@agentlang/lstudio 0.5.6 → 0.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/AwsJson1_1Protocol-BPKAibNb.js +1 -0
- package/assets/AwsQueryProtocol-gcsdfhfo.js +1 -0
- package/assets/XmlShapeDeserializer-yfMUWnPw.js +1 -0
- package/assets/_commonjs-dynamic-modules-B90KZyeo-MqqgM5Sj.js +1 -0
- package/assets/_commonjs-dynamic-modules-D244begT.js +1 -0
- package/assets/aws-BDH7ihg3.js +1 -0
- package/assets/documentFetcher-DXduTBqD-jqdP0czN.js +67 -0
- package/assets/documentFetcher-Ds-FwFaK.js +8 -0
- package/assets/index-BTpRe6xv-w-5JgxLH.js +1 -0
- package/assets/index-BWkXARMt.js +1 -0
- package/assets/index-BhYX3qBc.js +1 -0
- package/assets/{index-BFv-M3PX.js → index-BvJIpPZM.js} +14 -14
- package/assets/{index-BT-B0wMw.js → index-Bxvbin5N.js} +1837 -10339
- package/assets/index-CDKpgEyj-tyrSWl01.js +8753 -0
- package/assets/index-CZHYN75I.css +1 -0
- package/assets/index-Cv6PsiG7.js +1 -0
- package/assets/{index-KGBiLwKE-Doz2tX9S.js → index-D9hvpHrT-D460pOJZ.js} +7 -7
- package/assets/index-DGSGqHDe.js +1 -0
- package/assets/index-DRgW1--O-Be3NpfgF.js +17 -0
- package/assets/index-Dk98TczE-BtSqF03o.js +1 -0
- package/assets/{index-DYmn2gQ6-CnjFa625.js → index-DuUQBJXO-gNsOEp1C.js} +1 -1
- package/assets/{index-BitrXVkV.js → index-DzXvkWz5.js} +1 -1
- package/assets/{index-CAsiSxeK.js → index-QhSmQuQt.js} +9 -9
- package/assets/index-_duzuPdC.js +15 -0
- package/assets/{index-D4z_hbl0-CD1MieBA.js → index-ruSRuF6L-BjzIBLlQ.js} +9 -9
- package/assets/index.browser-DC-BI9vG.js +5 -0
- package/assets/index.browser-yI_W1hK0-C1Oinehc.js +1 -0
- package/assets/loadCognitoIdentity-C6X581JO.js +1 -0
- package/assets/loadSts-BLVzhgX4.js +1 -0
- package/assets/noAuth-Cp7LDRaC.js +1 -0
- package/assets/{normalizeProvider-CtDY37Q6.js → normalizeProvider-Cd9_AiS_.js} +1 -1
- package/assets/pdf-parse.es-Bg6uvNNe-3L3fe-Mc.js +26 -0
- package/assets/pdf-parse.es-CO6QlkPs.js +26 -0
- package/assets/replService-CPKXCVUs.js +1 -0
- package/assets/sdk-stream-mixin.browser-Dycc9CbH.js +2 -0
- package/assets/{winston-DA9FnRtM.js → winston-BWsrMlta.js} +27 -27
- package/assets/{winston-fLGSL0tu.js → winston-BvOMKj10.js} +1 -1
- package/assets/winston-CnOlwptw-BXt6VwZK.js +1 -0
- package/assets/{winston-1qzyIKCb-DfRv1PO8.js → winston-Dk1WXlDf--OwDrr6q.js} +27 -27
- package/index.html +6 -12
- package/package.json +1 -1
- package/assets/__vite-browser-external-BDMct_Gn-FmFgRqLi.js +0 -1
- package/assets/__vite-browser-external-DLjrMatA.js +0 -1
- package/assets/_commonjs-dynamic-modules-BpilXLfW-DfYEAvWy.js +0 -1
- package/assets/_commonjs-dynamic-modules-DkOKMH7F.js +0 -1
- package/assets/index-69shuAsh-DF18H7zf.js +0 -1
- package/assets/index-6mr3sa6o.js +0 -1
- package/assets/index-B0dS78d1.js +0 -1
- package/assets/index-BJBOx-Z---hbiLl7B.js +0 -5
- package/assets/index-BXMy9UIl.js +0 -1
- package/assets/index-Bto-kj6R-C0A_3Pwb.js +0 -1
- package/assets/index-ChvoNxcO.js +0 -5
- package/assets/index-CpjrEQ_o.css +0 -1
- package/assets/index-DSosZ5sh-Ceejs_jv.js +0 -1
- package/assets/index-DTNuphFO-Bf5Ad1xs.js +0 -17
- package/assets/index-Dlh-KIx4.js +0 -1
- package/assets/index-DsIu-45t-Bejjlpz4.js +0 -6
- package/assets/index.browser-1cO3jWRU.js +0 -6
- package/assets/index.browser-BHPvGrwi-6Mh8eUw-.js +0 -1
- package/assets/inherits_browser-nmOknR35-Bp0mvRSL.js +0 -1
- package/assets/loadCognitoIdentity-DbqOiF04.js +0 -1
- package/assets/loadSts-D8r_UqTz.js +0 -1
- package/assets/replService-CZE13KTw.js +0 -1
- package/assets/resolveDefaultsModeConfig-BaVgVWbD.js +0 -15
- package/assets/util-B4ZV5RJW.js +0 -10
- package/assets/util-CNqBjtt6-GUXK7Yxz.js +0 -10
- package/assets/util-DZRIOW0Z-CproX86h.js +0 -1
- package/assets/winston-CtxF18qc-B_oJRj0X.js +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{c as We,a as Oe}from"./_commonjsHelpers-D6-XlEtG.js";import{
|
|
1
|
+
import{c as We,a as Oe}from"./_commonjsHelpers-D6-XlEtG.js";import{r as Ot,a as Nt,c as Kt}from"./_commonjs-dynamic-modules-D244begT.js";/*!
|
|
2
2
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/var
|
|
4
|
+
*/var kn=(function(){function o(r){var e=r||{},a=e.ValidationData,s=e.Username,f=e.Password,u=e.AuthParameters,l=e.ClientMetadata;this.validationData=a||{},this.authParameters=u||{},this.clientMetadata=l||{},this.username=s,this.password=f}var t=o.prototype;return t.getUsername=function(){return this.username},t.getPassword=function(){return this.password},t.getValidationData=function(){return this.validationData},t.getAuthParameters=function(){return this.authParameters},t.getClientMetadata=function(){return this.clientMetadata},o})(),Ae={},Ue,Je;function kt(){if(Je)return Ue;Je=1;var o={}.toString;return Ue=Array.isArray||function(t){return o.call(t)=="[object Array]"},Ue}/*!
|
|
5
5
|
* The buffer module from node.js, for the browser.
|
|
6
6
|
*
|
|
7
7
|
* @author Feross Aboukhadijeh <http://feross.org>
|
|
8
8
|
* @license MIT
|
|
9
|
-
*/var Ge;function Vt(){return Ge||(Ge=1,(function(o){var t=Ot(),r=Nt(),e=qt();o.Buffer=u,o.SlowBuffer=T,o.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=We.TYPED_ARRAY_SUPPORT!==void 0?We.TYPED_ARRAY_SUPPORT:a(),o.kMaxLength=s();function a(){try{var h=new Uint8Array(1);return h.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},h.foo()===42&&typeof h.subarray=="function"&&h.subarray(1,1).byteLength===0}catch{return!1}}function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(h,n){if(s()<n)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(h=new Uint8Array(n),h.__proto__=u.prototype):(h===null&&(h=new u(n)),h.length=n),h}function u(h,n,i){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(h,n,i);if(typeof h=="number"){if(typeof n=="string")throw new Error("If encoding is specified then the first argument must be a string");return y(this,h)}return l(this,h,n,i)}u.poolSize=8192,u._augment=function(h){return h.__proto__=u.prototype,h};function l(h,n,i,c){if(typeof n=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&n instanceof ArrayBuffer?A(h,n,i,c):typeof n=="string"?S(h,n,i):C(h,n)}u.from=function(h,n,i){return l(null,h,n,i)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0}));function p(h){if(typeof h!="number")throw new TypeError('"size" argument must be a number');if(h<0)throw new RangeError('"size" argument must not be negative')}function d(h,n,i,c){return p(n),n<=0?f(h,n):i!==void 0?typeof c=="string"?f(h,n).fill(i,c):f(h,n).fill(i):f(h,n)}u.alloc=function(h,n,i){return d(null,h,n,i)};function y(h,n){if(p(n),h=f(h,n<0?0:D(n)|0),!u.TYPED_ARRAY_SUPPORT)for(var i=0;i<n;++i)h[i]=0;return h}u.allocUnsafe=function(h){return y(null,h)},u.allocUnsafeSlow=function(h){return y(null,h)};function S(h,n,i){if((typeof i!="string"||i==="")&&(i="utf8"),!u.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var c=P(n,i)|0;h=f(h,c);var g=h.write(n,i);return g!==c&&(h=h.slice(0,g)),h}function U(h,n){var i=n.length<0?0:D(n.length)|0;h=f(h,i);for(var c=0;c<i;c+=1)h[c]=n[c]&255;return h}function A(h,n,i,c){if(n.byteLength,i<0||n.byteLength<i)throw new RangeError("'offset' is out of bounds");if(n.byteLength<i+(c||0))throw new RangeError("'length' is out of bounds");return i===void 0&&c===void 0?n=new Uint8Array(n):c===void 0?n=new Uint8Array(n,i):n=new Uint8Array(n,i,c),u.TYPED_ARRAY_SUPPORT?(h=n,h.__proto__=u.prototype):h=U(h,n),h}function C(h,n){if(u.isBuffer(n)){var i=D(n.length)|0;return h=f(h,i),h.length===0||n.copy(h,0,0,i),h}if(n){if(typeof ArrayBuffer<"u"&&n.buffer instanceof ArrayBuffer||"length"in n)return typeof n.length!="number"||Mt(n.length)?f(h,0):U(h,n);if(n.type==="Buffer"&&e(n.data))return U(h,n.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function D(h){if(h>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return h|0}function T(h){return+h!=h&&(h=0),u.alloc(+h)}u.isBuffer=function(n){return!!(n!=null&&n._isBuffer)},u.compare=function(n,i){if(!u.isBuffer(n)||!u.isBuffer(i))throw new TypeError("Arguments must be Buffers");if(n===i)return 0;for(var c=n.length,g=i.length,v=0,m=Math.min(c,g);v<m;++v)if(n[v]!==i[v]){c=n[v],g=i[v];break}return c<g?-1:g<c?1:0},u.isEncoding=function(n){switch(String(n).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(n,i){if(!e(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return u.alloc(0);var c;if(i===void 0)for(i=0,c=0;c<n.length;++c)i+=n[c].length;var g=u.allocUnsafe(i),v=0;for(c=0;c<n.length;++c){var m=n[c];if(!u.isBuffer(m))throw new TypeError('"list" argument must be an Array of Buffers');m.copy(g,v),v+=m.length}return g};function P(h,n){if(u.isBuffer(h))return h.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(h)||h instanceof ArrayBuffer))return h.byteLength;typeof h!="string"&&(h=""+h);var i=h.length;if(i===0)return 0;for(var c=!1;;)switch(n){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return ve(h).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return je(h).length;default:if(c)return ve(h).length;n=(""+n).toLowerCase(),c=!0}}u.byteLength=P;function j(h,n,i){var c=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,n>>>=0,i<=n))return"";for(h||(h="utf8");;)switch(h){case"hex":return xt(this,n,i);case"utf8":case"utf-8":return ne(this,n,i);case"ascii":return Tt(this,n,i);case"latin1":case"binary":return Dt(this,n,i);case"base64":return $(this,n,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return It(this,n,i);default:if(c)throw new TypeError("Unknown encoding: "+h);h=(h+"").toLowerCase(),c=!0}}u.prototype._isBuffer=!0;function k(h,n,i){var c=h[n];h[n]=h[i],h[i]=c}u.prototype.swap16=function(){var n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var i=0;i<n;i+=2)k(this,i,i+1);return this},u.prototype.swap32=function(){var n=this.length;if(n%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var i=0;i<n;i+=4)k(this,i,i+3),k(this,i+1,i+2);return this},u.prototype.swap64=function(){var n=this.length;if(n%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var i=0;i<n;i+=8)k(this,i,i+7),k(this,i+1,i+6),k(this,i+2,i+5),k(this,i+3,i+4);return this},u.prototype.toString=function(){var n=this.length|0;return n===0?"":arguments.length===0?ne(this,0,n):j.apply(this,arguments)},u.prototype.equals=function(n){if(!u.isBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:u.compare(this,n)===0},u.prototype.inspect=function(){var n="",i=o.INSPECT_MAX_BYTES;return this.length>0&&(n=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(n+=" ... ")),"<Buffer "+n+">"},u.prototype.compare=function(n,i,c,g,v){if(!u.isBuffer(n))throw new TypeError("Argument must be a Buffer");if(i===void 0&&(i=0),c===void 0&&(c=n?n.length:0),g===void 0&&(g=0),v===void 0&&(v=this.length),i<0||c>n.length||g<0||v>this.length)throw new RangeError("out of range index");if(g>=v&&i>=c)return 0;if(g>=v)return-1;if(i>=c)return 1;if(i>>>=0,c>>>=0,g>>>=0,v>>>=0,this===n)return 0;for(var m=v-g,E=c-i,x=Math.min(m,E),_=this.slice(g,v),B=n.slice(i,c),R=0;R<x;++R)if(_[R]!==B[R]){m=_[R],E=B[R];break}return m<E?-1:E<m?1:0};function Y(h,n,i,c,g){if(h.length===0)return-1;if(typeof i=="string"?(c=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=g?0:h.length-1),i<0&&(i=h.length+i),i>=h.length){if(g)return-1;i=h.length-1}else if(i<0)if(g)i=0;else return-1;if(typeof n=="string"&&(n=u.from(n,c)),u.isBuffer(n))return n.length===0?-1:W(h,n,i,c,g);if(typeof n=="number")return n=n&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?g?Uint8Array.prototype.indexOf.call(h,n,i):Uint8Array.prototype.lastIndexOf.call(h,n,i):W(h,[n],i,c,g);throw new TypeError("val must be string, number or Buffer")}function W(h,n,i,c,g){var v=1,m=h.length,E=n.length;if(c!==void 0&&(c=String(c).toLowerCase(),c==="ucs2"||c==="ucs-2"||c==="utf16le"||c==="utf-16le")){if(h.length<2||n.length<2)return-1;v=2,m/=2,E/=2,i/=2}function x(He,Ye){return v===1?He[Ye]:He.readUInt16BE(Ye*v)}var _;if(g){var B=-1;for(_=i;_<m;_++)if(x(h,_)===x(n,B===-1?0:_-B)){if(B===-1&&(B=_),_-B+1===E)return B*v}else B!==-1&&(_-=_-B),B=-1}else for(i+E>m&&(i=m-E),_=i;_>=0;_--){for(var R=!0,ye=0;ye<E;ye++)if(x(h,_+ye)!==x(n,ye)){R=!1;break}if(R)return _}return-1}u.prototype.includes=function(n,i,c){return this.indexOf(n,i,c)!==-1},u.prototype.indexOf=function(n,i,c){return Y(this,n,i,c,!0)},u.prototype.lastIndexOf=function(n,i,c){return Y(this,n,i,c,!1)};function te(h,n,i,c){i=Number(i)||0;var g=h.length-i;c?(c=Number(c),c>g&&(c=g)):c=g;var v=n.length;if(v%2!==0)throw new TypeError("Invalid hex string");c>v/2&&(c=v/2);for(var m=0;m<c;++m){var E=parseInt(n.substr(m*2,2),16);if(isNaN(E))return m;h[i+m]=E}return m}function L(h,n,i,c){return me(ve(n,h.length-i),h,i,c)}function O(h,n,i,c){return me(Bt(n),h,i,c)}function J(h,n,i,c){return O(h,n,i,c)}function z(h,n,i,c){return me(je(n),h,i,c)}function re(h,n,i,c){return me(bt(n,h.length-i),h,i,c)}u.prototype.write=function(n,i,c,g){if(i===void 0)g="utf8",c=this.length,i=0;else if(c===void 0&&typeof i=="string")g=i,c=this.length,i=0;else if(isFinite(i))i=i|0,isFinite(c)?(c=c|0,g===void 0&&(g="utf8")):(g=c,c=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var v=this.length-i;if((c===void 0||c>v)&&(c=v),n.length>0&&(c<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");g||(g="utf8");for(var m=!1;;)switch(g){case"hex":return te(this,n,i,c);case"utf8":case"utf-8":return L(this,n,i,c);case"ascii":return O(this,n,i,c);case"latin1":case"binary":return J(this,n,i,c);case"base64":return z(this,n,i,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return re(this,n,i,c);default:if(m)throw new TypeError("Unknown encoding: "+g);g=(""+g).toLowerCase(),m=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function $(h,n,i){return n===0&&i===h.length?t.fromByteArray(h):t.fromByteArray(h.slice(n,i))}function ne(h,n,i){i=Math.min(h.length,i);for(var c=[],g=n;g<i;){var v=h[g],m=null,E=v>239?4:v>223?3:v>191?2:1;if(g+E<=i){var x,_,B,R;switch(E){case 1:v<128&&(m=v);break;case 2:x=h[g+1],(x&192)===128&&(R=(v&31)<<6|x&63,R>127&&(m=R));break;case 3:x=h[g+1],_=h[g+2],(x&192)===128&&(_&192)===128&&(R=(v&15)<<12|(x&63)<<6|_&63,R>2047&&(R<55296||R>57343)&&(m=R));break;case 4:x=h[g+1],_=h[g+2],B=h[g+3],(x&192)===128&&(_&192)===128&&(B&192)===128&&(R=(v&15)<<18|(x&63)<<12|(_&63)<<6|B&63,R>65535&&R<1114112&&(m=R))}}m===null?(m=65533,E=1):m>65535&&(m-=65536,c.push(m>>>10&1023|55296),m=56320|m&1023),c.push(m),g+=E}return Ce(c)}var G=4096;function Ce(h){var n=h.length;if(n<=G)return String.fromCharCode.apply(String,h);for(var i="",c=0;c<n;)i+=String.fromCharCode.apply(String,h.slice(c,c+=G));return i}function Tt(h,n,i){var c="";i=Math.min(h.length,i);for(var g=n;g<i;++g)c+=String.fromCharCode(h[g]&127);return c}function Dt(h,n,i){var c="";i=Math.min(h.length,i);for(var g=n;g<i;++g)c+=String.fromCharCode(h[g]);return c}function xt(h,n,i){var c=h.length;(!n||n<0)&&(n=0),(!i||i<0||i>c)&&(i=c);for(var g="",v=n;v<i;++v)g+=Ft(h[v]);return g}function It(h,n,i){for(var c=h.slice(n,i),g="",v=0;v<c.length;v+=2)g+=String.fromCharCode(c[v]+c[v+1]*256);return g}u.prototype.slice=function(n,i){var c=this.length;n=~~n,i=i===void 0?c:~~i,n<0?(n+=c,n<0&&(n=0)):n>c&&(n=c),i<0?(i+=c,i<0&&(i=0)):i>c&&(i=c),i<n&&(i=n);var g;if(u.TYPED_ARRAY_SUPPORT)g=this.subarray(n,i),g.__proto__=u.prototype;else{var v=i-n;g=new u(v,void 0);for(var m=0;m<v;++m)g[m]=this[m+n]}return g};function F(h,n,i){if(h%1!==0||h<0)throw new RangeError("offset is not uint");if(h+n>i)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUIntLE=function(n,i,c){n=n|0,i=i|0,c||F(n,i,this.length);for(var g=this[n],v=1,m=0;++m<i&&(v*=256);)g+=this[n+m]*v;return g},u.prototype.readUIntBE=function(n,i,c){n=n|0,i=i|0,c||F(n,i,this.length);for(var g=this[n+--i],v=1;i>0&&(v*=256);)g+=this[n+--i]*v;return g},u.prototype.readUInt8=function(n,i){return i||F(n,1,this.length),this[n]},u.prototype.readUInt16LE=function(n,i){return i||F(n,2,this.length),this[n]|this[n+1]<<8},u.prototype.readUInt16BE=function(n,i){return i||F(n,2,this.length),this[n]<<8|this[n+1]},u.prototype.readUInt32LE=function(n,i){return i||F(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216},u.prototype.readUInt32BE=function(n,i){return i||F(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])},u.prototype.readIntLE=function(n,i,c){n=n|0,i=i|0,c||F(n,i,this.length);for(var g=this[n],v=1,m=0;++m<i&&(v*=256);)g+=this[n+m]*v;return v*=128,g>=v&&(g-=Math.pow(2,8*i)),g},u.prototype.readIntBE=function(n,i,c){n=n|0,i=i|0,c||F(n,i,this.length);for(var g=i,v=1,m=this[n+--g];g>0&&(v*=256);)m+=this[n+--g]*v;return v*=128,m>=v&&(m-=Math.pow(2,8*i)),m},u.prototype.readInt8=function(n,i){return i||F(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]},u.prototype.readInt16LE=function(n,i){i||F(n,2,this.length);var c=this[n]|this[n+1]<<8;return c&32768?c|4294901760:c},u.prototype.readInt16BE=function(n,i){i||F(n,2,this.length);var c=this[n+1]|this[n]<<8;return c&32768?c|4294901760:c},u.prototype.readInt32LE=function(n,i){return i||F(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},u.prototype.readInt32BE=function(n,i){return i||F(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},u.prototype.readFloatLE=function(n,i){return i||F(n,4,this.length),r.read(this,n,!0,23,4)},u.prototype.readFloatBE=function(n,i){return i||F(n,4,this.length),r.read(this,n,!1,23,4)},u.prototype.readDoubleLE=function(n,i){return i||F(n,8,this.length),r.read(this,n,!0,52,8)},u.prototype.readDoubleBE=function(n,i){return i||F(n,8,this.length),r.read(this,n,!1,52,8)};function M(h,n,i,c,g,v){if(!u.isBuffer(h))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>g||n<v)throw new RangeError('"value" argument is out of bounds');if(i+c>h.length)throw new RangeError("Index out of range")}u.prototype.writeUIntLE=function(n,i,c,g){if(n=+n,i=i|0,c=c|0,!g){var v=Math.pow(2,8*c)-1;M(this,n,i,c,v,0)}var m=1,E=0;for(this[i]=n&255;++E<c&&(m*=256);)this[i+E]=n/m&255;return i+c},u.prototype.writeUIntBE=function(n,i,c,g){if(n=+n,i=i|0,c=c|0,!g){var v=Math.pow(2,8*c)-1;M(this,n,i,c,v,0)}var m=c-1,E=1;for(this[i+m]=n&255;--m>=0&&(E*=256);)this[i+m]=n/E&255;return i+c},u.prototype.writeUInt8=function(n,i,c){return n=+n,i=i|0,c||M(this,n,i,1,255,0),u.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),this[i]=n&255,i+1};function ge(h,n,i,c){n<0&&(n=65535+n+1);for(var g=0,v=Math.min(h.length-i,2);g<v;++g)h[i+g]=(n&255<<8*(c?g:1-g))>>>(c?g:1-g)*8}u.prototype.writeUInt16LE=function(n,i,c){return n=+n,i=i|0,c||M(this,n,i,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[i]=n&255,this[i+1]=n>>>8):ge(this,n,i,!0),i+2},u.prototype.writeUInt16BE=function(n,i,c){return n=+n,i=i|0,c||M(this,n,i,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[i]=n>>>8,this[i+1]=n&255):ge(this,n,i,!1),i+2};function de(h,n,i,c){n<0&&(n=4294967295+n+1);for(var g=0,v=Math.min(h.length-i,4);g<v;++g)h[i+g]=n>>>(c?g:3-g)*8&255}u.prototype.writeUInt32LE=function(n,i,c){return n=+n,i=i|0,c||M(this,n,i,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[i+3]=n>>>24,this[i+2]=n>>>16,this[i+1]=n>>>8,this[i]=n&255):de(this,n,i,!0),i+4},u.prototype.writeUInt32BE=function(n,i,c){return n=+n,i=i|0,c||M(this,n,i,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[i]=n>>>24,this[i+1]=n>>>16,this[i+2]=n>>>8,this[i+3]=n&255):de(this,n,i,!1),i+4},u.prototype.writeIntLE=function(n,i,c,g){if(n=+n,i=i|0,!g){var v=Math.pow(2,8*c-1);M(this,n,i,c,v-1,-v)}var m=0,E=1,x=0;for(this[i]=n&255;++m<c&&(E*=256);)n<0&&x===0&&this[i+m-1]!==0&&(x=1),this[i+m]=(n/E>>0)-x&255;return i+c},u.prototype.writeIntBE=function(n,i,c,g){if(n=+n,i=i|0,!g){var v=Math.pow(2,8*c-1);M(this,n,i,c,v-1,-v)}var m=c-1,E=1,x=0;for(this[i+m]=n&255;--m>=0&&(E*=256);)n<0&&x===0&&this[i+m+1]!==0&&(x=1),this[i+m]=(n/E>>0)-x&255;return i+c},u.prototype.writeInt8=function(n,i,c){return n=+n,i=i|0,c||M(this,n,i,1,127,-128),u.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),n<0&&(n=255+n+1),this[i]=n&255,i+1},u.prototype.writeInt16LE=function(n,i,c){return n=+n,i=i|0,c||M(this,n,i,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[i]=n&255,this[i+1]=n>>>8):ge(this,n,i,!0),i+2},u.prototype.writeInt16BE=function(n,i,c){return n=+n,i=i|0,c||M(this,n,i,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[i]=n>>>8,this[i+1]=n&255):ge(this,n,i,!1),i+2},u.prototype.writeInt32LE=function(n,i,c){return n=+n,i=i|0,c||M(this,n,i,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[i]=n&255,this[i+1]=n>>>8,this[i+2]=n>>>16,this[i+3]=n>>>24):de(this,n,i,!0),i+4},u.prototype.writeInt32BE=function(n,i,c){return n=+n,i=i|0,c||M(this,n,i,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),u.TYPED_ARRAY_SUPPORT?(this[i]=n>>>24,this[i+1]=n>>>16,this[i+2]=n>>>8,this[i+3]=n&255):de(this,n,i,!1),i+4};function qe(h,n,i,c,g,v){if(i+c>h.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function Ve(h,n,i,c,g){return g||qe(h,n,i,4),r.write(h,n,i,c,23,4),i+4}u.prototype.writeFloatLE=function(n,i,c){return Ve(this,n,i,!0,c)},u.prototype.writeFloatBE=function(n,i,c){return Ve(this,n,i,!1,c)};function Le(h,n,i,c,g){return g||qe(h,n,i,8),r.write(h,n,i,c,52,8),i+8}u.prototype.writeDoubleLE=function(n,i,c){return Le(this,n,i,!0,c)},u.prototype.writeDoubleBE=function(n,i,c){return Le(this,n,i,!1,c)},u.prototype.copy=function(n,i,c,g){if(c||(c=0),!g&&g!==0&&(g=this.length),i>=n.length&&(i=n.length),i||(i=0),g>0&&g<c&&(g=c),g===c||n.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(c<0||c>=this.length)throw new RangeError("sourceStart out of bounds");if(g<0)throw new RangeError("sourceEnd out of bounds");g>this.length&&(g=this.length),n.length-i<g-c&&(g=n.length-i+c);var v=g-c,m;if(this===n&&c<i&&i<g)for(m=v-1;m>=0;--m)n[m+i]=this[m+c];else if(v<1e3||!u.TYPED_ARRAY_SUPPORT)for(m=0;m<v;++m)n[m+i]=this[m+c];else Uint8Array.prototype.set.call(n,this.subarray(c,c+v),i);return v},u.prototype.fill=function(n,i,c,g){if(typeof n=="string"){if(typeof i=="string"?(g=i,i=0,c=this.length):typeof c=="string"&&(g=c,c=this.length),n.length===1){var v=n.charCodeAt(0);v<256&&(n=v)}if(g!==void 0&&typeof g!="string")throw new TypeError("encoding must be a string");if(typeof g=="string"&&!u.isEncoding(g))throw new TypeError("Unknown encoding: "+g)}else typeof n=="number"&&(n=n&255);if(i<0||this.length<i||this.length<c)throw new RangeError("Out of range index");if(c<=i)return this;i=i>>>0,c=c===void 0?this.length:c>>>0,n||(n=0);var m;if(typeof n=="number")for(m=i;m<c;++m)this[m]=n;else{var E=u.isBuffer(n)?n:ve(new u(n,g).toString()),x=E.length;for(m=0;m<c-i;++m)this[m+i]=E[m%x]}return this};var _t=/[^+\/0-9A-Za-z-_]/g;function Rt(h){if(h=Pt(h).replace(_t,""),h.length<2)return"";for(;h.length%4!==0;)h=h+"=";return h}function Pt(h){return h.trim?h.trim():h.replace(/^\s+|\s+$/g,"")}function Ft(h){return h<16?"0"+h.toString(16):h.toString(16)}function ve(h,n){n=n||1/0;for(var i,c=h.length,g=null,v=[],m=0;m<c;++m){if(i=h.charCodeAt(m),i>55295&&i<57344){if(!g){if(i>56319){(n-=3)>-1&&v.push(239,191,189);continue}else if(m+1===c){(n-=3)>-1&&v.push(239,191,189);continue}g=i;continue}if(i<56320){(n-=3)>-1&&v.push(239,191,189),g=i;continue}i=(g-55296<<10|i-56320)+65536}else g&&(n-=3)>-1&&v.push(239,191,189);if(g=null,i<128){if((n-=1)<0)break;v.push(i)}else if(i<2048){if((n-=2)<0)break;v.push(i>>6|192,i&63|128)}else if(i<65536){if((n-=3)<0)break;v.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((n-=4)<0)break;v.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return v}function Bt(h){for(var n=[],i=0;i<h.length;++i)n.push(h.charCodeAt(i)&255);return n}function bt(h,n){for(var i,c,g,v=[],m=0;m<h.length&&!((n-=2)<0);++m)i=h.charCodeAt(m),c=i>>8,g=i%256,v.push(g),v.push(c);return v}function je(h){return t.toByteArray(Rt(h))}function me(h,n,i,c){for(var g=0;g<c&&!(g+i>=n.length||g>=h.length);++g)n[g+i]=h[g];return g}function Mt(h){return h!==h}})(Ae)),Ae}var I=Vt(),q;typeof window<"u"&&window.crypto&&(q=window.crypto);!q&&typeof window<"u"&&window.msCrypto&&(q=window.msCrypto);!q&&typeof global<"u"&&global.crypto&&(q=global.crypto);if(!q&&typeof Kt=="function")try{q=kt}catch{}function Lt(){if(q){if(typeof q.getRandomValues=="function")try{return q.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof q.randomBytes=="function")try{return q.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")}function jt(o){for(var t=o.words,r=o.sigBytes,e=[],a=0;a<r;a++){var s=t[a>>>2]>>>24-a%4*8&255;e.push((s>>>4).toString(16)),e.push((s&15).toString(16))}return e.join("")}var Ht=(function(){function o(r,e){r=this.words=r||[],e!=null?this.sigBytes=e:this.sigBytes=r.length*4}var t=o.prototype;return t.random=function(e){for(var a=[],s=0;s<e;s+=4)a.push(Lt());return new o(a,e)},t.toString=function(){return jt(this)},o})(),Ee={};/*! *****************************************************************************
|
|
9
|
+
*/var Ge;function qt(){return Ge||(Ge=1,(function(o){var t=Ot(),r=Nt(),e=kt();o.Buffer=u,o.SlowBuffer=T,o.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=We.TYPED_ARRAY_SUPPORT!==void 0?We.TYPED_ARRAY_SUPPORT:a(),o.kMaxLength=s();function a(){try{var h=new Uint8Array(1);return h.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},h.foo()===42&&typeof h.subarray=="function"&&h.subarray(1,1).byteLength===0}catch{return!1}}function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(h,n){if(s()<n)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(h=new Uint8Array(n),h.__proto__=u.prototype):(h===null&&(h=new u(n)),h.length=n),h}function u(h,n,i){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(h,n,i);if(typeof h=="number"){if(typeof n=="string")throw new Error("If encoding is specified then the first argument must be a string");return y(this,h)}return l(this,h,n,i)}u.poolSize=8192,u._augment=function(h){return h.__proto__=u.prototype,h};function l(h,n,i,c){if(typeof n=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&n instanceof ArrayBuffer?A(h,n,i,c):typeof n=="string"?S(h,n,i):C(h,n)}u.from=function(h,n,i){return l(null,h,n,i)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0}));function g(h){if(typeof h!="number")throw new TypeError('"size" argument must be a number');if(h<0)throw new RangeError('"size" argument must not be negative')}function d(h,n,i,c){return g(n),n<=0?f(h,n):i!==void 0?typeof c=="string"?f(h,n).fill(i,c):f(h,n).fill(i):f(h,n)}u.alloc=function(h,n,i){return d(null,h,n,i)};function y(h,n){if(g(n),h=f(h,n<0?0:D(n)|0),!u.TYPED_ARRAY_SUPPORT)for(var i=0;i<n;++i)h[i]=0;return h}u.allocUnsafe=function(h){return y(null,h)},u.allocUnsafeSlow=function(h){return y(null,h)};function S(h,n,i){if((typeof i!="string"||i==="")&&(i="utf8"),!u.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var c=P(n,i)|0;h=f(h,c);var p=h.write(n,i);return p!==c&&(h=h.slice(0,p)),h}function U(h,n){var i=n.length<0?0:D(n.length)|0;h=f(h,i);for(var c=0;c<i;c+=1)h[c]=n[c]&255;return h}function A(h,n,i,c){if(n.byteLength,i<0||n.byteLength<i)throw new RangeError("'offset' is out of bounds");if(n.byteLength<i+(c||0))throw new RangeError("'length' is out of bounds");return i===void 0&&c===void 0?n=new Uint8Array(n):c===void 0?n=new Uint8Array(n,i):n=new Uint8Array(n,i,c),u.TYPED_ARRAY_SUPPORT?(h=n,h.__proto__=u.prototype):h=U(h,n),h}function C(h,n){if(u.isBuffer(n)){var i=D(n.length)|0;return h=f(h,i),h.length===0||n.copy(h,0,0,i),h}if(n){if(typeof ArrayBuffer<"u"&&n.buffer instanceof ArrayBuffer||"length"in n)return typeof n.length!="number"||Mt(n.length)?f(h,0):U(h,n);if(n.type==="Buffer"&&e(n.data))return U(h,n.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function D(h){if(h>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return h|0}function T(h){return+h!=h&&(h=0),u.alloc(+h)}u.isBuffer=function(n){return!!(n!=null&&n._isBuffer)},u.compare=function(n,i){if(!u.isBuffer(n)||!u.isBuffer(i))throw new TypeError("Arguments must be Buffers");if(n===i)return 0;for(var c=n.length,p=i.length,v=0,m=Math.min(c,p);v<m;++v)if(n[v]!==i[v]){c=n[v],p=i[v];break}return c<p?-1:p<c?1:0},u.isEncoding=function(n){switch(String(n).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(n,i){if(!e(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return u.alloc(0);var c;if(i===void 0)for(i=0,c=0;c<n.length;++c)i+=n[c].length;var p=u.allocUnsafe(i),v=0;for(c=0;c<n.length;++c){var m=n[c];if(!u.isBuffer(m))throw new TypeError('"list" argument must be an Array of Buffers');m.copy(p,v),v+=m.length}return p};function P(h,n){if(u.isBuffer(h))return h.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(h)||h instanceof ArrayBuffer))return h.byteLength;typeof h!="string"&&(h=""+h);var i=h.length;if(i===0)return 0;for(var c=!1;;)switch(n){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return ve(h).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return je(h).length;default:if(c)return ve(h).length;n=(""+n).toLowerCase(),c=!0}}u.byteLength=P;function j(h,n,i){var c=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,n>>>=0,i<=n))return"";for(h||(h="utf8");;)switch(h){case"hex":return xt(this,n,i);case"utf8":case"utf-8":return ne(this,n,i);case"ascii":return Tt(this,n,i);case"latin1":case"binary":return Dt(this,n,i);case"base64":return $(this,n,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return It(this,n,i);default:if(c)throw new TypeError("Unknown encoding: "+h);h=(h+"").toLowerCase(),c=!0}}u.prototype._isBuffer=!0;function k(h,n,i){var c=h[n];h[n]=h[i],h[i]=c}u.prototype.swap16=function(){var n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var i=0;i<n;i+=2)k(this,i,i+1);return this},u.prototype.swap32=function(){var n=this.length;if(n%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var i=0;i<n;i+=4)k(this,i,i+3),k(this,i+1,i+2);return this},u.prototype.swap64=function(){var n=this.length;if(n%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var i=0;i<n;i+=8)k(this,i,i+7),k(this,i+1,i+6),k(this,i+2,i+5),k(this,i+3,i+4);return this},u.prototype.toString=function(){var n=this.length|0;return n===0?"":arguments.length===0?ne(this,0,n):j.apply(this,arguments)},u.prototype.equals=function(n){if(!u.isBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:u.compare(this,n)===0},u.prototype.inspect=function(){var n="",i=o.INSPECT_MAX_BYTES;return this.length>0&&(n=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(n+=" ... ")),"<Buffer "+n+">"},u.prototype.compare=function(n,i,c,p,v){if(!u.isBuffer(n))throw new TypeError("Argument must be a Buffer");if(i===void 0&&(i=0),c===void 0&&(c=n?n.length:0),p===void 0&&(p=0),v===void 0&&(v=this.length),i<0||c>n.length||p<0||v>this.length)throw new RangeError("out of range index");if(p>=v&&i>=c)return 0;if(p>=v)return-1;if(i>=c)return 1;if(i>>>=0,c>>>=0,p>>>=0,v>>>=0,this===n)return 0;for(var m=v-p,E=c-i,x=Math.min(m,E),_=this.slice(p,v),B=n.slice(i,c),R=0;R<x;++R)if(_[R]!==B[R]){m=_[R],E=B[R];break}return m<E?-1:E<m?1:0};function Y(h,n,i,c,p){if(h.length===0)return-1;if(typeof i=="string"?(c=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=p?0:h.length-1),i<0&&(i=h.length+i),i>=h.length){if(p)return-1;i=h.length-1}else if(i<0)if(p)i=0;else return-1;if(typeof n=="string"&&(n=u.from(n,c)),u.isBuffer(n))return n.length===0?-1:W(h,n,i,c,p);if(typeof n=="number")return n=n&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?p?Uint8Array.prototype.indexOf.call(h,n,i):Uint8Array.prototype.lastIndexOf.call(h,n,i):W(h,[n],i,c,p);throw new TypeError("val must be string, number or Buffer")}function W(h,n,i,c,p){var v=1,m=h.length,E=n.length;if(c!==void 0&&(c=String(c).toLowerCase(),c==="ucs2"||c==="ucs-2"||c==="utf16le"||c==="utf-16le")){if(h.length<2||n.length<2)return-1;v=2,m/=2,E/=2,i/=2}function x(He,Ye){return v===1?He[Ye]:He.readUInt16BE(Ye*v)}var _;if(p){var B=-1;for(_=i;_<m;_++)if(x(h,_)===x(n,B===-1?0:_-B)){if(B===-1&&(B=_),_-B+1===E)return B*v}else B!==-1&&(_-=_-B),B=-1}else for(i+E>m&&(i=m-E),_=i;_>=0;_--){for(var R=!0,ye=0;ye<E;ye++)if(x(h,_+ye)!==x(n,ye)){R=!1;break}if(R)return _}return-1}u.prototype.includes=function(n,i,c){return this.indexOf(n,i,c)!==-1},u.prototype.indexOf=function(n,i,c){return Y(this,n,i,c,!0)},u.prototype.lastIndexOf=function(n,i,c){return Y(this,n,i,c,!1)};function te(h,n,i,c){i=Number(i)||0;var p=h.length-i;c?(c=Number(c),c>p&&(c=p)):c=p;var v=n.length;if(v%2!==0)throw new TypeError("Invalid hex string");c>v/2&&(c=v/2);for(var m=0;m<c;++m){var E=parseInt(n.substr(m*2,2),16);if(isNaN(E))return m;h[i+m]=E}return m}function L(h,n,i,c){return me(ve(n,h.length-i),h,i,c)}function O(h,n,i,c){return me(Bt(n),h,i,c)}function J(h,n,i,c){return O(h,n,i,c)}function z(h,n,i,c){return me(je(n),h,i,c)}function re(h,n,i,c){return me(bt(n,h.length-i),h,i,c)}u.prototype.write=function(n,i,c,p){if(i===void 0)p="utf8",c=this.length,i=0;else if(c===void 0&&typeof i=="string")p=i,c=this.length,i=0;else if(isFinite(i))i=i|0,isFinite(c)?(c=c|0,p===void 0&&(p="utf8")):(p=c,c=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var v=this.length-i;if((c===void 0||c>v)&&(c=v),n.length>0&&(c<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");p||(p="utf8");for(var m=!1;;)switch(p){case"hex":return te(this,n,i,c);case"utf8":case"utf-8":return L(this,n,i,c);case"ascii":return O(this,n,i,c);case"latin1":case"binary":return J(this,n,i,c);case"base64":return z(this,n,i,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return re(this,n,i,c);default:if(m)throw new TypeError("Unknown encoding: "+p);p=(""+p).toLowerCase(),m=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function $(h,n,i){return n===0&&i===h.length?t.fromByteArray(h):t.fromByteArray(h.slice(n,i))}function ne(h,n,i){i=Math.min(h.length,i);for(var c=[],p=n;p<i;){var v=h[p],m=null,E=v>239?4:v>223?3:v>191?2:1;if(p+E<=i){var x,_,B,R;switch(E){case 1:v<128&&(m=v);break;case 2:x=h[p+1],(x&192)===128&&(R=(v&31)<<6|x&63,R>127&&(m=R));break;case 3:x=h[p+1],_=h[p+2],(x&192)===128&&(_&192)===128&&(R=(v&15)<<12|(x&63)<<6|_&63,R>2047&&(R<55296||R>57343)&&(m=R));break;case 4:x=h[p+1],_=h[p+2],B=h[p+3],(x&192)===128&&(_&192)===128&&(B&192)===128&&(R=(v&15)<<18|(x&63)<<12|(_&63)<<6|B&63,R>65535&&R<1114112&&(m=R))}}m===null?(m=65533,E=1):m>65535&&(m-=65536,c.push(m>>>10&1023|55296),m=56320|m&1023),c.push(m),p+=E}return Ce(c)}var G=4096;function Ce(h){var n=h.length;if(n<=G)return String.fromCharCode.apply(String,h);for(var i="",c=0;c<n;)i+=String.fromCharCode.apply(String,h.slice(c,c+=G));return i}function Tt(h,n,i){var c="";i=Math.min(h.length,i);for(var p=n;p<i;++p)c+=String.fromCharCode(h[p]&127);return c}function Dt(h,n,i){var c="";i=Math.min(h.length,i);for(var p=n;p<i;++p)c+=String.fromCharCode(h[p]);return c}function xt(h,n,i){var c=h.length;(!n||n<0)&&(n=0),(!i||i<0||i>c)&&(i=c);for(var p="",v=n;v<i;++v)p+=Ft(h[v]);return p}function It(h,n,i){for(var c=h.slice(n,i),p="",v=0;v<c.length;v+=2)p+=String.fromCharCode(c[v]+c[v+1]*256);return p}u.prototype.slice=function(n,i){var c=this.length;n=~~n,i=i===void 0?c:~~i,n<0?(n+=c,n<0&&(n=0)):n>c&&(n=c),i<0?(i+=c,i<0&&(i=0)):i>c&&(i=c),i<n&&(i=n);var p;if(u.TYPED_ARRAY_SUPPORT)p=this.subarray(n,i),p.__proto__=u.prototype;else{var v=i-n;p=new u(v,void 0);for(var m=0;m<v;++m)p[m]=this[m+n]}return p};function F(h,n,i){if(h%1!==0||h<0)throw new RangeError("offset is not uint");if(h+n>i)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUIntLE=function(n,i,c){n=n|0,i=i|0,c||F(n,i,this.length);for(var p=this[n],v=1,m=0;++m<i&&(v*=256);)p+=this[n+m]*v;return p},u.prototype.readUIntBE=function(n,i,c){n=n|0,i=i|0,c||F(n,i,this.length);for(var p=this[n+--i],v=1;i>0&&(v*=256);)p+=this[n+--i]*v;return p},u.prototype.readUInt8=function(n,i){return i||F(n,1,this.length),this[n]},u.prototype.readUInt16LE=function(n,i){return i||F(n,2,this.length),this[n]|this[n+1]<<8},u.prototype.readUInt16BE=function(n,i){return i||F(n,2,this.length),this[n]<<8|this[n+1]},u.prototype.readUInt32LE=function(n,i){return i||F(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216},u.prototype.readUInt32BE=function(n,i){return i||F(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])},u.prototype.readIntLE=function(n,i,c){n=n|0,i=i|0,c||F(n,i,this.length);for(var p=this[n],v=1,m=0;++m<i&&(v*=256);)p+=this[n+m]*v;return v*=128,p>=v&&(p-=Math.pow(2,8*i)),p},u.prototype.readIntBE=function(n,i,c){n=n|0,i=i|0,c||F(n,i,this.length);for(var p=i,v=1,m=this[n+--p];p>0&&(v*=256);)m+=this[n+--p]*v;return v*=128,m>=v&&(m-=Math.pow(2,8*i)),m},u.prototype.readInt8=function(n,i){return i||F(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]},u.prototype.readInt16LE=function(n,i){i||F(n,2,this.length);var c=this[n]|this[n+1]<<8;return c&32768?c|4294901760:c},u.prototype.readInt16BE=function(n,i){i||F(n,2,this.length);var c=this[n+1]|this[n]<<8;return c&32768?c|4294901760:c},u.prototype.readInt32LE=function(n,i){return i||F(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},u.prototype.readInt32BE=function(n,i){return i||F(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},u.prototype.readFloatLE=function(n,i){return i||F(n,4,this.length),r.read(this,n,!0,23,4)},u.prototype.readFloatBE=function(n,i){return i||F(n,4,this.length),r.read(this,n,!1,23,4)},u.prototype.readDoubleLE=function(n,i){return i||F(n,8,this.length),r.read(this,n,!0,52,8)},u.prototype.readDoubleBE=function(n,i){return i||F(n,8,this.length),r.read(this,n,!1,52,8)};function M(h,n,i,c,p,v){if(!u.isBuffer(h))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>p||n<v)throw new RangeError('"value" argument is out of bounds');if(i+c>h.length)throw new RangeError("Index out of range")}u.prototype.writeUIntLE=function(n,i,c,p){if(n=+n,i=i|0,c=c|0,!p){var v=Math.pow(2,8*c)-1;M(this,n,i,c,v,0)}var m=1,E=0;for(this[i]=n&255;++E<c&&(m*=256);)this[i+E]=n/m&255;return i+c},u.prototype.writeUIntBE=function(n,i,c,p){if(n=+n,i=i|0,c=c|0,!p){var v=Math.pow(2,8*c)-1;M(this,n,i,c,v,0)}var m=c-1,E=1;for(this[i+m]=n&255;--m>=0&&(E*=256);)this[i+m]=n/E&255;return i+c},u.prototype.writeUInt8=function(n,i,c){return n=+n,i=i|0,c||M(this,n,i,1,255,0),u.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),this[i]=n&255,i+1};function pe(h,n,i,c){n<0&&(n=65535+n+1);for(var p=0,v=Math.min(h.length-i,2);p<v;++p)h[i+p]=(n&255<<8*(c?p:1-p))>>>(c?p:1-p)*8}u.prototype.writeUInt16LE=function(n,i,c){return n=+n,i=i|0,c||M(this,n,i,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[i]=n&255,this[i+1]=n>>>8):pe(this,n,i,!0),i+2},u.prototype.writeUInt16BE=function(n,i,c){return n=+n,i=i|0,c||M(this,n,i,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[i]=n>>>8,this[i+1]=n&255):pe(this,n,i,!1),i+2};function de(h,n,i,c){n<0&&(n=4294967295+n+1);for(var p=0,v=Math.min(h.length-i,4);p<v;++p)h[i+p]=n>>>(c?p:3-p)*8&255}u.prototype.writeUInt32LE=function(n,i,c){return n=+n,i=i|0,c||M(this,n,i,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[i+3]=n>>>24,this[i+2]=n>>>16,this[i+1]=n>>>8,this[i]=n&255):de(this,n,i,!0),i+4},u.prototype.writeUInt32BE=function(n,i,c){return n=+n,i=i|0,c||M(this,n,i,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[i]=n>>>24,this[i+1]=n>>>16,this[i+2]=n>>>8,this[i+3]=n&255):de(this,n,i,!1),i+4},u.prototype.writeIntLE=function(n,i,c,p){if(n=+n,i=i|0,!p){var v=Math.pow(2,8*c-1);M(this,n,i,c,v-1,-v)}var m=0,E=1,x=0;for(this[i]=n&255;++m<c&&(E*=256);)n<0&&x===0&&this[i+m-1]!==0&&(x=1),this[i+m]=(n/E>>0)-x&255;return i+c},u.prototype.writeIntBE=function(n,i,c,p){if(n=+n,i=i|0,!p){var v=Math.pow(2,8*c-1);M(this,n,i,c,v-1,-v)}var m=c-1,E=1,x=0;for(this[i+m]=n&255;--m>=0&&(E*=256);)n<0&&x===0&&this[i+m+1]!==0&&(x=1),this[i+m]=(n/E>>0)-x&255;return i+c},u.prototype.writeInt8=function(n,i,c){return n=+n,i=i|0,c||M(this,n,i,1,127,-128),u.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),n<0&&(n=255+n+1),this[i]=n&255,i+1},u.prototype.writeInt16LE=function(n,i,c){return n=+n,i=i|0,c||M(this,n,i,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[i]=n&255,this[i+1]=n>>>8):pe(this,n,i,!0),i+2},u.prototype.writeInt16BE=function(n,i,c){return n=+n,i=i|0,c||M(this,n,i,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[i]=n>>>8,this[i+1]=n&255):pe(this,n,i,!1),i+2},u.prototype.writeInt32LE=function(n,i,c){return n=+n,i=i|0,c||M(this,n,i,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[i]=n&255,this[i+1]=n>>>8,this[i+2]=n>>>16,this[i+3]=n>>>24):de(this,n,i,!0),i+4},u.prototype.writeInt32BE=function(n,i,c){return n=+n,i=i|0,c||M(this,n,i,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),u.TYPED_ARRAY_SUPPORT?(this[i]=n>>>24,this[i+1]=n>>>16,this[i+2]=n>>>8,this[i+3]=n&255):de(this,n,i,!1),i+4};function qe(h,n,i,c,p,v){if(i+c>h.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function Ve(h,n,i,c,p){return p||qe(h,n,i,4),r.write(h,n,i,c,23,4),i+4}u.prototype.writeFloatLE=function(n,i,c){return Ve(this,n,i,!0,c)},u.prototype.writeFloatBE=function(n,i,c){return Ve(this,n,i,!1,c)};function Le(h,n,i,c,p){return p||qe(h,n,i,8),r.write(h,n,i,c,52,8),i+8}u.prototype.writeDoubleLE=function(n,i,c){return Le(this,n,i,!0,c)},u.prototype.writeDoubleBE=function(n,i,c){return Le(this,n,i,!1,c)},u.prototype.copy=function(n,i,c,p){if(c||(c=0),!p&&p!==0&&(p=this.length),i>=n.length&&(i=n.length),i||(i=0),p>0&&p<c&&(p=c),p===c||n.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(c<0||c>=this.length)throw new RangeError("sourceStart out of bounds");if(p<0)throw new RangeError("sourceEnd out of bounds");p>this.length&&(p=this.length),n.length-i<p-c&&(p=n.length-i+c);var v=p-c,m;if(this===n&&c<i&&i<p)for(m=v-1;m>=0;--m)n[m+i]=this[m+c];else if(v<1e3||!u.TYPED_ARRAY_SUPPORT)for(m=0;m<v;++m)n[m+i]=this[m+c];else Uint8Array.prototype.set.call(n,this.subarray(c,c+v),i);return v},u.prototype.fill=function(n,i,c,p){if(typeof n=="string"){if(typeof i=="string"?(p=i,i=0,c=this.length):typeof c=="string"&&(p=c,c=this.length),n.length===1){var v=n.charCodeAt(0);v<256&&(n=v)}if(p!==void 0&&typeof p!="string")throw new TypeError("encoding must be a string");if(typeof p=="string"&&!u.isEncoding(p))throw new TypeError("Unknown encoding: "+p)}else typeof n=="number"&&(n=n&255);if(i<0||this.length<i||this.length<c)throw new RangeError("Out of range index");if(c<=i)return this;i=i>>>0,c=c===void 0?this.length:c>>>0,n||(n=0);var m;if(typeof n=="number")for(m=i;m<c;++m)this[m]=n;else{var E=u.isBuffer(n)?n:ve(new u(n,p).toString()),x=E.length;for(m=0;m<c-i;++m)this[m+i]=E[m%x]}return this};var _t=/[^+\/0-9A-Za-z-_]/g;function Rt(h){if(h=Pt(h).replace(_t,""),h.length<2)return"";for(;h.length%4!==0;)h=h+"=";return h}function Pt(h){return h.trim?h.trim():h.replace(/^\s+|\s+$/g,"")}function Ft(h){return h<16?"0"+h.toString(16):h.toString(16)}function ve(h,n){n=n||1/0;for(var i,c=h.length,p=null,v=[],m=0;m<c;++m){if(i=h.charCodeAt(m),i>55295&&i<57344){if(!p){if(i>56319){(n-=3)>-1&&v.push(239,191,189);continue}else if(m+1===c){(n-=3)>-1&&v.push(239,191,189);continue}p=i;continue}if(i<56320){(n-=3)>-1&&v.push(239,191,189),p=i;continue}i=(p-55296<<10|i-56320)+65536}else p&&(n-=3)>-1&&v.push(239,191,189);if(p=null,i<128){if((n-=1)<0)break;v.push(i)}else if(i<2048){if((n-=2)<0)break;v.push(i>>6|192,i&63|128)}else if(i<65536){if((n-=3)<0)break;v.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((n-=4)<0)break;v.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return v}function Bt(h){for(var n=[],i=0;i<h.length;++i)n.push(h.charCodeAt(i)&255);return n}function bt(h,n){for(var i,c,p,v=[],m=0;m<h.length&&!((n-=2)<0);++m)i=h.charCodeAt(m),c=i>>8,p=i%256,v.push(p),v.push(c);return v}function je(h){return t.toByteArray(Rt(h))}function me(h,n,i,c){for(var p=0;p<c&&!(p+i>=n.length||p>=h.length);++p)n[p+i]=h[p];return p}function Mt(h){return h!==h}})(Ae)),Ae}var I=qt(),q;typeof window<"u"&&window.crypto&&(q=window.crypto);!q&&typeof window<"u"&&window.msCrypto&&(q=window.msCrypto);!q&&typeof global<"u"&&global.crypto&&(q=global.crypto);if(!q&&typeof Kt=="function")try{q=require("crypto")}catch{}function Vt(){if(q){if(typeof q.getRandomValues=="function")try{return q.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof q.randomBytes=="function")try{return q.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")}function Lt(o){for(var t=o.words,r=o.sigBytes,e=[],a=0;a<r;a++){var s=t[a>>>2]>>>24-a%4*8&255;e.push((s>>>4).toString(16)),e.push((s&15).toString(16))}return e.join("")}var jt=(function(){function o(r,e){r=this.words=r||[],e!=null?this.sigBytes=e:this.sigBytes=r.length*4}var t=o.prototype;return t.random=function(e){for(var a=[],s=0;s<e;s+=4)a.push(Vt());return new o(a,e)},t.toString=function(){return Lt(this)},o})(),Ee={};/*! *****************************************************************************
|
|
10
10
|
Copyright (c) Microsoft Corporation.
|
|
11
11
|
|
|
12
12
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -19,40 +19,40 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
19
19
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
20
20
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
21
21
|
PERFORMANCE OF THIS SOFTWARE.
|
|
22
|
-
***************************************************************************** */var _e=function(o,t){return _e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,e){r.__proto__=e}||function(r,e){for(var a in e)e.hasOwnProperty(a)&&(r[a]=e[a])},_e(o,t)};function Yt(o,t){_e(o,t);function r(){this.constructor=o}o.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Re=function(){return Re=Object.assign||function(t){for(var r,e=1,a=arguments.length;e<a;e++){r=arguments[e];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},Re.apply(this,arguments)};function Wt(o,t){var r={};for(var e in o)Object.prototype.hasOwnProperty.call(o,e)&&t.indexOf(e)<0&&(r[e]=o[e]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,e=Object.getOwnPropertySymbols(o);a<e.length;a++)t.indexOf(e[a])<0&&Object.prototype.propertyIsEnumerable.call(o,e[a])&&(r[e[a]]=o[e[a]]);return r}function Jt(o,t,r,e){var a=arguments.length,s=a<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,r):e,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,t,r,e);else for(var u=o.length-1;u>=0;u--)(f=o[u])&&(s=(a<3?f(s):a>3?f(t,r,s):f(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s}function Gt(o,t){return function(r,e){t(r,e,o)}}function Zt(o,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(o,t)}function zt(o,t,r,e){function a(s){return s instanceof r?s:new r(function(f){f(s)})}return new(r||(r=Promise))(function(s,f){function u(d){try{p(e.next(d))}catch(y){f(y)}}function l(d){try{p(e.throw(d))}catch(y){f(y)}}function p(d){d.done?s(d.value):a(d.value).then(u,l)}p((e=e.apply(o,t||[])).next())})}function $t(o,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},e,a,s,f;return f={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function u(p){return function(d){return l([p,d])}}function l(p){if(e)throw new TypeError("Generator is already executing.");for(;r;)try{if(e=1,a&&(s=p[0]&2?a.return:p[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,p[1])).done)return s;switch(a=0,s&&(p=[p[0]&2,s.value]),p[0]){case 0:case 1:s=p;break;case 4:return r.label++,{value:p[1],done:!1};case 5:r.label++,a=p[1],p=[0];continue;case 7:p=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!s||p[1]>s[0]&&p[1]<s[3])){r.label=p[1];break}if(p[0]===6&&r.label<s[1]){r.label=s[1],s=p;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(p);break}s[2]&&r.ops.pop(),r.trys.pop();continue}p=t.call(o,r)}catch(d){p=[6,d],a=0}finally{e=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function Xt(o,t,r,e){e===void 0&&(e=r),o[e]=t[r]}function Qt(o,t){for(var r in o)r!=="default"&&!t.hasOwnProperty(r)&&(t[r]=o[r])}function Pe(o){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&o[t],e=0;if(r)return r.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&e>=o.length&&(o=void 0),{value:o&&o[e++],done:!o}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function mt(o,t){var r=typeof Symbol=="function"&&o[Symbol.iterator];if(!r)return o;var e=r.call(o),a,s=[],f;try{for(;(t===void 0||t-- >0)&&!(a=e.next()).done;)s.push(a.value)}catch(u){f={error:u}}finally{try{a&&!a.done&&(r=e.return)&&r.call(e)}finally{if(f)throw f.error}}return s}function er(){for(var o=[],t=0;t<arguments.length;t++)o=o.concat(mt(arguments[t]));return o}function tr(){for(var o=0,t=0,r=arguments.length;t<r;t++)o+=arguments[t].length;for(var e=Array(o),a=0,t=0;t<r;t++)for(var s=arguments[t],f=0,u=s.length;f<u;f++,a++)e[a]=s[f];return e}function le(o){return this instanceof le?(this.v=o,this):new le(o)}function rr(o,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r.apply(o,t||[]),a,s=[];return a={},f("next"),f("throw"),f("return"),a[Symbol.asyncIterator]=function(){return this},a;function f(S){e[S]&&(a[S]=function(U){return new Promise(function(A,C){s.push([S,U,A,C])>1||u(S,U)})})}function u(S,U){try{l(e[S](U))}catch(A){y(s[0][3],A)}}function l(S){S.value instanceof le?Promise.resolve(S.value.v).then(p,d):y(s[0][2],S)}function p(S){u("next",S)}function d(S){u("throw",S)}function y(S,U){S(U),s.shift(),s.length&&u(s[0][0],s[0][1])}}function nr(o){var t,r;return t={},e("next"),e("throw",function(a){throw a}),e("return"),t[Symbol.iterator]=function(){return this},t;function e(a,s){t[a]=o[a]?function(f){return(r=!r)?{value:le(o[a](f)),done:a==="return"}:s?s(f):f}:s}}function ir(o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=o[Symbol.asyncIterator],r;return t?t.call(o):(o=typeof Pe=="function"?Pe(o):o[Symbol.iterator](),r={},e("next"),e("throw"),e("return"),r[Symbol.asyncIterator]=function(){return this},r);function e(s){r[s]=o[s]&&function(f){return new Promise(function(u,l){f=o[s](f),a(u,l,f.done,f.value)})}}function a(s,f,u,l){Promise.resolve(l).then(function(p){s({value:p,done:u})},f)}}function sr(o,t){return Object.defineProperty?Object.defineProperty(o,"raw",{value:t}):o.raw=t,o}function or(o){if(o&&o.__esModule)return o;var t={};if(o!=null)for(var r in o)Object.hasOwnProperty.call(o,r)&&(t[r]=o[r]);return t.default=o,t}function ar(o){return o&&o.__esModule?o:{default:o}}function ur(o,t){if(!t.has(o))throw new TypeError("attempted to get private field on non-instance");return t.get(o)}function fr(o,t,r){if(!t.has(o))throw new TypeError("attempted to set private field on non-instance");return t.set(o,r),r}const hr=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Re},__asyncDelegator:nr,__asyncGenerator:rr,__asyncValues:ir,__await:le,__awaiter:zt,__classPrivateFieldGet:ur,__classPrivateFieldSet:fr,__createBinding:Xt,__decorate:Jt,__exportStar:Qt,__extends:Yt,__generator:$t,__importDefault:ar,__importStar:or,__makeTemplateObject:sr,__metadata:Zt,__param:Gt,__read:mt,__rest:Wt,__spread:er,__spreadArrays:tr,__values:Pe},Symbol.toStringTag,{value:"Module"})),yt=Oe(hr);var ie={},N={},Ze;function St(){return Ze||(Ze=1,Object.defineProperty(N,"__esModule",{value:!0}),N.MAX_HASHABLE_LENGTH=N.INIT=N.KEY=N.DIGEST_LENGTH=N.BLOCK_SIZE=void 0,N.BLOCK_SIZE=64,N.DIGEST_LENGTH=32,N.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),N.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],N.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1),N}var se={},ze;function cr(){if(ze)return se;ze=1,Object.defineProperty(se,"__esModule",{value:!0}),se.RawSha256=void 0;var o=St(),t=(function(){function r(){this.state=Int32Array.from(o.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return r.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var a=0,s=e.byteLength;if(this.bytesHashed+=s,this.bytesHashed*8>o.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;s>0;)this.buffer[this.bufferLength++]=e[a++],s--,this.bufferLength===o.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},r.prototype.digest=function(){if(!this.finished){var e=this.bytesHashed*8,a=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),s=this.bufferLength;if(a.setUint8(this.bufferLength++,128),s%o.BLOCK_SIZE>=o.BLOCK_SIZE-8){for(var f=this.bufferLength;f<o.BLOCK_SIZE;f++)a.setUint8(f,0);this.hashBuffer(),this.bufferLength=0}for(var f=this.bufferLength;f<o.BLOCK_SIZE-8;f++)a.setUint8(f,0);a.setUint32(o.BLOCK_SIZE-8,Math.floor(e/4294967296),!0),a.setUint32(o.BLOCK_SIZE-4,e),this.hashBuffer(),this.finished=!0}for(var u=new Uint8Array(o.DIGEST_LENGTH),f=0;f<8;f++)u[f*4]=this.state[f]>>>24&255,u[f*4+1]=this.state[f]>>>16&255,u[f*4+2]=this.state[f]>>>8&255,u[f*4+3]=this.state[f]>>>0&255;return u},r.prototype.hashBuffer=function(){for(var e=this,a=e.buffer,s=e.state,f=s[0],u=s[1],l=s[2],p=s[3],d=s[4],y=s[5],S=s[6],U=s[7],A=0;A<o.BLOCK_SIZE;A++){if(A<16)this.temp[A]=(a[A*4]&255)<<24|(a[A*4+1]&255)<<16|(a[A*4+2]&255)<<8|a[A*4+3]&255;else{var C=this.temp[A-2],D=(C>>>17|C<<15)^(C>>>19|C<<13)^C>>>10;C=this.temp[A-15];var T=(C>>>7|C<<25)^(C>>>18|C<<14)^C>>>3;this.temp[A]=(D+this.temp[A-7]|0)+(T+this.temp[A-16]|0)}var P=(((d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(d&y^~d&S)|0)+(U+(o.KEY[A]+this.temp[A]|0)|0)|0,j=((f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10))+(f&u^f&l^u&l)|0;U=S,S=y,y=d,d=p+P|0,p=l,l=u,u=f,f=P+j|0}s[0]+=f,s[1]+=u,s[2]+=l,s[3]+=p,s[4]+=d,s[5]+=y,s[6]+=S,s[7]+=U},r})();return se.RawSha256=t,se}var Te={},oe={};const lr=o=>{const t=[];for(let r=0,e=o.length;r<e;r++){const a=o.charCodeAt(r);if(a<128)t.push(a);else if(a<2048)t.push(a>>6|192,a&63|128);else if(r+1<o.length&&(a&64512)===55296&&(o.charCodeAt(r+1)&64512)===56320){const s=65536+((a&1023)<<10)+(o.charCodeAt(++r)&1023);t.push(s>>18|240,s>>12&63|128,s>>6&63|128,s&63|128)}else t.push(a>>12|224,a>>6&63|128,a&63|128)}return Uint8Array.from(t)},pr=o=>{let t="";for(let r=0,e=o.length;r<e;r++){const a=o[r];if(a<128)t+=String.fromCharCode(a);else if(192<=a&&a<224){const s=o[++r];t+=String.fromCharCode((a&31)<<6|s&63)}else if(240<=a&&a<365){const f="%"+[a,o[++r],o[++r],o[++r]].map(u=>u.toString(16)).join("%");t+=decodeURIComponent(f)}else t+=String.fromCharCode((a&15)<<12|(o[++r]&63)<<6|o[++r]&63)}return t};function gr(o){return new TextEncoder().encode(o)}function dr(o){return new TextDecoder("utf-8").decode(o)}const vr=o=>typeof TextEncoder=="function"?gr(o):lr(o),mr=o=>typeof TextDecoder=="function"?dr(o):pr(o),yr=Object.freeze(Object.defineProperty({__proto__:null,fromUtf8:vr,toUtf8:mr},Symbol.toStringTag,{value:"Module"})),Sr=Oe(yr);var $e;function wr(){if($e)return oe;$e=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.convertToBuffer=void 0;var o=Sr,t=typeof Buffer<"u"&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:o.fromUtf8;function r(e){return e instanceof Uint8Array?e:typeof e=="string"?t(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}return oe.convertToBuffer=r,oe}var ae={},Xe;function Cr(){if(Xe)return ae;Xe=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.isEmptyData=void 0;function o(t){return typeof t=="string"?t.length===0:t.byteLength===0}return ae.isEmptyData=o,ae}var ue={},Qe;function Ar(){if(Qe)return ue;Qe=1,Object.defineProperty(ue,"__esModule",{value:!0}),ue.numToUint8=void 0;function o(t){return new Uint8Array([(t&4278190080)>>24,(t&16711680)>>16,(t&65280)>>8,t&255])}return ue.numToUint8=o,ue}var fe={},et;function Ur(){if(et)return fe;et=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.uint32ArrayFrom=void 0;function o(t){if(!Array.from){for(var r=new Uint32Array(t.length),e=0;e<t.length;)r[e]=t[e];return r}return Uint32Array.from(t)}return fe.uint32ArrayFrom=o,fe}var tt;function Er(){return tt||(tt=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.uint32ArrayFrom=o.numToUint8=o.isEmptyData=o.convertToBuffer=void 0;var t=wr();Object.defineProperty(o,"convertToBuffer",{enumerable:!0,get:function(){return t.convertToBuffer}});var r=Cr();Object.defineProperty(o,"isEmptyData",{enumerable:!0,get:function(){return r.isEmptyData}});var e=Ar();Object.defineProperty(o,"numToUint8",{enumerable:!0,get:function(){return e.numToUint8}});var a=Ur();Object.defineProperty(o,"uint32ArrayFrom",{enumerable:!0,get:function(){return a.uint32ArrayFrom}})})(Te)),Te}var rt;function Tr(){if(rt)return ie;rt=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.Sha256=void 0;var o=yt,t=St(),r=cr(),e=Er(),a=(function(){function f(u){if(this.hash=new r.RawSha256,u){this.outer=new r.RawSha256;var l=s(u),p=new Uint8Array(t.BLOCK_SIZE);p.set(l);for(var d=0;d<t.BLOCK_SIZE;d++)l[d]^=54,p[d]^=92;this.hash.update(l),this.outer.update(p);for(var d=0;d<l.byteLength;d++)l[d]=0}}return f.prototype.update=function(u){if(!((0,e.isEmptyData)(u)||this.error))try{this.hash.update((0,e.convertToBuffer)(u))}catch(l){this.error=l}},f.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},f.prototype.digest=function(){return(0,o.__awaiter)(this,void 0,void 0,function(){return(0,o.__generator)(this,function(u){return[2,this.digestSync()]})})},f})();ie.Sha256=a;function s(f){var u=(0,e.convertToBuffer)(f);if(u.byteLength>t.BLOCK_SIZE){var l=new r.RawSha256;l.update(u),u=l.digest()}var p=new Uint8Array(t.BLOCK_SIZE);return p.set(u),p}return ie}var nt;function Dr(){return nt||(nt=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0});var t=yt;(0,t.__exportStar)(Tr(),o)})(Ee)),Ee}var ce=Dr();function w(o,t){o!=null&&this.fromString(o,t)}function b(){return new w(null)}var H,xr=0xdeadbeefcafe,it=(xr&16777215)==15715070;function Ir(o,t,r,e,a,s){for(;--s>=0;){var f=t*this[o++]+r[e]+a;a=Math.floor(f/67108864),r[e++]=f&67108863}return a}function _r(o,t,r,e,a,s){for(var f=t&32767,u=t>>15;--s>=0;){var l=this[o]&32767,p=this[o++]>>15,d=u*l+p*f;l=f*l+((d&32767)<<15)+r[e]+(a&1073741823),a=(l>>>30)+(d>>>15)+u*p+(a>>>30),r[e++]=l&1073741823}return a}function Rr(o,t,r,e,a,s){for(var f=t&16383,u=t>>14;--s>=0;){var l=this[o]&16383,p=this[o++]>>14,d=u*l+p*f;l=f*l+((d&16383)<<14)+r[e]+a,a=(l>>28)+(d>>14)+u*p,r[e++]=l&268435455}return a}var st=typeof navigator<"u";st&&it&&navigator.appName=="Microsoft Internet Explorer"?(w.prototype.am=_r,H=30):st&&it&&navigator.appName!="Netscape"?(w.prototype.am=Ir,H=26):(w.prototype.am=Rr,H=28);w.prototype.DB=H;w.prototype.DM=(1<<H)-1;w.prototype.DV=1<<H;var Ne=52;w.prototype.FV=Math.pow(2,Ne);w.prototype.F1=Ne-H;w.prototype.F2=2*H-Ne;var Pr="0123456789abcdefghijklmnopqrstuvwxyz",we=new Array,Q,V;Q=48;for(V=0;V<=9;++V)we[Q++]=V;Q=97;for(V=10;V<36;++V)we[Q++]=V;Q=65;for(V=10;V<36;++V)we[Q++]=V;function ot(o){return Pr.charAt(o)}function Fr(o,t){var r=we[o.charCodeAt(t)];return r??-1}function Br(o){for(var t=this.t-1;t>=0;--t)o[t]=this[t];o.t=this.t,o.s=this.s}function br(o){this.t=1,this.s=o<0?-1:0,o>0?this[0]=o:o<-1?this[0]=o+this.DV:this.t=0}function Ke(o){var t=b();return t.fromInt(o),t}function Mr(o,t){var r;if(t==16)r=4;else if(t==8)r=3;else if(t==2)r=1;else if(t==32)r=5;else if(t==4)r=2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");this.t=0,this.s=0;for(var e=o.length,a=!1,s=0;--e>=0;){var f=Fr(o,e);if(f<0){o.charAt(e)=="-"&&(a=!0);continue}a=!1,s==0?this[this.t++]=f:s+r>this.DB?(this[this.t-1]|=(f&(1<<this.DB-s)-1)<<s,this[this.t++]=f>>this.DB-s):this[this.t-1]|=f<<s,s+=r,s>=this.DB&&(s-=this.DB)}this.clamp(),a&&w.ZERO.subTo(this,this)}function Or(){for(var o=this.s&this.DM;this.t>0&&this[this.t-1]==o;)--this.t}function Nr(o){if(this.s<0)return"-"+this.negate().toString(o);var t;if(o==16)t=4;else if(o==8)t=3;else if(o==2)t=1;else if(o==32)t=5;else if(o==4)t=2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");var r=(1<<t)-1,e,a=!1,s="",f=this.t,u=this.DB-f*this.DB%t;if(f-- >0)for(u<this.DB&&(e=this[f]>>u)>0&&(a=!0,s=ot(e));f>=0;)u<t?(e=(this[f]&(1<<u)-1)<<t-u,e|=this[--f]>>(u+=this.DB-t)):(e=this[f]>>(u-=t)&r,u<=0&&(u+=this.DB,--f)),e>0&&(a=!0),a&&(s+=ot(e));return a?s:"0"}function Kr(){var o=b();return w.ZERO.subTo(this,o),o}function kr(){return this.s<0?this.negate():this}function qr(o){var t=this.s-o.s;if(t!=0)return t;var r=this.t;if(t=r-o.t,t!=0)return this.s<0?-t:t;for(;--r>=0;)if((t=this[r]-o[r])!=0)return t;return 0}function ke(o){var t=1,r;return(r=o>>>16)!=0&&(o=r,t+=16),(r=o>>8)!=0&&(o=r,t+=8),(r=o>>4)!=0&&(o=r,t+=4),(r=o>>2)!=0&&(o=r,t+=2),(r=o>>1)!=0&&(o=r,t+=1),t}function Vr(){return this.t<=0?0:this.DB*(this.t-1)+ke(this[this.t-1]^this.s&this.DM)}function Lr(o,t){var r;for(r=this.t-1;r>=0;--r)t[r+o]=this[r];for(r=o-1;r>=0;--r)t[r]=0;t.t=this.t+o,t.s=this.s}function jr(o,t){for(var r=o;r<this.t;++r)t[r-o]=this[r];t.t=Math.max(this.t-o,0),t.s=this.s}function Hr(o,t){var r=o%this.DB,e=this.DB-r,a=(1<<e)-1,s=Math.floor(o/this.DB),f=this.s<<r&this.DM,u;for(u=this.t-1;u>=0;--u)t[u+s+1]=this[u]>>e|f,f=(this[u]&a)<<r;for(u=s-1;u>=0;--u)t[u]=0;t[s]=f,t.t=this.t+s+1,t.s=this.s,t.clamp()}function Yr(o,t){t.s=this.s;var r=Math.floor(o/this.DB);if(r>=this.t){t.t=0;return}var e=o%this.DB,a=this.DB-e,s=(1<<e)-1;t[0]=this[r]>>e;for(var f=r+1;f<this.t;++f)t[f-r-1]|=(this[f]&s)<<a,t[f-r]=this[f]>>e;e>0&&(t[this.t-r-1]|=(this.s&s)<<a),t.t=this.t-r,t.clamp()}function Wr(o,t){for(var r=0,e=0,a=Math.min(o.t,this.t);r<a;)e+=this[r]-o[r],t[r++]=e&this.DM,e>>=this.DB;if(o.t<this.t){for(e-=o.s;r<this.t;)e+=this[r],t[r++]=e&this.DM,e>>=this.DB;e+=this.s}else{for(e+=this.s;r<o.t;)e-=o[r],t[r++]=e&this.DM,e>>=this.DB;e-=o.s}t.s=e<0?-1:0,e<-1?t[r++]=this.DV+e:e>0&&(t[r++]=e),t.t=r,t.clamp()}function Jr(o,t){var r=this.abs(),e=o.abs(),a=r.t;for(t.t=a+e.t;--a>=0;)t[a]=0;for(a=0;a<e.t;++a)t[a+r.t]=r.am(0,e[a],t,a,0,r.t);t.s=0,t.clamp(),this.s!=o.s&&w.ZERO.subTo(t,t)}function Gr(o){for(var t=this.abs(),r=o.t=2*t.t;--r>=0;)o[r]=0;for(r=0;r<t.t-1;++r){var e=t.am(r,t[r],o,2*r,0,1);(o[r+t.t]+=t.am(r+1,2*t[r],o,2*r+1,e,t.t-r-1))>=t.DV&&(o[r+t.t]-=t.DV,o[r+t.t+1]=1)}o.t>0&&(o[o.t-1]+=t.am(r,t[r],o,2*r,0,1)),o.s=0,o.clamp()}function Zr(o,t,r){var e=o.abs();if(!(e.t<=0)){var a=this.abs();if(a.t<e.t){t?.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=b());var s=b(),f=this.s,u=o.s,l=this.DB-ke(e[e.t-1]);l>0?(e.lShiftTo(l,s),a.lShiftTo(l,r)):(e.copyTo(s),a.copyTo(r));var p=s.t,d=s[p-1];if(d!=0){var y=d*(1<<this.F1)+(p>1?s[p-2]>>this.F2:0),S=this.FV/y,U=(1<<this.F1)/y,A=1<<this.F2,C=r.t,D=C-p,T=t??b();for(s.dlShiftTo(D,T),r.compareTo(T)>=0&&(r[r.t++]=1,r.subTo(T,r)),w.ONE.dlShiftTo(p,T),T.subTo(s,s);s.t<p;)s[s.t++]=0;for(;--D>=0;){var P=r[--C]==d?this.DM:Math.floor(r[C]*S+(r[C-1]+A)*U);if((r[C]+=s.am(0,P,r,D,0,p))<P)for(s.dlShiftTo(D,T),r.subTo(T,r);r[C]<--P;)r.subTo(T,r)}t!=null&&(r.drShiftTo(p,t),f!=u&&w.ZERO.subTo(t,t)),r.t=p,r.clamp(),l>0&&r.rShiftTo(l,r),f<0&&w.ZERO.subTo(r,r)}}}function zr(o){var t=b();return this.abs().divRemTo(o,null,t),this.s<0&&t.compareTo(w.ZERO)>0&&o.subTo(t,t),t}function $r(){if(this.t<1)return 0;var o=this[0];if((o&1)==0)return 0;var t=o&3;return t=t*(2-(o&15)*t)&15,t=t*(2-(o&255)*t)&255,t=t*(2-((o&65535)*t&65535))&65535,t=t*(2-o*t%this.DV)%this.DV,t>0?this.DV-t:-t}function Xr(o){return this.compareTo(o)==0}function Qr(o,t){for(var r=0,e=0,a=Math.min(o.t,this.t);r<a;)e+=this[r]+o[r],t[r++]=e&this.DM,e>>=this.DB;if(o.t<this.t){for(e+=o.s;r<this.t;)e+=this[r],t[r++]=e&this.DM,e>>=this.DB;e+=this.s}else{for(e+=this.s;r<o.t;)e+=o[r],t[r++]=e&this.DM,e>>=this.DB;e+=o.s}t.s=e<0?-1:0,e>0?t[r++]=e:e<-1&&(t[r++]=this.DV+e),t.t=r,t.clamp()}function en(o){var t=b();return this.addTo(o,t),t}function tn(o){var t=b();return this.subTo(o,t),t}function rn(o){var t=b();return this.multiplyTo(o,t),t}function nn(o){var t=b();return this.divRemTo(o,t,null),t}function ee(o){this.m=o,this.mp=o.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<o.DB-15)-1,this.mt2=2*o.t}function sn(o){var t=b();return o.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),o.s<0&&t.compareTo(w.ZERO)>0&&this.m.subTo(t,t),t}function on(o){var t=b();return o.copyTo(t),this.reduce(t),t}function an(o){for(;o.t<=this.mt2;)o[o.t++]=0;for(var t=0;t<this.m.t;++t){var r=o[t]&32767,e=r*this.mpl+((r*this.mph+(o[t]>>15)*this.mpl&this.um)<<15)&o.DM;for(r=t+this.m.t,o[r]+=this.m.am(0,e,o,t,0,this.m.t);o[r]>=o.DV;)o[r]-=o.DV,o[++r]++}o.clamp(),o.drShiftTo(this.m.t,o),o.compareTo(this.m)>=0&&o.subTo(this.m,o)}function un(o,t){o.squareTo(t),this.reduce(t)}function fn(o,t,r){o.multiplyTo(t,r),this.reduce(r)}ee.prototype.convert=sn;ee.prototype.revert=on;ee.prototype.reduce=an;ee.prototype.mulTo=fn;ee.prototype.sqrTo=un;function hn(o,t,r){var e=o.bitLength(),a,s=Ke(1),f=new ee(t);if(e<=0)return s;e<18?a=1:e<48?a=3:e<144?a=4:e<768?a=5:a=6;var u=new Array,l=3,p=a-1,d=(1<<a)-1;if(u[1]=f.convert(this),a>1){var y=b();for(f.sqrTo(u[1],y);l<=d;)u[l]=b(),f.mulTo(y,u[l-2],u[l]),l+=2}var S=o.t-1,U,A=!0,C=b(),D;for(e=ke(o[S])-1;S>=0;){for(e>=p?U=o[S]>>e-p&d:(U=(o[S]&(1<<e+1)-1)<<p-e,S>0&&(U|=o[S-1]>>this.DB+e-p)),l=a;(U&1)==0;)U>>=1,--l;if((e-=l)<0&&(e+=this.DB,--S),A)u[U].copyTo(s),A=!1;else{for(;l>1;)f.sqrTo(s,C),f.sqrTo(C,s),l-=2;l>0?f.sqrTo(s,C):(D=s,s=C,C=D),f.mulTo(C,u[U],s)}for(;S>=0&&(o[S]&1<<e)==0;)f.sqrTo(s,C),D=s,s=C,C=D,--e<0&&(e=this.DB-1,--S)}var T=f.revert(s);return r(null,T),T}w.prototype.copyTo=Br;w.prototype.fromInt=br;w.prototype.fromString=Mr;w.prototype.clamp=Or;w.prototype.dlShiftTo=Lr;w.prototype.drShiftTo=jr;w.prototype.lShiftTo=Hr;w.prototype.rShiftTo=Yr;w.prototype.subTo=Wr;w.prototype.multiplyTo=Jr;w.prototype.squareTo=Gr;w.prototype.divRemTo=Zr;w.prototype.invDigit=$r;w.prototype.addTo=Qr;w.prototype.toString=Nr;w.prototype.negate=Kr;w.prototype.abs=kr;w.prototype.compareTo=qr;w.prototype.bitLength=Vr;w.prototype.mod=zr;w.prototype.equals=Xr;w.prototype.add=en;w.prototype.subtract=tn;w.prototype.multiply=rn;w.prototype.divide=nn;w.prototype.modPow=hn;w.ZERO=Ke(0);w.ONE=Ke(1);/*!
|
|
22
|
+
***************************************************************************** */var _e=function(o,t){return _e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,e){r.__proto__=e}||function(r,e){for(var a in e)e.hasOwnProperty(a)&&(r[a]=e[a])},_e(o,t)};function Ht(o,t){_e(o,t);function r(){this.constructor=o}o.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Re=function(){return Re=Object.assign||function(t){for(var r,e=1,a=arguments.length;e<a;e++){r=arguments[e];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},Re.apply(this,arguments)};function Yt(o,t){var r={};for(var e in o)Object.prototype.hasOwnProperty.call(o,e)&&t.indexOf(e)<0&&(r[e]=o[e]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,e=Object.getOwnPropertySymbols(o);a<e.length;a++)t.indexOf(e[a])<0&&Object.prototype.propertyIsEnumerable.call(o,e[a])&&(r[e[a]]=o[e[a]]);return r}function Wt(o,t,r,e){var a=arguments.length,s=a<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,r):e,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,t,r,e);else for(var u=o.length-1;u>=0;u--)(f=o[u])&&(s=(a<3?f(s):a>3?f(t,r,s):f(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s}function Jt(o,t){return function(r,e){t(r,e,o)}}function Gt(o,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(o,t)}function Zt(o,t,r,e){function a(s){return s instanceof r?s:new r(function(f){f(s)})}return new(r||(r=Promise))(function(s,f){function u(d){try{g(e.next(d))}catch(y){f(y)}}function l(d){try{g(e.throw(d))}catch(y){f(y)}}function g(d){d.done?s(d.value):a(d.value).then(u,l)}g((e=e.apply(o,t||[])).next())})}function zt(o,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},e,a,s,f;return f={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function u(g){return function(d){return l([g,d])}}function l(g){if(e)throw new TypeError("Generator is already executing.");for(;r;)try{if(e=1,a&&(s=g[0]&2?a.return:g[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,g[1])).done)return s;switch(a=0,s&&(g=[g[0]&2,s.value]),g[0]){case 0:case 1:s=g;break;case 4:return r.label++,{value:g[1],done:!1};case 5:r.label++,a=g[1],g=[0];continue;case 7:g=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(g[0]===6||g[0]===2)){r=0;continue}if(g[0]===3&&(!s||g[1]>s[0]&&g[1]<s[3])){r.label=g[1];break}if(g[0]===6&&r.label<s[1]){r.label=s[1],s=g;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(g);break}s[2]&&r.ops.pop(),r.trys.pop();continue}g=t.call(o,r)}catch(d){g=[6,d],a=0}finally{e=s=0}if(g[0]&5)throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}}function $t(o,t,r,e){e===void 0&&(e=r),o[e]=t[r]}function Xt(o,t){for(var r in o)r!=="default"&&!t.hasOwnProperty(r)&&(t[r]=o[r])}function Pe(o){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&o[t],e=0;if(r)return r.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&e>=o.length&&(o=void 0),{value:o&&o[e++],done:!o}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function mt(o,t){var r=typeof Symbol=="function"&&o[Symbol.iterator];if(!r)return o;var e=r.call(o),a,s=[],f;try{for(;(t===void 0||t-- >0)&&!(a=e.next()).done;)s.push(a.value)}catch(u){f={error:u}}finally{try{a&&!a.done&&(r=e.return)&&r.call(e)}finally{if(f)throw f.error}}return s}function Qt(){for(var o=[],t=0;t<arguments.length;t++)o=o.concat(mt(arguments[t]));return o}function er(){for(var o=0,t=0,r=arguments.length;t<r;t++)o+=arguments[t].length;for(var e=Array(o),a=0,t=0;t<r;t++)for(var s=arguments[t],f=0,u=s.length;f<u;f++,a++)e[a]=s[f];return e}function le(o){return this instanceof le?(this.v=o,this):new le(o)}function tr(o,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r.apply(o,t||[]),a,s=[];return a={},f("next"),f("throw"),f("return"),a[Symbol.asyncIterator]=function(){return this},a;function f(S){e[S]&&(a[S]=function(U){return new Promise(function(A,C){s.push([S,U,A,C])>1||u(S,U)})})}function u(S,U){try{l(e[S](U))}catch(A){y(s[0][3],A)}}function l(S){S.value instanceof le?Promise.resolve(S.value.v).then(g,d):y(s[0][2],S)}function g(S){u("next",S)}function d(S){u("throw",S)}function y(S,U){S(U),s.shift(),s.length&&u(s[0][0],s[0][1])}}function rr(o){var t,r;return t={},e("next"),e("throw",function(a){throw a}),e("return"),t[Symbol.iterator]=function(){return this},t;function e(a,s){t[a]=o[a]?function(f){return(r=!r)?{value:le(o[a](f)),done:a==="return"}:s?s(f):f}:s}}function nr(o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=o[Symbol.asyncIterator],r;return t?t.call(o):(o=typeof Pe=="function"?Pe(o):o[Symbol.iterator](),r={},e("next"),e("throw"),e("return"),r[Symbol.asyncIterator]=function(){return this},r);function e(s){r[s]=o[s]&&function(f){return new Promise(function(u,l){f=o[s](f),a(u,l,f.done,f.value)})}}function a(s,f,u,l){Promise.resolve(l).then(function(g){s({value:g,done:u})},f)}}function ir(o,t){return Object.defineProperty?Object.defineProperty(o,"raw",{value:t}):o.raw=t,o}function sr(o){if(o&&o.__esModule)return o;var t={};if(o!=null)for(var r in o)Object.hasOwnProperty.call(o,r)&&(t[r]=o[r]);return t.default=o,t}function or(o){return o&&o.__esModule?o:{default:o}}function ar(o,t){if(!t.has(o))throw new TypeError("attempted to get private field on non-instance");return t.get(o)}function ur(o,t,r){if(!t.has(o))throw new TypeError("attempted to set private field on non-instance");return t.set(o,r),r}const fr=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Re},__asyncDelegator:rr,__asyncGenerator:tr,__asyncValues:nr,__await:le,__awaiter:Zt,__classPrivateFieldGet:ar,__classPrivateFieldSet:ur,__createBinding:$t,__decorate:Wt,__exportStar:Xt,__extends:Ht,__generator:zt,__importDefault:or,__importStar:sr,__makeTemplateObject:ir,__metadata:Gt,__param:Jt,__read:mt,__rest:Yt,__spread:Qt,__spreadArrays:er,__values:Pe},Symbol.toStringTag,{value:"Module"})),yt=Oe(fr);var ie={},N={},Ze;function St(){return Ze||(Ze=1,Object.defineProperty(N,"__esModule",{value:!0}),N.MAX_HASHABLE_LENGTH=N.INIT=N.KEY=N.DIGEST_LENGTH=N.BLOCK_SIZE=void 0,N.BLOCK_SIZE=64,N.DIGEST_LENGTH=32,N.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),N.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],N.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1),N}var se={},ze;function hr(){if(ze)return se;ze=1,Object.defineProperty(se,"__esModule",{value:!0}),se.RawSha256=void 0;var o=St(),t=(function(){function r(){this.state=Int32Array.from(o.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return r.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var a=0,s=e.byteLength;if(this.bytesHashed+=s,this.bytesHashed*8>o.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;s>0;)this.buffer[this.bufferLength++]=e[a++],s--,this.bufferLength===o.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},r.prototype.digest=function(){if(!this.finished){var e=this.bytesHashed*8,a=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),s=this.bufferLength;if(a.setUint8(this.bufferLength++,128),s%o.BLOCK_SIZE>=o.BLOCK_SIZE-8){for(var f=this.bufferLength;f<o.BLOCK_SIZE;f++)a.setUint8(f,0);this.hashBuffer(),this.bufferLength=0}for(var f=this.bufferLength;f<o.BLOCK_SIZE-8;f++)a.setUint8(f,0);a.setUint32(o.BLOCK_SIZE-8,Math.floor(e/4294967296),!0),a.setUint32(o.BLOCK_SIZE-4,e),this.hashBuffer(),this.finished=!0}for(var u=new Uint8Array(o.DIGEST_LENGTH),f=0;f<8;f++)u[f*4]=this.state[f]>>>24&255,u[f*4+1]=this.state[f]>>>16&255,u[f*4+2]=this.state[f]>>>8&255,u[f*4+3]=this.state[f]>>>0&255;return u},r.prototype.hashBuffer=function(){for(var e=this,a=e.buffer,s=e.state,f=s[0],u=s[1],l=s[2],g=s[3],d=s[4],y=s[5],S=s[6],U=s[7],A=0;A<o.BLOCK_SIZE;A++){if(A<16)this.temp[A]=(a[A*4]&255)<<24|(a[A*4+1]&255)<<16|(a[A*4+2]&255)<<8|a[A*4+3]&255;else{var C=this.temp[A-2],D=(C>>>17|C<<15)^(C>>>19|C<<13)^C>>>10;C=this.temp[A-15];var T=(C>>>7|C<<25)^(C>>>18|C<<14)^C>>>3;this.temp[A]=(D+this.temp[A-7]|0)+(T+this.temp[A-16]|0)}var P=(((d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(d&y^~d&S)|0)+(U+(o.KEY[A]+this.temp[A]|0)|0)|0,j=((f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10))+(f&u^f&l^u&l)|0;U=S,S=y,y=d,d=g+P|0,g=l,l=u,u=f,f=P+j|0}s[0]+=f,s[1]+=u,s[2]+=l,s[3]+=g,s[4]+=d,s[5]+=y,s[6]+=S,s[7]+=U},r})();return se.RawSha256=t,se}var Te={},oe={};const cr=o=>{const t=[];for(let r=0,e=o.length;r<e;r++){const a=o.charCodeAt(r);if(a<128)t.push(a);else if(a<2048)t.push(a>>6|192,a&63|128);else if(r+1<o.length&&(a&64512)===55296&&(o.charCodeAt(r+1)&64512)===56320){const s=65536+((a&1023)<<10)+(o.charCodeAt(++r)&1023);t.push(s>>18|240,s>>12&63|128,s>>6&63|128,s&63|128)}else t.push(a>>12|224,a>>6&63|128,a&63|128)}return Uint8Array.from(t)},lr=o=>{let t="";for(let r=0,e=o.length;r<e;r++){const a=o[r];if(a<128)t+=String.fromCharCode(a);else if(192<=a&&a<224){const s=o[++r];t+=String.fromCharCode((a&31)<<6|s&63)}else if(240<=a&&a<365){const f="%"+[a,o[++r],o[++r],o[++r]].map(u=>u.toString(16)).join("%");t+=decodeURIComponent(f)}else t+=String.fromCharCode((a&15)<<12|(o[++r]&63)<<6|o[++r]&63)}return t};function gr(o){return new TextEncoder().encode(o)}function pr(o){return new TextDecoder("utf-8").decode(o)}const dr=o=>typeof TextEncoder=="function"?gr(o):cr(o),vr=o=>typeof TextDecoder=="function"?pr(o):lr(o),mr=Object.freeze(Object.defineProperty({__proto__:null,fromUtf8:dr,toUtf8:vr},Symbol.toStringTag,{value:"Module"})),yr=Oe(mr);var $e;function Sr(){if($e)return oe;$e=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.convertToBuffer=void 0;var o=yr,t=typeof Buffer<"u"&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:o.fromUtf8;function r(e){return e instanceof Uint8Array?e:typeof e=="string"?t(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}return oe.convertToBuffer=r,oe}var ae={},Xe;function wr(){if(Xe)return ae;Xe=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.isEmptyData=void 0;function o(t){return typeof t=="string"?t.length===0:t.byteLength===0}return ae.isEmptyData=o,ae}var ue={},Qe;function Cr(){if(Qe)return ue;Qe=1,Object.defineProperty(ue,"__esModule",{value:!0}),ue.numToUint8=void 0;function o(t){return new Uint8Array([(t&4278190080)>>24,(t&16711680)>>16,(t&65280)>>8,t&255])}return ue.numToUint8=o,ue}var fe={},et;function Ar(){if(et)return fe;et=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.uint32ArrayFrom=void 0;function o(t){if(!Array.from){for(var r=new Uint32Array(t.length),e=0;e<t.length;)r[e]=t[e];return r}return Uint32Array.from(t)}return fe.uint32ArrayFrom=o,fe}var tt;function Ur(){return tt||(tt=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.uint32ArrayFrom=o.numToUint8=o.isEmptyData=o.convertToBuffer=void 0;var t=Sr();Object.defineProperty(o,"convertToBuffer",{enumerable:!0,get:function(){return t.convertToBuffer}});var r=wr();Object.defineProperty(o,"isEmptyData",{enumerable:!0,get:function(){return r.isEmptyData}});var e=Cr();Object.defineProperty(o,"numToUint8",{enumerable:!0,get:function(){return e.numToUint8}});var a=Ar();Object.defineProperty(o,"uint32ArrayFrom",{enumerable:!0,get:function(){return a.uint32ArrayFrom}})})(Te)),Te}var rt;function Er(){if(rt)return ie;rt=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.Sha256=void 0;var o=yt,t=St(),r=hr(),e=Ur(),a=(function(){function f(u){if(this.hash=new r.RawSha256,u){this.outer=new r.RawSha256;var l=s(u),g=new Uint8Array(t.BLOCK_SIZE);g.set(l);for(var d=0;d<t.BLOCK_SIZE;d++)l[d]^=54,g[d]^=92;this.hash.update(l),this.outer.update(g);for(var d=0;d<l.byteLength;d++)l[d]=0}}return f.prototype.update=function(u){if(!((0,e.isEmptyData)(u)||this.error))try{this.hash.update((0,e.convertToBuffer)(u))}catch(l){this.error=l}},f.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},f.prototype.digest=function(){return(0,o.__awaiter)(this,void 0,void 0,function(){return(0,o.__generator)(this,function(u){return[2,this.digestSync()]})})},f})();ie.Sha256=a;function s(f){var u=(0,e.convertToBuffer)(f);if(u.byteLength>t.BLOCK_SIZE){var l=new r.RawSha256;l.update(u),u=l.digest()}var g=new Uint8Array(t.BLOCK_SIZE);return g.set(u),g}return ie}var nt;function Tr(){return nt||(nt=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0});var t=yt;(0,t.__exportStar)(Er(),o)})(Ee)),Ee}var ce=Tr();function w(o,t){o!=null&&this.fromString(o,t)}function b(){return new w(null)}var H,Dr=0xdeadbeefcafe,it=(Dr&16777215)==15715070;function xr(o,t,r,e,a,s){for(;--s>=0;){var f=t*this[o++]+r[e]+a;a=Math.floor(f/67108864),r[e++]=f&67108863}return a}function Ir(o,t,r,e,a,s){for(var f=t&32767,u=t>>15;--s>=0;){var l=this[o]&32767,g=this[o++]>>15,d=u*l+g*f;l=f*l+((d&32767)<<15)+r[e]+(a&1073741823),a=(l>>>30)+(d>>>15)+u*g+(a>>>30),r[e++]=l&1073741823}return a}function _r(o,t,r,e,a,s){for(var f=t&16383,u=t>>14;--s>=0;){var l=this[o]&16383,g=this[o++]>>14,d=u*l+g*f;l=f*l+((d&16383)<<14)+r[e]+a,a=(l>>28)+(d>>14)+u*g,r[e++]=l&268435455}return a}var st=typeof navigator<"u";st&&it&&navigator.appName=="Microsoft Internet Explorer"?(w.prototype.am=Ir,H=30):st&&it&&navigator.appName!="Netscape"?(w.prototype.am=xr,H=26):(w.prototype.am=_r,H=28);w.prototype.DB=H;w.prototype.DM=(1<<H)-1;w.prototype.DV=1<<H;var Ne=52;w.prototype.FV=Math.pow(2,Ne);w.prototype.F1=Ne-H;w.prototype.F2=2*H-Ne;var Rr="0123456789abcdefghijklmnopqrstuvwxyz",we=new Array,Q,V;Q=48;for(V=0;V<=9;++V)we[Q++]=V;Q=97;for(V=10;V<36;++V)we[Q++]=V;Q=65;for(V=10;V<36;++V)we[Q++]=V;function ot(o){return Rr.charAt(o)}function Pr(o,t){var r=we[o.charCodeAt(t)];return r??-1}function Fr(o){for(var t=this.t-1;t>=0;--t)o[t]=this[t];o.t=this.t,o.s=this.s}function Br(o){this.t=1,this.s=o<0?-1:0,o>0?this[0]=o:o<-1?this[0]=o+this.DV:this.t=0}function Ke(o){var t=b();return t.fromInt(o),t}function br(o,t){var r;if(t==16)r=4;else if(t==8)r=3;else if(t==2)r=1;else if(t==32)r=5;else if(t==4)r=2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");this.t=0,this.s=0;for(var e=o.length,a=!1,s=0;--e>=0;){var f=Pr(o,e);if(f<0){o.charAt(e)=="-"&&(a=!0);continue}a=!1,s==0?this[this.t++]=f:s+r>this.DB?(this[this.t-1]|=(f&(1<<this.DB-s)-1)<<s,this[this.t++]=f>>this.DB-s):this[this.t-1]|=f<<s,s+=r,s>=this.DB&&(s-=this.DB)}this.clamp(),a&&w.ZERO.subTo(this,this)}function Mr(){for(var o=this.s&this.DM;this.t>0&&this[this.t-1]==o;)--this.t}function Or(o){if(this.s<0)return"-"+this.negate().toString(o);var t;if(o==16)t=4;else if(o==8)t=3;else if(o==2)t=1;else if(o==32)t=5;else if(o==4)t=2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");var r=(1<<t)-1,e,a=!1,s="",f=this.t,u=this.DB-f*this.DB%t;if(f-- >0)for(u<this.DB&&(e=this[f]>>u)>0&&(a=!0,s=ot(e));f>=0;)u<t?(e=(this[f]&(1<<u)-1)<<t-u,e|=this[--f]>>(u+=this.DB-t)):(e=this[f]>>(u-=t)&r,u<=0&&(u+=this.DB,--f)),e>0&&(a=!0),a&&(s+=ot(e));return a?s:"0"}function Nr(){var o=b();return w.ZERO.subTo(this,o),o}function Kr(){return this.s<0?this.negate():this}function kr(o){var t=this.s-o.s;if(t!=0)return t;var r=this.t;if(t=r-o.t,t!=0)return this.s<0?-t:t;for(;--r>=0;)if((t=this[r]-o[r])!=0)return t;return 0}function ke(o){var t=1,r;return(r=o>>>16)!=0&&(o=r,t+=16),(r=o>>8)!=0&&(o=r,t+=8),(r=o>>4)!=0&&(o=r,t+=4),(r=o>>2)!=0&&(o=r,t+=2),(r=o>>1)!=0&&(o=r,t+=1),t}function qr(){return this.t<=0?0:this.DB*(this.t-1)+ke(this[this.t-1]^this.s&this.DM)}function Vr(o,t){var r;for(r=this.t-1;r>=0;--r)t[r+o]=this[r];for(r=o-1;r>=0;--r)t[r]=0;t.t=this.t+o,t.s=this.s}function Lr(o,t){for(var r=o;r<this.t;++r)t[r-o]=this[r];t.t=Math.max(this.t-o,0),t.s=this.s}function jr(o,t){var r=o%this.DB,e=this.DB-r,a=(1<<e)-1,s=Math.floor(o/this.DB),f=this.s<<r&this.DM,u;for(u=this.t-1;u>=0;--u)t[u+s+1]=this[u]>>e|f,f=(this[u]&a)<<r;for(u=s-1;u>=0;--u)t[u]=0;t[s]=f,t.t=this.t+s+1,t.s=this.s,t.clamp()}function Hr(o,t){t.s=this.s;var r=Math.floor(o/this.DB);if(r>=this.t){t.t=0;return}var e=o%this.DB,a=this.DB-e,s=(1<<e)-1;t[0]=this[r]>>e;for(var f=r+1;f<this.t;++f)t[f-r-1]|=(this[f]&s)<<a,t[f-r]=this[f]>>e;e>0&&(t[this.t-r-1]|=(this.s&s)<<a),t.t=this.t-r,t.clamp()}function Yr(o,t){for(var r=0,e=0,a=Math.min(o.t,this.t);r<a;)e+=this[r]-o[r],t[r++]=e&this.DM,e>>=this.DB;if(o.t<this.t){for(e-=o.s;r<this.t;)e+=this[r],t[r++]=e&this.DM,e>>=this.DB;e+=this.s}else{for(e+=this.s;r<o.t;)e-=o[r],t[r++]=e&this.DM,e>>=this.DB;e-=o.s}t.s=e<0?-1:0,e<-1?t[r++]=this.DV+e:e>0&&(t[r++]=e),t.t=r,t.clamp()}function Wr(o,t){var r=this.abs(),e=o.abs(),a=r.t;for(t.t=a+e.t;--a>=0;)t[a]=0;for(a=0;a<e.t;++a)t[a+r.t]=r.am(0,e[a],t,a,0,r.t);t.s=0,t.clamp(),this.s!=o.s&&w.ZERO.subTo(t,t)}function Jr(o){for(var t=this.abs(),r=o.t=2*t.t;--r>=0;)o[r]=0;for(r=0;r<t.t-1;++r){var e=t.am(r,t[r],o,2*r,0,1);(o[r+t.t]+=t.am(r+1,2*t[r],o,2*r+1,e,t.t-r-1))>=t.DV&&(o[r+t.t]-=t.DV,o[r+t.t+1]=1)}o.t>0&&(o[o.t-1]+=t.am(r,t[r],o,2*r,0,1)),o.s=0,o.clamp()}function Gr(o,t,r){var e=o.abs();if(!(e.t<=0)){var a=this.abs();if(a.t<e.t){t?.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=b());var s=b(),f=this.s,u=o.s,l=this.DB-ke(e[e.t-1]);l>0?(e.lShiftTo(l,s),a.lShiftTo(l,r)):(e.copyTo(s),a.copyTo(r));var g=s.t,d=s[g-1];if(d!=0){var y=d*(1<<this.F1)+(g>1?s[g-2]>>this.F2:0),S=this.FV/y,U=(1<<this.F1)/y,A=1<<this.F2,C=r.t,D=C-g,T=t??b();for(s.dlShiftTo(D,T),r.compareTo(T)>=0&&(r[r.t++]=1,r.subTo(T,r)),w.ONE.dlShiftTo(g,T),T.subTo(s,s);s.t<g;)s[s.t++]=0;for(;--D>=0;){var P=r[--C]==d?this.DM:Math.floor(r[C]*S+(r[C-1]+A)*U);if((r[C]+=s.am(0,P,r,D,0,g))<P)for(s.dlShiftTo(D,T),r.subTo(T,r);r[C]<--P;)r.subTo(T,r)}t!=null&&(r.drShiftTo(g,t),f!=u&&w.ZERO.subTo(t,t)),r.t=g,r.clamp(),l>0&&r.rShiftTo(l,r),f<0&&w.ZERO.subTo(r,r)}}}function Zr(o){var t=b();return this.abs().divRemTo(o,null,t),this.s<0&&t.compareTo(w.ZERO)>0&&o.subTo(t,t),t}function zr(){if(this.t<1)return 0;var o=this[0];if((o&1)==0)return 0;var t=o&3;return t=t*(2-(o&15)*t)&15,t=t*(2-(o&255)*t)&255,t=t*(2-((o&65535)*t&65535))&65535,t=t*(2-o*t%this.DV)%this.DV,t>0?this.DV-t:-t}function $r(o){return this.compareTo(o)==0}function Xr(o,t){for(var r=0,e=0,a=Math.min(o.t,this.t);r<a;)e+=this[r]+o[r],t[r++]=e&this.DM,e>>=this.DB;if(o.t<this.t){for(e+=o.s;r<this.t;)e+=this[r],t[r++]=e&this.DM,e>>=this.DB;e+=this.s}else{for(e+=this.s;r<o.t;)e+=o[r],t[r++]=e&this.DM,e>>=this.DB;e+=o.s}t.s=e<0?-1:0,e>0?t[r++]=e:e<-1&&(t[r++]=this.DV+e),t.t=r,t.clamp()}function Qr(o){var t=b();return this.addTo(o,t),t}function en(o){var t=b();return this.subTo(o,t),t}function tn(o){var t=b();return this.multiplyTo(o,t),t}function rn(o){var t=b();return this.divRemTo(o,t,null),t}function ee(o){this.m=o,this.mp=o.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<o.DB-15)-1,this.mt2=2*o.t}function nn(o){var t=b();return o.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),o.s<0&&t.compareTo(w.ZERO)>0&&this.m.subTo(t,t),t}function sn(o){var t=b();return o.copyTo(t),this.reduce(t),t}function on(o){for(;o.t<=this.mt2;)o[o.t++]=0;for(var t=0;t<this.m.t;++t){var r=o[t]&32767,e=r*this.mpl+((r*this.mph+(o[t]>>15)*this.mpl&this.um)<<15)&o.DM;for(r=t+this.m.t,o[r]+=this.m.am(0,e,o,t,0,this.m.t);o[r]>=o.DV;)o[r]-=o.DV,o[++r]++}o.clamp(),o.drShiftTo(this.m.t,o),o.compareTo(this.m)>=0&&o.subTo(this.m,o)}function an(o,t){o.squareTo(t),this.reduce(t)}function un(o,t,r){o.multiplyTo(t,r),this.reduce(r)}ee.prototype.convert=nn;ee.prototype.revert=sn;ee.prototype.reduce=on;ee.prototype.mulTo=un;ee.prototype.sqrTo=an;function fn(o,t,r){var e=o.bitLength(),a,s=Ke(1),f=new ee(t);if(e<=0)return s;e<18?a=1:e<48?a=3:e<144?a=4:e<768?a=5:a=6;var u=new Array,l=3,g=a-1,d=(1<<a)-1;if(u[1]=f.convert(this),a>1){var y=b();for(f.sqrTo(u[1],y);l<=d;)u[l]=b(),f.mulTo(y,u[l-2],u[l]),l+=2}var S=o.t-1,U,A=!0,C=b(),D;for(e=ke(o[S])-1;S>=0;){for(e>=g?U=o[S]>>e-g&d:(U=(o[S]&(1<<e+1)-1)<<g-e,S>0&&(U|=o[S-1]>>this.DB+e-g)),l=a;(U&1)==0;)U>>=1,--l;if((e-=l)<0&&(e+=this.DB,--S),A)u[U].copyTo(s),A=!1;else{for(;l>1;)f.sqrTo(s,C),f.sqrTo(C,s),l-=2;l>0?f.sqrTo(s,C):(D=s,s=C,C=D),f.mulTo(C,u[U],s)}for(;S>=0&&(o[S]&1<<e)==0;)f.sqrTo(s,C),D=s,s=C,C=D,--e<0&&(e=this.DB-1,--S)}var T=f.revert(s);return r(null,T),T}w.prototype.copyTo=Fr;w.prototype.fromInt=Br;w.prototype.fromString=br;w.prototype.clamp=Mr;w.prototype.dlShiftTo=Vr;w.prototype.drShiftTo=Lr;w.prototype.lShiftTo=jr;w.prototype.rShiftTo=Hr;w.prototype.subTo=Yr;w.prototype.multiplyTo=Wr;w.prototype.squareTo=Jr;w.prototype.divRemTo=Gr;w.prototype.invDigit=zr;w.prototype.addTo=Xr;w.prototype.toString=Or;w.prototype.negate=Nr;w.prototype.abs=Kr;w.prototype.compareTo=kr;w.prototype.bitLength=qr;w.prototype.mod=Zr;w.prototype.equals=$r;w.prototype.add=Qr;w.prototype.subtract=en;w.prototype.multiply=tn;w.prototype.divide=rn;w.prototype.modPow=fn;w.ZERO=Ke(0);w.ONE=Ke(1);/*!
|
|
23
23
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
24
24
|
* SPDX-License-Identifier: Apache-2.0
|
|
25
|
-
*/function De(o){return I.Buffer.from(new
|
|
25
|
+
*/function De(o){return I.Buffer.from(new jt().random(o).toString(),"hex")}var hn=/^[89a-f]/i,cn="FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF",ln="userAttributes.",X=(function(){function o(r){this.N=new w(cn,16),this.g=new w("2",16),this.k=new w(this.hexHash(""+this.padHex(this.N)+this.padHex(this.g)),16),this.smallAValue=this.generateRandomSmallA(),this.getLargeAValue(function(){}),this.infoBits=I.Buffer.from("Caldera Derived Key","utf8"),this.poolName=r}var t=o.prototype;return t.getSmallAValue=function(){return this.smallAValue},t.getLargeAValue=function(e){var a=this;this.largeAValue?e(null,this.largeAValue):this.calculateA(this.smallAValue,function(s,f){s&&e(s,null),a.largeAValue=f,e(null,a.largeAValue)})},t.generateRandomSmallA=function(){var e=De(128).toString("hex"),a=new w(e,16);return a},t.generateRandomString=function(){return De(40).toString("base64")},t.getRandomPassword=function(){return this.randomPassword},t.getSaltDevices=function(){return this.SaltToHashDevices},t.getVerifierDevices=function(){return this.verifierDevices},t.generateHashDevice=function(e,a,s){var f=this;this.randomPassword=this.generateRandomString();var u=""+e+a+":"+this.randomPassword,l=this.hash(u),g=De(16).toString("hex");this.SaltToHashDevices=this.padHex(new w(g,16)),this.g.modPow(new w(this.hexHash(this.SaltToHashDevices+l),16),this.N,function(d,y){d&&s(d,null),f.verifierDevices=f.padHex(y),s(null,null)})},t.calculateA=function(e,a){var s=this;this.g.modPow(e,this.N,function(f,u){f&&a(f,null),u.mod(s.N).equals(w.ZERO)&&a(new Error("Illegal paramater. A mod N cannot be 0."),null),a(null,u)})},t.calculateU=function(e,a){this.UHexHash=this.hexHash(this.padHex(e)+this.padHex(a));var s=new w(this.UHexHash,16);return s},t.hash=function(e){var a=new ce.Sha256;a.update(e);var s=a.digestSync(),f=I.Buffer.from(s).toString("hex");return new Array(64-f.length).join("0")+f},t.hexHash=function(e){return this.hash(I.Buffer.from(e,"hex"))},t.computehkdf=function(e,a){var s=I.Buffer.concat([this.infoBits,I.Buffer.from("","utf8")]),f=new ce.Sha256(a);f.update(e);var u=f.digestSync(),l=new ce.Sha256(u);l.update(s);var g=l.digestSync(),d=g,y=d.slice(0,16);return y},t.getPasswordAuthenticationKey=function(e,a,s,f,u){var l=this;if(s.mod(this.N).equals(w.ZERO))throw new Error("B cannot be zero.");if(this.UValue=this.calculateU(this.largeAValue,s),this.UValue.equals(w.ZERO))throw new Error("U cannot be zero.");var g=""+this.poolName+e+":"+a,d=this.hash(g),y=new w(this.hexHash(this.padHex(f)+d),16);this.calculateS(y,s,function(S,U){S&&u(S,null);var A=l.computehkdf(I.Buffer.from(l.padHex(U),"hex"),I.Buffer.from(l.padHex(l.UValue),"hex"));u(null,A)})},t.calculateS=function(e,a,s){var f=this;this.g.modPow(e,this.N,function(u,l){u&&s(u,null);var g=a.subtract(f.k.multiply(l));g.modPow(f.smallAValue.add(f.UValue.multiply(e)),f.N,function(d,y){d&&s(d,null),s(null,y.mod(f.N))})})},t.getNewPasswordRequiredChallengeUserAttributePrefix=function(){return ln},t.padHex=function(e){if(!(e instanceof w))throw new Error("Not a BigInteger");var a=e.compareTo(w.ZERO)<0,s=e.abs().toString(16);if(s=s.length%2!==0?"0"+s:s,s=hn.test(s)?"00"+s:s,a){var f=s.split("").map(function(l){var g=~parseInt(l,16)&15;return"0123456789ABCDEF".charAt(g)}).join(""),u=new w(f,16).add(w.ONE);s=u.toString(16),s.toUpperCase().startsWith("FF8")&&(s=s.substring(2))}return s},o})();/*!
|
|
26
26
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
27
27
|
* SPDX-License-Identifier: Apache-2.0
|
|
28
|
-
*/var wt=(function(){function o(r){this.jwtToken=r||"",this.payload=this.decodePayload()}var t=o.prototype;return t.getJwtToken=function(){return this.jwtToken},t.getExpiration=function(){return this.payload.exp},t.getIssuedAt=function(){return this.payload.iat},t.decodePayload=function(){var e=this.jwtToken.split(".")[1];try{return JSON.parse(I.Buffer.from(e,"base64").toString("utf8"))}catch{return{}}},o})();function gn(o,t){o.prototype=Object.create(t.prototype),o.prototype.constructor=o,Fe(o,t)}function Fe(o,t){return Fe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},Fe(o,t)}var at=(function(o){function t(r){var e=r===void 0?{}:r,a=e.AccessToken;return o.call(this,a||"")||this}return gn(t,o),t})(wt);function
|
|
28
|
+
*/var wt=(function(){function o(r){this.jwtToken=r||"",this.payload=this.decodePayload()}var t=o.prototype;return t.getJwtToken=function(){return this.jwtToken},t.getExpiration=function(){return this.payload.exp},t.getIssuedAt=function(){return this.payload.iat},t.decodePayload=function(){var e=this.jwtToken.split(".")[1];try{return JSON.parse(I.Buffer.from(e,"base64").toString("utf8"))}catch{return{}}},o})();function gn(o,t){o.prototype=Object.create(t.prototype),o.prototype.constructor=o,Fe(o,t)}function Fe(o,t){return Fe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},Fe(o,t)}var at=(function(o){function t(r){var e=r===void 0?{}:r,a=e.AccessToken;return o.call(this,a||"")||this}return gn(t,o),t})(wt);function pn(o,t){o.prototype=Object.create(t.prototype),o.prototype.constructor=o,Be(o,t)}function Be(o,t){return Be=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},Be(o,t)}var ut=(function(o){function t(r){var e=r===void 0?{}:r,a=e.IdToken;return o.call(this,a||"")||this}return pn(t,o),t})(wt);/*!
|
|
29
29
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
30
30
|
* SPDX-License-Identifier: Apache-2.0
|
|
31
|
-
*/var ft=(function(){function o(r){var e=r===void 0?{}:r,a=e.RefreshToken;this.token=a||""}var t=o.prototype;return t.getToken=function(){return this.token},o})(),
|
|
31
|
+
*/var ft=(function(){function o(r){var e=r===void 0?{}:r,a=e.RefreshToken;this.token=a||""}var t=o.prototype;return t.getToken=function(){return this.token},o})(),dn="5.0.4";/*!
|
|
32
32
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
33
33
|
* SPDX-License-Identifier: Apache-2.0
|
|
34
|
-
*/var
|
|
34
|
+
*/var vn="aws-amplify/"+dn,Ct={userAgent:vn,isReactNative:typeof navigator<"u"&&navigator.product==="ReactNative"},mn=function(){return Ct.userAgent};/*!
|
|
35
35
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
36
36
|
* SPDX-License-Identifier: Apache-2.0
|
|
37
37
|
*/var ht=(function(){function o(r){var e=r===void 0?{}:r,a=e.IdToken,s=e.RefreshToken,f=e.AccessToken,u=e.ClockDrift;if(f==null||a==null)throw new Error("Id token and Access Token must be present.");this.idToken=a,this.refreshToken=s,this.accessToken=f,this.clockDrift=u===void 0?this.calculateClockDrift():u}var t=o.prototype;return t.getIdToken=function(){return this.idToken},t.getRefreshToken=function(){return this.refreshToken},t.getAccessToken=function(){return this.accessToken},t.getClockDrift=function(){return this.clockDrift},t.calculateClockDrift=function(){var e=Math.floor(new Date/1e3),a=Math.min(this.accessToken.getIssuedAt(),this.idToken.getIssuedAt());return e-a},t.isValid=function(){var e=Math.floor(new Date/1e3),a=e-this.clockDrift;return a<this.accessToken.getExpiration()&&a<this.idToken.getExpiration()},o})();/*!
|
|
38
38
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
39
39
|
* SPDX-License-Identifier: Apache-2.0
|
|
40
|
-
*/var
|
|
40
|
+
*/var yn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Sn=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ct=(function(){function o(){}var t=o.prototype;return t.getNowString=function(){var e=new Date,a=Sn[e.getUTCDay()],s=yn[e.getUTCMonth()],f=e.getUTCDate(),u=e.getUTCHours();u<10&&(u="0"+u);var l=e.getUTCMinutes();l<10&&(l="0"+l);var g=e.getUTCSeconds();g<10&&(g="0"+g);var d=e.getUTCFullYear(),y=a+" "+s+" "+f+" "+u+":"+l+":"+g+" UTC "+d;return y},o})();/*!
|
|
41
41
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
42
42
|
* SPDX-License-Identifier: Apache-2.0
|
|
43
|
-
*/var
|
|
43
|
+
*/var wn=(function(){function o(r){var e=r===void 0?{}:r,a=e.Name,s=e.Value;this.Name=a||"",this.Value=s||""}var t=o.prototype;return t.getValue=function(){return this.Value},t.setValue=function(e){return this.Value=e,this},t.getName=function(){return this.Name},t.setName=function(e){return this.Name=e,this},t.toString=function(){return JSON.stringify(this)},t.toJSON=function(){return{Name:this.Name,Value:this.Value}},o})();/*!
|
|
44
44
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
45
45
|
* SPDX-License-Identifier: Apache-2.0
|
|
46
|
-
*/var Z={},
|
|
46
|
+
*/var Z={},Cn=(function(){function o(){}return o.setItem=function(r,e){return Z[r]=e,Z[r]},o.getItem=function(r){return Object.prototype.hasOwnProperty.call(Z,r)?Z[r]:void 0},o.removeItem=function(r){return delete Z[r]},o.clear=function(){return Z={},Z},o})(),At=(function(){function o(){try{this.storageWindow=window.localStorage,this.storageWindow.setItem("aws.cognito.test-ls",1),this.storageWindow.removeItem("aws.cognito.test-ls")}catch{this.storageWindow=Cn}}var t=o.prototype;return t.getStorage=function(){return this.storageWindow},o})();/*!
|
|
47
47
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
48
48
|
* SPDX-License-Identifier: Apache-2.0
|
|
49
|
-
*/var Un=typeof navigator<"u",lt=Un?Ct.isReactNative?"react-native":navigator.userAgent:"nodejs",pt=(function(){function o(r){if(r==null||r.Username==null||r.Pool==null)throw new Error("Username and Pool information are required.");this.username=r.Username||"",this.pool=r.Pool,this.Session=null,this.client=r.Pool.client,this.signInUserSession=null,this.authenticationFlowType="USER_SRP_AUTH",this.storage=r.Storage||new At().getStorage(),this.keyPrefix="CognitoIdentityServiceProvider."+this.pool.getClientId(),this.userDataKey=this.keyPrefix+"."+this.username+".userData"}var t=o.prototype;return t.setSignInUserSession=function(e){this.clearCachedUserData(),this.signInUserSession=e,this.cacheTokens()},t.getSignInUserSession=function(){return this.signInUserSession},t.getUsername=function(){return this.username},t.getAuthenticationFlowType=function(){return this.authenticationFlowType},t.setAuthenticationFlowType=function(e){this.authenticationFlowType=e},t.initiateAuth=function(e,a){var s=this,f=e.getAuthParameters();f.USERNAME=this.username;var u=Object.keys(e.getValidationData()).length!==0?e.getValidationData():e.getClientMetadata(),l={AuthFlow:"CUSTOM_AUTH",ClientId:this.pool.getClientId(),AuthParameters:f,ClientMetadata:u};this.getUserContextData()&&(l.UserContextData=this.getUserContextData()),this.client.request("InitiateAuth",l,function(p,d){if(p)return a.onFailure(p);var y=d.ChallengeName,S=d.ChallengeParameters;return y==="CUSTOM_CHALLENGE"?(s.Session=d.Session,a.customChallenge(S)):(s.signInUserSession=s.getCognitoUserSession(d.AuthenticationResult),s.cacheTokens(),a.onSuccess(s.signInUserSession))})},t.authenticateUser=function(e,a){return this.authenticationFlowType==="USER_PASSWORD_AUTH"?this.authenticateUserPlainUsernamePassword(e,a):this.authenticationFlowType==="USER_SRP_AUTH"||this.authenticationFlowType==="CUSTOM_AUTH"?this.authenticateUserDefaultAuth(e,a):a.onFailure(new Error("Authentication flow type is invalid."))},t.authenticateUserDefaultAuth=function(e,a){var s=this,f=new X(this.pool.getUserPoolName()),u=new ct,l,p,d={};this.deviceKey!=null&&(d.DEVICE_KEY=this.deviceKey),d.USERNAME=this.username,f.getLargeAValue(function(y,S){y&&a.onFailure(y),d.SRP_A=S.toString(16),s.authenticationFlowType==="CUSTOM_AUTH"&&(d.CHALLENGE_NAME="SRP_A");var U=Object.keys(e.getValidationData()).length!==0?e.getValidationData():e.getClientMetadata(),A={AuthFlow:s.authenticationFlowType,ClientId:s.pool.getClientId(),AuthParameters:d,ClientMetadata:U};s.getUserContextData(s.username)&&(A.UserContextData=s.getUserContextData(s.username)),s.client.request("InitiateAuth",A,function(C,D){if(C)return a.onFailure(C);var T=D.ChallengeParameters;s.username=T.USER_ID_FOR_SRP,s.userDataKey=s.keyPrefix+"."+s.username+".userData",l=new w(T.SRP_B,16),p=new w(T.SALT,16),s.getCachedDeviceKeyAndPassword(),f.getPasswordAuthenticationKey(s.username,e.getPassword(),l,p,function(P,j){P&&a.onFailure(P);var k=u.getNowString(),Y=I.Buffer.concat([I.Buffer.from(s.pool.getUserPoolName(),"utf8"),I.Buffer.from(s.username,"utf8"),I.Buffer.from(T.SECRET_BLOCK,"base64"),I.Buffer.from(k,"utf8")]),W=new ce.Sha256(j);W.update(Y);var te=W.digestSync(),L=I.Buffer.from(te).toString("base64"),O={};O.USERNAME=s.username,O.PASSWORD_CLAIM_SECRET_BLOCK=T.SECRET_BLOCK,O.TIMESTAMP=k,O.PASSWORD_CLAIM_SIGNATURE=L,s.deviceKey!=null&&(O.DEVICE_KEY=s.deviceKey);var J=function($,ne){return s.client.request("RespondToAuthChallenge",$,function(G,Ce){return G&&G.code==="ResourceNotFoundException"&&G.message.toLowerCase().indexOf("device")!==-1?(O.DEVICE_KEY=null,s.deviceKey=null,s.randomPassword=null,s.deviceGroupKey=null,s.clearCachedDeviceKeyAndPassword(),J($,ne)):ne(G,Ce)})},z={ChallengeName:"PASSWORD_VERIFIER",ClientId:s.pool.getClientId(),ChallengeResponses:O,Session:D.Session,ClientMetadata:U};s.getUserContextData()&&(z.UserContextData=s.getUserContextData()),J(z,function(re,$){return re?a.onFailure(re):s.authenticateUserInternal($,f,a)})})})})},t.authenticateUserPlainUsernamePassword=function(e,a){var s=this,f={};if(f.USERNAME=this.username,f.PASSWORD=e.getPassword(),!f.PASSWORD){a.onFailure(new Error("PASSWORD parameter is required"));return}var u=new X(this.pool.getUserPoolName());this.getCachedDeviceKeyAndPassword(),this.deviceKey!=null&&(f.DEVICE_KEY=this.deviceKey);var l=Object.keys(e.getValidationData()).length!==0?e.getValidationData():e.getClientMetadata(),p={AuthFlow:"USER_PASSWORD_AUTH",ClientId:this.pool.getClientId(),AuthParameters:f,ClientMetadata:l};this.getUserContextData(this.username)&&(p.UserContextData=this.getUserContextData(this.username)),this.client.request("InitiateAuth",p,function(d,y){return d?a.onFailure(d):s.authenticateUserInternal(y,u,a)})},t.authenticateUserInternal=function(e,a,s){var f=this,u=e.ChallengeName,l=e.ChallengeParameters;if(u==="SMS_MFA")return this.Session=e.Session,s.mfaRequired(u,l);if(u==="SELECT_MFA_TYPE")return this.Session=e.Session,s.selectMFAType(u,l);if(u==="MFA_SETUP")return this.Session=e.Session,s.mfaSetup(u,l);if(u==="SOFTWARE_TOKEN_MFA")return this.Session=e.Session,s.totpRequired(u,l);if(u==="CUSTOM_CHALLENGE")return this.Session=e.Session,s.customChallenge(l);if(u==="NEW_PASSWORD_REQUIRED"){this.Session=e.Session;var p=null,d=null,y=[],S=a.getNewPasswordRequiredChallengeUserAttributePrefix();if(l&&(p=JSON.parse(e.ChallengeParameters.userAttributes),d=JSON.parse(e.ChallengeParameters.requiredAttributes)),d)for(var U=0;U<d.length;U++)y[U]=d[U].substr(S.length);return s.newPasswordRequired(p,y)}if(u==="DEVICE_SRP_AUTH"){this.Session=e.Session,this.getDeviceResponse(s);return}this.signInUserSession=this.getCognitoUserSession(e.AuthenticationResult),this.challengeName=u,this.cacheTokens();var A=e.AuthenticationResult.NewDeviceMetadata;if(A==null)return s.onSuccess(this.signInUserSession);a.generateHashDevice(e.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,e.AuthenticationResult.NewDeviceMetadata.DeviceKey,function(C){if(C)return s.onFailure(C);var D={Salt:I.Buffer.from(a.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:I.Buffer.from(a.getVerifierDevices(),"hex").toString("base64")};f.verifierDevices=D.PasswordVerifier,f.deviceGroupKey=A.DeviceGroupKey,f.randomPassword=a.getRandomPassword(),f.client.request("ConfirmDevice",{DeviceKey:A.DeviceKey,AccessToken:f.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:D,DeviceName:lt},function(T,P){return T?s.onFailure(T):(f.deviceKey=e.AuthenticationResult.NewDeviceMetadata.DeviceKey,f.cacheDeviceKeyAndPassword(),P.UserConfirmationNecessary===!0?s.onSuccess(f.signInUserSession,P.UserConfirmationNecessary):s.onSuccess(f.signInUserSession))})})},t.completeNewPasswordChallenge=function(e,a,s,f){var u=this;if(!e)return s.onFailure(new Error("New password is required."));var l=new X(this.pool.getUserPoolName()),p=l.getNewPasswordRequiredChallengeUserAttributePrefix(),d={};a&&Object.keys(a).forEach(function(S){d[p+S]=a[S]}),d.NEW_PASSWORD=e,d.USERNAME=this.username;var y={ChallengeName:"NEW_PASSWORD_REQUIRED",ClientId:this.pool.getClientId(),ChallengeResponses:d,Session:this.Session,ClientMetadata:f};this.getUserContextData()&&(y.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",y,function(S,U){return S?s.onFailure(S):u.authenticateUserInternal(U,l,s)})},t.getDeviceResponse=function(e,a){var s=this,f=new X(this.deviceGroupKey),u=new ct,l={};l.USERNAME=this.username,l.DEVICE_KEY=this.deviceKey,f.getLargeAValue(function(p,d){p&&e.onFailure(p),l.SRP_A=d.toString(16);var y={ChallengeName:"DEVICE_SRP_AUTH",ClientId:s.pool.getClientId(),ChallengeResponses:l,ClientMetadata:a,Session:s.Session};s.getUserContextData()&&(y.UserContextData=s.getUserContextData()),s.client.request("RespondToAuthChallenge",y,function(S,U){if(S)return e.onFailure(S);var A=U.ChallengeParameters,C=new w(A.SRP_B,16),D=new w(A.SALT,16);f.getPasswordAuthenticationKey(s.deviceKey,s.randomPassword,C,D,function(T,P){if(T)return e.onFailure(T);var j=u.getNowString(),k=I.Buffer.concat([I.Buffer.from(s.deviceGroupKey,"utf8"),I.Buffer.from(s.deviceKey,"utf8"),I.Buffer.from(A.SECRET_BLOCK,"base64"),I.Buffer.from(j,"utf8")]),Y=new ce.Sha256(P);Y.update(k);var W=Y.digestSync(),te=I.Buffer.from(W).toString("base64"),L={};L.USERNAME=s.username,L.PASSWORD_CLAIM_SECRET_BLOCK=A.SECRET_BLOCK,L.TIMESTAMP=j,L.PASSWORD_CLAIM_SIGNATURE=te,L.DEVICE_KEY=s.deviceKey;var O={ChallengeName:"DEVICE_PASSWORD_VERIFIER",ClientId:s.pool.getClientId(),ChallengeResponses:L,Session:U.Session};s.getUserContextData()&&(O.UserContextData=s.getUserContextData()),s.client.request("RespondToAuthChallenge",O,function(J,z){return J?e.onFailure(J):(s.signInUserSession=s.getCognitoUserSession(z.AuthenticationResult),s.cacheTokens(),e.onSuccess(s.signInUserSession))})})})})},t.confirmRegistration=function(e,a,s,f){var u={ClientId:this.pool.getClientId(),ConfirmationCode:e,Username:this.username,ForceAliasCreation:a,ClientMetadata:f};this.getUserContextData()&&(u.UserContextData=this.getUserContextData()),this.client.request("ConfirmSignUp",u,function(l){return l?s(l,null):s(null,"SUCCESS")})},t.sendCustomChallengeAnswer=function(e,a,s){var f=this,u={};u.USERNAME=this.username,u.ANSWER=e;var l=new X(this.pool.getUserPoolName());this.getCachedDeviceKeyAndPassword(),this.deviceKey!=null&&(u.DEVICE_KEY=this.deviceKey);var p={ChallengeName:"CUSTOM_CHALLENGE",ChallengeResponses:u,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:s};this.getUserContextData()&&(p.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",p,function(d,y){return d?a.onFailure(d):f.authenticateUserInternal(y,l,a)})},t.sendMFACode=function(e,a,s,f){var u=this,l={};l.USERNAME=this.username,l.SMS_MFA_CODE=e;var p=s||"SMS_MFA";p==="SOFTWARE_TOKEN_MFA"&&(l.SOFTWARE_TOKEN_MFA_CODE=e),this.deviceKey!=null&&(l.DEVICE_KEY=this.deviceKey);var d={ChallengeName:p,ChallengeResponses:l,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:f};this.getUserContextData()&&(d.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",d,function(y,S){if(y)return a.onFailure(y);var U=S.ChallengeName;if(U==="DEVICE_SRP_AUTH"){u.getDeviceResponse(a);return}if(u.signInUserSession=u.getCognitoUserSession(S.AuthenticationResult),u.cacheTokens(),S.AuthenticationResult.NewDeviceMetadata==null)return a.onSuccess(u.signInUserSession);var A=new X(u.pool.getUserPoolName());A.generateHashDevice(S.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,S.AuthenticationResult.NewDeviceMetadata.DeviceKey,function(C){if(C)return a.onFailure(C);var D={Salt:I.Buffer.from(A.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:I.Buffer.from(A.getVerifierDevices(),"hex").toString("base64")};u.verifierDevices=D.PasswordVerifier,u.deviceGroupKey=S.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,u.randomPassword=A.getRandomPassword(),u.client.request("ConfirmDevice",{DeviceKey:S.AuthenticationResult.NewDeviceMetadata.DeviceKey,AccessToken:u.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:D,DeviceName:lt},function(T,P){return T?a.onFailure(T):(u.deviceKey=S.AuthenticationResult.NewDeviceMetadata.DeviceKey,u.cacheDeviceKeyAndPassword(),P.UserConfirmationNecessary===!0?a.onSuccess(u.signInUserSession,P.UserConfirmationNecessary):a.onSuccess(u.signInUserSession))})})})},t.changePassword=function(e,a,s,f){if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return s(new Error("User is not authenticated"),null);this.client.request("ChangePassword",{PreviousPassword:e,ProposedPassword:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:f},function(u){return u?s(u,null):s(null,"SUCCESS")})},t.enableMFA=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);var a=[],s={DeliveryMedium:"SMS",AttributeName:"phone_number"};a.push(s),this.client.request("SetUserSettings",{MFAOptions:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(f){return f?e(f,null):e(null,"SUCCESS")})},t.setUserMfaPreference=function(e,a,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return s(new Error("User is not authenticated"),null);this.client.request("SetUserMFAPreference",{SMSMfaSettings:e,SoftwareTokenMfaSettings:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(f){return f?s(f,null):s(null,"SUCCESS")})},t.disableMFA=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);var a=[];this.client.request("SetUserSettings",{MFAOptions:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(s){return s?e(s,null):e(null,"SUCCESS")})},t.deleteUser=function(e,a){var s=this;if(this.signInUserSession==null||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("DeleteUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:a},function(f){return f?e(f,null):(s.clearCachedUser(),e(null,"SUCCESS"))})},t.updateAttributes=function(e,a,s){var f=this;if(this.signInUserSession==null||!this.signInUserSession.isValid())return a(new Error("User is not authenticated"),null);this.client.request("UpdateUserAttributes",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),UserAttributes:e,ClientMetadata:s},function(u,l){return u?a(u,null):f.getUserData(function(){return a(null,"SUCCESS",l)},{bypassCache:!0})})},t.getUserAttributes=function(e){if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return e(new Error("User is not authenticated"),null);this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(a,s){if(a)return e(a,null);for(var f=[],u=0;u<s.UserAttributes.length;u++){var l={Name:s.UserAttributes[u].Name,Value:s.UserAttributes[u].Value},p=new Cn(l);f.push(p)}return e(null,f)})},t.getMFAOptions=function(e){if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return e(new Error("User is not authenticated"),null);this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(a,s){return a?e(a,null):e(null,s.MFAOptions)})},t.createGetUserRequest=function(){return this.client.promisifyRequest("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()})},t.refreshSessionIfPossible=function(e){var a=this;return e===void 0&&(e={}),new Promise(function(s){var f=a.signInUserSession.getRefreshToken();f&&f.getToken()?a.refreshSession(f,s,e.clientMetadata):s()})},t.getUserData=function(e,a){var s=this;if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return this.clearCachedUserData(),e(new Error("User is not authenticated"),null);var f=this.getUserDataFromCache();if(!f){this.fetchUserData().then(function(u){e(null,u)}).catch(e);return}if(this.isFetchUserDataAndTokenRequired(a)){this.fetchUserData().then(function(u){return s.refreshSessionIfPossible(a).then(function(){return u})}).then(function(u){return e(null,u)}).catch(e);return}try{e(null,JSON.parse(f));return}catch(u){this.clearCachedUserData(),e(u,null);return}},t.getUserDataFromCache=function(){var e=this.storage.getItem(this.userDataKey);return e},t.isFetchUserDataAndTokenRequired=function(e){var a=e||{},s=a.bypassCache,f=s===void 0?!1:s;return f},t.fetchUserData=function(){var e=this;return this.createGetUserRequest().then(function(a){return e.cacheUserData(a),a})},t.deleteAttributes=function(e,a){var s=this;if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return a(new Error("User is not authenticated"),null);this.client.request("DeleteUserAttributes",{UserAttributeNames:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(f){return f?a(f,null):s.getUserData(function(){return a(null,"SUCCESS")},{bypassCache:!0})})},t.resendConfirmationCode=function(e,a){var s={ClientId:this.pool.getClientId(),Username:this.username,ClientMetadata:a};this.client.request("ResendConfirmationCode",s,function(f,u){return f?e(f,null):e(null,u)})},t.getSession=function(e,a){if(a===void 0&&(a={}),this.username==null)return e(new Error("Username is null. Cannot retrieve a new session"),null);if(this.signInUserSession!=null&&this.signInUserSession.isValid())return e(null,this.signInUserSession);var s="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,f=s+".idToken",u=s+".accessToken",l=s+".refreshToken",p=s+".clockDrift";if(this.storage.getItem(f)){var d=new ut({IdToken:this.storage.getItem(f)}),y=new at({AccessToken:this.storage.getItem(u)}),S=new ft({RefreshToken:this.storage.getItem(l)}),U=parseInt(this.storage.getItem(p),0)||0,A={IdToken:d,AccessToken:y,RefreshToken:S,ClockDrift:U},C=new ht(A);if(C.isValid())return this.signInUserSession=C,e(null,this.signInUserSession);if(!S.getToken())return e(new Error("Cannot retrieve a new session. Please authenticate."),null);this.refreshSession(S,e,a.clientMetadata)}else e(new Error("Local storage is missing an ID Token, Please authenticate"),null)},t.refreshSession=function(e,a,s){var f=this,u=this.pool.wrapRefreshSessionCallback?this.pool.wrapRefreshSessionCallback(a):a,l={};l.REFRESH_TOKEN=e.getToken();var p="CognitoIdentityServiceProvider."+this.pool.getClientId(),d=p+".LastAuthUser";if(this.storage.getItem(d)){this.username=this.storage.getItem(d);var y=p+"."+this.username+".deviceKey";this.deviceKey=this.storage.getItem(y),l.DEVICE_KEY=this.deviceKey}var S={ClientId:this.pool.getClientId(),AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:l,ClientMetadata:s};this.getUserContextData()&&(S.UserContextData=this.getUserContextData()),this.client.requestWithRetry("InitiateAuth",S,function(U,A){if(U)return U.code==="NotAuthorizedException"&&f.clearCachedUser(),u(U,null);if(A){var C=A.AuthenticationResult;return Object.prototype.hasOwnProperty.call(C,"RefreshToken")||(C.RefreshToken=e.getToken()),f.signInUserSession=f.getCognitoUserSession(C),f.cacheTokens(),u(null,f.signInUserSession)}})},t.cacheTokens=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId(),a=e+"."+this.username+".idToken",s=e+"."+this.username+".accessToken",f=e+"."+this.username+".refreshToken",u=e+"."+this.username+".clockDrift",l=e+".LastAuthUser";this.storage.setItem(a,this.signInUserSession.getIdToken().getJwtToken()),this.storage.setItem(s,this.signInUserSession.getAccessToken().getJwtToken()),this.storage.setItem(f,this.signInUserSession.getRefreshToken().getToken()),this.storage.setItem(u,""+this.signInUserSession.getClockDrift()),this.storage.setItem(l,this.username)},t.cacheUserData=function(e){this.storage.setItem(this.userDataKey,JSON.stringify(e))},t.clearCachedUserData=function(){this.storage.removeItem(this.userDataKey)},t.clearCachedUser=function(){this.clearCachedTokens(),this.clearCachedUserData()},t.cacheDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,a=e+".deviceKey",s=e+".randomPasswordKey",f=e+".deviceGroupKey";this.storage.setItem(a,this.deviceKey),this.storage.setItem(s,this.randomPassword),this.storage.setItem(f,this.deviceGroupKey)},t.getCachedDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,a=e+".deviceKey",s=e+".randomPasswordKey",f=e+".deviceGroupKey";this.storage.getItem(a)&&(this.deviceKey=this.storage.getItem(a),this.randomPassword=this.storage.getItem(s),this.deviceGroupKey=this.storage.getItem(f))},t.clearCachedDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,a=e+".deviceKey",s=e+".randomPasswordKey",f=e+".deviceGroupKey";this.storage.removeItem(a),this.storage.removeItem(s),this.storage.removeItem(f)},t.clearCachedTokens=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId(),a=e+"."+this.username+".idToken",s=e+"."+this.username+".accessToken",f=e+"."+this.username+".refreshToken",u=e+".LastAuthUser",l=e+"."+this.username+".clockDrift";this.storage.removeItem(a),this.storage.removeItem(s),this.storage.removeItem(f),this.storage.removeItem(u),this.storage.removeItem(l)},t.getCognitoUserSession=function(e){var a=new ut(e),s=new at(e),f=new ft(e),u={IdToken:a,AccessToken:s,RefreshToken:f};return new ht(u)},t.forgotPassword=function(e,a){var s={ClientId:this.pool.getClientId(),Username:this.username,ClientMetadata:a};this.getUserContextData()&&(s.UserContextData=this.getUserContextData()),this.client.request("ForgotPassword",s,function(f,u){return f?e.onFailure(f):typeof e.inputVerificationCode=="function"?e.inputVerificationCode(u):e.onSuccess(u)})},t.confirmPassword=function(e,a,s,f){var u={ClientId:this.pool.getClientId(),Username:this.username,ConfirmationCode:e,Password:a,ClientMetadata:f};this.getUserContextData()&&(u.UserContextData=this.getUserContextData()),this.client.request("ConfirmForgotPassword",u,function(l){return l?s.onFailure(l):s.onSuccess("SUCCESS")})},t.getAttributeVerificationCode=function(e,a,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return a.onFailure(new Error("User is not authenticated"));this.client.request("GetUserAttributeVerificationCode",{AttributeName:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:s},function(f,u){return f?a.onFailure(f):typeof a.inputVerificationCode=="function"?a.inputVerificationCode(u):a.onSuccess("SUCCESS")})},t.verifyAttribute=function(e,a,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return s.onFailure(new Error("User is not authenticated"));this.client.request("VerifyUserAttribute",{AttributeName:e,Code:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(f){return f?s.onFailure(f):s.onSuccess("SUCCESS")})},t.getDevice=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("GetDevice",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey},function(a,s){return a?e.onFailure(a):e.onSuccess(s)})},t.forgetSpecificDevice=function(e,a){if(this.signInUserSession==null||!this.signInUserSession.isValid())return a.onFailure(new Error("User is not authenticated"));this.client.request("ForgetDevice",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:e},function(s){return s?a.onFailure(s):a.onSuccess("SUCCESS")})},t.forgetDevice=function(e){var a=this;this.forgetSpecificDevice(this.deviceKey,{onFailure:e.onFailure,onSuccess:function(f){return a.deviceKey=null,a.deviceGroupKey=null,a.randomPassword=null,a.clearCachedDeviceKeyAndPassword(),e.onSuccess(f)}})},t.setDeviceStatusRemembered=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("UpdateDeviceStatus",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey,DeviceRememberedStatus:"remembered"},function(a){return a?e.onFailure(a):e.onSuccess("SUCCESS")})},t.setDeviceStatusNotRemembered=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("UpdateDeviceStatus",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey,DeviceRememberedStatus:"not_remembered"},function(a){return a?e.onFailure(a):e.onSuccess("SUCCESS")})},t.listDevices=function(e,a,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return s.onFailure(new Error("User is not authenticated"));var f={AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),Limit:e};a&&(f.PaginationToken=a),this.client.request("ListDevices",f,function(u,l){return u?s.onFailure(u):s.onSuccess(l)})},t.globalSignOut=function(e){var a=this;if(this.signInUserSession==null||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("GlobalSignOut",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(s){return s?e.onFailure(s):(a.clearCachedUser(),e.onSuccess("SUCCESS"))})},t.signOut=function(e){var a=this;if(!e||typeof e!="function"){this.cleanClientData();return}this.getSession(function(s,f){if(s)return e(s);a.revokeTokens(function(u){a.cleanClientData(),e(u)})})},t.revokeTokens=function(e){if(e===void 0&&(e=function(){}),typeof e!="function")throw new Error("Invalid revokeTokenCallback. It should be a function.");if(!this.signInUserSession){var a=new Error("User is not authenticated");return e(a)}if(!this.signInUserSession.getAccessToken()){var s=new Error("No Access token available");return e(s)}var f=this.signInUserSession.getRefreshToken().getToken(),u=this.signInUserSession.getAccessToken();if(this.isSessionRevocable(u)&&f)return this.revokeToken({token:f,callback:e});e()},t.isSessionRevocable=function(e){if(e&&typeof e.decodePayload=="function")try{var a=e.decodePayload(),s=a.origin_jti;return!!s}catch{}return!1},t.cleanClientData=function(){this.signInUserSession=null,this.clearCachedUser()},t.revokeToken=function(e){var a=e.token,s=e.callback;this.client.requestWithRetry("RevokeToken",{Token:a,ClientId:this.pool.getClientId()},function(f){if(f)return s(f);s()})},t.sendMFASelectionAnswer=function(e,a){var s=this,f={};f.USERNAME=this.username,f.ANSWER=e;var u={ChallengeName:"SELECT_MFA_TYPE",ChallengeResponses:f,ClientId:this.pool.getClientId(),Session:this.Session};this.getUserContextData()&&(u.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",u,function(l,p){if(l)return a.onFailure(l);if(s.Session=p.Session,e==="SMS_MFA")return a.mfaRequired(p.ChallengeName,p.ChallengeParameters);if(e==="SOFTWARE_TOKEN_MFA")return a.totpRequired(p.ChallengeName,p.ChallengeParameters)})},t.getUserContextData=function(){var e=this.pool;return e.getUserContextData(this.username)},t.associateSoftwareToken=function(e){var a=this;this.signInUserSession!=null&&this.signInUserSession.isValid()?this.client.request("AssociateSoftwareToken",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(s,f){return s?e.onFailure(s):e.associateSecretCode(f.SecretCode)}):this.client.request("AssociateSoftwareToken",{Session:this.Session},function(s,f){return s?e.onFailure(s):(a.Session=f.Session,e.associateSecretCode(f.SecretCode))})},t.verifySoftwareToken=function(e,a,s){var f=this;this.signInUserSession!=null&&this.signInUserSession.isValid()?this.client.request("VerifySoftwareToken",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),UserCode:e,FriendlyDeviceName:a},function(u,l){return u?s.onFailure(u):s.onSuccess(l)}):this.client.request("VerifySoftwareToken",{Session:this.Session,UserCode:e,FriendlyDeviceName:a},function(u,l){if(u)return s.onFailure(u);f.Session=l.Session;var p={};p.USERNAME=f.username;var d={ChallengeName:"MFA_SETUP",ClientId:f.pool.getClientId(),ChallengeResponses:p,Session:f.Session};f.getUserContextData()&&(d.UserContextData=f.getUserContextData()),f.client.request("RespondToAuthChallenge",d,function(y,S){return y?s.onFailure(y):(f.signInUserSession=f.getCognitoUserSession(S.AuthenticationResult),f.cacheTokens(),s.onSuccess(f.signInUserSession))})})},o})();function En(o,t){return t=t||{},new Promise(function(r,e){var a=new XMLHttpRequest,s=[],f=[],u={},l=function(){return{ok:(a.status/100|0)==2,statusText:a.statusText,status:a.status,url:a.responseURL,text:function(){return Promise.resolve(a.responseText)},json:function(){return Promise.resolve(a.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([a.response]))},clone:l,headers:{keys:function(){return s},entries:function(){return f},get:function(d){return u[d.toLowerCase()]},has:function(d){return d.toLowerCase()in u}}}};for(var p in a.open(t.method||"get",o,!0),a.onload=function(){a.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(d,y,S){s.push(y=y.toLowerCase()),f.push([y,S]),u[y]=u[y]?u[y]+","+S:S}),r(l())},a.onerror=e,a.withCredentials=t.credentials=="include",t.headers)a.setRequestHeader(p,t.headers[p]);a.send(t.body||null)})}const Tn=Object.freeze(Object.defineProperty({__proto__:null,default:En},Symbol.toStringTag,{value:"Module"})),gt=Oe(Tn);var xe,dt;function Dn(){return dt||(dt=1,xe=self.fetch||(self.fetch=gt.default||gt)),xe}Dn();function K(){}K.prototype.userAgent=yn();var Ln=function(t){t&&(K.prototype.userAgent&&!K.prototype.userAgent.includes(t)&&(K.prototype.userAgent=K.prototype.userAgent.concat(" ",t)),(!K.prototype.userAgent||K.prototype.userAgent==="")&&(K.prototype.userAgent=t))},xn=function(t){var r=K.category?" "+K.category:"",e=K.framework?" framework/"+K.framework:"",a=""+K.prototype.userAgent+r+e;return a};function In(o,t){o.prototype=Object.create(t.prototype),o.prototype.constructor=o,pe(o,t)}function be(o){var t=typeof Map=="function"?new Map:void 0;return be=function(e){if(e===null||!Rn(e))return e;if(typeof e!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(e))return t.get(e);t.set(e,a)}function a(){return _n(e,arguments,Me(this).constructor)}return a.prototype=Object.create(e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),pe(a,e)},be(o)}function _n(o,t,r){if(Ut())return Reflect.construct.apply(null,arguments);var e=[null];e.push.apply(e,t);var a=new(o.bind.apply(o,e));return r&&pe(a,r.prototype),a}function Ut(){try{var o=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ut=function(){return!!o})()}function Rn(o){try{return Function.toString.call(o).indexOf("[native code]")!==-1}catch{return typeof o=="function"}}function pe(o,t){return pe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},pe(o,t)}function Me(o){return Me=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Me(o)}var Pn=(function(o){function t(r,e,a,s){var f;return f=o.call(this,r)||this,f.code=e,f.name=a,f.statusCode=s,f}return In(t,o),t})(be(Error)),Fn=(function(){function o(r,e,a){this.endpoint=e||"https://cognito-idp."+r+".amazonaws.com/";var s=a||{},f=s.credentials;this.fetchOptions=f?{credentials:f}:{}}var t=o.prototype;return t.promisifyRequest=function(e,a){var s=this;return new Promise(function(f,u){s.request(e,a,function(l,p){l?u(new Pn(l.message,l.code,l.name,l.statusCode)):f(p)})})},t.requestWithRetry=function(e,a,s){var f=this,u=5*1e3;Mn(function(l){return new Promise(function(p,d){f.request(e,l,function(y,S){y?d(y):p(S)})})},[a],u).then(function(l){return s(null,l)}).catch(function(l){return s(l)})},t.request=function(e,a,s){var f={"Content-Type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityProviderService."+e,"X-Amz-User-Agent":xn(),"Cache-Control":"no-store"},u=Object.assign({},this.fetchOptions,{headers:f,method:"POST",mode:"cors",body:JSON.stringify(a)}),l;fetch(this.endpoint,u).then(function(p){return l=p,p},function(p){throw p instanceof TypeError?new Error("Network error"):p}).then(function(p){return p.json().catch(function(){return{}})}).then(function(p){if(l.ok)return s(null,p);var d=(p.__type||p.code).split("#").pop(),y=new Error(p.message||p.Message||null);return y.name=d,y.code=d,s(y)}).catch(function(p){if(l&&l.headers&&l.headers.get("x-amzn-errortype"))try{var d=l.headers.get("x-amzn-errortype").split(":")[0],y=new Error(l.status?l.status.toString():null);return y.code=d,y.name=d,y.statusCode=l.status,s(y)}catch{return s(p)}else p instanceof Error&&p.message==="Network error"&&(p.code="NetworkError");return s(p)})},o})(),Se={debug:function(){}},Bn=function(t){var r="nonRetryable";return t&&t[r]};function Et(o,t,r,e){if(e===void 0&&(e=1),typeof o!="function")throw Error("functionToRetry must be a function");return Se.debug(o.name+" attempt #"+e+" with args: "+JSON.stringify(t)),o.apply(void 0,t).catch(function(a){if(Se.debug("error on "+o.name,a),Bn(a))throw Se.debug(o.name+" non retryable error",a),a;var s=r(e,t,a);if(Se.debug(o.name+" retrying in "+s+" ms"),s!==!1)return new Promise(function(f){return setTimeout(f,s)}).then(function(){return Et(o,t,r,e+1)});throw a})}function bn(o){var t=100,r=100;return function(e){var a=Math.pow(2,e)*t+r*Math.random();return a>o?!1:a}}function Mn(o,t,r){return Et(o,t,bn(r))}/*!
|
|
49
|
+
*/var An=typeof navigator<"u",lt=An?Ct.isReactNative?"react-native":navigator.userAgent:"nodejs",gt=(function(){function o(r){if(r==null||r.Username==null||r.Pool==null)throw new Error("Username and Pool information are required.");this.username=r.Username||"",this.pool=r.Pool,this.Session=null,this.client=r.Pool.client,this.signInUserSession=null,this.authenticationFlowType="USER_SRP_AUTH",this.storage=r.Storage||new At().getStorage(),this.keyPrefix="CognitoIdentityServiceProvider."+this.pool.getClientId(),this.userDataKey=this.keyPrefix+"."+this.username+".userData"}var t=o.prototype;return t.setSignInUserSession=function(e){this.clearCachedUserData(),this.signInUserSession=e,this.cacheTokens()},t.getSignInUserSession=function(){return this.signInUserSession},t.getUsername=function(){return this.username},t.getAuthenticationFlowType=function(){return this.authenticationFlowType},t.setAuthenticationFlowType=function(e){this.authenticationFlowType=e},t.initiateAuth=function(e,a){var s=this,f=e.getAuthParameters();f.USERNAME=this.username;var u=Object.keys(e.getValidationData()).length!==0?e.getValidationData():e.getClientMetadata(),l={AuthFlow:"CUSTOM_AUTH",ClientId:this.pool.getClientId(),AuthParameters:f,ClientMetadata:u};this.getUserContextData()&&(l.UserContextData=this.getUserContextData()),this.client.request("InitiateAuth",l,function(g,d){if(g)return a.onFailure(g);var y=d.ChallengeName,S=d.ChallengeParameters;return y==="CUSTOM_CHALLENGE"?(s.Session=d.Session,a.customChallenge(S)):(s.signInUserSession=s.getCognitoUserSession(d.AuthenticationResult),s.cacheTokens(),a.onSuccess(s.signInUserSession))})},t.authenticateUser=function(e,a){return this.authenticationFlowType==="USER_PASSWORD_AUTH"?this.authenticateUserPlainUsernamePassword(e,a):this.authenticationFlowType==="USER_SRP_AUTH"||this.authenticationFlowType==="CUSTOM_AUTH"?this.authenticateUserDefaultAuth(e,a):a.onFailure(new Error("Authentication flow type is invalid."))},t.authenticateUserDefaultAuth=function(e,a){var s=this,f=new X(this.pool.getUserPoolName()),u=new ct,l,g,d={};this.deviceKey!=null&&(d.DEVICE_KEY=this.deviceKey),d.USERNAME=this.username,f.getLargeAValue(function(y,S){y&&a.onFailure(y),d.SRP_A=S.toString(16),s.authenticationFlowType==="CUSTOM_AUTH"&&(d.CHALLENGE_NAME="SRP_A");var U=Object.keys(e.getValidationData()).length!==0?e.getValidationData():e.getClientMetadata(),A={AuthFlow:s.authenticationFlowType,ClientId:s.pool.getClientId(),AuthParameters:d,ClientMetadata:U};s.getUserContextData(s.username)&&(A.UserContextData=s.getUserContextData(s.username)),s.client.request("InitiateAuth",A,function(C,D){if(C)return a.onFailure(C);var T=D.ChallengeParameters;s.username=T.USER_ID_FOR_SRP,s.userDataKey=s.keyPrefix+"."+s.username+".userData",l=new w(T.SRP_B,16),g=new w(T.SALT,16),s.getCachedDeviceKeyAndPassword(),f.getPasswordAuthenticationKey(s.username,e.getPassword(),l,g,function(P,j){P&&a.onFailure(P);var k=u.getNowString(),Y=I.Buffer.concat([I.Buffer.from(s.pool.getUserPoolName(),"utf8"),I.Buffer.from(s.username,"utf8"),I.Buffer.from(T.SECRET_BLOCK,"base64"),I.Buffer.from(k,"utf8")]),W=new ce.Sha256(j);W.update(Y);var te=W.digestSync(),L=I.Buffer.from(te).toString("base64"),O={};O.USERNAME=s.username,O.PASSWORD_CLAIM_SECRET_BLOCK=T.SECRET_BLOCK,O.TIMESTAMP=k,O.PASSWORD_CLAIM_SIGNATURE=L,s.deviceKey!=null&&(O.DEVICE_KEY=s.deviceKey);var J=function($,ne){return s.client.request("RespondToAuthChallenge",$,function(G,Ce){return G&&G.code==="ResourceNotFoundException"&&G.message.toLowerCase().indexOf("device")!==-1?(O.DEVICE_KEY=null,s.deviceKey=null,s.randomPassword=null,s.deviceGroupKey=null,s.clearCachedDeviceKeyAndPassword(),J($,ne)):ne(G,Ce)})},z={ChallengeName:"PASSWORD_VERIFIER",ClientId:s.pool.getClientId(),ChallengeResponses:O,Session:D.Session,ClientMetadata:U};s.getUserContextData()&&(z.UserContextData=s.getUserContextData()),J(z,function(re,$){return re?a.onFailure(re):s.authenticateUserInternal($,f,a)})})})})},t.authenticateUserPlainUsernamePassword=function(e,a){var s=this,f={};if(f.USERNAME=this.username,f.PASSWORD=e.getPassword(),!f.PASSWORD){a.onFailure(new Error("PASSWORD parameter is required"));return}var u=new X(this.pool.getUserPoolName());this.getCachedDeviceKeyAndPassword(),this.deviceKey!=null&&(f.DEVICE_KEY=this.deviceKey);var l=Object.keys(e.getValidationData()).length!==0?e.getValidationData():e.getClientMetadata(),g={AuthFlow:"USER_PASSWORD_AUTH",ClientId:this.pool.getClientId(),AuthParameters:f,ClientMetadata:l};this.getUserContextData(this.username)&&(g.UserContextData=this.getUserContextData(this.username)),this.client.request("InitiateAuth",g,function(d,y){return d?a.onFailure(d):s.authenticateUserInternal(y,u,a)})},t.authenticateUserInternal=function(e,a,s){var f=this,u=e.ChallengeName,l=e.ChallengeParameters;if(u==="SMS_MFA")return this.Session=e.Session,s.mfaRequired(u,l);if(u==="SELECT_MFA_TYPE")return this.Session=e.Session,s.selectMFAType(u,l);if(u==="MFA_SETUP")return this.Session=e.Session,s.mfaSetup(u,l);if(u==="SOFTWARE_TOKEN_MFA")return this.Session=e.Session,s.totpRequired(u,l);if(u==="CUSTOM_CHALLENGE")return this.Session=e.Session,s.customChallenge(l);if(u==="NEW_PASSWORD_REQUIRED"){this.Session=e.Session;var g=null,d=null,y=[],S=a.getNewPasswordRequiredChallengeUserAttributePrefix();if(l&&(g=JSON.parse(e.ChallengeParameters.userAttributes),d=JSON.parse(e.ChallengeParameters.requiredAttributes)),d)for(var U=0;U<d.length;U++)y[U]=d[U].substr(S.length);return s.newPasswordRequired(g,y)}if(u==="DEVICE_SRP_AUTH"){this.Session=e.Session,this.getDeviceResponse(s);return}this.signInUserSession=this.getCognitoUserSession(e.AuthenticationResult),this.challengeName=u,this.cacheTokens();var A=e.AuthenticationResult.NewDeviceMetadata;if(A==null)return s.onSuccess(this.signInUserSession);a.generateHashDevice(e.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,e.AuthenticationResult.NewDeviceMetadata.DeviceKey,function(C){if(C)return s.onFailure(C);var D={Salt:I.Buffer.from(a.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:I.Buffer.from(a.getVerifierDevices(),"hex").toString("base64")};f.verifierDevices=D.PasswordVerifier,f.deviceGroupKey=A.DeviceGroupKey,f.randomPassword=a.getRandomPassword(),f.client.request("ConfirmDevice",{DeviceKey:A.DeviceKey,AccessToken:f.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:D,DeviceName:lt},function(T,P){return T?s.onFailure(T):(f.deviceKey=e.AuthenticationResult.NewDeviceMetadata.DeviceKey,f.cacheDeviceKeyAndPassword(),P.UserConfirmationNecessary===!0?s.onSuccess(f.signInUserSession,P.UserConfirmationNecessary):s.onSuccess(f.signInUserSession))})})},t.completeNewPasswordChallenge=function(e,a,s,f){var u=this;if(!e)return s.onFailure(new Error("New password is required."));var l=new X(this.pool.getUserPoolName()),g=l.getNewPasswordRequiredChallengeUserAttributePrefix(),d={};a&&Object.keys(a).forEach(function(S){d[g+S]=a[S]}),d.NEW_PASSWORD=e,d.USERNAME=this.username;var y={ChallengeName:"NEW_PASSWORD_REQUIRED",ClientId:this.pool.getClientId(),ChallengeResponses:d,Session:this.Session,ClientMetadata:f};this.getUserContextData()&&(y.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",y,function(S,U){return S?s.onFailure(S):u.authenticateUserInternal(U,l,s)})},t.getDeviceResponse=function(e,a){var s=this,f=new X(this.deviceGroupKey),u=new ct,l={};l.USERNAME=this.username,l.DEVICE_KEY=this.deviceKey,f.getLargeAValue(function(g,d){g&&e.onFailure(g),l.SRP_A=d.toString(16);var y={ChallengeName:"DEVICE_SRP_AUTH",ClientId:s.pool.getClientId(),ChallengeResponses:l,ClientMetadata:a,Session:s.Session};s.getUserContextData()&&(y.UserContextData=s.getUserContextData()),s.client.request("RespondToAuthChallenge",y,function(S,U){if(S)return e.onFailure(S);var A=U.ChallengeParameters,C=new w(A.SRP_B,16),D=new w(A.SALT,16);f.getPasswordAuthenticationKey(s.deviceKey,s.randomPassword,C,D,function(T,P){if(T)return e.onFailure(T);var j=u.getNowString(),k=I.Buffer.concat([I.Buffer.from(s.deviceGroupKey,"utf8"),I.Buffer.from(s.deviceKey,"utf8"),I.Buffer.from(A.SECRET_BLOCK,"base64"),I.Buffer.from(j,"utf8")]),Y=new ce.Sha256(P);Y.update(k);var W=Y.digestSync(),te=I.Buffer.from(W).toString("base64"),L={};L.USERNAME=s.username,L.PASSWORD_CLAIM_SECRET_BLOCK=A.SECRET_BLOCK,L.TIMESTAMP=j,L.PASSWORD_CLAIM_SIGNATURE=te,L.DEVICE_KEY=s.deviceKey;var O={ChallengeName:"DEVICE_PASSWORD_VERIFIER",ClientId:s.pool.getClientId(),ChallengeResponses:L,Session:U.Session};s.getUserContextData()&&(O.UserContextData=s.getUserContextData()),s.client.request("RespondToAuthChallenge",O,function(J,z){return J?e.onFailure(J):(s.signInUserSession=s.getCognitoUserSession(z.AuthenticationResult),s.cacheTokens(),e.onSuccess(s.signInUserSession))})})})})},t.confirmRegistration=function(e,a,s,f){var u={ClientId:this.pool.getClientId(),ConfirmationCode:e,Username:this.username,ForceAliasCreation:a,ClientMetadata:f};this.getUserContextData()&&(u.UserContextData=this.getUserContextData()),this.client.request("ConfirmSignUp",u,function(l){return l?s(l,null):s(null,"SUCCESS")})},t.sendCustomChallengeAnswer=function(e,a,s){var f=this,u={};u.USERNAME=this.username,u.ANSWER=e;var l=new X(this.pool.getUserPoolName());this.getCachedDeviceKeyAndPassword(),this.deviceKey!=null&&(u.DEVICE_KEY=this.deviceKey);var g={ChallengeName:"CUSTOM_CHALLENGE",ChallengeResponses:u,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:s};this.getUserContextData()&&(g.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",g,function(d,y){return d?a.onFailure(d):f.authenticateUserInternal(y,l,a)})},t.sendMFACode=function(e,a,s,f){var u=this,l={};l.USERNAME=this.username,l.SMS_MFA_CODE=e;var g=s||"SMS_MFA";g==="SOFTWARE_TOKEN_MFA"&&(l.SOFTWARE_TOKEN_MFA_CODE=e),this.deviceKey!=null&&(l.DEVICE_KEY=this.deviceKey);var d={ChallengeName:g,ChallengeResponses:l,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:f};this.getUserContextData()&&(d.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",d,function(y,S){if(y)return a.onFailure(y);var U=S.ChallengeName;if(U==="DEVICE_SRP_AUTH"){u.getDeviceResponse(a);return}if(u.signInUserSession=u.getCognitoUserSession(S.AuthenticationResult),u.cacheTokens(),S.AuthenticationResult.NewDeviceMetadata==null)return a.onSuccess(u.signInUserSession);var A=new X(u.pool.getUserPoolName());A.generateHashDevice(S.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,S.AuthenticationResult.NewDeviceMetadata.DeviceKey,function(C){if(C)return a.onFailure(C);var D={Salt:I.Buffer.from(A.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:I.Buffer.from(A.getVerifierDevices(),"hex").toString("base64")};u.verifierDevices=D.PasswordVerifier,u.deviceGroupKey=S.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,u.randomPassword=A.getRandomPassword(),u.client.request("ConfirmDevice",{DeviceKey:S.AuthenticationResult.NewDeviceMetadata.DeviceKey,AccessToken:u.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:D,DeviceName:lt},function(T,P){return T?a.onFailure(T):(u.deviceKey=S.AuthenticationResult.NewDeviceMetadata.DeviceKey,u.cacheDeviceKeyAndPassword(),P.UserConfirmationNecessary===!0?a.onSuccess(u.signInUserSession,P.UserConfirmationNecessary):a.onSuccess(u.signInUserSession))})})})},t.changePassword=function(e,a,s,f){if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return s(new Error("User is not authenticated"),null);this.client.request("ChangePassword",{PreviousPassword:e,ProposedPassword:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:f},function(u){return u?s(u,null):s(null,"SUCCESS")})},t.enableMFA=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);var a=[],s={DeliveryMedium:"SMS",AttributeName:"phone_number"};a.push(s),this.client.request("SetUserSettings",{MFAOptions:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(f){return f?e(f,null):e(null,"SUCCESS")})},t.setUserMfaPreference=function(e,a,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return s(new Error("User is not authenticated"),null);this.client.request("SetUserMFAPreference",{SMSMfaSettings:e,SoftwareTokenMfaSettings:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(f){return f?s(f,null):s(null,"SUCCESS")})},t.disableMFA=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);var a=[];this.client.request("SetUserSettings",{MFAOptions:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(s){return s?e(s,null):e(null,"SUCCESS")})},t.deleteUser=function(e,a){var s=this;if(this.signInUserSession==null||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("DeleteUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:a},function(f){return f?e(f,null):(s.clearCachedUser(),e(null,"SUCCESS"))})},t.updateAttributes=function(e,a,s){var f=this;if(this.signInUserSession==null||!this.signInUserSession.isValid())return a(new Error("User is not authenticated"),null);this.client.request("UpdateUserAttributes",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),UserAttributes:e,ClientMetadata:s},function(u,l){return u?a(u,null):f.getUserData(function(){return a(null,"SUCCESS",l)},{bypassCache:!0})})},t.getUserAttributes=function(e){if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return e(new Error("User is not authenticated"),null);this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(a,s){if(a)return e(a,null);for(var f=[],u=0;u<s.UserAttributes.length;u++){var l={Name:s.UserAttributes[u].Name,Value:s.UserAttributes[u].Value},g=new wn(l);f.push(g)}return e(null,f)})},t.getMFAOptions=function(e){if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return e(new Error("User is not authenticated"),null);this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(a,s){return a?e(a,null):e(null,s.MFAOptions)})},t.createGetUserRequest=function(){return this.client.promisifyRequest("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()})},t.refreshSessionIfPossible=function(e){var a=this;return e===void 0&&(e={}),new Promise(function(s){var f=a.signInUserSession.getRefreshToken();f&&f.getToken()?a.refreshSession(f,s,e.clientMetadata):s()})},t.getUserData=function(e,a){var s=this;if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return this.clearCachedUserData(),e(new Error("User is not authenticated"),null);var f=this.getUserDataFromCache();if(!f){this.fetchUserData().then(function(u){e(null,u)}).catch(e);return}if(this.isFetchUserDataAndTokenRequired(a)){this.fetchUserData().then(function(u){return s.refreshSessionIfPossible(a).then(function(){return u})}).then(function(u){return e(null,u)}).catch(e);return}try{e(null,JSON.parse(f));return}catch(u){this.clearCachedUserData(),e(u,null);return}},t.getUserDataFromCache=function(){var e=this.storage.getItem(this.userDataKey);return e},t.isFetchUserDataAndTokenRequired=function(e){var a=e||{},s=a.bypassCache,f=s===void 0?!1:s;return f},t.fetchUserData=function(){var e=this;return this.createGetUserRequest().then(function(a){return e.cacheUserData(a),a})},t.deleteAttributes=function(e,a){var s=this;if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return a(new Error("User is not authenticated"),null);this.client.request("DeleteUserAttributes",{UserAttributeNames:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(f){return f?a(f,null):s.getUserData(function(){return a(null,"SUCCESS")},{bypassCache:!0})})},t.resendConfirmationCode=function(e,a){var s={ClientId:this.pool.getClientId(),Username:this.username,ClientMetadata:a};this.client.request("ResendConfirmationCode",s,function(f,u){return f?e(f,null):e(null,u)})},t.getSession=function(e,a){if(a===void 0&&(a={}),this.username==null)return e(new Error("Username is null. Cannot retrieve a new session"),null);if(this.signInUserSession!=null&&this.signInUserSession.isValid())return e(null,this.signInUserSession);var s="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,f=s+".idToken",u=s+".accessToken",l=s+".refreshToken",g=s+".clockDrift";if(this.storage.getItem(f)){var d=new ut({IdToken:this.storage.getItem(f)}),y=new at({AccessToken:this.storage.getItem(u)}),S=new ft({RefreshToken:this.storage.getItem(l)}),U=parseInt(this.storage.getItem(g),0)||0,A={IdToken:d,AccessToken:y,RefreshToken:S,ClockDrift:U},C=new ht(A);if(C.isValid())return this.signInUserSession=C,e(null,this.signInUserSession);if(!S.getToken())return e(new Error("Cannot retrieve a new session. Please authenticate."),null);this.refreshSession(S,e,a.clientMetadata)}else e(new Error("Local storage is missing an ID Token, Please authenticate"),null)},t.refreshSession=function(e,a,s){var f=this,u=this.pool.wrapRefreshSessionCallback?this.pool.wrapRefreshSessionCallback(a):a,l={};l.REFRESH_TOKEN=e.getToken();var g="CognitoIdentityServiceProvider."+this.pool.getClientId(),d=g+".LastAuthUser";if(this.storage.getItem(d)){this.username=this.storage.getItem(d);var y=g+"."+this.username+".deviceKey";this.deviceKey=this.storage.getItem(y),l.DEVICE_KEY=this.deviceKey}var S={ClientId:this.pool.getClientId(),AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:l,ClientMetadata:s};this.getUserContextData()&&(S.UserContextData=this.getUserContextData()),this.client.requestWithRetry("InitiateAuth",S,function(U,A){if(U)return U.code==="NotAuthorizedException"&&f.clearCachedUser(),u(U,null);if(A){var C=A.AuthenticationResult;return Object.prototype.hasOwnProperty.call(C,"RefreshToken")||(C.RefreshToken=e.getToken()),f.signInUserSession=f.getCognitoUserSession(C),f.cacheTokens(),u(null,f.signInUserSession)}})},t.cacheTokens=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId(),a=e+"."+this.username+".idToken",s=e+"."+this.username+".accessToken",f=e+"."+this.username+".refreshToken",u=e+"."+this.username+".clockDrift",l=e+".LastAuthUser";this.storage.setItem(a,this.signInUserSession.getIdToken().getJwtToken()),this.storage.setItem(s,this.signInUserSession.getAccessToken().getJwtToken()),this.storage.setItem(f,this.signInUserSession.getRefreshToken().getToken()),this.storage.setItem(u,""+this.signInUserSession.getClockDrift()),this.storage.setItem(l,this.username)},t.cacheUserData=function(e){this.storage.setItem(this.userDataKey,JSON.stringify(e))},t.clearCachedUserData=function(){this.storage.removeItem(this.userDataKey)},t.clearCachedUser=function(){this.clearCachedTokens(),this.clearCachedUserData()},t.cacheDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,a=e+".deviceKey",s=e+".randomPasswordKey",f=e+".deviceGroupKey";this.storage.setItem(a,this.deviceKey),this.storage.setItem(s,this.randomPassword),this.storage.setItem(f,this.deviceGroupKey)},t.getCachedDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,a=e+".deviceKey",s=e+".randomPasswordKey",f=e+".deviceGroupKey";this.storage.getItem(a)&&(this.deviceKey=this.storage.getItem(a),this.randomPassword=this.storage.getItem(s),this.deviceGroupKey=this.storage.getItem(f))},t.clearCachedDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,a=e+".deviceKey",s=e+".randomPasswordKey",f=e+".deviceGroupKey";this.storage.removeItem(a),this.storage.removeItem(s),this.storage.removeItem(f)},t.clearCachedTokens=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId(),a=e+"."+this.username+".idToken",s=e+"."+this.username+".accessToken",f=e+"."+this.username+".refreshToken",u=e+".LastAuthUser",l=e+"."+this.username+".clockDrift";this.storage.removeItem(a),this.storage.removeItem(s),this.storage.removeItem(f),this.storage.removeItem(u),this.storage.removeItem(l)},t.getCognitoUserSession=function(e){var a=new ut(e),s=new at(e),f=new ft(e),u={IdToken:a,AccessToken:s,RefreshToken:f};return new ht(u)},t.forgotPassword=function(e,a){var s={ClientId:this.pool.getClientId(),Username:this.username,ClientMetadata:a};this.getUserContextData()&&(s.UserContextData=this.getUserContextData()),this.client.request("ForgotPassword",s,function(f,u){return f?e.onFailure(f):typeof e.inputVerificationCode=="function"?e.inputVerificationCode(u):e.onSuccess(u)})},t.confirmPassword=function(e,a,s,f){var u={ClientId:this.pool.getClientId(),Username:this.username,ConfirmationCode:e,Password:a,ClientMetadata:f};this.getUserContextData()&&(u.UserContextData=this.getUserContextData()),this.client.request("ConfirmForgotPassword",u,function(l){return l?s.onFailure(l):s.onSuccess("SUCCESS")})},t.getAttributeVerificationCode=function(e,a,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return a.onFailure(new Error("User is not authenticated"));this.client.request("GetUserAttributeVerificationCode",{AttributeName:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:s},function(f,u){return f?a.onFailure(f):typeof a.inputVerificationCode=="function"?a.inputVerificationCode(u):a.onSuccess("SUCCESS")})},t.verifyAttribute=function(e,a,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return s.onFailure(new Error("User is not authenticated"));this.client.request("VerifyUserAttribute",{AttributeName:e,Code:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(f){return f?s.onFailure(f):s.onSuccess("SUCCESS")})},t.getDevice=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("GetDevice",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey},function(a,s){return a?e.onFailure(a):e.onSuccess(s)})},t.forgetSpecificDevice=function(e,a){if(this.signInUserSession==null||!this.signInUserSession.isValid())return a.onFailure(new Error("User is not authenticated"));this.client.request("ForgetDevice",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:e},function(s){return s?a.onFailure(s):a.onSuccess("SUCCESS")})},t.forgetDevice=function(e){var a=this;this.forgetSpecificDevice(this.deviceKey,{onFailure:e.onFailure,onSuccess:function(f){return a.deviceKey=null,a.deviceGroupKey=null,a.randomPassword=null,a.clearCachedDeviceKeyAndPassword(),e.onSuccess(f)}})},t.setDeviceStatusRemembered=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("UpdateDeviceStatus",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey,DeviceRememberedStatus:"remembered"},function(a){return a?e.onFailure(a):e.onSuccess("SUCCESS")})},t.setDeviceStatusNotRemembered=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("UpdateDeviceStatus",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey,DeviceRememberedStatus:"not_remembered"},function(a){return a?e.onFailure(a):e.onSuccess("SUCCESS")})},t.listDevices=function(e,a,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return s.onFailure(new Error("User is not authenticated"));var f={AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),Limit:e};a&&(f.PaginationToken=a),this.client.request("ListDevices",f,function(u,l){return u?s.onFailure(u):s.onSuccess(l)})},t.globalSignOut=function(e){var a=this;if(this.signInUserSession==null||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("GlobalSignOut",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(s){return s?e.onFailure(s):(a.clearCachedUser(),e.onSuccess("SUCCESS"))})},t.signOut=function(e){var a=this;if(!e||typeof e!="function"){this.cleanClientData();return}this.getSession(function(s,f){if(s)return e(s);a.revokeTokens(function(u){a.cleanClientData(),e(u)})})},t.revokeTokens=function(e){if(e===void 0&&(e=function(){}),typeof e!="function")throw new Error("Invalid revokeTokenCallback. It should be a function.");if(!this.signInUserSession){var a=new Error("User is not authenticated");return e(a)}if(!this.signInUserSession.getAccessToken()){var s=new Error("No Access token available");return e(s)}var f=this.signInUserSession.getRefreshToken().getToken(),u=this.signInUserSession.getAccessToken();if(this.isSessionRevocable(u)&&f)return this.revokeToken({token:f,callback:e});e()},t.isSessionRevocable=function(e){if(e&&typeof e.decodePayload=="function")try{var a=e.decodePayload(),s=a.origin_jti;return!!s}catch{}return!1},t.cleanClientData=function(){this.signInUserSession=null,this.clearCachedUser()},t.revokeToken=function(e){var a=e.token,s=e.callback;this.client.requestWithRetry("RevokeToken",{Token:a,ClientId:this.pool.getClientId()},function(f){if(f)return s(f);s()})},t.sendMFASelectionAnswer=function(e,a){var s=this,f={};f.USERNAME=this.username,f.ANSWER=e;var u={ChallengeName:"SELECT_MFA_TYPE",ChallengeResponses:f,ClientId:this.pool.getClientId(),Session:this.Session};this.getUserContextData()&&(u.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",u,function(l,g){if(l)return a.onFailure(l);if(s.Session=g.Session,e==="SMS_MFA")return a.mfaRequired(g.ChallengeName,g.ChallengeParameters);if(e==="SOFTWARE_TOKEN_MFA")return a.totpRequired(g.ChallengeName,g.ChallengeParameters)})},t.getUserContextData=function(){var e=this.pool;return e.getUserContextData(this.username)},t.associateSoftwareToken=function(e){var a=this;this.signInUserSession!=null&&this.signInUserSession.isValid()?this.client.request("AssociateSoftwareToken",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(s,f){return s?e.onFailure(s):e.associateSecretCode(f.SecretCode)}):this.client.request("AssociateSoftwareToken",{Session:this.Session},function(s,f){return s?e.onFailure(s):(a.Session=f.Session,e.associateSecretCode(f.SecretCode))})},t.verifySoftwareToken=function(e,a,s){var f=this;this.signInUserSession!=null&&this.signInUserSession.isValid()?this.client.request("VerifySoftwareToken",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),UserCode:e,FriendlyDeviceName:a},function(u,l){return u?s.onFailure(u):s.onSuccess(l)}):this.client.request("VerifySoftwareToken",{Session:this.Session,UserCode:e,FriendlyDeviceName:a},function(u,l){if(u)return s.onFailure(u);f.Session=l.Session;var g={};g.USERNAME=f.username;var d={ChallengeName:"MFA_SETUP",ClientId:f.pool.getClientId(),ChallengeResponses:g,Session:f.Session};f.getUserContextData()&&(d.UserContextData=f.getUserContextData()),f.client.request("RespondToAuthChallenge",d,function(y,S){return y?s.onFailure(y):(f.signInUserSession=f.getCognitoUserSession(S.AuthenticationResult),f.cacheTokens(),s.onSuccess(f.signInUserSession))})})},o})();function Un(o,t){return t=t||{},new Promise(function(r,e){var a=new XMLHttpRequest,s=[],f=[],u={},l=function(){return{ok:(a.status/100|0)==2,statusText:a.statusText,status:a.status,url:a.responseURL,text:function(){return Promise.resolve(a.responseText)},json:function(){return Promise.resolve(a.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([a.response]))},clone:l,headers:{keys:function(){return s},entries:function(){return f},get:function(d){return u[d.toLowerCase()]},has:function(d){return d.toLowerCase()in u}}}};for(var g in a.open(t.method||"get",o,!0),a.onload=function(){a.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(d,y,S){s.push(y=y.toLowerCase()),f.push([y,S]),u[y]=u[y]?u[y]+","+S:S}),r(l())},a.onerror=e,a.withCredentials=t.credentials=="include",t.headers)a.setRequestHeader(g,t.headers[g]);a.send(t.body||null)})}const En=Object.freeze(Object.defineProperty({__proto__:null,default:Un},Symbol.toStringTag,{value:"Module"})),pt=Oe(En);var xe,dt;function Tn(){return dt||(dt=1,xe=self.fetch||(self.fetch=pt.default||pt)),xe}Tn();function K(){}K.prototype.userAgent=mn();var qn=function(t){t&&(K.prototype.userAgent&&!K.prototype.userAgent.includes(t)&&(K.prototype.userAgent=K.prototype.userAgent.concat(" ",t)),(!K.prototype.userAgent||K.prototype.userAgent==="")&&(K.prototype.userAgent=t))},Dn=function(t){var r=K.category?" "+K.category:"",e=K.framework?" framework/"+K.framework:"",a=""+K.prototype.userAgent+r+e;return a};function xn(o,t){o.prototype=Object.create(t.prototype),o.prototype.constructor=o,ge(o,t)}function be(o){var t=typeof Map=="function"?new Map:void 0;return be=function(e){if(e===null||!_n(e))return e;if(typeof e!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(e))return t.get(e);t.set(e,a)}function a(){return In(e,arguments,Me(this).constructor)}return a.prototype=Object.create(e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),ge(a,e)},be(o)}function In(o,t,r){if(Ut())return Reflect.construct.apply(null,arguments);var e=[null];e.push.apply(e,t);var a=new(o.bind.apply(o,e));return r&&ge(a,r.prototype),a}function Ut(){try{var o=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ut=function(){return!!o})()}function _n(o){try{return Function.toString.call(o).indexOf("[native code]")!==-1}catch{return typeof o=="function"}}function ge(o,t){return ge=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},ge(o,t)}function Me(o){return Me=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Me(o)}var Rn=(function(o){function t(r,e,a,s){var f;return f=o.call(this,r)||this,f.code=e,f.name=a,f.statusCode=s,f}return xn(t,o),t})(be(Error)),Pn=(function(){function o(r,e,a){this.endpoint=e||"https://cognito-idp."+r+".amazonaws.com/";var s=a||{},f=s.credentials;this.fetchOptions=f?{credentials:f}:{}}var t=o.prototype;return t.promisifyRequest=function(e,a){var s=this;return new Promise(function(f,u){s.request(e,a,function(l,g){l?u(new Rn(l.message,l.code,l.name,l.statusCode)):f(g)})})},t.requestWithRetry=function(e,a,s){var f=this,u=5*1e3;bn(function(l){return new Promise(function(g,d){f.request(e,l,function(y,S){y?d(y):g(S)})})},[a],u).then(function(l){return s(null,l)}).catch(function(l){return s(l)})},t.request=function(e,a,s){var f={"Content-Type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityProviderService."+e,"X-Amz-User-Agent":Dn(),"Cache-Control":"no-store"},u=Object.assign({},this.fetchOptions,{headers:f,method:"POST",mode:"cors",body:JSON.stringify(a)}),l;fetch(this.endpoint,u).then(function(g){return l=g,g},function(g){throw g instanceof TypeError?new Error("Network error"):g}).then(function(g){return g.json().catch(function(){return{}})}).then(function(g){if(l.ok)return s(null,g);var d=(g.__type||g.code).split("#").pop(),y=new Error(g.message||g.Message||null);return y.name=d,y.code=d,s(y)}).catch(function(g){if(l&&l.headers&&l.headers.get("x-amzn-errortype"))try{var d=l.headers.get("x-amzn-errortype").split(":")[0],y=new Error(l.status?l.status.toString():null);return y.code=d,y.name=d,y.statusCode=l.status,s(y)}catch{return s(g)}else g instanceof Error&&g.message==="Network error"&&(g.code="NetworkError");return s(g)})},o})(),Se={debug:function(){}},Fn=function(t){var r="nonRetryable";return t&&t[r]};function Et(o,t,r,e){if(e===void 0&&(e=1),typeof o!="function")throw Error("functionToRetry must be a function");return Se.debug(o.name+" attempt #"+e+" with args: "+JSON.stringify(t)),o.apply(void 0,t).catch(function(a){if(Se.debug("error on "+o.name,a),Fn(a))throw Se.debug(o.name+" non retryable error",a),a;var s=r(e,t,a);if(Se.debug(o.name+" retrying in "+s+" ms"),s!==!1)return new Promise(function(f){return setTimeout(f,s)}).then(function(){return Et(o,t,r,e+1)});throw a})}function Bn(o){var t=100,r=100;return function(e){var a=Math.pow(2,e)*t+r*Math.random();return a>o?!1:a}}function bn(o,t,r){return Et(o,t,Bn(r))}/*!
|
|
50
50
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
51
51
|
* SPDX-License-Identifier: Apache-2.0
|
|
52
|
-
*/var
|
|
52
|
+
*/var Mn=55,Vn=(function(){function o(r,e){var a=r||{},s=a.UserPoolId,f=a.ClientId,u=a.endpoint,l=a.fetchOptions,g=a.AdvancedSecurityDataCollectionFlag;if(!s||!f)throw new Error("Both UserPoolId and ClientId are required.");if(s.length>Mn||!/^[\w-]+_[0-9a-zA-Z]+$/.test(s))throw new Error("Invalid UserPoolId format.");var d=s.split("_")[0];this.userPoolId=s,this.clientId=f,this.client=new Pn(d,u,l),this.advancedSecurityDataCollectionFlag=g!==!1,this.storage=r.Storage||new At().getStorage(),e&&(this.wrapRefreshSessionCallback=e)}var t=o.prototype;return t.getUserPoolId=function(){return this.userPoolId},t.getUserPoolName=function(){return this.getUserPoolId().split("_")[1]},t.getClientId=function(){return this.clientId},t.signUp=function(e,a,s,f,u,l){var g=this,d={ClientId:this.clientId,Username:e,Password:a,UserAttributes:s,ValidationData:f,ClientMetadata:l};this.getUserContextData(e)&&(d.UserContextData=this.getUserContextData(e)),this.client.request("SignUp",d,function(y,S){if(y)return u(y,null);var U={Username:e,Pool:g,Storage:g.storage},A={user:new gt(U),userConfirmed:S.UserConfirmed,userSub:S.UserSub,codeDeliveryDetails:S.CodeDeliveryDetails};return u(null,A)})},t.getCurrentUser=function(){var e="CognitoIdentityServiceProvider."+this.clientId+".LastAuthUser",a=this.storage.getItem(e);if(a){var s={Username:a,Pool:this,Storage:this.storage};return new gt(s)}return null},t.getUserContextData=function(e){if(!(typeof AmazonCognitoAdvancedSecurityData>"u")){var a=AmazonCognitoAdvancedSecurityData;if(this.advancedSecurityDataCollectionFlag){var s=a.getData(e,this.userPoolId,this.clientId);if(s){var f={EncodedData:s};return f}}return{}}},o})(),Ie={exports:{}};/*!
|
|
53
53
|
* JavaScript Cookie v2.2.1
|
|
54
54
|
* https://github.com/js-cookie/js-cookie
|
|
55
55
|
*
|
|
56
56
|
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
|
|
57
57
|
* Released under the MIT license
|
|
58
|
-
*/var vt;function
|
|
58
|
+
*/var vt;function On(){return vt||(vt=1,(function(o,t){(function(r){var e;if(o.exports=r(),e=!0,!e){var a=window.Cookies,s=window.Cookies=r();s.noConflict=function(){return window.Cookies=a,s}}})(function(){function r(){for(var s=0,f={};s<arguments.length;s++){var u=arguments[s];for(var l in u)f[l]=u[l]}return f}function e(s){return s.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function a(s){function f(){}function u(g,d,y){if(!(typeof document>"u")){y=r({path:"/"},f.defaults,y),typeof y.expires=="number"&&(y.expires=new Date(new Date*1+y.expires*864e5)),y.expires=y.expires?y.expires.toUTCString():"";try{var S=JSON.stringify(d);/^[\{\[]/.test(S)&&(d=S)}catch{}d=s.write?s.write(d,g):encodeURIComponent(String(d)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),g=encodeURIComponent(String(g)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var U="";for(var A in y)y[A]&&(U+="; "+A,y[A]!==!0&&(U+="="+y[A].split(";")[0]));return document.cookie=g+"="+d+U}}function l(g,d){if(!(typeof document>"u")){for(var y={},S=document.cookie?document.cookie.split("; "):[],U=0;U<S.length;U++){var A=S[U].split("="),C=A.slice(1).join("=");!d&&C.charAt(0)==='"'&&(C=C.slice(1,-1));try{var D=e(A[0]);if(C=(s.read||s)(C,D)||e(C),d)try{C=JSON.parse(C)}catch{}if(y[D]=C,g===D)break}catch{}}return g?y[g]:y}}return f.set=u,f.get=function(g){return l(g,!1)},f.getJSON=function(g){return l(g,!0)},f.remove=function(g,d){u(g,"",r(d,{expires:-1}))},f.defaults={},f.withConverter=a,f}return a(function(){})})})(Ie)),Ie.exports}var he=On(),Ln=(function(){function o(r){if(r===void 0&&(r={}),r.domain&&(this.domain=r.domain),r.path?this.path=r.path:this.path="/",Object.prototype.hasOwnProperty.call(r,"expires")?this.expires=r.expires:this.expires=365,Object.prototype.hasOwnProperty.call(r,"secure")?this.secure=r.secure:this.secure=!0,Object.prototype.hasOwnProperty.call(r,"sameSite")){if(!["strict","lax","none"].includes(r.sameSite))throw new Error('The sameSite value of cookieStorage must be "lax", "strict" or "none".');if(r.sameSite==="none"&&!this.secure)throw new Error("sameSite = None requires the Secure attribute in latest browser versions.");this.sameSite=r.sameSite}else this.sameSite=null}var t=o.prototype;return t.setItem=function(e,a){var s={path:this.path,expires:this.expires,domain:this.domain,secure:this.secure};return this.sameSite&&(s.sameSite=this.sameSite),he.set(e,a,s),he.get(e)},t.getItem=function(e){return he.get(e)},t.removeItem=function(e){var a={path:this.path,expires:this.expires,domain:this.domain,secure:this.secure};return this.sameSite&&(a.sameSite=this.sameSite),he.remove(e,a)},t.clear=function(){for(var e=he.get(),a=Object.keys(e).length,s=0;s<a;++s)this.removeItem(Object.keys(e)[s]);return{}},o})();export{kn as AuthenticationDetails,X as AuthenticationHelper,at as CognitoAccessToken,ut as CognitoIdToken,ft as CognitoRefreshToken,gt as CognitoUser,wn as CognitoUserAttribute,Vn as CognitoUserPool,ht as CognitoUserSession,Ln as CookieStorage,ct as DateHelper,jt as WordArray,qn as appendToCognitoUserAgent};
|