@aws-amplify/api 4.0.62-unstable.4 → 4.0.62
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 +16 -0
- package/build.js +5 -0
- package/dist/aws-amplify-api.js +14768 -0
- package/dist/aws-amplify-api.js.map +1 -0
- package/dist/aws-amplify-api.min.js +11 -0
- package/dist/aws-amplify-api.min.js.map +1 -0
- package/index.js +7 -0
- package/lib/API.js +67 -8
- package/lib/API.js.map +1 -1
- package/lib/index.js +19 -4
- package/lib/index.js.map +1 -1
- package/lib/types/index.js +12 -2
- package/lib/types/index.js.map +1 -1
- package/lib-esm/API.js +60 -4
- package/lib-esm/API.js.map +1 -1
- package/lib-esm/index.d.ts +2 -0
- package/lib-esm/index.js +17 -2
- package/lib-esm/index.js.map +1 -1
- package/lib-esm/types/index.js +12 -2
- package/lib-esm/types/index.js.map +1 -1
- package/package.json +9 -14
- package/src/API.ts +13 -3
- package/src/index.ts +19 -2
- package/src/types/index.ts +12 -2
- package/webpack.config.dev.js +6 -0
- package/lib/.tsbuildinfo +0 -3
- package/lib/API.d.ts +0 -131
- package/lib/index.d.ts +0 -4
- package/lib/types/index.d.ts +0 -13
- package/lib-esm/.tsbuildinfo +0 -3
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("aws_amplify_core"),require("graphql"),require("aws_amplify_auth"),require("aws_amplify_cache")):"function"==typeof define&&define.amd?define("aws_amplify_api",["aws_amplify_core","graphql","aws_amplify_auth","aws_amplify_cache"],t):"object"==typeof exports?exports.aws_amplify_api=t(require("aws_amplify_core"),require("graphql"),require("aws_amplify_auth"),require("aws_amplify_cache")):e.aws_amplify_api=t(e.aws_amplify_core,e.graphql,e.aws_amplify_auth,e.aws_amplify_cache)}(this,(function(e,t,n,r){return 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=56)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){"use strict";var r=n(12),o=Object.prototype.toString;function i(e){return Array.isArray(e)}function s(e){return void 0===e}function a(e){return"[object ArrayBuffer]"===o.call(e)}function c(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function l(e){return"[object Function]"===o.call(e)}function f(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:i,isArrayBuffer:a,isBuffer:function(e){return null!==e&&!s(e)&&null!==e.constructor&&!s(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"[object FormData]"===o.call(e)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&a(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:c,isPlainObject:u,isUndefined:s,isDate:function(e){return"[object Date]"===o.call(e)},isFile:function(e){return"[object File]"===o.call(e)},isBlob:function(e){return"[object Blob]"===o.call(e)},isFunction:l,isStream:function(e){return c(e)&&l(e.pipe)},isURLSearchParams:function(e){return"[object URLSearchParams]"===o.call(e)},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:f,merge:function e(){var t={};function n(n,r){u(t[r])&&u(n)?t[r]=e(t[r],n):u(n)?t[r]=e({},n):i(n)?t[r]=n.slice():t[r]=n}for(var r=0,o=arguments.length;r<o;r++)f(arguments[r],n);return t},extend:function(e,t,n){return f(t,(function(t,o){e[o]=n&&"function"==typeof t?r(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},function(e,t){e.exports=n},function(e,t){e.exports=r},function(e,t,n){"use strict";var r=n(44),o=n(46);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=_,t.resolve=function(e,t){return _(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?_(e,!1,!0).resolveObject(t):t},t.format=function(e){o.isString(e)&&(e=_(e));return e instanceof i?e.format():i.prototype.format.call(e)},t.Url=i;var s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(u),f=["%","/","?",";","#"].concat(l),h=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,y={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=n(47);function _(e,t,n){if(e&&o.isObject(e)&&e instanceof i)return e;var r=new i;return r.parse(e,t,n),r}i.prototype.parse=function(e,t,n){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),a=-1!==i&&i<e.indexOf("#")?"?":"#",u=e.split(a);u[0]=u[0].replace(/\\/g,"/");var _=e=u.join(a);if(_=_.trim(),!n&&1===e.split("#").length){var m=c.exec(_);if(m)return this.path=_,this.href=_,this.pathname=m[1],m[2]?(this.search=m[2],this.query=t?b.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var w=s.exec(_);if(w){var E=(w=w[0]).toLowerCase();this.protocol=E,_=_.substr(w.length)}if(n||w||_.match(/^\/\/[^@\/]+@[^@\/]+/)){var S="//"===_.substr(0,2);!S||w&&g[w]||(_=_.substr(2),this.slashes=!0)}if(!g[w]&&(S||w&&!v[w])){for(var O,A,T=-1,I=0;I<h.length;I++){-1!==(C=_.indexOf(h[I]))&&(-1===T||C<T)&&(T=C)}-1!==(A=-1===T?_.lastIndexOf("@"):_.lastIndexOf("@",T))&&(O=_.slice(0,A),_=_.slice(A+1),this.auth=decodeURIComponent(O)),T=-1;for(I=0;I<f.length;I++){var C;-1!==(C=_.indexOf(f[I]))&&(-1===T||C<T)&&(T=C)}-1===T&&(T=_.length),this.host=_.slice(0,T),_=_.slice(T),this.parseHost(),this.hostname=this.hostname||"";var N="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!N)for(var k=this.hostname.split(/\./),R=(I=0,k.length);I<R;I++){var P=k[I];if(P&&!P.match(p)){for(var M="",x=0,L=P.length;x<L;x++)P.charCodeAt(x)>127?M+="x":M+=P[x];if(!M.match(p)){var U=k.slice(0,I),j=k.slice(I+1),D=P.match(d);D&&(U.push(D[1]),j.unshift(D[2])),j.length&&(_="/"+j.join(".")+_),this.hostname=U.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),N||(this.hostname=r.toASCII(this.hostname));var q=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+q,this.href+=this.host,N&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==_[0]&&(_="/"+_))}if(!y[E])for(I=0,R=l.length;I<R;I++){var F=l[I];if(-1!==_.indexOf(F)){var G=encodeURIComponent(F);G===F&&(G=escape(F)),_=_.split(F).join(G)}}var V=_.indexOf("#");-1!==V&&(this.hash=_.substr(V),_=_.slice(0,V));var Y=_.indexOf("?");if(-1!==Y?(this.search=_.substr(Y),this.query=_.substr(Y+1),t&&(this.query=b.parse(this.query)),_=_.slice(0,Y)):t&&(this.search="",this.query={}),_&&(this.pathname=_),v[E]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){q=this.pathname||"";var Q=this.search||"";this.path=q+Q}return this.href=this.format(),this},i.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",i=!1,s="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&o.isObject(this.query)&&Object.keys(this.query).length&&(s=b.stringify(this.query));var a=this.search||s&&"?"+s||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||v[t])&&!1!==i?(i="//"+(i||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):i||(i=""),r&&"#"!==r.charAt(0)&&(r="#"+r),a&&"?"!==a.charAt(0)&&(a="?"+a),t+i+(n=n.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(a=a.replace("#","%23"))+r},i.prototype.resolve=function(e){return this.resolveObject(_(e,!1,!0)).format()},i.prototype.resolveObject=function(e){if(o.isString(e)){var t=new i;t.parse(e,!1,!0),e=t}for(var n=new i,r=Object.keys(this),s=0;s<r.length;s++){var a=r[s];n[a]=this[a]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var c=Object.keys(e),u=0;u<c.length;u++){var l=c[u];"protocol"!==l&&(n[l]=e[l])}return v[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!v[e.protocol]){for(var f=Object.keys(e),h=0;h<f.length;h++){var p=f[h];n[p]=e[p]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||g[e.protocol])n.pathname=e.pathname;else{for(var d=(e.pathname||"").split("/");d.length&&!(e.host=d.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),n.pathname=d.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var y=n.pathname||"",b=n.search||"";n.path=y+b}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var _=n.pathname&&"/"===n.pathname.charAt(0),m=e.host||e.pathname&&"/"===e.pathname.charAt(0),w=m||_||n.host&&e.pathname,E=w,S=n.pathname&&n.pathname.split("/")||[],O=(d=e.pathname&&e.pathname.split("/")||[],n.protocol&&!v[n.protocol]);if(O&&(n.hostname="",n.port=null,n.host&&(""===S[0]?S[0]=n.host:S.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===d[0]?d[0]=e.host:d.unshift(e.host)),e.host=null),w=w&&(""===d[0]||""===S[0])),m)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,S=d;else if(d.length)S||(S=[]),S.pop(),S=S.concat(d),n.search=e.search,n.query=e.query;else if(!o.isNullOrUndefined(e.search)){if(O)n.hostname=n.host=S.shift(),(N=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=N.shift(),n.host=n.hostname=N.shift());return n.search=e.search,n.query=e.query,o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!S.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var A=S.slice(-1)[0],T=(n.host||e.host||S.length>1)&&("."===A||".."===A)||""===A,I=0,C=S.length;C>=0;C--)"."===(A=S[C])?S.splice(C,1):".."===A?(S.splice(C,1),I++):I&&(S.splice(C,1),I--);if(!w&&!E)for(;I--;I)S.unshift("..");!w||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),T&&"/"!==S.join("/").substr(-1)&&S.push("");var N,k=""===S[0]||S[0]&&"/"===S[0].charAt(0);O&&(n.hostname=n.host=k?"":S.length?S.shift():"",(N=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=N.shift(),n.host=n.hostname=N.shift()));return(w=w||n.host&&S.length)&&!k&&S.unshift(""),S.length?n.pathname=S.join("/"):(n.pathname=null,n.path=null),o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=a.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){e.exports=n(26)},function(e,t,n){"use strict";(function(t){var r=n(2),o=n(32),i=n(14),s={"Content-Type":"application/x-www-form-urlencoded"};function a(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,u={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(c=n(15)),c),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(a(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)||t&&"application/json"===t["Content-Type"]?(a(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(t||JSON.parse)(e),r.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||u.transitional,n=t&&t.silentJSONParsing,o=t&&t.forcedJSONParsing,s=!n&&"json"===this.responseType;if(s||o&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(s){if("SyntaxError"===e.name)throw i(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){u.headers[e]=r.merge(s)})),e.exports=u}).call(this,n(31))},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t,n){var r=n(51),o=n(52),i=o;i.v1=r,i.v4=o,e.exports=i},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";(function(e){
|
|
2
|
+
/*!
|
|
3
|
+
* The buffer module from node.js, for the browser.
|
|
4
|
+
*
|
|
5
|
+
* @author Feross Aboukhadijeh <http://feross.org>
|
|
6
|
+
* @license MIT
|
|
7
|
+
*/
|
|
8
|
+
var r=n(53),o=n(54),i=n(55);function s(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=c.prototype:(null===e&&(e=new c(t)),e.length=t),e}function c(e,t,n){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(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 f(this,e)}return u(this,e,t,n)}function u(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);c.TYPED_ARRAY_SUPPORT?(e=t).__proto__=c.prototype:e=h(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!c.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(t,n),o=(e=a(e,r)).write(t,n);o!==r&&(e=e.slice(0,o));return e}(e,t,n):function(e,t){if(c.isBuffer(t)){var n=0|p(t.length);return 0===(e=a(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?a(e,0):h(e,t);if("Buffer"===t.type&&i(t.data))return h(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(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 f(e,t){if(l(t),e=a(e,t<0?0:0|p(t)),!c.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function h(e,t){var n=t.length<0?0:0|p(t.length);e=a(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function p(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function d(e,t){if(c.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 B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return F(e).length;default:if(r)return B(e).length;t=(""+t).toLowerCase(),r=!0}}function y(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 N(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return I(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function v(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=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,o);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,o){var i,s=1,a=e.length,c=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;s=2,a/=2,c/=2,n/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(o){var l=-1;for(i=n;i<a;i++)if(u(e,i)===u(t,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===c)return l*s}else-1!==l&&(i-=i-l),l=-1}else for(n+c>a&&(n=a-c),i=n;i>=0;i--){for(var f=!0,h=0;h<c;h++)if(u(e,i+h)!==u(t,h)){f=!1;break}if(f)return i}return-1}function _(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 s=0;s<r;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[n+s]=a}return s}function m(e,t,n,r){return G(B(t,e.length-n),e,n,r)}function w(e,t,n,r){return G(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function E(e,t,n,r){return w(e,t,n,r)}function S(e,t,n,r){return G(F(t),e,n,r)}function O(e,t,n,r){return G(function(e,t){for(var n,r,o,i=[],s=0;s<e.length&&!((t-=2)<0);++s)n=e.charCodeAt(s),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 T(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i,s,a,c,u=e[o],l=null,f=u>239?4:u>223?3:u>191?2:1;if(o+f<=n)switch(f){case 1:u<128&&(l=u);break;case 2:128==(192&(i=e[o+1]))&&(c=(31&u)<<6|63&i)>127&&(l=c);break;case 3:i=e[o+1],s=e[o+2],128==(192&i)&&128==(192&s)&&(c=(15&u)<<12|(63&i)<<6|63&s)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:i=e[o+1],s=e[o+2],a=e[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(c=(15&u)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(l=c)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),o+=f}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=c,t.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},t.INSPECT_MAX_BYTES=50,c.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=s(),c.poolSize=8192,c._augment=function(e){return e.__proto__=c.prototype,e},c.from=function(e,t,n){return u(null,e,t,n)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(e,t,n){return function(e,t,n,r){return l(t),t<=0?a(e,t):void 0!==n?"string"==typeof r?a(e,t).fill(n,r):a(e,t).fill(n):a(e,t)}(null,e,t,n)},c.allocUnsafe=function(e){return f(null,e)},c.allocUnsafeSlow=function(e){return f(null,e)},c.isBuffer=function(e){return!(null==e||!e._isBuffer)},c.compare=function(e,t){if(!c.isBuffer(e)||!c.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},c.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}},c.concat=function(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=c.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var s=e[n];if(!c.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,o),o+=s.length}return r},c.byteLength=d,c.prototype._isBuffer=!0,c.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)g(this,t,t+1);return this},c.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)g(this,t,t+3),g(this,t+1,t+2);return this},c.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)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},c.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?T(this,0,e):y.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.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+">"},c.prototype.compare=function(e,t,n,r,o){if(!c.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),s=(n>>>=0)-(t>>>=0),a=Math.min(i,s),u=this.slice(r,o),l=e.slice(t,n),f=0;f<a;++f)if(u[f]!==l[f]){i=u[f],s=l[f];break}return i<s?-1:s<i?1:0},c.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},c.prototype.indexOf=function(e,t,n){return v(this,e,t,n,!0)},c.prototype.lastIndexOf=function(e,t,n){return v(this,e,t,n,!1)},c.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 _(this,e,t,n);case"utf8":case"utf-8":return m(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return E(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function I(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 C(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 N(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+=q(e[i]);return o}function k(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 R(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 P(e,t,n,r,o,i){if(!c.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 M(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 x(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 L(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 U(e,t,n,r,i){return i||L(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function j(e,t,n,r,i){return i||L(e,0,n,8),o.write(e,t,n,r,52,8),n+8}c.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),c.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=c.prototype;else{var o=t-e;n=new c(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+e]}return n},c.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},c.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},c.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||R(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},c.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||R(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},c.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||P(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},c.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||P(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},c.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):x(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):x(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);P(this,e,t,n,o-1,-o)}var i=0,s=1,a=0;for(this[t]=255&e;++i<n&&(s*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/s>>0)-a&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);P(this,e,t,n,o-1,-o)}var i=n-1,s=1,a=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/s>>0)-a&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):x(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):x(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,n){return U(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return U(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return j(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return j(this,e,t,!1,n)},c.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||!c.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},c.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&&!c.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 s=c.isBuffer(e)?e:B(new c(e,r).toString()),a=s.length;for(i=0;i<n-t;++i)this[i+t]=s[i%a]}return this};var D=/[^+\/0-9A-Za-z-_]/g;function q(e){return e<16?"0"+e.toString(16):e.toString(16)}function B(e,t){var n;t=t||1/0;for(var r=e.length,o=null,i=[],s=0;s<r;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+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 F(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(D,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(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(10))},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},function(e,t,n){"use strict";var r=n(2);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(r.isURLSearchParams(t))i=t.toString();else{var s=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),s.push(o(t)+"="+o(e))})))})),i=s.join("&")}if(i){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},function(e,t,n){"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}},function(e,t,n){"use strict";var r=n(2),o=n(33),i=n(34),s=n(13),a=n(35),c=n(38),u=n(39),l=n(16),f=n(7),h=n(8);e.exports=function(e){return new Promise((function(t,n){var p,d=e.data,y=e.headers,g=e.responseType;function v(){e.cancelToken&&e.cancelToken.unsubscribe(p),e.signal&&e.signal.removeEventListener("abort",p)}r.isFormData(d)&&delete y["Content-Type"];var b=new XMLHttpRequest;if(e.auth){var _=e.auth.username||"",m=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";y.Authorization="Basic "+btoa(_+":"+m)}var w=a(e.baseURL,e.url);function E(){if(b){var r="getAllResponseHeaders"in b?c(b.getAllResponseHeaders()):null,i={data:g&&"text"!==g&&"json"!==g?b.response:b.responseText,status:b.status,statusText:b.statusText,headers:r,config:e,request:b};o((function(e){t(e),v()}),(function(e){n(e),v()}),i),b=null}}if(b.open(e.method.toUpperCase(),s(w,e.params,e.paramsSerializer),!0),b.timeout=e.timeout,"onloadend"in b?b.onloadend=E:b.onreadystatechange=function(){b&&4===b.readyState&&(0!==b.status||b.responseURL&&0===b.responseURL.indexOf("file:"))&&setTimeout(E)},b.onabort=function(){b&&(n(l("Request aborted",e,"ECONNABORTED",b)),b=null)},b.onerror=function(){n(l("Network Error",e,null,b)),b=null},b.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||f.transitional;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(l(t,e,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",b)),b=null},r.isStandardBrowserEnv()){var S=(e.withCredentials||u(w))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;S&&(y[e.xsrfHeaderName]=S)}"setRequestHeader"in b&&r.forEach(y,(function(e,t){void 0===d&&"content-type"===t.toLowerCase()?delete y[t]:b.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(b.withCredentials=!!e.withCredentials),g&&"json"!==g&&(b.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&b.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&b.upload&&b.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(p=function(e){b&&(n(!e||e&&e.type?new h("canceled"):e),b.abort(),b=null)},e.cancelToken&&e.cancelToken.subscribe(p),e.signal&&(e.signal.aborted?p():e.signal.addEventListener("abort",p))),d||(d=null),b.send(d)}))}},function(e,t,n){"use strict";var r=n(14);e.exports=function(e,t,n,o,i){var s=new Error(e);return r(s,t,n,o,i)}},function(e,t,n){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t){t=t||{};var n={};function o(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function i(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:o(void 0,e[n]):o(e[n],t[n])}function s(e){if(!r.isUndefined(t[e]))return o(void 0,t[e])}function a(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:o(void 0,e[n]):o(void 0,t[n])}function c(n){return n in t?o(e[n],t[n]):n in e?o(void 0,e[n]):void 0}var u={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c};return r.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=u[e]||i,o=t(e);r.isUndefined(o)&&t!==c||(n[e]=o)})),n}},function(e,t){e.exports={version:"0.26.0"}},function(e,t){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);e.exports=function(){return n(r),r}}else{var o=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),o[t]=e>>>((3&t)<<3)&255;return o}}},function(e,t){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);e.exports=function(e,t){var r=t||0,o=n;return[o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]]].join("")}},function(e,t,n){e.exports=n(50).Observable},function(e,t,n){(function(t){var n;n=function(){return function(e){var t,n=e.localStorage||(t={},{setItem:function(e,n){t[e]=n},getItem:function(e){return t[e]},removeItem:function(e){delete t[e]}}),r=1,o=2,i=3,s=4,a=5,c=6,u=7,l=8,f=9,h=10,p=11,d=12,y=13,g=14,v=function(e,t){for(var n in e)if(e.hasOwnProperty(n)){if(!t.hasOwnProperty(n)){var r="Unknown property, "+n+". Valid properties are:";for(var o in t)t.hasOwnProperty(o)&&(r=r+" "+o);throw new Error(r)}if(typeof e[n]!==t[n])throw new Error(w(_.INVALID_TYPE,[typeof e[n],n]))}},b=function(e,t){return function(){return e.apply(t,arguments)}},_={OK:{code:0,text:"AMQJSC0000I OK."},CONNECT_TIMEOUT:{code:1,text:"AMQJSC0001E Connect timed out."},SUBSCRIBE_TIMEOUT:{code:2,text:"AMQJS0002E Subscribe timed out."},UNSUBSCRIBE_TIMEOUT:{code:3,text:"AMQJS0003E Unsubscribe timed out."},PING_TIMEOUT:{code:4,text:"AMQJS0004E Ping timed out."},INTERNAL_ERROR:{code:5,text:"AMQJS0005E Internal error. Error Message: {0}, Stack trace: {1}"},CONNACK_RETURNCODE:{code:6,text:"AMQJS0006E Bad Connack return code:{0} {1}."},SOCKET_ERROR:{code:7,text:"AMQJS0007E Socket error:{0}."},SOCKET_CLOSE:{code:8,text:"AMQJS0008I Socket closed."},MALFORMED_UTF:{code:9,text:"AMQJS0009E Malformed UTF data:{0} {1} {2}."},UNSUPPORTED:{code:10,text:"AMQJS0010E {0} is not supported by this browser."},INVALID_STATE:{code:11,text:"AMQJS0011E Invalid state {0}."},INVALID_TYPE:{code:12,text:"AMQJS0012E Invalid type {0} for {1}."},INVALID_ARGUMENT:{code:13,text:"AMQJS0013E Invalid argument {0} for {1}."},UNSUPPORTED_OPERATION:{code:14,text:"AMQJS0014E Unsupported operation."},INVALID_STORED_DATA:{code:15,text:"AMQJS0015E Invalid data in local storage key={0} value={1}."},INVALID_MQTT_MESSAGE_TYPE:{code:16,text:"AMQJS0016E Invalid MQTT message type {0}."},MALFORMED_UNICODE:{code:17,text:"AMQJS0017E Malformed Unicode string:{0} {1}."},BUFFER_FULL:{code:18,text:"AMQJS0018E Message buffer is full, maximum buffer size: {0}."}},m={0:"Connection Accepted",1:"Connection Refused: unacceptable protocol version",2:"Connection Refused: identifier rejected",3:"Connection Refused: server unavailable",4:"Connection Refused: bad user name or password",5:"Connection Refused: not authorized"},w=function(e,t){var n=e.text;if(t)for(var r,o,i=0;i<t.length;i++)if(r="{"+i+"}",(o=n.indexOf(r))>0){var s=n.substring(0,o),a=n.substring(o+r.length);n=s+t[i]+a}return n},E=[0,6,77,81,73,115,100,112,3],S=[0,4,77,81,84,84,4],O=function(e,t){for(var n in this.type=e,t)t.hasOwnProperty(n)&&(this[n]=t[n])};function A(e,t){var n,r=t,l=e[t],h=l>>4,d=l&=15;t+=1;var y=0,g=1;do{if(t==e.length)return[null,r];y+=(127&(n=e[t++]))*g,g*=128}while(0!=(128&n));var v=t+y;if(v>e.length)return[null,r];var b=new O(h);switch(h){case o:1&e[t++]&&(b.sessionPresent=!0),b.returnCode=e[t++];break;case i:var _=d>>1&3,m=C(e,t),w=R(e,t+=2,m);t+=m,_>0&&(b.messageIdentifier=C(e,t),t+=2);var E=new L(e.subarray(t,v));1==(1&d)&&(E.retained=!0),8==(8&d)&&(E.duplicate=!0),E.qos=_,E.destinationName=w,b.payloadMessage=E;break;case s:case a:case c:case u:case p:b.messageIdentifier=C(e,t);break;case f:b.messageIdentifier=C(e,t),t+=2,b.returnCode=e.subarray(t,v)}return[b,v]}function T(e,t,n){return t[n++]=e>>8,t[n++]=e%256,n}function I(e,t,n,r){return k(e,n,r=T(t,n,r)),r+t}function C(e,t){return 256*e[t]+e[t+1]}function N(e){for(var t=0,n=0;n<e.length;n++){var r=e.charCodeAt(n);r>2047?(55296<=r&&r<=56319&&(n++,t++),t+=3):r>127?t+=2:t++}return t}function k(e,t,n){for(var r=n,o=0;o<e.length;o++){var i=e.charCodeAt(o);if(55296<=i&&i<=56319){var s=e.charCodeAt(++o);if(isNaN(s))throw new Error(w(_.MALFORMED_UNICODE,[i,s]));i=s-56320+(i-55296<<10)+65536}i<=127?t[r++]=i:i<=2047?(t[r++]=i>>6&31|192,t[r++]=63&i|128):i<=65535?(t[r++]=i>>12&15|224,t[r++]=i>>6&63|128,t[r++]=63&i|128):(t[r++]=i>>18&7|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=63&i|128)}return t}function R(e,t,n){for(var r,o="",i=t;i<t+n;){var s=e[i++];if(s<128)r=s;else{var a=e[i++]-128;if(a<0)throw new Error(w(_.MALFORMED_UTF,[s.toString(16),a.toString(16),""]));if(s<224)r=64*(s-192)+a;else{var c=e[i++]-128;if(c<0)throw new Error(w(_.MALFORMED_UTF,[s.toString(16),a.toString(16),c.toString(16)]));if(s<240)r=4096*(s-224)+64*a+c;else{var u=e[i++]-128;if(u<0)throw new Error(w(_.MALFORMED_UTF,[s.toString(16),a.toString(16),c.toString(16),u.toString(16)]));if(!(s<248))throw new Error(w(_.MALFORMED_UTF,[s.toString(16),a.toString(16),c.toString(16),u.toString(16)]));r=262144*(s-240)+4096*a+64*c+u}}}r>65535&&(r-=65536,o+=String.fromCharCode(55296+(r>>10)),r=56320+(1023&r)),o+=String.fromCharCode(r)}return o}O.prototype.encode=function(){var e,t=(15&this.type)<<4,n=0,o=[],s=0;switch(void 0!==this.messageIdentifier&&(n+=2),this.type){case r:switch(this.mqttVersion){case 3:n+=E.length+3;break;case 4:n+=S.length+3}n+=N(this.clientId)+2,void 0!==this.willMessage&&(n+=N(this.willMessage.destinationName)+2,(e=this.willMessage.payloadBytes)instanceof Uint8Array||(e=new Uint8Array(u)),n+=e.byteLength+2),void 0!==this.userName&&(n+=N(this.userName)+2),void 0!==this.password&&(n+=N(this.password)+2);break;case l:t|=2;for(var a=0;a<this.topics.length;a++)o[a]=N(this.topics[a]),n+=o[a]+2;n+=this.requestedQos.length;break;case h:for(t|=2,a=0;a<this.topics.length;a++)o[a]=N(this.topics[a]),n+=o[a]+2;break;case c:t|=2;break;case i:this.payloadMessage.duplicate&&(t|=8),t=t|=this.payloadMessage.qos<<1,this.payloadMessage.retained&&(t|=1),n+=(s=N(this.payloadMessage.destinationName))+2;var u=this.payloadMessage.payloadBytes;n+=u.byteLength,u instanceof ArrayBuffer?u=new Uint8Array(u):u instanceof Uint8Array||(u=new Uint8Array(u.buffer))}var f=function(e){var t=new Array(1),n=0;do{var r=e%128;(e>>=7)>0&&(r|=128),t[n++]=r}while(e>0&&n<4);return t}(n),p=f.length+1,d=new ArrayBuffer(n+p),y=new Uint8Array(d);if(y[0]=t,y.set(f,1),this.type==i)p=I(this.payloadMessage.destinationName,s,y,p);else if(this.type==r){switch(this.mqttVersion){case 3:y.set(E,p),p+=E.length;break;case 4:y.set(S,p),p+=S.length}var g=0;this.cleanSession&&(g=2),void 0!==this.willMessage&&(g|=4,g|=this.willMessage.qos<<3,this.willMessage.retained&&(g|=32)),void 0!==this.userName&&(g|=128),void 0!==this.password&&(g|=64),y[p++]=g,p=T(this.keepAliveInterval,y,p)}switch(void 0!==this.messageIdentifier&&(p=T(this.messageIdentifier,y,p)),this.type){case r:p=I(this.clientId,N(this.clientId),y,p),void 0!==this.willMessage&&(p=I(this.willMessage.destinationName,N(this.willMessage.destinationName),y,p),p=T(e.byteLength,y,p),y.set(e,p),p+=e.byteLength),void 0!==this.userName&&(p=I(this.userName,N(this.userName),y,p)),void 0!==this.password&&(p=I(this.password,N(this.password),y,p));break;case i:y.set(u,p);break;case l:for(a=0;a<this.topics.length;a++)p=I(this.topics[a],o[a],y,p),y[p++]=this.requestedQos[a];break;case h:for(a=0;a<this.topics.length;a++)p=I(this.topics[a],o[a],y,p)}return d};var P=function(e,t){this._client=e,this._keepAliveInterval=1e3*t,this.isReset=!1;var n=new O(d).encode(),r=function(e){return function(){return o.apply(e)}},o=function(){this.isReset?(this.isReset=!1,this._client._trace("Pinger.doPing","send PINGREQ"),this._client.socket.send(n),this.timeout=setTimeout(r(this),this._keepAliveInterval)):(this._client._trace("Pinger.doPing","Timed out"),this._client._disconnected(_.PING_TIMEOUT.code,w(_.PING_TIMEOUT)))};this.reset=function(){this.isReset=!0,clearTimeout(this.timeout),this._keepAliveInterval>0&&(this.timeout=setTimeout(r(this),this._keepAliveInterval))},this.cancel=function(){clearTimeout(this.timeout)}},M=function(e,t,n,r){t||(t=30),this.timeout=setTimeout(function(e,t,n){return function(){return e.apply(t,n)}}(n,e,r),1e3*t),this.cancel=function(){clearTimeout(this.timeout)}},x=function(t,r,o,i,s){if(!("WebSocket"in e)||null===e.WebSocket)throw new Error(w(_.UNSUPPORTED,["WebSocket"]));if(!("ArrayBuffer"in e)||null===e.ArrayBuffer)throw new Error(w(_.UNSUPPORTED,["ArrayBuffer"]));for(var a in this._trace("Paho.Client",t,r,o,i,s),this.host=r,this.port=o,this.path=i,this.uri=t,this.clientId=s,this._wsuri=null,this._localKey=r+":"+o+("/mqtt"!=i?":"+i:"")+":"+s+":",this._msg_queue=[],this._buffered_msg_queue=[],this._sentMessages={},this._receivedMessages={},this._notify_msg_sent={},this._message_identifier=1,this._sequence=0,n)0!==a.indexOf("Sent:"+this._localKey)&&0!==a.indexOf("Received:"+this._localKey)||this.restore(a)};x.prototype.host=null,x.prototype.port=null,x.prototype.path=null,x.prototype.uri=null,x.prototype.clientId=null,x.prototype.socket=null,x.prototype.connected=!1,x.prototype.maxMessageIdentifier=65536,x.prototype.connectOptions=null,x.prototype.hostIndex=null,x.prototype.onConnected=null,x.prototype.onConnectionLost=null,x.prototype.onMessageDelivered=null,x.prototype.onMessageArrived=null,x.prototype.traceFunction=null,x.prototype._msg_queue=null,x.prototype._buffered_msg_queue=null,x.prototype._connectTimeout=null,x.prototype.sendPinger=null,x.prototype.receivePinger=null,x.prototype._reconnectInterval=1,x.prototype._reconnecting=!1,x.prototype._reconnectTimeout=null,x.prototype.disconnectedPublishing=!1,x.prototype.disconnectedBufferSize=5e3,x.prototype.receiveBuffer=null,x.prototype._traceBuffer=null,x.prototype._MAX_TRACE_ENTRIES=100,x.prototype.connect=function(e){var t=this._traceMask(e,"password");if(this._trace("Client.connect",t,this.socket,this.connected),this.connected)throw new Error(w(_.INVALID_STATE,["already connected"]));if(this.socket)throw new Error(w(_.INVALID_STATE,["already connected"]));this._reconnecting&&(this._reconnectTimeout.cancel(),this._reconnectTimeout=null,this._reconnecting=!1),this.connectOptions=e,this._reconnectInterval=1,this._reconnecting=!1,e.uris?(this.hostIndex=0,this._doConnect(e.uris[0])):this._doConnect(this.uri)},x.prototype.subscribe=function(e,t){if(this._trace("Client.subscribe",e,t),!this.connected)throw new Error(w(_.INVALID_STATE,["not connected"]));var n=new O(l);n.topics=e.constructor===Array?e:[e],void 0===t.qos&&(t.qos=0),n.requestedQos=[];for(var r=0;r<n.topics.length;r++)n.requestedQos[r]=t.qos;t.onSuccess&&(n.onSuccess=function(e){t.onSuccess({invocationContext:t.invocationContext,grantedQos:e})}),t.onFailure&&(n.onFailure=function(e){t.onFailure({invocationContext:t.invocationContext,errorCode:e,errorMessage:w(e)})}),t.timeout&&(n.timeOut=new M(this,t.timeout,t.onFailure,[{invocationContext:t.invocationContext,errorCode:_.SUBSCRIBE_TIMEOUT.code,errorMessage:w(_.SUBSCRIBE_TIMEOUT)}])),this._requires_ack(n),this._schedule_message(n)},x.prototype.unsubscribe=function(e,t){if(this._trace("Client.unsubscribe",e,t),!this.connected)throw new Error(w(_.INVALID_STATE,["not connected"]));var n=new O(h);n.topics=e.constructor===Array?e:[e],t.onSuccess&&(n.callback=function(){t.onSuccess({invocationContext:t.invocationContext})}),t.timeout&&(n.timeOut=new M(this,t.timeout,t.onFailure,[{invocationContext:t.invocationContext,errorCode:_.UNSUBSCRIBE_TIMEOUT.code,errorMessage:w(_.UNSUBSCRIBE_TIMEOUT)}])),this._requires_ack(n),this._schedule_message(n)},x.prototype.send=function(e){this._trace("Client.send",e);var t=new O(i);if(t.payloadMessage=e,this.connected)e.qos>0?this._requires_ack(t):this.onMessageDelivered&&(this._notify_msg_sent[t]=this.onMessageDelivered(t.payloadMessage)),this._schedule_message(t);else{if(!this._reconnecting||!this.disconnectedPublishing)throw new Error(w(_.INVALID_STATE,["not connected"]));if(Object.keys(this._sentMessages).length+this._buffered_msg_queue.length>this.disconnectedBufferSize)throw new Error(w(_.BUFFER_FULL,[this.disconnectedBufferSize]));e.qos>0?this._requires_ack(t):(t.sequence=++this._sequence,this._buffered_msg_queue.unshift(t))}},x.prototype.disconnect=function(){if(this._trace("Client.disconnect"),this._reconnecting&&(this._reconnectTimeout.cancel(),this._reconnectTimeout=null,this._reconnecting=!1),!this.socket)throw new Error(w(_.INVALID_STATE,["not connecting or connected"]));var e=new O(g);this._notify_msg_sent[e]=b(this._disconnected,this),this._schedule_message(e)},x.prototype.getTraceLog=function(){if(null!==this._traceBuffer){for(var e in this._trace("Client.getTraceLog",new Date),this._trace("Client.getTraceLog in flight messages",this._sentMessages.length),this._sentMessages)this._trace("_sentMessages ",e,this._sentMessages[e]);for(var e in this._receivedMessages)this._trace("_receivedMessages ",e,this._receivedMessages[e]);return this._traceBuffer}},x.prototype.startTrace=function(){null===this._traceBuffer&&(this._traceBuffer=[]),this._trace("Client.startTrace",new Date,"@VERSION@-@BUILDLEVEL@")},x.prototype.stopTrace=function(){delete this._traceBuffer},x.prototype._doConnect=function(e){if(this.connectOptions.useSSL){var t=e.split(":");t[0]="wss",e=t.join(":")}this._wsuri=e,this.connected=!1,this.connectOptions.mqttVersion<4?this.socket=new WebSocket(e,["mqttv3.1"]):this.socket=new WebSocket(e,["mqtt"]),this.socket.binaryType="arraybuffer",this.socket.onopen=b(this._on_socket_open,this),this.socket.onmessage=b(this._on_socket_message,this),this.socket.onerror=b(this._on_socket_error,this),this.socket.onclose=b(this._on_socket_close,this),this.sendPinger=new P(this,this.connectOptions.keepAliveInterval),this.receivePinger=new P(this,this.connectOptions.keepAliveInterval),this._connectTimeout&&(this._connectTimeout.cancel(),this._connectTimeout=null),this._connectTimeout=new M(this,this.connectOptions.timeout,this._disconnected,[_.CONNECT_TIMEOUT.code,w(_.CONNECT_TIMEOUT)])},x.prototype._schedule_message=function(e){this._msg_queue.unshift(e),this.connected&&this._process_queue()},x.prototype.store=function(e,t){var r={type:t.type,messageIdentifier:t.messageIdentifier,version:1};switch(t.type){case i:t.pubRecReceived&&(r.pubRecReceived=!0),r.payloadMessage={};for(var o="",s=t.payloadMessage.payloadBytes,a=0;a<s.length;a++)s[a]<=15?o=o+"0"+s[a].toString(16):o+=s[a].toString(16);r.payloadMessage.payloadHex=o,r.payloadMessage.qos=t.payloadMessage.qos,r.payloadMessage.destinationName=t.payloadMessage.destinationName,t.payloadMessage.duplicate&&(r.payloadMessage.duplicate=!0),t.payloadMessage.retained&&(r.payloadMessage.retained=!0),0===e.indexOf("Sent:")&&(void 0===t.sequence&&(t.sequence=++this._sequence),r.sequence=t.sequence);break;default:throw Error(w(_.INVALID_STORED_DATA,[e+this._localKey+t.messageIdentifier,r]))}n.setItem(e+this._localKey+t.messageIdentifier,JSON.stringify(r))},x.prototype.restore=function(e){var t=n.getItem(e),r=JSON.parse(t),o=new O(r.type,r);switch(r.type){case i:for(var s=r.payloadMessage.payloadHex,a=new ArrayBuffer(s.length/2),c=new Uint8Array(a),u=0;s.length>=2;){var l=parseInt(s.substring(0,2),16);s=s.substring(2,s.length),c[u++]=l}var f=new L(c);f.qos=r.payloadMessage.qos,f.destinationName=r.payloadMessage.destinationName,r.payloadMessage.duplicate&&(f.duplicate=!0),r.payloadMessage.retained&&(f.retained=!0),o.payloadMessage=f;break;default:throw Error(w(_.INVALID_STORED_DATA,[e,t]))}0===e.indexOf("Sent:"+this._localKey)?(o.payloadMessage.duplicate=!0,this._sentMessages[o.messageIdentifier]=o):0===e.indexOf("Received:"+this._localKey)&&(this._receivedMessages[o.messageIdentifier]=o)},x.prototype._process_queue=function(){for(var e=null;e=this._msg_queue.pop();)this._socket_send(e),this._notify_msg_sent[e]&&(this._notify_msg_sent[e](),delete this._notify_msg_sent[e])},x.prototype._requires_ack=function(e){var t=Object.keys(this._sentMessages).length;if(t>this.maxMessageIdentifier)throw Error("Too many messages:"+t);for(;void 0!==this._sentMessages[this._message_identifier];)this._message_identifier++;e.messageIdentifier=this._message_identifier,this._sentMessages[e.messageIdentifier]=e,e.type===i&&this.store("Sent:",e),this._message_identifier===this.maxMessageIdentifier&&(this._message_identifier=1)},x.prototype._on_socket_open=function(){var e=new O(r,this.connectOptions);e.clientId=this.clientId,this._socket_send(e)},x.prototype._on_socket_message=function(e){this._trace("Client._on_socket_message",e.data);for(var t=this._deframeMessages(e.data),n=0;n<t.length;n+=1)this._handleMessage(t[n])},x.prototype._deframeMessages=function(e){var t=new Uint8Array(e),n=[];if(this.receiveBuffer){var r=new Uint8Array(this.receiveBuffer.length+t.length);r.set(this.receiveBuffer),r.set(t,this.receiveBuffer.length),t=r,delete this.receiveBuffer}try{for(var o=0;o<t.length;){var i=A(t,o),s=i[0];if(o=i[1],null===s)break;n.push(s)}o<t.length&&(this.receiveBuffer=t.subarray(o))}catch(e){var a="undefined"==e.hasOwnProperty("stack")?e.stack.toString():"No Error Stack Available";return void this._disconnected(_.INTERNAL_ERROR.code,w(_.INTERNAL_ERROR,[e.message,a]))}return n},x.prototype._handleMessage=function(e){this._trace("Client._handleMessage",e);try{switch(e.type){case o:if(this._connectTimeout.cancel(),this._reconnectTimeout&&this._reconnectTimeout.cancel(),this.connectOptions.cleanSession){for(var t in this._sentMessages){var r=this._sentMessages[t];n.removeItem("Sent:"+this._localKey+r.messageIdentifier)}for(var t in this._sentMessages={},this._receivedMessages){var l=this._receivedMessages[t];n.removeItem("Received:"+this._localKey+l.messageIdentifier)}this._receivedMessages={}}if(0!==e.returnCode){this._disconnected(_.CONNACK_RETURNCODE.code,w(_.CONNACK_RETURNCODE,[e.returnCode,m[e.returnCode]]));break}this.connected=!0,this.connectOptions.uris&&(this.hostIndex=this.connectOptions.uris.length);var h=[];for(var d in this._sentMessages)this._sentMessages.hasOwnProperty(d)&&h.push(this._sentMessages[d]);if(this._buffered_msg_queue.length>0)for(var v=null;v=this._buffered_msg_queue.pop();)h.push(v),this.onMessageDelivered&&(this._notify_msg_sent[v]=this.onMessageDelivered(v.payloadMessage));h=h.sort((function(e,t){return e.sequence-t.sequence}));for(var b=0,E=h.length;b<E;b++)if((r=h[b]).type==i&&r.pubRecReceived){var S=new O(c,{messageIdentifier:r.messageIdentifier});this._schedule_message(S)}else this._schedule_message(r);this.connectOptions.onSuccess&&this.connectOptions.onSuccess({invocationContext:this.connectOptions.invocationContext});var A=!1;this._reconnecting&&(A=!0,this._reconnectInterval=1,this._reconnecting=!1),this._connected(A,this._wsuri),this._process_queue();break;case i:this._receivePublish(e);break;case s:(r=this._sentMessages[e.messageIdentifier])&&(delete this._sentMessages[e.messageIdentifier],n.removeItem("Sent:"+this._localKey+e.messageIdentifier),this.onMessageDelivered&&this.onMessageDelivered(r.payloadMessage));break;case a:(r=this._sentMessages[e.messageIdentifier])&&(r.pubRecReceived=!0,S=new O(c,{messageIdentifier:e.messageIdentifier}),this.store("Sent:",r),this._schedule_message(S));break;case c:l=this._receivedMessages[e.messageIdentifier],n.removeItem("Received:"+this._localKey+e.messageIdentifier),l&&(this._receiveMessage(l),delete this._receivedMessages[e.messageIdentifier]);var T=new O(u,{messageIdentifier:e.messageIdentifier});this._schedule_message(T);break;case u:r=this._sentMessages[e.messageIdentifier],delete this._sentMessages[e.messageIdentifier],n.removeItem("Sent:"+this._localKey+e.messageIdentifier),this.onMessageDelivered&&this.onMessageDelivered(r.payloadMessage);break;case f:(r=this._sentMessages[e.messageIdentifier])&&(r.timeOut&&r.timeOut.cancel(),128===e.returnCode[0]?r.onFailure&&r.onFailure(e.returnCode):r.onSuccess&&r.onSuccess(e.returnCode),delete this._sentMessages[e.messageIdentifier]);break;case p:(r=this._sentMessages[e.messageIdentifier])&&(r.timeOut&&r.timeOut.cancel(),r.callback&&r.callback(),delete this._sentMessages[e.messageIdentifier]);break;case y:this.sendPinger.reset();break;case g:this._disconnected(_.INVALID_MQTT_MESSAGE_TYPE.code,w(_.INVALID_MQTT_MESSAGE_TYPE,[e.type]));break;default:this._disconnected(_.INVALID_MQTT_MESSAGE_TYPE.code,w(_.INVALID_MQTT_MESSAGE_TYPE,[e.type]))}}catch(e){var I="undefined"==e.hasOwnProperty("stack")?e.stack.toString():"No Error Stack Available";return void this._disconnected(_.INTERNAL_ERROR.code,w(_.INTERNAL_ERROR,[e.message,I]))}},x.prototype._on_socket_error=function(e){this._reconnecting||this._disconnected(_.SOCKET_ERROR.code,w(_.SOCKET_ERROR,[e.data]))},x.prototype._on_socket_close=function(){this._reconnecting||this._disconnected(_.SOCKET_CLOSE.code,w(_.SOCKET_CLOSE))},x.prototype._socket_send=function(e){if(1==e.type){var t=this._traceMask(e,"password");this._trace("Client._socket_send",t)}else this._trace("Client._socket_send",e);this.socket.send(e.encode()),this.sendPinger.reset()},x.prototype._receivePublish=function(e){switch(e.payloadMessage.qos){case"undefined":case 0:this._receiveMessage(e);break;case 1:var t=new O(s,{messageIdentifier:e.messageIdentifier});this._schedule_message(t),this._receiveMessage(e);break;case 2:this._receivedMessages[e.messageIdentifier]=e,this.store("Received:",e);var n=new O(a,{messageIdentifier:e.messageIdentifier});this._schedule_message(n);break;default:throw Error("Invaild qos="+e.payloadMessage.qos)}},x.prototype._receiveMessage=function(e){this.onMessageArrived&&this.onMessageArrived(e.payloadMessage)},x.prototype._connected=function(e,t){this.onConnected&&this.onConnected(e,t)},x.prototype._reconnect=function(){this._trace("Client._reconnect"),this.connected||(this._reconnecting=!0,this.sendPinger.cancel(),this.receivePinger.cancel(),this._reconnectInterval<128&&(this._reconnectInterval=2*this._reconnectInterval),this.connectOptions.uris?(this.hostIndex=0,this._doConnect(this.connectOptions.uris[0])):this._doConnect(this.uri))},x.prototype._disconnected=function(e,t){if(this._trace("Client._disconnected",e,t),void 0!==e&&this._reconnecting)this._reconnectTimeout=new M(this,this._reconnectInterval,this._reconnect);else if(this.sendPinger.cancel(),this.receivePinger.cancel(),this._connectTimeout&&(this._connectTimeout.cancel(),this._connectTimeout=null),this._msg_queue=[],this._buffered_msg_queue=[],this._notify_msg_sent={},this.socket&&(this.socket.onopen=null,this.socket.onmessage=null,this.socket.onerror=null,this.socket.onclose=null,1===this.socket.readyState&&this.socket.close(),delete this.socket),this.connectOptions.uris&&this.hostIndex<this.connectOptions.uris.length-1)this.hostIndex++,this._doConnect(this.connectOptions.uris[this.hostIndex]);else if(void 0===e&&(e=_.OK.code,t=w(_.OK)),this.connected){if(this.connected=!1,this.onConnectionLost&&this.onConnectionLost({errorCode:e,errorMessage:t,reconnect:this.connectOptions.reconnect,uri:this._wsuri}),e!==_.OK.code&&this.connectOptions.reconnect)return this._reconnectInterval=1,void this._reconnect()}else 4===this.connectOptions.mqttVersion&&!1===this.connectOptions.mqttVersionExplicit?(this._trace("Failed to connect V4, dropping back to V3"),this.connectOptions.mqttVersion=3,this.connectOptions.uris?(this.hostIndex=0,this._doConnect(this.connectOptions.uris[0])):this._doConnect(this.uri)):this.connectOptions.onFailure&&this.connectOptions.onFailure({invocationContext:this.connectOptions.invocationContext,errorCode:e,errorMessage:t})},x.prototype._trace=function(){if(this.traceFunction){var e=Array.prototype.slice.call(arguments);for(var t in e)void 0!==e[t]&&e.splice(t,1,JSON.stringify(e[t]));var n=e.join("");this.traceFunction({severity:"Debug",message:n})}if(null!==this._traceBuffer){t=0;for(var r=arguments.length;t<r;t++)this._traceBuffer.length==this._MAX_TRACE_ENTRIES&&this._traceBuffer.shift(),0===t||void 0===arguments[t]?this._traceBuffer.push(arguments[t]):this._traceBuffer.push(" "+JSON.stringify(arguments[t]))}},x.prototype._traceMask=function(e,t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=r==t?"******":e[r]);return n};var L=function(e){var t,n;if(!("string"==typeof e||e instanceof ArrayBuffer||ArrayBuffer.isView(e)&&!(e instanceof DataView)))throw w(_.INVALID_ARGUMENT,[e,"newPayload"]);t=e;var r=0,o=!1,i=!1;Object.defineProperties(this,{payloadString:{enumerable:!0,get:function(){return"string"==typeof t?t:R(t,0,t.length)}},payloadBytes:{enumerable:!0,get:function(){if("string"==typeof t){var e=new ArrayBuffer(N(t)),n=new Uint8Array(e);return k(t,n,0),n}return t}},destinationName:{enumerable:!0,get:function(){return n},set:function(e){if("string"!=typeof e)throw new Error(w(_.INVALID_ARGUMENT,[e,"newDestinationName"]));n=e}},qos:{enumerable:!0,get:function(){return r},set:function(e){if(0!==e&&1!==e&&2!==e)throw new Error("Invalid argument:"+e);r=e}},retained:{enumerable:!0,get:function(){return o},set:function(e){if("boolean"!=typeof e)throw new Error(w(_.INVALID_ARGUMENT,[e,"newRetained"]));o=e}},topic:{enumerable:!0,get:function(){return n},set:function(e){n=e}},duplicate:{enumerable:!0,get:function(){return i},set:function(e){i=e}}})};return{Client:function(e,t,n,r){var o;if("string"!=typeof e)throw new Error(w(_.INVALID_TYPE,[typeof e,"host"]));if(2==arguments.length){r=t;var i=(o=e).match(/^(wss?):\/\/((\[(.+)\])|([^\/]+?))(:(\d+))?(\/.*)$/);if(!i)throw new Error(w(_.INVALID_ARGUMENT,[e,"host"]));e=i[4]||i[2],t=parseInt(i[7]),n=i[8]}else{if(3==arguments.length&&(r=n,n="/mqtt"),"number"!=typeof t||t<0)throw new Error(w(_.INVALID_TYPE,[typeof t,"port"]));if("string"!=typeof n)throw new Error(w(_.INVALID_TYPE,[typeof n,"path"]));var s=-1!==e.indexOf(":")&&"["!==e.slice(0,1)&&"]"!==e.slice(-1);o="ws://"+(s?"["+e+"]":e)+":"+t+n}for(var a=0,c=0;c<r.length;c++){var u=r.charCodeAt(c);55296<=u&&u<=56319&&c++,a++}if("string"!=typeof r||a>65535)throw new Error(w(_.INVALID_ARGUMENT,[r,"clientId"]));var l=new x(o,e,t,n,r);Object.defineProperties(this,{host:{get:function(){return e},set:function(){throw new Error(w(_.UNSUPPORTED_OPERATION))}},port:{get:function(){return t},set:function(){throw new Error(w(_.UNSUPPORTED_OPERATION))}},path:{get:function(){return n},set:function(){throw new Error(w(_.UNSUPPORTED_OPERATION))}},uri:{get:function(){return o},set:function(){throw new Error(w(_.UNSUPPORTED_OPERATION))}},clientId:{get:function(){return l.clientId},set:function(){throw new Error(w(_.UNSUPPORTED_OPERATION))}},onConnected:{get:function(){return l.onConnected},set:function(e){if("function"!=typeof e)throw new Error(w(_.INVALID_TYPE,[typeof e,"onConnected"]));l.onConnected=e}},disconnectedPublishing:{get:function(){return l.disconnectedPublishing},set:function(e){l.disconnectedPublishing=e}},disconnectedBufferSize:{get:function(){return l.disconnectedBufferSize},set:function(e){l.disconnectedBufferSize=e}},onConnectionLost:{get:function(){return l.onConnectionLost},set:function(e){if("function"!=typeof e)throw new Error(w(_.INVALID_TYPE,[typeof e,"onConnectionLost"]));l.onConnectionLost=e}},onMessageDelivered:{get:function(){return l.onMessageDelivered},set:function(e){if("function"!=typeof e)throw new Error(w(_.INVALID_TYPE,[typeof e,"onMessageDelivered"]));l.onMessageDelivered=e}},onMessageArrived:{get:function(){return l.onMessageArrived},set:function(e){if("function"!=typeof e)throw new Error(w(_.INVALID_TYPE,[typeof e,"onMessageArrived"]));l.onMessageArrived=e}},trace:{get:function(){return l.traceFunction},set:function(e){if("function"!=typeof e)throw new Error(w(_.INVALID_TYPE,[typeof e,"onTrace"]));l.traceFunction=e}}}),this.connect=function(e){if(v(e=e||{},{timeout:"number",userName:"string",password:"string",willMessage:"object",keepAliveInterval:"number",cleanSession:"boolean",useSSL:"boolean",invocationContext:"object",onSuccess:"function",onFailure:"function",hosts:"object",ports:"object",reconnect:"boolean",mqttVersion:"number",mqttVersionExplicit:"boolean",uris:"object"}),void 0===e.keepAliveInterval&&(e.keepAliveInterval=60),e.mqttVersion>4||e.mqttVersion<3)throw new Error(w(_.INVALID_ARGUMENT,[e.mqttVersion,"connectOptions.mqttVersion"]));if(void 0===e.mqttVersion?(e.mqttVersionExplicit=!1,e.mqttVersion=4):e.mqttVersionExplicit=!0,void 0!==e.password&&void 0===e.userName)throw new Error(w(_.INVALID_ARGUMENT,[e.password,"connectOptions.password"]));if(e.willMessage){if(!(e.willMessage instanceof L))throw new Error(w(_.INVALID_TYPE,[e.willMessage,"connectOptions.willMessage"]));if(e.willMessage.stringPayload=null,void 0===e.willMessage.destinationName)throw new Error(w(_.INVALID_TYPE,[typeof e.willMessage.destinationName,"connectOptions.willMessage.destinationName"]))}if(void 0===e.cleanSession&&(e.cleanSession=!0),e.hosts){if(!(e.hosts instanceof Array))throw new Error(w(_.INVALID_ARGUMENT,[e.hosts,"connectOptions.hosts"]));if(e.hosts.length<1)throw new Error(w(_.INVALID_ARGUMENT,[e.hosts,"connectOptions.hosts"]));for(var t=!1,r=0;r<e.hosts.length;r++){if("string"!=typeof e.hosts[r])throw new Error(w(_.INVALID_TYPE,[typeof e.hosts[r],"connectOptions.hosts["+r+"]"]));if(/^(wss?):\/\/((\[(.+)\])|([^\/]+?))(:(\d+))?(\/.*)$/.test(e.hosts[r])){if(0===r)t=!0;else if(!t)throw new Error(w(_.INVALID_ARGUMENT,[e.hosts[r],"connectOptions.hosts["+r+"]"]))}else if(t)throw new Error(w(_.INVALID_ARGUMENT,[e.hosts[r],"connectOptions.hosts["+r+"]"]))}if(t)e.uris=e.hosts;else{if(!e.ports)throw new Error(w(_.INVALID_ARGUMENT,[e.ports,"connectOptions.ports"]));if(!(e.ports instanceof Array))throw new Error(w(_.INVALID_ARGUMENT,[e.ports,"connectOptions.ports"]));if(e.hosts.length!==e.ports.length)throw new Error(w(_.INVALID_ARGUMENT,[e.ports,"connectOptions.ports"]));for(e.uris=[],r=0;r<e.hosts.length;r++){if("number"!=typeof e.ports[r]||e.ports[r]<0)throw new Error(w(_.INVALID_TYPE,[typeof e.ports[r],"connectOptions.ports["+r+"]"]));var i=e.hosts[r],s=e.ports[r],a=-1!==i.indexOf(":");o="ws://"+(a?"["+i+"]":i)+":"+s+n,e.uris.push(o)}}}l.connect(e)},this.subscribe=function(e,t){if("string"!=typeof e&&e.constructor!==Array)throw new Error("Invalid argument:"+e);if(v(t=t||{},{qos:"number",invocationContext:"object",onSuccess:"function",onFailure:"function",timeout:"number"}),t.timeout&&!t.onFailure)throw new Error("subscribeOptions.timeout specified with no onFailure callback.");if(void 0!==t.qos&&0!==t.qos&&1!==t.qos&&2!==t.qos)throw new Error(w(_.INVALID_ARGUMENT,[t.qos,"subscribeOptions.qos"]));l.subscribe(e,t)},this.unsubscribe=function(e,t){if("string"!=typeof e&&e.constructor!==Array)throw new Error("Invalid argument:"+e);if(v(t=t||{},{invocationContext:"object",onSuccess:"function",onFailure:"function",timeout:"number"}),t.timeout&&!t.onFailure)throw new Error("unsubscribeOptions.timeout specified with no onFailure callback.");l.unsubscribe(e,t)},this.send=function(e,t,n,r){var o;if(0===arguments.length)throw new Error("Invalid argument.length");if(1==arguments.length){if(!(e instanceof L)&&"string"!=typeof e)throw new Error("Invalid argument:"+typeof e);if(void 0===(o=e).destinationName)throw new Error(w(_.INVALID_ARGUMENT,[o.destinationName,"Message.destinationName"]));l.send(o)}else(o=new L(t)).destinationName=e,arguments.length>=3&&(o.qos=n),arguments.length>=4&&(o.retained=r),l.send(o)},this.publish=function(e,t,n,r){var o;if(0===arguments.length)throw new Error("Invalid argument.length");if(1==arguments.length){if(!(e instanceof L)&&"string"!=typeof e)throw new Error("Invalid argument:"+typeof e);if(void 0===(o=e).destinationName)throw new Error(w(_.INVALID_ARGUMENT,[o.destinationName,"Message.destinationName"]));l.send(o)}else(o=new L(t)).destinationName=e,arguments.length>=3&&(o.qos=n),arguments.length>=4&&(o.retained=r),l.send(o)},this.disconnect=function(){l.disconnect()},this.getTraceLog=function(){return l.getTraceLog()},this.startTrace=function(){l.startTrace()},this.stopTrace=function(){l.stopTrace()},this.isConnected=function(){return l.connected}},Message:L}}(void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},e.exports=n()}).call(this,n(10))},,,function(e,t,n){"use strict";var r=n(2),o=n(12),i=n(27),s=n(18);var a=function e(t){var n=new i(t),a=o(i.prototype.request,n);return r.extend(a,i.prototype,n),r.extend(a,n),a.create=function(n){return e(s(t,n))},a}(n(7));a.Axios=i,a.Cancel=n(8),a.CancelToken=n(41),a.isCancel=n(17),a.VERSION=n(19).version,a.all=function(e){return Promise.all(e)},a.spread=n(42),a.isAxiosError=n(43),e.exports=a,e.exports.default=a},function(e,t,n){"use strict";var r=n(2),o=n(13),i=n(28),s=n(29),a=n(18),c=n(40),u=c.validators;function l(e){this.defaults=e,this.interceptors={request:new i,response:new i}}l.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=a(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var n=t.transitional;void 0!==n&&c.assertOptions(n,{silentJSONParsing:u.transitional(u.boolean),forcedJSONParsing:u.transitional(u.boolean),clarifyTimeoutError:u.transitional(u.boolean)},!1);var r=[],o=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var i,l=[];if(this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)})),!o){var f=[s,void 0];for(Array.prototype.unshift.apply(f,r),f=f.concat(l),i=Promise.resolve(t);f.length;)i=i.then(f.shift(),f.shift());return i}for(var h=t;r.length;){var p=r.shift(),d=r.shift();try{h=p(h)}catch(e){d(e);break}}try{i=s(h)}catch(e){return Promise.reject(e)}for(;l.length;)i=i.then(l.shift(),l.shift());return i},l.prototype.getUri=function(e){return e=a(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,n){return this.request(a(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,n,r){return this.request(a(r||{},{method:e,url:t,data:n}))}})),e.exports=l},function(e,t,n){"use strict";var r=n(2);function o(){this.handlers=[]}o.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},function(e,t,n){"use strict";var r=n(2),o=n(30),i=n(17),s=n(7),a=n(8);function c(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new a("canceled")}e.exports=function(e){return c(e),e.headers=e.headers||{},e.data=o.call(e,e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return c(e),t.data=o.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(c(e),t&&t.response&&(t.response.data=o.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,n){"use strict";var r=n(2),o=n(7);e.exports=function(e,t,n){var i=this||o;return r.forEach(n,(function(n){e=n.call(i,e,t)})),e}},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(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:s}catch(e){r=s}}();var c,u=[],l=!1,f=-1;function h(){l&&c&&(l=!1,c.length?u=c.concat(u):f=-1,u.length&&p())}function p(){if(!l){var e=a(h);l=!0;for(var t=u.length;t;){for(c=u,u=[];++f<t;)c&&c[f].run();f=-1,t=u.length}c=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===s||!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 d(e,t){this.fun=e,this.array=t}function y(){}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];u.push(new d(e,t)),1!==u.length||l||a(p)},d.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=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,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";var r=n(2);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},function(e,t,n){"use strict";var r=n(16);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,o,i,s){var a=[];a.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(o)&&a.push("path="+o),r.isString(i)&&a.push("domain="+i),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,n){"use strict";var r=n(36),o=n(37);e.exports=function(e,t){return e&&!r(t)?o(e,t):t}},function(e,t,n){"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},function(e,t,n){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,n){"use strict";var r=n(2),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,i,s={};return e?(r.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(s[t]&&o.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([n]):s[t]?s[t]+", "+n:n}})),s):s}},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},function(e,t,n){"use strict";var r=n(19).version,o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var i={};o.transitional=function(e,t,n){function o(e,t){return"[Axios v"+r+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,s){if(!1===e)throw new Error(o(r," has been removed"+(t?" in "+t:"")));return t&&!i[r]&&(i[r]=!0,console.warn(o(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,s)}},e.exports={assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),o=r.length;o-- >0;){var i=r[o],s=t[i];if(s){var a=e[i],c=void 0===a||s(a,i,e);if(!0!==c)throw new TypeError("option "+i+" must be "+c)}else if(!0!==n)throw Error("Unknown option "+i)}},validators:o}},function(e,t,n){"use strict";var r=n(8);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t<r;t++)n._listeners[t](e);n._listeners=null}})),this.promise.then=function(e){var t,r=new Promise((function(e){n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},o.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,n){"use strict";var r=n(2);e.exports=function(e){return r.isObject(e)&&!0===e.isAxiosError}},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 s="object"==typeof r&&r;s.global!==s&&s.window!==s&&s.self;var a,c=2147483647,u=/^xn--/,l=/[^\x20-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,d=String.fromCharCode;function y(e){throw new RangeError(h[e])}function g(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function v(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+g((e=e.replace(f,".")).split("."),t).join(".")}function b(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 _(e){return g(e,(function(e){var t="";return e>65535&&(t+=d((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=d(e)})).join("")}function m(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function w(e,t,n){var r=0;for(e=n?p(e/700):e>>1,e+=p(e/t);e>455;r+=36)e=p(e/35);return p(r+36*e/(e+38))}function E(e){var t,n,r,o,i,s,a,u,l,f,h,d=[],g=e.length,v=0,b=128,m=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&y("not-basic"),d.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<g;){for(i=v,s=1,a=36;o>=g&&y("invalid-input"),((u=(h=e.charCodeAt(o++))-48<10?h-22:h-65<26?h-65:h-97<26?h-97:36)>=36||u>p((c-v)/s))&&y("overflow"),v+=u*s,!(u<(l=a<=m?1:a>=m+26?26:a-m));a+=36)s>p(c/(f=36-l))&&y("overflow"),s*=f;m=w(v-i,t=d.length+1,0==i),p(v/t)>c-b&&y("overflow"),b+=p(v/t),v%=t,d.splice(v++,0,b)}return _(d)}function S(e){var t,n,r,o,i,s,a,u,l,f,h,g,v,_,E,S=[];for(g=(e=b(e)).length,t=128,n=0,i=72,s=0;s<g;++s)(h=e[s])<128&&S.push(d(h));for(r=o=S.length,o&&S.push("-");r<g;){for(a=c,s=0;s<g;++s)(h=e[s])>=t&&h<a&&(a=h);for(a-t>p((c-n)/(v=r+1))&&y("overflow"),n+=(a-t)*v,t=a,s=0;s<g;++s)if((h=e[s])<t&&++n>c&&y("overflow"),h==t){for(u=n,l=36;!(u<(f=l<=i?1:l>=i+26?26:l-i));l+=36)E=u-f,_=36-f,S.push(d(m(f+E%_,0))),u=p(E/_);S.push(d(m(u,0))),i=w(n,v,r==o),n=0,++r}++n,++t}return S.join("")}a={version:"1.4.1",ucs2:{decode:b,encode:_},decode:E,encode:S,toASCII:function(e){return v(e,(function(e){return l.test(e)?"xn--"+S(e):e}))},toUnicode:function(e){return v(e,(function(e){return u.test(e)?E(e.slice(4).toLowerCase()):e}))}},void 0===(o=function(){return a}.call(t,n,t,e))||(e.exports=o)}()}).call(this,n(45)(e),n(10))},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(48),t.encode=t.stringify=n(49)},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 s={};if("string"!=typeof e||0===e.length)return s;var a=/\+/g;e=e.split(t);var c=1e3;i&&"number"==typeof i.maxKeys&&(c=i.maxKeys);var u=e.length;c>0&&u>c&&(u=c);for(var l=0;l<u;++l){var f,h,p,d,y=e[l].replace(a,"%20"),g=y.indexOf(n);g>=0?(f=y.substr(0,g),h=y.substr(g+1)):(f=y,h=""),p=decodeURIComponent(f),d=decodeURIComponent(h),r(s,p)?o(s[p])?s[p].push(d):s[p]=[s[p],d]:s[p]=d}return s};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,a){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?i(s(e),(function(s){var a=encodeURIComponent(r(s))+n;return o(e[s])?i(e[s],(function(e){return a+encodeURIComponent(r(e))})).join(t):a+encodeURIComponent(r(e[s]))})).join(t):a?encodeURIComponent(r(a))+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 s=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){"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 s=function(){return"function"==typeof Symbol},a=function(e){return s()&&Boolean(Symbol[e])},c=function(e){return a(e)?Symbol[e]:"@@"+e};s()&&!a("observable")&&(Symbol.observable=Symbol("observable"));var u=c("iterator"),l=c("observable"),f=c("species");function h(e,t){var n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function p(e){var t=e.constructor;return void 0!==t&&null===(t=t[f])&&(t=void 0),void 0!==t?t:S}function d(e){return e instanceof S}function y(e){y.log?y.log(e):setTimeout((function(){throw e}))}function g(e){Promise.resolve().then((function(){try{e()}catch(e){y(e)}}))}function v(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var n=h(t,"unsubscribe");n&&n.call(t)}}catch(e){y(e)}}function b(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function _(e,t,n){e._state="running";var r=e._observer;try{var o=h(r,t);switch(t){case"next":o&&o.call(r,n);break;case"error":if(b(e),!o)throw n;o.call(r,n);break;case"complete":b(e),o&&o.call(r)}}catch(e){y(e)}"closed"===e._state?v(e):"running"===e._state&&(e._state="ready")}function m(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 g((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var n=0;n<t.length&&(_(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e)}))):void _(e,t,n);e._queue.push({type:t,value:n})}}var w=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 E(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&&(b(this),v(this))}},{key:"closed",get:function(){return"closed"===this._state}}]),e}(),E=function(){function e(t){r(this,e),this._subscription=t}return i(e,[{key:"next",value:function(e){m(this._subscription,"next",e)}},{key:"error",value:function(e){m(this._subscription,"error",e)}},{key:"complete",value:function(){m(this._subscription,"complete")}},{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),S=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 w(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(p(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(p(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=p(this),r=arguments.length>1,o=!1,i=arguments[1],s=i;return new n((function(n){return t.subscribe({next:function(t){var i=!o;if(o=!0,!i||r)try{s=e(s,t)}catch(e){return n.error(e)}else s=t},error:function(e){n.error(e)},complete:function(){if(!o&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(s),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=p(this);return new o((function(t){var r,i=0;return function e(s){r=s.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=p(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),s()}});o.push(i)},error:function(e){r.error(e)},complete:function(){s()}});function s(){i.closed&&0===o.length&&r.complete()}return function(){o.forEach((function(e){return e.unsubscribe()})),i.unsubscribe()}}))}},{key:l,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=h(t,l);if(r){var o=r.call(t);if(Object(o)!==o)throw new TypeError(o+" is not an object");return d(o)&&o.constructor===n?o:new n((function(e){return o.subscribe(e)}))}if(a("iterator")&&(r=h(t,u)))return new n((function(e){g((function(){if(!e.closed){var n=!0,o=!1,i=void 0;try{for(var s,a=r.call(t)[Symbol.iterator]();!(n=(s=a.next()).done);n=!0){var c=s.value;if(e.next(c),e.closed)return}}catch(e){o=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}e.complete()}}))}));if(Array.isArray(t))return new n((function(e){g((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){g((function(){if(!e.closed){for(var t=0;t<n.length;++t)if(e.next(n[t]),e.closed)return;e.complete()}}))}))}},{key:f,get:function(){return this}}]),e}();t.Observable=S,s()&&Object.defineProperty(S,Symbol("extensions"),{value:{symbol:l,hostReportError:y},configurable:!0})},function(e,t,n){var r,o,i=n(20),s=n(21),a=0,c=0;e.exports=function(e,t,n){var u=t&&n||0,l=t||[],f=(e=e||{}).node||r,h=void 0!==e.clockseq?e.clockseq:o;if(null==f||null==h){var p=i();null==f&&(f=r=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==h&&(h=o=16383&(p[6]<<8|p[7]))}var d=void 0!==e.msecs?e.msecs:(new Date).getTime(),y=void 0!==e.nsecs?e.nsecs:c+1,g=d-a+(y-c)/1e4;if(g<0&&void 0===e.clockseq&&(h=h+1&16383),(g<0||d>a)&&void 0===e.nsecs&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=d,c=y,o=h;var v=(1e4*(268435455&(d+=122192928e5))+y)%4294967296;l[u++]=v>>>24&255,l[u++]=v>>>16&255,l[u++]=v>>>8&255,l[u++]=255&v;var b=d/4294967296*1e4&268435455;l[u++]=b>>>8&255,l[u++]=255&b,l[u++]=b>>>24&15|16,l[u++]=b>>>16&255,l[u++]=h>>>8|128,l[u++]=255&h;for(var _=0;_<6;++_)l[u+_]=f[_];return t||s(l)}},function(e,t,n){var r=n(20),o=n(21);e.exports=function(e,t,n){var i=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var s=(e=e||{}).random||(e.rng||r)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(var a=0;a<16;++a)t[i+a]=s[a];return t||o(s)}},function(e,t,n){"use strict";t.byteLength=function(e){var t=u(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=u(e),s=r[0],a=r[1],c=new i(function(e,t,n){return 3*(t+n)/4-n}(0,s,a)),l=0,f=a>0?s-4:s;for(n=0;n<f;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)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===a&&(t=o[e.charCodeAt(n)]<<2|o[e.charCodeAt(n+1)]>>4,c[l++]=255&t);1===a&&(t=o[e.charCodeAt(n)]<<10|o[e.charCodeAt(n+1)]<<4|o[e.charCodeAt(n+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],s=0,a=n-o;s<a;s+=16383)i.push(l(e,s,s+16383>a?a:s+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,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=s.length;a<c;++a)r[a]=s[a],o[s.charCodeAt(a)]=a;function u(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 l(e,t,n){for(var o,i,s=[],a=t;a<n;a+=3)o=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){
|
|
9
|
+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
10
|
+
t.read=function(e,t,n,r,o){var i,s,a=8*o-r-1,c=(1<<a)-1,u=c>>1,l=-7,f=n?o-1:0,h=n?-1:1,p=e[t+f];for(f+=h,i=p&(1<<-l)-1,p>>=-l,l+=a;l>0;i=256*i+e[t+f],f+=h,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=r;l>0;s=256*s+e[t+f],f+=h,l-=8);if(0===i)i=1-u;else{if(i===c)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),i-=u}return(p?-1:1)*s*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var s,a,c,u=8*i-o-1,l=(1<<u)-1,f=l>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,d=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+f>=1?h/c:h*Math.pow(2,1-f))*c>=2&&(s++,c/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(t*c-1)*Math.pow(2,o),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,o),s=0));o>=8;e[n+p]=255&a,p+=d,a/=256,o-=8);for(s=s<<o|a,u+=o;u>0;e[n+p]=255&s,p+=d,s/=256,u-=8);e[n+p-d]|=128*y}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";n.r(t),n.d(t,"API",(function(){return qe})),n.d(t,"APIClass",(function(){return De})),n.d(t,"graphqlOperation",(function(){return Re})),n.d(t,"GraphQLAuthError",(function(){return X})),n.d(t,"GRAPHQL_AUTH_MODE",(function(){return r.GRAPHQL_AUTH_MODE}));var r=n(3),o=n.n(r),i=n(4),s=n.n(i),a=n(0),c=n(6),u=n.n(c),l=n(5),f=function(){return(f=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)},h=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},p=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}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,a])}}},d=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},y=new a.ConsoleLogger("RestClient"),g=function(){function e(e){this._region="us-east-1",this._service="execute-api",this._custom_header=void 0,this._cancelTokenMap=null,this.Credentials=a.Credentials,this._options=e,y.debug("API Options",this._options),null==this._cancelTokenMap&&(this._cancelTokenMap=new WeakMap)}return e.prototype.ajax=function(e,t,n){return h(this,void 0,void 0,(function(){var r,o,i,s,c,u,h,g,v,b,_,m,w,E,S=this;return p(this,(function(p){switch(p.label){case 0:return y.debug(t,e),i="us-east-1",s="execute-api",c=void 0,"string"==typeof e?(r=this._parseUrl(e),o=e):(o=e.endpoint,c=e.custom_header,i=e.region,s=e.service,r=this._parseUrl(e.endpoint)),u={method:t,url:o,host:r.host,path:r.path,headers:{},data:null,responseType:"json",timeout:0,cancelToken:null},h={},a.Platform.isReactNative&&(g=a.Platform.userAgent||"aws-amplify/0.1.x",h={"User-Agent":g}),v=Object.assign({},n),b=v.response,v.body&&("function"==typeof FormData&&v.body instanceof FormData?(h["Content-Type"]="multipart/form-data",u.data=v.body):(h["Content-Type"]="application/json; charset=UTF-8",u.data=JSON.stringify(v.body))),v.responseType&&(u.responseType=v.responseType),v.withCredentials&&(u.withCredentials=v.withCredentials),v.timeout&&(u.timeout=v.timeout),v.cancellableToken&&(u.cancelToken=v.cancellableToken.token),u.signerServiceInfo=v.signerServiceInfo,"function"!=typeof c?[3,2]:[4,c()];case 1:return m=p.sent(),[3,3];case 2:m=void 0,p.label=3;case 3:return _=m,u.headers=f(f(f({},h),_),v.headers),w=Object(l.parse)(o,!0,!0),w.search,E=d(w,["search"]),u.url=Object(l.format)(f(f({},E),{query:f(f({},E.query),v.queryStringParameters||{})})),void 0!==u.headers.Authorization?(u.headers=Object.keys(u.headers).reduce((function(e,t){return u.headers[t]&&(e[t]=u.headers[t]),e}),{}),[2,this._request(u,b)]):[2,this.Credentials.get().then((function(r){return S._signed(f({},u),r,b,{region:i,service:s}).catch((function(r){if(a.DateUtils.isClockSkewError(r)){var o=r.response.headers,i=o&&(o.date||o.Date),s=new Date(i),c=a.DateUtils.getDateFromHeaderString(u.headers["x-amz-date"]);if(a.DateUtils.isClockSkewed(s))return a.DateUtils.setClockOffset(s.getTime()-c.getTime()),S.ajax(e,t,n)}throw r}))}),(function(e){return y.debug("No credentials available, the request will be unsigned"),S._request(u,b)}))]}}))}))},e.prototype.get=function(e,t){return this.ajax(e,"GET",t)},e.prototype.put=function(e,t){return this.ajax(e,"PUT",t)},e.prototype.patch=function(e,t){return this.ajax(e,"PATCH",t)},e.prototype.post=function(e,t){return this.ajax(e,"POST",t)},e.prototype.del=function(e,t){return this.ajax(e,"DELETE",t)},e.prototype.head=function(e,t){return this.ajax(e,"HEAD",t)},e.prototype.cancel=function(e,t){var n=this._cancelTokenMap.get(e);return!!n&&(n.cancel(t),!0)},e.prototype.hasCancelToken=function(e){return this._cancelTokenMap.has(e)},e.prototype.isCancel=function(e){return u.a.isCancel(e)},e.prototype.getCancellableToken=function(){return u.a.CancelToken.source()},e.prototype.updateRequestToBeCancellable=function(e,t){this._cancelTokenMap.set(e,t)},e.prototype.endpoint=function(e){var t=this,n=this._options.endpoints,r="";return Array.isArray(n)?(n.forEach((function(n){n.name===e&&(r=n.endpoint,"string"==typeof n.region?t._region=n.region:"string"==typeof t._options.region&&(t._region=t._options.region),"string"==typeof n.service?t._service=n.service||"execute-api":t._service="execute-api","function"==typeof n.custom_header?t._custom_header=n.custom_header:t._custom_header=void 0)})),r):r},e.prototype._signed=function(e,t,n,r){var o=r.service,i=r.region,s=e.signerServiceInfo,c=d(e,["signerServiceInfo"]),l=i||this._region||this._options.region,f=o||this._service||this._options.service,h={secret_key:t.secretAccessKey,access_key:t.accessKeyId,session_token:t.sessionToken},p={region:l,service:f},g=Object.assign(p,s),v=a.Signer.sign(c,h,g);return v.data&&(v.body=v.data),y.debug("Signed Request: ",v),delete v.headers.host,u()(v).then((function(e){return n?e:e.data})).catch((function(e){throw y.debug(e),e}))},e.prototype._request=function(e,t){return void 0===t&&(t=!1),u()(e).then((function(e){return t?e:e.data})).catch((function(e){throw y.debug(e),e}))},e.prototype._parseUrl=function(e){var t=e.split("/");return{host:t[2],path:"/"+t.slice(3).join("/")}},e}(),v=function(){return(v=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)},b=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},_=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}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,a])}}},m=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},w=new a.ConsoleLogger("RestAPI"),E=function(){function e(e){this._api=null,this.Credentials=a.Credentials,this._options=e,w.debug("API Options",this._options)}return e.prototype.getModuleName=function(){return"RestAPI"},e.prototype.configure=function(e){var t=e||{},n=t.API,r=void 0===n?{}:n,o=m(t,["API"]),i=v(v({},o),r);if(w.debug("configure Rest API",{opt:i}),i.aws_project_region){if(i.aws_cloud_logic_custom){var s=i.aws_cloud_logic_custom;i.endpoints="string"==typeof s?JSON.parse(s):s}i=Object.assign({},i,{region:i.aws_project_region,header:{}})}return Array.isArray(i.endpoints)?i.endpoints.forEach((function(e){void 0!==e.custom_header&&"function"!=typeof e.custom_header&&(w.warn("Rest API "+e.name+", custom_header should be a function"),e.custom_header=void 0)})):this._options&&Array.isArray(this._options.endpoints)?i.endpoints=this._options.endpoints:i.endpoints=[],this._options=Object.assign({},this._options,i),this.createInstance(),this._options},e.prototype.createInstance=function(){return w.debug("create Rest API instance"),this._api=new g(this._options),this._api.Credentials=this.Credentials,!0},e.prototype.get=function(e,t,n){try{var r=this.getEndpointInfo(e,t),o=this._api.getCancellableToken(),i=Object.assign({},n);i.cancellableToken=o;var s=this._api.get(r,i);return this._api.updateRequestToBeCancellable(s,o),s}catch(e){return Promise.reject(e.message)}},e.prototype.post=function(e,t,n){try{var r=this.getEndpointInfo(e,t),o=this._api.getCancellableToken(),i=Object.assign({},n);i.cancellableToken=o;var s=this._api.post(r,i);return this._api.updateRequestToBeCancellable(s,o),s}catch(e){return Promise.reject(e.message)}},e.prototype.put=function(e,t,n){try{var r=this.getEndpointInfo(e,t),o=this._api.getCancellableToken(),i=Object.assign({},n);i.cancellableToken=o;var s=this._api.put(r,i);return this._api.updateRequestToBeCancellable(s,o),s}catch(e){return Promise.reject(e.message)}},e.prototype.patch=function(e,t,n){try{var r=this.getEndpointInfo(e,t),o=this._api.getCancellableToken(),i=Object.assign({},n);i.cancellableToken=o;var s=this._api.patch(r,i);return this._api.updateRequestToBeCancellable(s,o),s}catch(e){return Promise.reject(e.message)}},e.prototype.del=function(e,t,n){try{var r=this.getEndpointInfo(e,t),o=this._api.getCancellableToken(),i=Object.assign({},n);i.cancellableToken=o;var s=this._api.del(r,i);return this._api.updateRequestToBeCancellable(s,o),s}catch(e){return Promise.reject(e.message)}},e.prototype.head=function(e,t,n){try{var r=this.getEndpointInfo(e,t),o=this._api.getCancellableToken(),i=Object.assign({},n);i.cancellableToken=o;var s=this._api.head(r,i);return this._api.updateRequestToBeCancellable(s,o),s}catch(e){return Promise.reject(e.message)}},e.prototype.isCancel=function(e){return this._api.isCancel(e)},e.prototype.cancel=function(e,t){return this._api.cancel(e,t)},e.prototype.hasCancelToken=function(e){return this._api.hasCancelToken(e)},e.prototype.endpoint=function(e){return b(this,void 0,void 0,(function(){return _(this,(function(t){return[2,this._api.endpoint(e)]}))}))},e.prototype.getEndpointInfo=function(e,t){var n=this._options.endpoints;if(!Array.isArray(n))throw new Error("API category not configured");var r=n.find((function(t){return t.name===e}));if(!r)throw new Error("API "+e+" does not exist");var o={endpoint:r.endpoint+t};return"string"==typeof r.region?o.region=r.region:"string"==typeof this._options.region&&(o.region=this._options.region),"string"==typeof r.service?o.service=r.service||"execute-api":o.service="execute-api","function"==typeof r.custom_header?o.custom_header=r.custom_header:o.custom_header=void 0,o},e}(),S=new E(null);a.Amplify.register(S);var O,A,T,I=n(1),C=n(22),N=n.n(C).a,k=n(23),R=n(9),P=function(){return(P=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)},M=new a.ConsoleLogger("AbstractPubSubProvider"),x=function(){function e(e){void 0===e&&(e={}),this._config=e}return e.prototype.configure=function(e){return void 0===e&&(e={}),this._config=P(P({},e),this._config),M.debug("configure "+this.getProviderName(),this._config),this.options},e.prototype.getCategory=function(){return"PubSub"},Object.defineProperty(e.prototype,"options",{get:function(){return P({},this._config)},enumerable:!0,configurable:!0}),e}();!function(e){e.CONNECTION_CLOSED="Connection closed",e.CONNECTION_FAILED="Connection failed",e.REALTIME_SUBSCRIPTION_INIT_ERROR="AppSync Realtime subscription init error",e.SUBSCRIPTION_ACK="Subscription ack",e.TIMEOUT_DISCONNECT="Timeout disconnect"}(O||(O={})),(T=A||(A={})).Connected="Connected",T.ConnectedPendingNetwork="ConnectedPendingNetwork",T.ConnectionDisrupted="ConnectionDisrupted",T.ConnectionDisruptedPendingNetwork="ConnectionDisruptedPendingNetwork",T.Connecting="Connecting",T.ConnectedPendingDisconnect="ConnectedPendingDisconnect",T.Disconnected="Disconnected",T.ConnectedPendingKeepAlive="ConnectedPendingKeepAlive";var L,U,j,D=function(){return(D=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)},q={KEEP_ALIVE_MISSED:{keepAliveState:"unhealthy"},KEEP_ALIVE:{keepAliveState:"healthy"},CONNECTION_ESTABLISHED:{connectionState:"connected"},CONNECTION_FAILED:{intendedConnectionState:"disconnected",connectionState:"disconnected"},CLOSING_CONNECTION:{intendedConnectionState:"disconnected"},OPENING_CONNECTION:{intendedConnectionState:"connected",connectionState:"connecting"},CLOSED:{connectionState:"disconnected"},ONLINE:{networkState:"connected"},OFFLINE:{networkState:"disconnected"}},B=function(){function e(){var e=this;this._networkMonitoringSubscription=void 0,this._linkedConnectionState={networkState:"connected",connectionState:"disconnected",intendedConnectionState:"disconnected",keepAliveState:"healthy"},this._linkedConnectionStateObservable=new N((function(t){t.next(e._linkedConnectionState),e._linkedConnectionStateObserver=t}))}return e.prototype.enableNetworkMonitoring=function(){var e=this;void 0===this._networkMonitoringSubscription&&(this._networkMonitoringSubscription=(new a.Reachability).networkMonitor().subscribe((function(t){var n=t.online;e.record(n?q.ONLINE:q.OFFLINE)})))},e.prototype.disableNetworkMonitoring=function(){var e;null===(e=this._networkMonitoringSubscription)||void 0===e||e.unsubscribe(),this._networkMonitoringSubscription=void 0},Object.defineProperty(e.prototype,"connectionStateObservable",{get:function(){var e,t=this;return this._linkedConnectionStateObservable.map((function(e){return t.connectionStatesTranslator(e)})).filter((function(t){var n=t!==e;return e=t,n}))},enumerable:!0,configurable:!0}),e.prototype.record=function(e){"connected"===e.intendedConnectionState?this.enableNetworkMonitoring():"disconnected"===e.intendedConnectionState&&this.disableNetworkMonitoring();var t=D(D({},this._linkedConnectionState),e);this._linkedConnectionState=D({},t),this._linkedConnectionStateObserver.next(this._linkedConnectionState)},e.prototype.connectionStatesTranslator=function(e){var t=e.connectionState,n=e.networkState,r=e.intendedConnectionState,o=e.keepAliveState;return"connected"===t&&"disconnected"===n?A.ConnectedPendingNetwork:"connected"===t&&"disconnected"===r?A.ConnectedPendingDisconnect:"disconnected"===t&&"connected"===r&&"disconnected"===n?A.ConnectionDisruptedPendingNetwork:"disconnected"===t&&"connected"===r?A.ConnectionDisrupted:"connected"===t&&"unhealthy"===o?A.ConnectedPendingKeepAlive:"connecting"===t?A.Connecting:"disconnected"===t?A.Disconnected:A.Connected},e}(),F=[400,401,403];!function(e){e.GQL_CONNECTION_INIT="connection_init",e.GQL_CONNECTION_ERROR="connection_error",e.GQL_CONNECTION_ACK="connection_ack",e.GQL_START="start",e.GQL_START_ACK="start_ack",e.GQL_DATA="data",e.GQL_CONNECTION_KEEP_ALIVE="ka",e.GQL_STOP="stop",e.GQL_COMPLETE="complete",e.GQL_ERROR="error"}(L||(L={})),function(e){e[e.PENDING=0]="PENDING",e[e.CONNECTED=1]="CONNECTED",e[e.FAILED=2]="FAILED"}(U||(U={})),function(e){e[e.CLOSED=0]="CLOSED",e[e.READY=1]="READY",e[e.CONNECTING=2]="CONNECTING"}(j||(j={}));var G="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",V={accept:"application/json, text/javascript","content-encoding":"amz-1.0","content-type":"application/json; charset=UTF-8"};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 Q,K=(Q=function(e,t){return(Q=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}Q(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),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,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},H=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}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,a])}}},W=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},$=new a.ConsoleLogger("MqttOverWSProvider");var X,Z=function(){function e(){this.promises=new Map}return e.prototype.get=function(e,t){return J(this,void 0,void 0,(function(){var n,r;return H(this,(function(o){return(n=this.promises.get(e))?[2,n]:t?(r=t(e),this.promises.set(e,r),[2,r]):[2,void 0]}))}))},Object.defineProperty(e.prototype,"allClients",{get:function(){return Array.from(this.promises.keys())},enumerable:!0,configurable:!0}),e.prototype.remove=function(e){this.promises.delete(e)},e}(),ee="undefined"!=typeof Symbol?Symbol("topic"):"@@topic",te=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,z(z({},t),{clientId:t.clientId||Object(R.v4)()}))||this;return n._clientsQueue=new Z,n.connectionStateMonitor=new B,n._topicObservers=new Map,n._clientIdObservers=new Map,n.connectionStateMonitor.connectionStateObservable.subscribe((function(e){var t,r,o;t="ConnectionStateChange",r={provider:n,connectionState:e},o="Connection state is "+e,a.Hub.dispatch("pubsub",{event:t,data:r,message:o},"PubSub",G)})),n}return K(t,e),Object.defineProperty(t.prototype,"clientId",{get:function(){return this.options.clientId},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"endpoint",{get:function(){return this.options.aws_pubsub_endpoint},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clientsQueue",{get:function(){return this._clientsQueue},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSSLEnabled",{get:function(){return!this.options.aws_appsync_dangerously_connect_to_http_endpoint_for_testing},enumerable:!0,configurable:!0}),t.prototype.getTopicForValue=function(e){return"object"===Y(e)&&e[ee]},t.prototype.getProviderName=function(){return"MqttOverWSProvider"},t.prototype.onDisconnect=function(e){var t=this,n=e.clientId,r=e.errorCode,o=W(e,["clientId","errorCode"]);if(0!==r){$.warn(n,JSON.stringify(z({errorCode:r},o),null,2));var i=[];if(!n)return;var s=this._clientIdObservers.get(n);if(!s)return;s.forEach((function(e){e.error("Disconnected, error code: "+r),t._topicObservers.forEach((function(t,n){t.delete(e),0===t.size&&i.push(n)}))})),this._clientIdObservers.delete(n),i.forEach((function(e){t._topicObservers.delete(e)}))}},t.prototype.newClient=function(e){var t=e.url,n=e.clientId;return J(this,void 0,void 0,(function(){var e,r=this;return H(this,(function(o){switch(o.label){case 0:return $.debug("Creating new MQTT client",n),this.connectionStateMonitor.record(q.OPENING_CONNECTION),(e=new k.Client(t,n)).onMessageArrived=function(e){var t=e.destinationName,n=e.payloadString;r._onMessage(t,n)},e.onConnectionLost=function(e){var t=e.errorCode,o=W(e,["errorCode"]);r.onDisconnect(z({clientId:n,errorCode:t},o)),r.connectionStateMonitor.record(q.CLOSED)},[4,new Promise((function(t,n){e.connect({useSSL:r.isSSLEnabled,mqttVersion:3,onSuccess:function(){return t(e)},onFailure:function(){n(),r.connectionStateMonitor.record(q.CONNECTION_FAILED)}})}))];case 1:return o.sent(),this.connectionStateMonitor.record(q.CONNECTION_ESTABLISHED),[2,e]}}))}))},t.prototype.connect=function(e,t){return void 0===t&&(t={}),J(this,void 0,void 0,(function(){var n=this;return H(this,(function(r){switch(r.label){case 0:return[4,this.clientsQueue.get(e,(function(e){return n.newClient(z(z({},t),{clientId:e}))}))];case 1:return[2,r.sent()]}}))}))},t.prototype.disconnect=function(e){return J(this,void 0,void 0,(function(){var t;return H(this,(function(n){switch(n.label){case 0:return[4,this.clientsQueue.get(e)];case 1:return(t=n.sent())&&t.isConnected()&&(t.disconnect(),this.connectionStateMonitor.record(q.CLOSED)),this.clientsQueue.remove(e),[2]}}))}))},t.prototype.publish=function(e,t){return J(this,void 0,void 0,(function(){var n,r,o,i;return H(this,(function(s){switch(s.label){case 0:return n=[].concat(e),r=JSON.stringify(t),[4,this.endpoint];case 1:return o=s.sent(),[4,this.connect(this.clientId,{url:o})];case 2:return i=s.sent(),$.debug("Publishing to topic(s)",n.join(","),r),n.forEach((function(e){return i.send(e,r)})),[2]}}))}))},t.prototype._onMessage=function(e,t){try{var n=[];this._topicObservers.forEach((function(t,r){(function(e,t){for(var n=e.split("/"),r=n.length,o=t.split("/"),i=0;i<r;++i){var s=n[i],a=o[i];if("#"===s)return o.length>=r;if("+"!==s&&s!==a)return!1}return r===o.length})(r,e)&&n.push(t)}));var r=JSON.parse(t);"object"===Y(r)&&(r[ee]=e),n.forEach((function(e){e.forEach((function(e){return e.next(r)}))}))}catch(e){$.warn("Error handling message",e,t)}},t.prototype.subscribe=function(e,t){var n=this;void 0===t&&(t={});var r=[].concat(e);return $.debug("Subscribing to topic(s)",r.join(",")),new N((function(e){var o;r.forEach((function(t){var r=n._topicObservers.get(t);r||(r=new Set,n._topicObservers.set(t,r)),r.add(e)}));var i=t.clientId,s=void 0===i?n.clientId:i,a=n._clientIdObservers.get(s);return a||(a=new Set),a.add(e),n._clientIdObservers.set(s,a),J(n,void 0,void 0,(function(){var n,i,a,c;return H(this,(function(u){switch(u.label){case 0:return void 0!==(n=t.url)?[3,2]:[4,this.endpoint];case 1:return a=u.sent(),[3,3];case 2:a=n,u.label=3;case 3:i=a,u.label=4;case 4:return u.trys.push([4,6,,7]),[4,this.connect(s,{url:i})];case 5:return o=u.sent(),r.forEach((function(e){o.subscribe(e)})),[3,7];case 6:return c=u.sent(),e.error(c),[3,7];case 7:return[2]}}))})),function(){var t,i;return $.debug("Unsubscribing from topic(s)",r.join(",")),o&&(null===(t=n._clientIdObservers.get(s))||void 0===t||t.delete(e),0===(null===(i=n._clientIdObservers.get(s))||void 0===i?void 0:i.size)&&(n.connectionStateMonitor.record(q.CLOSING_CONNECTION),n.disconnect(s),n._clientIdObservers.delete(s)),r.forEach((function(t){var r=n._topicObservers.get(t)||new Set;r.delete(e),0===r.size&&(n._topicObservers.delete(t),o.isConnected()&&o.unsubscribe(t))}))),null}}))},t}(x),ne=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)}}(),re=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},oe=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}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,a])}}},ie=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},se=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.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 s},ae=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(se(arguments[t]));return e},ce=new a.ConsoleLogger("AWSAppSyncProvider"),ue=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._topicClient=new Map,t._topicAlias=new Map,t}return ne(t,e),Object.defineProperty(t.prototype,"endpoint",{get:function(){throw new Error("Not supported")},enumerable:!0,configurable:!0}),t.prototype.getProviderName=function(){return"AWSAppSyncProvider"},t.prototype.publish=function(e,t,n){return re(this,void 0,void 0,(function(){return oe(this,(function(e){throw new Error("Operation not supported")}))}))},t.prototype._cleanUp=function(e){var t=this;Array.from(this._topicClient.entries()).filter((function(t){return se(t,2)[1].clientId===e})).map((function(e){return se(e,1)[0]})).forEach((function(e){return t._cleanUpForTopic(e)}))},t.prototype._cleanUpForTopic=function(e){this._topicClient.delete(e),this._topicAlias.delete(e)},t.prototype.onDisconnect=function(e){var t=this,n=e.clientId,r=e.errorCode,o=ie(e,["clientId","errorCode"]);0!==r&&(Array.from(this._topicClient.entries()).filter((function(e){return se(e,2)[1].clientId===n})).map((function(e){return se(e,1)[0]})).forEach((function(e){t._topicObservers.has(e)&&(t._topicObservers.get(e).forEach((function(e){e.closed||e.error(o)})),t._topicObservers.delete(e))})),this._cleanUp(n))},t.prototype.disconnect=function(t){return re(this,void 0,void 0,(function(){return oe(this,(function(n){switch(n.label){case 0:return[4,this.clientsQueue.get(t,(function(){return null}))];case 1:return n.sent(),[4,e.prototype.disconnect.call(this,t)];case 2:return n.sent(),this._cleanUp(t),[2]}}))}))},t.prototype.subscribe=function(e,t){var n=this;void 0===t&&(t={});var r=new N((function(r){var o=[].concat(e);return ce.debug("Subscribing to topic(s)",o.join(",")),re(n,void 0,void 0,(function(){var e,n,i,s,a,c=this;return oe(this,(function(u){switch(u.label){case 0:return o.forEach((function(e){c._topicObservers.has(e)||c._topicObservers.set(e,new Set),c._topicObservers.get(e).add(r)})),e=t.mqttConnections,n=void 0===e?[]:e,i=t.newSubscriptions,s=Object.entries(i).map((function(e){var t=se(e,2),n=t[0];return[t[1].topic,n]})),this._topicAlias=new Map(ae(Array.from(this._topicAlias.entries()),s)),a=Object.entries(o.reduce((function(e,t){var r=n.find((function(e){return e.topics.indexOf(t)>-1}));if(r){var o=r.client,i=r.url;e[o]||(e[o]={url:i,topics:new Set}),e[o].topics.add(t)}return e}),{})),[4,Promise.all(a.map((function(e){var t=se(e,2),n=t[0],o=t[1],i=o.url,s=o.topics;return re(c,void 0,void 0,(function(){var e,t,o=this;return oe(this,(function(a){switch(a.label){case 0:e=null,a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.connect(n,{clientId:n,url:i})];case 2:return e=a.sent(),[3,4];case 3:return t=a.sent(),r.error({message:"Failed to connect",error:t}),r.complete(),[2,void 0];case 4:return s.forEach((function(t){e.isConnected()&&(e.subscribe(t),o._topicClient.set(t,e))})),[2,e]}}))}))})))];case 1:return u.sent(),[2]}}))})),function(){ce.debug("Unsubscribing from topic(s)",o.join(",")),o.forEach((function(e){var t=n._topicClient.get(e);t&&t.isConnected()&&(t.unsubscribe(e),n._topicClient.delete(e),Array.from(n._topicClient.values()).some((function(e){return e===t}))||n.disconnect(t.clientId)),n._topicObservers.delete(e)}))}}));return N.from(r).map((function(e){var t=n.getTopicForValue(e),r=n._topicAlias.get(t);return e.data=Object.entries(e.data).reduce((function(e,t){var n=se(t,2),o=n[0],i=n[1];return e[r||o]=i,e}),{}),e}))},t}(te),le=n(11),fe=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)}}(),he=function(){return(he=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)},pe=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},de=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}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,a])}}},ye=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.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 s},ge=new a.Logger("AWSAppSyncRealTimeProvider"),ve=function(e,t,n){a.Hub.dispatch("api",{event:e,data:t,message:n},"PubSub",G)},be=/^https:\/\/\w{26}\.appsync\-api\.\w{2}(?:(?:\-\w{2,})+)\-\d\.amazonaws.com\/graphql$/i,_e=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,t)||this;return n.socketStatus=j.CLOSED,n.keepAliveTimeout=3e5,n.subscriptionObserverMap=new Map,n.promiseArray=[],n.connectionStateMonitor=new B,n.connectionStateMonitor.connectionStateObservable.subscribe((function(e){ve("ConnectionStateChange",{provider:n,connectionState:e},"Connection state is "+e)})),n}return fe(t,e),t.prototype.getNewWebSocket=function(e,t){return new WebSocket(e,t)},t.prototype.getProviderName=function(){return"AWSAppSyncRealTimeProvider"},t.prototype.newClient=function(){throw new Error("Not used here")},t.prototype.publish=function(e,t,n){return pe(this,void 0,void 0,(function(){return de(this,(function(e){throw new Error("Operation not supported")}))}))},t.prototype.isCustomDomain=function(e){return null===e.match(be)},t.prototype.subscribe=function(e,t){var n=this,r=null==t?void 0:t.appSyncGraphqlEndpoint;return new N((function(e){if(t&&r){var o=Object(R.v4)();return n._startSubscriptionWithAWSAppSyncRealTime({options:t,observer:e,subscriptionId:o}).catch((function(t){e.error({errors:[he({},new I.GraphQLError(O.REALTIME_SUBSCRIPTION_INIT_ERROR+": "+t))]}),n.connectionStateMonitor.record(q.CLOSED),e.complete()})),function(){return pe(n,void 0,void 0,(function(){var e,t;return de(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,3,4]),[4,this._waitForSubscriptionToBeConnected(o)];case 1:if(n.sent(),!(e=(this.subscriptionObserverMap.get(o)||{}).subscriptionState))return[2];if(e!==U.CONNECTED)throw new Error("Subscription never connected");return this._sendUnsubscriptionMessage(o),[3,4];case 2:return t=n.sent(),ge.debug("Error while unsubscribing "+t),[3,4];case 3:return this._removeSubscriptionObserver(o),[7];case 4:return[2]}}))}))}}e.error({errors:[he({},new I.GraphQLError("Subscribe only available for AWS AppSync endpoint"))]}),e.complete()}))},Object.defineProperty(t.prototype,"isSSLEnabled",{get:function(){return!this.options.aws_appsync_dangerously_connect_to_http_endpoint_for_testing},enumerable:!0,configurable:!0}),t.prototype._startSubscriptionWithAWSAppSyncRealTime=function(e){var t,n,r=e.options,o=e.observer,i=e.subscriptionId;return pe(this,void 0,void 0,(function(){var e,s,c,u,l,f,h,p,d,y,g,v,b,_,m,w,E,S,A,T,C,N,k,R,P,M=this;return de(this,(function(x){switch(x.label){case 0:return e=r.appSyncGraphqlEndpoint,s=r.authenticationType,c=r.query,u=r.variables,l=r.apiKey,f=r.region,h=r.graphql_headers,p=void 0===h?function(){return{}}:h,d=r.additionalHeaders,y=void 0===d?{}:d,g=U.PENDING,v={query:c,variables:u},this.subscriptionObserverMap.set(i,{observer:o,query:null!=c?c:"",variables:null!=u?u:{},subscriptionState:g,startAckTimeoutId:void 0}),b=JSON.stringify(v),m=[{}],[4,this._awsRealTimeHeaderBasedAuth({apiKey:l,appSyncGraphqlEndpoint:e,authenticationType:s,payload:b,canonicalUri:"",region:f,additionalHeaders:y})];case 1:return w=[he.apply(void 0,m.concat([x.sent()]))],[4,p()];case 2:_=he.apply(void 0,[he.apply(void 0,[he.apply(void 0,w.concat([x.sent()])),y]),(P={},P[a.USER_AGENT_HEADER]=a.Constants.userAgent,P)]),E={id:i,payload:{data:b,extensions:{authorization:he({},_)}},type:L.GQL_START},S=JSON.stringify(E),x.label=3;case 3:return x.trys.push([3,5,,6]),this.connectionStateMonitor.record(q.OPENING_CONNECTION),[4,this._initializeWebSocketConnection({apiKey:l,appSyncGraphqlEndpoint:e,authenticationType:s,region:f,additionalHeaders:y})];case 4:return x.sent(),[3,6];case 5:return A=x.sent(),ge.debug({err:A}),T=null!==(t=A.message)&&void 0!==t?t:"",this.connectionStateMonitor.record(q.CLOSED),o.error({errors:[he({},new I.GraphQLError(O.CONNECTION_FAILED+": "+T))]}),o.complete(),"function"==typeof(C=(this.subscriptionObserverMap.get(i)||{}).subscriptionFailedCallback)&&C(),[2];case 6:return N=null!==(n=this.subscriptionObserverMap.get(i))&&void 0!==n?n:{},k=N.subscriptionFailedCallback,R=N.subscriptionReadyCallback,this.subscriptionObserverMap.set(i,{observer:o,subscriptionState:g,query:null!=c?c:"",variables:null!=u?u:{},subscriptionReadyCallback:R,subscriptionFailedCallback:k,startAckTimeoutId:setTimeout((function(){M._timeoutStartSubscriptionAck.call(M,i)}),15e3)}),this.awsRealTimeSocket&&this.awsRealTimeSocket.send(S),[2]}}))}))},t.prototype._waitForSubscriptionToBeConnected=function(e){return pe(this,void 0,void 0,(function(){var t,n=this;return de(this,(function(r){return(t=this.subscriptionObserverMap.get(e))&&t.subscriptionState===U.PENDING?[2,new Promise((function(r,o){var i=t.observer,s=t.subscriptionState,a=t.variables,c=t.query;n.subscriptionObserverMap.set(e,{observer:i,subscriptionState:s,variables:a,query:c,subscriptionReadyCallback:r,subscriptionFailedCallback:o})}))]:[2]}))}))},t.prototype._sendUnsubscriptionMessage=function(e){try{if(this.awsRealTimeSocket&&this.awsRealTimeSocket.readyState===WebSocket.OPEN&&this.socketStatus===j.READY){var t={id:e,type:L.GQL_STOP},n=JSON.stringify(t);this.awsRealTimeSocket.send(n)}}catch(e){ge.debug({err:e})}},t.prototype._removeSubscriptionObserver=function(e){this.subscriptionObserverMap.delete(e),setTimeout(this._closeSocketIfRequired.bind(this),1e3)},t.prototype._closeSocketIfRequired=function(){if(!(this.subscriptionObserverMap.size>0))if(this.awsRealTimeSocket)if(this.connectionStateMonitor.record(q.CLOSING_CONNECTION),this.awsRealTimeSocket.bufferedAmount>0)setTimeout(this._closeSocketIfRequired.bind(this),1e3);else{ge.debug("closing WebSocket..."),this.keepAliveTimeoutId&&clearTimeout(this.keepAliveTimeoutId),this.keepAliveAlertTimeoutId&&clearTimeout(this.keepAliveAlertTimeoutId);var e=this.awsRealTimeSocket;e.onclose=null,e.onerror=null,e.close(1e3),this.awsRealTimeSocket=void 0,this.socketStatus=j.CLOSED,this.connectionStateMonitor.record(q.CLOSED)}else this.socketStatus=j.CLOSED},t.prototype._handleIncomingSubscriptionMessage=function(e){var t=this;ge.debug("subscription message from AWS AppSync RealTime: "+e.data);var n=JSON.parse(e.data),r=n.id,o=void 0===r?"":r,i=n.payload,s=n.type,a=this.subscriptionObserverMap.get(o)||{},c=a.observer,u=void 0===c?null:c,l=a.query,f=void 0===l?"":l,h=a.variables,p=void 0===h?{}:h,d=a.startAckTimeoutId,y=a.subscriptionReadyCallback,g=a.subscriptionFailedCallback;if(ge.debug({id:o,observer:u,query:f,variables:p}),s===L.GQL_DATA&&i&&i.data)u?u.next(i):ge.debug("observer not found for id: "+o);else{if(s===L.GQL_START_ACK){ge.debug("subscription ready for "+JSON.stringify({query:f,variables:p})),"function"==typeof y&&y(),d&&clearTimeout(d),ve(O.SUBSCRIPTION_ACK,{query:f,variables:p},"Connection established for subscription");var v=U.CONNECTED;return u&&this.subscriptionObserverMap.set(o,{observer:u,query:f,variables:p,startAckTimeoutId:void 0,subscriptionState:v,subscriptionReadyCallback:y,subscriptionFailedCallback:g}),void this.connectionStateMonitor.record(q.CONNECTION_ESTABLISHED)}if(s===L.GQL_CONNECTION_KEEP_ALIVE)return this.keepAliveTimeoutId&&clearTimeout(this.keepAliveTimeoutId),this.keepAliveAlertTimeoutId&&clearTimeout(this.keepAliveAlertTimeoutId),this.keepAliveTimeoutId=setTimeout((function(){return t._errorDisconnect(O.TIMEOUT_DISCONNECT)}),this.keepAliveTimeout),this.keepAliveAlertTimeoutId=setTimeout((function(){t.connectionStateMonitor.record(q.KEEP_ALIVE_MISSED)}),65e3),void this.connectionStateMonitor.record(q.KEEP_ALIVE);if(s===L.GQL_ERROR){v=U.FAILED;u&&(this.subscriptionObserverMap.set(o,{observer:u,query:f,variables:p,startAckTimeoutId:d,subscriptionReadyCallback:y,subscriptionFailedCallback:g,subscriptionState:v}),u.error({errors:[he({},new I.GraphQLError(O.CONNECTION_FAILED+": "+JSON.stringify(i)))]}),d&&clearTimeout(d),u.complete(),"function"==typeof g&&g())}}},t.prototype._errorDisconnect=function(e){ge.debug("Disconnect error: "+e),this.subscriptionObserverMap.forEach((function(t){var n=t.observer;n&&!n.closed&&n.error({errors:[he({},new I.GraphQLError(e))]})})),this.subscriptionObserverMap.clear(),this.awsRealTimeSocket&&(this.connectionStateMonitor.record(q.CLOSED),this.awsRealTimeSocket.close()),this.socketStatus=j.CLOSED},t.prototype._timeoutStartSubscriptionAck=function(e){var t=this.subscriptionObserverMap.get(e);if(t){var n=t.observer,r=t.query,o=t.variables;if(!n)return;this.subscriptionObserverMap.set(e,{observer:n,query:r,variables:o,subscriptionState:U.FAILED}),n&&!n.closed&&(n.error({errors:[he({},new I.GraphQLError("Subscription timeout "+JSON.stringify({query:r,variables:o})))]}),n.complete()),ge.debug("timeoutStartSubscription",JSON.stringify({query:r,variables:o}))}},t.prototype._initializeWebSocketConnection=function(e){var t=this,n=e.appSyncGraphqlEndpoint,r=e.authenticationType,o=e.apiKey,i=e.region,s=e.additionalHeaders;if(this.socketStatus!==j.READY)return new Promise((function(e,a){return pe(t,void 0,void 0,(function(){var t,c,u,l,f,h,p,d,y,g;return de(this,(function(v){switch(v.label){case 0:if(this.promiseArray.push({res:e,rej:a}),this.socketStatus!==j.CLOSED)return[3,5];v.label=1;case 1:return v.trys.push([1,4,,5]),this.socketStatus=j.CONNECTING,t="{}",l=(u=JSON).stringify,[4,this._awsRealTimeHeaderBasedAuth({authenticationType:r,payload:t,canonicalUri:"/connect",apiKey:o,appSyncGraphqlEndpoint:n,region:i,additionalHeaders:s})];case 2:return c=l.apply(u,[v.sent()]),f=le.Buffer.from(c).toString("base64"),h=le.Buffer.from(t).toString("base64"),p=null!=n?n:"",p=this.isCustomDomain(p)?p.concat("/realtime"):p.replace("appsync-api","appsync-realtime-api").replace("gogi-beta","grt-beta"),d=this.isSSLEnabled?"wss://":"ws://",p=p.replace("https://",d).replace("http://",d),y=p+"?header="+f+"&payload="+h,[4,this._initializeRetryableHandshake(y)];case 3:return v.sent(),this.promiseArray.forEach((function(e){var t=e.res;ge.debug("Notifying connection successful"),t()})),this.socketStatus=j.READY,this.promiseArray=[],[3,5];case 4:return g=v.sent(),this.promiseArray.forEach((function(e){return(0,e.rej)(g)})),this.promiseArray=[],this.awsRealTimeSocket&&this.awsRealTimeSocket.readyState===WebSocket.OPEN&&this.awsRealTimeSocket.close(3001),this.awsRealTimeSocket=void 0,this.socketStatus=j.CLOSED,[3,5];case 5:return[2]}}))}))}))},t.prototype._initializeRetryableHandshake=function(e){return pe(this,void 0,void 0,(function(){return de(this,(function(t){switch(t.label){case 0:return ge.debug("Initializaling retryable Handshake"),[4,Object(a.jitteredExponentialRetry)(this._initializeHandshake.bind(this),[e],5e3)];case 1:return t.sent(),[2]}}))}))},t.prototype._initializeHandshake=function(e){return pe(this,void 0,void 0,(function(){var t,n,r,o,i=this;return de(this,(function(s){switch(s.label){case 0:ge.debug("Initializing handshake "+e),s.label=1;case 1:return s.trys.push([1,4,,5]),[4,new Promise((function(t,n){var r=i.getNewWebSocket(e,"graphql-ws");r.onerror=function(){ge.debug("WebSocket connection error")},r.onclose=function(){i.connectionStateMonitor.record(q.CONNECTION_FAILED),n(new Error("Connection handshake error"))},r.onopen=function(){return i.awsRealTimeSocket=r,t()}}))];case 2:return s.sent(),[4,new Promise((function(e,t){if(i.awsRealTimeSocket){var n=!1;i.awsRealTimeSocket.onerror=function(e){ge.debug("WebSocket error "+JSON.stringify(e))},i.awsRealTimeSocket.onclose=function(e){ge.debug("WebSocket closed "+e.reason),t(new Error(JSON.stringify(e)))},i.awsRealTimeSocket.onmessage=function(r){ge.debug("subscription message from AWS AppSyncRealTime: "+r.data+" ");var o=JSON.parse(r.data),s=o.type,a=o.payload,c=(void 0===a?{}:a).connectionTimeoutMs,u=void 0===c?3e5:c;if(s===L.GQL_CONNECTION_ACK)return n=!0,i.awsRealTimeSocket&&(i.keepAliveTimeout=u,i.awsRealTimeSocket.onmessage=i._handleIncomingSubscriptionMessage.bind(i),i.awsRealTimeSocket.onerror=function(e){ge.debug(e),i._errorDisconnect(O.CONNECTION_CLOSED)},i.awsRealTimeSocket.onclose=function(e){ge.debug("WebSocket closed "+e.reason),i._errorDisconnect(O.CONNECTION_CLOSED)}),void e("Cool, connected to AWS AppSyncRealTime");if(s===L.GQL_CONNECTION_ERROR){var l=o.payload,f=(void 0===l?{}:l).errors,h=ye(void 0===f?[]:f,1)[0],p=void 0===h?{}:h,d=p.errorType,y=void 0===d?"":d,g=p.errorCode;t({errorType:y,errorCode:void 0===g?0:g})}};var r={type:L.GQL_CONNECTION_INIT};i.awsRealTimeSocket.send(JSON.stringify(r)),setTimeout((function(){n||(i.connectionStateMonitor.record(q.CONNECTION_FAILED),t(new Error("Connection timeout: ack from AWSAppSyncRealTime was not received after 15000 ms")))}),15e3)}}))];case 3:return s.sent(),[3,5];case 4:throw t=s.sent(),r=(n=t).errorType,o=n.errorCode,F.includes(o)?new a.NonRetryableError(r):r?new Error(r):t;case 5:return[2]}}))}))},t.prototype._awsRealTimeHeaderBasedAuth=function(e){var t=e.authenticationType,n=e.payload,r=e.canonicalUri,o=e.appSyncGraphqlEndpoint,i=e.apiKey,s=e.region,a=e.additionalHeaders;return pe(this,void 0,void 0,(function(){var e,c,u;return de(this,(function(f){switch(f.label){case 0:return e={API_KEY:this._awsRealTimeApiKeyHeader.bind(this),AWS_IAM:this._awsRealTimeIAMHeader.bind(this),OPENID_CONNECT:this._awsRealTimeOPENIDHeader.bind(this),AMAZON_COGNITO_USER_POOLS:this._awsRealTimeCUPHeader.bind(this),AWS_LAMBDA:this._customAuthHeader},t&&e[t]?[3,1]:(ge.debug("Authentication type "+t+" not supported"),[2,""]);case 1:return c=e[t],u=l.parse(null!=o?o:"").host,ge.debug("Authenticating with "+t),[4,c({payload:n,canonicalUri:r,appSyncGraphqlEndpoint:o,apiKey:i,region:s,host:u,additionalHeaders:a})];case 2:return[2,f.sent()]}}))}))},t.prototype._awsRealTimeCUPHeader=function(e){var t=e.host;return pe(this,void 0,void 0,(function(){return de(this,(function(e){switch(e.label){case 0:return[4,o.a.currentSession()];case 1:return[2,{Authorization:e.sent().getAccessToken().getJwtToken(),host:t}]}}))}))},t.prototype._awsRealTimeOPENIDHeader=function(e){var t=e.host;return pe(this,void 0,void 0,(function(){var e,n,r;return de(this,(function(i){switch(i.label){case 0:return[4,s.a.getItem("federatedInfo")];case 1:return(n=i.sent())?(e=n.token,[3,4]):[3,2];case 2:return[4,o.a.currentAuthenticatedUser()];case 3:(r=i.sent())&&(e=r.token),i.label=4;case 4:if(!e)throw new Error("No federated jwt");return[2,{Authorization:e,host:t}]}}))}))},t.prototype._awsRealTimeApiKeyHeader=function(e){var t=e.apiKey,n=e.host;return pe(this,void 0,void 0,(function(){var e,r;return de(this,(function(o){return e=new Date,r=e.toISOString().replace(/[:\-]|\.\d{3}/g,""),[2,{host:n,"x-amz-date":r,"x-api-key":t}]}))}))},t.prototype._awsRealTimeIAMHeader=function(e){var t=e.payload,n=e.canonicalUri,r=e.appSyncGraphqlEndpoint,o=e.region;return pe(this,void 0,void 0,(function(){var e,i,s;return de(this,(function(c){switch(c.label){case 0:return e={region:o,service:"appsync"},[4,this._ensureCredentials()];case 1:if(!c.sent())throw new Error("No credentials");return[4,a.Credentials.get().then((function(e){var t=e;return{secret_key:t.secretAccessKey,access_key:t.accessKeyId,session_token:t.sessionToken}}))];case 2:return i=c.sent(),s={url:""+r+n,data:t,method:"POST",headers:he({},V)},[2,a.Signer.sign(s,i,e).headers]}}))}))},t.prototype._customAuthHeader=function(e){var t=e.host,n=e.additionalHeaders;if(!n||!n.Authorization)throw new Error("No auth token specified");return{Authorization:n.Authorization,host:t}},t.prototype._ensureCredentials=function(){return a.Credentials.get().then((function(e){if(!e)return!1;var t=a.Credentials.shear(e);return ge.debug("set credentials for AWSAppSyncRealTimeProvider",t),!0})).catch((function(e){return ge.warn("ensure credentials error",e),!1}))},t}(x),me=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},we=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}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,a])}}},Ee=Object(a.browserOrNode)().isNode,Se=new a.ConsoleLogger("PubSub"),Oe=new(function(){function e(e){this._options=null!=e?e:{},Se.debug("PubSub Options",this._options),this._pluggables=[],this.subscribe=this.subscribe.bind(this)}return Object.defineProperty(e.prototype,"awsAppSyncProvider",{get:function(){return this._awsAppSyncProvider||(this._awsAppSyncProvider=new ue(this._options)),this._awsAppSyncProvider},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"awsAppSyncRealTimeProvider",{get:function(){return this._awsAppSyncRealTimeProvider||(this._awsAppSyncRealTimeProvider=new _e(this._options)),this._awsAppSyncRealTimeProvider},enumerable:!0,configurable:!0}),e.prototype.getModuleName=function(){return"PubSub"},e.prototype.configure=function(e){var t=this,n=e?e.PubSub||e:{};return Se.debug("configure PubSub",{opt:n}),this._options=Object.assign({},this._options,n),this._pluggables.map((function(e){return e.configure(t._options)})),this._options},e.prototype.addPluggable=function(e){return me(this,void 0,void 0,(function(){return we(this,(function(t){return e&&"PubSub"===e.getCategory()?(this._pluggables.push(e),[2,e.configure(this._options)]):[2]}))}))},e.prototype.removePluggable=function(e){this._pluggables=this._pluggables.filter((function(t){return t.getProviderName()!==e}))},e.prototype.getProviderByName=function(e){return e===a.INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER?this.awsAppSyncProvider:e===a.INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER?this.awsAppSyncRealTimeProvider:this._pluggables.find((function(t){return t.getProviderName()===e}))},e.prototype.getProviders=function(e){void 0===e&&(e={});var t=e.provider;if(!t)return this._pluggables;var n=this.getProviderByName(t);if(!n)throw new Error("Could not find provider named "+t);return[n]},e.prototype.publish=function(e,t,n){return me(this,void 0,void 0,(function(){return we(this,(function(r){return[2,Promise.all(this.getProviders(n).map((function(r){return r.publish(e,t,n)})))]}))}))},e.prototype.subscribe=function(e,t){if(Ee&&this._options&&this._options.ssr)throw new Error("Subscriptions are not supported for Server-Side Rendering (SSR)");Se.debug("subscribe options",t);var n=this.getProviders(t);return new N((function(r){var o=n.map((function(n){return{provider:n,observable:n.subscribe(e,t)}})).map((function(e){var t=e.provider;return e.observable.subscribe({start:console.error,next:function(e){return r.next({provider:t,value:e})},error:function(e){return r.error({provider:t,error:e})}})}));return function(){return o.forEach((function(e){return e.unsubscribe()}))}}))},e}());a.Amplify.register(Oe),function(e){e.NO_API_KEY="No api-key configured",e.NO_CURRENT_USER="No current user",e.NO_CREDENTIALS="No credentials",e.NO_FEDERATED_JWT="No federated jwt",e.NO_AUTH_TOKEN="No auth token specified"}(X||(X={}));var Ae=function(){return(Ae=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)},Te=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},Ie=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}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,a])}}},Ce=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},Ne=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.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 s},ke=new a.ConsoleLogger("GraphQLAPI"),Re=function(e,t,n,r){return void 0===t&&(t={}),{query:e,variables:t,authToken:n,userAgentSuffix:r}},Pe=function(){function e(e){this._api=null,this.Auth=o.a,this.Cache=s.a,this.Credentials=a.Credentials,this._options=e,ke.debug("API Options",this._options)}return e.prototype.getModuleName=function(){return"GraphQLAPI"},e.prototype.configure=function(e){var t=e||{},n=t.API,r=void 0===n?{}:n,o=Ce(t,["API"]),i=Ae(Ae({},o),r);return ke.debug("configure GraphQL API",{opt:i}),i.aws_project_region&&(i=Object.assign({},i,{region:i.aws_project_region,header:{}})),void 0!==i.graphql_headers&&"function"!=typeof i.graphql_headers&&(ke.warn("graphql_headers should be a function"),i.graphql_headers=void 0),this._options=Object.assign({},this._options,i),this.createInstance(),this._options},e.prototype.createInstance=function(){return ke.debug("create Rest instance"),this._options?(this._api=new g(this._options),this._api.Credentials=this.Credentials,!0):Promise.reject("API not configured")},e.prototype._headerBasedAuth=function(e,t){return void 0===t&&(t={}),Te(this,void 0,void 0,(function(){var n,r,i,a,c,u,l,f;return Ie(this,(function(h){switch(h.label){case 0:switch(n=this._options,r=n.aws_appsync_authenticationType,i=n.aws_appsync_apiKey,a={},e||r||"AWS_IAM"){case"API_KEY":return[3,1];case"AWS_IAM":return[3,2];case"OPENID_CONNECT":return[3,4];case"AMAZON_COGNITO_USER_POOLS":return[3,11];case"AWS_LAMBDA":return[3,15]}return[3,16];case 1:if(!i)throw new Error(X.NO_API_KEY);return a={Authorization:null,"X-Api-Key":i},[3,17];case 2:return[4,this._ensureCredentials()];case 3:if(!h.sent())throw new Error(X.NO_CREDENTIALS);return[3,17];case 4:return h.trys.push([4,9,,10]),c=void 0,[4,s.a.getItem("federatedInfo")];case 5:return(u=h.sent())?(c=u.token,[3,8]):[3,6];case 6:return[4,o.a.currentAuthenticatedUser()];case 7:(l=h.sent())&&(c=l.token),h.label=8;case 8:if(!c)throw new Error(X.NO_FEDERATED_JWT);return a={Authorization:c},[3,10];case 9:throw h.sent(),new Error(X.NO_CURRENT_USER);case 10:return[3,17];case 11:return h.trys.push([11,13,,14]),[4,this.Auth.currentSession()];case 12:return f=h.sent(),a={Authorization:f.getAccessToken().getJwtToken()},[3,14];case 13:throw h.sent(),new Error(X.NO_CURRENT_USER);case 14:return[3,17];case 15:if(!t.Authorization)throw new Error(X.NO_AUTH_TOKEN);return a={Authorization:t.Authorization},[3,17];case 16:return a={Authorization:null},[3,17];case 17:return[2,a]}}))}))},e.prototype.getGraphqlOperationType=function(e){var t=Object(I.parse)(e).definitions;return Ne(t,1)[0].operation},e.prototype.graphql=function(e,t){var n=e.query,r=e.variables,o=void 0===r?{}:r,i=e.authMode,s=e.authToken,a=e.userAgentSuffix,c="string"==typeof n?Object(I.parse)(n):Object(I.parse)(Object(I.print)(n)),u=Ne(c.definitions.filter((function(e){return"OperationDefinition"===e.kind})),1)[0],l=(void 0===u?{}:u).operation,f=t||{};switch(s&&(f.Authorization=s),l){case"query":case"mutation":this.createInstanceIfNotCreated();var h=this._api.getCancellableToken(),p={cancellableToken:h},d=this._graphql({query:c,variables:o,authMode:i,userAgentSuffix:a},f,p);return this._api.updateRequestToBeCancellable(d,h),d;case"subscription":return this._graphqlSubscribe({query:c,variables:o,authMode:i},f);default:throw new Error("invalid operation type: "+l)}},e.prototype._graphql=function(e,t,n){var r=e.query,o=e.variables,i=e.authMode,s=e.userAgentSuffix;return void 0===t&&(t={}),void 0===n&&(n={}),Te(this,void 0,void 0,(function(){var e,c,u,l,f,h,p,d,y,g,v,b,_,m,w,E,S,O,A,T,C;return Ie(this,(function(N){switch(N.label){case 0:return this.createInstanceIfNotCreated(),e=this._options,c=e.aws_appsync_region,u=e.aws_appsync_graphqlEndpoint,l=e.graphql_headers,f=void 0===l?function(){return{}}:l,h=e.graphql_endpoint,p=e.graphql_endpoint_iam_region,y=[{}],(g=!h)?[4,this._headerBasedAuth(i,t)]:[3,2];case 1:g=N.sent(),N.label=2;case 2:return v=[Ae.apply(void 0,y.concat([g]))],(b=h)?p?[4,this._headerBasedAuth(i,t)]:[3,4]:[3,6];case 3:return _=N.sent(),[3,5];case 4:_={Authorization:null},N.label=5;case 5:b=_,N.label=6;case 6:return m=[Ae.apply(void 0,v.concat([b]))],[4,f({query:r,variables:o})];case 7:if(d=Ae.apply(void 0,[Ae.apply(void 0,[Ae.apply(void 0,m.concat([N.sent()])),t]),!h&&(C={},C["x-amz-user-agent"]=Object(a.getAmplifyUserAgent)(s),C)]),w={query:Object(I.print)(r),variables:o},E=Object.assign({headers:d,body:w,signerServiceInfo:{service:h?"execute-api":"appsync",region:h?p:c}},n),!(S=h||u))throw{data:{},errors:[new I.GraphQLError("No graphql endpoint provided.")]};N.label=8;case 8:return N.trys.push([8,10,,11]),[4,this._api.post(S,E)];case 9:return O=N.sent(),[3,11];case 10:if(A=N.sent(),this._api.isCancel(A))throw A;return O={data:{},errors:[new I.GraphQLError(A.message,null,null,null,null,A)]},[3,11];case 11:if((T=O.errors)&&T.length)throw O;return[2,O]}}))}))},e.prototype.createInstanceIfNotCreated=function(){return Te(this,void 0,void 0,(function(){return Ie(this,(function(e){switch(e.label){case 0:return this._api?[3,2]:[4,this.createInstance()];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.prototype.isCancel=function(e){return this._api.isCancel(e)},e.prototype.cancel=function(e,t){return this._api.cancel(e,t)},e.prototype.hasCancelToken=function(e){return this._api.hasCancelToken(e)},e.prototype._graphqlSubscribe=function(e,t){var n=e.query,r=e.variables,o=e.authMode,i=e.authToken;void 0===t&&(t={});var s=this._options,c=s.aws_appsync_region,u=s.aws_appsync_graphqlEndpoint,l=s.aws_appsync_authenticationType,f=s.aws_appsync_apiKey,h=s.graphql_headers,p=void 0===h?function(){return{}}:h,d=o||l||"AWS_IAM";if(Oe&&"function"==typeof Oe.subscribe)return Oe.subscribe("",{provider:a.INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER,appSyncGraphqlEndpoint:u,authenticationType:d,apiKey:f,query:Object(I.print)(n),region:c,variables:r,graphql_headers:p,additionalHeaders:t,authToken:i});throw ke.debug("No pubsub module applied for subscription"),new Error("No pubsub module applied for subscription")},e.prototype._ensureCredentials=function(){var e=this;return this.Credentials.get().then((function(t){if(!t)return!1;var n=e.Credentials.shear(t);return ke.debug("set credentials for api",n),!0})).catch((function(e){return ke.warn("ensure credentials error",e),!1}))},e}(),Me=new Pe(null);a.Amplify.register(Me);var xe=function(){return(xe=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)},Le=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},Ue=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}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,a])}}},je=new a.ConsoleLogger("API"),De=function(){function e(e){this.Auth=r.Auth,this.Cache=s.a,this.Credentials=a.Credentials,this._options=e,this._restApi=new E(e),this._graphqlApi=new Pe(e),je.debug("API Options",this._options)}return e.prototype.getModuleName=function(){return"API"},e.prototype.configure=function(e){this._options=Object.assign({},this._options,e),this._restApi.Credentials=this.Credentials,this._graphqlApi.Auth=this.Auth,this._graphqlApi.Cache=this.Cache,this._graphqlApi.Credentials=this.Credentials;var t=this._restApi.configure(this._options),n=this._graphqlApi.configure(this._options);return xe(xe({},t),n)},e.prototype.get=function(e,t,n){return this._restApi.get(e,t,n)},e.prototype.post=function(e,t,n){return this._restApi.post(e,t,n)},e.prototype.put=function(e,t,n){return this._restApi.put(e,t,n)},e.prototype.patch=function(e,t,n){return this._restApi.patch(e,t,n)},e.prototype.del=function(e,t,n){return this._restApi.del(e,t,n)},e.prototype.head=function(e,t,n){return this._restApi.head(e,t,n)},e.prototype.isCancel=function(e){return this._restApi.isCancel(e)},e.prototype.cancel=function(e,t){return this._restApi.hasCancelToken(e)?this._restApi.cancel(e,t):!!this._graphqlApi.hasCancelToken(e)&&this._graphqlApi.cancel(e,t)},e.prototype.endpoint=function(e){return Le(this,void 0,void 0,(function(){return Ue(this,(function(t){return[2,this._restApi.endpoint(e)]}))}))},e.prototype.getGraphqlOperationType=function(e){return this._graphqlApi.getGraphqlOperationType(e)},e.prototype.graphql=function(e,t){return this._graphqlApi.graphql(e,t)},e}(),qe=new De(null);a.Amplify.register(qe);t.default=qe}])}));
|
|
11
|
+
//# sourceMappingURL=aws-amplify-api.min.js.map
|