@rango-dev/provider-ledger 0.20.1-next.1 → 0.21.1-next.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.
Files changed (37) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/{TransportWebHID-JLT4ETY3.js → TransportWebHID-HV53OYSS.js} +2 -2
  3. package/dist/chunk-L3UWJBD6.js +2 -0
  4. package/dist/chunk-L3UWJBD6.js.map +7 -0
  5. package/dist/constants.d.ts +6 -0
  6. package/dist/{ethereum-NIQRUD6P.js → ethereum-4K63WN6K.js} +2 -2
  7. package/dist/ethereum-4K63WN6K.js.map +7 -0
  8. package/dist/{index.d.ts → legacy/index.d.ts} +4 -2
  9. package/dist/mod.d.ts +2 -0
  10. package/dist/mod.js +2 -0
  11. package/dist/mod.js.map +7 -0
  12. package/dist/namespaces/evm.d.ts +3 -0
  13. package/dist/namespaces/solana.d.ts +3 -0
  14. package/dist/provider-ledger.build.json +1 -1
  15. package/dist/provider.d.ts +2 -0
  16. package/dist/solana-KIPRMAWD.js +2 -0
  17. package/dist/solana-KIPRMAWD.js.map +7 -0
  18. package/dist/{helpers.d.ts → utils.d.ts} +3 -2
  19. package/package.json +7 -7
  20. package/readme.md +16 -1
  21. package/src/constants.ts +91 -0
  22. package/src/{index.ts → legacy/index.ts} +15 -4
  23. package/src/mod.ts +12 -0
  24. package/src/namespaces/evm.ts +58 -0
  25. package/src/namespaces/solana.ts +50 -0
  26. package/src/provider.ts +22 -0
  27. package/src/signers/ethereum.ts +2 -2
  28. package/src/signers/solana.ts +2 -2
  29. package/src/{helpers.ts → utils.ts} +22 -16
  30. package/dist/chunk-PVLX7NBP.js +0 -2
  31. package/dist/chunk-PVLX7NBP.js.map +0 -7
  32. package/dist/ethereum-NIQRUD6P.js.map +0 -7
  33. package/dist/index.js +0 -2
  34. package/dist/index.js.map +0 -7
  35. package/dist/solana-CMBORE4C.js +0 -2
  36. package/dist/solana-CMBORE4C.js.map +0 -7
  37. /package/dist/{TransportWebHID-JLT4ETY3.js.map → TransportWebHID-HV53OYSS.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # [0.21.0](https://github.com/rango-exchange/rango-client/compare/provider-ledger@0.20.0...provider-ledger@0.21.0) (2025-09-06)
2
+
3
+
4
+
1
5
  # [0.20.0](https://github.com/rango-exchange/rango-client/compare/provider-ledger@0.19.0...provider-ledger@0.20.0) (2025-08-19)
2
6
 
3
7
 
@@ -1,2 +1,2 @@
1
- import{a as ye,b as ke}from"./chunk-5QSDSOWH.js";import{a as o,c as v,e as dn,g as Ye,h as We,i as Ee,j as Ke,k as b,l as ge,n as Ie}from"./chunk-CVKDPNYM.js";var W=v((Xo,ht)=>{var yn="2.0.0",Rn=Number.MAX_SAFE_INTEGER||9007199254740991,xn=16,Ln=250,Sn=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ht.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:xn,MAX_SAFE_BUILD_LENGTH:Ln,MAX_SAFE_INTEGER:Rn,RELEASE_TYPES:Sn,SEMVER_SPEC_VERSION:yn,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var K=v((Vo,ft)=>{var $n=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};ft.exports=$n});var B=v((P,pt)=>{var{MAX_SAFE_COMPONENT_LENGTH:Re,MAX_SAFE_BUILD_LENGTH:wn,MAX_LENGTH:Nn}=W(),Tn=K();P=pt.exports={};var On=P.re=[],An=P.safeRe=[],f=P.src=[],p=P.t={},bn=0,xe="[a-zA-Z0-9-]",qn=[["\\s",1],["\\d",Nn],[xe,wn]],Pn=o(t=>{for(let[e,r]of qn)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},"makeSafeRegex"),E=o((t,e,r)=>{let n=Pn(e),s=bn++;Tn(t,s,e),p[t]=s,f[s]=e,On[s]=new RegExp(e,r?"g":void 0),An[s]=new RegExp(n,r?"g":void 0)},"createToken");E("NUMERICIDENTIFIER","0|[1-9]\\d*");E("NUMERICIDENTIFIERLOOSE","\\d+");E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${xe}*`);E("MAINVERSION",`(${f[p.NUMERICIDENTIFIER]})\\.(${f[p.NUMERICIDENTIFIER]})\\.(${f[p.NUMERICIDENTIFIER]})`);E("MAINVERSIONLOOSE",`(${f[p.NUMERICIDENTIFIERLOOSE]})\\.(${f[p.NUMERICIDENTIFIERLOOSE]})\\.(${f[p.NUMERICIDENTIFIERLOOSE]})`);E("PRERELEASEIDENTIFIER",`(?:${f[p.NUMERICIDENTIFIER]}|${f[p.NONNUMERICIDENTIFIER]})`);E("PRERELEASEIDENTIFIERLOOSE",`(?:${f[p.NUMERICIDENTIFIERLOOSE]}|${f[p.NONNUMERICIDENTIFIER]})`);E("PRERELEASE",`(?:-(${f[p.PRERELEASEIDENTIFIER]}(?:\\.${f[p.PRERELEASEIDENTIFIER]})*))`);E("PRERELEASELOOSE",`(?:-?(${f[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${f[p.PRERELEASEIDENTIFIERLOOSE]})*))`);E("BUILDIDENTIFIER",`${xe}+`);E("BUILD",`(?:\\+(${f[p.BUILDIDENTIFIER]}(?:\\.${f[p.BUILDIDENTIFIER]})*))`);E("FULLPLAIN",`v?${f[p.MAINVERSION]}${f[p.PRERELEASE]}?${f[p.BUILD]}?`);E("FULL",`^${f[p.FULLPLAIN]}$`);E("LOOSEPLAIN",`[v=\\s]*${f[p.MAINVERSIONLOOSE]}${f[p.PRERELEASELOOSE]}?${f[p.BUILD]}?`);E("LOOSE",`^${f[p.LOOSEPLAIN]}$`);E("GTLT","((?:<|>)?=?)");E("XRANGEIDENTIFIERLOOSE",`${f[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);E("XRANGEIDENTIFIER",`${f[p.NUMERICIDENTIFIER]}|x|X|\\*`);E("XRANGEPLAIN",`[v=\\s]*(${f[p.XRANGEIDENTIFIER]})(?:\\.(${f[p.XRANGEIDENTIFIER]})(?:\\.(${f[p.XRANGEIDENTIFIER]})(?:${f[p.PRERELEASE]})?${f[p.BUILD]}?)?)?`);E("XRANGEPLAINLOOSE",`[v=\\s]*(${f[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[p.XRANGEIDENTIFIERLOOSE]})(?:${f[p.PRERELEASELOOSE]})?${f[p.BUILD]}?)?)?`);E("XRANGE",`^${f[p.GTLT]}\\s*${f[p.XRANGEPLAIN]}$`);E("XRANGELOOSE",`^${f[p.GTLT]}\\s*${f[p.XRANGEPLAINLOOSE]}$`);E("COERCE",`(^|[^\\d])(\\d{1,${Re}})(?:\\.(\\d{1,${Re}}))?(?:\\.(\\d{1,${Re}}))?(?:$|[^\\d])`);E("COERCERTL",f[p.COERCE],!0);E("LONETILDE","(?:~>?)");E("TILDETRIM",`(\\s*)${f[p.LONETILDE]}\\s+`,!0);P.tildeTrimReplace="$1~";E("TILDE",`^${f[p.LONETILDE]}${f[p.XRANGEPLAIN]}$`);E("TILDELOOSE",`^${f[p.LONETILDE]}${f[p.XRANGEPLAINLOOSE]}$`);E("LONECARET","(?:\\^)");E("CARETTRIM",`(\\s*)${f[p.LONECARET]}\\s+`,!0);P.caretTrimReplace="$1^";E("CARET",`^${f[p.LONECARET]}${f[p.XRANGEPLAIN]}$`);E("CARETLOOSE",`^${f[p.LONECARET]}${f[p.XRANGEPLAINLOOSE]}$`);E("COMPARATORLOOSE",`^${f[p.GTLT]}\\s*(${f[p.LOOSEPLAIN]})$|^$`);E("COMPARATOR",`^${f[p.GTLT]}\\s*(${f[p.FULLPLAIN]})$|^$`);E("COMPARATORTRIM",`(\\s*)${f[p.GTLT]}\\s*(${f[p.LOOSEPLAIN]}|${f[p.XRANGEPLAIN]})`,!0);P.comparatorTrimReplace="$1$2$3";E("HYPHENRANGE",`^\\s*(${f[p.XRANGEPLAIN]})\\s+-\\s+(${f[p.XRANGEPLAIN]})\\s*$`);E("HYPHENRANGELOOSE",`^\\s*(${f[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${f[p.XRANGEPLAINLOOSE]})\\s*$`);E("STAR","(<|>)?=?\\s*\\*");E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var ie=v((zo,dt)=>{var Cn=Object.freeze({loose:!0}),_n=Object.freeze({}),Dn=o(t=>t?typeof t!="object"?Cn:t:_n,"parseOptions");dt.exports=Dn});var Le=v((Wo,Et)=>{var mt=/^[0-9]+$/,vt=o((t,e)=>{let r=mt.test(t),n=mt.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},"compareIdentifiers"),Un=o((t,e)=>vt(e,t),"rcompareIdentifiers");Et.exports={compareIdentifiers:vt,rcompareIdentifiers:Un}});var S=v((ko,Rt)=>{var oe=K(),{MAX_LENGTH:gt,MAX_SAFE_INTEGER:ue}=W(),{safeRe:It,t:yt}=B(),Gn=ie(),{compareIdentifiers:X}=Le(),Se=class t{static{o(this,"SemVer")}constructor(e,r){if(r=Gn(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>gt)throw new TypeError(`version is longer than ${gt} characters`);oe("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?It[yt.LOOSE]:It[yt.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>ue||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ue||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ue||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let i=+s;if(i>=0&&i<ue)return i}return s}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(oe("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),X(this.major,e.major)||X(this.minor,e.minor)||X(this.patch,e.patch)}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],s=e.prerelease[r];if(oe("prerelease compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return X(n,s)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],s=e.build[r];if(oe("prerelease compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return X(n,s)}while(++r)}inc(e,r,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let s=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[s];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let i=[r,s];n===!1&&(i=[r]),X(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};Rt.exports=Se});var U=v((Jo,Lt)=>{var xt=S(),jn=o((t,e,r=!1)=>{if(t instanceof xt)return t;try{return new xt(t,e)}catch(n){if(!r)return null;throw n}},"parse");Lt.exports=jn});var $t=v((eu,St)=>{var Fn=U(),Mn=o((t,e)=>{let r=Fn(t,e);return r?r.version:null},"valid");St.exports=Mn});var Nt=v((ru,wt)=>{var Bn=U(),Xn=o((t,e)=>{let r=Bn(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null},"clean");wt.exports=Xn});var At=v((su,Ot)=>{var Tt=S(),Vn=o((t,e,r,n,s)=>{typeof r=="string"&&(s=n,n=r,r=void 0);try{return new Tt(t instanceof Tt?t.version:t,r).inc(e,n,s).version}catch{return null}},"inc");Ot.exports=Vn});var Pt=v((ou,qt)=>{var bt=U(),Hn=o((t,e)=>{let r=bt(t,null,!0),n=bt(e,null,!0),s=r.compare(n);if(s===0)return null;let i=s>0,u=i?r:n,a=i?n:r,c=!!u.prerelease.length;if(!!a.prerelease.length&&!c)return!a.patch&&!a.minor?"major":u.patch?"patch":u.minor?"minor":"major";let l=c?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"},"diff");qt.exports=Hn});var _t=v((au,Ct)=>{var zn=S(),Yn=o((t,e)=>new zn(t,e).major,"major");Ct.exports=Yn});var Ut=v((lu,Dt)=>{var Wn=S(),Kn=o((t,e)=>new Wn(t,e).minor,"minor");Dt.exports=Kn});var jt=v((fu,Gt)=>{var kn=S(),Zn=o((t,e)=>new kn(t,e).patch,"patch");Gt.exports=Zn});var Mt=v((du,Ft)=>{var Jn=U(),Qn=o((t,e)=>{let r=Jn(t,e);return r&&r.prerelease.length?r.prerelease:null},"prerelease");Ft.exports=Qn});var O=v((vu,Xt)=>{var Bt=S(),es=o((t,e,r)=>new Bt(t,r).compare(new Bt(e,r)),"compare");Xt.exports=es});var Ht=v((gu,Vt)=>{var ts=O(),rs=o((t,e,r)=>ts(e,t,r),"rcompare");Vt.exports=rs});var Yt=v((yu,zt)=>{var ns=O(),ss=o((t,e)=>ns(t,e,!0),"compareLoose");zt.exports=ss});var ae=v((xu,Kt)=>{var Wt=S(),is=o((t,e,r)=>{let n=new Wt(t,r),s=new Wt(e,r);return n.compare(s)||n.compareBuild(s)},"compareBuild");Kt.exports=is});var Zt=v((Su,kt)=>{var os=ae(),us=o((t,e)=>t.sort((r,n)=>os(r,n,e)),"sort");kt.exports=us});var Qt=v((wu,Jt)=>{var as=ae(),cs=o((t,e)=>t.sort((r,n)=>as(n,r,e)),"rsort");Jt.exports=cs});var k=v((Tu,er)=>{var ls=O(),hs=o((t,e,r)=>ls(t,e,r)>0,"gt");er.exports=hs});var ce=v((Au,tr)=>{var fs=O(),ps=o((t,e,r)=>fs(t,e,r)<0,"lt");tr.exports=ps});var $e=v((qu,rr)=>{var ds=O(),ms=o((t,e,r)=>ds(t,e,r)===0,"eq");rr.exports=ms});var we=v((Cu,nr)=>{var vs=O(),Es=o((t,e,r)=>vs(t,e,r)!==0,"neq");nr.exports=Es});var le=v((Du,sr)=>{var gs=O(),Is=o((t,e,r)=>gs(t,e,r)>=0,"gte");sr.exports=Is});var he=v((Gu,ir)=>{var ys=O(),Rs=o((t,e,r)=>ys(t,e,r)<=0,"lte");ir.exports=Rs});var Ne=v((Fu,or)=>{var xs=$e(),Ls=we(),Ss=k(),$s=le(),ws=ce(),Ns=he(),Ts=o((t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return xs(t,r,n);case"!=":return Ls(t,r,n);case">":return Ss(t,r,n);case">=":return $s(t,r,n);case"<":return ws(t,r,n);case"<=":return Ns(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}},"cmp");or.exports=Ts});var ar=v((Bu,ur)=>{var Os=S(),As=U(),{safeRe:fe,t:pe}=B(),bs=o((t,e)=>{if(t instanceof Os)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(fe[pe.COERCE]);else{let n;for(;(n=fe[pe.COERCERTL].exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||n.index+n[0].length!==r.index+r[0].length)&&(r=n),fe[pe.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;fe[pe.COERCERTL].lastIndex=-1}return r===null?null:As(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,e)},"coerce");ur.exports=bs});var lr=v((Vu,cr)=>{"use strict";cr.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var fr=v((Hu,hr)=>{"use strict";hr.exports=g;g.Node=G;g.create=g;function g(t){var e=this;if(e instanceof g||(e=new g),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(s){e.push(s)});else if(arguments.length>0)for(var r=0,n=arguments.length;r<n;r++)e.push(arguments[r]);return e}o(g,"Yallist");g.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,r=t.prev;return e&&(e.prev=r),r&&(r.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=r),t.list.length--,t.next=null,t.prev=null,t.list=null,e};g.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}};g.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}};g.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)Ps(this,arguments[t]);return this.length};g.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)Cs(this,arguments[t]);return this.length};g.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}};g.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}};g.prototype.forEach=function(t,e){e=e||this;for(var r=this.head,n=0;r!==null;n++)t.call(e,r.value,n,this),r=r.next};g.prototype.forEachReverse=function(t,e){e=e||this;for(var r=this.tail,n=this.length-1;r!==null;n--)t.call(e,r.value,n,this),r=r.prev};g.prototype.get=function(t){for(var e=0,r=this.head;r!==null&&e<t;e++)r=r.next;if(e===t&&r!==null)return r.value};g.prototype.getReverse=function(t){for(var e=0,r=this.tail;r!==null&&e<t;e++)r=r.prev;if(e===t&&r!==null)return r.value};g.prototype.map=function(t,e){e=e||this;for(var r=new g,n=this.head;n!==null;)r.push(t.call(e,n.value,this)),n=n.next;return r};g.prototype.mapReverse=function(t,e){e=e||this;for(var r=new g,n=this.tail;n!==null;)r.push(t.call(e,n.value,this)),n=n.prev;return r};g.prototype.reduce=function(t,e){var r,n=this.head;if(arguments.length>1)r=e;else if(this.head)n=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=0;n!==null;s++)r=t(r,n.value,s),n=n.next;return r};g.prototype.reduceReverse=function(t,e){var r,n=this.tail;if(arguments.length>1)r=e;else if(this.tail)n=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=this.length-1;n!==null;s--)r=t(r,n.value,s),n=n.prev;return r};g.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t};g.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t};g.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new g;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var n=0,s=this.head;s!==null&&n<t;n++)s=s.next;for(;s!==null&&n<e;n++,s=s.next)r.push(s.value);return r};g.prototype.sliceReverse=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new g;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var n=this.length,s=this.tail;s!==null&&n>e;n--)s=s.prev;for(;s!==null&&n>t;n--,s=s.prev)r.push(s.value);return r};g.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,s=this.head;s!==null&&n<t;n++)s=s.next;for(var i=[],n=0;s&&n<e;n++)i.push(s.value),s=this.removeNode(s);s===null&&(s=this.tail),s!==this.head&&s!==this.tail&&(s=s.prev);for(var n=0;n<r.length;n++)s=qs(this,s,r[n]);return i};g.prototype.reverse=function(){for(var t=this.head,e=this.tail,r=t;r!==null;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=e,this.tail=t,this};function qs(t,e,r){var n=e===t.head?new G(r,null,e,t):new G(r,e,e.next,t);return n.next===null&&(t.tail=n),n.prev===null&&(t.head=n),t.length++,n}o(qs,"insert");function Ps(t,e){t.tail=new G(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}o(Ps,"push");function Cs(t,e){t.head=new G(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}o(Cs,"unshift");function G(t,e,r,n){if(!(this instanceof G))return new G(t,e,r,n);this.list=n,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}o(G,"Node");try{lr()(g)}catch{}});var Er=v((Yu,vr)=>{"use strict";var _s=fr(),j=Symbol("max"),_=Symbol("length"),V=Symbol("lengthCalculator"),J=Symbol("allowStale"),F=Symbol("maxAge"),C=Symbol("dispose"),pr=Symbol("noDisposeOnSet"),L=Symbol("lruList"),q=Symbol("cache"),mr=Symbol("updateAgeOnGet"),Te=o(()=>1,"naiveLength"),Ae=class{static{o(this,"LRUCache")}constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");let r=this[j]=e.max||1/0,n=e.length||Te;if(this[V]=typeof n!="function"?Te:n,this[J]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[F]=e.maxAge||0,this[C]=e.dispose,this[pr]=e.noDisposeOnSet||!1,this[mr]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[j]=e||1/0,Z(this)}get max(){return this[j]}set allowStale(e){this[J]=!!e}get allowStale(){return this[J]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[F]=e,Z(this)}get maxAge(){return this[F]}set lengthCalculator(e){typeof e!="function"&&(e=Te),e!==this[V]&&(this[V]=e,this[_]=0,this[L].forEach(r=>{r.length=this[V](r.value,r.key),this[_]+=r.length})),Z(this)}get lengthCalculator(){return this[V]}get length(){return this[_]}get itemCount(){return this[L].length}rforEach(e,r){r=r||this;for(let n=this[L].tail;n!==null;){let s=n.prev;dr(this,e,n,r),n=s}}forEach(e,r){r=r||this;for(let n=this[L].head;n!==null;){let s=n.next;dr(this,e,n,r),n=s}}keys(){return this[L].toArray().map(e=>e.key)}values(){return this[L].toArray().map(e=>e.value)}reset(){this[C]&&this[L]&&this[L].length&&this[L].forEach(e=>this[C](e.key,e.value)),this[q]=new Map,this[L]=new _s,this[_]=0}dump(){return this[L].map(e=>de(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[L]}set(e,r,n){if(n=n||this[F],n&&typeof n!="number")throw new TypeError("maxAge must be a number");let s=n?Date.now():0,i=this[V](r,e);if(this[q].has(e)){if(i>this[j])return H(this,this[q].get(e)),!1;let c=this[q].get(e).value;return this[C]&&(this[pr]||this[C](e,c.value)),c.now=s,c.maxAge=n,c.value=r,this[_]+=i-c.length,c.length=i,this.get(e),Z(this),!0}let u=new be(e,r,i,s,n);return u.length>this[j]?(this[C]&&this[C](e,r),!1):(this[_]+=u.length,this[L].unshift(u),this[q].set(e,this[L].head),Z(this),!0)}has(e){if(!this[q].has(e))return!1;let r=this[q].get(e).value;return!de(this,r)}get(e){return Oe(this,e,!0)}peek(e){return Oe(this,e,!1)}pop(){let e=this[L].tail;return e?(H(this,e),e.value):null}del(e){H(this,this[q].get(e))}load(e){this.reset();let r=Date.now();for(let n=e.length-1;n>=0;n--){let s=e[n],i=s.e||0;if(i===0)this.set(s.k,s.v);else{let u=i-r;u>0&&this.set(s.k,s.v,u)}}}prune(){this[q].forEach((e,r)=>Oe(this,r,!1))}},Oe=o((t,e,r)=>{let n=t[q].get(e);if(n){let s=n.value;if(de(t,s)){if(H(t,n),!t[J])return}else r&&(t[mr]&&(n.value.now=Date.now()),t[L].unshiftNode(n));return s.value}},"get"),de=o((t,e)=>{if(!e||!e.maxAge&&!t[F])return!1;let r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[F]&&r>t[F]},"isStale"),Z=o(t=>{if(t[_]>t[j])for(let e=t[L].tail;t[_]>t[j]&&e!==null;){let r=e.prev;H(t,e),e=r}},"trim"),H=o((t,e)=>{if(e){let r=e.value;t[C]&&t[C](r.key,r.value),t[_]-=r.length,t[q].delete(r.key),t[L].removeNode(e)}},"del"),be=class{static{o(this,"Entry")}constructor(e,r,n,s,i){this.key=e,this.value=r,this.length=n,this.now=s,this.maxAge=i||0}},dr=o((t,e,r,n)=>{let s=r.value;de(t,s)&&(H(t,r),t[J]||(s=void 0)),s&&e.call(n,s.value,s.key,t)},"forEachStep");vr.exports=Ae});var A=v((Ku,Rr)=>{var qe=class t{static{o(this,"Range")}constructor(e,r){if(r=Us(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof Pe)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(s=>!Ir(s[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&Vs(s[0])){this.set=[s];break}}}this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){let n=((this.options.includePrerelease&&Bs)|(this.options.loose&&Xs))+":"+e,s=gr.get(n);if(s)return s;let i=this.options.loose,u=i?T[w.HYPHENRANGELOOSE]:T[w.HYPHENRANGE];e=e.replace(u,ei(this.options.includePrerelease)),R("hyphen replace",e),e=e.replace(T[w.COMPARATORTRIM],js),R("comparator trim",e),e=e.replace(T[w.TILDETRIM],Fs),R("tilde trim",e),e=e.replace(T[w.CARETTRIM],Ms),R("caret trim",e);let a=e.split(" ").map(d=>Hs(d,this.options)).join(" ").split(/\s+/).map(d=>Qs(d,this.options));i&&(a=a.filter(d=>(R("loose invalid filter",d,this.options),!!d.match(T[w.COMPARATORLOOSE])))),R("range list",a);let c=new Map,h=a.map(d=>new Pe(d,this.options));for(let d of h){if(Ir(d))return[d];c.set(d.value,d)}c.size>1&&c.has("")&&c.delete("");let l=[...c.values()];return gr.set(n,l),l}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>yr(n,r)&&e.set.some(s=>yr(s,r)&&n.every(i=>s.every(u=>i.intersects(u,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Gs(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(ti(this.set[r],e,this.options))return!0;return!1}};Rr.exports=qe;var Ds=Er(),gr=new Ds({max:1e3}),Us=ie(),Pe=Q(),R=K(),Gs=S(),{safeRe:T,t:w,comparatorTrimReplace:js,tildeTrimReplace:Fs,caretTrimReplace:Ms}=B(),{FLAG_INCLUDE_PRERELEASE:Bs,FLAG_LOOSE:Xs}=W(),Ir=o(t=>t.value==="<0.0.0-0","isNullSet"),Vs=o(t=>t.value==="","isAny"),yr=o((t,e)=>{let r=!0,n=t.slice(),s=n.pop();for(;r&&n.length;)r=n.every(i=>s.intersects(i,e)),s=n.pop();return r},"isSatisfiable"),Hs=o((t,e)=>(R("comp",t,e),t=Ws(t,e),R("caret",t),t=zs(t,e),R("tildes",t),t=ks(t,e),R("xrange",t),t=Js(t,e),R("stars",t),t),"parseComparator"),N=o(t=>!t||t.toLowerCase()==="x"||t==="*","isX"),zs=o((t,e)=>t.trim().split(/\s+/).map(r=>Ys(r,e)).join(" "),"replaceTildes"),Ys=o((t,e)=>{let r=e.loose?T[w.TILDELOOSE]:T[w.TILDE];return t.replace(r,(n,s,i,u,a)=>{R("tilde",t,n,s,i,u,a);let c;return N(s)?c="":N(i)?c=`>=${s}.0.0 <${+s+1}.0.0-0`:N(u)?c=`>=${s}.${i}.0 <${s}.${+i+1}.0-0`:a?(R("replaceTilde pr",a),c=`>=${s}.${i}.${u}-${a} <${s}.${+i+1}.0-0`):c=`>=${s}.${i}.${u} <${s}.${+i+1}.0-0`,R("tilde return",c),c})},"replaceTilde"),Ws=o((t,e)=>t.trim().split(/\s+/).map(r=>Ks(r,e)).join(" "),"replaceCarets"),Ks=o((t,e)=>{R("caret",t,e);let r=e.loose?T[w.CARETLOOSE]:T[w.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(s,i,u,a,c)=>{R("caret",t,s,i,u,a,c);let h;return N(i)?h="":N(u)?h=`>=${i}.0.0${n} <${+i+1}.0.0-0`:N(a)?i==="0"?h=`>=${i}.${u}.0${n} <${i}.${+u+1}.0-0`:h=`>=${i}.${u}.0${n} <${+i+1}.0.0-0`:c?(R("replaceCaret pr",c),i==="0"?u==="0"?h=`>=${i}.${u}.${a}-${c} <${i}.${u}.${+a+1}-0`:h=`>=${i}.${u}.${a}-${c} <${i}.${+u+1}.0-0`:h=`>=${i}.${u}.${a}-${c} <${+i+1}.0.0-0`):(R("no pr"),i==="0"?u==="0"?h=`>=${i}.${u}.${a}${n} <${i}.${u}.${+a+1}-0`:h=`>=${i}.${u}.${a}${n} <${i}.${+u+1}.0-0`:h=`>=${i}.${u}.${a} <${+i+1}.0.0-0`),R("caret return",h),h})},"replaceCaret"),ks=o((t,e)=>(R("replaceXRanges",t,e),t.split(/\s+/).map(r=>Zs(r,e)).join(" ")),"replaceXRanges"),Zs=o((t,e)=>{t=t.trim();let r=e.loose?T[w.XRANGELOOSE]:T[w.XRANGE];return t.replace(r,(n,s,i,u,a,c)=>{R("xRange",t,n,s,i,u,a,c);let h=N(i),l=h||N(u),d=l||N(a),y=d;return s==="="&&y&&(s=""),c=e.includePrerelease?"-0":"",h?s===">"||s==="<"?n="<0.0.0-0":n="*":s&&y?(l&&(u=0),a=0,s===">"?(s=">=",l?(i=+i+1,u=0,a=0):(u=+u+1,a=0)):s==="<="&&(s="<",l?i=+i+1:u=+u+1),s==="<"&&(c="-0"),n=`${s+i}.${u}.${a}${c}`):l?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${u}.0${c} <${i}.${+u+1}.0-0`),R("xRange return",n),n})},"replaceXRange"),Js=o((t,e)=>(R("replaceStars",t,e),t.trim().replace(T[w.STAR],"")),"replaceStars"),Qs=o((t,e)=>(R("replaceGTE0",t,e),t.trim().replace(T[e.includePrerelease?w.GTE0PRE:w.GTE0],"")),"replaceGTE0"),ei=o(t=>(e,r,n,s,i,u,a,c,h,l,d,y,m)=>(N(n)?r="":N(s)?r=`>=${n}.0.0${t?"-0":""}`:N(i)?r=`>=${n}.${s}.0${t?"-0":""}`:u?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,N(h)?c="":N(l)?c=`<${+h+1}.0.0-0`:N(d)?c=`<${h}.${+l+1}.0-0`:y?c=`<=${h}.${l}.${d}-${y}`:t?c=`<${h}.${l}.${+d+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),"hyphenReplace"),ti=o((t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if(R(t[n].semver),t[n].semver!==Pe.ANY&&t[n].semver.prerelease.length>0){let s=t[n].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0},"testSet")});var Q=v((Zu,Nr)=>{var ee=Symbol("SemVer ANY"),De=class t{static{o(this,"Comparator")}static get ANY(){return ee}constructor(e,r){if(r=xr(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),_e("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===ee?this.value="":this.value=this.operator+this.semver.version,_e("comp",this)}parse(e){let r=this.options.loose?Lr[Sr.COMPARATORLOOSE]:Lr[Sr.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new $r(n[2],this.options.loose):this.semver=ee}toString(){return this.value}test(e){if(_e("Comparator.test",e,this.options.loose),this.semver===ee||e===ee)return!0;if(typeof e=="string")try{e=new $r(e,this.options)}catch{return!1}return Ce(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new wr(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new wr(this.value,r).test(e.semver):(r=xr(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Ce(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Ce(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Nr.exports=De;var xr=ie(),{safeRe:Lr,t:Sr}=B(),Ce=Ne(),_e=K(),$r=S(),wr=A()});var te=v((Qu,Tr)=>{var ri=A(),ni=o((t,e,r)=>{try{e=new ri(e,r)}catch{return!1}return e.test(t)},"satisfies");Tr.exports=ni});var Ar=v((ta,Or)=>{var si=A(),ii=o((t,e)=>new si(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" ")),"toComparators");Or.exports=ii});var qr=v((na,br)=>{var oi=S(),ui=A(),ai=o((t,e,r)=>{let n=null,s=null,i=null;try{i=new ui(e,r)}catch{return null}return t.forEach(u=>{i.test(u)&&(!n||s.compare(u)===-1)&&(n=u,s=new oi(n,r))}),n},"maxSatisfying");br.exports=ai});var Cr=v((ia,Pr)=>{var ci=S(),li=A(),hi=o((t,e,r)=>{let n=null,s=null,i=null;try{i=new li(e,r)}catch{return null}return t.forEach(u=>{i.test(u)&&(!n||s.compare(u)===1)&&(n=u,s=new ci(n,r))}),n},"minSatisfying");Pr.exports=hi});var Ur=v((ua,Dr)=>{var Ue=S(),fi=A(),_r=k(),pi=o((t,e)=>{t=new fi(t,e);let r=new Ue("0.0.0");if(t.test(r)||(r=new Ue("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){let s=t.set[n],i=null;s.forEach(u=>{let a=new Ue(u.semver.version);switch(u.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!i||_r(a,i))&&(i=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${u.operator}`)}}),i&&(!r||_r(r,i))&&(r=i)}return r&&t.test(r)?r:null},"minVersion");Dr.exports=pi});var jr=v((ca,Gr)=>{var di=A(),mi=o((t,e)=>{try{return new di(t,e).range||"*"}catch{return null}},"validRange");Gr.exports=mi});var me=v((ha,Xr)=>{var vi=S(),Br=Q(),{ANY:Ei}=Br,gi=A(),Ii=te(),Fr=k(),Mr=ce(),yi=he(),Ri=le(),xi=o((t,e,r,n)=>{t=new vi(t,n),e=new gi(e,n);let s,i,u,a,c;switch(r){case">":s=Fr,i=yi,u=Mr,a=">",c=">=";break;case"<":s=Mr,i=Ri,u=Fr,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Ii(t,e,n))return!1;for(let h=0;h<e.set.length;++h){let l=e.set[h],d=null,y=null;if(l.forEach(m=>{m.semver===Ei&&(m=new Br(">=0.0.0")),d=d||m,y=y||m,s(m.semver,d.semver,n)?d=m:u(m.semver,y.semver,n)&&(y=m)}),d.operator===a||d.operator===c||(!y.operator||y.operator===a)&&i(t,y.semver))return!1;if(y.operator===c&&u(t,y.semver))return!1}return!0},"outside");Xr.exports=xi});var Hr=v((pa,Vr)=>{var Li=me(),Si=o((t,e,r)=>Li(t,e,">",r),"gtr");Vr.exports=Si});var Yr=v((ma,zr)=>{var $i=me(),wi=o((t,e,r)=>$i(t,e,"<",r),"ltr");zr.exports=wi});var kr=v((Ea,Kr)=>{var Wr=A(),Ni=o((t,e,r)=>(t=new Wr(t,r),e=new Wr(e,r),t.intersects(e,r)),"intersects");Kr.exports=Ni});var Jr=v((Ia,Zr)=>{var Ti=te(),Oi=O();Zr.exports=(t,e,r)=>{let n=[],s=null,i=null,u=t.sort((l,d)=>Oi(l,d,r));for(let l of u)Ti(l,e,r)?(i=l,s||(s=l)):(i&&n.push([s,i]),i=null,s=null);s&&n.push([s,null]);let a=[];for(let[l,d]of n)l===d?a.push(l):!d&&l===u[0]?a.push("*"):d?l===u[0]?a.push(`<=${d}`):a.push(`${l} - ${d}`):a.push(`>=${l}`);let c=a.join(" || "),h=typeof e.raw=="string"?e.raw:String(e);return c.length<h.length?c:e}});var sn=v((ya,nn)=>{var Qr=A(),je=Q(),{ANY:Ge}=je,re=te(),Fe=O(),Ai=o((t,e,r={})=>{if(t===e)return!0;t=new Qr(t,r),e=new Qr(e,r);let n=!1;e:for(let s of t.set){for(let i of e.set){let u=qi(s,i,r);if(n=n||u!==null,u)continue e}if(n)return!1}return!0},"subset"),bi=[new je(">=0.0.0-0")],en=[new je(">=0.0.0")],qi=o((t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Ge){if(e.length===1&&e[0].semver===Ge)return!0;r.includePrerelease?t=bi:t=en}if(e.length===1&&e[0].semver===Ge){if(r.includePrerelease)return!0;e=en}let n=new Set,s,i;for(let m of t)m.operator===">"||m.operator===">="?s=tn(s,m,r):m.operator==="<"||m.operator==="<="?i=rn(i,m,r):n.add(m.semver);if(n.size>1)return null;let u;if(s&&i){if(u=Fe(s.semver,i.semver,r),u>0)return null;if(u===0&&(s.operator!==">="||i.operator!=="<="))return null}for(let m of n){if(s&&!re(m,String(s),r)||i&&!re(m,String(i),r))return null;for(let pn of e)if(!re(m,String(pn),r))return!1;return!0}let a,c,h,l,d=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1,y=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;d&&d.prerelease.length===1&&i.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let m of e){if(l=l||m.operator===">"||m.operator===">=",h=h||m.operator==="<"||m.operator==="<=",s){if(y&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===y.major&&m.semver.minor===y.minor&&m.semver.patch===y.patch&&(y=!1),m.operator===">"||m.operator===">="){if(a=tn(s,m,r),a===m&&a!==s)return!1}else if(s.operator===">="&&!re(s.semver,String(m),r))return!1}if(i){if(d&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===d.major&&m.semver.minor===d.minor&&m.semver.patch===d.patch&&(d=!1),m.operator==="<"||m.operator==="<="){if(c=rn(i,m,r),c===m&&c!==i)return!1}else if(i.operator==="<="&&!re(i.semver,String(m),r))return!1}if(!m.operator&&(i||s)&&u!==0)return!1}return!(s&&h&&!i&&u!==0||i&&l&&!s&&u!==0||y||d)},"simpleSubset"),tn=o((t,e,r)=>{if(!t)return e;let n=Fe(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},"higherGT"),rn=o((t,e,r)=>{if(!t)return e;let n=Fe(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t},"lowerLT");nn.exports=Ai});var cn=v((xa,an)=>{var Me=B(),on=W(),Pi=S(),un=Le(),Ci=U(),_i=$t(),Di=Nt(),Ui=At(),Gi=Pt(),ji=_t(),Fi=Ut(),Mi=jt(),Bi=Mt(),Xi=O(),Vi=Ht(),Hi=Yt(),zi=ae(),Yi=Zt(),Wi=Qt(),Ki=k(),ki=ce(),Zi=$e(),Ji=we(),Qi=le(),eo=he(),to=Ne(),ro=ar(),no=Q(),so=A(),io=te(),oo=Ar(),uo=qr(),ao=Cr(),co=Ur(),lo=jr(),ho=me(),fo=Hr(),po=Yr(),mo=kr(),vo=Jr(),Eo=sn();an.exports={parse:Ci,valid:_i,clean:Di,inc:Ui,diff:Gi,major:ji,minor:Fi,patch:Mi,prerelease:Bi,compare:Xi,rcompare:Vi,compareLoose:Hi,compareBuild:zi,sort:Yi,rsort:Wi,gt:Ki,lt:ki,eq:Zi,neq:Ji,gte:Qi,lte:eo,cmp:to,coerce:ro,Comparator:no,Range:so,satisfies:io,toComparators:oo,maxSatisfying:uo,minSatisfying:ao,minVersion:co,validRange:lo,outside:ho,gtr:fo,ltr:po,intersects:mo,simplifyRange:vo,subset:Eo,SemVer:Pi,re:Me.re,src:Me.src,tokens:Me.t,SEMVER_SPEC_VERSION:on.SEMVER_SPEC_VERSION,RELEASE_TYPES:on.RELEASE_TYPES,compareIdentifiers:un.compareIdentifiers,rcompareIdentifiers:un.rcompareIdentifiers}});var st,it,M=typeof Reflect=="object"?Reflect:null,Ze=M&&typeof M.apply=="function"?M.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};it=M&&typeof M.ownKeys=="function"?M.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var Je=Number.isNaN||function(t){return t!=t};function I(){I.init.call(this)}o(I,"o");st=I,I.EventEmitter=I,I.prototype._events=void 0,I.prototype._eventsCount=0,I.prototype._maxListeners=void 0;var Qe=10;function ne(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}o(ne,"u");function ot(t){return t._maxListeners===void 0?I.defaultMaxListeners:t._maxListeners}o(ot,"f");function et(t,e,r,n){var s,i,u,a;if(ne(r),(i=t._events)===void 0?(i=t._events=Object.create(null),t._eventsCount=0):(i.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),i=t._events),u=i[e]),u===void 0)u=i[e]=r,++t._eventsCount;else if(typeof u=="function"?u=i[e]=n?[r,u]:[u,r]:n?u.unshift(r):u.push(r),(s=ot(t))>0&&u.length>s&&!u.warned){u.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+u.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=u.length,a=c,console&&console.warn&&console.warn(a)}return t}o(et,"v");function mn(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}o(mn,"a");function tt(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},s=mn.bind(n);return s.listener=r,n.wrapFn=s,s}o(tt,"l");function rt(t,e,r){var n=t._events;if(n===void 0)return[];var s=n[e];return s===void 0?[]:typeof s=="function"?r?[s.listener||s]:[s]:r?function(i){for(var u=new Array(i.length),a=0;a<u.length;++a)u[a]=i[a].listener||i[a];return u}(s):ut(s,s.length)}o(rt,"h");function nt(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}o(nt,"p");function ut(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}o(ut,"c");Object.defineProperty(I,"defaultMaxListeners",{enumerable:!0,get:function(){return Qe},set:function(t){if(typeof t!="number"||t<0||Je(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Qe=t}}),I.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},I.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||Je(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},I.prototype.getMaxListeners=function(){return ot(this)},I.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n=t==="error",s=this._events;if(s!==void 0)n=n&&s.error===void 0;else if(!n)return!1;if(n){var i;if(e.length>0&&(i=e[0]),i instanceof Error)throw i;var u=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw u.context=i,u}var a=s[t];if(a===void 0)return!1;if(typeof a=="function")Ze(a,this,e);else{var c=a.length,h=ut(a,c);for(r=0;r<c;++r)Ze(h[r],this,e)}return!0},I.prototype.addListener=function(t,e){return et(this,t,e,!1)},I.prototype.on=I.prototype.addListener,I.prototype.prependListener=function(t,e){return et(this,t,e,!0)},I.prototype.once=function(t,e){return ne(e),this.on(t,tt(this,t,e)),this},I.prototype.prependOnceListener=function(t,e){return ne(e),this.prependListener(t,tt(this,t,e)),this},I.prototype.removeListener=function(t,e){var r,n,s,i,u;if(ne(e),(n=this._events)===void 0)return this;if((r=n[t])===void 0)return this;if(r===e||r.listener===e)--this._eventsCount==0?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if(typeof r!="function"){for(s=-1,i=r.length-1;i>=0;i--)if(r[i]===e||r[i].listener===e){u=r[i].listener,s=i;break}if(s<0)return this;s===0?r.shift():function(a,c){for(;c+1<a.length;c++)a[c]=a[c+1];a.pop()}(r,s),r.length===1&&(n[t]=r[0]),n.removeListener!==void 0&&this.emit("removeListener",t,u||e)}return this},I.prototype.off=I.prototype.removeListener,I.prototype.removeAllListeners=function(t){var e,r,n;if((r=this._events)===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var s,i=Object.keys(r);for(n=0;n<i.length;++n)(s=i[n])!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(e=r[t])=="function")this.removeListener(t,e);else if(e!==void 0)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},I.prototype.listeners=function(t){return rt(this,t,!0)},I.prototype.rawListeners=function(t){return rt(this,t,!1)},I.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):nt.call(t,e)},I.prototype.listenerCount=nt,I.prototype.eventNames=function(){return this._eventsCount>0?it(this._events):[]};var $=st;$.EventEmitter;$.defaultMaxListeners;$.init;$.listenerCount;$.EventEmitter;$.defaultMaxListeners;$.init;$.listenerCount;$.once=function(t,e){return new Promise((r,n)=>{function s(...u){i!==void 0&&t.removeListener("error",i),r(u)}o(s,"eventListener");let i;e!=="error"&&(i=o(u=>{t.removeListener(name,s),n(u)},"errorListener"),t.once("error",i)),t.once(e,s)})};$.on=function(t,e){let r=[],n=[],s=null,i=!1,u={async next(){let h=r.shift();if(h)return createIterResult(h,!1);if(s){let l=Promise.reject(s);return s=null,l}return i?createIterResult(void 0,!0):new Promise((l,d)=>n.push({resolve:l,reject:d}))},async return(){t.removeListener(e,a),t.removeListener("error",c),i=!0;for(let h of n)h.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(h){s=h,t.removeListener(e,a),t.removeListener("error",c)},[Symbol.asyncIterator](){return this}};return t.on(e,a),t.on("error",c),u;function a(...h){let l=n.shift();l?l.resolve(createIterResult(h,!1)):r.push(h)}o(a,"eventHandler");function c(h){i=!0;let l=n.shift();l?l.reject(h):s=h,u.return()}o(c,"errorHandler")};var{EventEmitter:$o,defaultMaxListeners:wo,init:No,listenerCount:To,on:Oo,once:Ao}=$;var se=function(t,e,r,n){function s(i){return i instanceof r?i:new r(function(u){u(i)})}return o(s,"adopt"),new(r||(r=Promise))(function(i,u){function a(l){try{h(n.next(l))}catch(d){u(d)}}o(a,"fulfilled");function c(l){try{h(n.throw(l))}catch(d){u(d)}}o(c,"rejected");function h(l){l.done?i(l.value):s(l.value).then(a,c)}o(h,"step"),h((n=n.apply(t,e||[])).next())})};var vn="transport",Y=class{static{o(this,"Transport")}constructor({context:e,logType:r}={}){this.exchangeTimeout=3e4,this.unresponsiveTimeout=15e3,this.deviceModel=null,this._events=new $,this.send=(n,s,i,u,a=Buffer.alloc(0),c=[ge.OK],{abortTimeoutMs:h}={})=>se(this,void 0,void 0,function*(){let l=this.tracer.withUpdatedContext({function:"send"});if(a.length>=256)throw l.trace("data.length exceeded 256 bytes limit",{dataLength:a.length}),new b("data.length exceed 256 bytes limit. Got: "+a.length,"DataLengthTooBig");l.trace("Starting an exchange",{abortTimeoutMs:h});let d=yield this.exchange(Buffer.concat([Buffer.from([n,s,i,u]),Buffer.from([a.length]),a]),{abortTimeoutMs:h});l.trace("Received response from exchange");let y=d.readUInt16BE(d.length-2);if(!c.some(m=>m===y))throw new Ie(y);return d}),this._appAPIlock=null,this.tracer=new ke(r??vn,e)}exchange(e,{abortTimeoutMs:r}={}){throw new Error("exchange not implemented")}exchangeBulk(e,r){let n=!1,s=o(()=>{n=!0},"unsubscribe");return o(()=>se(this,void 0,void 0,function*(){if(!n)for(let u of e){let a=yield this.exchange(u);if(n)return;let c=a.readUInt16BE(a.length-2);if(c!==ge.OK)throw new Ie(c);r.next(a)}}),"main")().then(()=>!n&&r.complete(),u=>!n&&r.error(u)),{unsubscribe:s}}setScrambleKey(e){}close(){return Promise.resolve()}on(e,r){this._events.on(e,r)}off(e,r){this._events.removeListener(e,r)}emit(e,...r){this._events.emit(e,...r)}setDebugMode(){console.warn("setDebugMode is deprecated. use @ledgerhq/logs instead. No logs are emitted in this anymore.")}setExchangeTimeout(e){this.exchangeTimeout=e}setExchangeUnresponsiveTimeout(e){this.unresponsiveTimeout=e}static create(e=3e3,r){return new Promise((n,s)=>{let i=!1,u=this.listen({next:c=>{i=!0,u&&u.unsubscribe(),a&&clearTimeout(a),this.open(c.descriptor,e).then(n,s)},error:c=>{a&&clearTimeout(a),s(c)},complete:()=>{a&&clearTimeout(a),i||s(new b(this.ErrorMessage_NoDeviceFound,"NoDeviceFound"))}}),a=r?setTimeout(()=>{u.unsubscribe(),s(new b(this.ErrorMessage_ListenTimeout,"ListenTimeout"))},r):null})}exchangeAtomicImpl(e){return se(this,void 0,void 0,function*(){let r=this.tracer.withUpdatedContext({function:"exchangeAtomicImpl",unresponsiveTimeout:this.unresponsiveTimeout});if(this.exchangeBusyPromise)throw r.trace("Atomic exchange is already busy"),new Ke("An action was already pending on the Ledger device. Please deny or reconnect.");let n,s=new Promise(a=>{n=a});this.exchangeBusyPromise=s;let i=!1,u=setTimeout(()=>{r.trace('Timeout reached, emitting Transport event "unresponsive"',{unresponsiveTimeout:this.unresponsiveTimeout}),i=!0,this.emit("unresponsive")},this.unresponsiveTimeout);try{let a=yield e();return i&&(r.trace("Device was unresponsive, emitting responsive"),this.emit("responsive")),a}finally{r.trace("Finalize, clearing busy guard"),clearTimeout(u),n&&n(),this.exchangeBusyPromise=null}})}decorateAppAPIMethods(e,r,n){for(let s of r)e[s]=this.decorateAppAPIMethod(s,e[s],e,n)}decorateAppAPIMethod(e,r,n,s){return(...i)=>se(this,void 0,void 0,function*(){let{_appAPIlock:u}=this;if(u)return Promise.reject(new b("Ledger Device is busy (lock "+u+")","TransportLocked"));try{return this._appAPIlock=e,this.setScrambleKey(s),yield r.apply(n,i)}finally{this._appAPIlock=null}})}setTraceContext(e){this.tracer=this.tracer.withContext(e)}updateTraceContext(e){this.tracer.updateContext(e)}getTraceContext(){return this.tracer.getContext()}};Y.ErrorMessage_ListenTimeout="No Ledger device found (timeout)";Y.ErrorMessage_NoDeviceFound="No Ledger device found";var at=Y;var ct=5;function En(t){let e=Buffer.alloc(2);return e.writeUInt16BE(t,0),e}o(En,"asUInt16BE");var gn={data:Buffer.alloc(0),dataLength:0,sequence:0},In=o((t,e)=>({makeBlocks(r){let n=Buffer.concat([En(r.length),r]),s=e-5,i=Math.ceil(n.length/s);n=Buffer.concat([n,Buffer.alloc(i*s-n.length+1).fill(0)]);let u=[];for(let a=0;a<i;a++){let c=Buffer.alloc(5);c.writeUInt16BE(t,0),c.writeUInt8(ct,2),c.writeUInt16BE(a,3);let h=n.slice(a*s,(a+1)*s);u.push(Buffer.concat([c,h]))}return u},reduceResponse(r,n){let{data:s,dataLength:i,sequence:u}=r||gn;if(n.readUInt16BE(0)!==t)throw new b("Invalid channel","InvalidChannel");if(n.readUInt8(2)!==ct)throw new b("Invalid tag","InvalidTag");if(n.readUInt16BE(3)!==u)throw new b("Invalid sequence","InvalidSequence");r||(i=n.readUInt16BE(5)),u++;let a=n.slice(r?5:7);return s=Buffer.concat([s,a]),s.length>i&&(s=s.slice(0,i)),{data:s,dataLength:i,sequence:u}},getReducedResult(r){if(r&&r.dataLength===r.data.length)return r.data}}),"createHIDframing"),lt=In;var Be=dn(cn());var x;(function(t){t.blue="blue",t.nanoS="nanoS",t.nanoSP="nanoSP",t.nanoX="nanoX",t.stax="stax",t.europa="europa"})(x||(x={}));var Xe={[x.blue]:{id:x.blue,productName:"Ledger\xA0Blue",productIdMM:0,legacyUsbProductId:0,usbOnly:!0,memorySize:480*1024,masks:[822083584,822149120],getBlockSize:t=>4*1024},[x.nanoS]:{id:x.nanoS,productName:"Ledger\xA0Nano\xA0S",productIdMM:16,legacyUsbProductId:1,usbOnly:!0,memorySize:320*1024,masks:[823132160],getBlockSize:t=>{var e;return Be.default.lt((e=Be.default.coerce(t))!==null&&e!==void 0?e:"","2.0.0")?4*1024:2*1024}},[x.nanoX]:{id:x.nanoX,productName:"Ledger\xA0Nano\xA0X",productIdMM:64,legacyUsbProductId:4,usbOnly:!1,memorySize:2*1024*1024,masks:[855638016],getBlockSize:t=>4*1024,bluetoothSpec:[{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",notifyUuid:"13d63400-2c97-0004-0001-4c6564676572",writeUuid:"13d63400-2c97-0004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-0004-0003-4c6564676572"}]},[x.nanoSP]:{id:x.nanoSP,productName:"Ledger Nano S Plus",productIdMM:80,legacyUsbProductId:5,usbOnly:!0,memorySize:1533*1024,masks:[856686592],getBlockSize:t=>32},[x.stax]:{id:x.stax,productName:"Ledger\xA0Stax",productIdMM:96,legacyUsbProductId:6,usbOnly:!1,memorySize:1533*1024,masks:[857735168],getBlockSize:t=>32,bluetoothSpec:[{serviceUuid:"13d63400-2c97-6004-0000-4c6564676572",notifyUuid:"13d63400-2c97-6004-0001-4c6564676572",writeUuid:"13d63400-2c97-6004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-6004-0003-4c6564676572"}]},[x.europa]:{id:x.europa,productName:"Ledger Europa",productIdMM:112,legacyUsbProductId:7,usbOnly:!1,memorySize:1533*1024,masks:[858783744],getBlockSize:t=>32,bluetoothSpec:[{serviceUuid:"13d63400-2c97-3004-0000-4c6564676572",notifyUuid:"13d63400-2c97-3004-0001-4c6564676572",writeUuid:"13d63400-2c97-3004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-3004-0003-4c6564676572"}]}},La={Blue:x.blue,"Nano S":x.nanoS,"Nano S Plus":x.nanoSP,"Nano X":x.nanoX,Stax:x.stax,Europa:x.europa},ln=Object.values(Xe),Ve=11415;var He=o(t=>{let e=ln.find(s=>s.legacyUsbProductId===t);if(e)return e;let r=t>>8;return ln.find(s=>s.productIdMM===r)},"identifyUSBProductId");var go=[],hn={};for(let t in Xe){let e=Xe[t],{bluetoothSpec:r}=e;if(r)for(let n=0;n<r.length;n++){let s=r[n];go.push(s.serviceUuid),hn[s.serviceUuid]=hn[s.serviceUuid.replace(/-/g,"")]=Object.assign({deviceModel:e},s)}}var D=function(t,e,r,n){function s(i){return i instanceof r?i:new r(function(u){u(i)})}return o(s,"adopt"),new(r||(r=Promise))(function(i,u){function a(l){try{h(n.next(l))}catch(d){u(d)}}o(a,"fulfilled");function c(l){try{h(n.throw(l))}catch(d){u(d)}}o(c,"rejected");function h(l){l.done?i(l.value):s(l.value).then(a,c)}o(h,"step"),h((n=n.apply(t,e||[])).next())})},Io=[{vendorId:Ve}],yo=o(()=>Promise.resolve(!!(window.navigator&&window.navigator.hid)),"isSupported"),ve=o(()=>{let{hid:t}=navigator;if(!t)throw new b("navigator.hid is not supported","HIDNotSupported");return t},"getHID");function fn(){return D(this,void 0,void 0,function*(){let t=yield ve().requestDevice({filters:Io});return Array.isArray(t)?t:[t]})}o(fn,"requestLedgerDevices");function ze(){return D(this,void 0,void 0,function*(){return(yield ve().getDevices()).filter(e=>e.vendorId===Ve)})}o(ze,"getLedgerDevices");function Ro(){return D(this,void 0,void 0,function*(){let t=yield ze();return t.length>0?t[0]:(yield fn())[0]})}o(Ro,"getFirstLedgerDevice");var z=class t extends at{static{o(this,"TransportWebHID")}constructor(e){super(),this.channel=Math.floor(Math.random()*65535),this.packetSize=64,this.inputs=[],this.read=()=>this.inputs.length?Promise.resolve(this.inputs.shift()):new Promise(r=>{this.inputCallback=r}),this.onInputReport=r=>{let n=Buffer.from(r.data.buffer);this.inputCallback?(this.inputCallback(n),this.inputCallback=null):this.inputs.push(n)},this._disconnectEmitted=!1,this._emitDisconnect=r=>{this._disconnectEmitted||(this._disconnectEmitted=!0,this.emit("disconnect",r))},this.exchange=r=>D(this,void 0,void 0,function*(){return yield this.exchangeAtomicImpl(()=>D(this,void 0,void 0,function*(){let{channel:s,packetSize:i}=this;ye("apdu","=> "+r.toString("hex"));let u=lt(s,i),a=u.makeBlocks(r);for(let l=0;l<a.length;l++)yield this.device.sendReport(0,a[l]);let c,h;for(;!(c=u.getReducedResult(h));){let l=yield this.read();h=u.reduceResponse(h,l)}return ye("apdu","<= "+c.toString("hex")),c})).catch(s=>{throw s&&s.message&&s.message.includes("write")?(this._emitDisconnect(s),new We(s.message)):s})}),this.device=e,this.deviceModel=typeof e.productId=="number"?He(e.productId):void 0,e.addEventListener("inputreport",this.onInputReport)}static request(){return D(this,void 0,void 0,function*(){let[e]=yield fn();return t.open(e)})}static openConnected(){return D(this,void 0,void 0,function*(){let e=yield ze();return e.length===0?null:t.open(e[0])})}static open(e){return D(this,void 0,void 0,function*(){yield e.open();let r=new t(e),n=o(s=>{e===s.device&&(ve().removeEventListener("disconnect",n),r._emitDisconnect(new Ye))},"onDisconnect");return ve().addEventListener("disconnect",n),r})}close(){return D(this,void 0,void 0,function*(){yield this.exchangeBusyPromise,this.device.removeEventListener("inputreport",this.onInputReport),yield this.device.close()})}setScrambleKey(){}};z.isSupported=yo;z.list=ze;z.listen=t=>{let e=!1;Ro().then(n=>{if(!n)t.error(new Ee("Access denied to use Ledger device"));else if(!e){let s=typeof n.productId=="number"?He(n.productId):void 0;t.next({type:"add",descriptor:n,deviceModel:s}),t.complete()}},n=>{t.error(new Ee(n.message))});function r(){e=!0}return o(r,"unsubscribe"),{unsubscribe:r}};var ba=z;export{ba as default};
2
- //# sourceMappingURL=TransportWebHID-JLT4ETY3.js.map
1
+ import{a as Ee,b as Ye}from"./chunk-5QSDSOWH.js";import{a as o,c as v,e as dn,g as We,h as Ke,i as ge,j as ke,k as b,l as Ie,n as ye}from"./chunk-CVKDPNYM.js";var W=v((Xo,ht)=>{var yn="2.0.0",Rn=Number.MAX_SAFE_INTEGER||9007199254740991,xn=16,Ln=250,Sn=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ht.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:xn,MAX_SAFE_BUILD_LENGTH:Ln,MAX_SAFE_INTEGER:Rn,RELEASE_TYPES:Sn,SEMVER_SPEC_VERSION:yn,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var K=v((Vo,ft)=>{var $n=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};ft.exports=$n});var B=v((P,pt)=>{var{MAX_SAFE_COMPONENT_LENGTH:Re,MAX_SAFE_BUILD_LENGTH:wn,MAX_LENGTH:Nn}=W(),Tn=K();P=pt.exports={};var On=P.re=[],An=P.safeRe=[],f=P.src=[],p=P.t={},bn=0,xe="[a-zA-Z0-9-]",qn=[["\\s",1],["\\d",Nn],[xe,wn]],Pn=o(t=>{for(let[e,r]of qn)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},"makeSafeRegex"),E=o((t,e,r)=>{let n=Pn(e),s=bn++;Tn(t,s,e),p[t]=s,f[s]=e,On[s]=new RegExp(e,r?"g":void 0),An[s]=new RegExp(n,r?"g":void 0)},"createToken");E("NUMERICIDENTIFIER","0|[1-9]\\d*");E("NUMERICIDENTIFIERLOOSE","\\d+");E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${xe}*`);E("MAINVERSION",`(${f[p.NUMERICIDENTIFIER]})\\.(${f[p.NUMERICIDENTIFIER]})\\.(${f[p.NUMERICIDENTIFIER]})`);E("MAINVERSIONLOOSE",`(${f[p.NUMERICIDENTIFIERLOOSE]})\\.(${f[p.NUMERICIDENTIFIERLOOSE]})\\.(${f[p.NUMERICIDENTIFIERLOOSE]})`);E("PRERELEASEIDENTIFIER",`(?:${f[p.NUMERICIDENTIFIER]}|${f[p.NONNUMERICIDENTIFIER]})`);E("PRERELEASEIDENTIFIERLOOSE",`(?:${f[p.NUMERICIDENTIFIERLOOSE]}|${f[p.NONNUMERICIDENTIFIER]})`);E("PRERELEASE",`(?:-(${f[p.PRERELEASEIDENTIFIER]}(?:\\.${f[p.PRERELEASEIDENTIFIER]})*))`);E("PRERELEASELOOSE",`(?:-?(${f[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${f[p.PRERELEASEIDENTIFIERLOOSE]})*))`);E("BUILDIDENTIFIER",`${xe}+`);E("BUILD",`(?:\\+(${f[p.BUILDIDENTIFIER]}(?:\\.${f[p.BUILDIDENTIFIER]})*))`);E("FULLPLAIN",`v?${f[p.MAINVERSION]}${f[p.PRERELEASE]}?${f[p.BUILD]}?`);E("FULL",`^${f[p.FULLPLAIN]}$`);E("LOOSEPLAIN",`[v=\\s]*${f[p.MAINVERSIONLOOSE]}${f[p.PRERELEASELOOSE]}?${f[p.BUILD]}?`);E("LOOSE",`^${f[p.LOOSEPLAIN]}$`);E("GTLT","((?:<|>)?=?)");E("XRANGEIDENTIFIERLOOSE",`${f[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);E("XRANGEIDENTIFIER",`${f[p.NUMERICIDENTIFIER]}|x|X|\\*`);E("XRANGEPLAIN",`[v=\\s]*(${f[p.XRANGEIDENTIFIER]})(?:\\.(${f[p.XRANGEIDENTIFIER]})(?:\\.(${f[p.XRANGEIDENTIFIER]})(?:${f[p.PRERELEASE]})?${f[p.BUILD]}?)?)?`);E("XRANGEPLAINLOOSE",`[v=\\s]*(${f[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[p.XRANGEIDENTIFIERLOOSE]})(?:${f[p.PRERELEASELOOSE]})?${f[p.BUILD]}?)?)?`);E("XRANGE",`^${f[p.GTLT]}\\s*${f[p.XRANGEPLAIN]}$`);E("XRANGELOOSE",`^${f[p.GTLT]}\\s*${f[p.XRANGEPLAINLOOSE]}$`);E("COERCE",`(^|[^\\d])(\\d{1,${Re}})(?:\\.(\\d{1,${Re}}))?(?:\\.(\\d{1,${Re}}))?(?:$|[^\\d])`);E("COERCERTL",f[p.COERCE],!0);E("LONETILDE","(?:~>?)");E("TILDETRIM",`(\\s*)${f[p.LONETILDE]}\\s+`,!0);P.tildeTrimReplace="$1~";E("TILDE",`^${f[p.LONETILDE]}${f[p.XRANGEPLAIN]}$`);E("TILDELOOSE",`^${f[p.LONETILDE]}${f[p.XRANGEPLAINLOOSE]}$`);E("LONECARET","(?:\\^)");E("CARETTRIM",`(\\s*)${f[p.LONECARET]}\\s+`,!0);P.caretTrimReplace="$1^";E("CARET",`^${f[p.LONECARET]}${f[p.XRANGEPLAIN]}$`);E("CARETLOOSE",`^${f[p.LONECARET]}${f[p.XRANGEPLAINLOOSE]}$`);E("COMPARATORLOOSE",`^${f[p.GTLT]}\\s*(${f[p.LOOSEPLAIN]})$|^$`);E("COMPARATOR",`^${f[p.GTLT]}\\s*(${f[p.FULLPLAIN]})$|^$`);E("COMPARATORTRIM",`(\\s*)${f[p.GTLT]}\\s*(${f[p.LOOSEPLAIN]}|${f[p.XRANGEPLAIN]})`,!0);P.comparatorTrimReplace="$1$2$3";E("HYPHENRANGE",`^\\s*(${f[p.XRANGEPLAIN]})\\s+-\\s+(${f[p.XRANGEPLAIN]})\\s*$`);E("HYPHENRANGELOOSE",`^\\s*(${f[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${f[p.XRANGEPLAINLOOSE]})\\s*$`);E("STAR","(<|>)?=?\\s*\\*");E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var ie=v((zo,dt)=>{var Cn=Object.freeze({loose:!0}),_n=Object.freeze({}),Dn=o(t=>t?typeof t!="object"?Cn:t:_n,"parseOptions");dt.exports=Dn});var Le=v((Wo,Et)=>{var mt=/^[0-9]+$/,vt=o((t,e)=>{let r=mt.test(t),n=mt.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},"compareIdentifiers"),Un=o((t,e)=>vt(e,t),"rcompareIdentifiers");Et.exports={compareIdentifiers:vt,rcompareIdentifiers:Un}});var S=v((ko,Rt)=>{var oe=K(),{MAX_LENGTH:gt,MAX_SAFE_INTEGER:ue}=W(),{safeRe:It,t:yt}=B(),Gn=ie(),{compareIdentifiers:X}=Le(),Se=class t{static{o(this,"SemVer")}constructor(e,r){if(r=Gn(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>gt)throw new TypeError(`version is longer than ${gt} characters`);oe("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?It[yt.LOOSE]:It[yt.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>ue||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ue||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ue||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let i=+s;if(i>=0&&i<ue)return i}return s}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(oe("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),X(this.major,e.major)||X(this.minor,e.minor)||X(this.patch,e.patch)}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],s=e.prerelease[r];if(oe("prerelease compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return X(n,s)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],s=e.build[r];if(oe("prerelease compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return X(n,s)}while(++r)}inc(e,r,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let s=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[s];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let i=[r,s];n===!1&&(i=[r]),X(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};Rt.exports=Se});var U=v((Jo,Lt)=>{var xt=S(),jn=o((t,e,r=!1)=>{if(t instanceof xt)return t;try{return new xt(t,e)}catch(n){if(!r)return null;throw n}},"parse");Lt.exports=jn});var $t=v((eu,St)=>{var Fn=U(),Mn=o((t,e)=>{let r=Fn(t,e);return r?r.version:null},"valid");St.exports=Mn});var Nt=v((ru,wt)=>{var Bn=U(),Xn=o((t,e)=>{let r=Bn(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null},"clean");wt.exports=Xn});var At=v((su,Ot)=>{var Tt=S(),Vn=o((t,e,r,n,s)=>{typeof r=="string"&&(s=n,n=r,r=void 0);try{return new Tt(t instanceof Tt?t.version:t,r).inc(e,n,s).version}catch{return null}},"inc");Ot.exports=Vn});var Pt=v((ou,qt)=>{var bt=U(),Hn=o((t,e)=>{let r=bt(t,null,!0),n=bt(e,null,!0),s=r.compare(n);if(s===0)return null;let i=s>0,u=i?r:n,a=i?n:r,c=!!u.prerelease.length;if(!!a.prerelease.length&&!c)return!a.patch&&!a.minor?"major":u.patch?"patch":u.minor?"minor":"major";let l=c?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"},"diff");qt.exports=Hn});var _t=v((au,Ct)=>{var zn=S(),Yn=o((t,e)=>new zn(t,e).major,"major");Ct.exports=Yn});var Ut=v((lu,Dt)=>{var Wn=S(),Kn=o((t,e)=>new Wn(t,e).minor,"minor");Dt.exports=Kn});var jt=v((fu,Gt)=>{var kn=S(),Zn=o((t,e)=>new kn(t,e).patch,"patch");Gt.exports=Zn});var Mt=v((du,Ft)=>{var Jn=U(),Qn=o((t,e)=>{let r=Jn(t,e);return r&&r.prerelease.length?r.prerelease:null},"prerelease");Ft.exports=Qn});var O=v((vu,Xt)=>{var Bt=S(),es=o((t,e,r)=>new Bt(t,r).compare(new Bt(e,r)),"compare");Xt.exports=es});var Ht=v((gu,Vt)=>{var ts=O(),rs=o((t,e,r)=>ts(e,t,r),"rcompare");Vt.exports=rs});var Yt=v((yu,zt)=>{var ns=O(),ss=o((t,e)=>ns(t,e,!0),"compareLoose");zt.exports=ss});var ae=v((xu,Kt)=>{var Wt=S(),is=o((t,e,r)=>{let n=new Wt(t,r),s=new Wt(e,r);return n.compare(s)||n.compareBuild(s)},"compareBuild");Kt.exports=is});var Zt=v((Su,kt)=>{var os=ae(),us=o((t,e)=>t.sort((r,n)=>os(r,n,e)),"sort");kt.exports=us});var Qt=v((wu,Jt)=>{var as=ae(),cs=o((t,e)=>t.sort((r,n)=>as(n,r,e)),"rsort");Jt.exports=cs});var k=v((Tu,er)=>{var ls=O(),hs=o((t,e,r)=>ls(t,e,r)>0,"gt");er.exports=hs});var ce=v((Au,tr)=>{var fs=O(),ps=o((t,e,r)=>fs(t,e,r)<0,"lt");tr.exports=ps});var $e=v((qu,rr)=>{var ds=O(),ms=o((t,e,r)=>ds(t,e,r)===0,"eq");rr.exports=ms});var we=v((Cu,nr)=>{var vs=O(),Es=o((t,e,r)=>vs(t,e,r)!==0,"neq");nr.exports=Es});var le=v((Du,sr)=>{var gs=O(),Is=o((t,e,r)=>gs(t,e,r)>=0,"gte");sr.exports=Is});var he=v((Gu,ir)=>{var ys=O(),Rs=o((t,e,r)=>ys(t,e,r)<=0,"lte");ir.exports=Rs});var Ne=v((Fu,or)=>{var xs=$e(),Ls=we(),Ss=k(),$s=le(),ws=ce(),Ns=he(),Ts=o((t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return xs(t,r,n);case"!=":return Ls(t,r,n);case">":return Ss(t,r,n);case">=":return $s(t,r,n);case"<":return ws(t,r,n);case"<=":return Ns(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}},"cmp");or.exports=Ts});var ar=v((Bu,ur)=>{var Os=S(),As=U(),{safeRe:fe,t:pe}=B(),bs=o((t,e)=>{if(t instanceof Os)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(fe[pe.COERCE]);else{let n;for(;(n=fe[pe.COERCERTL].exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||n.index+n[0].length!==r.index+r[0].length)&&(r=n),fe[pe.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;fe[pe.COERCERTL].lastIndex=-1}return r===null?null:As(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,e)},"coerce");ur.exports=bs});var lr=v((Vu,cr)=>{"use strict";cr.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var fr=v((Hu,hr)=>{"use strict";hr.exports=g;g.Node=G;g.create=g;function g(t){var e=this;if(e instanceof g||(e=new g),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(s){e.push(s)});else if(arguments.length>0)for(var r=0,n=arguments.length;r<n;r++)e.push(arguments[r]);return e}o(g,"Yallist");g.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,r=t.prev;return e&&(e.prev=r),r&&(r.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=r),t.list.length--,t.next=null,t.prev=null,t.list=null,e};g.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}};g.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}};g.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)Ps(this,arguments[t]);return this.length};g.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)Cs(this,arguments[t]);return this.length};g.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}};g.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}};g.prototype.forEach=function(t,e){e=e||this;for(var r=this.head,n=0;r!==null;n++)t.call(e,r.value,n,this),r=r.next};g.prototype.forEachReverse=function(t,e){e=e||this;for(var r=this.tail,n=this.length-1;r!==null;n--)t.call(e,r.value,n,this),r=r.prev};g.prototype.get=function(t){for(var e=0,r=this.head;r!==null&&e<t;e++)r=r.next;if(e===t&&r!==null)return r.value};g.prototype.getReverse=function(t){for(var e=0,r=this.tail;r!==null&&e<t;e++)r=r.prev;if(e===t&&r!==null)return r.value};g.prototype.map=function(t,e){e=e||this;for(var r=new g,n=this.head;n!==null;)r.push(t.call(e,n.value,this)),n=n.next;return r};g.prototype.mapReverse=function(t,e){e=e||this;for(var r=new g,n=this.tail;n!==null;)r.push(t.call(e,n.value,this)),n=n.prev;return r};g.prototype.reduce=function(t,e){var r,n=this.head;if(arguments.length>1)r=e;else if(this.head)n=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=0;n!==null;s++)r=t(r,n.value,s),n=n.next;return r};g.prototype.reduceReverse=function(t,e){var r,n=this.tail;if(arguments.length>1)r=e;else if(this.tail)n=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=this.length-1;n!==null;s--)r=t(r,n.value,s),n=n.prev;return r};g.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t};g.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t};g.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new g;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var n=0,s=this.head;s!==null&&n<t;n++)s=s.next;for(;s!==null&&n<e;n++,s=s.next)r.push(s.value);return r};g.prototype.sliceReverse=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new g;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var n=this.length,s=this.tail;s!==null&&n>e;n--)s=s.prev;for(;s!==null&&n>t;n--,s=s.prev)r.push(s.value);return r};g.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,s=this.head;s!==null&&n<t;n++)s=s.next;for(var i=[],n=0;s&&n<e;n++)i.push(s.value),s=this.removeNode(s);s===null&&(s=this.tail),s!==this.head&&s!==this.tail&&(s=s.prev);for(var n=0;n<r.length;n++)s=qs(this,s,r[n]);return i};g.prototype.reverse=function(){for(var t=this.head,e=this.tail,r=t;r!==null;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=e,this.tail=t,this};function qs(t,e,r){var n=e===t.head?new G(r,null,e,t):new G(r,e,e.next,t);return n.next===null&&(t.tail=n),n.prev===null&&(t.head=n),t.length++,n}o(qs,"insert");function Ps(t,e){t.tail=new G(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}o(Ps,"push");function Cs(t,e){t.head=new G(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}o(Cs,"unshift");function G(t,e,r,n){if(!(this instanceof G))return new G(t,e,r,n);this.list=n,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}o(G,"Node");try{lr()(g)}catch{}});var Er=v((Yu,vr)=>{"use strict";var _s=fr(),j=Symbol("max"),_=Symbol("length"),V=Symbol("lengthCalculator"),J=Symbol("allowStale"),F=Symbol("maxAge"),C=Symbol("dispose"),pr=Symbol("noDisposeOnSet"),L=Symbol("lruList"),q=Symbol("cache"),mr=Symbol("updateAgeOnGet"),Te=o(()=>1,"naiveLength"),Ae=class{static{o(this,"LRUCache")}constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");let r=this[j]=e.max||1/0,n=e.length||Te;if(this[V]=typeof n!="function"?Te:n,this[J]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[F]=e.maxAge||0,this[C]=e.dispose,this[pr]=e.noDisposeOnSet||!1,this[mr]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[j]=e||1/0,Z(this)}get max(){return this[j]}set allowStale(e){this[J]=!!e}get allowStale(){return this[J]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[F]=e,Z(this)}get maxAge(){return this[F]}set lengthCalculator(e){typeof e!="function"&&(e=Te),e!==this[V]&&(this[V]=e,this[_]=0,this[L].forEach(r=>{r.length=this[V](r.value,r.key),this[_]+=r.length})),Z(this)}get lengthCalculator(){return this[V]}get length(){return this[_]}get itemCount(){return this[L].length}rforEach(e,r){r=r||this;for(let n=this[L].tail;n!==null;){let s=n.prev;dr(this,e,n,r),n=s}}forEach(e,r){r=r||this;for(let n=this[L].head;n!==null;){let s=n.next;dr(this,e,n,r),n=s}}keys(){return this[L].toArray().map(e=>e.key)}values(){return this[L].toArray().map(e=>e.value)}reset(){this[C]&&this[L]&&this[L].length&&this[L].forEach(e=>this[C](e.key,e.value)),this[q]=new Map,this[L]=new _s,this[_]=0}dump(){return this[L].map(e=>de(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[L]}set(e,r,n){if(n=n||this[F],n&&typeof n!="number")throw new TypeError("maxAge must be a number");let s=n?Date.now():0,i=this[V](r,e);if(this[q].has(e)){if(i>this[j])return H(this,this[q].get(e)),!1;let c=this[q].get(e).value;return this[C]&&(this[pr]||this[C](e,c.value)),c.now=s,c.maxAge=n,c.value=r,this[_]+=i-c.length,c.length=i,this.get(e),Z(this),!0}let u=new be(e,r,i,s,n);return u.length>this[j]?(this[C]&&this[C](e,r),!1):(this[_]+=u.length,this[L].unshift(u),this[q].set(e,this[L].head),Z(this),!0)}has(e){if(!this[q].has(e))return!1;let r=this[q].get(e).value;return!de(this,r)}get(e){return Oe(this,e,!0)}peek(e){return Oe(this,e,!1)}pop(){let e=this[L].tail;return e?(H(this,e),e.value):null}del(e){H(this,this[q].get(e))}load(e){this.reset();let r=Date.now();for(let n=e.length-1;n>=0;n--){let s=e[n],i=s.e||0;if(i===0)this.set(s.k,s.v);else{let u=i-r;u>0&&this.set(s.k,s.v,u)}}}prune(){this[q].forEach((e,r)=>Oe(this,r,!1))}},Oe=o((t,e,r)=>{let n=t[q].get(e);if(n){let s=n.value;if(de(t,s)){if(H(t,n),!t[J])return}else r&&(t[mr]&&(n.value.now=Date.now()),t[L].unshiftNode(n));return s.value}},"get"),de=o((t,e)=>{if(!e||!e.maxAge&&!t[F])return!1;let r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[F]&&r>t[F]},"isStale"),Z=o(t=>{if(t[_]>t[j])for(let e=t[L].tail;t[_]>t[j]&&e!==null;){let r=e.prev;H(t,e),e=r}},"trim"),H=o((t,e)=>{if(e){let r=e.value;t[C]&&t[C](r.key,r.value),t[_]-=r.length,t[q].delete(r.key),t[L].removeNode(e)}},"del"),be=class{static{o(this,"Entry")}constructor(e,r,n,s,i){this.key=e,this.value=r,this.length=n,this.now=s,this.maxAge=i||0}},dr=o((t,e,r,n)=>{let s=r.value;de(t,s)&&(H(t,r),t[J]||(s=void 0)),s&&e.call(n,s.value,s.key,t)},"forEachStep");vr.exports=Ae});var A=v((Ku,Rr)=>{var qe=class t{static{o(this,"Range")}constructor(e,r){if(r=Us(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof Pe)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(s=>!Ir(s[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&Vs(s[0])){this.set=[s];break}}}this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){let n=((this.options.includePrerelease&&Bs)|(this.options.loose&&Xs))+":"+e,s=gr.get(n);if(s)return s;let i=this.options.loose,u=i?T[w.HYPHENRANGELOOSE]:T[w.HYPHENRANGE];e=e.replace(u,ei(this.options.includePrerelease)),R("hyphen replace",e),e=e.replace(T[w.COMPARATORTRIM],js),R("comparator trim",e),e=e.replace(T[w.TILDETRIM],Fs),R("tilde trim",e),e=e.replace(T[w.CARETTRIM],Ms),R("caret trim",e);let a=e.split(" ").map(d=>Hs(d,this.options)).join(" ").split(/\s+/).map(d=>Qs(d,this.options));i&&(a=a.filter(d=>(R("loose invalid filter",d,this.options),!!d.match(T[w.COMPARATORLOOSE])))),R("range list",a);let c=new Map,h=a.map(d=>new Pe(d,this.options));for(let d of h){if(Ir(d))return[d];c.set(d.value,d)}c.size>1&&c.has("")&&c.delete("");let l=[...c.values()];return gr.set(n,l),l}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>yr(n,r)&&e.set.some(s=>yr(s,r)&&n.every(i=>s.every(u=>i.intersects(u,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Gs(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(ti(this.set[r],e,this.options))return!0;return!1}};Rr.exports=qe;var Ds=Er(),gr=new Ds({max:1e3}),Us=ie(),Pe=Q(),R=K(),Gs=S(),{safeRe:T,t:w,comparatorTrimReplace:js,tildeTrimReplace:Fs,caretTrimReplace:Ms}=B(),{FLAG_INCLUDE_PRERELEASE:Bs,FLAG_LOOSE:Xs}=W(),Ir=o(t=>t.value==="<0.0.0-0","isNullSet"),Vs=o(t=>t.value==="","isAny"),yr=o((t,e)=>{let r=!0,n=t.slice(),s=n.pop();for(;r&&n.length;)r=n.every(i=>s.intersects(i,e)),s=n.pop();return r},"isSatisfiable"),Hs=o((t,e)=>(R("comp",t,e),t=Ws(t,e),R("caret",t),t=zs(t,e),R("tildes",t),t=ks(t,e),R("xrange",t),t=Js(t,e),R("stars",t),t),"parseComparator"),N=o(t=>!t||t.toLowerCase()==="x"||t==="*","isX"),zs=o((t,e)=>t.trim().split(/\s+/).map(r=>Ys(r,e)).join(" "),"replaceTildes"),Ys=o((t,e)=>{let r=e.loose?T[w.TILDELOOSE]:T[w.TILDE];return t.replace(r,(n,s,i,u,a)=>{R("tilde",t,n,s,i,u,a);let c;return N(s)?c="":N(i)?c=`>=${s}.0.0 <${+s+1}.0.0-0`:N(u)?c=`>=${s}.${i}.0 <${s}.${+i+1}.0-0`:a?(R("replaceTilde pr",a),c=`>=${s}.${i}.${u}-${a} <${s}.${+i+1}.0-0`):c=`>=${s}.${i}.${u} <${s}.${+i+1}.0-0`,R("tilde return",c),c})},"replaceTilde"),Ws=o((t,e)=>t.trim().split(/\s+/).map(r=>Ks(r,e)).join(" "),"replaceCarets"),Ks=o((t,e)=>{R("caret",t,e);let r=e.loose?T[w.CARETLOOSE]:T[w.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(s,i,u,a,c)=>{R("caret",t,s,i,u,a,c);let h;return N(i)?h="":N(u)?h=`>=${i}.0.0${n} <${+i+1}.0.0-0`:N(a)?i==="0"?h=`>=${i}.${u}.0${n} <${i}.${+u+1}.0-0`:h=`>=${i}.${u}.0${n} <${+i+1}.0.0-0`:c?(R("replaceCaret pr",c),i==="0"?u==="0"?h=`>=${i}.${u}.${a}-${c} <${i}.${u}.${+a+1}-0`:h=`>=${i}.${u}.${a}-${c} <${i}.${+u+1}.0-0`:h=`>=${i}.${u}.${a}-${c} <${+i+1}.0.0-0`):(R("no pr"),i==="0"?u==="0"?h=`>=${i}.${u}.${a}${n} <${i}.${u}.${+a+1}-0`:h=`>=${i}.${u}.${a}${n} <${i}.${+u+1}.0-0`:h=`>=${i}.${u}.${a} <${+i+1}.0.0-0`),R("caret return",h),h})},"replaceCaret"),ks=o((t,e)=>(R("replaceXRanges",t,e),t.split(/\s+/).map(r=>Zs(r,e)).join(" ")),"replaceXRanges"),Zs=o((t,e)=>{t=t.trim();let r=e.loose?T[w.XRANGELOOSE]:T[w.XRANGE];return t.replace(r,(n,s,i,u,a,c)=>{R("xRange",t,n,s,i,u,a,c);let h=N(i),l=h||N(u),d=l||N(a),y=d;return s==="="&&y&&(s=""),c=e.includePrerelease?"-0":"",h?s===">"||s==="<"?n="<0.0.0-0":n="*":s&&y?(l&&(u=0),a=0,s===">"?(s=">=",l?(i=+i+1,u=0,a=0):(u=+u+1,a=0)):s==="<="&&(s="<",l?i=+i+1:u=+u+1),s==="<"&&(c="-0"),n=`${s+i}.${u}.${a}${c}`):l?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${u}.0${c} <${i}.${+u+1}.0-0`),R("xRange return",n),n})},"replaceXRange"),Js=o((t,e)=>(R("replaceStars",t,e),t.trim().replace(T[w.STAR],"")),"replaceStars"),Qs=o((t,e)=>(R("replaceGTE0",t,e),t.trim().replace(T[e.includePrerelease?w.GTE0PRE:w.GTE0],"")),"replaceGTE0"),ei=o(t=>(e,r,n,s,i,u,a,c,h,l,d,y,m)=>(N(n)?r="":N(s)?r=`>=${n}.0.0${t?"-0":""}`:N(i)?r=`>=${n}.${s}.0${t?"-0":""}`:u?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,N(h)?c="":N(l)?c=`<${+h+1}.0.0-0`:N(d)?c=`<${h}.${+l+1}.0-0`:y?c=`<=${h}.${l}.${d}-${y}`:t?c=`<${h}.${l}.${+d+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),"hyphenReplace"),ti=o((t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if(R(t[n].semver),t[n].semver!==Pe.ANY&&t[n].semver.prerelease.length>0){let s=t[n].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0},"testSet")});var Q=v((Zu,Nr)=>{var ee=Symbol("SemVer ANY"),De=class t{static{o(this,"Comparator")}static get ANY(){return ee}constructor(e,r){if(r=xr(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),_e("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===ee?this.value="":this.value=this.operator+this.semver.version,_e("comp",this)}parse(e){let r=this.options.loose?Lr[Sr.COMPARATORLOOSE]:Lr[Sr.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new $r(n[2],this.options.loose):this.semver=ee}toString(){return this.value}test(e){if(_e("Comparator.test",e,this.options.loose),this.semver===ee||e===ee)return!0;if(typeof e=="string")try{e=new $r(e,this.options)}catch{return!1}return Ce(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new wr(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new wr(this.value,r).test(e.semver):(r=xr(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Ce(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Ce(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Nr.exports=De;var xr=ie(),{safeRe:Lr,t:Sr}=B(),Ce=Ne(),_e=K(),$r=S(),wr=A()});var te=v((Qu,Tr)=>{var ri=A(),ni=o((t,e,r)=>{try{e=new ri(e,r)}catch{return!1}return e.test(t)},"satisfies");Tr.exports=ni});var Ar=v((ta,Or)=>{var si=A(),ii=o((t,e)=>new si(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" ")),"toComparators");Or.exports=ii});var qr=v((na,br)=>{var oi=S(),ui=A(),ai=o((t,e,r)=>{let n=null,s=null,i=null;try{i=new ui(e,r)}catch{return null}return t.forEach(u=>{i.test(u)&&(!n||s.compare(u)===-1)&&(n=u,s=new oi(n,r))}),n},"maxSatisfying");br.exports=ai});var Cr=v((ia,Pr)=>{var ci=S(),li=A(),hi=o((t,e,r)=>{let n=null,s=null,i=null;try{i=new li(e,r)}catch{return null}return t.forEach(u=>{i.test(u)&&(!n||s.compare(u)===1)&&(n=u,s=new ci(n,r))}),n},"minSatisfying");Pr.exports=hi});var Ur=v((ua,Dr)=>{var Ue=S(),fi=A(),_r=k(),pi=o((t,e)=>{t=new fi(t,e);let r=new Ue("0.0.0");if(t.test(r)||(r=new Ue("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){let s=t.set[n],i=null;s.forEach(u=>{let a=new Ue(u.semver.version);switch(u.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!i||_r(a,i))&&(i=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${u.operator}`)}}),i&&(!r||_r(r,i))&&(r=i)}return r&&t.test(r)?r:null},"minVersion");Dr.exports=pi});var jr=v((ca,Gr)=>{var di=A(),mi=o((t,e)=>{try{return new di(t,e).range||"*"}catch{return null}},"validRange");Gr.exports=mi});var me=v((ha,Xr)=>{var vi=S(),Br=Q(),{ANY:Ei}=Br,gi=A(),Ii=te(),Fr=k(),Mr=ce(),yi=he(),Ri=le(),xi=o((t,e,r,n)=>{t=new vi(t,n),e=new gi(e,n);let s,i,u,a,c;switch(r){case">":s=Fr,i=yi,u=Mr,a=">",c=">=";break;case"<":s=Mr,i=Ri,u=Fr,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Ii(t,e,n))return!1;for(let h=0;h<e.set.length;++h){let l=e.set[h],d=null,y=null;if(l.forEach(m=>{m.semver===Ei&&(m=new Br(">=0.0.0")),d=d||m,y=y||m,s(m.semver,d.semver,n)?d=m:u(m.semver,y.semver,n)&&(y=m)}),d.operator===a||d.operator===c||(!y.operator||y.operator===a)&&i(t,y.semver))return!1;if(y.operator===c&&u(t,y.semver))return!1}return!0},"outside");Xr.exports=xi});var Hr=v((pa,Vr)=>{var Li=me(),Si=o((t,e,r)=>Li(t,e,">",r),"gtr");Vr.exports=Si});var Yr=v((ma,zr)=>{var $i=me(),wi=o((t,e,r)=>$i(t,e,"<",r),"ltr");zr.exports=wi});var kr=v((Ea,Kr)=>{var Wr=A(),Ni=o((t,e,r)=>(t=new Wr(t,r),e=new Wr(e,r),t.intersects(e,r)),"intersects");Kr.exports=Ni});var Jr=v((Ia,Zr)=>{var Ti=te(),Oi=O();Zr.exports=(t,e,r)=>{let n=[],s=null,i=null,u=t.sort((l,d)=>Oi(l,d,r));for(let l of u)Ti(l,e,r)?(i=l,s||(s=l)):(i&&n.push([s,i]),i=null,s=null);s&&n.push([s,null]);let a=[];for(let[l,d]of n)l===d?a.push(l):!d&&l===u[0]?a.push("*"):d?l===u[0]?a.push(`<=${d}`):a.push(`${l} - ${d}`):a.push(`>=${l}`);let c=a.join(" || "),h=typeof e.raw=="string"?e.raw:String(e);return c.length<h.length?c:e}});var sn=v((ya,nn)=>{var Qr=A(),je=Q(),{ANY:Ge}=je,re=te(),Fe=O(),Ai=o((t,e,r={})=>{if(t===e)return!0;t=new Qr(t,r),e=new Qr(e,r);let n=!1;e:for(let s of t.set){for(let i of e.set){let u=qi(s,i,r);if(n=n||u!==null,u)continue e}if(n)return!1}return!0},"subset"),bi=[new je(">=0.0.0-0")],en=[new je(">=0.0.0")],qi=o((t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Ge){if(e.length===1&&e[0].semver===Ge)return!0;r.includePrerelease?t=bi:t=en}if(e.length===1&&e[0].semver===Ge){if(r.includePrerelease)return!0;e=en}let n=new Set,s,i;for(let m of t)m.operator===">"||m.operator===">="?s=tn(s,m,r):m.operator==="<"||m.operator==="<="?i=rn(i,m,r):n.add(m.semver);if(n.size>1)return null;let u;if(s&&i){if(u=Fe(s.semver,i.semver,r),u>0)return null;if(u===0&&(s.operator!==">="||i.operator!=="<="))return null}for(let m of n){if(s&&!re(m,String(s),r)||i&&!re(m,String(i),r))return null;for(let pn of e)if(!re(m,String(pn),r))return!1;return!0}let a,c,h,l,d=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1,y=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;d&&d.prerelease.length===1&&i.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let m of e){if(l=l||m.operator===">"||m.operator===">=",h=h||m.operator==="<"||m.operator==="<=",s){if(y&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===y.major&&m.semver.minor===y.minor&&m.semver.patch===y.patch&&(y=!1),m.operator===">"||m.operator===">="){if(a=tn(s,m,r),a===m&&a!==s)return!1}else if(s.operator===">="&&!re(s.semver,String(m),r))return!1}if(i){if(d&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===d.major&&m.semver.minor===d.minor&&m.semver.patch===d.patch&&(d=!1),m.operator==="<"||m.operator==="<="){if(c=rn(i,m,r),c===m&&c!==i)return!1}else if(i.operator==="<="&&!re(i.semver,String(m),r))return!1}if(!m.operator&&(i||s)&&u!==0)return!1}return!(s&&h&&!i&&u!==0||i&&l&&!s&&u!==0||y||d)},"simpleSubset"),tn=o((t,e,r)=>{if(!t)return e;let n=Fe(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},"higherGT"),rn=o((t,e,r)=>{if(!t)return e;let n=Fe(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t},"lowerLT");nn.exports=Ai});var cn=v((xa,an)=>{var Me=B(),on=W(),Pi=S(),un=Le(),Ci=U(),_i=$t(),Di=Nt(),Ui=At(),Gi=Pt(),ji=_t(),Fi=Ut(),Mi=jt(),Bi=Mt(),Xi=O(),Vi=Ht(),Hi=Yt(),zi=ae(),Yi=Zt(),Wi=Qt(),Ki=k(),ki=ce(),Zi=$e(),Ji=we(),Qi=le(),eo=he(),to=Ne(),ro=ar(),no=Q(),so=A(),io=te(),oo=Ar(),uo=qr(),ao=Cr(),co=Ur(),lo=jr(),ho=me(),fo=Hr(),po=Yr(),mo=kr(),vo=Jr(),Eo=sn();an.exports={parse:Ci,valid:_i,clean:Di,inc:Ui,diff:Gi,major:ji,minor:Fi,patch:Mi,prerelease:Bi,compare:Xi,rcompare:Vi,compareLoose:Hi,compareBuild:zi,sort:Yi,rsort:Wi,gt:Ki,lt:ki,eq:Zi,neq:Ji,gte:Qi,lte:eo,cmp:to,coerce:ro,Comparator:no,Range:so,satisfies:io,toComparators:oo,maxSatisfying:uo,minSatisfying:ao,minVersion:co,validRange:lo,outside:ho,gtr:fo,ltr:po,intersects:mo,simplifyRange:vo,subset:Eo,SemVer:Pi,re:Me.re,src:Me.src,tokens:Me.t,SEMVER_SPEC_VERSION:on.SEMVER_SPEC_VERSION,RELEASE_TYPES:on.RELEASE_TYPES,compareIdentifiers:un.compareIdentifiers,rcompareIdentifiers:un.rcompareIdentifiers}});var st,it,M=typeof Reflect=="object"?Reflect:null,Ze=M&&typeof M.apply=="function"?M.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};it=M&&typeof M.ownKeys=="function"?M.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var Je=Number.isNaN||function(t){return t!=t};function I(){I.init.call(this)}o(I,"o");st=I,I.EventEmitter=I,I.prototype._events=void 0,I.prototype._eventsCount=0,I.prototype._maxListeners=void 0;var Qe=10;function ne(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}o(ne,"u");function ot(t){return t._maxListeners===void 0?I.defaultMaxListeners:t._maxListeners}o(ot,"f");function et(t,e,r,n){var s,i,u,a;if(ne(r),(i=t._events)===void 0?(i=t._events=Object.create(null),t._eventsCount=0):(i.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),i=t._events),u=i[e]),u===void 0)u=i[e]=r,++t._eventsCount;else if(typeof u=="function"?u=i[e]=n?[r,u]:[u,r]:n?u.unshift(r):u.push(r),(s=ot(t))>0&&u.length>s&&!u.warned){u.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+u.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=u.length,a=c,console&&console.warn&&console.warn(a)}return t}o(et,"v");function mn(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}o(mn,"a");function tt(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},s=mn.bind(n);return s.listener=r,n.wrapFn=s,s}o(tt,"l");function rt(t,e,r){var n=t._events;if(n===void 0)return[];var s=n[e];return s===void 0?[]:typeof s=="function"?r?[s.listener||s]:[s]:r?function(i){for(var u=new Array(i.length),a=0;a<u.length;++a)u[a]=i[a].listener||i[a];return u}(s):ut(s,s.length)}o(rt,"h");function nt(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}o(nt,"p");function ut(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}o(ut,"c");Object.defineProperty(I,"defaultMaxListeners",{enumerable:!0,get:function(){return Qe},set:function(t){if(typeof t!="number"||t<0||Je(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Qe=t}}),I.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},I.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||Je(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},I.prototype.getMaxListeners=function(){return ot(this)},I.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n=t==="error",s=this._events;if(s!==void 0)n=n&&s.error===void 0;else if(!n)return!1;if(n){var i;if(e.length>0&&(i=e[0]),i instanceof Error)throw i;var u=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw u.context=i,u}var a=s[t];if(a===void 0)return!1;if(typeof a=="function")Ze(a,this,e);else{var c=a.length,h=ut(a,c);for(r=0;r<c;++r)Ze(h[r],this,e)}return!0},I.prototype.addListener=function(t,e){return et(this,t,e,!1)},I.prototype.on=I.prototype.addListener,I.prototype.prependListener=function(t,e){return et(this,t,e,!0)},I.prototype.once=function(t,e){return ne(e),this.on(t,tt(this,t,e)),this},I.prototype.prependOnceListener=function(t,e){return ne(e),this.prependListener(t,tt(this,t,e)),this},I.prototype.removeListener=function(t,e){var r,n,s,i,u;if(ne(e),(n=this._events)===void 0)return this;if((r=n[t])===void 0)return this;if(r===e||r.listener===e)--this._eventsCount==0?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if(typeof r!="function"){for(s=-1,i=r.length-1;i>=0;i--)if(r[i]===e||r[i].listener===e){u=r[i].listener,s=i;break}if(s<0)return this;s===0?r.shift():function(a,c){for(;c+1<a.length;c++)a[c]=a[c+1];a.pop()}(r,s),r.length===1&&(n[t]=r[0]),n.removeListener!==void 0&&this.emit("removeListener",t,u||e)}return this},I.prototype.off=I.prototype.removeListener,I.prototype.removeAllListeners=function(t){var e,r,n;if((r=this._events)===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var s,i=Object.keys(r);for(n=0;n<i.length;++n)(s=i[n])!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(e=r[t])=="function")this.removeListener(t,e);else if(e!==void 0)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},I.prototype.listeners=function(t){return rt(this,t,!0)},I.prototype.rawListeners=function(t){return rt(this,t,!1)},I.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):nt.call(t,e)},I.prototype.listenerCount=nt,I.prototype.eventNames=function(){return this._eventsCount>0?it(this._events):[]};var $=st;$.EventEmitter;$.defaultMaxListeners;$.init;$.listenerCount;$.EventEmitter;$.defaultMaxListeners;$.init;$.listenerCount;$.once=function(t,e){return new Promise((r,n)=>{function s(...u){i!==void 0&&t.removeListener("error",i),r(u)}o(s,"eventListener");let i;e!=="error"&&(i=o(u=>{t.removeListener(name,s),n(u)},"errorListener"),t.once("error",i)),t.once(e,s)})};$.on=function(t,e){let r=[],n=[],s=null,i=!1,u={async next(){let h=r.shift();if(h)return createIterResult(h,!1);if(s){let l=Promise.reject(s);return s=null,l}return i?createIterResult(void 0,!0):new Promise((l,d)=>n.push({resolve:l,reject:d}))},async return(){t.removeListener(e,a),t.removeListener("error",c),i=!0;for(let h of n)h.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(h){s=h,t.removeListener(e,a),t.removeListener("error",c)},[Symbol.asyncIterator](){return this}};return t.on(e,a),t.on("error",c),u;function a(...h){let l=n.shift();l?l.resolve(createIterResult(h,!1)):r.push(h)}o(a,"eventHandler");function c(h){i=!0;let l=n.shift();l?l.reject(h):s=h,u.return()}o(c,"errorHandler")};var{EventEmitter:$o,defaultMaxListeners:wo,init:No,listenerCount:To,on:Oo,once:Ao}=$;var se=function(t,e,r,n){function s(i){return i instanceof r?i:new r(function(u){u(i)})}return o(s,"adopt"),new(r||(r=Promise))(function(i,u){function a(l){try{h(n.next(l))}catch(d){u(d)}}o(a,"fulfilled");function c(l){try{h(n.throw(l))}catch(d){u(d)}}o(c,"rejected");function h(l){l.done?i(l.value):s(l.value).then(a,c)}o(h,"step"),h((n=n.apply(t,e||[])).next())})};var vn="transport",Y=class{static{o(this,"Transport")}constructor({context:e,logType:r}={}){this.exchangeTimeout=3e4,this.unresponsiveTimeout=15e3,this.deviceModel=null,this._events=new $,this.send=(n,s,i,u,a=Buffer.alloc(0),c=[Ie.OK],{abortTimeoutMs:h}={})=>se(this,void 0,void 0,function*(){let l=this.tracer.withUpdatedContext({function:"send"});if(a.length>=256)throw l.trace("data.length exceeded 256 bytes limit",{dataLength:a.length}),new b("data.length exceed 256 bytes limit. Got: "+a.length,"DataLengthTooBig");l.trace("Starting an exchange",{abortTimeoutMs:h});let d=yield this.exchange(Buffer.concat([Buffer.from([n,s,i,u]),Buffer.from([a.length]),a]),{abortTimeoutMs:h});l.trace("Received response from exchange");let y=d.readUInt16BE(d.length-2);if(!c.some(m=>m===y))throw new ye(y);return d}),this._appAPIlock=null,this.tracer=new Ye(r??vn,e)}exchange(e,{abortTimeoutMs:r}={}){throw new Error("exchange not implemented")}exchangeBulk(e,r){let n=!1,s=o(()=>{n=!0},"unsubscribe");return o(()=>se(this,void 0,void 0,function*(){if(!n)for(let u of e){let a=yield this.exchange(u);if(n)return;let c=a.readUInt16BE(a.length-2);if(c!==Ie.OK)throw new ye(c);r.next(a)}}),"main")().then(()=>!n&&r.complete(),u=>!n&&r.error(u)),{unsubscribe:s}}setScrambleKey(e){}close(){return Promise.resolve()}on(e,r){this._events.on(e,r)}off(e,r){this._events.removeListener(e,r)}emit(e,...r){this._events.emit(e,...r)}setDebugMode(){console.warn("setDebugMode is deprecated. use @ledgerhq/logs instead. No logs are emitted in this anymore.")}setExchangeTimeout(e){this.exchangeTimeout=e}setExchangeUnresponsiveTimeout(e){this.unresponsiveTimeout=e}static create(e=3e3,r){return new Promise((n,s)=>{let i=!1,u=this.listen({next:c=>{i=!0,u&&u.unsubscribe(),a&&clearTimeout(a),this.open(c.descriptor,e).then(n,s)},error:c=>{a&&clearTimeout(a),s(c)},complete:()=>{a&&clearTimeout(a),i||s(new b(this.ErrorMessage_NoDeviceFound,"NoDeviceFound"))}}),a=r?setTimeout(()=>{u.unsubscribe(),s(new b(this.ErrorMessage_ListenTimeout,"ListenTimeout"))},r):null})}exchangeAtomicImpl(e){return se(this,void 0,void 0,function*(){let r=this.tracer.withUpdatedContext({function:"exchangeAtomicImpl",unresponsiveTimeout:this.unresponsiveTimeout});if(this.exchangeBusyPromise)throw r.trace("Atomic exchange is already busy"),new ke("An action was already pending on the Ledger device. Please deny or reconnect.");let n,s=new Promise(a=>{n=a});this.exchangeBusyPromise=s;let i=!1,u=setTimeout(()=>{r.trace('Timeout reached, emitting Transport event "unresponsive"',{unresponsiveTimeout:this.unresponsiveTimeout}),i=!0,this.emit("unresponsive")},this.unresponsiveTimeout);try{let a=yield e();return i&&(r.trace("Device was unresponsive, emitting responsive"),this.emit("responsive")),a}finally{r.trace("Finalize, clearing busy guard"),clearTimeout(u),n&&n(),this.exchangeBusyPromise=null}})}decorateAppAPIMethods(e,r,n){for(let s of r)e[s]=this.decorateAppAPIMethod(s,e[s],e,n)}decorateAppAPIMethod(e,r,n,s){return(...i)=>se(this,void 0,void 0,function*(){let{_appAPIlock:u}=this;if(u)return Promise.reject(new b("Ledger Device is busy (lock "+u+")","TransportLocked"));try{return this._appAPIlock=e,this.setScrambleKey(s),yield r.apply(n,i)}finally{this._appAPIlock=null}})}setTraceContext(e){this.tracer=this.tracer.withContext(e)}updateTraceContext(e){this.tracer.updateContext(e)}getTraceContext(){return this.tracer.getContext()}};Y.ErrorMessage_ListenTimeout="No Ledger device found (timeout)";Y.ErrorMessage_NoDeviceFound="No Ledger device found";var at=Y;var ct=5;function En(t){let e=Buffer.alloc(2);return e.writeUInt16BE(t,0),e}o(En,"asUInt16BE");var gn={data:Buffer.alloc(0),dataLength:0,sequence:0},In=o((t,e)=>({makeBlocks(r){let n=Buffer.concat([En(r.length),r]),s=e-5,i=Math.ceil(n.length/s);n=Buffer.concat([n,Buffer.alloc(i*s-n.length+1).fill(0)]);let u=[];for(let a=0;a<i;a++){let c=Buffer.alloc(5);c.writeUInt16BE(t,0),c.writeUInt8(ct,2),c.writeUInt16BE(a,3);let h=n.slice(a*s,(a+1)*s);u.push(Buffer.concat([c,h]))}return u},reduceResponse(r,n){let{data:s,dataLength:i,sequence:u}=r||gn;if(n.readUInt16BE(0)!==t)throw new b("Invalid channel","InvalidChannel");if(n.readUInt8(2)!==ct)throw new b("Invalid tag","InvalidTag");if(n.readUInt16BE(3)!==u)throw new b("Invalid sequence","InvalidSequence");r||(i=n.readUInt16BE(5)),u++;let a=n.slice(r?5:7);return s=Buffer.concat([s,a]),s.length>i&&(s=s.slice(0,i)),{data:s,dataLength:i,sequence:u}},getReducedResult(r){if(r&&r.dataLength===r.data.length)return r.data}}),"createHIDframing"),lt=In;var Be=dn(cn());var x;(function(t){t.blue="blue",t.nanoS="nanoS",t.nanoSP="nanoSP",t.nanoX="nanoX",t.stax="stax",t.europa="europa"})(x||(x={}));var Xe={[x.blue]:{id:x.blue,productName:"Ledger\xA0Blue",productIdMM:0,legacyUsbProductId:0,usbOnly:!0,memorySize:480*1024,masks:[822083584,822149120],getBlockSize:t=>4*1024},[x.nanoS]:{id:x.nanoS,productName:"Ledger\xA0Nano\xA0S",productIdMM:16,legacyUsbProductId:1,usbOnly:!0,memorySize:320*1024,masks:[823132160],getBlockSize:t=>{var e;return Be.default.lt((e=Be.default.coerce(t))!==null&&e!==void 0?e:"","2.0.0")?4*1024:2*1024}},[x.nanoX]:{id:x.nanoX,productName:"Ledger\xA0Nano\xA0X",productIdMM:64,legacyUsbProductId:4,usbOnly:!1,memorySize:2*1024*1024,masks:[855638016],getBlockSize:t=>4*1024,bluetoothSpec:[{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",notifyUuid:"13d63400-2c97-0004-0001-4c6564676572",writeUuid:"13d63400-2c97-0004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-0004-0003-4c6564676572"}]},[x.nanoSP]:{id:x.nanoSP,productName:"Ledger Nano S Plus",productIdMM:80,legacyUsbProductId:5,usbOnly:!0,memorySize:1533*1024,masks:[856686592],getBlockSize:t=>32},[x.stax]:{id:x.stax,productName:"Ledger\xA0Stax",productIdMM:96,legacyUsbProductId:6,usbOnly:!1,memorySize:1533*1024,masks:[857735168],getBlockSize:t=>32,bluetoothSpec:[{serviceUuid:"13d63400-2c97-6004-0000-4c6564676572",notifyUuid:"13d63400-2c97-6004-0001-4c6564676572",writeUuid:"13d63400-2c97-6004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-6004-0003-4c6564676572"}]},[x.europa]:{id:x.europa,productName:"Ledger Europa",productIdMM:112,legacyUsbProductId:7,usbOnly:!1,memorySize:1533*1024,masks:[858783744],getBlockSize:t=>32,bluetoothSpec:[{serviceUuid:"13d63400-2c97-3004-0000-4c6564676572",notifyUuid:"13d63400-2c97-3004-0001-4c6564676572",writeUuid:"13d63400-2c97-3004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-3004-0003-4c6564676572"}]}},La={Blue:x.blue,"Nano S":x.nanoS,"Nano S Plus":x.nanoSP,"Nano X":x.nanoX,Stax:x.stax,Europa:x.europa},ln=Object.values(Xe),Ve=11415;var He=o(t=>{let e=ln.find(s=>s.legacyUsbProductId===t);if(e)return e;let r=t>>8;return ln.find(s=>s.productIdMM===r)},"identifyUSBProductId");var go=[],hn={};for(let t in Xe){let e=Xe[t],{bluetoothSpec:r}=e;if(r)for(let n=0;n<r.length;n++){let s=r[n];go.push(s.serviceUuid),hn[s.serviceUuid]=hn[s.serviceUuid.replace(/-/g,"")]=Object.assign({deviceModel:e},s)}}var D=function(t,e,r,n){function s(i){return i instanceof r?i:new r(function(u){u(i)})}return o(s,"adopt"),new(r||(r=Promise))(function(i,u){function a(l){try{h(n.next(l))}catch(d){u(d)}}o(a,"fulfilled");function c(l){try{h(n.throw(l))}catch(d){u(d)}}o(c,"rejected");function h(l){l.done?i(l.value):s(l.value).then(a,c)}o(h,"step"),h((n=n.apply(t,e||[])).next())})},Io=[{vendorId:Ve}],yo=o(()=>Promise.resolve(!!(window.navigator&&window.navigator.hid)),"isSupported"),ve=o(()=>{let{hid:t}=navigator;if(!t)throw new b("navigator.hid is not supported","HIDNotSupported");return t},"getHID");function fn(){return D(this,void 0,void 0,function*(){let t=yield ve().requestDevice({filters:Io});return Array.isArray(t)?t:[t]})}o(fn,"requestLedgerDevices");function ze(){return D(this,void 0,void 0,function*(){return(yield ve().getDevices()).filter(e=>e.vendorId===Ve)})}o(ze,"getLedgerDevices");function Ro(){return D(this,void 0,void 0,function*(){let t=yield ze();return t.length>0?t[0]:(yield fn())[0]})}o(Ro,"getFirstLedgerDevice");var z=class t extends at{static{o(this,"TransportWebHID")}constructor(e){super(),this.channel=Math.floor(Math.random()*65535),this.packetSize=64,this.inputs=[],this.read=()=>this.inputs.length?Promise.resolve(this.inputs.shift()):new Promise(r=>{this.inputCallback=r}),this.onInputReport=r=>{let n=Buffer.from(r.data.buffer);this.inputCallback?(this.inputCallback(n),this.inputCallback=null):this.inputs.push(n)},this._disconnectEmitted=!1,this._emitDisconnect=r=>{this._disconnectEmitted||(this._disconnectEmitted=!0,this.emit("disconnect",r))},this.exchange=r=>D(this,void 0,void 0,function*(){return yield this.exchangeAtomicImpl(()=>D(this,void 0,void 0,function*(){let{channel:s,packetSize:i}=this;Ee("apdu","=> "+r.toString("hex"));let u=lt(s,i),a=u.makeBlocks(r);for(let l=0;l<a.length;l++)yield this.device.sendReport(0,a[l]);let c,h;for(;!(c=u.getReducedResult(h));){let l=yield this.read();h=u.reduceResponse(h,l)}return Ee("apdu","<= "+c.toString("hex")),c})).catch(s=>{throw s&&s.message&&s.message.includes("write")?(this._emitDisconnect(s),new Ke(s.message)):s})}),this.device=e,this.deviceModel=typeof e.productId=="number"?He(e.productId):void 0,e.addEventListener("inputreport",this.onInputReport)}static request(){return D(this,void 0,void 0,function*(){let[e]=yield fn();return t.open(e)})}static openConnected(){return D(this,void 0,void 0,function*(){let e=yield ze();return e.length===0?null:t.open(e[0])})}static open(e){return D(this,void 0,void 0,function*(){yield e.open();let r=new t(e),n=o(s=>{e===s.device&&(ve().removeEventListener("disconnect",n),r._emitDisconnect(new We))},"onDisconnect");return ve().addEventListener("disconnect",n),r})}close(){return D(this,void 0,void 0,function*(){yield this.exchangeBusyPromise,this.device.removeEventListener("inputreport",this.onInputReport),yield this.device.close()})}setScrambleKey(){}};z.isSupported=yo;z.list=ze;z.listen=t=>{let e=!1;Ro().then(n=>{if(!n)t.error(new ge("Access denied to use Ledger device"));else if(!e){let s=typeof n.productId=="number"?He(n.productId):void 0;t.next({type:"add",descriptor:n,deviceModel:s}),t.complete()}},n=>{t.error(new ge(n.message))});function r(){e=!0}return o(r,"unsubscribe"),{unsubscribe:r}};var ba=z;export{ba as default};
2
+ //# sourceMappingURL=TransportWebHID-HV53OYSS.js.map
@@ -0,0 +1,2 @@
1
+ import{a as i,d as he,m as X}from"./chunk-CVKDPNYM.js";var St="";function rn(t){St=t}i(rn,"setDerivationPath");function q(){return St}i(q,"getDerivationPath");var de=Object.defineProperty,S=i((t,e)=>de(t,"name",{value:e,configurable:!0}),"r"),v=(t=>(t.BTC="BTC",t.BSC="BSC",t.LTC="LTC",t.THORCHAIN="THOR",t.BCH="BCH",t.BINANCE="BNB",t.ETHEREUM="ETH",t.POLYGON="POLYGON",t.TERRA="TERRA",t.POLKADOT="",t.TRON="TRON",t.DOGE="DOGE",t.HARMONY="HARMONY",t.AVAX_CCHAIN="AVAX_CCHAIN",t.FANTOM="FANTOM",t.MOONBEAM="MOONBEAM",t.ARBITRUM="ARBITRUM",t.BOBA="BOBA",t.OPTIMISM="OPTIMISM",t.FUSE="FUSE",t.CRONOS="CRONOS",t.SOLANA="SOLANA",t.MOONRIVER="MOONRIVER",t.GNOSIS="GNOSIS",t.COSMOS="COSMOS",t.OSMOSIS="OSMOSIS",t.AXELAR="AXELAR",t.MARS="MARS",t.STRIDE="STRIDE",t.MAYA="MAYA",t.AKASH="AKASH",t.IRIS="IRIS",t.PERSISTENCE="PERSISTENCE",t.SENTINEL="SENTINEL",t.REGEN="REGEN",t.CRYPTO_ORG="CRYPTO_ORG",t.SIF="SIF",t.CHIHUAHUA="CHIHUAHUA",t.JUNO="JUNO",t.KUJIRA="KUJIRA",t.STARNAME="STARNAME",t.COMDEX="COMDEX",t.STARGAZE="STARGAZE",t.DESMOS="DESMOS",t.BITCANNA="BITCANNA",t.SECRET="SECRET",t.INJECTIVE="INJECTIVE",t.LUMNETWORK="LUMNETWORK",t.BANDCHAIN="BANDCHAIN",t.EMONEY="EMONEY",t.BITSONG="BITSONG",t.KI="KI",t.MEDIBLOC="MEDIBLOC",t.KONSTELLATION="KONSTELLATION",t.UMEE="UMEE",t.STARKNET="STARKNET",t.TON="TON",t.BASE="BASE",t.SUI="SUI",t.Unknown="Unkown",t))(v||{}),le=(t=>(t.CONNECTED="connected",t.CONNECTING="connecting",t.REACHABLE="reachable",t.INSTALLED="installed",t.ACCOUNTS="accounts",t.NETWORK="network",t.NAMESPACE_DISCONNECTED="namespace_disconnected",t.PROVIDER_DISCONNECTED="provider_disconnected",t))(le||{}),an=class{static{i(this,"E")}static{S(this,"Persistor")}getItem(t){let e=localStorage.getItem(t);return e?JSON.parse(e):null}setItem(t,e){localStorage.setItem(t,JSON.stringify(e))}removeItem(t){localStorage.removeItem(t)}};function _t(t,e){return`${e||""}:${t}`}i(_t,"w");S(_t,"formatAddressWithNetwork");function F(t,e){return t?t.map(n=>_t(n,e)):[]}i(F,"y");S(F,"accountAddressesWithNetwork");function fe(t){let[e,n]=t.split(":");return{network:e,address:n}}i(fe,"b");S(fe,"readAccountAddress");function U(t){let{checkInstallation:e=!0}=t.config;return e}i(U,"S");S(U,"needsCheckInstallation");var L=S((t,e)=>(t=typeof t=="string"&&t.startsWith("0x")?parseInt(t):t,Object.values(v).includes(String(t))?t:t==="Binance-Chain-Tigris"?"BNB":e.filter(n=>!!n.chainId).find(n=>(n.chainId?.startsWith("0x")?parseInt(n.chainId):n.chainId)==t)?.name||null),"getBlockChainNameFromId");async function Et(t){if(await t.canEagerConnect())return await t.connectHandler();throw new Error(`can't restore connection for ${t.providerName}.`)}i(Et,"T");S(Et,"eagerConnectHandler");function pe(t){return t.namespace==="EVM"}i(pe,"B");S(pe,"isEvmNamespace");var cn=class{static{i(this,"A")}static{S(this,"Wallet")}provider;actions;state;options;info;cleanupSubscribe;constructor(t,e){this.actions=e,this.options=t,this.provider=null,this.info={supportedBlockchains:[],isContractWallet:!1,isHub:!1},this.state={connected:!1,connecting:!1,reachable:!1,installed:!1,accounts:null,network:null},U(t)||this.setInstalledAs(!0)}async suggestAndConnect(t){return this.actions.suggest&&await this.actions.suggest({instance:this.provider,meta:this.info.supportedBlockchains,network:t}),await this.connect(t)}async connect(t,e){if(this.state.connecting)throw new Error("Connecting...");let n=await this.getConnectionFromState(),r=this.state.network,s=t||r||this.options.config.defaultNetwork;if(n){let d=r!==s&&!!s;if(r===s)return n;let l=!0;if(this.actions.canSwitchNetworkTo&&(l=this.actions.canSwitchNetworkTo({provider:this.provider,meta:this.info.supportedBlockchains,network:s||""})),d&&l&&this.actions.switchNetwork)return await this.actions.switchNetwork({instance:this.provider,meta:this.info.supportedBlockchains,network:s,newInstance:this.tryGetInstance.bind(this),getState:this.getState.bind(this),updateChainId:this.updateChainId.bind(this)}),s!==this.state.network&&!this.options.config.isAsyncSwitchNetwork&&this.updateState({network:t}),{accounts:n.accounts,network:s,provider:this.provider}}let o=await this.tryGetInstance({network:t});this.updateState({connecting:!0}),this.setInstalledAs(!0);try{var a=await this.actions.connect({instance:o,network:s||void 0,meta:this.info.supportedBlockchains||[],namespaces:e})}catch(d){throw this.resetState(),d}this.updateState({connected:!0,reachable:!0,connecting:!1});let c=[],h=null,y;if(Array.isArray(a)){let d=null;c=a.flatMap(l=>{let w=l.chainId||"Unkown",O=L(w,this.info.supportedBlockchains)||"Unkown";return y=l.derivationPath?l.derivationPath:y,!d&&O!=="Unkown"&&this.info.supportedBlockchains.find(Z=>Z.name===O)?.info?.infoType==="EvmMetaInfo"&&(d=O),F(l.accounts,O)}).filter(Boolean),h=d||s||this.options.config.defaultNetwork}else{let d=a.chainId||"Unkown",l=L(d,this.info.supportedBlockchains)||"Unkown",w=a.derivationPath;c=F(a.accounts,l),h=l,y=w}return c.length>0&&this.updateState({accounts:c,network:h,derivationPath:y}),{accounts:this.state.accounts,network:this.state.network,provider:this.provider}}async disconnect(){this.resetState(),this.actions.disconnect&&this.actions.disconnect({instance:this.provider,destroyInstance:()=>{this.setProvider(null)}})}async eagerConnect(){let t=await this.tryGetInstance({network:void 0}),{canEagerConnect:e}=this.actions,n=this.options.config.type;return await Et({canEagerConnect:async()=>{if(!e)throw new Error(`${n} provider hasn't implemented canEagerConnect.`);return await e({instance:t,meta:this.info.supportedBlockchains})},connectHandler:async()=>await this.connect(),providerName:n})}async getSigners(t){return await this.actions.getSigners(t)}getWalletInfo(t){return this.actions.getWalletInfo(t)}canSwitchNetworkTo(t,e){let n=this.actions.canSwitchNetworkTo;return n?n({network:t,meta:this.info.supportedBlockchains,provider:e}):!1}onInit(){if(!this.actions.getInstance)throw new Error(`Provider hasn't defined how to get wallet's instance. provider: ${this.options.config.type} on: onInit`);this.options.config.isAsyncInstance?U(this.options)&&this.actions.getInstance().then(t=>{t&&this.setInstalledAs(!0)}):this.actions.getInstance()&&!this.state.installed&&this.setInstalledAs(!0)}setProvider(t){if(this.provider=t,t&&this.actions.subscribe){let e=this.actions.subscribe({instance:t,state:this.state,meta:this.info.supportedBlockchains,connect:this.connect.bind(this),disconnect:this.disconnect.bind(this),updateAccounts:(n,r)=>{let s=this.state.network;r&&(s=L(r,this.info.supportedBlockchains)||"Unkown");let o=F(n,s);o.length>0&&this.updateState({accounts:o})},updateChainId:this.updateChainId.bind(this)});this.cleanupSubscribe=e}else!t&&this.cleanupSubscribe&&this.cleanupSubscribe()}setInfo(t){typeof t.supportedBlockchains<"u"&&(this.info.supportedBlockchains=t.supportedBlockchains),typeof t.isContractWallet<"u"&&(this.info.isContractWallet=t.isContractWallet)}setHandler(t){this.options.handler=t}getState(){return this.state}updateState(t){let e=[];typeof t.connected<"u"&&(this.state.connected=t.connected,e.push(["connected",t.connected])),typeof t.connecting<"u"&&(this.state.connecting=t.connecting,e.push(["connecting",t.connecting])),typeof t.reachable<"u"&&(this.state.reachable=t.reachable,e.push(["reachable",t.reachable])),typeof t.installed<"u"&&(this.state.installed=t.installed,e.push(["installed",t.installed])),typeof t.accounts<"u"&&(this.state.accounts=t.accounts,this.state.derivationPath=t.derivationPath,e.push(["accounts",t.accounts])),typeof t.network<"u"&&(this.state.network=t.network,e.push(["network",t.network]));let n=this.getState();e.forEach(([r,s])=>{let o={supportedBlockchains:this.info.supportedBlockchains,isContractWallet:this.info.isContractWallet,isHub:!1};this.options.handler(this.options.config.type,r,s,n,o)})}resetState(){this.updateState({connected:!1,connecting:!1,reachable:!1,accounts:null,network:null})}async getConnectionFromState(){return this.state.connected&&this.provider?{accounts:this.state.accounts,network:this.state.network,provider:this.provider}:null}updateChainId(t){let e=t?L(t,this.info.supportedBlockchains):"Unkown";this.updateState({network:e})}setInstalledAs(t){!U(this.options)&&t===!1||this.updateState({installed:t})}async tryGetInstance({network:t,force:e}){let n=null;if(this.setProvider(null),this.options.config.isAsyncInstance){let r={currentProvider:this.provider,meta:this.info.supportedBlockchains,force:e||!1,updateChainId:this.updateChainId.bind(this),getState:this.getState.bind(this)};t&&(r.network=t),n=await this.actions.getInstance(r)}else n=this.actions.getInstance();if(!n){this.setInstalledAs(!1),this.resetState();let r=`It seems your selected wallet (${this.options.config.type}) isn't installed.`;throw new Error(r)}return this.setProvider(n),n}};var ve={};he(ve,{AccountId:()=>E,AssetId:()=>Nt,AssetType:()=>At,ChainId:()=>_});function Q(){return Q=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Q.apply(this,arguments)}i(Q,"_extends");var tt={name:"chainId",regex:"[-:a-zA-Z0-9]{5,41}",parameters:{delimiter:":",values:{0:{name:"namespace",regex:"[-a-z0-9]{3,8}"},1:{name:"reference",regex:"[-a-zA-Z0-9]{1,32}"}}}},me={name:"accountId",regex:"[-:a-zA-Z0-9]{7,106}",parameters:{delimiter:":",values:{0:{name:"namespace",regex:"[-a-z0-9]{3,8}"},1:{name:"reference",regex:"[-a-zA-Z0-9]{1,32}"},2:{name:"address",regex:"[a-zA-Z0-9]{1,64}"}}}},et={name:"assetName",regex:"[-:a-zA-Z0-9]{5,73}",parameters:{delimiter:":",values:{0:{name:"namespace",regex:"[-a-z0-9]{3,8}"},1:{name:"reference",regex:"[-a-zA-Z0-9]{1,64}"}}}},ge={name:"assetType",regex:"[-:a-zA-Z0-9]{11,115}",parameters:{delimiter:"/",values:{0:tt,1:et}}},ye={name:"assetId",regex:"[-:a-zA-Z0-9]{13,148}",parameters:{delimiter:"/",values:{0:tt,1:et,2:{name:"tokenId",regex:"[-a-zA-Z0-9]{1,32}"}}}},M={2:tt,10:me,19:{assetName:et,assetType:ge,assetId:ye}};function It(t,e){return t.split(e.parameters.delimiter)}i(It,"splitParams");function T(t,e){var n=It(t,e),r={};return n.forEach(function(s,o){r[e.parameters.values[o].name]=s}),r}i(T,"getParams");function C(t,e){return Object.values(e.parameters.values).map(function(n){var r=t[n.name];return typeof r=="string"?r:C(r,n)}).join(e.parameters.delimiter)}i(C,"joinParams");function R(t,e){if(!new RegExp(e.regex).test(t))return!1;var n=It(t,e);if(n.length!==Object.keys(e.parameters.values).length)return!1;var r=n.map(function(s,o){return new RegExp(e.parameters.values[o].regex).test(s)}).filter(function(s){return!!s});return r.length===n.length}i(R,"isValidId");var _=function(){function t(n){typeof n=="string"&&(n=t.parse(n)),this.namespace=n.namespace,this.reference=n.reference}i(t,"ChainId"),t.parse=i(function(r){if(!R(r,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+r);return new t(T(r,this.spec)).toJSON()},"parse"),t.format=i(function(r){return C(r,this.spec)},"format");var e=t.prototype;return e.toString=i(function(){return t.format(this.toJSON())},"toString"),e.toJSON=i(function(){return{namespace:this.namespace,reference:this.reference}},"toJSON"),t}();_.spec=M[2];var E=function(){function t(n){typeof n=="string"&&(n=t.parse(n)),this.chainId=new _(n.chainId),this.address=n.address}i(t,"AccountId"),t.parse=i(function(r){if(!R(r,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+r);var s=T(r,this.spec),o=s.namespace,a=s.reference,c=s.address,h=new _({namespace:o,reference:a});return new t({chainId:h,address:c}).toJSON()},"parse"),t.format=i(function(r){var s=new _(r.chainId),o=Q({},s.toJSON(),{address:r.address});return C(o,this.spec)},"format");var e=t.prototype;return e.toString=i(function(){return t.format(this.toJSON())},"toString"),e.toJSON=i(function(){return{chainId:this.chainId.toJSON(),address:this.address}},"toJSON"),t}();E.spec=M[10];var nt=function(){function t(n){typeof n=="string"&&(n=t.parse(n)),this.namespace=n.namespace,this.reference=n.reference}i(t,"AssetName"),t.parse=i(function(r){if(!R(r,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+r);return new t(T(r,this.spec)).toJSON()},"parse"),t.format=i(function(r){return C(r,this.spec)},"format");var e=t.prototype;return e.toString=i(function(){return t.format(this.toJSON())},"toString"),e.toJSON=i(function(){return{namespace:this.namespace,reference:this.reference}},"toJSON"),t}();nt.spec=M[19].assetName;var At=function(){function t(n){typeof n=="string"&&(n=t.parse(n)),this.chainId=new _(n.chainId),this.assetName=new nt(n.assetName)}i(t,"AssetType"),t.parse=i(function(r){if(!R(r,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+r);return new t(T(r,this.spec)).toJSON()},"parse"),t.format=i(function(r){return C(r,this.spec)},"format");var e=t.prototype;return e.toString=i(function(){return t.format(this.toJSON())},"toString"),e.toJSON=i(function(){return{chainId:this.chainId.toJSON(),assetName:this.assetName}},"toJSON"),t}();At.spec=M[19].assetType;var Nt=function(){function t(n){typeof n=="string"&&(n=t.parse(n)),this.chainId=new _(n.chainId),this.assetName=new nt(n.assetName),this.tokenId=n.tokenId}i(t,"AssetId"),t.parse=i(function(r){if(!R(r,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+r);return new t(T(r,this.spec)).toJSON()},"parse"),t.format=i(function(r){return C(r,this.spec)},"format");var e=t.prototype;return e.toString=i(function(){return t.format(this.toJSON())},"toString"),e.toJSON=i(function(){return{chainId:this.chainId.toJSON(),assetName:this.assetName.toJSON(),tokenId:this.tokenId}},"toJSON"),t}();Nt.spec=M[19].assetId;var bt=i(t=>{let e,n=new Set,r=i((d,l)=>{let w=typeof d=="function"?d(e):d;if(!Object.is(w,e)){let O=e;e=l??(typeof w!="object"||w===null)?w:Object.assign({},e,w),n.forEach(Z=>Z(e,O))}},"setState"),s=i(()=>e,"getState"),h={setState:r,getState:s,getInitialState:i(()=>y,"getInitialState"),subscribe:i(d=>(n.add(d),()=>n.delete(d)),"subscribe"),destroy:i(()=>{(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()},"destroy")},y=e=t(r,s,h);return h},"createStoreImpl"),Ot=i(t=>t?bt(t):bt,"createStore");var Rt=Symbol.for("immer-nothing"),Ct=Symbol.for("immer-draftable"),f=Symbol.for("immer-state");function m(t,...e){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}i(m,"die");var P=Object.getPrototypeOf;function k(t){return!!t&&!!t[f]}i(k,"isDraft");function A(t){return t?xt(t)||Array.isArray(t)||!!t[Ct]||!!t.constructor?.[Ct]||Y(t)||V(t):!1}i(A,"isDraftable");var we=Object.prototype.constructor.toString();function xt(t){if(!t||typeof t!="object")return!1;let e=P(t);if(e===null)return!0;let n=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===we}i(xt,"isPlainObject");function H(t,e){W(t)===0?Reflect.ownKeys(t).forEach(n=>{e(n,t[n],t)}):t.forEach((n,r)=>e(r,n,t))}i(H,"each");function W(t){let e=t[f];return e?e.type_:Array.isArray(t)?1:Y(t)?2:V(t)?3:0}i(W,"getArchtype");function it(t,e){return W(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}i(it,"has");function Dt(t,e,n){let r=W(t);r===2?t.set(e,n):r===3?t.add(n):t[e]=n}i(Dt,"set");function Se(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}i(Se,"is");function Y(t){return t instanceof Map}i(Y,"isMap");function V(t){return t instanceof Set}i(V,"isSet");function I(t){return t.copy_||t.base_}i(I,"latest");function ot(t,e){if(Y(t))return new Map(t);if(V(t))return new Set(t);if(Array.isArray(t))return Array.prototype.slice.call(t);let n=xt(t);if(e===!0||e==="class_only"&&!n){let r=Object.getOwnPropertyDescriptors(t);delete r[f];let s=Reflect.ownKeys(r);for(let o=0;o<s.length;o++){let a=s[o],c=r[a];c.writable===!1&&(c.writable=!0,c.configurable=!0),(c.get||c.set)&&(r[a]={configurable:!0,writable:!0,enumerable:c.enumerable,value:t[a]})}return Object.create(P(t),r)}else{let r=P(t);if(r!==null&&n)return{...t};let s=Object.create(r);return Object.assign(s,t)}}i(ot,"shallowCopy");function dt(t,e=!1){return G(t)||k(t)||!A(t)||(W(t)>1&&(t.set=t.add=t.clear=t.delete=_e),Object.freeze(t),e&&Object.entries(t).forEach(([n,r])=>dt(r,!0))),t}i(dt,"freeze");function _e(){m(2)}i(_e,"dontMutateFrozenCollections");function G(t){return Object.isFrozen(t)}i(G,"isFrozen");var Ee={};function N(t){let e=Ee[t];return e||m(0,t),e}i(N,"getPlugin");var x;function Bt(){return x}i(Bt,"getCurrentScope");function Ie(t,e){return{drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}i(Ie,"createScope");function Pt(t,e){e&&(N("Patches"),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}i(Pt,"usePatchesInScope");function at(t){ct(t),t.drafts_.forEach(Ae),t.drafts_=null}i(at,"revokeScope");function ct(t){t===x&&(x=t.parent_)}i(ct,"leaveScope");function kt(t){return x=Ie(x,t)}i(kt,"enterScope");function Ae(t){let e=t[f];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}i(Ae,"revokeDraft");function Mt(t,e){e.unfinalizedDrafts_=e.drafts_.length;let n=e.drafts_[0];return t!==void 0&&t!==n?(n[f].modified_&&(at(e),m(4)),A(t)&&(t=$(e,t),e.parent_||J(e,t)),e.patches_&&N("Patches").generateReplacementPatches_(n[f].base_,t,e.patches_,e.inversePatches_)):t=$(e,n,[]),at(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==Rt?t:void 0}i(Mt,"processResult");function $(t,e,n){if(G(e))return e;let r=e[f];if(!r)return H(e,(s,o)=>Tt(t,r,e,s,o,n)),e;if(r.scope_!==t)return e;if(!r.modified_)return J(t,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;let s=r.copy_,o=s,a=!1;r.type_===3&&(o=new Set(s),s.clear(),a=!0),H(o,(c,h)=>Tt(t,r,s,c,h,n,a)),J(t,s,!1),n&&t.patches_&&N("Patches").generatePatches_(r,n,t.patches_,t.inversePatches_)}return r.copy_}i($,"finalize");function Tt(t,e,n,r,s,o,a){if(k(s)){let c=o&&e&&e.type_!==3&&!it(e.assigned_,r)?o.concat(r):void 0,h=$(t,s,c);if(Dt(n,r,h),k(h))t.canAutoFreeze_=!1;else return}else a&&n.add(s);if(A(s)&&!G(s)){if(!t.immer_.autoFreeze_&&t.unfinalizedDrafts_<1)return;$(t,s),(!e||!e.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&J(t,s)}}i(Tt,"finalizeProperty");function J(t,e,n=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&dt(e,n)}i(J,"maybeFreeze");function Ne(t,e){let n=Array.isArray(t),r={type_:n?1:0,scope_:e?e.scope_:Bt(),modified_:!1,finalized_:!1,assigned_:{},parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1},s=r,o=lt;n&&(s=[r],o=D);let{revoke:a,proxy:c}=Proxy.revocable(s,o);return r.draft_=c,r.revoke_=a,c}i(Ne,"createProxyProxy");var lt={get(t,e){if(e===f)return t;let n=I(t);if(!it(n,e))return be(t,n,e);let r=n[e];return t.finalized_||!A(r)?r:r===rt(t.base_,e)?(st(t),t.copy_[e]=ht(r,t)):r},has(t,e){return e in I(t)},ownKeys(t){return Reflect.ownKeys(I(t))},set(t,e,n){let r=zt(I(t),e);if(r?.set)return r.set.call(t.draft_,n),!0;if(!t.modified_){let s=rt(I(t),e),o=s?.[f];if(o&&o.base_===n)return t.copy_[e]=n,t.assigned_[e]=!1,!0;if(Se(n,s)&&(n!==void 0||it(t.base_,e)))return!0;st(t),ut(t)}return t.copy_[e]===n&&(n!==void 0||e in t.copy_)||Number.isNaN(n)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=n,t.assigned_[e]=!0),!0},deleteProperty(t,e){return rt(t.base_,e)!==void 0||e in t.base_?(t.assigned_[e]=!1,st(t),ut(t)):delete t.assigned_[e],t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){let n=I(t),r=Reflect.getOwnPropertyDescriptor(n,e);return r&&{writable:!0,configurable:t.type_!==1||e!=="length",enumerable:r.enumerable,value:n[e]}},defineProperty(){m(11)},getPrototypeOf(t){return P(t.base_)},setPrototypeOf(){m(12)}},D={};H(lt,(t,e)=>{D[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}});D.deleteProperty=function(t,e){return D.set.call(this,t,e,void 0)};D.set=function(t,e,n){return lt.set.call(this,t[0],e,n,t[0])};function rt(t,e){let n=t[f];return(n?I(n):t)[e]}i(rt,"peek");function be(t,e,n){let r=zt(e,n);return r?"value"in r?r.value:r.get?.call(t.draft_):void 0}i(be,"readPropFromProto");function zt(t,e){if(!(e in t))return;let n=P(t);for(;n;){let r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=P(n)}}i(zt,"getDescriptorFromProto");function ut(t){t.modified_||(t.modified_=!0,t.parent_&&ut(t.parent_))}i(ut,"markChanged");function st(t){t.copy_||(t.copy_=ot(t.base_,t.scope_.immer_.useStrictShallowCopy_))}i(st,"prepareCopy");var Oe=class{static{i(this,"Immer2")}constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,n,r)=>{if(typeof e=="function"&&typeof n!="function"){let o=n;n=e;let a=this;return i(function(h=o,...y){return a.produce(h,d=>n.call(this,d,...y))},"curriedProduce")}typeof n!="function"&&m(6),r!==void 0&&typeof r!="function"&&m(7);let s;if(A(e)){let o=kt(this),a=ht(e,void 0),c=!0;try{s=n(a),c=!1}finally{c?at(o):ct(o)}return Pt(o,r),Mt(s,o)}else if(!e||typeof e!="object"){if(s=n(e),s===void 0&&(s=e),s===Rt&&(s=void 0),this.autoFreeze_&&dt(s,!0),r){let o=[],a=[];N("Patches").generateReplacementPatches_(e,s,o,a),r(o,a)}return s}else m(1,e)},this.produceWithPatches=(e,n)=>{if(typeof e=="function")return(a,...c)=>this.produceWithPatches(a,h=>e(h,...c));let r,s;return[this.produce(e,n,(a,c)=>{r=a,s=c}),r,s]},typeof t?.autoFreeze=="boolean"&&this.setAutoFreeze(t.autoFreeze),typeof t?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(t.useStrictShallowCopy)}createDraft(t){A(t)||m(8),k(t)&&(t=Ce(t));let e=kt(this),n=ht(t,void 0);return n[f].isManual_=!0,ct(e),n}finishDraft(t,e){let n=t&&t[f];(!n||!n.isManual_)&&m(9);let{scope_:r}=n;return Pt(r,e),Mt(void 0,r)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}applyPatches(t,e){let n;for(n=e.length-1;n>=0;n--){let s=e[n];if(s.path.length===0&&s.op==="replace"){t=s.value;break}}n>-1&&(e=e.slice(n+1));let r=N("Patches").applyPatches_;return k(t)?r(t,e):this.produce(t,s=>r(s,e))}};function ht(t,e){let n=Y(t)?N("MapSet").proxyMap_(t,e):V(t)?N("MapSet").proxySet_(t,e):Ne(t,e);return(e?e.scope_:Bt()).drafts_.push(n),n}i(ht,"createProxy");function Ce(t){return k(t)||m(10,t),Lt(t)}i(Ce,"current");function Lt(t){if(!A(t)||G(t))return t;let e=t[f],n;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,n=ot(t,e.scope_.immer_.useStrictShallowCopy_)}else n=ot(t,!0);return H(n,(r,s)=>{Dt(n,r,Lt(s))}),e&&(e.finalized_=!1),n}i(Lt,"currentImpl");var p=new Oe,b=p.produce,gn=p.produceWithPatches.bind(p),yn=p.setAutoFreeze.bind(p),vn=p.setUseStrictShallowCopy.bind(p),wn=p.applyPatches.bind(p),Sn=p.createDraft.bind(p),_n=p.finishDraft.bind(p);var Ft=Object.defineProperty,g=i((t,e)=>Ft(t,"name",{value:e,configurable:!0}),"e"),B=i((t,e)=>{for(var n in e)Ft(t,n,{get:e[n],enumerable:!0})},"a"),Pe={};B(Pe,{changeAccountSubscriber:()=>Jt,connect:()=>Wt,recommended:()=>Me});function Ut(t){let[,e]=t.state();e("network",null),e("accounts",null),e("connected",!1),e("connecting",!1)}i(Ut,"A");g(Ut,"disconnect");var ke=[["disconnect",Ut]],Ht="solana",j="5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";async function $t(t){return{accounts:[(await t.connect()).publicKey.toString()],chainId:"SOLANA"}}i($t,"N");g($t,"getAccounts");var Me=[...ke];function Jt(t){let e;return[(n,r)=>{let s=t();if(!s)throw new Error("Trying to subscribe to your Solana wallet, but seems its instance is not available.");let[,o]=n.state();return e=g(a=>{if(!a){n.action("disconnect");return}o("accounts",[E.format({address:a.toString(),chainId:{namespace:Ht,reference:j}})])},"eventCallback"),s.on("accountChanged",e),r},(n,r)=>{let s=t();return e&&s&&s.off("accountChanged",e),r}]}i(Jt,"j");g(Jt,"changeAccountSubscriber");function Wt(t){return async()=>{let e=t(),n=await $t(e);if(Array.isArray(n))throw new Error("Expecting solana response to be a single value, not an array.");return n.accounts.map(r=>E.format({address:r,chainId:{namespace:Ht,reference:j}}))}}i(Wt,"_");g(Wt,"connect");var Te={};B(Te,{recommended:()=>xe});function ft(t){let[,e]=t.state();e("connecting",!1)}i(ft,"u");g(ft,"intoConnectionFinished");var Re=[["connect",ft]],xe=[...Re],De={};B(De,{recommended:()=>Le});var Be=class{static{i(this,"r")}static{g(this,"ActionBuilder")}name;#t=new Map;#n=new Map;#s=new Map;#e=new Map;#r;constructor(t){this.name=t}and(t){return this.#t.has(this.name)||this.#t.set(this.name,[]),this.#t.get(this.name)?.push(t),this}or(t){return this.#n.has(this.name)||this.#n.set(this.name,[]),this.#n.get(this.name)?.push(t),this}before(t){return this.#e.has(this.name)||this.#e.set(this.name,[]),this.#e.get(this.name)?.push(t),this}after(t){return this.#s.has(this.name)||this.#s.set(this.name,[]),this.#s.get(this.name)?.push(t),this}action(t){return this.#r=t,this}build(){if(!this.#r)throw new Error("Your action builder should includes an action.");return{actionName:this.name,action:this.#r,before:this.#e,after:this.#s,and:this.#t,or:this.#n}}};function Yt(t){try{return E.parse(t),!0}catch{return!1}}i(Yt,"T");g(Yt,"isValidCaipAddress");function pt(t,e){if(!e.every(Yt))throw new Error(`Your provider should format account addresses in CAIP-10 format. Your provided accounts: ${e}`);let[,n]=t.state();return n("accounts",e),n("connected",!0),e}i(pt,"c");g(pt,"connectAndUpdateStateForSingleNetwork");function mt(t){let[,e]=t.state();e("connecting",!0)}i(mt,"l");g(mt,"intoConnecting");var ze=[["connect",mt]],Le=[["connect",pt]],Fe={};B(Fe,{recommended:()=>Ue});var Ue=[...ze],He={};B(He,{connect:()=>$e});var $e=g(()=>new Be("connect").and(pt).before(mt).after(ft),"connect");import{dynamicImportWithRefinedError as oe,ETHEREUM_CHAIN_ID as ae}from"@rango-dev/wallets-shared";import en from"bs58";var Je=Object.defineProperty,u=i((t,e)=>Je(t,"name",{value:e,configurable:!0}),"a");function Kt(t){return t.constructor.name==="AsyncFunction"}i(Kt,"w");u(Kt,"isAsync");function Zt(t,e){return`${t}$$${e}`}i(Zt,"l");u(Zt,"generateStoreId");var gt=u(t=>`Couldn't find "${t}" action. Are you sure you've added the action?`,"ACTION_NOT_FOUND_ERROR"),We=u(t=>`An error occurred during running ${t}`,"OR_ELSE_ACTION_FAILED_ERROR"),Vt=u(t=>`An error occurred during running before for "${t}" action`,"BEFORE_ACTION_FAILED_ERROR"),Ye="For setup store, you should set `store` first.",Ve=class{static{i(this,"u")}static{u(this,"Namespace")}namespaceId;providerId;#t;#n=new Map;#s=new Map;#e=new Map;#r=new Map;#i=!1;#o;#c;constructor(t,e,n){let{configs:r,actions:s}=n;this.namespaceId=t,this.providerId=e,this.#c=r||new Map,this.#t=s,n.store&&this.store(n.store)}init(){if(this.#i)return;let t=this.#t.get("init");t&&t(this.#a()),this.#i=!0}state(){let t=this.#o;if(!t)throw new Error("You need to set your store using `.store` method first.");let e=this.#p();return[u(n=>{let r=t.getState().namespaces.getNamespaceData(e);return n?r[n]:r},"getState"),u((n,r)=>{t.getState().namespaces.updateStatus(e,n,r)},"setState")]}store(t){return this.#o&&console.warn("You've already set an store for your Namespace. Old store will be replaced by the new one."),this.#o=t,this.#g(),this}and_then(t,e){let n=this.#n.get(t)||[];return this.#n.set(t,n.concat(e)),this}or_else(t,e){let n=this.#s.get(t)||[];return this.#s.set(t,n.concat(e)),this}after(t,e,n){let r=this.#r.get(t)||[],s={hook:e,options:{context:n?.context}};return this.#r.set(t,r.concat(s)),this}before(t,e,n){let r=this.#e.get(t)||[],s={hook:e,options:{context:n?.context}};return this.#e.set(t,r.concat(s)),this}has(t){return!!this.#t.get(t)}run(t,...e){let n=this.#t.get(t);if(!n)throw new Error(gt(t.toString()));return Kt(n)?this.#m(t,e):this.#h(t,e)}#h(t,e){try{this.#d(t)}catch(o){throw this.#u(t),new Error(Vt(t.toString()),{cause:o})}let n=this.#t.get(t);if(!n)throw new Error(gt(t.toString()));let r=this.#a(),s;try{s=n(r,...e),s=this.#l(t,s)}catch(o){s=this.#f(t,o)}finally{this.#u(t)}return s}async#m(t,e){try{this.#d(t)}catch(s){throw this.#u(t),new Error(Vt(t.toString()),{cause:s})}let n=this.#t.get(t);if(!n)throw new Error(gt(t.toString()));let r=this.#a();return await n(r,...e).then(s=>this.#l(t,s)).catch(s=>this.#f(t,s)).finally(()=>this.#u(t))}#u(t){let e=this.#r.get(t);e&&e.forEach(n=>{let r=n.options?.context||this.#a();n.hook(r)})}#d(t){let e=this.#e.get(t);e&&e.forEach(n=>{let r=n.options?.context||this.#a();n.hook(r)})}#l(t,e){let n=this.#n.get(t);if(n){let r=this.#a();e=n.reduce((s,o)=>o(r,s),e)}return e}#f(t,e){let n=this.#s.get(t);if(n)try{let r=this.#a();return n.reduce((s,o)=>o(r,s),e)}catch(r){if(r instanceof Error)throw r.cause=e,r;let s=We(`${t.toString()} for ${this.namespaceId} namespace.`),o=new Error(String(r),{cause:e});throw new Error(s,{cause:o})}else throw e}#g(){let t=this.#o;if(!t)throw new Error(Ye);let e=this.#p();t.getState().namespaces.addNamespace(e,{namespaceId:this.namespaceId,providerId:this.providerId})}#p(){return Zt(this.providerId,this.namespaceId)}#a(){return{state:this.state.bind(this),action:this.run.bind(this)}}},Ge="1.0",je=class{static{i(this,"m")}static{u(this,"Provider")}id;version=Ge;#t;#n=!1;#s={};#e;#r;constructor(t,e,n,r){this.id=t,this.#r=n,this.#s=r?.extendInternalActions||{},this.#t=e,r?.store&&(this.#e=r.store,this.#o())}init(){if(this.#n)return;let t=this.#s.init;t&&t(this.#c()),this.#n=!0}state(){let t=this.#e;if(!t)throw new Error(`Any store detected for ${this.id}. You need to set your store using '.store' method first.`);return[u(e=>{let n=t.getState().providers.guessNamespacesState(this.id);if(!e)return n;switch(e){case"installed":case"connected":case"connecting":return n[e];default:throw new Error("Unhandled state for provider")}},"getState"),u((e,n)=>{switch(e){case"installed":return t.getState().providers.updateStatus(this.id,e,n);default:throw new Error(`Unhandled state update for provider. (provider id: ${this.id}, state name: ${e})`)}},"setState")]}store(t){return this.#e&&console.warn("You've already set an store for your Provider. Old store will be replaced by the new one."),this.#e=t,this.#o(),this}info(){let t=this.#e;if(!t)return this.#r;let e=t.getState().providers.list[this.id].config;return{metadata:e.metadata,deepLink:e.deepLink}}getAll(){return this.#t}get(t){return this.#t.get(t)}findByNamespace(t){let e;return this.#t.forEach(n=>{n.namespaceId===t&&(e=n)}),e}before(t,e){return this.#i("before",t,e),this}after(t,e){return this.#i("after",t,e),this}#i(t,e,n){let r={state:this.state.bind(this)};return this.#t.forEach(s=>{if(t==="after")s.after(e,n,{context:r});else if(t==="before")s.before(e,n,{context:r});else throw new Error(`You hook name is invalid: ${t}`)}),this}#o(){let t=this.#e;if(!t)throw new Error("For setup store, you should set `store` first.");t.getState().providers.addProvider(this.id,this.#r),this.#t.forEach(e=>{e.store(t)})}#c(){return{state:this.state.bind(this)}}},Mn=class{static{i(this,"g")}static{u(this,"Hub")}#t=new Map;#n;constructor(t){this.#n=t??{}}init(){this.runAll("init")}runAll(t){let e=[],n=this.#t.values();for(let r of n){let s={id:r.id,provider:void 0,namespaces:[]},o=r[t];typeof o=="function"&&(s.provider=o.call(r));let a=r.getAll().values();for(let c of a){let h=c[t];if(typeof h=="function"){let y=h();s.namespaces.push(y)}}e.push(s)}return e}add(t,e){return this.#n.store&&e.store(this.#n.store),this.#t.set(t,e),this}remove(t){if(!this.#t.get(t))throw new Error(`Provider not found: No provider exists with ID "${t}"`);return this.#n.store?.getState().providers.removeProvider(t),this.#t.delete(t),this}get(t){return this.#t.get(t)}getAll(){return this.#t}state(){let t=this.runAll("state"),e={};return t.forEach(n=>{let r=[];n.namespaces.forEach(o=>{let[a]=o;r.push(a())});let[s]=n.provider;e[n.id]={...s()||{},namespaces:r}}),e}};function K(t,e){let n=t.namespaces.list,r=Object.keys(n).filter(c=>n[c].info.providerId===e),s=!!t.providers.list[e]?.data.installed,o=r.length>0?r.some(c=>n[c].data.connected):!1,a=r.length>0?r.some(c=>n[c].data.connecting):!1;return{installed:s,connected:o,connecting:a}}i(K,"d");u(K,"guessProviderStateSelector");function Xt(t,e){return t.namespaces.list[e].data}i(Xt,"v");u(Xt,"namespaceStateSelector");function qt(t){let e=u(n=>r=>{let s=u((o,a,c)=>{for(let h of o)r(h,a,c)},"executeListener");return n.subscribe((o,a)=>{let c=Qt(o,a),h=[...yt(o),...c];s(h,o,a)}),{flushEvents:()=>{let o=n.getState(),a=yt(o);s(a,o,o)}}},"extendedSubscribe");return new Proxy(t,{get:function(n,r,s){return r==="subscribe"?e(n):Reflect.get(n,r,s)}})}i(qt,"T");u(qt,"extend");function yt(t){return[...t.providers.events,...t.namespaces.events]}i(yt,"k");u(yt,"tryConsumeEvents");function Qt(t,e){let n=[];for(let r of Object.keys(t.providers.list)){let s=K(t,r),o=K(e,r);if(o.connecting!==s.connecting){let a={type:"provider_connecting",provider:r,value:s.connecting};n.push(a)}if(!o.connected&&s.connected){let a={type:"provider_connected",provider:r};n.push(a)}if(o.connected&&!s.connected){let a={type:"provider_disconnected",provider:r};n.push(a)}}return n}i(Qt,"W");u(Qt,"getEventsLike");var Ke=u(()=>({config:{}}),"hubStore"),te=class{static{i(this,"h")}static{u(this,"ConsumableEvents")}#t=[];push(t){this.#t.push(t)}[Symbol.iterator](){return{next:()=>this.#t.length==0?{done:!0,value:void 0}:{done:!1,value:this.#t.shift()}}}},Ze=u((t,e)=>({events:new te,list:{},addNamespace:(n,r)=>{let s={data:{accounts:null,network:null,connected:!1,connecting:!1},error:"",info:r};t(b(o=>{o.namespaces.list[n]=s}))},updateStatus:(n,r,s)=>{let o=e().namespaces.list[n];if(!o)throw new Error(`No namespace with '${n}' found.`);e().namespaces._produceEventsWhenUpdatingStatus(o,n,r,s),t(b(a=>{a.namespaces.list[n].data[r]=s}))},getNamespaceData(n){return Xt(e(),n)},_produceEventsWhenUpdatingStatus:(n,r,s,o)=>{if(s==="accounts")if(Object.is(o,null)||Array.isArray(o)&&o.length===0){if(e().namespaces.list[r].data.connected){let a={type:"namespace_disconnected",provider:n.info.providerId,namespace:n.info.namespaceId};e().namespaces.events.push(a)}}else{let a=e().namespaces.list[r].data.accounts;if(a){if(a.sort().toString()!==o.sort().toString()){let c={type:"namespace_account_switched",provider:n.info.providerId,namespace:n.info.namespaceId,previousAccounts:a,accounts:o};e().namespaces.events.push(c)}}else{let c={type:"namespace_connected",provider:n.info.providerId,namespace:n.info.namespaceId,accounts:o};e().namespaces.events.push(c)}}else if(s==="network"){let a=e().namespaces.list[r].data.network,c={type:"namespace_network_switched",provider:n.info.providerId,namespace:n.info.namespaceId,network:o,previousNetwork:a};e().namespaces.events.push(c)}}}),"namespacesStore"),Xe=u((t,e)=>({events:new te,list:{},addProvider:(n,r)=>{let s={data:{installed:!1},error:"",config:r};t(b(o=>{o.providers.list[n]=s}))},removeProvider:n=>{t(b(r=>{delete r.providers.list[n]}))},updateStatus:(n,r,s)=>{let o=e().providers.list[n];if(!o)throw new Error(`No namespace namespace with '${n}' found.`);e().providers._produceEventsWhenUpdatingStatus(o,n,r,s),t(b(a=>{a.providers.list[n].data[r]=s}))},guessNamespacesState:n=>K(e(),n),_produceEventsWhenUpdatingStatus:(n,r,s,o)=>{if(s==="installed"){let a={type:"provider_detected",provider:r};e().providers.events.push(a)}}}),"providersStore"),Dn=u(()=>{let t=Ot((...e)=>({hub:Ke(...e),providers:Xe(...e),namespaces:Ze(...e)}));return qt(t)},"createStore"),Gt=["init","state","after","before","and_then","or_else","store"],jt=["string","number"],Bn=class{static{i(this,"S")}static{u(this,"NamespaceBuilder")}#t;#n;#s=new Map;#e=[];#r;constructor(t,e){this.#t=t,this.#n=e,this.#r={}}config(t,e){return this.#r[t]=e,this}action(t,e){return Array.isArray(t)?(t.forEach(([n,r])=>{this.#s.set(n,r)}),this):typeof t=="object"&&t?.actionName?(this.#e.push(t),this):(e&&this.#s.set(t,e),this)}build(){if(this.#i(this.#r))return this.#h(this.#r);throw new Error("You namespace config isn't valid.")}#i(t){return!0}#o(t){this.#e.forEach(e=>{e.after.forEach(n=>{n.map(r=>{t.after(e.actionName,r)})}),e.before.forEach(n=>{n.map(r=>{t.before(e.actionName,r)})}),e.and.forEach(n=>{n.map(r=>{t.and_then(e.actionName,r)})}),e.or.forEach(n=>{n.map(r=>{t.or_else(e.actionName,r)})})})}#c(){this.#e.forEach(t=>{this.#s.set(t.actionName,t.action)})}#h(t){this.#c();let e=new Ve(this.#t,this.#n,{configs:t,actions:this.#s});return this.#o(e),new Proxy(e,{has:(n,r)=>{if(typeof r!="string")throw new Error("You can use string as your property on Namespace instance.");return Gt.includes(r)||jt.includes(typeof e[r])?!0:e.has(r)},get:(n,r)=>{if(typeof r!="string")throw new Error("You can use string as your property on Namespace instance.");let s=e[r];return Gt.includes(r)?s.bind(e):jt.includes(typeof s)?s:e.run.bind(e,r)},set:()=>{throw new Error("You can not set anything on this object.")}})}},zn=class{static{i(this,"x")}static{u(this,"ProviderBuilder")}#t;#n=new Map;#s={};#e={};#r;constructor(t,e){this.#t=t,this.#r=e||{}}add(t,e){return this.#r.store&&e.store(this.#r.store),this.#n.set(t,e),this}config(t,e){return this.#e[t]=e,this}init(t){return this.#s.init=t,this}build(){if(this.#i(this.#e))return new je(this.#t,this.#n,this.#e,{extendInternalActions:this.#s,store:this.#r.store});throw new Error("You need to set all required configs.")}#i(t){return!!t.metadata}},Ln=class{static{i(this,"b")}static{u(this,"ActionBuilder")}name;#t=new Map;#n=new Map;#s=new Map;#e=new Map;#r;constructor(t){this.name=t}and(t){return this.#t.has(this.name)||this.#t.set(this.name,[]),this.#t.get(this.name)?.push(t),this}or(t){return this.#n.has(this.name)||this.#n.set(this.name,[]),this.#n.get(this.name)?.push(t),this}before(t){return this.#e.has(this.name)||this.#e.set(this.name,[]),this.#e.get(this.name)?.push(t),this}after(t){return this.#s.has(this.name)||this.#s.set(this.name,[]),this.#s.get(this.name)?.push(t),this}action(t){return this.#r=t,this}build(){if(!this.#r)throw new Error("Your action builder should includes an action.");return{actionName:this.name,action:this.#r,before:this.#e,after:this.#s,and:this.#t,or:this.#n}}};function qe(t,e){if(!e)throw new Error("You should provide a valid semver, e.g 1.0.0.");let n=t.find(([r])=>r===e);if(!n)throw new Error(`You target version hasn't been found. Available versions: ${Object.keys(t).join(", ")}`);return n}i(qe,"L");u(qe,"pickVersion");function Qe(){let t=[],e={version:(n,r)=>(t.push([n,r]),e),build:()=>t};return e}i(Qe,"H");u(Qe,"defineVersions");import{Networks as re}from"@rango-dev/wallets-shared";import"rango-types";import{dynamicImportWithRefinedError as ee}from"@rango-dev/wallets-shared";import{DefaultSignerFactory as tn,TransactionType as ne}from"rango-types";async function vt(){let t=new tn,{EthereumSigner:e}=await ee(async()=>await import("./ethereum-4K63WN6K.js")),{SolanaSigner:n}=await ee(async()=>await import("./solana-KIPRMAWD.js"));return t.registerSigner(ne.EVM,new e),t.registerSigner(ne.SOLANA,new n),t}i(vt,"getSigners");var sr=[v.ETHEREUM,v.POLYGON,v.BASE],se=16,ir="ledger",or={name:"Ledger",icon:"https://raw.githubusercontent.com/rango-exchange/assets/main/wallets/ledger/icon.svg",extensions:{homepage:"https://support.ledger.com/hc/en-us/articles/4404389606417-Download-and-install-Ledger-Live?docs=true"},properties:[{name:"namespaces",value:{selection:"single",data:[{label:"Ethereum",value:"EVM",id:"ETH",getSupportedChains:t=>t.filter(e=>e.name===re.ETHEREUM)},{label:"Solana",value:"Solana",id:"SOLANA",getSupportedChains:t=>t.filter(e=>e.name===re.SOLANA)}]}},{name:"derivationPath",value:{data:[{id:"metamask",label:"Metamask (m/44'/60'/0'/0/index)",namespace:"EVM",generateDerivationPath:t=>`44'/60'/0'/0/${t}`},{id:"ledgerLive",label:"LedgerLive (m/44'/60'/index'/0/0)",namespace:"EVM",generateDerivationPath:t=>`44'/60'/${t}'/0/0`},{id:"legacy",label:"Legacy (m/44'/60'/0'/index)",namespace:"EVM",generateDerivationPath:t=>`44'/60'/0'/${t}`},{id:"(m/44'/501'/index')",label:"(m/44'/501'/index')",namespace:"Solana",generateDerivationPath:t=>`44'/501'/${t}'`},{id:"(m/44'/501'/0'/index)",label:"(m/44'/501'/0'/index)",namespace:"Solana",generateDerivationPath:t=>`44'/501'/0'/${t}`}]}},{name:"signers",value:{getSigners:async()=>vt()}}]};function mr(){let t=new Map;return t.set(v.ETHEREUM,{chainId:ae}),t.set(v.SOLANA,{chainId:v.SOLANA}),t}i(mr,"ledger");var ie={21781:"The device is locked",25871:"Related application is not ready on your device",27013:"Action denied by user"};function nn(t){return ie[t]?ie[t]:X(t)?X(t):`Ledger device unknown error 0x${t.toString(se)}`}i(nn,"getLedgerErrorMessage");function wt(t){return t?.statusCode?new Error(nn(t.statusCode)):t?.code==="INSUFFICIENT_FUNDS"?new Error("Insufficient funds for transaction"):t}i(wt,"getLedgerError");function gr(t,e){throw wt(e)}i(gr,"standardizeAndThrowLedgerError");async function yr(){try{let t=await ce(),e=q(),n=new(await oe(async()=>await import("./Eth-5PCPPYSI.js"))).default(t),r=[],s=await n.getAddress(e,!1,!0);return r.push(s.address),{accounts:r,chainId:ae,derivationPath:e}}catch(t){throw wt(t)}finally{await ue()}}i(yr,"getEthereumAccounts");async function vr(){try{let t=await ce(),e=q(),n=new(await oe(async()=>await import("./Solana-NJS3LWGA.js"))).default(t),r=[],s=await n.getAddress(e);return r.push(en.encode(s.address)),{accounts:r,chainId:j,derivationPath:e}}catch(t){throw wt(t)}finally{await ue()}}i(vr,"getSolanaAccounts");var z=null;async function ce(){return z=await(await import("./TransportWebHID-HV53OYSS.js")).default.create(),z}i(ce,"transportConnect");async function ue(){z&&(await z.close(),z=null)}i(ue,"transportDisconnect");export{E as a,ve as b,rn as c,q as d,Ht as e,He as f,Bn as g,zn as h,ir as i,or as j,mr as k,wt as l,gr as m,yr as n,vr as o,ce as p,ue as q,vt as r};
2
+ //# sourceMappingURL=chunk-L3UWJBD6.js.map