33 lines
131 KiB
JavaScript
33 lines
131 KiB
JavaScript
|
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("WalletConnect",[],e):"object"==typeof exports?exports.WalletConnect=e():t.WalletConnect=e()}(this,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=42)}([function(t,e,r){"use strict";(function(t){r.d(e,"f",(function(){return u})),r.d(e,"g",(function(){return a})),r.d(e,"i",(function(){return h})),r.d(e,"h",(function(){return c})),r.d(e,"b",(function(){return f})),r.d(e,"c",(function(){return l})),r.d(e,"e",(function(){return d})),r.d(e,"d",(function(){return p})),r.d(e,"o",(function(){return m})),r.d(e,"n",(function(){return g})),r.d(e,"p",(function(){return y})),r.d(e,"A",(function(){return v})),r.d(e,"z",(function(){return w})),r.d(e,"B",(function(){return _})),r.d(e,"v",(function(){return b})),r.d(e,"u",(function(){return M})),r.d(e,"s",(function(){return k})),r.d(e,"r",(function(){return A})),r.d(e,"t",(function(){return I})),r.d(e,"q",(function(){return R})),r.d(e,"m",(function(){return E})),r.d(e,"l",(function(){return T})),r.d(e,"k",(function(){return j})),r.d(e,"j",(function(){return x})),r.d(e,"x",(function(){return P})),r.d(e,"a",(function(){return U})),r.d(e,"y",(function(){return N})),r.d(e,"w",(function(){return q}));var n=r(14),i=r.n(n),o=r(37),s=r.n(o);function u(t){return new Uint8Array(t)}function a(t,e=!1){const r=t.toString("hex");return e?U(r):r}function h(t){return t.toString("utf8")}function c(t){return t.readUIntBE(0,t.length)}function f(t){return s()(t)}function l(t,e=!1){return a(f(t),e)}function d(t){return h(f(t))}function p(t){return c(f(t))}function m(e){return t.from(P(e),"hex")}function g(t){return u(m(t))}function y(t){return h(m(t))}function v(e){return t.from(e,"utf8")}function w(t){return u(v(t))}function _(t,e=!1){return a(v(t),e)}function b(t){return f(O(S(t)))}function M(t){return O(S(t))}function S(t){return B((t>>>0).toString(2))}function O(t){return new Uint8Array(C(t).map(t=>parseInt(t,2)))}function k(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/))&&(!e||t.length===2+2*e)}function A(e){return t.isBuffer(e)}function I(t){return i.a.strict(t)&&!A(t)}function R(t){return!I(t)&&!A(t)&&void 0!==t.byteLength}function E(t){return A(t)?"buffer":I(t)?"typed-array":R(t)?"array-buffer":Array.isArray(t)?"array":typeof t}function T(t){return function(t){return!("string"!=typeof t||!new RegExp(/^[01]+$/).test(t))&&t.length%8==0}(t)?"binary":k(t)?"hex":"utf8"}function j(...e){return t.concat(e)}function x(...t){let e=[];return t.forEach(t=>e=e.concat(Array.from(t))),new Uint8Array([...e])}function C(t,e=8){const r=B(t).match(new RegExp(`.{${e}}`,"gi"));return Array.from(r||[])}function B(t,e=8,r="0"){return function(t,e,r="0"){return L(t,e,!0,r)}(t,function(t,e=8){const r=t%e;return r?(t-r)/e*e+e:t}(t.length,e),r)}function P(t){return t.replace(/^0x/,"")}function U(t){return t.startsWith("0x")?t:"0x"+t}function N(t){return(t=B(t=P(t),2))&&(t=U(t)),t}function q(t){const e=t.startsWith("0x");return t=(t=P(t)).startsWith("0")?t.substring(1):t,e?U(t):t}function L(t,e,r,n="0"){const i=e-t.length;let o=t;if(i>0){const e=n.repeat(i);o=r?e+t:t+e}return o}}).call(this,r(16).Buffer)},function(t,e
|
|||
|
/*!
|
|||
|
* The buffer module from node.js, for the browser.
|
|||
|
*
|
|||
|
* @author Feross Aboukhadijeh <http://feross.org>
|
|||
|
* @license MIT
|
|||
|
*/
|
|||
|
var n=r(46),i=r(47),o=r(48);function s(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=a.prototype:(null===t&&(t=new a(e)),t.length=e),t}function a(t,e,r){if(!(a.TYPED_ARRAY_SUPPORT||this instanceof a))return new a(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}return h(this,t,e,r)}function h(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);a.TYPED_ARRAY_SUPPORT?(t=e).__proto__=a.prototype:t=l(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!a.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(e,r),i=(t=u(t,n)).write(e,r);i!==n&&(t=t.slice(0,i));return t}(t,e,r):function(t,e){if(a.isBuffer(e)){var r=0|d(e.length);return 0===(t=u(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?u(t,0):l(t,e);if("Buffer"===e.type&&o(e.data))return l(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e){if(c(e),t=u(t,e<0?0:0|d(e)),!a.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function l(t,e){var r=e.length<0?0:0|d(e.length);t=u(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function d(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function p(t,e){if(a.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return D(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(t).length;default:if(n)return D(t).length;e=(""+e).toLowerCase(),n=!0}}function m(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return E(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return I(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return k(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){var o,s=1,u=t.length,a=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs
|
|||
|
/**
|
|||
|
* [js-sha3]{@link https://github.com/emn178/js-sha3}
|
|||
|
*
|
|||
|
* @version 0.8.0
|
|||
|
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|||
|
* @copyright Chen, Yi-Cyuan 2015-2018
|
|||
|
* @license MIT
|
|||
|
*/!function(){"use strict";var s="input is invalid type",u="object"==typeof window,a=u?window:{};a.JS_SHA3_NO_WINDOW&&(u=!1);var h=!u&&"object"==typeof self;!a.JS_SHA3_NO_NODE_JS&&"object"==typeof n&&n.versions&&n.versions.node?a=i:h&&(a=self);var c=!a.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,f=r(49),l=!a.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),p=[4,1024,262144,67108864],m=[0,8,16,24],g=[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],y=[224,256,384,512],v=[128,256],w=["hex","buffer","arrayBuffer","array","digest"],_={128:168,256:136};!a.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!l||!a.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var b=function(t,e,r){return function(n){return new U(t,e,t).update(n)[r]()}},M=function(t,e,r){return function(n,i){return new U(t,e,i).update(n)[r]()}},S=function(t,e,r){return function(e,n,i,o){return R["cshake"+t].update(e,n,i,o)[r]()}},O=function(t,e,r){return function(e,n,i,o){return R["kmac"+t].update(e,n,i,o)[r]()}},k=function(t,e,r,n){for(var i=0;i<w.length;++i){var o=w[i];t[o]=e(r,n,o)}return t},A=function(t,e){var r=b(t,e,"hex");return r.create=function(){return new U(t,e,t)},r.update=function(t){return r.create().update(t)},k(r,b,t,e)},I=[{name:"keccak",padding:[1,256,65536,16777216],bits:y,createMethod:A},{name:"sha3",padding:[6,1536,393216,100663296],bits:y,createMethod:A},{name:"shake",padding:[31,7936,2031616,520093696],bits:v,createMethod:function(t,e){var r=M(t,e,"hex");return r.create=function(r){return new U(t,e,r)},r.update=function(t,e){return r.create(e).update(t)},k(r,M,t,e)}},{name:"cshake",padding:p,bits:v,createMethod:function(t,e){var r=_[t],n=S(t,0,"hex");return n.create=function(n,i,o){return i||o?new U(t,e,n).bytepad([i,o],r):R["shake"+t].create(n)},n.update=function(t,e,r,i){return n.create(e,r,i).update(t)},k(n,S,t,e)}},{name:"kmac",padding:p,bits:v,createMethod:function(t,e){var r=_[t],n=O(t,0,"hex");return n.create=function(n,i,o){return new N(t,e,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(t,e,r,i){return n.create(t,r,i).update(e)},k(n,O,t,e)}}],R={},E=[],T=0;T<I.length;++T)for(var j=I[T],x=j.bits,C=0;C<x.length;++C){var B=j.name+"_"+x[C];if(E.push(B),R[B]=j.createMethod(x[C],j.padding),"sha3"!==j.name){var P=j.name+x[C];E.push(P),R[P]=R[B]}}function U(t,e,r){this.blocks=[],this.s=[],this.padding=e,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(t<<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 N(t,e,r){U.call(this,t,e,r)}U.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(s);if(null===t)throw new Error(s);if(l&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||l&&ArrayBuffer.isView(t)))throw new Error(s);e=!0}for(var n,i,o=this.blocks,u=this.byteCount,a=t.length,h=this.blockCount,c=0,f=this.s;c<a;){if(this.reset)for(this.reset=!1,o[0]=this.block,n=1;n<h+1;++n)o[n]=0;if(e)for(n=this.start;c<a&&n<u;++c)o[n>>2]|=t[c]<<m[3&n++];else for(n=this.start;c<a&&n<u;++c)(i=t.charCodeAt(c))<128?o[n>>2]|=i<<m[3&n++]:i<2048?(o[n>>2]|=(192|i>>6)<<m[3&n++],o[n>>2]|=(128|63&i)<<m[3&n++]):i<55296||i>=57344?(o[n>>2]|=(224|i>>12)<<m[3&n++],o[n>>2]|=(128|i>>6&63)<<m[3&n++],o[n>>2]|=(128|63&i)<<m[3&n++]):(i=65536+((1023&i)<<10|1023&t.charCodeAt(++c)),o[n>>2]|=(240|i>>18)<<m[3&n++],o[n>>2]|=(128|i>>12&63)<<m[3&n++],o[n>>2]|=(128|i>>6&63)<<m[3&n++],o[n>>2]|=(1
|
|||
|
/*! *****************************************************************************
|
|||
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|||
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|||
|
this file except in compliance with the License. You may obtain a copy of the
|
|||
|
License at http://www.apache.org/licenses/LICENSE-2.0
|
|||
|
|
|||
|
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|||
|
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|||
|
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|||
|
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|||
|
|
|||
|
See the Apache Version 2.0 License for specific language governing permissions
|
|||
|
and limitations under the License.
|
|||
|
***************************************************************************** */
|
|||
|
var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function i(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var o=function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function s(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&(r[n[i]]=t[n[i]])}return r}function u(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(i=t[u])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s}function a(t,e){return function(r,n){e(r,n,t)}}function h(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function c(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r((function(e){e(t.value)})).then(s,u)}a((n=n.apply(t,e||[])).next())}))}function f(t,e){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:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){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=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}}function l(t,e){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}function d(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function p(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function m(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(p(arguments[e]));return t}function g(t){return this instanceof g?(this.v=t,this):new g(t)}function y(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(t,e||[]),o=[];return n={},s("next"),s("throw"),s("return"),n[Symbol.asyncIterator]=function(){return this},n;function s(t){i[t]&&(n[t]=function(e){return new Promise((function(r,n){o.push([t,e,r,n])>1||u(t,e)}))})}function u(t,e){try{(r=i[t](e)).value instanceof g?Promise.resolve(r.value.v).then(a,h):c(o[0][2],r)}catch(t){c(o[0][3],t)}var r}function a(t){u("next",t)}function h(t){u("throw",t)}function c(t,e){t(e),o.shift(),o.length&&u(o[0][0],o[0][1])}}function v(t){var e,r;return e={},n("next"),n("throw",(function(t){throw t})),n("return"),e[Symbol.iterator]=function(){return this},e;function n(n,i){e[n]=t[n]?function(e){return(r=!r)?{value:g(t[n](e)),done:"return"===n}:i?i(e):e}:i}}function
|
|||
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|||
|
e.read=function(t,e,r,n,i){var o,s,u=8*i-n-1,a=(1<<u)-1,h=a>>1,c=-7,f=r?i-1:0,l=r?-1:1,d=t[e+f];for(f+=l,o=d&(1<<-c)-1,d>>=-c,c+=u;c>0;o=256*o+t[e+f],f+=l,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+t[e+f],f+=l,c-=8);if(0===o)o=1-h;else{if(o===a)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=h}return(d?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,u,a,h=8*o-i-1,c=(1<<h)-1,f=c>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-s))<1&&(s--,a*=2),(e+=s+f>=1?l/a:l*Math.pow(2,1-f))*a>=2&&(s++,a/=2),s+f>=c?(u=0,s=c):s+f>=1?(u=(e*a-1)*Math.pow(2,i),s+=f):(u=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&u,d+=p,u/=256,i-=8);for(s=s<<i|u,h+=i;h>0;t[r+d]=255&s,d+=p,s/=256,h-=8);t[r+d-p]|=128*m}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){(function(e){t.exports=e}).call(this,{})},function(t,e,r){"use strict";(function(t){function r(){return(null==t?void 0:t.crypto)||(null==t?void 0:t.msCrypto)||{}}function n(){const t=r();return t.subtle||t.webkitSubtle}Object.defineProperty(e,"__esModule",{value:!0}),e.isBrowserCryptoAvailable=e.getSubtleCrypto=e.getBrowerCrypto=void 0,e.getBrowerCrypto=r,e.getSubtleCrypto=n,e.isBrowserCryptoAvailable=function(){return!!r()&&!!n()}}).call(this,r(12))},function(t,e,r){"use strict";(function(t){function r(){return"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function n(){return void 0!==t&&void 0!==t.versions&&void 0!==t.versions.node}Object.defineProperty(e,"__esModule",{value:!0}),e.isBrowser=e.isNode=e.isReactNative=void 0,e.isReactNative=r,e.isNode=n,e.isBrowser=function(){return!r()&&!n()}}).call(this,r(13))},function(t,e,r){"use strict";t.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase())},function(t,e,r){"use strict";var n=new RegExp("%[a-f0-9]{2}","gi"),i=new RegExp("(%[a-f0-9]{2})+","gi");function o(t,e){try{return decodeURIComponent(t.join(""))}catch(t){}if(1===t.length)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],o(r),o(n))}function s(t){try{return decodeURIComponent(t)}catch(i){for(var e=t.match(n),r=1;r<e.length;r++)e=(t=o(e,r).join("")).match(n);return t}}t.exports=function(t){if("string"!=typeof t)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch(e){return function(t){for(var e={"%FE%FF":"<22><>","%FF%FE":"<22><>"},r=i.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch(t){var n=s(r[0]);n!==r[0]&&(e[r[0]]=n)}r=i.exec(t)}e["%C2"]="<22>";for(var o=Object.keys(e),u=0;u<o.length;u++){var a=o[u];t=t.replace(new RegExp(a,"g"),e[a])}return t}(t)}}},function(t,e,r){"use strict";t.exports=(t,e)=>{if("string"!=typeof t||"string"!=typeof e)throw new TypeError("Expected the arguments to be of type `string`");if(""===e)return[t];const r=t.indexOf(e);return-1===r?[t]:[t.slice(0,r),t.slice(r+e.length)]}},function(t,e,r){"use strict";t.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},function(t,e,r){"use strict";r.r(e),r.d(e,"generateKey",(function(){return s})),r.d(e,"verifyHmac",(function(){return u})),r.d(e,"encrypt",(function(){return a})),r.d(e,"decrypt",(function(){return h}));var n=r(8),i=r(0),o=r(1);async function s(t){const e=(t||256)/8,r=n.randomBytes(e);return Object(o.d)(i.b(r))}async function u(t,e){const r=i.n(t.data),o=i.n(t.iv),s=i.n(t.hmac),u=i.c(s,!1),a=i.j(r,o),h=await n.hmacSha256Sign(e,a),c=i.c(h,!1);return i.x(u)===i.x(c)}async function a(t,e,r){const u=i.f(Object(o.b)(e)),a=r||await s(128),h=i.f(Object(o.b)(a)),c=i.c(h,!1),f=JSON.stringify(t),l=i.z(f),d=await n.aesCbcEncrypt(h,u,l),p=i.c(d,!1),m=i.j(d,h),g=await n.hmacSha256Sign(u,m);return{data:p,hmac:i.c(g,!1),iv:c}}async function h(t,e){const r=i.f(Object(o.b)(e));
|