@dodoex/wallet-web3 0.0.43-10 → 0.0.43-12

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 (74) hide show
  1. package/dist/__tslib-0547aa38.js +1 -0
  2. package/dist/{alchemy-provider-5870b6fa-031aa534.js → alchemy-provider-5870b6fa-66ae0974.js} +1 -1
  3. package/dist/{alchemy-websocket-provider-213da986-9c604721.js → alchemy-websocket-provider-213da986-daa4b2ac.js} +1 -1
  4. package/dist/{blocto-3a3f2a16.js → blocto-186c1a22.js} +1 -1
  5. package/dist/{ccip-1ab01249.js → ccip-c22f8138.js} +1 -1
  6. package/dist/cjs/__tslib-93fe7c88.cjs +1 -0
  7. package/dist/cjs/{alchemy-provider-5870b6fa-d45451fd.cjs → alchemy-provider-5870b6fa-db07224d.cjs} +1 -1
  8. package/dist/cjs/{alchemy-websocket-provider-213da986-10a4b9e7.cjs → alchemy-websocket-provider-213da986-49c644b7.cjs} +1 -1
  9. package/dist/cjs/{blocto-f0c00f7e.cjs → blocto-4a1972b9.cjs} +1 -1
  10. package/dist/cjs/{ccip-b407d523.cjs → ccip-331d2547.cjs} +1 -1
  11. package/dist/cjs/{draggabilly-5bb01089.cjs → draggabilly-59a14a2e.cjs} +1 -1
  12. package/dist/cjs/{ethers-d83228c8.cjs → ethers-0f2d94e7.cjs} +1 -1
  13. package/dist/cjs/id-53a53aa8.cjs +1 -0
  14. package/dist/cjs/{index-264347ec.cjs → index-06bc03d7.cjs} +1 -1
  15. package/dist/cjs/{index-a56bd128.cjs → index-39537b4b.cjs} +1 -1
  16. package/dist/cjs/{index-8aff1799.cjs → index-776bd0cb.cjs} +1 -1
  17. package/dist/cjs/{index-12d8477a.cjs → index-799d6e58.cjs} +1 -1
  18. package/dist/cjs/{index-4f989ef8.cjs → index-81c627a5.cjs} +1 -1
  19. package/dist/cjs/{index-58fb77bb.cjs → index-9626a95b.cjs} +1 -1
  20. package/dist/cjs/{index-169ca3cc.cjs → index-9d6efa8f.cjs} +2 -2
  21. package/dist/cjs/{index-e628770e.cjs → index-a5572077.cjs} +1 -1
  22. package/dist/cjs/index-b34e24a5.cjs +1 -0
  23. package/dist/cjs/{index-dac27dde.cjs → index-c16f97a1.cjs} +1 -1
  24. package/dist/cjs/{index-f21b6f0e.cjs → index-c74605d1.cjs} +6 -6
  25. package/dist/cjs/{index-05d4740c.cjs → index-c7754d77.cjs} +1 -1
  26. package/dist/cjs/index.cjs +1 -1
  27. package/dist/cjs/{index.es-4b60988b.cjs → index.es-4d85c330.cjs} +1 -1
  28. package/dist/cjs/{interface-fe98cff9.cjs → interface-fbf06485.cjs} +1 -1
  29. package/dist/cjs/{lib-typedarrays-bdffcb4b.cjs → lib-typedarrays-b7f1a99f.cjs} +1 -1
  30. package/dist/cjs/{portis-9753b80e.cjs → portis-02fc861e.cjs} +1 -1
  31. package/dist/cjs/{provider-4316abb1.cjs → provider-c2173c36.cjs} +1 -1
  32. package/dist/cjs/{rainbow-a0174e93.cjs → rainbow-a61a981d.cjs} +1 -1
  33. package/dist/cjs/{sha224-c50de689.cjs → sha224-676e6207.cjs} +1 -1
  34. package/dist/cjs/{sha256-42051c0c.cjs → sha256-196f1980.cjs} +1 -1
  35. package/dist/cjs/{typed-data-0289b33b.cjs → typed-data-2d8f6df1.cjs} +1 -1
  36. package/dist/cjs/{uAuth-f3a2ae4c.cjs → uAuth-1e2719ad.cjs} +1 -1
  37. package/dist/cjs/{walletConnect-8352f639.cjs → walletConnect-2e821f1c.cjs} +1 -1
  38. package/dist/cjs/{walletLink-9d46eb6c.cjs → walletLink-924a3c11.cjs} +1 -1
  39. package/dist/{draggabilly-61827e22.js → draggabilly-a70131ad.js} +1 -1
  40. package/dist/{ethers-f88617c3.js → ethers-c3cb5bfc.js} +1 -1
  41. package/dist/id-a97ccfbc.js +1 -0
  42. package/dist/{index-eaf1a7e1.js → index-01c6492b.js} +1 -1
  43. package/dist/{index-d7a9192b.js → index-132570b4.js} +6 -6
  44. package/dist/{index-1f8e0dfc.js → index-243dafcd.js} +1 -1
  45. package/dist/{index-81bcae82.js → index-2ddbcf3e.js} +1 -1
  46. package/dist/index-6d1562d1.js +1 -0
  47. package/dist/{index-d95400e0.js → index-970c8e80.js} +1 -1
  48. package/dist/index-a257db7f.js +1 -0
  49. package/dist/{index-f99975f1.js → index-aae40eb1.js} +1 -1
  50. package/dist/{index-47f5d198.js → index-add76057.js} +2 -2
  51. package/dist/{index-4a956840.js → index-b22421b7.js} +1 -1
  52. package/dist/{index-253349c9.js → index-cd1740d0.js} +1 -1
  53. package/dist/{index-f7199a2b.js → index-fbb9a3f1.js} +1 -1
  54. package/dist/{index.es-4b977259.js → index.es-3dfca617.js} +1 -1
  55. package/dist/index.js +1 -1
  56. package/dist/{interface-1e8a49c4.js → interface-2897eab6.js} +1 -1
  57. package/dist/{lib-typedarrays-fa31fa82.js → lib-typedarrays-e6de1966.js} +1 -1
  58. package/dist/{portis-6f76b8e1.js → portis-54eeb284.js} +1 -1
  59. package/dist/{provider-036433d0.js → provider-e2e6131c.js} +1 -1
  60. package/dist/{rainbow-3661e3f6.js → rainbow-30b151a1.js} +1 -1
  61. package/dist/{sha224-8a20d072.js → sha224-a42e98c9.js} +1 -1
  62. package/dist/{sha256-bfa39a7c.js → sha256-46176d76.js} +1 -1
  63. package/dist/{typed-data-78d999f6.js → typed-data-10b4e227.js} +1 -1
  64. package/dist/{uAuth-f0f55294.js → uAuth-2762924f.js} +1 -1
  65. package/dist/{walletConnect-9def1feb.js → walletConnect-e95db0e9.js} +1 -1
  66. package/dist/{walletLink-ec8614d0.js → walletLink-556b70af.js} +1 -1
  67. package/package.json +2 -2
  68. package/dist/__tslib-f431f494.js +0 -1
  69. package/dist/cjs/__tslib-aa1ec370.cjs +0 -1
  70. package/dist/cjs/id-36ab9f54.cjs +0 -1
  71. package/dist/cjs/index-70269942.cjs +0 -1
  72. package/dist/id-25fee670.js +0 -1
  73. package/dist/index-6be6f872.js +0 -1
  74. package/dist/index-ccba79a0.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=e(require("util")),r={exports:{}};var s={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};var n="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r}=s,i=n,o=(t=e.exports={}).re=[],a=t.src=[],l=t.t={};let h=0;const u=(e,t,r)=>{const s=h++;i(e,s,t),l[e]=s,a[s]=t,o[s]=new RegExp(t,r?"g":void 0)};u("NUMERICIDENTIFIER","0|[1-9]\\d*"),u("NUMERICIDENTIFIERLOOSE","[0-9]+"),u("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),u("MAINVERSION",`(${a[l.NUMERICIDENTIFIER]})\\.(${a[l.NUMERICIDENTIFIER]})\\.(${a[l.NUMERICIDENTIFIER]})`),u("MAINVERSIONLOOSE",`(${a[l.NUMERICIDENTIFIERLOOSE]})\\.(${a[l.NUMERICIDENTIFIERLOOSE]})\\.(${a[l.NUMERICIDENTIFIERLOOSE]})`),u("PRERELEASEIDENTIFIER",`(?:${a[l.NUMERICIDENTIFIER]}|${a[l.NONNUMERICIDENTIFIER]})`),u("PRERELEASEIDENTIFIERLOOSE",`(?:${a[l.NUMERICIDENTIFIERLOOSE]}|${a[l.NONNUMERICIDENTIFIER]})`),u("PRERELEASE",`(?:-(${a[l.PRERELEASEIDENTIFIER]}(?:\\.${a[l.PRERELEASEIDENTIFIER]})*))`),u("PRERELEASELOOSE",`(?:-?(${a[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[l.PRERELEASEIDENTIFIERLOOSE]})*))`),u("BUILDIDENTIFIER","[0-9A-Za-z-]+"),u("BUILD",`(?:\\+(${a[l.BUILDIDENTIFIER]}(?:\\.${a[l.BUILDIDENTIFIER]})*))`),u("FULLPLAIN",`v?${a[l.MAINVERSION]}${a[l.PRERELEASE]}?${a[l.BUILD]}?`),u("FULL",`^${a[l.FULLPLAIN]}$`),u("LOOSEPLAIN",`[v=\\s]*${a[l.MAINVERSIONLOOSE]}${a[l.PRERELEASELOOSE]}?${a[l.BUILD]}?`),u("LOOSE",`^${a[l.LOOSEPLAIN]}$`),u("GTLT","((?:<|>)?=?)"),u("XRANGEIDENTIFIERLOOSE",`${a[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),u("XRANGEIDENTIFIER",`${a[l.NUMERICIDENTIFIER]}|x|X|\\*`),u("XRANGEPLAIN",`[v=\\s]*(${a[l.XRANGEIDENTIFIER]})(?:\\.(${a[l.XRANGEIDENTIFIER]})(?:\\.(${a[l.XRANGEIDENTIFIER]})(?:${a[l.PRERELEASE]})?${a[l.BUILD]}?)?)?`),u("XRANGEPLAINLOOSE",`[v=\\s]*(${a[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[l.XRANGEIDENTIFIERLOOSE]})(?:${a[l.PRERELEASELOOSE]})?${a[l.BUILD]}?)?)?`),u("XRANGE",`^${a[l.GTLT]}\\s*${a[l.XRANGEPLAIN]}$`),u("XRANGELOOSE",`^${a[l.GTLT]}\\s*${a[l.XRANGEPLAINLOOSE]}$`),u("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),u("COERCERTL",a[l.COERCE],!0),u("LONETILDE","(?:~>?)"),u("TILDETRIM",`(\\s*)${a[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",u("TILDE",`^${a[l.LONETILDE]}${a[l.XRANGEPLAIN]}$`),u("TILDELOOSE",`^${a[l.LONETILDE]}${a[l.XRANGEPLAINLOOSE]}$`),u("LONECARET","(?:\\^)"),u("CARETTRIM",`(\\s*)${a[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",u("CARET",`^${a[l.LONECARET]}${a[l.XRANGEPLAIN]}$`),u("CARETLOOSE",`^${a[l.LONECARET]}${a[l.XRANGEPLAINLOOSE]}$`),u("COMPARATORLOOSE",`^${a[l.GTLT]}\\s*(${a[l.LOOSEPLAIN]})$|^$`),u("COMPARATOR",`^${a[l.GTLT]}\\s*(${a[l.FULLPLAIN]})$|^$`),u("COMPARATORTRIM",`(\\s*)${a[l.GTLT]}\\s*(${a[l.LOOSEPLAIN]}|${a[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",u("HYPHENRANGE",`^\\s*(${a[l.XRANGEPLAIN]})\\s+-\\s+(${a[l.XRANGEPLAIN]})\\s*$`),u("HYPHENRANGELOOSE",`^\\s*(${a[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[l.XRANGEPLAINLOOSE]})\\s*$`),u("STAR","(<|>)?=?\\s*\\*"),u("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),u("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(r,r.exports);const i=Object.freeze({loose:!0}),o=Object.freeze({});var a=e=>e?"object"!=typeof e?i:e:o;const l=/^[0-9]+$/,h=(e,t)=>{const r=l.test(e),s=l.test(t);return r&&s&&(e=+e,t=+t),e===t?0:r&&!s?-1:s&&!r?1:e<t?-1:1};var u={compareIdentifiers:h,rcompareIdentifiers:(e,t)=>h(t,e)};const p=n,{MAX_LENGTH:c,MAX_SAFE_INTEGER:E}=s,{re:f,t:v}=r.exports,m=a,{compareIdentifiers:$}=u;class R{constructor(e,r){if(r=m(r),e instanceof R){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid Version: ${t.default.inspect(e)}`);if(e.length>c)throw new TypeError(`version is longer than ${c} characters`);p("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const s=e.trim().match(r.loose?f[v.LOOSE]:f[v.FULL]);if(!s)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>E||this.major<0)throw new TypeError("Invalid major version");if(this.minor>E||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>E||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<E)return t}return e})):this.prerelease=[],this.build=s[5]?s[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(p("SemVer.compare",this.version,this.options,e),!(e instanceof R)){if("string"==typeof e&&e===this.version)return 0;e=new R(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof R||(e=new R(e,this.options)),$(this.major,e.major)||$(this.minor,e.minor)||$(this.patch,e.patch)}comparePre(e){if(e instanceof R||(e=new R(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 t=0;do{const r=this.prerelease[t],s=e.prerelease[t];if(p("prerelease compare",t,r,s),void 0===r&&void 0===s)return 0;if(void 0===s)return 1;if(void 0===r)return-1;if(r!==s)return $(r,s)}while(++t)}compareBuild(e){e instanceof R||(e=new R(e,this.options));let t=0;do{const r=this.build[t],s=e.build[t];if(p("prerelease compare",t,r,s),void 0===r&&void 0===s)return 0;if(void 0===s)return 1;if(void 0===r)return-1;if(r!==s)return $(r,s)}while(++t)}inc(e,t,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let s=this.prerelease.length;for(;--s>=0;)"number"==typeof this.prerelease[s]&&(this.prerelease[s]++,s=-2);if(-1===s){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let s=[t,e];!1===r&&(s=[t]),0===$(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}}var I=R;const g=I;var d=(e,t,r=!1)=>{if(e instanceof g)return e;try{return new g(e,t)}catch(e){if(!r)return null;throw e}};const N=d;var A=(e,t)=>{const r=N(e,t);return r?r.version:null};const L=d;var w=(e,t)=>{const r=L(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};const O=I;var T=(e,t,r,s,n)=>{"string"==typeof r&&(n=s,s=r,r=void 0);try{return new O(e instanceof O?e.version:e,r).inc(t,s,n).version}catch(e){return null}};const S=d;var y=(e,t)=>{const r=S(e,null,!0),s=S(t,null,!0),n=r.compare(s);if(0===n)return null;const i=n>0,o=i?s:r,a=!!(i?r:s).prerelease.length,l=a?"pre":"";return r.major!==s.major?l+"major":r.minor!==s.minor?l+"minor":r.patch!==s.patch?l+"patch":a?"prerelease":o.patch?"patch":o.minor?"minor":"major"};const x=I;var P=(e,t)=>new x(e,t).major;const C=I;var D=(e,t)=>new C(e,t).minor;const b=I;var G=(e,t)=>new b(e,t).patch;const M=d;var F=(e,t)=>{const r=M(e,t);return r&&r.prerelease.length?r.prerelease:null};const j=I;var X=(e,t,r)=>new j(e,r).compare(new j(t,r));const U=X;var _=(e,t,r)=>U(t,e,r);const k=X;var V=(e,t)=>k(e,t,!0);const B=I;var H=(e,t,r)=>{const s=new B(e,r),n=new B(t,r);return s.compare(n)||s.compareBuild(n)};const Y=H;var W=(e,t)=>e.sort(((e,r)=>Y(e,r,t)));const z=H;var q=(e,t)=>e.sort(((e,r)=>z(r,e,t)));const Z=X;var J=(e,t,r)=>Z(e,t,r)>0;const K=X;var Q=(e,t,r)=>K(e,t,r)<0;const ee=X;var te=(e,t,r)=>0===ee(e,t,r);const re=X;var se=(e,t,r)=>0!==re(e,t,r);const ne=X;var ie=(e,t,r)=>ne(e,t,r)>=0;const oe=X;var ae=(e,t,r)=>oe(e,t,r)<=0;const le=te,he=se,ue=J,pe=ie,ce=Q,Ee=ae;var fe=(e,t,r,s)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return le(e,r,s);case"!=":return he(e,r,s);case">":return ue(e,r,s);case">=":return pe(e,r,s);case"<":return ce(e,r,s);case"<=":return Ee(e,r,s);default:throw new TypeError(`Invalid operator: ${t}`)}};const ve=I,me=d,{re:$e,t:Re}=r.exports;var Ie,ge,de=(e,t)=>{if(e instanceof ve)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let t;for(;(t=$e[Re.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&t.index+t[0].length===r.index+r[0].length||(r=t),$e[Re.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;$e[Re.COERCERTL].lastIndex=-1}else r=e.match($e[Re.COERCE]);return null===r?null:me(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)};var Ne=Ae;function Ae(e){var t=this;if(t instanceof Ae||(t=new Ae),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var r=0,s=arguments.length;r<s;r++)t.push(arguments[r]);return t}function Le(e,t,r){var s=t===e.head?new Te(r,null,t,e):new Te(r,t,t.next,e);return null===s.next&&(e.tail=s),null===s.prev&&(e.head=s),e.length++,s}function we(e,t){e.tail=new Te(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function Oe(e,t){e.head=new Te(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function Te(e,t,r,s){if(!(this instanceof Te))return new Te(e,t,r,s);this.list=s,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}Ae.Node=Te,Ae.create=Ae,Ae.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},Ae.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},Ae.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},Ae.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)we(this,arguments[e]);return this.length},Ae.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)Oe(this,arguments[e]);return this.length},Ae.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},Ae.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},Ae.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,s=0;null!==r;s++)e.call(t,r.value,s,this),r=r.next},Ae.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,s=this.length-1;null!==r;s--)e.call(t,r.value,s,this),r=r.prev},Ae.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},Ae.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},Ae.prototype.map=function(e,t){t=t||this;for(var r=new Ae,s=this.head;null!==s;)r.push(e.call(t,s.value,this)),s=s.next;return r},Ae.prototype.mapReverse=function(e,t){t=t||this;for(var r=new Ae,s=this.tail;null!==s;)r.push(e.call(t,s.value,this)),s=s.prev;return r},Ae.prototype.reduce=function(e,t){var r,s=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");s=this.head.next,r=this.head.value}for(var n=0;null!==s;n++)r=e(r,s.value,n),s=s.next;return r},Ae.prototype.reduceReverse=function(e,t){var r,s=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");s=this.tail.prev,r=this.tail.value}for(var n=this.length-1;null!==s;n--)r=e(r,s.value,n),s=s.prev;return r},Ae.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},Ae.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},Ae.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new Ae;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var s=0,n=this.head;null!==n&&s<e;s++)n=n.next;for(;null!==n&&s<t;s++,n=n.next)r.push(n.value);return r},Ae.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new Ae;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var s=this.length,n=this.tail;null!==n&&s>t;s--)n=n.prev;for(;null!==n&&s>e;s--,n=n.prev)r.push(n.value);return r},Ae.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var s=0,n=this.head;null!==n&&s<e;s++)n=n.next;var i=[];for(s=0;n&&s<t;s++)i.push(n.value),n=this.removeNode(n);null===n&&(n=this.tail),n!==this.head&&n!==this.tail&&(n=n.prev);for(s=0;s<r.length;s++)n=Le(this,n,r[s]);return i},Ae.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var s=r.prev;r.prev=r.next,r.next=s}return this.head=t,this.tail=e,this};try{(ge||(ge=1,Ie=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),Ie)(Ae)}catch(e){}const Se=Ne,ye=Symbol("max"),xe=Symbol("length"),Pe=Symbol("lengthCalculator"),Ce=Symbol("allowStale"),De=Symbol("maxAge"),be=Symbol("dispose"),Ge=Symbol("noDisposeOnSet"),Me=Symbol("lruList"),Fe=Symbol("cache"),je=Symbol("updateAgeOnGet"),Xe=()=>1;const Ue=(e,t,r)=>{const s=e[Fe].get(t);if(s){const t=s.value;if(_e(e,t)){if(Ve(e,s),!e[Ce])return}else r&&(e[je]&&(s.value.now=Date.now()),e[Me].unshiftNode(s));return t.value}},_e=(e,t)=>{if(!t||!t.maxAge&&!e[De])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[De]&&r>e[De]},ke=e=>{if(e[xe]>e[ye])for(let t=e[Me].tail;e[xe]>e[ye]&&null!==t;){const r=t.prev;Ve(e,t),t=r}},Ve=(e,t)=>{if(t){const r=t.value;e[be]&&e[be](r.key,r.value),e[xe]-=r.length,e[Fe].delete(r.key),e[Me].removeNode(t)}};class Be{constructor(e,t,r,s,n){this.key=e,this.value=t,this.length=r,this.now=s,this.maxAge=n||0}}const He=(e,t,r,s)=>{let n=r.value;_e(e,n)&&(Ve(e,r),e[Ce]||(n=void 0)),n&&t.call(s,n.value,n.key,e)};var Ye,We,ze,qe,Ze=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[ye]=e.max||1/0;const t=e.length||Xe;if(this[Pe]="function"!=typeof t?Xe:t,this[Ce]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[De]=e.maxAge||0,this[be]=e.dispose,this[Ge]=e.noDisposeOnSet||!1,this[je]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[ye]=e||1/0,ke(this)}get max(){return this[ye]}set allowStale(e){this[Ce]=!!e}get allowStale(){return this[Ce]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[De]=e,ke(this)}get maxAge(){return this[De]}set lengthCalculator(e){"function"!=typeof e&&(e=Xe),e!==this[Pe]&&(this[Pe]=e,this[xe]=0,this[Me].forEach((e=>{e.length=this[Pe](e.value,e.key),this[xe]+=e.length}))),ke(this)}get lengthCalculator(){return this[Pe]}get length(){return this[xe]}get itemCount(){return this[Me].length}rforEach(e,t){t=t||this;for(let r=this[Me].tail;null!==r;){const s=r.prev;He(this,e,r,t),r=s}}forEach(e,t){t=t||this;for(let r=this[Me].head;null!==r;){const s=r.next;He(this,e,r,t),r=s}}keys(){return this[Me].toArray().map((e=>e.key))}values(){return this[Me].toArray().map((e=>e.value))}reset(){this[be]&&this[Me]&&this[Me].length&&this[Me].forEach((e=>this[be](e.key,e.value))),this[Fe]=new Map,this[Me]=new Se,this[xe]=0}dump(){return this[Me].map((e=>!_e(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[Me]}set(e,t,r){if((r=r||this[De])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const s=r?Date.now():0,n=this[Pe](t,e);if(this[Fe].has(e)){if(n>this[ye])return Ve(this,this[Fe].get(e)),!1;const i=this[Fe].get(e).value;return this[be]&&(this[Ge]||this[be](e,i.value)),i.now=s,i.maxAge=r,i.value=t,this[xe]+=n-i.length,i.length=n,this.get(e),ke(this),!0}const i=new Be(e,t,n,s,r);return i.length>this[ye]?(this[be]&&this[be](e,t),!1):(this[xe]+=i.length,this[Me].unshift(i),this[Fe].set(e,this[Me].head),ke(this),!0)}has(e){if(!this[Fe].has(e))return!1;const t=this[Fe].get(e).value;return!_e(this,t)}get(e){return Ue(this,e,!0)}peek(e){return Ue(this,e,!1)}pop(){const e=this[Me].tail;return e?(Ve(this,e),e.value):null}del(e){Ve(this,this[Fe].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const s=e[r],n=s.e||0;if(0===n)this.set(s.k,s.v);else{const e=n-t;e>0&&this.set(s.k,s.v,e)}}}prune(){this[Fe].forEach(((e,t)=>Ue(this,t,!1)))}};function Je(){if(We)return Ye;We=1;class e{constructor(t,r){if(r=i(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof o)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t,this.set=t.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${t}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!$(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&R(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();const r=((this.options.includePrerelease&&v)|(this.options.loose&&m))+":"+e,s=t.get(r);if(s)return s;const n=this.options.loose,i=n?u[p.HYPHENRANGELOOSE]:u[p.HYPHENRANGE];e=e.replace(i,P(this.options.includePrerelease)),l("hyphen replace",e),e=e.replace(u[p.COMPARATORTRIM],c),l("comparator trim",e);let a=(e=(e=(e=e.replace(u[p.TILDETRIM],E)).replace(u[p.CARETTRIM],f)).split(/\s+/).join(" ")).split(" ").map((e=>d(e,this.options))).join(" ").split(/\s+/).map((e=>x(e,this.options)));n&&(a=a.filter((e=>(l("loose invalid filter",e,this.options),!!e.match(u[p.COMPARATORLOOSE]))))),l("range list",a);const h=new Map,R=a.map((e=>new o(e,this.options)));for(const e of R){if($(e))return[e];h.set(e.value,e)}h.size>1&&h.has("")&&h.delete("");const I=[...h.values()];return t.set(r,I),I}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((e=>g(e,r)&&t.set.some((t=>g(t,r)&&e.every((e=>t.every((t=>e.intersects(t,r)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new h(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(C(this.set[t],e,this.options))return!0;return!1}}Ye=e;const t=new Ze({max:1e3}),i=a,o=Ke(),l=n,h=I,{re:u,t:p,comparatorTrimReplace:c,tildeTrimReplace:E,caretTrimReplace:f}=r.exports,{FLAG_INCLUDE_PRERELEASE:v,FLAG_LOOSE:m}=s,$=e=>"<0.0.0-0"===e.value,R=e=>""===e.value,g=(e,t)=>{let r=!0;const s=e.slice();let n=s.pop();for(;r&&s.length;)r=s.every((e=>n.intersects(e,t))),n=s.pop();return r},d=(e,t)=>(l("comp",e,t),e=w(e,t),l("caret",e),e=A(e,t),l("tildes",e),e=T(e,t),l("xrange",e),e=y(e,t),l("stars",e),e),N=e=>!e||"x"===e.toLowerCase()||"*"===e,A=(e,t)=>e.trim().split(/\s+/).map((e=>L(e,t))).join(" "),L=(e,t)=>{const r=t.loose?u[p.TILDELOOSE]:u[p.TILDE];return e.replace(r,((t,r,s,n,i)=>{let o;return l("tilde",e,t,r,s,n,i),N(r)?o="":N(s)?o=`>=${r}.0.0 <${+r+1}.0.0-0`:N(n)?o=`>=${r}.${s}.0 <${r}.${+s+1}.0-0`:i?(l("replaceTilde pr",i),o=`>=${r}.${s}.${n}-${i} <${r}.${+s+1}.0-0`):o=`>=${r}.${s}.${n} <${r}.${+s+1}.0-0`,l("tilde return",o),o}))},w=(e,t)=>e.trim().split(/\s+/).map((e=>O(e,t))).join(" "),O=(e,t)=>{l("caret",e,t);const r=t.loose?u[p.CARETLOOSE]:u[p.CARET],s=t.includePrerelease?"-0":"";return e.replace(r,((t,r,n,i,o)=>{let a;return l("caret",e,t,r,n,i,o),N(r)?a="":N(n)?a=`>=${r}.0.0${s} <${+r+1}.0.0-0`:N(i)?a="0"===r?`>=${r}.${n}.0${s} <${r}.${+n+1}.0-0`:`>=${r}.${n}.0${s} <${+r+1}.0.0-0`:o?(l("replaceCaret pr",o),a="0"===r?"0"===n?`>=${r}.${n}.${i}-${o} <${r}.${n}.${+i+1}-0`:`>=${r}.${n}.${i}-${o} <${r}.${+n+1}.0-0`:`>=${r}.${n}.${i}-${o} <${+r+1}.0.0-0`):(l("no pr"),a="0"===r?"0"===n?`>=${r}.${n}.${i}${s} <${r}.${n}.${+i+1}-0`:`>=${r}.${n}.${i}${s} <${r}.${+n+1}.0-0`:`>=${r}.${n}.${i} <${+r+1}.0.0-0`),l("caret return",a),a}))},T=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map((e=>S(e,t))).join(" ")),S=(e,t)=>{e=e.trim();const r=t.loose?u[p.XRANGELOOSE]:u[p.XRANGE];return e.replace(r,((r,s,n,i,o,a)=>{l("xRange",e,r,s,n,i,o,a);const h=N(n),u=h||N(i),p=u||N(o),c=p;return"="===s&&c&&(s=""),a=t.includePrerelease?"-0":"",h?r=">"===s||"<"===s?"<0.0.0-0":"*":s&&c?(u&&(i=0),o=0,">"===s?(s=">=",u?(n=+n+1,i=0,o=0):(i=+i+1,o=0)):"<="===s&&(s="<",u?n=+n+1:i=+i+1),"<"===s&&(a="-0"),r=`${s+n}.${i}.${o}${a}`):u?r=`>=${n}.0.0${a} <${+n+1}.0.0-0`:p&&(r=`>=${n}.${i}.0${a} <${n}.${+i+1}.0-0`),l("xRange return",r),r}))},y=(e,t)=>(l("replaceStars",e,t),e.trim().replace(u[p.STAR],"")),x=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?p.GTE0PRE:p.GTE0],"")),P=e=>(t,r,s,n,i,o,a,l,h,u,p,c,E)=>`${r=N(s)?"":N(n)?`>=${s}.0.0${e?"-0":""}`:N(i)?`>=${s}.${n}.0${e?"-0":""}`:o?`>=${r}`:`>=${r}${e?"-0":""}`} ${l=N(h)?"":N(u)?`<${+h+1}.0.0-0`:N(p)?`<${h}.${+u+1}.0-0`:c?`<=${h}.${u}.${p}-${c}`:e?`<${h}.${u}.${+p+1}-0`:`<=${l}`}`.trim(),C=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(l(e[r].semver),e[r].semver!==o.ANY&&e[r].semver.prerelease.length>0){const s=e[r].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}return!1}return!0};return Ye}function Ke(){if(qe)return ze;qe=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(r,n){if(n=s(n),r instanceof t){if(r.loose===!!n.loose)return r;r=r.value}h("comparator",r,n),this.options=n,this.loose=!!n.loose,this.parse(r),this.semver===e?this.value="":this.value=this.operator+this.semver.version,h("comp",this)}parse(t){const r=this.options.loose?i[o.COMPARATORLOOSE]:i[o.COMPARATOR],s=t.match(r);if(!s)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==s[1]?s[1]:"","="===this.operator&&(this.operator=""),s[2]?this.semver=new u(s[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(h("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new u(t,this.options)}catch(e){return!1}return l(t,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||new p(e.value,r).test(this.value):""===e.operator?""===e.value||new p(this.value,r).test(e.semver):(!(r=s(r)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(l(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(l(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}ze=t;const s=a,{re:i,t:o}=r.exports,l=fe,h=n,u=I,p=Je();return ze}const Qe=Je();var et=(e,t,r)=>{try{t=new Qe(t,r)}catch(e){return!1}return t.test(e)};const tt=Je();var rt=(e,t)=>new tt(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")));const st=I,nt=Je();var it=(e,t,r)=>{let s=null,n=null,i=null;try{i=new nt(t,r)}catch(e){return null}return e.forEach((e=>{i.test(e)&&(s&&-1!==n.compare(e)||(s=e,n=new st(s,r)))})),s};const ot=I,at=Je();var lt=(e,t,r)=>{let s=null,n=null,i=null;try{i=new at(t,r)}catch(e){return null}return e.forEach((e=>{i.test(e)&&(s&&1!==n.compare(e)||(s=e,n=new ot(s,r)))})),s};const ht=I,ut=Je(),pt=J;var ct=(e,t)=>{e=new ut(e,t);let r=new ht("0.0.0");if(e.test(r))return r;if(r=new ht("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t<e.set.length;++t){const s=e.set[t];let n=null;s.forEach((e=>{const t=new ht(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!pt(t,n)||(n=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!n||r&&!pt(r,n)||(r=n)}return r&&e.test(r)?r:null};const Et=Je();var ft=(e,t)=>{try{return new Et(e,t).range||"*"}catch(e){return null}};const vt=I,mt=Ke(),{ANY:$t}=mt,Rt=Je(),It=et,gt=J,dt=Q,Nt=ae,At=ie;var Lt=(e,t,r,s)=>{let n,i,o,a,l;switch(e=new vt(e,s),t=new Rt(t,s),r){case">":n=gt,i=Nt,o=dt,a=">",l=">=";break;case"<":n=dt,i=At,o=gt,a="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(It(e,t,s))return!1;for(let r=0;r<t.set.length;++r){const h=t.set[r];let u=null,p=null;if(h.forEach((e=>{e.semver===$t&&(e=new mt(">=0.0.0")),u=u||e,p=p||e,n(e.semver,u.semver,s)?u=e:o(e.semver,p.semver,s)&&(p=e)})),u.operator===a||u.operator===l)return!1;if((!p.operator||p.operator===a)&&i(e,p.semver))return!1;if(p.operator===l&&o(e,p.semver))return!1}return!0};const wt=Lt;var Ot=(e,t,r)=>wt(e,t,">",r);const Tt=Lt;var St=(e,t,r)=>Tt(e,t,"<",r);const yt=Je();var xt=(e,t,r)=>(e=new yt(e,r),t=new yt(t,r),e.intersects(t,r));const Pt=et,Ct=X;const Dt=Je(),bt=Ke(),{ANY:Gt}=bt,Mt=et,Ft=X,jt=[new bt(">=0.0.0-0")],Xt=[new bt(">=0.0.0")],Ut=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===Gt){if(1===t.length&&t[0].semver===Gt)return!0;e=r.includePrerelease?jt:Xt}if(1===t.length&&t[0].semver===Gt){if(r.includePrerelease)return!0;t=Xt}const s=new Set;let n,i,o,a,l,h,u;for(const t of e)">"===t.operator||">="===t.operator?n=_t(n,t,r):"<"===t.operator||"<="===t.operator?i=kt(i,t,r):s.add(t.semver);if(s.size>1)return null;if(n&&i){if(o=Ft(n.semver,i.semver,r),o>0)return null;if(0===o&&(">="!==n.operator||"<="!==i.operator))return null}for(const e of s){if(n&&!Mt(e,String(n),r))return null;if(i&&!Mt(e,String(i),r))return null;for(const s of t)if(!Mt(e,String(s),r))return!1;return!0}let p=!(!i||r.includePrerelease||!i.semver.prerelease.length)&&i.semver,c=!(!n||r.includePrerelease||!n.semver.prerelease.length)&&n.semver;p&&1===p.prerelease.length&&"<"===i.operator&&0===p.prerelease[0]&&(p=!1);for(const e of t){if(u=u||">"===e.operator||">="===e.operator,h=h||"<"===e.operator||"<="===e.operator,n)if(c&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===c.major&&e.semver.minor===c.minor&&e.semver.patch===c.patch&&(c=!1),">"===e.operator||">="===e.operator){if(a=_t(n,e,r),a===e&&a!==n)return!1}else if(">="===n.operator&&!Mt(n.semver,String(e),r))return!1;if(i)if(p&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===p.major&&e.semver.minor===p.minor&&e.semver.patch===p.patch&&(p=!1),"<"===e.operator||"<="===e.operator){if(l=kt(i,e,r),l===e&&l!==i)return!1}else if("<="===i.operator&&!Mt(i.semver,String(e),r))return!1;if(!e.operator&&(i||n)&&0!==o)return!1}return!(n&&h&&!i&&0!==o)&&(!(i&&u&&!n&&0!==o)&&(!c&&!p))},_t=(e,t,r)=>{if(!e)return t;const s=Ft(e.semver,t.semver,r);return s>0?e:s<0||">"===t.operator&&">="===e.operator?t:e},kt=(e,t,r)=>{if(!e)return t;const s=Ft(e.semver,t.semver,r);return s<0?e:s>0||"<"===t.operator&&"<="===e.operator?t:e};var Vt=(e,t,r={})=>{if(e===t)return!0;e=new Dt(e,r),t=new Dt(t,r);let s=!1;e:for(const n of e.set){for(const e of t.set){const t=Ut(n,e,r);if(s=s||null!==t,t)continue e}if(s)return!1}return!0};const Bt=r.exports,Ht=s,Yt=I,Wt=u,zt=(e,t,r)=>{const s=[];let n=null,i=null;const o=e.sort(((e,t)=>Ct(e,t,r)));for(const e of o){Pt(e,t,r)?(i=e,n||(n=e)):(i&&s.push([n,i]),i=null,n=null)}n&&s.push([n,null]);const a=[];for(const[e,t]of s)e===t?a.push(e):t||e!==o[0]?t?e===o[0]?a.push(`<=${t}`):a.push(`${e} - ${t}`):a.push(`>=${e}`):a.push("*");const l=a.join(" || "),h="string"==typeof t.raw?t.raw:String(t);return l.length<h.length?l:t};var qt={parse:d,valid:A,clean:w,inc:T,diff:y,major:P,minor:D,patch:G,prerelease:F,compare:X,rcompare:_,compareLoose:V,compareBuild:H,sort:W,rsort:q,gt:J,lt:Q,eq:te,neq:se,gte:ie,lte:ae,cmp:fe,coerce:de,Comparator:Ke(),Range:Je(),satisfies:et,toComparators:rt,maxSatisfying:it,minSatisfying:lt,minVersion:ct,validRange:ft,outside:Lt,gtr:Ot,ltr:St,intersects:xt,simplifyRange:zt,subset:Vt,SemVer:Yt,re:Bt.re,src:Bt.src,tokens:Bt.t,SEMVER_SPEC_VERSION:Ht.SEMVER_SPEC_VERSION,RELEASE_TYPES:Ht.RELEASE_TYPES,compareIdentifiers:Wt.compareIdentifiers,rcompareIdentifiers:Wt.rcompareIdentifiers};exports.semver=qt;
@@ -1 +1 @@
1
- "use strict";var e=require("./index-f21b6f0e.cjs"),t=require("@ethersproject/address"),n=require("@ethersproject/abstract-signer"),r=require("@ethersproject/providers"),o=require("@ethersproject/bytes"),i=require("./typed-data-0289b33b.cjs"),a=require("./index-58fb77bb.cjs"),s=require("./ethers-d83228c8.cjs"),u=require("./id-36ab9f54.cjs"),c=require("@ethersproject/json-wallets"),p=require("@ethersproject/properties"),l=require("./index-05d4740c.cjs"),d=require("@ethersproject/transactions"),f=require("@ethersproject/contracts");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("zustand"),require("events"),require("buffer"),require("@ethersproject/abstract-provider"),require("@ethersproject/constants"),require("./interface-fe98cff9.cjs"),require("./hash-7ce6fed5.cjs"),require("./inherits_browser-50deae74.cjs");var g,m=h(t),y=h(o),b=h(c),v=h(p),w=h(d),P=Object.freeze({__proto__:null,_toEscapedUtf8String:e._toEscapedUtf8String,toUtf8Bytes:e.toUtf8Bytes,toUtf8CodePoints:e.toUtf8CodePoints,toUtf8String:e.toUtf8String,Utf8ErrorFuncs:e.Utf8ErrorFuncs,get Utf8ErrorReason(){return e.Utf8ErrorReason},get UnicodeNormalizationForm(){return e.UnicodeNormalizationForm},formatBytes32String:s.formatBytes32String,parseBytes32String:s.parseBytes32String,nameprep:s.nameprep}),x=Object.freeze({__proto__:null,id:u.id,dnsEncode:s.dnsEncode,namehash:s.namehash,isValidName:s.isValidName,ensNormalize:s.ensNormalize,messagePrefix:s.messagePrefix,hashMessage:s.hashMessage,_TypedDataEncoder:i.TypedDataEncoder}),_=Object.freeze({__proto__:null,computeHmac:s.computeHmac,ripemd160:s.ripemd160,sha256:s.sha256,sha512:s.sha512,get SupportedAlgorithm(){return s.SupportedAlgorithm}}),O=Object.freeze({__proto__:null,randomBytes:s.randomBytes,shuffled:s.shuffled});class j extends n.Signer{constructor(e,t,n,r){super(),this._address=n,this._index=null!=r?r:0,this.provider=e,this.upWallet=t}_legacySignMessage(e){throw new Error("Method not implemented.")}sendUncheckedTransaction(e){throw new Error("Method not implemented.")}unlock(e){throw new Error("Method not implemented.")}getAddress(){return e.__awaiter(this,void 0,void 0,(function*(){return Promise.resolve(t.getAddress(this._address))}))}signMessage(t){return e.__awaiter(this,void 0,void 0,(function*(){if(!this.upWallet)throw new Error(`address unknown '${t}'`);return yield this.upWallet.signMessage(t,{isEIP191Prefix:!0,onAuthChain:!0})}))}_signTypedData(t,n,r){return e.__awaiter(this,void 0,void 0,(function*(){throw new Error("Method not implemented.")}))}signTransaction(t){return e.__awaiter(this,void 0,void 0,(function*(){if(!this.upWallet)throw new Error(`address unknown '${t.from}'`);return this.upWallet.sendTransaction({from:t.from,to:t.to,value:t.value,data:t.data})}))}sendTransaction(t){return e.__awaiter(this,void 0,void 0,(function*(){if(!this.upWallet)throw new Error(`address unknown '${t.from}'`);return{hash:yield this.upWallet.sendTransaction({from:t.from,to:t.to,value:t.value,data:t.data}),from:t.from}}))}connect(e){return new j(null!=e?e:this.provider,this.upWallet,this._address,this._index)}connectUnchecked(){return new j(this.provider,this.upWallet,this._address,this._index)}}!function(e){e.REGISTER="register"}(g||(g={}));var S,E=function(e,t,n,r,o){this.from=e,this.msg=t,this.type=n,this.isEIP191Prefix=r,this.onAuthChain=o},k=function(e,t){this.type=e,this.data=t},T=function(e,t,n){this.type=e,this.payload=t,this.appSetting=n};function A(){return A=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},A.apply(this,arguments)}!function(e){e.LIGHT="light",e.DARK="dark"}(S||(S={}));var U=function(e){var t=A({},e.types);return delete t.EIP712Domain,i.TypedDataEncoder.hash(e.domain,t,e.message)},C=function(e){return o.arrayify(U(e))},L={},N=e.getAugmentedNamespace(s.lib_esm),I=e.getAugmentedNamespace(s.lib_esm$1),D=e.getAugmentedNamespace(x),R=e.getAugmentedNamespace(s.lib_esm$2),M=e.getAugmentedNamespace(e.lib_esm),B=e.getAugmentedNamespace(e.lib_esm$1),F=e.getAugmentedNamespace(_),z=e.getAugmentedNamespace(s.lib_esm$3),W=e.getAugmentedNamespace(O),G=e.getAugmentedNamespace(l.lib_esm),q=e.getAugmentedNamespace(s.lib_esm$4),J=e.getAugmentedNamespace(P),V=e.getAugmentedNamespace(e.lib_esm$2),H=e.getAugmentedNamespace(s.lib_esm$5),$=e.getAugmentedNamespace(e.lib_esm$3);function K(){K=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function c(e,t,n,o){var i=t&&t.prototype instanceof d?t:d,a=Object.create(i.prototype),s=new j(o||[]);return r(a,"_invoke",{value:P(e,n,s)}),a}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var l={};function d(){}function f(){}function h(){}var g={};u(g,i,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(S([])));y&&y!==t&&n.call(y,i)&&(g=y);var b=h.prototype=d.prototype=Object.create(g);function v(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function o(r,i,a,s){var u=p(e[r],e,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){o("next",e,a,s)}),(function(e){o("throw",e,a,s)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return o("throw",e,a,s)}))}s(u.arg)}var i;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){o(e,n,t,r)}))}return i=i?i.then(r,r):r()}})}function P(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return E()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=x(a,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=p(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function x(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),l;var o=p(r,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,l;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function _(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function S(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return f.prototype=h,r(b,"constructor",{value:h,configurable:!0}),r(h,"constructor",{value:f,configurable:!0}),f.displayName=u(h,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,u(e,s,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},v(w.prototype),u(w.prototype,a,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new w(c(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},v(b),u(b,s,"Generator"),u(b,i,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},e}function Z(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function Y(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Z(i,r,o,a,s,"next",e)}function s(e){Z(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Q(){return Q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Q.apply(this,arguments)}!function(t){var n=e.commonjsGlobal&&e.commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=e.commonjsGlobal&&e.commonjsGlobal.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=e.commonjsGlobal&&e.commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&n(t,e,o);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.formatBytes32String=t.Utf8ErrorFuncs=t.toUtf8String=t.toUtf8CodePoints=t.toUtf8Bytes=t._toEscapedUtf8String=t.nameprep=t.hexDataSlice=t.hexDataLength=t.hexZeroPad=t.hexValue=t.hexStripZeros=t.hexConcat=t.isHexString=t.hexlify=t.base64=t.base58=t.TransactionDescription=t.LogDescription=t.Interface=t.SigningKey=t.HDNode=t.defaultPath=t.isBytesLike=t.isBytes=t.zeroPad=t.stripZeros=t.concat=t.arrayify=t.shallowCopy=t.resolveProperties=t.getStatic=t.defineReadOnly=t.deepCopy=t.checkProperties=t.poll=t.fetchJson=t._fetchData=t.RLP=t.Logger=t.checkResultErrors=t.FormatTypes=t.ParamType=t.FunctionFragment=t.EventFragment=t.ErrorFragment=t.ConstructorFragment=t.Fragment=t.defaultAbiCoder=t.AbiCoder=void 0,t.Indexed=t.Utf8ErrorReason=t.UnicodeNormalizationForm=t.SupportedAlgorithm=t.mnemonicToSeed=t.isValidMnemonic=t.entropyToMnemonic=t.mnemonicToEntropy=t.getAccountPath=t.verifyTypedData=t.verifyMessage=t.recoverPublicKey=t.computePublicKey=t.recoverAddress=t.computeAddress=t.getJsonWalletAddress=t.TransactionTypes=t.serializeTransaction=t.parseTransaction=t.accessListify=t.joinSignature=t.splitSignature=t.soliditySha256=t.solidityKeccak256=t.solidityPack=t.shuffled=t.randomBytes=t.sha512=t.sha256=t.ripemd160=t.keccak256=t.computeHmac=t.commify=t.parseUnits=t.formatUnits=t.parseEther=t.formatEther=t.isAddress=t.getCreate2Address=t.getContractAddress=t.getIcapAddress=t.getAddress=t._TypedDataEncoder=t.id=t.isValidName=t.namehash=t.hashMessage=t.dnsEncode=t.parseBytes32String=void 0;var i=a.require$$0;Object.defineProperty(t,"AbiCoder",{enumerable:!0,get:function(){return i.AbiCoder}}),Object.defineProperty(t,"checkResultErrors",{enumerable:!0,get:function(){return i.checkResultErrors}}),Object.defineProperty(t,"ConstructorFragment",{enumerable:!0,get:function(){return i.ConstructorFragment}}),Object.defineProperty(t,"defaultAbiCoder",{enumerable:!0,get:function(){return i.defaultAbiCoder}}),Object.defineProperty(t,"ErrorFragment",{enumerable:!0,get:function(){return i.ErrorFragment}}),Object.defineProperty(t,"EventFragment",{enumerable:!0,get:function(){return i.EventFragment}}),Object.defineProperty(t,"FormatTypes",{enumerable:!0,get:function(){return i.FormatTypes}}),Object.defineProperty(t,"Fragment",{enumerable:!0,get:function(){return i.Fragment}}),Object.defineProperty(t,"FunctionFragment",{enumerable:!0,get:function(){return i.FunctionFragment}}),Object.defineProperty(t,"Indexed",{enumerable:!0,get:function(){return i.Indexed}}),Object.defineProperty(t,"Interface",{enumerable:!0,get:function(){return i.Interface}}),Object.defineProperty(t,"LogDescription",{enumerable:!0,get:function(){return i.LogDescription}}),Object.defineProperty(t,"ParamType",{enumerable:!0,get:function(){return i.ParamType}}),Object.defineProperty(t,"TransactionDescription",{enumerable:!0,get:function(){return i.TransactionDescription}});var s=m.default;Object.defineProperty(t,"getAddress",{enumerable:!0,get:function(){return s.getAddress}}),Object.defineProperty(t,"getCreate2Address",{enumerable:!0,get:function(){return s.getCreate2Address}}),Object.defineProperty(t,"getContractAddress",{enumerable:!0,get:function(){return s.getContractAddress}}),Object.defineProperty(t,"getIcapAddress",{enumerable:!0,get:function(){return s.getIcapAddress}}),Object.defineProperty(t,"isAddress",{enumerable:!0,get:function(){return s.isAddress}});var u=o(N);t.base64=u;var c=I;Object.defineProperty(t,"base58",{enumerable:!0,get:function(){return c.Base58}});var p=y.default;Object.defineProperty(t,"arrayify",{enumerable:!0,get:function(){return p.arrayify}}),Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return p.concat}}),Object.defineProperty(t,"hexConcat",{enumerable:!0,get:function(){return p.hexConcat}}),Object.defineProperty(t,"hexDataSlice",{enumerable:!0,get:function(){return p.hexDataSlice}}),Object.defineProperty(t,"hexDataLength",{enumerable:!0,get:function(){return p.hexDataLength}}),Object.defineProperty(t,"hexlify",{enumerable:!0,get:function(){return p.hexlify}}),Object.defineProperty(t,"hexStripZeros",{enumerable:!0,get:function(){return p.hexStripZeros}}),Object.defineProperty(t,"hexValue",{enumerable:!0,get:function(){return p.hexValue}}),Object.defineProperty(t,"hexZeroPad",{enumerable:!0,get:function(){return p.hexZeroPad}}),Object.defineProperty(t,"isBytes",{enumerable:!0,get:function(){return p.isBytes}}),Object.defineProperty(t,"isBytesLike",{enumerable:!0,get:function(){return p.isBytesLike}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return p.isHexString}}),Object.defineProperty(t,"joinSignature",{enumerable:!0,get:function(){return p.joinSignature}}),Object.defineProperty(t,"zeroPad",{enumerable:!0,get:function(){return p.zeroPad}}),Object.defineProperty(t,"splitSignature",{enumerable:!0,get:function(){return p.splitSignature}}),Object.defineProperty(t,"stripZeros",{enumerable:!0,get:function(){return p.stripZeros}});var l=D;Object.defineProperty(t,"_TypedDataEncoder",{enumerable:!0,get:function(){return l._TypedDataEncoder}}),Object.defineProperty(t,"dnsEncode",{enumerable:!0,get:function(){return l.dnsEncode}}),Object.defineProperty(t,"hashMessage",{enumerable:!0,get:function(){return l.hashMessage}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return l.id}}),Object.defineProperty(t,"isValidName",{enumerable:!0,get:function(){return l.isValidName}}),Object.defineProperty(t,"namehash",{enumerable:!0,get:function(){return l.namehash}});var d=R;Object.defineProperty(t,"defaultPath",{enumerable:!0,get:function(){return d.defaultPath}}),Object.defineProperty(t,"entropyToMnemonic",{enumerable:!0,get:function(){return d.entropyToMnemonic}}),Object.defineProperty(t,"getAccountPath",{enumerable:!0,get:function(){return d.getAccountPath}}),Object.defineProperty(t,"HDNode",{enumerable:!0,get:function(){return d.HDNode}}),Object.defineProperty(t,"isValidMnemonic",{enumerable:!0,get:function(){return d.isValidMnemonic}}),Object.defineProperty(t,"mnemonicToEntropy",{enumerable:!0,get:function(){return d.mnemonicToEntropy}}),Object.defineProperty(t,"mnemonicToSeed",{enumerable:!0,get:function(){return d.mnemonicToSeed}});var f=b.default;Object.defineProperty(t,"getJsonWalletAddress",{enumerable:!0,get:function(){return f.getJsonWalletAddress}});var h=M;Object.defineProperty(t,"keccak256",{enumerable:!0,get:function(){return h.keccak256}});var g=B;Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return g.Logger}});var P=F;Object.defineProperty(t,"computeHmac",{enumerable:!0,get:function(){return P.computeHmac}}),Object.defineProperty(t,"ripemd160",{enumerable:!0,get:function(){return P.ripemd160}}),Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return P.sha256}}),Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return P.sha512}});var x=z;Object.defineProperty(t,"solidityKeccak256",{enumerable:!0,get:function(){return x.keccak256}}),Object.defineProperty(t,"solidityPack",{enumerable:!0,get:function(){return x.pack}}),Object.defineProperty(t,"soliditySha256",{enumerable:!0,get:function(){return x.sha256}});var _=W;Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return _.randomBytes}}),Object.defineProperty(t,"shuffled",{enumerable:!0,get:function(){return _.shuffled}});var O=v.default;Object.defineProperty(t,"checkProperties",{enumerable:!0,get:function(){return O.checkProperties}}),Object.defineProperty(t,"deepCopy",{enumerable:!0,get:function(){return O.deepCopy}}),Object.defineProperty(t,"defineReadOnly",{enumerable:!0,get:function(){return O.defineReadOnly}}),Object.defineProperty(t,"getStatic",{enumerable:!0,get:function(){return O.getStatic}}),Object.defineProperty(t,"resolveProperties",{enumerable:!0,get:function(){return O.resolveProperties}}),Object.defineProperty(t,"shallowCopy",{enumerable:!0,get:function(){return O.shallowCopy}});var j=o(G);t.RLP=j;var S=q;Object.defineProperty(t,"computePublicKey",{enumerable:!0,get:function(){return S.computePublicKey}}),Object.defineProperty(t,"recoverPublicKey",{enumerable:!0,get:function(){return S.recoverPublicKey}}),Object.defineProperty(t,"SigningKey",{enumerable:!0,get:function(){return S.SigningKey}});var E=J;Object.defineProperty(t,"formatBytes32String",{enumerable:!0,get:function(){return E.formatBytes32String}}),Object.defineProperty(t,"nameprep",{enumerable:!0,get:function(){return E.nameprep}}),Object.defineProperty(t,"parseBytes32String",{enumerable:!0,get:function(){return E.parseBytes32String}}),Object.defineProperty(t,"_toEscapedUtf8String",{enumerable:!0,get:function(){return E._toEscapedUtf8String}}),Object.defineProperty(t,"toUtf8Bytes",{enumerable:!0,get:function(){return E.toUtf8Bytes}}),Object.defineProperty(t,"toUtf8CodePoints",{enumerable:!0,get:function(){return E.toUtf8CodePoints}}),Object.defineProperty(t,"toUtf8String",{enumerable:!0,get:function(){return E.toUtf8String}}),Object.defineProperty(t,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return E.Utf8ErrorFuncs}});var k=w.default;Object.defineProperty(t,"accessListify",{enumerable:!0,get:function(){return k.accessListify}}),Object.defineProperty(t,"computeAddress",{enumerable:!0,get:function(){return k.computeAddress}}),Object.defineProperty(t,"parseTransaction",{enumerable:!0,get:function(){return k.parse}}),Object.defineProperty(t,"recoverAddress",{enumerable:!0,get:function(){return k.recoverAddress}}),Object.defineProperty(t,"serializeTransaction",{enumerable:!0,get:function(){return k.serialize}}),Object.defineProperty(t,"TransactionTypes",{enumerable:!0,get:function(){return k.TransactionTypes}});var T=V;Object.defineProperty(t,"commify",{enumerable:!0,get:function(){return T.commify}}),Object.defineProperty(t,"formatEther",{enumerable:!0,get:function(){return T.formatEther}}),Object.defineProperty(t,"parseEther",{enumerable:!0,get:function(){return T.parseEther}}),Object.defineProperty(t,"formatUnits",{enumerable:!0,get:function(){return T.formatUnits}}),Object.defineProperty(t,"parseUnits",{enumerable:!0,get:function(){return T.parseUnits}});var A=H;Object.defineProperty(t,"verifyMessage",{enumerable:!0,get:function(){return A.verifyMessage}}),Object.defineProperty(t,"verifyTypedData",{enumerable:!0,get:function(){return A.verifyTypedData}});var U=$;Object.defineProperty(t,"_fetchData",{enumerable:!0,get:function(){return U._fetchData}}),Object.defineProperty(t,"fetchJson",{enumerable:!0,get:function(){return U.fetchJson}}),Object.defineProperty(t,"poll",{enumerable:!0,get:function(){return U.poll}});var C=F;Object.defineProperty(t,"SupportedAlgorithm",{enumerable:!0,get:function(){return C.SupportedAlgorithm}});var L=J;Object.defineProperty(t,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return L.UnicodeNormalizationForm}}),Object.defineProperty(t,"Utf8ErrorReason",{enumerable:!0,get:function(){return L.Utf8ErrorReason}})}(L);var X="wallet.unipass.id",ee={upDomain:X,upConnectUrl:"https://"+X+"/connect",upLogoutUrl:"https://"+X+"/logout",upSignMessageUrl:"https://"+X+"/sign-message",upTransactionUrl:"https://"+X+"/send-transaction",upLoadingUrl:"https://"+X+"/connect/loading"},te=function(){return ee},ne={protocol:"https",domain:"testnet.wallet.unipass.id"},re={protocol:"https",domain:"wallet.unipass.id"},oe={mainnet:{eth:"https://node.wallet.unipass.id/eth-mainnet",polygon:"https://node.wallet.unipass.id/polygon-mainnet",bsc:"https://node.wallet.unipass.id/bsc-mainnet",rangers:"https://node.wallet.unipass.id/rangers-mainnet",scroll:"https://node.wallet.unipass.id/scroll-mainnet",arbitrum:"https://node.wallet.unipass.id/arbitrum-mainnet",avalanche:"https://node.wallet.unipass.id/avalanche-mainnet",kcc:"https://node.wallet.unipass.id/kcc-mainnet",platon:"https://node.wallet.unipass.id/platon-mainnet",okc:"https://node.wallet.unipass.id/okc-mainnet"},testnet:{eth:"https://node.wallet.unipass.id/eth-goerli",polygon:"https://node.wallet.unipass.id/polygon-mumbai",bsc:"https://node.wallet.unipass.id/bsc-testnet",rangers:"https://node.wallet.unipass.id/rangers-robin",scroll:"https://node.wallet.unipass.id/scroll-testnet",arbitrum:"https://node.wallet.unipass.id/arbitrum-testnet",avalanche:"https://node.wallet.unipass.id/avalanche-testnet",kcc:"https://node.wallet.unipass.id/kcc-testnet",platon:"https://node.wallet.unipass.id/platon-testnet",okc:"https://node.wallet.unipass.id/okc-testnet"}},ie=function(e){var t;t="localStorage"===e?window.localStorage||localStorage:window.sessionStorage||sessionStorage;return{get:function(e){return t.getItem(e)||""},set:function(e,n){return t.setItem(e,n||"")},remove:function(e){return t.removeItem(e)}}},ae=function(){var e=Y(K().mark((function e(t,n){var r,o;return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=ie(t.storageType).get(Pe),e.t0=r&&JSON.parse(r),e.t0){e.next=6;break}return e.next=5,ue(t,n);case 5:e.t0=e.sent;case 6:return o=e.t0,e.abrupt("return",o);case 8:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),se=function(){var e=Y(K().mark((function e(t){var n;return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=4;break}return n=new T("UP_LOGOUT"),e.next=4,xe(n);case 4:ie("localStorage").remove(Pe),ie("sessionStorage").remove(Pe);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ue=function(){var e=Y(K().mark((function e(t,n){var r,o,i;return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r=n?JSON.stringify(n):"",o=new T("UP_LOGIN",r,t.appSettings),e.next=5,xe(o,null==n?void 0:n.connectType,null==n?void 0:n.forceLogin,null==n?void 0:n.eventListener);case 5:return(i=e.sent)&&i.address&&ie(t.storageType).set(Pe,JSON.stringify(i)),e.abrupt("return",i);case 10:throw e.prev=10,e.t0=e.catch(0),new Error("Account Not Available");case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(t,n){return e.apply(this,arguments)}}(),ce="UP_WALLET_POP",pe=null,le=null;function de(e,t,n){var r="innerWidth=462,width=462,innerHeight=810,height=810,top="+.5*(n.screen.availHeight-30-810)+",left="+.8*(n.screen.availWidth-10-462)+",toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,";return n.open(e,t,r)}function fe(e,t,n){return he.apply(this,arguments)}function he(){return(he=Y(K().mark((function e(t,n,r){var o,i,a;return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(null==pe||null!=(o=pe)&&o.closed)){e.next=8;break}if(null!=(pe=de(t,ce,window))){e.next=6;break}return e.next=5,ge(t,n,r);case 5:return e.abrupt("return",e.sent);case 6:e.next=9;break;case 8:le!==t?(pe.location.replace(t),pe.focus()):pe.focus();case 9:return i=setInterval((function(){if(pe&&pe.closed){var e={data:new T("UP_RESPONSE",JSON.stringify(new k("DECLINE","user reject connection")))};n(e,{close:function(){},send:function(){}}),clearInterval(i)}}),1e3),a=function(){pe&&!pe.closed&&pe.close(),pe=null},e.abrupt("return",{popup:pe,unmount:a});case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ge(e,t,n){return me.apply(this,arguments)}function me(){return(me=Y(K().mark((function e(t,n,r){var o,i;return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=document.createElement("div"),'\n <div\n class="up_notification"\n style="\n position: fixed;\n display: flex;\n flex-flow: row nowrap;\n justify-content: space-between;\n align-items: center;\n top: 26px;\n right: 26px;\n width: 340px;\n height: 96px;\n z-index: 100001;\n background-color: #362866;\n box-sizing: border-box;\n border: 2px solid #ffffff;\n border-radius: 8px;\n padding: 16px 20px;\n "\n>\n <div class="up_notification_left" style="color: white">\n <div\n class="up_notification_title"\n style="\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n margin-bottom: 8px;\n "\n >\n Request Pop-up\n </div>\n <div\n class="up_notification_tip"\n style="\n font-weight: 450;\n font-size: 12px;\n line-height: 20px;\n color: rgba(255, 255, 255, 0.8);\n "\n >\n Click Approve to complete creating or using wallet\n </div>\n </div>\n <div\n class="up_notification_right"\n style="\n width: 90px;\n height: 35px;\n font-size: 12px;\n text-align: center;\n background: linear-gradient(270deg, #997afb 0%, #7a55f8 63.6%);\n border-radius: 6px;\n line-height: 35px;\n color: white;\n margin-left: 20px;\n cursor: pointer;\n "\n >\n Approve\n </div>\n</div>\n ',o.innerHTML='\n <div\n class="up_notification"\n style="\n position: fixed;\n display: flex;\n flex-flow: row nowrap;\n justify-content: space-between;\n align-items: center;\n top: 26px;\n right: 26px;\n width: 340px;\n height: 96px;\n z-index: 100001;\n background-color: #362866;\n box-sizing: border-box;\n border: 2px solid #ffffff;\n border-radius: 8px;\n padding: 16px 20px;\n "\n>\n <div class="up_notification_left" style="color: white">\n <div\n class="up_notification_title"\n style="\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n margin-bottom: 8px;\n "\n >\n Request Pop-up\n </div>\n <div\n class="up_notification_tip"\n style="\n font-weight: 450;\n font-size: 12px;\n line-height: 20px;\n color: rgba(255, 255, 255, 0.8);\n "\n >\n Click Approve to complete creating or using wallet\n </div>\n </div>\n <div\n class="up_notification_right"\n style="\n width: 90px;\n height: 35px;\n font-size: 12px;\n text-align: center;\n background: linear-gradient(270deg, #997afb 0%, #7a55f8 63.6%);\n border-radius: 6px;\n line-height: 35px;\n color: white;\n margin-left: 20px;\n cursor: pointer;\n "\n >\n Approve\n </div>\n</div>\n ',document.body.appendChild(o),i=document.querySelector(".up_notification_right"),e.abrupt("return",new Promise((function(e){null==i||i.addEventListener("click",(function(){document.body.removeChild(o),e(fe(t,n,r))}),!1)})));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ye=function(){};function be(e,t,n){if("UP_LOGIN"===e)return"google"===t?te().upConnectUrl+"?connectType=google&forceLogin="+(n?"1":"0"):"email"===t?te().upConnectUrl+"?connectType=email&forceLogin="+(n?"1":"0"):te().upConnectUrl+"?forceLogin="+(n?"1":"0");if("UP_LOGOUT"===e)return te().upLogoutUrl;if("UP_SIGN_MESSAGE"===e)return te().upSignMessageUrl;if("UP_TRANSACTION"===e)return te().upTransactionUrl;if("UP_READY"===e)return te().upLoadingUrl;throw new Error("unsupport type "+e)}function ve(e,t,n,r){return we.apply(this,arguments)}function we(){return we=Y(K().mark((function e(t,n,r,o){var i,a,s,u,c,p,l,d,f,h;return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h=function(e){try{null==p||p.postMessage(JSON.parse(JSON.stringify(e||{})),"*")}catch(t){console.error("Popup Send Error",e,t)}},f=function(){try{window.removeEventListener("message",d),l(),i()}catch(e){console.error("Popup Close Error",e)}},d=function(e){try{if("object"!=typeof e.data)return;var t=e.data;if(!t||!t.type)return;"UP_CLOSE"===e.data.type&&f(),"UP_READY"===t.type&&s(e,{send:h,close:f}),"UP_RESPONSE"===t.type&&u(e,{send:h,close:f}),"UP_EVENT"===t.type&&a(e,{send:h,close:f})}catch(e){console.error("Popup Callback Error",e),f()}},null!=t){e.next=5;break}return e.abrupt("return",{send:ye,close:ye});case 5:return i=(null==o?void 0:o.onClose)||ye,a=(null==o?void 0:o.onMessage)||ye,s=(null==o?void 0:o.onReady)||ye,u=(null==o?void 0:o.onResponse)||ye,window.addEventListener("message",d),e.next=12,fe(be(t.type,n,r),u,t.appSetting);case 12:return c=e.sent,p=c.popup,l=c.unmount,e.abrupt("return",{send:h,close:f});case 16:case"end":return e.stop()}}),e)}))),we.apply(this,arguments)}var Pe="UP-A";function xe(e,t,n,r){return new Promise(function(){var o=Y(K().mark((function o(i,a){return K().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,ve(e,t,n,{onReady:function(t,n){return Y(K().mark((function t(){var r;return K().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=n.send,t.prev=1,r(e),t.next=8;break;case 5:throw t.prev=5,t.t0=t.catch(1),t.t0;case 8:case"end":return t.stop()}}),t,null,[[1,5]])})))()},onResponse:function(t,n){return Y(K().mark((function r(){var o,s,u;return K().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(o=n.close,r.prev=1,"object"==typeof t.data){r.next=4;break}return r.abrupt("return");case 4:s=t.data,u=JSON.parse(s.payload),r.t0=u.type,r.next="APPROVE"===r.t0?9:"DECLINE"===r.t0?12:27;break;case 9:return i(u.data),o(),r.abrupt("break",30);case 12:if("expired"!==u.data){r.next=24;break}if("UP_LOGIN"!==e.type){r.next=15;break}return r.abrupt("return");case 15:if("UP_LOGOUT"!==e.type){r.next=19;break}return i(u.data),o(),r.abrupt("return");case 19:if("UP_TRANSACTION"!==e.type&&"UP_SIGN_MESSAGE"!==e.type){r.next=24;break}return se(!1),a("can not authorize without login"),o(),r.abrupt("break",30);case 24:return a("Declined: "+(u.data||"No reason supplied")),o(),r.abrupt("break",30);case 27:return a("Declined: No reason supplied"),o(),r.abrupt("break",30);case 30:r.next=35;break;case 32:throw r.prev=32,r.t1=r.catch(1),r.t1;case 35:case"end":return r.stop()}}),r,null,[[1,32]])})))()},onMessage:function(e,t){return Y(K().mark((function t(){var n,o;return K().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r){t.next=2;break}return t.abrupt("return");case 2:if(t.prev=2,"object"==typeof e.data){t.next=5;break}return t.abrupt("return");case 5:n=e.data,o=JSON.parse(n.payload),r(o),t.next=13;break;case 10:throw t.prev=10,t.t0=t.catch(2),t.t0;case 13:case"end":return t.stop()}}),t,null,[[2,10]])})))()},onClose:function(){return Y(K().mark((function e(){return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a("Declined: Externally Halted");case 1:case"end":return e.stop()}}),e)})))()}});case 2:case"end":return o.stop()}}),o)})));return function(e,t){return o.apply(this,arguments)}}())}var _e=function(){var e=Y(K().mark((function e(t,n){var r,o,i,a;return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=ie(n.storageType).get(Pe),(o=r&&JSON.parse(r))&&t.from&&o.address.toLowerCase()===t.from.toLowerCase()){e.next=4;break}throw new Error("can not authorize without login");case 4:return i=new T("UP_SIGN_MESSAGE",JSON.stringify(t),null==n?void 0:n.appSettings),e.prev=5,e.next=8,xe(i);case 8:return a=e.sent,e.abrupt("return",a);case 12:throw e.prev=12,e.t0=e.catch(5),new Error(e.t0);case 15:case"end":return e.stop()}}),e,null,[[5,12]])})));return function(t,n){return e.apply(this,arguments)}}(),Oe=function(){var e=Y(K().mark((function e(t,n){var r,o,i,a;return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=ie(n.storageType).get(Pe),(o=r&&JSON.parse(r))&&t.from&&o.address.toLowerCase()===t.from.toLowerCase()){e.next=4;break}throw new Error("can not authorize without login");case 4:return i=new T("UP_TRANSACTION",JSON.stringify(t),n.appSettings),e.prev=5,e.next=8,xe(i);case 8:return a=e.sent,e.abrupt("return",a);case 12:throw e.prev=12,e.t0=e.catch(5),new Error(e.t0);case 15:case"end":return e.stop()}}),e,null,[[5,12]])})));return function(t,n){return e.apply(this,arguments)}}(),je="0x1626ba7e";var Se=function(){function e(e){this.initConfig(e)}var t=e.prototype;return t.initConfig=function(e){this._config={env:"prod",nodeRPC:"",chainType:"polygon",storageType:"sessionStorage"},this._config.env=e.env||"prod",this._config.chainType=e.chainType||"polygon";var t,n,o=(t=this._config.env,n=this._config.chainType,{env:t,nodeRPC:"prod"===t?oe.mainnet[n]:oe.testnet[n],chainType:n,walletUrl:"prod"===t?re:ne});this._config.nodeRPC=e.nodeRPC||o.nodeRPC,this._config.appSettings=function(e,t){return Q({},t||{},{chain:(null==t?void 0:t.chain)||e,appName:(null==t?void 0:t.appName)||"MyDemo"})}(this._config.chainType,e.appSettings),this._provider=new r.JsonRpcProvider(this._config.nodeRPC),this._auth_provider=new r.JsonRpcProvider(function(e){return"prod"===e?oe.mainnet.polygon:oe.testnet.polygon}(this._config.env));var i,a,s,u=e.walletUrl||o.walletUrl;u&&(a=(i=u).domain,s=i.protocol,ee={upDomain:a=a||X,upConnectUrl:(s=s||"https")+"://"+a+"/connect",upLogoutUrl:s+"://"+a+"/logout",upSignMessageUrl:s+"://"+a+"/sign-message",upTransactionUrl:s+"://"+a+"/send-transaction",upLoadingUrl:s+"://"+a+"/connect/loading"}),this._config.storageType=e.storageType||"sessionStorage"},t.updateConfig=function(e){this._config&&(e.chainType&&(this._config.chainType=e.chainType),e.nodeRPC&&(this._config.nodeRPC=e.nodeRPC,this._provider=new r.JsonRpcProvider(this._config.nodeRPC)),e.appSettings&&(this._config.appSettings=e.appSettings))},t.login=function(){var e=Y(K().mark((function e(t){return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ae(this._config,t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.getAccount=function(){var e,t;return e=this._config.storageType,(t=ie(e).get(Pe))?JSON.parse(t):void 0},t.logout=function(){var e=Y(K().mark((function e(t){return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===t&&(t=!1),e.next=3,se(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),t.getProvider=function(){return this._provider},t.getAuthProvider=function(){return this._auth_provider},t.isLogin=function(){return!!this.getAccount()},t.assertLogin=function(){if(!this.isLogin())throw new Error("user is not login")},t.getAddress=function(){return this.assertLogin(),this.getAccount().address},t.sendTransaction=function(){var e=Y(K().mark((function e(t){return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertLogin(),e.next=3,Oe(t,this._config);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.signMessage=function(){var e=Y(K().mark((function e(t,n){var r,o,i,a,s;return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertLogin(),o=(r=n||{}).isEIP191Prefix,i=void 0!==o&&o,a=r.onAuthChain,s=void 0===a||a,"string"==typeof t&&(t=L.toUtf8Bytes(t)),e.next=5,_e(new E(this.getAddress(),L.hexlify(t),"V1",i,s),this._config);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),t.isValidSignature=function(){var e=Y(K().mark((function e(t,n,r){var o,i;return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r||(this.assertLogin(),r=this.getAddress()),o=new f.Contract(r,[{inputs:[{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{internalType:"bytes4",name:"magicValue",type:"bytes4"}],stateMutability:"view",type:"function"}],this._auth_provider),e.next=4,o.isValidSignature(("string"==typeof(a=t)&&(a=L.toUtf8Bytes(a)),L.keccak256(L.concat([L.toUtf8Bytes("UniPass Signed Message:\n"),L.toUtf8Bytes(String(a.length)),a]))),n);case 4:return i=e.sent,e.abrupt("return",i===je);case 6:case"end":return e.stop()}var a}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}(),t.signTypedData=function(){var e=Y(K().mark((function e(t,n){var r,o;return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertLogin(),null!=t){e.next=3;break}throw new Error("Missing data parameter");case 3:return r=(n||{}).onAuthChain,o=void 0===r||r,e.next=6,_e(new E(this.getAddress(),JSON.stringify(t),"V4",!1,o),this._config);case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),t.isValidTypedSignature=function(){var e=Y(K().mark((function e(t,n,r){var o,i,a;return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t){e.next=2;break}throw new Error("Missing data parameter");case 2:return n||(this.assertLogin(),n=this.getAddress()),o=new f.Contract(n,[{inputs:[{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{internalType:"bytes4",name:"magicValue",type:"bytes4"}],stateMutability:"view",type:"function"}],this._auth_provider),i=C(t),e.next=7,o.isValidSignature(i,r);case 7:return a=e.sent,e.abrupt("return",a===je);case 9:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}(),e}();function Ee(n){var r,o,i;return e.__awaiter(this,void 0,void 0,(function*(){const a=n.JsonRpcProvider||e.DefaultJsonRpcProvider,s=null!==(r=n.chainId)&&void 0!==r?r:1;let u=null!==(o=n.rpcUrl)&&void 0!==o?o:null===(i=n.rpc)||void 0===i?void 0:i[s];const c=new class extends a{constructor(t,r){super(t,r),this.updateUpWalletConfig=t=>{var r;const o=null===(r=n.rpc)||void 0===r?void 0:r[t];if(!e.SUPPORTED_CHAIN_ID.includes(t))throw new Error(`chainId ${t} not supported`);if(this.upWallet.updateConfig({chainType:e.getChainNameByChainId(t),nodeRPC:o,appSettings:{chain:e.getChainNameByChainId(t)}}),"object"==typeof this.network)this.network.chainId=t;else{const e={chainId:t,name:"unknown"};p.defineReadOnly(this,"_network",e),this.emit("network",e,null)}return this.rpcUrl=o,this.emit("chainChanged",`0x${t.toString(16)}`),{result:!0}},this.rpcUrl=t,this.upWallet=new Se({env:e.getENVByChainId(s),chainType:e.getChainNameByChainId(s),appSettings:{appIcon:n.appLogoUrl,appName:n.appName,chain:e.getChainNameByChainId(s)},rpcUrl:u,storageType:"sessionStorage"})}getSigner(){var e;const t=this.upWallet.getAccount();return new j(c,this.upWallet,null!==(e=null==t?void 0:t.address)&&void 0!==e?e:"",0)}connect(){return e.__awaiter(this,void 0,void 0,(function*(){const e=this.upWallet.getAccount();return e||(yield this.upWallet.login({email:false}))}))}disconnect(){return e.__awaiter(this,void 0,void 0,(function*(){yield this.upWallet.logout()}))}listAccounts(){return e.__awaiter(this,void 0,void 0,(function*(){const e=this.upWallet.getAccount();return(null==e?void 0:e.address)?[null==e?void 0:e.address]:[]}))}getAddress(){const e=this.upWallet.getAccount();return Promise.resolve((null==e?void 0:e.address)?t.getAddress(null==e?void 0:e.address):null)}}(u,s);return c}))}exports.createProvider=Ee,exports.default=function(t,n){return e.__awaiter(this,void 0,void 0,(function*(){const e=yield Ee(t);return e.on("connect",n.connect),e.on("disconnect",(e=>{n.disconnect(e),n.accountsChanged([])})),e.on("accountsChanged",n.accountsChanged),e.on("chainChanged",n.chainChanged),e.on("message",(({type:e,data:t})=>n.message(e,t))),yield e.connect(),e}))},exports.disconnectWallet=function(){var t;null===(t=e.useWalletStore.getState().provider)||void 0===t||t.disconnect()},exports.signTypedData=function(t){var n,r;return null===(r=null===(n=e.useWalletStore.getState().provider)||void 0===n?void 0:n.upWallet)||void 0===r?void 0:r.signTypedData(t)},exports.switchChain=function(t){var n;const r=t.addChainParameters.chainId,o="string"==typeof r&&(null==r?void 0:r.startsWith("0x"))?parseInt(r,16):Number(r);if(!e.SUPPORTED_CHAIN_ID.includes(o))throw new Error(`chainId ${o} not supported`);return null===(n=e.useWalletStore.getState().provider)||void 0===n?void 0:n.updateUpWalletConfig(o)};
1
+ "use strict";var e=require("./index-c74605d1.cjs"),t=require("@ethersproject/address"),n=require("@ethersproject/abstract-signer"),r=require("@ethersproject/providers"),o=require("@ethersproject/bytes"),i=require("./typed-data-2d8f6df1.cjs"),a=require("./index-9626a95b.cjs"),s=require("./ethers-0f2d94e7.cjs"),u=require("./id-53a53aa8.cjs"),c=require("@ethersproject/json-wallets"),p=require("@ethersproject/properties"),l=require("./index-c7754d77.cjs"),d=require("@ethersproject/transactions"),f=require("@ethersproject/contracts");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("zustand"),require("events"),require("buffer"),require("@ethersproject/abstract-provider"),require("@ethersproject/constants"),require("./interface-fbf06485.cjs"),require("./hash-7ce6fed5.cjs"),require("./inherits_browser-50deae74.cjs");var g,m=h(t),y=h(o),b=h(c),v=h(p),w=h(d),P=Object.freeze({__proto__:null,_toEscapedUtf8String:e._toEscapedUtf8String,toUtf8Bytes:e.toUtf8Bytes,toUtf8CodePoints:e.toUtf8CodePoints,toUtf8String:e.toUtf8String,Utf8ErrorFuncs:e.Utf8ErrorFuncs,get Utf8ErrorReason(){return e.Utf8ErrorReason},get UnicodeNormalizationForm(){return e.UnicodeNormalizationForm},formatBytes32String:s.formatBytes32String,parseBytes32String:s.parseBytes32String,nameprep:s.nameprep}),x=Object.freeze({__proto__:null,id:u.id,dnsEncode:s.dnsEncode,namehash:s.namehash,isValidName:s.isValidName,ensNormalize:s.ensNormalize,messagePrefix:s.messagePrefix,hashMessage:s.hashMessage,_TypedDataEncoder:i.TypedDataEncoder}),_=Object.freeze({__proto__:null,computeHmac:s.computeHmac,ripemd160:s.ripemd160,sha256:s.sha256,sha512:s.sha512,get SupportedAlgorithm(){return s.SupportedAlgorithm}}),O=Object.freeze({__proto__:null,randomBytes:s.randomBytes,shuffled:s.shuffled});class j extends n.Signer{constructor(e,t,n,r){super(),this._address=n,this._index=null!=r?r:0,this.provider=e,this.upWallet=t}_legacySignMessage(e){throw new Error("Method not implemented.")}sendUncheckedTransaction(e){throw new Error("Method not implemented.")}unlock(e){throw new Error("Method not implemented.")}getAddress(){return e.__awaiter(this,void 0,void 0,(function*(){return Promise.resolve(t.getAddress(this._address))}))}signMessage(t){return e.__awaiter(this,void 0,void 0,(function*(){if(!this.upWallet)throw new Error(`address unknown '${t}'`);return yield this.upWallet.signMessage(t,{isEIP191Prefix:!0,onAuthChain:!0})}))}_signTypedData(t,n,r){return e.__awaiter(this,void 0,void 0,(function*(){throw new Error("Method not implemented.")}))}signTransaction(t){return e.__awaiter(this,void 0,void 0,(function*(){if(!this.upWallet)throw new Error(`address unknown '${t.from}'`);return this.upWallet.sendTransaction({from:t.from,to:t.to,value:t.value,data:t.data})}))}sendTransaction(t){return e.__awaiter(this,void 0,void 0,(function*(){if(!this.upWallet)throw new Error(`address unknown '${t.from}'`);return{hash:yield this.upWallet.sendTransaction({from:t.from,to:t.to,value:t.value,data:t.data}),from:t.from}}))}connect(e){return new j(null!=e?e:this.provider,this.upWallet,this._address,this._index)}connectUnchecked(){return new j(this.provider,this.upWallet,this._address,this._index)}}!function(e){e.REGISTER="register"}(g||(g={}));var S,E=function(e,t,n,r,o){this.from=e,this.msg=t,this.type=n,this.isEIP191Prefix=r,this.onAuthChain=o},k=function(e,t){this.type=e,this.data=t},T=function(e,t,n){this.type=e,this.payload=t,this.appSetting=n};function A(){return A=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},A.apply(this,arguments)}!function(e){e.LIGHT="light",e.DARK="dark"}(S||(S={}));var U=function(e){var t=A({},e.types);return delete t.EIP712Domain,i.TypedDataEncoder.hash(e.domain,t,e.message)},C=function(e){return o.arrayify(U(e))},L={},N=e.getAugmentedNamespace(s.lib_esm),I=e.getAugmentedNamespace(s.lib_esm$1),D=e.getAugmentedNamespace(x),R=e.getAugmentedNamespace(s.lib_esm$2),M=e.getAugmentedNamespace(e.lib_esm),B=e.getAugmentedNamespace(e.lib_esm$1),F=e.getAugmentedNamespace(_),z=e.getAugmentedNamespace(s.lib_esm$3),W=e.getAugmentedNamespace(O),G=e.getAugmentedNamespace(l.lib_esm),q=e.getAugmentedNamespace(s.lib_esm$4),J=e.getAugmentedNamespace(P),V=e.getAugmentedNamespace(e.lib_esm$2),H=e.getAugmentedNamespace(s.lib_esm$5),$=e.getAugmentedNamespace(e.lib_esm$3);function K(){K=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function c(e,t,n,o){var i=t&&t.prototype instanceof d?t:d,a=Object.create(i.prototype),s=new j(o||[]);return r(a,"_invoke",{value:P(e,n,s)}),a}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var l={};function d(){}function f(){}function h(){}var g={};u(g,i,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(S([])));y&&y!==t&&n.call(y,i)&&(g=y);var b=h.prototype=d.prototype=Object.create(g);function v(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function o(r,i,a,s){var u=p(e[r],e,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){o("next",e,a,s)}),(function(e){o("throw",e,a,s)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return o("throw",e,a,s)}))}s(u.arg)}var i;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){o(e,n,t,r)}))}return i=i?i.then(r,r):r()}})}function P(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return E()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=x(a,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=p(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function x(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),l;var o=p(r,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,l;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function _(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function S(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return f.prototype=h,r(b,"constructor",{value:h,configurable:!0}),r(h,"constructor",{value:f,configurable:!0}),f.displayName=u(h,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,u(e,s,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},v(w.prototype),u(w.prototype,a,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new w(c(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},v(b),u(b,s,"Generator"),u(b,i,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},e}function Z(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function Y(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Z(i,r,o,a,s,"next",e)}function s(e){Z(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Q(){return Q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Q.apply(this,arguments)}!function(t){var n=e.commonjsGlobal&&e.commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=e.commonjsGlobal&&e.commonjsGlobal.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=e.commonjsGlobal&&e.commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&n(t,e,o);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.formatBytes32String=t.Utf8ErrorFuncs=t.toUtf8String=t.toUtf8CodePoints=t.toUtf8Bytes=t._toEscapedUtf8String=t.nameprep=t.hexDataSlice=t.hexDataLength=t.hexZeroPad=t.hexValue=t.hexStripZeros=t.hexConcat=t.isHexString=t.hexlify=t.base64=t.base58=t.TransactionDescription=t.LogDescription=t.Interface=t.SigningKey=t.HDNode=t.defaultPath=t.isBytesLike=t.isBytes=t.zeroPad=t.stripZeros=t.concat=t.arrayify=t.shallowCopy=t.resolveProperties=t.getStatic=t.defineReadOnly=t.deepCopy=t.checkProperties=t.poll=t.fetchJson=t._fetchData=t.RLP=t.Logger=t.checkResultErrors=t.FormatTypes=t.ParamType=t.FunctionFragment=t.EventFragment=t.ErrorFragment=t.ConstructorFragment=t.Fragment=t.defaultAbiCoder=t.AbiCoder=void 0,t.Indexed=t.Utf8ErrorReason=t.UnicodeNormalizationForm=t.SupportedAlgorithm=t.mnemonicToSeed=t.isValidMnemonic=t.entropyToMnemonic=t.mnemonicToEntropy=t.getAccountPath=t.verifyTypedData=t.verifyMessage=t.recoverPublicKey=t.computePublicKey=t.recoverAddress=t.computeAddress=t.getJsonWalletAddress=t.TransactionTypes=t.serializeTransaction=t.parseTransaction=t.accessListify=t.joinSignature=t.splitSignature=t.soliditySha256=t.solidityKeccak256=t.solidityPack=t.shuffled=t.randomBytes=t.sha512=t.sha256=t.ripemd160=t.keccak256=t.computeHmac=t.commify=t.parseUnits=t.formatUnits=t.parseEther=t.formatEther=t.isAddress=t.getCreate2Address=t.getContractAddress=t.getIcapAddress=t.getAddress=t._TypedDataEncoder=t.id=t.isValidName=t.namehash=t.hashMessage=t.dnsEncode=t.parseBytes32String=void 0;var i=a.require$$0;Object.defineProperty(t,"AbiCoder",{enumerable:!0,get:function(){return i.AbiCoder}}),Object.defineProperty(t,"checkResultErrors",{enumerable:!0,get:function(){return i.checkResultErrors}}),Object.defineProperty(t,"ConstructorFragment",{enumerable:!0,get:function(){return i.ConstructorFragment}}),Object.defineProperty(t,"defaultAbiCoder",{enumerable:!0,get:function(){return i.defaultAbiCoder}}),Object.defineProperty(t,"ErrorFragment",{enumerable:!0,get:function(){return i.ErrorFragment}}),Object.defineProperty(t,"EventFragment",{enumerable:!0,get:function(){return i.EventFragment}}),Object.defineProperty(t,"FormatTypes",{enumerable:!0,get:function(){return i.FormatTypes}}),Object.defineProperty(t,"Fragment",{enumerable:!0,get:function(){return i.Fragment}}),Object.defineProperty(t,"FunctionFragment",{enumerable:!0,get:function(){return i.FunctionFragment}}),Object.defineProperty(t,"Indexed",{enumerable:!0,get:function(){return i.Indexed}}),Object.defineProperty(t,"Interface",{enumerable:!0,get:function(){return i.Interface}}),Object.defineProperty(t,"LogDescription",{enumerable:!0,get:function(){return i.LogDescription}}),Object.defineProperty(t,"ParamType",{enumerable:!0,get:function(){return i.ParamType}}),Object.defineProperty(t,"TransactionDescription",{enumerable:!0,get:function(){return i.TransactionDescription}});var s=m.default;Object.defineProperty(t,"getAddress",{enumerable:!0,get:function(){return s.getAddress}}),Object.defineProperty(t,"getCreate2Address",{enumerable:!0,get:function(){return s.getCreate2Address}}),Object.defineProperty(t,"getContractAddress",{enumerable:!0,get:function(){return s.getContractAddress}}),Object.defineProperty(t,"getIcapAddress",{enumerable:!0,get:function(){return s.getIcapAddress}}),Object.defineProperty(t,"isAddress",{enumerable:!0,get:function(){return s.isAddress}});var u=o(N);t.base64=u;var c=I;Object.defineProperty(t,"base58",{enumerable:!0,get:function(){return c.Base58}});var p=y.default;Object.defineProperty(t,"arrayify",{enumerable:!0,get:function(){return p.arrayify}}),Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return p.concat}}),Object.defineProperty(t,"hexConcat",{enumerable:!0,get:function(){return p.hexConcat}}),Object.defineProperty(t,"hexDataSlice",{enumerable:!0,get:function(){return p.hexDataSlice}}),Object.defineProperty(t,"hexDataLength",{enumerable:!0,get:function(){return p.hexDataLength}}),Object.defineProperty(t,"hexlify",{enumerable:!0,get:function(){return p.hexlify}}),Object.defineProperty(t,"hexStripZeros",{enumerable:!0,get:function(){return p.hexStripZeros}}),Object.defineProperty(t,"hexValue",{enumerable:!0,get:function(){return p.hexValue}}),Object.defineProperty(t,"hexZeroPad",{enumerable:!0,get:function(){return p.hexZeroPad}}),Object.defineProperty(t,"isBytes",{enumerable:!0,get:function(){return p.isBytes}}),Object.defineProperty(t,"isBytesLike",{enumerable:!0,get:function(){return p.isBytesLike}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return p.isHexString}}),Object.defineProperty(t,"joinSignature",{enumerable:!0,get:function(){return p.joinSignature}}),Object.defineProperty(t,"zeroPad",{enumerable:!0,get:function(){return p.zeroPad}}),Object.defineProperty(t,"splitSignature",{enumerable:!0,get:function(){return p.splitSignature}}),Object.defineProperty(t,"stripZeros",{enumerable:!0,get:function(){return p.stripZeros}});var l=D;Object.defineProperty(t,"_TypedDataEncoder",{enumerable:!0,get:function(){return l._TypedDataEncoder}}),Object.defineProperty(t,"dnsEncode",{enumerable:!0,get:function(){return l.dnsEncode}}),Object.defineProperty(t,"hashMessage",{enumerable:!0,get:function(){return l.hashMessage}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return l.id}}),Object.defineProperty(t,"isValidName",{enumerable:!0,get:function(){return l.isValidName}}),Object.defineProperty(t,"namehash",{enumerable:!0,get:function(){return l.namehash}});var d=R;Object.defineProperty(t,"defaultPath",{enumerable:!0,get:function(){return d.defaultPath}}),Object.defineProperty(t,"entropyToMnemonic",{enumerable:!0,get:function(){return d.entropyToMnemonic}}),Object.defineProperty(t,"getAccountPath",{enumerable:!0,get:function(){return d.getAccountPath}}),Object.defineProperty(t,"HDNode",{enumerable:!0,get:function(){return d.HDNode}}),Object.defineProperty(t,"isValidMnemonic",{enumerable:!0,get:function(){return d.isValidMnemonic}}),Object.defineProperty(t,"mnemonicToEntropy",{enumerable:!0,get:function(){return d.mnemonicToEntropy}}),Object.defineProperty(t,"mnemonicToSeed",{enumerable:!0,get:function(){return d.mnemonicToSeed}});var f=b.default;Object.defineProperty(t,"getJsonWalletAddress",{enumerable:!0,get:function(){return f.getJsonWalletAddress}});var h=M;Object.defineProperty(t,"keccak256",{enumerable:!0,get:function(){return h.keccak256}});var g=B;Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return g.Logger}});var P=F;Object.defineProperty(t,"computeHmac",{enumerable:!0,get:function(){return P.computeHmac}}),Object.defineProperty(t,"ripemd160",{enumerable:!0,get:function(){return P.ripemd160}}),Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return P.sha256}}),Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return P.sha512}});var x=z;Object.defineProperty(t,"solidityKeccak256",{enumerable:!0,get:function(){return x.keccak256}}),Object.defineProperty(t,"solidityPack",{enumerable:!0,get:function(){return x.pack}}),Object.defineProperty(t,"soliditySha256",{enumerable:!0,get:function(){return x.sha256}});var _=W;Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return _.randomBytes}}),Object.defineProperty(t,"shuffled",{enumerable:!0,get:function(){return _.shuffled}});var O=v.default;Object.defineProperty(t,"checkProperties",{enumerable:!0,get:function(){return O.checkProperties}}),Object.defineProperty(t,"deepCopy",{enumerable:!0,get:function(){return O.deepCopy}}),Object.defineProperty(t,"defineReadOnly",{enumerable:!0,get:function(){return O.defineReadOnly}}),Object.defineProperty(t,"getStatic",{enumerable:!0,get:function(){return O.getStatic}}),Object.defineProperty(t,"resolveProperties",{enumerable:!0,get:function(){return O.resolveProperties}}),Object.defineProperty(t,"shallowCopy",{enumerable:!0,get:function(){return O.shallowCopy}});var j=o(G);t.RLP=j;var S=q;Object.defineProperty(t,"computePublicKey",{enumerable:!0,get:function(){return S.computePublicKey}}),Object.defineProperty(t,"recoverPublicKey",{enumerable:!0,get:function(){return S.recoverPublicKey}}),Object.defineProperty(t,"SigningKey",{enumerable:!0,get:function(){return S.SigningKey}});var E=J;Object.defineProperty(t,"formatBytes32String",{enumerable:!0,get:function(){return E.formatBytes32String}}),Object.defineProperty(t,"nameprep",{enumerable:!0,get:function(){return E.nameprep}}),Object.defineProperty(t,"parseBytes32String",{enumerable:!0,get:function(){return E.parseBytes32String}}),Object.defineProperty(t,"_toEscapedUtf8String",{enumerable:!0,get:function(){return E._toEscapedUtf8String}}),Object.defineProperty(t,"toUtf8Bytes",{enumerable:!0,get:function(){return E.toUtf8Bytes}}),Object.defineProperty(t,"toUtf8CodePoints",{enumerable:!0,get:function(){return E.toUtf8CodePoints}}),Object.defineProperty(t,"toUtf8String",{enumerable:!0,get:function(){return E.toUtf8String}}),Object.defineProperty(t,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return E.Utf8ErrorFuncs}});var k=w.default;Object.defineProperty(t,"accessListify",{enumerable:!0,get:function(){return k.accessListify}}),Object.defineProperty(t,"computeAddress",{enumerable:!0,get:function(){return k.computeAddress}}),Object.defineProperty(t,"parseTransaction",{enumerable:!0,get:function(){return k.parse}}),Object.defineProperty(t,"recoverAddress",{enumerable:!0,get:function(){return k.recoverAddress}}),Object.defineProperty(t,"serializeTransaction",{enumerable:!0,get:function(){return k.serialize}}),Object.defineProperty(t,"TransactionTypes",{enumerable:!0,get:function(){return k.TransactionTypes}});var T=V;Object.defineProperty(t,"commify",{enumerable:!0,get:function(){return T.commify}}),Object.defineProperty(t,"formatEther",{enumerable:!0,get:function(){return T.formatEther}}),Object.defineProperty(t,"parseEther",{enumerable:!0,get:function(){return T.parseEther}}),Object.defineProperty(t,"formatUnits",{enumerable:!0,get:function(){return T.formatUnits}}),Object.defineProperty(t,"parseUnits",{enumerable:!0,get:function(){return T.parseUnits}});var A=H;Object.defineProperty(t,"verifyMessage",{enumerable:!0,get:function(){return A.verifyMessage}}),Object.defineProperty(t,"verifyTypedData",{enumerable:!0,get:function(){return A.verifyTypedData}});var U=$;Object.defineProperty(t,"_fetchData",{enumerable:!0,get:function(){return U._fetchData}}),Object.defineProperty(t,"fetchJson",{enumerable:!0,get:function(){return U.fetchJson}}),Object.defineProperty(t,"poll",{enumerable:!0,get:function(){return U.poll}});var C=F;Object.defineProperty(t,"SupportedAlgorithm",{enumerable:!0,get:function(){return C.SupportedAlgorithm}});var L=J;Object.defineProperty(t,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return L.UnicodeNormalizationForm}}),Object.defineProperty(t,"Utf8ErrorReason",{enumerable:!0,get:function(){return L.Utf8ErrorReason}})}(L);var X="wallet.unipass.id",ee={upDomain:X,upConnectUrl:"https://"+X+"/connect",upLogoutUrl:"https://"+X+"/logout",upSignMessageUrl:"https://"+X+"/sign-message",upTransactionUrl:"https://"+X+"/send-transaction",upLoadingUrl:"https://"+X+"/connect/loading"},te=function(){return ee},ne={protocol:"https",domain:"testnet.wallet.unipass.id"},re={protocol:"https",domain:"wallet.unipass.id"},oe={mainnet:{eth:"https://node.wallet.unipass.id/eth-mainnet",polygon:"https://node.wallet.unipass.id/polygon-mainnet",bsc:"https://node.wallet.unipass.id/bsc-mainnet",rangers:"https://node.wallet.unipass.id/rangers-mainnet",scroll:"https://node.wallet.unipass.id/scroll-mainnet",arbitrum:"https://node.wallet.unipass.id/arbitrum-mainnet",avalanche:"https://node.wallet.unipass.id/avalanche-mainnet",kcc:"https://node.wallet.unipass.id/kcc-mainnet",platon:"https://node.wallet.unipass.id/platon-mainnet",okc:"https://node.wallet.unipass.id/okc-mainnet"},testnet:{eth:"https://node.wallet.unipass.id/eth-goerli",polygon:"https://node.wallet.unipass.id/polygon-mumbai",bsc:"https://node.wallet.unipass.id/bsc-testnet",rangers:"https://node.wallet.unipass.id/rangers-robin",scroll:"https://node.wallet.unipass.id/scroll-testnet",arbitrum:"https://node.wallet.unipass.id/arbitrum-testnet",avalanche:"https://node.wallet.unipass.id/avalanche-testnet",kcc:"https://node.wallet.unipass.id/kcc-testnet",platon:"https://node.wallet.unipass.id/platon-testnet",okc:"https://node.wallet.unipass.id/okc-testnet"}},ie=function(e){var t;t="localStorage"===e?window.localStorage||localStorage:window.sessionStorage||sessionStorage;return{get:function(e){return t.getItem(e)||""},set:function(e,n){return t.setItem(e,n||"")},remove:function(e){return t.removeItem(e)}}},ae=function(){var e=Y(K().mark((function e(t,n){var r,o;return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=ie(t.storageType).get(Pe),e.t0=r&&JSON.parse(r),e.t0){e.next=6;break}return e.next=5,ue(t,n);case 5:e.t0=e.sent;case 6:return o=e.t0,e.abrupt("return",o);case 8:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),se=function(){var e=Y(K().mark((function e(t){var n;return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=4;break}return n=new T("UP_LOGOUT"),e.next=4,xe(n);case 4:ie("localStorage").remove(Pe),ie("sessionStorage").remove(Pe);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ue=function(){var e=Y(K().mark((function e(t,n){var r,o,i;return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r=n?JSON.stringify(n):"",o=new T("UP_LOGIN",r,t.appSettings),e.next=5,xe(o,null==n?void 0:n.connectType,null==n?void 0:n.forceLogin,null==n?void 0:n.eventListener);case 5:return(i=e.sent)&&i.address&&ie(t.storageType).set(Pe,JSON.stringify(i)),e.abrupt("return",i);case 10:throw e.prev=10,e.t0=e.catch(0),new Error("Account Not Available");case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(t,n){return e.apply(this,arguments)}}(),ce="UP_WALLET_POP",pe=null,le=null;function de(e,t,n){var r="innerWidth=462,width=462,innerHeight=810,height=810,top="+.5*(n.screen.availHeight-30-810)+",left="+.8*(n.screen.availWidth-10-462)+",toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,";return n.open(e,t,r)}function fe(e,t,n){return he.apply(this,arguments)}function he(){return(he=Y(K().mark((function e(t,n,r){var o,i,a;return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(null==pe||null!=(o=pe)&&o.closed)){e.next=8;break}if(null!=(pe=de(t,ce,window))){e.next=6;break}return e.next=5,ge(t,n,r);case 5:return e.abrupt("return",e.sent);case 6:e.next=9;break;case 8:le!==t?(pe.location.replace(t),pe.focus()):pe.focus();case 9:return i=setInterval((function(){if(pe&&pe.closed){var e={data:new T("UP_RESPONSE",JSON.stringify(new k("DECLINE","user reject connection")))};n(e,{close:function(){},send:function(){}}),clearInterval(i)}}),1e3),a=function(){pe&&!pe.closed&&pe.close(),pe=null},e.abrupt("return",{popup:pe,unmount:a});case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ge(e,t,n){return me.apply(this,arguments)}function me(){return(me=Y(K().mark((function e(t,n,r){var o,i;return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=document.createElement("div"),'\n <div\n class="up_notification"\n style="\n position: fixed;\n display: flex;\n flex-flow: row nowrap;\n justify-content: space-between;\n align-items: center;\n top: 26px;\n right: 26px;\n width: 340px;\n height: 96px;\n z-index: 100001;\n background-color: #362866;\n box-sizing: border-box;\n border: 2px solid #ffffff;\n border-radius: 8px;\n padding: 16px 20px;\n "\n>\n <div class="up_notification_left" style="color: white">\n <div\n class="up_notification_title"\n style="\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n margin-bottom: 8px;\n "\n >\n Request Pop-up\n </div>\n <div\n class="up_notification_tip"\n style="\n font-weight: 450;\n font-size: 12px;\n line-height: 20px;\n color: rgba(255, 255, 255, 0.8);\n "\n >\n Click Approve to complete creating or using wallet\n </div>\n </div>\n <div\n class="up_notification_right"\n style="\n width: 90px;\n height: 35px;\n font-size: 12px;\n text-align: center;\n background: linear-gradient(270deg, #997afb 0%, #7a55f8 63.6%);\n border-radius: 6px;\n line-height: 35px;\n color: white;\n margin-left: 20px;\n cursor: pointer;\n "\n >\n Approve\n </div>\n</div>\n ',o.innerHTML='\n <div\n class="up_notification"\n style="\n position: fixed;\n display: flex;\n flex-flow: row nowrap;\n justify-content: space-between;\n align-items: center;\n top: 26px;\n right: 26px;\n width: 340px;\n height: 96px;\n z-index: 100001;\n background-color: #362866;\n box-sizing: border-box;\n border: 2px solid #ffffff;\n border-radius: 8px;\n padding: 16px 20px;\n "\n>\n <div class="up_notification_left" style="color: white">\n <div\n class="up_notification_title"\n style="\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n margin-bottom: 8px;\n "\n >\n Request Pop-up\n </div>\n <div\n class="up_notification_tip"\n style="\n font-weight: 450;\n font-size: 12px;\n line-height: 20px;\n color: rgba(255, 255, 255, 0.8);\n "\n >\n Click Approve to complete creating or using wallet\n </div>\n </div>\n <div\n class="up_notification_right"\n style="\n width: 90px;\n height: 35px;\n font-size: 12px;\n text-align: center;\n background: linear-gradient(270deg, #997afb 0%, #7a55f8 63.6%);\n border-radius: 6px;\n line-height: 35px;\n color: white;\n margin-left: 20px;\n cursor: pointer;\n "\n >\n Approve\n </div>\n</div>\n ',document.body.appendChild(o),i=document.querySelector(".up_notification_right"),e.abrupt("return",new Promise((function(e){null==i||i.addEventListener("click",(function(){document.body.removeChild(o),e(fe(t,n,r))}),!1)})));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ye=function(){};function be(e,t,n){if("UP_LOGIN"===e)return"google"===t?te().upConnectUrl+"?connectType=google&forceLogin="+(n?"1":"0"):"email"===t?te().upConnectUrl+"?connectType=email&forceLogin="+(n?"1":"0"):te().upConnectUrl+"?forceLogin="+(n?"1":"0");if("UP_LOGOUT"===e)return te().upLogoutUrl;if("UP_SIGN_MESSAGE"===e)return te().upSignMessageUrl;if("UP_TRANSACTION"===e)return te().upTransactionUrl;if("UP_READY"===e)return te().upLoadingUrl;throw new Error("unsupport type "+e)}function ve(e,t,n,r){return we.apply(this,arguments)}function we(){return we=Y(K().mark((function e(t,n,r,o){var i,a,s,u,c,p,l,d,f,h;return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h=function(e){try{null==p||p.postMessage(JSON.parse(JSON.stringify(e||{})),"*")}catch(t){console.error("Popup Send Error",e,t)}},f=function(){try{window.removeEventListener("message",d),l(),i()}catch(e){console.error("Popup Close Error",e)}},d=function(e){try{if("object"!=typeof e.data)return;var t=e.data;if(!t||!t.type)return;"UP_CLOSE"===e.data.type&&f(),"UP_READY"===t.type&&s(e,{send:h,close:f}),"UP_RESPONSE"===t.type&&u(e,{send:h,close:f}),"UP_EVENT"===t.type&&a(e,{send:h,close:f})}catch(e){console.error("Popup Callback Error",e),f()}},null!=t){e.next=5;break}return e.abrupt("return",{send:ye,close:ye});case 5:return i=(null==o?void 0:o.onClose)||ye,a=(null==o?void 0:o.onMessage)||ye,s=(null==o?void 0:o.onReady)||ye,u=(null==o?void 0:o.onResponse)||ye,window.addEventListener("message",d),e.next=12,fe(be(t.type,n,r),u,t.appSetting);case 12:return c=e.sent,p=c.popup,l=c.unmount,e.abrupt("return",{send:h,close:f});case 16:case"end":return e.stop()}}),e)}))),we.apply(this,arguments)}var Pe="UP-A";function xe(e,t,n,r){return new Promise(function(){var o=Y(K().mark((function o(i,a){return K().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,ve(e,t,n,{onReady:function(t,n){return Y(K().mark((function t(){var r;return K().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=n.send,t.prev=1,r(e),t.next=8;break;case 5:throw t.prev=5,t.t0=t.catch(1),t.t0;case 8:case"end":return t.stop()}}),t,null,[[1,5]])})))()},onResponse:function(t,n){return Y(K().mark((function r(){var o,s,u;return K().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(o=n.close,r.prev=1,"object"==typeof t.data){r.next=4;break}return r.abrupt("return");case 4:s=t.data,u=JSON.parse(s.payload),r.t0=u.type,r.next="APPROVE"===r.t0?9:"DECLINE"===r.t0?12:27;break;case 9:return i(u.data),o(),r.abrupt("break",30);case 12:if("expired"!==u.data){r.next=24;break}if("UP_LOGIN"!==e.type){r.next=15;break}return r.abrupt("return");case 15:if("UP_LOGOUT"!==e.type){r.next=19;break}return i(u.data),o(),r.abrupt("return");case 19:if("UP_TRANSACTION"!==e.type&&"UP_SIGN_MESSAGE"!==e.type){r.next=24;break}return se(!1),a("can not authorize without login"),o(),r.abrupt("break",30);case 24:return a("Declined: "+(u.data||"No reason supplied")),o(),r.abrupt("break",30);case 27:return a("Declined: No reason supplied"),o(),r.abrupt("break",30);case 30:r.next=35;break;case 32:throw r.prev=32,r.t1=r.catch(1),r.t1;case 35:case"end":return r.stop()}}),r,null,[[1,32]])})))()},onMessage:function(e,t){return Y(K().mark((function t(){var n,o;return K().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r){t.next=2;break}return t.abrupt("return");case 2:if(t.prev=2,"object"==typeof e.data){t.next=5;break}return t.abrupt("return");case 5:n=e.data,o=JSON.parse(n.payload),r(o),t.next=13;break;case 10:throw t.prev=10,t.t0=t.catch(2),t.t0;case 13:case"end":return t.stop()}}),t,null,[[2,10]])})))()},onClose:function(){return Y(K().mark((function e(){return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a("Declined: Externally Halted");case 1:case"end":return e.stop()}}),e)})))()}});case 2:case"end":return o.stop()}}),o)})));return function(e,t){return o.apply(this,arguments)}}())}var _e=function(){var e=Y(K().mark((function e(t,n){var r,o,i,a;return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=ie(n.storageType).get(Pe),(o=r&&JSON.parse(r))&&t.from&&o.address.toLowerCase()===t.from.toLowerCase()){e.next=4;break}throw new Error("can not authorize without login");case 4:return i=new T("UP_SIGN_MESSAGE",JSON.stringify(t),null==n?void 0:n.appSettings),e.prev=5,e.next=8,xe(i);case 8:return a=e.sent,e.abrupt("return",a);case 12:throw e.prev=12,e.t0=e.catch(5),new Error(e.t0);case 15:case"end":return e.stop()}}),e,null,[[5,12]])})));return function(t,n){return e.apply(this,arguments)}}(),Oe=function(){var e=Y(K().mark((function e(t,n){var r,o,i,a;return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=ie(n.storageType).get(Pe),(o=r&&JSON.parse(r))&&t.from&&o.address.toLowerCase()===t.from.toLowerCase()){e.next=4;break}throw new Error("can not authorize without login");case 4:return i=new T("UP_TRANSACTION",JSON.stringify(t),n.appSettings),e.prev=5,e.next=8,xe(i);case 8:return a=e.sent,e.abrupt("return",a);case 12:throw e.prev=12,e.t0=e.catch(5),new Error(e.t0);case 15:case"end":return e.stop()}}),e,null,[[5,12]])})));return function(t,n){return e.apply(this,arguments)}}(),je="0x1626ba7e";var Se=function(){function e(e){this.initConfig(e)}var t=e.prototype;return t.initConfig=function(e){this._config={env:"prod",nodeRPC:"",chainType:"polygon",storageType:"sessionStorage"},this._config.env=e.env||"prod",this._config.chainType=e.chainType||"polygon";var t,n,o=(t=this._config.env,n=this._config.chainType,{env:t,nodeRPC:"prod"===t?oe.mainnet[n]:oe.testnet[n],chainType:n,walletUrl:"prod"===t?re:ne});this._config.nodeRPC=e.nodeRPC||o.nodeRPC,this._config.appSettings=function(e,t){return Q({},t||{},{chain:(null==t?void 0:t.chain)||e,appName:(null==t?void 0:t.appName)||"MyDemo"})}(this._config.chainType,e.appSettings),this._provider=new r.JsonRpcProvider(this._config.nodeRPC),this._auth_provider=new r.JsonRpcProvider(function(e){return"prod"===e?oe.mainnet.polygon:oe.testnet.polygon}(this._config.env));var i,a,s,u=e.walletUrl||o.walletUrl;u&&(a=(i=u).domain,s=i.protocol,ee={upDomain:a=a||X,upConnectUrl:(s=s||"https")+"://"+a+"/connect",upLogoutUrl:s+"://"+a+"/logout",upSignMessageUrl:s+"://"+a+"/sign-message",upTransactionUrl:s+"://"+a+"/send-transaction",upLoadingUrl:s+"://"+a+"/connect/loading"}),this._config.storageType=e.storageType||"sessionStorage"},t.updateConfig=function(e){this._config&&(e.chainType&&(this._config.chainType=e.chainType),e.nodeRPC&&(this._config.nodeRPC=e.nodeRPC,this._provider=new r.JsonRpcProvider(this._config.nodeRPC)),e.appSettings&&(this._config.appSettings=e.appSettings))},t.login=function(){var e=Y(K().mark((function e(t){return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ae(this._config,t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.getAccount=function(){var e,t;return e=this._config.storageType,(t=ie(e).get(Pe))?JSON.parse(t):void 0},t.logout=function(){var e=Y(K().mark((function e(t){return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===t&&(t=!1),e.next=3,se(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),t.getProvider=function(){return this._provider},t.getAuthProvider=function(){return this._auth_provider},t.isLogin=function(){return!!this.getAccount()},t.assertLogin=function(){if(!this.isLogin())throw new Error("user is not login")},t.getAddress=function(){return this.assertLogin(),this.getAccount().address},t.sendTransaction=function(){var e=Y(K().mark((function e(t){return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertLogin(),e.next=3,Oe(t,this._config);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.signMessage=function(){var e=Y(K().mark((function e(t,n){var r,o,i,a,s;return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertLogin(),o=(r=n||{}).isEIP191Prefix,i=void 0!==o&&o,a=r.onAuthChain,s=void 0===a||a,"string"==typeof t&&(t=L.toUtf8Bytes(t)),e.next=5,_e(new E(this.getAddress(),L.hexlify(t),"V1",i,s),this._config);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),t.isValidSignature=function(){var e=Y(K().mark((function e(t,n,r){var o,i;return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r||(this.assertLogin(),r=this.getAddress()),o=new f.Contract(r,[{inputs:[{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{internalType:"bytes4",name:"magicValue",type:"bytes4"}],stateMutability:"view",type:"function"}],this._auth_provider),e.next=4,o.isValidSignature(("string"==typeof(a=t)&&(a=L.toUtf8Bytes(a)),L.keccak256(L.concat([L.toUtf8Bytes("UniPass Signed Message:\n"),L.toUtf8Bytes(String(a.length)),a]))),n);case 4:return i=e.sent,e.abrupt("return",i===je);case 6:case"end":return e.stop()}var a}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}(),t.signTypedData=function(){var e=Y(K().mark((function e(t,n){var r,o;return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertLogin(),null!=t){e.next=3;break}throw new Error("Missing data parameter");case 3:return r=(n||{}).onAuthChain,o=void 0===r||r,e.next=6,_e(new E(this.getAddress(),JSON.stringify(t),"V4",!1,o),this._config);case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),t.isValidTypedSignature=function(){var e=Y(K().mark((function e(t,n,r){var o,i,a;return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t){e.next=2;break}throw new Error("Missing data parameter");case 2:return n||(this.assertLogin(),n=this.getAddress()),o=new f.Contract(n,[{inputs:[{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{internalType:"bytes4",name:"magicValue",type:"bytes4"}],stateMutability:"view",type:"function"}],this._auth_provider),i=C(t),e.next=7,o.isValidSignature(i,r);case 7:return a=e.sent,e.abrupt("return",a===je);case 9:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}(),e}();function Ee(n){var r,o,i;return e.__awaiter(this,void 0,void 0,(function*(){const a=n.JsonRpcProvider||e.DefaultJsonRpcProvider,s=null!==(r=n.chainId)&&void 0!==r?r:1;let u=null!==(o=n.rpcUrl)&&void 0!==o?o:null===(i=n.rpc)||void 0===i?void 0:i[s];const c=new class extends a{constructor(t,r){super(t,r),this.updateUpWalletConfig=t=>{var r;const o=null===(r=n.rpc)||void 0===r?void 0:r[t];if(!e.SUPPORTED_CHAIN_ID.includes(t))throw new Error(`chainId ${t} not supported`);if(this.upWallet.updateConfig({chainType:e.getChainNameByChainId(t),nodeRPC:o,appSettings:{chain:e.getChainNameByChainId(t)}}),"object"==typeof this.network)this.network.chainId=t;else{const e={chainId:t,name:"unknown"};p.defineReadOnly(this,"_network",e),this.emit("network",e,null)}return this.rpcUrl=o,this.emit("chainChanged",`0x${t.toString(16)}`),{result:!0}},this.rpcUrl=t,this.upWallet=new Se({env:e.getENVByChainId(s),chainType:e.getChainNameByChainId(s),appSettings:{appIcon:n.appLogoUrl,appName:n.appName,chain:e.getChainNameByChainId(s)},rpcUrl:u,storageType:"sessionStorage"})}getSigner(){var e;const t=this.upWallet.getAccount();return new j(c,this.upWallet,null!==(e=null==t?void 0:t.address)&&void 0!==e?e:"",0)}connect(){return e.__awaiter(this,void 0,void 0,(function*(){const e=this.upWallet.getAccount();return e||(yield this.upWallet.login({email:false}))}))}disconnect(){return e.__awaiter(this,void 0,void 0,(function*(){yield this.upWallet.logout()}))}listAccounts(){return e.__awaiter(this,void 0,void 0,(function*(){const e=this.upWallet.getAccount();return(null==e?void 0:e.address)?[null==e?void 0:e.address]:[]}))}getAddress(){const e=this.upWallet.getAccount();return Promise.resolve((null==e?void 0:e.address)?t.getAddress(null==e?void 0:e.address):null)}}(u,s);return c}))}exports.createProvider=Ee,exports.default=function(t,n){return e.__awaiter(this,void 0,void 0,(function*(){const e=yield Ee(t);return e.on("connect",n.connect),e.on("disconnect",(e=>{n.disconnect(e),n.accountsChanged([])})),e.on("accountsChanged",n.accountsChanged),e.on("chainChanged",n.chainChanged),e.on("message",(({type:e,data:t})=>n.message(e,t))),yield e.connect(),e}))},exports.disconnectWallet=function(){var t;null===(t=e.useWalletStore.getState().provider)||void 0===t||t.disconnect()},exports.signTypedData=function(t){var n,r;return null===(r=null===(n=e.useWalletStore.getState().provider)||void 0===n?void 0:n.upWallet)||void 0===r?void 0:r.signTypedData(t)},exports.switchChain=function(t){var n;const r=t.addChainParameters.chainId,o="string"==typeof r&&(null==r?void 0:r.startsWith("0x"))?parseInt(r,16):Number(r);if(!e.SUPPORTED_CHAIN_ID.includes(o))throw new Error(`chainId ${o} not supported`);return null===(n=e.useWalletStore.getState().provider)||void 0===n?void 0:n.updateUpWalletConfig(o)};