@aws-amplify/core 4.7.9 → 4.7.10
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/CHANGELOG.md +11 -0
- package/dist/aws-amplify-core.js +1 -1
- package/dist/aws-amplify-core.js.map +1 -1
- package/dist/aws-amplify-core.min.js +1 -1
- package/lib/Platform/version.js +1 -1
- package/lib/Util/BackgroundProcessManager.js.map +1 -1
- package/lib-esm/Platform/version.d.ts +1 -1
- package/lib-esm/Platform/version.js +1 -1
- package/lib-esm/Util/BackgroundProcessManager.d.ts +1 -1
- package/lib-esm/Util/BackgroundProcessManager.js.map +1 -1
- package/package.json +2 -2
- package/src/Platform/version.ts +1 -1
- package/src/Util/BackgroundProcessManager.ts +1 -1
|
@@ -28,5 +28,5 @@ var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Arr
|
|
|
28
28
|
*/
|
|
29
29
|
var r=n(39),o=n(40),i=n(41);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return c(this,e,t,n)}function c(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=d(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|p(t,n),o=(e=s(e,r)).write(t,n);o!==r&&(e=e.slice(0,o));return e}(e,t,n):function(e,t){if(u.isBuffer(t)){var n=0|h(t.length);return 0===(e=s(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?s(e,0):d(e,t);if("Buffer"===t.type&&i(t.data))return d(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function l(e,t){if(f(t),e=s(e,t<0?0:0|h(t)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function d(e,t){var n=t.length<0?0:0|h(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function h(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return D(e).length;default:if(r)return F(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,n);case"utf8":case"utf-8":return O(this,t,n);case"ascii":return k(this,t,n);case"latin1":case"binary":return L(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,o);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,o){var i,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var f=-1;for(i=n;i<s;i++)if(c(e,i)===c(t,-1===f?0:i-f)){if(-1===f&&(f=i),i-f+1===u)return f*a}else-1!==f&&(i-=i-f),f=-1}else for(n+u>s&&(n=s-u),i=n;i>=0;i--){for(var l=!0,d=0;d<u;d++)if(c(e,i+d)!==c(t,d)){l=!1;break}if(l)return i}return-1}function b(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function w(e,t,n,r){return q(F(t,e.length-n),e,n,r)}function _(e,t,n,r){return q(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function S(e,t,n,r){return _(e,t,n,r)}function E(e,t,n,r){return q(D(t),e,n,r)}function x(e,t,n,r){return q(function(e,t){for(var n,r,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function A(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function O(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i,a,s,u,c=e[o],f=null,l=c>239?4:c>223?3:c>191?2:1;if(o+l<=n)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(i=e[o+1]))&&(u=(31&c)<<6|63&i)>127&&(f=u);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(u=(15&c)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(f=u)}null===f?(f=65533,l=1):f>65535&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|1023&f),r.push(f),o+=l}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return c(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return function(e,t,n,r){return f(t),t<=0?s(e,t):void 0!==n?"string"==typeof r?s(e,t).fill(n,r):s(e,t).fill(n):s(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return l(null,e)},u.allocUnsafeSlow=function(e){return l(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var a=e[n];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,o),o+=a.length}return r},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?O(this,0,e):g.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,n,r,o){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(i,a),c=this.slice(r,o),f=e.slice(t,n),l=0;l<s;++l)if(c[l]!==f[l]){i=c[l],a=f[l];break}return i<a?-1:a<i?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return m(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return m(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return _(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return E(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function k(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function L(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function I(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=t;i<n;++i)o+=U(e[i]);return o}function P(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function C(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function T(e,t,n,r,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function j(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o<i;++o)e[n+o]=(t&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function R(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o<i;++o)e[n+o]=t>>>8*(r?o:3-o)&255}function M(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(e,t,n,r,i){return i||M(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function z(e,t,n,r,i){return i||M(e,0,n,8),o.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=u.prototype;else{var o=t-e;n=new u(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+e]}return n},u.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||C(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},u.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||C(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},u.prototype.readUInt8=function(e,t){return t||C(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||C(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||C(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||C(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||C(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||C(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||C(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||C(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||C(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||C(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||C(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||T(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||T(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):j(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):j(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):R(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);T(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i<n&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);T(this,e,t,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):j(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):j(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):R(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return N(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return N(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return z(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return z(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o,i=r-n;if(this===e&&n<t&&t<r)for(o=i-1;o>=0;--o)e[o+t]=this[o+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),t);return i},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{var a=u.isBuffer(e)?e:F(new u(e,r).toString()),s=a.length;for(i=0;i<n-t;++i)this[i+t]=a[i%s]}return this};var B=/[^+\/0-9A-Za-z-_]/g;function U(e){return e<16?"0"+e.toString(16):e.toString(16)}function F(e,t){var n;t=t||1/0;for(var r=e.length,o=null,i=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function D(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(9))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_HASHABLE_LENGTH=t.INIT=t.KEY=t.DIGEST_LENGTH=t.BLOCK_SIZE=void 0,t.BLOCK_SIZE=64,t.DIGEST_LENGTH=32,t.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]),t.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],t.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1},function(e,t,n){"use strict";n.r(t),n.d(t,"fromUtf8",(function(){return r})),n.d(t,"toUtf8",(function(){return o}));const r=e=>"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):(e=>{const t=[];for(let n=0,r=e.length;n<r;n++){const r=e.charCodeAt(n);if(r<128)t.push(r);else if(r<2048)t.push(r>>6|192,63&r|128);else if(n+1<e.length&&55296==(64512&r)&&56320==(64512&e.charCodeAt(n+1))){const o=65536+((1023&r)<<10)+(1023&e.charCodeAt(++n));t.push(o>>18|240,o>>12&63|128,o>>6&63|128,63&o|128)}else t.push(r>>12|224,r>>6&63|128,63&r|128)}return Uint8Array.from(t)})(e),o=e=>"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):(e=>{let t="";for(let n=0,r=e.length;n<r;n++){const r=e[n];if(r<128)t+=String.fromCharCode(r);else if(192<=r&&r<224){const o=e[++n];t+=String.fromCharCode((31&r)<<6|63&o)}else if(240<=r&&r<365){const o="%"+[r,e[++n],e[++n],e[++n]].map(e=>e.toString(16)).join("%");t+=decodeURIComponent(o)}else t+=String.fromCharCode((15&r)<<12|(63&e[++n])<<6|63&e[++n])}return t})(e)},function(e,t,n){var r=n(33),o=n(34),i=o;i.v1=r,i.v4=o,e.exports=i},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=90)}({17:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=n(18),o=function(){function e(){}return e.getFirstMatch=function(e,t){var n=t.match(e);return n&&n.length>0&&n[1]||""},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||""},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,n,r){void 0===r&&(r=!1);var o=e.getVersionPrecision(t),i=e.getVersionPrecision(n),a=Math.max(o,i),s=0,u=e.map([t,n],(function(t){var n=a-e.getVersionPrecision(t),r=t+new Array(n+1).join(".0");return e.map(r.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(r&&(s=a-Math.min(o,i)),a-=1;a>=s;){if(u[0][a]>u[1][a])return 1;if(u[0][a]===u[1][a]){if(a===s)return 0;a-=1}else if(u[0][a]<u[1][a])return-1}},e.map=function(e,t){var n,r=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)r.push(t(e[n]));return r},e.find=function(e,t){var n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){var o=e[n];if(t(o,n))return o}},e.assign=function(e){for(var t,n,r=e,o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];if(Object.assign)return Object.assign.apply(Object,[e].concat(i));var s=function(){var e=i[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach((function(t){r[t]=e[t]}))};for(t=0,n=i.length;t<n;t+=1)s();return e},e.getBrowserAlias=function(e){return r.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return r.BROWSER_MAP[e]||""},e}();t.default=o,e.exports=t.default},18:function(e,t,n){"use strict";t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,o=(r=n(91))&&r.__esModule?r:{default:r},i=n(18);function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var s=function(){function e(){}var t,n;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("UserAgent should be a string");return new o.default(e,t)},e.parse=function(e){return new o.default(e).getResult()},t=e,(n=[{key:"BROWSER_MAP",get:function(){return i.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return i.ENGINE_MAP}},{key:"OS_MAP",get:function(){return i.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return i.PLATFORMS_MAP}}])&&a(t,n),e}();t.default=s,e.exports=t.default},91:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=u(n(92)),o=u(n(93)),i=u(n(94)),a=u(n(95)),s=u(n(17));function u(e){return e&&e.__esModule?e:{default:e}}var c=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=s.default.find(r.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=s.default.find(o.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=s.default.find(i.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=s.default.find(a.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return s.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,n={},r=0,o={},i=0;if(Object.keys(e).forEach((function(t){var a=e[t];"string"==typeof a?(o[t]=a,i+=1):"object"==typeof a&&(n[t]=a,r+=1)})),r>0){var a=Object.keys(n),u=s.default.find(a,(function(e){return t.isOS(e)}));if(u){var c=this.satisfies(n[u]);if(void 0!==c)return c}var f=s.default.find(a,(function(e){return t.isPlatform(e)}));if(f){var l=this.satisfies(n[f]);if(void 0!==l)return l}}if(i>0){var d=Object.keys(o),h=s.default.find(d,(function(e){return t.isBrowser(e,!0)}));if(void 0!==h)return this.compareVersion(o[h])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var n=this.getBrowserName().toLowerCase(),r=e.toLowerCase(),o=s.default.getBrowserTypeByAlias(r);return t&&o&&(r=o.toLowerCase()),r===n},t.compareVersion=function(e){var t=[0],n=e,r=!1,o=this.getBrowserVersion();if("string"==typeof o)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(s.default.compareVersions(o,n,r))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=c,e.exports=t.default},92:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,o=(r=n(17))&&r.__esModule?r:{default:r},i=/version\/(\d+(\.?_?\d+)+)/i,a=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},n=o.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},n=o.default.getFirstMatch(i,e)||o.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},n=o.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},n=o.default.getFirstMatch(i,e)||o.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},n=o.default.getFirstMatch(i,e)||o.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},n=o.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},n=o.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},n=o.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},n=o.default.getFirstMatch(i,e)||o.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},n=o.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},n=o.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},n=o.default.getFirstMatch(i,e)||o.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},n=o.default.getFirstMatch(i,e)||o.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},n=o.default.getFirstMatch(i,e)||o.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},n=o.default.getFirstMatch(i,e)||o.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},n=o.default.getFirstMatch(i,e)||o.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},n=o.default.getFirstMatch(i,e)||o.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},n=o.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=o.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},n=o.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},n=o.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},n=o.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},n=o.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},n=o.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},n=o.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},n=o.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},n=o.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},n=o.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},n=o.default.getFirstMatch(i,e)||o.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},n=o.default.getFirstMatch(i,e)||o.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},n=o.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},n=o.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},n=o.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},n=o.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},n=o.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},n=o.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},n=o.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},n=o.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},n=o.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:"Android Browser"},n=o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},n=o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},n=o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:o.default.getFirstMatch(t,e),version:o.default.getSecondMatch(t,e)}}}];t.default=a,e.exports=t.default},93:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,o=(r=n(17))&&r.__esModule?r:{default:r},i=n(18),a=[{test:[/Roku\/DVP/],describe:function(e){var t=o.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:i.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=o.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:i.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=o.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=o.default.getWindowsVersionName(t);return{name:i.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:i.OS_MAP.iOS},n=o.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe:function(e){var t=o.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=o.default.getMacOSVersionName(t),r={name:i.OS_MAP.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=o.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:i.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=o.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=o.default.getAndroidVersionName(t),r={name:i.OS_MAP.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=o.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:i.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=o.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||o.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||o.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:i.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=o.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:i.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=o.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:i.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:i.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:i.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=o.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:i.OS_MAP.PlayStation4,version:t}}}];t.default=a,e.exports=t.default},94:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,o=(r=n(17))&&r.__esModule?r:{default:r},i=n(18),a=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=o.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:i.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=o.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:i.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:i.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.tv}}}];t.default=a,e.exports=t.default},95:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,o=(r=n(17))&&r.__esModule?r:{default:r},i=n(18),a=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:i.ENGINE_MAP.Blink};var t=o.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:i.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:i.ENGINE_MAP.Trident},n=o.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:i.ENGINE_MAP.Presto},n=o.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:i.ENGINE_MAP.Gecko},n=o.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:i.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:i.ENGINE_MAP.WebKit},n=o.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];t.default=a,e.exports=t.default}})},function(e){e.exports=JSON.parse('{"name":"@aws-sdk/client-cloudwatch-logs","description":"AWS SDK for JavaScript Cloudwatch Logs Client for Node.js, Browser and React Native","version":"3.6.1","scripts":{"clean":"yarn remove-definitions && yarn remove-dist && yarn remove-documentation","build-documentation":"yarn remove-documentation && typedoc ./","prepublishOnly":"yarn build","pretest":"yarn build:cjs","remove-definitions":"rimraf ./types","remove-dist":"rimraf ./dist","remove-documentation":"rimraf ./docs","test":"exit 0","build:cjs":"tsc -p tsconfig.json","build:es":"tsc -p tsconfig.es.json","build":"yarn build:cjs && yarn build:es","postbuild":"downlevel-dts types types/ts3.4"},"main":"./dist/cjs/index.js","types":"./types/index.d.ts","module":"./dist/es/index.js","browser":{"./runtimeConfig":"./runtimeConfig.browser"},"react-native":{"./runtimeConfig":"./runtimeConfig.native"},"sideEffects":false,"dependencies":{"@aws-crypto/sha256-browser":"^1.0.0","@aws-crypto/sha256-js":"^1.0.0","@aws-sdk/config-resolver":"3.6.1","@aws-sdk/credential-provider-node":"3.6.1","@aws-sdk/fetch-http-handler":"3.6.1","@aws-sdk/hash-node":"3.6.1","@aws-sdk/invalid-dependency":"3.6.1","@aws-sdk/middleware-content-length":"3.6.1","@aws-sdk/middleware-host-header":"3.6.1","@aws-sdk/middleware-logger":"3.6.1","@aws-sdk/middleware-retry":"3.6.1","@aws-sdk/middleware-serde":"3.6.1","@aws-sdk/middleware-signing":"3.6.1","@aws-sdk/middleware-stack":"3.6.1","@aws-sdk/middleware-user-agent":"3.6.1","@aws-sdk/node-config-provider":"3.6.1","@aws-sdk/node-http-handler":"3.6.1","@aws-sdk/protocol-http":"3.6.1","@aws-sdk/smithy-client":"3.6.1","@aws-sdk/types":"3.6.1","@aws-sdk/url-parser":"3.6.1","@aws-sdk/url-parser-native":"3.6.1","@aws-sdk/util-base64-browser":"3.6.1","@aws-sdk/util-base64-node":"3.6.1","@aws-sdk/util-body-length-browser":"3.6.1","@aws-sdk/util-body-length-node":"3.6.1","@aws-sdk/util-user-agent-browser":"3.6.1","@aws-sdk/util-user-agent-node":"3.6.1","@aws-sdk/util-utf8-browser":"3.6.1","@aws-sdk/util-utf8-node":"3.6.1","tslib":"^2.0.0"},"devDependencies":{"@aws-sdk/client-documentation-generator":"3.6.1","@types/node":"^12.7.5","downlevel-dts":"0.7.0","jest":"^26.1.0","rimraf":"^3.0.0","typedoc":"^0.19.2","typescript":"~4.1.2"},"engines":{"node":">=10.0.0"},"typesVersions":{"<4.0":{"types/*":["types/ts3.4/*"]}},"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cloudwatch-logs","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-cloudwatch-logs"}}')},function(e){e.exports=JSON.parse('{"name":"@aws-sdk/client-cognito-identity","description":"AWS SDK for JavaScript Cognito Identity Client for Node.js, Browser and React Native","version":"3.6.1","scripts":{"clean":"yarn remove-definitions && yarn remove-dist && yarn remove-documentation","build-documentation":"yarn remove-documentation && typedoc ./","prepublishOnly":"yarn build","pretest":"yarn build:cjs","remove-definitions":"rimraf ./types","remove-dist":"rimraf ./dist","remove-documentation":"rimraf ./docs","test:unit":"mocha **/cjs/**/*.spec.js","test:e2e":"mocha **/cjs/**/*.ispec.js && karma start karma.conf.js","test":"yarn test:unit","build:cjs":"tsc -p tsconfig.json","build:es":"tsc -p tsconfig.es.json","build":"yarn build:cjs && yarn build:es","postbuild":"downlevel-dts types types/ts3.4"},"main":"./dist/cjs/index.js","types":"./types/index.d.ts","module":"./dist/es/index.js","browser":{"./runtimeConfig":"./runtimeConfig.browser"},"react-native":{"./runtimeConfig":"./runtimeConfig.native"},"sideEffects":false,"dependencies":{"@aws-crypto/sha256-browser":"^1.0.0","@aws-crypto/sha256-js":"^1.0.0","@aws-sdk/config-resolver":"3.6.1","@aws-sdk/credential-provider-node":"3.6.1","@aws-sdk/fetch-http-handler":"3.6.1","@aws-sdk/hash-node":"3.6.1","@aws-sdk/invalid-dependency":"3.6.1","@aws-sdk/middleware-content-length":"3.6.1","@aws-sdk/middleware-host-header":"3.6.1","@aws-sdk/middleware-logger":"3.6.1","@aws-sdk/middleware-retry":"3.6.1","@aws-sdk/middleware-serde":"3.6.1","@aws-sdk/middleware-signing":"3.6.1","@aws-sdk/middleware-stack":"3.6.1","@aws-sdk/middleware-user-agent":"3.6.1","@aws-sdk/node-config-provider":"3.6.1","@aws-sdk/node-http-handler":"3.6.1","@aws-sdk/protocol-http":"3.6.1","@aws-sdk/smithy-client":"3.6.1","@aws-sdk/types":"3.6.1","@aws-sdk/url-parser":"3.6.1","@aws-sdk/url-parser-native":"3.6.1","@aws-sdk/util-base64-browser":"3.6.1","@aws-sdk/util-base64-node":"3.6.1","@aws-sdk/util-body-length-browser":"3.6.1","@aws-sdk/util-body-length-node":"3.6.1","@aws-sdk/util-user-agent-browser":"3.6.1","@aws-sdk/util-user-agent-node":"3.6.1","@aws-sdk/util-utf8-browser":"3.6.1","@aws-sdk/util-utf8-node":"3.6.1","tslib":"^2.0.0"},"devDependencies":{"@aws-sdk/client-documentation-generator":"3.6.1","@aws-sdk/client-iam":"3.6.1","@types/chai":"^4.2.11","@types/mocha":"^8.0.4","@types/node":"^12.7.5","downlevel-dts":"0.7.0","jest":"^26.1.0","rimraf":"^3.0.0","typedoc":"^0.19.2","typescript":"~4.1.2"},"engines":{"node":">=10.0.0"},"typesVersions":{"<4.0":{"types/*":["types/ts3.4/*"]}},"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cognito-identity","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-cognito-identity"}}')},function(e,t,n){e.exports=n(61).Observable},,function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,c=[],f=!1,l=-1;function d(){f&&u&&(f=!1,u.length?c=u.concat(c):l=-1,c.length&&h())}function h(){if(!f){var e=s(d);f=!0;for(var t=c.length;t;){for(u=c,c=[];++l<t;)u&&u[l].run();l=-1,t=c.length}u=null,f=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function g(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new p(e,t)),1!==c.length||f||s(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(8),i=n(26),a=n(63),s=function(){function e(e){if(this.hash=new i.RawSha256,e){this.outer=new i.RawSha256;var t=function(e){var t=u(e);if(t.byteLength>o.BLOCK_SIZE){var n=new i.RawSha256;n.update(t),t=n.digest()}var r=new Uint8Array(o.BLOCK_SIZE);return r.set(t),r}(e),n=new Uint8Array(o.BLOCK_SIZE);n.set(t);for(var r=0;r<o.BLOCK_SIZE;r++)t[r]^=54,n[r]^=92;this.hash.update(t),this.outer.update(n);for(r=0;r<t.byteLength;r++)t[r]=0}}return e.prototype.update=function(e){if(!function(e){if("string"==typeof e)return 0===e.length;return 0===e.byteLength}(e)&&!this.error)try{this.hash.update(u(e))}catch(e){this.error=e}},e.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()},e.prototype.digest=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.digestSync()]}))}))},e}();function u(e){return"string"==typeof e?a.fromUtf8(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}t.Sha256=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8),o=function(){function e(){this.state=Int32Array.from(r.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,n=e.byteLength;if(this.bytesHashed+=n,8*this.bytesHashed>r.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===r.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(t.setUint8(this.bufferLength++,128),n%r.BLOCK_SIZE>=r.BLOCK_SIZE-8){for(var o=this.bufferLength;o<r.BLOCK_SIZE;o++)t.setUint8(o,0);this.hashBuffer(),this.bufferLength=0}for(o=this.bufferLength;o<r.BLOCK_SIZE-8;o++)t.setUint8(o,0);t.setUint32(r.BLOCK_SIZE-8,Math.floor(e/4294967296),!0),t.setUint32(r.BLOCK_SIZE-4,e),this.hashBuffer(),this.finished=!0}var i=new Uint8Array(r.DIGEST_LENGTH);for(o=0;o<8;o++)i[4*o]=this.state[o]>>>24&255,i[4*o+1]=this.state[o]>>>16&255,i[4*o+2]=this.state[o]>>>8&255,i[4*o+3]=this.state[o]>>>0&255;return i},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,n=t[0],o=t[1],i=t[2],a=t[3],s=t[4],u=t[5],c=t[6],f=t[7],l=0;l<r.BLOCK_SIZE;l++){if(l<16)this.temp[l]=(255&e[4*l])<<24|(255&e[4*l+1])<<16|(255&e[4*l+2])<<8|255&e[4*l+3];else{var d=this.temp[l-2],h=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,p=((d=this.temp[l-15])>>>7|d<<25)^(d>>>18|d<<14)^d>>>3;this.temp[l]=(h+this.temp[l-7]|0)+(p+this.temp[l-16]|0)}var g=(((s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+(s&u^~s&c)|0)+(f+(r.KEY[l]+this.temp[l]|0)|0)|0,v=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&o^n&i^o&i)|0;f=c,c=u,u=s,s=a+g|0,a=i,i=o,o=n,n=g+v|0}t[0]+=n,t[1]+=o,t[2]+=i,t[3]+=a,t[4]+=s,t[5]+=u,t[6]+=c,t[7]+=f},e}();t.RawSha256=o},function(e,t,n){(function(e,r){var o;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(i){t&&t.nodeType,e&&e.nodeType;var a="object"==typeof r&&r;a.global!==a&&a.window!==a&&a.self;var s,u=2147483647,c=/^xn--/,f=/[^\x20-\x7E]/,l=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=Math.floor,p=String.fromCharCode;function g(e){throw new RangeError(d[e])}function v(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function m(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+v((e=e.replace(l,".")).split("."),t).join(".")}function y(e){for(var t,n,r=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(n=e.charCodeAt(o++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--):r.push(t);return r}function b(e){return v(e,(function(e){var t="";return e>65535&&(t+=p((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=p(e)})).join("")}function w(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function _(e,t,n){var r=0;for(e=n?h(e/700):e>>1,e+=h(e/t);e>455;r+=36)e=h(e/35);return h(r+36*e/(e+38))}function S(e){var t,n,r,o,i,a,s,c,f,l,d,p=[],v=e.length,m=0,y=128,w=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&g("not-basic"),p.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<v;){for(i=m,a=1,s=36;o>=v&&g("invalid-input"),((c=(d=e.charCodeAt(o++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:36)>=36||c>h((u-m)/a))&&g("overflow"),m+=c*a,!(c<(f=s<=w?1:s>=w+26?26:s-w));s+=36)a>h(u/(l=36-f))&&g("overflow"),a*=l;w=_(m-i,t=p.length+1,0==i),h(m/t)>u-y&&g("overflow"),y+=h(m/t),m%=t,p.splice(m++,0,y)}return b(p)}function E(e){var t,n,r,o,i,a,s,c,f,l,d,v,m,b,S,E=[];for(v=(e=y(e)).length,t=128,n=0,i=72,a=0;a<v;++a)(d=e[a])<128&&E.push(p(d));for(r=o=E.length,o&&E.push("-");r<v;){for(s=u,a=0;a<v;++a)(d=e[a])>=t&&d<s&&(s=d);for(s-t>h((u-n)/(m=r+1))&&g("overflow"),n+=(s-t)*m,t=s,a=0;a<v;++a)if((d=e[a])<t&&++n>u&&g("overflow"),d==t){for(c=n,f=36;!(c<(l=f<=i?1:f>=i+26?26:f-i));f+=36)S=c-l,b=36-l,E.push(p(w(l+S%b,0))),c=h(S/b);E.push(p(w(c,0))),i=_(n,m,r==o),n=0,++r}++n,++t}return E.join("")}s={version:"1.4.1",ucs2:{decode:y,encode:b},decode:S,encode:E,toASCII:function(e){return m(e,(function(e){return f.test(e)?"xn--"+E(e):e}))},toUnicode:function(e){return m(e,(function(e){return c.test(e)?S(e.slice(4).toLowerCase()):e}))}},void 0===(o=function(){return s}.call(t,n,t,e))||(e.exports=o)}()}).call(this,n(28)(e),n(9))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,n){"use strict";t.decode=t.parse=n(31),t.encode=t.stringify=n(32)},function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,i){t=t||"&",n=n||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var u=1e3;i&&"number"==typeof i.maxKeys&&(u=i.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var f=0;f<c;++f){var l,d,h,p,g=e[f].replace(s,"%20"),v=g.indexOf(n);v>=0?(l=g.substr(0,v),d=g.substr(v+1)):(l=g,d=""),h=decodeURIComponent(l),p=decodeURIComponent(d),r(a,h)?o(a[h])?a[h].push(p):a[h]=[a[h],p]:a[h]=p}return a};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,s){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?i(a(e),(function(a){var s=encodeURIComponent(r(a))+n;return o(e[a])?i(e[a],(function(e){return s+encodeURIComponent(r(e))})).join(t):s+encodeURIComponent(r(e[a]))})).join(t):s?encodeURIComponent(r(s))+n+encodeURIComponent(r(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function i(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var a=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}},function(e,t,n){var r,o,i=n(10),a=n(11),s=0,u=0;e.exports=function(e,t,n){var c=t&&n||0,f=t||[],l=(e=e||{}).node||r,d=void 0!==e.clockseq?e.clockseq:o;if(null==l||null==d){var h=i();null==l&&(l=r=[1|h[0],h[1],h[2],h[3],h[4],h[5]]),null==d&&(d=o=16383&(h[6]<<8|h[7]))}var p=void 0!==e.msecs?e.msecs:(new Date).getTime(),g=void 0!==e.nsecs?e.nsecs:u+1,v=p-s+(g-u)/1e4;if(v<0&&void 0===e.clockseq&&(d=d+1&16383),(v<0||p>s)&&void 0===e.nsecs&&(g=0),g>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=p,u=g,o=d;var m=(1e4*(268435455&(p+=122192928e5))+g)%4294967296;f[c++]=m>>>24&255,f[c++]=m>>>16&255,f[c++]=m>>>8&255,f[c++]=255&m;var y=p/4294967296*1e4&268435455;f[c++]=y>>>8&255,f[c++]=255&y,f[c++]=y>>>24&15|16,f[c++]=y>>>16&255,f[c++]=d>>>8|128,f[c++]=255&d;for(var b=0;b<6;++b)f[c+b]=l[b];return t||a(f)}},function(e,t,n){var r=n(10),o=n(11);e.exports=function(e,t,n){var i=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||r)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t)for(var s=0;s<16;++s)t[i+s]=a[s];return t||o(a)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(12),o=n(14),i=n(45),a=n(53),s=n(55),u=n(6),c=function(){function e(e){(0,a.supportsWebCrypto)((0,u.locateWindow)())?this.hash=new o.Sha256(e):(0,s.isMsWindow)((0,u.locateWindow)())?this.hash=new r.Sha256(e):this.hash=new i.Sha256(e)}return e.prototype.update=function(e,t){this.hash.update(e,t)},e.prototype.digest=function(){return this.hash.digest()},e}();t.Sha256=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmptyData=void 0,t.isEmptyData=function(e){return"string"==typeof e?0===e.length:0===e.byteLength}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=t.numToUint8=t.isEmptyData=t.convertToBuffer=void 0;var r=n(38);Object.defineProperty(t,"convertToBuffer",{enumerable:!0,get:function(){return r.convertToBuffer}});var o=n(42);Object.defineProperty(t,"isEmptyData",{enumerable:!0,get:function(){return o.isEmptyData}});var i=n(43);Object.defineProperty(t,"numToUint8",{enumerable:!0,get:function(){return i.numToUint8}});var a=n(44);Object.defineProperty(t,"uint32ArrayFrom",{enumerable:!0,get:function(){return a.uint32ArrayFrom}})},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.convertToBuffer=void 0;var r=n(17),o=void 0!==e&&e.from?function(t){return e.from(t,"utf8")}:r.fromUtf8;t.convertToBuffer=function(e){return e instanceof Uint8Array?e:"string"==typeof e?o(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}}).call(this,n(15).Buffer)},function(e,t,n){"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=c(e),a=r[0],s=r[1],u=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),f=0,l=s>0?a-4:a;for(n=0;n<l;n+=4)t=o[e.charCodeAt(n)]<<18|o[e.charCodeAt(n+1)]<<12|o[e.charCodeAt(n+2)]<<6|o[e.charCodeAt(n+3)],u[f++]=t>>16&255,u[f++]=t>>8&255,u[f++]=255&t;2===s&&(t=o[e.charCodeAt(n)]<<2|o[e.charCodeAt(n+1)]>>4,u[f++]=255&t);1===s&&(t=o[e.charCodeAt(n)]<<10|o[e.charCodeAt(n+1)]<<4|o[e.charCodeAt(n+2)]>>2,u[f++]=t>>8&255,u[f++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,s=n-o;a<s;a+=16383)i.push(f(e,a,a+16383>s?s:a+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s<u;++s)r[s]=a[s],o[a.charCodeAt(s)]=s;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function f(e,t,n){for(var o,i,a=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){
|
|
30
30
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
31
|
-
t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,u=(1<<s)-1,c=u>>1,f=-7,l=n?o-1:0,d=n?-1:1,h=e[t+l];for(l+=d,i=h&(1<<-f)-1,h>>=-f,f+=s;f>0;i=256*i+e[t+l],l+=d,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=r;f>0;a=256*a+e[t+l],l+=d,f-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=c}return(h?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,u,c=8*i-o-1,f=(1<<c)-1,l=f>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+l>=1?d/u:d*Math.pow(2,1-l))*u>=2&&(a++,u/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(t*u-1)*Math.pow(2,o),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&s,h+=p,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[n+h]=255&a,h+=p,a/=256,c-=8);e[n+h-p]|=128*g}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmptyData=void 0,t.isEmptyData=function(e){return"string"==typeof e?0===e.length:0===e.byteLength}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.numToUint8=void 0,t.numToUint8=function(e){return new Uint8Array([(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=void 0,t.uint32ArrayFrom=function(e){if(!Array.from){for(var t=new Uint32Array(e.length);0<e.length;)t[0]=e[0];return t}return Uint32Array.from(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),(0,n(0).__exportStar)(n(46),t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(0),o=n(16),i=n(47),a=n(48),s=function(){function e(e){if(this.hash=new i.RawSha256,e){this.outer=new i.RawSha256;var t=function(e){var t=(0,a.convertToBuffer)(e);if(t.byteLength>o.BLOCK_SIZE){var n=new i.RawSha256;n.update(t),t=n.digest()}var r=new Uint8Array(o.BLOCK_SIZE);return r.set(t),r}(e),n=new Uint8Array(o.BLOCK_SIZE);n.set(t);for(var r=0;r<o.BLOCK_SIZE;r++)t[r]^=54,n[r]^=92;this.hash.update(t),this.outer.update(n);for(r=0;r<t.byteLength;r++)t[r]=0}}return e.prototype.update=function(e){if(!(0,a.isEmptyData)(e)&&!this.error)try{this.hash.update((0,a.convertToBuffer)(e))}catch(e){this.error=e}},e.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()},e.prototype.digest=function(){return(0,r.__awaiter)(this,void 0,void 0,(function(){return(0,r.__generator)(this,(function(e){return[2,this.digestSync()]}))}))},e}();t.Sha256=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RawSha256=void 0;var r=n(16),o=function(){function e(){this.state=Int32Array.from(r.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,n=e.byteLength;if(this.bytesHashed+=n,8*this.bytesHashed>r.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===r.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(t.setUint8(this.bufferLength++,128),n%r.BLOCK_SIZE>=r.BLOCK_SIZE-8){for(var o=this.bufferLength;o<r.BLOCK_SIZE;o++)t.setUint8(o,0);this.hashBuffer(),this.bufferLength=0}for(o=this.bufferLength;o<r.BLOCK_SIZE-8;o++)t.setUint8(o,0);t.setUint32(r.BLOCK_SIZE-8,Math.floor(e/4294967296),!0),t.setUint32(r.BLOCK_SIZE-4,e),this.hashBuffer(),this.finished=!0}var i=new Uint8Array(r.DIGEST_LENGTH);for(o=0;o<8;o++)i[4*o]=this.state[o]>>>24&255,i[4*o+1]=this.state[o]>>>16&255,i[4*o+2]=this.state[o]>>>8&255,i[4*o+3]=this.state[o]>>>0&255;return i},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,n=t[0],o=t[1],i=t[2],a=t[3],s=t[4],u=t[5],c=t[6],f=t[7],l=0;l<r.BLOCK_SIZE;l++){if(l<16)this.temp[l]=(255&e[4*l])<<24|(255&e[4*l+1])<<16|(255&e[4*l+2])<<8|255&e[4*l+3];else{var d=this.temp[l-2],h=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,p=((d=this.temp[l-15])>>>7|d<<25)^(d>>>18|d<<14)^d>>>3;this.temp[l]=(h+this.temp[l-7]|0)+(p+this.temp[l-16]|0)}var g=(((s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+(s&u^~s&c)|0)+(f+(r.KEY[l]+this.temp[l]|0)|0)|0,v=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&o^n&i^o&i)|0;f=c,c=u,u=s,s=a+g|0,a=i,i=o,o=n,n=g+v|0}t[0]+=n,t[1]+=o,t[2]+=i,t[3]+=a,t[4]+=s,t[5]+=u,t[6]+=c,t[7]+=f},e}();t.RawSha256=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=t.numToUint8=t.isEmptyData=t.convertToBuffer=void 0;var r=n(49);Object.defineProperty(t,"convertToBuffer",{enumerable:!0,get:function(){return r.convertToBuffer}});var o=n(50);Object.defineProperty(t,"isEmptyData",{enumerable:!0,get:function(){return o.isEmptyData}});var i=n(51);Object.defineProperty(t,"numToUint8",{enumerable:!0,get:function(){return i.numToUint8}});var a=n(52);Object.defineProperty(t,"uint32ArrayFrom",{enumerable:!0,get:function(){return a.uint32ArrayFrom}})},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.convertToBuffer=void 0;var r=n(64),o=void 0!==e&&e.from?function(t){return e.from(t,"utf8")}:r.fromUtf8;t.convertToBuffer=function(e){return e instanceof Uint8Array?e:"string"==typeof e?o(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}}).call(this,n(15).Buffer)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmptyData=void 0,t.isEmptyData=function(e){return"string"==typeof e?0===e.length:0===e.byteLength}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.numToUint8=void 0,t.numToUint8=function(e){return new Uint8Array([(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=void 0,t.uint32ArrayFrom=function(e){if(!Array.from){for(var t=new Uint32Array(e.length);0<e.length;)t[0]=e[0];return t}return Uint32Array.from(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(0).__exportStar(n(54),t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.supportsZeroByteGCM=t.supportsSubtleCrypto=t.supportsSecureRandom=t.supportsWebCrypto=void 0;var r=n(0),o=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function i(e){return"object"==typeof e&&"object"==typeof e.crypto&&"function"==typeof e.crypto.getRandomValues}function a(e){return e&&o.every((function(t){return"function"==typeof e[t]}))}t.supportsWebCrypto=function(e){return!(!i(e)||"object"!=typeof e.crypto.subtle)&&a(e.crypto.subtle)},t.supportsSecureRandom=i,t.supportsSubtleCrypto=a,t.supportsZeroByteGCM=function(e){return r.__awaiter(this,void 0,void 0,(function(){var t;return r.__generator(this,(function(n){switch(n.label){case 0:if(!a(e))return[2,!1];n.label=1;case 1:return n.trys.push([1,4,,5]),[4,e.generateKey({name:"AES-GCM",length:128},!1,["encrypt"])];case 2:return t=n.sent(),[4,e.encrypt({name:"AES-GCM",iv:new Uint8Array(Array(12)),additionalData:new Uint8Array(Array(16)),tagLength:128},t,new Uint8Array(0))];case 3:return[2,16===n.sent().byteLength];case 4:return n.sent(),[2,!1];case 5:return[2]}}))}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);r.__exportStar(n(56),t),r.__exportStar(n(57),t),r.__exportStar(n(58),t),r.__exportStar(n(59),t),r.__exportStar(n(60),t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMsWindow=void 0;var r=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];t.isMsWindow=function(e){if(function(e){return"MSInputMethodContext"in e&&"msCrypto"in e}(e)&&void 0!==e.msCrypto.subtle){var t=e.msCrypto,n=t.getRandomValues,o=t.subtle;return r.map((function(e){return o[e]})).concat(n).every((function(e){return"function"==typeof e}))}return!1}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}Object.defineProperty(t,"__esModule",{value:!0}),t.Observable=void 0;var a=function(){return"function"==typeof Symbol},s=function(e){return a()&&Boolean(Symbol[e])},u=function(e){return s(e)?Symbol[e]:"@@"+e};a()&&!s("observable")&&(Symbol.observable=Symbol("observable"));var c=u("iterator"),f=u("observable"),l=u("species");function d(e,t){var n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function h(e){var t=e.constructor;return void 0!==t&&null===(t=t[l])&&(t=void 0),void 0!==t?t:E}function p(e){return e instanceof E}function g(e){g.log?g.log(e):setTimeout((function(){throw e}))}function v(e){Promise.resolve().then((function(){try{e()}catch(e){g(e)}}))}function m(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var n=d(t,"unsubscribe");n&&n.call(t)}}catch(e){g(e)}}function y(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function b(e,t,n){e._state="running";var r=e._observer;try{var o=d(r,t);switch(t){case"next":o&&o.call(r,n);break;case"error":if(y(e),!o)throw n;o.call(r,n);break;case"complete":y(e),o&&o.call(r)}}catch(e){g(e)}"closed"===e._state?m(e):"running"===e._state&&(e._state="ready")}function w(e,t,n){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:n}],void v((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var n=0;n<t.length&&(b(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e)}))):void b(e,t,n);e._queue.push({type:t,value:n})}}var _=function(){function e(t,n){r(this,e),this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";var o=new S(this);try{this._cleanup=n.call(void 0,o)}catch(e){o.error(e)}"initializing"===this._state&&(this._state="ready")}return i(e,[{key:"unsubscribe",value:function(){"closed"!==this._state&&(y(this),m(this))}},{key:"closed",get:function(){return"closed"===this._state}}]),e}(),S=function(){function e(t){r(this,e),this._subscription=t}return i(e,[{key:"next",value:function(e){w(this._subscription,"next",e)}},{key:"error",value:function(e){w(this._subscription,"error",e)}},{key:"complete",value:function(){w(this._subscription,"complete")}},{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),E=function(){function e(t){if(r(this,e),!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}return i(e,[{key:"subscribe",value:function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new _(e,this._subscriber)}},{key:"forEach",value:function(e){var t=this;return new Promise((function(n,r){if("function"==typeof e)var o=t.subscribe({next:function(t){try{e(t,i)}catch(e){r(e),o.unsubscribe()}},error:r,complete:n});else r(new TypeError(e+" is not a function"));function i(){o.unsubscribe(),n()}}))}},{key:"map",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(h(this))((function(n){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))}},{key:"filter",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(h(this))((function(n){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))}},{key:"reduce",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=h(this),r=arguments.length>1,o=!1,i=arguments[1],a=i;return new n((function(n){return t.subscribe({next:function(t){var i=!o;if(o=!0,!i||r)try{a=e(a,t)}catch(e){return n.error(e)}else a=t},error:function(e){n.error(e)},complete:function(){if(!o&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(a),n.complete()}})}))}},{key:"concat",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=h(this);return new o((function(t){var r,i=0;return function e(a){r=a.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){i===n.length?(r=void 0,t.complete()):e(o.from(n[i++]))}})}(e),function(){r&&(r.unsubscribe(),r=void 0)}}))}},{key:"flatMap",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=h(this);return new n((function(r){var o=[],i=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return r.error(e)}var i=n.from(t).subscribe({next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){var e=o.indexOf(i);e>=0&&o.splice(e,1),a()}});o.push(i)},error:function(e){r.error(e)},complete:function(){a()}});function a(){i.closed&&0===o.length&&r.complete()}return function(){o.forEach((function(e){return e.unsubscribe()})),i.unsubscribe()}}))}},{key:f,value:function(){return this}}],[{key:"from",value:function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=d(t,f);if(r){var o=r.call(t);if(Object(o)!==o)throw new TypeError(o+" is not an object");return p(o)&&o.constructor===n?o:new n((function(e){return o.subscribe(e)}))}if(s("iterator")&&(r=d(t,c)))return new n((function(e){v((function(){if(!e.closed){var n=!0,o=!1,i=void 0;try{for(var a,s=r.call(t)[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;if(e.next(u),e.closed)return}}catch(e){o=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}e.complete()}}))}));if(Array.isArray(t))return new n((function(e){v((function(){if(!e.closed){for(var n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")}},{key:"of",value:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o="function"==typeof this?this:e;return new o((function(e){v((function(){if(!e.closed){for(var t=0;t<n.length;++t)if(e.next(n[t]),e.closed)return;e.complete()}}))}))}},{key:l,get:function(){return this}}]),e}();t.Observable=E,a()&&Object.defineProperty(E,Symbol("extensions"),{value:{symbol:f,hostReportError:g},configurable:!0})},function(e,t,n){"use strict";n.r(t),n.d(t,"AmplifyClass",(function(){return y})),n.d(t,"ClientDevice",(function(){return x})),n.d(t,"ConsoleLogger",(function(){return g})),n.d(t,"Logger",(function(){return g})),n.d(t,"missingConfig",(function(){return A})),n.d(t,"invalidParameter",(function(){return O})),n.d(t,"Hub",(function(){return T})),n.d(t,"I18n",(function(){return B})),n.d(t,"isEmpty",(function(){return U.e})),n.d(t,"sortByField",(function(){return U.k})),n.d(t,"objectLessAttributes",(function(){return U.j})),n.d(t,"filenameToContentType",(function(){return U.c})),n.d(t,"isTextFile",(function(){return U.g})),n.d(t,"generateRandomString",(function(){return U.d})),n.d(t,"makeQuerablePromise",(function(){return U.i})),n.d(t,"isWebWorker",(function(){return U.h})),n.d(t,"browserOrNode",(function(){return U.b})),n.d(t,"transferKeyToLowerCase",(function(){return U.l})),n.d(t,"transferKeyToUpperCase",(function(){return U.m})),n.d(t,"isStrictObject",(function(){return U.f})),n.d(t,"JS",(function(){return U.a})),n.d(t,"Signer",(function(){return ue})),n.d(t,"parseMobileHubConfig",(function(){return le})),n.d(t,"Parser",(function(){return de})),n.d(t,"AWSCloudWatchProvider",(function(){return Gc})),n.d(t,"FacebookOAuth",(function(){return Fi})),n.d(t,"GoogleOAuth",(function(){return Ui})),n.d(t,"Linking",(function(){return Hc})),n.d(t,"AppState",(function(){return Wc})),n.d(t,"AsyncStorage",(function(){return $c})),n.d(t,"Credentials",(function(){return zc})),n.d(t,"CredentialsClass",(function(){return Nc})),n.d(t,"ServiceWorker",(function(){return Vc})),n.d(t,"StorageHelper",(function(){return vi})),n.d(t,"MemoryStorage",(function(){return gi})),n.d(t,"UniversalStorage",(function(){return ef})),n.d(t,"Platform",(function(){return w})),n.d(t,"getAmplifyUserAgent",(function(){return _})),n.d(t,"INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER",(function(){return nf})),n.d(t,"INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER",(function(){return rf})),n.d(t,"USER_AGENT_HEADER",(function(){return of})),n.d(t,"Constants",(function(){return wf})),n.d(t,"NonRetryableError",(function(){return Ai})),n.d(t,"retry",(function(){return Oi})),n.d(t,"jitteredBackoff",(function(){return ki})),n.d(t,"jitteredExponentialRetry",(function(){return Li})),n.d(t,"Mutex",(function(){return af})),n.d(t,"Reachability",(function(){return ff})),n.d(t,"DateUtils",(function(){return V})),n.d(t,"urlSafeEncode",(function(){return lf})),n.d(t,"urlSafeDecode",(function(){return df})),n.d(t,"AWS_CLOUDWATCH_BASE_BUFFER_SIZE",(function(){return o})),n.d(t,"AWS_CLOUDWATCH_CATEGORY",(function(){return s})),n.d(t,"AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE",(function(){return i})),n.d(t,"AWS_CLOUDWATCH_MAX_EVENT_SIZE",(function(){return a})),n.d(t,"AWS_CLOUDWATCH_PROVIDER_NAME",(function(){return u})),n.d(t,"NO_CREDS_ERROR_STRING",(function(){return c})),n.d(t,"RETRY_ERROR_CODES",(function(){return f})),n.d(t,"BackgroundProcessManager",(function(){return yf})),n.d(t,"BackgroundManagerNotOpenError",(function(){return bf})),n.d(t,"BackgroundProcessManagerState",(function(){return hf})),n.d(t,"Amplify",(function(){return b}));var r,o=26,i=1048576,a=256e3,s="Logging",u="AWSCloudWatch",c="No credentials",f=["ResourceNotFoundException","InvalidSequenceTokenException"],l=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},d=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},h=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(d(arguments[t]));return e},p={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5};!function(e){e.DEBUG="DEBUG",e.ERROR="ERROR",e.INFO="INFO",e.WARN="WARN",e.VERBOSE="VERBOSE"}(r||(r={}));var g=function(){function e(e,t){void 0===t&&(t=r.WARN),this.name=e,this.level=t,this._pluggables=[]}return e.prototype._padding=function(e){return e<10?"0"+e:""+e},e.prototype._ts=function(){var e=new Date;return[this._padding(e.getMinutes()),this._padding(e.getSeconds())].join(":")+"."+e.getMilliseconds()},e.prototype.configure=function(e){return e?(this._config=e,this._config):this._config},e.prototype._log=function(t){for(var n,o,i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];var s=this.level;e.LOG_LEVEL&&(s=e.LOG_LEVEL),"undefined"!=typeof window&&window.LOG_LEVEL&&(s=window.LOG_LEVEL);var u=p[s],c=p[t];if(c>=u){var f=console.log.bind(console);t===r.ERROR&&console.error&&(f=console.error.bind(console)),t===r.WARN&&console.warn&&(f=console.warn.bind(console));var d="["+t+"] "+this._ts()+" "+this.name,h="";if(1===i.length&&"string"==typeof i[0])f(h=d+" - "+i[0]);else if(1===i.length)h=d+" "+i[0],f(d,i[0]);else if("string"==typeof i[0]){var g=i.slice(1);1===g.length&&(g=g[0]),h=d+" - "+i[0]+" "+g,f(d+" - "+i[0],g)}else h=d+" "+i,f(d,i);try{for(var v=l(this._pluggables),m=v.next();!m.done;m=v.next()){var y=m.value,b={message:h,timestamp:Date.now()};y.pushLogs([b])}}catch(e){n={error:e}}finally{try{m&&!m.done&&(o=v.return)&&o.call(v)}finally{if(n)throw n.error}}}},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,h([r.INFO],e))},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,h([r.INFO],e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,h([r.WARN],e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,h([r.ERROR],e))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,h([r.DEBUG],e))},e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,h([r.VERBOSE],e))},e.prototype.addPluggable=function(e){e&&e.getCategoryName()===s&&(this._pluggables.push(e),e.configure(this._config))},e.prototype.listPluggables=function(){return this._pluggables},e.LOG_LEVEL=null,e}(),v=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},m=new g("Amplify"),y=function(){function e(){this._components=[],this._config={},this._modules={},this.Auth=null,this.Analytics=null,this.API=null,this.Credentials=null,this.Storage=null,this.I18n=null,this.Cache=null,this.PubSub=null,this.Interactions=null,this.Pushnotification=null,this.UI=null,this.XR=null,this.Predictions=null,this.DataStore=null,this.Geo=null,this.Logger=g,this.ServiceWorker=null}return e.prototype.register=function(e){m.debug("component registered in amplify",e),this._components.push(e),"function"==typeof e.getModuleName?(this._modules[e.getModuleName()]=e,this[e.getModuleName()]=e):m.debug("no getModuleName method for component",e),e.configure(this._config)},e.prototype.configure=function(e){var t=this;return e?(this._config=Object.assign(this._config,e),m.debug("amplify config",this._config),Object.entries(this._modules).forEach((function(e){var n=v(e,2),r=(n[0],n[1]);Object.keys(r).forEach((function(e){t._modules[e]&&(r[e]=t._modules[e])}))})),this._components.map((function(e){e.configure(t._config)})),this._config):this._config},e.prototype.addPluggable=function(e){e&&e.getCategory&&"function"==typeof e.getCategory&&this._components.map((function(t){t.addPluggable&&"function"==typeof t.addPluggable&&t.addPluggable(e)}))},e}(),b=new y,w={userAgent:"aws-amplify/4.7.8 js",product:"",navigator:null,isReactNative:!1};if("undefined"!=typeof navigator&&navigator.product)switch(w.product=navigator.product||"",w.navigator=navigator||null,navigator.product){case"ReactNative":w.userAgent="aws-amplify/4.7.8 react-native",w.isReactNative=!0;break;default:w.userAgent="aws-amplify/4.7.8 js",w.isReactNative=!1}var _=function(e){return""+w.userAgent+(e||"")},S=new g("ClientDevice_Browser");function E(){return"undefined"==typeof window?{}:function(){if("undefined"==typeof window)return S.warn("No window object available to get browser client info"),{};var e=window.navigator;if(!e)return S.warn("No navigator object available to get browser client info"),{};var t=e.platform,n=e.product,r=e.vendor,o=e.userAgent,i=e.language,a=function(e){var t=/.+(Opera[\s[A-Z]*|OPR[\sA-Z]*)\/([0-9\.]+).*/i.exec(e);if(t)return{type:t[1],version:t[2]};var n=/.+(Trident|Edge)\/([0-9\.]+).*/i.exec(e);if(n)return{type:n[1],version:n[2]};var r=/.+(Chrome|Firefox|FxiOS)\/([0-9\.]+).*/i.exec(e);if(r)return{type:r[1],version:r[2]};var o=/.+(Safari)\/([0-9\.]+).*/i.exec(e);if(o)return{type:o[1],version:o[2]};var i=/.+(AppleWebKit)\/([0-9\.]+).*/i.exec(e);if(i)return{type:i[1],version:i[2]};var a=/.*([A-Z]+)\/([0-9\.]+).*/i.exec(e);if(a)return{type:a[1],version:a[2]};return{type:"",version:""}}(o),s=(u=/\(([A-Za-z\s].*)\)/.exec((new Date).toString()),u&&u[1]||"");var u;return{platform:t,make:n||r,model:a.type,version:a.version,appVersion:[a.type,a.version].join("/"),language:i,timezone:s}}()}var x=function(){function e(){}return e.clientInfo=function(){return E()},e.dimension=function(){return"undefined"==typeof window?(S.warn("No window object available to get browser client info"),{width:320,height:320}):{width:window.innerWidth,height:window.innerHeight}},e}();function A(e){return new Error("Missing config value of "+e)}function O(e){return new Error("Invalid parameter value of "+e)}var k=function(){return(k=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},L=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},I=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(L(arguments[t]));return e},P=new g("Hub"),C="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default";var T=new(function(){function e(e){this.listeners=[],this.patterns=[],this.protectedChannels=["core","auth","api","analytics","interactions","pubsub","storage","ui","xr"],this.name=e}return e.prototype.remove=function(e,t){if(e instanceof RegExp){var n=this.patterns.find((function(t){return t.pattern.source===e.source}));if(!n)return void P.warn("No listeners for "+e);this.patterns=I(this.patterns.filter((function(e){return e!==n})))}else{var r=this.listeners[e];if(!r)return void P.warn("No listeners for "+e);this.listeners[e]=I(r.filter((function(e){return e.callback!==t})))}},e.prototype.dispatch=function(e,t,n,r){(void 0===n&&(n=""),this.protectedChannels.indexOf(e)>-1)&&(r===C||P.warn("WARNING: "+e+" is protected and dispatching on it can have unintended consequences"));var o={channel:e,payload:k({},t),source:n,patternInfo:[]};try{this._toListeners(o)}catch(e){P.error(e)}},e.prototype.listen=function(e,t,n){var r,o=this;if(void 0===n&&(n="noname"),function(e){return void 0!==e.onHubCapsule}(t))P.warn("WARNING onHubCapsule is Deprecated. Please pass in a callback."),r=t.onHubCapsule.bind(t);else{if("function"!=typeof t)throw new Error("No callback supplied to Hub");r=t}if(e instanceof RegExp)this.patterns.push({pattern:e,callback:r});else{var i=this.listeners[e];i||(i=[],this.listeners[e]=i),i.push({name:n,callback:r})}return function(){o.remove(e,r)}},e.prototype._toListeners=function(e){var t=e.channel,n=e.payload,r=this.listeners[t];if(r&&r.forEach((function(r){P.debug("Dispatching to "+t+" with ",n);try{r.callback(e)}catch(e){P.error(e)}})),this.patterns.length>0){if(!n.message)return void P.warn("Cannot perform pattern matching without a message key");var o=n.message;this.patterns.forEach((function(t){var n=o.match(t.pattern);if(n){var r=L(n).slice(1),i=k(k({},e),{patternInfo:r});try{t.callback(i)}catch(e){P.error(e)}}}))}},e}())("__default__"),j=new g("I18n"),R=function(){function e(e){this._options=null,this._lang=null,this._dict={},this._options=Object.assign({},e),this._lang=this._options.language,!this._lang&&"undefined"!=typeof window&&window&&window.navigator&&(this._lang=window.navigator.language),j.debug(this._lang)}return e.prototype.setLanguage=function(e){this._lang=e},e.prototype.get=function(e,t){if(void 0===t&&(t=void 0),!this._lang)return void 0!==t?t:e;var n=this._lang,r=this.getByLanguage(e,n);return r||(n.indexOf("-")>0&&(r=this.getByLanguage(e,n.split("-")[0])),r||(void 0!==t?t:e))},e.prototype.getByLanguage=function(e,t,n){if(void 0===n&&(n=null),!t)return n;var r=this._dict[t];return r?r[e]:n},e.prototype.putVocabulariesForLanguage=function(e,t){var n=this._dict[e];n||(n=this._dict[e]={}),Object.assign(n,t)},e.prototype.putVocabularies=function(e){var t=this;Object.keys(e).map((function(n){t.putVocabulariesForLanguage(n,e[n])}))},e}(),M=new g("I18n"),N=null,z=null,B=function(){function e(){}return e.configure=function(t){return M.debug("configure I18n"),t?(N=Object.assign({},N,t.I18n||t),e.createInstance(),N):N},e.getModuleName=function(){return"I18n"},e.createInstance=function(){M.debug("create I18n instance"),z||(z=new R(N))},e.setLanguage=function(t){return e.checkConfig(),z.setLanguage(t)},e.get=function(t,n){return e.checkConfig()?z.get(t,n):void 0===n?t:n},e.putVocabulariesForLanguage=function(t,n){return e.checkConfig(),z.putVocabulariesForLanguage(t,n)},e.putVocabularies=function(t){return e.checkConfig(),z.putVocabularies(t)},e.checkConfig=function(){return z||(z=new R(N)),!0},e}();b.register(B);for(var U=n(1),F=n(7),D={},q={},G=0;G<256;G++){var H=G.toString(16).toLowerCase();1===H.length&&(H="0"+H),D[G]=H,q[H]=G}function W(e){for(var t="",n=0;n<e.byteLength;n++)t+=D[e[n]];return t}var $=n(3),K=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},V={clockOffset:0,getDateWithClockOffset:function(){return V.clockOffset?new Date((new Date).getTime()+V.clockOffset):new Date},getClockOffset:function(){return V.clockOffset},getHeaderStringFromDate:function(e){return void 0===e&&(e=V.getDateWithClockOffset()),e.toISOString().replace(/[:\-]|\.\d{3}/g,"")},getDateFromHeaderString:function(e){var t=K(e.match(/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2}).+/),7),n=t[1],r=t[2],o=t[3],i=t[4],a=t[5],s=t[6];return new Date(Date.UTC(Number(n),Number(r)-1,Number(o),Number(i),Number(a),Number(s)))},isClockSkewed:function(e){return Math.abs(e.getTime()-V.getDateWithClockOffset().getTime())>=3e5},isClockSkewError:function(e){if(!e.response||!e.response.headers)return!1;var t=e.response.headers;return Boolean(["BadRequestException","InvalidSignatureException"].includes(t["x-amzn-errortype"])&&(t.date||t.Date))},setClockOffset:function(e){V.clockOffset=e}};function Y(e){return(Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Z=function(){return(Z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},J=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},X=new g("Signer"),Q=function(e,t){var n=new F.Sha256(e);return n.update(t),n.digestSync()},ee=function(e){var t=e||"",n=new F.Sha256;return n.update(t),W(n.digestSync())},te=function(e){return Object.keys(e).map((function(e){return e.toLowerCase()})).sort().join(";")},ne=function(e){var t,n,r=Object($.parse)(e.url);return[e.method||"/",encodeURIComponent(r.pathname).replace(/%2F/gi,"/"),(n=r.query,n&&0!==n.length?n.split("&").map((function(e){var t=e.split("=");if(1===t.length)return e;var n=t[1].replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}));return t[0]+"="+n})).sort((function(e,t){var n=e.split("=")[0],r=t.split("=")[0];return n===r?e<t?-1:1:n<r?-1:1})).join("&"):""),(t=e.headers,t&&0!==Object.keys(t).length?Object.keys(t).map((function(e){return{key:e.toLowerCase(),value:t[e]?t[e].trim().replace(/\s+/g," "):""}})).sort((function(e,t){return e.key<t.key?-1:1})).map((function(e){return e.key+":"+e.value})).join("\n")+"\n":""),te(e.headers),ee(e.data)].join("\n")},re=function(e){var t=(Object($.parse)(e.url).host.match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com$/)||[]).slice(1,3);return"es"===t[1]&&(t=t.reverse()),{service:e.service||t[0],region:e.region||t[1]}},oe=function(e,t,n){return[e,t,n,"aws4_request"].join("/")},ie=function(e,t,n,r){return[e,n,r,ee(t)].join("\n")},ae=function(e,t,n){X.debug(n);var r=Q("AWS4"+e,t),o=Q(r,n.region),i=Q(o,n.service);return Q(i,"aws4_request")},se=function(e,t){return W(Q(e,t))},ue=function(){function e(){}return e.sign=function(e,t,n){if(void 0===n&&(n=null),e.headers=e.headers||{},e.body&&!e.data)throw new Error('The attribute "body" was found on the request object. Please use the attribute "data" instead.');var r=V.getDateWithClockOffset().toISOString().replace(/[:\-]|\.\d{3}/g,""),o=r.substr(0,8),i=Object($.parse)(e.url);e.headers.host=i.host,e.headers["x-amz-date"]=r,t.session_token&&(e.headers["X-Amz-Security-Token"]=t.session_token);var a=ne(e);X.debug(a);var s=n||re(e),u=oe(o,s.region,s.service),c=ie("AWS4-HMAC-SHA256",a,r,u),f=ae(t.secret_key,o,s),l=se(f,c),d=function(e,t,n,r,o){return[e+" Credential="+t+"/"+n,"SignedHeaders="+r,"Signature="+o].join(", ")}("AWS4-HMAC-SHA256",t.access_key,u,te(e.headers),l);return e.headers.Authorization=d,e},e.signUrl=function(e,t,n,r){var o="object"===Y(e)?e.url:e,i="object"===Y(e)?e.method:"GET",a="object"===Y(e)?e.body:void 0,s=V.getDateWithClockOffset().toISOString().replace(/[:\-]|\.\d{3}/g,""),u=s.substr(0,8),c=Object($.parse)(o,!0,!0),f=(c.search,J(c,["search"])),l={host:f.host},d=n||re({url:Object($.format)(f)}),h=d.region,p=d.service,g=oe(u,h,p),v=t.session_token&&"iotdevicegateway"!==p,m=Z(Z(Z({"X-Amz-Algorithm":"AWS4-HMAC-SHA256","X-Amz-Credential":[t.access_key,g].join("/"),"X-Amz-Date":s.substr(0,16)},v?{"X-Amz-Security-Token":""+t.session_token}:{}),r?{"X-Amz-Expires":""+r}:{}),{"X-Amz-SignedHeaders":Object.keys(l).join(",")}),y=ne({method:i,url:Object($.format)(Z(Z({},f),{query:Z(Z({},f.query),m)})),headers:l,data:a}),b=ie("AWS4-HMAC-SHA256",y,s,g),w=ae(t.secret_key,u,{region:h,service:p}),_=se(w,b),S=Z({"X-Amz-Signature":_},t.session_token&&{"X-Amz-Security-Token":t.session_token});return Object($.format)({protocol:f.protocol,slashes:!0,hostname:f.hostname,port:f.port,pathname:f.pathname,query:Z(Z(Z({},f.query),m),S)})},e}(),ce=function(){return(ce=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},fe=new g("Parser"),le=function(e){var t,n={};if(e.aws_mobile_analytics_app_id){var r={AWSPinpoint:{appId:e.aws_mobile_analytics_app_id,region:e.aws_mobile_analytics_app_region}};n.Analytics=r}return(e.aws_cognito_identity_pool_id||e.aws_user_pools_id)&&(n.Auth={userPoolId:e.aws_user_pools_id,userPoolWebClientId:e.aws_user_pools_web_client_id,region:e.aws_cognito_region,identityPoolId:e.aws_cognito_identity_pool_id,identityPoolRegion:e.aws_cognito_region,mandatorySignIn:"enable"===e.aws_mandatory_sign_in,signUpVerificationMethod:e.aws_cognito_sign_up_verification_method||"code"}),t=e.aws_user_files_s3_bucket?{AWSS3:{bucket:e.aws_user_files_s3_bucket,region:e.aws_user_files_s3_bucket_region,dangerouslyConnectToHttpEndpointForTesting:e.aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing}}:e?e.Storage||e:{},e.Logging&&(n.Logging=ce(ce({},e.Logging),{region:e.aws_project_region})),e.geo&&(n.Geo=Object.assign({},e.geo),e.geo.amazon_location_service&&(n.Geo={AmazonLocationService:e.geo.amazon_location_service})),n.Analytics=Object.assign({},n.Analytics,e.Analytics),n.Auth=Object.assign({},n.Auth,e.Auth),n.Storage=Object.assign({},t),n.Logging=Object.assign({},n.Logging,e.Logging),fe.debug("parse config",e,"to amplifyconfig",n),n},de=function(){function e(){}return e.parseMobilehubConfig=le,e}(),he=function(e,t){return(he=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function pe(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}he(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var ge=function(){return(ge=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function ve(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function me(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}Object.create;function ye(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}var be,we,_e,Se,Ee,xe,Ae,Oe,ke,Le,Ie,Pe,Ce,Te,je,Re,Me,Ne,ze,Be,Ue,Fe,De,qe,Ge,He,We,$e,Ke,Ve,Ye,Ze,Je,Xe,Qe,et,tt,nt,rt,ot,it,at,st,ut,ct,ft,lt,dt,ht,pt,gt,vt,mt,yt,bt,wt,_t,St,Et,xt,At,Ot,kt,Lt,It,Pt,Ct,Tt,jt,Rt,Mt,Nt,zt,Bt,Ut,Ft,Dt,qt,Gt,Ht,Wt,$t,Kt,Vt,Yt,Zt,Jt,Xt,Qt,en,tn,nn,rn,on,an,sn,un,cn,fn,ln,dn,hn,pn,gn;Object.create;(be||(be={})).filterSensitiveLog=function(e){return ge({},e)},(we||(we={})).filterSensitiveLog=function(e){return ge({},e)},(_e||(_e={})).filterSensitiveLog=function(e){return ge({},e)},(Se||(Se={})).filterSensitiveLog=function(e){return ge({},e)},(Ee||(Ee={})).filterSensitiveLog=function(e){return ge({},e)},(xe||(xe={})).filterSensitiveLog=function(e){return ge({},e)},(Ae||(Ae={})).filterSensitiveLog=function(e){return ge({},e)},(Oe||(Oe={})).filterSensitiveLog=function(e){return ge({},e)},(ke||(ke={})).filterSensitiveLog=function(e){return ge({},e)},(Le||(Le={})).filterSensitiveLog=function(e){return ge({},e)},(Ie||(Ie={})).filterSensitiveLog=function(e){return ge({},e)},(Pe||(Pe={})).filterSensitiveLog=function(e){return ge({},e)},(Ce||(Ce={})).filterSensitiveLog=function(e){return ge({},e)},(Te||(Te={})).filterSensitiveLog=function(e){return ge({},e)},(je||(je={})).filterSensitiveLog=function(e){return ge({},e)},(Re||(Re={})).filterSensitiveLog=function(e){return ge({},e)},(Me||(Me={})).filterSensitiveLog=function(e){return ge({},e)},(Ne||(Ne={})).filterSensitiveLog=function(e){return ge({},e)},(ze||(ze={})).filterSensitiveLog=function(e){return ge({},e)},(Be||(Be={})).filterSensitiveLog=function(e){return ge({},e)},(Ue||(Ue={})).filterSensitiveLog=function(e){return ge({},e)},(Fe||(Fe={})).filterSensitiveLog=function(e){return ge({},e)},(De||(De={})).filterSensitiveLog=function(e){return ge({},e)},(qe||(qe={})).filterSensitiveLog=function(e){return ge({},e)},(Ge||(Ge={})).filterSensitiveLog=function(e){return ge({},e)},(He||(He={})).filterSensitiveLog=function(e){return ge({},e)},function(e){e.CANCELLED="CANCELLED",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.PENDING="PENDING",e.PENDING_CANCEL="PENDING_CANCEL",e.RUNNING="RUNNING"}(We||(We={})),($e||($e={})).filterSensitiveLog=function(e){return ge({},e)},(Ke||(Ke={})).filterSensitiveLog=function(e){return ge({},e)},(Ve||(Ve={})).filterSensitiveLog=function(e){return ge({},e)},(Ye||(Ye={})).filterSensitiveLog=function(e){return ge({},e)},(Ze||(Ze={})).filterSensitiveLog=function(e){return ge({},e)},(Je||(Je={})).filterSensitiveLog=function(e){return ge({},e)},(Xe||(Xe={})).filterSensitiveLog=function(e){return ge({},e)},(Qe||(Qe={})).filterSensitiveLog=function(e){return ge({},e)},function(e){e.LastEventTime="LastEventTime",e.LogStreamName="LogStreamName"}(et||(et={})),(tt||(tt={})).filterSensitiveLog=function(e){return ge({},e)},(nt||(nt={})).filterSensitiveLog=function(e){return ge({},e)},(rt||(rt={})).filterSensitiveLog=function(e){return ge({},e)},(ot||(ot={})).filterSensitiveLog=function(e){return ge({},e)},(it||(it={})).filterSensitiveLog=function(e){return ge({},e)},(at||(at={})).filterSensitiveLog=function(e){return ge({},e)},(st||(st={})).filterSensitiveLog=function(e){return ge({},e)},function(e){e.Cancelled="Cancelled",e.Complete="Complete",e.Failed="Failed",e.Running="Running",e.Scheduled="Scheduled"}(ut||(ut={})),(ct||(ct={})).filterSensitiveLog=function(e){return ge({},e)},(ft||(ft={})).filterSensitiveLog=function(e){return ge({},e)},(lt||(lt={})).filterSensitiveLog=function(e){return ge({},e)},(dt||(dt={})).filterSensitiveLog=function(e){return ge({},e)},(ht||(ht={})).filterSensitiveLog=function(e){return ge({},e)},(pt||(pt={})).filterSensitiveLog=function(e){return ge({},e)},(gt||(gt={})).filterSensitiveLog=function(e){return ge({},e)},(vt||(vt={})).filterSensitiveLog=function(e){return ge({},e)},(mt||(mt={})).filterSensitiveLog=function(e){return ge({},e)},(yt||(yt={})).filterSensitiveLog=function(e){return ge({},e)},function(e){e.ByLogStream="ByLogStream",e.Random="Random"}(bt||(bt={})),(wt||(wt={})).filterSensitiveLog=function(e){return ge({},e)},(_t||(_t={})).filterSensitiveLog=function(e){return ge({},e)},(St||(St={})).filterSensitiveLog=function(e){return ge({},e)},(Et||(Et={})).filterSensitiveLog=function(e){return ge({},e)},(xt||(xt={})).filterSensitiveLog=function(e){return ge({},e)},(At||(At={})).filterSensitiveLog=function(e){return ge({},e)},(Ot||(Ot={})).filterSensitiveLog=function(e){return ge({},e)},(kt||(kt={})).filterSensitiveLog=function(e){return ge({},e)},(Lt||(Lt={})).filterSensitiveLog=function(e){return ge({},e)},(It||(It={})).filterSensitiveLog=function(e){return ge({},e)},(Pt||(Pt={})).filterSensitiveLog=function(e){return ge({},e)},(Ct||(Ct={})).filterSensitiveLog=function(e){return ge({},e)},(Tt||(Tt={})).filterSensitiveLog=function(e){return ge({},e)},(jt||(jt={})).filterSensitiveLog=function(e){return ge({},e)},(Rt||(Rt={})).filterSensitiveLog=function(e){return ge({},e)},(Mt||(Mt={})).filterSensitiveLog=function(e){return ge({},e)},(Nt||(Nt={})).filterSensitiveLog=function(e){return ge({},e)},(zt||(zt={})).filterSensitiveLog=function(e){return ge({},e)},(Bt||(Bt={})).filterSensitiveLog=function(e){return ge({},e)},(Ut||(Ut={})).filterSensitiveLog=function(e){return ge({},e)},(Ft||(Ft={})).filterSensitiveLog=function(e){return ge({},e)},(Dt||(Dt={})).filterSensitiveLog=function(e){return ge({},e)},(qt||(qt={})).filterSensitiveLog=function(e){return ge({},e)},(Gt||(Gt={})).filterSensitiveLog=function(e){return ge({},e)},(Ht||(Ht={})).filterSensitiveLog=function(e){return ge({},e)},(Wt||(Wt={})).filterSensitiveLog=function(e){return ge({},e)},($t||($t={})).filterSensitiveLog=function(e){return ge({},e)},(Kt||(Kt={})).filterSensitiveLog=function(e){return ge({},e)},(Vt||(Vt={})).filterSensitiveLog=function(e){return ge({},e)},(Yt||(Yt={})).filterSensitiveLog=function(e){return ge({},e)},(Zt||(Zt={})).filterSensitiveLog=function(e){return ge({},e)},(Jt||(Jt={})).filterSensitiveLog=function(e){return ge({},e)},(Xt||(Xt={})).filterSensitiveLog=function(e){return ge({},e)},(Qt||(Qt={})).filterSensitiveLog=function(e){return ge({},e)},(en||(en={})).filterSensitiveLog=function(e){return ge({},e)},(tn||(tn={})).filterSensitiveLog=function(e){return ge({},e)},(nn||(nn={})).filterSensitiveLog=function(e){return ge({},e)},(rn||(rn={})).filterSensitiveLog=function(e){return ge({},e)},(on||(on={})).filterSensitiveLog=function(e){return ge({},e)},(an||(an={})).filterSensitiveLog=function(e){return ge({},e)},(sn||(sn={})).filterSensitiveLog=function(e){return ge({},e)},(un||(un={})).filterSensitiveLog=function(e){return ge({},e)},(cn||(cn={})).filterSensitiveLog=function(e){return ge({},e)},(fn||(fn={})).filterSensitiveLog=function(e){return ge({},e)},(ln||(ln={})).filterSensitiveLog=function(e){return ge({},e)},(dn||(dn={})).filterSensitiveLog=function(e){return ge({},e)},(hn||(hn={})).filterSensitiveLog=function(e){return ge({},e)},(pn||(pn={})).filterSensitiveLog=function(e){return ge({},e)},(gn||(gn={})).filterSensitiveLog=function(e){return ge({},e)};var vn=function(){function e(e){this.statusCode=e.statusCode,this.headers=e.headers||{},this.body=e.body}return e.isInstance=function(e){if(!e)return!1;var t=e;return"number"==typeof t.statusCode&&"object"==typeof t.headers},e}(),mn=n(0),yn=function(){function e(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?":"!==e.protocol.substr(-1)?e.protocol+":":e.protocol:"https:",this.path=e.path?"/"!==e.path.charAt(0)?"/"+e.path:e.path:"/"}return e.isInstance=function(e){if(!e)return!1;var t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&"object"==typeof t.query&&"object"==typeof t.headers},e.prototype.clone=function(){var t,n=new e(Object(mn.__assign)(Object(mn.__assign)({},this),{headers:Object(mn.__assign)({},this.headers)}));return n.query&&(n.query=(t=n.query,Object.keys(t).reduce((function(e,n){var r,o=t[n];return Object(mn.__assign)(Object(mn.__assign)({},e),((r={})[n]=Array.isArray(o)?Object(mn.__spread)(o):o,r))}),{}))),n},e}();var bn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h;return me(this,(function(p){switch(p.label){case 0:return r=[ge({},e)],h={},[4,ur(e.body,t)];case 1:switch(n=ge.apply(void 0,r.concat([(h.body=p.sent(),h)])),i="UnknownError",i=cr(e,n.body),i){case"InvalidParameterException":case"com.amazonaws.cloudwatchlogs#InvalidParameterException":return[3,2];case"LimitExceededException":case"com.amazonaws.cloudwatchlogs#LimitExceededException":return[3,4];case"OperationAbortedException":case"com.amazonaws.cloudwatchlogs#OperationAbortedException":return[3,6];case"ResourceAlreadyExistsException":case"com.amazonaws.cloudwatchlogs#ResourceAlreadyExistsException":return[3,8];case"ServiceUnavailableException":case"com.amazonaws.cloudwatchlogs#ServiceUnavailableException":return[3,10]}return[3,12];case 2:return a=[{}],[4,On(n,t)];case 3:return o=ge.apply(void 0,[ge.apply(void 0,a.concat([p.sent()])),{name:i,$metadata:ir(e)}]),[3,13];case 4:return s=[{}],[4,Ln(n,t)];case 5:return o=ge.apply(void 0,[ge.apply(void 0,s.concat([p.sent()])),{name:i,$metadata:ir(e)}]),[3,13];case 6:return u=[{}],[4,In(n,t)];case 7:return o=ge.apply(void 0,[ge.apply(void 0,u.concat([p.sent()])),{name:i,$metadata:ir(e)}]),[3,13];case 8:return c=[{}],[4,Pn(n,t)];case 9:return o=ge.apply(void 0,[ge.apply(void 0,c.concat([p.sent()])),{name:i,$metadata:ir(e)}]),[3,13];case 10:return f=[{}],[4,Tn(n,t)];case 11:return o=ge.apply(void 0,[ge.apply(void 0,f.concat([p.sent()])),{name:i,$metadata:ir(e)}]),[3,13];case 12:l=n.body,i=l.code||l.Code||i,o=ge(ge({},l),{name:""+i,message:l.message||l.Message||i,$fault:"client",$metadata:ir(e)}),p.label=13;case 13:return d=o.message||o.Message||i,o.message=d,delete o.Message,[2,Promise.reject(Object.assign(new Error(d),o))]}}))}))},wn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d;return me(this,(function(h){switch(h.label){case 0:return r=[ge({},e)],d={},[4,ur(e.body,t)];case 1:switch(n=ge.apply(void 0,r.concat([(d.body=h.sent(),d)])),i="UnknownError",i=cr(e,n.body),i){case"InvalidParameterException":case"com.amazonaws.cloudwatchlogs#InvalidParameterException":return[3,2];case"ResourceAlreadyExistsException":case"com.amazonaws.cloudwatchlogs#ResourceAlreadyExistsException":return[3,4];case"ResourceNotFoundException":case"com.amazonaws.cloudwatchlogs#ResourceNotFoundException":return[3,6];case"ServiceUnavailableException":case"com.amazonaws.cloudwatchlogs#ServiceUnavailableException":return[3,8]}return[3,10];case 2:return a=[{}],[4,On(n,t)];case 3:return o=ge.apply(void 0,[ge.apply(void 0,a.concat([h.sent()])),{name:i,$metadata:ir(e)}]),[3,11];case 4:return s=[{}],[4,Pn(n,t)];case 5:return o=ge.apply(void 0,[ge.apply(void 0,s.concat([h.sent()])),{name:i,$metadata:ir(e)}]),[3,11];case 6:return u=[{}],[4,Cn(n,t)];case 7:return o=ge.apply(void 0,[ge.apply(void 0,u.concat([h.sent()])),{name:i,$metadata:ir(e)}]),[3,11];case 8:return c=[{}],[4,Tn(n,t)];case 9:return o=ge.apply(void 0,[ge.apply(void 0,c.concat([h.sent()])),{name:i,$metadata:ir(e)}]),[3,11];case 10:f=n.body,i=f.code||f.Code||i,o=ge(ge({},f),{name:""+i,message:f.message||f.Message||i,$fault:"client",$metadata:ir(e)}),h.label=11;case 11:return l=o.message||o.Message||i,o.message=l,delete o.Message,[2,Promise.reject(Object.assign(new Error(l),o))]}}))}))},_n=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f;return me(this,(function(l){switch(l.label){case 0:return r=[ge({},e)],f={},[4,ur(e.body,t)];case 1:switch(n=ge.apply(void 0,r.concat([(f.body=l.sent(),f)])),i="UnknownError",i=cr(e,n.body),i){case"InvalidParameterException":case"com.amazonaws.cloudwatchlogs#InvalidParameterException":return[3,2];case"ServiceUnavailableException":case"com.amazonaws.cloudwatchlogs#ServiceUnavailableException":return[3,4]}return[3,6];case 2:return a=[{}],[4,On(n,t)];case 3:return o=ge.apply(void 0,[ge.apply(void 0,a.concat([l.sent()])),{name:i,$metadata:ir(e)}]),[3,7];case 4:return s=[{}],[4,Tn(n,t)];case 5:return o=ge.apply(void 0,[ge.apply(void 0,s.concat([l.sent()])),{name:i,$metadata:ir(e)}]),[3,7];case 6:u=n.body,i=u.code||u.Code||i,o=ge(ge({},u),{name:""+i,message:u.message||u.Message||i,$fault:"client",$metadata:ir(e)}),l.label=7;case 7:return c=o.message||o.Message||i,o.message=c,delete o.Message,[2,Promise.reject(Object.assign(new Error(c),o))]}}))}))},Sn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l;return me(this,(function(d){switch(d.label){case 0:return r=[ge({},e)],l={},[4,ur(e.body,t)];case 1:switch(n=ge.apply(void 0,r.concat([(l.body=d.sent(),l)])),i="UnknownError",i=cr(e,n.body),i){case"InvalidParameterException":case"com.amazonaws.cloudwatchlogs#InvalidParameterException":return[3,2];case"ResourceNotFoundException":case"com.amazonaws.cloudwatchlogs#ResourceNotFoundException":return[3,4];case"ServiceUnavailableException":case"com.amazonaws.cloudwatchlogs#ServiceUnavailableException":return[3,6]}return[3,8];case 2:return a=[{}],[4,On(n,t)];case 3:return o=ge.apply(void 0,[ge.apply(void 0,a.concat([d.sent()])),{name:i,$metadata:ir(e)}]),[3,9];case 4:return s=[{}],[4,Cn(n,t)];case 5:return o=ge.apply(void 0,[ge.apply(void 0,s.concat([d.sent()])),{name:i,$metadata:ir(e)}]),[3,9];case 6:return u=[{}],[4,Tn(n,t)];case 7:return o=ge.apply(void 0,[ge.apply(void 0,u.concat([d.sent()])),{name:i,$metadata:ir(e)}]),[3,9];case 8:c=n.body,i=c.code||c.Code||i,o=ge(ge({},c),{name:""+i,message:c.message||c.Message||i,$fault:"client",$metadata:ir(e)}),d.label=9;case 9:return f=o.message||o.Message||i,o.message=f,delete o.Message,[2,Promise.reject(Object.assign(new Error(f),o))]}}))}))},En=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l;return me(this,(function(d){switch(d.label){case 0:return r=[ge({},e)],l={},[4,ur(e.body,t)];case 1:switch(n=ge.apply(void 0,r.concat([(l.body=d.sent(),l)])),i="UnknownError",i=cr(e,n.body),i){case"InvalidParameterException":case"com.amazonaws.cloudwatchlogs#InvalidParameterException":return[3,2];case"ResourceNotFoundException":case"com.amazonaws.cloudwatchlogs#ResourceNotFoundException":return[3,4];case"ServiceUnavailableException":case"com.amazonaws.cloudwatchlogs#ServiceUnavailableException":return[3,6]}return[3,8];case 2:return a=[{}],[4,On(n,t)];case 3:return o=ge.apply(void 0,[ge.apply(void 0,a.concat([d.sent()])),{name:i,$metadata:ir(e)}]),[3,9];case 4:return s=[{}],[4,Cn(n,t)];case 5:return o=ge.apply(void 0,[ge.apply(void 0,s.concat([d.sent()])),{name:i,$metadata:ir(e)}]),[3,9];case 6:return u=[{}],[4,Tn(n,t)];case 7:return o=ge.apply(void 0,[ge.apply(void 0,u.concat([d.sent()])),{name:i,$metadata:ir(e)}]),[3,9];case 8:c=n.body,i=c.code||c.Code||i,o=ge(ge({},c),{name:""+i,message:c.message||c.Message||i,$fault:"client",$metadata:ir(e)}),d.label=9;case 9:return f=o.message||o.Message||i,o.message=f,delete o.Message,[2,Promise.reject(Object.assign(new Error(f),o))]}}))}))},xn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h,p;return me(this,(function(g){switch(g.label){case 0:return r=[ge({},e)],p={},[4,ur(e.body,t)];case 1:switch(n=ge.apply(void 0,r.concat([(p.body=g.sent(),p)])),i="UnknownError",i=cr(e,n.body),i){case"DataAlreadyAcceptedException":case"com.amazonaws.cloudwatchlogs#DataAlreadyAcceptedException":return[3,2];case"InvalidParameterException":case"com.amazonaws.cloudwatchlogs#InvalidParameterException":return[3,4];case"InvalidSequenceTokenException":case"com.amazonaws.cloudwatchlogs#InvalidSequenceTokenException":return[3,6];case"ResourceNotFoundException":case"com.amazonaws.cloudwatchlogs#ResourceNotFoundException":return[3,8];case"ServiceUnavailableException":case"com.amazonaws.cloudwatchlogs#ServiceUnavailableException":return[3,10];case"UnrecognizedClientException":case"com.amazonaws.cloudwatchlogs#UnrecognizedClientException":return[3,12]}return[3,14];case 2:return a=[{}],[4,An(n,t)];case 3:return o=ge.apply(void 0,[ge.apply(void 0,a.concat([g.sent()])),{name:i,$metadata:ir(e)}]),[3,15];case 4:return s=[{}],[4,On(n,t)];case 5:return o=ge.apply(void 0,[ge.apply(void 0,s.concat([g.sent()])),{name:i,$metadata:ir(e)}]),[3,15];case 6:return u=[{}],[4,kn(n,t)];case 7:return o=ge.apply(void 0,[ge.apply(void 0,u.concat([g.sent()])),{name:i,$metadata:ir(e)}]),[3,15];case 8:return c=[{}],[4,Cn(n,t)];case 9:return o=ge.apply(void 0,[ge.apply(void 0,c.concat([g.sent()])),{name:i,$metadata:ir(e)}]),[3,15];case 10:return f=[{}],[4,Tn(n,t)];case 11:return o=ge.apply(void 0,[ge.apply(void 0,f.concat([g.sent()])),{name:i,$metadata:ir(e)}]),[3,15];case 12:return l=[{}],[4,jn(n,t)];case 13:return o=ge.apply(void 0,[ge.apply(void 0,l.concat([g.sent()])),{name:i,$metadata:ir(e)}]),[3,15];case 14:d=n.body,i=d.code||d.Code||i,o=ge(ge({},d),{name:""+i,message:d.message||d.Message||i,$fault:"client",$metadata:ir(e)}),g.label=15;case 15:return h=o.message||o.Message||i,o.message=h,delete o.Message,[2,Promise.reject(Object.assign(new Error(h),o))]}}))}))},An=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=qn(n,t),[2,ge({name:"DataAlreadyAcceptedException",$fault:"client",$metadata:ir(e)},r)]}))}))},On=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=$n(n,t),[2,ge({name:"InvalidParameterException",$fault:"client",$metadata:ir(e)},r)]}))}))},kn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=Kn(n,t),[2,ge({name:"InvalidSequenceTokenException",$fault:"client",$metadata:ir(e)},r)]}))}))},Ln=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=Vn(n,t),[2,ge({name:"LimitExceededException",$fault:"client",$metadata:ir(e)},r)]}))}))},In=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=Jn(n,t),[2,ge({name:"OperationAbortedException",$fault:"client",$metadata:ir(e)},r)]}))}))},Pn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=tr(n,t),[2,ge({name:"ResourceAlreadyExistsException",$fault:"client",$metadata:ir(e)},r)]}))}))},Cn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=nr(n,t),[2,ge({name:"ResourceNotFoundException",$fault:"client",$metadata:ir(e)},r)]}))}))},Tn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=rr(n,t),[2,ge({name:"ServiceUnavailableException",$fault:"server",$metadata:ir(e)},r)]}))}))},jn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=or(n,t),[2,ge({name:"UnrecognizedClientException",$fault:"client",$metadata:ir(e)},r)]}))}))},Rn=function(e,t){return ge(ge(ge({},void 0!==e.kmsKeyId&&null!==e.kmsKeyId&&{kmsKeyId:e.kmsKeyId}),void 0!==e.logGroupName&&null!==e.logGroupName&&{logGroupName:e.logGroupName}),void 0!==e.tags&&null!==e.tags&&{tags:Dn(e.tags,t)})},Mn=function(e,t){return ge(ge({},void 0!==e.logGroupName&&null!==e.logGroupName&&{logGroupName:e.logGroupName}),void 0!==e.logStreamName&&null!==e.logStreamName&&{logStreamName:e.logStreamName})},Nn=function(e,t){return ge(ge(ge({},void 0!==e.limit&&null!==e.limit&&{limit:e.limit}),void 0!==e.logGroupNamePrefix&&null!==e.logGroupNamePrefix&&{logGroupNamePrefix:e.logGroupNamePrefix}),void 0!==e.nextToken&&null!==e.nextToken&&{nextToken:e.nextToken})},zn=function(e,t){return ge(ge(ge(ge(ge(ge({},void 0!==e.descending&&null!==e.descending&&{descending:e.descending}),void 0!==e.limit&&null!==e.limit&&{limit:e.limit}),void 0!==e.logGroupName&&null!==e.logGroupName&&{logGroupName:e.logGroupName}),void 0!==e.logStreamNamePrefix&&null!==e.logStreamNamePrefix&&{logStreamNamePrefix:e.logStreamNamePrefix}),void 0!==e.nextToken&&null!==e.nextToken&&{nextToken:e.nextToken}),void 0!==e.orderBy&&null!==e.orderBy&&{orderBy:e.orderBy})},Bn=function(e,t){return ge(ge(ge(ge(ge(ge(ge({},void 0!==e.endTime&&null!==e.endTime&&{endTime:e.endTime}),void 0!==e.limit&&null!==e.limit&&{limit:e.limit}),void 0!==e.logGroupName&&null!==e.logGroupName&&{logGroupName:e.logGroupName}),void 0!==e.logStreamName&&null!==e.logStreamName&&{logStreamName:e.logStreamName}),void 0!==e.nextToken&&null!==e.nextToken&&{nextToken:e.nextToken}),void 0!==e.startFromHead&&null!==e.startFromHead&&{startFromHead:e.startFromHead}),void 0!==e.startTime&&null!==e.startTime&&{startTime:e.startTime})},Un=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return ge(ge({},void 0!==e.message&&null!==e.message&&{message:e.message}),void 0!==e.timestamp&&null!==e.timestamp&&{timestamp:e.timestamp})}(e)}))},Fn=function(e,t){return ge(ge(ge(ge({},void 0!==e.logEvents&&null!==e.logEvents&&{logEvents:Un(e.logEvents)}),void 0!==e.logGroupName&&null!==e.logGroupName&&{logGroupName:e.logGroupName}),void 0!==e.logStreamName&&null!==e.logStreamName&&{logStreamName:e.logStreamName}),void 0!==e.sequenceToken&&null!==e.sequenceToken&&{sequenceToken:e.sequenceToken})},Dn=function(e,t){return Object.entries(e).reduce((function(e,t){var n,r=ye(t,2),o=r[0],i=r[1];return null===i?e:ge(ge({},e),((n={})[o]=i,n))}),{})},qn=function(e,t){return{expectedSequenceToken:void 0!==e.expectedSequenceToken&&null!==e.expectedSequenceToken?e.expectedSequenceToken:void 0,message:void 0!==e.message&&null!==e.message?e.message:void 0}},Gn=function(e,t){return{logGroups:void 0!==e.logGroups&&null!==e.logGroups?Yn(e.logGroups,t):void 0,nextToken:void 0!==e.nextToken&&null!==e.nextToken?e.nextToken:void 0}},Hn=function(e,t){return{logStreams:void 0!==e.logStreams&&null!==e.logStreams?Zn(e.logStreams,t):void 0,nextToken:void 0!==e.nextToken&&null!==e.nextToken?e.nextToken:void 0}},Wn=function(e,t){return{events:void 0!==e.events&&null!==e.events?Xn(e.events,t):void 0,nextBackwardToken:void 0!==e.nextBackwardToken&&null!==e.nextBackwardToken?e.nextBackwardToken:void 0,nextForwardToken:void 0!==e.nextForwardToken&&null!==e.nextForwardToken?e.nextForwardToken:void 0}},$n=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Kn=function(e,t){return{expectedSequenceToken:void 0!==e.expectedSequenceToken&&null!==e.expectedSequenceToken?e.expectedSequenceToken:void 0,message:void 0!==e.message&&null!==e.message?e.message:void 0}},Vn=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Yn=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{arn:void 0!==e.arn&&null!==e.arn?e.arn:void 0,creationTime:void 0!==e.creationTime&&null!==e.creationTime?e.creationTime:void 0,kmsKeyId:void 0!==e.kmsKeyId&&null!==e.kmsKeyId?e.kmsKeyId:void 0,logGroupName:void 0!==e.logGroupName&&null!==e.logGroupName?e.logGroupName:void 0,metricFilterCount:void 0!==e.metricFilterCount&&null!==e.metricFilterCount?e.metricFilterCount:void 0,retentionInDays:void 0!==e.retentionInDays&&null!==e.retentionInDays?e.retentionInDays:void 0,storedBytes:void 0!==e.storedBytes&&null!==e.storedBytes?e.storedBytes:void 0}}(e)}))},Zn=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{arn:void 0!==e.arn&&null!==e.arn?e.arn:void 0,creationTime:void 0!==e.creationTime&&null!==e.creationTime?e.creationTime:void 0,firstEventTimestamp:void 0!==e.firstEventTimestamp&&null!==e.firstEventTimestamp?e.firstEventTimestamp:void 0,lastEventTimestamp:void 0!==e.lastEventTimestamp&&null!==e.lastEventTimestamp?e.lastEventTimestamp:void 0,lastIngestionTime:void 0!==e.lastIngestionTime&&null!==e.lastIngestionTime?e.lastIngestionTime:void 0,logStreamName:void 0!==e.logStreamName&&null!==e.logStreamName?e.logStreamName:void 0,storedBytes:void 0!==e.storedBytes&&null!==e.storedBytes?e.storedBytes:void 0,uploadSequenceToken:void 0!==e.uploadSequenceToken&&null!==e.uploadSequenceToken?e.uploadSequenceToken:void 0}}(e)}))},Jn=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Xn=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{ingestionTime:void 0!==e.ingestionTime&&null!==e.ingestionTime?e.ingestionTime:void 0,message:void 0!==e.message&&null!==e.message?e.message:void 0,timestamp:void 0!==e.timestamp&&null!==e.timestamp?e.timestamp:void 0}}(e)}))},Qn=function(e,t){return{nextSequenceToken:void 0!==e.nextSequenceToken&&null!==e.nextSequenceToken?e.nextSequenceToken:void 0,rejectedLogEventsInfo:void 0!==e.rejectedLogEventsInfo&&null!==e.rejectedLogEventsInfo?er(e.rejectedLogEventsInfo,t):void 0}},er=function(e,t){return{expiredLogEventEndIndex:void 0!==e.expiredLogEventEndIndex&&null!==e.expiredLogEventEndIndex?e.expiredLogEventEndIndex:void 0,tooNewLogEventStartIndex:void 0!==e.tooNewLogEventStartIndex&&null!==e.tooNewLogEventStartIndex?e.tooNewLogEventStartIndex:void 0,tooOldLogEventEndIndex:void 0!==e.tooOldLogEventEndIndex&&null!==e.tooOldLogEventEndIndex?e.tooOldLogEventEndIndex:void 0}},tr=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},nr=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},rr=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},or=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},ir=function(e){var t;return{httpStatusCode:e.statusCode,requestId:null!==(t=e.headers["x-amzn-requestid"])&&void 0!==t?t:e.headers["x-amzn-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}},ar=function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)},sr=function(e,t,n,r,o){return ve(void 0,void 0,void 0,(function(){var i,a,s,u,c,f;return me(this,(function(l){switch(l.label){case 0:return[4,e.endpoint()];case 1:return i=l.sent(),a=i.hostname,s=i.protocol,u=void 0===s?"https":s,c=i.port,f={protocol:u,hostname:a,port:c,method:"POST",path:n,headers:t},void 0!==r&&(f.hostname=r),void 0!==o&&(f.body=o),[2,new yn(f)]}}))}))},ur=function(e,t){return function(e,t){return ar(e,t).then((function(e){return t.utf8Encoder(e)}))}(e,t).then((function(e){return e.length?JSON.parse(e):{}}))},cr=function(e,t){var n,r,o=function(e){var t=e;return t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},i=(n=e.headers,r="x-amzn-errortype",Object.keys(n).find((function(e){return e.toLowerCase()===r.toLowerCase()})));return void 0!==i?o(e.headers[i]):void 0!==t.code?o(t.code):void 0!==t.__type?o(t.__type):""},fr={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},lr={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function dr(e,t,n){return{applyToStack:function(r){r.add(function(e,t){return function(n,r){return function(r){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var o,i;return Object(mn.__generator)(this,(function(a){switch(a.label){case 0:return[4,n(r)];case 1:return o=a.sent().response,[4,t(o,e)];case 2:return i=a.sent(),[2,{response:o,output:i}]}}))}))}}}(e,n),fr),r.add(function(e,t){return function(n,r){return function(r){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var o;return Object(mn.__generator)(this,(function(i){switch(i.label){case 0:return[4,t(r.input,e)];case 1:return o=i.sent(),[2,n(Object(mn.__assign)(Object(mn.__assign)({},r),{request:o}))]}}))}))}}}(e,t),lr)}}}var hr=function(){var e=[],t=[],n=new Set,r=function(n){return e.forEach((function(e){n.add(e.middleware,Object(mn.__assign)({},e))})),t.forEach((function(e){n.addRelativeTo(e.middleware,Object(mn.__assign)({},e))})),n},o=function(e){var t=[];return e.before.forEach((function(e){0===e.before.length&&0===e.after.length?t.push(e):t.push.apply(t,Object(mn.__spread)(o(e)))})),t.push(e),e.after.reverse().forEach((function(e){0===e.before.length&&0===e.after.length?t.push(e):t.push.apply(t,Object(mn.__spread)(o(e)))})),t},i=function(){var n,r=[],i=[],a={};return e.forEach((function(e){var t=Object(mn.__assign)(Object(mn.__assign)({},e),{before:[],after:[]});t.name&&(a[t.name]=t),r.push(t)})),t.forEach((function(e){var t=Object(mn.__assign)(Object(mn.__assign)({},e),{before:[],after:[]});t.name&&(a[t.name]=t),i.push(t)})),i.forEach((function(e){if(e.toMiddleware){var t=a[e.toMiddleware];if(void 0===t)throw new Error(e.toMiddleware+" is not found when adding "+(e.name||"anonymous")+" middleware "+e.relation+" "+e.toMiddleware);"after"===e.relation&&t.after.push(e),"before"===e.relation&&t.before.push(e)}})),(n=r,n.sort((function(e,t){return pr[t.step]-pr[e.step]||gr[t.priority||"normal"]-gr[e.priority||"normal"]}))).map(o).reduce((function(e,t){return e.push.apply(e,Object(mn.__spread)(t)),e}),[]).map((function(e){return e.middleware}))},a={add:function(t,r){void 0===r&&(r={});var o=r.name,i=r.override,a=Object(mn.__assign)({step:"initialize",priority:"normal",middleware:t},r);if(o){if(n.has(o)){if(!i)throw new Error("Duplicate middleware name '"+o+"'");var s=e.findIndex((function(e){return e.name===o})),u=e[s];if(u.step!==a.step||u.priority!==a.priority)throw new Error('"'+o+'" middleware with '+u.priority+" priority in "+u.step+" step cannot be overridden by same-name middleware with "+a.priority+" priority in "+a.step+" step.");e.splice(s,1)}n.add(o)}e.push(a)},addRelativeTo:function(e,r){var o=r.name,i=r.override,a=Object(mn.__assign)({middleware:e},r);if(o){if(n.has(o)){if(!i)throw new Error("Duplicate middleware name '"+o+"'");var s=t.findIndex((function(e){return e.name===o})),u=t[s];if(u.toMiddleware!==a.toMiddleware||u.relation!==a.relation)throw new Error('"'+o+'" middleware '+u.relation+' "'+u.toMiddleware+'" middleware cannot be overridden by same-name middleware '+a.relation+' "'+a.toMiddleware+'" middleware.');t.splice(s,1)}n.add(o)}t.push(a)},clone:function(){return r(hr())},use:function(e){e.applyToStack(a)},remove:function(r){return"string"==typeof r?function(r){var o=!1,i=function(e){return!e.name||e.name!==r||(o=!0,n.delete(r),!1)};return e=e.filter(i),t=t.filter(i),o}(r):function(r){var o=!1,i=function(e){return e.middleware!==r||(o=!0,e.name&&n.delete(e.name),!1)};return e=e.filter(i),t=t.filter(i),o}(r)},removeByTag:function(r){var o=!1,i=function(e){var t=e.tags,i=e.name;return!t||!t.includes(r)||(i&&n.delete(i),o=!0,!1)};return e=e.filter(i),t=t.filter(i),o},concat:function(e){var t=r(hr());return t.use(e),t},applyToStack:r,resolve:function(e,t){var n,r;try{for(var o=Object(mn.__values)(i().reverse()),a=o.next();!a.done;a=o.next()){e=(0,a.value)(e,t)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return e}};return a},pr={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},gr={high:3,normal:2,low:1},vr=function(){function e(e){this.middlewareStack=hr(),this.config=e}return e.prototype.send=function(e,t,n){var r="function"!=typeof t?t:void 0,o="function"==typeof t?t:n,i=e.resolveMiddleware(this.middlewareStack,this.config,r);if(!o)return i(e).then((function(e){return e.output}));i(e).then((function(e){return o(null,e.output)}),(function(e){return o(e)})).catch((function(){}))},e.prototype.destroy=function(){this.config.requestHandler.destroy&&this.config.requestHandler.destroy()},e}(),mr=function(){this.middlewareStack=hr()};var yr=function(){var e=Object.getPrototypeOf(this).constructor,t=Function.bind.apply(String,Object(mn.__spread)([null],arguments)),n=new t;return Object.setPrototypeOf(n,e.prototype),n};yr.prototype=Object.create(String.prototype,{constructor:{value:yr,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(yr,String);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}Object(mn.__extends)(t,e),t.prototype.deserializeJSON=function(){return JSON.parse(e.prototype.toString.call(this))},t.prototype.toJSON=function(){return e.prototype.toString.call(this)},t.fromObject=function(e){return e instanceof t?e:new t(e instanceof String||"string"==typeof e?e:JSON.stringify(e))}}(yr);var br=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return pe(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"CreateLogGroupCommand",inputFilterSensitiveLog:Pe.filterSensitiveLog,outputFilterSensitiveLog:function(e){return e}},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"Logs_20140328.CreateLogGroup"},r=JSON.stringify(Rn(e,t)),[2,sr(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n;return me(this,(function(r){switch(r.label){case 0:return e.statusCode>=300?[2,bn(e,t)]:[4,ar(e.body,t)];case 1:return r.sent(),n={$metadata:ir(e)},[2,Promise.resolve(n)]}}))}))}(e,t)},t}(mr),wr=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return pe(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"DescribeLogGroupsCommand",inputFilterSensitiveLog:Je.filterSensitiveLog,outputFilterSensitiveLog:Qe.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"Logs_20140328.DescribeLogGroups"},r=JSON.stringify(Nn(e,t)),[2,sr(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o;return me(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,_n(e,t)]:[4,ur(e.body,t)];case 1:return n=i.sent(),{},r=Gn(n,t),o=ge({$metadata:ir(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),_r=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return pe(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"CreateLogStreamCommand",inputFilterSensitiveLog:Ce.filterSensitiveLog,outputFilterSensitiveLog:function(e){return e}},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"Logs_20140328.CreateLogStream"},r=JSON.stringify(Mn(e,t)),[2,sr(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n;return me(this,(function(r){switch(r.label){case 0:return e.statusCode>=300?[2,wn(e,t)]:[4,ar(e.body,t)];case 1:return r.sent(),n={$metadata:ir(e)},[2,Promise.resolve(n)]}}))}))}(e,t)},t}(mr),Sr=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return pe(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"DescribeLogStreamsCommand",inputFilterSensitiveLog:tt.filterSensitiveLog,outputFilterSensitiveLog:rt.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"Logs_20140328.DescribeLogStreams"},r=JSON.stringify(zn(e,t)),[2,sr(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o;return me(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,Sn(e,t)]:[4,ur(e.body,t)];case 1:return n=i.sent(),{},r=Hn(n,t),o=ge({$metadata:ir(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),Er=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return pe(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"GetLogEventsCommand",inputFilterSensitiveLog:kt.filterSensitiveLog,outputFilterSensitiveLog:It.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"Logs_20140328.GetLogEvents"},r=JSON.stringify(Bn(e,t)),[2,sr(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o;return me(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,En(e,t)]:[4,ur(e.body,t)];case 1:return n=i.sent(),{},r=Wn(n,t),o=ge({$metadata:ir(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),xr=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return pe(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"PutLogEventsCommand",inputFilterSensitiveLog:$t.filterSensitiveLog,outputFilterSensitiveLog:Vt.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"Logs_20140328.PutLogEvents"},r=JSON.stringify(Fn(e,t)),[2,sr(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o;return me(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,xn(e,t)]:[4,ur(e.body,t)];case 1:return n=i.sent(),{},r=Qn(n,t),o=ge({$metadata:ir(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),Ar=n(20),Or=n(5),kr=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,Lr)},Lr=function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()};for(var Ir=function(){function e(e){var t=(void 0===e?{}:e).requestTimeout;this.requestTimeout=t}return e.prototype.destroy=function(){},e.prototype.handle=function(e,t){var n=(void 0===t?{}:t).abortSignal,r=this.requestTimeout;if(null==n?void 0:n.aborted){var o=new Error("Request aborted");return o.name="AbortError",Promise.reject(o)}var i=e.path;if(e.query){var a=function(e){var t,n,r=[];try{for(var o=Object(mn.__values)(Object.keys(e).sort()),i=o.next();!i.done;i=o.next()){var a=i.value,s=e[a];if(a=kr(a),Array.isArray(s))for(var u=0,c=s.length;u<c;u++)r.push(a+"="+kr(s[u]));else{var f=a;(s||"string"==typeof s)&&(f+="="+kr(s)),r.push(f)}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r.join("&")}(e.query);a&&(i+="?"+a)}var s=e.port,u=e.method,c=e.protocol+"//"+e.hostname+(s?":"+s:"")+i,f={body:"GET"===u||"HEAD"===u?void 0:e.body,headers:new Headers(e.headers),method:u};"undefined"!=typeof AbortController&&(f.signal=n);var l,d=new Request(c,f),h=[fetch(d).then((function(e){var t,n,r=e.headers,o={};try{for(var i=Object(mn.__values)(r.entries()),a=i.next();!a.done;a=i.next()){var s=a.value;o[s[0]]=s[1]}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return void 0!==e.body?{response:new vn({headers:o,statusCode:e.status,body:e.body})}:e.blob().then((function(t){return{response:new vn({headers:o,statusCode:e.status,body:t})}}))})),(l=r,void 0===l&&(l=0),new Promise((function(e,t){l&&setTimeout((function(){var e=new Error("Request did not complete within "+l+" ms");e.name="TimeoutError",t(e)}),l)})))];return n&&h.push(new Promise((function(e,t){n.onabort=function(){var e=new Error("Request aborted");e.name="AbortError",t(e)}}))),Promise.race(h)},e}(),Pr={},Cr=new Array(64),Tr=0,jr="A".charCodeAt(0),Rr="Z".charCodeAt(0);Tr+jr<=Rr;Tr++){var Mr=String.fromCharCode(Tr+jr);Pr[Mr]=Tr,Cr[Tr]=Mr}for(Tr=0,jr="a".charCodeAt(0),Rr="z".charCodeAt(0);Tr+jr<=Rr;Tr++){Mr=String.fromCharCode(Tr+jr);var Nr=Tr+26;Pr[Mr]=Nr,Cr[Nr]=Mr}for(Tr=0;Tr<10;Tr++){Pr[Tr.toString(10)]=Tr+52;Mr=Tr.toString(10),Nr=Tr+52;Pr[Mr]=Nr,Cr[Nr]=Mr}Pr["+"]=62,Cr[62]="+",Pr["/"]=63,Cr[63]="/";function zr(e){var t=e.length/4*3;"=="===e.substr(-2)?t-=2:"="===e.substr(-1)&&t--;for(var n=new ArrayBuffer(t),r=new DataView(n),o=0;o<e.length;o+=4){for(var i=0,a=0,s=o,u=o+3;s<=u;s++)"="!==e[s]?(i|=Pr[e[s]]<<6*(u-s),a+=6):i>>=6;var c=o/4*3;i>>=a%8;for(var f=Math.floor(a/8),l=0;l<f;l++){var d=8*(f-l-1);r.setUint8(c+l,(i&255<<d)>>d)}}return new Uint8Array(n)}function Br(e){for(var t="",n=0;n<e.length;n+=3){for(var r=0,o=0,i=n,a=Math.min(n+3,e.length);i<a;i++)r|=e[i]<<8*(a-i-1),o+=8;var s=Math.ceil(o/6);r<<=6*s-o;for(var u=1;u<=s;u++){var c=6*(s-u);t+=Cr[(r&63<<c)>>c]}t+="==".slice(0,4-s)}return t}var Ur=function(e){return"function"==typeof Blob&&e instanceof Blob?function(e){return Object(mn.__awaiter)(this,void 0,void 0,(function(){var t,n;return Object(mn.__generator)(this,(function(r){switch(r.label){case 0:return[4,Fr(e)];case 1:return t=r.sent(),n=zr(t),[2,new Uint8Array(n)]}}))}))}(e):function(e){return Object(mn.__awaiter)(this,void 0,void 0,(function(){var t,n,r,o,i,a,s;return Object(mn.__generator)(this,(function(u){switch(u.label){case 0:t=new Uint8Array(0),n=e.getReader(),r=!1,u.label=1;case 1:return r?[3,3]:[4,n.read()];case 2:return o=u.sent(),i=o.done,(a=o.value)&&(s=t,(t=new Uint8Array(s.length+a.length)).set(s),t.set(a,s.length)),r=i,[3,1];case 3:return[2,t]}}))}))}(e)};function Fr(e){return new Promise((function(t,n){var r=new FileReader;r.onloadend=function(){var e;if(2!==r.readyState)return n(new Error("Reader aborted too early"));var o=null!==(e=r.result)&&void 0!==e?e:"",i=o.indexOf(","),a=i>-1?i+1:o.length;t(o.substring(a))},r.onabort=function(){return n(new Error("Read aborted"))},r.onerror=function(){return n(r.error)},r.readAsDataURL(e)}))}var Dr=function(e){return function(){return Promise.reject(e)}},qr={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},Gr=function(e){return{applyToStack:function(t){t.add(function(e){return function(t,n){return function(r){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var o;return Object(mn.__generator)(this,(function(i){return(null===(o=null==e?void 0:e.retryStrategy)||void 0===o?void 0:o.mode)&&(n.userAgent=Object(mn.__spread)(n.userAgent||[],[["cfg/retry-mode",e.retryStrategy.mode]])),[2,e.retryStrategy.retry(t,r)]}))}))}}}(e),qr)}}},Hr=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],Wr=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],$r=["AbortError","TimeoutError","RequestTimeout","RequestTimeoutException"],Kr=[500,502,503,504],Vr=function(e){var t,n;return 429===(null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||Wr.includes(e.name)||1==(null===(n=e.$retryable)||void 0===n?void 0:n.throttling)},Yr=n(18),Zr=function(e,t){return Math.floor(Math.min(2e4,Math.random()*Math.pow(2,t)*e))},Jr=function(e){return!!e&&(function(e){return void 0!==e.$retryable}(e)||function(e){return Hr.includes(e.name)}(e)||Vr(e)||function(e){var t;return $r.includes(e.name)||Kr.includes((null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||0)}(e))},Xr=function(){function e(e,t){var n,r,o,i,a,s,u,c;this.maxAttemptsProvider=e,this.mode="standard",this.retryDecider=null!==(n=null==t?void 0:t.retryDecider)&&void 0!==n?n:Jr,this.delayDecider=null!==(r=null==t?void 0:t.delayDecider)&&void 0!==r?r:Zr,this.retryQuota=null!==(o=null==t?void 0:t.retryQuota)&&void 0!==o?o:(a=i=500,s=i,u=function(e){return"TimeoutError"===e.name?10:5},c=function(e){return u(e)<=s},Object.freeze({hasRetryTokens:c,retrieveRetryTokens:function(e){if(!c(e))throw new Error("No retry token available");var t=u(e);return s-=t,t},releaseRetryTokens:function(e){s+=null!=e?e:1,s=Math.min(s,a)}}))}return e.prototype.shouldRetry=function(e,t,n){return t<n&&this.retryDecider(e)&&this.retryQuota.hasRetryTokens(e)},e.prototype.getMaxAttempts=function(){return Object(mn.__awaiter)(this,void 0,void 0,(function(){var e;return Object(mn.__generator)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.maxAttemptsProvider()];case 1:return e=t.sent(),[3,3];case 2:return t.sent(),e=3,[3,3];case 3:return[2,e]}}))}))},e.prototype.retry=function(e,t){return Object(mn.__awaiter)(this,void 0,void 0,(function(){var n,r,o,i,a,s,u,c;return Object(mn.__generator)(this,(function(f){switch(f.label){case 0:return r=0,o=0,[4,this.getMaxAttempts()];case 1:i=f.sent(),a=t.request,yn.isInstance(a)&&(a.headers["amz-sdk-invocation-id"]=Object(Yr.v4)()),s=function(){var s,c,f,l,d;return Object(mn.__generator)(this,(function(h){switch(h.label){case 0:return h.trys.push([0,2,,5]),yn.isInstance(a)&&(a.headers["amz-sdk-request"]="attempt="+(r+1)+"; max="+i),[4,e(t)];case 1:return s=h.sent(),c=s.response,f=s.output,u.retryQuota.releaseRetryTokens(n),f.$metadata.attempts=r+1,f.$metadata.totalRetryDelay=o,[2,{value:{response:c,output:f}}];case 2:return l=h.sent(),r++,u.shouldRetry(l,r,i)?(n=u.retryQuota.retrieveRetryTokens(l),d=u.delayDecider(Vr(l)?500:100,r),o+=d,[4,new Promise((function(e){return setTimeout(e,d)}))]):[3,4];case 3:return h.sent(),[2,"continue"];case 4:throw l.$metadata||(l.$metadata={}),l.$metadata.attempts=r,l.$metadata.totalRetryDelay=o,l;case 5:return[2]}}))},u=this,f.label=2;case 2:return[5,s()];case 3:return"object"==typeof(c=f.sent())?[2,c.value]:[3,2];case 4:return[2]}}))}))},e}(),Qr=function(e){var t=eo(e.maxAttempts);return Object(mn.__assign)(Object(mn.__assign)({},e),{maxAttempts:t,retryStrategy:e.retryStrategy||new Xr(t)})},eo=function(e){if(void 0===e&&(e=3),"number"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e};function to(e){if("string"==typeof e){for(var t=e.length,n=t-1;n>=0;n--){var r=e.charCodeAt(n);r>127&&r<=2047?t++:r>2047&&r<=65535&&(t+=2)}return t}return"number"==typeof e.byteLength?e.byteLength:"number"==typeof e.size?e.size:void 0}var no=n(19),ro=n.n(no),oo=function(e){var t=e.serviceId,n=e.clientVersion;return function(){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var e,r,o,i,a,s,u,c,f;return Object(mn.__generator)(this,(function(l){return e=(null===(o=null===window||void 0===window?void 0:window.navigator)||void 0===o?void 0:o.userAgent)?ro.a.parse(window.navigator.userAgent):void 0,r=[["aws-sdk-js",n],["os/"+((null===(i=null==e?void 0:e.os)||void 0===i?void 0:i.name)||"other"),null===(a=null==e?void 0:e.os)||void 0===a?void 0:a.version],["lang/js"],["md/browser",(null!==(u=null===(s=null==e?void 0:e.browser)||void 0===s?void 0:s.name)&&void 0!==u?u:"unknown")+"_"+(null!==(f=null===(c=null==e?void 0:e.browser)||void 0===c?void 0:c.version)&&void 0!==f?f:"unknown")]],t&&r.push(["api/"+t,n]),[2,r]}))}))}};var io=function(e){return"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):function(e){for(var t=[],n=0,r=e.length;n<r;n++){var o=e.charCodeAt(n);if(o<128)t.push(o);else if(o<2048)t.push(o>>6|192,63&o|128);else if(n+1<e.length&&55296==(64512&o)&&56320==(64512&e.charCodeAt(n+1))){var i=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n));t.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}else t.push(o>>12|224,o>>6&63|128,63&o|128)}return Uint8Array.from(t)}(e)},ao=function(e){return"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):function(e){for(var t="",n=0,r=e.length;n<r;n++){var o=e[n];if(o<128)t+=String.fromCharCode(o);else if(192<=o&&o<224){var i=e[++n];t+=String.fromCharCode((31&o)<<6|63&i)}else if(240<=o&&o<365){var a="%"+[o,e[++n],e[++n],e[++n]].map((function(e){return e.toString(16)})).join("%");t+=decodeURIComponent(a)}else t+=String.fromCharCode((15&o)<<12|(63&e[++n])<<6|63&e[++n])}return t}(e)},so=new Set(["af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-south-1","ap-southeast-1","ap-southeast-2","ca-central-1","eu-central-1","eu-north-1","eu-south-1","eu-west-1","eu-west-2","eu-west-3","me-south-1","sa-east-1","us-east-1","us-east-2","us-west-1","us-west-2"]),uo=new Set(["cn-north-1","cn-northwest-1"]),co=new Set(["us-iso-east-1"]),fo=new Set(["us-isob-east-1"]),lo=new Set(["us-gov-east-1","us-gov-west-1"]);var ho=function(e){var t,n=new URL(e),r=n.hostname,o=n.pathname,i=n.port,a=n.protocol,s=n.search;return s&&(t=function(e){var t,n,r={};if(e=e.replace(/^\?/,""))try{for(var o=Object(mn.__values)(e.split("&")),i=o.next();!i.done;i=o.next()){var a=i.value,s=Object(mn.__read)(a.split("="),2),u=s[0],c=s[1],f=void 0===c?null:c;u=decodeURIComponent(u),f&&(f=decodeURIComponent(f)),u in r?Array.isArray(r[u])?r[u].push(f):r[u]=[r[u],f]:r[u]=f}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r}(s)),{hostname:r,port:i?parseInt(i):void 0,protocol:a,path:o,query:t}},po={apiVersion:"2014-03-28",disableHostPrefix:!1,logger:{},regionInfoProvider:function(e,t){var n=void 0;switch(e){case"af-south-1":n={hostname:"logs.af-south-1.amazonaws.com",partition:"aws"};break;case"ap-east-1":n={hostname:"logs.ap-east-1.amazonaws.com",partition:"aws"};break;case"ap-northeast-1":n={hostname:"logs.ap-northeast-1.amazonaws.com",partition:"aws"};break;case"ap-northeast-2":n={hostname:"logs.ap-northeast-2.amazonaws.com",partition:"aws"};break;case"ap-south-1":n={hostname:"logs.ap-south-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-1":n={hostname:"logs.ap-southeast-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-2":n={hostname:"logs.ap-southeast-2.amazonaws.com",partition:"aws"};break;case"ca-central-1":n={hostname:"logs.ca-central-1.amazonaws.com",partition:"aws"};break;case"cn-north-1":n={hostname:"logs.cn-north-1.amazonaws.com.cn",partition:"aws-cn"};break;case"cn-northwest-1":n={hostname:"logs.cn-northwest-1.amazonaws.com.cn",partition:"aws-cn"};break;case"eu-central-1":n={hostname:"logs.eu-central-1.amazonaws.com",partition:"aws"};break;case"eu-north-1":n={hostname:"logs.eu-north-1.amazonaws.com",partition:"aws"};break;case"eu-south-1":n={hostname:"logs.eu-south-1.amazonaws.com",partition:"aws"};break;case"eu-west-1":n={hostname:"logs.eu-west-1.amazonaws.com",partition:"aws"};break;case"eu-west-2":n={hostname:"logs.eu-west-2.amazonaws.com",partition:"aws"};break;case"eu-west-3":n={hostname:"logs.eu-west-3.amazonaws.com",partition:"aws"};break;case"fips-us-east-1":n={hostname:"logs-fips.us-east-1.amazonaws.com",partition:"aws",signingRegion:"us-east-1"};break;case"fips-us-east-2":n={hostname:"logs-fips.us-east-2.amazonaws.com",partition:"aws",signingRegion:"us-east-2"};break;case"fips-us-west-1":n={hostname:"logs-fips.us-west-1.amazonaws.com",partition:"aws",signingRegion:"us-west-1"};break;case"fips-us-west-2":n={hostname:"logs-fips.us-west-2.amazonaws.com",partition:"aws",signingRegion:"us-west-2"};break;case"me-south-1":n={hostname:"logs.me-south-1.amazonaws.com",partition:"aws"};break;case"sa-east-1":n={hostname:"logs.sa-east-1.amazonaws.com",partition:"aws"};break;case"us-east-1":n={hostname:"logs.us-east-1.amazonaws.com",partition:"aws"};break;case"us-east-2":n={hostname:"logs.us-east-2.amazonaws.com",partition:"aws"};break;case"us-gov-east-1":n={hostname:"logs.us-gov-east-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-east-1"};break;case"us-gov-west-1":n={hostname:"logs.us-gov-west-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-west-1"};break;case"us-iso-east-1":n={hostname:"logs.us-iso-east-1.c2s.ic.gov",partition:"aws-iso"};break;case"us-isob-east-1":n={hostname:"logs.us-isob-east-1.sc2s.sgov.gov",partition:"aws-iso-b"};break;case"us-west-1":n={hostname:"logs.us-west-1.amazonaws.com",partition:"aws"};break;case"us-west-2":n={hostname:"logs.us-west-2.amazonaws.com",partition:"aws"};break;default:so.has(e)&&(n={hostname:"logs.{region}.amazonaws.com".replace("{region}",e),partition:"aws"}),uo.has(e)&&(n={hostname:"logs.{region}.amazonaws.com.cn".replace("{region}",e),partition:"aws-cn"}),co.has(e)&&(n={hostname:"logs.{region}.c2s.ic.gov".replace("{region}",e),partition:"aws-iso"}),fo.has(e)&&(n={hostname:"logs.{region}.sc2s.sgov.gov".replace("{region}",e),partition:"aws-iso-b"}),lo.has(e)&&(n={hostname:"logs.{region}.amazonaws.com".replace("{region}",e),partition:"aws-us-gov"}),void 0===n&&(n={hostname:"logs.{region}.amazonaws.com".replace("{region}",e),partition:"aws"})}return Promise.resolve(ge({signingService:"logs"},n))},serviceId:"CloudWatch Logs",urlParser:ho},go=ge(ge({},po),{runtime:"browser",base64Decoder:zr,base64Encoder:Br,bodyLengthChecker:to,credentialDefaultProvider:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:oo({serviceId:po.serviceId,clientVersion:Ar.version}),maxAttempts:3,region:Dr("Region is missing"),requestHandler:new Ir,sha256:Or.Sha256,streamCollector:Ur,utf8Decoder:io,utf8Encoder:ao}),vo=function(e){var t;return Object(mn.__assign)(Object(mn.__assign)({},e),{tls:null===(t=e.tls)||void 0===t||t,endpoint:e.endpoint?mo(e):function(){return yo(e)},isCustomEndpoint:!!e.endpoint})},mo=function(e){var t=e.endpoint,n=e.urlParser;if("string"==typeof t){var r=Promise.resolve(n(t));return function(){return r}}if("object"==typeof t){var o=Promise.resolve(t);return function(){return o}}return t},yo=function(e){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var t,n,r,o,i;return Object(mn.__generator)(this,(function(a){switch(a.label){case 0:return t=e.tls,n=void 0===t||t,[4,e.region()];case 1:if(r=a.sent(),!new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/).test(r))throw new Error("Invalid region in client config");return[4,e.regionInfoProvider(r)];case 2:if(!(o=(null!==(i=a.sent())&&void 0!==i?i:{}).hostname))throw new Error("Cannot resolve hostname from client config");return[2,e.urlParser((n?"https:":"http:")+"//"+o)]}}))}))},bo=function(e){if(!e.region)throw new Error("Region is missing");return Object(mn.__assign)(Object(mn.__assign)({},e),{region:wo(e.region)})},wo=function(e){if("string"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e};var _o={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},So=function(e){return{applyToStack:function(t){t.add(function(e){var t=this;return function(n){return function(r){return Object(mn.__awaiter)(t,void 0,void 0,(function(){var t,o,i,a,s;return Object(mn.__generator)(this,(function(u){return t=r.request,yn.isInstance(t)&&(o=t.body,i=t.headers,o&&-1===Object.keys(i).map((function(e){return e.toLowerCase()})).indexOf("content-length")&&void 0!==(a=e(o))&&(t.headers=Object(mn.__assign)(Object(mn.__assign)({},t.headers),((s={})["content-length"]=String(a),s)))),[2,n(Object(mn.__assign)(Object(mn.__assign)({},r),{request:t}))]}))}))}}}(e.bodyLengthChecker),_o)}}};for(var Eo={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},xo=function(e){return{applyToStack:function(t){t.add(function(e){return function(t){return function(n){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var r,o;return Object(mn.__generator)(this,(function(i){return yn.isInstance(n.request)?(r=n.request,o=(e.requestHandler.metadata||{}).handlerProtocol,(void 0===o?"":o).indexOf("h2")>=0&&!r.headers[":authority"]?(delete r.headers.host,r.headers[":authority"]=""):r.headers.host||(r.headers.host=r.hostname),[2,t(n)]):[2,t(n)]}))}))}}}(e),Eo)}}},Ao={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},Oo=function(e){return{applyToStack:function(e){e.add((function(e,t){return function(n){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var r,o,i,a,s,u,c,f,l;return Object(mn.__generator)(this,(function(d){switch(d.label){case 0:return r=t.clientName,o=t.commandName,i=t.inputFilterSensitiveLog,a=t.logger,s=t.outputFilterSensitiveLog,[4,e(n)];case 1:return u=d.sent(),a?("function"==typeof a.info&&(c=u.output,f=c.$metadata,l=Object(mn.__rest)(c,["$metadata"]),a.info({clientName:r,commandName:o,input:i(n.input),output:s(l),metadata:f})),[2,u]):[2,u]}}))}))}}),Ao)}}},ko={},Lo={},Io=0;Io<256;Io++){var Po=Io.toString(16).toLowerCase();1===Po.length&&(Po="0"+Po),ko[Io]=Po,Lo[Po]=Io}function Co(e){for(var t="",n=0;n<e.byteLength;n++)t+=ko[e[n]];return t}var To="X-Amz-Date".toLowerCase(),jo=["authorization",To,"date"],Ro="X-Amz-Signature".toLowerCase(),Mo="X-Amz-Security-Token".toLowerCase(),No={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},zo=/^proxy-/,Bo=/^sec-/,Uo="AWS4-HMAC-SHA256-PAYLOAD",Fo={},Do=[];function qo(e,t,n){return e+"/"+t+"/"+n+"/aws4_request"}function Go(e,t,n){var r=new e(t);return r.update(n),r.digest()}function Ho(e,t,n){var r,o,i=e.headers,a={};try{for(var s=Object(mn.__values)(Object.keys(i).sort()),u=s.next();!u.done;u=s.next()){var c=u.value,f=c.toLowerCase();(f in No||(null==t?void 0:t.has(f))||zo.test(f)||Bo.test(f))&&(!n||n&&!n.has(f))||(a[f]=i[c].trim().replace(/\s+/g," "))}}catch(e){r={error:e}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return a}var Wo=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,$o)},$o=function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()};function Ko(e,t){var n=e.headers,r=e.body;return Object(mn.__awaiter)(this,void 0,void 0,(function(){var e,o,i,a,s,u,c;return Object(mn.__generator)(this,(function(f){switch(f.label){case 0:try{for(e=Object(mn.__values)(Object.keys(n)),o=e.next();!o.done;o=e.next())if("x-amz-content-sha256"===(i=o.value).toLowerCase())return[2,n[i]]}catch(e){u={error:e}}finally{try{o&&!o.done&&(c=e.return)&&c.call(e)}finally{if(u)throw u.error}}return null!=r?[3,1]:[2,"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"];case 1:return"string"==typeof r||ArrayBuffer.isView(r)||(l=r,"function"==typeof ArrayBuffer&&l instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(l))?((a=new t).update(r),s=Co,[4,a.digest()]):[3,3];case 2:return[2,s.apply(void 0,[f.sent()])];case 3:return[2,"UNSIGNED-PAYLOAD"]}var l}))}))}function Vo(e){var t=e.headers,n=e.query,r=Object(mn.__rest)(e,["headers","query"]);return Object(mn.__assign)(Object(mn.__assign)({},r),{headers:Object(mn.__assign)({},t),query:n?Yo(n):void 0})}function Yo(e){return Object.keys(e).reduce((function(t,n){var r,o=e[n];return Object(mn.__assign)(Object(mn.__assign)({},t),((r={})[n]=Array.isArray(o)?Object(mn.__spread)(o):o,r))}),{})}function Zo(e){var t,n;e="function"==typeof e.clone?e.clone():Vo(e);try{for(var r=Object(mn.__values)(Object.keys(e.headers)),o=r.next();!o.done;o=r.next()){var i=o.value;jo.indexOf(i.toLowerCase())>-1&&delete e.headers[i]}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return e}function Jo(e){return function(e){if("number"==typeof e)return new Date(1e3*e);if("string"==typeof e)return Number(e)?new Date(1e3*Number(e)):new Date(e);return e}(e).toISOString().replace(/\.\d{3}Z$/,"Z")}var Xo=function(){function e(e){var t=e.applyChecksum,n=e.credentials,r=e.region,o=e.service,i=e.sha256,a=e.uriEscapePath,s=void 0===a||a;this.service=o,this.sha256=i,this.uriEscapePath=s,this.applyChecksum="boolean"!=typeof t||t,this.regionProvider=ti(r),this.credentialProvider=ni(n)}return e.prototype.presign=function(e,t){return void 0===t&&(t={}),Object(mn.__awaiter)(this,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h,p,g,v,m,y,b,w,_,S,E,x,A;return Object(mn.__generator)(this,(function(O){switch(O.label){case 0:return n=t.signingDate,r=void 0===n?new Date:n,o=t.expiresIn,i=void 0===o?3600:o,a=t.unsignableHeaders,s=t.unhoistableHeaders,u=t.signableHeaders,c=t.signingRegion,f=t.signingService,[4,this.credentialProvider()];case 1:return l=O.sent(),null==c?[3,2]:(h=c,[3,4]);case 2:return[4,this.regionProvider()];case 3:h=O.sent(),O.label=4;case 4:return d=h,p=Qo(r),g=p.longDate,v=p.shortDate,i>604800?[2,Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future")]:(m=qo(v,d,null!=f?f:this.service),y=function(e,t){var n,r,o;void 0===t&&(t={});var i="function"==typeof e.clone?e.clone():Vo(e),a=i.headers,s=i.query,u=void 0===s?{}:s;try{for(var c=Object(mn.__values)(Object.keys(a)),f=c.next();!f.done;f=c.next()){var l=f.value,d=l.toLowerCase();"x-amz-"!==d.substr(0,6)||(null===(o=t.unhoistableHeaders)||void 0===o?void 0:o.has(d))||(u[l]=a[l],delete a[l])}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return Object(mn.__assign)(Object(mn.__assign)({},e),{headers:a,query:u})}(Zo(e),{unhoistableHeaders:s}),l.sessionToken&&(y.query["X-Amz-Security-Token"]=l.sessionToken),y.query["X-Amz-Algorithm"]="AWS4-HMAC-SHA256",y.query["X-Amz-Credential"]=l.accessKeyId+"/"+m,y.query["X-Amz-Date"]=g,y.query["X-Amz-Expires"]=i.toString(10),b=Ho(y,a,u),y.query["X-Amz-SignedHeaders"]=ei(b),w=y.query,_="X-Amz-Signature",S=this.getSignature,E=[g,m,this.getSigningKey(l,d,v,f)],x=this.createCanonicalRequest,A=[y,b],[4,Ko(e,this.sha256)]);case 5:return[4,S.apply(this,E.concat([x.apply(this,A.concat([O.sent()]))]))];case 6:return w[_]=O.sent(),[2,y]}}))}))},e.prototype.sign=function(e,t){return Object(mn.__awaiter)(this,void 0,void 0,(function(){return Object(mn.__generator)(this,(function(n){return"string"==typeof e?[2,this.signString(e,t)]:e.headers&&e.payload?[2,this.signEvent(e,t)]:[2,this.signRequest(e,t)]}))}))},e.prototype.signEvent=function(e,t){var n=e.headers,r=e.payload,o=t.signingDate,i=void 0===o?new Date:o,a=t.priorSignature,s=t.signingRegion,u=t.signingService;return Object(mn.__awaiter)(this,void 0,void 0,(function(){var e,t,o,c,f,l,d,h,p,g,v;return Object(mn.__generator)(this,(function(m){switch(m.label){case 0:return null==s?[3,1]:(t=s,[3,3]);case 1:return[4,this.regionProvider()];case 2:t=m.sent(),m.label=3;case 3:return e=t,o=Qo(i),c=o.shortDate,f=o.longDate,l=qo(c,e,null!=u?u:this.service),[4,Ko({headers:{},body:r},this.sha256)];case 4:return d=m.sent(),(h=new this.sha256).update(n),g=Co,[4,h.digest()];case 5:return p=g.apply(void 0,[m.sent()]),v=[Uo,f,l,a,p,d].join("\n"),[2,this.signString(v,{signingDate:i,signingRegion:e,signingService:u})]}}))}))},e.prototype.signString=function(e,t){var n=void 0===t?{}:t,r=n.signingDate,o=void 0===r?new Date:r,i=n.signingRegion,a=n.signingService;return Object(mn.__awaiter)(this,void 0,void 0,(function(){var t,n,r,s,u,c,f,l;return Object(mn.__generator)(this,(function(d){switch(d.label){case 0:return[4,this.credentialProvider()];case 1:return t=d.sent(),null==i?[3,2]:(r=i,[3,4]);case 2:return[4,this.regionProvider()];case 3:r=d.sent(),d.label=4;case 4:return n=r,s=Qo(o).shortDate,f=(c=this.sha256).bind,[4,this.getSigningKey(t,n,s,a)];case 5:return(u=new(f.apply(c,[void 0,d.sent()]))).update(e),l=Co,[4,u.digest()];case 6:return[2,l.apply(void 0,[d.sent()])]}}))}))},e.prototype.signRequest=function(e,t){var n=void 0===t?{}:t,r=n.signingDate,o=void 0===r?new Date:r,i=n.signableHeaders,a=n.unsignableHeaders,s=n.signingRegion,u=n.signingService;return Object(mn.__awaiter)(this,void 0,void 0,(function(){var t,n,r,c,f,l,d,h,p,g,v;return Object(mn.__generator)(this,(function(m){switch(m.label){case 0:return[4,this.credentialProvider()];case 1:return t=m.sent(),null==s?[3,2]:(r=s,[3,4]);case 2:return[4,this.regionProvider()];case 3:r=m.sent(),m.label=4;case 4:return n=r,c=Zo(e),f=Qo(o),l=f.longDate,d=f.shortDate,h=qo(d,n,null!=u?u:this.service),c.headers[To]=l,t.sessionToken&&(c.headers[Mo]=t.sessionToken),[4,Ko(c,this.sha256)];case 5:return p=m.sent(),!function(e,t){var n,r;e=e.toLowerCase();try{for(var o=Object(mn.__values)(Object.keys(t)),i=o.next();!i.done;i=o.next()){if(e===i.value.toLowerCase())return!0}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!1}("x-amz-content-sha256",c.headers)&&this.applyChecksum&&(c.headers["x-amz-content-sha256"]=p),g=Ho(c,a,i),[4,this.getSignature(l,h,this.getSigningKey(t,n,d,u),this.createCanonicalRequest(c,g,p))];case 6:return v=m.sent(),c.headers.authorization="AWS4-HMAC-SHA256 Credential="+t.accessKeyId+"/"+h+", SignedHeaders="+ei(g)+", Signature="+v,[2,c]}}))}))},e.prototype.createCanonicalRequest=function(e,t,n){var r=Object.keys(t).sort();return e.method+"\n"+this.getCanonicalPath(e)+"\n"+function(e){var t,n,r=e.query,o=void 0===r?{}:r,i=[],a={},s=function(e){if(e.toLowerCase()===Ro)return"continue";i.push(e);var t=o[e];"string"==typeof t?a[e]=Wo(e)+"="+Wo(t):Array.isArray(t)&&(a[e]=t.slice(0).sort().reduce((function(t,n){return t.concat([Wo(e)+"="+Wo(n)])}),[]).join("&"))};try{for(var u=Object(mn.__values)(Object.keys(o).sort()),c=u.next();!c.done;c=u.next()){s(c.value)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}return i.map((function(e){return a[e]})).filter((function(e){return e})).join("&")}(e)+"\n"+r.map((function(e){return e+":"+t[e]})).join("\n")+"\n\n"+r.join(";")+"\n"+n},e.prototype.createStringToSign=function(e,t,n){return Object(mn.__awaiter)(this,void 0,void 0,(function(){var r,o;return Object(mn.__generator)(this,(function(i){switch(i.label){case 0:return(r=new this.sha256).update(n),[4,r.digest()];case 1:return o=i.sent(),[2,"AWS4-HMAC-SHA256\n"+e+"\n"+t+"\n"+Co(o)]}}))}))},e.prototype.getCanonicalPath=function(e){var t=e.path;return this.uriEscapePath?"/"+encodeURIComponent(t.replace(/^\//,"")).replace(/%2F/g,"/"):t},e.prototype.getSignature=function(e,t,n,r){return Object(mn.__awaiter)(this,void 0,void 0,(function(){var o,i,a,s,u;return Object(mn.__generator)(this,(function(c){switch(c.label){case 0:return[4,this.createStringToSign(e,t,r)];case 1:return o=c.sent(),s=(a=this.sha256).bind,[4,n];case 2:return(i=new(s.apply(a,[void 0,c.sent()]))).update(o),u=Co,[4,i.digest()];case 3:return[2,u.apply(void 0,[c.sent()])]}}))}))},e.prototype.getSigningKey=function(e,t,n,r){return function(e,t,n,r,o){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var i,a,s,u,c,f,l,d,h;return Object(mn.__generator)(this,(function(p){switch(p.label){case 0:return[4,Go(e,t.secretAccessKey,t.accessKeyId)];case 1:if(i=p.sent(),(a=n+":"+r+":"+o+":"+Co(i)+":"+t.sessionToken)in Fo)return[2,Fo[a]];for(Do.push(a);Do.length>50;)delete Fo[Do.shift()];s="AWS4"+t.secretAccessKey,p.label=2;case 2:p.trys.push([2,7,8,9]),u=Object(mn.__values)([n,r,o,"aws4_request"]),c=u.next(),p.label=3;case 3:return c.done?[3,6]:(f=c.value,[4,Go(e,s,f)]);case 4:s=p.sent(),p.label=5;case 5:return c=u.next(),[3,3];case 6:return[3,9];case 7:return l=p.sent(),d={error:l},[3,9];case 8:try{c&&!c.done&&(h=u.return)&&h.call(u)}finally{if(d)throw d.error}return[7];case 9:return[2,Fo[a]=s]}}))}))}(this.sha256,e,n,t,r||this.service)},e}(),Qo=function(e){var t=Jo(e).replace(/[\-:]/g,"");return{longDate:t,shortDate:t.substr(0,8)}},ei=function(e){return Object.keys(e).sort().join(";")},ti=function(e){if("string"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e},ni=function(e){if("object"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e};function ri(e){var t,n=this,r=oi(e.credentials||e.credentialDefaultProvider(e)),o=e.signingEscapePath,i=void 0===o||o,a=e.systemClockOffset,s=void 0===a?e.systemClockOffset||0:a,u=e.sha256;return t=e.signer?oi(e.signer):function(){return oi(e.region)().then((function(t){return Object(mn.__awaiter)(n,void 0,void 0,(function(){return Object(mn.__generator)(this,(function(n){switch(n.label){case 0:return[4,e.regionInfoProvider(t)];case 1:return[2,[n.sent()||{},t]]}}))}))})).then((function(t){var n=Object(mn.__read)(t,2),o=n[0],a=n[1],s=o.signingRegion,c=o.signingService;return e.signingRegion=e.signingRegion||s||a,e.signingName=e.signingName||c||e.serviceId,new Xo({credentials:r,region:e.signingRegion,service:e.signingName,sha256:u,uriEscapePath:i})}))},Object(mn.__assign)(Object(mn.__assign)({},e),{systemClockOffset:s,signingEscapePath:i,credentials:r,signer:t})}function oi(e){if("object"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e}var ii=function(e){return new Date(Date.now()+e)};function ai(e){return function(t,n){return function(r){return Object(mn.__awaiter)(this,void 0,void 0,(function(){var o,i,a,s,u,c,f,l,d;return Object(mn.__generator)(this,(function(h){switch(h.label){case 0:return yn.isInstance(r.request)?"function"!=typeof e.signer?[3,2]:[4,e.signer()]:[2,t(r)];case 1:return i=h.sent(),[3,3];case 2:i=e.signer,h.label=3;case 3:return o=i,s=t,u=[Object(mn.__assign)({},r)],d={},[4,o.sign(r.request,{signingDate:new Date(Date.now()+e.systemClockOffset),signingRegion:n.signing_region,signingService:n.signing_service})];case 4:return[4,s.apply(void 0,[mn.__assign.apply(void 0,u.concat([(d.request=h.sent(),d)]))])];case 5:return a=h.sent(),c=a.response.headers,(f=c&&(c.date||c.Date))&&(l=Date.parse(f),p=l,g=e.systemClockOffset,Math.abs(ii(g).getTime()-p)>=3e5&&(e.systemClockOffset=l-Date.now())),[2,a]}var p,g}))}))}}}var si={name:"awsAuthMiddleware",tags:["SIGNATURE","AWSAUTH"],relation:"after",toMiddleware:"retryMiddleware",override:!0};function ui(e){return Object(mn.__assign)(Object(mn.__assign)({},e),{customUserAgent:"string"==typeof e.customUserAgent?[[e.customUserAgent]]:e.customUserAgent})}var ci=/[^\!\#\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,fi=function(e){var t=Object(mn.__read)(e,2),n=t[0],r=t[1],o=n.indexOf("/"),i=n.substring(0,o),a=n.substring(o+1);return"api"===i&&(a=a.toLowerCase()),[i,a,r].filter((function(e){return e&&e.length>0})).map((function(e){return null==e?void 0:e.replace(ci,"_")})).join("/")},li={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},di=function(e){return{applyToStack:function(t){var n;t.add((n=e,function(e,t){return function(r){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var o,i,a,s,u,c,f,l;return Object(mn.__generator)(this,(function(d){switch(d.label){case 0:return o=r.request,yn.isInstance(o)?(i=o.headers,a=(null===(f=null==t?void 0:t.userAgent)||void 0===f?void 0:f.map(fi))||[],[4,n.defaultUserAgentProvider()]):[2,e(r)];case 1:return s=d.sent().map(fi),u=(null===(l=null==n?void 0:n.customUserAgent)||void 0===l?void 0:l.map(fi))||[],i["x-amz-user-agent"]=Object(mn.__spread)(s,a,u).join(" "),c=Object(mn.__spread)(s.filter((function(e){return e.startsWith("aws-sdk-")})),u).join(" "),"browser"!==n.runtime&&c&&(i["user-agent"]=i["user-agent"]?i["user-agent"]+" "+c:c),[2,e(Object(mn.__assign)(Object(mn.__assign)({},r),{request:o}))]}}))}))}}),li)}}},hi=function(e){function t(t){var n,r=this,o=ge(ge({},go),t),i=bo(o),a=ri(vo(i)),s=ui(Qr(a));return(r=e.call(this,s)||this).config=s,r.middlewareStack.use((n=r.config,{applyToStack:function(e){e.addRelativeTo(ai(n),si)}})),r.middlewareStack.use(Gr(r.config)),r.middlewareStack.use(So(r.config)),r.middlewareStack.use(xo(r.config)),r.middlewareStack.use(Oo(r.config)),r.middlewareStack.use(di(r.config)),r}return pe(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(vr),pi={},gi=function(){function e(){}return e.setItem=function(e,t){return pi[e]=t,pi[e]},e.getItem=function(e){return Object.prototype.hasOwnProperty.call(pi,e)?pi[e]:void 0},e.removeItem=function(e){return delete pi[e]},e.clear=function(){return pi={}},e}(),vi=function(){function e(){try{this.storageWindow=window.localStorage,this.storageWindow.setItem("aws.amplify.test-ls",1),this.storageWindow.removeItem("aws.amplify.test-ls")}catch(e){this.storageWindow=gi}}return e.prototype.getStorage=function(){return this.storageWindow},e}();function mi(e){return(mi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var yi,bi=(yi=function(e,t){return(yi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}yi(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),wi=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},_i=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Si=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Ei=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Si(arguments[t]));return e},xi=new g("Util"),Ai=function(e){function t(t){var n=e.call(this,t)||this;return n.nonRetryable=!0,n}return bi(t,e),t}(Error);function Oi(e,t,n,r){return wi(this,void 0,void 0,(function(){var o=this;return _i(this,(function(i){if("function"!=typeof e)throw Error("functionToRetry must be a function");return[2,new Promise((function(i,a){return wi(o,void 0,void 0,(function(){var o,s,u,c,f,l,d;return _i(this,(function(h){switch(h.label){case 0:o=0,s=!1,c=function(){},r&&r.then((function(){s=!0,clearTimeout(u),c()})),l=function(){var r,l,d,h;return _i(this,(function(p){switch(p.label){case 0:o++,xi.debug(e.name+" attempt #"+o+" with this vars: "+JSON.stringify(t)),p.label=1;case 1:return p.trys.push([1,3,,7]),r={},l=i,[4,e.apply(void 0,Ei(t))];case 2:return[2,(r.value=l.apply(void 0,[p.sent()]),r)];case 3:return d=p.sent(),f=d,xi.debug("error on "+e.name,d),(g=d)&&g.nonRetryable?(xi.debug(e.name+" non retryable error",d),[2,{value:a(d)}]):(h=n(o,t,d),xi.debug(e.name+" retrying in "+h+" ms"),!1===h||s?[2,{value:a(d)}]:[3,4]);case 4:return[4,new Promise((function(e){c=e,u=setTimeout(c,h)}))];case 5:p.sent(),p.label=6;case 6:return[3,7];case 7:return[2]}var g}))},h.label=1;case 1:return s?[3,3]:[5,l()];case 2:return"object"===mi(d=h.sent())?[2,d.value]:[3,1];case 3:return a(f),[2]}}))}))}))]}))}))}function ki(e){void 0===e&&(e=3e5);return function(t){var n=100*Math.pow(2,t)+100*Math.random();return!(n>e)&&n}}var Li=function(e,t,n,r){return void 0===n&&(n=3e5),Oi(e,t,ki(n),r)},Ii=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Pi=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Ci=new g("CognitoCredentials"),Ti=new Promise((function(e,t){return Object(U.b)().isBrowser?(window.gapi&&window.gapi.auth2?window.gapi.auth2:null)?(Ci.debug("google api already loaded"),e()):void setTimeout((function(){return e()}),2e3):(Ci.debug("not in the browser, directly resolved"),e())})),ji=function(){function e(){this.initialized=!1,this.refreshGoogleToken=this.refreshGoogleToken.bind(this),this._refreshGoogleTokenImpl=this._refreshGoogleTokenImpl.bind(this)}return e.prototype.refreshGoogleToken=function(){return Ii(this,void 0,void 0,(function(){return Pi(this,(function(e){switch(e.label){case 0:return this.initialized?[3,2]:(Ci.debug("need to wait for the Google SDK loaded"),[4,Ti]);case 1:e.sent(),this.initialized=!0,Ci.debug("finish waiting"),e.label=2;case 2:return[2,this._refreshGoogleTokenImpl()]}}))}))},e.prototype._refreshGoogleTokenImpl=function(){var e=null;return Object(U.b)().isBrowser&&(e=window.gapi&&window.gapi.auth2?window.gapi.auth2:null),e?new Promise((function(t,n){e.getAuthInstance().then((function(e){e||(Ci.debug("google Auth undefined"),n(new Ai("google Auth undefined")));var r=e.currentUser.get();r.isSignedIn()?(Ci.debug("refreshing the google access token"),r.reloadAuthResponse().then((function(e){var n=e.id_token,r=e.expires_at;t({token:n,expires_at:r})})).catch((function(e){e&&"network_error"===e.error?n("Network error reloading google auth response"):n(new Ai("Failed to reload google auth response"))}))):n(new Ai("User is not signed in with Google"))})).catch((function(e){Ci.debug("Failed to refresh google token",e),n(new Ai("Failed to refresh google token"))}))})):(Ci.debug("no gapi auth2 available"),Promise.reject("no gapi auth2 available"))},e}(),Ri=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Mi=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Ni=new g("CognitoCredentials"),zi=new Promise((function(e,t){return Object(U.b)().isBrowser?window.FB?(Ni.debug("FB SDK already loaded"),e()):void setTimeout((function(){return e()}),2e3):(Ni.debug("not in the browser, directly resolved"),e())})),Bi=function(){function e(){this.initialized=!1,this.refreshFacebookToken=this.refreshFacebookToken.bind(this),this._refreshFacebookTokenImpl=this._refreshFacebookTokenImpl.bind(this)}return e.prototype.refreshFacebookToken=function(){return Ri(this,void 0,void 0,(function(){return Mi(this,(function(e){switch(e.label){case 0:return this.initialized?[3,2]:(Ni.debug("need to wait for the Facebook SDK loaded"),[4,zi]);case 1:e.sent(),this.initialized=!0,Ni.debug("finish waiting"),e.label=2;case 2:return[2,this._refreshFacebookTokenImpl()]}}))}))},e.prototype._refreshFacebookTokenImpl=function(){var e=null;if(Object(U.b)().isBrowser&&(e=window.FB),!e){return Ni.debug("no fb sdk available"),Promise.reject(new Ai("no fb sdk available"))}return new Promise((function(t,n){e.getLoginStatus((function(e){if(e&&e.authResponse){var r=e.authResponse,o=r.accessToken,i=1e3*r.expiresIn+(new Date).getTime();if(!o){a="the jwtToken is undefined";Ni.debug(a),n(new Ai(a))}t({token:o,expires_at:i})}else{var a="no response from facebook when refreshing the jwt token";Ni.debug(a),n(new Ai(a))}}),{scope:"public_profile,email"})}))},e}(),Ui=new ji,Fi=new Bi,Di=function(e,t){return(Di=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function qi(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Di(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Gi=function(){return(Gi=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function Hi(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function Wi(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}Object.create;function $i(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}var Ki,Vi,Yi,Zi,Ji,Xi,Qi,ea,ta,na,ra,oa,ia,aa,sa,ua,ca,fa,la,da,ha,pa,ga,va,ma,ya,ba,wa,_a,Sa,Ea,xa,Aa,Oa,ka,La,Ia,Pa,Ca,Ta,ja,Ra,Ma,Na,za,Ba,Ua,Fa,Da,qa,Ga,Ha,Wa,$a,Ka,Va,Ya;Object.create;!function(e){e.AUTHENTICATED_ROLE="AuthenticatedRole",e.DENY="Deny"}(Ki||(Ki={})),(Vi||(Vi={})).filterSensitiveLog=function(e){return Gi({},e)},(Yi||(Yi={})).filterSensitiveLog=function(e){return Gi({},e)},(Zi||(Zi={})).filterSensitiveLog=function(e){return Gi({},e)},(Ji||(Ji={})).filterSensitiveLog=function(e){return Gi({},e)},function(e){e.filterSensitiveLog=function(e){return Gi({},e)}}(Xi||(Xi={})),function(e){e.filterSensitiveLog=function(e){return Gi({},e)}}(Qi||(Qi={})),(ea||(ea={})).filterSensitiveLog=function(e){return Gi({},e)},(ta||(ta={})).filterSensitiveLog=function(e){return Gi({},e)},(na||(na={})).filterSensitiveLog=function(e){return Gi({},e)},(ra||(ra={})).filterSensitiveLog=function(e){return Gi({},e)},function(e){e.ACCESS_DENIED="AccessDenied",e.INTERNAL_SERVER_ERROR="InternalServerError"}(oa||(oa={})),(ia||(ia={})).filterSensitiveLog=function(e){return Gi({},e)},(aa||(aa={})).filterSensitiveLog=function(e){return Gi({},e)},(sa||(sa={})).filterSensitiveLog=function(e){return Gi({},e)},function(e){e.filterSensitiveLog=function(e){return Gi({},e)}}(ua||(ua={})),(ca||(ca={})).filterSensitiveLog=function(e){return Gi({},e)},(fa||(fa={})).filterSensitiveLog=function(e){return Gi({},e)},(la||(la={})).filterSensitiveLog=function(e){return Gi({},e)},(da||(da={})).filterSensitiveLog=function(e){return Gi({},e)},(ha||(ha={})).filterSensitiveLog=function(e){return Gi({},e)},(pa||(pa={})).filterSensitiveLog=function(e){return Gi({},e)},(ga||(ga={})).filterSensitiveLog=function(e){return Gi({},e)},(va||(va={})).filterSensitiveLog=function(e){return Gi({},e)},(ma||(ma={})).filterSensitiveLog=function(e){return Gi({},e)},(ya||(ya={})).filterSensitiveLog=function(e){return Gi({},e)},(ba||(ba={})).filterSensitiveLog=function(e){return Gi({},e)},function(e){e.CONTAINS="Contains",e.EQUALS="Equals",e.NOT_EQUAL="NotEqual",e.STARTS_WITH="StartsWith"}(wa||(wa={})),(_a||(_a={})).filterSensitiveLog=function(e){return Gi({},e)},(Sa||(Sa={})).filterSensitiveLog=function(e){return Gi({},e)},function(e){e.RULES="Rules",e.TOKEN="Token"}(Ea||(Ea={})),(xa||(xa={})).filterSensitiveLog=function(e){return Gi({},e)},(Aa||(Aa={})).filterSensitiveLog=function(e){return Gi({},e)},(Oa||(Oa={})).filterSensitiveLog=function(e){return Gi({},e)},(ka||(ka={})).filterSensitiveLog=function(e){return Gi({},e)},(La||(La={})).filterSensitiveLog=function(e){return Gi({},e)},(Ia||(Ia={})).filterSensitiveLog=function(e){return Gi({},e)},(Pa||(Pa={})).filterSensitiveLog=function(e){return Gi({},e)},(Ca||(Ca={})).filterSensitiveLog=function(e){return Gi({},e)},(Ta||(Ta={})).filterSensitiveLog=function(e){return Gi({},e)},(ja||(ja={})).filterSensitiveLog=function(e){return Gi({},e)},(Ra||(Ra={})).filterSensitiveLog=function(e){return Gi({},e)},(Ma||(Ma={})).filterSensitiveLog=function(e){return Gi({},e)},(Na||(Na={})).filterSensitiveLog=function(e){return Gi({},e)},(za||(za={})).filterSensitiveLog=function(e){return Gi({},e)},(Ba||(Ba={})).filterSensitiveLog=function(e){return Gi({},e)},(Ua||(Ua={})).filterSensitiveLog=function(e){return Gi({},e)},(Fa||(Fa={})).filterSensitiveLog=function(e){return Gi({},e)},(Da||(Da={})).filterSensitiveLog=function(e){return Gi({},e)},(qa||(qa={})).filterSensitiveLog=function(e){return Gi({},e)},(Ga||(Ga={})).filterSensitiveLog=function(e){return Gi({},e)},(Ha||(Ha={})).filterSensitiveLog=function(e){return Gi({},e)},(Wa||(Wa={})).filterSensitiveLog=function(e){return Gi({},e)},($a||($a={})).filterSensitiveLog=function(e){return Gi({},e)},(Ka||(Ka={})).filterSensitiveLog=function(e){return Gi({},e)},(Va||(Va={})).filterSensitiveLog=function(e){return Gi({},e)},(Ya||(Ya={})).filterSensitiveLog=function(e){return Gi({},e)};var Za=function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h,p,g,v;return Wi(this,(function(m){switch(m.label){case 0:return r=[Gi({},e)],v={},[4,As(e.body,t)];case 1:switch(n=Gi.apply(void 0,r.concat([(v.body=m.sent(),v)])),i="UnknownError",i=Os(e,n.body),i){case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":return[3,2];case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":return[3,4];case"InvalidIdentityPoolConfigurationException":case"com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException":return[3,6];case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":return[3,8];case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":return[3,10];case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":return[3,12];case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":return[3,14];case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":return[3,16]}return[3,18];case 2:return a=[{}],[4,Xa(n,t)];case 3:return o=Gi.apply(void 0,[Gi.apply(void 0,a.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 4:return s=[{}],[4,Qa(n,t)];case 5:return o=Gi.apply(void 0,[Gi.apply(void 0,s.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 6:return u=[{}],[4,es(n,t)];case 7:return o=Gi.apply(void 0,[Gi.apply(void 0,u.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 8:return c=[{}],[4,ts(n,t)];case 9:return o=Gi.apply(void 0,[Gi.apply(void 0,c.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 10:return f=[{}],[4,rs(n,t)];case 11:return o=Gi.apply(void 0,[Gi.apply(void 0,f.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 12:return l=[{}],[4,os(n,t)];case 13:return o=Gi.apply(void 0,[Gi.apply(void 0,l.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 14:return d=[{}],[4,is(n,t)];case 15:return o=Gi.apply(void 0,[Gi.apply(void 0,d.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 16:return h=[{}],[4,as(n,t)];case 17:return o=Gi.apply(void 0,[Gi.apply(void 0,h.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 18:p=n.body,i=p.code||p.Code||i,o=Gi(Gi({},p),{name:""+i,message:p.message||p.Message||i,$fault:"client",$metadata:Ss(e)}),m.label=19;case 19:return g=o.message||o.Message||i,o.message=g,delete o.Message,[2,Promise.reject(Object.assign(new Error(g),o))]}}))}))},Ja=function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h,p,g,v;return Wi(this,(function(m){switch(m.label){case 0:return r=[Gi({},e)],v={},[4,As(e.body,t)];case 1:switch(n=Gi.apply(void 0,r.concat([(v.body=m.sent(),v)])),i="UnknownError",i=Os(e,n.body),i){case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":return[3,2];case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":return[3,4];case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":return[3,6];case"LimitExceededException":case"com.amazonaws.cognitoidentity#LimitExceededException":return[3,8];case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":return[3,10];case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":return[3,12];case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":return[3,14];case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":return[3,16]}return[3,18];case 2:return a=[{}],[4,Xa(n,t)];case 3:return o=Gi.apply(void 0,[Gi.apply(void 0,a.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 4:return s=[{}],[4,Qa(n,t)];case 5:return o=Gi.apply(void 0,[Gi.apply(void 0,s.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 6:return u=[{}],[4,ts(n,t)];case 7:return o=Gi.apply(void 0,[Gi.apply(void 0,u.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 8:return c=[{}],[4,ns(n,t)];case 9:return o=Gi.apply(void 0,[Gi.apply(void 0,c.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 10:return f=[{}],[4,rs(n,t)];case 11:return o=Gi.apply(void 0,[Gi.apply(void 0,f.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 12:return l=[{}],[4,os(n,t)];case 13:return o=Gi.apply(void 0,[Gi.apply(void 0,l.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 14:return d=[{}],[4,is(n,t)];case 15:return o=Gi.apply(void 0,[Gi.apply(void 0,d.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 16:return h=[{}],[4,as(n,t)];case 17:return o=Gi.apply(void 0,[Gi.apply(void 0,h.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 18:p=n.body,i=p.code||p.Code||i,o=Gi(Gi({},p),{name:""+i,message:p.message||p.Message||i,$fault:"client",$metadata:Ss(e)}),m.label=19;case 19:return g=o.message||o.Message||i,o.message=g,delete o.Message,[2,Promise.reject(Object.assign(new Error(g),o))]}}))}))},Xa=function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r;return Wi(this,(function(o){return n=e.body,r=ls(n,t),[2,Gi({name:"ExternalServiceException",$fault:"client",$metadata:Ss(e)},r)]}))}))},Qa=function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r;return Wi(this,(function(o){return n=e.body,r=ps(n,t),[2,Gi({name:"InternalErrorException",$fault:"server",$metadata:Ss(e)},r)]}))}))},es=function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r;return Wi(this,(function(o){return n=e.body,r=gs(n,t),[2,Gi({name:"InvalidIdentityPoolConfigurationException",$fault:"client",$metadata:Ss(e)},r)]}))}))},ts=function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r;return Wi(this,(function(o){return n=e.body,r=vs(n,t),[2,Gi({name:"InvalidParameterException",$fault:"client",$metadata:Ss(e)},r)]}))}))},ns=function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r;return Wi(this,(function(o){return n=e.body,r=ms(n,t),[2,Gi({name:"LimitExceededException",$fault:"client",$metadata:Ss(e)},r)]}))}))},rs=function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r;return Wi(this,(function(o){return n=e.body,r=ys(n,t),[2,Gi({name:"NotAuthorizedException",$fault:"client",$metadata:Ss(e)},r)]}))}))},os=function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r;return Wi(this,(function(o){return n=e.body,r=bs(n,t),[2,Gi({name:"ResourceConflictException",$fault:"client",$metadata:Ss(e)},r)]}))}))},is=function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r;return Wi(this,(function(o){return n=e.body,r=ws(n,t),[2,Gi({name:"ResourceNotFoundException",$fault:"client",$metadata:Ss(e)},r)]}))}))},as=function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r;return Wi(this,(function(o){return n=e.body,r=_s(n,t),[2,Gi({name:"TooManyRequestsException",$fault:"client",$metadata:Ss(e)},r)]}))}))},ss=function(e,t){return Gi(Gi(Gi({},void 0!==e.CustomRoleArn&&null!==e.CustomRoleArn&&{CustomRoleArn:e.CustomRoleArn}),void 0!==e.IdentityId&&null!==e.IdentityId&&{IdentityId:e.IdentityId}),void 0!==e.Logins&&null!==e.Logins&&{Logins:cs(e.Logins,t)})},us=function(e,t){return Gi(Gi(Gi({},void 0!==e.AccountId&&null!==e.AccountId&&{AccountId:e.AccountId}),void 0!==e.IdentityPoolId&&null!==e.IdentityPoolId&&{IdentityPoolId:e.IdentityPoolId}),void 0!==e.Logins&&null!==e.Logins&&{Logins:cs(e.Logins,t)})},cs=function(e,t){return Object.entries(e).reduce((function(e,t){var n,r=$i(t,2),o=r[0],i=r[1];return null===i?e:Gi(Gi({},e),((n={})[o]=i,n))}),{})},fs=function(e,t){return{AccessKeyId:void 0!==e.AccessKeyId&&null!==e.AccessKeyId?e.AccessKeyId:void 0,Expiration:void 0!==e.Expiration&&null!==e.Expiration?new Date(Math.round(1e3*e.Expiration)):void 0,SecretKey:void 0!==e.SecretKey&&null!==e.SecretKey?e.SecretKey:void 0,SessionToken:void 0!==e.SessionToken&&null!==e.SessionToken?e.SessionToken:void 0}},ls=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},ds=function(e,t){return{Credentials:void 0!==e.Credentials&&null!==e.Credentials?fs(e.Credentials):void 0,IdentityId:void 0!==e.IdentityId&&null!==e.IdentityId?e.IdentityId:void 0}},hs=function(e,t){return{IdentityId:void 0!==e.IdentityId&&null!==e.IdentityId?e.IdentityId:void 0}},ps=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},gs=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},vs=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},ms=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},ys=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},bs=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},ws=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},_s=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Ss=function(e){var t;return{httpStatusCode:e.statusCode,requestId:null!==(t=e.headers["x-amzn-requestid"])&&void 0!==t?t:e.headers["x-amzn-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}},Es=function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)},xs=function(e,t,n,r,o){return Hi(void 0,void 0,void 0,(function(){var i,a,s,u,c,f;return Wi(this,(function(l){switch(l.label){case 0:return[4,e.endpoint()];case 1:return i=l.sent(),a=i.hostname,s=i.protocol,u=void 0===s?"https":s,c=i.port,f={protocol:u,hostname:a,port:c,method:"POST",path:n,headers:t},void 0!==r&&(f.hostname=r),void 0!==o&&(f.body=o),[2,new yn(f)]}}))}))},As=function(e,t){return function(e,t){return Es(e,t).then((function(e){return t.utf8Encoder(e)}))}(e,t).then((function(e){return e.length?JSON.parse(e):{}}))},Os=function(e,t){var n,r,o=function(e){var t=e;return t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},i=(n=e.headers,r="x-amzn-errortype",Object.keys(n).find((function(e){return e.toLowerCase()===r.toLowerCase()})));return void 0!==i?o(e.headers[i]):void 0!==t.code?o(t.code):void 0!==t.__type?o(t.__type):""},ks=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return qi(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CognitoIdentityClient",commandName:"GetCredentialsForIdentityCommand",inputFilterSensitiveLog:ha.filterSensitiveLog,outputFilterSensitiveLog:ga.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r;return Wi(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.GetCredentialsForIdentity"},r=JSON.stringify(ss(e,t)),[2,xs(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r,o;return Wi(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,Za(e,t)]:[4,As(e.body,t)];case 1:return n=i.sent(),{},r=ds(n,t),o=Gi({$metadata:Ss(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),Ls=function(e){function t(t,n){void 0===n&&(n=!0);var r=e.call(this,t)||this;return r.tryNextLink=n,r}return Object(mn.__extends)(t,e),t}(Error);function Is(e){return Promise.all(Object.keys(e).reduce((function(t,n){var r=e[n];return"string"==typeof r?t.push([n,r]):t.push(r().then((function(e){return[n,e]}))),t}),[])).then((function(e){return e.reduce((function(e,t){var n=Object(mn.__read)(t,2),r=n[0],o=n[1];return e[r]=o,e}),{})}))}function Ps(e){var t=this;return function(){return Object(mn.__awaiter)(t,void 0,void 0,(function(){var t,n,r,o,i,a,s,u,c,f,l,d,h;return Object(mn.__generator)(this,(function(p){switch(p.label){case 0:return f=(c=e.client).send,l=ks.bind,h={CustomRoleArn:e.customRoleArn,IdentityId:e.identityId},e.logins?[4,Is(e.logins)]:[3,2];case 1:return d=p.sent(),[3,3];case 2:d=void 0,p.label=3;case 3:return[4,f.apply(c,[new(l.apply(ks,[void 0,(h.Logins=d,h)]))])];case 4:return t=p.sent().Credentials,n=void 0===t?function(){throw new Ls("Response from Amazon Cognito contained no credentials")}():t,r=n.AccessKeyId,o=void 0===r?function(){throw new Ls("Response from Amazon Cognito contained no access key ID")}():r,i=n.Expiration,a=n.SecretKey,s=void 0===a?function(){throw new Ls("Response from Amazon Cognito contained no secret key")}():a,u=n.SessionToken,[2,{identityId:e.identityId,accessKeyId:o,secretAccessKey:s,sessionToken:u,expiration:i}]}}))}))}}var Cs=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return qi(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CognitoIdentityClient",commandName:"GetIdCommand",inputFilterSensitiveLog:ma.filterSensitiveLog,outputFilterSensitiveLog:ya.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r;return Wi(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.GetId"},r=JSON.stringify(us(e,t)),[2,xs(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r,o;return Wi(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,Ja(e,t)]:[4,As(e.body,t)];case 1:return n=i.sent(),{},r=hs(n,t),o=Gi({$metadata:Ss(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),Ts=function(){function e(e){void 0===e&&(e="aws:cognito-identity-ids"),this.dbName=e}return e.prototype.getItem=function(e){return this.withObjectStore("readonly",(function(t){var n=t.get(e);return new Promise((function(e){n.onerror=function(){return e(null)},n.onsuccess=function(){return e(n.result?n.result.value:null)}}))})).catch((function(){return null}))},e.prototype.removeItem=function(e){return this.withObjectStore("readwrite",(function(t){var n=t.delete(e);return new Promise((function(e,t){n.onerror=function(){return t(n.error)},n.onsuccess=function(){return e()}}))}))},e.prototype.setItem=function(e,t){return this.withObjectStore("readwrite",(function(n){var r=n.put({id:e,value:t});return new Promise((function(e,t){r.onerror=function(){return t(r.error)},r.onsuccess=function(){return e()}}))}))},e.prototype.getDb=function(){var e=self.indexedDB.open(this.dbName,1);return new Promise((function(t,n){e.onsuccess=function(){t(e.result)},e.onerror=function(){n(e.error)},e.onblocked=function(){n(new Error("Unable to access DB"))},e.onupgradeneeded=function(){var t=e.result;t.onerror=function(){n(new Error("Failed to create object store"))},t.createObjectStore("IdentityIds",{keyPath:"id"})}}))},e.prototype.withObjectStore=function(e,t){return this.getDb().then((function(n){var r=n.transaction("IdentityIds",e);return r.oncomplete=function(){return n.close()},new Promise((function(e,n){r.onerror=function(){return n(r.error)},e(t(r.objectStore("IdentityIds")))})).catch((function(e){throw n.close(),e}))}))},e}(),js=new(function(){function e(e){void 0===e&&(e={}),this.store=e}return e.prototype.getItem=function(e){return e in this.store?this.store[e]:null},e.prototype.removeItem=function(e){delete this.store[e]},e.prototype.setItem=function(e,t){this.store[e]=t},e}());function Rs(e){var t=this,n=e.accountId,r=e.cache,o=void 0===r?"object"==typeof self&&self.indexedDB?new Ts:"object"==typeof window&&window.localStorage?window.localStorage:js:r,i=e.client,a=e.customRoleArn,s=e.identityPoolId,u=e.logins,c=e.userIdentifier,f=void 0===c?u&&0!==Object.keys(u).length?void 0:"ANONYMOUS":c,l=f?"aws:cognito-identity-credentials:"+s+":"+f:void 0,d=function(){return Object(mn.__awaiter)(t,void 0,void 0,(function(){var e,t,r,c,f,h,p,g,v;return Object(mn.__generator)(this,(function(m){switch(m.label){case 0:return(t=l)?[4,o.getItem(l)]:[3,2];case 1:t=m.sent(),m.label=2;case 2:return(e=t)?[3,7]:(h=(f=i).send,p=Cs.bind,v={AccountId:n,IdentityPoolId:s},u?[4,Is(u)]:[3,4]);case 3:return g=m.sent(),[3,5];case 4:g=void 0,m.label=5;case 5:return[4,h.apply(f,[new(p.apply(Cs,[void 0,(v.Logins=g,v)]))])];case 6:r=m.sent().IdentityId,c=void 0===r?function(){throw new Ls("Response from Amazon Cognito contained no identity ID")}():r,e=c,l&&Promise.resolve(o.setItem(l,e)).catch((function(){})),m.label=7;case 7:return[2,(d=Ps({client:i,customRoleArn:a,logins:u,identityId:e}))()]}}))}))};return function(){return d().catch((function(e){return Object(mn.__awaiter)(t,void 0,void 0,(function(){return Object(mn.__generator)(this,(function(t){throw l&&Promise.resolve(o.removeItem(l)).catch((function(){})),e}))}))}))}}var Ms=function(e,t){return(Ms=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function Ns(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Ms(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var zs=function(){return(zs=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function Bs(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function Us(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}Object.create;function Fs(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}Object.create;var Ds,qs,Gs,Hs,Ws,$s,Ks,Vs,Ys,Zs,Js,Xs,Qs,eu,tu,nu,ru,ou,iu,au,su,uu,cu,fu,lu,du,hu,pu,gu,vu,mu,yu,bu,wu,_u,Su,Eu,xu,Au,Ou,ku,Lu,Iu,Pu,Cu,Tu,ju,Ru,Mu,Nu,zu,Bu,Uu,Fu,Du,qu,Gu,Hu=n(21),Wu=new Set(["af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-south-1","ap-southeast-1","ap-southeast-2","ca-central-1","eu-central-1","eu-north-1","eu-south-1","eu-west-1","eu-west-2","eu-west-3","me-south-1","sa-east-1","us-east-1","us-east-2","us-west-1","us-west-2"]),$u=new Set(["cn-north-1","cn-northwest-1"]),Ku=new Set(["us-iso-east-1"]),Vu=new Set(["us-isob-east-1"]),Yu=new Set(["us-gov-east-1","us-gov-west-1"]),Zu={apiVersion:"2014-06-30",disableHostPrefix:!1,logger:{},regionInfoProvider:function(e,t){var n=void 0;switch(e){case"ap-northeast-1":n={hostname:"cognito-identity.ap-northeast-1.amazonaws.com",partition:"aws"};break;case"ap-northeast-2":n={hostname:"cognito-identity.ap-northeast-2.amazonaws.com",partition:"aws"};break;case"ap-south-1":n={hostname:"cognito-identity.ap-south-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-1":n={hostname:"cognito-identity.ap-southeast-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-2":n={hostname:"cognito-identity.ap-southeast-2.amazonaws.com",partition:"aws"};break;case"ca-central-1":n={hostname:"cognito-identity.ca-central-1.amazonaws.com",partition:"aws"};break;case"cn-north-1":n={hostname:"cognito-identity.cn-north-1.amazonaws.com.cn",partition:"aws-cn"};break;case"eu-central-1":n={hostname:"cognito-identity.eu-central-1.amazonaws.com",partition:"aws"};break;case"eu-north-1":n={hostname:"cognito-identity.eu-north-1.amazonaws.com",partition:"aws"};break;case"eu-west-1":n={hostname:"cognito-identity.eu-west-1.amazonaws.com",partition:"aws"};break;case"eu-west-2":n={hostname:"cognito-identity.eu-west-2.amazonaws.com",partition:"aws"};break;case"eu-west-3":n={hostname:"cognito-identity.eu-west-3.amazonaws.com",partition:"aws"};break;case"fips-us-east-1":n={hostname:"cognito-identity-fips.us-east-1.amazonaws.com",partition:"aws",signingRegion:"us-east-1"};break;case"fips-us-east-2":n={hostname:"cognito-identity-fips.us-east-2.amazonaws.com",partition:"aws",signingRegion:"us-east-2"};break;case"fips-us-gov-west-1":n={hostname:"cognito-identity-fips.us-gov-west-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-west-1"};break;case"fips-us-west-2":n={hostname:"cognito-identity-fips.us-west-2.amazonaws.com",partition:"aws",signingRegion:"us-west-2"};break;case"sa-east-1":n={hostname:"cognito-identity.sa-east-1.amazonaws.com",partition:"aws"};break;case"us-east-1":n={hostname:"cognito-identity.us-east-1.amazonaws.com",partition:"aws"};break;case"us-east-2":n={hostname:"cognito-identity.us-east-2.amazonaws.com",partition:"aws"};break;case"us-gov-west-1":n={hostname:"cognito-identity.us-gov-west-1.amazonaws.com",partition:"aws-us-gov"};break;case"us-west-1":n={hostname:"cognito-identity.us-west-1.amazonaws.com",partition:"aws"};break;case"us-west-2":n={hostname:"cognito-identity.us-west-2.amazonaws.com",partition:"aws"};break;default:Wu.has(e)&&(n={hostname:"cognito-identity.{region}.amazonaws.com".replace("{region}",e),partition:"aws"}),$u.has(e)&&(n={hostname:"cognito-identity.{region}.amazonaws.com.cn".replace("{region}",e),partition:"aws-cn"}),Ku.has(e)&&(n={hostname:"cognito-identity.{region}.c2s.ic.gov".replace("{region}",e),partition:"aws-iso"}),Vu.has(e)&&(n={hostname:"cognito-identity.{region}.sc2s.sgov.gov".replace("{region}",e),partition:"aws-iso-b"}),Yu.has(e)&&(n={hostname:"cognito-identity.{region}.amazonaws.com".replace("{region}",e),partition:"aws-us-gov"}),void 0===n&&(n={hostname:"cognito-identity.{region}.amazonaws.com".replace("{region}",e),partition:"aws"})}return Promise.resolve(zs({signingService:"cognito-identity"},n))},serviceId:"Cognito Identity",urlParser:ho},Ju=zs(zs({},Zu),{runtime:"browser",base64Decoder:zr,base64Encoder:Br,bodyLengthChecker:to,credentialDefaultProvider:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:oo({serviceId:Zu.serviceId,clientVersion:Hu.version}),maxAttempts:3,region:Dr("Region is missing"),requestHandler:new Ir,sha256:Or.Sha256,streamCollector:Ur,utf8Decoder:io,utf8Encoder:ao}),Xu=function(e){function t(t){var n=this,r=zs(zs({},Ju),t),o=bo(r),i=ri(vo(o)),a=ui(Qr(i));return(n=e.call(this,a)||this).config=a,n.middlewareStack.use(Gr(n.config)),n.middlewareStack.use(So(n.config)),n.middlewareStack.use(xo(n.config)),n.middlewareStack.use(Oo(n.config)),n.middlewareStack.use(di(n.config)),n}return Ns(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(vr);!function(e){e.AUTHENTICATED_ROLE="AuthenticatedRole",e.DENY="Deny"}(Ds||(Ds={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(qs||(qs={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Gs||(Gs={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Hs||(Hs={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Ws||(Ws={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}($s||($s={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Ks||(Ks={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Vs||(Vs={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Ys||(Ys={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Zs||(Zs={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Js||(Js={})),function(e){e.ACCESS_DENIED="AccessDenied",e.INTERNAL_SERVER_ERROR="InternalServerError"}(Xs||(Xs={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Qs||(Qs={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(eu||(eu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(tu||(tu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(nu||(nu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(ru||(ru={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(ou||(ou={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(iu||(iu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(au||(au={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(su||(su={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(uu||(uu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(cu||(cu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(fu||(fu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(lu||(lu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(du||(du={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(hu||(hu={})),function(e){e.CONTAINS="Contains",e.EQUALS="Equals",e.NOT_EQUAL="NotEqual",e.STARTS_WITH="StartsWith"}(pu||(pu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(gu||(gu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(vu||(vu={})),function(e){e.RULES="Rules",e.TOKEN="Token"}(mu||(mu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(yu||(yu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(bu||(bu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(wu||(wu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(_u||(_u={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Su||(Su={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Eu||(Eu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(xu||(xu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Au||(Au={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Ou||(Ou={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(ku||(ku={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Lu||(Lu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Iu||(Iu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Pu||(Pu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Cu||(Cu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Tu||(Tu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(ju||(ju={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Ru||(Ru={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Mu||(Mu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Nu||(Nu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(zu||(zu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Bu||(Bu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Uu||(Uu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Fu||(Fu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Du||(Du={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(qu||(qu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Gu||(Gu={}));var Qu=function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h,p,g,v;return Us(this,(function(m){switch(m.label){case 0:return r=[zs({},e)],v={},[4,Lc(e.body,t)];case 1:switch(n=zs.apply(void 0,r.concat([(v.body=m.sent(),v)])),i="UnknownError",i=Ic(e,n.body),i){case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":return[3,2];case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":return[3,4];case"InvalidIdentityPoolConfigurationException":case"com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException":return[3,6];case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":return[3,8];case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":return[3,10];case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":return[3,12];case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":return[3,14];case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":return[3,16]}return[3,18];case 2:return a=[{}],[4,tc(n,t)];case 3:return o=zs.apply(void 0,[zs.apply(void 0,a.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 4:return s=[{}],[4,nc(n,t)];case 5:return o=zs.apply(void 0,[zs.apply(void 0,s.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 6:return u=[{}],[4,rc(n,t)];case 7:return o=zs.apply(void 0,[zs.apply(void 0,u.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 8:return c=[{}],[4,oc(n,t)];case 9:return o=zs.apply(void 0,[zs.apply(void 0,c.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 10:return f=[{}],[4,ac(n,t)];case 11:return o=zs.apply(void 0,[zs.apply(void 0,f.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 12:return l=[{}],[4,sc(n,t)];case 13:return o=zs.apply(void 0,[zs.apply(void 0,l.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 14:return d=[{}],[4,uc(n,t)];case 15:return o=zs.apply(void 0,[zs.apply(void 0,d.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 16:return h=[{}],[4,cc(n,t)];case 17:return o=zs.apply(void 0,[zs.apply(void 0,h.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 18:p=n.body,i=p.code||p.Code||i,o=zs(zs({},p),{name:""+i,message:p.message||p.Message||i,$fault:"client",$metadata:Ac(e)}),m.label=19;case 19:return g=o.message||o.Message||i,o.message=g,delete o.Message,[2,Promise.reject(Object.assign(new Error(g),o))]}}))}))},ec=function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h,p,g,v;return Us(this,(function(m){switch(m.label){case 0:return r=[zs({},e)],v={},[4,Lc(e.body,t)];case 1:switch(n=zs.apply(void 0,r.concat([(v.body=m.sent(),v)])),i="UnknownError",i=Ic(e,n.body),i){case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":return[3,2];case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":return[3,4];case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":return[3,6];case"LimitExceededException":case"com.amazonaws.cognitoidentity#LimitExceededException":return[3,8];case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":return[3,10];case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":return[3,12];case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":return[3,14];case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":return[3,16]}return[3,18];case 2:return a=[{}],[4,tc(n,t)];case 3:return o=zs.apply(void 0,[zs.apply(void 0,a.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 4:return s=[{}],[4,nc(n,t)];case 5:return o=zs.apply(void 0,[zs.apply(void 0,s.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 6:return u=[{}],[4,oc(n,t)];case 7:return o=zs.apply(void 0,[zs.apply(void 0,u.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 8:return c=[{}],[4,ic(n,t)];case 9:return o=zs.apply(void 0,[zs.apply(void 0,c.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 10:return f=[{}],[4,ac(n,t)];case 11:return o=zs.apply(void 0,[zs.apply(void 0,f.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 12:return l=[{}],[4,sc(n,t)];case 13:return o=zs.apply(void 0,[zs.apply(void 0,l.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 14:return d=[{}],[4,uc(n,t)];case 15:return o=zs.apply(void 0,[zs.apply(void 0,d.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 16:return h=[{}],[4,cc(n,t)];case 17:return o=zs.apply(void 0,[zs.apply(void 0,h.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 18:p=n.body,i=p.code||p.Code||i,o=zs(zs({},p),{name:""+i,message:p.message||p.Message||i,$fault:"client",$metadata:Ac(e)}),m.label=19;case 19:return g=o.message||o.Message||i,o.message=g,delete o.Message,[2,Promise.reject(Object.assign(new Error(g),o))]}}))}))},tc=function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r;return Us(this,(function(o){return n=e.body,r=pc(n,t),[2,zs({name:"ExternalServiceException",$fault:"client",$metadata:Ac(e)},r)]}))}))},nc=function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r;return Us(this,(function(o){return n=e.body,r=mc(n,t),[2,zs({name:"InternalErrorException",$fault:"server",$metadata:Ac(e)},r)]}))}))},rc=function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r;return Us(this,(function(o){return n=e.body,r=yc(n,t),[2,zs({name:"InvalidIdentityPoolConfigurationException",$fault:"client",$metadata:Ac(e)},r)]}))}))},oc=function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r;return Us(this,(function(o){return n=e.body,r=bc(n,t),[2,zs({name:"InvalidParameterException",$fault:"client",$metadata:Ac(e)},r)]}))}))},ic=function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r;return Us(this,(function(o){return n=e.body,r=wc(n,t),[2,zs({name:"LimitExceededException",$fault:"client",$metadata:Ac(e)},r)]}))}))},ac=function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r;return Us(this,(function(o){return n=e.body,r=_c(n,t),[2,zs({name:"NotAuthorizedException",$fault:"client",$metadata:Ac(e)},r)]}))}))},sc=function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r;return Us(this,(function(o){return n=e.body,r=Sc(n,t),[2,zs({name:"ResourceConflictException",$fault:"client",$metadata:Ac(e)},r)]}))}))},uc=function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r;return Us(this,(function(o){return n=e.body,r=Ec(n,t),[2,zs({name:"ResourceNotFoundException",$fault:"client",$metadata:Ac(e)},r)]}))}))},cc=function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r;return Us(this,(function(o){return n=e.body,r=xc(n,t),[2,zs({name:"TooManyRequestsException",$fault:"client",$metadata:Ac(e)},r)]}))}))},fc=function(e,t){return zs(zs(zs({},void 0!==e.CustomRoleArn&&null!==e.CustomRoleArn&&{CustomRoleArn:e.CustomRoleArn}),void 0!==e.IdentityId&&null!==e.IdentityId&&{IdentityId:e.IdentityId}),void 0!==e.Logins&&null!==e.Logins&&{Logins:dc(e.Logins,t)})},lc=function(e,t){return zs(zs(zs({},void 0!==e.AccountId&&null!==e.AccountId&&{AccountId:e.AccountId}),void 0!==e.IdentityPoolId&&null!==e.IdentityPoolId&&{IdentityPoolId:e.IdentityPoolId}),void 0!==e.Logins&&null!==e.Logins&&{Logins:dc(e.Logins,t)})},dc=function(e,t){return Object.entries(e).reduce((function(e,t){var n,r=Fs(t,2),o=r[0],i=r[1];return null===i?e:zs(zs({},e),((n={})[o]=i,n))}),{})},hc=function(e,t){return{AccessKeyId:void 0!==e.AccessKeyId&&null!==e.AccessKeyId?e.AccessKeyId:void 0,Expiration:void 0!==e.Expiration&&null!==e.Expiration?new Date(Math.round(1e3*e.Expiration)):void 0,SecretKey:void 0!==e.SecretKey&&null!==e.SecretKey?e.SecretKey:void 0,SessionToken:void 0!==e.SessionToken&&null!==e.SessionToken?e.SessionToken:void 0}},pc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},gc=function(e,t){return{Credentials:void 0!==e.Credentials&&null!==e.Credentials?hc(e.Credentials):void 0,IdentityId:void 0!==e.IdentityId&&null!==e.IdentityId?e.IdentityId:void 0}},vc=function(e,t){return{IdentityId:void 0!==e.IdentityId&&null!==e.IdentityId?e.IdentityId:void 0}},mc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},yc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},bc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},wc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},_c=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Sc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Ec=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},xc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Ac=function(e){var t;return{httpStatusCode:e.statusCode,requestId:null!==(t=e.headers["x-amzn-requestid"])&&void 0!==t?t:e.headers["x-amzn-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}},Oc=function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)},kc=function(e,t,n,r,o){return Bs(void 0,void 0,void 0,(function(){var i,a,s,u,c,f;return Us(this,(function(l){switch(l.label){case 0:return[4,e.endpoint()];case 1:return i=l.sent(),a=i.hostname,s=i.protocol,u=void 0===s?"https":s,c=i.port,f={protocol:u,hostname:a,port:c,method:"POST",path:n,headers:t},void 0!==r&&(f.hostname=r),void 0!==o&&(f.body=o),[2,new yn(f)]}}))}))},Lc=function(e,t){return function(e,t){return Oc(e,t).then((function(e){return t.utf8Encoder(e)}))}(e,t).then((function(e){return e.length?JSON.parse(e):{}}))},Ic=function(e,t){var n,r,o=function(e){var t=e;return t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},i=(n=e.headers,r="x-amzn-errortype",Object.keys(n).find((function(e){return e.toLowerCase()===r.toLowerCase()})));return void 0!==i?o(e.headers[i]):void 0!==t.code?o(t.code):void 0!==t.__type?o(t.__type):""},Pc=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return Ns(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CognitoIdentityClient",commandName:"GetIdCommand",inputFilterSensitiveLog:lu.filterSensitiveLog,outputFilterSensitiveLog:du.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r;return Us(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.GetId"},r=JSON.stringify(lc(e,t)),[2,kc(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r,o;return Us(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,ec(e,t)]:[4,Lc(e.body,t)];case 1:return n=i.sent(),{},r=vc(n,t),o=zs({$metadata:Ac(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),Cc=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return Ns(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CognitoIdentityClient",commandName:"GetCredentialsForIdentityCommand",inputFilterSensitiveLog:su.filterSensitiveLog,outputFilterSensitiveLog:cu.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r;return Us(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.GetCredentialsForIdentity"},r=JSON.stringify(fc(e,t)),[2,kc(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r,o;return Us(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,Qu(e,t)]:[4,Lc(e.body,t)];case 1:return n=i.sent(),{},r=gc(n,t),o=zs({$metadata:Ac(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),Tc=function(){return(Tc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},jc=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Rc=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Mc=new g("Credentials"),Nc=function(){function e(e){this._gettingCredPromise=null,this._refreshHandlers={},this.Auth=void 0,this.configure(e),this._refreshHandlers.google=Ui.refreshGoogleToken,this._refreshHandlers.facebook=Fi.refreshFacebookToken}return e.prototype.getModuleName=function(){return"Credentials"},e.prototype.getCredSource=function(){return this._credentials_source},e.prototype.configure=function(e){if(!e)return this._config||{};this._config=Object.assign({},this._config,e);var t=this._config.refreshHandlers;return t&&(this._refreshHandlers=Tc(Tc({},this._refreshHandlers),t)),this._storage=this._config.storage,this._storage||(this._storage=(new vi).getStorage()),this._storageSync=Promise.resolve(),"function"==typeof this._storage.sync&&(this._storageSync=this._storage.sync()),this._config},e.prototype.get=function(){return Mc.debug("getting credentials"),this._pickupCredentials()},e.prototype._getCognitoIdentityIdStorageKey=function(e){return"CognitoIdentityId-"+e},e.prototype._pickupCredentials=function(){return Mc.debug("picking up credentials"),this._gettingCredPromise&&this._gettingCredPromise.isPending()?Mc.debug("getting old cred promise"):(Mc.debug("getting new cred promise"),this._gettingCredPromise=Object(U.i)(this._keepAlive())),this._gettingCredPromise},e.prototype._keepAlive=function(){return jc(this,void 0,void 0,(function(){var e,t,n,r,o,i,a;return Rc(this,(function(s){switch(s.label){case 0:if(Mc.debug("checking if credentials exists and not expired"),(e=this._credentials)&&!this._isExpired(e)&&!this._isPastTTL())return Mc.debug("credentials not changed and not expired, directly return"),[2,Promise.resolve(e)];if(Mc.debug("need to get a new credential or refresh the existing one"),t=this.Auth,!(n=void 0===t?b.Auth:t)||"function"!=typeof n.currentUserCredentials)return[2,Promise.reject("No Auth module registered in Amplify")];if(this._isExpired(e)||!this._isPastTTL())return[3,6];Mc.debug("ttl has passed but token is not yet expired"),s.label=1;case 1:return s.trys.push([1,5,,6]),[4,n.currentUserPoolUser()];case 2:return r=s.sent(),[4,n.currentSession()];case 3:return o=s.sent(),i=o.refreshToken,[4,new Promise((function(e,t){r.refreshSession(i,(function(n,r){return n?t(n):e(r)}))}))];case 4:return s.sent(),[3,6];case 5:return a=s.sent(),Mc.debug("Error attempting to refreshing the session",a),[3,6];case 6:return[2,n.currentUserCredentials()]}}))}))},e.prototype.refreshFederatedToken=function(e){Mc.debug("Getting federated credentials");var t=e.provider,n=e.user,r=e.token,o=e.identity_id,i=e.expires_at;i=1970===new Date(i).getFullYear()?1e3*i:i;return Mc.debug("checking if federated jwt token expired"),i>(new Date).getTime()?(Mc.debug("token not expired"),this._setCredentialsFromFederation({provider:t,token:r,user:n,identity_id:o,expires_at:i})):this._refreshHandlers[t]&&"function"==typeof this._refreshHandlers[t]?(Mc.debug("getting refreshed jwt token from federation provider"),this._providerRefreshWithRetry({refreshHandler:this._refreshHandlers[t],provider:t,user:n})):(Mc.debug("no refresh handler for provider:",t),this.clear(),Promise.reject("no refresh handler for provider"))},e.prototype._providerRefreshWithRetry=function(e){var t=this,n=e.refreshHandler,r=e.provider,o=e.user;return Li(n,[],1e4).then((function(e){return Mc.debug("refresh federated token sucessfully",e),t._setCredentialsFromFederation({provider:r,token:e.token,user:o,identity_id:e.identity_id,expires_at:e.expires_at})})).catch((function(e){return"string"==typeof e&&0===e.toLowerCase().lastIndexOf("network error",e.length)||t.clear(),Mc.debug("refresh federated token failed",e),Promise.reject("refreshing federation token failed: "+e)}))},e.prototype._isExpired=function(e){if(!e)return Mc.debug("no credentials for expiration check"),!0;Mc.debug("are these credentials expired?",e);var t=Date.now();return e.expiration.getTime()<=t},e.prototype._isPastTTL=function(){return this._nextCredentialsRefresh<=Date.now()},e.prototype._setCredentialsForGuest=function(){return jc(this,void 0,void 0,(function(){var e,t,n,r,o,i,a,s=this;return Rc(this,(function(u){switch(u.label){case 0:return Mc.debug("setting credentials for guest"),e=this._config,t=e.identityPoolId,n=e.region,e.mandatorySignIn?[2,Promise.reject("cannot get guest credentials when mandatory signin enabled")]:t?n?(o=this,[4,this._getGuestIdentityId()]):(Mc.debug("region is not configured for getting the credentials"),[2,Promise.reject("region is not configured for getting the credentials")]):(Mc.debug("No Cognito Identity pool provided for unauthenticated access"),[2,Promise.reject("No Cognito Identity pool provided for unauthenticated access")]);case 1:return r=o._identityId=u.sent(),i=new Xu({region:n,customUserAgent:_()}),a=void 0,a=r?Ps({identityId:r,client:i})():function(){return jc(s,void 0,void 0,(function(){var e;return Rc(this,(function(n){switch(n.label){case 0:return[4,i.send(new Pc({IdentityPoolId:t}))];case 1:return e=n.sent().IdentityId,this._identityId=e,[2,Ps({client:i,identityId:e})()]}}))}))}().catch((function(e){return jc(s,void 0,void 0,(function(){return Rc(this,(function(t){throw e}))}))})),[2,this._loadCredentials(a,"guest",!1,null).then((function(e){return e})).catch((function(e){return jc(s,void 0,void 0,(function(){var n=this;return Rc(this,(function(o){switch(o.label){case 0:return"ResourceNotFoundException"!==e.name||e.message!=="Identity '"+r+"' not found."?[3,2]:(Mc.debug("Failed to load guest credentials"),[4,this._removeGuestIdentityId()]);case 1:return o.sent(),a=function(){return jc(n,void 0,void 0,(function(){var e;return Rc(this,(function(n){switch(n.label){case 0:return[4,i.send(new Pc({IdentityPoolId:t}))];case 1:return e=n.sent().IdentityId,this._identityId=e,[2,Ps({client:i,identityId:e})()]}}))}))}().catch((function(e){return jc(n,void 0,void 0,(function(){return Rc(this,(function(t){throw e}))}))})),[2,this._loadCredentials(a,"guest",!1,null)];case 2:return[2,e]}}))}))}))]}}))}))},e.prototype._setCredentialsFromFederation=function(e){var t=e.provider,n=e.token,r=e.identity_id,o={google:"accounts.google.com",facebook:"graph.facebook.com",amazon:"www.amazon.com",developer:"cognito-identity.amazonaws.com"}[t]||t;if(!o)return Promise.reject("You must specify a federated provider");var i={};i[o]=n;var a=this._config,s=a.identityPoolId,u=a.region;if(!s)return Mc.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");if(!u)return Mc.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var c=new Xu({region:u,customUserAgent:_()}),f=void 0;r?f=Ps({identityId:r,logins:i,client:c})():f=Rs({logins:i,identityPoolId:s,client:c})();return this._loadCredentials(f,"federated",!0,e)},e.prototype._setCredentialsFromSession=function(e){var t=this;Mc.debug("set credentials from session");var n=e.getIdToken().getJwtToken(),r=this._config,o=r.region,i=r.userPoolId,a=r.identityPoolId;if(!a)return Mc.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");if(!o)return Mc.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var s={};s["cognito-idp."+o+".amazonaws.com/"+i]=n;var u=new Xu({region:o,customUserAgent:_()}),c=jc(t,void 0,void 0,(function(){var e,t,n,r,o,i,c,f,l,d;return Rc(this,(function(h){switch(h.label){case 0:return[4,this._getGuestIdentityId()];case 1:return(e=h.sent())?[3,3]:[4,u.send(new Pc({IdentityPoolId:a,Logins:s}))];case 2:n=h.sent().IdentityId,t=n,h.label=3;case 3:return[4,u.send(new Cc({IdentityId:e||t,Logins:s}))];case 4:return r=h.sent(),o=r.Credentials,i=o.AccessKeyId,c=o.Expiration,f=o.SecretKey,l=o.SessionToken,d=r.IdentityId,this._identityId=d,e?(Mc.debug("The guest identity "+e+" has been successfully linked to the logins"),e===d&&Mc.debug("The guest identity "+e+" has become the primary identity"),[4,this._removeGuestIdentityId()]):[3,6];case 5:h.sent(),h.label=6;case 6:return[2,{accessKeyId:i,secretAccessKey:f,sessionToken:l,expiration:c,identityId:d}]}}))})).catch((function(e){return jc(t,void 0,void 0,(function(){return Rc(this,(function(t){throw e}))}))}));return this._loadCredentials(c,"userPool",!0,null)},e.prototype._loadCredentials=function(e,t,n,r){var o=this,i=this;return new Promise((function(a,s){e.then((function(e){return jc(o,void 0,void 0,(function(){var o,s,u,c,f;return Rc(this,(function(l){switch(l.label){case 0:if(Mc.debug("Load credentials successfully",e),this._identityId&&!e.identityId&&(e.identityId=this._identityId),i._credentials=e,i._credentials.authenticated=n,i._credentials_source=t,i._nextCredentialsRefresh=(new Date).getTime()+3e6,"federated"===t){o=Object.assign({id:this._credentials.identityId},r.user),s=r.provider,u=r.token,c=r.expires_at,f=r.identity_id;try{this._storage.setItem("aws-amplify-federatedInfo",JSON.stringify({provider:s,token:u,user:o,expires_at:c,identity_id:f}))}catch(e){Mc.debug("Failed to put federated info into auth storage",e)}}return"guest"!==t?[3,2]:[4,this._setGuestIdentityId(e.identityId)];case 1:l.sent(),l.label=2;case 2:return a(i._credentials),[2]}}))}))})).catch((function(t){if(t)return Mc.debug("Failed to load credentials",e),Mc.debug("Error loading credentials",t),void s(t)}))}))},e.prototype.set=function(e,t){return"session"===t?this._setCredentialsFromSession(e):"federation"===t?this._setCredentialsFromFederation(e):"guest"===t?this._setCredentialsForGuest():(Mc.debug("no source specified for setting credentials"),Promise.reject("invalid source"))},e.prototype.clear=function(){return jc(this,void 0,void 0,(function(){return Rc(this,(function(e){return this._credentials=null,this._credentials_source=null,Mc.debug("removing aws-amplify-federatedInfo from storage"),this._storage.removeItem("aws-amplify-federatedInfo"),[2]}))}))},e.prototype._getGuestIdentityId=function(){return jc(this,void 0,void 0,(function(){var e,t;return Rc(this,(function(n){switch(n.label){case 0:e=this._config.identityPoolId,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this._storageSync];case 2:return n.sent(),[2,this._storage.getItem(this._getCognitoIdentityIdStorageKey(e))];case 3:return t=n.sent(),Mc.debug("Failed to get the cached guest identityId",t),[3,4];case 4:return[2]}}))}))},e.prototype._setGuestIdentityId=function(e){return jc(this,void 0,void 0,(function(){var t,n;return Rc(this,(function(r){switch(r.label){case 0:t=this._config.identityPoolId,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this._storageSync];case 2:return r.sent(),this._storage.setItem(this._getCognitoIdentityIdStorageKey(t),e),[3,4];case 3:return n=r.sent(),Mc.debug("Failed to cache guest identityId",n),[3,4];case 4:return[2]}}))}))},e.prototype._removeGuestIdentityId=function(){return jc(this,void 0,void 0,(function(){var e;return Rc(this,(function(t){return e=this._config.identityPoolId,Mc.debug("removing "+this._getCognitoIdentityIdStorageKey(e)+" from storage"),this._storage.removeItem(this._getCognitoIdentityIdStorageKey(e)),[2]}))}))},e.prototype.shear=function(e){return{accessKeyId:e.accessKeyId,sessionToken:e.sessionToken,secretAccessKey:e.secretAccessKey,identityId:e.identityId,authenticated:e.authenticated}},e}(),zc=new Nc(null);b.register(zc);var Bc=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Uc=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Fc=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Dc=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Fc(arguments[t]));return e},qc=new g("AWSCloudWatch"),Gc=function(){function e(e){this.configure(e),this._dataTracker={eventUploadInProgress:!1,logEvents:[]},this._currentLogBatch=[],this._initiateLogPushInterval()}return e.prototype.getProviderName=function(){return e.PROVIDER_NAME},e.prototype.getCategoryName=function(){return e.CATEGORY},e.prototype.getLogQueue=function(){return this._dataTracker.logEvents},e.prototype.configure=function(e){if(!e)return this._config||{};var t=Object.assign({},this._config,le(e).Logging,e);return this._config=t,this._config},e.prototype.createLogGroup=function(e){return Bc(this,void 0,void 0,(function(){var t,n;return Uc(this,(function(r){switch(r.label){case 0:qc.debug("creating new log group in CloudWatch - ",e.logGroupName),t=new br(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),qc.error("error creating log group - "+n),n;case 5:return[2]}}))}))},e.prototype.getLogGroups=function(e){return Bc(this,void 0,void 0,(function(){var t,n;return Uc(this,(function(r){switch(r.label){case 0:qc.debug("getting list of log groups"),t=new wr(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),qc.error("error getting log group - "+n),n;case 5:return[2]}}))}))},e.prototype.createLogStream=function(e){return Bc(this,void 0,void 0,(function(){var t,n;return Uc(this,(function(r){switch(r.label){case 0:qc.debug("creating new log stream in CloudWatch - ",e.logStreamName),t=new _r(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),qc.error("error creating log stream - "+n),n;case 5:return[2]}}))}))},e.prototype.getLogStreams=function(e){return Bc(this,void 0,void 0,(function(){var t,n;return Uc(this,(function(r){switch(r.label){case 0:qc.debug("getting list of log streams"),t=new Sr(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),qc.error("error getting log stream - "+n),n;case 5:return[2]}}))}))},e.prototype.getLogEvents=function(e){return Bc(this,void 0,void 0,(function(){var t,n;return Uc(this,(function(r){switch(r.label){case 0:qc.debug("getting log events from stream - ",e.logStreamName),t=new Er(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),qc.error("error getting log events - "+n),n;case 5:return[2]}}))}))},e.prototype.pushLogs=function(e){qc.debug("pushing log events to Cloudwatch..."),this._dataTracker.logEvents=Dc(this._dataTracker.logEvents,e)},e.prototype._validateLogGroupExistsAndCreate=function(e){return Bc(this,void 0,void 0,(function(){var t,n,r,o;return Uc(this,(function(i){switch(i.label){case 0:if(this._dataTracker.verifiedLogGroup)return[2,this._dataTracker.verifiedLogGroup];i.label=1;case 1:return i.trys.push([1,5,,6]),[4,this._ensureCredentials()];case 2:if(!i.sent())throw new Error(c);return[4,this.getLogGroups({logGroupNamePrefix:e})];case 3:return"string"!=typeof(t=i.sent())&&t.logGroups&&(n=t.logGroups.filter((function(t){return t.logGroupName===e}))).length>0?(this._dataTracker.verifiedLogGroup=n[0],[2,n[0]]):[4,this.createLogGroup({logGroupName:e})];case 4:return i.sent(),[2,null];case 5:throw r=i.sent(),o="failure during log group search: "+r,qc.error(o),r;case 6:return[2]}}))}))},e.prototype._validateLogStreamExists=function(e,t){return Bc(this,void 0,void 0,(function(){var n,r,o,i;return Uc(this,(function(a){switch(a.label){case 0:return a.trys.push([0,4,,5]),[4,this._ensureCredentials()];case 1:if(!a.sent())throw new Error(c);return[4,this.getLogStreams({logGroupName:e,logStreamNamePrefix:t})];case 2:return(n=a.sent()).logStreams&&(r=n.logStreams.filter((function(e){return e.logStreamName===t}))).length>0?(this._nextSequenceToken=r[0].uploadSequenceToken,[2,r[0]]):[4,this.createLogStream({logGroupName:e,logStreamName:t})];case 3:return a.sent(),[2,null];case 4:throw o=a.sent(),i="failure during log stream search: "+o,qc.error(i),o;case 5:return[2]}}))}))},e.prototype._sendLogEvents=function(e){return Bc(this,void 0,void 0,(function(){var t,n,r;return Uc(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,this._ensureCredentials()];case 1:if(!o.sent())throw new Error(c);return qc.debug("sending log events to stream - ",e.logStreamName),t=new xr(e),[4,this._initCloudWatchLogs().send(t)];case 2:return[2,o.sent()];case 3:return n=o.sent(),r="failure during log push: "+n,qc.error(r),[3,4];case 4:return[2]}}))}))},e.prototype._initCloudWatchLogs=function(){return new hi({region:this._config.region,credentials:this._config.credentials,customUserAgent:_(),endpoint:this._config.endpoint})},e.prototype._ensureCredentials=function(){return Bc(this,void 0,void 0,(function(){var e=this;return Uc(this,(function(t){switch(t.label){case 0:return[4,zc.get().then((function(t){if(!t)return!1;var n=zc.shear(t);return qc.debug("set credentials for logging",n),e._config.credentials=n,!0})).catch((function(e){return qc.warn("ensure credentials error",e),!1}))];case 1:return[2,t.sent()]}}))}))},e.prototype._getNextSequenceToken=function(){return Bc(this,void 0,void 0,(function(){var e,t;return Uc(this,(function(n){switch(n.label){case 0:if(this._nextSequenceToken&&this._nextSequenceToken.length>0)return[2,this._nextSequenceToken];n.label=1;case 1:return n.trys.push([1,4,,5]),[4,this._validateLogGroupExistsAndCreate(this._config.logGroupName)];case 2:return n.sent(),this._nextSequenceToken=void 0,[4,this._validateLogStreamExists(this._config.logGroupName,this._config.logStreamName)];case 3:return(e=n.sent())&&(this._nextSequenceToken=e.uploadSequenceToken),[2,this._nextSequenceToken];case 4:throw t=n.sent(),qc.error("failure while getting next sequence token: "+t),t;case 5:return[2]}}))}))},e.prototype._safeUploadLogEvents=function(){return Bc(this,void 0,void 0,(function(){var e,t,n,r,o;return Uc(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this._getNextSequenceToken()];case 1:return e=i.sent(),t=0===this._currentLogBatch.length?this._getBufferedBatchOfLogs():this._currentLogBatch,n={logGroupName:this._config.logGroupName,logStreamName:this._config.logStreamName,logEvents:t,sequenceToken:e},this._dataTracker.eventUploadInProgress=!0,[4,this._sendLogEvents(n)];case 2:return r=i.sent(),this._nextSequenceToken=r.nextSequenceToken,this._dataTracker.eventUploadInProgress=!1,this._currentLogBatch=[],[2,r];case 3:if(o=i.sent(),qc.error("error during _safeUploadLogEvents: "+o),!f.includes(o.name))throw this._dataTracker.eventUploadInProgress=!1,o;return this._getNewSequenceTokenAndSubmit({logEvents:this._currentLogBatch,logGroupName:this._config.logGroupName,logStreamName:this._config.logStreamName}),[3,4];case 4:return[2]}}))}))},e.prototype._getBufferedBatchOfLogs=function(){for(var e=0,t=0;e<this._dataTracker.logEvents.length;){var n=this._dataTracker.logEvents[e],r=n?(new TextEncoder).encode(n.message).length+o:0;if(r>a){var s="Log entry exceeds maximum size for CloudWatch logs. Log size: "+r+". Truncating log message.";qc.warn(s),n.message=n.message.substring(0,r)}if(t+r>i)break;t+=r,e++}return this._currentLogBatch=this._dataTracker.logEvents.splice(0,e),this._currentLogBatch},e.prototype._getNewSequenceTokenAndSubmit=function(e){return Bc(this,void 0,void 0,(function(){var t,n,r;return Uc(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),this._nextSequenceToken=void 0,this._dataTracker.eventUploadInProgress=!0,[4,this._getNextSequenceToken()];case 1:return t=o.sent(),e.sequenceToken=t,[4,this._sendLogEvents(e)];case 2:return n=o.sent(),this._dataTracker.eventUploadInProgress=!1,this._currentLogBatch=[],[2,n];case 3:throw r=o.sent(),qc.error("error when retrying log submission with new sequence token: "+r),this._dataTracker.eventUploadInProgress=!1,r;case 4:return[2]}}))}))},e.prototype._initiateLogPushInterval=function(){var e=this;this._timer&&clearInterval(this._timer),this._timer=setInterval((function(){return Bc(e,void 0,void 0,(function(){var e;return Uc(this,(function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),this._getDocUploadPermissibility()?[4,this._safeUploadLogEvents()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[3,4];case 3:return e=t.sent(),qc.error("error when calling _safeUploadLogEvents in the timer interval - "+e),[3,4];case 4:return[2]}}))}))}),2e3)},e.prototype._getDocUploadPermissibility=function(){return(0!==this._dataTracker.logEvents.length||0!==this._currentLogBatch.length)&&!this._dataTracker.eventUploadInProgress},e.PROVIDER_NAME=u,e.CATEGORY=s,e}(),Hc={},Wc={addEventListener:function(e,t){}},$c=Object(U.b)().isBrowser?(new vi).getStorage():void 0;function Kc(e){return(Kc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Vc=function(){function e(){this._logger=new g("ServiceWorker")}return Object.defineProperty(e.prototype,"serviceWorker",{get:function(){return this._serviceWorker},enumerable:!0,configurable:!0}),e.prototype.register=function(e,t){var n=this;return void 0===e&&(e="/service-worker.js"),void 0===t&&(t="/"),this._logger.debug("registering "+e),this._logger.debug("registering service worker with scope "+t),new Promise((function(r,o){if(!navigator||!("serviceWorker"in navigator))return o(new Error("Service Worker not available"));navigator.serviceWorker.register(e,{scope:t}).then((function(e){return e.installing?n._serviceWorker=e.installing:e.waiting?n._serviceWorker=e.waiting:e.active&&(n._serviceWorker=e.active),n._registration=e,n._setupListeners(),n._logger.debug("Service Worker Registration Success: "+e),r(e)})).catch((function(e){return n._logger.debug("Service Worker Registration Failed "+e),o(e)}))}))},e.prototype.enablePush=function(e){var t=this;if(!this._registration)throw new Error("Service Worker not registered");return this._publicKey=e,new Promise((function(n,r){if(!Object(U.b)().isBrowser)return r(new Error("Service Worker not available"));t._registration.pushManager.getSubscription().then((function(r){if(!r)return t._logger.debug("User is NOT subscribed to push"),t._registration.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:t._urlB64ToUint8Array(e)}).then((function(e){t._subscription=e,t._logger.debug("User subscribed: "+JSON.stringify(e)),n(e)})).catch((function(e){t._logger.error(e)}));t._subscription=r,t._logger.debug("User is subscribed to push: "+JSON.stringify(r)),n(r)}))}))},e.prototype._urlB64ToUint8Array=function(e){for(var t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),n=window.atob(t),r=new Uint8Array(n.length),o=0;o<n.length;++o)r[o]=n.charCodeAt(o);return r},e.prototype.send=function(e){this._serviceWorker&&this._serviceWorker.postMessage("object"===Kc(e)?JSON.stringify(e):e)},e.prototype._setupListeners=function(){var e=this;this._serviceWorker.addEventListener("statechange",(function(t){var n=e._serviceWorker.state;e._logger.debug("ServiceWorker statechange: "+n),b.Analytics&&"function"==typeof b.Analytics.record&&b.Analytics.record({name:"ServiceWorker",attributes:{state:n}})})),this._serviceWorker.addEventListener("message",(function(t){e._logger.debug("ServiceWorker message event: "+t)}))},e}(),Yc=n(4);function Zc(e,t){void 0===t&&(t={});var n=function(e){if(e&&"j"===e[0]&&":"===e[1])return e.substr(2);return e}(e);if(function(e,t){return void 0===t&&(t=!e||"{"!==e[0]&&"["!==e[0]&&'"'!==e[0]),!t}(n,t.doNotParse))try{return JSON.parse(n)}catch(e){}return e}var Jc=function(){return(Jc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Xc=function(){function e(e,t){var n=this;this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.cookies=function(e,t){return"string"==typeof e?Yc.parse(e,t):"object"==typeof e&&null!==e?e:{}}(e,t),new Promise((function(){n.HAS_DOCUMENT_COOKIE="object"==typeof document&&"string"==typeof document.cookie})).catch((function(){}))}return e.prototype._updateBrowserValues=function(e){this.HAS_DOCUMENT_COOKIE&&(this.cookies=Yc.parse(document.cookie,e))},e.prototype._emitChange=function(e){for(var t=0;t<this.changeListeners.length;++t)this.changeListeners[t](e)},e.prototype.get=function(e,t,n){return void 0===t&&(t={}),this._updateBrowserValues(n),Zc(this.cookies[e],t)},e.prototype.getAll=function(e,t){void 0===e&&(e={}),this._updateBrowserValues(t);var n={};for(var r in this.cookies)n[r]=Zc(this.cookies[r],e);return n},e.prototype.set=function(e,t,n){var r;"object"==typeof t&&(t=JSON.stringify(t)),this.cookies=Jc(Jc({},this.cookies),((r={})[e]=t,r)),this.HAS_DOCUMENT_COOKIE&&(document.cookie=Yc.serialize(e,t,n)),this._emitChange({name:e,value:t,options:n})},e.prototype.remove=function(e,t){var n=t=Jc(Jc({},t),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=Jc({},this.cookies),delete this.cookies[e],this.HAS_DOCUMENT_COOKIE&&(document.cookie=Yc.serialize(e,"",n)),this._emitChange({name:e,value:void 0,options:t})},e.prototype.addChangeListener=function(e){this.changeListeners.push(e)},e.prototype.removeChangeListener=function(e){var t=this.changeListeners.indexOf(e);t>=0&&this.changeListeners.splice(t,1)},e}(),Qc=Object(U.b)().isBrowser,ef=function(){function e(e){void 0===e&&(e={}),this.cookies=new Xc,this.store=Qc?window.localStorage:Object.create(null),this.cookies=e.req?new Xc(e.req.headers.cookie):new Xc,Object.assign(this.store,this.cookies.getAll())}return Object.defineProperty(e.prototype,"length",{get:function(){return Object.entries(this.store).length},enumerable:!0,configurable:!0}),e.prototype.clear=function(){var e=this;Array.from(new Array(this.length)).map((function(t,n){return e.key(n)})).forEach((function(t){return e.removeItem(t)}))},e.prototype.getItem=function(e){return this.getLocalItem(e)},e.prototype.getLocalItem=function(e){return Object.prototype.hasOwnProperty.call(this.store,e)?this.store[e]:null},e.prototype.getUniversalItem=function(e){return this.cookies.get(e)},e.prototype.key=function(e){return Object.keys(this.store)[e]},e.prototype.removeItem=function(e){this.removeLocalItem(e),this.removeUniversalItem(e)},e.prototype.removeLocalItem=function(e){delete this.store[e]},e.prototype.removeUniversalItem=function(e){this.cookies.remove(e,{path:"/"})},e.prototype.setItem=function(e,t){switch(this.setLocalItem(e,t),e.split(".").pop()){case"LastAuthUser":case"accessToken":case"refreshToken":case"idToken":Qc?this.setUniversalItem(e,t):this.setLocalItem(e,t)}},e.prototype.setLocalItem=function(e,t){this.store[e]=t},e.prototype.setUniversalItem=function(e,t){this.cookies.set(e,t,{path:"/",sameSite:!0,secure:"localhost"!==window.location.hostname})},e}(),tf="undefined"!=typeof Symbol&&"function"==typeof Symbol.for,nf=tf?Symbol.for("INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER"):"@@INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER",rf=tf?Symbol.for("INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER"):"@@INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER",of="x-amz-user-agent",af=function(){function e(){this._queue=[],this._pending=!1}return e.prototype.isLocked=function(){return this._pending},e.prototype.acquire=function(){var e=this,t=new Promise((function(t){return e._queue.push(t)}));return this._pending||this._dispatchNext(),t},e.prototype.runExclusive=function(e){return this.acquire().then((function(t){var n;try{n=e()}catch(e){throw t(),e}return Promise.resolve(n).then((function(e){return t(),e}),(function(e){throw t(),e}))}))},e.prototype._dispatchNext=function(){this._queue.length>0?(this._pending=!0,this._queue.shift()(this._dispatchNext.bind(this))):this._pending=!1},e}(),sf=n(22),uf=n.n(sf).a,cf=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ff=function(){function e(){}return e.prototype.networkMonitor=function(t){if(Object(U.b)().isNode)return uf.from([{online:!0}]);var n=Object(U.h)()?self:window;return new uf((function(t){t.next({online:n.navigator.onLine});var r=function(){return t.next({online:!0})},o=function(){return t.next({online:!1})};return n.addEventListener("online",r),n.addEventListener("offline",o),e._observers.push(t),function(){n.removeEventListener("online",r),n.removeEventListener("offline",o),e._observers=e._observers.filter((function(e){return e!==t}))}}))},e._observerOverride=function(t){var n,r,o=function(n){if(n.closed)return e._observers=e._observers.filter((function(e){return e!==n})),"continue";n.next(t)};try{for(var i=cf(e._observers),a=i.next();!a.done;a=i.next()){o(a.value)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e._observers=[],e}();function lf(e){return e.split("").map((function(e){return e.charCodeAt(0).toString(16).padStart(2,"0")})).join("")}function df(e){return e.match(/.{2}/g).map((function(e){return String.fromCharCode(parseInt(e,16))})).join("")}var hf,pf=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),gf=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},vf=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},mf=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},yf=function(){function e(){this._state=hf.Open,this.jobs=new Set}return e.prototype.add=function(t,n){var r,o;"string"==typeof t?(r=void 0,o=t):(r=t,o=n);var i=this.closedFailure(o);if(i)return i;if(void 0===r)return this.addHook(o);if("function"==typeof r)return this.addFunction(r,o);if(r instanceof e)return this.addManager(r,o);throw new Error("If `job` is provided, it must be an Observable, Function, or BackgroundProcessManager.")},e.prototype.addCleaner=function(e,t){var n=this,r=this.addHook(t),o=r.resolve,i=function(){return gf(n,void 0,void 0,(function(){return vf(this,(function(t){switch(t.label){case 0:return[4,e()];case 1:return t.sent(),o(),[2]}}))}))};return r.onTerminate.then(i),i},e.prototype.addFunction=function(e,t){var n,r=e(new Promise((function(e){n=e})));return"function"==typeof(null==r?void 0:r.then)&&this.registerPromise(r,n,t),r},e.prototype.addManager=function(e,t){var n=this;this.addCleaner((function(){return gf(n,void 0,void 0,(function(){return vf(this,(function(t){switch(t.label){case 0:return[4,e.close()];case 1:return[2,t.sent()]}}))}))}),t)},e.prototype.addHook=function(e){var t,n,r,o=new Promise((function(e,r){t=e,n=r})),i=new Promise((function(e){r=e}));return this.registerPromise(o,r,e),{resolve:t,reject:n,onTerminate:i}},e.prototype.registerPromise=function(e,t,n){var r=this,o={promise:e,terminate:t,description:n};this.jobs.add(o),e.then((function(){r.jobs.delete(o)})).catch((function(){r.jobs.delete(o)}))},Object.defineProperty(e.prototype,"length",{get:function(){return this.jobs.size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pending",{get:function(){return Array.from(this.jobs).map((function(e){return e.description}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._state===hf.Open},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isClosing",{get:function(){return this._state===hf.Closing},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isClosed",{get:function(){return this._state===hf.Closed},enumerable:!0,configurable:!0}),e.prototype.closedFailure=function(e){if(!this.isOpen)return Promise.reject(new bf(["The manager is "+this.state+".",'You tried to add "'+e+'".',"Pending jobs: [\n"+this.pending.map((function(e){return" "+e})).join(",\n")+"\n]"].join("\n")))},e.prototype.close=function(){return gf(this,void 0,void 0,(function(){var e,t,n,r,o;return vf(this,(function(i){switch(i.label){case 0:if(!this.isOpen)return[3,2];this._state=hf.Closing;try{for(e=mf(Array.from(this.jobs)),t=e.next();!t.done;t=e.next()){n=t.value;try{n.terminate()}catch(e){console.warn("Failed to send termination signal to job. Error: "+e.message,n)}}}catch(e){r={error:e}}finally{try{t&&!t.done&&(o=e.return)&&o.call(e)}finally{if(r)throw r.error}}return this._closingPromise=Promise.allSettled(Array.from(this.jobs).map((function(e){return e.promise}))),[4,this._closingPromise];case 1:i.sent(),this._state=hf.Closed,i.label=2;case 2:return[2,this._closingPromise]}}))}))},e.prototype.open=function(){return gf(this,void 0,void 0,(function(){return vf(this,(function(e){switch(e.label){case 0:return this.isClosing?[4,this.close()]:[3,2];case 1:e.sent(),e.label=2;case 2:return this._state=hf.Open,[2]}}))}))},e}(),bf=function(e){function t(t){return e.call(this,"BackgroundManagerNotOpenError: "+t)||this}return pf(t,e),t}(Error);!function(e){e.Open="Open",e.Closing="Closing",e.Closed="Closed"}(hf||(hf={}));var wf={userAgent:w.userAgent};t.default=b},function(e,t,n){"use strict";n.r(t),n.d(t,"fromUtf8",(function(){return r})),n.d(t,"toUtf8",(function(){return o}));var r=function(e){return"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):function(e){for(var t=[],n=0,r=e.length;n<r;n++){var o=e.charCodeAt(n);if(o<128)t.push(o);else if(o<2048)t.push(o>>6|192,63&o|128);else if(n+1<e.length&&55296==(64512&o)&&56320==(64512&e.charCodeAt(n+1))){var i=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n));t.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}else t.push(o>>12|224,o>>6&63|128,63&o|128)}return Uint8Array.from(t)}(e)},o=function(e){return"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):function(e){for(var t="",n=0,r=e.length;n<r;n++){var o=e[n];if(o<128)t+=String.fromCharCode(o);else if(192<=o&&o<224){var i=e[++n];t+=String.fromCharCode((31&o)<<6|63&i)}else if(240<=o&&o<365){var a="%"+[o,e[++n],e[++n],e[++n]].map((function(e){return e.toString(16)})).join("%");t+=decodeURIComponent(a)}else t+=String.fromCharCode((15&o)<<12|(63&e[++n])<<6|63&e[++n])}return t}(e)}},function(e,t,n){"use strict";n.r(t),n.d(t,"fromUtf8",(function(){return r})),n.d(t,"toUtf8",(function(){return o}));const r=e=>"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):(e=>{const t=[];for(let n=0,r=e.length;n<r;n++){const r=e.charCodeAt(n);if(r<128)t.push(r);else if(r<2048)t.push(r>>6|192,63&r|128);else if(n+1<e.length&&55296==(64512&r)&&56320==(64512&e.charCodeAt(n+1))){const o=65536+((1023&r)<<10)+(1023&e.charCodeAt(++n));t.push(o>>18|240,o>>12&63|128,o>>6&63|128,63&o|128)}else t.push(r>>12|224,r>>6&63|128,63&r|128)}return Uint8Array.from(t)})(e),o=e=>"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):(e=>{let t="";for(let n=0,r=e.length;n<r;n++){const r=e[n];if(r<128)t+=String.fromCharCode(r);else if(192<=r&&r<224){const o=e[++n];t+=String.fromCharCode((31&r)<<6|63&o)}else if(240<=r&&r<365){const o="%"+[r,e[++n],e[++n],e[++n]].map(e=>e.toString(16)).join("%");t+=decodeURIComponent(o)}else t+=String.fromCharCode((15&r)<<12|(63&e[++n])<<6|63&e[++n])}return t})(e)}])}));
|
|
31
|
+
t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,u=(1<<s)-1,c=u>>1,f=-7,l=n?o-1:0,d=n?-1:1,h=e[t+l];for(l+=d,i=h&(1<<-f)-1,h>>=-f,f+=s;f>0;i=256*i+e[t+l],l+=d,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=r;f>0;a=256*a+e[t+l],l+=d,f-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=c}return(h?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,u,c=8*i-o-1,f=(1<<c)-1,l=f>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+l>=1?d/u:d*Math.pow(2,1-l))*u>=2&&(a++,u/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(t*u-1)*Math.pow(2,o),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&s,h+=p,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[n+h]=255&a,h+=p,a/=256,c-=8);e[n+h-p]|=128*g}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmptyData=void 0,t.isEmptyData=function(e){return"string"==typeof e?0===e.length:0===e.byteLength}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.numToUint8=void 0,t.numToUint8=function(e){return new Uint8Array([(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=void 0,t.uint32ArrayFrom=function(e){if(!Array.from){for(var t=new Uint32Array(e.length);0<e.length;)t[0]=e[0];return t}return Uint32Array.from(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),(0,n(0).__exportStar)(n(46),t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(0),o=n(16),i=n(47),a=n(48),s=function(){function e(e){if(this.hash=new i.RawSha256,e){this.outer=new i.RawSha256;var t=function(e){var t=(0,a.convertToBuffer)(e);if(t.byteLength>o.BLOCK_SIZE){var n=new i.RawSha256;n.update(t),t=n.digest()}var r=new Uint8Array(o.BLOCK_SIZE);return r.set(t),r}(e),n=new Uint8Array(o.BLOCK_SIZE);n.set(t);for(var r=0;r<o.BLOCK_SIZE;r++)t[r]^=54,n[r]^=92;this.hash.update(t),this.outer.update(n);for(r=0;r<t.byteLength;r++)t[r]=0}}return e.prototype.update=function(e){if(!(0,a.isEmptyData)(e)&&!this.error)try{this.hash.update((0,a.convertToBuffer)(e))}catch(e){this.error=e}},e.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()},e.prototype.digest=function(){return(0,r.__awaiter)(this,void 0,void 0,(function(){return(0,r.__generator)(this,(function(e){return[2,this.digestSync()]}))}))},e}();t.Sha256=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RawSha256=void 0;var r=n(16),o=function(){function e(){this.state=Int32Array.from(r.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,n=e.byteLength;if(this.bytesHashed+=n,8*this.bytesHashed>r.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===r.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(t.setUint8(this.bufferLength++,128),n%r.BLOCK_SIZE>=r.BLOCK_SIZE-8){for(var o=this.bufferLength;o<r.BLOCK_SIZE;o++)t.setUint8(o,0);this.hashBuffer(),this.bufferLength=0}for(o=this.bufferLength;o<r.BLOCK_SIZE-8;o++)t.setUint8(o,0);t.setUint32(r.BLOCK_SIZE-8,Math.floor(e/4294967296),!0),t.setUint32(r.BLOCK_SIZE-4,e),this.hashBuffer(),this.finished=!0}var i=new Uint8Array(r.DIGEST_LENGTH);for(o=0;o<8;o++)i[4*o]=this.state[o]>>>24&255,i[4*o+1]=this.state[o]>>>16&255,i[4*o+2]=this.state[o]>>>8&255,i[4*o+3]=this.state[o]>>>0&255;return i},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,n=t[0],o=t[1],i=t[2],a=t[3],s=t[4],u=t[5],c=t[6],f=t[7],l=0;l<r.BLOCK_SIZE;l++){if(l<16)this.temp[l]=(255&e[4*l])<<24|(255&e[4*l+1])<<16|(255&e[4*l+2])<<8|255&e[4*l+3];else{var d=this.temp[l-2],h=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,p=((d=this.temp[l-15])>>>7|d<<25)^(d>>>18|d<<14)^d>>>3;this.temp[l]=(h+this.temp[l-7]|0)+(p+this.temp[l-16]|0)}var g=(((s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+(s&u^~s&c)|0)+(f+(r.KEY[l]+this.temp[l]|0)|0)|0,v=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&o^n&i^o&i)|0;f=c,c=u,u=s,s=a+g|0,a=i,i=o,o=n,n=g+v|0}t[0]+=n,t[1]+=o,t[2]+=i,t[3]+=a,t[4]+=s,t[5]+=u,t[6]+=c,t[7]+=f},e}();t.RawSha256=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=t.numToUint8=t.isEmptyData=t.convertToBuffer=void 0;var r=n(49);Object.defineProperty(t,"convertToBuffer",{enumerable:!0,get:function(){return r.convertToBuffer}});var o=n(50);Object.defineProperty(t,"isEmptyData",{enumerable:!0,get:function(){return o.isEmptyData}});var i=n(51);Object.defineProperty(t,"numToUint8",{enumerable:!0,get:function(){return i.numToUint8}});var a=n(52);Object.defineProperty(t,"uint32ArrayFrom",{enumerable:!0,get:function(){return a.uint32ArrayFrom}})},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.convertToBuffer=void 0;var r=n(64),o=void 0!==e&&e.from?function(t){return e.from(t,"utf8")}:r.fromUtf8;t.convertToBuffer=function(e){return e instanceof Uint8Array?e:"string"==typeof e?o(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}}).call(this,n(15).Buffer)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmptyData=void 0,t.isEmptyData=function(e){return"string"==typeof e?0===e.length:0===e.byteLength}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.numToUint8=void 0,t.numToUint8=function(e){return new Uint8Array([(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=void 0,t.uint32ArrayFrom=function(e){if(!Array.from){for(var t=new Uint32Array(e.length);0<e.length;)t[0]=e[0];return t}return Uint32Array.from(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(0).__exportStar(n(54),t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.supportsZeroByteGCM=t.supportsSubtleCrypto=t.supportsSecureRandom=t.supportsWebCrypto=void 0;var r=n(0),o=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function i(e){return"object"==typeof e&&"object"==typeof e.crypto&&"function"==typeof e.crypto.getRandomValues}function a(e){return e&&o.every((function(t){return"function"==typeof e[t]}))}t.supportsWebCrypto=function(e){return!(!i(e)||"object"!=typeof e.crypto.subtle)&&a(e.crypto.subtle)},t.supportsSecureRandom=i,t.supportsSubtleCrypto=a,t.supportsZeroByteGCM=function(e){return r.__awaiter(this,void 0,void 0,(function(){var t;return r.__generator(this,(function(n){switch(n.label){case 0:if(!a(e))return[2,!1];n.label=1;case 1:return n.trys.push([1,4,,5]),[4,e.generateKey({name:"AES-GCM",length:128},!1,["encrypt"])];case 2:return t=n.sent(),[4,e.encrypt({name:"AES-GCM",iv:new Uint8Array(Array(12)),additionalData:new Uint8Array(Array(16)),tagLength:128},t,new Uint8Array(0))];case 3:return[2,16===n.sent().byteLength];case 4:return n.sent(),[2,!1];case 5:return[2]}}))}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);r.__exportStar(n(56),t),r.__exportStar(n(57),t),r.__exportStar(n(58),t),r.__exportStar(n(59),t),r.__exportStar(n(60),t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMsWindow=void 0;var r=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];t.isMsWindow=function(e){if(function(e){return"MSInputMethodContext"in e&&"msCrypto"in e}(e)&&void 0!==e.msCrypto.subtle){var t=e.msCrypto,n=t.getRandomValues,o=t.subtle;return r.map((function(e){return o[e]})).concat(n).every((function(e){return"function"==typeof e}))}return!1}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}Object.defineProperty(t,"__esModule",{value:!0}),t.Observable=void 0;var a=function(){return"function"==typeof Symbol},s=function(e){return a()&&Boolean(Symbol[e])},u=function(e){return s(e)?Symbol[e]:"@@"+e};a()&&!s("observable")&&(Symbol.observable=Symbol("observable"));var c=u("iterator"),f=u("observable"),l=u("species");function d(e,t){var n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function h(e){var t=e.constructor;return void 0!==t&&null===(t=t[l])&&(t=void 0),void 0!==t?t:E}function p(e){return e instanceof E}function g(e){g.log?g.log(e):setTimeout((function(){throw e}))}function v(e){Promise.resolve().then((function(){try{e()}catch(e){g(e)}}))}function m(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var n=d(t,"unsubscribe");n&&n.call(t)}}catch(e){g(e)}}function y(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function b(e,t,n){e._state="running";var r=e._observer;try{var o=d(r,t);switch(t){case"next":o&&o.call(r,n);break;case"error":if(y(e),!o)throw n;o.call(r,n);break;case"complete":y(e),o&&o.call(r)}}catch(e){g(e)}"closed"===e._state?m(e):"running"===e._state&&(e._state="ready")}function w(e,t,n){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:n}],void v((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var n=0;n<t.length&&(b(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e)}))):void b(e,t,n);e._queue.push({type:t,value:n})}}var _=function(){function e(t,n){r(this,e),this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";var o=new S(this);try{this._cleanup=n.call(void 0,o)}catch(e){o.error(e)}"initializing"===this._state&&(this._state="ready")}return i(e,[{key:"unsubscribe",value:function(){"closed"!==this._state&&(y(this),m(this))}},{key:"closed",get:function(){return"closed"===this._state}}]),e}(),S=function(){function e(t){r(this,e),this._subscription=t}return i(e,[{key:"next",value:function(e){w(this._subscription,"next",e)}},{key:"error",value:function(e){w(this._subscription,"error",e)}},{key:"complete",value:function(){w(this._subscription,"complete")}},{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),E=function(){function e(t){if(r(this,e),!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}return i(e,[{key:"subscribe",value:function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new _(e,this._subscriber)}},{key:"forEach",value:function(e){var t=this;return new Promise((function(n,r){if("function"==typeof e)var o=t.subscribe({next:function(t){try{e(t,i)}catch(e){r(e),o.unsubscribe()}},error:r,complete:n});else r(new TypeError(e+" is not a function"));function i(){o.unsubscribe(),n()}}))}},{key:"map",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(h(this))((function(n){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))}},{key:"filter",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(h(this))((function(n){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))}},{key:"reduce",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=h(this),r=arguments.length>1,o=!1,i=arguments[1],a=i;return new n((function(n){return t.subscribe({next:function(t){var i=!o;if(o=!0,!i||r)try{a=e(a,t)}catch(e){return n.error(e)}else a=t},error:function(e){n.error(e)},complete:function(){if(!o&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(a),n.complete()}})}))}},{key:"concat",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=h(this);return new o((function(t){var r,i=0;return function e(a){r=a.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){i===n.length?(r=void 0,t.complete()):e(o.from(n[i++]))}})}(e),function(){r&&(r.unsubscribe(),r=void 0)}}))}},{key:"flatMap",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=h(this);return new n((function(r){var o=[],i=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return r.error(e)}var i=n.from(t).subscribe({next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){var e=o.indexOf(i);e>=0&&o.splice(e,1),a()}});o.push(i)},error:function(e){r.error(e)},complete:function(){a()}});function a(){i.closed&&0===o.length&&r.complete()}return function(){o.forEach((function(e){return e.unsubscribe()})),i.unsubscribe()}}))}},{key:f,value:function(){return this}}],[{key:"from",value:function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=d(t,f);if(r){var o=r.call(t);if(Object(o)!==o)throw new TypeError(o+" is not an object");return p(o)&&o.constructor===n?o:new n((function(e){return o.subscribe(e)}))}if(s("iterator")&&(r=d(t,c)))return new n((function(e){v((function(){if(!e.closed){var n=!0,o=!1,i=void 0;try{for(var a,s=r.call(t)[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;if(e.next(u),e.closed)return}}catch(e){o=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}e.complete()}}))}));if(Array.isArray(t))return new n((function(e){v((function(){if(!e.closed){for(var n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")}},{key:"of",value:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o="function"==typeof this?this:e;return new o((function(e){v((function(){if(!e.closed){for(var t=0;t<n.length;++t)if(e.next(n[t]),e.closed)return;e.complete()}}))}))}},{key:l,get:function(){return this}}]),e}();t.Observable=E,a()&&Object.defineProperty(E,Symbol("extensions"),{value:{symbol:f,hostReportError:g},configurable:!0})},function(e,t,n){"use strict";n.r(t),n.d(t,"AmplifyClass",(function(){return y})),n.d(t,"ClientDevice",(function(){return x})),n.d(t,"ConsoleLogger",(function(){return g})),n.d(t,"Logger",(function(){return g})),n.d(t,"missingConfig",(function(){return A})),n.d(t,"invalidParameter",(function(){return O})),n.d(t,"Hub",(function(){return T})),n.d(t,"I18n",(function(){return B})),n.d(t,"isEmpty",(function(){return U.e})),n.d(t,"sortByField",(function(){return U.k})),n.d(t,"objectLessAttributes",(function(){return U.j})),n.d(t,"filenameToContentType",(function(){return U.c})),n.d(t,"isTextFile",(function(){return U.g})),n.d(t,"generateRandomString",(function(){return U.d})),n.d(t,"makeQuerablePromise",(function(){return U.i})),n.d(t,"isWebWorker",(function(){return U.h})),n.d(t,"browserOrNode",(function(){return U.b})),n.d(t,"transferKeyToLowerCase",(function(){return U.l})),n.d(t,"transferKeyToUpperCase",(function(){return U.m})),n.d(t,"isStrictObject",(function(){return U.f})),n.d(t,"JS",(function(){return U.a})),n.d(t,"Signer",(function(){return ue})),n.d(t,"parseMobileHubConfig",(function(){return le})),n.d(t,"Parser",(function(){return de})),n.d(t,"AWSCloudWatchProvider",(function(){return Gc})),n.d(t,"FacebookOAuth",(function(){return Fi})),n.d(t,"GoogleOAuth",(function(){return Ui})),n.d(t,"Linking",(function(){return Hc})),n.d(t,"AppState",(function(){return Wc})),n.d(t,"AsyncStorage",(function(){return $c})),n.d(t,"Credentials",(function(){return zc})),n.d(t,"CredentialsClass",(function(){return Nc})),n.d(t,"ServiceWorker",(function(){return Vc})),n.d(t,"StorageHelper",(function(){return vi})),n.d(t,"MemoryStorage",(function(){return gi})),n.d(t,"UniversalStorage",(function(){return ef})),n.d(t,"Platform",(function(){return w})),n.d(t,"getAmplifyUserAgent",(function(){return _})),n.d(t,"INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER",(function(){return nf})),n.d(t,"INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER",(function(){return rf})),n.d(t,"USER_AGENT_HEADER",(function(){return of})),n.d(t,"Constants",(function(){return wf})),n.d(t,"NonRetryableError",(function(){return Ai})),n.d(t,"retry",(function(){return Oi})),n.d(t,"jitteredBackoff",(function(){return ki})),n.d(t,"jitteredExponentialRetry",(function(){return Li})),n.d(t,"Mutex",(function(){return af})),n.d(t,"Reachability",(function(){return ff})),n.d(t,"DateUtils",(function(){return V})),n.d(t,"urlSafeEncode",(function(){return lf})),n.d(t,"urlSafeDecode",(function(){return df})),n.d(t,"AWS_CLOUDWATCH_BASE_BUFFER_SIZE",(function(){return o})),n.d(t,"AWS_CLOUDWATCH_CATEGORY",(function(){return s})),n.d(t,"AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE",(function(){return i})),n.d(t,"AWS_CLOUDWATCH_MAX_EVENT_SIZE",(function(){return a})),n.d(t,"AWS_CLOUDWATCH_PROVIDER_NAME",(function(){return u})),n.d(t,"NO_CREDS_ERROR_STRING",(function(){return c})),n.d(t,"RETRY_ERROR_CODES",(function(){return f})),n.d(t,"BackgroundProcessManager",(function(){return yf})),n.d(t,"BackgroundManagerNotOpenError",(function(){return bf})),n.d(t,"BackgroundProcessManagerState",(function(){return hf})),n.d(t,"Amplify",(function(){return b}));var r,o=26,i=1048576,a=256e3,s="Logging",u="AWSCloudWatch",c="No credentials",f=["ResourceNotFoundException","InvalidSequenceTokenException"],l=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},d=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},h=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(d(arguments[t]));return e},p={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5};!function(e){e.DEBUG="DEBUG",e.ERROR="ERROR",e.INFO="INFO",e.WARN="WARN",e.VERBOSE="VERBOSE"}(r||(r={}));var g=function(){function e(e,t){void 0===t&&(t=r.WARN),this.name=e,this.level=t,this._pluggables=[]}return e.prototype._padding=function(e){return e<10?"0"+e:""+e},e.prototype._ts=function(){var e=new Date;return[this._padding(e.getMinutes()),this._padding(e.getSeconds())].join(":")+"."+e.getMilliseconds()},e.prototype.configure=function(e){return e?(this._config=e,this._config):this._config},e.prototype._log=function(t){for(var n,o,i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];var s=this.level;e.LOG_LEVEL&&(s=e.LOG_LEVEL),"undefined"!=typeof window&&window.LOG_LEVEL&&(s=window.LOG_LEVEL);var u=p[s],c=p[t];if(c>=u){var f=console.log.bind(console);t===r.ERROR&&console.error&&(f=console.error.bind(console)),t===r.WARN&&console.warn&&(f=console.warn.bind(console));var d="["+t+"] "+this._ts()+" "+this.name,h="";if(1===i.length&&"string"==typeof i[0])f(h=d+" - "+i[0]);else if(1===i.length)h=d+" "+i[0],f(d,i[0]);else if("string"==typeof i[0]){var g=i.slice(1);1===g.length&&(g=g[0]),h=d+" - "+i[0]+" "+g,f(d+" - "+i[0],g)}else h=d+" "+i,f(d,i);try{for(var v=l(this._pluggables),m=v.next();!m.done;m=v.next()){var y=m.value,b={message:h,timestamp:Date.now()};y.pushLogs([b])}}catch(e){n={error:e}}finally{try{m&&!m.done&&(o=v.return)&&o.call(v)}finally{if(n)throw n.error}}}},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,h([r.INFO],e))},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,h([r.INFO],e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,h([r.WARN],e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,h([r.ERROR],e))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,h([r.DEBUG],e))},e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,h([r.VERBOSE],e))},e.prototype.addPluggable=function(e){e&&e.getCategoryName()===s&&(this._pluggables.push(e),e.configure(this._config))},e.prototype.listPluggables=function(){return this._pluggables},e.LOG_LEVEL=null,e}(),v=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},m=new g("Amplify"),y=function(){function e(){this._components=[],this._config={},this._modules={},this.Auth=null,this.Analytics=null,this.API=null,this.Credentials=null,this.Storage=null,this.I18n=null,this.Cache=null,this.PubSub=null,this.Interactions=null,this.Pushnotification=null,this.UI=null,this.XR=null,this.Predictions=null,this.DataStore=null,this.Geo=null,this.Logger=g,this.ServiceWorker=null}return e.prototype.register=function(e){m.debug("component registered in amplify",e),this._components.push(e),"function"==typeof e.getModuleName?(this._modules[e.getModuleName()]=e,this[e.getModuleName()]=e):m.debug("no getModuleName method for component",e),e.configure(this._config)},e.prototype.configure=function(e){var t=this;return e?(this._config=Object.assign(this._config,e),m.debug("amplify config",this._config),Object.entries(this._modules).forEach((function(e){var n=v(e,2),r=(n[0],n[1]);Object.keys(r).forEach((function(e){t._modules[e]&&(r[e]=t._modules[e])}))})),this._components.map((function(e){e.configure(t._config)})),this._config):this._config},e.prototype.addPluggable=function(e){e&&e.getCategory&&"function"==typeof e.getCategory&&this._components.map((function(t){t.addPluggable&&"function"==typeof t.addPluggable&&t.addPluggable(e)}))},e}(),b=new y,w={userAgent:"aws-amplify/4.7.9 js",product:"",navigator:null,isReactNative:!1};if("undefined"!=typeof navigator&&navigator.product)switch(w.product=navigator.product||"",w.navigator=navigator||null,navigator.product){case"ReactNative":w.userAgent="aws-amplify/4.7.9 react-native",w.isReactNative=!0;break;default:w.userAgent="aws-amplify/4.7.9 js",w.isReactNative=!1}var _=function(e){return""+w.userAgent+(e||"")},S=new g("ClientDevice_Browser");function E(){return"undefined"==typeof window?{}:function(){if("undefined"==typeof window)return S.warn("No window object available to get browser client info"),{};var e=window.navigator;if(!e)return S.warn("No navigator object available to get browser client info"),{};var t=e.platform,n=e.product,r=e.vendor,o=e.userAgent,i=e.language,a=function(e){var t=/.+(Opera[\s[A-Z]*|OPR[\sA-Z]*)\/([0-9\.]+).*/i.exec(e);if(t)return{type:t[1],version:t[2]};var n=/.+(Trident|Edge)\/([0-9\.]+).*/i.exec(e);if(n)return{type:n[1],version:n[2]};var r=/.+(Chrome|Firefox|FxiOS)\/([0-9\.]+).*/i.exec(e);if(r)return{type:r[1],version:r[2]};var o=/.+(Safari)\/([0-9\.]+).*/i.exec(e);if(o)return{type:o[1],version:o[2]};var i=/.+(AppleWebKit)\/([0-9\.]+).*/i.exec(e);if(i)return{type:i[1],version:i[2]};var a=/.*([A-Z]+)\/([0-9\.]+).*/i.exec(e);if(a)return{type:a[1],version:a[2]};return{type:"",version:""}}(o),s=(u=/\(([A-Za-z\s].*)\)/.exec((new Date).toString()),u&&u[1]||"");var u;return{platform:t,make:n||r,model:a.type,version:a.version,appVersion:[a.type,a.version].join("/"),language:i,timezone:s}}()}var x=function(){function e(){}return e.clientInfo=function(){return E()},e.dimension=function(){return"undefined"==typeof window?(S.warn("No window object available to get browser client info"),{width:320,height:320}):{width:window.innerWidth,height:window.innerHeight}},e}();function A(e){return new Error("Missing config value of "+e)}function O(e){return new Error("Invalid parameter value of "+e)}var k=function(){return(k=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},L=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},I=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(L(arguments[t]));return e},P=new g("Hub"),C="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default";var T=new(function(){function e(e){this.listeners=[],this.patterns=[],this.protectedChannels=["core","auth","api","analytics","interactions","pubsub","storage","ui","xr"],this.name=e}return e.prototype.remove=function(e,t){if(e instanceof RegExp){var n=this.patterns.find((function(t){return t.pattern.source===e.source}));if(!n)return void P.warn("No listeners for "+e);this.patterns=I(this.patterns.filter((function(e){return e!==n})))}else{var r=this.listeners[e];if(!r)return void P.warn("No listeners for "+e);this.listeners[e]=I(r.filter((function(e){return e.callback!==t})))}},e.prototype.dispatch=function(e,t,n,r){(void 0===n&&(n=""),this.protectedChannels.indexOf(e)>-1)&&(r===C||P.warn("WARNING: "+e+" is protected and dispatching on it can have unintended consequences"));var o={channel:e,payload:k({},t),source:n,patternInfo:[]};try{this._toListeners(o)}catch(e){P.error(e)}},e.prototype.listen=function(e,t,n){var r,o=this;if(void 0===n&&(n="noname"),function(e){return void 0!==e.onHubCapsule}(t))P.warn("WARNING onHubCapsule is Deprecated. Please pass in a callback."),r=t.onHubCapsule.bind(t);else{if("function"!=typeof t)throw new Error("No callback supplied to Hub");r=t}if(e instanceof RegExp)this.patterns.push({pattern:e,callback:r});else{var i=this.listeners[e];i||(i=[],this.listeners[e]=i),i.push({name:n,callback:r})}return function(){o.remove(e,r)}},e.prototype._toListeners=function(e){var t=e.channel,n=e.payload,r=this.listeners[t];if(r&&r.forEach((function(r){P.debug("Dispatching to "+t+" with ",n);try{r.callback(e)}catch(e){P.error(e)}})),this.patterns.length>0){if(!n.message)return void P.warn("Cannot perform pattern matching without a message key");var o=n.message;this.patterns.forEach((function(t){var n=o.match(t.pattern);if(n){var r=L(n).slice(1),i=k(k({},e),{patternInfo:r});try{t.callback(i)}catch(e){P.error(e)}}}))}},e}())("__default__"),j=new g("I18n"),R=function(){function e(e){this._options=null,this._lang=null,this._dict={},this._options=Object.assign({},e),this._lang=this._options.language,!this._lang&&"undefined"!=typeof window&&window&&window.navigator&&(this._lang=window.navigator.language),j.debug(this._lang)}return e.prototype.setLanguage=function(e){this._lang=e},e.prototype.get=function(e,t){if(void 0===t&&(t=void 0),!this._lang)return void 0!==t?t:e;var n=this._lang,r=this.getByLanguage(e,n);return r||(n.indexOf("-")>0&&(r=this.getByLanguage(e,n.split("-")[0])),r||(void 0!==t?t:e))},e.prototype.getByLanguage=function(e,t,n){if(void 0===n&&(n=null),!t)return n;var r=this._dict[t];return r?r[e]:n},e.prototype.putVocabulariesForLanguage=function(e,t){var n=this._dict[e];n||(n=this._dict[e]={}),Object.assign(n,t)},e.prototype.putVocabularies=function(e){var t=this;Object.keys(e).map((function(n){t.putVocabulariesForLanguage(n,e[n])}))},e}(),M=new g("I18n"),N=null,z=null,B=function(){function e(){}return e.configure=function(t){return M.debug("configure I18n"),t?(N=Object.assign({},N,t.I18n||t),e.createInstance(),N):N},e.getModuleName=function(){return"I18n"},e.createInstance=function(){M.debug("create I18n instance"),z||(z=new R(N))},e.setLanguage=function(t){return e.checkConfig(),z.setLanguage(t)},e.get=function(t,n){return e.checkConfig()?z.get(t,n):void 0===n?t:n},e.putVocabulariesForLanguage=function(t,n){return e.checkConfig(),z.putVocabulariesForLanguage(t,n)},e.putVocabularies=function(t){return e.checkConfig(),z.putVocabularies(t)},e.checkConfig=function(){return z||(z=new R(N)),!0},e}();b.register(B);for(var U=n(1),F=n(7),D={},q={},G=0;G<256;G++){var H=G.toString(16).toLowerCase();1===H.length&&(H="0"+H),D[G]=H,q[H]=G}function W(e){for(var t="",n=0;n<e.byteLength;n++)t+=D[e[n]];return t}var $=n(3),K=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},V={clockOffset:0,getDateWithClockOffset:function(){return V.clockOffset?new Date((new Date).getTime()+V.clockOffset):new Date},getClockOffset:function(){return V.clockOffset},getHeaderStringFromDate:function(e){return void 0===e&&(e=V.getDateWithClockOffset()),e.toISOString().replace(/[:\-]|\.\d{3}/g,"")},getDateFromHeaderString:function(e){var t=K(e.match(/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2}).+/),7),n=t[1],r=t[2],o=t[3],i=t[4],a=t[5],s=t[6];return new Date(Date.UTC(Number(n),Number(r)-1,Number(o),Number(i),Number(a),Number(s)))},isClockSkewed:function(e){return Math.abs(e.getTime()-V.getDateWithClockOffset().getTime())>=3e5},isClockSkewError:function(e){if(!e.response||!e.response.headers)return!1;var t=e.response.headers;return Boolean(["BadRequestException","InvalidSignatureException"].includes(t["x-amzn-errortype"])&&(t.date||t.Date))},setClockOffset:function(e){V.clockOffset=e}};function Y(e){return(Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Z=function(){return(Z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},J=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},X=new g("Signer"),Q=function(e,t){var n=new F.Sha256(e);return n.update(t),n.digestSync()},ee=function(e){var t=e||"",n=new F.Sha256;return n.update(t),W(n.digestSync())},te=function(e){return Object.keys(e).map((function(e){return e.toLowerCase()})).sort().join(";")},ne=function(e){var t,n,r=Object($.parse)(e.url);return[e.method||"/",encodeURIComponent(r.pathname).replace(/%2F/gi,"/"),(n=r.query,n&&0!==n.length?n.split("&").map((function(e){var t=e.split("=");if(1===t.length)return e;var n=t[1].replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}));return t[0]+"="+n})).sort((function(e,t){var n=e.split("=")[0],r=t.split("=")[0];return n===r?e<t?-1:1:n<r?-1:1})).join("&"):""),(t=e.headers,t&&0!==Object.keys(t).length?Object.keys(t).map((function(e){return{key:e.toLowerCase(),value:t[e]?t[e].trim().replace(/\s+/g," "):""}})).sort((function(e,t){return e.key<t.key?-1:1})).map((function(e){return e.key+":"+e.value})).join("\n")+"\n":""),te(e.headers),ee(e.data)].join("\n")},re=function(e){var t=(Object($.parse)(e.url).host.match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com$/)||[]).slice(1,3);return"es"===t[1]&&(t=t.reverse()),{service:e.service||t[0],region:e.region||t[1]}},oe=function(e,t,n){return[e,t,n,"aws4_request"].join("/")},ie=function(e,t,n,r){return[e,n,r,ee(t)].join("\n")},ae=function(e,t,n){X.debug(n);var r=Q("AWS4"+e,t),o=Q(r,n.region),i=Q(o,n.service);return Q(i,"aws4_request")},se=function(e,t){return W(Q(e,t))},ue=function(){function e(){}return e.sign=function(e,t,n){if(void 0===n&&(n=null),e.headers=e.headers||{},e.body&&!e.data)throw new Error('The attribute "body" was found on the request object. Please use the attribute "data" instead.');var r=V.getDateWithClockOffset().toISOString().replace(/[:\-]|\.\d{3}/g,""),o=r.substr(0,8),i=Object($.parse)(e.url);e.headers.host=i.host,e.headers["x-amz-date"]=r,t.session_token&&(e.headers["X-Amz-Security-Token"]=t.session_token);var a=ne(e);X.debug(a);var s=n||re(e),u=oe(o,s.region,s.service),c=ie("AWS4-HMAC-SHA256",a,r,u),f=ae(t.secret_key,o,s),l=se(f,c),d=function(e,t,n,r,o){return[e+" Credential="+t+"/"+n,"SignedHeaders="+r,"Signature="+o].join(", ")}("AWS4-HMAC-SHA256",t.access_key,u,te(e.headers),l);return e.headers.Authorization=d,e},e.signUrl=function(e,t,n,r){var o="object"===Y(e)?e.url:e,i="object"===Y(e)?e.method:"GET",a="object"===Y(e)?e.body:void 0,s=V.getDateWithClockOffset().toISOString().replace(/[:\-]|\.\d{3}/g,""),u=s.substr(0,8),c=Object($.parse)(o,!0,!0),f=(c.search,J(c,["search"])),l={host:f.host},d=n||re({url:Object($.format)(f)}),h=d.region,p=d.service,g=oe(u,h,p),v=t.session_token&&"iotdevicegateway"!==p,m=Z(Z(Z({"X-Amz-Algorithm":"AWS4-HMAC-SHA256","X-Amz-Credential":[t.access_key,g].join("/"),"X-Amz-Date":s.substr(0,16)},v?{"X-Amz-Security-Token":""+t.session_token}:{}),r?{"X-Amz-Expires":""+r}:{}),{"X-Amz-SignedHeaders":Object.keys(l).join(",")}),y=ne({method:i,url:Object($.format)(Z(Z({},f),{query:Z(Z({},f.query),m)})),headers:l,data:a}),b=ie("AWS4-HMAC-SHA256",y,s,g),w=ae(t.secret_key,u,{region:h,service:p}),_=se(w,b),S=Z({"X-Amz-Signature":_},t.session_token&&{"X-Amz-Security-Token":t.session_token});return Object($.format)({protocol:f.protocol,slashes:!0,hostname:f.hostname,port:f.port,pathname:f.pathname,query:Z(Z(Z({},f.query),m),S)})},e}(),ce=function(){return(ce=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},fe=new g("Parser"),le=function(e){var t,n={};if(e.aws_mobile_analytics_app_id){var r={AWSPinpoint:{appId:e.aws_mobile_analytics_app_id,region:e.aws_mobile_analytics_app_region}};n.Analytics=r}return(e.aws_cognito_identity_pool_id||e.aws_user_pools_id)&&(n.Auth={userPoolId:e.aws_user_pools_id,userPoolWebClientId:e.aws_user_pools_web_client_id,region:e.aws_cognito_region,identityPoolId:e.aws_cognito_identity_pool_id,identityPoolRegion:e.aws_cognito_region,mandatorySignIn:"enable"===e.aws_mandatory_sign_in,signUpVerificationMethod:e.aws_cognito_sign_up_verification_method||"code"}),t=e.aws_user_files_s3_bucket?{AWSS3:{bucket:e.aws_user_files_s3_bucket,region:e.aws_user_files_s3_bucket_region,dangerouslyConnectToHttpEndpointForTesting:e.aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing}}:e?e.Storage||e:{},e.Logging&&(n.Logging=ce(ce({},e.Logging),{region:e.aws_project_region})),e.geo&&(n.Geo=Object.assign({},e.geo),e.geo.amazon_location_service&&(n.Geo={AmazonLocationService:e.geo.amazon_location_service})),n.Analytics=Object.assign({},n.Analytics,e.Analytics),n.Auth=Object.assign({},n.Auth,e.Auth),n.Storage=Object.assign({},t),n.Logging=Object.assign({},n.Logging,e.Logging),fe.debug("parse config",e,"to amplifyconfig",n),n},de=function(){function e(){}return e.parseMobilehubConfig=le,e}(),he=function(e,t){return(he=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function pe(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}he(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var ge=function(){return(ge=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function ve(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function me(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}Object.create;function ye(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}var be,we,_e,Se,Ee,xe,Ae,Oe,ke,Le,Ie,Pe,Ce,Te,je,Re,Me,Ne,ze,Be,Ue,Fe,De,qe,Ge,He,We,$e,Ke,Ve,Ye,Ze,Je,Xe,Qe,et,tt,nt,rt,ot,it,at,st,ut,ct,ft,lt,dt,ht,pt,gt,vt,mt,yt,bt,wt,_t,St,Et,xt,At,Ot,kt,Lt,It,Pt,Ct,Tt,jt,Rt,Mt,Nt,zt,Bt,Ut,Ft,Dt,qt,Gt,Ht,Wt,$t,Kt,Vt,Yt,Zt,Jt,Xt,Qt,en,tn,nn,rn,on,an,sn,un,cn,fn,ln,dn,hn,pn,gn;Object.create;(be||(be={})).filterSensitiveLog=function(e){return ge({},e)},(we||(we={})).filterSensitiveLog=function(e){return ge({},e)},(_e||(_e={})).filterSensitiveLog=function(e){return ge({},e)},(Se||(Se={})).filterSensitiveLog=function(e){return ge({},e)},(Ee||(Ee={})).filterSensitiveLog=function(e){return ge({},e)},(xe||(xe={})).filterSensitiveLog=function(e){return ge({},e)},(Ae||(Ae={})).filterSensitiveLog=function(e){return ge({},e)},(Oe||(Oe={})).filterSensitiveLog=function(e){return ge({},e)},(ke||(ke={})).filterSensitiveLog=function(e){return ge({},e)},(Le||(Le={})).filterSensitiveLog=function(e){return ge({},e)},(Ie||(Ie={})).filterSensitiveLog=function(e){return ge({},e)},(Pe||(Pe={})).filterSensitiveLog=function(e){return ge({},e)},(Ce||(Ce={})).filterSensitiveLog=function(e){return ge({},e)},(Te||(Te={})).filterSensitiveLog=function(e){return ge({},e)},(je||(je={})).filterSensitiveLog=function(e){return ge({},e)},(Re||(Re={})).filterSensitiveLog=function(e){return ge({},e)},(Me||(Me={})).filterSensitiveLog=function(e){return ge({},e)},(Ne||(Ne={})).filterSensitiveLog=function(e){return ge({},e)},(ze||(ze={})).filterSensitiveLog=function(e){return ge({},e)},(Be||(Be={})).filterSensitiveLog=function(e){return ge({},e)},(Ue||(Ue={})).filterSensitiveLog=function(e){return ge({},e)},(Fe||(Fe={})).filterSensitiveLog=function(e){return ge({},e)},(De||(De={})).filterSensitiveLog=function(e){return ge({},e)},(qe||(qe={})).filterSensitiveLog=function(e){return ge({},e)},(Ge||(Ge={})).filterSensitiveLog=function(e){return ge({},e)},(He||(He={})).filterSensitiveLog=function(e){return ge({},e)},function(e){e.CANCELLED="CANCELLED",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.PENDING="PENDING",e.PENDING_CANCEL="PENDING_CANCEL",e.RUNNING="RUNNING"}(We||(We={})),($e||($e={})).filterSensitiveLog=function(e){return ge({},e)},(Ke||(Ke={})).filterSensitiveLog=function(e){return ge({},e)},(Ve||(Ve={})).filterSensitiveLog=function(e){return ge({},e)},(Ye||(Ye={})).filterSensitiveLog=function(e){return ge({},e)},(Ze||(Ze={})).filterSensitiveLog=function(e){return ge({},e)},(Je||(Je={})).filterSensitiveLog=function(e){return ge({},e)},(Xe||(Xe={})).filterSensitiveLog=function(e){return ge({},e)},(Qe||(Qe={})).filterSensitiveLog=function(e){return ge({},e)},function(e){e.LastEventTime="LastEventTime",e.LogStreamName="LogStreamName"}(et||(et={})),(tt||(tt={})).filterSensitiveLog=function(e){return ge({},e)},(nt||(nt={})).filterSensitiveLog=function(e){return ge({},e)},(rt||(rt={})).filterSensitiveLog=function(e){return ge({},e)},(ot||(ot={})).filterSensitiveLog=function(e){return ge({},e)},(it||(it={})).filterSensitiveLog=function(e){return ge({},e)},(at||(at={})).filterSensitiveLog=function(e){return ge({},e)},(st||(st={})).filterSensitiveLog=function(e){return ge({},e)},function(e){e.Cancelled="Cancelled",e.Complete="Complete",e.Failed="Failed",e.Running="Running",e.Scheduled="Scheduled"}(ut||(ut={})),(ct||(ct={})).filterSensitiveLog=function(e){return ge({},e)},(ft||(ft={})).filterSensitiveLog=function(e){return ge({},e)},(lt||(lt={})).filterSensitiveLog=function(e){return ge({},e)},(dt||(dt={})).filterSensitiveLog=function(e){return ge({},e)},(ht||(ht={})).filterSensitiveLog=function(e){return ge({},e)},(pt||(pt={})).filterSensitiveLog=function(e){return ge({},e)},(gt||(gt={})).filterSensitiveLog=function(e){return ge({},e)},(vt||(vt={})).filterSensitiveLog=function(e){return ge({},e)},(mt||(mt={})).filterSensitiveLog=function(e){return ge({},e)},(yt||(yt={})).filterSensitiveLog=function(e){return ge({},e)},function(e){e.ByLogStream="ByLogStream",e.Random="Random"}(bt||(bt={})),(wt||(wt={})).filterSensitiveLog=function(e){return ge({},e)},(_t||(_t={})).filterSensitiveLog=function(e){return ge({},e)},(St||(St={})).filterSensitiveLog=function(e){return ge({},e)},(Et||(Et={})).filterSensitiveLog=function(e){return ge({},e)},(xt||(xt={})).filterSensitiveLog=function(e){return ge({},e)},(At||(At={})).filterSensitiveLog=function(e){return ge({},e)},(Ot||(Ot={})).filterSensitiveLog=function(e){return ge({},e)},(kt||(kt={})).filterSensitiveLog=function(e){return ge({},e)},(Lt||(Lt={})).filterSensitiveLog=function(e){return ge({},e)},(It||(It={})).filterSensitiveLog=function(e){return ge({},e)},(Pt||(Pt={})).filterSensitiveLog=function(e){return ge({},e)},(Ct||(Ct={})).filterSensitiveLog=function(e){return ge({},e)},(Tt||(Tt={})).filterSensitiveLog=function(e){return ge({},e)},(jt||(jt={})).filterSensitiveLog=function(e){return ge({},e)},(Rt||(Rt={})).filterSensitiveLog=function(e){return ge({},e)},(Mt||(Mt={})).filterSensitiveLog=function(e){return ge({},e)},(Nt||(Nt={})).filterSensitiveLog=function(e){return ge({},e)},(zt||(zt={})).filterSensitiveLog=function(e){return ge({},e)},(Bt||(Bt={})).filterSensitiveLog=function(e){return ge({},e)},(Ut||(Ut={})).filterSensitiveLog=function(e){return ge({},e)},(Ft||(Ft={})).filterSensitiveLog=function(e){return ge({},e)},(Dt||(Dt={})).filterSensitiveLog=function(e){return ge({},e)},(qt||(qt={})).filterSensitiveLog=function(e){return ge({},e)},(Gt||(Gt={})).filterSensitiveLog=function(e){return ge({},e)},(Ht||(Ht={})).filterSensitiveLog=function(e){return ge({},e)},(Wt||(Wt={})).filterSensitiveLog=function(e){return ge({},e)},($t||($t={})).filterSensitiveLog=function(e){return ge({},e)},(Kt||(Kt={})).filterSensitiveLog=function(e){return ge({},e)},(Vt||(Vt={})).filterSensitiveLog=function(e){return ge({},e)},(Yt||(Yt={})).filterSensitiveLog=function(e){return ge({},e)},(Zt||(Zt={})).filterSensitiveLog=function(e){return ge({},e)},(Jt||(Jt={})).filterSensitiveLog=function(e){return ge({},e)},(Xt||(Xt={})).filterSensitiveLog=function(e){return ge({},e)},(Qt||(Qt={})).filterSensitiveLog=function(e){return ge({},e)},(en||(en={})).filterSensitiveLog=function(e){return ge({},e)},(tn||(tn={})).filterSensitiveLog=function(e){return ge({},e)},(nn||(nn={})).filterSensitiveLog=function(e){return ge({},e)},(rn||(rn={})).filterSensitiveLog=function(e){return ge({},e)},(on||(on={})).filterSensitiveLog=function(e){return ge({},e)},(an||(an={})).filterSensitiveLog=function(e){return ge({},e)},(sn||(sn={})).filterSensitiveLog=function(e){return ge({},e)},(un||(un={})).filterSensitiveLog=function(e){return ge({},e)},(cn||(cn={})).filterSensitiveLog=function(e){return ge({},e)},(fn||(fn={})).filterSensitiveLog=function(e){return ge({},e)},(ln||(ln={})).filterSensitiveLog=function(e){return ge({},e)},(dn||(dn={})).filterSensitiveLog=function(e){return ge({},e)},(hn||(hn={})).filterSensitiveLog=function(e){return ge({},e)},(pn||(pn={})).filterSensitiveLog=function(e){return ge({},e)},(gn||(gn={})).filterSensitiveLog=function(e){return ge({},e)};var vn=function(){function e(e){this.statusCode=e.statusCode,this.headers=e.headers||{},this.body=e.body}return e.isInstance=function(e){if(!e)return!1;var t=e;return"number"==typeof t.statusCode&&"object"==typeof t.headers},e}(),mn=n(0),yn=function(){function e(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?":"!==e.protocol.substr(-1)?e.protocol+":":e.protocol:"https:",this.path=e.path?"/"!==e.path.charAt(0)?"/"+e.path:e.path:"/"}return e.isInstance=function(e){if(!e)return!1;var t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&"object"==typeof t.query&&"object"==typeof t.headers},e.prototype.clone=function(){var t,n=new e(Object(mn.__assign)(Object(mn.__assign)({},this),{headers:Object(mn.__assign)({},this.headers)}));return n.query&&(n.query=(t=n.query,Object.keys(t).reduce((function(e,n){var r,o=t[n];return Object(mn.__assign)(Object(mn.__assign)({},e),((r={})[n]=Array.isArray(o)?Object(mn.__spread)(o):o,r))}),{}))),n},e}();var bn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h;return me(this,(function(p){switch(p.label){case 0:return r=[ge({},e)],h={},[4,ur(e.body,t)];case 1:switch(n=ge.apply(void 0,r.concat([(h.body=p.sent(),h)])),i="UnknownError",i=cr(e,n.body),i){case"InvalidParameterException":case"com.amazonaws.cloudwatchlogs#InvalidParameterException":return[3,2];case"LimitExceededException":case"com.amazonaws.cloudwatchlogs#LimitExceededException":return[3,4];case"OperationAbortedException":case"com.amazonaws.cloudwatchlogs#OperationAbortedException":return[3,6];case"ResourceAlreadyExistsException":case"com.amazonaws.cloudwatchlogs#ResourceAlreadyExistsException":return[3,8];case"ServiceUnavailableException":case"com.amazonaws.cloudwatchlogs#ServiceUnavailableException":return[3,10]}return[3,12];case 2:return a=[{}],[4,On(n,t)];case 3:return o=ge.apply(void 0,[ge.apply(void 0,a.concat([p.sent()])),{name:i,$metadata:ir(e)}]),[3,13];case 4:return s=[{}],[4,Ln(n,t)];case 5:return o=ge.apply(void 0,[ge.apply(void 0,s.concat([p.sent()])),{name:i,$metadata:ir(e)}]),[3,13];case 6:return u=[{}],[4,In(n,t)];case 7:return o=ge.apply(void 0,[ge.apply(void 0,u.concat([p.sent()])),{name:i,$metadata:ir(e)}]),[3,13];case 8:return c=[{}],[4,Pn(n,t)];case 9:return o=ge.apply(void 0,[ge.apply(void 0,c.concat([p.sent()])),{name:i,$metadata:ir(e)}]),[3,13];case 10:return f=[{}],[4,Tn(n,t)];case 11:return o=ge.apply(void 0,[ge.apply(void 0,f.concat([p.sent()])),{name:i,$metadata:ir(e)}]),[3,13];case 12:l=n.body,i=l.code||l.Code||i,o=ge(ge({},l),{name:""+i,message:l.message||l.Message||i,$fault:"client",$metadata:ir(e)}),p.label=13;case 13:return d=o.message||o.Message||i,o.message=d,delete o.Message,[2,Promise.reject(Object.assign(new Error(d),o))]}}))}))},wn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d;return me(this,(function(h){switch(h.label){case 0:return r=[ge({},e)],d={},[4,ur(e.body,t)];case 1:switch(n=ge.apply(void 0,r.concat([(d.body=h.sent(),d)])),i="UnknownError",i=cr(e,n.body),i){case"InvalidParameterException":case"com.amazonaws.cloudwatchlogs#InvalidParameterException":return[3,2];case"ResourceAlreadyExistsException":case"com.amazonaws.cloudwatchlogs#ResourceAlreadyExistsException":return[3,4];case"ResourceNotFoundException":case"com.amazonaws.cloudwatchlogs#ResourceNotFoundException":return[3,6];case"ServiceUnavailableException":case"com.amazonaws.cloudwatchlogs#ServiceUnavailableException":return[3,8]}return[3,10];case 2:return a=[{}],[4,On(n,t)];case 3:return o=ge.apply(void 0,[ge.apply(void 0,a.concat([h.sent()])),{name:i,$metadata:ir(e)}]),[3,11];case 4:return s=[{}],[4,Pn(n,t)];case 5:return o=ge.apply(void 0,[ge.apply(void 0,s.concat([h.sent()])),{name:i,$metadata:ir(e)}]),[3,11];case 6:return u=[{}],[4,Cn(n,t)];case 7:return o=ge.apply(void 0,[ge.apply(void 0,u.concat([h.sent()])),{name:i,$metadata:ir(e)}]),[3,11];case 8:return c=[{}],[4,Tn(n,t)];case 9:return o=ge.apply(void 0,[ge.apply(void 0,c.concat([h.sent()])),{name:i,$metadata:ir(e)}]),[3,11];case 10:f=n.body,i=f.code||f.Code||i,o=ge(ge({},f),{name:""+i,message:f.message||f.Message||i,$fault:"client",$metadata:ir(e)}),h.label=11;case 11:return l=o.message||o.Message||i,o.message=l,delete o.Message,[2,Promise.reject(Object.assign(new Error(l),o))]}}))}))},_n=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f;return me(this,(function(l){switch(l.label){case 0:return r=[ge({},e)],f={},[4,ur(e.body,t)];case 1:switch(n=ge.apply(void 0,r.concat([(f.body=l.sent(),f)])),i="UnknownError",i=cr(e,n.body),i){case"InvalidParameterException":case"com.amazonaws.cloudwatchlogs#InvalidParameterException":return[3,2];case"ServiceUnavailableException":case"com.amazonaws.cloudwatchlogs#ServiceUnavailableException":return[3,4]}return[3,6];case 2:return a=[{}],[4,On(n,t)];case 3:return o=ge.apply(void 0,[ge.apply(void 0,a.concat([l.sent()])),{name:i,$metadata:ir(e)}]),[3,7];case 4:return s=[{}],[4,Tn(n,t)];case 5:return o=ge.apply(void 0,[ge.apply(void 0,s.concat([l.sent()])),{name:i,$metadata:ir(e)}]),[3,7];case 6:u=n.body,i=u.code||u.Code||i,o=ge(ge({},u),{name:""+i,message:u.message||u.Message||i,$fault:"client",$metadata:ir(e)}),l.label=7;case 7:return c=o.message||o.Message||i,o.message=c,delete o.Message,[2,Promise.reject(Object.assign(new Error(c),o))]}}))}))},Sn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l;return me(this,(function(d){switch(d.label){case 0:return r=[ge({},e)],l={},[4,ur(e.body,t)];case 1:switch(n=ge.apply(void 0,r.concat([(l.body=d.sent(),l)])),i="UnknownError",i=cr(e,n.body),i){case"InvalidParameterException":case"com.amazonaws.cloudwatchlogs#InvalidParameterException":return[3,2];case"ResourceNotFoundException":case"com.amazonaws.cloudwatchlogs#ResourceNotFoundException":return[3,4];case"ServiceUnavailableException":case"com.amazonaws.cloudwatchlogs#ServiceUnavailableException":return[3,6]}return[3,8];case 2:return a=[{}],[4,On(n,t)];case 3:return o=ge.apply(void 0,[ge.apply(void 0,a.concat([d.sent()])),{name:i,$metadata:ir(e)}]),[3,9];case 4:return s=[{}],[4,Cn(n,t)];case 5:return o=ge.apply(void 0,[ge.apply(void 0,s.concat([d.sent()])),{name:i,$metadata:ir(e)}]),[3,9];case 6:return u=[{}],[4,Tn(n,t)];case 7:return o=ge.apply(void 0,[ge.apply(void 0,u.concat([d.sent()])),{name:i,$metadata:ir(e)}]),[3,9];case 8:c=n.body,i=c.code||c.Code||i,o=ge(ge({},c),{name:""+i,message:c.message||c.Message||i,$fault:"client",$metadata:ir(e)}),d.label=9;case 9:return f=o.message||o.Message||i,o.message=f,delete o.Message,[2,Promise.reject(Object.assign(new Error(f),o))]}}))}))},En=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l;return me(this,(function(d){switch(d.label){case 0:return r=[ge({},e)],l={},[4,ur(e.body,t)];case 1:switch(n=ge.apply(void 0,r.concat([(l.body=d.sent(),l)])),i="UnknownError",i=cr(e,n.body),i){case"InvalidParameterException":case"com.amazonaws.cloudwatchlogs#InvalidParameterException":return[3,2];case"ResourceNotFoundException":case"com.amazonaws.cloudwatchlogs#ResourceNotFoundException":return[3,4];case"ServiceUnavailableException":case"com.amazonaws.cloudwatchlogs#ServiceUnavailableException":return[3,6]}return[3,8];case 2:return a=[{}],[4,On(n,t)];case 3:return o=ge.apply(void 0,[ge.apply(void 0,a.concat([d.sent()])),{name:i,$metadata:ir(e)}]),[3,9];case 4:return s=[{}],[4,Cn(n,t)];case 5:return o=ge.apply(void 0,[ge.apply(void 0,s.concat([d.sent()])),{name:i,$metadata:ir(e)}]),[3,9];case 6:return u=[{}],[4,Tn(n,t)];case 7:return o=ge.apply(void 0,[ge.apply(void 0,u.concat([d.sent()])),{name:i,$metadata:ir(e)}]),[3,9];case 8:c=n.body,i=c.code||c.Code||i,o=ge(ge({},c),{name:""+i,message:c.message||c.Message||i,$fault:"client",$metadata:ir(e)}),d.label=9;case 9:return f=o.message||o.Message||i,o.message=f,delete o.Message,[2,Promise.reject(Object.assign(new Error(f),o))]}}))}))},xn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h,p;return me(this,(function(g){switch(g.label){case 0:return r=[ge({},e)],p={},[4,ur(e.body,t)];case 1:switch(n=ge.apply(void 0,r.concat([(p.body=g.sent(),p)])),i="UnknownError",i=cr(e,n.body),i){case"DataAlreadyAcceptedException":case"com.amazonaws.cloudwatchlogs#DataAlreadyAcceptedException":return[3,2];case"InvalidParameterException":case"com.amazonaws.cloudwatchlogs#InvalidParameterException":return[3,4];case"InvalidSequenceTokenException":case"com.amazonaws.cloudwatchlogs#InvalidSequenceTokenException":return[3,6];case"ResourceNotFoundException":case"com.amazonaws.cloudwatchlogs#ResourceNotFoundException":return[3,8];case"ServiceUnavailableException":case"com.amazonaws.cloudwatchlogs#ServiceUnavailableException":return[3,10];case"UnrecognizedClientException":case"com.amazonaws.cloudwatchlogs#UnrecognizedClientException":return[3,12]}return[3,14];case 2:return a=[{}],[4,An(n,t)];case 3:return o=ge.apply(void 0,[ge.apply(void 0,a.concat([g.sent()])),{name:i,$metadata:ir(e)}]),[3,15];case 4:return s=[{}],[4,On(n,t)];case 5:return o=ge.apply(void 0,[ge.apply(void 0,s.concat([g.sent()])),{name:i,$metadata:ir(e)}]),[3,15];case 6:return u=[{}],[4,kn(n,t)];case 7:return o=ge.apply(void 0,[ge.apply(void 0,u.concat([g.sent()])),{name:i,$metadata:ir(e)}]),[3,15];case 8:return c=[{}],[4,Cn(n,t)];case 9:return o=ge.apply(void 0,[ge.apply(void 0,c.concat([g.sent()])),{name:i,$metadata:ir(e)}]),[3,15];case 10:return f=[{}],[4,Tn(n,t)];case 11:return o=ge.apply(void 0,[ge.apply(void 0,f.concat([g.sent()])),{name:i,$metadata:ir(e)}]),[3,15];case 12:return l=[{}],[4,jn(n,t)];case 13:return o=ge.apply(void 0,[ge.apply(void 0,l.concat([g.sent()])),{name:i,$metadata:ir(e)}]),[3,15];case 14:d=n.body,i=d.code||d.Code||i,o=ge(ge({},d),{name:""+i,message:d.message||d.Message||i,$fault:"client",$metadata:ir(e)}),g.label=15;case 15:return h=o.message||o.Message||i,o.message=h,delete o.Message,[2,Promise.reject(Object.assign(new Error(h),o))]}}))}))},An=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=qn(n,t),[2,ge({name:"DataAlreadyAcceptedException",$fault:"client",$metadata:ir(e)},r)]}))}))},On=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=$n(n,t),[2,ge({name:"InvalidParameterException",$fault:"client",$metadata:ir(e)},r)]}))}))},kn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=Kn(n,t),[2,ge({name:"InvalidSequenceTokenException",$fault:"client",$metadata:ir(e)},r)]}))}))},Ln=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=Vn(n,t),[2,ge({name:"LimitExceededException",$fault:"client",$metadata:ir(e)},r)]}))}))},In=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=Jn(n,t),[2,ge({name:"OperationAbortedException",$fault:"client",$metadata:ir(e)},r)]}))}))},Pn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=tr(n,t),[2,ge({name:"ResourceAlreadyExistsException",$fault:"client",$metadata:ir(e)},r)]}))}))},Cn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=nr(n,t),[2,ge({name:"ResourceNotFoundException",$fault:"client",$metadata:ir(e)},r)]}))}))},Tn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=rr(n,t),[2,ge({name:"ServiceUnavailableException",$fault:"server",$metadata:ir(e)},r)]}))}))},jn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=or(n,t),[2,ge({name:"UnrecognizedClientException",$fault:"client",$metadata:ir(e)},r)]}))}))},Rn=function(e,t){return ge(ge(ge({},void 0!==e.kmsKeyId&&null!==e.kmsKeyId&&{kmsKeyId:e.kmsKeyId}),void 0!==e.logGroupName&&null!==e.logGroupName&&{logGroupName:e.logGroupName}),void 0!==e.tags&&null!==e.tags&&{tags:Dn(e.tags,t)})},Mn=function(e,t){return ge(ge({},void 0!==e.logGroupName&&null!==e.logGroupName&&{logGroupName:e.logGroupName}),void 0!==e.logStreamName&&null!==e.logStreamName&&{logStreamName:e.logStreamName})},Nn=function(e,t){return ge(ge(ge({},void 0!==e.limit&&null!==e.limit&&{limit:e.limit}),void 0!==e.logGroupNamePrefix&&null!==e.logGroupNamePrefix&&{logGroupNamePrefix:e.logGroupNamePrefix}),void 0!==e.nextToken&&null!==e.nextToken&&{nextToken:e.nextToken})},zn=function(e,t){return ge(ge(ge(ge(ge(ge({},void 0!==e.descending&&null!==e.descending&&{descending:e.descending}),void 0!==e.limit&&null!==e.limit&&{limit:e.limit}),void 0!==e.logGroupName&&null!==e.logGroupName&&{logGroupName:e.logGroupName}),void 0!==e.logStreamNamePrefix&&null!==e.logStreamNamePrefix&&{logStreamNamePrefix:e.logStreamNamePrefix}),void 0!==e.nextToken&&null!==e.nextToken&&{nextToken:e.nextToken}),void 0!==e.orderBy&&null!==e.orderBy&&{orderBy:e.orderBy})},Bn=function(e,t){return ge(ge(ge(ge(ge(ge(ge({},void 0!==e.endTime&&null!==e.endTime&&{endTime:e.endTime}),void 0!==e.limit&&null!==e.limit&&{limit:e.limit}),void 0!==e.logGroupName&&null!==e.logGroupName&&{logGroupName:e.logGroupName}),void 0!==e.logStreamName&&null!==e.logStreamName&&{logStreamName:e.logStreamName}),void 0!==e.nextToken&&null!==e.nextToken&&{nextToken:e.nextToken}),void 0!==e.startFromHead&&null!==e.startFromHead&&{startFromHead:e.startFromHead}),void 0!==e.startTime&&null!==e.startTime&&{startTime:e.startTime})},Un=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return ge(ge({},void 0!==e.message&&null!==e.message&&{message:e.message}),void 0!==e.timestamp&&null!==e.timestamp&&{timestamp:e.timestamp})}(e)}))},Fn=function(e,t){return ge(ge(ge(ge({},void 0!==e.logEvents&&null!==e.logEvents&&{logEvents:Un(e.logEvents)}),void 0!==e.logGroupName&&null!==e.logGroupName&&{logGroupName:e.logGroupName}),void 0!==e.logStreamName&&null!==e.logStreamName&&{logStreamName:e.logStreamName}),void 0!==e.sequenceToken&&null!==e.sequenceToken&&{sequenceToken:e.sequenceToken})},Dn=function(e,t){return Object.entries(e).reduce((function(e,t){var n,r=ye(t,2),o=r[0],i=r[1];return null===i?e:ge(ge({},e),((n={})[o]=i,n))}),{})},qn=function(e,t){return{expectedSequenceToken:void 0!==e.expectedSequenceToken&&null!==e.expectedSequenceToken?e.expectedSequenceToken:void 0,message:void 0!==e.message&&null!==e.message?e.message:void 0}},Gn=function(e,t){return{logGroups:void 0!==e.logGroups&&null!==e.logGroups?Yn(e.logGroups,t):void 0,nextToken:void 0!==e.nextToken&&null!==e.nextToken?e.nextToken:void 0}},Hn=function(e,t){return{logStreams:void 0!==e.logStreams&&null!==e.logStreams?Zn(e.logStreams,t):void 0,nextToken:void 0!==e.nextToken&&null!==e.nextToken?e.nextToken:void 0}},Wn=function(e,t){return{events:void 0!==e.events&&null!==e.events?Xn(e.events,t):void 0,nextBackwardToken:void 0!==e.nextBackwardToken&&null!==e.nextBackwardToken?e.nextBackwardToken:void 0,nextForwardToken:void 0!==e.nextForwardToken&&null!==e.nextForwardToken?e.nextForwardToken:void 0}},$n=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Kn=function(e,t){return{expectedSequenceToken:void 0!==e.expectedSequenceToken&&null!==e.expectedSequenceToken?e.expectedSequenceToken:void 0,message:void 0!==e.message&&null!==e.message?e.message:void 0}},Vn=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Yn=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{arn:void 0!==e.arn&&null!==e.arn?e.arn:void 0,creationTime:void 0!==e.creationTime&&null!==e.creationTime?e.creationTime:void 0,kmsKeyId:void 0!==e.kmsKeyId&&null!==e.kmsKeyId?e.kmsKeyId:void 0,logGroupName:void 0!==e.logGroupName&&null!==e.logGroupName?e.logGroupName:void 0,metricFilterCount:void 0!==e.metricFilterCount&&null!==e.metricFilterCount?e.metricFilterCount:void 0,retentionInDays:void 0!==e.retentionInDays&&null!==e.retentionInDays?e.retentionInDays:void 0,storedBytes:void 0!==e.storedBytes&&null!==e.storedBytes?e.storedBytes:void 0}}(e)}))},Zn=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{arn:void 0!==e.arn&&null!==e.arn?e.arn:void 0,creationTime:void 0!==e.creationTime&&null!==e.creationTime?e.creationTime:void 0,firstEventTimestamp:void 0!==e.firstEventTimestamp&&null!==e.firstEventTimestamp?e.firstEventTimestamp:void 0,lastEventTimestamp:void 0!==e.lastEventTimestamp&&null!==e.lastEventTimestamp?e.lastEventTimestamp:void 0,lastIngestionTime:void 0!==e.lastIngestionTime&&null!==e.lastIngestionTime?e.lastIngestionTime:void 0,logStreamName:void 0!==e.logStreamName&&null!==e.logStreamName?e.logStreamName:void 0,storedBytes:void 0!==e.storedBytes&&null!==e.storedBytes?e.storedBytes:void 0,uploadSequenceToken:void 0!==e.uploadSequenceToken&&null!==e.uploadSequenceToken?e.uploadSequenceToken:void 0}}(e)}))},Jn=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Xn=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{ingestionTime:void 0!==e.ingestionTime&&null!==e.ingestionTime?e.ingestionTime:void 0,message:void 0!==e.message&&null!==e.message?e.message:void 0,timestamp:void 0!==e.timestamp&&null!==e.timestamp?e.timestamp:void 0}}(e)}))},Qn=function(e,t){return{nextSequenceToken:void 0!==e.nextSequenceToken&&null!==e.nextSequenceToken?e.nextSequenceToken:void 0,rejectedLogEventsInfo:void 0!==e.rejectedLogEventsInfo&&null!==e.rejectedLogEventsInfo?er(e.rejectedLogEventsInfo,t):void 0}},er=function(e,t){return{expiredLogEventEndIndex:void 0!==e.expiredLogEventEndIndex&&null!==e.expiredLogEventEndIndex?e.expiredLogEventEndIndex:void 0,tooNewLogEventStartIndex:void 0!==e.tooNewLogEventStartIndex&&null!==e.tooNewLogEventStartIndex?e.tooNewLogEventStartIndex:void 0,tooOldLogEventEndIndex:void 0!==e.tooOldLogEventEndIndex&&null!==e.tooOldLogEventEndIndex?e.tooOldLogEventEndIndex:void 0}},tr=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},nr=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},rr=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},or=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},ir=function(e){var t;return{httpStatusCode:e.statusCode,requestId:null!==(t=e.headers["x-amzn-requestid"])&&void 0!==t?t:e.headers["x-amzn-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}},ar=function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)},sr=function(e,t,n,r,o){return ve(void 0,void 0,void 0,(function(){var i,a,s,u,c,f;return me(this,(function(l){switch(l.label){case 0:return[4,e.endpoint()];case 1:return i=l.sent(),a=i.hostname,s=i.protocol,u=void 0===s?"https":s,c=i.port,f={protocol:u,hostname:a,port:c,method:"POST",path:n,headers:t},void 0!==r&&(f.hostname=r),void 0!==o&&(f.body=o),[2,new yn(f)]}}))}))},ur=function(e,t){return function(e,t){return ar(e,t).then((function(e){return t.utf8Encoder(e)}))}(e,t).then((function(e){return e.length?JSON.parse(e):{}}))},cr=function(e,t){var n,r,o=function(e){var t=e;return t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},i=(n=e.headers,r="x-amzn-errortype",Object.keys(n).find((function(e){return e.toLowerCase()===r.toLowerCase()})));return void 0!==i?o(e.headers[i]):void 0!==t.code?o(t.code):void 0!==t.__type?o(t.__type):""},fr={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},lr={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function dr(e,t,n){return{applyToStack:function(r){r.add(function(e,t){return function(n,r){return function(r){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var o,i;return Object(mn.__generator)(this,(function(a){switch(a.label){case 0:return[4,n(r)];case 1:return o=a.sent().response,[4,t(o,e)];case 2:return i=a.sent(),[2,{response:o,output:i}]}}))}))}}}(e,n),fr),r.add(function(e,t){return function(n,r){return function(r){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var o;return Object(mn.__generator)(this,(function(i){switch(i.label){case 0:return[4,t(r.input,e)];case 1:return o=i.sent(),[2,n(Object(mn.__assign)(Object(mn.__assign)({},r),{request:o}))]}}))}))}}}(e,t),lr)}}}var hr=function(){var e=[],t=[],n=new Set,r=function(n){return e.forEach((function(e){n.add(e.middleware,Object(mn.__assign)({},e))})),t.forEach((function(e){n.addRelativeTo(e.middleware,Object(mn.__assign)({},e))})),n},o=function(e){var t=[];return e.before.forEach((function(e){0===e.before.length&&0===e.after.length?t.push(e):t.push.apply(t,Object(mn.__spread)(o(e)))})),t.push(e),e.after.reverse().forEach((function(e){0===e.before.length&&0===e.after.length?t.push(e):t.push.apply(t,Object(mn.__spread)(o(e)))})),t},i=function(){var n,r=[],i=[],a={};return e.forEach((function(e){var t=Object(mn.__assign)(Object(mn.__assign)({},e),{before:[],after:[]});t.name&&(a[t.name]=t),r.push(t)})),t.forEach((function(e){var t=Object(mn.__assign)(Object(mn.__assign)({},e),{before:[],after:[]});t.name&&(a[t.name]=t),i.push(t)})),i.forEach((function(e){if(e.toMiddleware){var t=a[e.toMiddleware];if(void 0===t)throw new Error(e.toMiddleware+" is not found when adding "+(e.name||"anonymous")+" middleware "+e.relation+" "+e.toMiddleware);"after"===e.relation&&t.after.push(e),"before"===e.relation&&t.before.push(e)}})),(n=r,n.sort((function(e,t){return pr[t.step]-pr[e.step]||gr[t.priority||"normal"]-gr[e.priority||"normal"]}))).map(o).reduce((function(e,t){return e.push.apply(e,Object(mn.__spread)(t)),e}),[]).map((function(e){return e.middleware}))},a={add:function(t,r){void 0===r&&(r={});var o=r.name,i=r.override,a=Object(mn.__assign)({step:"initialize",priority:"normal",middleware:t},r);if(o){if(n.has(o)){if(!i)throw new Error("Duplicate middleware name '"+o+"'");var s=e.findIndex((function(e){return e.name===o})),u=e[s];if(u.step!==a.step||u.priority!==a.priority)throw new Error('"'+o+'" middleware with '+u.priority+" priority in "+u.step+" step cannot be overridden by same-name middleware with "+a.priority+" priority in "+a.step+" step.");e.splice(s,1)}n.add(o)}e.push(a)},addRelativeTo:function(e,r){var o=r.name,i=r.override,a=Object(mn.__assign)({middleware:e},r);if(o){if(n.has(o)){if(!i)throw new Error("Duplicate middleware name '"+o+"'");var s=t.findIndex((function(e){return e.name===o})),u=t[s];if(u.toMiddleware!==a.toMiddleware||u.relation!==a.relation)throw new Error('"'+o+'" middleware '+u.relation+' "'+u.toMiddleware+'" middleware cannot be overridden by same-name middleware '+a.relation+' "'+a.toMiddleware+'" middleware.');t.splice(s,1)}n.add(o)}t.push(a)},clone:function(){return r(hr())},use:function(e){e.applyToStack(a)},remove:function(r){return"string"==typeof r?function(r){var o=!1,i=function(e){return!e.name||e.name!==r||(o=!0,n.delete(r),!1)};return e=e.filter(i),t=t.filter(i),o}(r):function(r){var o=!1,i=function(e){return e.middleware!==r||(o=!0,e.name&&n.delete(e.name),!1)};return e=e.filter(i),t=t.filter(i),o}(r)},removeByTag:function(r){var o=!1,i=function(e){var t=e.tags,i=e.name;return!t||!t.includes(r)||(i&&n.delete(i),o=!0,!1)};return e=e.filter(i),t=t.filter(i),o},concat:function(e){var t=r(hr());return t.use(e),t},applyToStack:r,resolve:function(e,t){var n,r;try{for(var o=Object(mn.__values)(i().reverse()),a=o.next();!a.done;a=o.next()){e=(0,a.value)(e,t)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return e}};return a},pr={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},gr={high:3,normal:2,low:1},vr=function(){function e(e){this.middlewareStack=hr(),this.config=e}return e.prototype.send=function(e,t,n){var r="function"!=typeof t?t:void 0,o="function"==typeof t?t:n,i=e.resolveMiddleware(this.middlewareStack,this.config,r);if(!o)return i(e).then((function(e){return e.output}));i(e).then((function(e){return o(null,e.output)}),(function(e){return o(e)})).catch((function(){}))},e.prototype.destroy=function(){this.config.requestHandler.destroy&&this.config.requestHandler.destroy()},e}(),mr=function(){this.middlewareStack=hr()};var yr=function(){var e=Object.getPrototypeOf(this).constructor,t=Function.bind.apply(String,Object(mn.__spread)([null],arguments)),n=new t;return Object.setPrototypeOf(n,e.prototype),n};yr.prototype=Object.create(String.prototype,{constructor:{value:yr,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(yr,String);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}Object(mn.__extends)(t,e),t.prototype.deserializeJSON=function(){return JSON.parse(e.prototype.toString.call(this))},t.prototype.toJSON=function(){return e.prototype.toString.call(this)},t.fromObject=function(e){return e instanceof t?e:new t(e instanceof String||"string"==typeof e?e:JSON.stringify(e))}}(yr);var br=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return pe(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"CreateLogGroupCommand",inputFilterSensitiveLog:Pe.filterSensitiveLog,outputFilterSensitiveLog:function(e){return e}},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"Logs_20140328.CreateLogGroup"},r=JSON.stringify(Rn(e,t)),[2,sr(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n;return me(this,(function(r){switch(r.label){case 0:return e.statusCode>=300?[2,bn(e,t)]:[4,ar(e.body,t)];case 1:return r.sent(),n={$metadata:ir(e)},[2,Promise.resolve(n)]}}))}))}(e,t)},t}(mr),wr=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return pe(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"DescribeLogGroupsCommand",inputFilterSensitiveLog:Je.filterSensitiveLog,outputFilterSensitiveLog:Qe.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"Logs_20140328.DescribeLogGroups"},r=JSON.stringify(Nn(e,t)),[2,sr(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o;return me(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,_n(e,t)]:[4,ur(e.body,t)];case 1:return n=i.sent(),{},r=Gn(n,t),o=ge({$metadata:ir(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),_r=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return pe(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"CreateLogStreamCommand",inputFilterSensitiveLog:Ce.filterSensitiveLog,outputFilterSensitiveLog:function(e){return e}},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"Logs_20140328.CreateLogStream"},r=JSON.stringify(Mn(e,t)),[2,sr(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n;return me(this,(function(r){switch(r.label){case 0:return e.statusCode>=300?[2,wn(e,t)]:[4,ar(e.body,t)];case 1:return r.sent(),n={$metadata:ir(e)},[2,Promise.resolve(n)]}}))}))}(e,t)},t}(mr),Sr=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return pe(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"DescribeLogStreamsCommand",inputFilterSensitiveLog:tt.filterSensitiveLog,outputFilterSensitiveLog:rt.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"Logs_20140328.DescribeLogStreams"},r=JSON.stringify(zn(e,t)),[2,sr(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o;return me(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,Sn(e,t)]:[4,ur(e.body,t)];case 1:return n=i.sent(),{},r=Hn(n,t),o=ge({$metadata:ir(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),Er=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return pe(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"GetLogEventsCommand",inputFilterSensitiveLog:kt.filterSensitiveLog,outputFilterSensitiveLog:It.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"Logs_20140328.GetLogEvents"},r=JSON.stringify(Bn(e,t)),[2,sr(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o;return me(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,En(e,t)]:[4,ur(e.body,t)];case 1:return n=i.sent(),{},r=Wn(n,t),o=ge({$metadata:ir(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),xr=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return pe(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"PutLogEventsCommand",inputFilterSensitiveLog:$t.filterSensitiveLog,outputFilterSensitiveLog:Vt.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"Logs_20140328.PutLogEvents"},r=JSON.stringify(Fn(e,t)),[2,sr(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o;return me(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,xn(e,t)]:[4,ur(e.body,t)];case 1:return n=i.sent(),{},r=Qn(n,t),o=ge({$metadata:ir(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),Ar=n(20),Or=n(5),kr=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,Lr)},Lr=function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()};for(var Ir=function(){function e(e){var t=(void 0===e?{}:e).requestTimeout;this.requestTimeout=t}return e.prototype.destroy=function(){},e.prototype.handle=function(e,t){var n=(void 0===t?{}:t).abortSignal,r=this.requestTimeout;if(null==n?void 0:n.aborted){var o=new Error("Request aborted");return o.name="AbortError",Promise.reject(o)}var i=e.path;if(e.query){var a=function(e){var t,n,r=[];try{for(var o=Object(mn.__values)(Object.keys(e).sort()),i=o.next();!i.done;i=o.next()){var a=i.value,s=e[a];if(a=kr(a),Array.isArray(s))for(var u=0,c=s.length;u<c;u++)r.push(a+"="+kr(s[u]));else{var f=a;(s||"string"==typeof s)&&(f+="="+kr(s)),r.push(f)}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r.join("&")}(e.query);a&&(i+="?"+a)}var s=e.port,u=e.method,c=e.protocol+"//"+e.hostname+(s?":"+s:"")+i,f={body:"GET"===u||"HEAD"===u?void 0:e.body,headers:new Headers(e.headers),method:u};"undefined"!=typeof AbortController&&(f.signal=n);var l,d=new Request(c,f),h=[fetch(d).then((function(e){var t,n,r=e.headers,o={};try{for(var i=Object(mn.__values)(r.entries()),a=i.next();!a.done;a=i.next()){var s=a.value;o[s[0]]=s[1]}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return void 0!==e.body?{response:new vn({headers:o,statusCode:e.status,body:e.body})}:e.blob().then((function(t){return{response:new vn({headers:o,statusCode:e.status,body:t})}}))})),(l=r,void 0===l&&(l=0),new Promise((function(e,t){l&&setTimeout((function(){var e=new Error("Request did not complete within "+l+" ms");e.name="TimeoutError",t(e)}),l)})))];return n&&h.push(new Promise((function(e,t){n.onabort=function(){var e=new Error("Request aborted");e.name="AbortError",t(e)}}))),Promise.race(h)},e}(),Pr={},Cr=new Array(64),Tr=0,jr="A".charCodeAt(0),Rr="Z".charCodeAt(0);Tr+jr<=Rr;Tr++){var Mr=String.fromCharCode(Tr+jr);Pr[Mr]=Tr,Cr[Tr]=Mr}for(Tr=0,jr="a".charCodeAt(0),Rr="z".charCodeAt(0);Tr+jr<=Rr;Tr++){Mr=String.fromCharCode(Tr+jr);var Nr=Tr+26;Pr[Mr]=Nr,Cr[Nr]=Mr}for(Tr=0;Tr<10;Tr++){Pr[Tr.toString(10)]=Tr+52;Mr=Tr.toString(10),Nr=Tr+52;Pr[Mr]=Nr,Cr[Nr]=Mr}Pr["+"]=62,Cr[62]="+",Pr["/"]=63,Cr[63]="/";function zr(e){var t=e.length/4*3;"=="===e.substr(-2)?t-=2:"="===e.substr(-1)&&t--;for(var n=new ArrayBuffer(t),r=new DataView(n),o=0;o<e.length;o+=4){for(var i=0,a=0,s=o,u=o+3;s<=u;s++)"="!==e[s]?(i|=Pr[e[s]]<<6*(u-s),a+=6):i>>=6;var c=o/4*3;i>>=a%8;for(var f=Math.floor(a/8),l=0;l<f;l++){var d=8*(f-l-1);r.setUint8(c+l,(i&255<<d)>>d)}}return new Uint8Array(n)}function Br(e){for(var t="",n=0;n<e.length;n+=3){for(var r=0,o=0,i=n,a=Math.min(n+3,e.length);i<a;i++)r|=e[i]<<8*(a-i-1),o+=8;var s=Math.ceil(o/6);r<<=6*s-o;for(var u=1;u<=s;u++){var c=6*(s-u);t+=Cr[(r&63<<c)>>c]}t+="==".slice(0,4-s)}return t}var Ur=function(e){return"function"==typeof Blob&&e instanceof Blob?function(e){return Object(mn.__awaiter)(this,void 0,void 0,(function(){var t,n;return Object(mn.__generator)(this,(function(r){switch(r.label){case 0:return[4,Fr(e)];case 1:return t=r.sent(),n=zr(t),[2,new Uint8Array(n)]}}))}))}(e):function(e){return Object(mn.__awaiter)(this,void 0,void 0,(function(){var t,n,r,o,i,a,s;return Object(mn.__generator)(this,(function(u){switch(u.label){case 0:t=new Uint8Array(0),n=e.getReader(),r=!1,u.label=1;case 1:return r?[3,3]:[4,n.read()];case 2:return o=u.sent(),i=o.done,(a=o.value)&&(s=t,(t=new Uint8Array(s.length+a.length)).set(s),t.set(a,s.length)),r=i,[3,1];case 3:return[2,t]}}))}))}(e)};function Fr(e){return new Promise((function(t,n){var r=new FileReader;r.onloadend=function(){var e;if(2!==r.readyState)return n(new Error("Reader aborted too early"));var o=null!==(e=r.result)&&void 0!==e?e:"",i=o.indexOf(","),a=i>-1?i+1:o.length;t(o.substring(a))},r.onabort=function(){return n(new Error("Read aborted"))},r.onerror=function(){return n(r.error)},r.readAsDataURL(e)}))}var Dr=function(e){return function(){return Promise.reject(e)}},qr={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},Gr=function(e){return{applyToStack:function(t){t.add(function(e){return function(t,n){return function(r){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var o;return Object(mn.__generator)(this,(function(i){return(null===(o=null==e?void 0:e.retryStrategy)||void 0===o?void 0:o.mode)&&(n.userAgent=Object(mn.__spread)(n.userAgent||[],[["cfg/retry-mode",e.retryStrategy.mode]])),[2,e.retryStrategy.retry(t,r)]}))}))}}}(e),qr)}}},Hr=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],Wr=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],$r=["AbortError","TimeoutError","RequestTimeout","RequestTimeoutException"],Kr=[500,502,503,504],Vr=function(e){var t,n;return 429===(null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||Wr.includes(e.name)||1==(null===(n=e.$retryable)||void 0===n?void 0:n.throttling)},Yr=n(18),Zr=function(e,t){return Math.floor(Math.min(2e4,Math.random()*Math.pow(2,t)*e))},Jr=function(e){return!!e&&(function(e){return void 0!==e.$retryable}(e)||function(e){return Hr.includes(e.name)}(e)||Vr(e)||function(e){var t;return $r.includes(e.name)||Kr.includes((null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||0)}(e))},Xr=function(){function e(e,t){var n,r,o,i,a,s,u,c;this.maxAttemptsProvider=e,this.mode="standard",this.retryDecider=null!==(n=null==t?void 0:t.retryDecider)&&void 0!==n?n:Jr,this.delayDecider=null!==(r=null==t?void 0:t.delayDecider)&&void 0!==r?r:Zr,this.retryQuota=null!==(o=null==t?void 0:t.retryQuota)&&void 0!==o?o:(a=i=500,s=i,u=function(e){return"TimeoutError"===e.name?10:5},c=function(e){return u(e)<=s},Object.freeze({hasRetryTokens:c,retrieveRetryTokens:function(e){if(!c(e))throw new Error("No retry token available");var t=u(e);return s-=t,t},releaseRetryTokens:function(e){s+=null!=e?e:1,s=Math.min(s,a)}}))}return e.prototype.shouldRetry=function(e,t,n){return t<n&&this.retryDecider(e)&&this.retryQuota.hasRetryTokens(e)},e.prototype.getMaxAttempts=function(){return Object(mn.__awaiter)(this,void 0,void 0,(function(){var e;return Object(mn.__generator)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.maxAttemptsProvider()];case 1:return e=t.sent(),[3,3];case 2:return t.sent(),e=3,[3,3];case 3:return[2,e]}}))}))},e.prototype.retry=function(e,t){return Object(mn.__awaiter)(this,void 0,void 0,(function(){var n,r,o,i,a,s,u,c;return Object(mn.__generator)(this,(function(f){switch(f.label){case 0:return r=0,o=0,[4,this.getMaxAttempts()];case 1:i=f.sent(),a=t.request,yn.isInstance(a)&&(a.headers["amz-sdk-invocation-id"]=Object(Yr.v4)()),s=function(){var s,c,f,l,d;return Object(mn.__generator)(this,(function(h){switch(h.label){case 0:return h.trys.push([0,2,,5]),yn.isInstance(a)&&(a.headers["amz-sdk-request"]="attempt="+(r+1)+"; max="+i),[4,e(t)];case 1:return s=h.sent(),c=s.response,f=s.output,u.retryQuota.releaseRetryTokens(n),f.$metadata.attempts=r+1,f.$metadata.totalRetryDelay=o,[2,{value:{response:c,output:f}}];case 2:return l=h.sent(),r++,u.shouldRetry(l,r,i)?(n=u.retryQuota.retrieveRetryTokens(l),d=u.delayDecider(Vr(l)?500:100,r),o+=d,[4,new Promise((function(e){return setTimeout(e,d)}))]):[3,4];case 3:return h.sent(),[2,"continue"];case 4:throw l.$metadata||(l.$metadata={}),l.$metadata.attempts=r,l.$metadata.totalRetryDelay=o,l;case 5:return[2]}}))},u=this,f.label=2;case 2:return[5,s()];case 3:return"object"==typeof(c=f.sent())?[2,c.value]:[3,2];case 4:return[2]}}))}))},e}(),Qr=function(e){var t=eo(e.maxAttempts);return Object(mn.__assign)(Object(mn.__assign)({},e),{maxAttempts:t,retryStrategy:e.retryStrategy||new Xr(t)})},eo=function(e){if(void 0===e&&(e=3),"number"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e};function to(e){if("string"==typeof e){for(var t=e.length,n=t-1;n>=0;n--){var r=e.charCodeAt(n);r>127&&r<=2047?t++:r>2047&&r<=65535&&(t+=2)}return t}return"number"==typeof e.byteLength?e.byteLength:"number"==typeof e.size?e.size:void 0}var no=n(19),ro=n.n(no),oo=function(e){var t=e.serviceId,n=e.clientVersion;return function(){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var e,r,o,i,a,s,u,c,f;return Object(mn.__generator)(this,(function(l){return e=(null===(o=null===window||void 0===window?void 0:window.navigator)||void 0===o?void 0:o.userAgent)?ro.a.parse(window.navigator.userAgent):void 0,r=[["aws-sdk-js",n],["os/"+((null===(i=null==e?void 0:e.os)||void 0===i?void 0:i.name)||"other"),null===(a=null==e?void 0:e.os)||void 0===a?void 0:a.version],["lang/js"],["md/browser",(null!==(u=null===(s=null==e?void 0:e.browser)||void 0===s?void 0:s.name)&&void 0!==u?u:"unknown")+"_"+(null!==(f=null===(c=null==e?void 0:e.browser)||void 0===c?void 0:c.version)&&void 0!==f?f:"unknown")]],t&&r.push(["api/"+t,n]),[2,r]}))}))}};var io=function(e){return"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):function(e){for(var t=[],n=0,r=e.length;n<r;n++){var o=e.charCodeAt(n);if(o<128)t.push(o);else if(o<2048)t.push(o>>6|192,63&o|128);else if(n+1<e.length&&55296==(64512&o)&&56320==(64512&e.charCodeAt(n+1))){var i=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n));t.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}else t.push(o>>12|224,o>>6&63|128,63&o|128)}return Uint8Array.from(t)}(e)},ao=function(e){return"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):function(e){for(var t="",n=0,r=e.length;n<r;n++){var o=e[n];if(o<128)t+=String.fromCharCode(o);else if(192<=o&&o<224){var i=e[++n];t+=String.fromCharCode((31&o)<<6|63&i)}else if(240<=o&&o<365){var a="%"+[o,e[++n],e[++n],e[++n]].map((function(e){return e.toString(16)})).join("%");t+=decodeURIComponent(a)}else t+=String.fromCharCode((15&o)<<12|(63&e[++n])<<6|63&e[++n])}return t}(e)},so=new Set(["af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-south-1","ap-southeast-1","ap-southeast-2","ca-central-1","eu-central-1","eu-north-1","eu-south-1","eu-west-1","eu-west-2","eu-west-3","me-south-1","sa-east-1","us-east-1","us-east-2","us-west-1","us-west-2"]),uo=new Set(["cn-north-1","cn-northwest-1"]),co=new Set(["us-iso-east-1"]),fo=new Set(["us-isob-east-1"]),lo=new Set(["us-gov-east-1","us-gov-west-1"]);var ho=function(e){var t,n=new URL(e),r=n.hostname,o=n.pathname,i=n.port,a=n.protocol,s=n.search;return s&&(t=function(e){var t,n,r={};if(e=e.replace(/^\?/,""))try{for(var o=Object(mn.__values)(e.split("&")),i=o.next();!i.done;i=o.next()){var a=i.value,s=Object(mn.__read)(a.split("="),2),u=s[0],c=s[1],f=void 0===c?null:c;u=decodeURIComponent(u),f&&(f=decodeURIComponent(f)),u in r?Array.isArray(r[u])?r[u].push(f):r[u]=[r[u],f]:r[u]=f}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r}(s)),{hostname:r,port:i?parseInt(i):void 0,protocol:a,path:o,query:t}},po={apiVersion:"2014-03-28",disableHostPrefix:!1,logger:{},regionInfoProvider:function(e,t){var n=void 0;switch(e){case"af-south-1":n={hostname:"logs.af-south-1.amazonaws.com",partition:"aws"};break;case"ap-east-1":n={hostname:"logs.ap-east-1.amazonaws.com",partition:"aws"};break;case"ap-northeast-1":n={hostname:"logs.ap-northeast-1.amazonaws.com",partition:"aws"};break;case"ap-northeast-2":n={hostname:"logs.ap-northeast-2.amazonaws.com",partition:"aws"};break;case"ap-south-1":n={hostname:"logs.ap-south-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-1":n={hostname:"logs.ap-southeast-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-2":n={hostname:"logs.ap-southeast-2.amazonaws.com",partition:"aws"};break;case"ca-central-1":n={hostname:"logs.ca-central-1.amazonaws.com",partition:"aws"};break;case"cn-north-1":n={hostname:"logs.cn-north-1.amazonaws.com.cn",partition:"aws-cn"};break;case"cn-northwest-1":n={hostname:"logs.cn-northwest-1.amazonaws.com.cn",partition:"aws-cn"};break;case"eu-central-1":n={hostname:"logs.eu-central-1.amazonaws.com",partition:"aws"};break;case"eu-north-1":n={hostname:"logs.eu-north-1.amazonaws.com",partition:"aws"};break;case"eu-south-1":n={hostname:"logs.eu-south-1.amazonaws.com",partition:"aws"};break;case"eu-west-1":n={hostname:"logs.eu-west-1.amazonaws.com",partition:"aws"};break;case"eu-west-2":n={hostname:"logs.eu-west-2.amazonaws.com",partition:"aws"};break;case"eu-west-3":n={hostname:"logs.eu-west-3.amazonaws.com",partition:"aws"};break;case"fips-us-east-1":n={hostname:"logs-fips.us-east-1.amazonaws.com",partition:"aws",signingRegion:"us-east-1"};break;case"fips-us-east-2":n={hostname:"logs-fips.us-east-2.amazonaws.com",partition:"aws",signingRegion:"us-east-2"};break;case"fips-us-west-1":n={hostname:"logs-fips.us-west-1.amazonaws.com",partition:"aws",signingRegion:"us-west-1"};break;case"fips-us-west-2":n={hostname:"logs-fips.us-west-2.amazonaws.com",partition:"aws",signingRegion:"us-west-2"};break;case"me-south-1":n={hostname:"logs.me-south-1.amazonaws.com",partition:"aws"};break;case"sa-east-1":n={hostname:"logs.sa-east-1.amazonaws.com",partition:"aws"};break;case"us-east-1":n={hostname:"logs.us-east-1.amazonaws.com",partition:"aws"};break;case"us-east-2":n={hostname:"logs.us-east-2.amazonaws.com",partition:"aws"};break;case"us-gov-east-1":n={hostname:"logs.us-gov-east-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-east-1"};break;case"us-gov-west-1":n={hostname:"logs.us-gov-west-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-west-1"};break;case"us-iso-east-1":n={hostname:"logs.us-iso-east-1.c2s.ic.gov",partition:"aws-iso"};break;case"us-isob-east-1":n={hostname:"logs.us-isob-east-1.sc2s.sgov.gov",partition:"aws-iso-b"};break;case"us-west-1":n={hostname:"logs.us-west-1.amazonaws.com",partition:"aws"};break;case"us-west-2":n={hostname:"logs.us-west-2.amazonaws.com",partition:"aws"};break;default:so.has(e)&&(n={hostname:"logs.{region}.amazonaws.com".replace("{region}",e),partition:"aws"}),uo.has(e)&&(n={hostname:"logs.{region}.amazonaws.com.cn".replace("{region}",e),partition:"aws-cn"}),co.has(e)&&(n={hostname:"logs.{region}.c2s.ic.gov".replace("{region}",e),partition:"aws-iso"}),fo.has(e)&&(n={hostname:"logs.{region}.sc2s.sgov.gov".replace("{region}",e),partition:"aws-iso-b"}),lo.has(e)&&(n={hostname:"logs.{region}.amazonaws.com".replace("{region}",e),partition:"aws-us-gov"}),void 0===n&&(n={hostname:"logs.{region}.amazonaws.com".replace("{region}",e),partition:"aws"})}return Promise.resolve(ge({signingService:"logs"},n))},serviceId:"CloudWatch Logs",urlParser:ho},go=ge(ge({},po),{runtime:"browser",base64Decoder:zr,base64Encoder:Br,bodyLengthChecker:to,credentialDefaultProvider:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:oo({serviceId:po.serviceId,clientVersion:Ar.version}),maxAttempts:3,region:Dr("Region is missing"),requestHandler:new Ir,sha256:Or.Sha256,streamCollector:Ur,utf8Decoder:io,utf8Encoder:ao}),vo=function(e){var t;return Object(mn.__assign)(Object(mn.__assign)({},e),{tls:null===(t=e.tls)||void 0===t||t,endpoint:e.endpoint?mo(e):function(){return yo(e)},isCustomEndpoint:!!e.endpoint})},mo=function(e){var t=e.endpoint,n=e.urlParser;if("string"==typeof t){var r=Promise.resolve(n(t));return function(){return r}}if("object"==typeof t){var o=Promise.resolve(t);return function(){return o}}return t},yo=function(e){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var t,n,r,o,i;return Object(mn.__generator)(this,(function(a){switch(a.label){case 0:return t=e.tls,n=void 0===t||t,[4,e.region()];case 1:if(r=a.sent(),!new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/).test(r))throw new Error("Invalid region in client config");return[4,e.regionInfoProvider(r)];case 2:if(!(o=(null!==(i=a.sent())&&void 0!==i?i:{}).hostname))throw new Error("Cannot resolve hostname from client config");return[2,e.urlParser((n?"https:":"http:")+"//"+o)]}}))}))},bo=function(e){if(!e.region)throw new Error("Region is missing");return Object(mn.__assign)(Object(mn.__assign)({},e),{region:wo(e.region)})},wo=function(e){if("string"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e};var _o={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},So=function(e){return{applyToStack:function(t){t.add(function(e){var t=this;return function(n){return function(r){return Object(mn.__awaiter)(t,void 0,void 0,(function(){var t,o,i,a,s;return Object(mn.__generator)(this,(function(u){return t=r.request,yn.isInstance(t)&&(o=t.body,i=t.headers,o&&-1===Object.keys(i).map((function(e){return e.toLowerCase()})).indexOf("content-length")&&void 0!==(a=e(o))&&(t.headers=Object(mn.__assign)(Object(mn.__assign)({},t.headers),((s={})["content-length"]=String(a),s)))),[2,n(Object(mn.__assign)(Object(mn.__assign)({},r),{request:t}))]}))}))}}}(e.bodyLengthChecker),_o)}}};for(var Eo={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},xo=function(e){return{applyToStack:function(t){t.add(function(e){return function(t){return function(n){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var r,o;return Object(mn.__generator)(this,(function(i){return yn.isInstance(n.request)?(r=n.request,o=(e.requestHandler.metadata||{}).handlerProtocol,(void 0===o?"":o).indexOf("h2")>=0&&!r.headers[":authority"]?(delete r.headers.host,r.headers[":authority"]=""):r.headers.host||(r.headers.host=r.hostname),[2,t(n)]):[2,t(n)]}))}))}}}(e),Eo)}}},Ao={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},Oo=function(e){return{applyToStack:function(e){e.add((function(e,t){return function(n){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var r,o,i,a,s,u,c,f,l;return Object(mn.__generator)(this,(function(d){switch(d.label){case 0:return r=t.clientName,o=t.commandName,i=t.inputFilterSensitiveLog,a=t.logger,s=t.outputFilterSensitiveLog,[4,e(n)];case 1:return u=d.sent(),a?("function"==typeof a.info&&(c=u.output,f=c.$metadata,l=Object(mn.__rest)(c,["$metadata"]),a.info({clientName:r,commandName:o,input:i(n.input),output:s(l),metadata:f})),[2,u]):[2,u]}}))}))}}),Ao)}}},ko={},Lo={},Io=0;Io<256;Io++){var Po=Io.toString(16).toLowerCase();1===Po.length&&(Po="0"+Po),ko[Io]=Po,Lo[Po]=Io}function Co(e){for(var t="",n=0;n<e.byteLength;n++)t+=ko[e[n]];return t}var To="X-Amz-Date".toLowerCase(),jo=["authorization",To,"date"],Ro="X-Amz-Signature".toLowerCase(),Mo="X-Amz-Security-Token".toLowerCase(),No={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},zo=/^proxy-/,Bo=/^sec-/,Uo="AWS4-HMAC-SHA256-PAYLOAD",Fo={},Do=[];function qo(e,t,n){return e+"/"+t+"/"+n+"/aws4_request"}function Go(e,t,n){var r=new e(t);return r.update(n),r.digest()}function Ho(e,t,n){var r,o,i=e.headers,a={};try{for(var s=Object(mn.__values)(Object.keys(i).sort()),u=s.next();!u.done;u=s.next()){var c=u.value,f=c.toLowerCase();(f in No||(null==t?void 0:t.has(f))||zo.test(f)||Bo.test(f))&&(!n||n&&!n.has(f))||(a[f]=i[c].trim().replace(/\s+/g," "))}}catch(e){r={error:e}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return a}var Wo=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,$o)},$o=function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()};function Ko(e,t){var n=e.headers,r=e.body;return Object(mn.__awaiter)(this,void 0,void 0,(function(){var e,o,i,a,s,u,c;return Object(mn.__generator)(this,(function(f){switch(f.label){case 0:try{for(e=Object(mn.__values)(Object.keys(n)),o=e.next();!o.done;o=e.next())if("x-amz-content-sha256"===(i=o.value).toLowerCase())return[2,n[i]]}catch(e){u={error:e}}finally{try{o&&!o.done&&(c=e.return)&&c.call(e)}finally{if(u)throw u.error}}return null!=r?[3,1]:[2,"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"];case 1:return"string"==typeof r||ArrayBuffer.isView(r)||(l=r,"function"==typeof ArrayBuffer&&l instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(l))?((a=new t).update(r),s=Co,[4,a.digest()]):[3,3];case 2:return[2,s.apply(void 0,[f.sent()])];case 3:return[2,"UNSIGNED-PAYLOAD"]}var l}))}))}function Vo(e){var t=e.headers,n=e.query,r=Object(mn.__rest)(e,["headers","query"]);return Object(mn.__assign)(Object(mn.__assign)({},r),{headers:Object(mn.__assign)({},t),query:n?Yo(n):void 0})}function Yo(e){return Object.keys(e).reduce((function(t,n){var r,o=e[n];return Object(mn.__assign)(Object(mn.__assign)({},t),((r={})[n]=Array.isArray(o)?Object(mn.__spread)(o):o,r))}),{})}function Zo(e){var t,n;e="function"==typeof e.clone?e.clone():Vo(e);try{for(var r=Object(mn.__values)(Object.keys(e.headers)),o=r.next();!o.done;o=r.next()){var i=o.value;jo.indexOf(i.toLowerCase())>-1&&delete e.headers[i]}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return e}function Jo(e){return function(e){if("number"==typeof e)return new Date(1e3*e);if("string"==typeof e)return Number(e)?new Date(1e3*Number(e)):new Date(e);return e}(e).toISOString().replace(/\.\d{3}Z$/,"Z")}var Xo=function(){function e(e){var t=e.applyChecksum,n=e.credentials,r=e.region,o=e.service,i=e.sha256,a=e.uriEscapePath,s=void 0===a||a;this.service=o,this.sha256=i,this.uriEscapePath=s,this.applyChecksum="boolean"!=typeof t||t,this.regionProvider=ti(r),this.credentialProvider=ni(n)}return e.prototype.presign=function(e,t){return void 0===t&&(t={}),Object(mn.__awaiter)(this,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h,p,g,v,m,y,b,w,_,S,E,x,A;return Object(mn.__generator)(this,(function(O){switch(O.label){case 0:return n=t.signingDate,r=void 0===n?new Date:n,o=t.expiresIn,i=void 0===o?3600:o,a=t.unsignableHeaders,s=t.unhoistableHeaders,u=t.signableHeaders,c=t.signingRegion,f=t.signingService,[4,this.credentialProvider()];case 1:return l=O.sent(),null==c?[3,2]:(h=c,[3,4]);case 2:return[4,this.regionProvider()];case 3:h=O.sent(),O.label=4;case 4:return d=h,p=Qo(r),g=p.longDate,v=p.shortDate,i>604800?[2,Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future")]:(m=qo(v,d,null!=f?f:this.service),y=function(e,t){var n,r,o;void 0===t&&(t={});var i="function"==typeof e.clone?e.clone():Vo(e),a=i.headers,s=i.query,u=void 0===s?{}:s;try{for(var c=Object(mn.__values)(Object.keys(a)),f=c.next();!f.done;f=c.next()){var l=f.value,d=l.toLowerCase();"x-amz-"!==d.substr(0,6)||(null===(o=t.unhoistableHeaders)||void 0===o?void 0:o.has(d))||(u[l]=a[l],delete a[l])}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return Object(mn.__assign)(Object(mn.__assign)({},e),{headers:a,query:u})}(Zo(e),{unhoistableHeaders:s}),l.sessionToken&&(y.query["X-Amz-Security-Token"]=l.sessionToken),y.query["X-Amz-Algorithm"]="AWS4-HMAC-SHA256",y.query["X-Amz-Credential"]=l.accessKeyId+"/"+m,y.query["X-Amz-Date"]=g,y.query["X-Amz-Expires"]=i.toString(10),b=Ho(y,a,u),y.query["X-Amz-SignedHeaders"]=ei(b),w=y.query,_="X-Amz-Signature",S=this.getSignature,E=[g,m,this.getSigningKey(l,d,v,f)],x=this.createCanonicalRequest,A=[y,b],[4,Ko(e,this.sha256)]);case 5:return[4,S.apply(this,E.concat([x.apply(this,A.concat([O.sent()]))]))];case 6:return w[_]=O.sent(),[2,y]}}))}))},e.prototype.sign=function(e,t){return Object(mn.__awaiter)(this,void 0,void 0,(function(){return Object(mn.__generator)(this,(function(n){return"string"==typeof e?[2,this.signString(e,t)]:e.headers&&e.payload?[2,this.signEvent(e,t)]:[2,this.signRequest(e,t)]}))}))},e.prototype.signEvent=function(e,t){var n=e.headers,r=e.payload,o=t.signingDate,i=void 0===o?new Date:o,a=t.priorSignature,s=t.signingRegion,u=t.signingService;return Object(mn.__awaiter)(this,void 0,void 0,(function(){var e,t,o,c,f,l,d,h,p,g,v;return Object(mn.__generator)(this,(function(m){switch(m.label){case 0:return null==s?[3,1]:(t=s,[3,3]);case 1:return[4,this.regionProvider()];case 2:t=m.sent(),m.label=3;case 3:return e=t,o=Qo(i),c=o.shortDate,f=o.longDate,l=qo(c,e,null!=u?u:this.service),[4,Ko({headers:{},body:r},this.sha256)];case 4:return d=m.sent(),(h=new this.sha256).update(n),g=Co,[4,h.digest()];case 5:return p=g.apply(void 0,[m.sent()]),v=[Uo,f,l,a,p,d].join("\n"),[2,this.signString(v,{signingDate:i,signingRegion:e,signingService:u})]}}))}))},e.prototype.signString=function(e,t){var n=void 0===t?{}:t,r=n.signingDate,o=void 0===r?new Date:r,i=n.signingRegion,a=n.signingService;return Object(mn.__awaiter)(this,void 0,void 0,(function(){var t,n,r,s,u,c,f,l;return Object(mn.__generator)(this,(function(d){switch(d.label){case 0:return[4,this.credentialProvider()];case 1:return t=d.sent(),null==i?[3,2]:(r=i,[3,4]);case 2:return[4,this.regionProvider()];case 3:r=d.sent(),d.label=4;case 4:return n=r,s=Qo(o).shortDate,f=(c=this.sha256).bind,[4,this.getSigningKey(t,n,s,a)];case 5:return(u=new(f.apply(c,[void 0,d.sent()]))).update(e),l=Co,[4,u.digest()];case 6:return[2,l.apply(void 0,[d.sent()])]}}))}))},e.prototype.signRequest=function(e,t){var n=void 0===t?{}:t,r=n.signingDate,o=void 0===r?new Date:r,i=n.signableHeaders,a=n.unsignableHeaders,s=n.signingRegion,u=n.signingService;return Object(mn.__awaiter)(this,void 0,void 0,(function(){var t,n,r,c,f,l,d,h,p,g,v;return Object(mn.__generator)(this,(function(m){switch(m.label){case 0:return[4,this.credentialProvider()];case 1:return t=m.sent(),null==s?[3,2]:(r=s,[3,4]);case 2:return[4,this.regionProvider()];case 3:r=m.sent(),m.label=4;case 4:return n=r,c=Zo(e),f=Qo(o),l=f.longDate,d=f.shortDate,h=qo(d,n,null!=u?u:this.service),c.headers[To]=l,t.sessionToken&&(c.headers[Mo]=t.sessionToken),[4,Ko(c,this.sha256)];case 5:return p=m.sent(),!function(e,t){var n,r;e=e.toLowerCase();try{for(var o=Object(mn.__values)(Object.keys(t)),i=o.next();!i.done;i=o.next()){if(e===i.value.toLowerCase())return!0}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!1}("x-amz-content-sha256",c.headers)&&this.applyChecksum&&(c.headers["x-amz-content-sha256"]=p),g=Ho(c,a,i),[4,this.getSignature(l,h,this.getSigningKey(t,n,d,u),this.createCanonicalRequest(c,g,p))];case 6:return v=m.sent(),c.headers.authorization="AWS4-HMAC-SHA256 Credential="+t.accessKeyId+"/"+h+", SignedHeaders="+ei(g)+", Signature="+v,[2,c]}}))}))},e.prototype.createCanonicalRequest=function(e,t,n){var r=Object.keys(t).sort();return e.method+"\n"+this.getCanonicalPath(e)+"\n"+function(e){var t,n,r=e.query,o=void 0===r?{}:r,i=[],a={},s=function(e){if(e.toLowerCase()===Ro)return"continue";i.push(e);var t=o[e];"string"==typeof t?a[e]=Wo(e)+"="+Wo(t):Array.isArray(t)&&(a[e]=t.slice(0).sort().reduce((function(t,n){return t.concat([Wo(e)+"="+Wo(n)])}),[]).join("&"))};try{for(var u=Object(mn.__values)(Object.keys(o).sort()),c=u.next();!c.done;c=u.next()){s(c.value)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}return i.map((function(e){return a[e]})).filter((function(e){return e})).join("&")}(e)+"\n"+r.map((function(e){return e+":"+t[e]})).join("\n")+"\n\n"+r.join(";")+"\n"+n},e.prototype.createStringToSign=function(e,t,n){return Object(mn.__awaiter)(this,void 0,void 0,(function(){var r,o;return Object(mn.__generator)(this,(function(i){switch(i.label){case 0:return(r=new this.sha256).update(n),[4,r.digest()];case 1:return o=i.sent(),[2,"AWS4-HMAC-SHA256\n"+e+"\n"+t+"\n"+Co(o)]}}))}))},e.prototype.getCanonicalPath=function(e){var t=e.path;return this.uriEscapePath?"/"+encodeURIComponent(t.replace(/^\//,"")).replace(/%2F/g,"/"):t},e.prototype.getSignature=function(e,t,n,r){return Object(mn.__awaiter)(this,void 0,void 0,(function(){var o,i,a,s,u;return Object(mn.__generator)(this,(function(c){switch(c.label){case 0:return[4,this.createStringToSign(e,t,r)];case 1:return o=c.sent(),s=(a=this.sha256).bind,[4,n];case 2:return(i=new(s.apply(a,[void 0,c.sent()]))).update(o),u=Co,[4,i.digest()];case 3:return[2,u.apply(void 0,[c.sent()])]}}))}))},e.prototype.getSigningKey=function(e,t,n,r){return function(e,t,n,r,o){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var i,a,s,u,c,f,l,d,h;return Object(mn.__generator)(this,(function(p){switch(p.label){case 0:return[4,Go(e,t.secretAccessKey,t.accessKeyId)];case 1:if(i=p.sent(),(a=n+":"+r+":"+o+":"+Co(i)+":"+t.sessionToken)in Fo)return[2,Fo[a]];for(Do.push(a);Do.length>50;)delete Fo[Do.shift()];s="AWS4"+t.secretAccessKey,p.label=2;case 2:p.trys.push([2,7,8,9]),u=Object(mn.__values)([n,r,o,"aws4_request"]),c=u.next(),p.label=3;case 3:return c.done?[3,6]:(f=c.value,[4,Go(e,s,f)]);case 4:s=p.sent(),p.label=5;case 5:return c=u.next(),[3,3];case 6:return[3,9];case 7:return l=p.sent(),d={error:l},[3,9];case 8:try{c&&!c.done&&(h=u.return)&&h.call(u)}finally{if(d)throw d.error}return[7];case 9:return[2,Fo[a]=s]}}))}))}(this.sha256,e,n,t,r||this.service)},e}(),Qo=function(e){var t=Jo(e).replace(/[\-:]/g,"");return{longDate:t,shortDate:t.substr(0,8)}},ei=function(e){return Object.keys(e).sort().join(";")},ti=function(e){if("string"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e},ni=function(e){if("object"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e};function ri(e){var t,n=this,r=oi(e.credentials||e.credentialDefaultProvider(e)),o=e.signingEscapePath,i=void 0===o||o,a=e.systemClockOffset,s=void 0===a?e.systemClockOffset||0:a,u=e.sha256;return t=e.signer?oi(e.signer):function(){return oi(e.region)().then((function(t){return Object(mn.__awaiter)(n,void 0,void 0,(function(){return Object(mn.__generator)(this,(function(n){switch(n.label){case 0:return[4,e.regionInfoProvider(t)];case 1:return[2,[n.sent()||{},t]]}}))}))})).then((function(t){var n=Object(mn.__read)(t,2),o=n[0],a=n[1],s=o.signingRegion,c=o.signingService;return e.signingRegion=e.signingRegion||s||a,e.signingName=e.signingName||c||e.serviceId,new Xo({credentials:r,region:e.signingRegion,service:e.signingName,sha256:u,uriEscapePath:i})}))},Object(mn.__assign)(Object(mn.__assign)({},e),{systemClockOffset:s,signingEscapePath:i,credentials:r,signer:t})}function oi(e){if("object"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e}var ii=function(e){return new Date(Date.now()+e)};function ai(e){return function(t,n){return function(r){return Object(mn.__awaiter)(this,void 0,void 0,(function(){var o,i,a,s,u,c,f,l,d;return Object(mn.__generator)(this,(function(h){switch(h.label){case 0:return yn.isInstance(r.request)?"function"!=typeof e.signer?[3,2]:[4,e.signer()]:[2,t(r)];case 1:return i=h.sent(),[3,3];case 2:i=e.signer,h.label=3;case 3:return o=i,s=t,u=[Object(mn.__assign)({},r)],d={},[4,o.sign(r.request,{signingDate:new Date(Date.now()+e.systemClockOffset),signingRegion:n.signing_region,signingService:n.signing_service})];case 4:return[4,s.apply(void 0,[mn.__assign.apply(void 0,u.concat([(d.request=h.sent(),d)]))])];case 5:return a=h.sent(),c=a.response.headers,(f=c&&(c.date||c.Date))&&(l=Date.parse(f),p=l,g=e.systemClockOffset,Math.abs(ii(g).getTime()-p)>=3e5&&(e.systemClockOffset=l-Date.now())),[2,a]}var p,g}))}))}}}var si={name:"awsAuthMiddleware",tags:["SIGNATURE","AWSAUTH"],relation:"after",toMiddleware:"retryMiddleware",override:!0};function ui(e){return Object(mn.__assign)(Object(mn.__assign)({},e),{customUserAgent:"string"==typeof e.customUserAgent?[[e.customUserAgent]]:e.customUserAgent})}var ci=/[^\!\#\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,fi=function(e){var t=Object(mn.__read)(e,2),n=t[0],r=t[1],o=n.indexOf("/"),i=n.substring(0,o),a=n.substring(o+1);return"api"===i&&(a=a.toLowerCase()),[i,a,r].filter((function(e){return e&&e.length>0})).map((function(e){return null==e?void 0:e.replace(ci,"_")})).join("/")},li={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},di=function(e){return{applyToStack:function(t){var n;t.add((n=e,function(e,t){return function(r){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var o,i,a,s,u,c,f,l;return Object(mn.__generator)(this,(function(d){switch(d.label){case 0:return o=r.request,yn.isInstance(o)?(i=o.headers,a=(null===(f=null==t?void 0:t.userAgent)||void 0===f?void 0:f.map(fi))||[],[4,n.defaultUserAgentProvider()]):[2,e(r)];case 1:return s=d.sent().map(fi),u=(null===(l=null==n?void 0:n.customUserAgent)||void 0===l?void 0:l.map(fi))||[],i["x-amz-user-agent"]=Object(mn.__spread)(s,a,u).join(" "),c=Object(mn.__spread)(s.filter((function(e){return e.startsWith("aws-sdk-")})),u).join(" "),"browser"!==n.runtime&&c&&(i["user-agent"]=i["user-agent"]?i["user-agent"]+" "+c:c),[2,e(Object(mn.__assign)(Object(mn.__assign)({},r),{request:o}))]}}))}))}}),li)}}},hi=function(e){function t(t){var n,r=this,o=ge(ge({},go),t),i=bo(o),a=ri(vo(i)),s=ui(Qr(a));return(r=e.call(this,s)||this).config=s,r.middlewareStack.use((n=r.config,{applyToStack:function(e){e.addRelativeTo(ai(n),si)}})),r.middlewareStack.use(Gr(r.config)),r.middlewareStack.use(So(r.config)),r.middlewareStack.use(xo(r.config)),r.middlewareStack.use(Oo(r.config)),r.middlewareStack.use(di(r.config)),r}return pe(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(vr),pi={},gi=function(){function e(){}return e.setItem=function(e,t){return pi[e]=t,pi[e]},e.getItem=function(e){return Object.prototype.hasOwnProperty.call(pi,e)?pi[e]:void 0},e.removeItem=function(e){return delete pi[e]},e.clear=function(){return pi={}},e}(),vi=function(){function e(){try{this.storageWindow=window.localStorage,this.storageWindow.setItem("aws.amplify.test-ls",1),this.storageWindow.removeItem("aws.amplify.test-ls")}catch(e){this.storageWindow=gi}}return e.prototype.getStorage=function(){return this.storageWindow},e}();function mi(e){return(mi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var yi,bi=(yi=function(e,t){return(yi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}yi(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),wi=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},_i=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Si=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Ei=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Si(arguments[t]));return e},xi=new g("Util"),Ai=function(e){function t(t){var n=e.call(this,t)||this;return n.nonRetryable=!0,n}return bi(t,e),t}(Error);function Oi(e,t,n,r){return wi(this,void 0,void 0,(function(){var o=this;return _i(this,(function(i){if("function"!=typeof e)throw Error("functionToRetry must be a function");return[2,new Promise((function(i,a){return wi(o,void 0,void 0,(function(){var o,s,u,c,f,l,d;return _i(this,(function(h){switch(h.label){case 0:o=0,s=!1,c=function(){},r&&r.then((function(){s=!0,clearTimeout(u),c()})),l=function(){var r,l,d,h;return _i(this,(function(p){switch(p.label){case 0:o++,xi.debug(e.name+" attempt #"+o+" with this vars: "+JSON.stringify(t)),p.label=1;case 1:return p.trys.push([1,3,,7]),r={},l=i,[4,e.apply(void 0,Ei(t))];case 2:return[2,(r.value=l.apply(void 0,[p.sent()]),r)];case 3:return d=p.sent(),f=d,xi.debug("error on "+e.name,d),(g=d)&&g.nonRetryable?(xi.debug(e.name+" non retryable error",d),[2,{value:a(d)}]):(h=n(o,t,d),xi.debug(e.name+" retrying in "+h+" ms"),!1===h||s?[2,{value:a(d)}]:[3,4]);case 4:return[4,new Promise((function(e){c=e,u=setTimeout(c,h)}))];case 5:p.sent(),p.label=6;case 6:return[3,7];case 7:return[2]}var g}))},h.label=1;case 1:return s?[3,3]:[5,l()];case 2:return"object"===mi(d=h.sent())?[2,d.value]:[3,1];case 3:return a(f),[2]}}))}))}))]}))}))}function ki(e){void 0===e&&(e=3e5);return function(t){var n=100*Math.pow(2,t)+100*Math.random();return!(n>e)&&n}}var Li=function(e,t,n,r){return void 0===n&&(n=3e5),Oi(e,t,ki(n),r)},Ii=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Pi=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Ci=new g("CognitoCredentials"),Ti=new Promise((function(e,t){return Object(U.b)().isBrowser?(window.gapi&&window.gapi.auth2?window.gapi.auth2:null)?(Ci.debug("google api already loaded"),e()):void setTimeout((function(){return e()}),2e3):(Ci.debug("not in the browser, directly resolved"),e())})),ji=function(){function e(){this.initialized=!1,this.refreshGoogleToken=this.refreshGoogleToken.bind(this),this._refreshGoogleTokenImpl=this._refreshGoogleTokenImpl.bind(this)}return e.prototype.refreshGoogleToken=function(){return Ii(this,void 0,void 0,(function(){return Pi(this,(function(e){switch(e.label){case 0:return this.initialized?[3,2]:(Ci.debug("need to wait for the Google SDK loaded"),[4,Ti]);case 1:e.sent(),this.initialized=!0,Ci.debug("finish waiting"),e.label=2;case 2:return[2,this._refreshGoogleTokenImpl()]}}))}))},e.prototype._refreshGoogleTokenImpl=function(){var e=null;return Object(U.b)().isBrowser&&(e=window.gapi&&window.gapi.auth2?window.gapi.auth2:null),e?new Promise((function(t,n){e.getAuthInstance().then((function(e){e||(Ci.debug("google Auth undefined"),n(new Ai("google Auth undefined")));var r=e.currentUser.get();r.isSignedIn()?(Ci.debug("refreshing the google access token"),r.reloadAuthResponse().then((function(e){var n=e.id_token,r=e.expires_at;t({token:n,expires_at:r})})).catch((function(e){e&&"network_error"===e.error?n("Network error reloading google auth response"):n(new Ai("Failed to reload google auth response"))}))):n(new Ai("User is not signed in with Google"))})).catch((function(e){Ci.debug("Failed to refresh google token",e),n(new Ai("Failed to refresh google token"))}))})):(Ci.debug("no gapi auth2 available"),Promise.reject("no gapi auth2 available"))},e}(),Ri=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Mi=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Ni=new g("CognitoCredentials"),zi=new Promise((function(e,t){return Object(U.b)().isBrowser?window.FB?(Ni.debug("FB SDK already loaded"),e()):void setTimeout((function(){return e()}),2e3):(Ni.debug("not in the browser, directly resolved"),e())})),Bi=function(){function e(){this.initialized=!1,this.refreshFacebookToken=this.refreshFacebookToken.bind(this),this._refreshFacebookTokenImpl=this._refreshFacebookTokenImpl.bind(this)}return e.prototype.refreshFacebookToken=function(){return Ri(this,void 0,void 0,(function(){return Mi(this,(function(e){switch(e.label){case 0:return this.initialized?[3,2]:(Ni.debug("need to wait for the Facebook SDK loaded"),[4,zi]);case 1:e.sent(),this.initialized=!0,Ni.debug("finish waiting"),e.label=2;case 2:return[2,this._refreshFacebookTokenImpl()]}}))}))},e.prototype._refreshFacebookTokenImpl=function(){var e=null;if(Object(U.b)().isBrowser&&(e=window.FB),!e){return Ni.debug("no fb sdk available"),Promise.reject(new Ai("no fb sdk available"))}return new Promise((function(t,n){e.getLoginStatus((function(e){if(e&&e.authResponse){var r=e.authResponse,o=r.accessToken,i=1e3*r.expiresIn+(new Date).getTime();if(!o){a="the jwtToken is undefined";Ni.debug(a),n(new Ai(a))}t({token:o,expires_at:i})}else{var a="no response from facebook when refreshing the jwt token";Ni.debug(a),n(new Ai(a))}}),{scope:"public_profile,email"})}))},e}(),Ui=new ji,Fi=new Bi,Di=function(e,t){return(Di=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function qi(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Di(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Gi=function(){return(Gi=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function Hi(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function Wi(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}Object.create;function $i(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}var Ki,Vi,Yi,Zi,Ji,Xi,Qi,ea,ta,na,ra,oa,ia,aa,sa,ua,ca,fa,la,da,ha,pa,ga,va,ma,ya,ba,wa,_a,Sa,Ea,xa,Aa,Oa,ka,La,Ia,Pa,Ca,Ta,ja,Ra,Ma,Na,za,Ba,Ua,Fa,Da,qa,Ga,Ha,Wa,$a,Ka,Va,Ya;Object.create;!function(e){e.AUTHENTICATED_ROLE="AuthenticatedRole",e.DENY="Deny"}(Ki||(Ki={})),(Vi||(Vi={})).filterSensitiveLog=function(e){return Gi({},e)},(Yi||(Yi={})).filterSensitiveLog=function(e){return Gi({},e)},(Zi||(Zi={})).filterSensitiveLog=function(e){return Gi({},e)},(Ji||(Ji={})).filterSensitiveLog=function(e){return Gi({},e)},function(e){e.filterSensitiveLog=function(e){return Gi({},e)}}(Xi||(Xi={})),function(e){e.filterSensitiveLog=function(e){return Gi({},e)}}(Qi||(Qi={})),(ea||(ea={})).filterSensitiveLog=function(e){return Gi({},e)},(ta||(ta={})).filterSensitiveLog=function(e){return Gi({},e)},(na||(na={})).filterSensitiveLog=function(e){return Gi({},e)},(ra||(ra={})).filterSensitiveLog=function(e){return Gi({},e)},function(e){e.ACCESS_DENIED="AccessDenied",e.INTERNAL_SERVER_ERROR="InternalServerError"}(oa||(oa={})),(ia||(ia={})).filterSensitiveLog=function(e){return Gi({},e)},(aa||(aa={})).filterSensitiveLog=function(e){return Gi({},e)},(sa||(sa={})).filterSensitiveLog=function(e){return Gi({},e)},function(e){e.filterSensitiveLog=function(e){return Gi({},e)}}(ua||(ua={})),(ca||(ca={})).filterSensitiveLog=function(e){return Gi({},e)},(fa||(fa={})).filterSensitiveLog=function(e){return Gi({},e)},(la||(la={})).filterSensitiveLog=function(e){return Gi({},e)},(da||(da={})).filterSensitiveLog=function(e){return Gi({},e)},(ha||(ha={})).filterSensitiveLog=function(e){return Gi({},e)},(pa||(pa={})).filterSensitiveLog=function(e){return Gi({},e)},(ga||(ga={})).filterSensitiveLog=function(e){return Gi({},e)},(va||(va={})).filterSensitiveLog=function(e){return Gi({},e)},(ma||(ma={})).filterSensitiveLog=function(e){return Gi({},e)},(ya||(ya={})).filterSensitiveLog=function(e){return Gi({},e)},(ba||(ba={})).filterSensitiveLog=function(e){return Gi({},e)},function(e){e.CONTAINS="Contains",e.EQUALS="Equals",e.NOT_EQUAL="NotEqual",e.STARTS_WITH="StartsWith"}(wa||(wa={})),(_a||(_a={})).filterSensitiveLog=function(e){return Gi({},e)},(Sa||(Sa={})).filterSensitiveLog=function(e){return Gi({},e)},function(e){e.RULES="Rules",e.TOKEN="Token"}(Ea||(Ea={})),(xa||(xa={})).filterSensitiveLog=function(e){return Gi({},e)},(Aa||(Aa={})).filterSensitiveLog=function(e){return Gi({},e)},(Oa||(Oa={})).filterSensitiveLog=function(e){return Gi({},e)},(ka||(ka={})).filterSensitiveLog=function(e){return Gi({},e)},(La||(La={})).filterSensitiveLog=function(e){return Gi({},e)},(Ia||(Ia={})).filterSensitiveLog=function(e){return Gi({},e)},(Pa||(Pa={})).filterSensitiveLog=function(e){return Gi({},e)},(Ca||(Ca={})).filterSensitiveLog=function(e){return Gi({},e)},(Ta||(Ta={})).filterSensitiveLog=function(e){return Gi({},e)},(ja||(ja={})).filterSensitiveLog=function(e){return Gi({},e)},(Ra||(Ra={})).filterSensitiveLog=function(e){return Gi({},e)},(Ma||(Ma={})).filterSensitiveLog=function(e){return Gi({},e)},(Na||(Na={})).filterSensitiveLog=function(e){return Gi({},e)},(za||(za={})).filterSensitiveLog=function(e){return Gi({},e)},(Ba||(Ba={})).filterSensitiveLog=function(e){return Gi({},e)},(Ua||(Ua={})).filterSensitiveLog=function(e){return Gi({},e)},(Fa||(Fa={})).filterSensitiveLog=function(e){return Gi({},e)},(Da||(Da={})).filterSensitiveLog=function(e){return Gi({},e)},(qa||(qa={})).filterSensitiveLog=function(e){return Gi({},e)},(Ga||(Ga={})).filterSensitiveLog=function(e){return Gi({},e)},(Ha||(Ha={})).filterSensitiveLog=function(e){return Gi({},e)},(Wa||(Wa={})).filterSensitiveLog=function(e){return Gi({},e)},($a||($a={})).filterSensitiveLog=function(e){return Gi({},e)},(Ka||(Ka={})).filterSensitiveLog=function(e){return Gi({},e)},(Va||(Va={})).filterSensitiveLog=function(e){return Gi({},e)},(Ya||(Ya={})).filterSensitiveLog=function(e){return Gi({},e)};var Za=function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h,p,g,v;return Wi(this,(function(m){switch(m.label){case 0:return r=[Gi({},e)],v={},[4,As(e.body,t)];case 1:switch(n=Gi.apply(void 0,r.concat([(v.body=m.sent(),v)])),i="UnknownError",i=Os(e,n.body),i){case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":return[3,2];case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":return[3,4];case"InvalidIdentityPoolConfigurationException":case"com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException":return[3,6];case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":return[3,8];case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":return[3,10];case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":return[3,12];case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":return[3,14];case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":return[3,16]}return[3,18];case 2:return a=[{}],[4,Xa(n,t)];case 3:return o=Gi.apply(void 0,[Gi.apply(void 0,a.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 4:return s=[{}],[4,Qa(n,t)];case 5:return o=Gi.apply(void 0,[Gi.apply(void 0,s.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 6:return u=[{}],[4,es(n,t)];case 7:return o=Gi.apply(void 0,[Gi.apply(void 0,u.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 8:return c=[{}],[4,ts(n,t)];case 9:return o=Gi.apply(void 0,[Gi.apply(void 0,c.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 10:return f=[{}],[4,rs(n,t)];case 11:return o=Gi.apply(void 0,[Gi.apply(void 0,f.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 12:return l=[{}],[4,os(n,t)];case 13:return o=Gi.apply(void 0,[Gi.apply(void 0,l.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 14:return d=[{}],[4,is(n,t)];case 15:return o=Gi.apply(void 0,[Gi.apply(void 0,d.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 16:return h=[{}],[4,as(n,t)];case 17:return o=Gi.apply(void 0,[Gi.apply(void 0,h.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 18:p=n.body,i=p.code||p.Code||i,o=Gi(Gi({},p),{name:""+i,message:p.message||p.Message||i,$fault:"client",$metadata:Ss(e)}),m.label=19;case 19:return g=o.message||o.Message||i,o.message=g,delete o.Message,[2,Promise.reject(Object.assign(new Error(g),o))]}}))}))},Ja=function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h,p,g,v;return Wi(this,(function(m){switch(m.label){case 0:return r=[Gi({},e)],v={},[4,As(e.body,t)];case 1:switch(n=Gi.apply(void 0,r.concat([(v.body=m.sent(),v)])),i="UnknownError",i=Os(e,n.body),i){case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":return[3,2];case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":return[3,4];case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":return[3,6];case"LimitExceededException":case"com.amazonaws.cognitoidentity#LimitExceededException":return[3,8];case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":return[3,10];case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":return[3,12];case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":return[3,14];case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":return[3,16]}return[3,18];case 2:return a=[{}],[4,Xa(n,t)];case 3:return o=Gi.apply(void 0,[Gi.apply(void 0,a.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 4:return s=[{}],[4,Qa(n,t)];case 5:return o=Gi.apply(void 0,[Gi.apply(void 0,s.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 6:return u=[{}],[4,ts(n,t)];case 7:return o=Gi.apply(void 0,[Gi.apply(void 0,u.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 8:return c=[{}],[4,ns(n,t)];case 9:return o=Gi.apply(void 0,[Gi.apply(void 0,c.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 10:return f=[{}],[4,rs(n,t)];case 11:return o=Gi.apply(void 0,[Gi.apply(void 0,f.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 12:return l=[{}],[4,os(n,t)];case 13:return o=Gi.apply(void 0,[Gi.apply(void 0,l.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 14:return d=[{}],[4,is(n,t)];case 15:return o=Gi.apply(void 0,[Gi.apply(void 0,d.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 16:return h=[{}],[4,as(n,t)];case 17:return o=Gi.apply(void 0,[Gi.apply(void 0,h.concat([m.sent()])),{name:i,$metadata:Ss(e)}]),[3,19];case 18:p=n.body,i=p.code||p.Code||i,o=Gi(Gi({},p),{name:""+i,message:p.message||p.Message||i,$fault:"client",$metadata:Ss(e)}),m.label=19;case 19:return g=o.message||o.Message||i,o.message=g,delete o.Message,[2,Promise.reject(Object.assign(new Error(g),o))]}}))}))},Xa=function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r;return Wi(this,(function(o){return n=e.body,r=ls(n,t),[2,Gi({name:"ExternalServiceException",$fault:"client",$metadata:Ss(e)},r)]}))}))},Qa=function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r;return Wi(this,(function(o){return n=e.body,r=ps(n,t),[2,Gi({name:"InternalErrorException",$fault:"server",$metadata:Ss(e)},r)]}))}))},es=function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r;return Wi(this,(function(o){return n=e.body,r=gs(n,t),[2,Gi({name:"InvalidIdentityPoolConfigurationException",$fault:"client",$metadata:Ss(e)},r)]}))}))},ts=function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r;return Wi(this,(function(o){return n=e.body,r=vs(n,t),[2,Gi({name:"InvalidParameterException",$fault:"client",$metadata:Ss(e)},r)]}))}))},ns=function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r;return Wi(this,(function(o){return n=e.body,r=ms(n,t),[2,Gi({name:"LimitExceededException",$fault:"client",$metadata:Ss(e)},r)]}))}))},rs=function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r;return Wi(this,(function(o){return n=e.body,r=ys(n,t),[2,Gi({name:"NotAuthorizedException",$fault:"client",$metadata:Ss(e)},r)]}))}))},os=function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r;return Wi(this,(function(o){return n=e.body,r=bs(n,t),[2,Gi({name:"ResourceConflictException",$fault:"client",$metadata:Ss(e)},r)]}))}))},is=function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r;return Wi(this,(function(o){return n=e.body,r=ws(n,t),[2,Gi({name:"ResourceNotFoundException",$fault:"client",$metadata:Ss(e)},r)]}))}))},as=function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r;return Wi(this,(function(o){return n=e.body,r=_s(n,t),[2,Gi({name:"TooManyRequestsException",$fault:"client",$metadata:Ss(e)},r)]}))}))},ss=function(e,t){return Gi(Gi(Gi({},void 0!==e.CustomRoleArn&&null!==e.CustomRoleArn&&{CustomRoleArn:e.CustomRoleArn}),void 0!==e.IdentityId&&null!==e.IdentityId&&{IdentityId:e.IdentityId}),void 0!==e.Logins&&null!==e.Logins&&{Logins:cs(e.Logins,t)})},us=function(e,t){return Gi(Gi(Gi({},void 0!==e.AccountId&&null!==e.AccountId&&{AccountId:e.AccountId}),void 0!==e.IdentityPoolId&&null!==e.IdentityPoolId&&{IdentityPoolId:e.IdentityPoolId}),void 0!==e.Logins&&null!==e.Logins&&{Logins:cs(e.Logins,t)})},cs=function(e,t){return Object.entries(e).reduce((function(e,t){var n,r=$i(t,2),o=r[0],i=r[1];return null===i?e:Gi(Gi({},e),((n={})[o]=i,n))}),{})},fs=function(e,t){return{AccessKeyId:void 0!==e.AccessKeyId&&null!==e.AccessKeyId?e.AccessKeyId:void 0,Expiration:void 0!==e.Expiration&&null!==e.Expiration?new Date(Math.round(1e3*e.Expiration)):void 0,SecretKey:void 0!==e.SecretKey&&null!==e.SecretKey?e.SecretKey:void 0,SessionToken:void 0!==e.SessionToken&&null!==e.SessionToken?e.SessionToken:void 0}},ls=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},ds=function(e,t){return{Credentials:void 0!==e.Credentials&&null!==e.Credentials?fs(e.Credentials):void 0,IdentityId:void 0!==e.IdentityId&&null!==e.IdentityId?e.IdentityId:void 0}},hs=function(e,t){return{IdentityId:void 0!==e.IdentityId&&null!==e.IdentityId?e.IdentityId:void 0}},ps=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},gs=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},vs=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},ms=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},ys=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},bs=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},ws=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},_s=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Ss=function(e){var t;return{httpStatusCode:e.statusCode,requestId:null!==(t=e.headers["x-amzn-requestid"])&&void 0!==t?t:e.headers["x-amzn-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}},Es=function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)},xs=function(e,t,n,r,o){return Hi(void 0,void 0,void 0,(function(){var i,a,s,u,c,f;return Wi(this,(function(l){switch(l.label){case 0:return[4,e.endpoint()];case 1:return i=l.sent(),a=i.hostname,s=i.protocol,u=void 0===s?"https":s,c=i.port,f={protocol:u,hostname:a,port:c,method:"POST",path:n,headers:t},void 0!==r&&(f.hostname=r),void 0!==o&&(f.body=o),[2,new yn(f)]}}))}))},As=function(e,t){return function(e,t){return Es(e,t).then((function(e){return t.utf8Encoder(e)}))}(e,t).then((function(e){return e.length?JSON.parse(e):{}}))},Os=function(e,t){var n,r,o=function(e){var t=e;return t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},i=(n=e.headers,r="x-amzn-errortype",Object.keys(n).find((function(e){return e.toLowerCase()===r.toLowerCase()})));return void 0!==i?o(e.headers[i]):void 0!==t.code?o(t.code):void 0!==t.__type?o(t.__type):""},ks=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return qi(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CognitoIdentityClient",commandName:"GetCredentialsForIdentityCommand",inputFilterSensitiveLog:ha.filterSensitiveLog,outputFilterSensitiveLog:ga.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r;return Wi(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.GetCredentialsForIdentity"},r=JSON.stringify(ss(e,t)),[2,xs(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r,o;return Wi(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,Za(e,t)]:[4,As(e.body,t)];case 1:return n=i.sent(),{},r=ds(n,t),o=Gi({$metadata:Ss(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),Ls=function(e){function t(t,n){void 0===n&&(n=!0);var r=e.call(this,t)||this;return r.tryNextLink=n,r}return Object(mn.__extends)(t,e),t}(Error);function Is(e){return Promise.all(Object.keys(e).reduce((function(t,n){var r=e[n];return"string"==typeof r?t.push([n,r]):t.push(r().then((function(e){return[n,e]}))),t}),[])).then((function(e){return e.reduce((function(e,t){var n=Object(mn.__read)(t,2),r=n[0],o=n[1];return e[r]=o,e}),{})}))}function Ps(e){var t=this;return function(){return Object(mn.__awaiter)(t,void 0,void 0,(function(){var t,n,r,o,i,a,s,u,c,f,l,d,h;return Object(mn.__generator)(this,(function(p){switch(p.label){case 0:return f=(c=e.client).send,l=ks.bind,h={CustomRoleArn:e.customRoleArn,IdentityId:e.identityId},e.logins?[4,Is(e.logins)]:[3,2];case 1:return d=p.sent(),[3,3];case 2:d=void 0,p.label=3;case 3:return[4,f.apply(c,[new(l.apply(ks,[void 0,(h.Logins=d,h)]))])];case 4:return t=p.sent().Credentials,n=void 0===t?function(){throw new Ls("Response from Amazon Cognito contained no credentials")}():t,r=n.AccessKeyId,o=void 0===r?function(){throw new Ls("Response from Amazon Cognito contained no access key ID")}():r,i=n.Expiration,a=n.SecretKey,s=void 0===a?function(){throw new Ls("Response from Amazon Cognito contained no secret key")}():a,u=n.SessionToken,[2,{identityId:e.identityId,accessKeyId:o,secretAccessKey:s,sessionToken:u,expiration:i}]}}))}))}}var Cs=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return qi(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CognitoIdentityClient",commandName:"GetIdCommand",inputFilterSensitiveLog:ma.filterSensitiveLog,outputFilterSensitiveLog:ya.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r;return Wi(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.GetId"},r=JSON.stringify(us(e,t)),[2,xs(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return Hi(void 0,void 0,void 0,(function(){var n,r,o;return Wi(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,Ja(e,t)]:[4,As(e.body,t)];case 1:return n=i.sent(),{},r=hs(n,t),o=Gi({$metadata:Ss(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),Ts=function(){function e(e){void 0===e&&(e="aws:cognito-identity-ids"),this.dbName=e}return e.prototype.getItem=function(e){return this.withObjectStore("readonly",(function(t){var n=t.get(e);return new Promise((function(e){n.onerror=function(){return e(null)},n.onsuccess=function(){return e(n.result?n.result.value:null)}}))})).catch((function(){return null}))},e.prototype.removeItem=function(e){return this.withObjectStore("readwrite",(function(t){var n=t.delete(e);return new Promise((function(e,t){n.onerror=function(){return t(n.error)},n.onsuccess=function(){return e()}}))}))},e.prototype.setItem=function(e,t){return this.withObjectStore("readwrite",(function(n){var r=n.put({id:e,value:t});return new Promise((function(e,t){r.onerror=function(){return t(r.error)},r.onsuccess=function(){return e()}}))}))},e.prototype.getDb=function(){var e=self.indexedDB.open(this.dbName,1);return new Promise((function(t,n){e.onsuccess=function(){t(e.result)},e.onerror=function(){n(e.error)},e.onblocked=function(){n(new Error("Unable to access DB"))},e.onupgradeneeded=function(){var t=e.result;t.onerror=function(){n(new Error("Failed to create object store"))},t.createObjectStore("IdentityIds",{keyPath:"id"})}}))},e.prototype.withObjectStore=function(e,t){return this.getDb().then((function(n){var r=n.transaction("IdentityIds",e);return r.oncomplete=function(){return n.close()},new Promise((function(e,n){r.onerror=function(){return n(r.error)},e(t(r.objectStore("IdentityIds")))})).catch((function(e){throw n.close(),e}))}))},e}(),js=new(function(){function e(e){void 0===e&&(e={}),this.store=e}return e.prototype.getItem=function(e){return e in this.store?this.store[e]:null},e.prototype.removeItem=function(e){delete this.store[e]},e.prototype.setItem=function(e,t){this.store[e]=t},e}());function Rs(e){var t=this,n=e.accountId,r=e.cache,o=void 0===r?"object"==typeof self&&self.indexedDB?new Ts:"object"==typeof window&&window.localStorage?window.localStorage:js:r,i=e.client,a=e.customRoleArn,s=e.identityPoolId,u=e.logins,c=e.userIdentifier,f=void 0===c?u&&0!==Object.keys(u).length?void 0:"ANONYMOUS":c,l=f?"aws:cognito-identity-credentials:"+s+":"+f:void 0,d=function(){return Object(mn.__awaiter)(t,void 0,void 0,(function(){var e,t,r,c,f,h,p,g,v;return Object(mn.__generator)(this,(function(m){switch(m.label){case 0:return(t=l)?[4,o.getItem(l)]:[3,2];case 1:t=m.sent(),m.label=2;case 2:return(e=t)?[3,7]:(h=(f=i).send,p=Cs.bind,v={AccountId:n,IdentityPoolId:s},u?[4,Is(u)]:[3,4]);case 3:return g=m.sent(),[3,5];case 4:g=void 0,m.label=5;case 5:return[4,h.apply(f,[new(p.apply(Cs,[void 0,(v.Logins=g,v)]))])];case 6:r=m.sent().IdentityId,c=void 0===r?function(){throw new Ls("Response from Amazon Cognito contained no identity ID")}():r,e=c,l&&Promise.resolve(o.setItem(l,e)).catch((function(){})),m.label=7;case 7:return[2,(d=Ps({client:i,customRoleArn:a,logins:u,identityId:e}))()]}}))}))};return function(){return d().catch((function(e){return Object(mn.__awaiter)(t,void 0,void 0,(function(){return Object(mn.__generator)(this,(function(t){throw l&&Promise.resolve(o.removeItem(l)).catch((function(){})),e}))}))}))}}var Ms=function(e,t){return(Ms=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function Ns(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Ms(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var zs=function(){return(zs=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function Bs(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function Us(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}Object.create;function Fs(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}Object.create;var Ds,qs,Gs,Hs,Ws,$s,Ks,Vs,Ys,Zs,Js,Xs,Qs,eu,tu,nu,ru,ou,iu,au,su,uu,cu,fu,lu,du,hu,pu,gu,vu,mu,yu,bu,wu,_u,Su,Eu,xu,Au,Ou,ku,Lu,Iu,Pu,Cu,Tu,ju,Ru,Mu,Nu,zu,Bu,Uu,Fu,Du,qu,Gu,Hu=n(21),Wu=new Set(["af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-south-1","ap-southeast-1","ap-southeast-2","ca-central-1","eu-central-1","eu-north-1","eu-south-1","eu-west-1","eu-west-2","eu-west-3","me-south-1","sa-east-1","us-east-1","us-east-2","us-west-1","us-west-2"]),$u=new Set(["cn-north-1","cn-northwest-1"]),Ku=new Set(["us-iso-east-1"]),Vu=new Set(["us-isob-east-1"]),Yu=new Set(["us-gov-east-1","us-gov-west-1"]),Zu={apiVersion:"2014-06-30",disableHostPrefix:!1,logger:{},regionInfoProvider:function(e,t){var n=void 0;switch(e){case"ap-northeast-1":n={hostname:"cognito-identity.ap-northeast-1.amazonaws.com",partition:"aws"};break;case"ap-northeast-2":n={hostname:"cognito-identity.ap-northeast-2.amazonaws.com",partition:"aws"};break;case"ap-south-1":n={hostname:"cognito-identity.ap-south-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-1":n={hostname:"cognito-identity.ap-southeast-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-2":n={hostname:"cognito-identity.ap-southeast-2.amazonaws.com",partition:"aws"};break;case"ca-central-1":n={hostname:"cognito-identity.ca-central-1.amazonaws.com",partition:"aws"};break;case"cn-north-1":n={hostname:"cognito-identity.cn-north-1.amazonaws.com.cn",partition:"aws-cn"};break;case"eu-central-1":n={hostname:"cognito-identity.eu-central-1.amazonaws.com",partition:"aws"};break;case"eu-north-1":n={hostname:"cognito-identity.eu-north-1.amazonaws.com",partition:"aws"};break;case"eu-west-1":n={hostname:"cognito-identity.eu-west-1.amazonaws.com",partition:"aws"};break;case"eu-west-2":n={hostname:"cognito-identity.eu-west-2.amazonaws.com",partition:"aws"};break;case"eu-west-3":n={hostname:"cognito-identity.eu-west-3.amazonaws.com",partition:"aws"};break;case"fips-us-east-1":n={hostname:"cognito-identity-fips.us-east-1.amazonaws.com",partition:"aws",signingRegion:"us-east-1"};break;case"fips-us-east-2":n={hostname:"cognito-identity-fips.us-east-2.amazonaws.com",partition:"aws",signingRegion:"us-east-2"};break;case"fips-us-gov-west-1":n={hostname:"cognito-identity-fips.us-gov-west-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-west-1"};break;case"fips-us-west-2":n={hostname:"cognito-identity-fips.us-west-2.amazonaws.com",partition:"aws",signingRegion:"us-west-2"};break;case"sa-east-1":n={hostname:"cognito-identity.sa-east-1.amazonaws.com",partition:"aws"};break;case"us-east-1":n={hostname:"cognito-identity.us-east-1.amazonaws.com",partition:"aws"};break;case"us-east-2":n={hostname:"cognito-identity.us-east-2.amazonaws.com",partition:"aws"};break;case"us-gov-west-1":n={hostname:"cognito-identity.us-gov-west-1.amazonaws.com",partition:"aws-us-gov"};break;case"us-west-1":n={hostname:"cognito-identity.us-west-1.amazonaws.com",partition:"aws"};break;case"us-west-2":n={hostname:"cognito-identity.us-west-2.amazonaws.com",partition:"aws"};break;default:Wu.has(e)&&(n={hostname:"cognito-identity.{region}.amazonaws.com".replace("{region}",e),partition:"aws"}),$u.has(e)&&(n={hostname:"cognito-identity.{region}.amazonaws.com.cn".replace("{region}",e),partition:"aws-cn"}),Ku.has(e)&&(n={hostname:"cognito-identity.{region}.c2s.ic.gov".replace("{region}",e),partition:"aws-iso"}),Vu.has(e)&&(n={hostname:"cognito-identity.{region}.sc2s.sgov.gov".replace("{region}",e),partition:"aws-iso-b"}),Yu.has(e)&&(n={hostname:"cognito-identity.{region}.amazonaws.com".replace("{region}",e),partition:"aws-us-gov"}),void 0===n&&(n={hostname:"cognito-identity.{region}.amazonaws.com".replace("{region}",e),partition:"aws"})}return Promise.resolve(zs({signingService:"cognito-identity"},n))},serviceId:"Cognito Identity",urlParser:ho},Ju=zs(zs({},Zu),{runtime:"browser",base64Decoder:zr,base64Encoder:Br,bodyLengthChecker:to,credentialDefaultProvider:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:oo({serviceId:Zu.serviceId,clientVersion:Hu.version}),maxAttempts:3,region:Dr("Region is missing"),requestHandler:new Ir,sha256:Or.Sha256,streamCollector:Ur,utf8Decoder:io,utf8Encoder:ao}),Xu=function(e){function t(t){var n=this,r=zs(zs({},Ju),t),o=bo(r),i=ri(vo(o)),a=ui(Qr(i));return(n=e.call(this,a)||this).config=a,n.middlewareStack.use(Gr(n.config)),n.middlewareStack.use(So(n.config)),n.middlewareStack.use(xo(n.config)),n.middlewareStack.use(Oo(n.config)),n.middlewareStack.use(di(n.config)),n}return Ns(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(vr);!function(e){e.AUTHENTICATED_ROLE="AuthenticatedRole",e.DENY="Deny"}(Ds||(Ds={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(qs||(qs={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Gs||(Gs={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Hs||(Hs={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Ws||(Ws={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}($s||($s={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Ks||(Ks={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Vs||(Vs={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Ys||(Ys={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Zs||(Zs={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Js||(Js={})),function(e){e.ACCESS_DENIED="AccessDenied",e.INTERNAL_SERVER_ERROR="InternalServerError"}(Xs||(Xs={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Qs||(Qs={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(eu||(eu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(tu||(tu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(nu||(nu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(ru||(ru={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(ou||(ou={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(iu||(iu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(au||(au={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(su||(su={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(uu||(uu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(cu||(cu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(fu||(fu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(lu||(lu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(du||(du={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(hu||(hu={})),function(e){e.CONTAINS="Contains",e.EQUALS="Equals",e.NOT_EQUAL="NotEqual",e.STARTS_WITH="StartsWith"}(pu||(pu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(gu||(gu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(vu||(vu={})),function(e){e.RULES="Rules",e.TOKEN="Token"}(mu||(mu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(yu||(yu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(bu||(bu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(wu||(wu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(_u||(_u={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Su||(Su={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Eu||(Eu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(xu||(xu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Au||(Au={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Ou||(Ou={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(ku||(ku={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Lu||(Lu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Iu||(Iu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Pu||(Pu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Cu||(Cu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Tu||(Tu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(ju||(ju={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Ru||(Ru={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Mu||(Mu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Nu||(Nu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(zu||(zu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Bu||(Bu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Uu||(Uu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Fu||(Fu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Du||(Du={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(qu||(qu={})),function(e){e.filterSensitiveLog=function(e){return zs({},e)}}(Gu||(Gu={}));var Qu=function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h,p,g,v;return Us(this,(function(m){switch(m.label){case 0:return r=[zs({},e)],v={},[4,Lc(e.body,t)];case 1:switch(n=zs.apply(void 0,r.concat([(v.body=m.sent(),v)])),i="UnknownError",i=Ic(e,n.body),i){case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":return[3,2];case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":return[3,4];case"InvalidIdentityPoolConfigurationException":case"com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException":return[3,6];case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":return[3,8];case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":return[3,10];case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":return[3,12];case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":return[3,14];case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":return[3,16]}return[3,18];case 2:return a=[{}],[4,tc(n,t)];case 3:return o=zs.apply(void 0,[zs.apply(void 0,a.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 4:return s=[{}],[4,nc(n,t)];case 5:return o=zs.apply(void 0,[zs.apply(void 0,s.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 6:return u=[{}],[4,rc(n,t)];case 7:return o=zs.apply(void 0,[zs.apply(void 0,u.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 8:return c=[{}],[4,oc(n,t)];case 9:return o=zs.apply(void 0,[zs.apply(void 0,c.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 10:return f=[{}],[4,ac(n,t)];case 11:return o=zs.apply(void 0,[zs.apply(void 0,f.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 12:return l=[{}],[4,sc(n,t)];case 13:return o=zs.apply(void 0,[zs.apply(void 0,l.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 14:return d=[{}],[4,uc(n,t)];case 15:return o=zs.apply(void 0,[zs.apply(void 0,d.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 16:return h=[{}],[4,cc(n,t)];case 17:return o=zs.apply(void 0,[zs.apply(void 0,h.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 18:p=n.body,i=p.code||p.Code||i,o=zs(zs({},p),{name:""+i,message:p.message||p.Message||i,$fault:"client",$metadata:Ac(e)}),m.label=19;case 19:return g=o.message||o.Message||i,o.message=g,delete o.Message,[2,Promise.reject(Object.assign(new Error(g),o))]}}))}))},ec=function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h,p,g,v;return Us(this,(function(m){switch(m.label){case 0:return r=[zs({},e)],v={},[4,Lc(e.body,t)];case 1:switch(n=zs.apply(void 0,r.concat([(v.body=m.sent(),v)])),i="UnknownError",i=Ic(e,n.body),i){case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":return[3,2];case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":return[3,4];case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":return[3,6];case"LimitExceededException":case"com.amazonaws.cognitoidentity#LimitExceededException":return[3,8];case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":return[3,10];case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":return[3,12];case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":return[3,14];case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":return[3,16]}return[3,18];case 2:return a=[{}],[4,tc(n,t)];case 3:return o=zs.apply(void 0,[zs.apply(void 0,a.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 4:return s=[{}],[4,nc(n,t)];case 5:return o=zs.apply(void 0,[zs.apply(void 0,s.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 6:return u=[{}],[4,oc(n,t)];case 7:return o=zs.apply(void 0,[zs.apply(void 0,u.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 8:return c=[{}],[4,ic(n,t)];case 9:return o=zs.apply(void 0,[zs.apply(void 0,c.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 10:return f=[{}],[4,ac(n,t)];case 11:return o=zs.apply(void 0,[zs.apply(void 0,f.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 12:return l=[{}],[4,sc(n,t)];case 13:return o=zs.apply(void 0,[zs.apply(void 0,l.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 14:return d=[{}],[4,uc(n,t)];case 15:return o=zs.apply(void 0,[zs.apply(void 0,d.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 16:return h=[{}],[4,cc(n,t)];case 17:return o=zs.apply(void 0,[zs.apply(void 0,h.concat([m.sent()])),{name:i,$metadata:Ac(e)}]),[3,19];case 18:p=n.body,i=p.code||p.Code||i,o=zs(zs({},p),{name:""+i,message:p.message||p.Message||i,$fault:"client",$metadata:Ac(e)}),m.label=19;case 19:return g=o.message||o.Message||i,o.message=g,delete o.Message,[2,Promise.reject(Object.assign(new Error(g),o))]}}))}))},tc=function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r;return Us(this,(function(o){return n=e.body,r=pc(n,t),[2,zs({name:"ExternalServiceException",$fault:"client",$metadata:Ac(e)},r)]}))}))},nc=function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r;return Us(this,(function(o){return n=e.body,r=mc(n,t),[2,zs({name:"InternalErrorException",$fault:"server",$metadata:Ac(e)},r)]}))}))},rc=function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r;return Us(this,(function(o){return n=e.body,r=yc(n,t),[2,zs({name:"InvalidIdentityPoolConfigurationException",$fault:"client",$metadata:Ac(e)},r)]}))}))},oc=function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r;return Us(this,(function(o){return n=e.body,r=bc(n,t),[2,zs({name:"InvalidParameterException",$fault:"client",$metadata:Ac(e)},r)]}))}))},ic=function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r;return Us(this,(function(o){return n=e.body,r=wc(n,t),[2,zs({name:"LimitExceededException",$fault:"client",$metadata:Ac(e)},r)]}))}))},ac=function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r;return Us(this,(function(o){return n=e.body,r=_c(n,t),[2,zs({name:"NotAuthorizedException",$fault:"client",$metadata:Ac(e)},r)]}))}))},sc=function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r;return Us(this,(function(o){return n=e.body,r=Sc(n,t),[2,zs({name:"ResourceConflictException",$fault:"client",$metadata:Ac(e)},r)]}))}))},uc=function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r;return Us(this,(function(o){return n=e.body,r=Ec(n,t),[2,zs({name:"ResourceNotFoundException",$fault:"client",$metadata:Ac(e)},r)]}))}))},cc=function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r;return Us(this,(function(o){return n=e.body,r=xc(n,t),[2,zs({name:"TooManyRequestsException",$fault:"client",$metadata:Ac(e)},r)]}))}))},fc=function(e,t){return zs(zs(zs({},void 0!==e.CustomRoleArn&&null!==e.CustomRoleArn&&{CustomRoleArn:e.CustomRoleArn}),void 0!==e.IdentityId&&null!==e.IdentityId&&{IdentityId:e.IdentityId}),void 0!==e.Logins&&null!==e.Logins&&{Logins:dc(e.Logins,t)})},lc=function(e,t){return zs(zs(zs({},void 0!==e.AccountId&&null!==e.AccountId&&{AccountId:e.AccountId}),void 0!==e.IdentityPoolId&&null!==e.IdentityPoolId&&{IdentityPoolId:e.IdentityPoolId}),void 0!==e.Logins&&null!==e.Logins&&{Logins:dc(e.Logins,t)})},dc=function(e,t){return Object.entries(e).reduce((function(e,t){var n,r=Fs(t,2),o=r[0],i=r[1];return null===i?e:zs(zs({},e),((n={})[o]=i,n))}),{})},hc=function(e,t){return{AccessKeyId:void 0!==e.AccessKeyId&&null!==e.AccessKeyId?e.AccessKeyId:void 0,Expiration:void 0!==e.Expiration&&null!==e.Expiration?new Date(Math.round(1e3*e.Expiration)):void 0,SecretKey:void 0!==e.SecretKey&&null!==e.SecretKey?e.SecretKey:void 0,SessionToken:void 0!==e.SessionToken&&null!==e.SessionToken?e.SessionToken:void 0}},pc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},gc=function(e,t){return{Credentials:void 0!==e.Credentials&&null!==e.Credentials?hc(e.Credentials):void 0,IdentityId:void 0!==e.IdentityId&&null!==e.IdentityId?e.IdentityId:void 0}},vc=function(e,t){return{IdentityId:void 0!==e.IdentityId&&null!==e.IdentityId?e.IdentityId:void 0}},mc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},yc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},bc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},wc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},_c=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Sc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Ec=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},xc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Ac=function(e){var t;return{httpStatusCode:e.statusCode,requestId:null!==(t=e.headers["x-amzn-requestid"])&&void 0!==t?t:e.headers["x-amzn-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}},Oc=function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)},kc=function(e,t,n,r,o){return Bs(void 0,void 0,void 0,(function(){var i,a,s,u,c,f;return Us(this,(function(l){switch(l.label){case 0:return[4,e.endpoint()];case 1:return i=l.sent(),a=i.hostname,s=i.protocol,u=void 0===s?"https":s,c=i.port,f={protocol:u,hostname:a,port:c,method:"POST",path:n,headers:t},void 0!==r&&(f.hostname=r),void 0!==o&&(f.body=o),[2,new yn(f)]}}))}))},Lc=function(e,t){return function(e,t){return Oc(e,t).then((function(e){return t.utf8Encoder(e)}))}(e,t).then((function(e){return e.length?JSON.parse(e):{}}))},Ic=function(e,t){var n,r,o=function(e){var t=e;return t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},i=(n=e.headers,r="x-amzn-errortype",Object.keys(n).find((function(e){return e.toLowerCase()===r.toLowerCase()})));return void 0!==i?o(e.headers[i]):void 0!==t.code?o(t.code):void 0!==t.__type?o(t.__type):""},Pc=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return Ns(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CognitoIdentityClient",commandName:"GetIdCommand",inputFilterSensitiveLog:lu.filterSensitiveLog,outputFilterSensitiveLog:du.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r;return Us(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.GetId"},r=JSON.stringify(lc(e,t)),[2,kc(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r,o;return Us(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,ec(e,t)]:[4,Lc(e.body,t)];case 1:return n=i.sent(),{},r=vc(n,t),o=zs({$metadata:Ac(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),Cc=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return Ns(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CognitoIdentityClient",commandName:"GetCredentialsForIdentityCommand",inputFilterSensitiveLog:su.filterSensitiveLog,outputFilterSensitiveLog:cu.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r;return Us(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.GetCredentialsForIdentity"},r=JSON.stringify(fc(e,t)),[2,kc(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return Bs(void 0,void 0,void 0,(function(){var n,r,o;return Us(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,Qu(e,t)]:[4,Lc(e.body,t)];case 1:return n=i.sent(),{},r=gc(n,t),o=zs({$metadata:Ac(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),Tc=function(){return(Tc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},jc=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Rc=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Mc=new g("Credentials"),Nc=function(){function e(e){this._gettingCredPromise=null,this._refreshHandlers={},this.Auth=void 0,this.configure(e),this._refreshHandlers.google=Ui.refreshGoogleToken,this._refreshHandlers.facebook=Fi.refreshFacebookToken}return e.prototype.getModuleName=function(){return"Credentials"},e.prototype.getCredSource=function(){return this._credentials_source},e.prototype.configure=function(e){if(!e)return this._config||{};this._config=Object.assign({},this._config,e);var t=this._config.refreshHandlers;return t&&(this._refreshHandlers=Tc(Tc({},this._refreshHandlers),t)),this._storage=this._config.storage,this._storage||(this._storage=(new vi).getStorage()),this._storageSync=Promise.resolve(),"function"==typeof this._storage.sync&&(this._storageSync=this._storage.sync()),this._config},e.prototype.get=function(){return Mc.debug("getting credentials"),this._pickupCredentials()},e.prototype._getCognitoIdentityIdStorageKey=function(e){return"CognitoIdentityId-"+e},e.prototype._pickupCredentials=function(){return Mc.debug("picking up credentials"),this._gettingCredPromise&&this._gettingCredPromise.isPending()?Mc.debug("getting old cred promise"):(Mc.debug("getting new cred promise"),this._gettingCredPromise=Object(U.i)(this._keepAlive())),this._gettingCredPromise},e.prototype._keepAlive=function(){return jc(this,void 0,void 0,(function(){var e,t,n,r,o,i,a;return Rc(this,(function(s){switch(s.label){case 0:if(Mc.debug("checking if credentials exists and not expired"),(e=this._credentials)&&!this._isExpired(e)&&!this._isPastTTL())return Mc.debug("credentials not changed and not expired, directly return"),[2,Promise.resolve(e)];if(Mc.debug("need to get a new credential or refresh the existing one"),t=this.Auth,!(n=void 0===t?b.Auth:t)||"function"!=typeof n.currentUserCredentials)return[2,Promise.reject("No Auth module registered in Amplify")];if(this._isExpired(e)||!this._isPastTTL())return[3,6];Mc.debug("ttl has passed but token is not yet expired"),s.label=1;case 1:return s.trys.push([1,5,,6]),[4,n.currentUserPoolUser()];case 2:return r=s.sent(),[4,n.currentSession()];case 3:return o=s.sent(),i=o.refreshToken,[4,new Promise((function(e,t){r.refreshSession(i,(function(n,r){return n?t(n):e(r)}))}))];case 4:return s.sent(),[3,6];case 5:return a=s.sent(),Mc.debug("Error attempting to refreshing the session",a),[3,6];case 6:return[2,n.currentUserCredentials()]}}))}))},e.prototype.refreshFederatedToken=function(e){Mc.debug("Getting federated credentials");var t=e.provider,n=e.user,r=e.token,o=e.identity_id,i=e.expires_at;i=1970===new Date(i).getFullYear()?1e3*i:i;return Mc.debug("checking if federated jwt token expired"),i>(new Date).getTime()?(Mc.debug("token not expired"),this._setCredentialsFromFederation({provider:t,token:r,user:n,identity_id:o,expires_at:i})):this._refreshHandlers[t]&&"function"==typeof this._refreshHandlers[t]?(Mc.debug("getting refreshed jwt token from federation provider"),this._providerRefreshWithRetry({refreshHandler:this._refreshHandlers[t],provider:t,user:n})):(Mc.debug("no refresh handler for provider:",t),this.clear(),Promise.reject("no refresh handler for provider"))},e.prototype._providerRefreshWithRetry=function(e){var t=this,n=e.refreshHandler,r=e.provider,o=e.user;return Li(n,[],1e4).then((function(e){return Mc.debug("refresh federated token sucessfully",e),t._setCredentialsFromFederation({provider:r,token:e.token,user:o,identity_id:e.identity_id,expires_at:e.expires_at})})).catch((function(e){return"string"==typeof e&&0===e.toLowerCase().lastIndexOf("network error",e.length)||t.clear(),Mc.debug("refresh federated token failed",e),Promise.reject("refreshing federation token failed: "+e)}))},e.prototype._isExpired=function(e){if(!e)return Mc.debug("no credentials for expiration check"),!0;Mc.debug("are these credentials expired?",e);var t=Date.now();return e.expiration.getTime()<=t},e.prototype._isPastTTL=function(){return this._nextCredentialsRefresh<=Date.now()},e.prototype._setCredentialsForGuest=function(){return jc(this,void 0,void 0,(function(){var e,t,n,r,o,i,a,s=this;return Rc(this,(function(u){switch(u.label){case 0:return Mc.debug("setting credentials for guest"),e=this._config,t=e.identityPoolId,n=e.region,e.mandatorySignIn?[2,Promise.reject("cannot get guest credentials when mandatory signin enabled")]:t?n?(o=this,[4,this._getGuestIdentityId()]):(Mc.debug("region is not configured for getting the credentials"),[2,Promise.reject("region is not configured for getting the credentials")]):(Mc.debug("No Cognito Identity pool provided for unauthenticated access"),[2,Promise.reject("No Cognito Identity pool provided for unauthenticated access")]);case 1:return r=o._identityId=u.sent(),i=new Xu({region:n,customUserAgent:_()}),a=void 0,a=r?Ps({identityId:r,client:i})():function(){return jc(s,void 0,void 0,(function(){var e;return Rc(this,(function(n){switch(n.label){case 0:return[4,i.send(new Pc({IdentityPoolId:t}))];case 1:return e=n.sent().IdentityId,this._identityId=e,[2,Ps({client:i,identityId:e})()]}}))}))}().catch((function(e){return jc(s,void 0,void 0,(function(){return Rc(this,(function(t){throw e}))}))})),[2,this._loadCredentials(a,"guest",!1,null).then((function(e){return e})).catch((function(e){return jc(s,void 0,void 0,(function(){var n=this;return Rc(this,(function(o){switch(o.label){case 0:return"ResourceNotFoundException"!==e.name||e.message!=="Identity '"+r+"' not found."?[3,2]:(Mc.debug("Failed to load guest credentials"),[4,this._removeGuestIdentityId()]);case 1:return o.sent(),a=function(){return jc(n,void 0,void 0,(function(){var e;return Rc(this,(function(n){switch(n.label){case 0:return[4,i.send(new Pc({IdentityPoolId:t}))];case 1:return e=n.sent().IdentityId,this._identityId=e,[2,Ps({client:i,identityId:e})()]}}))}))}().catch((function(e){return jc(n,void 0,void 0,(function(){return Rc(this,(function(t){throw e}))}))})),[2,this._loadCredentials(a,"guest",!1,null)];case 2:return[2,e]}}))}))}))]}}))}))},e.prototype._setCredentialsFromFederation=function(e){var t=e.provider,n=e.token,r=e.identity_id,o={google:"accounts.google.com",facebook:"graph.facebook.com",amazon:"www.amazon.com",developer:"cognito-identity.amazonaws.com"}[t]||t;if(!o)return Promise.reject("You must specify a federated provider");var i={};i[o]=n;var a=this._config,s=a.identityPoolId,u=a.region;if(!s)return Mc.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");if(!u)return Mc.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var c=new Xu({region:u,customUserAgent:_()}),f=void 0;r?f=Ps({identityId:r,logins:i,client:c})():f=Rs({logins:i,identityPoolId:s,client:c})();return this._loadCredentials(f,"federated",!0,e)},e.prototype._setCredentialsFromSession=function(e){var t=this;Mc.debug("set credentials from session");var n=e.getIdToken().getJwtToken(),r=this._config,o=r.region,i=r.userPoolId,a=r.identityPoolId;if(!a)return Mc.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");if(!o)return Mc.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var s={};s["cognito-idp."+o+".amazonaws.com/"+i]=n;var u=new Xu({region:o,customUserAgent:_()}),c=jc(t,void 0,void 0,(function(){var e,t,n,r,o,i,c,f,l,d;return Rc(this,(function(h){switch(h.label){case 0:return[4,this._getGuestIdentityId()];case 1:return(e=h.sent())?[3,3]:[4,u.send(new Pc({IdentityPoolId:a,Logins:s}))];case 2:n=h.sent().IdentityId,t=n,h.label=3;case 3:return[4,u.send(new Cc({IdentityId:e||t,Logins:s}))];case 4:return r=h.sent(),o=r.Credentials,i=o.AccessKeyId,c=o.Expiration,f=o.SecretKey,l=o.SessionToken,d=r.IdentityId,this._identityId=d,e?(Mc.debug("The guest identity "+e+" has been successfully linked to the logins"),e===d&&Mc.debug("The guest identity "+e+" has become the primary identity"),[4,this._removeGuestIdentityId()]):[3,6];case 5:h.sent(),h.label=6;case 6:return[2,{accessKeyId:i,secretAccessKey:f,sessionToken:l,expiration:c,identityId:d}]}}))})).catch((function(e){return jc(t,void 0,void 0,(function(){return Rc(this,(function(t){throw e}))}))}));return this._loadCredentials(c,"userPool",!0,null)},e.prototype._loadCredentials=function(e,t,n,r){var o=this,i=this;return new Promise((function(a,s){e.then((function(e){return jc(o,void 0,void 0,(function(){var o,s,u,c,f;return Rc(this,(function(l){switch(l.label){case 0:if(Mc.debug("Load credentials successfully",e),this._identityId&&!e.identityId&&(e.identityId=this._identityId),i._credentials=e,i._credentials.authenticated=n,i._credentials_source=t,i._nextCredentialsRefresh=(new Date).getTime()+3e6,"federated"===t){o=Object.assign({id:this._credentials.identityId},r.user),s=r.provider,u=r.token,c=r.expires_at,f=r.identity_id;try{this._storage.setItem("aws-amplify-federatedInfo",JSON.stringify({provider:s,token:u,user:o,expires_at:c,identity_id:f}))}catch(e){Mc.debug("Failed to put federated info into auth storage",e)}}return"guest"!==t?[3,2]:[4,this._setGuestIdentityId(e.identityId)];case 1:l.sent(),l.label=2;case 2:return a(i._credentials),[2]}}))}))})).catch((function(t){if(t)return Mc.debug("Failed to load credentials",e),Mc.debug("Error loading credentials",t),void s(t)}))}))},e.prototype.set=function(e,t){return"session"===t?this._setCredentialsFromSession(e):"federation"===t?this._setCredentialsFromFederation(e):"guest"===t?this._setCredentialsForGuest():(Mc.debug("no source specified for setting credentials"),Promise.reject("invalid source"))},e.prototype.clear=function(){return jc(this,void 0,void 0,(function(){return Rc(this,(function(e){return this._credentials=null,this._credentials_source=null,Mc.debug("removing aws-amplify-federatedInfo from storage"),this._storage.removeItem("aws-amplify-federatedInfo"),[2]}))}))},e.prototype._getGuestIdentityId=function(){return jc(this,void 0,void 0,(function(){var e,t;return Rc(this,(function(n){switch(n.label){case 0:e=this._config.identityPoolId,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this._storageSync];case 2:return n.sent(),[2,this._storage.getItem(this._getCognitoIdentityIdStorageKey(e))];case 3:return t=n.sent(),Mc.debug("Failed to get the cached guest identityId",t),[3,4];case 4:return[2]}}))}))},e.prototype._setGuestIdentityId=function(e){return jc(this,void 0,void 0,(function(){var t,n;return Rc(this,(function(r){switch(r.label){case 0:t=this._config.identityPoolId,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this._storageSync];case 2:return r.sent(),this._storage.setItem(this._getCognitoIdentityIdStorageKey(t),e),[3,4];case 3:return n=r.sent(),Mc.debug("Failed to cache guest identityId",n),[3,4];case 4:return[2]}}))}))},e.prototype._removeGuestIdentityId=function(){return jc(this,void 0,void 0,(function(){var e;return Rc(this,(function(t){return e=this._config.identityPoolId,Mc.debug("removing "+this._getCognitoIdentityIdStorageKey(e)+" from storage"),this._storage.removeItem(this._getCognitoIdentityIdStorageKey(e)),[2]}))}))},e.prototype.shear=function(e){return{accessKeyId:e.accessKeyId,sessionToken:e.sessionToken,secretAccessKey:e.secretAccessKey,identityId:e.identityId,authenticated:e.authenticated}},e}(),zc=new Nc(null);b.register(zc);var Bc=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Uc=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Fc=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Dc=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Fc(arguments[t]));return e},qc=new g("AWSCloudWatch"),Gc=function(){function e(e){this.configure(e),this._dataTracker={eventUploadInProgress:!1,logEvents:[]},this._currentLogBatch=[],this._initiateLogPushInterval()}return e.prototype.getProviderName=function(){return e.PROVIDER_NAME},e.prototype.getCategoryName=function(){return e.CATEGORY},e.prototype.getLogQueue=function(){return this._dataTracker.logEvents},e.prototype.configure=function(e){if(!e)return this._config||{};var t=Object.assign({},this._config,le(e).Logging,e);return this._config=t,this._config},e.prototype.createLogGroup=function(e){return Bc(this,void 0,void 0,(function(){var t,n;return Uc(this,(function(r){switch(r.label){case 0:qc.debug("creating new log group in CloudWatch - ",e.logGroupName),t=new br(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),qc.error("error creating log group - "+n),n;case 5:return[2]}}))}))},e.prototype.getLogGroups=function(e){return Bc(this,void 0,void 0,(function(){var t,n;return Uc(this,(function(r){switch(r.label){case 0:qc.debug("getting list of log groups"),t=new wr(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),qc.error("error getting log group - "+n),n;case 5:return[2]}}))}))},e.prototype.createLogStream=function(e){return Bc(this,void 0,void 0,(function(){var t,n;return Uc(this,(function(r){switch(r.label){case 0:qc.debug("creating new log stream in CloudWatch - ",e.logStreamName),t=new _r(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),qc.error("error creating log stream - "+n),n;case 5:return[2]}}))}))},e.prototype.getLogStreams=function(e){return Bc(this,void 0,void 0,(function(){var t,n;return Uc(this,(function(r){switch(r.label){case 0:qc.debug("getting list of log streams"),t=new Sr(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),qc.error("error getting log stream - "+n),n;case 5:return[2]}}))}))},e.prototype.getLogEvents=function(e){return Bc(this,void 0,void 0,(function(){var t,n;return Uc(this,(function(r){switch(r.label){case 0:qc.debug("getting log events from stream - ",e.logStreamName),t=new Er(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),qc.error("error getting log events - "+n),n;case 5:return[2]}}))}))},e.prototype.pushLogs=function(e){qc.debug("pushing log events to Cloudwatch..."),this._dataTracker.logEvents=Dc(this._dataTracker.logEvents,e)},e.prototype._validateLogGroupExistsAndCreate=function(e){return Bc(this,void 0,void 0,(function(){var t,n,r,o;return Uc(this,(function(i){switch(i.label){case 0:if(this._dataTracker.verifiedLogGroup)return[2,this._dataTracker.verifiedLogGroup];i.label=1;case 1:return i.trys.push([1,5,,6]),[4,this._ensureCredentials()];case 2:if(!i.sent())throw new Error(c);return[4,this.getLogGroups({logGroupNamePrefix:e})];case 3:return"string"!=typeof(t=i.sent())&&t.logGroups&&(n=t.logGroups.filter((function(t){return t.logGroupName===e}))).length>0?(this._dataTracker.verifiedLogGroup=n[0],[2,n[0]]):[4,this.createLogGroup({logGroupName:e})];case 4:return i.sent(),[2,null];case 5:throw r=i.sent(),o="failure during log group search: "+r,qc.error(o),r;case 6:return[2]}}))}))},e.prototype._validateLogStreamExists=function(e,t){return Bc(this,void 0,void 0,(function(){var n,r,o,i;return Uc(this,(function(a){switch(a.label){case 0:return a.trys.push([0,4,,5]),[4,this._ensureCredentials()];case 1:if(!a.sent())throw new Error(c);return[4,this.getLogStreams({logGroupName:e,logStreamNamePrefix:t})];case 2:return(n=a.sent()).logStreams&&(r=n.logStreams.filter((function(e){return e.logStreamName===t}))).length>0?(this._nextSequenceToken=r[0].uploadSequenceToken,[2,r[0]]):[4,this.createLogStream({logGroupName:e,logStreamName:t})];case 3:return a.sent(),[2,null];case 4:throw o=a.sent(),i="failure during log stream search: "+o,qc.error(i),o;case 5:return[2]}}))}))},e.prototype._sendLogEvents=function(e){return Bc(this,void 0,void 0,(function(){var t,n,r;return Uc(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,this._ensureCredentials()];case 1:if(!o.sent())throw new Error(c);return qc.debug("sending log events to stream - ",e.logStreamName),t=new xr(e),[4,this._initCloudWatchLogs().send(t)];case 2:return[2,o.sent()];case 3:return n=o.sent(),r="failure during log push: "+n,qc.error(r),[3,4];case 4:return[2]}}))}))},e.prototype._initCloudWatchLogs=function(){return new hi({region:this._config.region,credentials:this._config.credentials,customUserAgent:_(),endpoint:this._config.endpoint})},e.prototype._ensureCredentials=function(){return Bc(this,void 0,void 0,(function(){var e=this;return Uc(this,(function(t){switch(t.label){case 0:return[4,zc.get().then((function(t){if(!t)return!1;var n=zc.shear(t);return qc.debug("set credentials for logging",n),e._config.credentials=n,!0})).catch((function(e){return qc.warn("ensure credentials error",e),!1}))];case 1:return[2,t.sent()]}}))}))},e.prototype._getNextSequenceToken=function(){return Bc(this,void 0,void 0,(function(){var e,t;return Uc(this,(function(n){switch(n.label){case 0:if(this._nextSequenceToken&&this._nextSequenceToken.length>0)return[2,this._nextSequenceToken];n.label=1;case 1:return n.trys.push([1,4,,5]),[4,this._validateLogGroupExistsAndCreate(this._config.logGroupName)];case 2:return n.sent(),this._nextSequenceToken=void 0,[4,this._validateLogStreamExists(this._config.logGroupName,this._config.logStreamName)];case 3:return(e=n.sent())&&(this._nextSequenceToken=e.uploadSequenceToken),[2,this._nextSequenceToken];case 4:throw t=n.sent(),qc.error("failure while getting next sequence token: "+t),t;case 5:return[2]}}))}))},e.prototype._safeUploadLogEvents=function(){return Bc(this,void 0,void 0,(function(){var e,t,n,r,o;return Uc(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this._getNextSequenceToken()];case 1:return e=i.sent(),t=0===this._currentLogBatch.length?this._getBufferedBatchOfLogs():this._currentLogBatch,n={logGroupName:this._config.logGroupName,logStreamName:this._config.logStreamName,logEvents:t,sequenceToken:e},this._dataTracker.eventUploadInProgress=!0,[4,this._sendLogEvents(n)];case 2:return r=i.sent(),this._nextSequenceToken=r.nextSequenceToken,this._dataTracker.eventUploadInProgress=!1,this._currentLogBatch=[],[2,r];case 3:if(o=i.sent(),qc.error("error during _safeUploadLogEvents: "+o),!f.includes(o.name))throw this._dataTracker.eventUploadInProgress=!1,o;return this._getNewSequenceTokenAndSubmit({logEvents:this._currentLogBatch,logGroupName:this._config.logGroupName,logStreamName:this._config.logStreamName}),[3,4];case 4:return[2]}}))}))},e.prototype._getBufferedBatchOfLogs=function(){for(var e=0,t=0;e<this._dataTracker.logEvents.length;){var n=this._dataTracker.logEvents[e],r=n?(new TextEncoder).encode(n.message).length+o:0;if(r>a){var s="Log entry exceeds maximum size for CloudWatch logs. Log size: "+r+". Truncating log message.";qc.warn(s),n.message=n.message.substring(0,r)}if(t+r>i)break;t+=r,e++}return this._currentLogBatch=this._dataTracker.logEvents.splice(0,e),this._currentLogBatch},e.prototype._getNewSequenceTokenAndSubmit=function(e){return Bc(this,void 0,void 0,(function(){var t,n,r;return Uc(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),this._nextSequenceToken=void 0,this._dataTracker.eventUploadInProgress=!0,[4,this._getNextSequenceToken()];case 1:return t=o.sent(),e.sequenceToken=t,[4,this._sendLogEvents(e)];case 2:return n=o.sent(),this._dataTracker.eventUploadInProgress=!1,this._currentLogBatch=[],[2,n];case 3:throw r=o.sent(),qc.error("error when retrying log submission with new sequence token: "+r),this._dataTracker.eventUploadInProgress=!1,r;case 4:return[2]}}))}))},e.prototype._initiateLogPushInterval=function(){var e=this;this._timer&&clearInterval(this._timer),this._timer=setInterval((function(){return Bc(e,void 0,void 0,(function(){var e;return Uc(this,(function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),this._getDocUploadPermissibility()?[4,this._safeUploadLogEvents()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[3,4];case 3:return e=t.sent(),qc.error("error when calling _safeUploadLogEvents in the timer interval - "+e),[3,4];case 4:return[2]}}))}))}),2e3)},e.prototype._getDocUploadPermissibility=function(){return(0!==this._dataTracker.logEvents.length||0!==this._currentLogBatch.length)&&!this._dataTracker.eventUploadInProgress},e.PROVIDER_NAME=u,e.CATEGORY=s,e}(),Hc={},Wc={addEventListener:function(e,t){}},$c=Object(U.b)().isBrowser?(new vi).getStorage():void 0;function Kc(e){return(Kc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Vc=function(){function e(){this._logger=new g("ServiceWorker")}return Object.defineProperty(e.prototype,"serviceWorker",{get:function(){return this._serviceWorker},enumerable:!0,configurable:!0}),e.prototype.register=function(e,t){var n=this;return void 0===e&&(e="/service-worker.js"),void 0===t&&(t="/"),this._logger.debug("registering "+e),this._logger.debug("registering service worker with scope "+t),new Promise((function(r,o){if(!navigator||!("serviceWorker"in navigator))return o(new Error("Service Worker not available"));navigator.serviceWorker.register(e,{scope:t}).then((function(e){return e.installing?n._serviceWorker=e.installing:e.waiting?n._serviceWorker=e.waiting:e.active&&(n._serviceWorker=e.active),n._registration=e,n._setupListeners(),n._logger.debug("Service Worker Registration Success: "+e),r(e)})).catch((function(e){return n._logger.debug("Service Worker Registration Failed "+e),o(e)}))}))},e.prototype.enablePush=function(e){var t=this;if(!this._registration)throw new Error("Service Worker not registered");return this._publicKey=e,new Promise((function(n,r){if(!Object(U.b)().isBrowser)return r(new Error("Service Worker not available"));t._registration.pushManager.getSubscription().then((function(r){if(!r)return t._logger.debug("User is NOT subscribed to push"),t._registration.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:t._urlB64ToUint8Array(e)}).then((function(e){t._subscription=e,t._logger.debug("User subscribed: "+JSON.stringify(e)),n(e)})).catch((function(e){t._logger.error(e)}));t._subscription=r,t._logger.debug("User is subscribed to push: "+JSON.stringify(r)),n(r)}))}))},e.prototype._urlB64ToUint8Array=function(e){for(var t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),n=window.atob(t),r=new Uint8Array(n.length),o=0;o<n.length;++o)r[o]=n.charCodeAt(o);return r},e.prototype.send=function(e){this._serviceWorker&&this._serviceWorker.postMessage("object"===Kc(e)?JSON.stringify(e):e)},e.prototype._setupListeners=function(){var e=this;this._serviceWorker.addEventListener("statechange",(function(t){var n=e._serviceWorker.state;e._logger.debug("ServiceWorker statechange: "+n),b.Analytics&&"function"==typeof b.Analytics.record&&b.Analytics.record({name:"ServiceWorker",attributes:{state:n}})})),this._serviceWorker.addEventListener("message",(function(t){e._logger.debug("ServiceWorker message event: "+t)}))},e}(),Yc=n(4);function Zc(e,t){void 0===t&&(t={});var n=function(e){if(e&&"j"===e[0]&&":"===e[1])return e.substr(2);return e}(e);if(function(e,t){return void 0===t&&(t=!e||"{"!==e[0]&&"["!==e[0]&&'"'!==e[0]),!t}(n,t.doNotParse))try{return JSON.parse(n)}catch(e){}return e}var Jc=function(){return(Jc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Xc=function(){function e(e,t){var n=this;this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.cookies=function(e,t){return"string"==typeof e?Yc.parse(e,t):"object"==typeof e&&null!==e?e:{}}(e,t),new Promise((function(){n.HAS_DOCUMENT_COOKIE="object"==typeof document&&"string"==typeof document.cookie})).catch((function(){}))}return e.prototype._updateBrowserValues=function(e){this.HAS_DOCUMENT_COOKIE&&(this.cookies=Yc.parse(document.cookie,e))},e.prototype._emitChange=function(e){for(var t=0;t<this.changeListeners.length;++t)this.changeListeners[t](e)},e.prototype.get=function(e,t,n){return void 0===t&&(t={}),this._updateBrowserValues(n),Zc(this.cookies[e],t)},e.prototype.getAll=function(e,t){void 0===e&&(e={}),this._updateBrowserValues(t);var n={};for(var r in this.cookies)n[r]=Zc(this.cookies[r],e);return n},e.prototype.set=function(e,t,n){var r;"object"==typeof t&&(t=JSON.stringify(t)),this.cookies=Jc(Jc({},this.cookies),((r={})[e]=t,r)),this.HAS_DOCUMENT_COOKIE&&(document.cookie=Yc.serialize(e,t,n)),this._emitChange({name:e,value:t,options:n})},e.prototype.remove=function(e,t){var n=t=Jc(Jc({},t),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=Jc({},this.cookies),delete this.cookies[e],this.HAS_DOCUMENT_COOKIE&&(document.cookie=Yc.serialize(e,"",n)),this._emitChange({name:e,value:void 0,options:t})},e.prototype.addChangeListener=function(e){this.changeListeners.push(e)},e.prototype.removeChangeListener=function(e){var t=this.changeListeners.indexOf(e);t>=0&&this.changeListeners.splice(t,1)},e}(),Qc=Object(U.b)().isBrowser,ef=function(){function e(e){void 0===e&&(e={}),this.cookies=new Xc,this.store=Qc?window.localStorage:Object.create(null),this.cookies=e.req?new Xc(e.req.headers.cookie):new Xc,Object.assign(this.store,this.cookies.getAll())}return Object.defineProperty(e.prototype,"length",{get:function(){return Object.entries(this.store).length},enumerable:!0,configurable:!0}),e.prototype.clear=function(){var e=this;Array.from(new Array(this.length)).map((function(t,n){return e.key(n)})).forEach((function(t){return e.removeItem(t)}))},e.prototype.getItem=function(e){return this.getLocalItem(e)},e.prototype.getLocalItem=function(e){return Object.prototype.hasOwnProperty.call(this.store,e)?this.store[e]:null},e.prototype.getUniversalItem=function(e){return this.cookies.get(e)},e.prototype.key=function(e){return Object.keys(this.store)[e]},e.prototype.removeItem=function(e){this.removeLocalItem(e),this.removeUniversalItem(e)},e.prototype.removeLocalItem=function(e){delete this.store[e]},e.prototype.removeUniversalItem=function(e){this.cookies.remove(e,{path:"/"})},e.prototype.setItem=function(e,t){switch(this.setLocalItem(e,t),e.split(".").pop()){case"LastAuthUser":case"accessToken":case"refreshToken":case"idToken":Qc?this.setUniversalItem(e,t):this.setLocalItem(e,t)}},e.prototype.setLocalItem=function(e,t){this.store[e]=t},e.prototype.setUniversalItem=function(e,t){this.cookies.set(e,t,{path:"/",sameSite:!0,secure:"localhost"!==window.location.hostname})},e}(),tf="undefined"!=typeof Symbol&&"function"==typeof Symbol.for,nf=tf?Symbol.for("INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER"):"@@INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER",rf=tf?Symbol.for("INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER"):"@@INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER",of="x-amz-user-agent",af=function(){function e(){this._queue=[],this._pending=!1}return e.prototype.isLocked=function(){return this._pending},e.prototype.acquire=function(){var e=this,t=new Promise((function(t){return e._queue.push(t)}));return this._pending||this._dispatchNext(),t},e.prototype.runExclusive=function(e){return this.acquire().then((function(t){var n;try{n=e()}catch(e){throw t(),e}return Promise.resolve(n).then((function(e){return t(),e}),(function(e){throw t(),e}))}))},e.prototype._dispatchNext=function(){this._queue.length>0?(this._pending=!0,this._queue.shift()(this._dispatchNext.bind(this))):this._pending=!1},e}(),sf=n(22),uf=n.n(sf).a,cf=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ff=function(){function e(){}return e.prototype.networkMonitor=function(t){if(Object(U.b)().isNode)return uf.from([{online:!0}]);var n=Object(U.h)()?self:window;return new uf((function(t){t.next({online:n.navigator.onLine});var r=function(){return t.next({online:!0})},o=function(){return t.next({online:!1})};return n.addEventListener("online",r),n.addEventListener("offline",o),e._observers.push(t),function(){n.removeEventListener("online",r),n.removeEventListener("offline",o),e._observers=e._observers.filter((function(e){return e!==t}))}}))},e._observerOverride=function(t){var n,r,o=function(n){if(n.closed)return e._observers=e._observers.filter((function(e){return e!==n})),"continue";n.next(t)};try{for(var i=cf(e._observers),a=i.next();!a.done;a=i.next()){o(a.value)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e._observers=[],e}();function lf(e){return e.split("").map((function(e){return e.charCodeAt(0).toString(16).padStart(2,"0")})).join("")}function df(e){return e.match(/.{2}/g).map((function(e){return String.fromCharCode(parseInt(e,16))})).join("")}var hf,pf=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),gf=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},vf=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},mf=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},yf=function(){function e(){this._state=hf.Open,this.jobs=new Set}return e.prototype.add=function(t,n){var r,o;"string"==typeof t?(r=void 0,o=t):(r=t,o=n);var i=this.closedFailure(o);if(i)return i;if(void 0===r)return this.addHook(o);if("function"==typeof r)return this.addFunction(r,o);if(r instanceof e)return this.addManager(r,o);throw new Error("If `job` is provided, it must be an Observable, Function, or BackgroundProcessManager.")},e.prototype.addCleaner=function(e,t){var n=this,r=this.addHook(t),o=r.resolve,i=function(){return gf(n,void 0,void 0,(function(){return vf(this,(function(t){switch(t.label){case 0:return[4,e()];case 1:return t.sent(),o(),[2]}}))}))};return r.onTerminate.then(i),i},e.prototype.addFunction=function(e,t){var n,r=e(new Promise((function(e){n=e})));return"function"==typeof(null==r?void 0:r.then)&&this.registerPromise(r,n,t),r},e.prototype.addManager=function(e,t){var n=this;this.addCleaner((function(){return gf(n,void 0,void 0,(function(){return vf(this,(function(t){switch(t.label){case 0:return[4,e.close()];case 1:return[2,t.sent()]}}))}))}),t)},e.prototype.addHook=function(e){var t,n,r,o=new Promise((function(e,r){t=e,n=r})),i=new Promise((function(e){r=e}));return this.registerPromise(o,r,e),{resolve:t,reject:n,onTerminate:i}},e.prototype.registerPromise=function(e,t,n){var r=this,o={promise:e,terminate:t,description:n};this.jobs.add(o),e.then((function(){r.jobs.delete(o)})).catch((function(){r.jobs.delete(o)}))},Object.defineProperty(e.prototype,"length",{get:function(){return this.jobs.size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pending",{get:function(){return Array.from(this.jobs).map((function(e){return e.description}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._state===hf.Open},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isClosing",{get:function(){return this._state===hf.Closing},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isClosed",{get:function(){return this._state===hf.Closed},enumerable:!0,configurable:!0}),e.prototype.closedFailure=function(e){if(!this.isOpen)return Promise.reject(new bf(["The manager is "+this.state+".",'You tried to add "'+e+'".',"Pending jobs: [\n"+this.pending.map((function(e){return" "+e})).join(",\n")+"\n]"].join("\n")))},e.prototype.close=function(){return gf(this,void 0,void 0,(function(){var e,t,n,r,o;return vf(this,(function(i){switch(i.label){case 0:if(!this.isOpen)return[3,2];this._state=hf.Closing;try{for(e=mf(Array.from(this.jobs)),t=e.next();!t.done;t=e.next()){n=t.value;try{n.terminate()}catch(e){console.warn("Failed to send termination signal to job. Error: "+e.message,n)}}}catch(e){r={error:e}}finally{try{t&&!t.done&&(o=e.return)&&o.call(e)}finally{if(r)throw r.error}}return this._closingPromise=Promise.allSettled(Array.from(this.jobs).map((function(e){return e.promise}))),[4,this._closingPromise];case 1:i.sent(),this._state=hf.Closed,i.label=2;case 2:return[2,this._closingPromise]}}))}))},e.prototype.open=function(){return gf(this,void 0,void 0,(function(){return vf(this,(function(e){switch(e.label){case 0:return this.isClosing?[4,this.close()]:[3,2];case 1:e.sent(),e.label=2;case 2:return this._state=hf.Open,[2]}}))}))},e}(),bf=function(e){function t(t){return e.call(this,"BackgroundManagerNotOpenError: "+t)||this}return pf(t,e),t}(Error);!function(e){e.Open="Open",e.Closing="Closing",e.Closed="Closed"}(hf||(hf={}));var wf={userAgent:w.userAgent};t.default=b},function(e,t,n){"use strict";n.r(t),n.d(t,"fromUtf8",(function(){return r})),n.d(t,"toUtf8",(function(){return o}));var r=function(e){return"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):function(e){for(var t=[],n=0,r=e.length;n<r;n++){var o=e.charCodeAt(n);if(o<128)t.push(o);else if(o<2048)t.push(o>>6|192,63&o|128);else if(n+1<e.length&&55296==(64512&o)&&56320==(64512&e.charCodeAt(n+1))){var i=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n));t.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}else t.push(o>>12|224,o>>6&63|128,63&o|128)}return Uint8Array.from(t)}(e)},o=function(e){return"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):function(e){for(var t="",n=0,r=e.length;n<r;n++){var o=e[n];if(o<128)t+=String.fromCharCode(o);else if(192<=o&&o<224){var i=e[++n];t+=String.fromCharCode((31&o)<<6|63&i)}else if(240<=o&&o<365){var a="%"+[o,e[++n],e[++n],e[++n]].map((function(e){return e.toString(16)})).join("%");t+=decodeURIComponent(a)}else t+=String.fromCharCode((15&o)<<12|(63&e[++n])<<6|63&e[++n])}return t}(e)}},function(e,t,n){"use strict";n.r(t),n.d(t,"fromUtf8",(function(){return r})),n.d(t,"toUtf8",(function(){return o}));const r=e=>"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):(e=>{const t=[];for(let n=0,r=e.length;n<r;n++){const r=e.charCodeAt(n);if(r<128)t.push(r);else if(r<2048)t.push(r>>6|192,63&r|128);else if(n+1<e.length&&55296==(64512&r)&&56320==(64512&e.charCodeAt(n+1))){const o=65536+((1023&r)<<10)+(1023&e.charCodeAt(++n));t.push(o>>18|240,o>>12&63|128,o>>6&63|128,63&o|128)}else t.push(r>>12|224,r>>6&63|128,63&r|128)}return Uint8Array.from(t)})(e),o=e=>"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):(e=>{let t="";for(let n=0,r=e.length;n<r;n++){const r=e[n];if(r<128)t+=String.fromCharCode(r);else if(192<=r&&r<224){const o=e[++n];t+=String.fromCharCode((31&r)<<6|63&o)}else if(240<=r&&r<365){const o="%"+[r,e[++n],e[++n],e[++n]].map(e=>e.toString(16)).join("%");t+=decodeURIComponent(o)}else t+=String.fromCharCode((15&r)<<12|(63&e[++n])<<6|63&e[++n])}return t})(e)}])}));
|
|
32
32
|
//# sourceMappingURL=aws-amplify-core.min.js.map
|