Files
to_session/web_process/MetaMask 12.16.1/common-8.js

38 lines
853 KiB
JavaScript
Raw Normal View History

2025-11-12 12:54:37 +08:00
LavaPack.loadBundle([[4371,{"./_version":4368,"./formatter":4377,"@ethersproject/abstract-provider":487,"@ethersproject/base64":493,"@ethersproject/basex":494,"@ethersproject/bignumber":498,"@ethersproject/bytes":500,"@ethersproject/constants":504,"@ethersproject/hash":513,"@ethersproject/logger":528,"@ethersproject/networks":4388,"@ethersproject/properties":534,"@ethersproject/sha2":563,"@ethersproject/strings":573,"@ethersproject/web":4391,bech32:4395},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.BaseProvider=r.Resolver=r.Event=void 0;var u=e("@ethersproject/abstract-provider"),c=e("@ethersproject/base64"),l=e("@ethersproject/basex"),f=e("@ethersproject/bignumber"),h=e("@ethersproject/bytes"),d=e("@ethersproject/constants"),p=e("@ethersproject/hash"),y=e("@ethersproject/networks"),g=e("@ethersproject/properties"),m=e("@ethersproject/sha2"),b=e("@ethersproject/strings"),_=e("@ethersproject/web"),w=a(e("bech32")),v=e("@ethersproject/logger"),A=e("./_version"),T=new v.Logger(A.version),E=e("./formatter");function j(e){return null==e?"null":(32!==(0,h.hexDataLength)(e)&&T.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function x(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((function(e){if(Array.isArray(e)){var t={};e.forEach((function(e){t[j(e)]=!0}));var r=Object.keys(t);return r.sort(),r.join("|")}return j(e)})).join("&")}function k(e){if("string"==typeof e){if(e=e.toLowerCase(),32===(0,h.hexDataLength)(e))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+x(e);if(u.ForkEvent.isForkEvent(e))throw T.warn("not implemented"),new Error("not implemented");if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+x(e.topics||[])}throw new Error("invalid event - "+e)}function P(){return(new Date).getTime()}function S(e){return new Promise((function(t){setTimeout(t,e)}))}var O=["block","network","pending","poll"],I=function(){function e(e,t,r){(0,g.defineReadOnly)(this,"tag",e),(0,g.defineReadOnly)(this,
/*!
* https://github.com/Starcounter-Jack/JSON-Patch
* (c) 2017-2021 Joachim Wester
* MIT license
*/
var n=e("./helpers.js"),i=e("./core.js"),o=new WeakMap,s=function(e){this.observers=new Map,this.obj=e},a=function(e,t){this.callback=e,this.observer=t};function u(e,t){void 0===t&&(t=!1);var r=o.get(e.object);c(r.value,e.object,e.patches,"",t),e.patches.length&&i.applyPatch(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function c(e,t,r,i,o){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var s=n._objectKeys(t),a=n._objectKeys(e),u=!1,l=a.length-1;l>=0;l--){var f=e[d=a[l]];if(!n.hasOwnProperty(t,d)||t[d]===undefined&&f!==undefined&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(o&&r.push({op:"test",path:i+"/"+n.escapePathComponent(d),value:n._deepClone(f)}),r.push({op:"remove",path:i+"/"+n.escapePathComponent(d)}),u=!0):(o&&r.push({op:"test",path:i,value:e}),r.push({op:"replace",path:i,value:t}),!0);else{var h=t[d];"object"==typeof f&&null!=f&&"object"==typeof h&&null!=h&&Array.isArray(f)===Array.isArray(h)?c(f,h,r,i+"/"+n.escapePathComponent(d),o):f!==h&&(!0,o&&r.push({op:"test",path:i+"/"+n.escapePathComponent(d),value:n._deepClone(f)}),r.push({op:"replace",path:i+"/"+n.escapePathComponent(d),value:n._deepClone(h)}))}}if(u||s.length!=a.length)for(l=0;l<s.length;l++){var d=s[l];n.hasOwnProperty(e,d)||t[d]===undefined||r.push({op:"add",path:i+"/"+n.escapePathComponent(d),value:n._deepClone(t[d])})}}}r.unobserve=function(e,t){t.unobserve()},r.observe=function(e,t){var r,i=function(e){return o.get(e)}(e);if(i){var c=function(e,t){return e.observers.get(t)}(i,t);r=c&&c.observer}else i=new s(e),o.set(e,i);if(r)return r;if(r={},i.value=n._deepClone(e),t){r.callback=t,r.next=null;var l=function(){u(r)},f=function(){clearTimeout(r.next),r.next=setTimeout(l)};"undefined"!=typeof window&&(window.addEventListener("mouseup",f),window.addEventListener("keyup",f),window.addEventListener("mousedown",f),window.addEventListener("keydown",f),window.addEventListener("change",f))}return r.patches=[],r.object=e,r.unobserve=function(){u(r),clearTimeout(r.next),function(e,t){e.observers.delete(t.callback)}(i,r),"undefined"!=typeof window&&(window.removeEventListener("mouseup",f),window.removeEventListener("keyup",f),window.removeEventListener("mousedown",f),window.removeEventListener("keydown",f),window.removeEventListener("change",f))},i.observers.set(t,new a(t,r)),r},r.generate=u,r.compare=function(e,t,r){void 0===r&&(r=!1);var n=[];return c(e,t,n,"",r),n}}}},{package:"fast-json-patch",file:"node_modules/fast-json-patch/commonjs/duplex.js"}],[4432,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){
/*!
* https://github.com/Starcounter-Jack/JSON-Patch
* (c) 2017-2022 Joachim Wester
* MIT licensed
*/
var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0});var o=Object.prototype.hasOwnProperty;function s(e,t){return o.call(e,t)}function a(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);var n=[];for(var i in e)s(e,i)&&n.push(i);return n}function u(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function c(e,t){var r;for(var n in e)if(s(e,n)){if(e[n]===t)return u(n)+"/";if("object"==typeof e[n]&&""!=(r=c(e[n],t)))return u(n)+"/"+r}return""}function l(e,t){var r=[e];for(var n in t){var i="object"==typeof t[n]?JSON.stringify(t[n],null,2):t[n];void 0!==i&&r.push(n+": "+i)}return r.join("\n")}Object.defineProperty(r,"hasOwnProperty",{value:s}),r._objectKeys=a,r._deepClone=function(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}},r.isInteger=function(e){for(var t,r=0,n=e.length;r<n;){if(!((t=e.charCodeAt(r))>=48&&t<=57))return!1;r++}return!0},r.escapePathComponent=u,r.unescapePathComponent=function(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")},r._getPathRecursive=c,r.getPath=function(e,t){if(e===t)return"/";var r=c(e,t);if(""===r)throw new Error("Object not found in root");return"/"+r},r.hasUndefined=function e(t){if(t===undefined)return!0;if(t)if(Array.isArray(t)){for(var r=0,n=t.length;r<n;r++)if(e(t[r]))return!0}else if("object"==typeof t)for(var i=a(t),o=i.length,s=0;s<o;s++)if(e(t[i[s]]))return!0;return!1};var f=function(e){function t(t,r,n,i,o){var s=this.constructor,a=e.call(this,l(t,{name:r,index:n,operation:i,tree:o}))||this;return a.name=r,a.index=n,a.operation=i,a.tree=o,Object.setPrototypeOf(a,s.prototype),a.message=l(t,{name:r,index:n,operation:i,tree:o}),a}return i(t,e),t}(Error);r.PatchError=f}}},{package:"fast-json-patch",file:"node_modules/fast-json-patch/commonjs/helpers.js"}],[4433,{"./commonjs/core.js":4430,"./commonjs/duplex.js":4431,"./commonjs/helpers.js":4432},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("./commonjs/core.js");Object.assign(r,n);var i=e("./commonjs/duplex.js");Object.assign(r,i);var o=e("./commonjs/helpers.js");r.JsonPatchError=o.PatchError,r.deepClone=o._deepClone,r.escapePathComponent=o.escapePathComponent,r.unescapePathComponent=o.unescapePathComponent}}},{package:"fast-json-patch",file:"node_modules/fast-json-patch/index.js"}],[4434,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r,n="boolean"==typeof t.cycles&&t.cycles,i=t.cmp&&(r=t.cmp,function(e){return function(t,n){var i={key:t,value:e[t]},o={key:n,value:e[n]};return r(i,o)}}),o=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),t!==undefined){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var r,s;if(Array.isArray(t)){for(s="[",r=0;r<t.length;r++)r&&(s+=","),s+=e(t[r])||"null";return s+"]"}if(null===t)return"null";if(-1!==o.indexOf(t)){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var a=o.push(t)-1,u=Object.keys(t).sort(i&&i(t));for(s="",r=0;r<u.length;r++){var c=u[r],l=e(t[c]);l&&(s&&(s+=","),s+=JSON.stringify(c)+":"+l)}return o.splice(a,1),"{"+s+"}"}}(e)}}}},{package:"@metamask/snaps-utils>fast-json-stable-stringify",file:"node_modules/fast-json-stable-stringify/index.js"}],[4435,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=u,u.default=u,u.stable=h,u.stableStringify=h;var n="[..
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
r.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,l=-7,f=r?i-1:0,h=r?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=a;l>0;o=256*o+e[t+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:(d?-1:1)*Infinity;s+=Math.pow(2,n),o-=c}return(d?-1:1)*s*Math.pow(2,o-n)},r.write=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===Infinity?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(t*u-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+d]=255&s,d+=p,s/=256,c-=8);e[r+d-p]|=128*y}}}},{package:"buffer>ieee754",file:"node_modules/ieee754/index.js"}],[4647,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n;Object.defineProperty(r,"__esModule",{value:!0});var i="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),o="undefined"!=typeof Map,s="undefined"!=typeof Set,a="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,u=i?Symbol.for("immer-nothing"):((n={})["immer-nothing"]=!0,n),c=i?Symbol.for("immer-draftable"):"__$immer_draftable",l=i?Symbol.for("immer-state"):"__$immer_state",f="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",h={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(e){return"Cannot apply patch, path doesn't resolve: "+e},16:'Sets cannot have "replace" patches.',17:function(e){return"Unsupported patch operation: "+e},18:function(e){return"The plugin for '"+e+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+e+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(e){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+e+"'"},22:function(e){return"'current' expects a draft, got: "+e},23:function(e){return"'original' expects a draft, got: "+e},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"};function d(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var i=h[e],o=i?"function"==typeof i?i.apply(null,r):i:"unknown error nr: "+e;throw new Error("[Immer] "+o)}function p(e){return!!e&&!!e[l]}function y(e){var t;return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===g}(e)||Array.isArray(e)||!!e[c]||!!(null===(t=e.constructor)||void 0===t?void 0:t[c])||j(e)||x(e))}var g=Object.prototype.constructor.toString();var m="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.get
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
t.exports=function(e){return null!=e&&(n(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}(e)||!!e._isBuffer)}}}},{package:"browserify>insert-module-globals>is-buffer",file:"node_modules/is-buffer/index.js"}],[4658,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,i,o=Function.prototype.toString,s="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof s&&"function"==typeof Object.defineProperty)try{n=Object.defineProperty({},"length",{get:function(){throw i}}),i={},s((function(){throw 42}),null,n)}catch(e){e!==i&&(s=null)}else s=null;var a=/^\s*class\b/,u=function(e){try{var t=o.call(e);return a.test(t)}catch(e){return!1}},c=function(e){try{return!u(e)&&(o.call(e),!0)}catch(e){return!1}},l=Object.prototype.toString,f="function"==typeof Symbol&&!!Symbol.toStringTag,h=!(0 in[,]),d=function(){return!1};if("object"==typeof document){var p=document.all;l.call(p)===l.call(document.all)&&(d=function(e){if((h||!e)&&(void 0===e||"object"==typeof e))try{var t=l.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}t.exports=s?function(e){if(d(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{s(e,null,n)}catch(e){if(e!==i)return!1}return!u(e)&&c(e)}:function(e){if(d(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(f)return c(e);if(u(e))return!1;var t=l.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&c(e)}}}},{package:"string.prototype.matchall>es-abstract>is-callable",file:"node_modules/is-callable/index.js"}],[466,{"./constants.js":453},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.formatBigDecimal=r.GWEI_TO_WEI=void 0;const n=e("./constants.js");r.GWEI_TO_WEI=BigInt(1e9),r.formatBigDecimal=function(e,t,r){t===n.BIGINT_0&&(t=n.BIGINT_1);const i=e/t,o=(e-i*t)*r/t,s=String(r).length-1-String(o).length;return`${i}.${"0".repeat(s)}${o}`}}}},{package:"@ethereumjs/tx>@ethereumjs/util",file:"node_modules/@ethereumjs/util/dist/cjs/units.js"}],[4660,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=Object.prototype.toString;t.exports=function(e){return"[object Function]"===n.call(e)}}}},{package:"promise-to-callback>is-fn",file:"node_modules/is-fn/index.js"}],[4661,{"has-tostringtag/shams":4617},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,i=Object.prototype.toString,o=Function.prototype.toString,s=/^\s*(?:function)?\*/,a=e("has-tostringtag/shams")(),u=Object.getPrototypeOf;t.exports=function(e){if("function"!=typeof e)return!1;if(s.test(o.call(e)))return!0;if(!a)return"[object GeneratorFunction]"===i.call(e);if(!u)return!1;if(void 0===n){var t=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&u(t)}return u(e)===n}}}},{package:"koa>is-generator-function",file:"node_modules/is-generator-function/index.js"}],[4662,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=function(e){if("string"!=typeof e)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof e+", while checking isHexPrefixed.");return"0x"===e.slice(0,2)}}}},{package:"eth-method-registry>@metamask/ethjs-query>@metamask/ethjs-format>is-hex-prefixed",file:"node_modules/is-hex-prefixed/src/index.js"}],[467,{"./bytes.js":452},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.getVerkleTreeKeyForStorageSlot=r.chunkifyCode=r.getVerkleTreeKeyForCodeChunk=r.getVerkleTreeIndicesForCodeChunk
/**
* [js-sha3]{@link https://github.com/emn178/js-sha3}
*
* @version 0.9.3
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2015-2023
* @license MIT
*/
!function(){var r="input is invalid type",n="object"==typeof window,i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var o=!n&&"object"==typeof self;!i.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node?i=global:o&&(i=self);for(var s=!i.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,a="function"==typeof define&&define.amd,u=!i.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,c="0123456789abcdef".split(""),l=[4,1024,262144,67108864],f=[0,8,16,24],h=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],d=[224,256,384,512],p=[128,256],y=["hex","buffer","arrayBuffer","array","digest"],g={128:168,256:136},m=i.JS_SHA3_NO_NODE_JS||!Array.isArray?function(e){return"[object Array]"===Object.prototype.toString.call(e)}:Array.isArray,b=!u||!i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView?ArrayBuffer.isView:function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer},_=function(e){var t=typeof e;if("string"===t)return[e,!0];if("object"!==t||null===e)throw new Error(r);if(u&&e.constructor===ArrayBuffer)return[new Uint8Array(e),!1];if(!m(e)&&!b(e))throw new Error(r);return[e,!1]},w=function(e){return 0===_(e)[0].length},v=function(e){for(var t=[],r=0;r<e.length;++r)t[r]=e[r];return t},A=function(e,t,r){return function(n){return new L(e,t,e).update(n)[r]()}},T=function(e,t,r){return function(n,i){return new L(e,t,i).update(n)[r]()}},E=function(e,t,r){return function(t,n,i,o){return S["cshake"+e].update(t,n,i,o)[r]()}},j=function(e,t,r){return function(t,n,i,o){return S["kmac"+e].update(t,n,i,o)[r]()}},x=function(e,t,r,n){for(var i=0;i<y.length;++i){var o=y[i];e[o]=t(r,n,o)}return e},k=function(e,t){var r=A(e,t,"hex");return r.create=function(){return new L(e,t,e)},r.update=function(e){return r.create().update(e)},x(r,A,e,t)},P=[{name:"keccak",padding:[1,256,65536,16777216],bits:d,createMethod:k},{name:"sha3",padding:[6,1536,393216,100663296],bits:d,createMethod:k},{name:"shake",padding:[31,7936,2031616,520093696],bits:p,createMethod:function(e,t){var r=T(e,t,"hex");return r.create=function(r){return new L(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},x(r,T,e,t)}},{name:"cshake",padding:l,bits:p,createMethod:function(e,t){var r=g[e],n=E(e,0,"hex");return n.create=function(n,i,o){return w(i)&&w(o)?S["shake"+e].create(n):new L(e,t,n).bytepad([i,o],r)},n.update=function(e,t,r,i){return n.create(t,r,i).update(e)},x(n,E,e,t)}},{name:"kmac",padding:l,bits:p,createMethod:function(e,t){var r=g[e],n=j(e,0,"hex");return n.create=function(n,i,o){return new F(e,t,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(e,t,r,i){return n.create(e,r,i).update(t)},x(n,j,e,t)}}],S={},O=[],I=0;I<P.length;++I)for(var N=P[I],R=N.bits,U=0;U<R.length;++U){var B=N.name+"_"+R[U];if(O.push(B),S[B]=N.createMethod(R[U],N.padding),"sha3"!==N.name){var C=N.name+R[U];O.push(C),S[C]=S[B]}}function L(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function F(e,t,r){L.call(this,e,t,r)}L.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t=_(e);e=t[0];for(var r,n,i=t[1],o=this.blocks,s=this.byteCount,a=e.length,u=this.blockCount,c=0,l=this.s;c<a;){if(this.reset)for(this.reset=!1,o[0]=this.block,r=1;r<u+1;++r)o[r]=0;if(i)for(r=this.start;c<a&&r<s;++c)(n=e.charCodeAt(c))<128?o[r>>2]|=n<<f[3&r++]:n<2048?(o[r>>2]|=(192|n>>6)<<f[3&r++],o[r>>2]|=(128|63&n)<<f[3&r++]):n<55296||n>=57344?(o[r>>2]|=(224|n>>12)<<f[3&r++],o[r>>2]|=(128|n>>6&63)<<f[3&r++],o[r>>2]|=(128|63&n)<<f[3&r++]):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++c)),o[r>>2]|=(240|n>>18)<<f[3&r++],o
/*!
localForage -- Offline Storage, Improved
Version 1.10.0
https://localforage.github.io/localForage
(c) 2013-2017 Mozilla, Apache License 2.0
*/
!function(e){if("object"==typeof r&&void 0!==t)t.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).localforage=e()}}((function(){return function t(r,n,i){function o(a,u){if(!n[a]){if(!r[a]){var c="function"==typeof e&&e;if(!u&&c)return c(a,!0);if(s)return s(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var f=n[a]={exports:{}};r[a][0].call(f.exports,(function(e){var t=r[a][1][e];return o(t||e)}),f,f.exports,t,r,n,i)}return n[a].exports}for(var s="function"==typeof e&&e,a=0;a<i.length;a++)o(i[a]);return o}({1:[function(e,t,r){(function(e){var r,n,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var o=0,s=new i(l),a=e.document.createTextNode("");s.observe(a,{characterData:!0}),r=function(){a.data=o=++o%2}}else if(e.setImmediate||void 0===e.MessageChannel)r="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){l(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(l,0)};else{var u=new e.MessageChannel;u.port1.onmessage=l,r=function(){u.port2.postMessage(0)}}var c=[];function l(){var e,t;n=!0;for(var r=c.length;r;){for(t=c,c=[],e=-1;++e<r;)t[e]();r=c.length}n=!1}t.exports=function(e){1!==c.push(e)||n||r()}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,r){var n=e(1);function i(){}var o={},s=["REJECTED"],a=["FULFILLED"],u=["PENDING"];function c(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,e!==i&&d(this,e)}function l(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function f(e,t,r){n((function(){var n;try{n=t(r)}catch(t){return o.reject(e,t)}n===e?o.reject(e,new TypeError("Cannot resolve promise with itself")):o.resolve(e,n)}))}function h(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function d(e,t){var r=!1;function n(t){r||(r=!0,o.reject(e,t))}function i(t){r||(r=!0,o.resolve(e,t))}var s=p((function(){t(i,n)}));"error"===s.status&&n(s.value)}function p(e,t){var r={};try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}t.exports=c,c.prototype.catch=function(e){return this.then(null,e)},c.prototype.then=function(e,t){if("function"!=typeof e&&this.state===a||"function"!=typeof t&&this.state===s)return this;var r=new this.constructor(i);this.state!==u?f(r,this.state===a?e:t,this.outcome):this.queue.push(new l(r,e,t));return r},l.prototype.callFulfilled=function(e){o.resolve(this.promise,e)},l.prototype.otherCallFulfilled=function(e){f(this.promise,this.onFulfilled,e)},l.prototype.callRejected=function(e){o.reject(this.promise,e)},l.prototype.otherCallRejected=function(e){f(this.promise,this.onRejected,e)},o.resolve=function(e,t){var r=p(h,t);if("error"===r.status)return o.reject(e,r.value);var n=r.value;if(n)d(e,n);else{e.state=a,e.outcome=t;for(var i=-1,s=e.queue.length;++i<s;)e.queue[i].callFulfilled(t)}return e},o.reject=function(e,t){e.state=s,e.outcome=t;for(var r=-1,n=e.queue.length;++r<n;)e.queue[r].callRejected(t);return e},c.resolve=function(e){if(e instanceof this)return e;return o.resolve(new this(i),e)},c.reject=function(e){var t=new this(i);return o.reject(t,e)},c.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);var s=new Array(r),a=0,u=-1,c=new this(i);for(;++u<r;)l(e[u],u);return c;function l(e,i){t.resolve(e).then((function(e){s[i]=e,++a!==r||n||(n=!0,o.resolve(c,s))}),(function(e){n||(n=!0,o.reject(c,e))}))}},c.ra