From f7b3904fb91cf58828979d8c009f054f10b22c61 Mon Sep 17 00:00:00 2001 From: Evgeny Kuzyakov Date: Wed, 1 Mar 2023 13:05:34 -0800 Subject: [PATCH] Remove wallet selector dependencies --- CHANGELOG.md | 4 + dist/index.js | 2 +- package.json | 9 +- src/lib/data/near.js | 24 +- yarn.lock | 626 +------------------------------------------ 5 files changed, 20 insertions(+), 645 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d31f1b32..61365d68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.0.0 + +- BREAKING: Removed Wallet Selector dependency. `selector` object is required to pass into `initNear` from `useInitNear` hook. + ## 0.3.0 - Add support to hashtags for `Markdown` component. Expose `onHashtag` similar to `onMention`. diff --git a/dist/index.js b/dist/index.js index e87ce183..099e0d51 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,2 +1,2 @@ /*! For license information please see index.js.LICENSE.txt */ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("react"));else if("function"==typeof define&&define.amd)define(["react"],e);else{var r="object"==typeof exports?e(require("react")):e(t.React);for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(global,(t=>(()=>{"use strict";var e={764:(t,e,r)=>{const n=r(238),o=r(665),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.lW=u,e.h2=50;const a=2147483647;function c(t){if(t>a)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}return s(t,e,r)}function s(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|y(t,e);let n=c(r);const o=n.write(t,e);return o!==r&&(n=n.slice(0,o)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(V(t,Uint8Array)){const e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return h(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(V(t,ArrayBuffer)||t&&V(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(V(t,SharedArrayBuffer)||t&&V(t.buffer,SharedArrayBuffer)))return p(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return u.from(n,e,r);const o=function(t){if(u.isBuffer(t)){const e=0|d(t.length),r=c(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||X(t.length)?c(0):h(t):"Buffer"===t.type&&Array.isArray(t.data)?h(t.data):void 0}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[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 t)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function f(t){return l(t),c(t<0?0:0|d(t))}function h(t){const e=t.length<0?0:0|d(t.length),r=c(e);for(let n=0;n=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|t}function y(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||V(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(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(o)return n?-1:K(t).length;e=(""+e).toLowerCase(),o=!0}}function v(t,e,r){let 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 A(this,e,r);case"utf8":case"utf-8":return j(this,e,r);case"ascii":return L(this,e,r);case"latin1":case"binary":return N(this,e,r);case"base64":return O(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),X(r=+r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,o){let i,a=1,c=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,c/=2,u/=2,r/=2}function s(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){let n=-1;for(i=r;ic&&(r=c-u),i=r;i>=0;i--){let r=!0;for(let n=0;no&&(n=o):n=o;const i=e.length;let a;for(n>i/2&&(n=i/2),a=0;a>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function O(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function j(t,e,r){r=Math.min(t.length,r);const n=[];let o=e;for(;o239?4:e>223?3:e>191?2:1;if(o+a<=r){let r,n,c,u;switch(a){case 1:e<128&&(i=e);break;case 2:r=t[o+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(i=u));break;case 3:r=t[o+1],n=t[o+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(i=u));break;case 4:r=t[o+1],n=t[o+2],c=t[o+3],128==(192&r)&&128==(192&n)&&128==(192&c)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&c,u>65535&&u<1114112&&(i=u))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=a}return function(t){const e=t.length;if(e<=I)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(n,o)):Uint8Array.prototype.set.call(n,e,o);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,o)}o+=e.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;er&&(t+=" ... "),""},i&&(u.prototype[i]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,o){if(V(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;let i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0);const c=Math.min(i,a),s=this.slice(n,o),l=t.slice(e,r);for(let t=0;t>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return x(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const I=4096;function L(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;on)&&(r=n);let o="";for(let n=e;nr)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,o,i){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||et.length)throw new RangeError("Index out of range")}function P(t,e,r,n,o){D(e,n,o,t,r,7);let i=Number(e&BigInt(4294967295));t[r++]=i,i>>=8,t[r++]=i,i>>=8,t[r++]=i,i>>=8,t[r++]=i;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,r}function B(t,e,r,n,o){D(e,n,o,t,r,7);let i=Number(e&BigInt(4294967295));t[r+7]=i,i>>=8,t[r+6]=i,i>>=8,t[r+5]=i,i>>=8,t[r+4]=i;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=a,a>>=8,t[r+2]=a,a>>=8,t[r+1]=a,a>>=8,t[r]=a,r+8}function U(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(t,e,r,n,i){return e=+e,r>>>=0,i||U(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function R(t,e,r,n,i){return e=+e,r>>>=0,i||U(t,0,r,8),o.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||T(t,e,this.length);let n=this[t],o=1,i=0;for(;++i>>=0,e>>>=0,r||T(t,e,this.length);let n=this[t+--e],o=1;for(;e>0&&(o*=256);)n+=this[t+--e]*o;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=Z((function(t){J(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||$(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,o=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(o)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||$(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],o=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<>>=0,e>>>=0,r||T(t,e,this.length);let n=this[t],o=1,i=0;for(;++i=o&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);let n=e,o=1,i=this[t+--n];for(;n>0&&(o*=256);)i+=this[t+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i},u.prototype.readInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||T(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||T(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=Z((function(t){J(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||$(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||$(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<>>=0,e||T(t,4,this.length),o.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||T(t,4,this.length),o.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||T(t,8,this.length),o.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||T(t,8,this.length),o.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);let o=1,i=0;for(this[e]=255&t;++i>>=0,r>>>=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);let o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigUInt64LE=Z((function(t,e=0){return P(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Z((function(t,e=0){return B(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);C(this,t,e,r,n-1,-n)}let o=0,i=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);C(this,t,e,r,n-1,-n)}let o=r-1,i=1,a=0;for(this[e+o]=255&t;--o>=0&&(i*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/i>>0)-a&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigInt64LE=Z((function(t,e=0){return P(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Z((function(t,e=0){return B(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,r){return F(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return F(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return R(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return R(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function D(t,e,r,n,o,i){if(t>r||t3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new M.ERR_OUT_OF_RANGE("value",o,t)}!function(t,e,r){J(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||$(e,t.length-(r+1))}(n,o,i)}function J(t,e){if("number"!=typeof t)throw new M.ERR_INVALID_ARG_TYPE(e,"number",t)}function $(t,e,r){if(Math.floor(t)!==t)throw J(t,r),new M.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new M.ERR_BUFFER_OUT_OF_BOUNDS;throw new M.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}G("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),G("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),G("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=q(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=q(o)),o+="n"),n+=` It must be ${e}. Received ${o}`,n}),RangeError);const z=/[^+/0-9A-Za-z-_]/g;function K(t,e){let r;e=e||1/0;const n=t.length;let o=null;const i=[];for(let a=0;a55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function W(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Y(t,e,r,n){let o;for(o=0;o=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function V(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function X(t){return t!=t}const H=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)e[n+o]=t[r]+t[o]}return e}();function Z(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},238:t=>{t.exports=require("base64-js")},665:t=>{t.exports=require("ieee754")},359:e=>{e.exports=t}},r={};function n(t){var o=r[t];if(void 0!==o)return o.exports;var i=r[t]={exports:{}};return e[t](i,i.exports,n),i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{n.r(o),n.d(o,{CommitButton:()=>Tr,Widget:()=>Rn,useAccount:()=>oe,useAccountId:()=>ie,useCache:()=>wr,useInitNear:()=>Ft,useNear:()=>Rt,utils:()=>t});var t={};n.r(t),n.d(t,{ErrorFallback:()=>B,Loading:()=>P,MaxGasPerTransaction:()=>I,OneNear:()=>T,ReactKey:()=>lt,StorageCostPerByte:()=>L,TGas:()=>j,availableNearBalance:()=>Y,bigMax:()=>D,bigMin:()=>q,bigToString:()=>J,computeWritePermission:()=>ut,convertToStringLeaves:()=>rt,dateToString:()=>K,deepCopy:()=>ht,deepEqual:()=>pt,deepFreeze:()=>st,displayGas:()=>z,displayNear:()=>$,displayTime:()=>W,estimateDataSize:()=>Z,extractKeys:()=>Q,indexMatch:()=>at,ipfsUpload:()=>X,ipfsUrl:()=>H,isArray:()=>F,isObject:()=>R,isReactObject:()=>ft,isString:()=>M,isValidAccountId:()=>U,isoDate:()=>V,keysToCamel:()=>G,patternMatch:()=>it,removeDuplicates:()=>tt});var e=n(359),r=n.n(e);const i=require("react-singleton-hook"),a=require("near-api-js"),c=require("big.js");var u=n.n(c);const s=require("@near-wallet-selector/core"),l=require("@near-wallet-selector/near-wallet"),f=require("@near-wallet-selector/my-near-wallet"),h=require("@near-wallet-selector/sender"),p=require("@near-wallet-selector/here-wallet"),d=require("@near-wallet-selector/meteor-wallet"),y=require("@near-wallet-selector/neth"),v=require("deep-equal");var m=n.n(v),g=n(764).lW;function b(t){return function(t){if(Array.isArray(t))return S(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||x(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(t){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w(t)}function E(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(t,e)||x(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(t,e){if(t){if("string"==typeof t)return S(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?S(t,e):void 0}}function S(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),j(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;j(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:L(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function O(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var j=u()(10).pow(12),I=j.mul(250),L=u()(10).pow(19),N=2,A=64,_=/^(([a-z\d]+[-_])*[a-z\d]+\.)*([a-z\d]+[-_])*[a-z\d]+$/,T=u()(10).pow(24),C=T.div(2),P=r().createElement("span",{className:"spinner-grow spinner-grow-sm me-1",role:"status","aria-hidden":"true"}),B=function(t){var e=t.error;return r().createElement("div",{role:"alert"},r().createElement("p",null,"Something went wrong:"),r().createElement("pre",null,e.message))};function U(t){return t&&t.length>=N&&t.length<=A&&t.match(_)}var F=function(t){return Array.isArray(t)},R=function(t){return t===Object(t)&&!F(t)&&"function"!=typeof t},M=function(t){return"string"==typeof t},G=function t(e){if(R(e)){var r={};return Object.keys(e).forEach((function(n){var o;r[(o=n,o.replace(/([-_][a-z])/gi,(function(t){return t.toUpperCase().replace("-","").replace("_","")})))]=t(e[n])})),r}return F(e)?e.map((function(e){return t(e)})):e},q=function(t,e){return t&&e?t.lt(e)?t:e:t||e},D=function(t,e){return t&&e?t.gt(e)?t:e:t||e},J=function(t,e,r){if(null===t)return"???";var n=t.toFixed(),o=n.indexOf(".");if(e=e||6,r=r||7,o>0){var i=Math.min(e,Math.max(r-o,0));i>0&&(i+=1),o+i=0;a-=3)n=n.slice(0,a+1)+","+n.slice(a+1);return"0.000000"===n&&6===e&&7===r?"<0.000001":n},$=function(t){return t?t.eq(1)?r().createElement(r().Fragment,null,"1 ",r().createElement("span",{className:"text-secondary"},"yoctoNEAR")):r().createElement(r().Fragment,null,J(t.div(T))," ",r().createElement("span",{className:"text-secondary"},"NEAR")):"???"},z=function(t){return t?r().createElement(r().Fragment,null,J(t.div(j))," ",r().createElement("span",{className:"text-secondary"},"TGas")):"???"},K=function(t){return t.toLocaleString("en-us",{day:"numeric",month:"short",year:"numeric"})},W=function(t){return t.toLocaleString()},Y=function(t){if(t&&!t.loading&&t.state){var e=u()(t.state.amount).sub(u()(t.state.storage_usage).mul(u()(L)));if(e.gt(C))return e.sub(C)}return u()(0)},V=function(t){return t?new Date(t).toISOString().substring(0,10):""},X=function(){var t,e=(t=k().mark((function t(e){var r;return k().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch("https://ipfs.near.social/add",{method:"POST",headers:{Accept:"application/json"},body:e});case 2:return r=t.sent,t.next=5,r.json();case 5:return t.abrupt("return",t.sent.cid);case 6:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){O(i,n,o,a,c,"next",t)}function c(t){O(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(t){return e.apply(this,arguments)}}(),H=function(t){return"https://ipfs.near.social/ipfs/".concat(t)},Z=function t(e,r){return R(e)?Object.entries(e).reduce((function(e,n){var o=E(n,2),i=o[0],a=o[1],c=R(r)?r[i]:void 0;return e+(void 0!==c?t(a,c):2*i.length+t(a,void 0)+140)}),R(r)?0:98):((null==e?void 0:e.length)||8)-(M(r)?r.length:0)},Q=function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.entries(e).map((function(e){var n=E(e,2),o=n[0],i=n[1];return R(i)?t(i,"".concat(r).concat(o,"/")):"".concat(r).concat(o)})).flat()},tt=function t(e,r){var n=Object.entries(e).reduce((function(e,n){var o=E(n,2),i=o[0],a=o[1],c=R(r)?r[i]:void 0;if(R(a)){var u=R(c)?t(a,c):a;void 0!==u&&(e[i]=u)}else a!==c&&(e[i]=a);return e}),{});return Object.keys(n).length?n:void 0},et=function(t){return M(t)||null===t?t:JSON.stringify(t)},rt=function t(e){return R(e)?Object.entries(e).reduce((function(e,r){var n=E(r,2),o=n[0],i=n[1];return e[et(o)]=t(i),e}),{}):et(e)},nt=function t(e,r){var n=r[0],o="**"===n;return o?1===r.length:("*"===n||o?Object.values(e):n in e?[e[n]]:[]).some((function(e){return R(e)?r.length>1?t(e,r.slice(1)):void 0!==e[""]:1===r.length}))},ot=function t(e,r){var n=r[0];return("*"===n?Object.values(e):n in e?[e[n]]:[]).some((function(e){return 1===r.length||R(e)&&t(e,r.slice(1))}))},it=function(t,e,r){var n=e.split("/");return"get"===t?nt(r,n):"keys"===t&&ot(r,n)},at=function(t,e,r){return Object.values(r).some((function(r){var n,o=null==r||null===(n=r.index)||void 0===n?void 0:n[t];try{return o&&JSON.stringify(JSON.parse(o).key)===JSON.stringify(e)}catch(t){return!1}}))},ct={graph:!0,post:!0,index:!0,settings:!0},ut=function(t,e){var r=R(t)?JSON.parse(JSON.stringify(t)):{};return R(e)&&Object.entries(e).forEach((function(t){var e=E(t,2),n=e[0],o=e[1];if(n in ct)if(R(o)){var i=r[n]=r[n]||{};Object.keys(o).forEach((function(t){i[t]=!0}))}else r[n]=!0;else r[n]=!0})),r},st=function t(e){return Object.keys(e).forEach((function(r){(function(t,e){return!!Object.getOwnPropertyDescriptor(t,e).get})(e,r)||"object"!==w(e[r])||Object.isFrozen(e[r])||t(e[r])})),Object.freeze(e)},lt="$$typeof",ft=function(t){return null!==t&&"object"===w(t)&&!!t[lt]},ht=function t(e){return Array.isArray(e)?e.map((function(e){return t(e)})):e instanceof Map?new Map(b(e.entries()).map((function(e){var r=E(e,2),n=r[0],o=r[1];return[t(n),t(o)]}))):e instanceof Set?new Set(b(e).map((function(e){return t(e)}))):g.isBuffer(e)?g.from(e):e instanceof URL?new URL(e):e instanceof File?new File([e],e.name,{type:e.type}):e instanceof Blob?new Blob([e],{type:e.type}):e instanceof Uint8Array||e instanceof ArrayBuffer?e.slice(0):R(e)?ft(e)?e:Object.fromEntries(Object.entries(e).map((function(e){var r=E(e,2),n=r[0],o=r[1];return[n,t(o)]}))):void 0===e||"function"==typeof e?e:JSON.parse(JSON.stringify(e))},pt=m(),dt=n(764).lW;function yt(t){return yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yt(t)}function vt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return mt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?mt(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function bt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function wt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){bt(i,n,o,a,c,"next",t)}function c(t){bt(i,n,o,a,c,"throw",t)}a(void 0)}))}}var Et={networkId:"testnet",nodeUrl:"https://rpc.testnet.near.org",archivalNodeUrl:"https://rpc.testnet.internal.near.org",contractName:"v1.social08.testnet",walletUrl:"https://wallet.testnet.near.org",wrapNearAccountId:"wrap.testnet",apiUrl:null,enableWeb4FastRpc:!1},xt={networkId:"mainnet",nodeUrl:"https://rpc.mainnet.near.org",archivalNodeUrl:"https://rpc.mainnet.internal.near.org",contractName:"social.near",walletUrl:"https://wallet.near.org",wrapNearAccountId:"wrap.near",apiUrl:"https://api.near.social",enableWeb4FastRpc:!1},St={get:!0,keys:!0},kt=function(){var t=wt(gt().mark((function t(e,r,n,o,i){return gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.apiUrl&&r in St){t.next=2;break}return t.abrupt("return",i());case 2:return n=n||{},o&&(n.blockHeight=o),t.prev=4,t.next=7,fetch("".concat(e.apiUrl,"/").concat(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});case 7:return t.next=9,t.sent.json();case 9:return t.abrupt("return",t.sent);case 12:return t.prev=12,t.t0=t.catch(4),console.log("API call failed",r,n),console.error(t.t0),t.abrupt("return",i());case 17:case"end":return t.stop()}}),t,null,[[4,12]])})));return function(e,r,n,o,i){return t.apply(this,arguments)}}();function Ot(t,e,r,n,o,i){return jt.apply(this,arguments)}function jt(){return(jt=wt(gt().mark((function t(e,r,n,o,i,a){var c;return gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.selector;case 3:return t.next=5,t.sent.wallet();case 5:return c=t.sent,t.next=8,c.signAndSendTransaction({receiverId:r,actions:[{type:"FunctionCall",params:{methodName:n,args:o,gas:null!=i?i:j.mul(30).toFixed(0),deposit:null!=a?a:"0"}}]});case 8:return t.abrupt("return",t.sent);case 11:throw t.prev=11,t.t0=t.catch(0),t.t0;case 14:case"end":return t.stop()}}),t,null,[[0,11]])})))).apply(this,arguments)}function It(t,e){return Lt.apply(this,arguments)}function Lt(){return(Lt=wt(gt().mark((function t(e,r){var n;return gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new a.Account(e.nearConnection.connection,r),t.next=3,n.state();case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Nt(t,e){return At.apply(this,arguments)}function At(){return(At=wt(gt().mark((function t(e,r){var n,o,i;return gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.selector;case 3:return t.next=5,t.sent.wallet();case 5:return n=t.sent,o=[],i=u()(0),r.forEach((function(t){var e,r=t.contractName,n=t.methodName,a=t.args,c=t.gas,u=t.deposit,s=i.add(c),l={type:"FunctionCall",params:{methodName:n,args:a,gas:c.toFixed(0),deposit:u.toFixed(0)}};(null===(e=o[o.length-1])||void 0===e?void 0:e.receiverId)!==r||s.gt(I)?(o.push({receiverId:r,actions:[]}),i=c):i=s,o[o.length-1].actions.push(l)})),t.next=11,n.signAndSendTransactions({transactions:o});case 11:return t.abrupt("return",t.sent);case 14:throw t.prev=14,t.t0=t.catch(0),t.t0;case 17:case"end":return t.stop()}}),t,null,[[0,14]])})))).apply(this,arguments)}function _t(t,e,r){var n=r.viewMethods,o=void 0===n?[]:n,i=r.changeMethods,a=void 0===i?[]:i,c={near:t,contractId:e};return o.forEach((function(r){c[r]=function(n){return t.viewCall(e,r,n)}})),a.forEach((function(r){c[r]=function(n,o,i){return t.functionCall(e,r,n,o,i)}})),c}function Tt(t,e,r,n,o,i){return Ct.apply(this,arguments)}function Ct(){return(Ct=wt(gt().mark((function t(e,r,n,o,i,a){var c;return gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=i||{},t.next=3,e.query({request_type:"call_function",account_id:n,method_name:o,args_base64:dt.from(JSON.stringify(i)).toString("base64"),block_id:r,finality:a});case 3:return c=t.sent,t.abrupt("return",c.result&&c.result.length>0&&JSON.parse(dt.from(c.result).toString()));case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Pt(t,e,r,n){return Bt.apply(this,arguments)}function Bt(){return(Bt=wt(gt().mark((function t(e,r,n,o){var i;return gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=n||{},i=new URL("https://rpc.web4.near.page/account/".concat(e,"/view/").concat(r)),Object.entries(n).forEach((function(t){var e=vt(t,2),r=e[0],n=e[1];void 0!==n&&i.searchParams.append("".concat(r,".json"),JSON.stringify(n))})),t.prev=3,t.next=6,fetch(i.toString());case 6:return t.next=8,t.sent.json();case 8:return t.abrupt("return",t.sent);case 11:return t.prev=11,t.t0=t.catch(3),console.log("Web4 view call failed",i.toString()),console.error(t.t0),t.abrupt("return",o());case 16:case"end":return t.stop()}}),t,null,[[3,11]])})))).apply(this,arguments)}function Ut(){return Ut=wt(gt().mark((function t(){var e,r,n,o,i,c,u,v,m,g,b=arguments;return gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=(n=b.length>0&&void 0!==b[0]?b[0]:{}).networkId,i=n.config,c=n.keyStore,u=n.selector,i||(i={},o||(i.networkId="mainnet")),o&&!i.networkId&&(i.networkId=o),"mainnet"===i.networkId?i=Object.assign({},i,xt):"testnet"===i.networkId&&(i=Object.assign({},i,Et)),c=null!==(e=c)&&void 0!==e?e:new a.keyStores.BrowserLocalStorageKeyStore,u=null!==(r=u)&&void 0!==r?r:(0,s.setupWalletSelector)({network:i.networkId,modules:[(0,l.setupNearWallet)(),(0,f.setupMyNearWallet)(),(0,h.setupSender)(),(0,p.setupHereWallet)(),(0,d.setupMeteorWallet)(),(0,y.setupNeth)({gas:"300000000000000",bundle:!1})]}),t.next=8,a.connect(Object.assign({deps:{keyStore:c}},i));case 8:return v=t.sent,(m={config:i,selector:u,keyStore:c,nearConnection:v}).nearArchivalConnection=a.Connection.fromConfig({networkId:i.networkId,provider:{type:"JsonRpcProvider",args:{url:i.archivalNodeUrl}},signer:{type:"InMemorySigner",keyStore:c}}),g=function(t){return"optimistic"===t||"final"===t?{finality:t,blockId:void 0}:null!=t?{finality:void 0,blockId:parseInt(t)}:{finality:"optimistic",blockId:void 0}},m.viewCall=function(t,e,r,n){var o=g(n),a=o.blockId,c=o.finality,u=function(){return Tt(a?m.nearArchivalConnection.provider:m.nearConnection.connection.provider,null!=a?a:void 0,t,e,r,c)},s=function(){return"optimistic"===c&&i.enableWeb4FastRpc?Pt(t,e,r,u):u()};return t!==i.contractName||!a&&"final"!==c?s():kt(i,e,r,a,s)},m.block=function(t){var e=g(t);return(e.blockId?m.nearArchivalConnection.provider:m.nearConnection.connection.provider).block(e)},m.functionCall=function(t,e,r,n,o){return Ot(m,t,e,r,n,o)},m.sendTransactions=function(t){return Nt(m,t)},m.contract=_t(m,i.contractName,{viewMethods:["storage_balance_of","get","get_num_accounts","get_accounts_paged","is_write_permission_granted","keys"],changeMethods:["set","grant_write_permission","storage_deposit","storage_withdraw"]}),m.accountState=function(t){return It(m,t)},t.abrupt("return",m);case 19:case"end":return t.stop()}}),t)}))),Ut.apply(this,arguments)}var Ft=(0,i.singletonHook)({},(function(){var t=vt((0,e.useState)(null),2),r=t[0],n=t[1];return{nearPromise:r,initNear:(0,e.useMemo)((function(){return function(t){return n(function(){return Ut.apply(this,arguments)}(t))}}),[])}})),Rt=(0,i.singletonHook)(null,(function(){var t=vt((0,e.useState)(null),2),r=t[0],n=t[1],o=Ft().nearPromise;return(0,e.useEffect)((function(){o&&o.then(n)}),[o]),r}));const Mt=require("local-storage");var Gt,qt,Dt,Jt,$t=n.n(Mt);function zt(t){return zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zt(t)}function Kt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Wt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Wt(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Vt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Xt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Vt(i,n,o,a,c,"next",t)}function c(t){Vt(i,n,o,a,c,"throw",t)}a(void 0)}))}}var Ht="near-social-vm:v01:",Zt=Ht+":accountId:",Qt=Ht+":pretendAccountId:",te={loading:!0,signedAccountId:null!==(Gt=$t().get(Zt))&&void 0!==Gt?Gt:void 0,pretendAccountId:null!==(qt=$t().get(Qt))&&void 0!==qt?qt:void 0,accountId:null!==(Dt=null!==(Jt=$t().get(Qt))&&void 0!==Jt?Jt:$t().get(Zt))&&void 0!==Dt?Dt:void 0,state:null,near:null};function ee(t,e){return re.apply(this,arguments)}function re(){return(re=Xt(Yt().mark((function t(e,r){var n,o,i,c,u,s,l,f,h,p,d;return Yt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.connectedContractId=null===(n=r)||void 0===n||null===(o=n.contract)||void 0===o?void 0:o.contractId,!e.connectedContractId||e.connectedContractId===e.config.contractName){t.next=12;break}return t.next=4,e.selector;case 4:return l=t.sent,t.next=7,l.wallet();case 7:return f=t.sent,t.next=10,f.signOut();case 10:e.connectedContractId=null,r=l.store.getState();case 12:if(e.accountId=null!==(i=null===(c=r)||void 0===c||null===(u=c.accounts)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.accountId)&&void 0!==i?i:null,e.accountId){e.publicKey=null;try{"here-wallet"===(null===(h=r)||void 0===h?void 0:h.selectedWalletId)&&(p=$t().get("herewallet:keystore"),e.publicKey=a.KeyPair.fromString(p[e.config.networkId].accounts[e.accountId]).getPublicKey())}catch(t){console.error(t)}if(!e.publicKey)try{e.publicKey=a.KeyPair.fromString($t().get("meteor-wallet"===(null===(d=r)||void 0===d?void 0:d.selectedWalletId)?"_meteor_wallet".concat(e.accountId,":").concat(e.config.networkId):"near-api-js:keystore:".concat(e.accountId,":").concat(e.config.networkId))).getPublicKey()}catch(t){console.error(t)}}case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var ne=function(){var t=Xt(Yt().mark((function t(e,r){var n,o,i,a,c,u,s,l;return Yt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((o=e.accountId)?$t().set(Zt,o):$t().remove(Zt),i=null!==(n=$t().get(Qt))&&void 0!==n?n:void 0,a={loading:!1,signedAccountId:o,pretendAccountId:i,accountId:null!=i?i:o,state:null,near:e,refresh:function(){var t=Xt(Yt().mark((function t(){return Yt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,ne(e,r);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),startPretending:function(){var t=Xt(Yt().mark((function t(n){return Yt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n?$t().set(Qt,n):$t().remove(Qt),t.next=3,ne(e,r);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},!o){t.next=13;break}return t.next=7,Promise.all([e.contract.storage_balance_of({account_id:o}),e.accountState(o)]);case 7:c=t.sent,u=Kt(c,2),s=u[0],l=u[1],a.storageBalance=s,a.state=l;case 13:r(a);case 14:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),oe=(0,i.singletonHook)(te,(function(){var t=Kt((0,e.useState)(te),2),r=t[0],n=t[1],o=Rt();return(0,e.useEffect)((function(){o&&o.selector.then((function(t){t.store.observable.subscribe(function(){var t=Xt(Yt().mark((function t(e){return Yt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,ee(o,e);case 2:return t.prev=2,t.next=5,ne(o,n);case 5:t.next=10;break;case 7:t.prev=7,t.t0=t.catch(2),console.error(t.t0);case 10:case"end":return t.stop()}}),t,null,[[2,7]])})));return function(e){return t.apply(this,arguments)}}())}))}),[o]),r})),ie=function(){return oe().accountId};const ae=require("acorn"),ce=require("acorn-jsx");var ue=n.n(ce);const se=require("react-bootstrap/Modal");var le=n.n(se);const fe=require("remark-gfm");var he=n.n(fe);const pe=require("react-markdown");var de=n.n(pe);const ye=require("react-syntax-highlighter"),ve=require("react-syntax-highlighter/dist/esm/styles/prism"),me=require("mdast-util-find-and-replace");var ge=/@((?:(?:[a-z\d]+[-_])*[a-z\d]+\.)*(?:[a-z\d]+[-_])*[a-z\d]+)/gi;function be(){function t(t,e,r){if(/[\w`]/.test(r.input.charAt(r.index-1))||/[/\w`]/.test(r.input.charAt(r.index+t.length))||e.length<2||e.length>64)return!1;var n={type:"text",value:t};return{type:"strong",children:[n],data:{hProperties:{accountId:e}}}}return function(e){return(0,me.findAndReplace)(e,ge,t),e}}var we=/#(\w+)/gi;function Ee(){function t(t,e,r){if(/[\w`]/.test(r.input.charAt(r.index-1))||/[/\w`]/.test(r.input.charAt(r.index+t.length)))return!1;var n={type:"text",value:t};return{type:"strong",children:[n],data:{hProperties:{hashtag:e}}}}return function(e){return(0,me.findAndReplace)(e,we,t),e}}var xe=["onLinkClick","text","onMention","onHashtag","syntaxHighlighterProps"],Se=["node","children"],ke=["node"],Oe=["node"],je=["node"],Ie=["node"],Le=["node","inline","className","children"];function Ne(){return Ne=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}var _e=function(t){var e=t.onLinkClick,n=t.text,o=t.onMention,i=t.onHashtag,a=t.syntaxHighlighterProps,c=Ae(t,xe);return r().createElement(de(),Ne({},c,{plugins:[],rehypePlugins:[],remarkPlugins:[he(),be,Ee],children:n,components:{strong:function(t){var e,n,a,c,u=t.node,s=t.children,l=Ae(t,Se);return o&&null!==(e=u.properties)&&void 0!==e&&e.accountId?o(null===(a=u.properties)||void 0===a?void 0:a.accountId):i&&null!==(n=u.properties)&&void 0!==n&&n.hashtag?i(null===(c=u.properties)||void 0===c?void 0:c.hashtag):r().createElement("strong",l,s)},a:function(t){t.node;var n=Ae(t,ke);return e?r().createElement("a",Ne({onClick:e},n)):r().createElement("a",Ne({target:"_blank"},n))},img:function(t){t.node;var e=Ae(t,Oe);return r().createElement("img",Ne({className:"img-fluid"},e))},blockquote:function(t){t.node;var e=Ae(t,je);return r().createElement("blockquote",Ne({className:"blockquote"},e))},table:function(t){t.node;var e=Ae(t,Ie);return r().createElement("table",Ne({className:"table table-striped"},e))},code:function(t){t.node;var e=t.inline,n=t.className,o=t.children,i=Ae(t,Le),c=/language-(\w+)/.exec(n||""),u=null!=a?a:{},s=u.wrapLines,l=u.lineProps,f=u.showLineNumbers,h=u.lineNumberStyle;return!e&&c?r().createElement(ye.Prism,Ne({children:String(o).replace(/\n$/,""),style:ve.tomorrow,language:c[1],PreTag:"div",wrapLines:s,lineProps:l,showLineNumbers:f,lineNumberStyle:h},i)):r().createElement("code",Ne({className:n},i),o)}}}))};const Te=require("react-uuid");var Ce=n.n(Te);function Pe(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function ze(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Ke(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){ze(i,n,o,a,c,"next",t)}function c(t){ze(i,n,o,a,c,"throw",t)}a(void 0)}))}}var We=L.mul(2e3),Ye=L.mul(500),Ve=L.mul(500),Xe=L.mul(500),He=function(){var t=Ke($e().mark((function t(e,r){var n;return $e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=Q(r),t.next=3,e.contract.get({keys:n});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),Ze=function(){var t=Ke($e().mark((function t(e,r,n,o){var i,a,c,s,l,f,h,p,d,y;return $e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.selector;case 2:if(i=e.accountId){t.next=6;break}return alert("You're not logged in. Sign in to commit data."),t.abrupt("return");case 6:return t.next=8,Promise.all([e.viewCall(e.config.contractName,"storage_balance_of",{account_id:i}),i!==r?e.viewCall(e.config.contractName,"is_write_permission_granted",{predecessor_id:i,key:r}):e.publicKey?e.viewCall(e.config.contractName,"is_write_permission_granted",{public_key:e.publicKey.toString(),key:r}):Promise.resolve(!1)]);case 8:if(a=t.sent,w=2,c=function(t){if(Array.isArray(t))return t}(b=a)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(b,w)||function(t,e){if(t){if("string"==typeof t)return Je(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Je(t,e):void 0}}(b,w)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),s=c[0],l=c[1],f=u()((null==s?void 0:s.available)||"0"),v={},m=r,g=rt(n),(m=function(t){var e=function(t,e){if("object"!==De(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==De(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===De(e)?e:String(e)}(m))in v?Object.defineProperty(v,m,{value:g,enumerable:!0,configurable:!0,writable:!0}):v[m]=g,h=v,p={},o){t.next=20;break}return t.next=18,He(e,h);case 18:p=t.sent,h=tt(h,p);case 20:return d=L.mul(Z(h,p)).add(s?u()(0):Ye).add(l?u()(0):Xe).add(Ve),y=D(d.sub(f),l?u()(0):s?u()(1):We),t.abrupt("return",{originalData:n,accountId:r,storageBalance:s,availableStorage:f,currentData:p,data:h,expectedDataBalance:d,deposit:y,permissionGranted:l});case 23:case"end":return t.stop()}var v,m,g,b,w}),t)})));return function(e,r,n,o){return t.apply(this,arguments)}}(),Qe=function(){var t=Ke($e().mark((function t(e,r,n){return $e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return console.log("Committing data",r),t.next=3,e.contract.set({data:r},j.mul(100).toFixed(0),n.toFixed(0));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t)})));return function(e,r,n){return t.apply(this,arguments)}}(),tr=function(){var t=Ke($e().mark((function t(e,r,n){var o,i;return $e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.selector;case 2:return t.next=4,t.sent.wallet();case 4:return o=t.sent,i=[],e.publicKey&&(i.push({type:"FunctionCall",params:{methodName:"grant_write_permission",args:{public_key:e.publicKey.toString(),keys:[e.accountId]},gas:j.mul(100).toFixed(0),deposit:n.gt(0)?n.toFixed(0):"1"}}),n=u()(0)),i.push({type:"FunctionCall",params:{methodName:"set",args:{data:r},gas:j.mul(100).toFixed(0),deposit:n.gt(0)?n.toFixed(0):"1"}}),t.next=10,o.signAndSendTransaction({receiverId:e.config.contractName,actions:i});case 10:return t.abrupt("return",t.sent);case 11:case"end":return t.stop()}}),t)})));return function(e,r,n){return t.apply(this,arguments)}}();const er=require("react-bootstrap"),rr=require("idb");function nr(t){return nr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nr(t)}function or(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function ar(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function cr(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){ar(i,n,o,a,c,"next",t)}function c(t){ar(i,n,o,a,c,"throw",t)}a(void 0)}))}}function ur(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:3e3;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.dbPromise=(0,rr.openDB)(vr,1,{upgrade:function(t){t.createObjectStore(mr)}}),this.cache={},this.finalSynchronizationDelayMs=e}var e,r,n,o,i;return e=t,r=[{key:"invalidateCallbacks",value:function(t,e){var r;if(null!==(r=t.invalidationCallbacks)&&void 0!==r&&r.length){var n=t.invalidationCallbacks;t.invalidationCallbacks=[],setTimeout((function(){n.forEach((function(t){try{t()}catch(t){}}))}),e?this.finalSynchronizationDelayMs+50:50)}}},{key:"innerGet",value:(i=cr(ir().mark((function t(e){return ir().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.dbPromise;case 2:return t.abrupt("return",t.sent.get(mr,e));case 3:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"innerSet",value:(o=cr(ir().mark((function t(e,r){return ir().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.dbPromise;case 2:return t.abrupt("return",t.sent.put(mr,r,e));case 3:case"end":return t.stop()}}),t,this)}))),function(t,e){return o.apply(this,arguments)})},{key:"cachedPromise",value:function(t,e,r,n){var o=this;t=JSON.stringify(t);var i=this.cache[t]||{status:hr,invalidationCallbacks:[],result:null,time:(new Date).getTime()};return this.cache[t]=i,R(r)||(r={onInvalidate:r}),r.onInvalidate&&i.invalidationCallbacks.push(r.onInvalidate),!i.subscription&&r.subscribe&&function t(){i.subscription=setTimeout((function(){document.hidden?t():(i.subscription=null,i.status=yr,o.invalidateCallbacks(i,!1))}),5e3)}(),i.status===pr||i.status===dr&&i.time+3e5>(new Date).getTime()||(i.status===hr&&this.innerGet(t).then((function(t){(t||n)&&i.status===pr&&(i.result=t,i.time=(new Date).getTime(),o.invalidateCallbacks(i,!1))})),i.status=pr,e&&e().then((function(e){i.status=dr,i.time=(new Date).getTime(),JSON.stringify(e)!==JSON.stringify(i.result)&&(i.result=e,o.innerSet(t,e),o.invalidateCallbacks(i,!1))})).catch((function(e){console.error(e),i.status=dr;var r=void 0;i.time=(new Date).getTime(),JSON.stringify(r)!==JSON.stringify(i.result)&&(i.result=r,o.innerSet(t,r),o.invalidateCallbacks(i,!1))}))),i.result}},{key:"invalidateCache",value:function(t,e){var r=this,n=[],o="".concat(t.config.apiUrl,"/index");Object.keys(this.cache).forEach((function(r){var i;try{i=JSON.parse(r)}catch(t){return void console.error("Key deserialization failed",r)}if(i.action===sr&&i.contractId===t.config.contractName&&(!i.blockId||"optimistic"===i.blockId||"final"===i.blockId))try{var a;(null===(a=i.args)||void 0===a?void 0:a.keys).some((function(t){return it(i.methodName,t,e)}))&&n.push([r,"final"===i.blockId])}catch(t){}if(i.action===lr&&i.url===o)try{var c,u=JSON.parse(null===(c=i.options)||void 0===c?void 0:c.body),s=u.action,l=u.key;s&&l&&at(s,l,e)&&n.push([r,!0])}catch(t){}})),console.log("Cache invalidation",n),n.forEach((function(t){var e,n,o=(n=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(e,n)||function(t,e){if(t){if("string"==typeof t)return or(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?or(t,e):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=o[0],a=o[1],c=r.cache[i];c.status=yr,r.invalidateCallbacks(c,a)}))}},{key:"cachedBlock",value:function(t,e,r){return this.cachedPromise({action:"Block",blockId:e},(function(){return t.block(e)}),r)}},{key:"cachedViewCall",value:function(t,e,r,n,o,i){return this.cachedPromise({action:sr,contractId:e,methodName:r,args:n,blockId:o},(function(){return t.viewCall(e,r,n,o)}),i)}},{key:"asyncFetch",value:(n=cr(ir().mark((function t(e,r){var n,o,i,a,c,u,s,l,f,h,p;return ir().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=null===(n=r)||void 0===n||null===(o=n.responseType)||void 0===o?void 0:o.toLowerCase(),r={method:null===(i=r)||void 0===i?void 0:i.method,headers:null===(a=r)||void 0===a?void 0:a.headers,body:null===(c=r)||void 0===c?void 0:c.body},t.prev=2,t.next=5,fetch(e,r);case 5:if(s=t.sent,l=s.status,f=s.ok,h=s.headers.get("content-type"),!f){t.next=15;break}return t.next=12,"arraybuffer"===u?s.arrayBuffer():"blob"===u?s.blob():"formdata"===u?s.formData():"json"===u?s.json():"text"===u?s.text():h&&-1!==h.indexOf("application/json")?s.json():s.text();case 12:t.t0=t.sent,t.next=16;break;case 15:t.t0=void 0;case 16:return p=t.t0,t.abrupt("return",{ok:f,status:l,contentType:h,body:p});case 20:return t.prev=20,t.t1=t.catch(2),t.abrupt("return",{ok:!1,error:t.t1.message});case 23:case"end":return t.stop()}}),t,null,[[2,20]])}))),function(t,e){return n.apply(this,arguments)})},{key:"cachedFetch",value:function(t,e,r){var n=this;return this.cachedPromise({action:lr,url:t,options:e},(function(){return n.asyncFetch(t,e)}),r)}},{key:"cachedCustomPromise",value:function(t,e,r){return this.cachedPromise({action:"CustomPromise",key:t},(function(){return e()}),r)}},{key:"socialGet",value:function(t,e,r,n,o,i){if(!t)return null;var a={keys:e=(e=Array.isArray(e)?e:[e]).map((function(t){return r?"".concat(t,"/**"):"".concat(t)})),options:o},c=this.cachedViewCall(t,t.config.contractName,"get",a,n,i);if(null===c)return null;if(1===e.length)for(var u=e[0].split("/"),s=0;s=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Or(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function jr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Ir(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ir(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ir(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,xr),p=jr((0,e.useState)(null),2),d=p[0],y=p[1];return r().createElement(r().Fragment,null,r().createElement("button",Sr({},h,{disabled:s||!o||!!d||!n,onClick:function(t){t.preventDefault(),y("function"==typeof o?o():o),a&&a()}}),!!d&&P,i),r().createElement(_r,{show:!!d,widgetSrc:l,data:d,force:f,onHide:function(){return y(null)},onCancel:u,onCommit:c}))};require("react-bootstrap-typeahead/css/Typeahead.css"),require("react-bootstrap-typeahead/css/Typeahead.bs5.css");const Cr=require("react-bootstrap-typeahead"),Pr=require("styled-components");var Br=n.n(Pr);const Ur=require("elliptic"),Fr=require("bn.js");var Rr=n.n(Fr);const Mr=require("tweetnacl");function Gr(){return Gr=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function Wr(t,e,r){return Wr=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct.bind():function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&Yr(o,r.prototype),o},Wr.apply(null,arguments)}function Yr(t,e){return Yr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Yr(t,e)}function Vr(){return Vr=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r0?(l[f]={uploading:!0,cid:null},n.vm.setReactState(n.vm.state.state),X(t[0]).then((function(t){if(n.vm.alive){var e=n.vm.vmStack.resolveMemberExpression(i.expression,{requireState:!0,left:!0});e.obj[e.key]={cid:t},n.vm.setReactState(n.vm.state.state)}}))):(l[f]=null,n.vm.setReactState(n.vm.state.state))}}}else{var h=n.resolveMemberExpression(i.expression,{requireState:!0,left:!0}),p=h.obj,d=h.key;c.value=(null==p?void 0:p[d])||"",c.onChange=function(t){t.preventDefault(),p[d]=t.target.value,n.vm.setReactState(n.vm.state.state)}}})),c.key=null!==(e=c.key)&&void 0!==e?e:"".concat(this.vm.widgetSrc,"-").concat(o,"-").concat(this.vm.gIndex),delete c.dangerouslySetInnerHTML;var l,f=(null==a?void 0:a.target)||o;if(c.as&&!dn[c.as]&&delete c.as,c.forwardedAs&&!dn[c.forwardedAs]&&delete c.forwardedAs,"img"===f?c.alt=null!==(l=c.alt)&&void 0!==l?l:"not defined":"a"===f?"href"in c&&(c.href=(0,Me.sanitizeUrl)(c.href)):"Widget"===o&&(c.depth=this.vm.depth+1,c.config=[c.config].concat(Xr(this.vm.widgetConfigs)).filter(Boolean)),!1===i&&t.children.length)throw new Error("And element '"+o+"' contains children, but shouldn't");var h,p,d,y,v=t.children.map((function(t,e){return n.vm.gIndex=e,n.executeExpression(t)}));if("Widget"===o)return r().createElement(Rn,c);if("CommitButton"===o)return r().createElement(Tr,Vr({},c,{widgetSrc:this.vm.widgetSrc}),v);if("InfiniteScroll"===o)return r().createElement(qe(),c,v);if("Tooltip"===o)return r().createElement(er.Tooltip,c,v);if("OverlayTrigger"===o)return r().createElement(er.OverlayTrigger,c,v.filter((function(t){return!M(t)||!!t.trim()}))[0]);if("Typeahead"===o)return r().createElement(Cr.Typeahead,c);if("Markdown"===o)return r().createElement(_e,c);if("Fragment"===o)return r().createElement(r().Fragment,c,v);if("IpfsImageUpload"===o)return r().createElement("div",{className:"d-inline-block",key:c.key},(null===(h=u.img)||void 0===h?void 0:h.cid)&&r().createElement("div",{className:"d-inline-block me-2 overflow-hidden align-middle",style:{width:"2.5em",height:"2.5em"}},r().createElement("img",{className:"rounded w-100 h-100",style:{objectFit:"cover"},src:H(null===(p=u.img)||void 0===p?void 0:p.cid),alt:"upload preview"})),r().createElement(Re(),Vr({multiple:!1,accepts:["image/*"],minFileSize:1,clickable:!0},c),null!==(d=u.img)&&void 0!==d&&d.uploading?r().createElement(r().Fragment,null,P," Uploading"):null!==(y=u.img)&&void 0!==y&&y.cid?"Replace":"Upload an Image"));if("Files"===o)return r().createElement(Re(),c,v);if("iframe"===o)return r().createElement(Jr,c);if(a)return r().createElement.apply(r(),[a,an({},c)].concat(Xr(v)));if(!0===i)return r().createElement.apply(r(),[o,an({},c)].concat(Xr(v)));if(!1===i)return r().createElement(o,an({},c));throw new Error("Unsupported element: "+o)}},{key:"resolveKey",value:function(t,e){var r=e||"Identifier"!==t.type?this.executeExpression(t):t.name;return gn(r),r}},{key:"callFunction",value:function(t,e,r,n,o){var i=this,a=vn[t];if(!0===a||void 0===a){if("Social"===t&&"getr"===e||"socialGetr"===e){if(r.length<1)throw new Error("Missing argument 'keys' for Social.getr");return this.vm.cachedSocialGet(r[0],!0,r[1],r[2])}if("Social"===t&&"get"===e||"socialGet"===e){if(r.length<1)throw new Error("Missing argument 'keys' for Social.get");return this.vm.cachedSocialGet(r[0],!1,r[1],r[2])}if("Social"===t&&"keys"===e){if(r.length<1)throw new Error("Missing argument 'keys' for Social.keys");return this.vm.cachedSocialKeys(r[0],r[1],r[2])}if("Social"===t&&"index"===e){if(r.length<2)throw new Error("Missing argument 'action' and 'key` for Social.index");return this.vm.cachedIndex(r[0],r[1],r[2])}if("Social"===t&&"set"===e){if(r.length<1)throw new Error("Missing argument 'data' for Social.set");return this.vm.socialSet(r[0],r[1])}if("Near"===t&&"view"===e){if(r.length<2)throw new Error("Method: Near.view. Required arguments: 'contractName', 'methodName'. Optional: 'args', 'blockId/finality', 'subscribe'");var c=tn(r,5),u=c[0],s=c[1],l=c[2],f=c[3],h=c[4];return this.vm.cachedNearView(u,s,l,f,En(h,f))}if("Near"===t&&"asyncView"===e){var p;if(r.length<2)throw new Error("Method: Near.asyncView. Required arguments: 'contractName', 'methodName'. Optional: 'args', 'blockId/finality'");return(p=this.vm).asyncNearView.apply(p,Xr(r))}if("Near"===t&&"block"===e){var d=tn(r,2),y=d[0],v=d[1];return this.vm.cachedNearBlock(y,En(v,y))}if("Near"===t&&"call"===e){if(1===r.length){if(R(r[0]))return this.vm.confirmTransactions([r[0]]);if(F(r[0]))return this.vm.confirmTransactions(r[0]);throw new Error("Method: Near.call. Required argument: 'tx/txs'. A single argument call requires an TX object or an array of TX objects.")}var m;if(r.length<2||r.length>5)throw new Error("Method: Near.call. Required argument: 'contractName'. If the first argument is a string: 'methodName'. Optional: 'args', 'gas' (defaults to 300Tg), 'deposit' (defaults to 0)");return this.vm.confirmTransactions([{contractName:r[0],methodName:r[1],args:null!==(m=r[2])&&void 0!==m?m:{},gas:r[3],deposit:r[4]}])}if("fetch"===e){var g;if(r.length<1)throw new Error("Method: fetch. Required arguments: 'url'. Optional: 'options'");return(g=this.vm).cachedFetch.apply(g,Xr(r))}if("asyncFetch"===e){var b;if(r.length<1)throw new Error("Method: asyncFetch. Required arguments: 'url'. Optional: 'options'");return(b=this.vm).asyncFetch.apply(b,Xr(r))}if("useCache"===e){var w;if(r.length<2)throw new Error("Method: useCache. Required arguments: 'promiseGenerator', 'dataKey'. Optional: 'options'");if(!(r[0]instanceof Function))throw new Error("Method: useCache. The first argument 'promiseGenerator' must be a function");return(w=this.vm).useCache.apply(w,Xr(r))}if("parseInt"===e)return parseInt.apply(void 0,Xr(r));if("parseFloat"===e)return parseFloat.apply(void 0,Xr(r));if("isNaN"===e)return isNaN.apply(void 0,Xr(r));if("setTimeout"===e){var E=tn(r,2),x=E[0],S=E[1],k=setTimeout((function(){i.vm.alive&&x()}),S);return this.vm.timeouts.add(k),k}if("setInterval"===e){if(this.vm.intervals.size>=16)throw new Error("Too many intervals. Max allowed: ".concat(16));var O=tn(r,2),j=O[0],I=O[1],L=setInterval((function(){i.vm.alive&&j()}),I);return this.vm.intervals.add(L),L}if("clearTimeout"===e){var N=r[0];return this.vm.timeouts.delete(N),clearTimeout(N)}if("clearInterval"===e){var A=r[0];return this.vm.intervals.delete(A),clearInterval(A)}if("JSON"===t&&"stringify"===e||"stringify"===e){if(r.length<1)throw new Error("Missing argument 'obj' for JSON.stringify");return bn(r[0]),JSON.stringify(r[0],r[1],r[2])}if("JSON"===t&&"parse"===e){if(r.length<1)throw new Error("Missing argument 's' for JSON.parse");try{var _=JSON.parse(r[0]);return wn(_),_}catch(t){return null}}else if("Object"===t){if("keys"===e){if(r.length<1)throw new Error("Missing argument 'obj' for Object.keys");return bn(r[0]),Object.keys(r[0])}if("values"===e){if(r.length<1)throw new Error("Missing argument 'obj' for Object.values");return bn(r[0]),Object.values(r[0])}if("entries"===e){if(r.length<1)throw new Error("Missing argument 'obj' for Object.entries");return bn(r[0]),Object.entries(r[0])}if("assign"===e){r.forEach((function(t){return bn(t)}));var T=Object.assign.apply(Object,Xr(r));return wn(T),T}if("fromEntries"===e){var C=Object.fromEntries(r[0]);return wn(C),C}}else{if("State"===t&&"init"===e||"initState"===e){if(r.length<1)throw new Error("Missing argument 'initialState' for State.init");if(null===r[0]||"object"!==nn(r[0])||ft(r[0]))throw new Error("'initialState' is not an object");if(void 0===this.vm.state.state){var P=r[0];this.vm.state.state=P,this.vm.setReactState(P)}return this.vm.state.state}if("State"===t&&"update"===e){var B;if(R(r[0]))this.vm.state.state=null!==(B=this.vm.state.state)&&void 0!==B?B:{},Object.assign(this.vm.state.state,ht(r[0]));else if(r[0]instanceof Function){var U;this.vm.state.state=null!==(U=this.vm.state.state)&&void 0!==U?U:{},this.vm.state.state=r[0](this.vm.state.state)}if(void 0===this.vm.state.state)throw new Error("The state was not initialized");return this.vm.setReactState(this.vm.state.state),this.vm.state.state}if("Storage"===t&&"privateSet"===e){if(r.length<2)throw new Error("Missing argument 'key' or 'value' for Storage.privateSet");return this.vm.storageSet({src:this.vm.widgetSrc,type:hn},r[0],r[1])}if("Storage"===t&&"privateGet"===e){if(r.length<1)throw new Error("Missing argument 'key' for Storage.privateGet");return this.vm.storageGet({src:this.vm.widgetSrc,type:hn},r[0])}if("Storage"===t&&"set"===e){if(r.length<2)throw new Error("Missing argument 'key' or 'value' for Storage.set");return this.vm.storageSet({src:this.vm.widgetSrc,type:pn},r[0],r[1])}if("Storage"===t&&"get"===e){var M;if(r.length<1)throw new Error("Missing argument 'key' for Storage.get");return this.vm.storageGet({src:null!==(M=r[1])&&void 0!==M?M:this.vm.widgetSrc,type:pn},r[0])}var G,q;if("console"===t&&"log"===e)return(G=console).log.apply(G,[this.vm.widgetSrc].concat(Xr(r)));if("clipboard"===t&&"writeText"===e)return this.isTrusted?(q=navigator.clipboard).writeText.apply(q,Xr(r)):Promise.reject(new Error("Not trusted (not a click)"))}}else{var D=e===t?a:a[e];if("function"==typeof D)return o?Wr(D,Xr(r)):D.apply(void 0,Xr(r))}if(!n)throw new Error(t&&t!==e?"Unsupported callee method '".concat(t,".").concat(e,"'"):"Unsupported callee method '".concat(e,"'"))}},{key:"resolveMemberExpression",value:function(t,e){if("Identifier"===t.type){var r,n=t.name;if(gn(n),null!=e&&e.requireState&&n!==fn)throw new Error("The top object should be ".concat(fn));var o=null!==(r=this.stack.findObj(n))&&void 0!==r?r:this.stack.state;if(bn(o),o===this.stack.state&&n in vn){if(null!=e&&e.left)throw new Error("Cannot assign to keyword '"+n+"'");return{obj:o,key:n,keyword:n}}if(null!=e&&e.left&&(!o||!(n in o)))throw new Error("Accessing undeclared identifier '".concat(t.name,"'"));return{obj:o,key:n}}if("MemberExpression"===t.type){var i;if("Identifier"===(null===(i=t.object)||void 0===i?void 0:i.type)){var a=t.object.name;if(a in vn){if(null==e||!e.callee)throw new Error("Cannot dereference keyword '"+a+"' in non-call expression");return{obj:this.stack.state,key:this.resolveKey(t.property,t.computed),keyword:a}}}var c=this.executeExpression(t.object);return bn(c),{obj:c,key:this.resolveKey(t.property,t.computed)}}throw new Error("Unsupported member type: '"+t.type+"'")}},{key:"getArray",value:function(t){var e=this,r=[];return t.forEach((function(t){"SpreadElement"===t.type?r.push.apply(r,Xr(e.executeExpression(t.argument))):r.push(e.executeExpression(t))})),r}},{key:"executeExpressionInternal",value:function(t){var e=this;if(!t)return null;var r=null==t?void 0:t.type;if("AssignmentExpression"===r){var n,o=this.resolveMemberExpression(t.left,{left:!0}),i=o.obj,a=o.key,c=this.executeExpression(t.right);if("="===t.operator)return i[a]=c;if("+="===t.operator)return i[a]+=c;if("-="===t.operator)return i[a]-=c;if("*="===t.operator)return i[a]*=c;if("/="===t.operator)return i[a]/=c;if("??="===t.operator)return null!==(n=i[a])&&void 0!==n?n:i[a]=c;throw new Error("Unknown AssignmentExpression operator '"+t.operator+"'")}if("ChainExpression"===r)return this.executeExpression(t.expression);if("MemberExpression"===r){var u=this.resolveMemberExpression(t),s=u.obj,l=u.key;return null==s?void 0:s[l]}if("Identifier"===r)return this.stack.get(t.name);if("JSXExpressionContainer"===r)return this.executeExpression(t.expression);if("TemplateLiteral"===r){for(var f=[],h=0;h"===t.operator)return w>E;if("<="===t.operator)return w<=E;if(">="===t.operator)return w>=E;if("==="===t.operator||"=="===t.operator)return w===E;if("!=="===t.operator||"!="===t.operator)return w!==E;if("in"===t.operator)return w in E;throw new Error("Unknown BinaryExpression operator '"+t.operator+"'")}if("UnaryExpression"===r){if("delete"===t.operator){var x=this.resolveMemberExpression(t.argument,{left:!0}),S=x.obj,k=x.key;return null==S||delete S[k]}var O=this.executeExpression(t.argument);if("-"===t.operator)return-O;if("!"===t.operator)return!O;if("typeof"===t.operator)return nn(O);throw new Error("Unknown UnaryExpression operator '"+t.operator+"'")}if("LogicalExpression"===r){var j=this.executeExpression(t.left);if("||"===t.operator)return j||this.executeExpression(t.right);if("&&"===t.operator)return j&&this.executeExpression(t.right);if("??"===t.operator)return null!=j?j:this.executeExpression(t.right);throw new Error("Unknown LogicalExpression operator '"+t.operator+"'")}if("ConditionalExpression"===r)return this.executeExpression(t.test)?this.executeExpression(t.consequent):this.executeExpression(t.alternate);if("UpdateExpression"===r){var I=this.resolveMemberExpression(t.argument,{left:!0}),L=I.obj,N=I.key;if("++"===t.operator)return t.prefix?++L[N]:L[N]++;if("--"===t.operator)return t.prefix?--L[N]:L[N]--;throw new Error("Unknown UpdateExpression operator '"+t.operator+"'")}if("ObjectExpression"===r)return t.properties.reduce((function(t,r){if("Property"===r.type)t[e.resolveKey(r.key,r.computed)]=e.executeExpression(r.value);else{if("SpreadElement"!==r.type)throw new Error("Unknown property type: "+r.type);var n=e.executeExpression(r.argument);bn(n),Object.assign(t,n)}return t}),{});if("ArrayExpression"===r)return this.getArray(t.elements);if("JSXEmptyExpression"===r)return null;if("ArrowFunctionExpression"===r)return this.createFunction(t.params,t.body,t.expression);if("TaggedTemplateExpression"===r){var A,_;if("MemberExpression"!==t.tag.type&&"CallExpression"!==t.tag.type)throw new Error("TaggedTemplateExpression is only supported for `styled` components");var T=this.resolveMemberExpression("MemberExpression"===t.tag.type?t.tag:t.tag.callee,{callee:!0}),C=T.key;if("styled"!==T.keyword)throw new Error("TaggedTemplateExpression is only supported for `styled` components");if("CallExpression"===t.tag.type){var P=this.getArray(t.tag.arguments),B=null==P?void 0:P[0];if(!(0,Pr.isStyledComponent)(B))throw new Error("styled() can only take `styled` components");A=Br()(B)}else{if("keyframes"===C)A=Pr.keyframes;else{if(!(C in dn))throw new Error("Unsupported styled tag: "+C);A=Br()(C)}_=C}if("TemplateLiteral"!==t.quasi.type)throw new Error("Unknown quasi type: "+t.quasi.type);var U=t.quasi.quasis.map((function(t){if("TemplateElement"!==t.type)throw new Error("Unknown quasis type: "+t.type);return t.value.cooked})),F=0===t.quasi.expressions.length&&"CallExpression"!==t.tag.type,R=JSON.stringify([_].concat(Xr(U)));if(F&&this.vm.cachedStyledComponents.has(R))return this.vm.cachedStyledComponents.get(R);var M=t.quasi.expressions.map((function(t){return e.executeExpression(t)}));if(A instanceof Function){var G=A.apply(void 0,[U].concat(Xr(M)));return F&&this.vm.cachedStyledComponents.set(R,G),G}throw new Error("styled error")}throw new Error("Unknown expression type '"+r+"'")}},{key:"createFunction",value:function(t,e,r){var n=this;return t=t.map(kn),function(){for(var o,i,a,c=arguments.length,u=new Array(c),s=0;s0&&(!t.test||a.executeExpression(t.test));){var c=a.executeStatement(t.body);if(c){if(c.break)break;if(!c.continue)return c}a.executeExpression(t.update)}if(this.vm.loopLimit<=0)throw new Error("Exceeded loop limit")}else if("ForOfStatement"===t.type){var u=this.newStack(),s=u.executeExpression(t.right);bn(s);var l,f=Kr(s);try{var h=function(){var r=l.value;if(e.vm.loopLimit--<=0)throw new Error("Exceeded loop limit");if("VariableDeclaration"===t.left.type){if(1!==t.left.declarations.length)throw new Error("Invalid for-of statement");t.left.declarations.forEach((function(t){if("VariableDeclarator"!==t.type)throw new Error("Unknown variable declaration type '"+t.type+"'");e.stackDeclare(kn(t.id),r)}))}else{var n=e.resolveMemberExpression(t.left,{left:!0});n.obj[n.key]=r}var o=u.executeStatement(t.body);if(o){if(o.break)return"break";if(!o.continue)return{v:o}}};for(f.s();!(l=f.n()).done;){var p=h();if("break"===p)break;if("object"===nn(p))return p.v}}catch(t){f.e(t)}finally{f.f()}}else if("WhileStatement"===t.type){for(var d=this.newStack();this.vm.loopLimit-- >0&&d.executeExpression(t.test);){var y=d.executeStatement(t.body);if(y){if(y.break)break;if(!y.continue)return y}}if(this.vm.loopLimit<=0)throw new Error("Exceeded loop limit")}else if("IfStatement"===t.type){var v=this.executeExpression(t.test),m=this.newStack(),g=v?m.executeStatement(t.consequent):m.executeStatement(t.alternate);if(g)return g}else{if("BreakStatement"===t.type)return{break:!0};if("ContinueStatement"===t.type)return{continue:!0};if("ThrowStatement"===t.type)throw this.executeExpression(t.argument);if("TryStatement"===t.type)try{var b=this.newStack().executeStatement(t.block);if(b)return b}catch(e){if(!this.vm.alive||!t.handler)return null;if("CatchClause"!==t.handler.type)throw new Error("Unknown try statement handler type '"+t.handler.type+"'");var w=this.newStack();t.handler.param&&w.stackDeclare(xn(t.handler.param),ht(e instanceof Error?{name:null==e?void 0:e.name,message:null==e?void 0:e.message,toString:function(){return e.toString()}}:e));var E=w.executeStatement(t.handler.body);if(E)return E}finally{this.vm.alive&&this.newStack().executeStatement(t.finalizer)}else{if("SwitchStatement"!==t.type)throw new Error("Unknown token type '"+t.type+"'");var x,S=this.executeExpression(t.discriminant),k=this.newStack(),O=!1,j=Kr(t.cases);try{for(j.s();!(x=j.n()).done;){var I=x.value;if("SwitchCase"!==I.type)throw new Error("Unknown switch case type '"+I.type+"'");if(!O&&I.test){if(k.executeExpression(I.test)!==S)continue;O=!0}if(O){var L,N=!1,A=Kr(I.consequent);try{for(A.s();!(L=A.n()).done;){var _=L.value,T=k.executeStatement(_);if(T){if(T.break){N=!0;break}return T}}}catch(t){A.e(t)}finally{A.f()}if(N)break}}}catch(t){j.e(t)}finally{j.f()}}}}return null}}]),t}(),In=function(){function t(e){Hr(this,t);var r=e.near,n=e.code,o=e.setReactState,i=e.cache,a=e.refreshCache,c=e.confirmTransactions,u=e.depth,s=e.widgetSrc,l=e.requestCommit,f=e.version,h=e.widgetConfigs;if(!n)throw new Error("Not a program");this.alive=!0,this.near=r,this.code=n,this.setReactState=function(t){return o(ht(t))},this.cache=i,this.refreshCache=a,this.confirmTransactions=c,this.depth=u,this.widgetSrc=s,this.requestCommit=l,this.version=f,this.cachedStyledComponents=new Map,this.widgetConfigs=h,this.timeouts=new Set,this.intervals=new Set}return Qr(t,[{key:"stop",value:function(){this.alive=!1,this.timeouts.forEach((function(t){return clearTimeout(t)})),this.intervals.forEach((function(t){return clearInterval(t)}))}},{key:"cachedPromise",value:function(t,e){var r=this;return ht(t({onInvalidate:function(){r.alive&&r.refreshCache()},subscribe:!!e}))}},{key:"cachedSocialGet",value:function(t,e,r,n){var o=this;return t=Array.isArray(t)?t:[t],this.cachedPromise((function(i){return o.cache.socialGet(o.near,t,e,r,n,i)}),null==n?void 0:n.subscribe)}},{key:"storageGet",value:function(t,e){var r=this;return this.cachedPromise((function(n){return r.cache.localStorageGet(t,e,n)}))}},{key:"storageSet",value:function(t,e,r){return this.cache.localStorageSet(t,e,r)}},{key:"cachedSocialKeys",value:function(t,e,r){var n=this;return t=Array.isArray(t)?t:[t],this.cachedPromise((function(o){return n.cache.cachedViewCall(n.near,n.near.config.contractName,"keys",{keys:t,options:r},e,o)}),null==r?void 0:r.subscribe)}},{key:"asyncNearView",value:function(t,e,r,n){return this.near.viewCall(t,e,r,n)}},{key:"cachedNearView",value:function(t,e,r,n,o){var i=this;return this.cachedPromise((function(o){return i.cache.cachedViewCall(i.near,t,e,r,n,o)}),o)}},{key:"cachedNearBlock",value:function(t,e){var r=this;return this.cachedPromise((function(e){return r.cache.cachedBlock(r.near,t,e)}),e)}},{key:"asyncFetch",value:function(t,e){return this.cache.asyncFetch(t,e)}},{key:"cachedFetch",value:function(t,e){var r=this;return this.cachedPromise((function(n){return r.cache.cachedFetch(t,e,n)}),null==e?void 0:e.subscribe)}},{key:"cachedIndex",value:function(t,e,r){var n=this;return this.cachedPromise((function(o){return n.cache.socialIndex(n.near,t,e,r,o)}),null==r?void 0:r.subscribe)}},{key:"useCache",value:function(t,e,r){var n=this;return this.cachedPromise((function(r){return n.cache.cachedCustomPromise({widgetSrc:n.widgetSrc,dataKey:e},t,r)}),null==r?void 0:r.subscribe)}},{key:"socialSet",value:function(t,e){return this.requestCommit({data:t,force:null==e?void 0:e.force,onCommit:null==e?void 0:e.onCommit,onCancel:null==e?void 0:e.onCancel})}},{key:"renderCode",value:function(t){var e=t.props,n=t.context,o=t.state;if(this.depth>=32)return"Too deep";this.gIndex=0,this.state={props:ht(e),context:n,state:ht(o),nacl:sn,elliptic:ln},this.loopLimit=1e6,this.vmStack=new jn(this,void 0,this.state);var i=this.vmStack.executeStatement(this.code);if(null!=i&&i.break)throw new Error("BreakStatement outside of a loop");if(null!=i&&i.continue)throw new Error("ContinueStatement outside of a loop");var a=null==i?void 0:i.result;return ft(a)||"string"==typeof a||"number"==typeof a?a:r().createElement("pre",null,JSON.stringify(a,void 0,2))}}]),t}();const Ln=require("react-error-boundary"),Nn=require("react-bootstrap-typeahead/types/utils");function An(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(t,e)||_n(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _n(t,e){if(t){if("string"==typeof t)return Tn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Tn(t,e):void 0}}function Tn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}(r||[]);try{for(i.s();!(n=i.n()).done;){var a,c=n.value;if(null!==(a=o)&&void 0!==a&&a.src){var u,s=o.src,l=R(null==c?void 0:c.redirectMap)&&c.redirectMap[s];if(!l)try{l=(0,Nn.isFunction)(null==c?void 0:c.redirect)&&c.redirect(s)}catch(t){}if(M(l))o={src:l};else if(M(null===(u=l)||void 0===u?void 0:u.code))return{code:l.code}}}}catch(t){i.e(t)}finally{i.f()}return o};function Rn(t){var n=t.src,o=t.code,i=t.props,a=t.depth||0,c=t.config,s=An((0,e.useState)(0),2),l=s[0],f=s[1],h=An((0,e.useState)(null),2),p=h[0],d=h[1],y=An((0,e.useState)(null),2),v=y[0],m=y[1],g=An((0,e.useState)(void 0),2),b=g[0],w=g[1],E=An((0,e.useState)(0),2),x=E[0],S=E[1],k=An((0,e.useState)(null),2),O=k[0],I=k[1],L=An((0,e.useState)({}),2),N=L[0],A=L[1],_=An((0,e.useState)(null),2),T=_[0],C=_[1],U=An((0,e.useState)(null),2),F=U[0],R=U[1],M=An((0,e.useState)(null),2),G=M[0],q=M[1],D=An((0,e.useState)(null),2),J=D[0],$=D[1],z=An((0,e.useState)(null),2),K=z[0],W=z[1],Y=An((0,e.useState)(null),2),V=Y[0],X=Y[1],H=wr(),Z=Rt(),Q=ie(),tt=An((0,e.useState)(null),2),et=tt[0],rt=tt[1];(0,e.useEffect)((function(){var t=c?Array.isArray(c)?c:[c]:[];pt(t,K)||W(t)}),[c,K]),(0,e.useEffect)((function(){var t=Fn(n,o,K);pt(t,V)||X(t)}),[n,o,K,V]),(0,e.useEffect)((function(){if(Z)if(null!=V&&V.src){var t=V.src,e=H.socialGet(Z,t.toString(),!1,void 0,void 0,(function(){f(l+1)}));d(e),m(t)}else null!=V&&V.code&&(d(V.code),m(null))}),[Z,V,l]),(0,e.useEffect)((function(){if(C(null),rt(null),p)try{var t=Un(p);I({parsedCode:t})}catch(t){rt(r().createElement("div",{className:"alert alert-danger"},"Compilation error:",r().createElement("pre",null,t.message),r().createElement("pre",null,t.stack))),console.error(t)}else void 0===p&&rt(r().createElement("div",{className:"alert alert-danger"},'Source code for "',v,'" is not found'))}),[p,v]);var nt=(0,e.useCallback)((function(t){if(!Z||!t||0===t.length)return null;t=t.map((function(t){return{contractName:t.contractName,methodName:t.methodName,args:t.args||{},deposit:t.deposit?u()(t.deposit):u()(0),gas:t.gas?u()(t.gas):j.mul(30)}})),console.log("confirm txs",t),R(t)}),[Z]),ot=(0,e.useCallback)((function(t){if(!Z)return null;console.log("commit requested",t),q(t)}),[Z]);return(0,e.useEffect)((function(){if(Z&&O){w(void 0);var t=new In({near:Z,code:O.parsedCode,setReactState:w,cache:H,refreshCache:function(){S((function(t){return t+1}))},confirmTransactions:nt,depth:a,widgetSrc:v,requestCommit:ot,version:Ce()(),widgetConfigs:K});return C(t),function(){t.stop()}}}),[v,Z,O,a,ot,nt,K]),(0,e.useEffect)((function(){Z&&A({loading:!1,accountId:null!=Q?Q:null,widgetSrc:v})}),[Z,Q,v]),(0,e.useLayoutEffect)((function(){if(T){var t={props:i||{},context:N,state:b,cacheNonce:x,version:T.version};if(!pt(t,J)){$(ht(t));try{var e;rt(null!==(e=T.renderCode(t))&&void 0!==e?e:"Execution failed")}catch(t){rt(r().createElement("div",{className:"alert alert-danger"},"Execution error:",r().createElement("pre",null,t.message),r().createElement("pre",null,t.stack))),console.error(t)}}}}),[T,i,N,b,x,J]),null!=et?r().createElement(Ln.ErrorBoundary,{FallbackComponent:B,onReset:function(){rt(null)},resetKeys:[et]},r().createElement(r().Fragment,null,et,F&&r().createElement(Ue,{transactions:F,onHide:function(){return R(null)}}),G&&r().createElement(_r,{show:!0,widgetSrc:v,data:G.data,force:G.force,onHide:function(){return q(null)},onCommit:G.onCommit,onCancel:G.onCancel}))):P}})(),o})())); \ No newline at end of file +!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("react"));else if("function"==typeof define&&define.amd)define(["react"],e);else{var r="object"==typeof exports?e(require("react")):e(t.React);for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(global,(t=>(()=>{"use strict";var e={764:(t,e,r)=>{const n=r(238),o=r(665),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.lW=u,e.h2=50;const a=2147483647;function c(t){if(t>a)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}return s(t,e,r)}function s(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|y(t,e);let n=c(r);const o=n.write(t,e);return o!==r&&(n=n.slice(0,o)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(X(t,Uint8Array)){const e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return h(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(X(t,ArrayBuffer)||t&&X(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(X(t,SharedArrayBuffer)||t&&X(t.buffer,SharedArrayBuffer)))return p(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return u.from(n,e,r);const o=function(t){if(u.isBuffer(t)){const e=0|d(t.length),r=c(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||W(t.length)?c(0):h(t):"Buffer"===t.type&&Array.isArray(t.data)?h(t.data):void 0}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[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 t)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function f(t){return l(t),c(t<0?0:0|d(t))}function h(t){const e=t.length<0?0:0|d(t.length),r=c(e);for(let n=0;n=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|t}function y(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||X(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Y(t).length;default:if(o)return n?-1:K(t).length;e=(""+e).toLowerCase(),o=!0}}function v(t,e,r){let 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 A(this,e,r);case"utf8":case"utf-8":return j(this,e,r);case"ascii":return L(this,e,r);case"latin1":case"binary":return N(this,e,r);case"base64":return O(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),W(r=+r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,o){let i,a=1,c=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,c/=2,u/=2,r/=2}function s(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){let n=-1;for(i=r;ic&&(r=c-u),i=r;i>=0;i--){let r=!0;for(let n=0;no&&(n=o):n=o;const i=e.length;let a;for(n>i/2&&(n=i/2),a=0;a>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function O(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function j(t,e,r){r=Math.min(t.length,r);const n=[];let o=e;for(;o239?4:e>223?3:e>191?2:1;if(o+a<=r){let r,n,c,u;switch(a){case 1:e<128&&(i=e);break;case 2:r=t[o+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(i=u));break;case 3:r=t[o+1],n=t[o+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(i=u));break;case 4:r=t[o+1],n=t[o+2],c=t[o+3],128==(192&r)&&128==(192&n)&&128==(192&c)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&c,u>65535&&u<1114112&&(i=u))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=a}return function(t){const e=t.length;if(e<=I)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(n,o)):Uint8Array.prototype.set.call(n,e,o);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,o)}o+=e.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;er&&(t+=" ... "),""},i&&(u.prototype[i]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,o){if(X(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;let i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0);const c=Math.min(i,a),s=this.slice(n,o),l=t.slice(e,r);for(let t=0;t>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return x(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const I=4096;function L(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;on)&&(r=n);let o="";for(let n=e;nr)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,o,i){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||et.length)throw new RangeError("Index out of range")}function P(t,e,r,n,o){D(e,n,o,t,r,7);let i=Number(e&BigInt(4294967295));t[r++]=i,i>>=8,t[r++]=i,i>>=8,t[r++]=i,i>>=8,t[r++]=i;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,r}function B(t,e,r,n,o){D(e,n,o,t,r,7);let i=Number(e&BigInt(4294967295));t[r+7]=i,i>>=8,t[r+6]=i,i>>=8,t[r+5]=i,i>>=8,t[r+4]=i;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=a,a>>=8,t[r+2]=a,a>>=8,t[r+1]=a,a>>=8,t[r]=a,r+8}function U(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(t,e,r,n,i){return e=+e,r>>>=0,i||U(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function R(t,e,r,n,i){return e=+e,r>>>=0,i||U(t,0,r,8),o.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||T(t,e,this.length);let n=this[t],o=1,i=0;for(;++i>>=0,e>>>=0,r||T(t,e,this.length);let n=this[t+--e],o=1;for(;e>0&&(o*=256);)n+=this[t+--e]*o;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=Z((function(t){J(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||$(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,o=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(o)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||$(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],o=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<>>=0,e>>>=0,r||T(t,e,this.length);let n=this[t],o=1,i=0;for(;++i=o&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);let n=e,o=1,i=this[t+--n];for(;n>0&&(o*=256);)i+=this[t+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i},u.prototype.readInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||T(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||T(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=Z((function(t){J(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||$(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||$(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<>>=0,e||T(t,4,this.length),o.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||T(t,4,this.length),o.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||T(t,8,this.length),o.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||T(t,8,this.length),o.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);let o=1,i=0;for(this[e]=255&t;++i>>=0,r>>>=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);let o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigUInt64LE=Z((function(t,e=0){return P(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Z((function(t,e=0){return B(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);C(this,t,e,r,n-1,-n)}let o=0,i=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);C(this,t,e,r,n-1,-n)}let o=r-1,i=1,a=0;for(this[e+o]=255&t;--o>=0&&(i*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/i>>0)-a&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigInt64LE=Z((function(t,e=0){return P(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Z((function(t,e=0){return B(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,r){return F(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return F(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return R(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return R(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function D(t,e,r,n,o,i){if(t>r||t3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new M.ERR_OUT_OF_RANGE("value",o,t)}!function(t,e,r){J(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||$(e,t.length-(r+1))}(n,o,i)}function J(t,e){if("number"!=typeof t)throw new M.ERR_INVALID_ARG_TYPE(e,"number",t)}function $(t,e,r){if(Math.floor(t)!==t)throw J(t,r),new M.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new M.ERR_BUFFER_OUT_OF_BOUNDS;throw new M.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}G("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),G("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),G("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=q(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=q(o)),o+="n"),n+=` It must be ${e}. Received ${o}`,n}),RangeError);const z=/[^+/0-9A-Za-z-_]/g;function K(t,e){let r;e=e||1/0;const n=t.length;let o=null;const i=[];for(let a=0;a55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function Y(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function V(t,e,r,n){let o;for(o=0;o=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function X(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function W(t){return t!=t}const H=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)e[n+o]=t[r]+t[o]}return e}();function Z(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},238:t=>{t.exports=require("base64-js")},665:t=>{t.exports=require("ieee754")},359:e=>{e.exports=t}},r={};function n(t){var o=r[t];if(void 0!==o)return o.exports;var i=r[t]={exports:{}};return e[t](i,i.exports,n),i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{n.r(o),n.d(o,{CommitButton:()=>Or,Widget:()=>_n,useAccount:()=>Ht,useAccountId:()=>Zt,useCache:()=>pr,useInitNear:()=>At,useNear:()=>_t,utils:()=>t});var t={};n.r(t),n.d(t,{ErrorFallback:()=>L,Loading:()=>I,MaxGasPerTransaction:()=>w,OneNear:()=>O,ReactKey:()=>nt,StorageCostPerByte:()=>E,TGas:()=>b,availableNearBalance:()=>q,bigMax:()=>B,bigMin:()=>P,bigToString:()=>U,computeWritePermission:()=>et,convertToStringLeaves:()=>X,dateToString:()=>M,deepCopy:()=>it,deepEqual:()=>at,deepFreeze:()=>rt,displayGas:()=>R,displayNear:()=>F,displayTime:()=>G,estimateDataSize:()=>z,extractKeys:()=>K,indexMatch:()=>Q,ipfsUpload:()=>J,ipfsUrl:()=>$,isArray:()=>A,isObject:()=>_,isReactObject:()=>ot,isString:()=>T,isValidAccountId:()=>N,isoDate:()=>D,keysToCamel:()=>C,patternMatch:()=>Z,removeDuplicates:()=>Y});var e=n(359),r=n.n(e);const i=require("react-singleton-hook"),a=require("near-api-js"),c=require("big.js");var u=n.n(c);const s=require("deep-equal");var l=n.n(s),f=n(764).lW;function h(t){return function(t){if(Array.isArray(t))return v(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||y(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function d(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(t,e)||y(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t,e){if(t){if("string"==typeof t)return v(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?v(t,e):void 0}}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),j(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;j(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:L(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function g(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var b=u()(10).pow(12),w=b.mul(250),E=u()(10).pow(19),x=2,S=64,k=/^(([a-z\d]+[-_])*[a-z\d]+\.)*([a-z\d]+[-_])*[a-z\d]+$/,O=u()(10).pow(24),j=O.div(2),I=r().createElement("span",{className:"spinner-grow spinner-grow-sm me-1",role:"status","aria-hidden":"true"}),L=function(t){var e=t.error;return r().createElement("div",{role:"alert"},r().createElement("p",null,"Something went wrong:"),r().createElement("pre",null,e.message))};function N(t){return t&&t.length>=x&&t.length<=S&&t.match(k)}var A=function(t){return Array.isArray(t)},_=function(t){return t===Object(t)&&!A(t)&&"function"!=typeof t},T=function(t){return"string"==typeof t},C=function t(e){if(_(e)){var r={};return Object.keys(e).forEach((function(n){var o;r[(o=n,o.replace(/([-_][a-z])/gi,(function(t){return t.toUpperCase().replace("-","").replace("_","")})))]=t(e[n])})),r}return A(e)?e.map((function(e){return t(e)})):e},P=function(t,e){return t&&e?t.lt(e)?t:e:t||e},B=function(t,e){return t&&e?t.gt(e)?t:e:t||e},U=function(t,e,r){if(null===t)return"???";var n=t.toFixed(),o=n.indexOf(".");if(e=e||6,r=r||7,o>0){var i=Math.min(e,Math.max(r-o,0));i>0&&(i+=1),o+i=0;a-=3)n=n.slice(0,a+1)+","+n.slice(a+1);return"0.000000"===n&&6===e&&7===r?"<0.000001":n},F=function(t){return t?t.eq(1)?r().createElement(r().Fragment,null,"1 ",r().createElement("span",{className:"text-secondary"},"yoctoNEAR")):r().createElement(r().Fragment,null,U(t.div(O))," ",r().createElement("span",{className:"text-secondary"},"NEAR")):"???"},R=function(t){return t?r().createElement(r().Fragment,null,U(t.div(b))," ",r().createElement("span",{className:"text-secondary"},"TGas")):"???"},M=function(t){return t.toLocaleString("en-us",{day:"numeric",month:"short",year:"numeric"})},G=function(t){return t.toLocaleString()},q=function(t){if(t&&!t.loading&&t.state){var e=u()(t.state.amount).sub(u()(t.state.storage_usage).mul(u()(E)));if(e.gt(j))return e.sub(j)}return u()(0)},D=function(t){return t?new Date(t).toISOString().substring(0,10):""},J=function(){var t,e=(t=m().mark((function t(e){var r;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch("https://ipfs.near.social/add",{method:"POST",headers:{Accept:"application/json"},body:e});case 2:return r=t.sent,t.next=5,r.json();case 5:return t.abrupt("return",t.sent.cid);case 6:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){g(i,n,o,a,c,"next",t)}function c(t){g(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(t){return e.apply(this,arguments)}}(),$=function(t){return"https://ipfs.near.social/ipfs/".concat(t)},z=function t(e,r){return _(e)?Object.entries(e).reduce((function(e,n){var o=d(n,2),i=o[0],a=o[1],c=_(r)?r[i]:void 0;return e+(void 0!==c?t(a,c):2*i.length+t(a,void 0)+140)}),_(r)?0:98):((null==e?void 0:e.length)||8)-(T(r)?r.length:0)},K=function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.entries(e).map((function(e){var n=d(e,2),o=n[0],i=n[1];return _(i)?t(i,"".concat(r).concat(o,"/")):"".concat(r).concat(o)})).flat()},Y=function t(e,r){var n=Object.entries(e).reduce((function(e,n){var o=d(n,2),i=o[0],a=o[1],c=_(r)?r[i]:void 0;if(_(a)){var u=_(c)?t(a,c):a;void 0!==u&&(e[i]=u)}else a!==c&&(e[i]=a);return e}),{});return Object.keys(n).length?n:void 0},V=function(t){return T(t)||null===t?t:JSON.stringify(t)},X=function t(e){return _(e)?Object.entries(e).reduce((function(e,r){var n=d(r,2),o=n[0],i=n[1];return e[V(o)]=t(i),e}),{}):V(e)},W=function t(e,r){var n=r[0],o="**"===n;return o?1===r.length:("*"===n||o?Object.values(e):n in e?[e[n]]:[]).some((function(e){return _(e)?r.length>1?t(e,r.slice(1)):void 0!==e[""]:1===r.length}))},H=function t(e,r){var n=r[0];return("*"===n?Object.values(e):n in e?[e[n]]:[]).some((function(e){return 1===r.length||_(e)&&t(e,r.slice(1))}))},Z=function(t,e,r){var n=e.split("/");return"get"===t?W(r,n):"keys"===t&&H(r,n)},Q=function(t,e,r){return Object.values(r).some((function(r){var n,o=null==r||null===(n=r.index)||void 0===n?void 0:n[t];try{return o&&JSON.stringify(JSON.parse(o).key)===JSON.stringify(e)}catch(t){return!1}}))},tt={graph:!0,post:!0,index:!0,settings:!0},et=function(t,e){var r=_(t)?JSON.parse(JSON.stringify(t)):{};return _(e)&&Object.entries(e).forEach((function(t){var e=d(t,2),n=e[0],o=e[1];if(n in tt)if(_(o)){var i=r[n]=r[n]||{};Object.keys(o).forEach((function(t){i[t]=!0}))}else r[n]=!0;else r[n]=!0})),r},rt=function t(e){return Object.keys(e).forEach((function(r){(function(t,e){return!!Object.getOwnPropertyDescriptor(t,e).get})(e,r)||"object"!==p(e[r])||Object.isFrozen(e[r])||t(e[r])})),Object.freeze(e)},nt="$$typeof",ot=function(t){return null!==t&&"object"===p(t)&&!!t[nt]},it=function t(e){return Array.isArray(e)?e.map((function(e){return t(e)})):e instanceof Map?new Map(h(e.entries()).map((function(e){var r=d(e,2),n=r[0],o=r[1];return[t(n),t(o)]}))):e instanceof Set?new Set(h(e).map((function(e){return t(e)}))):f.isBuffer(e)?f.from(e):e instanceof URL?new URL(e):e instanceof File?new File([e],e.name,{type:e.type}):e instanceof Blob?new Blob([e],{type:e.type}):e instanceof Uint8Array||e instanceof ArrayBuffer?e.slice(0):_(e)?ot(e)?e:Object.fromEntries(Object.entries(e).map((function(e){var r=d(e,2),n=r[0],o=r[1];return[n,t(o)]}))):void 0===e||"function"==typeof e?e:JSON.parse(JSON.stringify(e))},at=l(),ct=n(764).lW;function ut(t){return ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ut(t)}function st(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return lt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?lt(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function ht(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function pt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){ht(i,n,o,a,c,"next",t)}function c(t){ht(i,n,o,a,c,"throw",t)}a(void 0)}))}}var dt={networkId:"testnet",nodeUrl:"https://rpc.testnet.near.org",archivalNodeUrl:"https://rpc.testnet.internal.near.org",contractName:"v1.social08.testnet",walletUrl:"https://wallet.testnet.near.org",wrapNearAccountId:"wrap.testnet",apiUrl:null,enableWeb4FastRpc:!1},yt={networkId:"mainnet",nodeUrl:"https://rpc.mainnet.near.org",archivalNodeUrl:"https://rpc.mainnet.internal.near.org",contractName:"social.near",walletUrl:"https://wallet.near.org",wrapNearAccountId:"wrap.near",apiUrl:"https://api.near.social",enableWeb4FastRpc:!1},vt={get:!0,keys:!0},mt=function(){var t=pt(ft().mark((function t(e,r,n,o,i){return ft().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.apiUrl&&r in vt){t.next=2;break}return t.abrupt("return",i());case 2:return n=n||{},o&&(n.blockHeight=o),t.prev=4,t.next=7,fetch("".concat(e.apiUrl,"/").concat(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});case 7:return t.next=9,t.sent.json();case 9:return t.abrupt("return",t.sent);case 12:return t.prev=12,t.t0=t.catch(4),console.log("API call failed",r,n),console.error(t.t0),t.abrupt("return",i());case 17:case"end":return t.stop()}}),t,null,[[4,12]])})));return function(e,r,n,o,i){return t.apply(this,arguments)}}();function gt(t,e,r,n,o,i){return bt.apply(this,arguments)}function bt(){return(bt=pt(ft().mark((function t(e,r,n,o,i,a){var c;return ft().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.selector;case 3:return t.next=5,t.sent.wallet();case 5:return c=t.sent,t.next=8,c.signAndSendTransaction({receiverId:r,actions:[{type:"FunctionCall",params:{methodName:n,args:o,gas:null!=i?i:b.mul(30).toFixed(0),deposit:null!=a?a:"0"}}]});case 8:return t.abrupt("return",t.sent);case 11:throw t.prev=11,t.t0=t.catch(0),t.t0;case 14:case"end":return t.stop()}}),t,null,[[0,11]])})))).apply(this,arguments)}function wt(t,e){return Et.apply(this,arguments)}function Et(){return(Et=pt(ft().mark((function t(e,r){var n;return ft().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new a.Account(e.nearConnection.connection,r),t.next=3,n.state();case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function xt(t,e){return St.apply(this,arguments)}function St(){return(St=pt(ft().mark((function t(e,r){var n,o,i;return ft().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.selector;case 3:return t.next=5,t.sent.wallet();case 5:return n=t.sent,o=[],i=u()(0),r.forEach((function(t){var e,r=t.contractName,n=t.methodName,a=t.args,c=t.gas,u=t.deposit,s=i.add(c),l={type:"FunctionCall",params:{methodName:n,args:a,gas:c.toFixed(0),deposit:u.toFixed(0)}};(null===(e=o[o.length-1])||void 0===e?void 0:e.receiverId)!==r||s.gt(w)?(o.push({receiverId:r,actions:[]}),i=c):i=s,o[o.length-1].actions.push(l)})),t.next=11,n.signAndSendTransactions({transactions:o});case 11:return t.abrupt("return",t.sent);case 14:throw t.prev=14,t.t0=t.catch(0),t.t0;case 17:case"end":return t.stop()}}),t,null,[[0,14]])})))).apply(this,arguments)}function kt(t,e,r){var n=r.viewMethods,o=void 0===n?[]:n,i=r.changeMethods,a=void 0===i?[]:i,c={near:t,contractId:e};return o.forEach((function(r){c[r]=function(n){return t.viewCall(e,r,n)}})),a.forEach((function(r){c[r]=function(n,o,i){return t.functionCall(e,r,n,o,i)}})),c}function Ot(t,e,r,n,o,i){return jt.apply(this,arguments)}function jt(){return(jt=pt(ft().mark((function t(e,r,n,o,i,a){var c;return ft().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=i||{},t.next=3,e.query({request_type:"call_function",account_id:n,method_name:o,args_base64:ct.from(JSON.stringify(i)).toString("base64"),block_id:r,finality:a});case 3:return c=t.sent,t.abrupt("return",c.result&&c.result.length>0&&JSON.parse(ct.from(c.result).toString()));case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function It(t,e,r,n){return Lt.apply(this,arguments)}function Lt(){return(Lt=pt(ft().mark((function t(e,r,n,o){var i;return ft().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=n||{},i=new URL("https://rpc.web4.near.page/account/".concat(e,"/view/").concat(r)),Object.entries(n).forEach((function(t){var e=st(t,2),r=e[0],n=e[1];void 0!==n&&i.searchParams.append("".concat(r,".json"),JSON.stringify(n))})),t.prev=3,t.next=6,fetch(i.toString());case 6:return t.next=8,t.sent.json();case 8:return t.abrupt("return",t.sent);case 11:return t.prev=11,t.t0=t.catch(3),console.log("Web4 view call failed",i.toString()),console.error(t.t0),t.abrupt("return",o());case 16:case"end":return t.stop()}}),t,null,[[3,11]])})))).apply(this,arguments)}function Nt(){return Nt=pt(ft().mark((function t(){var e,r,n,o,i,c,u,s,l,f=arguments;return ft().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=(r=f.length>0&&void 0!==f[0]?f[0]:{}).networkId,o=r.config,i=r.keyStore,c=r.selector,o||(o={},n||(o.networkId="mainnet")),n&&!o.networkId&&(o.networkId=n),"mainnet"===o.networkId?o=Object.assign({},o,yt):"testnet"===o.networkId&&(o=Object.assign({},o,dt)),i=null!==(e=i)&&void 0!==e?e:new a.keyStores.BrowserLocalStorageKeyStore,t.next=7,a.connect(Object.assign({deps:{keyStore:i}},o));case 7:return u=t.sent,(s={config:o,selector:c,keyStore:i,nearConnection:u}).nearArchivalConnection=a.Connection.fromConfig({networkId:o.networkId,provider:{type:"JsonRpcProvider",args:{url:o.archivalNodeUrl}},signer:{type:"InMemorySigner",keyStore:i}}),l=function(t){return"optimistic"===t||"final"===t?{finality:t,blockId:void 0}:null!=t?{finality:void 0,blockId:parseInt(t)}:{finality:"optimistic",blockId:void 0}},s.viewCall=function(t,e,r,n){var i=l(n),a=i.blockId,c=i.finality,u=function(){return Ot(a?s.nearArchivalConnection.provider:s.nearConnection.connection.provider,null!=a?a:void 0,t,e,r,c)},f=function(){return"optimistic"===c&&o.enableWeb4FastRpc?It(t,e,r,u):u()};return t!==o.contractName||!a&&"final"!==c?f():mt(o,e,r,a,f)},s.block=function(t){var e=l(t);return(e.blockId?s.nearArchivalConnection.provider:s.nearConnection.connection.provider).block(e)},s.functionCall=function(t,e,r,n,o){return gt(s,t,e,r,n,o)},s.sendTransactions=function(t){return xt(s,t)},s.contract=kt(s,o.contractName,{viewMethods:["storage_balance_of","get","get_num_accounts","get_accounts_paged","is_write_permission_granted","keys"],changeMethods:["set","grant_write_permission","storage_deposit","storage_withdraw"]}),s.accountState=function(t){return wt(s,t)},t.abrupt("return",s);case 18:case"end":return t.stop()}}),t)}))),Nt.apply(this,arguments)}var At=(0,i.singletonHook)({},(function(){var t=st((0,e.useState)(null),2),r=t[0],n=t[1];return{nearPromise:r,initNear:(0,e.useMemo)((function(){return function(t){return n(function(){return Nt.apply(this,arguments)}(t))}}),[])}})),_t=(0,i.singletonHook)(null,(function(){var t=st((0,e.useState)(null),2),r=t[0],n=t[1],o=At().nearPromise;return(0,e.useEffect)((function(){o&&o.then(n)}),[o]),r}));const Tt=require("local-storage");var Ct,Pt,Bt,Ut,Ft=n.n(Tt);function Rt(t){return Rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rt(t)}function Mt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Gt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Gt(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Dt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Jt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Dt(i,n,o,a,c,"next",t)}function c(t){Dt(i,n,o,a,c,"throw",t)}a(void 0)}))}}var $t="near-social-vm:v01:",zt=$t+":accountId:",Kt=$t+":pretendAccountId:",Yt={loading:!0,signedAccountId:null!==(Ct=Ft().get(zt))&&void 0!==Ct?Ct:void 0,pretendAccountId:null!==(Pt=Ft().get(Kt))&&void 0!==Pt?Pt:void 0,accountId:null!==(Bt=null!==(Ut=Ft().get(Kt))&&void 0!==Ut?Ut:Ft().get(zt))&&void 0!==Bt?Bt:void 0,state:null,near:null};function Vt(t,e){return Xt.apply(this,arguments)}function Xt(){return(Xt=Jt(qt().mark((function t(e,r){var n,o,i,c,u,s,l,f,h,p,d;return qt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.connectedContractId=null===(n=r)||void 0===n||null===(o=n.contract)||void 0===o?void 0:o.contractId,!e.connectedContractId||e.connectedContractId===e.config.contractName){t.next=12;break}return t.next=4,e.selector;case 4:return l=t.sent,t.next=7,l.wallet();case 7:return f=t.sent,t.next=10,f.signOut();case 10:e.connectedContractId=null,r=l.store.getState();case 12:if(e.accountId=null!==(i=null===(c=r)||void 0===c||null===(u=c.accounts)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.accountId)&&void 0!==i?i:null,e.accountId){e.publicKey=null;try{"here-wallet"===(null===(h=r)||void 0===h?void 0:h.selectedWalletId)&&(p=Ft().get("herewallet:keystore"),e.publicKey=a.KeyPair.fromString(p[e.config.networkId].accounts[e.accountId]).getPublicKey())}catch(t){console.error(t)}if(!e.publicKey)try{e.publicKey=a.KeyPair.fromString(Ft().get("meteor-wallet"===(null===(d=r)||void 0===d?void 0:d.selectedWalletId)?"_meteor_wallet".concat(e.accountId,":").concat(e.config.networkId):"near-api-js:keystore:".concat(e.accountId,":").concat(e.config.networkId))).getPublicKey()}catch(t){console.error(t)}}case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Wt=function(){var t=Jt(qt().mark((function t(e,r){var n,o,i,a,c,u,s,l;return qt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((o=e.accountId)?Ft().set(zt,o):Ft().remove(zt),i=null!==(n=Ft().get(Kt))&&void 0!==n?n:void 0,a={loading:!1,signedAccountId:o,pretendAccountId:i,accountId:null!=i?i:o,state:null,near:e,refresh:function(){var t=Jt(qt().mark((function t(){return qt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Wt(e,r);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),startPretending:function(){var t=Jt(qt().mark((function t(n){return qt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n?Ft().set(Kt,n):Ft().remove(Kt),t.next=3,Wt(e,r);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},!o){t.next=13;break}return t.next=7,Promise.all([e.contract.storage_balance_of({account_id:o}),e.accountState(o)]);case 7:c=t.sent,u=Mt(c,2),s=u[0],l=u[1],a.storageBalance=s,a.state=l;case 13:r(a);case 14:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),Ht=(0,i.singletonHook)(Yt,(function(){var t=Mt((0,e.useState)(Yt),2),r=t[0],n=t[1],o=_t();return(0,e.useEffect)((function(){o&&o.selector.then((function(t){t.store.observable.subscribe(function(){var t=Jt(qt().mark((function t(e){return qt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Vt(o,e);case 2:return t.prev=2,t.next=5,Wt(o,n);case 5:t.next=10;break;case 7:t.prev=7,t.t0=t.catch(2),console.error(t.t0);case 10:case"end":return t.stop()}}),t,null,[[2,7]])})));return function(e){return t.apply(this,arguments)}}())}))}),[o]),r})),Zt=function(){return Ht().accountId};const Qt=require("acorn"),te=require("acorn-jsx");var ee=n.n(te);const re=require("react-bootstrap/Modal");var ne=n.n(re);const oe=require("remark-gfm");var ie=n.n(oe);const ae=require("react-markdown");var ce=n.n(ae);const ue=require("react-syntax-highlighter"),se=require("react-syntax-highlighter/dist/esm/styles/prism"),le=require("mdast-util-find-and-replace");var fe=/@((?:(?:[a-z\d]+[-_])*[a-z\d]+\.)*(?:[a-z\d]+[-_])*[a-z\d]+)/gi;function he(){function t(t,e,r){if(/[\w`]/.test(r.input.charAt(r.index-1))||/[/\w`]/.test(r.input.charAt(r.index+t.length))||e.length<2||e.length>64)return!1;var n={type:"text",value:t};return{type:"strong",children:[n],data:{hProperties:{accountId:e}}}}return function(e){return(0,le.findAndReplace)(e,fe,t),e}}var pe=/#(\w+)/gi;function de(){function t(t,e,r){if(/[\w`]/.test(r.input.charAt(r.index-1))||/[/\w`]/.test(r.input.charAt(r.index+t.length)))return!1;var n={type:"text",value:t};return{type:"strong",children:[n],data:{hProperties:{hashtag:e}}}}return function(e){return(0,le.findAndReplace)(e,pe,t),e}}var ye=["onLinkClick","text","onMention","onHashtag","syntaxHighlighterProps"],ve=["node","children"],me=["node"],ge=["node"],be=["node"],we=["node"],Ee=["node","inline","className","children"];function xe(){return xe=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}var ke=function(t){var e=t.onLinkClick,n=t.text,o=t.onMention,i=t.onHashtag,a=t.syntaxHighlighterProps,c=Se(t,ye);return r().createElement(ce(),xe({},c,{plugins:[],rehypePlugins:[],remarkPlugins:[ie(),he,de],children:n,components:{strong:function(t){var e,n,a,c,u=t.node,s=t.children,l=Se(t,ve);return o&&null!==(e=u.properties)&&void 0!==e&&e.accountId?o(null===(a=u.properties)||void 0===a?void 0:a.accountId):i&&null!==(n=u.properties)&&void 0!==n&&n.hashtag?i(null===(c=u.properties)||void 0===c?void 0:c.hashtag):r().createElement("strong",l,s)},a:function(t){t.node;var n=Se(t,me);return e?r().createElement("a",xe({onClick:e},n)):r().createElement("a",xe({target:"_blank"},n))},img:function(t){t.node;var e=Se(t,ge);return r().createElement("img",xe({className:"img-fluid"},e))},blockquote:function(t){t.node;var e=Se(t,be);return r().createElement("blockquote",xe({className:"blockquote"},e))},table:function(t){t.node;var e=Se(t,we);return r().createElement("table",xe({className:"table table-striped"},e))},code:function(t){t.node;var e=t.inline,n=t.className,o=t.children,i=Se(t,Ee),c=/language-(\w+)/.exec(n||""),u=null!=a?a:{},s=u.wrapLines,l=u.lineProps,f=u.showLineNumbers,h=u.lineNumberStyle;return!e&&c?r().createElement(ue.Prism,xe({children:String(o).replace(/\n$/,""),style:se.tomorrow,language:c[1],PreTag:"div",wrapLines:s,lineProps:l,showLineNumbers:f,lineNumberStyle:h},i)):r().createElement("code",xe({className:n},i),o)}}}))};const Oe=require("react-uuid");var je=n.n(Oe);function Ie(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Re(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Me(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Re(i,n,o,a,c,"next",t)}function c(t){Re(i,n,o,a,c,"throw",t)}a(void 0)}))}}var Ge=E.mul(2e3),qe=E.mul(500),De=E.mul(500),Je=E.mul(500),$e=function(){var t=Me(Fe().mark((function t(e,r){var n;return Fe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=K(r),t.next=3,e.contract.get({keys:n});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),ze=function(){var t=Me(Fe().mark((function t(e,r,n,o){var i,a,c,s,l,f,h,p,d,y;return Fe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.selector;case 2:if(i=e.accountId){t.next=6;break}return alert("You're not logged in. Sign in to commit data."),t.abrupt("return");case 6:return t.next=8,Promise.all([e.viewCall(e.config.contractName,"storage_balance_of",{account_id:i}),i!==r?e.viewCall(e.config.contractName,"is_write_permission_granted",{predecessor_id:i,key:r}):e.publicKey?e.viewCall(e.config.contractName,"is_write_permission_granted",{public_key:e.publicKey.toString(),key:r}):Promise.resolve(!1)]);case 8:if(a=t.sent,w=2,c=function(t){if(Array.isArray(t))return t}(b=a)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(b,w)||function(t,e){if(t){if("string"==typeof t)return Ue(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ue(t,e):void 0}}(b,w)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),s=c[0],l=c[1],f=u()((null==s?void 0:s.available)||"0"),v={},m=r,g=X(n),(m=function(t){var e=function(t,e){if("object"!==Be(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Be(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Be(e)?e:String(e)}(m))in v?Object.defineProperty(v,m,{value:g,enumerable:!0,configurable:!0,writable:!0}):v[m]=g,h=v,p={},o){t.next=20;break}return t.next=18,$e(e,h);case 18:p=t.sent,h=Y(h,p);case 20:return d=E.mul(z(h,p)).add(s?u()(0):qe).add(l?u()(0):Je).add(De),y=B(d.sub(f),l?u()(0):s?u()(1):Ge),t.abrupt("return",{originalData:n,accountId:r,storageBalance:s,availableStorage:f,currentData:p,data:h,expectedDataBalance:d,deposit:y,permissionGranted:l});case 23:case"end":return t.stop()}var v,m,g,b,w}),t)})));return function(e,r,n,o){return t.apply(this,arguments)}}(),Ke=function(){var t=Me(Fe().mark((function t(e,r,n){return Fe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return console.log("Committing data",r),t.next=3,e.contract.set({data:r},b.mul(100).toFixed(0),n.toFixed(0));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t)})));return function(e,r,n){return t.apply(this,arguments)}}(),Ye=function(){var t=Me(Fe().mark((function t(e,r,n){var o,i;return Fe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.selector;case 2:return t.next=4,t.sent.wallet();case 4:return o=t.sent,i=[],e.publicKey&&(i.push({type:"FunctionCall",params:{methodName:"grant_write_permission",args:{public_key:e.publicKey.toString(),keys:[e.accountId]},gas:b.mul(100).toFixed(0),deposit:n.gt(0)?n.toFixed(0):"1"}}),n=u()(0)),i.push({type:"FunctionCall",params:{methodName:"set",args:{data:r},gas:b.mul(100).toFixed(0),deposit:n.gt(0)?n.toFixed(0):"1"}}),t.next=10,o.signAndSendTransaction({receiverId:e.config.contractName,actions:i});case 10:return t.abrupt("return",t.sent);case 11:case"end":return t.stop()}}),t)})));return function(e,r,n){return t.apply(this,arguments)}}();const Ve=require("react-bootstrap"),Xe=require("idb");function We(t){return We="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},We(t)}function He(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Qe(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function tr(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Qe(i,n,o,a,c,"next",t)}function c(t){Qe(i,n,o,a,c,"throw",t)}a(void 0)}))}}function er(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:3e3;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.dbPromise=(0,Xe.openDB)(sr,1,{upgrade:function(t){t.createObjectStore(lr)}}),this.cache={},this.finalSynchronizationDelayMs=e}var e,r,n,o,i;return e=t,r=[{key:"invalidateCallbacks",value:function(t,e){var r;if(null!==(r=t.invalidationCallbacks)&&void 0!==r&&r.length){var n=t.invalidationCallbacks;t.invalidationCallbacks=[],setTimeout((function(){n.forEach((function(t){try{t()}catch(t){}}))}),e?this.finalSynchronizationDelayMs+50:50)}}},{key:"innerGet",value:(i=tr(Ze().mark((function t(e){return Ze().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.dbPromise;case 2:return t.abrupt("return",t.sent.get(lr,e));case 3:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"innerSet",value:(o=tr(Ze().mark((function t(e,r){return Ze().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.dbPromise;case 2:return t.abrupt("return",t.sent.put(lr,r,e));case 3:case"end":return t.stop()}}),t,this)}))),function(t,e){return o.apply(this,arguments)})},{key:"cachedPromise",value:function(t,e,r,n){var o=this;t=JSON.stringify(t);var i=this.cache[t]||{status:ir,invalidationCallbacks:[],result:null,time:(new Date).getTime()};return this.cache[t]=i,_(r)||(r={onInvalidate:r}),r.onInvalidate&&i.invalidationCallbacks.push(r.onInvalidate),!i.subscription&&r.subscribe&&function t(){i.subscription=setTimeout((function(){document.hidden?t():(i.subscription=null,i.status=ur,o.invalidateCallbacks(i,!1))}),5e3)}(),i.status===ar||i.status===cr&&i.time+3e5>(new Date).getTime()||(i.status===ir&&this.innerGet(t).then((function(t){(t||n)&&i.status===ar&&(i.result=t,i.time=(new Date).getTime(),o.invalidateCallbacks(i,!1))})),i.status=ar,e&&e().then((function(e){i.status=cr,i.time=(new Date).getTime(),JSON.stringify(e)!==JSON.stringify(i.result)&&(i.result=e,o.innerSet(t,e),o.invalidateCallbacks(i,!1))})).catch((function(e){console.error(e),i.status=cr;var r=void 0;i.time=(new Date).getTime(),JSON.stringify(r)!==JSON.stringify(i.result)&&(i.result=r,o.innerSet(t,r),o.invalidateCallbacks(i,!1))}))),i.result}},{key:"invalidateCache",value:function(t,e){var r=this,n=[],o="".concat(t.config.apiUrl,"/index");Object.keys(this.cache).forEach((function(r){var i;try{i=JSON.parse(r)}catch(t){return void console.error("Key deserialization failed",r)}if(i.action===rr&&i.contractId===t.config.contractName&&(!i.blockId||"optimistic"===i.blockId||"final"===i.blockId))try{var a;(null===(a=i.args)||void 0===a?void 0:a.keys).some((function(t){return Z(i.methodName,t,e)}))&&n.push([r,"final"===i.blockId])}catch(t){}if(i.action===nr&&i.url===o)try{var c,u=JSON.parse(null===(c=i.options)||void 0===c?void 0:c.body),s=u.action,l=u.key;s&&l&&Q(s,l,e)&&n.push([r,!0])}catch(t){}})),console.log("Cache invalidation",n),n.forEach((function(t){var e,n,o=(n=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(e,n)||function(t,e){if(t){if("string"==typeof t)return He(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?He(t,e):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=o[0],a=o[1],c=r.cache[i];c.status=ur,r.invalidateCallbacks(c,a)}))}},{key:"cachedBlock",value:function(t,e,r){return this.cachedPromise({action:"Block",blockId:e},(function(){return t.block(e)}),r)}},{key:"cachedViewCall",value:function(t,e,r,n,o,i){return this.cachedPromise({action:rr,contractId:e,methodName:r,args:n,blockId:o},(function(){return t.viewCall(e,r,n,o)}),i)}},{key:"asyncFetch",value:(n=tr(Ze().mark((function t(e,r){var n,o,i,a,c,u,s,l,f,h,p;return Ze().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=null===(n=r)||void 0===n||null===(o=n.responseType)||void 0===o?void 0:o.toLowerCase(),r={method:null===(i=r)||void 0===i?void 0:i.method,headers:null===(a=r)||void 0===a?void 0:a.headers,body:null===(c=r)||void 0===c?void 0:c.body},t.prev=2,t.next=5,fetch(e,r);case 5:if(s=t.sent,l=s.status,f=s.ok,h=s.headers.get("content-type"),!f){t.next=15;break}return t.next=12,"arraybuffer"===u?s.arrayBuffer():"blob"===u?s.blob():"formdata"===u?s.formData():"json"===u?s.json():"text"===u?s.text():h&&-1!==h.indexOf("application/json")?s.json():s.text();case 12:t.t0=t.sent,t.next=16;break;case 15:t.t0=void 0;case 16:return p=t.t0,t.abrupt("return",{ok:f,status:l,contentType:h,body:p});case 20:return t.prev=20,t.t1=t.catch(2),t.abrupt("return",{ok:!1,error:t.t1.message});case 23:case"end":return t.stop()}}),t,null,[[2,20]])}))),function(t,e){return n.apply(this,arguments)})},{key:"cachedFetch",value:function(t,e,r){var n=this;return this.cachedPromise({action:nr,url:t,options:e},(function(){return n.asyncFetch(t,e)}),r)}},{key:"cachedCustomPromise",value:function(t,e,r){return this.cachedPromise({action:"CustomPromise",key:t},(function(){return e()}),r)}},{key:"socialGet",value:function(t,e,r,n,o,i){if(!t)return null;var a={keys:e=(e=Array.isArray(e)?e:[e]).map((function(t){return r?"".concat(t,"/**"):"".concat(t)})),options:o},c=this.cachedViewCall(t,t.config.contractName,"get",a,n,i);if(null===c)return null;if(1===e.length)for(var u=e[0].split("/"),s=0;s=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function gr(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function br(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return wr(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?wr(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,yr),p=br((0,e.useState)(null),2),d=p[0],y=p[1];return r().createElement(r().Fragment,null,r().createElement("button",vr({},h,{disabled:s||!o||!!d||!n,onClick:function(t){t.preventDefault(),y("function"==typeof o?o():o),a&&a()}}),!!d&&I,i),r().createElement(kr,{show:!!d,widgetSrc:l,data:d,force:f,onHide:function(){return y(null)},onCancel:u,onCommit:c}))};require("react-bootstrap-typeahead/css/Typeahead.css"),require("react-bootstrap-typeahead/css/Typeahead.bs5.css");const jr=require("react-bootstrap-typeahead"),Ir=require("styled-components");var Lr=n.n(Ir);const Nr=require("elliptic"),Ar=require("bn.js");var _r=n.n(Ar);const Tr=require("tweetnacl");function Cr(){return Cr=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function Gr(t,e,r){return Gr=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct.bind():function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&qr(o,r.prototype),o},Gr.apply(null,arguments)}function qr(t,e){return qr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},qr(t,e)}function Dr(){return Dr=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r0?(l[f]={uploading:!0,cid:null},n.vm.setReactState(n.vm.state.state),J(t[0]).then((function(t){if(n.vm.alive){var e=n.vm.vmStack.resolveMemberExpression(i.expression,{requireState:!0,left:!0});e.obj[e.key]={cid:t},n.vm.setReactState(n.vm.state.state)}}))):(l[f]=null,n.vm.setReactState(n.vm.state.state))}}}else{var h=n.resolveMemberExpression(i.expression,{requireState:!0,left:!0}),p=h.obj,d=h.key;c.value=(null==p?void 0:p[d])||"",c.onChange=function(t){t.preventDefault(),p[d]=t.target.value,n.vm.setReactState(n.vm.state.state)}}})),c.key=null!==(e=c.key)&&void 0!==e?e:"".concat(this.vm.widgetSrc,"-").concat(o,"-").concat(this.vm.gIndex),delete c.dangerouslySetInnerHTML;var l,f=(null==a?void 0:a.target)||o;if(c.as&&!cn[c.as]&&delete c.as,c.forwardedAs&&!cn[c.forwardedAs]&&delete c.forwardedAs,"img"===f?c.alt=null!==(l=c.alt)&&void 0!==l?l:"not defined":"a"===f?"href"in c&&(c.href=(0,Te.sanitizeUrl)(c.href)):"Widget"===o&&(c.depth=this.vm.depth+1,c.config=[c.config].concat(Jr(this.vm.widgetConfigs)).filter(Boolean)),!1===i&&t.children.length)throw new Error("And element '"+o+"' contains children, but shouldn't");var h,p,d,y,v=t.children.map((function(t,e){return n.vm.gIndex=e,n.executeExpression(t)}));if("Widget"===o)return r().createElement(_n,c);if("CommitButton"===o)return r().createElement(Or,Dr({},c,{widgetSrc:this.vm.widgetSrc}),v);if("InfiniteScroll"===o)return r().createElement(Pe(),c,v);if("Tooltip"===o)return r().createElement(Ve.Tooltip,c,v);if("OverlayTrigger"===o)return r().createElement(Ve.OverlayTrigger,c,v.filter((function(t){return!T(t)||!!t.trim()}))[0]);if("Typeahead"===o)return r().createElement(jr.Typeahead,c);if("Markdown"===o)return r().createElement(ke,c);if("Fragment"===o)return r().createElement(r().Fragment,c,v);if("IpfsImageUpload"===o)return r().createElement("div",{className:"d-inline-block",key:c.key},(null===(h=u.img)||void 0===h?void 0:h.cid)&&r().createElement("div",{className:"d-inline-block me-2 overflow-hidden align-middle",style:{width:"2.5em",height:"2.5em"}},r().createElement("img",{className:"rounded w-100 h-100",style:{objectFit:"cover"},src:$(null===(p=u.img)||void 0===p?void 0:p.cid),alt:"upload preview"})),r().createElement(_e(),Dr({multiple:!1,accepts:["image/*"],minFileSize:1,clickable:!0},c),null!==(d=u.img)&&void 0!==d&&d.uploading?r().createElement(r().Fragment,null,I," Uploading"):null!==(y=u.img)&&void 0!==y&&y.cid?"Replace":"Upload an Image"));if("Files"===o)return r().createElement(_e(),c,v);if("iframe"===o)return r().createElement(Ur,c);if(a)return r().createElement.apply(r(),[a,Zr({},c)].concat(Jr(v)));if(!0===i)return r().createElement.apply(r(),[o,Zr({},c)].concat(Jr(v)));if(!1===i)return r().createElement(o,Zr({},c));throw new Error("Unsupported element: "+o)}},{key:"resolveKey",value:function(t,e){var r=e||"Identifier"!==t.type?this.executeExpression(t):t.name;return fn(r),r}},{key:"callFunction",value:function(t,e,r,n,o){var i=this,a=sn[t];if(!0===a||void 0===a){if("Social"===t&&"getr"===e||"socialGetr"===e){if(r.length<1)throw new Error("Missing argument 'keys' for Social.getr");return this.vm.cachedSocialGet(r[0],!0,r[1],r[2])}if("Social"===t&&"get"===e||"socialGet"===e){if(r.length<1)throw new Error("Missing argument 'keys' for Social.get");return this.vm.cachedSocialGet(r[0],!1,r[1],r[2])}if("Social"===t&&"keys"===e){if(r.length<1)throw new Error("Missing argument 'keys' for Social.keys");return this.vm.cachedSocialKeys(r[0],r[1],r[2])}if("Social"===t&&"index"===e){if(r.length<2)throw new Error("Missing argument 'action' and 'key` for Social.index");return this.vm.cachedIndex(r[0],r[1],r[2])}if("Social"===t&&"set"===e){if(r.length<1)throw new Error("Missing argument 'data' for Social.set");return this.vm.socialSet(r[0],r[1])}if("Near"===t&&"view"===e){if(r.length<2)throw new Error("Method: Near.view. Required arguments: 'contractName', 'methodName'. Optional: 'args', 'blockId/finality', 'subscribe'");var c=Yr(r,5),u=c[0],s=c[1],l=c[2],f=c[3],h=c[4];return this.vm.cachedNearView(u,s,l,f,dn(h,f))}if("Near"===t&&"asyncView"===e){var p;if(r.length<2)throw new Error("Method: Near.asyncView. Required arguments: 'contractName', 'methodName'. Optional: 'args', 'blockId/finality'");return(p=this.vm).asyncNearView.apply(p,Jr(r))}if("Near"===t&&"block"===e){var d=Yr(r,2),y=d[0],v=d[1];return this.vm.cachedNearBlock(y,dn(v,y))}if("Near"===t&&"call"===e){if(1===r.length){if(_(r[0]))return this.vm.confirmTransactions([r[0]]);if(A(r[0]))return this.vm.confirmTransactions(r[0]);throw new Error("Method: Near.call. Required argument: 'tx/txs'. A single argument call requires an TX object or an array of TX objects.")}var m;if(r.length<2||r.length>5)throw new Error("Method: Near.call. Required argument: 'contractName'. If the first argument is a string: 'methodName'. Optional: 'args', 'gas' (defaults to 300Tg), 'deposit' (defaults to 0)");return this.vm.confirmTransactions([{contractName:r[0],methodName:r[1],args:null!==(m=r[2])&&void 0!==m?m:{},gas:r[3],deposit:r[4]}])}if("fetch"===e){var g;if(r.length<1)throw new Error("Method: fetch. Required arguments: 'url'. Optional: 'options'");return(g=this.vm).cachedFetch.apply(g,Jr(r))}if("asyncFetch"===e){var b;if(r.length<1)throw new Error("Method: asyncFetch. Required arguments: 'url'. Optional: 'options'");return(b=this.vm).asyncFetch.apply(b,Jr(r))}if("useCache"===e){var w;if(r.length<2)throw new Error("Method: useCache. Required arguments: 'promiseGenerator', 'dataKey'. Optional: 'options'");if(!(r[0]instanceof Function))throw new Error("Method: useCache. The first argument 'promiseGenerator' must be a function");return(w=this.vm).useCache.apply(w,Jr(r))}if("parseInt"===e)return parseInt.apply(void 0,Jr(r));if("parseFloat"===e)return parseFloat.apply(void 0,Jr(r));if("isNaN"===e)return isNaN.apply(void 0,Jr(r));if("setTimeout"===e){var E=Yr(r,2),x=E[0],S=E[1],k=setTimeout((function(){i.vm.alive&&x()}),S);return this.vm.timeouts.add(k),k}if("setInterval"===e){if(this.vm.intervals.size>=16)throw new Error("Too many intervals. Max allowed: ".concat(16));var O=Yr(r,2),j=O[0],I=O[1],L=setInterval((function(){i.vm.alive&&j()}),I);return this.vm.intervals.add(L),L}if("clearTimeout"===e){var N=r[0];return this.vm.timeouts.delete(N),clearTimeout(N)}if("clearInterval"===e){var T=r[0];return this.vm.intervals.delete(T),clearInterval(T)}if("JSON"===t&&"stringify"===e||"stringify"===e){if(r.length<1)throw new Error("Missing argument 'obj' for JSON.stringify");return hn(r[0]),JSON.stringify(r[0],r[1],r[2])}if("JSON"===t&&"parse"===e){if(r.length<1)throw new Error("Missing argument 's' for JSON.parse");try{var C=JSON.parse(r[0]);return pn(C),C}catch(t){return null}}else if("Object"===t){if("keys"===e){if(r.length<1)throw new Error("Missing argument 'obj' for Object.keys");return hn(r[0]),Object.keys(r[0])}if("values"===e){if(r.length<1)throw new Error("Missing argument 'obj' for Object.values");return hn(r[0]),Object.values(r[0])}if("entries"===e){if(r.length<1)throw new Error("Missing argument 'obj' for Object.entries");return hn(r[0]),Object.entries(r[0])}if("assign"===e){r.forEach((function(t){return hn(t)}));var P=Object.assign.apply(Object,Jr(r));return pn(P),P}if("fromEntries"===e){var B=Object.fromEntries(r[0]);return pn(B),B}}else{if("State"===t&&"init"===e||"initState"===e){if(r.length<1)throw new Error("Missing argument 'initialState' for State.init");if(null===r[0]||"object"!==Wr(r[0])||ot(r[0]))throw new Error("'initialState' is not an object");if(void 0===this.vm.state.state){var U=r[0];this.vm.state.state=U,this.vm.setReactState(U)}return this.vm.state.state}if("State"===t&&"update"===e){var F;if(_(r[0]))this.vm.state.state=null!==(F=this.vm.state.state)&&void 0!==F?F:{},Object.assign(this.vm.state.state,it(r[0]));else if(r[0]instanceof Function){var R;this.vm.state.state=null!==(R=this.vm.state.state)&&void 0!==R?R:{},this.vm.state.state=r[0](this.vm.state.state)}if(void 0===this.vm.state.state)throw new Error("The state was not initialized");return this.vm.setReactState(this.vm.state.state),this.vm.state.state}if("Storage"===t&&"privateSet"===e){if(r.length<2)throw new Error("Missing argument 'key' or 'value' for Storage.privateSet");return this.vm.storageSet({src:this.vm.widgetSrc,type:on},r[0],r[1])}if("Storage"===t&&"privateGet"===e){if(r.length<1)throw new Error("Missing argument 'key' for Storage.privateGet");return this.vm.storageGet({src:this.vm.widgetSrc,type:on},r[0])}if("Storage"===t&&"set"===e){if(r.length<2)throw new Error("Missing argument 'key' or 'value' for Storage.set");return this.vm.storageSet({src:this.vm.widgetSrc,type:an},r[0],r[1])}if("Storage"===t&&"get"===e){var M;if(r.length<1)throw new Error("Missing argument 'key' for Storage.get");return this.vm.storageGet({src:null!==(M=r[1])&&void 0!==M?M:this.vm.widgetSrc,type:an},r[0])}var G,q;if("console"===t&&"log"===e)return(G=console).log.apply(G,[this.vm.widgetSrc].concat(Jr(r)));if("clipboard"===t&&"writeText"===e)return this.isTrusted?(q=navigator.clipboard).writeText.apply(q,Jr(r)):Promise.reject(new Error("Not trusted (not a click)"))}}else{var D=e===t?a:a[e];if("function"==typeof D)return o?Gr(D,Jr(r)):D.apply(void 0,Jr(r))}if(!n)throw new Error(t&&t!==e?"Unsupported callee method '".concat(t,".").concat(e,"'"):"Unsupported callee method '".concat(e,"'"))}},{key:"resolveMemberExpression",value:function(t,e){if("Identifier"===t.type){var r,n=t.name;if(fn(n),null!=e&&e.requireState&&n!==nn)throw new Error("The top object should be ".concat(nn));var o=null!==(r=this.stack.findObj(n))&&void 0!==r?r:this.stack.state;if(hn(o),o===this.stack.state&&n in sn){if(null!=e&&e.left)throw new Error("Cannot assign to keyword '"+n+"'");return{obj:o,key:n,keyword:n}}if(null!=e&&e.left&&(!o||!(n in o)))throw new Error("Accessing undeclared identifier '".concat(t.name,"'"));return{obj:o,key:n}}if("MemberExpression"===t.type){var i;if("Identifier"===(null===(i=t.object)||void 0===i?void 0:i.type)){var a=t.object.name;if(a in sn){if(null==e||!e.callee)throw new Error("Cannot dereference keyword '"+a+"' in non-call expression");return{obj:this.stack.state,key:this.resolveKey(t.property,t.computed),keyword:a}}}var c=this.executeExpression(t.object);return hn(c),{obj:c,key:this.resolveKey(t.property,t.computed)}}throw new Error("Unsupported member type: '"+t.type+"'")}},{key:"getArray",value:function(t){var e=this,r=[];return t.forEach((function(t){"SpreadElement"===t.type?r.push.apply(r,Jr(e.executeExpression(t.argument))):r.push(e.executeExpression(t))})),r}},{key:"executeExpressionInternal",value:function(t){var e=this;if(!t)return null;var r=null==t?void 0:t.type;if("AssignmentExpression"===r){var n,o=this.resolveMemberExpression(t.left,{left:!0}),i=o.obj,a=o.key,c=this.executeExpression(t.right);if("="===t.operator)return i[a]=c;if("+="===t.operator)return i[a]+=c;if("-="===t.operator)return i[a]-=c;if("*="===t.operator)return i[a]*=c;if("/="===t.operator)return i[a]/=c;if("??="===t.operator)return null!==(n=i[a])&&void 0!==n?n:i[a]=c;throw new Error("Unknown AssignmentExpression operator '"+t.operator+"'")}if("ChainExpression"===r)return this.executeExpression(t.expression);if("MemberExpression"===r){var u=this.resolveMemberExpression(t),s=u.obj,l=u.key;return null==s?void 0:s[l]}if("Identifier"===r)return this.stack.get(t.name);if("JSXExpressionContainer"===r)return this.executeExpression(t.expression);if("TemplateLiteral"===r){for(var f=[],h=0;h"===t.operator)return w>E;if("<="===t.operator)return w<=E;if(">="===t.operator)return w>=E;if("==="===t.operator||"=="===t.operator)return w===E;if("!=="===t.operator||"!="===t.operator)return w!==E;if("in"===t.operator)return w in E;throw new Error("Unknown BinaryExpression operator '"+t.operator+"'")}if("UnaryExpression"===r){if("delete"===t.operator){var x=this.resolveMemberExpression(t.argument,{left:!0}),S=x.obj,k=x.key;return null==S||delete S[k]}var O=this.executeExpression(t.argument);if("-"===t.operator)return-O;if("!"===t.operator)return!O;if("typeof"===t.operator)return Wr(O);throw new Error("Unknown UnaryExpression operator '"+t.operator+"'")}if("LogicalExpression"===r){var j=this.executeExpression(t.left);if("||"===t.operator)return j||this.executeExpression(t.right);if("&&"===t.operator)return j&&this.executeExpression(t.right);if("??"===t.operator)return null!=j?j:this.executeExpression(t.right);throw new Error("Unknown LogicalExpression operator '"+t.operator+"'")}if("ConditionalExpression"===r)return this.executeExpression(t.test)?this.executeExpression(t.consequent):this.executeExpression(t.alternate);if("UpdateExpression"===r){var I=this.resolveMemberExpression(t.argument,{left:!0}),L=I.obj,N=I.key;if("++"===t.operator)return t.prefix?++L[N]:L[N]++;if("--"===t.operator)return t.prefix?--L[N]:L[N]--;throw new Error("Unknown UpdateExpression operator '"+t.operator+"'")}if("ObjectExpression"===r)return t.properties.reduce((function(t,r){if("Property"===r.type)t[e.resolveKey(r.key,r.computed)]=e.executeExpression(r.value);else{if("SpreadElement"!==r.type)throw new Error("Unknown property type: "+r.type);var n=e.executeExpression(r.argument);hn(n),Object.assign(t,n)}return t}),{});if("ArrayExpression"===r)return this.getArray(t.elements);if("JSXEmptyExpression"===r)return null;if("ArrowFunctionExpression"===r)return this.createFunction(t.params,t.body,t.expression);if("TaggedTemplateExpression"===r){var A,_;if("MemberExpression"!==t.tag.type&&"CallExpression"!==t.tag.type)throw new Error("TaggedTemplateExpression is only supported for `styled` components");var T=this.resolveMemberExpression("MemberExpression"===t.tag.type?t.tag:t.tag.callee,{callee:!0}),C=T.key;if("styled"!==T.keyword)throw new Error("TaggedTemplateExpression is only supported for `styled` components");if("CallExpression"===t.tag.type){var P=this.getArray(t.tag.arguments),B=null==P?void 0:P[0];if(!(0,Ir.isStyledComponent)(B))throw new Error("styled() can only take `styled` components");A=Lr()(B)}else{if("keyframes"===C)A=Ir.keyframes;else{if(!(C in cn))throw new Error("Unsupported styled tag: "+C);A=Lr()(C)}_=C}if("TemplateLiteral"!==t.quasi.type)throw new Error("Unknown quasi type: "+t.quasi.type);var U=t.quasi.quasis.map((function(t){if("TemplateElement"!==t.type)throw new Error("Unknown quasis type: "+t.type);return t.value.cooked})),F=0===t.quasi.expressions.length&&"CallExpression"!==t.tag.type,R=JSON.stringify([_].concat(Jr(U)));if(F&&this.vm.cachedStyledComponents.has(R))return this.vm.cachedStyledComponents.get(R);var M=t.quasi.expressions.map((function(t){return e.executeExpression(t)}));if(A instanceof Function){var G=A.apply(void 0,[U].concat(Jr(M)));return F&&this.vm.cachedStyledComponents.set(R,G),G}throw new Error("styled error")}throw new Error("Unknown expression type '"+r+"'")}},{key:"createFunction",value:function(t,e,r){var n=this;return t=t.map(mn),function(){for(var o,i,a,c=arguments.length,u=new Array(c),s=0;s0&&(!t.test||a.executeExpression(t.test));){var c=a.executeStatement(t.body);if(c){if(c.break)break;if(!c.continue)return c}a.executeExpression(t.update)}if(this.vm.loopLimit<=0)throw new Error("Exceeded loop limit")}else if("ForOfStatement"===t.type){var u=this.newStack(),s=u.executeExpression(t.right);hn(s);var l,f=Mr(s);try{var h=function(){var r=l.value;if(e.vm.loopLimit--<=0)throw new Error("Exceeded loop limit");if("VariableDeclaration"===t.left.type){if(1!==t.left.declarations.length)throw new Error("Invalid for-of statement");t.left.declarations.forEach((function(t){if("VariableDeclarator"!==t.type)throw new Error("Unknown variable declaration type '"+t.type+"'");e.stackDeclare(mn(t.id),r)}))}else{var n=e.resolveMemberExpression(t.left,{left:!0});n.obj[n.key]=r}var o=u.executeStatement(t.body);if(o){if(o.break)return"break";if(!o.continue)return{v:o}}};for(f.s();!(l=f.n()).done;){var p=h();if("break"===p)break;if("object"===Wr(p))return p.v}}catch(t){f.e(t)}finally{f.f()}}else if("WhileStatement"===t.type){for(var d=this.newStack();this.vm.loopLimit-- >0&&d.executeExpression(t.test);){var y=d.executeStatement(t.body);if(y){if(y.break)break;if(!y.continue)return y}}if(this.vm.loopLimit<=0)throw new Error("Exceeded loop limit")}else if("IfStatement"===t.type){var v=this.executeExpression(t.test),m=this.newStack(),g=v?m.executeStatement(t.consequent):m.executeStatement(t.alternate);if(g)return g}else{if("BreakStatement"===t.type)return{break:!0};if("ContinueStatement"===t.type)return{continue:!0};if("ThrowStatement"===t.type)throw this.executeExpression(t.argument);if("TryStatement"===t.type)try{var b=this.newStack().executeStatement(t.block);if(b)return b}catch(e){if(!this.vm.alive||!t.handler)return null;if("CatchClause"!==t.handler.type)throw new Error("Unknown try statement handler type '"+t.handler.type+"'");var w=this.newStack();t.handler.param&&w.stackDeclare(yn(t.handler.param),it(e instanceof Error?{name:null==e?void 0:e.name,message:null==e?void 0:e.message,toString:function(){return e.toString()}}:e));var E=w.executeStatement(t.handler.body);if(E)return E}finally{this.vm.alive&&this.newStack().executeStatement(t.finalizer)}else{if("SwitchStatement"!==t.type)throw new Error("Unknown token type '"+t.type+"'");var x,S=this.executeExpression(t.discriminant),k=this.newStack(),O=!1,j=Mr(t.cases);try{for(j.s();!(x=j.n()).done;){var I=x.value;if("SwitchCase"!==I.type)throw new Error("Unknown switch case type '"+I.type+"'");if(!O&&I.test){if(k.executeExpression(I.test)!==S)continue;O=!0}if(O){var L,N=!1,A=Mr(I.consequent);try{for(A.s();!(L=A.n()).done;){var _=L.value,T=k.executeStatement(_);if(T){if(T.break){N=!0;break}return T}}}catch(t){A.e(t)}finally{A.f()}if(N)break}}}catch(t){j.e(t)}finally{j.f()}}}}return null}}]),t}(),wn=function(){function t(e){$r(this,t);var r=e.near,n=e.code,o=e.setReactState,i=e.cache,a=e.refreshCache,c=e.confirmTransactions,u=e.depth,s=e.widgetSrc,l=e.requestCommit,f=e.version,h=e.widgetConfigs;if(!n)throw new Error("Not a program");this.alive=!0,this.near=r,this.code=n,this.setReactState=function(t){return o(it(t))},this.cache=i,this.refreshCache=a,this.confirmTransactions=c,this.depth=u,this.widgetSrc=s,this.requestCommit=l,this.version=f,this.cachedStyledComponents=new Map,this.widgetConfigs=h,this.timeouts=new Set,this.intervals=new Set}return Kr(t,[{key:"stop",value:function(){this.alive=!1,this.timeouts.forEach((function(t){return clearTimeout(t)})),this.intervals.forEach((function(t){return clearInterval(t)}))}},{key:"cachedPromise",value:function(t,e){var r=this;return it(t({onInvalidate:function(){r.alive&&r.refreshCache()},subscribe:!!e}))}},{key:"cachedSocialGet",value:function(t,e,r,n){var o=this;return t=Array.isArray(t)?t:[t],this.cachedPromise((function(i){return o.cache.socialGet(o.near,t,e,r,n,i)}),null==n?void 0:n.subscribe)}},{key:"storageGet",value:function(t,e){var r=this;return this.cachedPromise((function(n){return r.cache.localStorageGet(t,e,n)}))}},{key:"storageSet",value:function(t,e,r){return this.cache.localStorageSet(t,e,r)}},{key:"cachedSocialKeys",value:function(t,e,r){var n=this;return t=Array.isArray(t)?t:[t],this.cachedPromise((function(o){return n.cache.cachedViewCall(n.near,n.near.config.contractName,"keys",{keys:t,options:r},e,o)}),null==r?void 0:r.subscribe)}},{key:"asyncNearView",value:function(t,e,r,n){return this.near.viewCall(t,e,r,n)}},{key:"cachedNearView",value:function(t,e,r,n,o){var i=this;return this.cachedPromise((function(o){return i.cache.cachedViewCall(i.near,t,e,r,n,o)}),o)}},{key:"cachedNearBlock",value:function(t,e){var r=this;return this.cachedPromise((function(e){return r.cache.cachedBlock(r.near,t,e)}),e)}},{key:"asyncFetch",value:function(t,e){return this.cache.asyncFetch(t,e)}},{key:"cachedFetch",value:function(t,e){var r=this;return this.cachedPromise((function(n){return r.cache.cachedFetch(t,e,n)}),null==e?void 0:e.subscribe)}},{key:"cachedIndex",value:function(t,e,r){var n=this;return this.cachedPromise((function(o){return n.cache.socialIndex(n.near,t,e,r,o)}),null==r?void 0:r.subscribe)}},{key:"useCache",value:function(t,e,r){var n=this;return this.cachedPromise((function(r){return n.cache.cachedCustomPromise({widgetSrc:n.widgetSrc,dataKey:e},t,r)}),null==r?void 0:r.subscribe)}},{key:"socialSet",value:function(t,e){return this.requestCommit({data:t,force:null==e?void 0:e.force,onCommit:null==e?void 0:e.onCommit,onCancel:null==e?void 0:e.onCancel})}},{key:"renderCode",value:function(t){var e=t.props,n=t.context,o=t.state;if(this.depth>=32)return"Too deep";this.gIndex=0,this.state={props:it(e),context:n,state:it(o),nacl:en,elliptic:rn},this.loopLimit=1e6,this.vmStack=new bn(this,void 0,this.state);var i=this.vmStack.executeStatement(this.code);if(null!=i&&i.break)throw new Error("BreakStatement outside of a loop");if(null!=i&&i.continue)throw new Error("ContinueStatement outside of a loop");var a=null==i?void 0:i.result;return ot(a)||"string"==typeof a||"number"==typeof a?a:r().createElement("pre",null,JSON.stringify(a,void 0,2))}}]),t}();const En=require("react-error-boundary"),xn=require("react-bootstrap-typeahead/types/utils");function Sn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(t,e)||kn(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kn(t,e){if(t){if("string"==typeof t)return On(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?On(t,e):void 0}}function On(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}(r||[]);try{for(i.s();!(n=i.n()).done;){var a,c=n.value;if(null!==(a=o)&&void 0!==a&&a.src){var u,s=o.src,l=_(null==c?void 0:c.redirectMap)&&c.redirectMap[s];if(!l)try{l=(0,xn.isFunction)(null==c?void 0:c.redirect)&&c.redirect(s)}catch(t){}if(T(l))o={src:l};else if(T(null===(u=l)||void 0===u?void 0:u.code))return{code:l.code}}}}catch(t){i.e(t)}finally{i.f()}return o};function _n(t){var n=t.src,o=t.code,i=t.props,a=t.depth||0,c=t.config,s=Sn((0,e.useState)(0),2),l=s[0],f=s[1],h=Sn((0,e.useState)(null),2),p=h[0],d=h[1],y=Sn((0,e.useState)(null),2),v=y[0],m=y[1],g=Sn((0,e.useState)(void 0),2),w=g[0],E=g[1],x=Sn((0,e.useState)(0),2),S=x[0],k=x[1],O=Sn((0,e.useState)(null),2),j=O[0],N=O[1],A=Sn((0,e.useState)({}),2),_=A[0],T=A[1],C=Sn((0,e.useState)(null),2),P=C[0],B=C[1],U=Sn((0,e.useState)(null),2),F=U[0],R=U[1],M=Sn((0,e.useState)(null),2),G=M[0],q=M[1],D=Sn((0,e.useState)(null),2),J=D[0],$=D[1],z=Sn((0,e.useState)(null),2),K=z[0],Y=z[1],V=Sn((0,e.useState)(null),2),X=V[0],W=V[1],H=pr(),Z=_t(),Q=Zt(),tt=Sn((0,e.useState)(null),2),et=tt[0],rt=tt[1];(0,e.useEffect)((function(){var t=c?Array.isArray(c)?c:[c]:[];at(t,K)||Y(t)}),[c,K]),(0,e.useEffect)((function(){var t=An(n,o,K);at(t,X)||W(t)}),[n,o,K,X]),(0,e.useEffect)((function(){if(Z)if(null!=X&&X.src){var t=X.src,e=H.socialGet(Z,t.toString(),!1,void 0,void 0,(function(){f(l+1)}));d(e),m(t)}else null!=X&&X.code&&(d(X.code),m(null))}),[Z,X,l]),(0,e.useEffect)((function(){if(B(null),rt(null),p)try{var t=Nn(p);N({parsedCode:t})}catch(t){rt(r().createElement("div",{className:"alert alert-danger"},"Compilation error:",r().createElement("pre",null,t.message),r().createElement("pre",null,t.stack))),console.error(t)}else void 0===p&&rt(r().createElement("div",{className:"alert alert-danger"},'Source code for "',v,'" is not found'))}),[p,v]);var nt=(0,e.useCallback)((function(t){if(!Z||!t||0===t.length)return null;t=t.map((function(t){return{contractName:t.contractName,methodName:t.methodName,args:t.args||{},deposit:t.deposit?u()(t.deposit):u()(0),gas:t.gas?u()(t.gas):b.mul(30)}})),console.log("confirm txs",t),R(t)}),[Z]),ot=(0,e.useCallback)((function(t){if(!Z)return null;console.log("commit requested",t),q(t)}),[Z]);return(0,e.useEffect)((function(){if(Z&&j){E(void 0);var t=new wn({near:Z,code:j.parsedCode,setReactState:E,cache:H,refreshCache:function(){k((function(t){return t+1}))},confirmTransactions:nt,depth:a,widgetSrc:v,requestCommit:ot,version:je()(),widgetConfigs:K});return B(t),function(){t.stop()}}}),[v,Z,j,a,ot,nt,K]),(0,e.useEffect)((function(){Z&&T({loading:!1,accountId:null!=Q?Q:null,widgetSrc:v})}),[Z,Q,v]),(0,e.useLayoutEffect)((function(){if(P){var t={props:i||{},context:_,state:w,cacheNonce:S,version:P.version};if(!at(t,J)){$(it(t));try{var e;rt(null!==(e=P.renderCode(t))&&void 0!==e?e:"Execution failed")}catch(t){rt(r().createElement("div",{className:"alert alert-danger"},"Execution error:",r().createElement("pre",null,t.message),r().createElement("pre",null,t.stack))),console.error(t)}}}}),[P,i,_,w,S,J]),null!=et?r().createElement(En.ErrorBoundary,{FallbackComponent:L,onReset:function(){rt(null)},resetKeys:[et]},r().createElement(r().Fragment,null,et,F&&r().createElement(Ne,{transactions:F,onHide:function(){return R(null)}}),G&&r().createElement(kr,{show:!0,widgetSrc:v,data:G.data,force:G.force,onHide:function(){return q(null)},onCommit:G.onCommit,onCancel:G.onCancel}))):I}})(),o})())); \ No newline at end of file diff --git a/package.json b/package.json index 321f043b..73be2a4a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "near-social-vm", - "version": "0.3.0", + "version": "1.0.0", "description": "Near Social VM", "main": "dist/index.js", "files": [ @@ -8,13 +8,6 @@ ], "dependencies": { "@braintree/sanitize-url": "6.0.0", - "@near-wallet-selector/core": "^7.4.0", - "@near-wallet-selector/here-wallet": "^7.4.0", - "@near-wallet-selector/meteor-wallet": "^7.4.0", - "@near-wallet-selector/my-near-wallet": "^7.4.0", - "@near-wallet-selector/near-wallet": "^7.4.0", - "@near-wallet-selector/neth": "^7.4.0", - "@near-wallet-selector/sender": "^7.4.0", "acorn": "^8.8.0", "acorn-jsx": "^5.3.2", "big.js": "^6.1.1", diff --git a/src/lib/data/near.js b/src/lib/data/near.js index 85cfe166..c913a64a 100644 --- a/src/lib/data/near.js +++ b/src/lib/data/near.js @@ -1,13 +1,6 @@ import * as nearAPI from "near-api-js"; import Big from "big.js"; import { useEffect, useMemo, useState } from "react"; -import { setupWalletSelector } from "@near-wallet-selector/core"; -import { setupNearWallet } from "@near-wallet-selector/near-wallet"; -import { setupMyNearWallet } from "@near-wallet-selector/my-near-wallet"; -import { setupSender } from "@near-wallet-selector/sender"; -import { setupHereWallet } from "@near-wallet-selector/here-wallet"; -import { setupMeteorWallet } from "@near-wallet-selector/meteor-wallet"; -import { setupNeth } from "@near-wallet-selector/neth"; import { singletonHook } from "react-singleton-hook"; import { MaxGasPerTransaction, TGas } from "./utils"; @@ -225,22 +218,7 @@ async function _initNear({ networkId, config, keyStore, selector } = {}) { config = Object.assign({}, config, TestNearConfig); } keyStore = keyStore ?? new nearAPI.keyStores.BrowserLocalStorageKeyStore(); - selector = - selector ?? - setupWalletSelector({ - network: config.networkId, - modules: [ - setupNearWallet(), - setupMyNearWallet(), - setupSender(), - setupHereWallet(), - setupMeteorWallet(), - setupNeth({ - gas: "300000000000000", - bundle: false, - }), - ], - }); + const nearConnection = await nearAPI.connect( Object.assign({ deps: { keyStore } }, config) diff --git a/yarn.lock b/yarn.lock index 4bdbc2e6..da2de3ba 100644 --- a/yarn.lock +++ b/yarn.lock @@ -993,361 +993,11 @@ resolved "https://registry.yarnpkg.com/@emotion/unitless/-/unitless-0.7.5.tgz#77211291c1900a700b8a78cfafda3160d76949ed" integrity sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg== -"@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" - integrity sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA== - dependencies: - "@ethersproject/address" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/hash" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - -"@ethersproject/abstract-provider@5.7.0", "@ethersproject/abstract-provider@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz#b0a8550f88b6bf9d51f90e4795d48294630cb9ef" - integrity sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw== - dependencies: - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/networks" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@ethersproject/web" "^5.7.0" - -"@ethersproject/abstract-signer@5.7.0", "@ethersproject/abstract-signer@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz#13f4f32117868452191a4649723cb086d2b596b2" - integrity sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ== - dependencies: - "@ethersproject/abstract-provider" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - -"@ethersproject/address@5.7.0", "@ethersproject/address@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.7.0.tgz#19b56c4d74a3b0a46bfdbb6cfcc0a153fc697f37" - integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA== - dependencies: - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/rlp" "^5.7.0" - -"@ethersproject/base64@5.7.0", "@ethersproject/base64@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.7.0.tgz#ac4ee92aa36c1628173e221d0d01f53692059e1c" - integrity sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ== - dependencies: - "@ethersproject/bytes" "^5.7.0" - -"@ethersproject/basex@5.7.0", "@ethersproject/basex@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.7.0.tgz#97034dc7e8938a8ca943ab20f8a5e492ece4020b" - integrity sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - -"@ethersproject/bignumber@5.7.0", "@ethersproject/bignumber@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.7.0.tgz#e2f03837f268ba655ffba03a57853e18a18dc9c2" - integrity sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - bn.js "^5.2.1" - -"@ethersproject/bytes@5.7.0", "@ethersproject/bytes@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.7.0.tgz#a00f6ea8d7e7534d6d87f47188af1148d71f155d" - integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A== - dependencies: - "@ethersproject/logger" "^5.7.0" - -"@ethersproject/constants@5.7.0", "@ethersproject/constants@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.7.0.tgz#df80a9705a7e08984161f09014ea012d1c75295e" - integrity sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA== - dependencies: - "@ethersproject/bignumber" "^5.7.0" - -"@ethersproject/contracts@5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.7.0.tgz#c305e775abd07e48aa590e1a877ed5c316f8bd1e" - integrity sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg== - dependencies: - "@ethersproject/abi" "^5.7.0" - "@ethersproject/abstract-provider" "^5.7.0" - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/address" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - -"@ethersproject/hash@5.7.0", "@ethersproject/hash@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.7.0.tgz#eb7aca84a588508369562e16e514b539ba5240a7" - integrity sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g== - dependencies: - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/address" "^5.7.0" - "@ethersproject/base64" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - -"@ethersproject/hdnode@5.7.0", "@ethersproject/hdnode@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.7.0.tgz#e627ddc6b466bc77aebf1a6b9e47405ca5aef9cf" - integrity sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg== - dependencies: - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/basex" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/pbkdf2" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/sha2" "^5.7.0" - "@ethersproject/signing-key" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@ethersproject/wordlists" "^5.7.0" - -"@ethersproject/json-wallets@5.7.0", "@ethersproject/json-wallets@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz#5e3355287b548c32b368d91014919ebebddd5360" - integrity sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g== - dependencies: - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/address" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/hdnode" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/pbkdf2" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/random" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - aes-js "3.0.0" - scrypt-js "3.0.1" - -"@ethersproject/keccak256@5.7.0", "@ethersproject/keccak256@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.7.0.tgz#3186350c6e1cd6aba7940384ec7d6d9db01f335a" - integrity sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg== - dependencies: - "@ethersproject/bytes" "^5.7.0" - js-sha3 "0.8.0" - -"@ethersproject/logger@5.7.0", "@ethersproject/logger@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.7.0.tgz#6ce9ae168e74fecf287be17062b590852c311892" - integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== - -"@ethersproject/networks@5.7.1", "@ethersproject/networks@^5.7.0": - version "5.7.1" - resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.7.1.tgz#118e1a981d757d45ccea6bb58d9fd3d9db14ead6" - integrity sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ== - dependencies: - "@ethersproject/logger" "^5.7.0" - -"@ethersproject/pbkdf2@5.7.0", "@ethersproject/pbkdf2@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz#d2267d0a1f6e123f3771007338c47cccd83d3102" - integrity sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/sha2" "^5.7.0" - -"@ethersproject/properties@5.7.0", "@ethersproject/properties@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.7.0.tgz#a6e12cb0439b878aaf470f1902a176033067ed30" - integrity sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw== - dependencies: - "@ethersproject/logger" "^5.7.0" - -"@ethersproject/providers@5.7.2": - version "5.7.2" - resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.7.2.tgz#f8b1a4f275d7ce58cf0a2eec222269a08beb18cb" - integrity sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg== - dependencies: - "@ethersproject/abstract-provider" "^5.7.0" - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/address" "^5.7.0" - "@ethersproject/base64" "^5.7.0" - "@ethersproject/basex" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/hash" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/networks" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/random" "^5.7.0" - "@ethersproject/rlp" "^5.7.0" - "@ethersproject/sha2" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@ethersproject/web" "^5.7.0" - bech32 "1.1.4" - ws "7.4.6" - -"@ethersproject/random@5.7.0", "@ethersproject/random@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.7.0.tgz#af19dcbc2484aae078bb03656ec05df66253280c" - integrity sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - -"@ethersproject/rlp@5.7.0", "@ethersproject/rlp@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.7.0.tgz#de39e4d5918b9d74d46de93af80b7685a9c21304" - integrity sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - -"@ethersproject/sha2@5.7.0", "@ethersproject/sha2@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.7.0.tgz#9a5f7a7824ef784f7f7680984e593a800480c9fb" - integrity sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - hash.js "1.1.7" - -"@ethersproject/signing-key@5.7.0", "@ethersproject/signing-key@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.7.0.tgz#06b2df39411b00bc57c7c09b01d1e41cf1b16ab3" - integrity sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - bn.js "^5.2.1" - elliptic "6.5.4" - hash.js "1.1.7" - -"@ethersproject/solidity@5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.7.0.tgz#5e9c911d8a2acce2a5ebb48a5e2e0af20b631cb8" - integrity sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA== - dependencies: - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/sha2" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - -"@ethersproject/strings@5.7.0", "@ethersproject/strings@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.7.0.tgz#54c9d2a7c57ae8f1205c88a9d3a56471e14d5ed2" - integrity sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - -"@ethersproject/transactions@5.7.0", "@ethersproject/transactions@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.7.0.tgz#91318fc24063e057885a6af13fdb703e1f993d3b" - integrity sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ== - dependencies: - "@ethersproject/address" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/rlp" "^5.7.0" - "@ethersproject/signing-key" "^5.7.0" - -"@ethersproject/units@5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.7.0.tgz#637b563d7e14f42deeee39245275d477aae1d8b1" - integrity sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg== - dependencies: - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - -"@ethersproject/wallet@5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.7.0.tgz#4e5d0790d96fe21d61d38fb40324e6c7ef350b2d" - integrity sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA== - dependencies: - "@ethersproject/abstract-provider" "^5.7.0" - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/address" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/hash" "^5.7.0" - "@ethersproject/hdnode" "^5.7.0" - "@ethersproject/json-wallets" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/random" "^5.7.0" - "@ethersproject/signing-key" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@ethersproject/wordlists" "^5.7.0" - -"@ethersproject/web@5.7.1", "@ethersproject/web@^5.7.0": - version "5.7.1" - resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.7.1.tgz#de1f285b373149bee5928f4eb7bcb87ee5fbb4ae" - integrity sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w== - dependencies: - "@ethersproject/base64" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - -"@ethersproject/wordlists@5.7.0", "@ethersproject/wordlists@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.7.0.tgz#8fb2c07185d68c3e09eb3bfd6e779ba2774627f5" - integrity sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/hash" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - "@gar/promisify@^1.0.1": version "1.1.3" resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6" integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw== -"@here-wallet/core@^1.3.1": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@here-wallet/core/-/core-1.3.1.tgz#bf384ac7b2b88f1d1dcd6739c25c06e21c2f3d87" - integrity sha512-OK7AlskPpGRdAnGruy8dWcvPCl8JL+hmBCKr1QRESPNwA4Tn3InhTL8xyxGrCjFA1gQ9XUGGTQvdI9ae3FDQ9Q== - dependencies: - sha1 "^1.1.1" - uuid4 "2.0.3" - "@jridgewell/gen-mapping@^0.1.0": version "0.1.1" resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz#e5d2e450306a9491e3bd77e323e38d7aff315996" @@ -1401,88 +1051,6 @@ resolved "https://registry.yarnpkg.com/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz#b2ac626d6cb9c8718ab459166d4bb405b8ffa78b" integrity sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A== -"@metamask/detect-provider@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@metamask/detect-provider/-/detect-provider-2.0.0.tgz#4bc2795e5e6f7d8b84b2e845058d2f222c99917d" - integrity sha512-sFpN+TX13E9fdBDh9lvQeZdJn4qYoRb/6QF2oZZK/Pn559IhCFacPMU1rMuqyXoFQF3JSJfii2l98B87QDPeCQ== - -"@meteorwallet/sdk@^0.6.0": - version "0.6.0" - resolved "https://registry.yarnpkg.com/@meteorwallet/sdk/-/sdk-0.6.0.tgz#006b77410a7874f0c9bfc0d693f199b561f39d19" - integrity sha512-oriaQ1gk1hpQx6V6BxsvUthDd0Bpmv3ho5Ap5pm9P0euEosWtFUVF1dTYndJE10qBG8yLW+EOOX1LZ8taXCiRA== - dependencies: - nanoid "3.3.4" - query-string "^7.1.1" - -"@near-wallet-selector/core@7.8.0", "@near-wallet-selector/core@^7.4.0": - version "7.8.0" - resolved "https://registry.yarnpkg.com/@near-wallet-selector/core/-/core-7.8.0.tgz#690a9f20deb20dbcfb40074933a4fbcd280662e6" - integrity sha512-hFYbWE4aUwhaCqYHXQ7eyhu2dZQl5EIi1TFwkaEcaaQirHBhLda8vpHARAzrZ9H5po2yUhqxv1lw/5O6uAcF4Q== - dependencies: - rxjs "^7.8.0" - -"@near-wallet-selector/here-wallet@^7.4.0": - version "7.8.0" - resolved "https://registry.yarnpkg.com/@near-wallet-selector/here-wallet/-/here-wallet-7.8.0.tgz#72a468186c335a6378ceeda253adce6022814d47" - integrity sha512-zvfo+NcSFLdtJ217AOZUnlQ/QAO3CufM9V0siiggq22fe2+4KZbthvF6ty3t6ZCYETvioa/rkUQ9M+3AG0U0EA== - dependencies: - "@here-wallet/core" "^1.3.1" - "@near-wallet-selector/core" "7.8.0" - bn.js "^5.2.0" - -"@near-wallet-selector/meteor-wallet@^7.4.0": - version "7.8.0" - resolved "https://registry.yarnpkg.com/@near-wallet-selector/meteor-wallet/-/meteor-wallet-7.8.0.tgz#8cd4f2c60f8622ff4442fbeb3b819f73fb331aa2" - integrity sha512-rfMvMDJA6goz2KytzxRDFNsdpOdg2AyWXbAlbJn3YVTZcry297E+SYV9xQEX5dLuVd81AgxXIwq9WuPA3cCdnw== - dependencies: - "@meteorwallet/sdk" "^0.6.0" - "@near-wallet-selector/core" "7.8.0" - "@near-wallet-selector/wallet-utils" "7.8.0" - -"@near-wallet-selector/my-near-wallet@7.8.0", "@near-wallet-selector/my-near-wallet@^7.4.0": - version "7.8.0" - resolved "https://registry.yarnpkg.com/@near-wallet-selector/my-near-wallet/-/my-near-wallet-7.8.0.tgz#57ff616af71654ce342e11f2dfed3acc0c694af8" - integrity sha512-+mRCOuPtiJRrPCTnSDjzbzIU8e7QHAQKPG3b/Kx/z1DFrOogvOXN37UPsS3CxHz0d8UVPQZBuTgFH/iQ7RcQrg== - dependencies: - "@near-wallet-selector/core" "7.8.0" - "@near-wallet-selector/wallet-utils" "7.8.0" - -"@near-wallet-selector/near-wallet@^7.4.0": - version "7.8.0" - resolved "https://registry.yarnpkg.com/@near-wallet-selector/near-wallet/-/near-wallet-7.8.0.tgz#60bbf44962bc5356adfba40c3e18623057acd89d" - integrity sha512-9DpWYL7nDwAvQumr7TM+5ZcfkovO4notu9JR/juZc6nn3kiwjMWaqUMeePsvZ0Xo/Eh5FmK+w2Kw7zMZRh0ruA== - dependencies: - "@near-wallet-selector/core" "7.8.0" - "@near-wallet-selector/my-near-wallet" "7.8.0" - -"@near-wallet-selector/neth@^7.4.0": - version "7.8.0" - resolved "https://registry.yarnpkg.com/@near-wallet-selector/neth/-/neth-7.8.0.tgz#627cb3df8f4c834af8daafaa593af4e55ef9b698" - integrity sha512-a59uopLxWn81zTZG0xM7r2EX/sgoFZjqek/dvSvuzYKUkCOTfWSplUHC7CgikuU2BlzBMQ4QCbIWYKSqbjFl5Q== - dependencies: - "@metamask/detect-provider" "^2.0.0" - "@near-wallet-selector/core" "7.8.0" - bn.js "^5.2.0" - ethers "^5.7.2" - is-mobile "^3.1.1" - near-seed-phrase "^0.2.0" - -"@near-wallet-selector/sender@^7.4.0": - version "7.8.0" - resolved "https://registry.yarnpkg.com/@near-wallet-selector/sender/-/sender-7.8.0.tgz#dcf1d5005d4d5d51fbafd1c808c1ab5c12e57e43" - integrity sha512-4kY4aH1Y6S6mOvyKu4CovIYrjuSyiKQFz3uNJzJVdg+JwMxRJaikwX7SrZhlkPYslan0MdNRSxVMlH1X7tO9lQ== - dependencies: - "@near-wallet-selector/core" "7.8.0" - is-mobile "^3.1.1" - -"@near-wallet-selector/wallet-utils@7.8.0": - version "7.8.0" - resolved "https://registry.yarnpkg.com/@near-wallet-selector/wallet-utils/-/wallet-utils-7.8.0.tgz#33a868fc47a6299bafc4890a0fbe65a8f57f981a" - integrity sha512-L14ykKZSGE7G5vu8GHxCQ6x0rDGd6AJDiHe8vLPbFz71DVQIo4VV2PRTz5DzKL29CfCU4Q2tWXlILPXtqvDKgw== - dependencies: - "@near-wallet-selector/core" "7.8.0" - bn.js "^5.2.0" - "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -1727,11 +1295,6 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-18.13.0.tgz#0400d1e6ce87e9d3032c19eb6c58205b0d3f7850" integrity sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg== -"@types/node@11.11.6": - version "11.11.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-11.11.6.tgz#df929d1bb2eee5afdda598a41930fe50b43eaa6a" - integrity sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ== - "@types/normalize-package-data@^2.4.0": version "2.4.1" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" @@ -2003,11 +1566,6 @@ acorn@^8.0.4, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.8.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== -aes-js@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" - integrity sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw== - agent-base@6, agent-base@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" @@ -2285,11 +1843,6 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" -bech32@1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" - integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== - big.js@^6.1.1: version "6.2.1" resolved "https://registry.yarnpkg.com/big.js/-/big.js-6.2.1.tgz#7205ce763efb17c2e41f26f121c420c6a7c2744f" @@ -2300,24 +1853,6 @@ binary-extensions@^2.0.0: resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== -bip39-light@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/bip39-light/-/bip39-light-1.0.7.tgz#06a72f251b89389a136d3f177f29b03342adc5ba" - integrity sha512-WDTmLRQUsiioBdTs9BmSEmkJza+8xfJmptsNJjxnoq3EydSa/ZBXT6rm66KoT3PJIRYMnhSKNR7S9YL1l7R40Q== - dependencies: - create-hash "^1.1.0" - pbkdf2 "^3.0.9" - -bip39@3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.0.2.tgz#2baf42ff3071fc9ddd5103de92e8f80d9257ee32" - integrity sha512-J4E1r2N0tUylTKt07ibXvhpT2c5pyAFgvuA5q1H9uDy6dEGpjV8jmymh3MTYJDLCNbIVClSB9FbND49I6N24MQ== - dependencies: - "@types/node" "11.11.6" - create-hash "^1.1.0" - pbkdf2 "^3.0.9" - randombytes "^2.0.1" - bn.js@5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" @@ -2328,7 +1863,7 @@ bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== -bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.2.0, bn.js@^5.2.1: +bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== @@ -2469,7 +2004,7 @@ browserslist@^4.0.0, browserslist@^4.14.5, browserslist@^4.21.3, browserslist@^4 node-releases "^2.0.8" update-browserslist-db "^1.0.10" -bs58@^4.0.0, bs58@^4.0.1: +bs58@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" integrity sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw== @@ -2640,11 +2175,6 @@ character-reference-invalid@^1.0.0: resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz#083329cda0eae272ab3dbbf37e9a382c13af1560" integrity sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg== -"charenc@>= 0.0.1": - version "0.0.2" - resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" - integrity sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA== - chokidar@^3.5.3: version "3.5.3" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" @@ -2929,7 +2459,7 @@ create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: ripemd160 "^2.0.1" sha.js "^2.4.0" -create-hmac@1.1.7, create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7: +create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== @@ -2957,11 +2487,6 @@ cross-spawn@^7.0.1, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" -"crypt@>= 0.0.1": - version "0.0.2" - resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" - integrity sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow== - crypto-browserify@^3.12.0: version "3.12.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" @@ -3155,11 +2680,6 @@ decode-named-character-reference@^1.0.0: dependencies: character-entities "^2.0.0" -decode-uri-component@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" - integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ== - deep-equal@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-2.2.0.tgz#5caeace9c781028b9ff459f33b779346637c43e6" @@ -3368,7 +2888,7 @@ electron-to-chromium@^1.4.284: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.299.tgz#faa2069cd4879a73e540e533178db5c618768d41" integrity sha512-lQ7ijJghH6pCGbfWXr6EY+KYCMaRSjgsY925r1p/TlpSfVM1VjHTcn1gAc15VM4uwti283X6QtjPTXdpoSGiZQ== -elliptic@6.5.4, elliptic@^6.5.3, elliptic@^6.5.4: +elliptic@^6.5.3, elliptic@^6.5.4: version "6.5.4" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== @@ -3517,42 +3037,6 @@ etag@~1.8.1: resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" integrity sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg== -ethers@^5.7.2: - version "5.7.2" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" - integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== - dependencies: - "@ethersproject/abi" "5.7.0" - "@ethersproject/abstract-provider" "5.7.0" - "@ethersproject/abstract-signer" "5.7.0" - "@ethersproject/address" "5.7.0" - "@ethersproject/base64" "5.7.0" - "@ethersproject/basex" "5.7.0" - "@ethersproject/bignumber" "5.7.0" - "@ethersproject/bytes" "5.7.0" - "@ethersproject/constants" "5.7.0" - "@ethersproject/contracts" "5.7.0" - "@ethersproject/hash" "5.7.0" - "@ethersproject/hdnode" "5.7.0" - "@ethersproject/json-wallets" "5.7.0" - "@ethersproject/keccak256" "5.7.0" - "@ethersproject/logger" "5.7.0" - "@ethersproject/networks" "5.7.1" - "@ethersproject/pbkdf2" "5.7.0" - "@ethersproject/properties" "5.7.0" - "@ethersproject/providers" "5.7.2" - "@ethersproject/random" "5.7.0" - "@ethersproject/rlp" "5.7.0" - "@ethersproject/sha2" "5.7.0" - "@ethersproject/signing-key" "5.7.0" - "@ethersproject/solidity" "5.7.0" - "@ethersproject/strings" "5.7.0" - "@ethersproject/transactions" "5.7.0" - "@ethersproject/units" "5.7.0" - "@ethersproject/wallet" "5.7.0" - "@ethersproject/web" "5.7.1" - "@ethersproject/wordlists" "5.7.0" - eventemitter3@^4.0.0: version "4.0.7" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" @@ -3692,11 +3176,6 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" -filter-obj@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/filter-obj/-/filter-obj-1.1.0.tgz#9b311112bc6c6127a16e016c6c5d7f19e0805c5b" - integrity sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ== - finalhandler@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32" @@ -4049,7 +3528,7 @@ hash-base@^3.0.0: readable-stream "^3.6.0" safe-buffer "^5.2.0" -hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3: +hash.js@^1.0.0, hash.js@^1.0.3: version "1.1.7" resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== @@ -4522,11 +4001,6 @@ is-map@^2.0.1, is-map@^2.0.2: resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.2.tgz#00922db8c9bf73e81b7a335827bc2a43f2b91127" integrity sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg== -is-mobile@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/is-mobile/-/is-mobile-3.1.1.tgz#3b9e48f40068e4ea2da411f5009779844ce8d6aa" - integrity sha512-RRoXXR2HNFxNkUnxtaBdGBXtFlUMFa06S0NUKf/LCF+MuGLu13gi9iBCkoEmc6+rpXuwi5Mso5V8Zf7mNynMBQ== - is-number-object@^1.0.4: version "1.0.7" resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.7.tgz#59d50ada4c45251784e9904f5246c742f07a42fc" @@ -4699,11 +4173,6 @@ js-sha256@^0.9.0: resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966" integrity sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA== -js-sha3@0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" - integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== - "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -5584,7 +5053,7 @@ nan@^2.13.2: resolved "https://registry.yarnpkg.com/nan/-/nan-2.17.0.tgz#c0150a2368a182f033e9aa5195ec76ea41a199cb" integrity sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ== -nanoid@3.3.4, nanoid@^3.3.4: +nanoid@^3.3.4: version "3.3.4" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== @@ -5606,25 +5075,6 @@ near-api-js@^0.45.1: text-encoding-utf-8 "^1.0.2" tweetnacl "^1.0.1" -near-hd-key@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/near-hd-key/-/near-hd-key-1.2.1.tgz#f508ff15436cf8a439b543220f3cc72188a46756" - integrity sha512-SIrthcL5Wc0sps+2e1xGj3zceEa68TgNZDLuCx0daxmfTP7sFTB3/mtE2pYhlFsCxWoMn+JfID5E1NlzvvbRJg== - dependencies: - bip39 "3.0.2" - create-hmac "1.1.7" - tweetnacl "1.0.3" - -near-seed-phrase@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/near-seed-phrase/-/near-seed-phrase-0.2.0.tgz#fb7cf89682112b1160ab68abb50dc821f49be18a" - integrity sha512-NpmrnejpY1AdlRpDZ0schJQJtfBaoUheRfiYtQpcq9TkwPgqKZCRULV5L3hHmLc0ep7KRtikbPQ9R2ztN/3cyQ== - dependencies: - bip39-light "^1.0.7" - bs58 "^4.0.1" - near-hd-key "^1.2.1" - tweetnacl "^1.0.2" - negotiator@0.6.3, negotiator@^0.6.2: version "0.6.3" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" @@ -5998,7 +5448,7 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== -pbkdf2@^3.0.3, pbkdf2@^3.0.9: +pbkdf2@^3.0.3: version "3.1.2" resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== @@ -6431,16 +5881,6 @@ qs@~6.5.2: resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== -query-string@^7.1.1: - version "7.1.3" - resolved "https://registry.yarnpkg.com/query-string/-/query-string-7.1.3.tgz#a1cf90e994abb113a325804a972d98276fe02328" - integrity sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg== - dependencies: - decode-uri-component "^0.2.2" - filter-obj "^1.1.0" - split-on-first "^1.0.0" - strict-uri-encode "^2.0.0" - querystring@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" @@ -6914,13 +6354,6 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -rxjs@^7.8.0: - version "7.8.0" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.0.tgz#90a938862a82888ff4c7359811a595e14e1e09a4" - integrity sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg== - dependencies: - tslib "^2.1.0" - sade@^1.7.3: version "1.8.1" resolved "https://registry.yarnpkg.com/sade/-/sade-1.8.1.tgz#0a78e81d658d394887be57d2a409bf703a3b2701" @@ -6987,11 +6420,6 @@ scroll-into-view-if-needed@^2.2.20: dependencies: compute-scroll-into-view "^1.0.20" -scrypt-js@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" - integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== - scss-tokenizer@^0.4.3: version "0.4.3" resolved "https://registry.yarnpkg.com/scss-tokenizer/-/scss-tokenizer-0.4.3.tgz#1058400ee7d814d71049c29923d2b25e61dc026c" @@ -7101,14 +6529,6 @@ sha.js@^2.4.0, sha.js@^2.4.8: inherits "^2.0.1" safe-buffer "^5.0.1" -sha1@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/sha1/-/sha1-1.1.1.tgz#addaa7a93168f393f19eb2b15091618e2700f848" - integrity sha512-dZBS6OrMjtgVkopB1Gmo4RQCDKiZsqcpAQpkV/aaj+FCrCg8r4I4qMkDPQjBgLIxlmu9k4nUbWq6ohXahOneYA== - dependencies: - charenc ">= 0.0.1" - crypt ">= 0.0.1" - shallow-clone@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" @@ -7279,11 +6699,6 @@ spdy@^4.0.2: select-hose "^2.0.0" spdy-transport "^3.0.0" -split-on-first@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/split-on-first/-/split-on-first-1.1.0.tgz#f610afeee3b12bce1d0c30425e76398b78249a5f" - integrity sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw== - sshpk@^1.7.0: version "1.17.0" resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.17.0.tgz#578082d92d4fe612b13007496e543fa0fbcbe4c5" @@ -7353,11 +6768,6 @@ stream-http@^3.2.0: readable-stream "^3.6.0" xtend "^4.0.2" -strict-uri-encode@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" - integrity sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ== - "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" @@ -7575,7 +6985,7 @@ trough@^2.0.0: dependencies: glob "^7.1.2" -tslib@^2.0.3, tslib@^2.1.0, tslib@^2.4.0: +tslib@^2.0.3, tslib@^2.4.0: version "2.5.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf" integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg== @@ -7587,16 +6997,16 @@ tunnel-agent@^0.6.0: dependencies: safe-buffer "^5.0.1" -tweetnacl@1.0.3, tweetnacl@^1.0.1, tweetnacl@^1.0.2, tweetnacl@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" - integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== - tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.5" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA== +tweetnacl@^1.0.1, tweetnacl@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" + integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== + type-fest@^0.18.0: version "0.18.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.18.1.tgz#db4bc151a4a2cf4eebf9add5db75508db6cc841f" @@ -7776,11 +7186,6 @@ utils-merge@1.0.1: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== -uuid4@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/uuid4/-/uuid4-2.0.3.tgz#241e5dfe1704a79c52e2aa40e7e581a5e7b01ab4" - integrity sha512-CTpAkEVXMNJl2ojgtpLXHgz23dh8z81u6/HEPiQFOvBc/c2pde6TVHmH4uwY0d/GLF3tb7+VDAj4+2eJaQSdZQ== - uuid@^3.3.2: version "3.4.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" @@ -8105,11 +7510,6 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== -ws@7.4.6: - version "7.4.6" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" - integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== - ws@^7.3.1: version "7.5.9" resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591"