@dodoex/wallet-web3 0.0.66 → 0.0.68

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 (63) hide show
  1. package/dist/{alchemy-provider-5870b6fa-18c81351.js → alchemy-provider-5870b6fa-e6cf88d2.js} +1 -1
  2. package/dist/{alchemy-websocket-provider-213da986-4e051507.js → alchemy-websocket-provider-213da986-99aa41a4.js} +1 -1
  3. package/dist/{blocto-b790d079.js → blocto-fa48294e.js} +1 -1
  4. package/dist/{ccip-1b50a4b6.js → ccip-6419cbf3.js} +1 -1
  5. package/dist/cjs/{alchemy-provider-5870b6fa-757dd405.cjs → alchemy-provider-5870b6fa-b19cd97f.cjs} +1 -1
  6. package/dist/cjs/{alchemy-websocket-provider-213da986-63a14c19.cjs → alchemy-websocket-provider-213da986-afdba789.cjs} +1 -1
  7. package/dist/cjs/{blocto-6ad74a7c.cjs → blocto-b05359bb.cjs} +1 -1
  8. package/dist/cjs/{ccip-29a0c692.cjs → ccip-3ea07f9f.cjs} +1 -1
  9. package/dist/cjs/{draggabilly-1db23d29.cjs → draggabilly-eb392a3a.cjs} +1 -1
  10. package/dist/cjs/id-8bcc2bc4.cjs +1 -0
  11. package/dist/cjs/{index-eeda7d0a.cjs → index-0afafb96.cjs} +1 -1
  12. package/dist/cjs/{index-ec75bd64.cjs → index-152a5099.cjs} +1 -1
  13. package/dist/cjs/{index-32fdf8e5.cjs → index-332fbbc9.cjs} +1 -1
  14. package/dist/cjs/{index-7ee26fab.cjs → index-3b516efd.cjs} +1 -1
  15. package/dist/cjs/{index-42ebd156.cjs → index-415589eb.cjs} +1 -1
  16. package/dist/cjs/{index-43289a57.cjs → index-951f7911.cjs} +4 -4
  17. package/dist/cjs/{index-5a6afdc1.cjs → index-9dd6a839.cjs} +2 -2
  18. package/dist/cjs/{index-0da0f3e1.cjs → index-d41402c5.cjs} +1 -1
  19. package/dist/cjs/{index-10420800.cjs → index-d9820812.cjs} +1 -1
  20. package/dist/cjs/{index-8b646c2c.cjs → index-fb9a4f81.cjs} +1 -1
  21. package/dist/cjs/index.cjs +1 -1
  22. package/dist/cjs/{index.es-38733083.cjs → index.es-39b4a755.cjs} +1 -1
  23. package/dist/cjs/{interface-78ed6726.cjs → interface-053f3142.cjs} +1 -1
  24. package/dist/cjs/{lib-typedarrays-765e8073.cjs → lib-typedarrays-8ed34612.cjs} +1 -1
  25. package/dist/cjs/{portis-bbdb30f7.cjs → portis-c36b8ca3.cjs} +1 -1
  26. package/dist/cjs/{provider-214a541f.cjs → provider-a249c714.cjs} +1 -1
  27. package/dist/cjs/{rainbow-bdbbdf92.cjs → rainbow-2ee45982.cjs} +1 -1
  28. package/dist/cjs/sha224-3ae7a0d0.cjs +1 -0
  29. package/dist/cjs/{sha256-1da100f2.cjs → sha256-fc0f8946.cjs} +1 -1
  30. package/dist/cjs/{typed-data-ac450224.cjs → typed-data-3ced104f.cjs} +1 -1
  31. package/dist/cjs/{uAuth-fb59a769.cjs → uAuth-42f14250.cjs} +1 -1
  32. package/dist/cjs/{walletConnect-e3be2b57.cjs → walletConnect-a512d2fb.cjs} +1 -1
  33. package/dist/cjs/{walletLink-0372cd75.cjs → walletLink-918af8ef.cjs} +1 -1
  34. package/dist/{draggabilly-e5894c14.js → draggabilly-8c28a460.js} +1 -1
  35. package/dist/id-096f5044.js +1 -0
  36. package/dist/{index-bccf7498.js → index-01ab10a2.js} +1 -1
  37. package/dist/{index-fd6b6765.js → index-01f93a83.js} +1 -1
  38. package/dist/{index-730e4ec4.js → index-1c1cc5ed.js} +1 -1
  39. package/dist/{index-a42068f2.js → index-1cc45d09.js} +1 -1
  40. package/dist/{index-c079cfa5.js → index-5252b463.js} +1 -1
  41. package/dist/{index-87c6229a.js → index-5d347686.js} +1 -1
  42. package/dist/{index-b2d7f586.js → index-6f38613a.js} +1 -1
  43. package/dist/{index-afeddbec.js → index-95842038.js} +1 -1
  44. package/dist/{index-38803328.js → index-a11b8b79.js} +2 -2
  45. package/dist/{index-446c71f4.js → index-eb40de42.js} +4 -4
  46. package/dist/{index.es-77497000.js → index.es-65a57fd5.js} +1 -1
  47. package/dist/index.js +1 -1
  48. package/dist/{interface-789628fd.js → interface-29877c9e.js} +1 -1
  49. package/dist/{lib-typedarrays-13c0d1d7.js → lib-typedarrays-1a911861.js} +1 -1
  50. package/dist/{portis-85dc7ba5.js → portis-20549b1e.js} +1 -1
  51. package/dist/{provider-b787ad38.js → provider-a8ab2f0e.js} +1 -1
  52. package/dist/{rainbow-e0ef719e.js → rainbow-3a33a2a5.js} +1 -1
  53. package/dist/sha224-19a3b847.js +1 -0
  54. package/dist/{sha256-8f491017.js → sha256-8fbe5b89.js} +1 -1
  55. package/dist/{typed-data-e7777a2c.js → typed-data-0e66cd2f.js} +1 -1
  56. package/dist/{uAuth-2d4231df.js → uAuth-de9daec7.js} +1 -1
  57. package/dist/{walletConnect-e5320b71.js → walletConnect-91d8ffb6.js} +1 -1
  58. package/dist/{walletLink-24205b0c.js → walletLink-dbbd6feb.js} +1 -1
  59. package/package.json +1 -1
  60. package/dist/cjs/id-18175452.cjs +0 -1
  61. package/dist/cjs/sha224-e35247b0.cjs +0 -1
  62. package/dist/id-68d53df0.js +0 -1
  63. package/dist/sha224-cac5c58b.js +0 -1
@@ -1 +1 @@
1
- "use strict";var e=require("./index-43289a57.cjs"),t=require("@ethersproject/address"),r=require("@ethersproject/abstract-signer"),n=require("@unipasswallet/popup-sdk"),i=require("@ethersproject/properties");require("@ethersproject/providers"),require("zustand"),require("@ethersproject/bytes"),require("buffer"),require("@ethersproject/abstract-provider"),require("@ethersproject/contracts"),require("events"),require("@ethersproject/constants"),require("@ethersproject/transactions");class o extends r.Signer{constructor(e,t,r,n){super(),this._address=r,this._index=null!=n?n: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,r,n){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 o(null!=e?e:this.provider,this.upWallet,this._address,this._index)}connectUnchecked(){return new o(this.provider,this.upWallet,this._address,this._index)}}function s(r){var s,a,d;return e.__awaiter(this,void 0,void 0,(function*(){const u=r.JsonRpcProvider||e.DefaultJsonRpcProvider,l=null!==(s=r.chainId)&&void 0!==s?s:1;let c=null!==(a=r.rpcUrl)&&void 0!==a?a:null===(d=r.rpc)||void 0===d?void 0:d[l];const h=new class extends u{constructor(t,o){super(t,o),this.updateUpWalletConfig=t=>{var n;const o=null===(n=r.rpc)||void 0===n?void 0:n[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"};i.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 n.UniPassPopupSDK({env:e.getENVByChainId(l),chainType:e.getChainNameByChainId(l),appSettings:{appIcon:r.appLogoUrl,appName:r.appName,chain:e.getChainNameByChainId(l)},rpcUrl:c,storageType:"sessionStorage"})}getSigner(){var e;const t=this.upWallet.getAccount();return new o(h,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)}}(c,l);return h}))}exports.createProvider=s,exports.default=function(t,r){return e.__awaiter(this,void 0,void 0,(function*(){const e=yield s(t);return e.on("connect",r.connect),e.on("disconnect",(e=>{r.disconnect(e),r.accountsChanged([])})),e.on("accountsChanged",r.accountsChanged),e.on("chainChanged",r.chainChanged),e.on("message",(({type:e,data:t})=>r.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 r,n;return null===(n=null===(r=e.useWalletStore.getState().provider)||void 0===r?void 0:r.upWallet)||void 0===n?void 0:n.signTypedData(t)},exports.switchChain=function(t){var r;const n=t.addChainParameters.chainId,i="string"==typeof n&&(null==n?void 0:n.startsWith("0x"))?parseInt(n,16):Number(n);if(!e.SUPPORTED_CHAIN_ID.includes(i))throw new Error(`chainId ${i} not supported`);return null===(r=e.useWalletStore.getState().provider)||void 0===r?void 0:r.updateUpWalletConfig(i)};
1
+ "use strict";var e=require("./index-951f7911.cjs"),t=require("@ethersproject/address"),r=require("@ethersproject/abstract-signer"),n=require("@unipasswallet/popup-sdk"),i=require("@ethersproject/properties");require("@ethersproject/providers"),require("zustand"),require("@ethersproject/bytes"),require("buffer"),require("@ethersproject/abstract-provider"),require("@ethersproject/contracts"),require("events"),require("@ethersproject/constants"),require("@ethersproject/transactions");class o extends r.Signer{constructor(e,t,r,n){super(),this._address=r,this._index=null!=n?n: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,r,n){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 o(null!=e?e:this.provider,this.upWallet,this._address,this._index)}connectUnchecked(){return new o(this.provider,this.upWallet,this._address,this._index)}}function s(r){var s,a,d;return e.__awaiter(this,void 0,void 0,(function*(){const u=r.JsonRpcProvider||e.DefaultJsonRpcProvider,l=null!==(s=r.chainId)&&void 0!==s?s:1;let c=null!==(a=r.rpcUrl)&&void 0!==a?a:null===(d=r.rpc)||void 0===d?void 0:d[l];const h=new class extends u{constructor(t,o){super(t,o),this.updateUpWalletConfig=t=>{var n;const o=null===(n=r.rpc)||void 0===n?void 0:n[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"};i.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 n.UniPassPopupSDK({env:e.getENVByChainId(l),chainType:e.getChainNameByChainId(l),appSettings:{appIcon:r.appLogoUrl,appName:r.appName,chain:e.getChainNameByChainId(l)},rpcUrl:c,storageType:"sessionStorage"})}getSigner(){var e;const t=this.upWallet.getAccount();return new o(h,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)}}(c,l);return h}))}exports.createProvider=s,exports.default=function(t,r){return e.__awaiter(this,void 0,void 0,(function*(){const e=yield s(t);return e.on("connect",r.connect),e.on("disconnect",(e=>{r.disconnect(e),r.accountsChanged([])})),e.on("accountsChanged",r.accountsChanged),e.on("chainChanged",r.chainChanged),e.on("message",(({type:e,data:t})=>r.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 r,n;return null===(n=null===(r=e.useWalletStore.getState().provider)||void 0===r?void 0:r.upWallet)||void 0===n?void 0:n.signTypedData(t)},exports.switchChain=function(t){var r;const n=t.addChainParameters.chainId,i="string"==typeof n&&(null==n?void 0:n.startsWith("0x"))?parseInt(n,16):Number(n);if(!e.SUPPORTED_CHAIN_ID.includes(i))throw new Error(`chainId ${i} not supported`);return null===(r=e.useWalletStore.getState().provider)||void 0===r?void 0:r.updateUpWalletConfig(i)};
@@ -1,4 +1,4 @@
1
- "use strict";var e=require("./index-43289a57.cjs"),n=require("react"),t=require("react-dom"),r=require("./interface-78ed6726.cjs");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function i(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}})),n.default=e,Object.freeze(n)}require("@ethersproject/address"),require("@ethersproject/providers"),require("zustand"),require("@ethersproject/bytes"),require("@ethersproject/properties"),require("@ethersproject/abstract-signer"),require("buffer"),require("@ethersproject/abstract-provider"),require("@ethersproject/contracts"),require("events"),require("@ethersproject/constants"),require("@ethersproject/transactions"),require("./id-18175452.cjs");var s=o(n),a=i(n),c=o(t);function l(e,n,t,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void t(e)}a.done?n(c):Promise.resolve(c).then(r,o)}function u(e){return function(){var n=this,t=arguments;return new Promise((function(r,o){var i=e.apply(n,t);function s(e){l(i,r,o,s,a,"next",e)}function a(e){l(i,r,o,s,a,"throw",e)}s(void 0)}))}}function d(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function h(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){f(e,n,t[n])}))}return e}function p(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})),e}function m(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function w(e,n){var t,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(e){return function(n){return c([e,n])}}function c(i){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=n.call(e,s)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}}var y,g=Object.defineProperty,b=function(e,n,t){return function(e,n,t){n in e?g(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t}(e,"symbol"!=(void 0===n?"undefined":m(n))?n+"":n,t),t},v={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},k=function(){function n(t){if(function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.url=t,b(this,"events",new e.O),b(this,"isAvailable",!1),b(this,"registering",!1),!e.ea(t))throw new Error("Provided URL is not compatible with HTTP connection: ".concat(t));this.url=t}return function(e,n,t){n&&d(e.prototype,n),t&&d(e,t)}(n,[{key:"connected",get:function(){return this.isAvailable}},{key:"connecting",get:function(){return this.registering}},{key:"open",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.url,n=this;return u((function(){return w(this,(function(t){switch(t.label){case 0:return[4,n.register(e)];case 1:return t.sent(),[2]}}))}))()}},{key:"close",value:function(){var e=this;return u((function(){return w(this,(function(n){if(!e.isAvailable)throw new Error("Connection already closed");return e.onClose(),[2]}))}))()}},{key:"request",value:function(n){var t=this;return u((function(){var r,o,i,s;return w(this,(function(a){switch(a.label){case 0:return e.rm.debug("HttpClient ~ request ~ payload:",n),t.isAvailable?[3,2]:[4,t.register()];case 1:a.sent(),a.label=2;case 2:a.label=3;case 3:return a.trys.push([3,6,,7]),r=e.ed(n),[4,e.m(t.url,p(h({},v),{body:r}))];case 4:return[4,a.sent().json()];case 5:return o=a.sent(),i="string"==typeof o?e.ep(o):o,[2,(e.rm.debug("HttpClient ~ request ~ result:",i),i)];case 6:return s=a.sent(),[2,t.formatError(n.id,s)];case 7:return[2]}}))}))()}},{key:"formatError",value:function(n,t){var r=this.parseError(t),o=r.message||r.toString();return e.Q(n,o)}},{key:"register",value:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.url,t=this;return u((function(){var r,o,i;return w(this,(function(s){switch(s.label){case 0:if(!e.ea(n))throw new Error("Provided URL is not compatible with HTTP connection: ".concat(n));if(t.registering)return[2,new Promise((function(e,n){t.events.once("register_error",(function(e){n(e)})),t.events.once("open",(function(){if(m(t.isAvailable)>"u")return n(new Error("HTTP connection is missing or invalid"));e()}))}))];t.url=n,t.registering=!0,s.label=1;case 1:return s.trys.push([1,3,,4]),r=e.ed({id:1,jsonrpc:"2.0",method:"test",params:[]}),[4,e.m(n,p(h({},v),{body:r}))];case 2:return s.sent(),t.onOpen(),[3,4];case 3:throw o=s.sent(),i=t.parseError(o),t.events.emit("register_error",i),t.onClose(),i;case 4:return[2]}}))}))()}},{key:"onOpen",value:function(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}},{key:"onClose",value:function(){this.isAvailable=!1,this.registering=!1,this.events.emit("open")}},{key:"parseError",value:function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.url;return e.z(n,t,"HTTP")}}]),n}(),E=c.default;if("production"===process.env.NODE_ENV)y=E.createRoot,E.hydrateRoot;else{var C=E.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;y=function(e,n){C.usingClientEntryPoint=!0;try{return E.createRoot(e,n)}finally{C.usingClientEntryPoint=!1}}}var S,O,A=Object.defineProperty,x=Object.getOwnPropertySymbols,R=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,_=(e,n,t)=>n in e?A(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,N=(e,n)=>{for(var t in n||(n={}))R.call(n,t)&&_(e,t,n[t]);if(x)for(var t of x(n))I.call(n,t)&&_(e,t,n[t]);return e},T=(e,n)=>{var t={};for(var r in e)R.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&x)for(var r of x(e))n.indexOf(r)<0&&I.call(e,r)&&(t[r]=e[r]);return t};(e=>{const n=class{constructor(e,t,r,o){if(this.version=e,this.errorCorrectionLevel=t,this.modules=[],this.isFunction=[],e<n.MIN_VERSION||e>n.MAX_VERSION)throw new RangeError("Version value out of range");if(o<-1||o>7)throw new RangeError("Mask value out of range");this.size=4*e+17;let s=[];for(let e=0;e<this.size;e++)s.push(!1);for(let e=0;e<this.size;e++)this.modules.push(s.slice()),this.isFunction.push(s.slice());this.drawFunctionPatterns();const a=this.addEccAndInterleave(r);if(this.drawCodewords(a),-1==o){let e=1e9;for(let n=0;n<8;n++){this.applyMask(n),this.drawFormatBits(n);const t=this.getPenaltyScore();t<e&&(o=n,e=t),this.applyMask(n)}}i(0<=o&&o<=7),this.mask=o,this.applyMask(o),this.drawFormatBits(o),this.isFunction=[]}static encodeText(t,r){const o=e.QrSegment.makeSegments(t);return n.encodeSegments(o,r)}static encodeBinary(t,r){const o=e.QrSegment.makeBytes(t);return n.encodeSegments([o],r)}static encodeSegments(e,t,o=1,s=40,c=-1,l=!0){if(!(n.MIN_VERSION<=o&&o<=s&&s<=n.MAX_VERSION)||c<-1||c>7)throw new RangeError("Invalid value");let u,d;for(u=o;;u++){const r=8*n.getNumDataCodewords(u,t),o=a.getTotalBits(e,u);if(o<=r){d=o;break}if(u>=s)throw new RangeError("Data too long")}for(const e of[n.Ecc.MEDIUM,n.Ecc.QUARTILE,n.Ecc.HIGH])l&&d<=8*n.getNumDataCodewords(u,e)&&(t=e);let f=[];for(const n of e){r(n.mode.modeBits,4,f),r(n.numChars,n.mode.numCharCountBits(u),f);for(const e of n.getData())f.push(e)}i(f.length==d);const h=8*n.getNumDataCodewords(u,t);i(f.length<=h),r(0,Math.min(4,h-f.length),f),r(0,(8-f.length%8)%8,f),i(f.length%8==0);for(let e=236;f.length<h;e^=253)r(e,8,f);let p=[];for(;8*p.length<f.length;)p.push(0);return f.forEach(((e,n)=>p[n>>>3]|=e<<7-(7&n))),new n(u,t,p,c)}getModule(e,n){return 0<=e&&e<this.size&&0<=n&&n<this.size&&this.modules[n][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),n=e.length;for(let t=0;t<n;t++)for(let r=0;r<n;r++)0==t&&0==r||0==t&&r==n-1||t==n-1&&0==r||this.drawAlignmentPattern(e[t],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const n=this.errorCorrectionLevel.formatBits<<3|e;let t=n;for(let e=0;e<10;e++)t=t<<1^1335*(t>>>9);const r=21522^(n<<10|t);i(r>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,o(r,e));this.setFunctionModule(8,7,o(r,6)),this.setFunctionModule(8,8,o(r,7)),this.setFunctionModule(7,8,o(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,o(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,o(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,o(r,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let n=0;n<12;n++)e=e<<1^7973*(e>>>11);const n=this.version<<12|e;i(n>>>18==0);for(let e=0;e<18;e++){const t=o(n,e),r=this.size-11+e%3,i=Math.floor(e/3);this.setFunctionModule(r,i,t),this.setFunctionModule(i,r,t)}}drawFinderPattern(e,n){for(let t=-4;t<=4;t++)for(let r=-4;r<=4;r++){const o=Math.max(Math.abs(r),Math.abs(t)),i=e+r,s=n+t;0<=i&&i<this.size&&0<=s&&s<this.size&&this.setFunctionModule(i,s,2!=o&&4!=o)}}drawAlignmentPattern(e,n){for(let t=-2;t<=2;t++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,n+t,1!=Math.max(Math.abs(r),Math.abs(t)))}setFunctionModule(e,n,t){this.modules[n][e]=t,this.isFunction[n][e]=!0}addEccAndInterleave(e){const t=this.version,r=this.errorCorrectionLevel;if(e.length!=n.getNumDataCodewords(t,r))throw new RangeError("Invalid argument");const o=n.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][t],s=n.ECC_CODEWORDS_PER_BLOCK[r.ordinal][t],a=Math.floor(n.getNumRawDataModules(t)/8),c=o-a%o,l=Math.floor(a/o);let u=[];const d=n.reedSolomonComputeDivisor(s);for(let t=0,r=0;t<o;t++){let o=e.slice(r,r+l-s+(t<c?0:1));r+=o.length;const i=n.reedSolomonComputeRemainder(o,d);t<c&&o.push(0),u.push(o.concat(i))}let f=[];for(let e=0;e<u[0].length;e++)u.forEach(((n,t)=>{(e!=l-s||t>=c)&&f.push(n[e])}));return i(f.length==a),f}drawCodewords(e){if(e.length!=Math.floor(n.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let t=0;for(let n=this.size-1;n>=1;n-=2){6==n&&(n=5);for(let r=0;r<this.size;r++)for(let i=0;i<2;i++){const s=n-i,a=0==(n+1&2)?this.size-1-r:r;!this.isFunction[a][s]&&t<8*e.length&&(this.modules[a][s]=o(e[t>>>3],7-(7&t)),t++)}}i(t==8*e.length)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let n=0;n<this.size;n++)for(let t=0;t<this.size;t++){let r;switch(e){case 0:r=(t+n)%2==0;break;case 1:r=n%2==0;break;case 2:r=t%3==0;break;case 3:r=(t+n)%3==0;break;case 4:r=(Math.floor(t/3)+Math.floor(n/2))%2==0;break;case 5:r=t*n%2+t*n%3==0;break;case 6:r=(t*n%2+t*n%3)%2==0;break;case 7:r=((t+n)%2+t*n%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[n][t]&&r&&(this.modules[n][t]=!this.modules[n][t])}}getPenaltyScore(){let e=0;for(let t=0;t<this.size;t++){let r=!1,o=0,i=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[t][s]==r?(o++,5==o?e+=n.PENALTY_N1:o>5&&e++):(this.finderPenaltyAddHistory(o,i),r||(e+=this.finderPenaltyCountPatterns(i)*n.PENALTY_N3),r=this.modules[t][s],o=1);e+=this.finderPenaltyTerminateAndCount(r,o,i)*n.PENALTY_N3}for(let t=0;t<this.size;t++){let r=!1,o=0,i=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[s][t]==r?(o++,5==o?e+=n.PENALTY_N1:o>5&&e++):(this.finderPenaltyAddHistory(o,i),r||(e+=this.finderPenaltyCountPatterns(i)*n.PENALTY_N3),r=this.modules[s][t],o=1);e+=this.finderPenaltyTerminateAndCount(r,o,i)*n.PENALTY_N3}for(let t=0;t<this.size-1;t++)for(let r=0;r<this.size-1;r++){const o=this.modules[t][r];o==this.modules[t][r+1]&&o==this.modules[t+1][r]&&o==this.modules[t+1][r+1]&&(e+=n.PENALTY_N2)}let t=0;for(const e of this.modules)t=e.reduce(((e,n)=>e+(n?1:0)),t);const r=this.size*this.size,o=Math.ceil(Math.abs(20*t-10*r)/r)-1;return i(0<=o&&o<=9),e+=o*n.PENALTY_N4,i(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{const e=Math.floor(this.version/7)+2,n=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2));let t=[6];for(let r=this.size-7;t.length<e;r-=n)t.splice(1,0,r);return t}}static getNumRawDataModules(e){if(e<n.MIN_VERSION||e>n.MAX_VERSION)throw new RangeError("Version number out of range");let t=(16*e+128)*e+64;if(e>=2){const n=Math.floor(e/7)+2;t-=(25*n-10)*n-55,e>=7&&(t-=36)}return i(208<=t&&t<=29648),t}static getNumDataCodewords(e,t){return Math.floor(n.getNumRawDataModules(e)/8)-n.ECC_CODEWORDS_PER_BLOCK[t.ordinal][e]*n.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let t=[];for(let n=0;n<e-1;n++)t.push(0);t.push(1);let r=1;for(let o=0;o<e;o++){for(let e=0;e<t.length;e++)t[e]=n.reedSolomonMultiply(t[e],r),e+1<t.length&&(t[e]^=t[e+1]);r=n.reedSolomonMultiply(r,2)}return t}static reedSolomonComputeRemainder(e,t){let r=t.map((e=>0));for(const o of e){const e=o^r.shift();r.push(0),t.forEach(((t,o)=>r[o]^=n.reedSolomonMultiply(t,e)))}return r}static reedSolomonMultiply(e,n){if(e>>>8!=0||n>>>8!=0)throw new RangeError("Byte out of range");let t=0;for(let r=7;r>=0;r--)t=t<<1^285*(t>>>7),t^=(n>>>r&1)*e;return i(t>>>8==0),t}finderPenaltyCountPatterns(e){const n=e[1];i(n<=3*this.size);const t=n>0&&e[2]==n&&e[3]==3*n&&e[4]==n&&e[5]==n;return(t&&e[0]>=4*n&&e[6]>=n?1:0)+(t&&e[6]>=4*n&&e[0]>=n?1:0)}finderPenaltyTerminateAndCount(e,n,t){return e&&(this.finderPenaltyAddHistory(n,t),n=0),n+=this.size,this.finderPenaltyAddHistory(n,t),this.finderPenaltyCountPatterns(t)}finderPenaltyAddHistory(e,n){0==n[0]&&(e+=this.size),n.pop(),n.unshift(e)}};let t=n;function r(e,n,t){if(n<0||n>31||e>>>n!=0)throw new RangeError("Value out of range");for(let r=n-1;r>=0;r--)t.push(e>>>r&1)}function o(e,n){return 0!=(e>>>n&1)}function i(e){if(!e)throw new Error("Assertion error")}t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;const s=class{constructor(e,n,t){if(this.mode=e,this.numChars=n,this.bitData=t,n<0)throw new RangeError("Invalid argument");this.bitData=t.slice()}static makeBytes(e){let n=[];for(const t of e)r(t,8,n);return new s(s.Mode.BYTE,e.length,n)}static makeNumeric(e){if(!s.isNumeric(e))throw new RangeError("String contains non-numeric characters");let n=[];for(let t=0;t<e.length;){const o=Math.min(e.length-t,3);r(parseInt(e.substr(t,o),10),3*o+1,n),t+=o}return new s(s.Mode.NUMERIC,e.length,n)}static makeAlphanumeric(e){if(!s.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");let n,t=[];for(n=0;n+2<=e.length;n+=2){let o=45*s.ALPHANUMERIC_CHARSET.indexOf(e.charAt(n));o+=s.ALPHANUMERIC_CHARSET.indexOf(e.charAt(n+1)),r(o,11,t)}return n<e.length&&r(s.ALPHANUMERIC_CHARSET.indexOf(e.charAt(n)),6,t),new s(s.Mode.ALPHANUMERIC,e.length,t)}static makeSegments(e){return""==e?[]:s.isNumeric(e)?[s.makeNumeric(e)]:s.isAlphanumeric(e)?[s.makeAlphanumeric(e)]:[s.makeBytes(s.toUtf8ByteArray(e))]}static makeEci(e){let n=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<128)r(e,8,n);else if(e<16384)r(2,2,n),r(e,14,n);else{if(!(e<1e6))throw new RangeError("ECI assignment value out of range");r(6,3,n),r(e,21,n)}return new s(s.Mode.ECI,0,n)}static isNumeric(e){return s.NUMERIC_REGEX.test(e)}static isAlphanumeric(e){return s.ALPHANUMERIC_REGEX.test(e)}getData(){return this.bitData.slice()}static getTotalBits(e,n){let t=0;for(const r of e){const e=r.mode.numCharCountBits(n);if(r.numChars>=1<<e)return 1/0;t+=4+e+r.bitData.length}return t}static toUtf8ByteArray(e){e=encodeURI(e);let n=[];for(let t=0;t<e.length;t++)"%"!=e.charAt(t)?n.push(e.charCodeAt(t)):(n.push(parseInt(e.substr(t+1,2),16)),t+=2);return n}};let a=s;a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=a})(S||(S={})),(e=>{const n=class{constructor(e,n){this.ordinal=e,this.formatBits=n}};let t=n;t.LOW=new n(0,1),t.MEDIUM=new n(1,0),t.QUARTILE=new n(2,3),t.HIGH=new n(3,2),e.Ecc=t})((O=S||(S={})).QrCode||(O.QrCode={})),(e=>{(e=>{const n=class{constructor(e,n){this.modeBits=e,this.numBitsCharCount=n}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};let t=n;t.NUMERIC=new n(1,[10,12,14]),t.ALPHANUMERIC=new n(2,[9,11,13]),t.BYTE=new n(4,[8,16,16]),t.KANJI=new n(8,[8,10,12]),t.ECI=new n(7,[0,0,0]),e.Mode=t})(e.QrSegment||(e.QrSegment={}))})(S||(S={}));var M=S,P={L:M.QrCode.Ecc.LOW,M:M.QrCode.Ecc.MEDIUM,Q:M.QrCode.Ecc.QUARTILE,H:M.QrCode.Ecc.HIGH},j=128,B="L",D="#FFFFFF",W="#000000",L=!1,F=4,z=.1;
1
+ "use strict";var e=require("./index-951f7911.cjs"),n=require("react"),t=require("react-dom"),r=require("./interface-053f3142.cjs");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function i(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}})),n.default=e,Object.freeze(n)}require("@ethersproject/address"),require("@ethersproject/providers"),require("zustand"),require("@ethersproject/bytes"),require("@ethersproject/properties"),require("@ethersproject/abstract-signer"),require("buffer"),require("@ethersproject/abstract-provider"),require("@ethersproject/contracts"),require("events"),require("@ethersproject/constants"),require("@ethersproject/transactions"),require("./id-8bcc2bc4.cjs");var s=o(n),a=i(n),c=o(t);function l(e,n,t,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void t(e)}a.done?n(c):Promise.resolve(c).then(r,o)}function u(e){return function(){var n=this,t=arguments;return new Promise((function(r,o){var i=e.apply(n,t);function s(e){l(i,r,o,s,a,"next",e)}function a(e){l(i,r,o,s,a,"throw",e)}s(void 0)}))}}function d(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function h(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){f(e,n,t[n])}))}return e}function p(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})),e}function m(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function w(e,n){var t,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(e){return function(n){return c([e,n])}}function c(i){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=n.call(e,s)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}}var y,g=Object.defineProperty,b=function(e,n,t){return function(e,n,t){n in e?g(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t}(e,"symbol"!=(void 0===n?"undefined":m(n))?n+"":n,t),t},v={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},k=function(){function n(t){if(function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.url=t,b(this,"events",new e.O),b(this,"isAvailable",!1),b(this,"registering",!1),!e.ea(t))throw new Error("Provided URL is not compatible with HTTP connection: ".concat(t));this.url=t}return function(e,n,t){n&&d(e.prototype,n),t&&d(e,t)}(n,[{key:"connected",get:function(){return this.isAvailable}},{key:"connecting",get:function(){return this.registering}},{key:"open",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.url,n=this;return u((function(){return w(this,(function(t){switch(t.label){case 0:return[4,n.register(e)];case 1:return t.sent(),[2]}}))}))()}},{key:"close",value:function(){var e=this;return u((function(){return w(this,(function(n){if(!e.isAvailable)throw new Error("Connection already closed");return e.onClose(),[2]}))}))()}},{key:"request",value:function(n){var t=this;return u((function(){var r,o,i,s;return w(this,(function(a){switch(a.label){case 0:return e.rm.debug("HttpClient ~ request ~ payload:",n),t.isAvailable?[3,2]:[4,t.register()];case 1:a.sent(),a.label=2;case 2:a.label=3;case 3:return a.trys.push([3,6,,7]),r=e.ed(n),[4,e.m(t.url,p(h({},v),{body:r}))];case 4:return[4,a.sent().json()];case 5:return o=a.sent(),i="string"==typeof o?e.ep(o):o,[2,(e.rm.debug("HttpClient ~ request ~ result:",i),i)];case 6:return s=a.sent(),[2,t.formatError(n.id,s)];case 7:return[2]}}))}))()}},{key:"formatError",value:function(n,t){var r=this.parseError(t),o=r.message||r.toString();return e.Q(n,o)}},{key:"register",value:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.url,t=this;return u((function(){var r,o,i;return w(this,(function(s){switch(s.label){case 0:if(!e.ea(n))throw new Error("Provided URL is not compatible with HTTP connection: ".concat(n));if(t.registering)return[2,new Promise((function(e,n){t.events.once("register_error",(function(e){n(e)})),t.events.once("open",(function(){if(m(t.isAvailable)>"u")return n(new Error("HTTP connection is missing or invalid"));e()}))}))];t.url=n,t.registering=!0,s.label=1;case 1:return s.trys.push([1,3,,4]),r=e.ed({id:1,jsonrpc:"2.0",method:"test",params:[]}),[4,e.m(n,p(h({},v),{body:r}))];case 2:return s.sent(),t.onOpen(),[3,4];case 3:throw o=s.sent(),i=t.parseError(o),t.events.emit("register_error",i),t.onClose(),i;case 4:return[2]}}))}))()}},{key:"onOpen",value:function(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}},{key:"onClose",value:function(){this.isAvailable=!1,this.registering=!1,this.events.emit("open")}},{key:"parseError",value:function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.url;return e.z(n,t,"HTTP")}}]),n}(),E=c.default;if("production"===process.env.NODE_ENV)y=E.createRoot,E.hydrateRoot;else{var C=E.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;y=function(e,n){C.usingClientEntryPoint=!0;try{return E.createRoot(e,n)}finally{C.usingClientEntryPoint=!1}}}var S,O,A=Object.defineProperty,x=Object.getOwnPropertySymbols,R=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,_=(e,n,t)=>n in e?A(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,N=(e,n)=>{for(var t in n||(n={}))R.call(n,t)&&_(e,t,n[t]);if(x)for(var t of x(n))I.call(n,t)&&_(e,t,n[t]);return e},T=(e,n)=>{var t={};for(var r in e)R.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&x)for(var r of x(e))n.indexOf(r)<0&&I.call(e,r)&&(t[r]=e[r]);return t};(e=>{const n=class{constructor(e,t,r,o){if(this.version=e,this.errorCorrectionLevel=t,this.modules=[],this.isFunction=[],e<n.MIN_VERSION||e>n.MAX_VERSION)throw new RangeError("Version value out of range");if(o<-1||o>7)throw new RangeError("Mask value out of range");this.size=4*e+17;let s=[];for(let e=0;e<this.size;e++)s.push(!1);for(let e=0;e<this.size;e++)this.modules.push(s.slice()),this.isFunction.push(s.slice());this.drawFunctionPatterns();const a=this.addEccAndInterleave(r);if(this.drawCodewords(a),-1==o){let e=1e9;for(let n=0;n<8;n++){this.applyMask(n),this.drawFormatBits(n);const t=this.getPenaltyScore();t<e&&(o=n,e=t),this.applyMask(n)}}i(0<=o&&o<=7),this.mask=o,this.applyMask(o),this.drawFormatBits(o),this.isFunction=[]}static encodeText(t,r){const o=e.QrSegment.makeSegments(t);return n.encodeSegments(o,r)}static encodeBinary(t,r){const o=e.QrSegment.makeBytes(t);return n.encodeSegments([o],r)}static encodeSegments(e,t,o=1,s=40,c=-1,l=!0){if(!(n.MIN_VERSION<=o&&o<=s&&s<=n.MAX_VERSION)||c<-1||c>7)throw new RangeError("Invalid value");let u,d;for(u=o;;u++){const r=8*n.getNumDataCodewords(u,t),o=a.getTotalBits(e,u);if(o<=r){d=o;break}if(u>=s)throw new RangeError("Data too long")}for(const e of[n.Ecc.MEDIUM,n.Ecc.QUARTILE,n.Ecc.HIGH])l&&d<=8*n.getNumDataCodewords(u,e)&&(t=e);let f=[];for(const n of e){r(n.mode.modeBits,4,f),r(n.numChars,n.mode.numCharCountBits(u),f);for(const e of n.getData())f.push(e)}i(f.length==d);const h=8*n.getNumDataCodewords(u,t);i(f.length<=h),r(0,Math.min(4,h-f.length),f),r(0,(8-f.length%8)%8,f),i(f.length%8==0);for(let e=236;f.length<h;e^=253)r(e,8,f);let p=[];for(;8*p.length<f.length;)p.push(0);return f.forEach(((e,n)=>p[n>>>3]|=e<<7-(7&n))),new n(u,t,p,c)}getModule(e,n){return 0<=e&&e<this.size&&0<=n&&n<this.size&&this.modules[n][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),n=e.length;for(let t=0;t<n;t++)for(let r=0;r<n;r++)0==t&&0==r||0==t&&r==n-1||t==n-1&&0==r||this.drawAlignmentPattern(e[t],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const n=this.errorCorrectionLevel.formatBits<<3|e;let t=n;for(let e=0;e<10;e++)t=t<<1^1335*(t>>>9);const r=21522^(n<<10|t);i(r>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,o(r,e));this.setFunctionModule(8,7,o(r,6)),this.setFunctionModule(8,8,o(r,7)),this.setFunctionModule(7,8,o(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,o(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,o(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,o(r,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let n=0;n<12;n++)e=e<<1^7973*(e>>>11);const n=this.version<<12|e;i(n>>>18==0);for(let e=0;e<18;e++){const t=o(n,e),r=this.size-11+e%3,i=Math.floor(e/3);this.setFunctionModule(r,i,t),this.setFunctionModule(i,r,t)}}drawFinderPattern(e,n){for(let t=-4;t<=4;t++)for(let r=-4;r<=4;r++){const o=Math.max(Math.abs(r),Math.abs(t)),i=e+r,s=n+t;0<=i&&i<this.size&&0<=s&&s<this.size&&this.setFunctionModule(i,s,2!=o&&4!=o)}}drawAlignmentPattern(e,n){for(let t=-2;t<=2;t++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,n+t,1!=Math.max(Math.abs(r),Math.abs(t)))}setFunctionModule(e,n,t){this.modules[n][e]=t,this.isFunction[n][e]=!0}addEccAndInterleave(e){const t=this.version,r=this.errorCorrectionLevel;if(e.length!=n.getNumDataCodewords(t,r))throw new RangeError("Invalid argument");const o=n.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][t],s=n.ECC_CODEWORDS_PER_BLOCK[r.ordinal][t],a=Math.floor(n.getNumRawDataModules(t)/8),c=o-a%o,l=Math.floor(a/o);let u=[];const d=n.reedSolomonComputeDivisor(s);for(let t=0,r=0;t<o;t++){let o=e.slice(r,r+l-s+(t<c?0:1));r+=o.length;const i=n.reedSolomonComputeRemainder(o,d);t<c&&o.push(0),u.push(o.concat(i))}let f=[];for(let e=0;e<u[0].length;e++)u.forEach(((n,t)=>{(e!=l-s||t>=c)&&f.push(n[e])}));return i(f.length==a),f}drawCodewords(e){if(e.length!=Math.floor(n.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let t=0;for(let n=this.size-1;n>=1;n-=2){6==n&&(n=5);for(let r=0;r<this.size;r++)for(let i=0;i<2;i++){const s=n-i,a=0==(n+1&2)?this.size-1-r:r;!this.isFunction[a][s]&&t<8*e.length&&(this.modules[a][s]=o(e[t>>>3],7-(7&t)),t++)}}i(t==8*e.length)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let n=0;n<this.size;n++)for(let t=0;t<this.size;t++){let r;switch(e){case 0:r=(t+n)%2==0;break;case 1:r=n%2==0;break;case 2:r=t%3==0;break;case 3:r=(t+n)%3==0;break;case 4:r=(Math.floor(t/3)+Math.floor(n/2))%2==0;break;case 5:r=t*n%2+t*n%3==0;break;case 6:r=(t*n%2+t*n%3)%2==0;break;case 7:r=((t+n)%2+t*n%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[n][t]&&r&&(this.modules[n][t]=!this.modules[n][t])}}getPenaltyScore(){let e=0;for(let t=0;t<this.size;t++){let r=!1,o=0,i=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[t][s]==r?(o++,5==o?e+=n.PENALTY_N1:o>5&&e++):(this.finderPenaltyAddHistory(o,i),r||(e+=this.finderPenaltyCountPatterns(i)*n.PENALTY_N3),r=this.modules[t][s],o=1);e+=this.finderPenaltyTerminateAndCount(r,o,i)*n.PENALTY_N3}for(let t=0;t<this.size;t++){let r=!1,o=0,i=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[s][t]==r?(o++,5==o?e+=n.PENALTY_N1:o>5&&e++):(this.finderPenaltyAddHistory(o,i),r||(e+=this.finderPenaltyCountPatterns(i)*n.PENALTY_N3),r=this.modules[s][t],o=1);e+=this.finderPenaltyTerminateAndCount(r,o,i)*n.PENALTY_N3}for(let t=0;t<this.size-1;t++)for(let r=0;r<this.size-1;r++){const o=this.modules[t][r];o==this.modules[t][r+1]&&o==this.modules[t+1][r]&&o==this.modules[t+1][r+1]&&(e+=n.PENALTY_N2)}let t=0;for(const e of this.modules)t=e.reduce(((e,n)=>e+(n?1:0)),t);const r=this.size*this.size,o=Math.ceil(Math.abs(20*t-10*r)/r)-1;return i(0<=o&&o<=9),e+=o*n.PENALTY_N4,i(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{const e=Math.floor(this.version/7)+2,n=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2));let t=[6];for(let r=this.size-7;t.length<e;r-=n)t.splice(1,0,r);return t}}static getNumRawDataModules(e){if(e<n.MIN_VERSION||e>n.MAX_VERSION)throw new RangeError("Version number out of range");let t=(16*e+128)*e+64;if(e>=2){const n=Math.floor(e/7)+2;t-=(25*n-10)*n-55,e>=7&&(t-=36)}return i(208<=t&&t<=29648),t}static getNumDataCodewords(e,t){return Math.floor(n.getNumRawDataModules(e)/8)-n.ECC_CODEWORDS_PER_BLOCK[t.ordinal][e]*n.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let t=[];for(let n=0;n<e-1;n++)t.push(0);t.push(1);let r=1;for(let o=0;o<e;o++){for(let e=0;e<t.length;e++)t[e]=n.reedSolomonMultiply(t[e],r),e+1<t.length&&(t[e]^=t[e+1]);r=n.reedSolomonMultiply(r,2)}return t}static reedSolomonComputeRemainder(e,t){let r=t.map((e=>0));for(const o of e){const e=o^r.shift();r.push(0),t.forEach(((t,o)=>r[o]^=n.reedSolomonMultiply(t,e)))}return r}static reedSolomonMultiply(e,n){if(e>>>8!=0||n>>>8!=0)throw new RangeError("Byte out of range");let t=0;for(let r=7;r>=0;r--)t=t<<1^285*(t>>>7),t^=(n>>>r&1)*e;return i(t>>>8==0),t}finderPenaltyCountPatterns(e){const n=e[1];i(n<=3*this.size);const t=n>0&&e[2]==n&&e[3]==3*n&&e[4]==n&&e[5]==n;return(t&&e[0]>=4*n&&e[6]>=n?1:0)+(t&&e[6]>=4*n&&e[0]>=n?1:0)}finderPenaltyTerminateAndCount(e,n,t){return e&&(this.finderPenaltyAddHistory(n,t),n=0),n+=this.size,this.finderPenaltyAddHistory(n,t),this.finderPenaltyCountPatterns(t)}finderPenaltyAddHistory(e,n){0==n[0]&&(e+=this.size),n.pop(),n.unshift(e)}};let t=n;function r(e,n,t){if(n<0||n>31||e>>>n!=0)throw new RangeError("Value out of range");for(let r=n-1;r>=0;r--)t.push(e>>>r&1)}function o(e,n){return 0!=(e>>>n&1)}function i(e){if(!e)throw new Error("Assertion error")}t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;const s=class{constructor(e,n,t){if(this.mode=e,this.numChars=n,this.bitData=t,n<0)throw new RangeError("Invalid argument");this.bitData=t.slice()}static makeBytes(e){let n=[];for(const t of e)r(t,8,n);return new s(s.Mode.BYTE,e.length,n)}static makeNumeric(e){if(!s.isNumeric(e))throw new RangeError("String contains non-numeric characters");let n=[];for(let t=0;t<e.length;){const o=Math.min(e.length-t,3);r(parseInt(e.substr(t,o),10),3*o+1,n),t+=o}return new s(s.Mode.NUMERIC,e.length,n)}static makeAlphanumeric(e){if(!s.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");let n,t=[];for(n=0;n+2<=e.length;n+=2){let o=45*s.ALPHANUMERIC_CHARSET.indexOf(e.charAt(n));o+=s.ALPHANUMERIC_CHARSET.indexOf(e.charAt(n+1)),r(o,11,t)}return n<e.length&&r(s.ALPHANUMERIC_CHARSET.indexOf(e.charAt(n)),6,t),new s(s.Mode.ALPHANUMERIC,e.length,t)}static makeSegments(e){return""==e?[]:s.isNumeric(e)?[s.makeNumeric(e)]:s.isAlphanumeric(e)?[s.makeAlphanumeric(e)]:[s.makeBytes(s.toUtf8ByteArray(e))]}static makeEci(e){let n=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<128)r(e,8,n);else if(e<16384)r(2,2,n),r(e,14,n);else{if(!(e<1e6))throw new RangeError("ECI assignment value out of range");r(6,3,n),r(e,21,n)}return new s(s.Mode.ECI,0,n)}static isNumeric(e){return s.NUMERIC_REGEX.test(e)}static isAlphanumeric(e){return s.ALPHANUMERIC_REGEX.test(e)}getData(){return this.bitData.slice()}static getTotalBits(e,n){let t=0;for(const r of e){const e=r.mode.numCharCountBits(n);if(r.numChars>=1<<e)return 1/0;t+=4+e+r.bitData.length}return t}static toUtf8ByteArray(e){e=encodeURI(e);let n=[];for(let t=0;t<e.length;t++)"%"!=e.charAt(t)?n.push(e.charCodeAt(t)):(n.push(parseInt(e.substr(t+1,2),16)),t+=2);return n}};let a=s;a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=a})(S||(S={})),(e=>{const n=class{constructor(e,n){this.ordinal=e,this.formatBits=n}};let t=n;t.LOW=new n(0,1),t.MEDIUM=new n(1,0),t.QUARTILE=new n(2,3),t.HIGH=new n(3,2),e.Ecc=t})((O=S||(S={})).QrCode||(O.QrCode={})),(e=>{(e=>{const n=class{constructor(e,n){this.modeBits=e,this.numBitsCharCount=n}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};let t=n;t.NUMERIC=new n(1,[10,12,14]),t.ALPHANUMERIC=new n(2,[9,11,13]),t.BYTE=new n(4,[8,16,16]),t.KANJI=new n(8,[8,10,12]),t.ECI=new n(7,[0,0,0]),e.Mode=t})(e.QrSegment||(e.QrSegment={}))})(S||(S={}));var M=S,P={L:M.QrCode.Ecc.LOW,M:M.QrCode.Ecc.MEDIUM,Q:M.QrCode.Ecc.QUARTILE,H:M.QrCode.Ecc.HIGH},j=128,B="L",D="#FFFFFF",W="#000000",L=!1,F=4,z=.1;
2
2
  /**
3
3
  * @license qrcode.react
4
4
  * Copyright (c) Paul O'Shannessy
@@ -1,4 +1,4 @@
1
- "use strict";var e=require("./index-43289a57.cjs"),t=require("./v4-3e682452.cjs");function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}require("@ethersproject/address"),require("@ethersproject/providers"),require("zustand"),require("@ethersproject/bytes"),require("@ethersproject/properties"),require("@ethersproject/abstract-signer"),require("buffer"),require("@ethersproject/abstract-provider"),require("@ethersproject/contracts"),require("events"),require("@ethersproject/constants"),require("@ethersproject/transactions");var r={exports:{}};!function(t,n){var r="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==e.commonjsGlobal&&e.commonjsGlobal,i=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var n=void 0!==e&&e||"undefined"!=typeof self&&self||void 0!==n&&n,r={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};if(r.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],o=ArrayBuffer.isView||function(e){return e&&i.indexOf(Object.prototype.toString.call(e))>-1};function s(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function a(e){return"string"!=typeof e&&(e=String(e)),e}function c(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r.iterable&&(t[Symbol.iterator]=function(){return t}),t}function l(e){this.map={},e instanceof l?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function d(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function u(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function h(e){var t=new FileReader,n=u(t);return t.readAsArrayBuffer(e),n}function f(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:r.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:r.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():r.arrayBuffer&&r.blob&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=f(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||o(e))?this._bodyArrayBuffer=f(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=d(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}return this.blob().then(h)}),this.text=function(){var e,t,n,r=d(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=u(t),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(e,t){e=s(e),t=a(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},l.prototype.delete=function(e){delete this.map[s(e)]},l.prototype.get=function(e){return e=s(e),this.has(e)?this.map[e]:null},l.prototype.has=function(e){return this.map.hasOwnProperty(s(e))},l.prototype.set=function(e,t){this.map[s(e)]=a(t)},l.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},l.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),c(e)},l.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),c(e)},l.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),c(e)},r.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var g=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function m(e,t){if(!(this instanceof m))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,r,i=(t=t||{}).body;if(e instanceof m){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new l(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new l(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),g.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var o=/([?&])_=[^&]*/;if(o.test(this.url))this.url=this.url.replace(o,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function y(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function v(e,t){if(!(this instanceof v))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new l(t.headers),this.url=t.url||"",this._initBody(e)}m.prototype.clone=function(){return new m(this,{body:this._bodyInit})},p.call(m.prototype),p.call(v.prototype),v.prototype.clone=function(){return new v(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},v.error=function(){var e=new v(null,{status:0,statusText:""});return e.type="error",e};var b=[301,302,303,307,308];v.redirect=function(e,t){if(-1===b.indexOf(t))throw new RangeError("Invalid status code");return new v(null,{status:t,headers:{location:e}})},t.DOMException=n.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function w(e,i){return new Promise((function(o,s){var c=new m(e,i);if(c.signal&&c.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var d=new XMLHttpRequest;function u(){d.abort()}d.onload=function(){var e,t,n={status:d.status,statusText:d.statusText,headers:(e=d.getAllResponseHeaders()||"",t=new l,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t)};n.url="responseURL"in d?d.responseURL:n.headers.get("X-Request-URL");var r="response"in d?d.response:d.responseText;setTimeout((function(){o(new v(r,n))}),0)},d.onerror=function(){setTimeout((function(){s(new TypeError("Network request failed"))}),0)},d.ontimeout=function(){setTimeout((function(){s(new TypeError("Network request failed"))}),0)},d.onabort=function(){setTimeout((function(){s(new t.DOMException("Aborted","AbortError"))}),0)},d.open(c.method,function(e){try{return""===e&&n.location.href?n.location.href:e}catch(t){return e}}(c.url),!0),"include"===c.credentials?d.withCredentials=!0:"omit"===c.credentials&&(d.withCredentials=!1),"responseType"in d&&(r.blob?d.responseType="blob":r.arrayBuffer&&c.headers.get("Content-Type")&&-1!==c.headers.get("Content-Type").indexOf("application/octet-stream")&&(d.responseType="arraybuffer")),!i||"object"!=typeof i.headers||i.headers instanceof l?c.headers.forEach((function(e,t){d.setRequestHeader(t,e)})):Object.getOwnPropertyNames(i.headers).forEach((function(e){d.setRequestHeader(e,a(i.headers[e]))})),c.signal&&(c.signal.addEventListener("abort",u),d.onreadystatechange=function(){4===d.readyState&&c.signal.removeEventListener("abort",u)}),d.send(void 0===c._bodyInit?null:c._bodyInit)}))}w.polyfill=!0,n.fetch||(n.fetch=w,n.Headers=l,n.Request=m,n.Response=v),t.Headers=l,t.Request=m,t.Response=v,t.fetch=w}({})}(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var o=r.fetch?r:i;(n=o.fetch).default=o.fetch,n.fetch=o.fetch,n.Headers=o.Headers,n.Request=o.Request,n.Response=o.Response,t.exports=n}(r,r.exports);var i,o,s=r.exports,a={exports:{}};function c(){if(o)return i;o=1;var e=1e3,t=60*e,n=60*t,r=24*n,s=7*r,a=365.25*r;function c(e,t,n,r){var i=t>=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}return i=function(i,o){o=o||{};var l=typeof i;if("string"===l&&i.length>0)return function(i){if((i=String(i)).length>100)return;var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!o)return;var c=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*a;case"weeks":case"week":case"w":return c*s;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(i);if("number"===l&&isFinite(i))return o.long?function(i){var o=Math.abs(i);if(o>=r)return c(i,o,r,"day");if(o>=n)return c(i,o,n,"hour");if(o>=t)return c(i,o,t,"minute");if(o>=e)return c(i,o,e,"second");return i+" ms"}(i):function(i){var o=Math.abs(i);if(o>=r)return Math.round(i/r)+"d";if(o>=n)return Math.round(i/n)+"h";if(o>=t)return Math.round(i/t)+"m";if(o>=e)return Math.round(i/e)+"s";return i+"ms"}(i);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))},i}var l=function(e){function t(e){let r,i,o,s=null;function a(...e){if(!a.enabled)return;const n=a,i=Number(new Date),o=i-(r||i);n.diff=o,n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";s++;const o=t.formatters[i];if("function"==typeof o){const t=e[s];r=o.call(n,t),e.splice(s,1),s--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=c(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t};!function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(i=r))})),t.splice(i,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=l(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(a,a.exports);var d,u=a.exports,h={exports:{}};
1
+ "use strict";var e=require("./index-951f7911.cjs"),t=require("./v4-3e682452.cjs");function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}require("@ethersproject/address"),require("@ethersproject/providers"),require("zustand"),require("@ethersproject/bytes"),require("@ethersproject/properties"),require("@ethersproject/abstract-signer"),require("buffer"),require("@ethersproject/abstract-provider"),require("@ethersproject/contracts"),require("events"),require("@ethersproject/constants"),require("@ethersproject/transactions");var r={exports:{}};!function(t,n){var r="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==e.commonjsGlobal&&e.commonjsGlobal,i=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var n=void 0!==e&&e||"undefined"!=typeof self&&self||void 0!==n&&n,r={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};if(r.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],o=ArrayBuffer.isView||function(e){return e&&i.indexOf(Object.prototype.toString.call(e))>-1};function s(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function a(e){return"string"!=typeof e&&(e=String(e)),e}function c(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r.iterable&&(t[Symbol.iterator]=function(){return t}),t}function l(e){this.map={},e instanceof l?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function d(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function u(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function h(e){var t=new FileReader,n=u(t);return t.readAsArrayBuffer(e),n}function f(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:r.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:r.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():r.arrayBuffer&&r.blob&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=f(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||o(e))?this._bodyArrayBuffer=f(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=d(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}return this.blob().then(h)}),this.text=function(){var e,t,n,r=d(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=u(t),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(e,t){e=s(e),t=a(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},l.prototype.delete=function(e){delete this.map[s(e)]},l.prototype.get=function(e){return e=s(e),this.has(e)?this.map[e]:null},l.prototype.has=function(e){return this.map.hasOwnProperty(s(e))},l.prototype.set=function(e,t){this.map[s(e)]=a(t)},l.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},l.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),c(e)},l.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),c(e)},l.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),c(e)},r.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var g=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function m(e,t){if(!(this instanceof m))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,r,i=(t=t||{}).body;if(e instanceof m){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new l(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new l(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),g.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var o=/([?&])_=[^&]*/;if(o.test(this.url))this.url=this.url.replace(o,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function y(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function v(e,t){if(!(this instanceof v))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new l(t.headers),this.url=t.url||"",this._initBody(e)}m.prototype.clone=function(){return new m(this,{body:this._bodyInit})},p.call(m.prototype),p.call(v.prototype),v.prototype.clone=function(){return new v(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},v.error=function(){var e=new v(null,{status:0,statusText:""});return e.type="error",e};var b=[301,302,303,307,308];v.redirect=function(e,t){if(-1===b.indexOf(t))throw new RangeError("Invalid status code");return new v(null,{status:t,headers:{location:e}})},t.DOMException=n.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function w(e,i){return new Promise((function(o,s){var c=new m(e,i);if(c.signal&&c.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var d=new XMLHttpRequest;function u(){d.abort()}d.onload=function(){var e,t,n={status:d.status,statusText:d.statusText,headers:(e=d.getAllResponseHeaders()||"",t=new l,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t)};n.url="responseURL"in d?d.responseURL:n.headers.get("X-Request-URL");var r="response"in d?d.response:d.responseText;setTimeout((function(){o(new v(r,n))}),0)},d.onerror=function(){setTimeout((function(){s(new TypeError("Network request failed"))}),0)},d.ontimeout=function(){setTimeout((function(){s(new TypeError("Network request failed"))}),0)},d.onabort=function(){setTimeout((function(){s(new t.DOMException("Aborted","AbortError"))}),0)},d.open(c.method,function(e){try{return""===e&&n.location.href?n.location.href:e}catch(t){return e}}(c.url),!0),"include"===c.credentials?d.withCredentials=!0:"omit"===c.credentials&&(d.withCredentials=!1),"responseType"in d&&(r.blob?d.responseType="blob":r.arrayBuffer&&c.headers.get("Content-Type")&&-1!==c.headers.get("Content-Type").indexOf("application/octet-stream")&&(d.responseType="arraybuffer")),!i||"object"!=typeof i.headers||i.headers instanceof l?c.headers.forEach((function(e,t){d.setRequestHeader(t,e)})):Object.getOwnPropertyNames(i.headers).forEach((function(e){d.setRequestHeader(e,a(i.headers[e]))})),c.signal&&(c.signal.addEventListener("abort",u),d.onreadystatechange=function(){4===d.readyState&&c.signal.removeEventListener("abort",u)}),d.send(void 0===c._bodyInit?null:c._bodyInit)}))}w.polyfill=!0,n.fetch||(n.fetch=w,n.Headers=l,n.Request=m,n.Response=v),t.Headers=l,t.Request=m,t.Response=v,t.fetch=w}({})}(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var o=r.fetch?r:i;(n=o.fetch).default=o.fetch,n.fetch=o.fetch,n.Headers=o.Headers,n.Request=o.Request,n.Response=o.Response,t.exports=n}(r,r.exports);var i,o,s=r.exports,a={exports:{}};function c(){if(o)return i;o=1;var e=1e3,t=60*e,n=60*t,r=24*n,s=7*r,a=365.25*r;function c(e,t,n,r){var i=t>=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}return i=function(i,o){o=o||{};var l=typeof i;if("string"===l&&i.length>0)return function(i){if((i=String(i)).length>100)return;var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!o)return;var c=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*a;case"weeks":case"week":case"w":return c*s;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(i);if("number"===l&&isFinite(i))return o.long?function(i){var o=Math.abs(i);if(o>=r)return c(i,o,r,"day");if(o>=n)return c(i,o,n,"hour");if(o>=t)return c(i,o,t,"minute");if(o>=e)return c(i,o,e,"second");return i+" ms"}(i):function(i){var o=Math.abs(i);if(o>=r)return Math.round(i/r)+"d";if(o>=n)return Math.round(i/n)+"h";if(o>=t)return Math.round(i/t)+"m";if(o>=e)return Math.round(i/e)+"s";return i+"ms"}(i);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))},i}var l=function(e){function t(e){let r,i,o,s=null;function a(...e){if(!a.enabled)return;const n=a,i=Number(new Date),o=i-(r||i);n.diff=o,n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";s++;const o=t.formatters[i];if("function"==typeof o){const t=e[s];r=o.call(n,t),e.splice(s,1),s--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=c(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t};!function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(i=r))})),t.splice(i,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=l(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(a,a.exports);var d,u=a.exports,h={exports:{}};
2
2
  /*!
3
3
  * EventEmitter2
4
4
  * https://github.com/hij1nx/EventEmitter2