>>=26,e.words[r]=a,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(A[e])return A[e];var t;if("k256"===e)t=new x;else if("p224"===e)t=new E;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new C}return A[e]=t,t},k.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},k.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},k.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(f(e,e.umod(this.m)._forceRed(this)),e)},k.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},k.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},k.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},k.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},k.prototype.isqr=function(e){return this.imul(e,e.clone())},k.prototype.sqr=function(e){return this.mul(e,e)},k.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);n(!a.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,u).cmp(c);)f.redIAdd(c);for(var d=this.pow(f,a),l=this.pow(e,a.addn(1).iushrn(1)),h=this.pow(e,a),p=o;0!==h.cmp(s);){for(var b=h,m=0;0!==b.cmp(s);m++)b=b.redSqr();n(m=0;n--){for(var u=t.words[n],f=c-1;f>=0;f--){var d=u>>f&1;a!==r[0]&&(a=this.sqr(a)),0!==d||0!==o?(o<<=1,o|=d,(4===++s||0===n&&0===f)&&(a=this.mul(a,r[o]),s=0,o=0)):s=0}c=26}return a},k.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},k.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new B(e)},a(B,k),B.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},B.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},B.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},B.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},B.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(98)(e))},function(e,t){var r,n,a=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"===typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"===typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var c,u=[],f=!1,d=-1;function l(){f&&c&&(f=!1,c.length?u=c.concat(u):d=-1,u.length&&h())}function h(){if(!f){var e=s(l);f=!0;for(var t=u.length;t;){for(c=u,u=[];++d1)for(var r=1;r1&&void 0!==arguments[1]&&arguments[1],r=e.toString(s);return t?L(r):r}function l(e){return e.toString(c)}function h(e){return e.readUIntBE(0,e.length)}function p(e){return o.default(e)}function b(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return d(p(e),t)}function m(e){return l(p(e))}function g(e){return h(p(e))}function v(e){return Array.from(e).map(_).join("")}function y(t){return e.from(j(t),s)}function A(e){return f(y(e))}function w(e){return v(A(e))}function x(t){return e.from(t,c)}function E(e){return f(x(e))}function _(e){return P((e>>>0).toString(2))}function C(e){return p(k(e))}function k(e){return new Uint8Array(F(e).map((function(e){return parseInt(e,2)})))}function B(e,t){return b(k(e),t)}function I(e){return!("string"!==typeof e||!new RegExp(/^[01]+$/).test(e))&&e.length%8===0}function S(e,t){return!("string"!==typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}function O(t){return e.isBuffer(t)}function M(e){return i.default.strict(e)&&!O(e)}function D(e){return!M(e)&&!O(e)&&"undefined"!==typeof e.byteLength}function T(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,r=e%t;return r?(e-r)/t*t+t:e}function F(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,r=P(e).match(new RegExp(".{".concat(t,"}"),"gi"));return Array.from(r||[])}function R(e){return F(e).map(U).join("")}function P(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u;return N(e,T(e.length,t),r)}function N(e,t){return Q(e,t,!0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:u)}function j(e){return e.replace(/^0x/,"")}function L(e){return e.startsWith("0x")?e:"0x".concat(e)}function U(e){return e.split("").reverse().join("")}function Q(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:u,a=t-e.length,i=e;if(a>0){var o=n.repeat(a);i=r?o+e:e+o}return i}t.bufferToArray=f,t.bufferToHex=d,t.bufferToUtf8=l,t.bufferToNumber=h,t.bufferToBinary=function(e){return v(f(e))},t.arrayToBuffer=p,t.arrayToHex=b,t.arrayToUtf8=m,t.arrayToNumber=g,t.arrayToBinary=v,t.hexToBuffer=y,t.hexToArray=A,t.hexToUtf8=function(e){return l(y(e))},t.hexToNumber=function(e){return g(A(e))},t.hexToBinary=w,t.utf8ToBuffer=x,t.utf8ToArray=E,t.utf8ToHex=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return d(x(e),t)},t.utf8ToNumber=function(e){var t=parseInt(e,10);return function(e,t){if(!e)throw new Error(t)}(!function(e){return"undefined"===typeof e}(t),"Number can only safely store up to 53 bits"),t},t.utf8ToBinary=function(e){return v(E(e))},t.numberToBuffer=function(e){return C(_(e))},t.numberToArray=function(e){return k(_(e))},t.numberToHex=function(e,t){return B(_(e),t)},t.numberToUtf8=function(e){return"".concat(e)},t.numberToBinary=_,t.binaryToBuffer=C,t.binaryToArray=k,t.binaryToHex=B,t.binaryToUtf8=function(e){return m(k(e))},t.binaryToNumber=function(e){return g(k(e))},t.isBinaryString=I,t.isHexString=S,t.isBuffer=O,t.isTypedArray=M,t.isArrayBuffer=D,t.getType=function(e){return O(e)?"buffer":M(e)?"typed-array":D(e)?"array-buffer":Array.isArray(e)?"array":typeof e},t.getEncoding=function(e){return I(e)?"binary":S(e)?s:c},t.concatBuffers=function(){for(var t=arguments.length,r=new Array(t),n=0;n0&&(e=e.slice(r)),e},t.trimRight=function(e,t){return e.slice(0,t)},t.calcByteLength=T,t.splitBytes=F,t.swapBytes=R,t.swapHex=function(e){return B(R(w(e)))},t.sanitizeBytes=P,t.padLeft=N,t.padRight=function(e,t){return Q(e,t,!1,arguments.length>2&&void 0!==arguments[2]?arguments[2]:u)},t.removeHexPrefix=j,t.addHexPrefix=L,t.sanitizeHex=function(e){return(e=P(e=j(e),2))&&(e=L(e)),e},t.removeHexLeadingZeros=function(e){var t=e.startsWith("0x");return e=(e=j(e)).startsWith(u)?e.substring(1):e,t?L(e):e}}).call(this,r(15).Buffer)},function(e,t,r){var n,a,i;!function(o){var s="object"==typeof o.sodium&&"function"==typeof o.sodium.onload?o.sodium.onload:null;a=[t,r(2938)],n=function(e,t){"use strict";var r,n=t.ready.then((function(){function n(){if(0!==r._sodium_init())throw new Error("libsodium was not correctly initialized.");for(var t=["crypto_aead_chacha20poly1305_decrypt","crypto_aead_chacha20poly1305_decrypt_detached","crypto_aead_chacha20poly1305_encrypt","crypto_aead_chacha20poly1305_encrypt_detached","crypto_aead_chacha20poly1305_ietf_decrypt","crypto_aead_chacha20poly1305_ietf_decrypt_detached","crypto_aead_chacha20poly1305_ietf_encrypt","crypto_aead_chacha20poly1305_ietf_encrypt_detached","crypto_aead_chacha20poly1305_ietf_keygen","crypto_aead_chacha20poly1305_keygen","crypto_aead_xchacha20poly1305_ietf_decrypt","crypto_aead_xchacha20poly1305_ietf_decrypt_detached","crypto_aead_xchacha20poly1305_ietf_encrypt","crypto_aead_xchacha20poly1305_ietf_encrypt_detached","crypto_aead_xchacha20poly1305_ietf_keygen","crypto_auth","crypto_auth_hmacsha256","crypto_auth_hmacsha256_keygen","crypto_auth_hmacsha256_verify","crypto_auth_hmacsha512","crypto_auth_hmacsha512_keygen","crypto_auth_hmacsha512_verify","crypto_auth_keygen","crypto_auth_verify","crypto_box_beforenm","crypto_box_curve25519xchacha20poly1305_keypair","crypto_box_curve25519xchacha20poly1305_seal","crypto_box_curve25519xchacha20poly1305_seal_open","crypto_box_detached","crypto_box_easy","crypto_box_easy_afternm","crypto_box_keypair","crypto_box_open_detached","crypto_box_open_easy","crypto_box_open_easy_afternm","crypto_box_seal","crypto_box_seal_open","crypto_box_seed_keypair","crypto_core_ristretto255_add","crypto_core_ristretto255_from_hash","crypto_core_ristretto255_is_valid_point","crypto_core_ristretto255_random","crypto_core_ristretto255_scalar_add","crypto_core_ristretto255_scalar_complement","crypto_core_ristretto255_scalar_invert","crypto_core_ristretto255_scalar_mul","crypto_core_ristretto255_scalar_negate","crypto_core_ristretto255_scalar_random","crypto_core_ristretto255_scalar_reduce","crypto_core_ristretto255_scalar_sub","crypto_core_ristretto255_sub","crypto_generichash","crypto_generichash_blake2b_salt_personal","crypto_generichash_final","crypto_generichash_init","crypto_generichash_keygen","crypto_generichash_update","crypto_hash","crypto_hash_sha256","crypto_hash_sha256_final","crypto_hash_sha256_init","crypto_hash_sha256_update","crypto_hash_sha512","crypto_hash_sha512_final","crypto_hash_sha512_init","crypto_hash_sha512_update","crypto_kdf_derive_from_key","crypto_kdf_keygen","crypto_kx_client_session_keys","crypto_kx_keypair","crypto_kx_seed_keypair","crypto_kx_server_session_keys","crypto_onetimeauth","crypto_onetimeauth_final","crypto_onetimeauth_init","crypto_onetimeauth_keygen","crypto_onetimeauth_update","crypto_onetimeauth_verify","crypto_pwhash","crypto_pwhash_scryptsalsa208sha256","crypto_pwhash_scryptsalsa208sha256_ll","crypto_pwhash_scryptsalsa208sha256_str","crypto_pwhash_scryptsalsa208sha256_str_verify","crypto_pwhash_str","crypto_pwhash_str_needs_rehash","crypto_pwhash_str_verify","crypto_scalarmult","crypto_scalarmult_base","crypto_scalarmult_ristretto255","crypto_scalarmult_ristretto255_base","crypto_secretbox_detached","crypto_secretbox_easy","crypto_secretbox_keygen","crypto_secretbox_open_detached","crypto_secretbox_open_easy","crypto_secretstream_xchacha20poly1305_init_pull","crypto_secretstream_xchacha20poly1305_init_push","crypto_secretstream_xchacha20poly1305_keygen","crypto_secretstream_xchacha20poly1305_pull","crypto_secretstream_xchacha20poly1305_push","crypto_secretstream_xchacha20poly1305_rekey","crypto_shorthash","crypto_shorthash_keygen","crypto_shorthash_siphashx24","crypto_sign","crypto_sign_detached","crypto_sign_ed25519_pk_to_curve25519","crypto_sign_ed25519_sk_to_curve25519","crypto_sign_ed25519_sk_to_pk","crypto_sign_ed25519_sk_to_seed","crypto_sign_final_create","crypto_sign_final_verify","crypto_sign_init","crypto_sign_keypair","crypto_sign_open","crypto_sign_seed_keypair","crypto_sign_update","crypto_sign_verify_detached","crypto_stream_chacha20","crypto_stream_chacha20_ietf_xor","crypto_stream_chacha20_ietf_xor_ic","crypto_stream_chacha20_keygen","crypto_stream_chacha20_xor","crypto_stream_chacha20_xor_ic","crypto_stream_keygen","crypto_stream_xchacha20_keygen","crypto_stream_xchacha20_xor","crypto_stream_xchacha20_xor_ic","randombytes_buf","randombytes_buf_deterministic","randombytes_close","randombytes_random","randombytes_set_implementation","randombytes_stir","randombytes_uniform","sodium_version_string"],n=[w,x,E,_,C,k,B,I,S,O,M,D,T,F,R,P,N,j,L,U,Q,G,H,z,q,K,V,W,Y,J,X,Z,$,ee,te,re,ne,ae,ie,oe,se,ce,ue,fe,de,le,he,pe,be,me,ge,ve,ye,Ae,we,xe,Ee,_e,Ce,ke,Be,Ie,Se,Oe,Me,De,Te,Fe,Re,Pe,Ne,je,Le,Ue,Qe,Ge,He,ze,qe,Ke,Ve,We,Ye,Je,Xe,Ze,$e,et,tt,rt,nt,at,it,ot,st,ct,ut,ft,dt,lt,ht,pt,bt,mt,gt,vt,yt,At,wt,xt,Et,_t,Ct,kt,Bt,It,St,Ot,Mt,Dt,Tt,Ft,Rt,Pt,Nt,jt,Lt,Ut,Qt,Gt,Ht,zt,qt,Kt,Vt,Wt],a=0;a=240?(u=4,s=!0):f>=224?(u=3,s=!0):f>=192?(u=2,s=!0):f<128&&(u=1,s=!0)}while(!s);for(var d=u-(o.length-c),l=0;l>8&-39)<<8|87+(t=e[i]>>>4)+(t-10>>8&-39),a+=String.fromCharCode(255&n)+String.fromCharCode(n>>>8);return a}var s={ORIGINAL:1,ORIGINAL_NO_PADDING:3,URLSAFE:5,URLSAFE_NO_PADDING:7};function c(e){if(null==e)return s.URLSAFE_NO_PADDING;if(e!==s.ORIGINAL&&e!==s.ORIGINAL_NO_PADDING&&e!==s.URLSAFE&&e!=s.URLSAFE_NO_PADDING)throw new Error("unsupported base64 variant");return e}function u(e,t){t=c(t),e=A(a,e,"input");var n,a=[],o=0|Math.floor(e.length/3),s=e.length-3*o,u=4*o+(0!==s?0==(2&t)?4:2+(s>>>1):0),f=new h(u+1),d=p(e);return a.push(d),a.push(f.address),0===r._sodium_bin2base64(f.address,f.length,d,e.length,t)&&g(a,"conversion failed"),f.length=u,n=i(f.to_Uint8Array()),m(a),n}function f(e,t){var r=t||"uint8array";if(!d(r))throw new Error(r+" output format is not available");if(e instanceof h){if("uint8array"===r)return e.to_Uint8Array();if("text"===r)return i(e.to_Uint8Array());if("hex"===r)return o(e.to_Uint8Array());if("base64"===r)return u(e.to_Uint8Array(),s.URLSAFE_NO_PADDING);throw new Error('What is output format "'+r+'"?')}if("object"==typeof e){for(var n=Object.keys(e),a={},c=0;c>>24>>>8,c,d);var x=f(g,o);return m(s),x}function Fe(e){var t=[];l(e);var n=new h(0|r._crypto_kdf_keybytes()),a=n.address;t.push(a),r._crypto_kdf_keygen(a);var i=f(n,e);return m(t),i}function Re(e,t,n,a){var i=[];l(a),e=A(i,e,"clientPublicKey");var o,s=0|r._crypto_kx_publickeybytes();e.length!==s&&v(i,"invalid clientPublicKey length"),o=p(e),i.push(o),t=A(i,t,"clientSecretKey");var c,u=0|r._crypto_kx_secretkeybytes();t.length!==u&&v(i,"invalid clientSecretKey length"),c=p(t),i.push(c),n=A(i,n,"serverPublicKey");var d,b=0|r._crypto_kx_publickeybytes();n.length!==b&&v(i,"invalid serverPublicKey length"),d=p(n),i.push(d);var y=new h(0|r._crypto_kx_sessionkeybytes()),w=y.address;i.push(w);var x=new h(0|r._crypto_kx_sessionkeybytes()),E=x.address;if(i.push(E),0==(0|r._crypto_kx_client_session_keys(w,E,o,c,d))){var _=f({sharedRx:y,sharedTx:x},a);return m(i),_}g(i,"invalid usage")}function Pe(e){var t=[];l(e);var n=new h(0|r._crypto_kx_publickeybytes()),a=n.address;t.push(a);var i=new h(0|r._crypto_kx_secretkeybytes()),o=i.address;if(t.push(o),0==(0|r._crypto_kx_keypair(a,o))){var s={publicKey:f(n,e),privateKey:f(i,e),keyType:"x25519"};return m(t),s}g(t,"internal error")}function Ne(e,t){var n=[];l(t),e=A(n,e,"seed");var a,i=0|r._crypto_kx_seedbytes();e.length!==i&&v(n,"invalid seed length"),a=p(e),n.push(a);var o=new h(0|r._crypto_kx_publickeybytes()),s=o.address;n.push(s);var c=new h(0|r._crypto_kx_secretkeybytes()),u=c.address;if(n.push(u),0==(0|r._crypto_kx_seed_keypair(s,u,a))){var d={publicKey:f(o,t),privateKey:f(c,t),keyType:"x25519"};return m(n),d}g(n,"internal error")}function je(e,t,n,a){var i=[];l(a),e=A(i,e,"serverPublicKey");var o,s=0|r._crypto_kx_publickeybytes();e.length!==s&&v(i,"invalid serverPublicKey length"),o=p(e),i.push(o),t=A(i,t,"serverSecretKey");var c,u=0|r._crypto_kx_secretkeybytes();t.length!==u&&v(i,"invalid serverSecretKey length"),c=p(t),i.push(c),n=A(i,n,"clientPublicKey");var d,b=0|r._crypto_kx_publickeybytes();n.length!==b&&v(i,"invalid clientPublicKey length"),d=p(n),i.push(d);var y=new h(0|r._crypto_kx_sessionkeybytes()),w=y.address;i.push(w);var x=new h(0|r._crypto_kx_sessionkeybytes()),E=x.address;if(i.push(E),0==(0|r._crypto_kx_server_session_keys(w,E,o,c,d))){var _=f({sharedRx:y,sharedTx:x},a);return m(i),_}g(i,"invalid usage")}function Le(e,t,n){var a=[];l(n);var i=p(e=A(a,e,"message")),o=e.length;a.push(i),t=A(a,t,"key");var s,c=0|r._crypto_onetimeauth_keybytes();t.length!==c&&v(a,"invalid key length"),s=p(t),a.push(s);var u=new h(0|r._crypto_onetimeauth_bytes()),d=u.address;if(a.push(d),0==(0|r._crypto_onetimeauth(d,i,o,0,s))){var b=f(u,n);return m(a),b}g(a,"invalid usage")}function Ue(e,t){var n=[];l(t),y(n,e,"state_address");var a=new h(0|r._crypto_onetimeauth_bytes()),i=a.address;if(n.push(i),0==(0|r._crypto_onetimeauth_final(e,i))){var o=(r._free(e),f(a,t));return m(n),o}g(n,"invalid usage")}function Qe(e,t){var n=[];l(t);var a=null;null!=e&&(a=p(e=A(n,e,"key")),e.length,n.push(a));var i=new h(144).address;if(0==(0|r._crypto_onetimeauth_init(i,a))){var o=i;return m(n),o}g(n,"invalid usage")}function Ge(e){var t=[];l(e);var n=new h(0|r._crypto_onetimeauth_keybytes()),a=n.address;t.push(a),r._crypto_onetimeauth_keygen(a);var i=f(n,e);return m(t),i}function He(e,t,n){var a=[];l(n),y(a,e,"state_address");var i=p(t=A(a,t,"message_chunk")),o=t.length;a.push(i),0!=(0|r._crypto_onetimeauth_update(e,i,o))&&g(a,"invalid usage"),m(a)}function ze(e,t,n){var a=[];e=A(a,e,"hash");var i,o=0|r._crypto_onetimeauth_bytes();e.length!==o&&v(a,"invalid hash length"),i=p(e),a.push(i);var s=p(t=A(a,t,"message")),c=t.length;a.push(s),n=A(a,n,"key");var u,f=0|r._crypto_onetimeauth_keybytes();n.length!==f&&v(a,"invalid key length"),u=p(n),a.push(u);var d=0==(0|r._crypto_onetimeauth_verify(i,s,c,0,u));return m(a),d}function qe(e,t,n,a,i,o,s){var c=[];l(s),y(c,e,"keyLength"),("number"!=typeof e||(0|e)!==e||e<0)&&v(c,"keyLength must be an unsigned integer");var u=p(t=A(c,t,"password")),d=t.length;c.push(u),n=A(c,n,"salt");var b,w=0|r._crypto_pwhash_saltbytes();n.length!==w&&v(c,"invalid salt length"),b=p(n),c.push(b),y(c,a,"opsLimit"),("number"!=typeof a||(0|a)!==a||a<0)&&v(c,"opsLimit must be an unsigned integer"),y(c,i,"memLimit"),("number"!=typeof i||(0|i)!==i||i<0)&&v(c,"memLimit must be an unsigned integer"),y(c,o,"algorithm"),("number"!=typeof o||(0|o)!==o||o<0)&&v(c,"algorithm must be an unsigned integer");var x=new h(0|e),E=x.address;if(c.push(E),0==(0|r._crypto_pwhash(E,e,0,u,d,0,b,a,0,i,o))){var _=f(x,s);return m(c),_}g(c,"invalid usage")}function Ke(e,t,n,a,i,o){var s=[];l(o),y(s,e,"keyLength"),("number"!=typeof e||(0|e)!==e||e<0)&&v(s,"keyLength must be an unsigned integer");var c=p(t=A(s,t,"password")),u=t.length;s.push(c),n=A(s,n,"salt");var d,b=0|r._crypto_pwhash_scryptsalsa208sha256_saltbytes();n.length!==b&&v(s,"invalid salt length"),d=p(n),s.push(d),y(s,a,"opsLimit"),("number"!=typeof a||(0|a)!==a||a<0)&&v(s,"opsLimit must be an unsigned integer"),y(s,i,"memLimit"),("number"!=typeof i||(0|i)!==i||i<0)&&v(s,"memLimit must be an unsigned integer");var w=new h(0|e),x=w.address;if(s.push(x),0==(0|r._crypto_pwhash_scryptsalsa208sha256(x,e,0,c,u,0,d,a,0,i))){var E=f(w,o);return m(s),E}g(s,"invalid usage")}function Ve(e,t,n,a,i,o,s){var c=[];l(s);var u=p(e=A(c,e,"password")),d=e.length;c.push(u);var b=p(t=A(c,t,"salt")),w=t.length;c.push(b),y(c,n,"opsLimit"),("number"!=typeof n||(0|n)!==n||n<0)&&v(c,"opsLimit must be an unsigned integer"),y(c,a,"r"),("number"!=typeof a||(0|a)!==a||a<0)&&v(c,"r must be an unsigned integer"),y(c,i,"p"),("number"!=typeof i||(0|i)!==i||i<0)&&v(c,"p must be an unsigned integer"),y(c,o,"keyLength"),("number"!=typeof o||(0|o)!==o||o<0)&&v(c,"keyLength must be an unsigned integer");var x=new h(0|o),E=x.address;if(c.push(E),0==(0|r._crypto_pwhash_scryptsalsa208sha256_ll(u,d,b,w,n,0,a,i,E,o))){var _=f(x,s);return m(c),_}g(c,"invalid usage")}function We(e,t,n,a){var i=[];l(a);var o=p(e=A(i,e,"password")),s=e.length;i.push(o),y(i,t,"opsLimit"),("number"!=typeof t||(0|t)!==t||t<0)&&v(i,"opsLimit must be an unsigned integer"),y(i,n,"memLimit"),("number"!=typeof n||(0|n)!==n||n<0)&&v(i,"memLimit must be an unsigned integer");var c=new h(0|r._crypto_pwhash_scryptsalsa208sha256_strbytes()).address;if(i.push(c),0==(0|r._crypto_pwhash_scryptsalsa208sha256_str(c,o,s,0,t,0,n))){var u=r.UTF8ToString(c);return m(i),u}g(i,"invalid usage")}function Ye(e,t,n){var i=[];l(n),"string"!=typeof e&&v(i,"hashed_password must be a string"),e=a(e+"\0"),null!=s&&e.length-1!==s&&v(i,"invalid hashed_password length");var o=p(e),s=e.length-1;i.push(o);var c=p(t=A(i,t,"password")),u=t.length;i.push(c);var f=0==(0|r._crypto_pwhash_scryptsalsa208sha256_str_verify(o,c,u,0));return m(i),f}function Je(e,t,n,a){var i=[];l(a);var o=p(e=A(i,e,"password")),s=e.length;i.push(o),y(i,t,"opsLimit"),("number"!=typeof t||(0|t)!==t||t<0)&&v(i,"opsLimit must be an unsigned integer"),y(i,n,"memLimit"),("number"!=typeof n||(0|n)!==n||n<0)&&v(i,"memLimit must be an unsigned integer");var c=new h(0|r._crypto_pwhash_strbytes()).address;if(i.push(c),0==(0|r._crypto_pwhash_str(c,o,s,0,t,0,n))){var u=r.UTF8ToString(c);return m(i),u}g(i,"invalid usage")}function Xe(e,t,n,i){var o=[];l(i),"string"!=typeof e&&v(o,"hashed_password must be a string"),e=a(e+"\0"),null!=c&&e.length-1!==c&&v(o,"invalid hashed_password length");var s=p(e),c=e.length-1;o.push(s),y(o,t,"opsLimit"),("number"!=typeof t||(0|t)!==t||t<0)&&v(o,"opsLimit must be an unsigned integer"),y(o,n,"memLimit"),("number"!=typeof n||(0|n)!==n||n<0)&&v(o,"memLimit must be an unsigned integer");var u=0!=(0|r._crypto_pwhash_str_needs_rehash(s,t,0,n));return m(o),u}function Ze(e,t,n){var i=[];l(n),"string"!=typeof e&&v(i,"hashed_password must be a string"),e=a(e+"\0"),null!=s&&e.length-1!==s&&v(i,"invalid hashed_password length");var o=p(e),s=e.length-1;i.push(o);var c=p(t=A(i,t,"password")),u=t.length;i.push(c);var f=0==(0|r._crypto_pwhash_str_verify(o,c,u,0));return m(i),f}function $e(e,t,n){var a=[];l(n),e=A(a,e,"privateKey");var i,o=0|r._crypto_scalarmult_scalarbytes();e.length!==o&&v(a,"invalid privateKey length"),i=p(e),a.push(i),t=A(a,t,"publicKey");var s,c=0|r._crypto_scalarmult_scalarbytes();t.length!==c&&v(a,"invalid publicKey length"),s=p(t),a.push(s);var u=new h(0|r._crypto_scalarmult_bytes()),d=u.address;if(a.push(d),0==(0|r._crypto_scalarmult(d,i,s))){var b=f(u,n);return m(a),b}g(a,"weak public key")}function et(e,t){var n=[];l(t),e=A(n,e,"privateKey");var a,i=0|r._crypto_scalarmult_scalarbytes();e.length!==i&&v(n,"invalid privateKey length"),a=p(e),n.push(a);var o=new h(0|r._crypto_scalarmult_scalarbytes()),s=o.address;if(n.push(s),0==(0|r._crypto_scalarmult_base(s,a))){var c=f(o,t);return m(n),c}g(n,"insecure scalar")}function tt(e,t,n){var a=[];l(n),e=A(a,e,"scalar");var i,o=0|r._crypto_scalarmult_ristretto255_scalarbytes();e.length!==o&&v(a,"invalid scalar length"),i=p(e),a.push(i),t=A(a,t,"privateKey");var s,c=0|r._crypto_scalarmult_ristretto255_bytes();t.length!==c&&v(a,"invalid privateKey length"),s=p(t),a.push(s);var u=new h(0|r._crypto_scalarmult_ristretto255_bytes()),d=u.address;if(a.push(d),0==(0|r._crypto_scalarmult_ristretto255(d,i,s))){var b=f(u,n);return m(a),b}g(a,"input is zero element")}function rt(e,t){var n=[];l(t);var a=p(e=A(n,e,"scalar"));e.length,n.push(a);var i=new h(0|r._crypto_core_ristretto255_bytes()),o=i.address;if(n.push(o),0==(0|r._crypto_scalarmult_ristretto255_base(o,a))){var s=f(i,t);return m(n),s}g(n,"scalar is 0")}function nt(e,t,n,a){var i=[];l(a);var o=p(e=A(i,e,"message")),s=e.length;i.push(o),t=A(i,t,"nonce");var c,u=0|r._crypto_secretbox_noncebytes();t.length!==u&&v(i,"invalid nonce length"),c=p(t),i.push(c),n=A(i,n,"key");var d,b=0|r._crypto_secretbox_keybytes();n.length!==b&&v(i,"invalid key length"),d=p(n),i.push(d);var y=new h(0|s),w=y.address;i.push(w);var x=new h(0|r._crypto_secretbox_macbytes()),E=x.address;if(i.push(E),0==(0|r._crypto_secretbox_detached(w,E,o,s,0,c,d))){var _=f({mac:x,cipher:y},a);return m(i),_}g(i,"invalid usage")}function at(e,t,n,a){var i=[];l(a);var o=p(e=A(i,e,"message")),s=e.length;i.push(o),t=A(i,t,"nonce");var c,u=0|r._crypto_secretbox_noncebytes();t.length!==u&&v(i,"invalid nonce length"),c=p(t),i.push(c),n=A(i,n,"key");var d,b=0|r._crypto_secretbox_keybytes();n.length!==b&&v(i,"invalid key length"),d=p(n),i.push(d);var y=new h(s+r._crypto_secretbox_macbytes()|0),w=y.address;if(i.push(w),0==(0|r._crypto_secretbox_easy(w,o,s,0,c,d))){var x=f(y,a);return m(i),x}g(i,"invalid usage")}function it(e){var t=[];l(e);var n=new h(0|r._crypto_secretbox_keybytes()),a=n.address;t.push(a),r._crypto_secretbox_keygen(a);var i=f(n,e);return m(t),i}function ot(e,t,n,a,i){var o=[];l(i);var s=p(e=A(o,e,"ciphertext")),c=e.length;o.push(s),t=A(o,t,"mac");var u,d=0|r._crypto_secretbox_macbytes();t.length!==d&&v(o,"invalid mac length"),u=p(t),o.push(u),n=A(o,n,"nonce");var b,y=0|r._crypto_secretbox_noncebytes();n.length!==y&&v(o,"invalid nonce length"),b=p(n),o.push(b),a=A(o,a,"key");var w,x=0|r._crypto_secretbox_keybytes();a.length!==x&&v(o,"invalid key length"),w=p(a),o.push(w);var E=new h(0|c),_=E.address;if(o.push(_),0==(0|r._crypto_secretbox_open_detached(_,s,u,c,0,b,w))){var C=f(E,i);return m(o),C}g(o,"wrong secret key for the given ciphertext")}function st(e,t,n,a){var i=[];l(a),e=A(i,e,"ciphertext");var o,s=r._crypto_secretbox_macbytes(),c=e.length;c>>0;return m([]),t}function qt(e,t){var n=[];l(t);for(var a=r._malloc(24),i=0;i<6;i++)r.setValue(a+4*i,r.Runtime.addFunction(e[["implementation_name","random","stir","uniform","buf","close"][i]]),"i32");0!=(0|r._randombytes_set_implementation(a))&&g(n,"unsupported implementation"),m(n)}function Kt(e){l(e),r._randombytes_stir()}function Vt(e,t){var n=[];l(t),y(n,e,"upper_bound"),("number"!=typeof e||(0|e)!==e||e<0)&&v(n,"upper_bound must be an unsigned integer");var a=r._randombytes_uniform(e)>>>0;return m(n),a}function Wt(){var e=r._sodium_version_string(),t=r.UTF8ToString(e);return m([]),t}return h.prototype.to_Uint8Array=function(){var e=new Uint8Array(this.length);return e.set(r.HEAPU8.subarray(this.address,this.address+this.length)),e},e.add=function(e,t){if(!(e instanceof Uint8Array&&t instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can added");var r=e.length,n=0,a=0;if(t.length!=e.length)throw new TypeError("Arguments must have the same length");for(a=0;a>=8,n+=e[a]+t[a],e[a]=255&n},e.base64_variants=s,e.compare=function(e,t){if(!(e instanceof Uint8Array&&t instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be compared");if(e.length!==t.length)throw new TypeError("Only instances of identical length can be compared");for(var r=0,n=1,a=e.length;a-- >0;)r|=t[a]-e[a]>>8&n,n&=(t[a]^e[a])-1>>8;return r+r+n-1},e.from_base64=function(e,t){t=c(t);var n,a=[],i=new h(3*(e=A(a,e,"input")).length/4),o=p(e),s=b(4),u=b(4);return a.push(o),a.push(i.address),a.push(i.result_bin_len_p),a.push(i.b64_end_p),0!==r._sodium_base642bin(i.address,i.length,o,e.length,0,s,u,t)&&g(a,"invalid input"),r.getValue(u,"i32")-o!==e.length&&g(a,"incomplete input"),i.length=r.getValue(s,"i32"),n=i.to_Uint8Array(),m(a),n},e.from_hex=function(e){var t,n=[],a=new h((e=A(n,e,"input")).length/2),i=p(e),o=b(4);return n.push(i),n.push(a.address),n.push(a.hex_end_p),0!==r._sodium_hex2bin(a.address,a.length,i,e.length,0,0,o)&&g(n,"invalid input"),r.getValue(o,"i32")-i!==e.length&&g(n,"incomplete input"),t=a.to_Uint8Array(),m(n),t},e.from_string=a,e.increment=function(e){if(!(e instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be incremented");for(var t=256,r=0,n=e.length;r>=8,t+=e[r],e[r]=255&t},e.is_zero=function(e){if(!(e instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be checked");for(var t=0,r=0,n=e.length;r 0");var n,a=[],i=b(4),o=1,s=0,c=0|e.length,u=new h(c+t);a.push(i),a.push(u.address);for(var f=u.address,d=u.address+c+t;f>>48|c>>>32|c>>>16|c))-1>>16);return 0!==r._sodium_pad(i,u.address,e.length,t,u.length)&&g(a,"internal error"),u.length=r.getValue(i,"i32"),n=u.to_Uint8Array(),m(a),n},e.unpad=function(e,t){if(!(e instanceof Uint8Array))throw new TypeError("buffer must be a Uint8Array");if((t|=0)<=0)throw new Error("block size must be > 0");var n=[],a=p(e),i=b(4);return n.push(a),n.push(i),0!==r._sodium_unpad(i,a,e.length,t)&&g(n,"unsupported/invalid padding"),e=(e=new Uint8Array(e)).subarray(0,r.getValue(i,"i32")),m(n),e},e.ready=n,e.symbols=function(){return Object.keys(e).sort()},e.to_base64=u,e.to_hex=o,e.to_string=i,e},void 0!==(i="function"===typeof n?n.apply(t,a):n)&&(e.exports=i),s&&o.sodium.ready.then((function(){s(o.sodium)}))}(this)},function(e,t,r){var n=r(2968)();e.exports=n;try{regeneratorRuntime=n}catch(a){"object"===typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return De})),r.d(t,"b",(function(){return G}));var n=r(0),a=r(9),i=r(33),o=r(12),s=r(25),c=r(14),u=r(10),f=function(e){return"checkbox"===e.type},d=function(e){return e instanceof Date},l=function(e){return null==e},h=function(e){return"object"===typeof e},p=function(e){return!l(e)&&!Array.isArray(e)&&h(e)&&!d(e)},b=function(e){return p(e)&&e.target?f(e.target)?e.target.checked:e.target.value:e},m=function(e,t){return Object(c.a)(e).some((function(e){return function(e){return e.substring(0,e.search(/.\d/))||e}(t)===e}))},g=function(e){return e.filter(Boolean)},v=function(e){return void 0===e},y=function(e,t,r){if(!t||!p(e))return r;var n=g(t.split(/[,[\].]+?/)).reduce((function(e,t){return l(e)?e:e[t]}),e);return v(n)||n===e?v(e[t])?r:e[t]:n},A={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},w={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},x="max",E="min",_="maxLength",C="minLength",k="pattern",B="required",I="validate",S=function(e,t){var r=Object.assign({},e);return delete r[t],r},O=u.createContext(null),M=function(){return u.useContext(O)},D=function(e,t,r){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a={},i=function(i){Object.defineProperty(a,i,{get:function(){var a=i;return t[a]!==w.all&&(t[a]=!n||w.all),r&&(r[a]=!0),e[a]}})};for(var o in e)i(o);return a},T=function(e){return p(e)&&!Object.keys(e).length},F=function(e,t,r){var n=S(e,"name");return T(n)||Object.keys(n).length>=Object.keys(t).length||Object.keys(n).find((function(e){return t[e]===(!r||w.all)}))},R=function(e){return Array.isArray(e)?e:[e]},P=function(e,t,r){return r&&t?e===t:!e||!t||e===t||R(e).some((function(e){return e&&(e.startsWith(t)||t.startsWith(e))}))};function N(e){var t=u.useRef(e);t.current=e,u.useEffect((function(){var r=!e.disabled&&t.current.subject.subscribe({next:t.current.callback});return function(){return function(e){e&&e.unsubscribe()}(r)}}),[e.disabled])}var j=function(e){return"string"===typeof e},L=function(e,t,r,n){var a=Array.isArray(e);return j(e)?(n&&t.watch.add(e),y(r,e)):a?e.map((function(e){return n&&t.watch.add(e),y(r,e)})):(n&&(t.watchAll=!0),r)},U=function(e){return"function"===typeof e},Q=function(e){for(var t in e)if(U(e[t]))return!0;return!1};function G(e){var t=M(),r=e||{},n=r.control,a=void 0===n?t.control:n,i=r.name,o=r.defaultValue,f=r.disabled,d=r.exact,l=u.useRef(i);l.current=i;var h=u.useCallback((function(e){if(P(l.current,e.name,d)){var t=L(l.current,a._names,e.values||a._formValues);y(v(l.current)||p(t)&&!Q(t)?Object.assign({},t):Array.isArray(t)?Object(c.a)(t):v(t)?o:t)}}),[a,d,o]);N({disabled:f,subject:a._subjects.watch,callback:h});var b=u.useState(v(o)?a._getWatch(i):o),m=Object(s.a)(b,2),g=m[0],y=m[1];return u.useEffect((function(){a._removeUnmounted()})),g}var H=function(e,t,r,n,a){return t?Object.assign(Object.assign({},r[e]),{types:Object.assign(Object.assign({},r[e]&&r[e].types?r[e].types:{}),Object(o.a)({},n,a||!0))}):{}},z=function(e){return/^\w*$/.test(e)},q=function(e){return g(e.replace(/["|']|\]/g,"").split(/\.|\[/))};function K(e,t,r){for(var n=-1,a=z(t)?[t]:q(t),i=a.length,o=i-1;++n0&&(r=e);++s1&&void 0!==arguments[1]?arguments[1]:{},r=Array.isArray(e);if(p(e)||r)for(var n in e)Array.isArray(e[n])||p(e[n])&&!Q(e[n])?(t[n]=Array.isArray(e[n])?[]:{},ue(e[n],t[n])):l(e[n])||(t[n]=!0);return t}function fe(e,t,r){var n=Array.isArray(e);if(p(e)||n)for(var a in e)Array.isArray(e[a])||p(e[a])&&!Q(e[a])?v(t)||X(r[a])?r[a]=Array.isArray(e[a])?ue(e[a],[]):Object.assign({},ue(e[a])):fe(e[a],l(t)?{}:t[a],r[a]):r[a]=!Z(e[a],t[a]);return r}var de=function(e,t){return fe(e,t,ue(t))},le={value:!1,isValid:!1},he={value:!0,isValid:!0},pe=function(e){if(Array.isArray(e)){if(e.length>1){var t=e.filter((function(e){return e&&e.checked&&!e.disabled})).map((function(e){return e.value}));return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!v(e[0].attributes.value)?v(e[0].value)||""===e[0].value?he:{value:e[0].value,isValid:!0}:he:le}return le},be=function(e,t){var r=t.valueAsNumber,n=t.valueAsDate,a=t.setValueAs;return v(e)?e:r?""===e?NaN:+e:n&&j(e)?new Date(e):a?a(e):e},me={isValid:!1,value:null},ge=function(e){return Array.isArray(e)?e.reduce((function(e,t){return t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e}),me):me};function ve(e){var t=e.ref;if(!(e.refs?e.refs.every((function(e){return e.disabled})):t.disabled))return te(t)?t.files:ae(t)?ge(e.refs).value:ne(t)?Object(c.a)(t.selectedOptions).map((function(e){return e.value})):f(t)?pe(e.refs).value:be(v(t.value)?e.ref.value:t.value,e)}var ye=function(e,t,r,n){var a,o={},s=Object(i.a)(e);try{for(s.s();!(a=s.n()).done;){var u=a.value,f=y(t,u);f&&K(o,u,f._f)}}catch(d){s.e(d)}finally{s.f()}return{criteriaMode:r,names:Object(c.a)(e),fields:o,shouldUseNativeValidation:n}},Ae=function(e){return e instanceof RegExp},we=function(e){return v(e)?void 0:Ae(e)?e.source:p(e)?Ae(e.value)?e.value.source:e.value:e},xe=function(e){return e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate)};function Ee(e,t,r){var n=y(e,r);if(n||z(r))return{error:n,name:r};for(var a=r.split(".");a.length;){var i=a.join("."),o=y(t,i),s=y(e,i);if(o&&!Array.isArray(o)&&r!==i)return{name:r};if(s&&s.type)return{name:i,error:s};a.pop()}return{name:r}}var _e=function(e,t,r,n,a){return!a.isOnAll&&(!r&&a.isOnTouch?!(t||e):(r?n.isOnBlur:a.isOnBlur)?!e:!(r?n.isOnChange:a.isOnChange)||e)},Ce=function(e,t){return!g(y(e,t)).length&&ce(e,t)},ke=function(e){return j(e)||u.isValidElement(e)};function Be(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"validate";if(ke(e)||Array.isArray(e)&&e.every(ke)||ee(e)&&!e)return{type:r,message:ke(e)?e:"",ref:t}}var Ie=function(e){return p(e)&&!Ae(e)?e:{value:e,message:""}},Se=function(){var e=Object(a.a)(Object(n.a)().mark((function e(t,r,a,i){var o,s,c,u,d,h,b,m,g,v,y,A,w,S,O,M,D,F,R,P,N,L,Q,G,z,q,K,V,W,Y,J,X,Z,$,re,ne,ie,oe,se,ce,ue,fe,de,le;return Object(n.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=t._f,s=o.ref,c=o.refs,u=o.required,d=o.maxLength,h=o.minLength,b=o.min,m=o.max,g=o.pattern,v=o.validate,y=o.name,A=o.valueAsNumber,w=o.mount,S=o.disabled,w&&!S){e.next=3;break}return e.abrupt("return",{});case 3:if(O=c?c[0]:s,M=function(e){i&&O.reportValidity&&(O.setCustomValidity(ee(e)?"":e||" "),O.reportValidity())},D={},F=ae(s),R=f(s),P=F||R,N=(A||te(s))&&!s.value||""===r||Array.isArray(r)&&!r.length,L=H.bind(null,y,a,D),Q=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:_,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:C,i=e?t:r;D[y]=Object.assign({type:e?n:a,message:i,ref:s},L(e?n:a,i))},!u||!(!P&&(N||l(r))||ee(r)&&!r||R&&!pe(c).isValid||F&&!ge(c).isValid)){e.next=19;break}if(G=ke(u)?{value:!!u,message:u}:Ie(u),z=G.value,q=G.message,!z){e.next=19;break}if(D[y]=Object.assign({type:B,message:q,ref:O},L(B,q)),a){e.next=19;break}return M(q),e.abrupt("return",D);case 19:if(N||l(b)&&l(m)){e.next=28;break}if(W=Ie(m),Y=Ie(b),isNaN(r)?(X=s.valueAsDate||new Date(r),j(W.value)&&(K=X>new Date(W.value)),j(Y.value)&&(V=XW.value),l(Y.value)||(V=JZ.value,ne=!l($.value)&&r.length<$.value,!re&&!ne){e.next=38;break}if(Q(re,Z.message,$.message),a){e.next=38;break}return M(D[y].message),e.abrupt("return",D);case 38:if(!g||N||!j(r)){e.next=45;break}if(ie=Ie(g),oe=ie.value,se=ie.message,!Ae(oe)||r.match(oe)){e.next=45;break}if(D[y]=Object.assign({type:k,message:se,ref:s},L(k,se)),a){e.next=45;break}return M(se),e.abrupt("return",D);case 45:if(!v){e.next=79;break}if(!U(v)){e.next=58;break}return e.next=49,v(r);case 49:if(ce=e.sent,!(ue=Be(ce,O))){e.next=56;break}if(D[y]=Object.assign(Object.assign({},ue),L(I,ue.message)),a){e.next=56;break}return M(ue.message),e.abrupt("return",D);case 56:e.next=79;break;case 58:if(!p(v)){e.next=79;break}fe={},e.t0=Object(n.a)().keys(v);case 61:if((e.t1=e.t0()).done){e.next=75;break}if(de=e.t1.value,T(fe)||a){e.next=65;break}return e.abrupt("break",75);case 65:return e.t2=Be,e.next=68,v[de](r);case 68:e.t3=e.sent,e.t4=O,e.t5=de,(le=(0,e.t2)(e.t3,e.t4,e.t5))&&(fe=Object.assign(Object.assign({},le),L(de,le.message)),M(le.message),a&&(D[y]=fe)),e.next=61;break;case 75:if(T(fe)){e.next=79;break}if(D[y]=Object.assign({ref:O},fe),a){e.next=79;break}return e.abrupt("return",D);case 79:return M(!0),e.abrupt("return",D);case 81:case"end":return e.stop()}}),e)})));return function(t,r,n,a){return e.apply(this,arguments)}}(),Oe={mode:w.onSubmit,reValidateMode:w.onChange,shouldFocusError:!0};function Me(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=Object.assign(Object.assign({},Oe),t),u={isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touchedFields:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,errors:{}},h={},p=r.defaultValues||{},x=r.shouldUnregister?{}:Y(p),E={action:!1,mount:!1,watch:!1},_={mount:new Set,unMount:new Set,array:new Set,watch:new Set},C=0,k={},B={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},I={watch:J(),array:J(),state:J()},O=$(r.mode),M=$(r.reValidateMode),D=r.criteriaMode===w.all,F=function(e,t){return function(){for(var r=arguments.length,n=new Array(r),a=0;a2&&void 0!==l[2]?l[2]:{valid:!0},e.t0=Object(n.a)().keys(t);case 2:if((e.t1=e.t0()).done){e.next=23;break}if(o=e.t1.value,!(s=t[o])){e.next=21;break}if(c=s._f,f=S(s,"_f"),!c){e.next=17;break}return e.next=11,Se(s,y(x,c.name),D,r.shouldUseNativeValidation);case 11:if(!(d=e.sent)[c.name]){e.next=16;break}if(i.valid=!1,!a){e.next=16;break}return e.abrupt("break",23);case 16:a||(d[c.name]?K(u.errors,c.name,d[c.name]):ce(u.errors,c.name));case 17:if(e.t2=f,!e.t2){e.next=21;break}return e.next=21,ae(f,a,i);case 21:e.next=2;break;case 23:return e.abrupt("return",i.valid);case 24:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),ue=function(e,t){return e&&t&&K(x,e,t),!Z(Ae(),p)},fe=function(e,t,r){var n=Object.assign({},E.mount?x:v(t)?p:j(e)?Object(o.a)({},e,t):t);return L(e,_,n,r)},le=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=y(h,e),a=t;if(n){var i=n._f;i&&(!i.disabled&&K(x,e,be(t,i)),a=oe&&re(i.ref)&&l(t)?"":t,ne(i.ref)?Object(c.a)(i.ref.options).forEach((function(e){return e.selected=a.includes(e.value)})):i.refs?f(i.ref)?i.refs.length>1?i.refs.forEach((function(e){return!e.disabled&&(e.checked=Array.isArray(a)?!!a.find((function(t){return t===e.value})):a===e.value)})):i.refs[0]&&(i.refs[0].checked=!!a):i.refs.forEach((function(e){return e.checked=e.value===a})):te(i.ref)?i.ref.value="":(i.ref.value=a,i.ref.type||I.watch.next({name:e})))}(r.shouldDirty||r.shouldTouch)&&G(e,a,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&ge(e)},he=function e(t,r,n){for(var a in r){var i=r[a],o="".concat(t,".").concat(a),s=y(h,o);!_.array.has(t)&&X(i)&&(!s||s._f)||d(i)?le(o,i,n):e(o,i,n)}},pe=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=y(h,e),a=_.array.has(e),i=Y(t);K(x,e,i),a?(I.array.next({name:e,values:x}),(B.isDirty||B.dirtyFields)&&r.shouldDirty&&(u.dirtyFields=de(p,x),I.state.next({name:e,dirtyFields:u.dirtyFields,isDirty:ue(e,i)}))):!n||n._f||l(i)?le(e,i,r):he(e,i,r),W(e,_)&&I.state.next({}),I.watch.next({name:e})},me=function(){var e=Object(a.a)(Object(n.a)().mark((function e(t){var a,i,o,s,c,f,d,l,p,m,g,v,w,E,C;return Object(n.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t.target,i=a.name,!(o=y(h,i))){e.next=39;break}if(f=a.type?ve(o._f):b(t),d=t.type===A.BLUR||t.type===A.FOCUS_OUT,l=!xe(o._f)&&!r.resolver&&!y(u.errors,i)&&!o._f.deps||_e(d,y(u.touchedFields,i),u.isSubmitted,M,O),p=W(i,_,d),K(x,i,f),d?o._f.onBlur&&o._f.onBlur(t):o._f.onChange&&o._f.onChange(t),m=G(i,f,d,!1),g=!T(m)||p,!d&&I.watch.next({name:i,type:t.type}),!l){e.next=15;break}return e.abrupt("return",g&&I.state.next(Object.assign({name:i},p?{}:m)));case 15:if(!d&&p&&I.state.next({}),k[i]=(k[i],1),I.state.next({isValidating:!0}),!r.resolver){e.next=30;break}return e.next=21,z([i]);case 21:v=e.sent,w=v.errors,E=Ee(u.errors,h,i),C=Ee(w,h,E.name||i),s=C.error,i=C.name,c=T(w),e.next=37;break;case 30:return e.next=32,Se(o,y(x,i),D,r.shouldUseNativeValidation);case 32:return e.t0=i,s=e.sent[e.t0],e.next=36,P(!0);case 36:c=e.sent;case 37:o._f.deps&&ge(o._f.deps),H(!1,i,c,s,m);case 39:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ge=function(){var e=Object(a.a)(Object(n.a)().mark((function e(t){var i,s,c,f,d,l=arguments;return Object(n.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=l.length>1&&void 0!==l[1]?l[1]:{},f=R(t),I.state.next({isValidating:!0}),!r.resolver){e.next=11;break}return e.next=6,q(v(t)?t:f);case 6:d=e.sent,s=T(d),c=t?!f.some((function(e){return y(d,e)})):s,e.next=21;break;case 11:if(!t){e.next=18;break}return e.next=14,Promise.all(f.map(function(){var e=Object(a.a)(Object(n.a)().mark((function e(t){var r;return Object(n.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=y(h,t),e.next=3,ae(r&&r._f?Object(o.a)({},t,r):r);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 14:((c=e.sent.every(Boolean))||u.isValid)&&P(),e.next=21;break;case 18:return e.next=20,ae(h);case 20:c=s=e.sent;case 21:return I.state.next(Object.assign(Object.assign(Object.assign({},!j(t)||B.isValid&&s!==u.isValid?{}:{name:t}),r.resolver?{isValid:s}:{}),{errors:u.errors,isValidating:!1})),i.shouldFocus&&!c&&V(h,(function(e){return y(u.errors,e)}),t?f:_.mount),e.abrupt("return",c);case 24:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ae=function(e){var t=Object.assign(Object.assign({},p),E.mount?x:{});return v(e)?t:j(e)?y(t,e):e.map((function(e){return y(t,e)}))},ke=function(e,t){return{invalid:!!y((t||u).errors,e),isDirty:!!y((t||u).dirtyFields,e),isTouched:!!y((t||u).touchedFields,e),error:y((t||u).errors,e)}},Be=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=Object(i.a)(e?R(e):_.mount);try{for(a.s();!(t=a.n()).done;){var o=t.value;_.mount.delete(o),_.array.delete(o),y(h,o)&&(n.keepValue||(ce(h,o),ce(x,o)),!n.keepError&&ce(u.errors,o),!n.keepDirty&&ce(u.dirtyFields,o),!n.keepTouched&&ce(u.touchedFields,o),!r.shouldUnregister&&!n.keepDefaultValue&&ce(p,o))}}catch(s){a.e(s)}finally{a.f()}I.watch.next({}),I.state.next(Object.assign(Object.assign({},u),n.keepDirty?{isDirty:ue()}:{})),!n.keepIsValid&&P()},Ie=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=y(h,t),i=ee(n.disabled);return K(h,t,{_f:Object.assign(Object.assign(Object.assign({},a&&a._f?a._f:{ref:{name:t}}),{name:t,mount:!0}),n)}),_.mount.add(t),a?i&&K(x,t,n.disabled?void 0:y(x,t,ve(a._f))):Q(t,!0,n.value),Object.assign(Object.assign(Object.assign({},i?{disabled:n.disabled}:{}),r.shouldUseNativeValidation?{required:!!n.required,min:we(n.min),max:we(n.max),minLength:we(n.minLength),maxLength:we(n.maxLength),pattern:we(n.pattern)}:{}),{name:t,onChange:me,onBlur:me,ref:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(i){if(i){e(t,n),a=y(h,t);var o=v(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,s=ie(o),u=a._f.refs||[];if(s?u.find((function(e){return e===o})):o===a._f.ref)return;K(h,t,{_f:Object.assign(Object.assign({},a._f),s?{refs:[].concat(Object(c.a)(u.filter(se)),[o]),ref:{type:o.type,name:t}}:{ref:o})}),Q(t,!1,void 0,o)}else(a=y(h,t,{}))._f&&(a._f.mount=!1),(r.shouldUnregister||n.shouldUnregister)&&(!m(_.array,t)||!E.action)&&_.unMount.add(t)}))})};return{control:{register:Ie,unregister:Be,getFieldState:ke,_executeSchema:z,_getWatch:fe,_getDirty:ue,_updateValid:P,_removeUnmounted:function(){var e,t=Object(i.a)(_.unMount);try{for(t.s();!(e=t.n()).done;){var r=e.value,n=y(h,r);n&&(n._f.refs?n._f.refs.every((function(e){return!se(e)})):!se(n._f.ref))&&Be(r)}}catch(a){t.e(a)}finally{t.f()}_.unMount=new Set},_updateFieldArray:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];if(n&&r){if(E.action=!0,i&&Array.isArray(y(h,e))){var o=r(y(h,e),n.argA,n.argB);a&&K(h,e,o)}if(B.errors&&i&&Array.isArray(y(u.errors,e))){var s=r(y(u.errors,e),n.argA,n.argB);a&&K(u.errors,e,s),Ce(u.errors,e)}if(B.touchedFields&&i&&Array.isArray(y(u.touchedFields,e))){var c=r(y(u.touchedFields,e),n.argA,n.argB);a&&K(u.touchedFields,e,c)}B.dirtyFields&&(u.dirtyFields=de(p,x)),I.state.next({isDirty:ue(e,t),dirtyFields:u.dirtyFields,errors:u.errors,isValid:u.isValid})}else K(x,e,t)},_getFieldArray:function(e){return g(y(E.mount?x:p,e,t.shouldUnregister?y(p,e,[]):[]))},_subjects:I,_proxyFormState:B,get _fields(){return h},get _formValues(){return x},get _stateFlags(){return E},set _stateFlags(e){E=e},get _defaultValues(){return p},get _names(){return _},set _names(e){_=e},get _formState(){return u},set _formState(e){u=e},get _options(){return r},set _options(e){r=Object.assign(Object.assign({},r),e)}},trigger:ge,register:Ie,handleSubmit:function(e,t){return function(){var i=Object(a.a)(Object(n.a)().mark((function a(i){var o,s,c,f,d;return Object(n.a)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(i&&(i.preventDefault&&i.preventDefault(),i.persist&&i.persist()),o=!0,s=Y(x),I.state.next({isSubmitting:!0}),n.prev=4,!r.resolver){n.next=15;break}return n.next=8,z();case 8:c=n.sent,f=c.errors,d=c.values,u.errors=f,s=d,n.next=17;break;case 15:return n.next=17,ae(h);case 17:if(!T(u.errors)||!Object.keys(u.errors).every((function(e){return y(s,e)}))){n.next=23;break}return I.state.next({errors:{},isSubmitting:!0}),n.next=21,e(s,i);case 21:n.next=27;break;case 23:if(!t){n.next=26;break}return n.next=26,t(Object.assign({},u.errors),i);case 26:r.shouldFocusError&&V(h,(function(e){return y(u.errors,e)}),_.mount);case 27:n.next=33;break;case 29:throw n.prev=29,n.t0=n.catch(4),o=!1,n.t0;case 33:return n.prev=33,u.isSubmitted=!0,I.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:T(u.errors)&&o,submitCount:u.submitCount+1,errors:u.errors}),n.finish(33);case 37:case"end":return n.stop()}}),a,null,[[4,29,33,37]])})));return function(e){return i.apply(this,arguments)}}()},watch:function(e,t){return U(e)?I.watch.subscribe({next:function(r){return e(fe(void 0,t),r)}}):fe(e,t,!0)},setValue:pe,getValues:Ae,reset:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e||p,a=Y(n),c=e&&!T(e)?a:p;if(r.keepDefaultValues||(p=n),!r.keepValues){if(oe&&v(e)){var f,d=Object(i.a)(_.mount);try{for(d.s();!(f=d.n()).done;){var l=f.value,b=y(h,l);if(b&&b._f){var m=Array.isArray(b._f.refs)?b._f.refs[0]:b._f.ref;try{re(m)&&m.closest("form").reset();break}catch(g){}}}}catch(A){d.e(A)}finally{d.f()}}x=t.shouldUnregister?r.keepDefaultValues?Y(p):{}:a,h={},I.array.next({values:c}),I.watch.next({values:c})}_={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},E.mount=!B.isValid||!!r.keepIsValid,E.watch=!!t.shouldUnregister,I.state.next({submitCount:r.keepSubmitCount?u.submitCount:0,isDirty:r.keepDirty?u.isDirty:!!r.keepDefaultValues&&!Z(e,p),isSubmitted:!!r.keepIsSubmitted&&u.isSubmitted,dirtyFields:r.keepDirty?u.dirtyFields:r.keepDefaultValues&&e?Object.entries(e).reduce((function(e,t){var r=Object(s.a)(t,2),n=r[0],a=r[1];return Object.assign(Object.assign({},e),Object(o.a)({},n,a!==y(p,n)))}),{}):{},touchedFields:r.keepTouched?u.touchedFields:{},errors:r.keepErrors?u.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},resetField:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};y(h,e)&&(v(t.defaultValue)?pe(e,y(p,e)):(pe(e,t.defaultValue),K(p,e,t.defaultValue)),t.keepTouched||ce(u.touchedFields,e),t.keepDirty||(ce(u.dirtyFields,e),u.isDirty=t.defaultValue?ue(e,y(p,e)):ue()),t.keepError||(ce(u.errors,e),B.isValid&&P()),I.state.next(Object.assign({},u)))},clearErrors:function(e){e?R(e).forEach((function(e){return ce(u.errors,e)})):u.errors={},I.state.next({errors:u.errors})},unregister:Be,setError:function(e,t,r){var n=(y(h,e,{_f:{}})._f||{}).ref;K(u.errors,e,Object.assign(Object.assign({},t),{ref:n})),I.state.next({name:e,errors:u.errors,isValid:!1}),r&&r.shouldFocus&&n&&n.focus&&n.focus()},setFocus:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=y(h,e)._f,n=r.refs?r.refs[0]:r.ref;t.shouldSelect?n.select():n.focus()},getFieldState:ke}}function De(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=u.useRef(),r=u.useState({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touchedFields:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,errors:{}}),n=Object(s.a)(r,2),a=n[0],i=n[1];t.current?t.current.control._options=e:t.current=Object.assign(Object.assign({},Me(e)),{formState:a});var o=t.current.control,c=u.useCallback((function(e){F(e,o._proxyFormState,!0)&&(o._formState=Object.assign(Object.assign({},o._formState),e),i(Object.assign({},o._formState)))}),[o]);return N({subject:o._subjects.state,callback:c}),u.useEffect((function(){o._stateFlags.mount||(o._proxyFormState.isValid&&o._updateValid(),o._stateFlags.mount=!0),o._stateFlags.watch&&(o._stateFlags.watch=!1,o._subjects.state.next({})),o._removeUnmounted()})),t.current.formState=D(a,o._proxyFormState),t.current}},function(e,t,r){var n,a,i;!function(o){var s="object"==typeof o.sodium&&"function"==typeof o.sodium.onload?o.sodium.onload:null;a=[t,r(3500)],n=function(e,t){"use strict";var r,n=t.ready.then((function(){function n(){if(0!==r._sodium_init())throw new Error("libsodium was not correctly initialized.");for(var t=["crypto_aead_chacha20poly1305_decrypt","crypto_aead_chacha20poly1305_decrypt_detached","crypto_aead_chacha20poly1305_encrypt","crypto_aead_chacha20poly1305_encrypt_detached","crypto_aead_chacha20poly1305_ietf_decrypt","crypto_aead_chacha20poly1305_ietf_decrypt_detached","crypto_aead_chacha20poly1305_ietf_encrypt","crypto_aead_chacha20poly1305_ietf_encrypt_detached","crypto_aead_chacha20poly1305_ietf_keygen","crypto_aead_chacha20poly1305_keygen","crypto_aead_xchacha20poly1305_ietf_decrypt","crypto_aead_xchacha20poly1305_ietf_decrypt_detached","crypto_aead_xchacha20poly1305_ietf_encrypt","crypto_aead_xchacha20poly1305_ietf_encrypt_detached","crypto_aead_xchacha20poly1305_ietf_keygen","crypto_auth","crypto_auth_hmacsha256","crypto_auth_hmacsha256_keygen","crypto_auth_hmacsha256_verify","crypto_auth_hmacsha512","crypto_auth_hmacsha512_keygen","crypto_auth_hmacsha512_verify","crypto_auth_keygen","crypto_auth_verify","crypto_box_beforenm","crypto_box_curve25519xchacha20poly1305_keypair","crypto_box_curve25519xchacha20poly1305_seal","crypto_box_curve25519xchacha20poly1305_seal_open","crypto_box_detached","crypto_box_easy","crypto_box_easy_afternm","crypto_box_keypair","crypto_box_open_detached","crypto_box_open_easy","crypto_box_open_easy_afternm","crypto_box_seal","crypto_box_seal_open","crypto_box_seed_keypair","crypto_core_ed25519_add","crypto_core_ed25519_from_hash","crypto_core_ed25519_from_uniform","crypto_core_ed25519_is_valid_point","crypto_core_ed25519_random","crypto_core_ed25519_scalar_add","crypto_core_ed25519_scalar_complement","crypto_core_ed25519_scalar_invert","crypto_core_ed25519_scalar_mul","crypto_core_ed25519_scalar_negate","crypto_core_ed25519_scalar_random","crypto_core_ed25519_scalar_reduce","crypto_core_ed25519_scalar_sub","crypto_core_ed25519_sub","crypto_core_ristretto255_add","crypto_core_ristretto255_from_hash","crypto_core_ristretto255_is_valid_point","crypto_core_ristretto255_random","crypto_core_ristretto255_scalar_add","crypto_core_ristretto255_scalar_complement","crypto_core_ristretto255_scalar_invert","crypto_core_ristretto255_scalar_mul","crypto_core_ristretto255_scalar_negate","crypto_core_ristretto255_scalar_random","crypto_core_ristretto255_scalar_reduce","crypto_core_ristretto255_scalar_sub","crypto_core_ristretto255_sub","crypto_generichash","crypto_generichash_blake2b_salt_personal","crypto_generichash_final","crypto_generichash_init","crypto_generichash_keygen","crypto_generichash_update","crypto_hash","crypto_hash_sha256","crypto_hash_sha256_final","crypto_hash_sha256_init","crypto_hash_sha256_update","crypto_hash_sha512","crypto_hash_sha512_final","crypto_hash_sha512_init","crypto_hash_sha512_update","crypto_kdf_derive_from_key","crypto_kdf_keygen","crypto_kx_client_session_keys","crypto_kx_keypair","crypto_kx_seed_keypair","crypto_kx_server_session_keys","crypto_onetimeauth","crypto_onetimeauth_final","crypto_onetimeauth_init","crypto_onetimeauth_keygen","crypto_onetimeauth_update","crypto_onetimeauth_verify","crypto_pwhash","crypto_pwhash_scryptsalsa208sha256","crypto_pwhash_scryptsalsa208sha256_ll","crypto_pwhash_scryptsalsa208sha256_str","crypto_pwhash_scryptsalsa208sha256_str_verify","crypto_pwhash_str","crypto_pwhash_str_needs_rehash","crypto_pwhash_str_verify","crypto_scalarmult","crypto_scalarmult_base","crypto_scalarmult_ed25519","crypto_scalarmult_ed25519_base","crypto_scalarmult_ed25519_base_noclamp","crypto_scalarmult_ed25519_noclamp","crypto_scalarmult_ristretto255","crypto_scalarmult_ristretto255_base","crypto_secretbox_detached","crypto_secretbox_easy","crypto_secretbox_keygen","crypto_secretbox_open_detached","crypto_secretbox_open_easy","crypto_secretstream_xchacha20poly1305_init_pull","crypto_secretstream_xchacha20poly1305_init_push","crypto_secretstream_xchacha20poly1305_keygen","crypto_secretstream_xchacha20poly1305_pull","crypto_secretstream_xchacha20poly1305_push","crypto_secretstream_xchacha20poly1305_rekey","crypto_shorthash","crypto_shorthash_keygen","crypto_shorthash_siphashx24","crypto_sign","crypto_sign_detached","crypto_sign_ed25519_pk_to_curve25519","crypto_sign_ed25519_sk_to_curve25519","crypto_sign_ed25519_sk_to_pk","crypto_sign_ed25519_sk_to_seed","crypto_sign_final_create","crypto_sign_final_verify","crypto_sign_init","crypto_sign_keypair","crypto_sign_open","crypto_sign_seed_keypair","crypto_sign_update","crypto_sign_verify_detached","crypto_stream_chacha20","crypto_stream_chacha20_ietf_xor","crypto_stream_chacha20_ietf_xor_ic","crypto_stream_chacha20_keygen","crypto_stream_chacha20_xor","crypto_stream_chacha20_xor_ic","crypto_stream_keygen","crypto_stream_xchacha20_keygen","crypto_stream_xchacha20_xor","crypto_stream_xchacha20_xor_ic","randombytes_buf","randombytes_buf_deterministic","randombytes_close","randombytes_random","randombytes_set_implementation","randombytes_stir","randombytes_uniform","sodium_version_string"],n=[w,x,E,_,C,k,B,I,S,O,M,D,T,F,R,P,N,j,L,U,Q,G,H,z,q,K,V,W,Y,J,X,Z,$,ee,te,re,ne,ae,ie,oe,se,ce,ue,fe,de,le,he,pe,be,me,ge,ve,ye,Ae,we,xe,Ee,_e,Ce,ke,Be,Ie,Se,Oe,Me,De,Te,Fe,Re,Pe,Ne,je,Le,Ue,Qe,Ge,He,ze,qe,Ke,Ve,We,Ye,Je,Xe,Ze,$e,et,tt,rt,nt,at,it,ot,st,ct,ut,ft,dt,lt,ht,pt,bt,mt,gt,vt,yt,At,wt,xt,Et,_t,Ct,kt,Bt,It,St,Ot,Mt,Dt,Tt,Ft,Rt,Pt,Nt,jt,Lt,Ut,Qt,Gt,Ht,zt,qt,Kt,Vt,Wt,Yt,Jt,Xt,Zt,$t,er,tr,rr,nr,ar,ir,or,sr,cr,ur,fr,dr,lr],a=0;a=240?(f=4,c=!0):d>=224?(f=3,c=!0):d>=192?(f=2,c=!0):d<128&&(f=1,c=!0)}while(!c);for(var l=f-(s.length-u),h=0;h>8&-39)<<8|87+(t=e[i]>>>4)+(t-10>>8&-39),a+=String.fromCharCode(255&n)+String.fromCharCode(n>>>8);return a}var s={ORIGINAL:1,ORIGINAL_NO_PADDING:3,URLSAFE:5,URLSAFE_NO_PADDING:7};function c(e){if(null==e)return s.URLSAFE_NO_PADDING;if(e!==s.ORIGINAL&&e!==s.ORIGINAL_NO_PADDING&&e!==s.URLSAFE&&e!=s.URLSAFE_NO_PADDING)throw new Error("unsupported base64 variant");return e}function u(e,t){t=c(t),e=A(a,e,"input");var n,a=[],o=0|Math.floor(e.length/3),s=e.length-3*o,u=4*o+(0!==s?0==(2&t)?4:2+(s>>>1):0),f=new h(u+1),d=p(e);return a.push(d),a.push(f.address),0===r._sodium_bin2base64(f.address,f.length,d,e.length,t)&&g(a,"conversion failed"),f.length=u,n=i(f.to_Uint8Array()),m(a),n}function f(e,t){var r=t||"uint8array";if(!d(r))throw new Error(r+" output format is not available");if(e instanceof h){if("uint8array"===r)return e.to_Uint8Array();if("text"===r)return i(e.to_Uint8Array());if("hex"===r)return o(e.to_Uint8Array());if("base64"===r)return u(e.to_Uint8Array(),s.URLSAFE_NO_PADDING);throw new Error('What is output format "'+r+'"?')}if("object"==typeof e){for(var n=Object.keys(e),a={},c=0;c>>24>>>8,c,d);var x=f(g,o);return m(s),x}function We(e){var t=[];l(e);var n=new h(0|r._crypto_kdf_keybytes()),a=n.address;t.push(a),r._crypto_kdf_keygen(a);var i=f(n,e);return m(t),i}function Ye(e,t,n,a){var i=[];l(a),e=A(i,e,"clientPublicKey");var o,s=0|r._crypto_kx_publickeybytes();e.length!==s&&v(i,"invalid clientPublicKey length"),o=p(e),i.push(o),t=A(i,t,"clientSecretKey");var c,u=0|r._crypto_kx_secretkeybytes();t.length!==u&&v(i,"invalid clientSecretKey length"),c=p(t),i.push(c),n=A(i,n,"serverPublicKey");var d,b=0|r._crypto_kx_publickeybytes();n.length!==b&&v(i,"invalid serverPublicKey length"),d=p(n),i.push(d);var y=new h(0|r._crypto_kx_sessionkeybytes()),w=y.address;i.push(w);var x=new h(0|r._crypto_kx_sessionkeybytes()),E=x.address;if(i.push(E),0==(0|r._crypto_kx_client_session_keys(w,E,o,c,d))){var _=f({sharedRx:y,sharedTx:x},a);return m(i),_}g(i,"invalid usage")}function Je(e){var t=[];l(e);var n=new h(0|r._crypto_kx_publickeybytes()),a=n.address;t.push(a);var i=new h(0|r._crypto_kx_secretkeybytes()),o=i.address;if(t.push(o),0==(0|r._crypto_kx_keypair(a,o))){var s={publicKey:f(n,e),privateKey:f(i,e),keyType:"x25519"};return m(t),s}g(t,"internal error")}function Xe(e,t){var n=[];l(t),e=A(n,e,"seed");var a,i=0|r._crypto_kx_seedbytes();e.length!==i&&v(n,"invalid seed length"),a=p(e),n.push(a);var o=new h(0|r._crypto_kx_publickeybytes()),s=o.address;n.push(s);var c=new h(0|r._crypto_kx_secretkeybytes()),u=c.address;if(n.push(u),0==(0|r._crypto_kx_seed_keypair(s,u,a))){var d={publicKey:f(o,t),privateKey:f(c,t),keyType:"x25519"};return m(n),d}g(n,"internal error")}function Ze(e,t,n,a){var i=[];l(a),e=A(i,e,"serverPublicKey");var o,s=0|r._crypto_kx_publickeybytes();e.length!==s&&v(i,"invalid serverPublicKey length"),o=p(e),i.push(o),t=A(i,t,"serverSecretKey");var c,u=0|r._crypto_kx_secretkeybytes();t.length!==u&&v(i,"invalid serverSecretKey length"),c=p(t),i.push(c),n=A(i,n,"clientPublicKey");var d,b=0|r._crypto_kx_publickeybytes();n.length!==b&&v(i,"invalid clientPublicKey length"),d=p(n),i.push(d);var y=new h(0|r._crypto_kx_sessionkeybytes()),w=y.address;i.push(w);var x=new h(0|r._crypto_kx_sessionkeybytes()),E=x.address;if(i.push(E),0==(0|r._crypto_kx_server_session_keys(w,E,o,c,d))){var _=f({sharedRx:y,sharedTx:x},a);return m(i),_}g(i,"invalid usage")}function $e(e,t,n){var a=[];l(n);var i=p(e=A(a,e,"message")),o=e.length;a.push(i),t=A(a,t,"key");var s,c=0|r._crypto_onetimeauth_keybytes();t.length!==c&&v(a,"invalid key length"),s=p(t),a.push(s);var u=new h(0|r._crypto_onetimeauth_bytes()),d=u.address;if(a.push(d),0==(0|r._crypto_onetimeauth(d,i,o,0,s))){var b=f(u,n);return m(a),b}g(a,"invalid usage")}function et(e,t){var n=[];l(t),y(n,e,"state_address");var a=new h(0|r._crypto_onetimeauth_bytes()),i=a.address;if(n.push(i),0==(0|r._crypto_onetimeauth_final(e,i))){var o=(r._free(e),f(a,t));return m(n),o}g(n,"invalid usage")}function tt(e,t){var n=[];l(t);var a=null;null!=e&&(a=p(e=A(n,e,"key")),e.length,n.push(a));var i=new h(144).address;if(0==(0|r._crypto_onetimeauth_init(i,a))){var o=i;return m(n),o}g(n,"invalid usage")}function rt(e){var t=[];l(e);var n=new h(0|r._crypto_onetimeauth_keybytes()),a=n.address;t.push(a),r._crypto_onetimeauth_keygen(a);var i=f(n,e);return m(t),i}function nt(e,t,n){var a=[];l(n),y(a,e,"state_address");var i=p(t=A(a,t,"message_chunk")),o=t.length;a.push(i),0!=(0|r._crypto_onetimeauth_update(e,i,o))&&g(a,"invalid usage"),m(a)}function at(e,t,n){var a=[];e=A(a,e,"hash");var i,o=0|r._crypto_onetimeauth_bytes();e.length!==o&&v(a,"invalid hash length"),i=p(e),a.push(i);var s=p(t=A(a,t,"message")),c=t.length;a.push(s),n=A(a,n,"key");var u,f=0|r._crypto_onetimeauth_keybytes();n.length!==f&&v(a,"invalid key length"),u=p(n),a.push(u);var d=0==(0|r._crypto_onetimeauth_verify(i,s,c,0,u));return m(a),d}function it(e,t,n,a,i,o,s){var c=[];l(s),y(c,e,"keyLength"),("number"!=typeof e||(0|e)!==e||e<0)&&v(c,"keyLength must be an unsigned integer");var u=p(t=A(c,t,"password")),d=t.length;c.push(u),n=A(c,n,"salt");var b,w=0|r._crypto_pwhash_saltbytes();n.length!==w&&v(c,"invalid salt length"),b=p(n),c.push(b),y(c,a,"opsLimit"),("number"!=typeof a||(0|a)!==a||a<0)&&v(c,"opsLimit must be an unsigned integer"),y(c,i,"memLimit"),("number"!=typeof i||(0|i)!==i||i<0)&&v(c,"memLimit must be an unsigned integer"),y(c,o,"algorithm"),("number"!=typeof o||(0|o)!==o||o<0)&&v(c,"algorithm must be an unsigned integer");var x=new h(0|e),E=x.address;if(c.push(E),0==(0|r._crypto_pwhash(E,e,0,u,d,0,b,a,0,i,o))){var _=f(x,s);return m(c),_}g(c,"invalid usage")}function ot(e,t,n,a,i,o){var s=[];l(o),y(s,e,"keyLength"),("number"!=typeof e||(0|e)!==e||e<0)&&v(s,"keyLength must be an unsigned integer");var c=p(t=A(s,t,"password")),u=t.length;s.push(c),n=A(s,n,"salt");var d,b=0|r._crypto_pwhash_scryptsalsa208sha256_saltbytes();n.length!==b&&v(s,"invalid salt length"),d=p(n),s.push(d),y(s,a,"opsLimit"),("number"!=typeof a||(0|a)!==a||a<0)&&v(s,"opsLimit must be an unsigned integer"),y(s,i,"memLimit"),("number"!=typeof i||(0|i)!==i||i<0)&&v(s,"memLimit must be an unsigned integer");var w=new h(0|e),x=w.address;if(s.push(x),0==(0|r._crypto_pwhash_scryptsalsa208sha256(x,e,0,c,u,0,d,a,0,i))){var E=f(w,o);return m(s),E}g(s,"invalid usage")}function st(e,t,n,a,i,o,s){var c=[];l(s);var u=p(e=A(c,e,"password")),d=e.length;c.push(u);var b=p(t=A(c,t,"salt")),w=t.length;c.push(b),y(c,n,"opsLimit"),("number"!=typeof n||(0|n)!==n||n<0)&&v(c,"opsLimit must be an unsigned integer"),y(c,a,"r"),("number"!=typeof a||(0|a)!==a||a<0)&&v(c,"r must be an unsigned integer"),y(c,i,"p"),("number"!=typeof i||(0|i)!==i||i<0)&&v(c,"p must be an unsigned integer"),y(c,o,"keyLength"),("number"!=typeof o||(0|o)!==o||o<0)&&v(c,"keyLength must be an unsigned integer");var x=new h(0|o),E=x.address;if(c.push(E),0==(0|r._crypto_pwhash_scryptsalsa208sha256_ll(u,d,b,w,n,0,a,i,E,o))){var _=f(x,s);return m(c),_}g(c,"invalid usage")}function ct(e,t,n,a){var i=[];l(a);var o=p(e=A(i,e,"password")),s=e.length;i.push(o),y(i,t,"opsLimit"),("number"!=typeof t||(0|t)!==t||t<0)&&v(i,"opsLimit must be an unsigned integer"),y(i,n,"memLimit"),("number"!=typeof n||(0|n)!==n||n<0)&&v(i,"memLimit must be an unsigned integer");var c=new h(0|r._crypto_pwhash_scryptsalsa208sha256_strbytes()).address;if(i.push(c),0==(0|r._crypto_pwhash_scryptsalsa208sha256_str(c,o,s,0,t,0,n))){var u=r.UTF8ToString(c);return m(i),u}g(i,"invalid usage")}function ut(e,t,n){var i=[];l(n),"string"!=typeof e&&v(i,"hashed_password must be a string"),e=a(e+"\0"),null!=s&&e.length-1!==s&&v(i,"invalid hashed_password length");var o=p(e),s=e.length-1;i.push(o);var c=p(t=A(i,t,"password")),u=t.length;i.push(c);var f=0==(0|r._crypto_pwhash_scryptsalsa208sha256_str_verify(o,c,u,0));return m(i),f}function ft(e,t,n,a){var i=[];l(a);var o=p(e=A(i,e,"password")),s=e.length;i.push(o),y(i,t,"opsLimit"),("number"!=typeof t||(0|t)!==t||t<0)&&v(i,"opsLimit must be an unsigned integer"),y(i,n,"memLimit"),("number"!=typeof n||(0|n)!==n||n<0)&&v(i,"memLimit must be an unsigned integer");var c=new h(0|r._crypto_pwhash_strbytes()).address;if(i.push(c),0==(0|r._crypto_pwhash_str(c,o,s,0,t,0,n))){var u=r.UTF8ToString(c);return m(i),u}g(i,"invalid usage")}function dt(e,t,n,i){var o=[];l(i),"string"!=typeof e&&v(o,"hashed_password must be a string"),e=a(e+"\0"),null!=c&&e.length-1!==c&&v(o,"invalid hashed_password length");var s=p(e),c=e.length-1;o.push(s),y(o,t,"opsLimit"),("number"!=typeof t||(0|t)!==t||t<0)&&v(o,"opsLimit must be an unsigned integer"),y(o,n,"memLimit"),("number"!=typeof n||(0|n)!==n||n<0)&&v(o,"memLimit must be an unsigned integer");var u=0!=(0|r._crypto_pwhash_str_needs_rehash(s,t,0,n));return m(o),u}function lt(e,t,n){var i=[];l(n),"string"!=typeof e&&v(i,"hashed_password must be a string"),e=a(e+"\0"),null!=s&&e.length-1!==s&&v(i,"invalid hashed_password length");var o=p(e),s=e.length-1;i.push(o);var c=p(t=A(i,t,"password")),u=t.length;i.push(c);var f=0==(0|r._crypto_pwhash_str_verify(o,c,u,0));return m(i),f}function ht(e,t,n){var a=[];l(n),e=A(a,e,"privateKey");var i,o=0|r._crypto_scalarmult_scalarbytes();e.length!==o&&v(a,"invalid privateKey length"),i=p(e),a.push(i),t=A(a,t,"publicKey");var s,c=0|r._crypto_scalarmult_bytes();t.length!==c&&v(a,"invalid publicKey length"),s=p(t),a.push(s);var u=new h(0|r._crypto_scalarmult_bytes()),d=u.address;if(a.push(d),0==(0|r._crypto_scalarmult(d,i,s))){var b=f(u,n);return m(a),b}g(a,"weak public key")}function pt(e,t){var n=[];l(t),e=A(n,e,"privateKey");var a,i=0|r._crypto_scalarmult_scalarbytes();e.length!==i&&v(n,"invalid privateKey length"),a=p(e),n.push(a);var o=new h(0|r._crypto_scalarmult_bytes()),s=o.address;if(n.push(s),0==(0|r._crypto_scalarmult_base(s,a))){var c=f(o,t);return m(n),c}g(n,"unknown error")}function bt(e,t,n){var a=[];l(n),e=A(a,e,"n");var i,o=0|r._crypto_scalarmult_ed25519_scalarbytes();e.length!==o&&v(a,"invalid n length"),i=p(e),a.push(i),t=A(a,t,"p");var s,c=0|r._crypto_scalarmult_ed25519_bytes();t.length!==c&&v(a,"invalid p length"),s=p(t),a.push(s);var u=new h(0|r._crypto_scalarmult_ed25519_bytes()),d=u.address;if(a.push(d),0==(0|r._crypto_scalarmult_ed25519(d,i,s))){var b=f(u,n);return m(a),b}g(a,"invalid point or scalar is 0")}function mt(e,t){var n=[];l(t),e=A(n,e,"scalar");var a,i=0|r._crypto_scalarmult_ed25519_scalarbytes();e.length!==i&&v(n,"invalid scalar length"),a=p(e),n.push(a);var o=new h(0|r._crypto_scalarmult_ed25519_bytes()),s=o.address;if(n.push(s),0==(0|r._crypto_scalarmult_ed25519_base(s,a))){var c=f(o,t);return m(n),c}g(n,"scalar is 0")}function gt(e,t){var n=[];l(t),e=A(n,e,"scalar");var a,i=0|r._crypto_scalarmult_ed25519_scalarbytes();e.length!==i&&v(n,"invalid scalar length"),a=p(e),n.push(a);var o=new h(0|r._crypto_scalarmult_ed25519_bytes()),s=o.address;if(n.push(s),0==(0|r._crypto_scalarmult_ed25519_base_noclamp(s,a))){var c=f(o,t);return m(n),c}g(n,"scalar is 0")}function vt(e,t,n){var a=[];l(n),e=A(a,e,"n");var i,o=0|r._crypto_scalarmult_ed25519_scalarbytes();e.length!==o&&v(a,"invalid n length"),i=p(e),a.push(i),t=A(a,t,"p");var s,c=0|r._crypto_scalarmult_ed25519_bytes();t.length!==c&&v(a,"invalid p length"),s=p(t),a.push(s);var u=new h(0|r._crypto_scalarmult_ed25519_bytes()),d=u.address;if(a.push(d),0==(0|r._crypto_scalarmult_ed25519_noclamp(d,i,s))){var b=f(u,n);return m(a),b}g(a,"invalid point or scalar is 0")}function yt(e,t,n){var a=[];l(n),e=A(a,e,"scalar");var i,o=0|r._crypto_scalarmult_ristretto255_scalarbytes();e.length!==o&&v(a,"invalid scalar length"),i=p(e),a.push(i),t=A(a,t,"element");var s,c=0|r._crypto_scalarmult_ristretto255_bytes();t.length!==c&&v(a,"invalid element length"),s=p(t),a.push(s);var u=new h(0|r._crypto_scalarmult_ristretto255_bytes()),d=u.address;if(a.push(d),0==(0|r._crypto_scalarmult_ristretto255(d,i,s))){var b=f(u,n);return m(a),b}g(a,"result is identity element")}function At(e,t){var n=[];l(t),e=A(n,e,"scalar");var a,i=0|r._crypto_core_ristretto255_scalarbytes();e.length!==i&&v(n,"invalid scalar length"),a=p(e),n.push(a);var o=new h(0|r._crypto_core_ristretto255_bytes()),s=o.address;if(n.push(s),0==(0|r._crypto_scalarmult_ristretto255_base(s,a))){var c=f(o,t);return m(n),c}g(n,"scalar is 0")}function wt(e,t,n,a){var i=[];l(a);var o=p(e=A(i,e,"message")),s=e.length;i.push(o),t=A(i,t,"nonce");var c,u=0|r._crypto_secretbox_noncebytes();t.length!==u&&v(i,"invalid nonce length"),c=p(t),i.push(c),n=A(i,n,"key");var d,b=0|r._crypto_secretbox_keybytes();n.length!==b&&v(i,"invalid key length"),d=p(n),i.push(d);var y=new h(0|s),w=y.address;i.push(w);var x=new h(0|r._crypto_secretbox_macbytes()),E=x.address;if(i.push(E),0==(0|r._crypto_secretbox_detached(w,E,o,s,0,c,d))){var _=f({mac:x,cipher:y},a);return m(i),_}g(i,"invalid usage")}function xt(e,t,n,a){var i=[];l(a);var o=p(e=A(i,e,"message")),s=e.length;i.push(o),t=A(i,t,"nonce");var c,u=0|r._crypto_secretbox_noncebytes();t.length!==u&&v(i,"invalid nonce length"),c=p(t),i.push(c),n=A(i,n,"key");var d,b=0|r._crypto_secretbox_keybytes();n.length!==b&&v(i,"invalid key length"),d=p(n),i.push(d);var y=new h(s+r._crypto_secretbox_macbytes()|0),w=y.address;if(i.push(w),0==(0|r._crypto_secretbox_easy(w,o,s,0,c,d))){var x=f(y,a);return m(i),x}g(i,"invalid usage")}function Et(e){var t=[];l(e);var n=new h(0|r._crypto_secretbox_keybytes()),a=n.address;t.push(a),r._crypto_secretbox_keygen(a);var i=f(n,e);return m(t),i}function _t(e,t,n,a,i){var o=[];l(i);var s=p(e=A(o,e,"ciphertext")),c=e.length;o.push(s),t=A(o,t,"mac");var u,d=0|r._crypto_secretbox_macbytes();t.length!==d&&v(o,"invalid mac length"),u=p(t),o.push(u),n=A(o,n,"nonce");var b,y=0|r._crypto_secretbox_noncebytes();n.length!==y&&v(o,"invalid nonce length"),b=p(n),o.push(b),a=A(o,a,"key");var w,x=0|r._crypto_secretbox_keybytes();a.length!==x&&v(o,"invalid key length"),w=p(a),o.push(w);var E=new h(0|c),_=E.address;if(o.push(_),0==(0|r._crypto_secretbox_open_detached(_,s,u,c,0,b,w))){var C=f(E,i);return m(o),C}g(o,"wrong secret key for the given ciphertext")}function Ct(e,t,n,a){var i=[];l(a),e=A(i,e,"ciphertext");var o,s=r._crypto_secretbox_macbytes(),c=e.length;c