UNPKG

@sofaws/dapp-core

Version:

A library to hold the main logic for a dapp on the Elrond Network

162 lines (125 loc) 34.2 kB
"use strict";var Ue=Object.create;var D=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Te=Object.getOwnPropertyNames;var Ce=Object.getPrototypeOf,Se=Object.prototype.hasOwnProperty;var be=(n,e)=>()=>(n&&(e=n(n=0)),e);var j=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),ke=(n,e)=>{for(var r in e)D(n,r,{get:e[r],enumerable:!0})},ee=(n,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Te(e))!Se.call(n,i)&&i!==r&&D(n,i,{get:()=>e[i],enumerable:!(t=Ie(e,i))||t.enumerable});return n};var re=(n,e,r)=>(r=n!=null?Ue(Ce(n)):{},ee(e||!n||!n.__esModule?D(r,"default",{value:n,enumerable:!0}):r,n)),Re=n=>ee(D({},"__esModule",{value:!0}),n);var ie=j(N=>{"use strict";g();N.byteLength=Me;N.toByteArray=je;N.fromByteArray=Ye;var d=[],w=[],Le=typeof Uint8Array!="undefined"?Uint8Array:Array,H="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(I=0,ne=H.length;I<ne;++I)d[I]=H[I],w[H.charCodeAt(I)]=I;var I,ne;w["-".charCodeAt(0)]=62;w["_".charCodeAt(0)]=63;function te(n){var e=n.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=n.indexOf("=");r===-1&&(r=e);var t=r===e?0:4-r%4;return[r,t]}function Me(n){var e=te(n),r=e[0],t=e[1];return(r+t)*3/4-t}function De(n,e,r){return(e+r)*3/4-r}function je(n){var e,r=te(n),t=r[0],i=r[1],o=new Le(De(n,t,i)),a=0,f=i>0?t-4:t,l;for(l=0;l<f;l+=4)e=w[n.charCodeAt(l)]<<18|w[n.charCodeAt(l+1)]<<12|w[n.charCodeAt(l+2)]<<6|w[n.charCodeAt(l+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return i===2&&(e=w[n.charCodeAt(l)]<<2|w[n.charCodeAt(l+1)]>>4,o[a++]=e&255),i===1&&(e=w[n.charCodeAt(l)]<<10|w[n.charCodeAt(l+1)]<<4|w[n.charCodeAt(l+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}function Ne(n){return d[n>>18&63]+d[n>>12&63]+d[n>>6&63]+d[n&63]}function We(n,e,r){for(var t,i=[],o=e;o<r;o+=3)t=(n[o]<<16&16711680)+(n[o+1]<<8&65280)+(n[o+2]&255),i.push(Ne(t));return i.join("")}function Ye(n){for(var e,r=n.length,t=r%3,i=[],o=16383,a=0,f=r-t;a<f;a+=o)i.push(We(n,a,a+o>f?f:a+o));return t===1?(e=n[r-1],i.push(d[e>>2]+d[e<<4&63]+"==")):t===2&&(e=(n[r-2]<<8)+n[r-1],i.push(d[e>>10]+d[e>>4&63]+d[e<<2&63]+"=")),i.join("")}});var oe=j(X=>{g();X.read=function(n,e,r,t,i){var o,a,f=i*8-t-1,l=(1<<f)-1,u=l>>1,_=-7,c=r?i-1:0,y=r?-1:1,m=n[e+c];for(c+=y,o=m&(1<<-_)-1,m>>=-_,_+=f;_>0;o=o*256+n[e+c],c+=y,_-=8);for(a=o&(1<<-_)-1,o>>=-_,_+=t;_>0;a=a*256+n[e+c],c+=y,_-=8);if(o===0)o=1-u;else{if(o===l)return a?NaN:(m?-1:1)*(1/0);a=a+Math.pow(2,t),o=o-u}return(m?-1:1)*a*Math.pow(2,o-t)};X.write=function(n,e,r,t,i,o){var a,f,l,u=o*8-i-1,_=(1<<u)-1,c=_>>1,y=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=t?0:o-1,S=t?1:-1,Ae=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(f=isNaN(e)?1:0,a=_):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+c>=1?e+=y/l:e+=y*Math.pow(2,1-c),e*l>=2&&(a++,l/=2),a+c>=_?(f=0,a=_):a+c>=1?(f=(e*l-1)*Math.pow(2,i),a=a+c):(f=e*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;n[r+m]=f&255,m+=S,f/=256,i-=8);for(a=a<<i|f,u+=i;u>0;n[r+m]=a&255,m+=S,a/=256,u-=8);n[r+m-S]|=Ae*128}});var ye=j(k=>{"use strict";g();var z=ie(),b=oe(),ae=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;k.Buffer=p;k.SlowBuffer=Je;k.INSPECT_MAX_BYTES=50;var Y=2147483647;k.kMaxLength=Y;p.TYPED_ARRAY_SUPPORT=qe();!p.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function qe(){try{var n=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(n,e),n.foo()===42}catch(r){return!1}}Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(!!p.isBuffer(this))return this.buffer}});Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(!!p.isBuffer(this))return this.byteOffset}});function B(n){if(n>Y)throw new RangeError('The value "'+n+'" is invalid for option "size"');var e=new Uint8Array(n);return Object.setPrototypeOf(e,p.prototype),e}function p(n,e,r){if(typeof n=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return K(n)}return le(n,e,r)}p.poolSize=8192;function le(n,e,r){if(typeof n=="string")return He(n,e);if(ArrayBuffer.isView(n))return Xe(n);if(n==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof n);if(E(n,ArrayBuffer)||n&&E(n.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(E(n,SharedArrayBuffer)||n&&E(n.buffer,SharedArrayBuffer)))return Q(n,e,r);if(typeof n=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var t=n.valueOf&&n.valueOf();if(t!=null&&t!==n)return p.from(t,e,r);var i=ze(n);if(i)return i;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof n[Symbol.toPrimitive]=="function")return p.from(n[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof n)}p.from=function(n,e,r){return le(n,e,r)};Object.setPrototypeOf(p.prototype,Uint8Array.prototype);Object.setPrototypeOf(p,Uint8Array);function ce(n){if(typeof n!="number")throw new TypeError('"size" argument must be of type number');if(n<0)throw new RangeError('The value "'+n+'" is invalid for option "size"')}function Ge(n,e,r){return ce(n),n<=0?B(n):e!==void 0?typeof r=="string"?B(n).fill(e,r):B(n).fill(e):B(n)}p.alloc=function(n,e,r){return Ge(n,e,r)};function K(n){return ce(n),B(n<0?0:O(n)|0)}p.allocUnsafe=function(n){return K(n)};p.allocUnsafeSlow=function(n){return K(n)};function He(n,e){if((typeof e!="string"||e==="")&&(e="utf8"),!p.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=ue(n,e)|0,t=B(r),i=t.write(n,e);return i!==r&&(t=t.slice(0,i)),t}function J(n){for(var e=n.length<0?0:O(n.length)|0,r=B(e),t=0;t<e;t+=1)r[t]=n[t]&255;return r}function Xe(n){if(E(n,Uint8Array)){var e=new Uint8Array(n);return Q(e.buffer,e.byteOffset,e.byteLength)}return J(n)}function Q(n,e,r){if(e<0||n.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(n.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var t;return e===void 0&&r===void 0?t=new Uint8Array(n):r===void 0?t=new Uint8Array(n,e):t=new Uint8Array(n,e,r),Object.setPrototypeOf(t,p.prototype),t}function ze(n){if(p.isBuffer(n)){var e=O(n.length)|0,r=B(e);return r.length===0||n.copy(r,0,0,e),r}if(n.length!==void 0)return typeof n.length!="number"||Z(n.length)?B(0):J(n);if(n.type==="Buffer"&&Array.isArray(n.data))return J(n.data)}function O(n){if(n>=Y)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Y.toString(16)+" bytes");return n|0}function Je(n){return+n!=n&&(n=0),p.alloc(+n)}p.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==p.prototype};p.compare=function(e,r){if(E(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),E(r,Uint8Array)&&(r=p.from(r,r.offset,r.byteLength)),!p.isBuffer(e)||!p.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;for(var t=e.length,i=r.length,o=0,a=Math.min(t,i);o<a;++o)if(e[o]!==r[o]){t=e[o],i=r[o];break}return t<i?-1:i<t?1:0};p.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};p.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return p.alloc(0);var t;if(r===void 0)for(r=0,t=0;t<e.length;++t)r+=e[t].length;var i=p.allocUnsafe(r),o=0;for(t=0;t<e.length;++t){var a=e[t];if(E(a,Uint8Array))o+a.length>i.length?p.from(a).copy(i,o):Uint8Array.prototype.set.call(i,a,o);else if(p.isBuffer(a))a.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return i};function ue(n,e){if(p.isBuffer(n))return n.length;if(ArrayBuffer.isView(n)||E(n,ArrayBuffer))return n.byteLength;if(typeof n!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof n);var r=n.length,t=arguments.length>2&&arguments[2]===!0;if(!t&&r===0)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return V(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return we(n).length;default:if(i)return t?-1:V(n).length;e=(""+e).toLowerCase(),i=!0}}p.byteLength=ue;function Qe(n,e,r){var t=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(n||(n="utf8");;)switch(n){case"hex":return tr(this,e,r);case"utf8":case"utf-8":return he(this,e,r);case"ascii":return rr(this,e,r);case"latin1":case"binary":return nr(this,e,r);case"base64":return Pe(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ir(this,e,r);default:if(t)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),t=!0}}p.prototype._isBuffer=!0;function T(n,e,r){var t=n[e];n[e]=n[r],n[r]=t}p.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)T(this,r,r+1);return this};p.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)T(this,r,r+3),T(this,r+1,r+2);return this};p.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)T(this,r,r+7),T(this,r+1,r+6),T(this,r+2,r+5),T(this,r+3,r+4);return this};p.prototype.toString=function(){var e=this.length;return e===0?"":arguments.length===0?he(this,0,e):Qe.apply(this,arguments)};p.prototype.toLocaleString=p.prototype.toString;p.prototype.equals=function(e){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:p.compare(this,e)===0};p.prototype.inspect=function(){var e="",r=k.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};ae&&(p.prototype[ae]=p.prototype.inspect);p.prototype.compare=function(e,r,t,i,o){if(E(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),!p.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),t===void 0&&(t=e?e.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),r<0||t>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=t)return 0;if(i>=o)return-1;if(r>=t)return 1;if(r>>>=0,t>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var a=o-i,f=t-r,l=Math.min(a,f),u=this.slice(i,o),_=e.slice(r,t),c=0;c<l;++c)if(u[c]!==_[c]){a=u[c],f=_[c];break}return a<f?-1:f<a?1:0};function _e(n,e,r,t,i){if(n.length===0)return-1;if(typeof r=="string"?(t=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Z(r)&&(r=i?0:n.length-1),r<0&&(r=n.length+r),r>=n.length){if(i)return-1;r=n.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof e=="string"&&(e=p.from(e,t)),p.isBuffer(e))return e.length===0?-1:pe(n,e,r,t,i);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(n,e,r):Uint8Array.prototype.lastIndexOf.call(n,e,r):pe(n,[e],r,t,i);throw new TypeError("val must be string, number or Buffer")}function pe(n,e,r,t,i){var o=1,a=n.length,f=e.length;if(t!==void 0&&(t=String(t).toLowerCase(),t==="ucs2"||t==="ucs-2"||t==="utf16le"||t==="utf-16le")){if(n.length<2||e.length<2)return-1;o=2,a/=2,f/=2,r/=2}function l(m,S){return o===1?m[S]:m.readUInt16BE(S*o)}var u;if(i){var _=-1;for(u=r;u<a;u++)if(l(n,u)===l(e,_===-1?0:u-_)){if(_===-1&&(_=u),u-_+1===f)return _*o}else _!==-1&&(u-=u-_),_=-1}else for(r+f>a&&(r=a-f),u=r;u>=0;u--){for(var c=!0,y=0;y<f;y++)if(l(n,u+y)!==l(e,y)){c=!1;break}if(c)return u}return-1}p.prototype.includes=function(e,r,t){return this.indexOf(e,r,t)!==-1};p.prototype.indexOf=function(e,r,t){return _e(this,e,r,t,!0)};p.prototype.lastIndexOf=function(e,r,t){return _e(this,e,r,t,!1)};function Ve(n,e,r,t){r=Number(r)||0;var i=n.length-r;t?(t=Number(t),t>i&&(t=i)):t=i;var o=e.length;t>o/2&&(t=o/2);for(var a=0;a<t;++a){var f=parseInt(e.substr(a*2,2),16);if(Z(f))return a;n[r+a]=f}return a}function Ke(n,e,r,t){return q(V(e,n.length-r),n,r,t)}function Oe(n,e,r,t){return q(pr(e),n,r,t)}function Ze(n,e,r,t){return q(we(e),n,r,t)}function $e(n,e,r,t){return q(fr(e,n.length-r),n,r,t)}p.prototype.write=function(e,r,t,i){if(r===void 0)i="utf8",t=this.length,r=0;else if(t===void 0&&typeof r=="string")i=r,t=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(t)?(t=t>>>0,i===void 0&&(i="utf8")):(i=t,t=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-r;if((t===void 0||t>o)&&(t=o),e.length>0&&(t<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return Ve(this,e,r,t);case"utf8":case"utf-8":return Ke(this,e,r,t);case"ascii":case"latin1":case"binary":return Oe(this,e,r,t);case"base64":return Ze(this,e,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $e(this,e,r,t);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Pe(n,e,r){return e===0&&r===n.length?z.fromByteArray(n):z.fromByteArray(n.slice(e,r))}function he(n,e,r){r=Math.min(n.length,r);for(var t=[],i=e;i<r;){var o=n[i],a=null,f=o>239?4:o>223?3:o>191?2:1;if(i+f<=r){var l,u,_,c;switch(f){case 1:o<128&&(a=o);break;case 2:l=n[i+1],(l&192)===128&&(c=(o&31)<<6|l&63,c>127&&(a=c));break;case 3:l=n[i+1],u=n[i+2],(l&192)===128&&(u&192)===128&&(c=(o&15)<<12|(l&63)<<6|u&63,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:l=n[i+1],u=n[i+2],_=n[i+3],(l&192)===128&&(u&192)===128&&(_&192)===128&&(c=(o&15)<<18|(l&63)<<12|(u&63)<<6|_&63,c>65535&&c<1114112&&(a=c))}}a===null?(a=65533,f=1):a>65535&&(a-=65536,t.push(a>>>10&1023|55296),a=56320|a&1023),t.push(a),i+=f}return er(t)}var fe=4096;function er(n){var e=n.length;if(e<=fe)return String.fromCharCode.apply(String,n);for(var r="",t=0;t<e;)r+=String.fromCharCode.apply(String,n.slice(t,t+=fe));return r}function rr(n,e,r){var t="";r=Math.min(n.length,r);for(var i=e;i<r;++i)t+=String.fromCharCode(n[i]&127);return t}function nr(n,e,r){var t="";r=Math.min(n.length,r);for(var i=e;i<r;++i)t+=String.fromCharCode(n[i]);return t}function tr(n,e,r){var t=n.length;(!e||e<0)&&(e=0),(!r||r<0||r>t)&&(r=t);for(var i="",o=e;o<r;++o)i+=lr[n[o]];return i}function ir(n,e,r){for(var t=n.slice(e,r),i="",o=0;o<t.length-1;o+=2)i+=String.fromCharCode(t[o]+t[o+1]*256);return i}p.prototype.slice=function(e,r){var t=this.length;e=~~e,r=r===void 0?t:~~r,e<0?(e+=t,e<0&&(e=0)):e>t&&(e=t),r<0?(r+=t,r<0&&(r=0)):r>t&&(r=t),r<e&&(r=e);var i=this.subarray(e,r);return Object.setPrototypeOf(i,p.prototype),i};function s(n,e,r){if(n%1!==0||n<0)throw new RangeError("offset is not uint");if(n+e>r)throw new RangeError("Trying to access beyond buffer length")}p.prototype.readUintLE=p.prototype.readUIntLE=function(e,r,t){e=e>>>0,r=r>>>0,t||s(e,r,this.length);for(var i=this[e],o=1,a=0;++a<r&&(o*=256);)i+=this[e+a]*o;return i};p.prototype.readUintBE=p.prototype.readUIntBE=function(e,r,t){e=e>>>0,r=r>>>0,t||s(e,r,this.length);for(var i=this[e+--r],o=1;r>0&&(o*=256);)i+=this[e+--r]*o;return i};p.prototype.readUint8=p.prototype.readUInt8=function(e,r){return e=e>>>0,r||s(e,1,this.length),this[e]};p.prototype.readUint16LE=p.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||s(e,2,this.length),this[e]|this[e+1]<<8};p.prototype.readUint16BE=p.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||s(e,2,this.length),this[e]<<8|this[e+1]};p.prototype.readUint32LE=p.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||s(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};p.prototype.readUint32BE=p.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||s(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};p.prototype.readIntLE=function(e,r,t){e=e>>>0,r=r>>>0,t||s(e,r,this.length);for(var i=this[e],o=1,a=0;++a<r&&(o*=256);)i+=this[e+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i};p.prototype.readIntBE=function(e,r,t){e=e>>>0,r=r>>>0,t||s(e,r,this.length);for(var i=r,o=1,a=this[e+--i];i>0&&(o*=256);)a+=this[e+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*r)),a};p.prototype.readInt8=function(e,r){return e=e>>>0,r||s(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};p.prototype.readInt16LE=function(e,r){e=e>>>0,r||s(e,2,this.length);var t=this[e]|this[e+1]<<8;return t&32768?t|4294901760:t};p.prototype.readInt16BE=function(e,r){e=e>>>0,r||s(e,2,this.length);var t=this[e+1]|this[e]<<8;return t&32768?t|4294901760:t};p.prototype.readInt32LE=function(e,r){return e=e>>>0,r||s(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};p.prototype.readInt32BE=function(e,r){return e=e>>>0,r||s(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};p.prototype.readFloatLE=function(e,r){return e=e>>>0,r||s(e,4,this.length),b.read(this,e,!0,23,4)};p.prototype.readFloatBE=function(e,r){return e=e>>>0,r||s(e,4,this.length),b.read(this,e,!1,23,4)};p.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||s(e,8,this.length),b.read(this,e,!0,52,8)};p.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||s(e,8,this.length),b.read(this,e,!1,52,8)};function x(n,e,r,t,i,o){if(!p.isBuffer(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+t>n.length)throw new RangeError("Index out of range")}p.prototype.writeUintLE=p.prototype.writeUIntLE=function(e,r,t,i){if(e=+e,r=r>>>0,t=t>>>0,!i){var o=Math.pow(2,8*t)-1;x(this,e,r,t,o,0)}var a=1,f=0;for(this[r]=e&255;++f<t&&(a*=256);)this[r+f]=e/a&255;return r+t};p.prototype.writeUintBE=p.prototype.writeUIntBE=function(e,r,t,i){if(e=+e,r=r>>>0,t=t>>>0,!i){var o=Math.pow(2,8*t)-1;x(this,e,r,t,o,0)}var a=t-1,f=1;for(this[r+a]=e&255;--a>=0&&(f*=256);)this[r+a]=e/f&255;return r+t};p.prototype.writeUint8=p.prototype.writeUInt8=function(e,r,t){return e=+e,r=r>>>0,t||x(this,e,r,1,255,0),this[r]=e&255,r+1};p.prototype.writeUint16LE=p.prototype.writeUInt16LE=function(e,r,t){return e=+e,r=r>>>0,t||x(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};p.prototype.writeUint16BE=p.prototype.writeUInt16BE=function(e,r,t){return e=+e,r=r>>>0,t||x(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};p.prototype.writeUint32LE=p.prototype.writeUInt32LE=function(e,r,t){return e=+e,r=r>>>0,t||x(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};p.prototype.writeUint32BE=p.prototype.writeUInt32BE=function(e,r,t){return e=+e,r=r>>>0,t||x(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};p.prototype.writeIntLE=function(e,r,t,i){if(e=+e,r=r>>>0,!i){var o=Math.pow(2,8*t-1);x(this,e,r,t,o-1,-o)}var a=0,f=1,l=0;for(this[r]=e&255;++a<t&&(f*=256);)e<0&&l===0&&this[r+a-1]!==0&&(l=1),this[r+a]=(e/f>>0)-l&255;return r+t};p.prototype.writeIntBE=function(e,r,t,i){if(e=+e,r=r>>>0,!i){var o=Math.pow(2,8*t-1);x(this,e,r,t,o-1,-o)}var a=t-1,f=1,l=0;for(this[r+a]=e&255;--a>=0&&(f*=256);)e<0&&l===0&&this[r+a+1]!==0&&(l=1),this[r+a]=(e/f>>0)-l&255;return r+t};p.prototype.writeInt8=function(e,r,t){return e=+e,r=r>>>0,t||x(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};p.prototype.writeInt16LE=function(e,r,t){return e=+e,r=r>>>0,t||x(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};p.prototype.writeInt16BE=function(e,r,t){return e=+e,r=r>>>0,t||x(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};p.prototype.writeInt32LE=function(e,r,t){return e=+e,r=r>>>0,t||x(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};p.prototype.writeInt32BE=function(e,r,t){return e=+e,r=r>>>0,t||x(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function se(n,e,r,t,i,o){if(r+t>n.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function xe(n,e,r,t,i){return e=+e,r=r>>>0,i||se(n,e,r,4,34028234663852886e22,-34028234663852886e22),b.write(n,e,r,t,23,4),r+4}p.prototype.writeFloatLE=function(e,r,t){return xe(this,e,r,!0,t)};p.prototype.writeFloatBE=function(e,r,t){return xe(this,e,r,!1,t)};function me(n,e,r,t,i){return e=+e,r=r>>>0,i||se(n,e,r,8,17976931348623157e292,-17976931348623157e292),b.write(n,e,r,t,52,8),r+8}p.prototype.writeDoubleLE=function(e,r,t){return me(this,e,r,!0,t)};p.prototype.writeDoubleBE=function(e,r,t){return me(this,e,r,!1,t)};p.prototype.copy=function(e,r,t,i){if(!p.isBuffer(e))throw new TypeError("argument should be a Buffer");if(t||(t=0),!i&&i!==0&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i<t&&(i=t),i===t||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(t<0||t>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r<i-t&&(i=e.length-r+t);var o=i-t;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,t,i):Uint8Array.prototype.set.call(e,this.subarray(t,i),r),o};p.prototype.fill=function(e,r,t,i){if(typeof e=="string"){if(typeof r=="string"?(i=r,r=0,t=this.length):typeof t=="string"&&(i=t,t=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!p.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(e.length===1){var o=e.charCodeAt(0);(i==="utf8"&&o<128||i==="latin1")&&(e=o)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<t)throw new RangeError("Out of range index");if(t<=r)return this;r=r>>>0,t=t===void 0?this.length:t>>>0,e||(e=0);var a;if(typeof e=="number")for(a=r;a<t;++a)this[a]=e;else{var f=p.isBuffer(e)?e:p.from(e,i),l=f.length;if(l===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(a=0;a<t-r;++a)this[a+r]=f[a%l]}return this};var or=/[^+/0-9A-Za-z-_]/g;function ar(n){if(n=n.split("=")[0],n=n.trim().replace(or,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function V(n,e){e=e||1/0;for(var r,t=n.length,i=null,o=[],a=0;a<t;++a){if(r=n.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===t){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function pr(n){for(var e=[],r=0;r<n.length;++r)e.push(n.charCodeAt(r)&255);return e}function fr(n,e){for(var r,t,i,o=[],a=0;a<n.length&&!((e-=2)<0);++a)r=n.charCodeAt(a),t=r>>8,i=r%256,o.push(i),o.push(t);return o}function we(n){return z.toByteArray(ar(n))}function q(n,e,r,t){for(var i=0;i<t&&!(i+r>=e.length||i>=n.length);++i)e[i+r]=n[i];return i}function E(n,e){return n instanceof e||n!=null&&n.constructor!=null&&n.constructor.name!=null&&n.constructor.name===e.name}function Z(n){return n!==n}var lr=function(){for(var n="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var t=r*16,i=0;i<16;++i)e[t+i]=n[r]+n[i];return e}()});var ve=j((yr,Fe)=>{g();var h=Fe.exports={},F,v;function $(){throw new Error("setTimeout has not been defined")}function P(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?F=setTimeout:F=$}catch(n){F=$}try{typeof clearTimeout=="function"?v=clearTimeout:v=P}catch(n){v=P}})();function ge(n){if(F===setTimeout)return setTimeout(n,0);if((F===$||!F)&&setTimeout)return F=setTimeout,setTimeout(n,0);try{return F(n,0)}catch(e){try{return F.call(null,n,0)}catch(r){return F.call(this,n,0)}}}function cr(n){if(v===clearTimeout)return clearTimeout(n);if((v===P||!v)&&clearTimeout)return v=clearTimeout,clearTimeout(n);try{return v(n)}catch(e){try{return v.call(null,n)}catch(r){return v.call(this,n)}}}var A=[],R=!1,C,G=-1;function ur(){!R||!C||(R=!1,C.length?A=C.concat(A):G=-1,A.length&&de())}function de(){if(!R){var n=ge(ur);R=!0;for(var e=A.length;e;){for(C=A,A=[];++G<e;)C&&C[G].run();G=-1,e=A.length}C=null,R=!1,cr(n)}}h.nextTick=function(n){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];A.push(new Ee(n,e)),A.length===1&&!R&&ge(de)};function Ee(n,e){this.fun=n,this.array=e}Ee.prototype.run=function(){this.fun.apply(null,this.array)};h.title="browser";h.browser=!0;h.env={};h.argv=[];h.version="";h.versions={};function U(){}h.on=U;h.addListener=U;h.once=U;h.off=U;h.removeListener=U;h.removeAllListeners=U;h.emit=U;h.prependListener=U;h.prependOnceListener=U;h.listeners=function(n){return[]};h.binding=function(n){throw new Error("process.binding is not supported")};h.cwd=function(){return"/"};h.chdir=function(n){throw new Error("process.chdir is not supported")};h.umask=function(){return 0}});var L,M,gr,g=be(()=>{L=re(ye()),M=re(ve()),gr=function(n){function e(){var t=this||self;return delete n.prototype.__magic__,t}if(typeof globalThis=="object")return globalThis;if(this)return e();n.defineProperty(n.prototype,"__magic__",{configurable:!0,get:e});var r=__magic__;return r}(Object)});var hr={};ke(hr,{css:()=>Be,default:()=>_r});module.exports=Re(hr);g();var Be=`.dapp-core-component__flex__flex-row { flex-direction: row; } .dapp-core-component__flex__flex-column { flex-direction: column; } .dapp-core-component__flex__flex-row-reverse { flex-direction: row-reverse; } .dapp-core-component__flex__flex-column-reverse { flex-direction: column-reverse; } .dapp-core-component__flex__flex-wrap { flex-wrap: wrap; } .dapp-core-component__flex__flex-nowrap { flex-wrap: nowrap; } .dapp-core-component__flex__flex-wrap-reverse { flex-wrap: wrap-reverse; } .dapp-core-component__flex__flex-fill { flex: 1 1 auto; } .dapp-core-component__flex__flex-grow-0 { flex-grow: 0; } .dapp-core-component__flex__flex-grow-1 { flex-grow: 1; } .dapp-core-component__flex__flex-shrink-0 { flex-shrink: 0; } .dapp-core-component__flex__flex-shrink-1 { flex-shrink: 1; } .dapp-core-component__flex__justify-content-start { justify-content: flex-start; } .dapp-core-component__flex__justify-content-end { justify-content: flex-end; } .dapp-core-component__flex__justify-content-center { justify-content: center; } .dapp-core-component__flex__justify-content-between { justify-content: space-between; } .dapp-core-component__flex__justify-content-around { justify-content: space-around; } .dapp-core-component__flex__align-items-start { align-items: flex-start; } .dapp-core-component__flex__align-items-end { align-items: flex-end; } .dapp-core-component__flex__align-items-center { align-items: center; } .dapp-core-component__flex__align-items-baseline { align-items: baseline; } .dapp-core-component__flex__align-items-stretch { align-items: stretch; } .dapp-core-component__flex__align-content-start { align-content: flex-start; } .dapp-core-component__flex__align-content-end { align-content: flex-end; } .dapp-core-component__flex__align-content-center { align-content: center; } .dapp-core-component__flex__align-content-between { align-content: space-between; } .dapp-core-component__flex__align-content-around { align-content: space-around; } .dapp-core-component__flex__align-content-stretch { align-content: stretch; } .dapp-core-component__flex__align-self-auto { align-self: auto; } .dapp-core-component__flex__align-self-start { align-self: flex-start; } .dapp-core-component__flex__align-self-end { align-self: flex-end; } .dapp-core-component__flex__align-self-center { align-self: center; } .dapp-core-component__flex__align-self-baseline { align-self: baseline; } .dapp-core-component__flex__align-self-stretch { align-self: stretch; } @media (min-width: 576px) { .dapp-core-component__flex__flex-sm-row { flex-direction: row; } } @media (min-width: 992px) { .dapp-core-component__flex__flex-lg-row { flex-direction: row; } } @media (min-width: 992px) { .dapp-core-component__flex__flex-lg-wrap { flex-wrap: wrap; } }`;document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(Be));var _r={"flex-row":"dapp-core-component__flex__flex-row",flexRow:"dapp-core-component__flex__flex-row","flex-column":"dapp-core-component__flex__flex-column",flexColumn:"dapp-core-component__flex__flex-column","flex-row-reverse":"dapp-core-component__flex__flex-row-reverse",flexRowReverse:"dapp-core-component__flex__flex-row-reverse","flex-column-reverse":"dapp-core-component__flex__flex-column-reverse",flexColumnReverse:"dapp-core-component__flex__flex-column-reverse","flex-wrap":"dapp-core-component__flex__flex-wrap",flexWrap:"dapp-core-component__flex__flex-wrap","flex-nowrap":"dapp-core-component__flex__flex-nowrap",flexNowrap:"dapp-core-component__flex__flex-nowrap","flex-wrap-reverse":"dapp-core-component__flex__flex-wrap-reverse",flexWrapReverse:"dapp-core-component__flex__flex-wrap-reverse","flex-fill":"dapp-core-component__flex__flex-fill",flexFill:"dapp-core-component__flex__flex-fill","flex-grow-0":"dapp-core-component__flex__flex-grow-0",flexGrow0:"dapp-core-component__flex__flex-grow-0","flex-grow-1":"dapp-core-component__flex__flex-grow-1",flexGrow1:"dapp-core-component__flex__flex-grow-1","flex-shrink-0":"dapp-core-component__flex__flex-shrink-0",flexShrink0:"dapp-core-component__flex__flex-shrink-0","flex-shrink-1":"dapp-core-component__flex__flex-shrink-1",flexShrink1:"dapp-core-component__flex__flex-shrink-1","justify-content-start":"dapp-core-component__flex__justify-content-start",justifyContentStart:"dapp-core-component__flex__justify-content-start","justify-content-end":"dapp-core-component__flex__justify-content-end",justifyContentEnd:"dapp-core-component__flex__justify-content-end","justify-content-center":"dapp-core-component__flex__justify-content-center",justifyContentCenter:"dapp-core-component__flex__justify-content-center","justify-content-between":"dapp-core-component__flex__justify-content-between",justifyContentBetween:"dapp-core-component__flex__justify-content-between","justify-content-around":"dapp-core-component__flex__justify-content-around",justifyContentAround:"dapp-core-component__flex__justify-content-around","align-items-start":"dapp-core-component__flex__align-items-start",alignItemsStart:"dapp-core-component__flex__align-items-start","align-items-end":"dapp-core-component__flex__align-items-end",alignItemsEnd:"dapp-core-component__flex__align-items-end","align-items-center":"dapp-core-component__flex__align-items-center",alignItemsCenter:"dapp-core-component__flex__align-items-center","align-items-baseline":"dapp-core-component__flex__align-items-baseline",alignItemsBaseline:"dapp-core-component__flex__align-items-baseline","align-items-stretch":"dapp-core-component__flex__align-items-stretch",alignItemsStretch:"dapp-core-component__flex__align-items-stretch","align-content-start":"dapp-core-component__flex__align-content-start",alignContentStart:"dapp-core-component__flex__align-content-start","align-content-end":"dapp-core-component__flex__align-content-end",alignContentEnd:"dapp-core-component__flex__align-content-end","align-content-center":"dapp-core-component__flex__align-content-center",alignContentCenter:"dapp-core-component__flex__align-content-center","align-content-between":"dapp-core-component__flex__align-content-between",alignContentBetween:"dapp-core-component__flex__align-content-between","align-content-around":"dapp-core-component__flex__align-content-around",alignContentAround:"dapp-core-component__flex__align-content-around","align-content-stretch":"dapp-core-component__flex__align-content-stretch",alignContentStretch:"dapp-core-component__flex__align-content-stretch","align-self-auto":"dapp-core-component__flex__align-self-auto",alignSelfAuto:"dapp-core-component__flex__align-self-auto","align-self-start":"dapp-core-component__flex__align-self-start",alignSelfStart:"dapp-core-component__flex__align-self-start","align-self-end":"dapp-core-component__flex__align-self-end",alignSelfEnd:"dapp-core-component__flex__align-self-end","align-self-center":"dapp-core-component__flex__align-self-center",alignSelfCenter:"dapp-core-component__flex__align-self-center","align-self-baseline":"dapp-core-component__flex__align-self-baseline",alignSelfBaseline:"dapp-core-component__flex__align-self-baseline","align-self-stretch":"dapp-core-component__flex__align-self-stretch",alignSelfStretch:"dapp-core-component__flex__align-self-stretch","flex-sm-row":"dapp-core-component__flex__flex-sm-row",flexSmRow:"dapp-core-component__flex__flex-sm-row","flex-lg-row":"dapp-core-component__flex__flex-lg-row",flexLgRow:"dapp-core-component__flex__flex-lg-row","flex-lg-wrap":"dapp-core-component__flex__flex-lg-wrap",flexLgWrap:"dapp-core-component__flex__flex-lg-wrap"};0&&(module.exports={css}); /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <https://feross.org> * @license MIT */ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ //# sourceMappingURL=flex.js.map