{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///amazon-cognito-identity.min.js","webpack:///webpack/bootstrap a48aa96e8112c5b148ef","webpack:///./enhance.js","webpack:///external {\"root\":[\"AWSCognito\"],\"commonjs2\":\"aws-sdk/global\",\"commonjs\":\"aws-sdk/global\",\"amd\":\"aws-sdk/global\"}","webpack:///./src/AuthenticationHelper.js","webpack:///./src/BigInteger.js","webpack:///./src/CognitoAccessToken.js","webpack:///./src/CognitoIdToken.js","webpack:///./src/CognitoJwtToken.js","webpack:///./src/CognitoRefreshToken.js","webpack:///./src/CognitoUser.js","webpack:///./src/CognitoUserAttribute.js","webpack:///./src/CognitoUserSession.js","webpack:///./src/DateHelper.js","webpack:///./src/StorageHelper.js","webpack:///external {\"root\":[\"AWSCognito\",\"CognitoIdentityServiceProvider\"],\"commonjs2\":\"aws-sdk/clients/cognitoidentityserviceprovider\",\"commonjs\":\"aws-sdk/clients/cognitoidentityserviceprovider\",\"amd\":\"aws-sdk/clients/cognitoidentityserviceprovider\"}","webpack:///./src/AuthenticationDetails.js","webpack:///./src/CognitoUserPool.js","webpack:///./src/CookieStorage.js","webpack:///./src/index.js","webpack:///./~/js-cookie/src/js.cookie.js"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE_1__","__WEBPACK_EXTERNAL_MODULE_13__","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","_interopRequireWildcard","obj","__esModule","newObj","key","Object","prototype","hasOwnProperty","default","_interopRequireDefault","_src","keys","forEach","defineProperty","enumerable","get","_cognitoidentityserviceprovider","_cognitoidentityserviceprovider2","enhancements","_classCallCheck","instance","Constructor","TypeError","_global","_BigInteger","_BigInteger2","initN","newPasswordRequiredChallengeUserAttributePrefix","AuthenticationHelper","PoolName","N","g","k","hexHash","toString","smallAValue","generateRandomSmallA","getLargeAValue","infoBits","util","Buffer","poolName","getSmallAValue","callback","_this","largeAValue","calculateA","err","hexRandom","crypto","lib","randomBytes","randomBigInt","smallABigInt","mod","generateRandomString","getRandomPassword","randomPassword","getSaltDevices","SaltToHashDevices","getVerifierDevices","verifierDevices","generateHashDevice","deviceGroupKey","username","_this2","combinedString","hashedString","hash","padHex","modPow","verifierDevicesNotPadded","a","_this3","A","equals","ZERO","Error","calculateU","B","UHexHash","finalU","buf","hashHex","sha256","Array","length","join","hexStr","computehkdf","ikm","salt","prk","hmac","infoBitsUpdate","buffer","concat","String","fromCharCode","slice","getPasswordAuthenticationKey","password","serverBValue","_this4","UValue","usernamePassword","usernamePasswordHash","xValue","calculateS","sValue","hkdf","_this5","gModPowXN","intValue2","subtract","multiply","add","err2","result","getNewPasswordRequiredChallengeUserAttributePrefix","bigInt","hashStr","indexOf","BigInteger","b","fromString","nbi","am1","i","x","w","j","n","v","Math","floor","am2","xl","xh","l","h","am3","int2char","BI_RM","charAt","intAt","s","BI_RC","charCodeAt","bnpCopyTo","r","t","bnpFromInt","DV","nbv","fromInt","bnpFromString","mi","sh","DB","clamp","subTo","bnpClamp","DM","bnToString","negate","d","km","bnNegate","bnAbs","bnCompareTo","nbits","bnBitLength","bnpDLShiftTo","bnpDRShiftTo","max","bnpLShiftTo","bs","cbs","bm","ds","bnpRShiftTo","bnpSubTo","min","bnpMultiplyTo","abs","y","am","bnpSquareTo","bnpDivRemTo","q","pm","pt","copyTo","ts","ms","nsh","lShiftTo","ys","y0","yt","F1","F2","d1","FV","d2","e","dlShiftTo","compareTo","ONE","qd","drShiftTo","rShiftTo","bnMod","divRemTo","bnpInvDigit","bnEquals","bnpAddTo","bnAdd","addTo","bnSubtract","bnMultiply","multiplyTo","bnDivide","Montgomery","mp","invDigit","mpl","mph","um","mt2","montConvert","montRevert","reduce","montReduce","u0","montSqrTo","squareTo","montMulTo","bnModPow","bitLength","z","k1","convert","g2","sqrTo","mulTo","is1","r2","revert","dbits","canary","j_lm","inBrowser","navigator","appName","BI_FP","pow","rr","vv","divide","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","create","constructor","value","writable","configurable","setPrototypeOf","__proto__","_CognitoJwtToken2","_CognitoJwtToken3","CognitoAccessToken","_CognitoJwtToken","_ref","arguments","undefined","AccessToken","CognitoIdToken","IdToken","CognitoJwtToken","token","jwtToken","payload","decodePayload","getJwtToken","getExpiration","exp","getIssuedAt","iat","split","JSON","parse","base64","decode","CognitoRefreshToken","RefreshToken","getToken","_AuthenticationHelper","_AuthenticationHelper2","_CognitoAccessToken","_CognitoAccessToken2","_CognitoIdToken","_CognitoIdToken2","_CognitoRefreshToken","_CognitoRefreshToken2","_CognitoUserSession","_CognitoUserSession2","_DateHelper","_DateHelper2","_CognitoUserAttribute","_CognitoUserAttribute2","_StorageHelper","_StorageHelper2","CognitoUser","data","Username","Pool","pool","Session","client","signInUserSession","authenticationFlowType","storage","Storage","getStorage","setSignInUserSession","clearCachedTokens","cacheTokens","getSignInUserSession","getUsername","getAuthenticationFlowType","setAuthenticationFlowType","initiateAuth","authDetails","authParameters","getAuthParameters","USERNAME","jsonReq","AuthFlow","ClientId","getClientId","AuthParameters","ClientMetadata","getValidationData","getUserContextData","UserContextData","makeUnauthenticatedRequest","onFailure","challengeName","ChallengeName","challengeParameters","ChallengeParameters","customChallenge","getCognitoUserSession","AuthenticationResult","onSuccess","authenticateUser","authenticationHelper","getUserPoolId","dateHelper","deviceKey","DEVICE_KEY","errOnAValue","aValue","SRP_A","CHALLENGE_NAME","USER_ID_FOR_SRP","SRP_B","SALT","getCachedDeviceKeyAndPassword","getPassword","errOnHkdf","dateNow","getNowString","signatureString","SECRET_BLOCK","challengeResponses","PASSWORD_CLAIM_SECRET_BLOCK","TIMESTAMP","PASSWORD_CLAIM_SIGNATURE","respondToAuthChallenge","challenge","challengeCallback","errChallenge","dataChallenge","code","message","toLowerCase","clearCachedDeviceKeyAndPassword","jsonReqResp","ChallengeResponses","errAuthenticate","dataAuthenticate","userAttributes","rawRequiredAttributes","requiredAttributes","userAttributesPrefix","substr","newPasswordRequired","authenticateUserInternal","mfaRequired","selectMFAType","mfaSetup","totpRequired","getDeviceResponse","newDeviceMetadata","NewDeviceMetadata","DeviceGroupKey","DeviceKey","errGenHash","deviceSecretVerifierConfig","Salt","PasswordVerifier","getAccessToken","DeviceSecretVerifierConfig","DeviceName","userAgent","errConfirm","dataConfirm","cacheDeviceKeyAndPassword","UserConfirmationNecessary","completeNewPasswordChallenge","newPassword","requiredAttributeData","finalUserAttributes","NEW_PASSWORD","errAValue","errHkdf","confirmRegistration","confirmationCode","forceAliasCreation","ConfirmationCode","ForceAliasCreation","sendCustomChallengeAnswer","answerChallenge","_this6","ANSWER","sendMFACode","mfaType","_this7","SMS_MFA_CODE","mfaTypeSelection","SOFTWARE_TOKEN_MFA_CODE","changePassword","oldUserPassword","newUserPassword","isValid","PreviousPassword","ProposedPassword","enableMFA","mfaOptions","mfaEnabled","DeliveryMedium","AttributeName","push","MFAOptions","setUserMfaPreference","smsMfaSettings","softwareTokenMfaSettings","SMSMfaSettings","SoftwareTokenMfaSettings","disableMFA","deleteUser","_this8","updateAttributes","attributes","UserAttributes","getUserAttributes","userData","attributeList","attribute","Name","Value","userAttribute","getMFAOptions","deleteAttributes","UserAttributeNames","resendConfirmationCode","getSession","keyPrefix","idTokenKey","accessTokenKey","refreshTokenKey","clockDriftKey","getItem","idToken","accessToken","refreshToken","clockDrift","parseInt","sessionData","ClockDrift","cachedSession","refreshSession","_this9","REFRESH_TOKEN","lastUserKey","deviceKeyKey","authResult","authenticationResult","setItem","getIdToken","getRefreshToken","getClockDrift","randomPasswordKey","deviceGroupKeyKey","removeItem","forgotPassword","inputVerificationCode","confirmPassword","Password","getAttributeVerificationCode","attributeName","verifyAttribute","Code","getDevice","forgetSpecificDevice","forgetDevice","_this10","setDeviceStatusRemembered","DeviceRememberedStatus","setDeviceStatusNotRemembered","listDevices","limit","paginationToken","Limit","PaginationToken","globalSignOut","_this11","signOut","sendMFASelectionAnswer","_this12","associateSoftwareToken","_this13","associateSecretCode","SecretCode","verifySoftwareToken","totpCode","friendlyDeviceName","_this14","UserCode","FriendlyDeviceName","errRespond","dataRespond","CognitoUserAttribute","getValue","setValue","getName","setName","name","stringify","toJSON","CognitoUserSession","calculateClockDrift","now","Date","adjusted","monthNames","weekNames","DateHelper","weekDay","getUTCDay","month","getUTCMonth","day","getUTCDate","hours","getUTCHours","minutes","getUTCMinutes","seconds","getUTCSeconds","year","getUTCFullYear","dataMemory","MemoryStorage","clear","StorageHelper","storageWindow","window","localStorage","exception","AuthenticationDetails","ValidationData","validationData","_CognitoUser","_CognitoUser2","CognitoUserPool","UserPoolId","endpoint","AdvancedSecurityDataCollectionFlag","test","region","userPoolId","clientId","apiVersion","advancedSecurityDataCollectionFlag","signUp","cognitoUser","returnData","user","userConfirmed","UserConfirmed","userSub","UserSub","getCurrentUser","lastAuthUser","AmazonCognitoAdvancedSecurityData","amazonCognitoAdvancedSecurityDataConst","advancedSecurityData","getData","userContextData","EncodedData","_jsCookie","Cookies","CookieStorage","domain","path","expires","secure","set","remove","cookies","index","_AuthenticationDetails","_CognitoUserPool","_CookieStorage","msCrypto","__WEBPACK_AMD_DEFINE_FACTORY__","__WEBPACK_AMD_DEFINE_RESULT__","registeredInModuleLoader","OldCookies","api","noConflict","extend","init","converter","document","defaults","setMilliseconds","getMilliseconds","toUTCString","write","encodeURIComponent","replace","decodeURIComponent","escape","stringifiedAttributes","cookie","rdecode","parts","json","read","getJSON","apply","withConverter"],"mappings":";;;;;;;;;;;;;;;;CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,kBAAAA,QAAA,mDACA,kBAAAC,gBAAAC,IACAD,QAAA,mEAAAJ,GACA,gBAAAC,SACAA,QAAA,sBAAAD,EAAAG,QAAA,kBAAAA,QAAA,mDAEAJ,EAAA,sBAAAC,EAAAD,EAAA,WAAAA,EAAA,4CACCO,KAAA,SAAAC,EAAAC,GACD,MCkBgB,UAAUC,GCxB1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,G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EAAA,IAAAyQ,EAAA+X,EAKAxoB,IACAkH,KAUA,KAJA,GAAA6f,GAAAe,SAAAW,OAAAX,SAAAW,OAAAvW,MAAA,SACAwW,EAAA,mBACA9gB,EAAA,EAESA,EAAAmf,EAAA7hB,OAAoB0C,IAAA,CAC7B,GAAA+gB,GAAA5B,EAAAnf,GAAAsK,MAAA,KACAuW,EAAAE,EAAA5iB,MAAA,GAAAZ,KAAA,IAEApG,MAAA6pB,MAAA,MAAAH,EAAA7f,OAAA,KACA6f,IAAA1iB,MAAA,MAGA,KACA,GAAAuc,GAAAqG,EAAA,GAAAN,QAAAK,EAAAJ,mBAKA,IAJAG,EAAAZ,EAAAgB,KACAhB,EAAAgB,KAAAJ,EAAAnG,GAAAuF,EAAAY,EAAAnG,IACAmG,EAAAJ,QAAAK,EAAAJ,oBAEAvpB,KAAA6pB,KACA,IACAH,EAAAtW,KAAAC,MAAAqW,GACO,MAAA/b,IAGP,GAAA1M,IAAAsiB,EAAA,CACApb,EAAAuhB,CACA,OAGAzoB,IACAkH,EAAAob,GAAAmG,GAEK,MAAA/b,KAGL,MAAAxF,IAsBA,MAnBAugB,GAAAZ,IAAAY,EACAA,EAAA9mB,IAAA,SAAAX,GACA,MAAAynB,GAAAjoB,KAAAioB,EAAAznB,IAEAynB,EAAAqB,QAAA,WACA,MAAArB,GAAAsB,OACAH,MAAA,MACI7iB,MAAAvG,KAAA2R,aAEJsW,EAAAM,YAEAN,EAAAX,OAAA,SAAA9mB,EAAAkd,GACAuK,EAAAznB,EAAA,GAAA2nB,EAAAzK,GACAyJ,SAAA,MAIAc,EAAAuB,cAAApB,EAEAH,EAGA,MAAAG,GAAA","file":"amazon-cognito-identity.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"aws-sdk/global\"), require(\"aws-sdk/clients/cognitoidentityserviceprovider\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"aws-sdk/global\", \"aws-sdk/clients/cognitoidentityserviceprovider\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"AmazonCognitoIdentity\"] = factory(require(\"aws-sdk/global\"), require(\"aws-sdk/clients/cognitoidentityserviceprovider\"));\n\telse\n\t\troot[\"AmazonCognitoIdentity\"] = factory(root[\"AWSCognito\"], root[\"AWSCognito\"][\"CognitoIdentityServiceProvider\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_13__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n * \n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n * \n * http://aws.amazon.com/asl/\n * \n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License. \n */\n\n\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"aws-sdk/global\"), require(\"aws-sdk/clients/cognitoidentityserviceprovider\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"aws-sdk/global\", \"aws-sdk/clients/cognitoidentityserviceprovider\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"AmazonCognitoIdentity\"] = factory(require(\"aws-sdk/global\"), require(\"aws-sdk/clients/cognitoidentityserviceprovider\"));\n\telse\n\t\troot[\"AmazonCognitoIdentity\"] = factory(root[\"AWSCognito\"], root[\"AWSCognito\"][\"CognitoIdentityServiceProvider\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_13__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _src = __webpack_require__(17);\n\t\n\tObject.keys(_src).forEach(function (key) {\n\t if (key === \"default\" || key === \"__esModule\") return;\n\t Object.defineProperty(exports, key, {\n\t enumerable: true,\n\t get: function get() {\n\t return _src[key];\n\t }\n\t });\n\t});\n\t\n\tvar _cognitoidentityserviceprovider = __webpack_require__(13);\n\t\n\tvar _cognitoidentityserviceprovider2 = _interopRequireDefault(_cognitoidentityserviceprovider);\n\t\n\tvar enhancements = _interopRequireWildcard(_src);\n\t\n\tfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tObject.keys(enhancements).forEach(function (key) {\n\t _cognitoidentityserviceprovider2.default[key] = enhancements[key];\n\t});\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _global = __webpack_require__(1);\n\t\n\tvar _BigInteger = __webpack_require__(3);\n\t\n\tvar _BigInteger2 = _interopRequireDefault(_BigInteger);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } } /*!\n\t * Copyright 2016 Amazon.com,\n\t * Inc. or its affiliates. All Rights Reserved.\n\t *\n\t * Licensed under the Amazon Software License (the \"License\").\n\t * You may not use this file except in compliance with the\n\t * License. A copy of the License is located at\n\t *\n\t * http://aws.amazon.com/asl/\n\t *\n\t * or in the \"license\" file accompanying this file. This file is\n\t * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n\t * CONDITIONS OF ANY KIND, express or implied. See the License\n\t * for the specific language governing permissions and\n\t * limitations under the License.\n\t */\n\t\n\tvar initN = 'FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1' + '29024E088A67CC74020BBEA63B139B22514A08798E3404DD' + 'EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245' + 'E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED' + 'EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D' + 'C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F' + '83655D23DCA3AD961C62F356208552BB9ED529077096966D' + '670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B' + 'E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9' + 'DE2BCBF6955817183995497CEA956AE515D2261898FA0510' + '15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64' + 'ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7' + 'ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B' + 'F12FFA06D98A0864D87602733EC86A64521F2B18177B200C' + 'BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31' + '43DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF';\n\t\n\tvar newPasswordRequiredChallengeUserAttributePrefix = 'userAttributes.';\n\t\n\t/** @class */\n\t\n\tvar AuthenticationHelper = function () {\n\t /**\n\t * Constructs a new AuthenticationHelper object\n\t * @param {string} PoolName Cognito user pool name.\n\t */\n\t function AuthenticationHelper(PoolName) {\n\t _classCallCheck(this, AuthenticationHelper);\n\t\n\t this.N = new _BigInteger2.default(initN, 16);\n\t this.g = new _BigInteger2.default('2', 16);\n\t this.k = new _BigInteger2.default(this.hexHash('00' + this.N.toString(16) + '0' + this.g.toString(16)), 16);\n\t\n\t this.smallAValue = this.generateRandomSmallA();\n\t this.getLargeAValue(function () {});\n\t\n\t this.infoBits = new _global.util.Buffer('Caldera Derived Key', 'utf8');\n\t\n\t this.poolName = PoolName;\n\t }\n\t\n\t /**\n\t * @returns {BigInteger} small A, a random number\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.getSmallAValue = function getSmallAValue() {\n\t return this.smallAValue;\n\t };\n\t\n\t /**\n\t * @param {nodeCallback} callback Called with (err, largeAValue)\n\t * @returns {void}\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.getLargeAValue = function getLargeAValue(callback) {\n\t var _this = this;\n\t\n\t if (this.largeAValue) {\n\t callback(null, this.largeAValue);\n\t } else {\n\t this.calculateA(this.smallAValue, function (err, largeAValue) {\n\t if (err) {\n\t callback(err, null);\n\t }\n\t\n\t _this.largeAValue = largeAValue;\n\t callback(null, _this.largeAValue);\n\t });\n\t }\n\t };\n\t\n\t /**\n\t * helper function to generate a random big integer\n\t * @returns {BigInteger} a random value.\n\t * @private\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.generateRandomSmallA = function generateRandomSmallA() {\n\t var hexRandom = _global.util.crypto.lib.randomBytes(128).toString('hex');\n\t\n\t var randomBigInt = new _BigInteger2.default(hexRandom, 16);\n\t var smallABigInt = randomBigInt.mod(this.N);\n\t\n\t return smallABigInt;\n\t };\n\t\n\t /**\n\t * helper function to generate a random string\n\t * @returns {string} a random value.\n\t * @private\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.generateRandomString = function generateRandomString() {\n\t return _global.util.crypto.lib.randomBytes(40).toString('base64');\n\t };\n\t\n\t /**\n\t * @returns {string} Generated random value included in password hash.\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.getRandomPassword = function getRandomPassword() {\n\t return this.randomPassword;\n\t };\n\t\n\t /**\n\t * @returns {string} Generated random value included in devices hash.\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.getSaltDevices = function getSaltDevices() {\n\t return this.SaltToHashDevices;\n\t };\n\t\n\t /**\n\t * @returns {string} Value used to verify devices.\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.getVerifierDevices = function getVerifierDevices() {\n\t return this.verifierDevices;\n\t };\n\t\n\t /**\n\t * Generate salts and compute verifier.\n\t * @param {string} deviceGroupKey Devices to generate verifier for.\n\t * @param {string} username User to generate verifier for.\n\t * @param {nodeCallback} callback Called with (err, null)\n\t * @returns {void}\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.generateHashDevice = function generateHashDevice(deviceGroupKey, username, callback) {\n\t var _this2 = this;\n\t\n\t this.randomPassword = this.generateRandomString();\n\t var combinedString = '' + deviceGroupKey + username + ':' + this.randomPassword;\n\t var hashedString = this.hash(combinedString);\n\t\n\t var hexRandom = _global.util.crypto.lib.randomBytes(16).toString('hex');\n\t this.SaltToHashDevices = this.padHex(new _BigInteger2.default(hexRandom, 16));\n\t\n\t this.g.modPow(new _BigInteger2.default(this.hexHash(this.SaltToHashDevices + hashedString), 16), this.N, function (err, verifierDevicesNotPadded) {\n\t if (err) {\n\t callback(err, null);\n\t }\n\t\n\t _this2.verifierDevices = _this2.padHex(verifierDevicesNotPadded);\n\t callback(null, null);\n\t });\n\t };\n\t\n\t /**\n\t * Calculate the client's public value A = g^a%N\n\t * with the generated random number a\n\t * @param {BigInteger} a Randomly generated small A.\n\t * @param {nodeCallback} callback Called with (err, largeAValue)\n\t * @returns {void}\n\t * @private\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.calculateA = function calculateA(a, callback) {\n\t var _this3 = this;\n\t\n\t this.g.modPow(a, this.N, function (err, A) {\n\t if (err) {\n\t callback(err, null);\n\t }\n\t\n\t if (A.mod(_this3.N).equals(_BigInteger2.default.ZERO)) {\n\t callback(new Error('Illegal paramater. A mod N cannot be 0.'), null);\n\t }\n\t\n\t callback(null, A);\n\t });\n\t };\n\t\n\t /**\n\t * Calculate the client's value U which is the hash of A and B\n\t * @param {BigInteger} A Large A value.\n\t * @param {BigInteger} B Server B value.\n\t * @returns {BigInteger} Computed U value.\n\t * @private\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.calculateU = function calculateU(A, B) {\n\t this.UHexHash = this.hexHash(this.padHex(A) + this.padHex(B));\n\t var finalU = new _BigInteger2.default(this.UHexHash, 16);\n\t\n\t return finalU;\n\t };\n\t\n\t /**\n\t * Calculate a hash from a bitArray\n\t * @param {Buffer} buf Value to hash.\n\t * @returns {String} Hex-encoded hash.\n\t * @private\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.hash = function hash(buf) {\n\t var hashHex = _global.util.crypto.sha256(buf, 'hex');\n\t return new Array(64 - hashHex.length).join('0') + hashHex;\n\t };\n\t\n\t /**\n\t * Calculate a hash from a hex string\n\t * @param {String} hexStr Value to hash.\n\t * @returns {String} Hex-encoded hash.\n\t * @private\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.hexHash = function hexHash(hexStr) {\n\t return this.hash(new _global.util.Buffer(hexStr, 'hex'));\n\t };\n\t\n\t /**\n\t * Standard hkdf algorithm\n\t * @param {Buffer} ikm Input key material.\n\t * @param {Buffer} salt Salt value.\n\t * @returns {Buffer} Strong key material.\n\t * @private\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.computehkdf = function computehkdf(ikm, salt) {\n\t var prk = _global.util.crypto.hmac(salt, ikm, 'buffer', 'sha256');\n\t var infoBitsUpdate = _global.util.buffer.concat([this.infoBits, new _global.util.Buffer(String.fromCharCode(1), 'utf8')]);\n\t var hmac = _global.util.crypto.hmac(prk, infoBitsUpdate, 'buffer', 'sha256');\n\t return hmac.slice(0, 16);\n\t };\n\t\n\t /**\n\t * Calculates the final hkdf based on computed S value, and computed U value and the key\n\t * @param {String} username Username.\n\t * @param {String} password Password.\n\t * @param {BigInteger} serverBValue Server B value.\n\t * @param {BigInteger} salt Generated salt.\n\t * @param {nodeCallback} callback Called with (err, hkdfValue)\n\t * @returns {void}\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.getPasswordAuthenticationKey = function getPasswordAuthenticationKey(username, password, serverBValue, salt, callback) {\n\t var _this4 = this;\n\t\n\t if (serverBValue.mod(this.N).equals(_BigInteger2.default.ZERO)) {\n\t throw new Error('B cannot be zero.');\n\t }\n\t\n\t this.UValue = this.calculateU(this.largeAValue, serverBValue);\n\t\n\t if (this.UValue.equals(_BigInteger2.default.ZERO)) {\n\t throw new Error('U cannot be zero.');\n\t }\n\t\n\t var usernamePassword = '' + this.poolName + username + ':' + password;\n\t var usernamePasswordHash = this.hash(usernamePassword);\n\t\n\t var xValue = new _BigInteger2.default(this.hexHash(this.padHex(salt) + usernamePasswordHash), 16);\n\t this.calculateS(xValue, serverBValue, function (err, sValue) {\n\t if (err) {\n\t callback(err, null);\n\t }\n\t\n\t var hkdf = _this4.computehkdf(new _global.util.Buffer(_this4.padHex(sValue), 'hex'), new _global.util.Buffer(_this4.padHex(_this4.UValue.toString(16)), 'hex'));\n\t\n\t callback(null, hkdf);\n\t });\n\t };\n\t\n\t /**\n\t * Calculates the S value used in getPasswordAuthenticationKey\n\t * @param {BigInteger} xValue Salted password hash value.\n\t * @param {BigInteger} serverBValue Server B value.\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.calculateS = function calculateS(xValue, serverBValue, callback) {\n\t var _this5 = this;\n\t\n\t this.g.modPow(xValue, this.N, function (err, gModPowXN) {\n\t if (err) {\n\t callback(err, null);\n\t }\n\t\n\t var intValue2 = serverBValue.subtract(_this5.k.multiply(gModPowXN));\n\t intValue2.modPow(_this5.smallAValue.add(_this5.UValue.multiply(xValue)), _this5.N, function (err2, result) {\n\t if (err2) {\n\t callback(err2, null);\n\t }\n\t\n\t callback(null, result.mod(_this5.N));\n\t });\n\t });\n\t };\n\t\n\t /**\n\t * Return constant newPasswordRequiredChallengeUserAttributePrefix\n\t * @return {newPasswordRequiredChallengeUserAttributePrefix} constant prefix value\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.getNewPasswordRequiredChallengeUserAttributePrefix = function getNewPasswordRequiredChallengeUserAttributePrefix() {\n\t return newPasswordRequiredChallengeUserAttributePrefix;\n\t };\n\t\n\t /**\n\t * Converts a BigInteger (or hex string) to hex format padded with zeroes for hashing\n\t * @param {BigInteger|String} bigInt Number or string to pad.\n\t * @returns {String} Padded hex string.\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.padHex = function padHex(bigInt) {\n\t var hashStr = bigInt.toString(16);\n\t if (hashStr.length % 2 === 1) {\n\t hashStr = '0' + hashStr;\n\t } else if ('89ABCDEFabcdef'.indexOf(hashStr[0]) !== -1) {\n\t hashStr = '00' + hashStr;\n\t }\n\t return hashStr;\n\t };\n\t\n\t return AuthenticationHelper;\n\t}();\n\t\n\texports.default = AuthenticationHelper;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\n\t\"use strict\";\n\t\n\texports.__esModule = true;\n\t// A small implementation of BigInteger based on http://www-cs-students.stanford.edu/~tjw/jsbn/\n\t//\n\t// All public methods have been removed except the following:\n\t// new BigInteger(a, b) (only radix 2, 4, 8, 16 and 32 supported)\n\t// toString (only radix 2, 4, 8, 16 and 32 supported)\n\t// negate\n\t// abs\n\t// compareTo\n\t// bitLength\n\t// mod\n\t// equals\n\t// add\n\t// subtract\n\t// multiply\n\t// divide\n\t// modPow\n\t\n\texports.default = BigInteger;\n\t\n\t/*\n\t * Copyright (c) 2003-2005 Tom Wu\n\t * All Rights Reserved.\n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining\n\t * a copy of this software and associated documentation files (the\n\t * \"Software\"), to deal in the Software without restriction, including\n\t * without limitation the rights to use, copy, modify, merge, publish,\n\t * distribute, sublicense, and/or sell copies of the Software, and to\n\t * permit persons to whom the Software is furnished to do so, subject to\n\t * the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be\n\t * included in all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND,\n\t * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY\n\t * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n\t *\n\t * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,\n\t * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER\n\t * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF\n\t * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT\n\t * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n\t *\n\t * In addition, the following condition applies:\n\t *\n\t * All redistributions must retain an intact copy of this copyright notice\n\t * and disclaimer.\n\t */\n\t\n\t// (public) Constructor\n\t\n\tfunction BigInteger(a, b) {\n\t if (a != null) this.fromString(a, b);\n\t}\n\t\n\t// return new, unset BigInteger\n\tfunction nbi() {\n\t return new BigInteger(null);\n\t}\n\t\n\t// Bits per digit\n\tvar dbits;\n\t\n\t// JavaScript engine analysis\n\tvar canary = 0xdeadbeefcafe;\n\tvar j_lm = (canary & 0xffffff) == 0xefcafe;\n\t\n\t// am: Compute w_j += (x*this_i), propagate carries,\n\t// c is initial carry, returns final carry.\n\t// c < 3*dvalue, x < 2*dvalue, this_i < dvalue\n\t// We need to select the fastest one that works in this environment.\n\t\n\t// am1: use a single mult and divide to get the high bits,\n\t// max digit bits should be 26 because\n\t// max internal value = 2*dvalue^2-2*dvalue (< 2^53)\n\tfunction am1(i, x, w, j, c, n) {\n\t while (--n >= 0) {\n\t var v = x * this[i++] + w[j] + c;\n\t c = Math.floor(v / 0x4000000);\n\t w[j++] = v & 0x3ffffff;\n\t }\n\t return c;\n\t}\n\t// am2 avoids a big mult-and-extract completely.\n\t// Max digit bits should be <= 30 because we do bitwise ops\n\t// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)\n\tfunction am2(i, x, w, j, c, n) {\n\t var xl = x & 0x7fff,\n\t xh = x >> 15;\n\t while (--n >= 0) {\n\t var l = this[i] & 0x7fff;\n\t var h = this[i++] >> 15;\n\t var m = xh * l + h * xl;\n\t l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff);\n\t c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30);\n\t w[j++] = l & 0x3fffffff;\n\t }\n\t return c;\n\t}\n\t// Alternately, set max digit bits to 28 since some\n\t// browsers slow down when dealing with 32-bit numbers.\n\tfunction am3(i, x, w, j, c, n) {\n\t var xl = x & 0x3fff,\n\t xh = x >> 14;\n\t while (--n >= 0) {\n\t var l = this[i] & 0x3fff;\n\t var h = this[i++] >> 14;\n\t var m = xh * l + h * xl;\n\t l = xl * l + ((m & 0x3fff) << 14) + w[j] + c;\n\t c = (l >> 28) + (m >> 14) + xh * h;\n\t w[j++] = l & 0xfffffff;\n\t }\n\t return c;\n\t}\n\tvar inBrowser = typeof navigator !== \"undefined\";\n\tif (inBrowser && j_lm && navigator.appName == \"Microsoft Internet Explorer\") {\n\t BigInteger.prototype.am = am2;\n\t dbits = 30;\n\t} else if (inBrowser && j_lm && navigator.appName != \"Netscape\") {\n\t BigInteger.prototype.am = am1;\n\t dbits = 26;\n\t} else {\n\t // Mozilla/Netscape seems to prefer am3\n\t BigInteger.prototype.am = am3;\n\t dbits = 28;\n\t}\n\t\n\tBigInteger.prototype.DB = dbits;\n\tBigInteger.prototype.DM = (1 << dbits) - 1;\n\tBigInteger.prototype.DV = 1 << dbits;\n\t\n\tvar BI_FP = 52;\n\tBigInteger.prototype.FV = Math.pow(2, BI_FP);\n\tBigInteger.prototype.F1 = BI_FP - dbits;\n\tBigInteger.prototype.F2 = 2 * dbits - BI_FP;\n\t\n\t// Digit conversions\n\tvar BI_RM = \"0123456789abcdefghijklmnopqrstuvwxyz\";\n\tvar BI_RC = new Array();\n\tvar rr, vv;\n\trr = \"0\".charCodeAt(0);\n\tfor (vv = 0; vv <= 9; ++vv) {\n\t BI_RC[rr++] = vv;\n\t}rr = \"a\".charCodeAt(0);\n\tfor (vv = 10; vv < 36; ++vv) {\n\t BI_RC[rr++] = vv;\n\t}rr = \"A\".charCodeAt(0);\n\tfor (vv = 10; vv < 36; ++vv) {\n\t BI_RC[rr++] = vv;\n\t}function int2char(n) {\n\t return BI_RM.charAt(n);\n\t}\n\tfunction intAt(s, i) {\n\t var c = BI_RC[s.charCodeAt(i)];\n\t return c == null ? -1 : c;\n\t}\n\t\n\t// (protected) copy this to r\n\tfunction bnpCopyTo(r) {\n\t for (var i = this.t - 1; i >= 0; --i) {\n\t r[i] = this[i];\n\t }r.t = this.t;\n\t r.s = this.s;\n\t}\n\t\n\t// (protected) set from integer value x, -DV <= x < DV\n\tfunction bnpFromInt(x) {\n\t this.t = 1;\n\t this.s = x < 0 ? -1 : 0;\n\t if (x > 0) this[0] = x;else if (x < -1) this[0] = x + this.DV;else this.t = 0;\n\t}\n\t\n\t// return bigint initialized to value\n\tfunction nbv(i) {\n\t var r = nbi();\n\t\n\t r.fromInt(i);\n\t\n\t return r;\n\t}\n\t\n\t// (protected) set from string and radix\n\tfunction bnpFromString(s, b) {\n\t var k;\n\t if (b == 16) k = 4;else if (b == 8) k = 3;else if (b == 2) k = 1;else if (b == 32) k = 5;else if (b == 4) k = 2;else throw new Error(\"Only radix 2, 4, 8, 16, 32 are supported\");\n\t this.t = 0;\n\t this.s = 0;\n\t var i = s.length,\n\t mi = false,\n\t sh = 0;\n\t while (--i >= 0) {\n\t var x = intAt(s, i);\n\t if (x < 0) {\n\t if (s.charAt(i) == \"-\") mi = true;\n\t continue;\n\t }\n\t mi = false;\n\t if (sh == 0) this[this.t++] = x;else if (sh + k > this.DB) {\n\t this[this.t - 1] |= (x & (1 << this.DB - sh) - 1) << sh;\n\t this[this.t++] = x >> this.DB - sh;\n\t } else this[this.t - 1] |= x << sh;\n\t sh += k;\n\t if (sh >= this.DB) sh -= this.DB;\n\t }\n\t this.clamp();\n\t if (mi) BigInteger.ZERO.subTo(this, this);\n\t}\n\t\n\t// (protected) clamp off excess high words\n\tfunction bnpClamp() {\n\t var c = this.s & this.DM;\n\t while (this.t > 0 && this[this.t - 1] == c) {\n\t --this.t;\n\t }\n\t}\n\t\n\t// (public) return string representation in given radix\n\tfunction bnToString(b) {\n\t if (this.s < 0) return \"-\" + this.negate().toString();\n\t var k;\n\t if (b == 16) k = 4;else if (b == 8) k = 3;else if (b == 2) k = 1;else if (b == 32) k = 5;else if (b == 4) k = 2;else throw new Error(\"Only radix 2, 4, 8, 16, 32 are supported\");\n\t var km = (1 << k) - 1,\n\t d,\n\t m = false,\n\t r = \"\",\n\t i = this.t;\n\t var p = this.DB - i * this.DB % k;\n\t if (i-- > 0) {\n\t if (p < this.DB && (d = this[i] >> p) > 0) {\n\t m = true;\n\t r = int2char(d);\n\t }\n\t while (i >= 0) {\n\t if (p < k) {\n\t d = (this[i] & (1 << p) - 1) << k - p;\n\t d |= this[--i] >> (p += this.DB - k);\n\t } else {\n\t d = this[i] >> (p -= k) & km;\n\t if (p <= 0) {\n\t p += this.DB;\n\t --i;\n\t }\n\t }\n\t if (d > 0) m = true;\n\t if (m) r += int2char(d);\n\t }\n\t }\n\t return m ? r : \"0\";\n\t}\n\t\n\t// (public) -this\n\tfunction bnNegate() {\n\t var r = nbi();\n\t\n\t BigInteger.ZERO.subTo(this, r);\n\t\n\t return r;\n\t}\n\t\n\t// (public) |this|\n\tfunction bnAbs() {\n\t return this.s < 0 ? this.negate() : this;\n\t}\n\t\n\t// (public) return + if this > a, - if this < a, 0 if equal\n\tfunction bnCompareTo(a) {\n\t var r = this.s - a.s;\n\t if (r != 0) return r;\n\t var i = this.t;\n\t r = i - a.t;\n\t if (r != 0) return this.s < 0 ? -r : r;\n\t while (--i >= 0) {\n\t if ((r = this[i] - a[i]) != 0) return r;\n\t }return 0;\n\t}\n\t\n\t// returns bit length of the integer x\n\tfunction nbits(x) {\n\t var r = 1,\n\t t;\n\t if ((t = x >>> 16) != 0) {\n\t x = t;\n\t r += 16;\n\t }\n\t if ((t = x >> 8) != 0) {\n\t x = t;\n\t r += 8;\n\t }\n\t if ((t = x >> 4) != 0) {\n\t x = t;\n\t r += 4;\n\t }\n\t if ((t = x >> 2) != 0) {\n\t x = t;\n\t r += 2;\n\t }\n\t if ((t = x >> 1) != 0) {\n\t x = t;\n\t r += 1;\n\t }\n\t return r;\n\t}\n\t\n\t// (public) return the number of bits in \"this\"\n\tfunction bnBitLength() {\n\t if (this.t <= 0) return 0;\n\t return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);\n\t}\n\t\n\t// (protected) r = this << n*DB\n\tfunction bnpDLShiftTo(n, r) {\n\t var i;\n\t for (i = this.t - 1; i >= 0; --i) {\n\t r[i + n] = this[i];\n\t }for (i = n - 1; i >= 0; --i) {\n\t r[i] = 0;\n\t }r.t = this.t + n;\n\t r.s = this.s;\n\t}\n\t\n\t// (protected) r = this >> n*DB\n\tfunction bnpDRShiftTo(n, r) {\n\t for (var i = n; i < this.t; ++i) {\n\t r[i - n] = this[i];\n\t }r.t = Math.max(this.t - n, 0);\n\t r.s = this.s;\n\t}\n\t\n\t// (protected) r = this << n\n\tfunction bnpLShiftTo(n, r) {\n\t var bs = n % this.DB;\n\t var cbs = this.DB - bs;\n\t var bm = (1 << cbs) - 1;\n\t var ds = Math.floor(n / this.DB),\n\t c = this.s << bs & this.DM,\n\t i;\n\t for (i = this.t - 1; i >= 0; --i) {\n\t r[i + ds + 1] = this[i] >> cbs | c;\n\t c = (this[i] & bm) << bs;\n\t }\n\t for (i = ds - 1; i >= 0; --i) {\n\t r[i] = 0;\n\t }r[ds] = c;\n\t r.t = this.t + ds + 1;\n\t r.s = this.s;\n\t r.clamp();\n\t}\n\t\n\t// (protected) r = this >> n\n\tfunction bnpRShiftTo(n, r) {\n\t r.s = this.s;\n\t var ds = Math.floor(n / this.DB);\n\t if (ds >= this.t) {\n\t r.t = 0;\n\t return;\n\t }\n\t var bs = n % this.DB;\n\t var cbs = this.DB - bs;\n\t var bm = (1 << bs) - 1;\n\t r[0] = this[ds] >> bs;\n\t for (var i = ds + 1; i < this.t; ++i) {\n\t r[i - ds - 1] |= (this[i] & bm) << cbs;\n\t r[i - ds] = this[i] >> bs;\n\t }\n\t if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n\t r.t = this.t - ds;\n\t r.clamp();\n\t}\n\t\n\t// (protected) r = this - a\n\tfunction bnpSubTo(a, r) {\n\t var i = 0,\n\t c = 0,\n\t m = Math.min(a.t, this.t);\n\t while (i < m) {\n\t c += this[i] - a[i];\n\t r[i++] = c & this.DM;\n\t c >>= this.DB;\n\t }\n\t if (a.t < this.t) {\n\t c -= a.s;\n\t while (i < this.t) {\n\t c += this[i];\n\t r[i++] = c & this.DM;\n\t c >>= this.DB;\n\t }\n\t c += this.s;\n\t } else {\n\t c += this.s;\n\t while (i < a.t) {\n\t c -= a[i];\n\t r[i++] = c & this.DM;\n\t c >>= this.DB;\n\t }\n\t c -= a.s;\n\t }\n\t r.s = c < 0 ? -1 : 0;\n\t if (c < -1) r[i++] = this.DV + c;else if (c > 0) r[i++] = c;\n\t r.t = i;\n\t r.clamp();\n\t}\n\t\n\t// (protected) r = this * a, r != this,a (HAC 14.12)\n\t// \"this\" should be the larger one if appropriate.\n\tfunction bnpMultiplyTo(a, r) {\n\t var x = this.abs(),\n\t y = a.abs();\n\t var i = x.t;\n\t r.t = i + y.t;\n\t while (--i >= 0) {\n\t r[i] = 0;\n\t }for (i = 0; i < y.t; ++i) {\n\t r[i + x.t] = x.am(0, y[i], r, i, 0, x.t);\n\t }r.s = 0;\n\t r.clamp();\n\t if (this.s != a.s) BigInteger.ZERO.subTo(r, r);\n\t}\n\t\n\t// (protected) r = this^2, r != this (HAC 14.16)\n\tfunction bnpSquareTo(r) {\n\t var x = this.abs();\n\t var i = r.t = 2 * x.t;\n\t while (--i >= 0) {\n\t r[i] = 0;\n\t }for (i = 0; i < x.t - 1; ++i) {\n\t var c = x.am(i, x[i], r, 2 * i, 0, 1);\n\t if ((r[i + x.t] += x.am(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >= x.DV) {\n\t r[i + x.t] -= x.DV;\n\t r[i + x.t + 1] = 1;\n\t }\n\t }\n\t if (r.t > 0) r[r.t - 1] += x.am(i, x[i], r, 2 * i, 0, 1);\n\t r.s = 0;\n\t r.clamp();\n\t}\n\t\n\t// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)\n\t// r != q, this != m. q or r may be null.\n\tfunction bnpDivRemTo(m, q, r) {\n\t var pm = m.abs();\n\t if (pm.t <= 0) return;\n\t var pt = this.abs();\n\t if (pt.t < pm.t) {\n\t if (q != null) q.fromInt(0);\n\t if (r != null) this.copyTo(r);\n\t return;\n\t }\n\t if (r == null) r = nbi();\n\t var y = nbi(),\n\t ts = this.s,\n\t ms = m.s;\n\t var nsh = this.DB - nbits(pm[pm.t - 1]);\n\t // normalize modulus\n\t if (nsh > 0) {\n\t pm.lShiftTo(nsh, y);\n\t pt.lShiftTo(nsh, r);\n\t } else {\n\t pm.copyTo(y);\n\t pt.copyTo(r);\n\t }\n\t var ys = y.t;\n\t var y0 = y[ys - 1];\n\t if (y0 == 0) return;\n\t var yt = y0 * (1 << this.F1) + (ys > 1 ? y[ys - 2] >> this.F2 : 0);\n\t var d1 = this.FV / yt,\n\t d2 = (1 << this.F1) / yt,\n\t e = 1 << this.F2;\n\t var i = r.t,\n\t j = i - ys,\n\t t = q == null ? nbi() : q;\n\t y.dlShiftTo(j, t);\n\t if (r.compareTo(t) >= 0) {\n\t r[r.t++] = 1;\n\t r.subTo(t, r);\n\t }\n\t BigInteger.ONE.dlShiftTo(ys, t);\n\t t.subTo(y, y);\n\t // \"negative\" y so we can replace sub with am later\n\t while (y.t < ys) {\n\t y[y.t++] = 0;\n\t }while (--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = r[--i] == y0 ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n\t if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\n\t // Try it out\n\t y.dlShiftTo(j, t);\n\t r.subTo(t, r);\n\t while (r[i] < --qd) {\n\t r.subTo(t, r);\n\t }\n\t }\n\t }\n\t if (q != null) {\n\t r.drShiftTo(ys, q);\n\t if (ts != ms) BigInteger.ZERO.subTo(q, q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if (nsh > 0) r.rShiftTo(nsh, r);\n\t // Denormalize remainder\n\t if (ts < 0) BigInteger.ZERO.subTo(r, r);\n\t}\n\t\n\t// (public) this mod a\n\tfunction bnMod(a) {\n\t var r = nbi();\n\t this.abs().divRemTo(a, null, r);\n\t if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r);\n\t return r;\n\t}\n\t\n\t// (protected) return \"-1/this % 2^DB\"; useful for Mont. reduction\n\t// justification:\n\t// xy == 1 (mod m)\n\t// xy = 1+km\n\t// xy(2-xy) = (1+km)(1-km)\n\t// x[y(2-xy)] = 1-k^2m^2\n\t// x[y(2-xy)] == 1 (mod m^2)\n\t// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2\n\t// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.\n\t// JS multiply \"overflows\" differently from C/C++, so care is needed here.\n\tfunction bnpInvDigit() {\n\t if (this.t < 1) return 0;\n\t var x = this[0];\n\t if ((x & 1) == 0) return 0;\n\t var y = x & 3;\n\t // y == 1/x mod 2^2\n\t y = y * (2 - (x & 0xf) * y) & 0xf;\n\t // y == 1/x mod 2^4\n\t y = y * (2 - (x & 0xff) * y) & 0xff;\n\t // y == 1/x mod 2^8\n\t y = y * (2 - ((x & 0xffff) * y & 0xffff)) & 0xffff;\n\t // y == 1/x mod 2^16\n\t // last step - calculate inverse mod DV directly;\n\t // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints\n\t y = y * (2 - x * y % this.DV) % this.DV;\n\t // y == 1/x mod 2^dbits\n\t // we really want the negative inverse, and -DV < y < DV\n\t return y > 0 ? this.DV - y : -y;\n\t}\n\t\n\tfunction bnEquals(a) {\n\t return this.compareTo(a) == 0;\n\t}\n\t\n\t// (protected) r = this + a\n\tfunction bnpAddTo(a, r) {\n\t var i = 0,\n\t c = 0,\n\t m = Math.min(a.t, this.t);\n\t while (i < m) {\n\t c += this[i] + a[i];\n\t r[i++] = c & this.DM;\n\t c >>= this.DB;\n\t }\n\t if (a.t < this.t) {\n\t c += a.s;\n\t while (i < this.t) {\n\t c += this[i];\n\t r[i++] = c & this.DM;\n\t c >>= this.DB;\n\t }\n\t c += this.s;\n\t } else {\n\t c += this.s;\n\t while (i < a.t) {\n\t c += a[i];\n\t r[i++] = c & this.DM;\n\t c >>= this.DB;\n\t }\n\t c += a.s;\n\t }\n\t r.s = c < 0 ? -1 : 0;\n\t if (c > 0) r[i++] = c;else if (c < -1) r[i++] = this.DV + c;\n\t r.t = i;\n\t r.clamp();\n\t}\n\t\n\t// (public) this + a\n\tfunction bnAdd(a) {\n\t var r = nbi();\n\t\n\t this.addTo(a, r);\n\t\n\t return r;\n\t}\n\t\n\t// (public) this - a\n\tfunction bnSubtract(a) {\n\t var r = nbi();\n\t\n\t this.subTo(a, r);\n\t\n\t return r;\n\t}\n\t\n\t// (public) this * a\n\tfunction bnMultiply(a) {\n\t var r = nbi();\n\t\n\t this.multiplyTo(a, r);\n\t\n\t return r;\n\t}\n\t\n\t// (public) this / a\n\tfunction bnDivide(a) {\n\t var r = nbi();\n\t\n\t this.divRemTo(a, r, null);\n\t\n\t return r;\n\t}\n\t\n\t// Montgomery reduction\n\tfunction Montgomery(m) {\n\t this.m = m;\n\t this.mp = m.invDigit();\n\t this.mpl = this.mp & 0x7fff;\n\t this.mph = this.mp >> 15;\n\t this.um = (1 << m.DB - 15) - 1;\n\t this.mt2 = 2 * m.t;\n\t}\n\t\n\t// xR mod m\n\tfunction montConvert(x) {\n\t var r = nbi();\n\t x.abs().dlShiftTo(this.m.t, r);\n\t r.divRemTo(this.m, null, r);\n\t if (x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r, r);\n\t return r;\n\t}\n\t\n\t// x/R mod m\n\tfunction montRevert(x) {\n\t var r = nbi();\n\t x.copyTo(r);\n\t this.reduce(r);\n\t return r;\n\t}\n\t\n\t// x = x/R mod m (HAC 14.32)\n\tfunction montReduce(x) {\n\t while (x.t <= this.mt2) {\n\t // pad x so am has enough room later\n\t x[x.t++] = 0;\n\t }for (var i = 0; i < this.m.t; ++i) {\n\t // faster way of calculating u0 = x[i]*mp mod DV\n\t var j = x[i] & 0x7fff;\n\t var u0 = j * this.mpl + ((j * this.mph + (x[i] >> 15) * this.mpl & this.um) << 15) & x.DM;\n\t // use am to combine the multiply-shift-add into one call\n\t j = i + this.m.t;\n\t x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n\t // propagate carry\n\t while (x[j] >= x.DV) {\n\t x[j] -= x.DV;\n\t x[++j]++;\n\t }\n\t }\n\t x.clamp();\n\t x.drShiftTo(this.m.t, x);\n\t if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n\t}\n\t\n\t// r = \"x^2/R mod m\"; x != r\n\tfunction montSqrTo(x, r) {\n\t x.squareTo(r);\n\t\n\t this.reduce(r);\n\t}\n\t\n\t// r = \"xy/R mod m\"; x,y != r\n\tfunction montMulTo(x, y, r) {\n\t x.multiplyTo(y, r);\n\t\n\t this.reduce(r);\n\t}\n\t\n\tMontgomery.prototype.convert = montConvert;\n\tMontgomery.prototype.revert = montRevert;\n\tMontgomery.prototype.reduce = montReduce;\n\tMontgomery.prototype.mulTo = montMulTo;\n\tMontgomery.prototype.sqrTo = montSqrTo;\n\t\n\t// (public) this^e % m (HAC 14.85)\n\tfunction bnModPow(e, m, callback) {\n\t var i = e.bitLength(),\n\t k,\n\t r = nbv(1),\n\t z = new Montgomery(m);\n\t if (i <= 0) return r;else if (i < 18) k = 1;else if (i < 48) k = 3;else if (i < 144) k = 4;else if (i < 768) k = 5;else k = 6;\n\t\n\t // precomputation\n\t var g = new Array(),\n\t n = 3,\n\t k1 = k - 1,\n\t km = (1 << k) - 1;\n\t g[1] = z.convert(this);\n\t if (k > 1) {\n\t var g2 = nbi();\n\t z.sqrTo(g[1], g2);\n\t while (n <= km) {\n\t g[n] = nbi();\n\t z.mulTo(g2, g[n - 2], g[n]);\n\t n += 2;\n\t }\n\t }\n\t\n\t var j = e.t - 1,\n\t w,\n\t is1 = true,\n\t r2 = nbi(),\n\t t;\n\t i = nbits(e[j]) - 1;\n\t while (j >= 0) {\n\t if (i >= k1) w = e[j] >> i - k1 & km;else {\n\t w = (e[j] & (1 << i + 1) - 1) << k1 - i;\n\t if (j > 0) w |= e[j - 1] >> this.DB + i - k1;\n\t }\n\t\n\t n = k;\n\t while ((w & 1) == 0) {\n\t w >>= 1;\n\t --n;\n\t }\n\t if ((i -= n) < 0) {\n\t i += this.DB;\n\t --j;\n\t }\n\t if (is1) {\n\t // ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r);\n\t is1 = false;\n\t } else {\n\t while (n > 1) {\n\t z.sqrTo(r, r2);\n\t z.sqrTo(r2, r);\n\t n -= 2;\n\t }\n\t if (n > 0) z.sqrTo(r, r2);else {\n\t t = r;\n\t r = r2;\n\t r2 = t;\n\t }\n\t z.mulTo(r2, g[w], r);\n\t }\n\t\n\t while (j >= 0 && (e[j] & 1 << i) == 0) {\n\t z.sqrTo(r, r2);\n\t t = r;\n\t r = r2;\n\t r2 = t;\n\t if (--i < 0) {\n\t i = this.DB - 1;\n\t --j;\n\t }\n\t }\n\t }\n\t var result = z.revert(r);\n\t callback(null, result);\n\t return result;\n\t}\n\t\n\t// protected\n\tBigInteger.prototype.copyTo = bnpCopyTo;\n\tBigInteger.prototype.fromInt = bnpFromInt;\n\tBigInteger.prototype.fromString = bnpFromString;\n\tBigInteger.prototype.clamp = bnpClamp;\n\tBigInteger.prototype.dlShiftTo = bnpDLShiftTo;\n\tBigInteger.prototype.drShiftTo = bnpDRShiftTo;\n\tBigInteger.prototype.lShiftTo = bnpLShiftTo;\n\tBigInteger.prototype.rShiftTo = bnpRShiftTo;\n\tBigInteger.prototype.subTo = bnpSubTo;\n\tBigInteger.prototype.multiplyTo = bnpMultiplyTo;\n\tBigInteger.prototype.squareTo = bnpSquareTo;\n\tBigInteger.prototype.divRemTo = bnpDivRemTo;\n\tBigInteger.prototype.invDigit = bnpInvDigit;\n\tBigInteger.prototype.addTo = bnpAddTo;\n\t\n\t// public\n\tBigInteger.prototype.toString = bnToString;\n\tBigInteger.prototype.negate = bnNegate;\n\tBigInteger.prototype.abs = bnAbs;\n\tBigInteger.prototype.compareTo = bnCompareTo;\n\tBigInteger.prototype.bitLength = bnBitLength;\n\tBigInteger.prototype.mod = bnMod;\n\tBigInteger.prototype.equals = bnEquals;\n\tBigInteger.prototype.add = bnAdd;\n\tBigInteger.prototype.subtract = bnSubtract;\n\tBigInteger.prototype.multiply = bnMultiply;\n\tBigInteger.prototype.divide = bnDivide;\n\tBigInteger.prototype.modPow = bnModPow;\n\t\n\t// \"constants\"\n\tBigInteger.ZERO = nbv(0);\n\tBigInteger.ONE = nbv(1);\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _CognitoJwtToken2 = __webpack_require__(6);\n\t\n\tvar _CognitoJwtToken3 = _interopRequireDefault(_CognitoJwtToken2);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n\t * Copyright 2016 Amazon.com,\n\t * Inc. or its affiliates. All Rights Reserved.\n\t *\n\t * Licensed under the Amazon Software License (the \"License\").\n\t * You may not use this file except in compliance with the\n\t * License. A copy of the License is located at\n\t *\n\t * http://aws.amazon.com/asl/\n\t *\n\t * or in the \"license\" file accompanying this file. This file is\n\t * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n\t * CONDITIONS OF ANY KIND, express or implied. See the License\n\t * for the specific language governing permissions and\n\t * limitations under the License.\n\t */\n\t\n\t/** @class */\n\tvar CognitoAccessToken = function (_CognitoJwtToken) {\n\t _inherits(CognitoAccessToken, _CognitoJwtToken);\n\t\n\t /**\n\t * Constructs a new CognitoAccessToken object\n\t * @param {string=} AccessToken The JWT access token.\n\t */\n\t function CognitoAccessToken() {\n\t var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n\t AccessToken = _ref.AccessToken;\n\t\n\t _classCallCheck(this, CognitoAccessToken);\n\t\n\t return _possibleConstructorReturn(this, _CognitoJwtToken.call(this, AccessToken || ''));\n\t }\n\t\n\t return CognitoAccessToken;\n\t}(_CognitoJwtToken3.default);\n\t\n\texports.default = CognitoAccessToken;\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _CognitoJwtToken2 = __webpack_require__(6);\n\t\n\tvar _CognitoJwtToken3 = _interopRequireDefault(_CognitoJwtToken2);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*!\n\t * Copyright 2016 Amazon.com,\n\t * Inc. or its affiliates. All Rights Reserved.\n\t *\n\t * Licensed under the Amazon Software License (the \"License\").\n\t * You may not use this file except in compliance with the\n\t * License. A copy of the License is located at\n\t *\n\t * http://aws.amazon.com/asl/\n\t *\n\t * or in the \"license\" file accompanying this file. This file is\n\t * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n\t * CONDITIONS OF ANY KIND, express or implied. See the License\n\t * for the specific language governing permissions and\n\t * limitations under the License.\n\t */\n\t\n\t/** @class */\n\tvar CognitoIdToken = function (_CognitoJwtToken) {\n\t _inherits(CognitoIdToken, _CognitoJwtToken);\n\t\n\t /**\n\t * Constructs a new CognitoIdToken object\n\t * @param {string=} IdToken The JWT Id token\n\t */\n\t function CognitoIdToken() {\n\t var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n\t IdToken = _ref.IdToken;\n\t\n\t _classCallCheck(this, CognitoIdToken);\n\t\n\t return _possibleConstructorReturn(this, _CognitoJwtToken.call(this, IdToken || ''));\n\t }\n\t\n\t return CognitoIdToken;\n\t}(_CognitoJwtToken3.default);\n\t\n\texports.default = CognitoIdToken;\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _global = __webpack_require__(1);\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } } /*!\n\t * Copyright 2016 Amazon.com,\n\t * Inc. or its affiliates. All Rights Reserved.\n\t *\n\t * Licensed under the Amazon Software License (the \"License\").\n\t * You may not use this file except in compliance with the\n\t * License. A copy of the License is located at\n\t *\n\t * http://aws.amazon.com/asl/\n\t *\n\t * or in the \"license\" file accompanying this file. This file is\n\t * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n\t * CONDITIONS OF ANY KIND, express or implied. See the License\n\t * for the specific language governing permissions and\n\t * limitations under the License.\n\t */\n\t\n\t/** @class */\n\tvar CognitoJwtToken = function () {\n\t /**\n\t * Constructs a new CognitoJwtToken object\n\t * @param {string=} token The JWT token.\n\t */\n\t function CognitoJwtToken(token) {\n\t _classCallCheck(this, CognitoJwtToken);\n\t\n\t // Assign object\n\t this.jwtToken = token || '';\n\t this.payload = this.decodePayload();\n\t }\n\t\n\t /**\n\t * @returns {string} the record's token.\n\t */\n\t\n\t\n\t CognitoJwtToken.prototype.getJwtToken = function getJwtToken() {\n\t return this.jwtToken;\n\t };\n\t\n\t /**\n\t * @returns {int} the token's expiration (exp member).\n\t */\n\t\n\t\n\t CognitoJwtToken.prototype.getExpiration = function getExpiration() {\n\t return this.payload.exp;\n\t };\n\t\n\t /**\n\t * @returns {int} the token's \"issued at\" (iat member).\n\t */\n\t\n\t\n\t CognitoJwtToken.prototype.getIssuedAt = function getIssuedAt() {\n\t return this.payload.iat;\n\t };\n\t\n\t /**\n\t * @returns {object} the token's payload.\n\t */\n\t\n\t\n\t CognitoJwtToken.prototype.decodePayload = function decodePayload() {\n\t var payload = this.jwtToken.split('.')[1];\n\t try {\n\t return JSON.parse(_global.util.base64.decode(payload).toString('utf8'));\n\t } catch (err) {\n\t return {};\n\t }\n\t };\n\t\n\t return CognitoJwtToken;\n\t}();\n\t\n\texports.default = CognitoJwtToken;\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*!\n\t * Copyright 2016 Amazon.com,\n\t * Inc. or its affiliates. All Rights Reserved.\n\t *\n\t * Licensed under the Amazon Software License (the \"License\").\n\t * You may not use this file except in compliance with the\n\t * License. A copy of the License is located at\n\t *\n\t * http://aws.amazon.com/asl/\n\t *\n\t * or in the \"license\" file accompanying this file. This file is\n\t * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n\t * CONDITIONS OF ANY KIND, express or implied. See the License\n\t * for the specific language governing permissions and\n\t * limitations under the License.\n\t */\n\t\n\t/** @class */\n\tvar CognitoRefreshToken = function () {\n\t /**\n\t * Constructs a new CognitoRefreshToken object\n\t * @param {string=} RefreshToken The JWT refresh token.\n\t */\n\t function CognitoRefreshToken() {\n\t var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n\t RefreshToken = _ref.RefreshToken;\n\t\n\t _classCallCheck(this, CognitoRefreshToken);\n\t\n\t // Assign object\n\t this.token = RefreshToken || '';\n\t }\n\t\n\t /**\n\t * @returns {string} the record's token.\n\t */\n\t\n\t\n\t CognitoRefreshToken.prototype.getToken = function getToken() {\n\t return this.token;\n\t };\n\t\n\t return CognitoRefreshToken;\n\t}();\n\t\n\texports.default = CognitoRefreshToken;\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _global = __webpack_require__(1);\n\t\n\tvar _BigInteger = __webpack_require__(3);\n\t\n\tvar _BigInteger2 = _interopRequireDefault(_BigInteger);\n\t\n\tvar _AuthenticationHelper = __webpack_require__(2);\n\t\n\tvar _AuthenticationHelper2 = _interopRequireDefault(_AuthenticationHelper);\n\t\n\tvar _CognitoAccessToken = __webpack_require__(4);\n\t\n\tvar _CognitoAccessToken2 = _interopRequireDefault(_CognitoAccessToken);\n\t\n\tvar _CognitoIdToken = __webpack_require__(5);\n\t\n\tvar _CognitoIdToken2 = _interopRequireDefault(_CognitoIdToken);\n\t\n\tvar _CognitoRefreshToken = __webpack_require__(7);\n\t\n\tvar _CognitoRefreshToken2 = _interopRequireDefault(_CognitoRefreshToken);\n\t\n\tvar _CognitoUserSession = __webpack_require__(10);\n\t\n\tvar _CognitoUserSession2 = _interopRequireDefault(_CognitoUserSession);\n\t\n\tvar _DateHelper = __webpack_require__(11);\n\t\n\tvar _DateHelper2 = _interopRequireDefault(_DateHelper);\n\t\n\tvar _CognitoUserAttribute = __webpack_require__(9);\n\t\n\tvar _CognitoUserAttribute2 = _interopRequireDefault(_CognitoUserAttribute);\n\t\n\tvar _StorageHelper = __webpack_require__(12);\n\t\n\tvar _StorageHelper2 = _interopRequireDefault(_StorageHelper);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } } /*!\n\t * Copyright 2016 Amazon.com,\n\t * Inc. or its affiliates. All Rights Reserved.\n\t *\n\t * Licensed under the Amazon Software License (the \"License\").\n\t * You may not use this file except in compliance with the\n\t * License. A copy of the License is located at\n\t *\n\t * http://aws.amazon.com/asl/\n\t *\n\t * or in the \"license\" file accompanying this file. This file is\n\t * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n\t * CONDITIONS OF ANY KIND, express or implied. See the License\n\t * for the specific language governing permissions and\n\t * limitations under the License.\n\t */\n\t\n\t/**\n\t * @callback nodeCallback\n\t * @template T result\n\t * @param {*} err The operation failure reason, or null.\n\t * @param {T} result The operation result.\n\t */\n\t\n\t/**\n\t * @callback onFailure\n\t * @param {*} err Failure reason.\n\t */\n\t\n\t/**\n\t * @callback onSuccess\n\t * @template T result\n\t * @param {T} result The operation result.\n\t */\n\t\n\t/**\n\t * @callback mfaRequired\n\t * @param {*} details MFA challenge details.\n\t */\n\t\n\t/**\n\t * @callback customChallenge\n\t * @param {*} details Custom challenge details.\n\t */\n\t\n\t/**\n\t * @callback inputVerificationCode\n\t * @param {*} data Server response.\n\t */\n\t\n\t/**\n\t * @callback authSuccess\n\t * @param {CognitoUserSession} session The new session.\n\t * @param {bool=} userConfirmationNecessary User must be confirmed.\n\t */\n\t\n\t/** @class */\n\tvar CognitoUser = function () {\n\t /**\n\t * Constructs a new CognitoUser object\n\t * @param {object} data Creation options\n\t * @param {string} data.Username The user's username.\n\t * @param {CognitoUserPool} data.Pool Pool containing the user.\n\t * @param {object} data.Storage Optional storage object.\n\t */\n\t function CognitoUser(data) {\n\t _classCallCheck(this, CognitoUser);\n\t\n\t if (data == null || data.Username == null || data.Pool == null) {\n\t throw new Error('Username and pool information are required.');\n\t }\n\t\n\t this.username = data.Username || '';\n\t this.pool = data.Pool;\n\t this.Session = null;\n\t\n\t this.client = data.Pool.client;\n\t\n\t this.signInUserSession = null;\n\t this.authenticationFlowType = 'USER_SRP_AUTH';\n\t\n\t this.storage = data.Storage || new _StorageHelper2.default().getStorage();\n\t }\n\t\n\t /**\n\t * Sets the session for this user\n\t * @param {CognitoUserSession} signInUserSession the session\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.setSignInUserSession = function setSignInUserSession(signInUserSession) {\n\t this.clearCachedTokens();\n\t this.signInUserSession = signInUserSession;\n\t this.cacheTokens();\n\t };\n\t\n\t /**\n\t * @returns {CognitoUserSession} the current session for this user\n\t */\n\t\n\t\n\t CognitoUser.prototype.getSignInUserSession = function getSignInUserSession() {\n\t return this.signInUserSession;\n\t };\n\t\n\t /**\n\t * @returns {string} the user's username\n\t */\n\t\n\t\n\t CognitoUser.prototype.getUsername = function getUsername() {\n\t return this.username;\n\t };\n\t\n\t /**\n\t * @returns {String} the authentication flow type\n\t */\n\t\n\t\n\t CognitoUser.prototype.getAuthenticationFlowType = function getAuthenticationFlowType() {\n\t return this.authenticationFlowType;\n\t };\n\t\n\t /**\n\t * sets authentication flow type\n\t * @param {string} authenticationFlowType New value.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.setAuthenticationFlowType = function setAuthenticationFlowType(authenticationFlowType) {\n\t this.authenticationFlowType = authenticationFlowType;\n\t };\n\t\n\t /**\n\t * This is used for authenticating the user through the custom authentication flow.\n\t * @param {AuthenticationDetails} authDetails Contains the authentication data\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {customChallenge} callback.customChallenge Custom challenge\n\t * response required to continue.\n\t * @param {authSuccess} callback.onSuccess Called on success with the new session.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.initiateAuth = function initiateAuth(authDetails, callback) {\n\t var _this = this;\n\t\n\t var authParameters = authDetails.getAuthParameters();\n\t authParameters.USERNAME = this.username;\n\t\n\t var jsonReq = {\n\t AuthFlow: 'CUSTOM_AUTH',\n\t ClientId: this.pool.getClientId(),\n\t AuthParameters: authParameters,\n\t ClientMetadata: authDetails.getValidationData()\n\t };\n\t if (this.getUserContextData()) {\n\t jsonReq.UserContextData = this.getUserContextData();\n\t }\n\t\n\t this.client.makeUnauthenticatedRequest('initiateAuth', jsonReq, function (err, data) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t var challengeName = data.ChallengeName;\n\t var challengeParameters = data.ChallengeParameters;\n\t\n\t if (challengeName === 'CUSTOM_CHALLENGE') {\n\t _this.Session = data.Session;\n\t return callback.customChallenge(challengeParameters);\n\t }\n\t _this.signInUserSession = _this.getCognitoUserSession(data.AuthenticationResult);\n\t _this.cacheTokens();\n\t return callback.onSuccess(_this.signInUserSession);\n\t });\n\t };\n\t\n\t /**\n\t * This is used for authenticating the user. it calls the AuthenticationHelper for SRP related\n\t * stuff\n\t * @param {AuthenticationDetails} authDetails Contains the authentication data\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {newPasswordRequired} callback.newPasswordRequired new\n\t * password and any required attributes are required to continue\n\t * @param {mfaRequired} callback.mfaRequired MFA code\n\t * required to continue.\n\t * @param {customChallenge} callback.customChallenge Custom challenge\n\t * response required to continue.\n\t * @param {authSuccess} callback.onSuccess Called on success with the new session.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.authenticateUser = function authenticateUser(authDetails, callback) {\n\t var _this2 = this;\n\t\n\t var authenticationHelper = new _AuthenticationHelper2.default(this.pool.getUserPoolId().split('_')[1]);\n\t var dateHelper = new _DateHelper2.default();\n\t\n\t var serverBValue = void 0;\n\t var salt = void 0;\n\t var authParameters = {};\n\t\n\t if (this.deviceKey != null) {\n\t authParameters.DEVICE_KEY = this.deviceKey;\n\t }\n\t\n\t authParameters.USERNAME = this.username;\n\t authenticationHelper.getLargeAValue(function (errOnAValue, aValue) {\n\t // getLargeAValue callback start\n\t if (errOnAValue) {\n\t callback.onFailure(errOnAValue);\n\t }\n\t\n\t authParameters.SRP_A = aValue.toString(16);\n\t\n\t if (_this2.authenticationFlowType === 'CUSTOM_AUTH') {\n\t authParameters.CHALLENGE_NAME = 'SRP_A';\n\t }\n\t\n\t var jsonReq = {\n\t AuthFlow: _this2.authenticationFlowType,\n\t ClientId: _this2.pool.getClientId(),\n\t AuthParameters: authParameters,\n\t ClientMetadata: authDetails.getValidationData()\n\t };\n\t if (_this2.getUserContextData(_this2.username)) {\n\t jsonReq.UserContextData = _this2.getUserContextData(_this2.username);\n\t }\n\t\n\t _this2.client.makeUnauthenticatedRequest('initiateAuth', jsonReq, function (err, data) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t\n\t var challengeParameters = data.ChallengeParameters;\n\t\n\t _this2.username = challengeParameters.USER_ID_FOR_SRP;\n\t serverBValue = new _BigInteger2.default(challengeParameters.SRP_B, 16);\n\t salt = new _BigInteger2.default(challengeParameters.SALT, 16);\n\t _this2.getCachedDeviceKeyAndPassword();\n\t\n\t authenticationHelper.getPasswordAuthenticationKey(_this2.username, authDetails.getPassword(), serverBValue, salt, function (errOnHkdf, hkdf) {\n\t // getPasswordAuthenticationKey callback start\n\t if (errOnHkdf) {\n\t callback.onFailure(errOnHkdf);\n\t }\n\t\n\t var dateNow = dateHelper.getNowString();\n\t\n\t var signatureString = _global.util.crypto.hmac(hkdf, _global.util.buffer.concat([new _global.util.Buffer(_this2.pool.getUserPoolId().split('_')[1], 'utf8'), new _global.util.Buffer(_this2.username, 'utf8'), new _global.util.Buffer(challengeParameters.SECRET_BLOCK, 'base64'), new _global.util.Buffer(dateNow, 'utf8')]), 'base64', 'sha256');\n\t\n\t var challengeResponses = {};\n\t\n\t challengeResponses.USERNAME = _this2.username;\n\t challengeResponses.PASSWORD_CLAIM_SECRET_BLOCK = challengeParameters.SECRET_BLOCK;\n\t challengeResponses.TIMESTAMP = dateNow;\n\t challengeResponses.PASSWORD_CLAIM_SIGNATURE = signatureString;\n\t\n\t if (_this2.deviceKey != null) {\n\t challengeResponses.DEVICE_KEY = _this2.deviceKey;\n\t }\n\t\n\t var respondToAuthChallenge = function respondToAuthChallenge(challenge, challengeCallback) {\n\t return _this2.client.makeUnauthenticatedRequest('respondToAuthChallenge', challenge, function (errChallenge, dataChallenge) {\n\t if (errChallenge && errChallenge.code === 'ResourceNotFoundException' && errChallenge.message.toLowerCase().indexOf('device') !== -1) {\n\t challengeResponses.DEVICE_KEY = null;\n\t _this2.deviceKey = null;\n\t _this2.randomPassword = null;\n\t _this2.deviceGroupKey = null;\n\t _this2.clearCachedDeviceKeyAndPassword();\n\t return respondToAuthChallenge(challenge, challengeCallback);\n\t }\n\t return challengeCallback(errChallenge, dataChallenge);\n\t });\n\t };\n\t\n\t var jsonReqResp = {\n\t ChallengeName: 'PASSWORD_VERIFIER',\n\t ClientId: _this2.pool.getClientId(),\n\t ChallengeResponses: challengeResponses,\n\t Session: data.Session\n\t };\n\t if (_this2.getUserContextData()) {\n\t jsonReqResp.UserContextData = _this2.getUserContextData();\n\t }\n\t respondToAuthChallenge(jsonReqResp, function (errAuthenticate, dataAuthenticate) {\n\t if (errAuthenticate) {\n\t return callback.onFailure(errAuthenticate);\n\t }\n\t\n\t var challengeName = dataAuthenticate.ChallengeName;\n\t if (challengeName === 'NEW_PASSWORD_REQUIRED') {\n\t _this2.Session = dataAuthenticate.Session;\n\t var userAttributes = null;\n\t var rawRequiredAttributes = null;\n\t var requiredAttributes = [];\n\t var userAttributesPrefix = authenticationHelper.getNewPasswordRequiredChallengeUserAttributePrefix();\n\t\n\t if (dataAuthenticate.ChallengeParameters) {\n\t userAttributes = JSON.parse(dataAuthenticate.ChallengeParameters.userAttributes);\n\t rawRequiredAttributes = JSON.parse(dataAuthenticate.ChallengeParameters.requiredAttributes);\n\t }\n\t\n\t if (rawRequiredAttributes) {\n\t for (var i = 0; i < rawRequiredAttributes.length; i++) {\n\t requiredAttributes[i] = rawRequiredAttributes[i].substr(userAttributesPrefix.length);\n\t }\n\t }\n\t return callback.newPasswordRequired(userAttributes, requiredAttributes);\n\t }\n\t return _this2.authenticateUserInternal(dataAuthenticate, authenticationHelper, callback);\n\t });\n\t return undefined;\n\t // getPasswordAuthenticationKey callback end\n\t });\n\t return undefined;\n\t });\n\t // getLargeAValue callback end\n\t });\n\t };\n\t\n\t /**\n\t * PRIVATE ONLY: This is an internal only method and should not\n\t * be directly called by the consumers.\n\t * @param {object} dataAuthenticate authentication data\n\t * @param {object} authenticationHelper helper created\n\t * @param {callback} callback passed on from caller\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.authenticateUserInternal = function authenticateUserInternal(dataAuthenticate, authenticationHelper, callback) {\n\t var _this3 = this;\n\t\n\t var challengeName = dataAuthenticate.ChallengeName;\n\t var challengeParameters = dataAuthenticate.ChallengeParameters;\n\t\n\t if (challengeName === 'SMS_MFA') {\n\t this.Session = dataAuthenticate.Session;\n\t return callback.mfaRequired(challengeName, challengeParameters);\n\t }\n\t\n\t if (challengeName === 'SELECT_MFA_TYPE') {\n\t this.Session = dataAuthenticate.Session;\n\t return callback.selectMFAType(challengeName, challengeParameters);\n\t }\n\t\n\t if (challengeName === 'MFA_SETUP') {\n\t this.Session = dataAuthenticate.Session;\n\t return callback.mfaSetup(challengeName, challengeParameters);\n\t }\n\t\n\t if (challengeName === 'SOFTWARE_TOKEN_MFA') {\n\t this.Session = dataAuthenticate.Session;\n\t return callback.totpRequired(challengeName, challengeParameters);\n\t }\n\t\n\t if (challengeName === 'CUSTOM_CHALLENGE') {\n\t this.Session = dataAuthenticate.Session;\n\t return callback.customChallenge(challengeParameters);\n\t }\n\t\n\t if (challengeName === 'DEVICE_SRP_AUTH') {\n\t this.getDeviceResponse(callback);\n\t return undefined;\n\t }\n\t\n\t this.signInUserSession = this.getCognitoUserSession(dataAuthenticate.AuthenticationResult);\n\t this.cacheTokens();\n\t\n\t var newDeviceMetadata = dataAuthenticate.AuthenticationResult.NewDeviceMetadata;\n\t if (newDeviceMetadata == null) {\n\t return callback.onSuccess(this.signInUserSession);\n\t }\n\t\n\t authenticationHelper.generateHashDevice(dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey, dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey, function (errGenHash) {\n\t if (errGenHash) {\n\t return callback.onFailure(errGenHash);\n\t }\n\t\n\t var deviceSecretVerifierConfig = {\n\t Salt: new _global.util.Buffer(authenticationHelper.getSaltDevices(), 'hex').toString('base64'),\n\t PasswordVerifier: new _global.util.Buffer(authenticationHelper.getVerifierDevices(), 'hex').toString('base64')\n\t };\n\t\n\t _this3.verifierDevices = deviceSecretVerifierConfig.PasswordVerifier;\n\t _this3.deviceGroupKey = newDeviceMetadata.DeviceGroupKey;\n\t _this3.randomPassword = authenticationHelper.getRandomPassword();\n\t\n\t _this3.client.makeUnauthenticatedRequest('confirmDevice', {\n\t DeviceKey: newDeviceMetadata.DeviceKey,\n\t AccessToken: _this3.signInUserSession.getAccessToken().getJwtToken(),\n\t DeviceSecretVerifierConfig: deviceSecretVerifierConfig,\n\t DeviceName: navigator.userAgent\n\t }, function (errConfirm, dataConfirm) {\n\t if (errConfirm) {\n\t return callback.onFailure(errConfirm);\n\t }\n\t\n\t _this3.deviceKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey;\n\t _this3.cacheDeviceKeyAndPassword();\n\t if (dataConfirm.UserConfirmationNecessary === true) {\n\t return callback.onSuccess(_this3.signInUserSession, dataConfirm.UserConfirmationNecessary);\n\t }\n\t return callback.onSuccess(_this3.signInUserSession);\n\t });\n\t return undefined;\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This method is user to complete the NEW_PASSWORD_REQUIRED challenge.\n\t * Pass the new password with any new user attributes to be updated.\n\t * User attribute keys must be of format userAttributes..\n\t * @param {string} newPassword new password for this user\n\t * @param {object} requiredAttributeData map with values for all required attributes\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {mfaRequired} callback.mfaRequired MFA code required to continue.\n\t * @param {customChallenge} callback.customChallenge Custom challenge\n\t * response required to continue.\n\t * @param {authSuccess} callback.onSuccess Called on success with the new session.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.completeNewPasswordChallenge = function completeNewPasswordChallenge(newPassword, requiredAttributeData, callback) {\n\t var _this4 = this;\n\t\n\t if (!newPassword) {\n\t return callback.onFailure(new Error('New password is required.'));\n\t }\n\t var authenticationHelper = new _AuthenticationHelper2.default(this.pool.getUserPoolId().split('_')[1]);\n\t var userAttributesPrefix = authenticationHelper.getNewPasswordRequiredChallengeUserAttributePrefix();\n\t\n\t var finalUserAttributes = {};\n\t if (requiredAttributeData) {\n\t Object.keys(requiredAttributeData).forEach(function (key) {\n\t finalUserAttributes[userAttributesPrefix + key] = requiredAttributeData[key];\n\t });\n\t }\n\t\n\t finalUserAttributes.NEW_PASSWORD = newPassword;\n\t finalUserAttributes.USERNAME = this.username;\n\t var jsonReq = {\n\t ChallengeName: 'NEW_PASSWORD_REQUIRED',\n\t ClientId: this.pool.getClientId(),\n\t ChallengeResponses: finalUserAttributes,\n\t Session: this.Session\n\t };\n\t if (this.getUserContextData()) {\n\t jsonReq.UserContextData = this.getUserContextData();\n\t }\n\t\n\t this.client.makeUnauthenticatedRequest('respondToAuthChallenge', jsonReq, function (errAuthenticate, dataAuthenticate) {\n\t if (errAuthenticate) {\n\t return callback.onFailure(errAuthenticate);\n\t }\n\t return _this4.authenticateUserInternal(dataAuthenticate, authenticationHelper, callback);\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used to get a session using device authentication. It is called at the end of user\n\t * authentication\n\t *\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {authSuccess} callback.onSuccess Called on success with the new session.\n\t * @returns {void}\n\t * @private\n\t */\n\t\n\t\n\t CognitoUser.prototype.getDeviceResponse = function getDeviceResponse(callback) {\n\t var _this5 = this;\n\t\n\t var authenticationHelper = new _AuthenticationHelper2.default(this.deviceGroupKey);\n\t var dateHelper = new _DateHelper2.default();\n\t\n\t var authParameters = {};\n\t\n\t authParameters.USERNAME = this.username;\n\t authParameters.DEVICE_KEY = this.deviceKey;\n\t authenticationHelper.getLargeAValue(function (errAValue, aValue) {\n\t // getLargeAValue callback start\n\t if (errAValue) {\n\t callback.onFailure(errAValue);\n\t }\n\t\n\t authParameters.SRP_A = aValue.toString(16);\n\t\n\t var jsonReq = {\n\t ChallengeName: 'DEVICE_SRP_AUTH',\n\t ClientId: _this5.pool.getClientId(),\n\t ChallengeResponses: authParameters\n\t };\n\t if (_this5.getUserContextData()) {\n\t jsonReq.UserContextData = _this5.getUserContextData();\n\t }\n\t _this5.client.makeUnauthenticatedRequest('respondToAuthChallenge', jsonReq, function (err, data) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t\n\t var challengeParameters = data.ChallengeParameters;\n\t\n\t var serverBValue = new _BigInteger2.default(challengeParameters.SRP_B, 16);\n\t var salt = new _BigInteger2.default(challengeParameters.SALT, 16);\n\t\n\t authenticationHelper.getPasswordAuthenticationKey(_this5.deviceKey, _this5.randomPassword, serverBValue, salt, function (errHkdf, hkdf) {\n\t // getPasswordAuthenticationKey callback start\n\t if (errHkdf) {\n\t return callback.onFailure(errHkdf);\n\t }\n\t\n\t var dateNow = dateHelper.getNowString();\n\t\n\t var signatureString = _global.util.crypto.hmac(hkdf, _global.util.buffer.concat([new _global.util.Buffer(_this5.deviceGroupKey, 'utf8'), new _global.util.Buffer(_this5.deviceKey, 'utf8'), new _global.util.Buffer(challengeParameters.SECRET_BLOCK, 'base64'), new _global.util.Buffer(dateNow, 'utf8')]), 'base64', 'sha256');\n\t\n\t var challengeResponses = {};\n\t\n\t challengeResponses.USERNAME = _this5.username;\n\t challengeResponses.PASSWORD_CLAIM_SECRET_BLOCK = challengeParameters.SECRET_BLOCK;\n\t challengeResponses.TIMESTAMP = dateNow;\n\t challengeResponses.PASSWORD_CLAIM_SIGNATURE = signatureString;\n\t challengeResponses.DEVICE_KEY = _this5.deviceKey;\n\t\n\t var jsonReqResp = {\n\t ChallengeName: 'DEVICE_PASSWORD_VERIFIER',\n\t ClientId: _this5.pool.getClientId(),\n\t ChallengeResponses: challengeResponses,\n\t Session: data.Session\n\t };\n\t if (_this5.getUserContextData()) {\n\t jsonReqResp.UserContextData = _this5.getUserContextData();\n\t }\n\t\n\t _this5.client.makeUnauthenticatedRequest('respondToAuthChallenge', jsonReqResp, function (errAuthenticate, dataAuthenticate) {\n\t if (errAuthenticate) {\n\t return callback.onFailure(errAuthenticate);\n\t }\n\t\n\t _this5.signInUserSession = _this5.getCognitoUserSession(dataAuthenticate.AuthenticationResult);\n\t _this5.cacheTokens();\n\t\n\t return callback.onSuccess(_this5.signInUserSession);\n\t });\n\t return undefined;\n\t // getPasswordAuthenticationKey callback end\n\t });\n\t return undefined;\n\t });\n\t // getLargeAValue callback end\n\t });\n\t };\n\t\n\t /**\n\t * This is used for a certain user to confirm the registration by using a confirmation code\n\t * @param {string} confirmationCode Code entered by user.\n\t * @param {bool} forceAliasCreation Allow migrating from an existing email / phone number.\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.confirmRegistration = function confirmRegistration(confirmationCode, forceAliasCreation, callback) {\n\t var jsonReq = {\n\t ClientId: this.pool.getClientId(),\n\t ConfirmationCode: confirmationCode,\n\t Username: this.username,\n\t ForceAliasCreation: forceAliasCreation\n\t };\n\t if (this.getUserContextData()) {\n\t jsonReq.UserContextData = this.getUserContextData();\n\t }\n\t this.client.makeUnauthenticatedRequest('confirmSignUp', jsonReq, function (err) {\n\t if (err) {\n\t return callback(err, null);\n\t }\n\t return callback(null, 'SUCCESS');\n\t });\n\t };\n\t\n\t /**\n\t * This is used by the user once he has the responses to a custom challenge\n\t * @param {string} answerChallenge The custom challange answer.\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {customChallenge} callback.customChallenge\n\t * Custom challenge response required to continue.\n\t * @param {authSuccess} callback.onSuccess Called on success with the new session.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.sendCustomChallengeAnswer = function sendCustomChallengeAnswer(answerChallenge, callback) {\n\t var _this6 = this;\n\t\n\t var challengeResponses = {};\n\t challengeResponses.USERNAME = this.username;\n\t challengeResponses.ANSWER = answerChallenge;\n\t\n\t var authenticationHelper = new _AuthenticationHelper2.default(this.pool.getUserPoolId().split('_')[1]);\n\t this.getCachedDeviceKeyAndPassword();\n\t if (this.deviceKey != null) {\n\t challengeResponses.DEVICE_KEY = this.deviceKey;\n\t }\n\t\n\t var jsonReq = {\n\t ChallengeName: 'CUSTOM_CHALLENGE',\n\t ChallengeResponses: challengeResponses,\n\t ClientId: this.pool.getClientId(),\n\t Session: this.Session\n\t };\n\t if (this.getUserContextData()) {\n\t jsonReq.UserContextData = this.getUserContextData();\n\t }\n\t this.client.makeUnauthenticatedRequest('respondToAuthChallenge', jsonReq, function (err, data) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t\n\t return _this6.authenticateUserInternal(data, authenticationHelper, callback);\n\t });\n\t };\n\t\n\t /**\n\t * This is used by the user once he has an MFA code\n\t * @param {string} confirmationCode The MFA code entered by the user.\n\t * @param {object} callback Result callback map.\n\t * @param {string} mfaType The mfa we are replying to.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {authSuccess} callback.onSuccess Called on success with the new session.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.sendMFACode = function sendMFACode(confirmationCode, callback, mfaType) {\n\t var _this7 = this;\n\t\n\t var challengeResponses = {};\n\t challengeResponses.USERNAME = this.username;\n\t challengeResponses.SMS_MFA_CODE = confirmationCode;\n\t var mfaTypeSelection = mfaType || 'SMS_MFA';\n\t if (mfaTypeSelection === 'SOFTWARE_TOKEN_MFA') {\n\t challengeResponses.SOFTWARE_TOKEN_MFA_CODE = confirmationCode;\n\t }\n\t\n\t if (this.deviceKey != null) {\n\t challengeResponses.DEVICE_KEY = this.deviceKey;\n\t }\n\t\n\t var jsonReq = {\n\t ChallengeName: mfaTypeSelection,\n\t ChallengeResponses: challengeResponses,\n\t ClientId: this.pool.getClientId(),\n\t Session: this.Session\n\t };\n\t if (this.getUserContextData()) {\n\t jsonReq.UserContextData = this.getUserContextData();\n\t }\n\t\n\t this.client.makeUnauthenticatedRequest('respondToAuthChallenge', jsonReq, function (err, dataAuthenticate) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t\n\t var challengeName = dataAuthenticate.ChallengeName;\n\t\n\t if (challengeName === 'DEVICE_SRP_AUTH') {\n\t _this7.getDeviceResponse(callback);\n\t return undefined;\n\t }\n\t\n\t _this7.signInUserSession = _this7.getCognitoUserSession(dataAuthenticate.AuthenticationResult);\n\t _this7.cacheTokens();\n\t\n\t if (dataAuthenticate.AuthenticationResult.NewDeviceMetadata == null) {\n\t return callback.onSuccess(_this7.signInUserSession);\n\t }\n\t\n\t var authenticationHelper = new _AuthenticationHelper2.default(_this7.pool.getUserPoolId().split('_')[1]);\n\t authenticationHelper.generateHashDevice(dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey, dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey, function (errGenHash) {\n\t if (errGenHash) {\n\t return callback.onFailure(errGenHash);\n\t }\n\t\n\t var deviceSecretVerifierConfig = {\n\t Salt: new _global.util.Buffer(authenticationHelper.getSaltDevices(), 'hex').toString('base64'),\n\t PasswordVerifier: new _global.util.Buffer(authenticationHelper.getVerifierDevices(), 'hex').toString('base64')\n\t };\n\t\n\t _this7.verifierDevices = deviceSecretVerifierConfig.PasswordVerifier;\n\t _this7.deviceGroupKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey;\n\t _this7.randomPassword = authenticationHelper.getRandomPassword();\n\t\n\t _this7.client.makeUnauthenticatedRequest('confirmDevice', {\n\t DeviceKey: dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey,\n\t AccessToken: _this7.signInUserSession.getAccessToken().getJwtToken(),\n\t DeviceSecretVerifierConfig: deviceSecretVerifierConfig,\n\t DeviceName: navigator.userAgent\n\t }, function (errConfirm, dataConfirm) {\n\t if (errConfirm) {\n\t return callback.onFailure(errConfirm);\n\t }\n\t\n\t _this7.deviceKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey;\n\t _this7.cacheDeviceKeyAndPassword();\n\t if (dataConfirm.UserConfirmationNecessary === true) {\n\t return callback.onSuccess(_this7.signInUserSession, dataConfirm.UserConfirmationNecessary);\n\t }\n\t return callback.onSuccess(_this7.signInUserSession);\n\t });\n\t return undefined;\n\t });\n\t return undefined;\n\t });\n\t };\n\t\n\t /**\n\t * This is used by an authenticated user to change the current password\n\t * @param {string} oldUserPassword The current password.\n\t * @param {string} newUserPassword The requested new password.\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.changePassword = function changePassword(oldUserPassword, newUserPassword, callback) {\n\t if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n\t return callback(new Error('User is not authenticated'), null);\n\t }\n\t\n\t this.client.makeUnauthenticatedRequest('changePassword', {\n\t PreviousPassword: oldUserPassword,\n\t ProposedPassword: newUserPassword,\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n\t }, function (err) {\n\t if (err) {\n\t return callback(err, null);\n\t }\n\t return callback(null, 'SUCCESS');\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used by an authenticated user to enable MFA for himself\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.enableMFA = function enableMFA(callback) {\n\t if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n\t return callback(new Error('User is not authenticated'), null);\n\t }\n\t\n\t var mfaOptions = [];\n\t var mfaEnabled = {\n\t DeliveryMedium: 'SMS',\n\t AttributeName: 'phone_number'\n\t };\n\t mfaOptions.push(mfaEnabled);\n\t\n\t this.client.makeUnauthenticatedRequest('setUserSettings', {\n\t MFAOptions: mfaOptions,\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n\t }, function (err) {\n\t if (err) {\n\t return callback(err, null);\n\t }\n\t return callback(null, 'SUCCESS');\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used by an authenticated user to enable MFA for himself\n\t * @param {string[]} smsMfaSettings the sms mfa settings\n\t * @param {string[]} softwareTokenMfaSettings the software token mfa settings\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.setUserMfaPreference = function setUserMfaPreference(smsMfaSettings, softwareTokenMfaSettings, callback) {\n\t if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n\t return callback(new Error('User is not authenticated'), null);\n\t }\n\t\n\t this.client.makeUnauthenticatedRequest('setUserMFAPreference', {\n\t SMSMfaSettings: smsMfaSettings,\n\t SoftwareTokenMfaSettings: softwareTokenMfaSettings,\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n\t }, function (err) {\n\t if (err) {\n\t return callback(err, null);\n\t }\n\t return callback(null, 'SUCCESS');\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used by an authenticated user to disable MFA for himself\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.disableMFA = function disableMFA(callback) {\n\t if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n\t return callback(new Error('User is not authenticated'), null);\n\t }\n\t\n\t var mfaOptions = [];\n\t\n\t this.client.makeUnauthenticatedRequest('setUserSettings', {\n\t MFAOptions: mfaOptions,\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n\t }, function (err) {\n\t if (err) {\n\t return callback(err, null);\n\t }\n\t return callback(null, 'SUCCESS');\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used by an authenticated user to delete himself\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.deleteUser = function deleteUser(callback) {\n\t var _this8 = this;\n\t\n\t if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n\t return callback(new Error('User is not authenticated'), null);\n\t }\n\t\n\t this.client.makeUnauthenticatedRequest('deleteUser', {\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n\t }, function (err) {\n\t if (err) {\n\t return callback(err, null);\n\t }\n\t _this8.clearCachedTokens();\n\t return callback(null, 'SUCCESS');\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * @typedef {CognitoUserAttribute | { Name:string, Value:string }} AttributeArg\n\t */\n\t /**\n\t * This is used by an authenticated user to change a list of attributes\n\t * @param {AttributeArg[]} attributes A list of the new user attributes.\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.updateAttributes = function updateAttributes(attributes, callback) {\n\t if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n\t return callback(new Error('User is not authenticated'), null);\n\t }\n\t\n\t this.client.makeUnauthenticatedRequest('updateUserAttributes', {\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n\t UserAttributes: attributes\n\t }, function (err) {\n\t if (err) {\n\t return callback(err, null);\n\t }\n\t return callback(null, 'SUCCESS');\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used by an authenticated user to get a list of attributes\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.getUserAttributes = function getUserAttributes(callback) {\n\t if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n\t return callback(new Error('User is not authenticated'), null);\n\t }\n\t\n\t this.client.makeUnauthenticatedRequest('getUser', {\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n\t }, function (err, userData) {\n\t if (err) {\n\t return callback(err, null);\n\t }\n\t\n\t var attributeList = [];\n\t\n\t for (var i = 0; i < userData.UserAttributes.length; i++) {\n\t var attribute = {\n\t Name: userData.UserAttributes[i].Name,\n\t Value: userData.UserAttributes[i].Value\n\t };\n\t var userAttribute = new _CognitoUserAttribute2.default(attribute);\n\t attributeList.push(userAttribute);\n\t }\n\t\n\t return callback(null, attributeList);\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used by an authenticated user to get the MFAOptions\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.getMFAOptions = function getMFAOptions(callback) {\n\t if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n\t return callback(new Error('User is not authenticated'), null);\n\t }\n\t\n\t this.client.makeUnauthenticatedRequest('getUser', {\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n\t }, function (err, userData) {\n\t if (err) {\n\t return callback(err, null);\n\t }\n\t\n\t return callback(null, userData.MFAOptions);\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used by an authenticated user to delete a list of attributes\n\t * @param {string[]} attributeList Names of the attributes to delete.\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.deleteAttributes = function deleteAttributes(attributeList, callback) {\n\t if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n\t return callback(new Error('User is not authenticated'), null);\n\t }\n\t\n\t this.client.makeUnauthenticatedRequest('deleteUserAttributes', {\n\t UserAttributeNames: attributeList,\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n\t }, function (err) {\n\t if (err) {\n\t return callback(err, null);\n\t }\n\t return callback(null, 'SUCCESS');\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used by a user to resend a confirmation code\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.resendConfirmationCode = function resendConfirmationCode(callback) {\n\t var jsonReq = {\n\t ClientId: this.pool.getClientId(),\n\t Username: this.username\n\t };\n\t\n\t this.client.makeUnauthenticatedRequest('resendConfirmationCode', jsonReq, function (err, result) {\n\t if (err) {\n\t return callback(err, null);\n\t }\n\t return callback(null, result);\n\t });\n\t };\n\t\n\t /**\n\t * This is used to get a session, either from the session object\n\t * or from the local storage, or by using a refresh token\n\t *\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.getSession = function getSession(callback) {\n\t if (this.username == null) {\n\t return callback(new Error('Username is null. Cannot retrieve a new session'), null);\n\t }\n\t\n\t if (this.signInUserSession != null && this.signInUserSession.isValid()) {\n\t return callback(null, this.signInUserSession);\n\t }\n\t\n\t var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId() + '.' + this.username;\n\t var idTokenKey = keyPrefix + '.idToken';\n\t var accessTokenKey = keyPrefix + '.accessToken';\n\t var refreshTokenKey = keyPrefix + '.refreshToken';\n\t var clockDriftKey = keyPrefix + '.clockDrift';\n\t\n\t if (this.storage.getItem(idTokenKey)) {\n\t var idToken = new _CognitoIdToken2.default({\n\t IdToken: this.storage.getItem(idTokenKey)\n\t });\n\t var accessToken = new _CognitoAccessToken2.default({\n\t AccessToken: this.storage.getItem(accessTokenKey)\n\t });\n\t var refreshToken = new _CognitoRefreshToken2.default({\n\t RefreshToken: this.storage.getItem(refreshTokenKey)\n\t });\n\t var clockDrift = parseInt(this.storage.getItem(clockDriftKey), 0) || 0;\n\t\n\t var sessionData = {\n\t IdToken: idToken,\n\t AccessToken: accessToken,\n\t RefreshToken: refreshToken,\n\t ClockDrift: clockDrift\n\t };\n\t var cachedSession = new _CognitoUserSession2.default(sessionData);\n\t if (cachedSession.isValid()) {\n\t this.signInUserSession = cachedSession;\n\t return callback(null, this.signInUserSession);\n\t }\n\t\n\t if (refreshToken.getToken() == null) {\n\t return callback(new Error('Cannot retrieve a new session. Please authenticate.'), null);\n\t }\n\t\n\t this.refreshSession(refreshToken, callback);\n\t } else {\n\t callback(new Error('Local storage is missing an ID Token, Please authenticate'), null);\n\t }\n\t\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This uses the refreshToken to retrieve a new session\n\t * @param {CognitoRefreshToken} refreshToken A previous session's refresh token.\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.refreshSession = function refreshSession(refreshToken, callback) {\n\t var _this9 = this;\n\t\n\t var authParameters = {};\n\t authParameters.REFRESH_TOKEN = refreshToken.getToken();\n\t var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId();\n\t var lastUserKey = keyPrefix + '.LastAuthUser';\n\t\n\t if (this.storage.getItem(lastUserKey)) {\n\t this.username = this.storage.getItem(lastUserKey);\n\t var deviceKeyKey = keyPrefix + '.' + this.username + '.deviceKey';\n\t this.deviceKey = this.storage.getItem(deviceKeyKey);\n\t authParameters.DEVICE_KEY = this.deviceKey;\n\t }\n\t\n\t var jsonReq = {\n\t ClientId: this.pool.getClientId(),\n\t AuthFlow: 'REFRESH_TOKEN_AUTH',\n\t AuthParameters: authParameters\n\t };\n\t if (this.getUserContextData()) {\n\t jsonReq.UserContextData = this.getUserContextData();\n\t }\n\t this.client.makeUnauthenticatedRequest('initiateAuth', jsonReq, function (err, authResult) {\n\t if (err) {\n\t if (err.code === 'NotAuthorizedException') {\n\t _this9.clearCachedTokens();\n\t }\n\t return callback(err, null);\n\t }\n\t if (authResult) {\n\t var authenticationResult = authResult.AuthenticationResult;\n\t if (!Object.prototype.hasOwnProperty.call(authenticationResult, 'RefreshToken')) {\n\t authenticationResult.RefreshToken = refreshToken.getToken();\n\t }\n\t _this9.signInUserSession = _this9.getCognitoUserSession(authenticationResult);\n\t _this9.cacheTokens();\n\t return callback(null, _this9.signInUserSession);\n\t }\n\t return undefined;\n\t });\n\t };\n\t\n\t /**\n\t * This is used to save the session tokens to local storage\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.cacheTokens = function cacheTokens() {\n\t var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId();\n\t var idTokenKey = keyPrefix + '.' + this.username + '.idToken';\n\t var accessTokenKey = keyPrefix + '.' + this.username + '.accessToken';\n\t var refreshTokenKey = keyPrefix + '.' + this.username + '.refreshToken';\n\t var clockDriftKey = keyPrefix + '.' + this.username + '.clockDrift';\n\t var lastUserKey = keyPrefix + '.LastAuthUser';\n\t\n\t this.storage.setItem(idTokenKey, this.signInUserSession.getIdToken().getJwtToken());\n\t this.storage.setItem(accessTokenKey, this.signInUserSession.getAccessToken().getJwtToken());\n\t this.storage.setItem(refreshTokenKey, this.signInUserSession.getRefreshToken().getToken());\n\t this.storage.setItem(clockDriftKey, '' + this.signInUserSession.getClockDrift());\n\t this.storage.setItem(lastUserKey, this.username);\n\t };\n\t\n\t /**\n\t * This is used to cache the device key and device group and device password\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.cacheDeviceKeyAndPassword = function cacheDeviceKeyAndPassword() {\n\t var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId() + '.' + this.username;\n\t var deviceKeyKey = keyPrefix + '.deviceKey';\n\t var randomPasswordKey = keyPrefix + '.randomPasswordKey';\n\t var deviceGroupKeyKey = keyPrefix + '.deviceGroupKey';\n\t\n\t this.storage.setItem(deviceKeyKey, this.deviceKey);\n\t this.storage.setItem(randomPasswordKey, this.randomPassword);\n\t this.storage.setItem(deviceGroupKeyKey, this.deviceGroupKey);\n\t };\n\t\n\t /**\n\t * This is used to get current device key and device group and device password\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.getCachedDeviceKeyAndPassword = function getCachedDeviceKeyAndPassword() {\n\t var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId() + '.' + this.username;\n\t var deviceKeyKey = keyPrefix + '.deviceKey';\n\t var randomPasswordKey = keyPrefix + '.randomPasswordKey';\n\t var deviceGroupKeyKey = keyPrefix + '.deviceGroupKey';\n\t\n\t if (this.storage.getItem(deviceKeyKey)) {\n\t this.deviceKey = this.storage.getItem(deviceKeyKey);\n\t this.randomPassword = this.storage.getItem(randomPasswordKey);\n\t this.deviceGroupKey = this.storage.getItem(deviceGroupKeyKey);\n\t }\n\t };\n\t\n\t /**\n\t * This is used to clear the device key info from local storage\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.clearCachedDeviceKeyAndPassword = function clearCachedDeviceKeyAndPassword() {\n\t var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId() + '.' + this.username;\n\t var deviceKeyKey = keyPrefix + '.deviceKey';\n\t var randomPasswordKey = keyPrefix + '.randomPasswordKey';\n\t var deviceGroupKeyKey = keyPrefix + '.deviceGroupKey';\n\t\n\t this.storage.removeItem(deviceKeyKey);\n\t this.storage.removeItem(randomPasswordKey);\n\t this.storage.removeItem(deviceGroupKeyKey);\n\t };\n\t\n\t /**\n\t * This is used to clear the session tokens from local storage\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.clearCachedTokens = function clearCachedTokens() {\n\t var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId();\n\t var idTokenKey = keyPrefix + '.' + this.username + '.idToken';\n\t var accessTokenKey = keyPrefix + '.' + this.username + '.accessToken';\n\t var refreshTokenKey = keyPrefix + '.' + this.username + '.refreshToken';\n\t var lastUserKey = keyPrefix + '.LastAuthUser';\n\t\n\t this.storage.removeItem(idTokenKey);\n\t this.storage.removeItem(accessTokenKey);\n\t this.storage.removeItem(refreshTokenKey);\n\t this.storage.removeItem(lastUserKey);\n\t };\n\t\n\t /**\n\t * This is used to build a user session from tokens retrieved in the authentication result\n\t * @param {object} authResult Successful auth response from server.\n\t * @returns {CognitoUserSession} The new user session.\n\t * @private\n\t */\n\t\n\t\n\t CognitoUser.prototype.getCognitoUserSession = function getCognitoUserSession(authResult) {\n\t var idToken = new _CognitoIdToken2.default(authResult);\n\t var accessToken = new _CognitoAccessToken2.default(authResult);\n\t var refreshToken = new _CognitoRefreshToken2.default(authResult);\n\t\n\t var sessionData = {\n\t IdToken: idToken,\n\t AccessToken: accessToken,\n\t RefreshToken: refreshToken\n\t };\n\t\n\t return new _CognitoUserSession2.default(sessionData);\n\t };\n\t\n\t /**\n\t * This is used to initiate a forgot password request\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {inputVerificationCode?} callback.inputVerificationCode\n\t * Optional callback raised instead of onSuccess with response data.\n\t * @param {onSuccess} callback.onSuccess Called on success.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.forgotPassword = function forgotPassword(callback) {\n\t var jsonReq = {\n\t ClientId: this.pool.getClientId(),\n\t Username: this.username\n\t };\n\t if (this.getUserContextData()) {\n\t jsonReq.UserContextData = this.getUserContextData();\n\t }\n\t this.client.makeUnauthenticatedRequest('forgotPassword', jsonReq, function (err, data) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t if (typeof callback.inputVerificationCode === 'function') {\n\t return callback.inputVerificationCode(data);\n\t }\n\t return callback.onSuccess(data);\n\t });\n\t };\n\t\n\t /**\n\t * This is used to confirm a new password using a confirmationCode\n\t * @param {string} confirmationCode Code entered by user.\n\t * @param {string} newPassword Confirm new password.\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {onSuccess} callback.onSuccess Called on success.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.confirmPassword = function confirmPassword(confirmationCode, newPassword, callback) {\n\t var jsonReq = {\n\t ClientId: this.pool.getClientId(),\n\t Username: this.username,\n\t ConfirmationCode: confirmationCode,\n\t Password: newPassword\n\t };\n\t if (this.getUserContextData()) {\n\t jsonReq.UserContextData = this.getUserContextData();\n\t }\n\t this.client.makeUnauthenticatedRequest('confirmForgotPassword', jsonReq, function (err) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t return callback.onSuccess();\n\t });\n\t };\n\t\n\t /**\n\t * This is used to initiate an attribute confirmation request\n\t * @param {string} attributeName User attribute that needs confirmation.\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {inputVerificationCode} callback.inputVerificationCode Called on success.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.getAttributeVerificationCode = function getAttributeVerificationCode(attributeName, callback) {\n\t if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n\t return callback.onFailure(new Error('User is not authenticated'));\n\t }\n\t\n\t this.client.makeUnauthenticatedRequest('getUserAttributeVerificationCode', {\n\t AttributeName: attributeName,\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n\t }, function (err, data) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t if (typeof callback.inputVerificationCode === 'function') {\n\t return callback.inputVerificationCode(data);\n\t }\n\t return callback.onSuccess();\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used to confirm an attribute using a confirmation code\n\t * @param {string} attributeName Attribute being confirmed.\n\t * @param {string} confirmationCode Code entered by user.\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {onSuccess} callback.onSuccess Called on success.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.verifyAttribute = function verifyAttribute(attributeName, confirmationCode, callback) {\n\t if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n\t return callback.onFailure(new Error('User is not authenticated'));\n\t }\n\t\n\t this.client.makeUnauthenticatedRequest('verifyUserAttribute', {\n\t AttributeName: attributeName,\n\t Code: confirmationCode,\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n\t }, function (err) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t return callback.onSuccess('SUCCESS');\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used to get the device information using the current device key\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {onSuccess<*>} callback.onSuccess Called on success with device data.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.getDevice = function getDevice(callback) {\n\t if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n\t return callback.onFailure(new Error('User is not authenticated'));\n\t }\n\t\n\t this.client.makeUnauthenticatedRequest('getDevice', {\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n\t DeviceKey: this.deviceKey\n\t }, function (err, data) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t return callback.onSuccess(data);\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used to forget a specific device\n\t * @param {string} deviceKey Device key.\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {onSuccess} callback.onSuccess Called on success.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.forgetSpecificDevice = function forgetSpecificDevice(deviceKey, callback) {\n\t if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n\t return callback.onFailure(new Error('User is not authenticated'));\n\t }\n\t\n\t this.client.makeUnauthenticatedRequest('forgetDevice', {\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n\t DeviceKey: deviceKey\n\t }, function (err) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t return callback.onSuccess('SUCCESS');\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used to forget the current device\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {onSuccess} callback.onSuccess Called on success.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.forgetDevice = function forgetDevice(callback) {\n\t var _this10 = this;\n\t\n\t this.forgetSpecificDevice(this.deviceKey, {\n\t onFailure: callback.onFailure,\n\t onSuccess: function onSuccess(result) {\n\t _this10.deviceKey = null;\n\t _this10.deviceGroupKey = null;\n\t _this10.randomPassword = null;\n\t _this10.clearCachedDeviceKeyAndPassword();\n\t return callback.onSuccess(result);\n\t }\n\t });\n\t };\n\t\n\t /**\n\t * This is used to set the device status as remembered\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {onSuccess} callback.onSuccess Called on success.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.setDeviceStatusRemembered = function setDeviceStatusRemembered(callback) {\n\t if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n\t return callback.onFailure(new Error('User is not authenticated'));\n\t }\n\t\n\t this.client.makeUnauthenticatedRequest('updateDeviceStatus', {\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n\t DeviceKey: this.deviceKey,\n\t DeviceRememberedStatus: 'remembered'\n\t }, function (err) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t return callback.onSuccess('SUCCESS');\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used to set the device status as not remembered\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {onSuccess} callback.onSuccess Called on success.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.setDeviceStatusNotRemembered = function setDeviceStatusNotRemembered(callback) {\n\t if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n\t return callback.onFailure(new Error('User is not authenticated'));\n\t }\n\t\n\t this.client.makeUnauthenticatedRequest('updateDeviceStatus', {\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n\t DeviceKey: this.deviceKey,\n\t DeviceRememberedStatus: 'not_remembered'\n\t }, function (err) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t return callback.onSuccess('SUCCESS');\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used to list all devices for a user\n\t *\n\t * @param {int} limit the number of devices returned in a call\n\t * @param {string} paginationToken the pagination token in case any was returned before\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {onSuccess<*>} callback.onSuccess Called on success with device list.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.listDevices = function listDevices(limit, paginationToken, callback) {\n\t if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n\t return callback.onFailure(new Error('User is not authenticated'));\n\t }\n\t\n\t this.client.makeUnauthenticatedRequest('listDevices', {\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n\t Limit: limit,\n\t PaginationToken: paginationToken\n\t }, function (err, data) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t return callback.onSuccess(data);\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used to globally revoke all tokens issued to a user\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {onSuccess} callback.onSuccess Called on success.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.globalSignOut = function globalSignOut(callback) {\n\t var _this11 = this;\n\t\n\t if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n\t return callback.onFailure(new Error('User is not authenticated'));\n\t }\n\t\n\t this.client.makeUnauthenticatedRequest('globalSignOut', {\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n\t }, function (err) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t _this11.clearCachedTokens();\n\t return callback.onSuccess('SUCCESS');\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used for the user to signOut of the application and clear the cached tokens.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.signOut = function signOut() {\n\t this.signInUserSession = null;\n\t this.clearCachedTokens();\n\t };\n\t\n\t /**\n\t * This is used by a user trying to select a given MFA\n\t * @param {string} answerChallenge the mfa the user wants\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.sendMFASelectionAnswer = function sendMFASelectionAnswer(answerChallenge, callback) {\n\t var _this12 = this;\n\t\n\t var challengeResponses = {};\n\t challengeResponses.USERNAME = this.username;\n\t challengeResponses.ANSWER = answerChallenge;\n\t\n\t var jsonReq = {\n\t ChallengeName: 'SELECT_MFA_TYPE',\n\t ChallengeResponses: challengeResponses,\n\t ClientId: this.pool.getClientId(),\n\t Session: this.Session\n\t };\n\t if (this.getUserContextData()) {\n\t jsonReq.UserContextData = this.getUserContextData();\n\t }\n\t this.client.makeUnauthenticatedRequest('respondToAuthChallenge', jsonReq, function (err, data) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t _this12.Session = data.Session;\n\t if (answerChallenge === 'SMS_MFA') {\n\t return callback.mfaRequired(data.challengeName, data.challengeParameters);\n\t }\n\t if (answerChallenge === 'SOFTWARE_TOKEN_MFA') {\n\t return callback.totpRequired(data.challengeName, data.challengeParameters);\n\t }\n\t return undefined;\n\t });\n\t };\n\t\n\t /**\n\t * This returns the user context data for advanced security feature.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.getUserContextData = function getUserContextData() {\n\t var pool = this.pool;\n\t return pool.getUserContextData(this.username);\n\t };\n\t\n\t /**\n\t * This is used by an authenticated or a user trying to authenticate to associate a TOTP MFA\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.associateSoftwareToken = function associateSoftwareToken(callback) {\n\t var _this13 = this;\n\t\n\t if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n\t this.client.makeUnauthenticatedRequest('associateSoftwareToken', {\n\t Session: this.Session\n\t }, function (err, data) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t _this13.Session = data.Session;\n\t return callback.associateSecretCode(data.SecretCode);\n\t });\n\t } else {\n\t this.client.makeUnauthenticatedRequest('associateSoftwareToken', {\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n\t }, function (err, data) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t return callback.associateSecretCode(data.SecretCode);\n\t });\n\t }\n\t };\n\t\n\t /**\n\t * This is used by an authenticated or a user trying to authenticate to associate a TOTP MFA\n\t * @param {string} totpCode The MFA code entered by the user.\n\t * @param {string} friendlyDeviceName The device name we are assigning to the device.\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.verifySoftwareToken = function verifySoftwareToken(totpCode, friendlyDeviceName, callback) {\n\t var _this14 = this;\n\t\n\t if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n\t this.client.makeUnauthenticatedRequest('verifySoftwareToken', {\n\t Session: this.Session,\n\t UserCode: totpCode,\n\t FriendlyDeviceName: friendlyDeviceName\n\t }, function (err, data) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t _this14.Session = data.Session;\n\t var challengeResponses = {};\n\t challengeResponses.USERNAME = _this14.username;\n\t var jsonReq = {\n\t ChallengeName: 'MFA_SETUP',\n\t ClientId: _this14.pool.getClientId(),\n\t ChallengeResponses: challengeResponses,\n\t Session: _this14.Session\n\t };\n\t if (_this14.getUserContextData()) {\n\t jsonReq.UserContextData = _this14.getUserContextData();\n\t }\n\t _this14.client.makeUnauthenticatedRequest('respondToAuthChallenge', jsonReq, function (errRespond, dataRespond) {\n\t if (errRespond) {\n\t return callback.onFailure(errRespond);\n\t }\n\t _this14.signInUserSession = _this14.getCognitoUserSession(dataRespond.AuthenticationResult);\n\t _this14.cacheTokens();\n\t return callback.onSuccess(_this14.signInUserSession);\n\t });\n\t return undefined;\n\t });\n\t } else {\n\t this.client.makeUnauthenticatedRequest('verifySoftwareToken', {\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n\t UserCode: totpCode,\n\t FriendlyDeviceName: friendlyDeviceName\n\t }, function (err, data) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t return callback(null, data);\n\t });\n\t }\n\t };\n\t\n\t return CognitoUser;\n\t}();\n\t\n\texports.default = CognitoUser;\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*!\n\t * Copyright 2016 Amazon.com,\n\t * Inc. or its affiliates. All Rights Reserved.\n\t *\n\t * Licensed under the Amazon Software License (the \"License\").\n\t * You may not use this file except in compliance with the\n\t * License. A copy of the License is located at\n\t *\n\t * http://aws.amazon.com/asl/\n\t *\n\t * or in the \"license\" file accompanying this file. This file is\n\t * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n\t * CONDITIONS OF ANY KIND, express or implied. See the License\n\t * for the specific language governing permissions and\n\t * limitations under the License.\n\t */\n\t\n\t/** @class */\n\tvar CognitoUserAttribute = function () {\n\t /**\n\t * Constructs a new CognitoUserAttribute object\n\t * @param {string=} Name The record's name\n\t * @param {string=} Value The record's value\n\t */\n\t function CognitoUserAttribute() {\n\t var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n\t Name = _ref.Name,\n\t Value = _ref.Value;\n\t\n\t _classCallCheck(this, CognitoUserAttribute);\n\t\n\t this.Name = Name || '';\n\t this.Value = Value || '';\n\t }\n\t\n\t /**\n\t * @returns {string} the record's value.\n\t */\n\t\n\t\n\t CognitoUserAttribute.prototype.getValue = function getValue() {\n\t return this.Value;\n\t };\n\t\n\t /**\n\t * Sets the record's value.\n\t * @param {string} value The new value.\n\t * @returns {CognitoUserAttribute} The record for method chaining.\n\t */\n\t\n\t\n\t CognitoUserAttribute.prototype.setValue = function setValue(value) {\n\t this.Value = value;\n\t return this;\n\t };\n\t\n\t /**\n\t * @returns {string} the record's name.\n\t */\n\t\n\t\n\t CognitoUserAttribute.prototype.getName = function getName() {\n\t return this.Name;\n\t };\n\t\n\t /**\n\t * Sets the record's name\n\t * @param {string} name The new name.\n\t * @returns {CognitoUserAttribute} The record for method chaining.\n\t */\n\t\n\t\n\t CognitoUserAttribute.prototype.setName = function setName(name) {\n\t this.Name = name;\n\t return this;\n\t };\n\t\n\t /**\n\t * @returns {string} a string representation of the record.\n\t */\n\t\n\t\n\t CognitoUserAttribute.prototype.toString = function toString() {\n\t return JSON.stringify(this);\n\t };\n\t\n\t /**\n\t * @returns {object} a flat object representing the record.\n\t */\n\t\n\t\n\t CognitoUserAttribute.prototype.toJSON = function toJSON() {\n\t return {\n\t Name: this.Name,\n\t Value: this.Value\n\t };\n\t };\n\t\n\t return CognitoUserAttribute;\n\t}();\n\t\n\texports.default = CognitoUserAttribute;\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*!\n\t * Copyright 2016 Amazon.com,\n\t * Inc. or its affiliates. All Rights Reserved.\n\t *\n\t * Licensed under the Amazon Software License (the \"License\").\n\t * You may not use this file except in compliance with the\n\t * License. A copy of the License is located at\n\t *\n\t * http://aws.amazon.com/asl/\n\t *\n\t * or in the \"license\" file accompanying this file. This file is\n\t * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n\t * CONDITIONS OF ANY KIND, express or implied. See the License\n\t * for the specific language governing permissions and\n\t * limitations under the License.\n\t */\n\t\n\t/** @class */\n\tvar CognitoUserSession = function () {\n\t /**\n\t * Constructs a new CognitoUserSession object\n\t * @param {CognitoIdToken} IdToken The session's Id token.\n\t * @param {CognitoRefreshToken=} RefreshToken The session's refresh token.\n\t * @param {CognitoAccessToken} AccessToken The session's access token.\n\t * @param {int} ClockDrift The saved computer's clock drift or undefined to force calculation.\n\t */\n\t function CognitoUserSession() {\n\t var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n\t IdToken = _ref.IdToken,\n\t RefreshToken = _ref.RefreshToken,\n\t AccessToken = _ref.AccessToken,\n\t ClockDrift = _ref.ClockDrift;\n\t\n\t _classCallCheck(this, CognitoUserSession);\n\t\n\t if (AccessToken == null || IdToken == null) {\n\t throw new Error('Id token and Access Token must be present.');\n\t }\n\t\n\t this.idToken = IdToken;\n\t this.refreshToken = RefreshToken;\n\t this.accessToken = AccessToken;\n\t this.clockDrift = ClockDrift === undefined ? this.calculateClockDrift() : ClockDrift;\n\t }\n\t\n\t /**\n\t * @returns {CognitoIdToken} the session's Id token\n\t */\n\t\n\t\n\t CognitoUserSession.prototype.getIdToken = function getIdToken() {\n\t return this.idToken;\n\t };\n\t\n\t /**\n\t * @returns {CognitoRefreshToken} the session's refresh token\n\t */\n\t\n\t\n\t CognitoUserSession.prototype.getRefreshToken = function getRefreshToken() {\n\t return this.refreshToken;\n\t };\n\t\n\t /**\n\t * @returns {CognitoAccessToken} the session's access token\n\t */\n\t\n\t\n\t CognitoUserSession.prototype.getAccessToken = function getAccessToken() {\n\t return this.accessToken;\n\t };\n\t\n\t /**\n\t * @returns {int} the session's clock drift\n\t */\n\t\n\t\n\t CognitoUserSession.prototype.getClockDrift = function getClockDrift() {\n\t return this.clockDrift;\n\t };\n\t\n\t /**\n\t * @returns {int} the computer's clock drift\n\t */\n\t\n\t\n\t CognitoUserSession.prototype.calculateClockDrift = function calculateClockDrift() {\n\t var now = Math.floor(new Date() / 1000);\n\t var iat = Math.min(this.accessToken.getIssuedAt(), this.idToken.getIssuedAt());\n\t\n\t return now - iat;\n\t };\n\t\n\t /**\n\t * Checks to see if the session is still valid based on session expiry information found\n\t * in tokens and the current time (adjusted with clock drift)\n\t * @returns {boolean} if the session is still valid\n\t */\n\t\n\t\n\t CognitoUserSession.prototype.isValid = function isValid() {\n\t var now = Math.floor(new Date() / 1000);\n\t var adjusted = now - this.clockDrift;\n\t\n\t return adjusted < this.accessToken.getExpiration() && adjusted < this.idToken.getExpiration();\n\t };\n\t\n\t return CognitoUserSession;\n\t}();\n\t\n\texports.default = CognitoUserSession;\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*!\n\t * Copyright 2016 Amazon.com,\n\t * Inc. or its affiliates. All Rights Reserved.\n\t *\n\t * Licensed under the Amazon Software License (the \"License\").\n\t * You may not use this file except in compliance with the\n\t * License. A copy of the License is located at\n\t *\n\t * http://aws.amazon.com/asl/\n\t *\n\t * or in the \"license\" file accompanying this file. This file is\n\t * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n\t * CONDITIONS OF ANY KIND, express or implied. See the License\n\t * for the specific language governing permissions and\n\t * limitations under the License.\n\t */\n\t\n\tvar monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n\tvar weekNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\n\t\n\t/** @class */\n\t\n\tvar DateHelper = function () {\n\t function DateHelper() {\n\t _classCallCheck(this, DateHelper);\n\t }\n\t\n\t /**\n\t * @returns {string} The current time in \"ddd MMM D HH:mm:ss UTC YYYY\" format.\n\t */\n\t DateHelper.prototype.getNowString = function getNowString() {\n\t var now = new Date();\n\t\n\t var weekDay = weekNames[now.getUTCDay()];\n\t var month = monthNames[now.getUTCMonth()];\n\t var day = now.getUTCDate();\n\t\n\t var hours = now.getUTCHours();\n\t if (hours < 10) {\n\t hours = '0' + hours;\n\t }\n\t\n\t var minutes = now.getUTCMinutes();\n\t if (minutes < 10) {\n\t minutes = '0' + minutes;\n\t }\n\t\n\t var seconds = now.getUTCSeconds();\n\t if (seconds < 10) {\n\t seconds = '0' + seconds;\n\t }\n\t\n\t var year = now.getUTCFullYear();\n\t\n\t // ddd MMM D HH:mm:ss UTC YYYY\n\t var dateNow = weekDay + ' ' + month + ' ' + day + ' ' + hours + ':' + minutes + ':' + seconds + ' UTC ' + year;\n\t\n\t return dateNow;\n\t };\n\t\n\t return DateHelper;\n\t}();\n\t\n\texports.default = DateHelper;\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*!\n\t * Copyright 2016 Amazon.com,\n\t * Inc. or its affiliates. All Rights Reserved.\n\t *\n\t * Licensed under the Amazon Software License (the \"License\").\n\t * You may not use this file except in compliance with the\n\t * License. A copy of the License is located at\n\t *\n\t * http://aws.amazon.com/asl/\n\t *\n\t * or in the \"license\" file accompanying this file. This file is\n\t * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n\t * CONDITIONS OF ANY KIND, express or implied. See the License\n\t * for the specific language governing permissions and\n\t * limitations under the License.\n\t */\n\t\n\tvar dataMemory = {};\n\t\n\t/** @class */\n\t\n\tvar MemoryStorage = function () {\n\t function MemoryStorage() {\n\t _classCallCheck(this, MemoryStorage);\n\t }\n\t\n\t /**\n\t * This is used to set a specific item in storage\n\t * @param {string} key - the key for the item\n\t * @param {object} value - the value\n\t * @returns {string} value that was set\n\t */\n\t MemoryStorage.setItem = function setItem(key, value) {\n\t dataMemory[key] = value;\n\t return dataMemory[key];\n\t };\n\t\n\t /**\n\t * This is used to get a specific key from storage\n\t * @param {string} key - the key for the item\n\t * This is used to clear the storage\n\t * @returns {string} the data item\n\t */\n\t\n\t\n\t MemoryStorage.getItem = function getItem(key) {\n\t return Object.prototype.hasOwnProperty.call(dataMemory, key) ? dataMemory[key] : undefined;\n\t };\n\t\n\t /**\n\t * This is used to remove an item from storage\n\t * @param {string} key - the key being set\n\t * @returns {string} value - value that was deleted\n\t */\n\t\n\t\n\t MemoryStorage.removeItem = function removeItem(key) {\n\t return delete dataMemory[key];\n\t };\n\t\n\t /**\n\t * This is used to clear the storage\n\t * @returns {string} nothing\n\t */\n\t\n\t\n\t MemoryStorage.clear = function clear() {\n\t dataMemory = {};\n\t return dataMemory;\n\t };\n\t\n\t return MemoryStorage;\n\t}();\n\t\n\t/** @class */\n\t\n\t\n\tvar StorageHelper = function () {\n\t\n\t /**\n\t * This is used to get a storage object\n\t * @returns {object} the storage\n\t */\n\t function StorageHelper() {\n\t _classCallCheck(this, StorageHelper);\n\t\n\t try {\n\t this.storageWindow = window.localStorage;\n\t this.storageWindow.setItem('aws.cognito.test-ls', 1);\n\t this.storageWindow.removeItem('aws.cognito.test-ls');\n\t } catch (exception) {\n\t this.storageWindow = MemoryStorage;\n\t }\n\t }\n\t\n\t /**\n\t * This is used to return the storage\n\t * @returns {object} the storage\n\t */\n\t\n\t\n\t StorageHelper.prototype.getStorage = function getStorage() {\n\t return this.storageWindow;\n\t };\n\t\n\t return StorageHelper;\n\t}();\n\t\n\texports.default = StorageHelper;\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_13__;\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports) {\n\n\t\"use strict\";\n\t\n\texports.__esModule = true;\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*!\n\t * Copyright 2016 Amazon.com,\n\t * Inc. or its affiliates. All Rights Reserved.\n\t *\n\t * Licensed under the Amazon Software License (the \"License\").\n\t * You may not use this file except in compliance with the\n\t * License. A copy of the License is located at\n\t *\n\t * http://aws.amazon.com/asl/\n\t *\n\t * or in the \"license\" file accompanying this file. This file is\n\t * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n\t * CONDITIONS OF ANY KIND, express or implied. See the License\n\t * for the specific language governing permissions and\n\t * limitations under the License.\n\t */\n\t\n\t/** @class */\n\tvar AuthenticationDetails = function () {\n\t /**\n\t * Constructs a new AuthenticationDetails object\n\t * @param {object=} data Creation options.\n\t * @param {string} data.Username User being authenticated.\n\t * @param {string} data.Password Plain-text password to authenticate with.\n\t * @param {(AttributeArg[])?} data.ValidationData Application extra metadata.\n\t * @param {(AttributeArg[])?} data.AuthParamaters Authentication paramaters for custom auth.\n\t */\n\t function AuthenticationDetails(data) {\n\t _classCallCheck(this, AuthenticationDetails);\n\t\n\t var _ref = data || {},\n\t ValidationData = _ref.ValidationData,\n\t Username = _ref.Username,\n\t Password = _ref.Password,\n\t AuthParameters = _ref.AuthParameters;\n\t\n\t this.validationData = ValidationData || [];\n\t this.authParameters = AuthParameters || [];\n\t this.username = Username;\n\t this.password = Password;\n\t }\n\t\n\t /**\n\t * @returns {string} the record's username\n\t */\n\t\n\t\n\t AuthenticationDetails.prototype.getUsername = function getUsername() {\n\t return this.username;\n\t };\n\t\n\t /**\n\t * @returns {string} the record's password\n\t */\n\t\n\t\n\t AuthenticationDetails.prototype.getPassword = function getPassword() {\n\t return this.password;\n\t };\n\t\n\t /**\n\t * @returns {Array} the record's validationData\n\t */\n\t\n\t\n\t AuthenticationDetails.prototype.getValidationData = function getValidationData() {\n\t return this.validationData;\n\t };\n\t\n\t /**\n\t * @returns {Array} the record's authParameters\n\t */\n\t\n\t\n\t AuthenticationDetails.prototype.getAuthParameters = function getAuthParameters() {\n\t return this.authParameters;\n\t };\n\t\n\t return AuthenticationDetails;\n\t}();\n\t\n\texports.default = AuthenticationDetails;\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _cognitoidentityserviceprovider = __webpack_require__(13);\n\t\n\tvar _cognitoidentityserviceprovider2 = _interopRequireDefault(_cognitoidentityserviceprovider);\n\t\n\tvar _CognitoUser = __webpack_require__(8);\n\t\n\tvar _CognitoUser2 = _interopRequireDefault(_CognitoUser);\n\t\n\tvar _StorageHelper = __webpack_require__(12);\n\t\n\tvar _StorageHelper2 = _interopRequireDefault(_StorageHelper);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } } /*!\n\t * Copyright 2016 Amazon.com,\n\t * Inc. or its affiliates. All Rights Reserved.\n\t *\n\t * Licensed under the Amazon Software License (the \"License\").\n\t * You may not use this file except in compliance with the\n\t * License. A copy of the License is located at\n\t *\n\t * http://aws.amazon.com/asl/\n\t *\n\t * or in the \"license\" file accompanying this file. This file is\n\t * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n\t * CONDITIONS OF ANY KIND, express or implied. See the License\n\t * for the specific language governing permissions and\n\t * limitations under the License.\n\t */\n\t\n\t/** @class */\n\tvar CognitoUserPool = function () {\n\t /**\n\t * Constructs a new CognitoUserPool object\n\t * @param {object} data Creation options.\n\t * @param {string} data.UserPoolId Cognito user pool id.\n\t * @param {string} data.ClientId User pool application client id.\n\t * @param {object} data.Storage Optional storage object.\n\t * @param {boolean} data.AdvancedSecurityDataCollectionFlag Optional:\n\t * boolean flag indicating if the data collection is enabled\n\t * to support cognito advanced security features. By default, this\n\t * flag is set to true.\n\t */\n\t function CognitoUserPool(data) {\n\t _classCallCheck(this, CognitoUserPool);\n\t\n\t var _ref = data || {},\n\t UserPoolId = _ref.UserPoolId,\n\t ClientId = _ref.ClientId,\n\t endpoint = _ref.endpoint,\n\t AdvancedSecurityDataCollectionFlag = _ref.AdvancedSecurityDataCollectionFlag;\n\t\n\t if (!UserPoolId || !ClientId) {\n\t throw new Error('Both UserPoolId and ClientId are required.');\n\t }\n\t if (!/^[\\w-]+_.+$/.test(UserPoolId)) {\n\t throw new Error('Invalid UserPoolId format.');\n\t }\n\t var region = UserPoolId.split('_')[0];\n\t\n\t this.userPoolId = UserPoolId;\n\t this.clientId = ClientId;\n\t\n\t this.client = new _cognitoidentityserviceprovider2.default({\n\t apiVersion: '2016-04-19',\n\t region: region,\n\t endpoint: endpoint\n\t });\n\t\n\t /**\n\t * By default, AdvancedSecurityDataCollectionFlag is set to true,\n\t * if no input value is provided.\n\t */\n\t this.advancedSecurityDataCollectionFlag = AdvancedSecurityDataCollectionFlag !== false;\n\t\n\t this.storage = data.Storage || new _StorageHelper2.default().getStorage();\n\t }\n\t\n\t /**\n\t * @returns {string} the user pool id\n\t */\n\t\n\t\n\t CognitoUserPool.prototype.getUserPoolId = function getUserPoolId() {\n\t return this.userPoolId;\n\t };\n\t\n\t /**\n\t * @returns {string} the client id\n\t */\n\t\n\t\n\t CognitoUserPool.prototype.getClientId = function getClientId() {\n\t return this.clientId;\n\t };\n\t\n\t /**\n\t * @typedef {object} SignUpResult\n\t * @property {CognitoUser} user New user.\n\t * @property {bool} userConfirmed If the user is already confirmed.\n\t */\n\t /**\n\t * method for signing up a user\n\t * @param {string} username User's username.\n\t * @param {string} password Plain-text initial password entered by user.\n\t * @param {(AttributeArg[])=} userAttributes New user attributes.\n\t * @param {(AttributeArg[])=} validationData Application metadata.\n\t * @param {nodeCallback} callback Called on error or with the new user.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUserPool.prototype.signUp = function signUp(username, password, userAttributes, validationData, callback) {\n\t var _this = this;\n\t\n\t var jsonReq = {\n\t ClientId: this.clientId,\n\t Username: username,\n\t Password: password,\n\t UserAttributes: userAttributes,\n\t ValidationData: validationData\n\t };\n\t if (this.getUserContextData(username)) {\n\t jsonReq.UserContextData = this.getUserContextData(username);\n\t }\n\t this.client.makeUnauthenticatedRequest('signUp', jsonReq, function (err, data) {\n\t if (err) {\n\t return callback(err, null);\n\t }\n\t\n\t var cognitoUser = {\n\t Username: username,\n\t Pool: _this,\n\t Storage: _this.storage\n\t };\n\t\n\t var returnData = {\n\t user: new _CognitoUser2.default(cognitoUser),\n\t userConfirmed: data.UserConfirmed,\n\t userSub: data.UserSub\n\t };\n\t\n\t return callback(null, returnData);\n\t });\n\t };\n\t\n\t /**\n\t * method for getting the current user of the application from the local storage\n\t *\n\t * @returns {CognitoUser} the user retrieved from storage\n\t */\n\t\n\t\n\t CognitoUserPool.prototype.getCurrentUser = function getCurrentUser() {\n\t var lastUserKey = 'CognitoIdentityServiceProvider.' + this.clientId + '.LastAuthUser';\n\t\n\t var lastAuthUser = this.storage.getItem(lastUserKey);\n\t if (lastAuthUser) {\n\t var cognitoUser = {\n\t Username: lastAuthUser,\n\t Pool: this,\n\t Storage: this.storage\n\t };\n\t\n\t return new _CognitoUser2.default(cognitoUser);\n\t }\n\t\n\t return null;\n\t };\n\t\n\t /**\n\t * This method returns the encoded data string used for cognito advanced security feature.\n\t * This would be generated only when developer has included the JS used for collecting the\n\t * data on their client. Please refer to documentation to know more about using AdvancedSecurity\n\t * features\n\t * @param {string} username the username for the context data\n\t * @returns {string} the user context data\n\t **/\n\t\n\t\n\t CognitoUserPool.prototype.getUserContextData = function getUserContextData(username) {\n\t if (typeof AmazonCognitoAdvancedSecurityData === 'undefined') {\n\t return undefined;\n\t }\n\t /* eslint-disable */\n\t var amazonCognitoAdvancedSecurityDataConst = AmazonCognitoAdvancedSecurityData;\n\t /* eslint-enable */\n\t\n\t if (this.advancedSecurityDataCollectionFlag) {\n\t var advancedSecurityData = amazonCognitoAdvancedSecurityDataConst.getData(username, this.userPoolId, this.clientId);\n\t if (advancedSecurityData) {\n\t var userContextData = {\n\t EncodedData: advancedSecurityData\n\t };\n\t return userContextData;\n\t }\n\t }\n\t return {};\n\t };\n\t\n\t return CognitoUserPool;\n\t}();\n\t\n\texports.default = CognitoUserPool;\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _jsCookie = __webpack_require__(18);\n\t\n\tvar Cookies = _interopRequireWildcard(_jsCookie);\n\t\n\tfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/** @class */\n\tvar CookieStorage = function () {\n\t\n\t /**\n\t * Constructs a new CookieStorage object\n\t * @param {object} data Creation options.\n\t * @param {string} data.domain Cookies domain (mandatory).\n\t * @param {string} data.path Cookies path (default: '/')\n\t * @param {integer} data.expires Cookie expiration (in days, default: 365)\n\t * @param {boolean} data.secure Cookie secure flag (default: true)\n\t */\n\t function CookieStorage(data) {\n\t _classCallCheck(this, CookieStorage);\n\t\n\t this.domain = data.domain;\n\t if (data.path) {\n\t this.path = data.path;\n\t } else {\n\t this.path = '/';\n\t }\n\t if (Object.prototype.hasOwnProperty.call(data, 'expires')) {\n\t this.expires = data.expires;\n\t } else {\n\t this.expires = 365;\n\t }\n\t if (Object.prototype.hasOwnProperty.call(data, 'secure')) {\n\t this.secure = data.secure;\n\t } else {\n\t this.secure = true;\n\t }\n\t }\n\t\n\t /**\n\t * This is used to set a specific item in storage\n\t * @param {string} key - the key for the item\n\t * @param {object} value - the value\n\t * @returns {string} value that was set\n\t */\n\t\n\t\n\t CookieStorage.prototype.setItem = function setItem(key, value) {\n\t Cookies.set(key, value, {\n\t path: this.path,\n\t expires: this.expires,\n\t domain: this.domain,\n\t secure: this.secure\n\t });\n\t return Cookies.get(key);\n\t };\n\t\n\t /**\n\t * This is used to get a specific key from storage\n\t * @param {string} key - the key for the item\n\t * This is used to clear the storage\n\t * @returns {string} the data item\n\t */\n\t\n\t\n\t CookieStorage.prototype.getItem = function getItem(key) {\n\t return Cookies.get(key);\n\t };\n\t\n\t /**\n\t * This is used to remove an item from storage\n\t * @param {string} key - the key being set\n\t * @returns {string} value - value that was deleted\n\t */\n\t\n\t\n\t CookieStorage.prototype.removeItem = function removeItem(key) {\n\t return Cookies.remove(key, {\n\t path: this.path,\n\t domain: this.domain,\n\t secure: this.secure\n\t });\n\t };\n\t\n\t /**\n\t * This is used to clear the storage\n\t * @returns {string} nothing\n\t */\n\t\n\t\n\t CookieStorage.prototype.clear = function clear() {\n\t var cookies = Cookies.get();\n\t var index = void 0;\n\t for (index = 0; index < cookies.length; ++index) {\n\t Cookies.remove(cookies[index]);\n\t }\n\t return {};\n\t };\n\t\n\t return CookieStorage;\n\t}();\n\t\n\texports.default = CookieStorage;\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _AuthenticationDetails = __webpack_require__(14);\n\t\n\tObject.defineProperty(exports, 'AuthenticationDetails', {\n\t enumerable: true,\n\t get: function get() {\n\t return _interopRequireDefault(_AuthenticationDetails).default;\n\t }\n\t});\n\t\n\tvar _AuthenticationHelper = __webpack_require__(2);\n\t\n\tObject.defineProperty(exports, 'AuthenticationHelper', {\n\t enumerable: true,\n\t get: function get() {\n\t return _interopRequireDefault(_AuthenticationHelper).default;\n\t }\n\t});\n\t\n\tvar _CognitoAccessToken = __webpack_require__(4);\n\t\n\tObject.defineProperty(exports, 'CognitoAccessToken', {\n\t enumerable: true,\n\t get: function get() {\n\t return _interopRequireDefault(_CognitoAccessToken).default;\n\t }\n\t});\n\t\n\tvar _CognitoIdToken = __webpack_require__(5);\n\t\n\tObject.defineProperty(exports, 'CognitoIdToken', {\n\t enumerable: true,\n\t get: function get() {\n\t return _interopRequireDefault(_CognitoIdToken).default;\n\t }\n\t});\n\t\n\tvar _CognitoRefreshToken = __webpack_require__(7);\n\t\n\tObject.defineProperty(exports, 'CognitoRefreshToken', {\n\t enumerable: true,\n\t get: function get() {\n\t return _interopRequireDefault(_CognitoRefreshToken).default;\n\t }\n\t});\n\t\n\tvar _CognitoUser = __webpack_require__(8);\n\t\n\tObject.defineProperty(exports, 'CognitoUser', {\n\t enumerable: true,\n\t get: function get() {\n\t return _interopRequireDefault(_CognitoUser).default;\n\t }\n\t});\n\t\n\tvar _CognitoUserAttribute = __webpack_require__(9);\n\t\n\tObject.defineProperty(exports, 'CognitoUserAttribute', {\n\t enumerable: true,\n\t get: function get() {\n\t return _interopRequireDefault(_CognitoUserAttribute).default;\n\t }\n\t});\n\t\n\tvar _CognitoUserPool = __webpack_require__(15);\n\t\n\tObject.defineProperty(exports, 'CognitoUserPool', {\n\t enumerable: true,\n\t get: function get() {\n\t return _interopRequireDefault(_CognitoUserPool).default;\n\t }\n\t});\n\t\n\tvar _CognitoUserSession = __webpack_require__(10);\n\t\n\tObject.defineProperty(exports, 'CognitoUserSession', {\n\t enumerable: true,\n\t get: function get() {\n\t return _interopRequireDefault(_CognitoUserSession).default;\n\t }\n\t});\n\t\n\tvar _CookieStorage = __webpack_require__(16);\n\t\n\tObject.defineProperty(exports, 'CookieStorage', {\n\t enumerable: true,\n\t get: function get() {\n\t return _interopRequireDefault(_CookieStorage).default;\n\t }\n\t});\n\t\n\tvar _DateHelper = __webpack_require__(11);\n\t\n\tObject.defineProperty(exports, 'DateHelper', {\n\t enumerable: true,\n\t get: function get() {\n\t return _interopRequireDefault(_DateHelper).default;\n\t }\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t// The version of crypto-browserify included by aws-sdk only\n\t// checks for window.crypto, not window.msCrypto as used by\n\t// IE 11 – so we set it explicitly here\n\tif (typeof window !== 'undefined' && !window.crypto && window.msCrypto) {\n\t window.crypto = window.msCrypto;\n\t}\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n\t * JavaScript Cookie v2.2.0\n\t * https://github.com/js-cookie/js-cookie\n\t *\n\t * Copyright 2006, 2015 Klaus Hartl & Fagner Brack\n\t * Released under the MIT license\n\t */\n\t;(function (factory) {\n\t\tvar registeredInModuleLoader = false;\n\t\tif (true) {\n\t\t\t!(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t\t\tregisteredInModuleLoader = true;\n\t\t}\n\t\tif (true) {\n\t\t\tmodule.exports = factory();\n\t\t\tregisteredInModuleLoader = true;\n\t\t}\n\t\tif (!registeredInModuleLoader) {\n\t\t\tvar OldCookies = window.Cookies;\n\t\t\tvar api = window.Cookies = factory();\n\t\t\tapi.noConflict = function () {\n\t\t\t\twindow.Cookies = OldCookies;\n\t\t\t\treturn api;\n\t\t\t};\n\t\t}\n\t}(function () {\n\t\tfunction extend () {\n\t\t\tvar i = 0;\n\t\t\tvar result = {};\n\t\t\tfor (; i < arguments.length; i++) {\n\t\t\t\tvar attributes = arguments[ i ];\n\t\t\t\tfor (var key in attributes) {\n\t\t\t\t\tresult[key] = attributes[key];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\n\t\tfunction init (converter) {\n\t\t\tfunction api (key, value, attributes) {\n\t\t\t\tvar result;\n\t\t\t\tif (typeof document === 'undefined') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\n\t\t\t\t// Write\n\t\n\t\t\t\tif (arguments.length > 1) {\n\t\t\t\t\tattributes = extend({\n\t\t\t\t\t\tpath: '/'\n\t\t\t\t\t}, api.defaults, attributes);\n\t\n\t\t\t\t\tif (typeof attributes.expires === 'number') {\n\t\t\t\t\t\tvar expires = new Date();\n\t\t\t\t\t\texpires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);\n\t\t\t\t\t\tattributes.expires = expires;\n\t\t\t\t\t}\n\t\n\t\t\t\t\t// We're using \"expires\" because \"max-age\" is not supported by IE\n\t\t\t\t\tattributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';\n\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\tresult = JSON.stringify(value);\n\t\t\t\t\t\tif (/^[\\{\\[]/.test(result)) {\n\t\t\t\t\t\t\tvalue = result;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {}\n\t\n\t\t\t\t\tif (!converter.write) {\n\t\t\t\t\t\tvalue = encodeURIComponent(String(value))\n\t\t\t\t\t\t\t.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvalue = converter.write(value, key);\n\t\t\t\t\t}\n\t\n\t\t\t\t\tkey = encodeURIComponent(String(key));\n\t\t\t\t\tkey = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);\n\t\t\t\t\tkey = key.replace(/[\\(\\)]/g, escape);\n\t\n\t\t\t\t\tvar stringifiedAttributes = '';\n\t\n\t\t\t\t\tfor (var attributeName in attributes) {\n\t\t\t\t\t\tif (!attributes[attributeName]) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstringifiedAttributes += '; ' + attributeName;\n\t\t\t\t\t\tif (attributes[attributeName] === true) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstringifiedAttributes += '=' + attributes[attributeName];\n\t\t\t\t\t}\n\t\t\t\t\treturn (document.cookie = key + '=' + value + stringifiedAttributes);\n\t\t\t\t}\n\t\n\t\t\t\t// Read\n\t\n\t\t\t\tif (!key) {\n\t\t\t\t\tresult = {};\n\t\t\t\t}\n\t\n\t\t\t\t// To prevent the for loop in the first place assign an empty array\n\t\t\t\t// in case there are no cookies at all. Also prevents odd result when\n\t\t\t\t// calling \"get()\"\n\t\t\t\tvar cookies = document.cookie ? document.cookie.split('; ') : [];\n\t\t\t\tvar rdecode = /(%[0-9A-Z]{2})+/g;\n\t\t\t\tvar i = 0;\n\t\n\t\t\t\tfor (; i < cookies.length; i++) {\n\t\t\t\t\tvar parts = cookies[i].split('=');\n\t\t\t\t\tvar cookie = parts.slice(1).join('=');\n\t\n\t\t\t\t\tif (!this.json && cookie.charAt(0) === '\"') {\n\t\t\t\t\t\tcookie = cookie.slice(1, -1);\n\t\t\t\t\t}\n\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar name = parts[0].replace(rdecode, decodeURIComponent);\n\t\t\t\t\t\tcookie = converter.read ?\n\t\t\t\t\t\t\tconverter.read(cookie, name) : converter(cookie, name) ||\n\t\t\t\t\t\t\tcookie.replace(rdecode, decodeURIComponent);\n\t\n\t\t\t\t\t\tif (this.json) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tcookie = JSON.parse(cookie);\n\t\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\tif (key === name) {\n\t\t\t\t\t\t\tresult = cookie;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\tif (!key) {\n\t\t\t\t\t\t\tresult[name] = cookie;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {}\n\t\t\t\t}\n\t\n\t\t\t\treturn result;\n\t\t\t}\n\t\n\t\t\tapi.set = api;\n\t\t\tapi.get = function (key) {\n\t\t\t\treturn api.call(api, key);\n\t\t\t};\n\t\t\tapi.getJSON = function () {\n\t\t\t\treturn api.apply({\n\t\t\t\t\tjson: true\n\t\t\t\t}, [].slice.call(arguments));\n\t\t\t};\n\t\t\tapi.defaults = {};\n\t\n\t\t\tapi.remove = function (key, attributes) {\n\t\t\t\tapi(key, '', extend(attributes, {\n\t\t\t\t\texpires: -1\n\t\t\t\t}));\n\t\t\t};\n\t\n\t\t\tapi.withConverter = init;\n\t\n\t\t\treturn api;\n\t\t}\n\t\n\t\treturn init(function () {});\n\t}));\n\n\n/***/ })\n/******/ ])\n});\n;\n\n\n// WEBPACK FOOTER //\n// amazon-cognito-identity.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap a48aa96e8112c5b148ef","import CognitoIdentityServiceProvider from 'aws-sdk/clients/cognitoidentityserviceprovider';\nimport * as enhancements from './src';\n\nexport * from './src';\n\nObject.keys(enhancements).forEach(key => {\n CognitoIdentityServiceProvider[key] = enhancements[key];\n});\n\n\n\n// WEBPACK FOOTER //\n// ./enhance.js","module.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"root\":[\"AWSCognito\"],\"commonjs2\":\"aws-sdk/global\",\"commonjs\":\"aws-sdk/global\",\"amd\":\"aws-sdk/global\"}\n// module id = 1\n// module chunks = 0","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { util } from 'aws-sdk/global';\n\nimport BigInteger from './BigInteger';\n\nconst initN = 'FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1'\n + '29024E088A67CC74020BBEA63B139B22514A08798E3404DD'\n + 'EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245'\n + 'E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED'\n + 'EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D'\n + 'C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F'\n + '83655D23DCA3AD961C62F356208552BB9ED529077096966D'\n + '670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B'\n + 'E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9'\n + 'DE2BCBF6955817183995497CEA956AE515D2261898FA0510'\n + '15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64'\n + 'ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7'\n + 'ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B'\n + 'F12FFA06D98A0864D87602733EC86A64521F2B18177B200C'\n + 'BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31'\n + '43DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF';\n\nconst newPasswordRequiredChallengeUserAttributePrefix = 'userAttributes.';\n\n/** @class */\nexport default class AuthenticationHelper {\n /**\n * Constructs a new AuthenticationHelper object\n * @param {string} PoolName Cognito user pool name.\n */\n constructor(PoolName) {\n this.N = new BigInteger(initN, 16);\n this.g = new BigInteger('2', 16);\n this.k = new BigInteger(this.hexHash(`00${this.N.toString(16)}0${this.g.toString(16)}`), 16);\n\n this.smallAValue = this.generateRandomSmallA();\n this.getLargeAValue(() => {});\n\n this.infoBits = new util.Buffer('Caldera Derived Key', 'utf8');\n\n this.poolName = PoolName;\n }\n\n /**\n * @returns {BigInteger} small A, a random number\n */\n getSmallAValue() {\n return this.smallAValue;\n }\n\n /**\n * @param {nodeCallback} callback Called with (err, largeAValue)\n * @returns {void}\n */\n getLargeAValue(callback) {\n if (this.largeAValue) {\n callback(null, this.largeAValue);\n } else {\n this.calculateA(this.smallAValue, (err, largeAValue) => {\n if (err) {\n callback(err, null);\n }\n\n this.largeAValue = largeAValue;\n callback(null, this.largeAValue);\n });\n }\n }\n\n /**\n * helper function to generate a random big integer\n * @returns {BigInteger} a random value.\n * @private\n */\n generateRandomSmallA() {\n const hexRandom = util.crypto.lib.randomBytes(128).toString('hex');\n\n const randomBigInt = new BigInteger(hexRandom, 16);\n const smallABigInt = randomBigInt.mod(this.N);\n\n return smallABigInt;\n }\n\n /**\n * helper function to generate a random string\n * @returns {string} a random value.\n * @private\n */\n generateRandomString() {\n return util.crypto.lib.randomBytes(40).toString('base64');\n }\n\n /**\n * @returns {string} Generated random value included in password hash.\n */\n getRandomPassword() {\n return this.randomPassword;\n }\n\n /**\n * @returns {string} Generated random value included in devices hash.\n */\n getSaltDevices() {\n return this.SaltToHashDevices;\n }\n\n /**\n * @returns {string} Value used to verify devices.\n */\n getVerifierDevices() {\n return this.verifierDevices;\n }\n\n /**\n * Generate salts and compute verifier.\n * @param {string} deviceGroupKey Devices to generate verifier for.\n * @param {string} username User to generate verifier for.\n * @param {nodeCallback} callback Called with (err, null)\n * @returns {void}\n */\n generateHashDevice(deviceGroupKey, username, callback) {\n this.randomPassword = this.generateRandomString();\n const combinedString = `${deviceGroupKey}${username}:${this.randomPassword}`;\n const hashedString = this.hash(combinedString);\n\n const hexRandom = util.crypto.lib.randomBytes(16).toString('hex');\n this.SaltToHashDevices = this.padHex(new BigInteger(hexRandom, 16));\n\n this.g.modPow(\n new BigInteger(this.hexHash(this.SaltToHashDevices + hashedString), 16),\n this.N,\n (err, verifierDevicesNotPadded) => {\n if (err) {\n callback(err, null);\n }\n\n this.verifierDevices = this.padHex(verifierDevicesNotPadded);\n callback(null, null);\n });\n }\n\n /**\n * Calculate the client's public value A = g^a%N\n * with the generated random number a\n * @param {BigInteger} a Randomly generated small A.\n * @param {nodeCallback} callback Called with (err, largeAValue)\n * @returns {void}\n * @private\n */\n calculateA(a, callback) {\n this.g.modPow(a, this.N, (err, A) => {\n if (err) {\n callback(err, null);\n }\n\n if (A.mod(this.N).equals(BigInteger.ZERO)) {\n callback(new Error('Illegal paramater. A mod N cannot be 0.'), null);\n }\n\n callback(null, A);\n });\n }\n\n /**\n * Calculate the client's value U which is the hash of A and B\n * @param {BigInteger} A Large A value.\n * @param {BigInteger} B Server B value.\n * @returns {BigInteger} Computed U value.\n * @private\n */\n calculateU(A, B) {\n this.UHexHash = this.hexHash(this.padHex(A) + this.padHex(B));\n const finalU = new BigInteger(this.UHexHash, 16);\n\n return finalU;\n }\n\n /**\n * Calculate a hash from a bitArray\n * @param {Buffer} buf Value to hash.\n * @returns {String} Hex-encoded hash.\n * @private\n */\n hash(buf) {\n const hashHex = util.crypto.sha256(buf, 'hex');\n return (new Array(64 - hashHex.length).join('0')) + hashHex;\n }\n\n /**\n * Calculate a hash from a hex string\n * @param {String} hexStr Value to hash.\n * @returns {String} Hex-encoded hash.\n * @private\n */\n hexHash(hexStr) {\n return this.hash(new util.Buffer(hexStr, 'hex'));\n }\n\n /**\n * Standard hkdf algorithm\n * @param {Buffer} ikm Input key material.\n * @param {Buffer} salt Salt value.\n * @returns {Buffer} Strong key material.\n * @private\n */\n computehkdf(ikm, salt) {\n const prk = util.crypto.hmac(salt, ikm, 'buffer', 'sha256');\n const infoBitsUpdate = util.buffer.concat([\n this.infoBits,\n new util.Buffer(String.fromCharCode(1), 'utf8'),\n ]);\n const hmac = util.crypto.hmac(prk, infoBitsUpdate, 'buffer', 'sha256');\n return hmac.slice(0, 16);\n }\n\n /**\n * Calculates the final hkdf based on computed S value, and computed U value and the key\n * @param {String} username Username.\n * @param {String} password Password.\n * @param {BigInteger} serverBValue Server B value.\n * @param {BigInteger} salt Generated salt.\n * @param {nodeCallback} callback Called with (err, hkdfValue)\n * @returns {void}\n */\n getPasswordAuthenticationKey(username, password, serverBValue, salt, callback) {\n if (serverBValue.mod(this.N).equals(BigInteger.ZERO)) {\n throw new Error('B cannot be zero.');\n }\n\n this.UValue = this.calculateU(this.largeAValue, serverBValue);\n\n if (this.UValue.equals(BigInteger.ZERO)) {\n throw new Error('U cannot be zero.');\n }\n\n const usernamePassword = `${this.poolName}${username}:${password}`;\n const usernamePasswordHash = this.hash(usernamePassword);\n\n const xValue = new BigInteger(this.hexHash(this.padHex(salt) + usernamePasswordHash), 16);\n this.calculateS(xValue, serverBValue, (err, sValue) => {\n if (err) {\n callback(err, null);\n }\n\n const hkdf = this.computehkdf(\n new util.Buffer(this.padHex(sValue), 'hex'),\n new util.Buffer(this.padHex(this.UValue.toString(16)), 'hex'));\n\n callback(null, hkdf);\n });\n }\n\n /**\n * Calculates the S value used in getPasswordAuthenticationKey\n * @param {BigInteger} xValue Salted password hash value.\n * @param {BigInteger} serverBValue Server B value.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n calculateS(xValue, serverBValue, callback) {\n this.g.modPow(xValue, this.N, (err, gModPowXN) => {\n if (err) {\n callback(err, null);\n }\n\n const intValue2 = serverBValue.subtract(this.k.multiply(gModPowXN));\n intValue2.modPow(\n this.smallAValue.add(this.UValue.multiply(xValue)),\n this.N,\n (err2, result) => {\n if (err2) {\n callback(err2, null);\n }\n\n callback(null, result.mod(this.N));\n }\n );\n });\n }\n\n /**\n * Return constant newPasswordRequiredChallengeUserAttributePrefix\n * @return {newPasswordRequiredChallengeUserAttributePrefix} constant prefix value\n */\n getNewPasswordRequiredChallengeUserAttributePrefix() {\n return newPasswordRequiredChallengeUserAttributePrefix;\n }\n\n /**\n * Converts a BigInteger (or hex string) to hex format padded with zeroes for hashing\n * @param {BigInteger|String} bigInt Number or string to pad.\n * @returns {String} Padded hex string.\n */\n padHex(bigInt) {\n let hashStr = bigInt.toString(16);\n if (hashStr.length % 2 === 1) {\n hashStr = `0${hashStr}`;\n } else if ('89ABCDEFabcdef'.indexOf(hashStr[0]) !== -1) {\n hashStr = `00${hashStr}`;\n }\n return hashStr;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/AuthenticationHelper.js","// A small implementation of BigInteger based on http://www-cs-students.stanford.edu/~tjw/jsbn/\n//\n// All public methods have been removed except the following:\n// new BigInteger(a, b) (only radix 2, 4, 8, 16 and 32 supported)\n// toString (only radix 2, 4, 8, 16 and 32 supported)\n// negate\n// abs\n// compareTo\n// bitLength\n// mod\n// equals\n// add\n// subtract\n// multiply\n// divide\n// modPow\n\nexport default BigInteger;\n\n/*\n * Copyright (c) 2003-2005 Tom Wu\n * All Rights Reserved.\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY\n * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n *\n * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,\n * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER\n * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF\n * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT\n * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n *\n * In addition, the following condition applies:\n *\n * All redistributions must retain an intact copy of this copyright notice\n * and disclaimer.\n */\n\n// (public) Constructor\nfunction BigInteger(a, b) {\n if (a != null) this.fromString(a, b);\n}\n\n// return new, unset BigInteger\nfunction nbi() {\n return new BigInteger(null);\n}\n\n// Bits per digit\nvar dbits;\n\n// JavaScript engine analysis\nvar canary = 0xdeadbeefcafe;\nvar j_lm = ((canary&0xffffff)==0xefcafe);\n\n// am: Compute w_j += (x*this_i), propagate carries,\n// c is initial carry, returns final carry.\n// c < 3*dvalue, x < 2*dvalue, this_i < dvalue\n// We need to select the fastest one that works in this environment.\n\n// am1: use a single mult and divide to get the high bits,\n// max digit bits should be 26 because\n// max internal value = 2*dvalue^2-2*dvalue (< 2^53)\nfunction am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this[i++]+w[j]+c;\n c = Math.floor(v/0x4000000);\n w[j++] = v&0x3ffffff;\n }\n return c;\n}\n// am2 avoids a big mult-and-extract completely.\n// Max digit bits should be <= 30 because we do bitwise ops\n// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)\nfunction am2(i,x,w,j,c,n) {\n var xl = x&0x7fff, xh = x>>15;\n while(--n >= 0) {\n var l = this[i]&0x7fff;\n var h = this[i++]>>15;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n w[j++] = l&0x3fffffff;\n }\n return c;\n}\n// Alternately, set max digit bits to 28 since some\n// browsers slow down when dealing with 32-bit numbers.\nfunction am3(i,x,w,j,c,n) {\n var xl = x&0x3fff, xh = x>>14;\n while(--n >= 0) {\n var l = this[i]&0x3fff;\n var h = this[i++]>>14;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x3fff)<<14)+w[j]+c;\n c = (l>>28)+(m>>14)+xh*h;\n w[j++] = l&0xfffffff;\n }\n return c;\n}\nvar inBrowser = typeof navigator !== \"undefined\";\nif(inBrowser && j_lm && (navigator.appName == \"Microsoft Internet Explorer\")) {\n BigInteger.prototype.am = am2;\n dbits = 30;\n}\nelse if(inBrowser && j_lm && (navigator.appName != \"Netscape\")) {\n BigInteger.prototype.am = am1;\n dbits = 26;\n}\nelse { // Mozilla/Netscape seems to prefer am3\n BigInteger.prototype.am = am3;\n dbits = 28;\n}\n\nBigInteger.prototype.DB = dbits;\nBigInteger.prototype.DM = (1 << dbits) - 1;\nBigInteger.prototype.DV = 1 << dbits;\n\nvar BI_FP = 52;\nBigInteger.prototype.FV = Math.pow(2, BI_FP);\nBigInteger.prototype.F1 = BI_FP - dbits;\nBigInteger.prototype.F2 = 2 * dbits - BI_FP;\n\n// Digit conversions\nvar BI_RM = \"0123456789abcdefghijklmnopqrstuvwxyz\";\nvar BI_RC = new Array();\nvar rr, vv;\nrr = \"0\".charCodeAt(0);\nfor (vv = 0; vv <= 9; ++vv)\n BI_RC[rr++] = vv;\nrr = \"a\".charCodeAt(0);\nfor (vv = 10; vv < 36; ++vv)\n BI_RC[rr++] = vv;\nrr = \"A\".charCodeAt(0);\nfor (vv = 10; vv < 36; ++vv)\n BI_RC[rr++] = vv;\n\nfunction int2char(n) {\n return BI_RM.charAt(n);\n}\nfunction intAt(s, i) {\n var c = BI_RC[s.charCodeAt(i)];\n return c == null ? -1 : c;\n}\n\n// (protected) copy this to r\nfunction bnpCopyTo(r) {\n for (var i = this.t - 1; i >= 0; --i)\n r[i] = this[i];\n r.t = this.t;\n r.s = this.s;\n}\n\n// (protected) set from integer value x, -DV <= x < DV\nfunction bnpFromInt(x) {\n this.t = 1;\n this.s = x < 0 ? -1 : 0;\n if (x > 0) this[0] = x;\n else if (x < -1) this[0] = x + this.DV;\n else this.t = 0;\n}\n\n// return bigint initialized to value\nfunction nbv(i) {\n var r = nbi();\n\n r.fromInt(i);\n\n return r;\n}\n\n// (protected) set from string and radix\nfunction bnpFromString(s, b) {\n var k;\n if (b == 16) k = 4;\n else if (b == 8) k = 3;\n else if (b == 2) k = 1;\n else if (b == 32) k = 5;\n else if (b == 4) k = 2;\n else throw new Error(\"Only radix 2, 4, 8, 16, 32 are supported\");\n this.t = 0;\n this.s = 0;\n var i = s.length, mi = false, sh = 0;\n while (--i >= 0) {\n var x = intAt(s, i);\n if (x < 0) {\n if (s.charAt(i) == \"-\") mi = true;\n continue;\n }\n mi = false;\n if (sh == 0) this[this.t++] = x;\n else if (sh + k > this.DB) {\n this[this.t - 1] |= (x & (1 << this.DB - sh) - 1) << sh;\n this[this.t++] = x >> this.DB - sh;\n } else this[this.t - 1] |= x << sh;\n sh += k;\n if (sh >= this.DB) sh -= this.DB;\n }\n this.clamp();\n if (mi) BigInteger.ZERO.subTo(this, this);\n}\n\n// (protected) clamp off excess high words\nfunction bnpClamp() {\n var c = this.s & this.DM;\n while (this.t > 0 && this[this.t - 1] == c)\n --this.t;\n}\n\n// (public) return string representation in given radix\nfunction bnToString(b) {\n if (this.s < 0) return \"-\" + this.negate().toString();\n var k;\n if (b == 16) k = 4;\n else if (b == 8) k = 3;\n else if (b == 2) k = 1;\n else if (b == 32) k = 5;\n else if (b == 4) k = 2;\n else throw new Error(\"Only radix 2, 4, 8, 16, 32 are supported\");\n var km = (1 << k) - 1, d, m = false, r = \"\", i = this.t;\n var p = this.DB - i * this.DB % k;\n if (i-- > 0) {\n if (p < this.DB && (d = this[i] >> p) > 0) {\n m = true;\n r = int2char(d);\n }\n while (i >= 0) {\n if (p < k) {\n d = (this[i] & (1 << p) - 1) << k - p;\n d |= this[--i] >> (p += this.DB - k);\n } else {\n d = this[i] >> (p -= k) & km;\n if (p <= 0) {\n p += this.DB;\n --i;\n }\n }\n if (d > 0) m = true;\n if (m) r += int2char(d);\n }\n }\n return m ? r : \"0\";\n}\n\n// (public) -this\nfunction bnNegate() {\n var r = nbi();\n\n BigInteger.ZERO.subTo(this, r);\n\n return r;\n}\n\n// (public) |this|\nfunction bnAbs() {\n return this.s < 0 ? this.negate() : this;\n}\n\n// (public) return + if this > a, - if this < a, 0 if equal\nfunction bnCompareTo(a) {\n var r = this.s - a.s;\n if (r != 0) return r;\n var i = this.t;\n r = i - a.t;\n if (r != 0) return this.s < 0 ? -r : r;\n while (--i >= 0)\n if ((r = this[i] - a[i]) != 0) return r;\n return 0;\n}\n\n// returns bit length of the integer x\nfunction nbits(x) {\n var r = 1, t;\n if ((t = x >>> 16) != 0) {\n x = t;\n r += 16;\n }\n if ((t = x >> 8) != 0) {\n x = t;\n r += 8;\n }\n if ((t = x >> 4) != 0) {\n x = t;\n r += 4;\n }\n if ((t = x >> 2) != 0) {\n x = t;\n r += 2;\n }\n if ((t = x >> 1) != 0) {\n x = t;\n r += 1;\n }\n return r;\n}\n\n// (public) return the number of bits in \"this\"\nfunction bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);\n}\n\n// (protected) r = this << n*DB\nfunction bnpDLShiftTo(n, r) {\n var i;\n for (i = this.t - 1; i >= 0; --i)\n r[i + n] = this[i];\n for (i = n - 1; i >= 0; --i)\n r[i] = 0;\n r.t = this.t + n;\n r.s = this.s;\n}\n\n// (protected) r = this >> n*DB\nfunction bnpDRShiftTo(n, r) {\n for (var i = n; i < this.t; ++i)\n r[i - n] = this[i];\n r.t = Math.max(this.t - n, 0);\n r.s = this.s;\n}\n\n// (protected) r = this << n\nfunction bnpLShiftTo(n, r) {\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << cbs) - 1;\n var ds = Math.floor(n / this.DB), c = this.s << bs & this.DM, i;\n for (i = this.t - 1; i >= 0; --i) {\n r[i + ds + 1] = this[i] >> cbs | c;\n c = (this[i] & bm) << bs;\n }\n for (i = ds - 1; i >= 0; --i)\n r[i] = 0;\n r[ds] = c;\n r.t = this.t + ds + 1;\n r.s = this.s;\n r.clamp();\n}\n\n// (protected) r = this >> n\nfunction bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;\n return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n}\n\n// (protected) r = this - a\nfunction bnpSubTo(a, r) {\n var i = 0, c = 0, m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] - a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c -= a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n } else {\n c += this.s;\n while (i < a.t) {\n c -= a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c -= a.s;\n }\n r.s = c < 0 ? -1 : 0;\n if (c < -1) r[i++] = this.DV + c;\n else if (c > 0) r[i++] = c;\n r.t = i;\n r.clamp();\n}\n\n// (protected) r = this * a, r != this,a (HAC 14.12)\n// \"this\" should be the larger one if appropriate.\nfunction bnpMultiplyTo(a, r) {\n var x = this.abs(), y = a.abs();\n var i = x.t;\n r.t = i + y.t;\n while (--i >= 0)\n r[i] = 0;\n for (i = 0; i < y.t; ++i)\n r[i + x.t] = x.am(0, y[i], r, i, 0, x.t);\n r.s = 0;\n r.clamp();\n if (this.s != a.s) BigInteger.ZERO.subTo(r, r);\n}\n\n// (protected) r = this^2, r != this (HAC 14.16)\nfunction bnpSquareTo(r) {\n var x = this.abs();\n var i = r.t = 2 * x.t;\n while (--i >= 0)\n r[i] = 0;\n for (i = 0; i < x.t - 1; ++i) {\n var c = x.am(i, x[i], r, 2 * i, 0, 1);\n if (\n (r[i + x.t] += x.am(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >=\n x.DV\n ) {\n r[i + x.t] -= x.DV;\n r[i + x.t + 1] = 1;\n }\n }\n if (r.t > 0) r[r.t - 1] += x.am(i, x[i], r, 2 * i, 0, 1);\n r.s = 0;\n r.clamp();\n}\n\n// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)\n// r != q, this != m. q or r may be null.\nfunction bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]);\n // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);\n pt.lShiftTo(nsh, r);\n } else {\n pm.copyTo(y);\n pt.copyTo(r);\n }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + (ys > 1 ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt, d2 = (1 << this.F1) / yt, e = 1 << this.F2;\n var i = r.t, j = i - ys, t = q == null ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y);\n // \"negative\" y so we can replace sub with am later\n while (y.t < ys)\n y[y.t++] = 0;\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = r[--i] == y0\n ? this.DM\n : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\n // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) r.subTo(t, r);\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r);\n // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n}\n\n// (public) this mod a\nfunction bnMod(a) {\n var r = nbi();\n this.abs().divRemTo(a, null, r);\n if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r);\n return r;\n}\n\n// (protected) return \"-1/this % 2^DB\"; useful for Mont. reduction\n// justification:\n// xy == 1 (mod m)\n// xy = 1+km\n// xy(2-xy) = (1+km)(1-km)\n// x[y(2-xy)] = 1-k^2m^2\n// x[y(2-xy)] == 1 (mod m^2)\n// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2\n// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.\n// JS multiply \"overflows\" differently from C/C++, so care is needed here.\nfunction bnpInvDigit() {\n if (this.t < 1) return 0;\n var x = this[0];\n if ((x & 1) == 0) return 0;\n var y = x & 3;\n // y == 1/x mod 2^2\n y = y * (2 - (x & 0xf) * y) & 0xf;\n // y == 1/x mod 2^4\n y = y * (2 - (x & 0xff) * y) & 0xff;\n // y == 1/x mod 2^8\n y = y * (2 - ((x & 0xffff) * y & 0xffff)) & 0xffff;\n // y == 1/x mod 2^16\n // last step - calculate inverse mod DV directly;\n // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints\n y = y * (2 - x * y % this.DV) % this.DV;\n // y == 1/x mod 2^dbits\n // we really want the negative inverse, and -DV < y < DV\n return y > 0 ? this.DV - y : -y;\n}\n\nfunction bnEquals(a) {\n return this.compareTo(a) == 0;\n}\n\n// (protected) r = this + a\nfunction bnpAddTo(a, r) {\n var i = 0, c = 0, m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] + a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c += a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n } else {\n c += this.s;\n while (i < a.t) {\n c += a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = c < 0 ? -1 : 0;\n if (c > 0) r[i++] = c;\n else if (c < -1) r[i++] = this.DV + c;\n r.t = i;\n r.clamp();\n}\n\n// (public) this + a\nfunction bnAdd(a) {\n var r = nbi();\n\n this.addTo(a, r);\n\n return r;\n}\n\n// (public) this - a\nfunction bnSubtract(a) {\n var r = nbi();\n\n this.subTo(a, r);\n\n return r;\n}\n\n// (public) this * a\nfunction bnMultiply(a) {\n var r = nbi();\n\n this.multiplyTo(a, r);\n\n return r;\n}\n\n// (public) this / a\nfunction bnDivide(a) {\n var r = nbi();\n\n this.divRemTo(a, r, null);\n\n return r;\n}\n\n// Montgomery reduction\nfunction Montgomery(m) {\n this.m = m;\n this.mp = m.invDigit();\n this.mpl = this.mp & 0x7fff;\n this.mph = this.mp >> 15;\n this.um = (1 << m.DB - 15) - 1;\n this.mt2 = 2 * m.t;\n}\n\n// xR mod m\nfunction montConvert(x) {\n var r = nbi();\n x.abs().dlShiftTo(this.m.t, r);\n r.divRemTo(this.m, null, r);\n if (x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r, r);\n return r;\n}\n\n// x/R mod m\nfunction montRevert(x) {\n var r = nbi();\n x.copyTo(r);\n this.reduce(r);\n return r;\n}\n\n// x = x/R mod m (HAC 14.32)\nfunction montReduce(x) {\n while (x.t <= this.mt2)\n // pad x so am has enough room later\n x[x.t++] = 0;\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff;\n var u0 = j * this.mpl +\n ((j * this.mph + (x[i] >> 15) * this.mpl & this.um) << 15) &\n x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV;\n x[++j]++;\n }\n }\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n}\n\n// r = \"x^2/R mod m\"; x != r\nfunction montSqrTo(x, r) {\n x.squareTo(r);\n\n this.reduce(r);\n}\n\n// r = \"xy/R mod m\"; x,y != r\nfunction montMulTo(x, y, r) {\n x.multiplyTo(y, r);\n\n this.reduce(r);\n}\n\nMontgomery.prototype.convert = montConvert;\nMontgomery.prototype.revert = montRevert;\nMontgomery.prototype.reduce = montReduce;\nMontgomery.prototype.mulTo = montMulTo;\nMontgomery.prototype.sqrTo = montSqrTo;\n\n// (public) this^e % m (HAC 14.85)\nfunction bnModPow(e, m, callback) {\n var i = e.bitLength(), k, r = nbv(1), z = new Montgomery(m);\n if (i <= 0) return r;\n else if (i < 18) k = 1;\n else if (i < 48) k = 3;\n else if (i < 144) k = 4;\n else if (i < 768) k = 5;\n else k = 6;\n\n // precomputation\n var g = new Array(), n = 3, k1 = k - 1, km = (1 << k) - 1;\n g[1] = z.convert(this);\n if (k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1], g2);\n while (n <= km) {\n g[n] = nbi();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n\n var j = e.t - 1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j]) - 1;\n while (j >= 0) {\n if (i >= k1) w = e[j] >> i - k1 & km;\n else {\n w = (e[j] & (1 << i + 1) - 1) << k1 - i;\n if (j > 0) w |= e[j - 1] >> this.DB + i - k1;\n }\n\n n = k;\n while ((w & 1) == 0) {\n w >>= 1;\n --n;\n }\n if ((i -= n) < 0) {\n i += this.DB;\n --j;\n }\n if (is1) {\n // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while (n > 1) {\n z.sqrTo(r, r2);\n z.sqrTo(r2, r);\n n -= 2;\n }\n if (n > 0) z.sqrTo(r, r2);\n else {\n t = r;\n r = r2;\n r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n\n while (j >= 0 && (e[j] & 1 << i) == 0) {\n z.sqrTo(r, r2);\n t = r;\n r = r2;\n r2 = t;\n if (--i < 0) {\n i = this.DB - 1;\n --j;\n }\n }\n }\n var result = z.revert(r);\n callback(null, result);\n return result;\n}\n\n// protected\nBigInteger.prototype.copyTo = bnpCopyTo;\nBigInteger.prototype.fromInt = bnpFromInt;\nBigInteger.prototype.fromString = bnpFromString;\nBigInteger.prototype.clamp = bnpClamp;\nBigInteger.prototype.dlShiftTo = bnpDLShiftTo;\nBigInteger.prototype.drShiftTo = bnpDRShiftTo;\nBigInteger.prototype.lShiftTo = bnpLShiftTo;\nBigInteger.prototype.rShiftTo = bnpRShiftTo;\nBigInteger.prototype.subTo = bnpSubTo;\nBigInteger.prototype.multiplyTo = bnpMultiplyTo;\nBigInteger.prototype.squareTo = bnpSquareTo;\nBigInteger.prototype.divRemTo = bnpDivRemTo;\nBigInteger.prototype.invDigit = bnpInvDigit;\nBigInteger.prototype.addTo = bnpAddTo;\n\n// public\nBigInteger.prototype.toString = bnToString;\nBigInteger.prototype.negate = bnNegate;\nBigInteger.prototype.abs = bnAbs;\nBigInteger.prototype.compareTo = bnCompareTo;\nBigInteger.prototype.bitLength = bnBitLength;\nBigInteger.prototype.mod = bnMod;\nBigInteger.prototype.equals = bnEquals;\nBigInteger.prototype.add = bnAdd;\nBigInteger.prototype.subtract = bnSubtract;\nBigInteger.prototype.multiply = bnMultiply;\nBigInteger.prototype.divide = bnDivide;\nBigInteger.prototype.modPow = bnModPow;\n\n// \"constants\"\nBigInteger.ZERO = nbv(0);\nBigInteger.ONE = nbv(1);\n\n\n\n\n// WEBPACK FOOTER //\n// ./src/BigInteger.js","/*\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport CognitoJwtToken from './CognitoJwtToken';\n\n/** @class */\nexport default class CognitoAccessToken extends CognitoJwtToken {\n /**\n * Constructs a new CognitoAccessToken object\n * @param {string=} AccessToken The JWT access token.\n */\n constructor({ AccessToken } = {}) {\n super(AccessToken || '');\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/CognitoAccessToken.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport CognitoJwtToken from './CognitoJwtToken';\n\n/** @class */\nexport default class CognitoIdToken extends CognitoJwtToken {\n /**\n * Constructs a new CognitoIdToken object\n * @param {string=} IdToken The JWT Id token\n */\n constructor({ IdToken } = {}) {\n super(IdToken || '');\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/CognitoIdToken.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { util } from 'aws-sdk/global';\n\n/** @class */\nexport default class CognitoJwtToken {\n /**\n * Constructs a new CognitoJwtToken object\n * @param {string=} token The JWT token.\n */\n constructor(token) {\n // Assign object\n this.jwtToken = token || '';\n this.payload = this.decodePayload();\n }\n\n /**\n * @returns {string} the record's token.\n */\n getJwtToken() {\n return this.jwtToken;\n }\n\n /**\n * @returns {int} the token's expiration (exp member).\n */\n getExpiration() {\n return this.payload.exp;\n }\n\n /**\n * @returns {int} the token's \"issued at\" (iat member).\n */\n getIssuedAt() {\n return this.payload.iat;\n }\n\n /**\n * @returns {object} the token's payload.\n */\n decodePayload() {\n const payload = this.jwtToken.split('.')[1];\n try {\n return JSON.parse(util.base64.decode(payload).toString('utf8'));\n } catch (err) {\n return {};\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/CognitoJwtToken.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @class */\nexport default class CognitoRefreshToken {\n /**\n * Constructs a new CognitoRefreshToken object\n * @param {string=} RefreshToken The JWT refresh token.\n */\n constructor({ RefreshToken } = {}) {\n // Assign object\n this.token = RefreshToken || '';\n }\n\n /**\n * @returns {string} the record's token.\n */\n getToken() {\n return this.token;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/CognitoRefreshToken.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { util } from 'aws-sdk/global';\n\nimport BigInteger from './BigInteger';\nimport AuthenticationHelper from './AuthenticationHelper';\nimport CognitoAccessToken from './CognitoAccessToken';\nimport CognitoIdToken from './CognitoIdToken';\nimport CognitoRefreshToken from './CognitoRefreshToken';\nimport CognitoUserSession from './CognitoUserSession';\nimport DateHelper from './DateHelper';\nimport CognitoUserAttribute from './CognitoUserAttribute';\nimport StorageHelper from './StorageHelper';\n\n/**\n * @callback nodeCallback\n * @template T result\n * @param {*} err The operation failure reason, or null.\n * @param {T} result The operation result.\n */\n\n/**\n * @callback onFailure\n * @param {*} err Failure reason.\n */\n\n/**\n * @callback onSuccess\n * @template T result\n * @param {T} result The operation result.\n */\n\n/**\n * @callback mfaRequired\n * @param {*} details MFA challenge details.\n */\n\n/**\n * @callback customChallenge\n * @param {*} details Custom challenge details.\n */\n\n/**\n * @callback inputVerificationCode\n * @param {*} data Server response.\n */\n\n/**\n * @callback authSuccess\n * @param {CognitoUserSession} session The new session.\n * @param {bool=} userConfirmationNecessary User must be confirmed.\n */\n\n\n/** @class */\nexport default class CognitoUser {\n /**\n * Constructs a new CognitoUser object\n * @param {object} data Creation options\n * @param {string} data.Username The user's username.\n * @param {CognitoUserPool} data.Pool Pool containing the user.\n * @param {object} data.Storage Optional storage object.\n */\n constructor(data) {\n if (data == null || data.Username == null || data.Pool == null) {\n throw new Error('Username and pool information are required.');\n }\n\n this.username = data.Username || '';\n this.pool = data.Pool;\n this.Session = null;\n\n this.client = data.Pool.client;\n\n this.signInUserSession = null;\n this.authenticationFlowType = 'USER_SRP_AUTH';\n\n this.storage = data.Storage || new StorageHelper().getStorage();\n }\n\n /**\n * Sets the session for this user\n * @param {CognitoUserSession} signInUserSession the session\n * @returns {void}\n */\n setSignInUserSession(signInUserSession) {\n this.clearCachedTokens();\n this.signInUserSession = signInUserSession;\n this.cacheTokens();\n }\n\n /**\n * @returns {CognitoUserSession} the current session for this user\n */\n getSignInUserSession() {\n return this.signInUserSession;\n }\n\n /**\n * @returns {string} the user's username\n */\n getUsername() {\n return this.username;\n }\n\n /**\n * @returns {String} the authentication flow type\n */\n getAuthenticationFlowType() {\n return this.authenticationFlowType;\n }\n\n /**\n * sets authentication flow type\n * @param {string} authenticationFlowType New value.\n * @returns {void}\n */\n setAuthenticationFlowType(authenticationFlowType) {\n this.authenticationFlowType = authenticationFlowType;\n }\n\n\n /**\n * This is used for authenticating the user through the custom authentication flow.\n * @param {AuthenticationDetails} authDetails Contains the authentication data\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {customChallenge} callback.customChallenge Custom challenge\n * response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n initiateAuth(authDetails, callback) {\n const authParameters = authDetails.getAuthParameters();\n authParameters.USERNAME = this.username;\n\n const jsonReq = {\n AuthFlow: 'CUSTOM_AUTH',\n ClientId: this.pool.getClientId(),\n AuthParameters: authParameters,\n ClientMetadata: authDetails.getValidationData(),\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n\n this.client.makeUnauthenticatedRequest('initiateAuth', jsonReq, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n const challengeName = data.ChallengeName;\n const challengeParameters = data.ChallengeParameters;\n\n if (challengeName === 'CUSTOM_CHALLENGE') {\n this.Session = data.Session;\n return callback.customChallenge(challengeParameters);\n }\n this.signInUserSession = this.getCognitoUserSession(data.AuthenticationResult);\n this.cacheTokens();\n return callback.onSuccess(this.signInUserSession);\n });\n }\n\n /**\n * This is used for authenticating the user. it calls the AuthenticationHelper for SRP related\n * stuff\n * @param {AuthenticationDetails} authDetails Contains the authentication data\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {newPasswordRequired} callback.newPasswordRequired new\n * password and any required attributes are required to continue\n * @param {mfaRequired} callback.mfaRequired MFA code\n * required to continue.\n * @param {customChallenge} callback.customChallenge Custom challenge\n * response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n authenticateUser(authDetails, callback) {\n const authenticationHelper = new AuthenticationHelper(\n this.pool.getUserPoolId().split('_')[1]);\n const dateHelper = new DateHelper();\n\n let serverBValue;\n let salt;\n const authParameters = {};\n\n if (this.deviceKey != null) {\n authParameters.DEVICE_KEY = this.deviceKey;\n }\n\n authParameters.USERNAME = this.username;\n authenticationHelper.getLargeAValue((errOnAValue, aValue) => {\n // getLargeAValue callback start\n if (errOnAValue) {\n callback.onFailure(errOnAValue);\n }\n\n authParameters.SRP_A = aValue.toString(16);\n\n if (this.authenticationFlowType === 'CUSTOM_AUTH') {\n authParameters.CHALLENGE_NAME = 'SRP_A';\n }\n\n const jsonReq = {\n AuthFlow: this.authenticationFlowType,\n ClientId: this.pool.getClientId(),\n AuthParameters: authParameters,\n ClientMetadata: authDetails.getValidationData(),\n };\n if (this.getUserContextData(this.username)) {\n jsonReq.UserContextData = this.getUserContextData(this.username);\n }\n\n this.client.makeUnauthenticatedRequest('initiateAuth', jsonReq, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n\n const challengeParameters = data.ChallengeParameters;\n\n this.username = challengeParameters.USER_ID_FOR_SRP;\n serverBValue = new BigInteger(challengeParameters.SRP_B, 16);\n salt = new BigInteger(challengeParameters.SALT, 16);\n this.getCachedDeviceKeyAndPassword();\n\n authenticationHelper.getPasswordAuthenticationKey(\n this.username,\n authDetails.getPassword(),\n serverBValue,\n salt,\n (errOnHkdf, hkdf) => {\n // getPasswordAuthenticationKey callback start\n if (errOnHkdf) {\n callback.onFailure(errOnHkdf);\n }\n\n const dateNow = dateHelper.getNowString();\n\n const signatureString = util.crypto.hmac(hkdf, util.buffer.concat([\n new util.Buffer(this.pool.getUserPoolId().split('_')[1], 'utf8'),\n new util.Buffer(this.username, 'utf8'),\n new util.Buffer(challengeParameters.SECRET_BLOCK, 'base64'),\n new util.Buffer(dateNow, 'utf8'),\n ]), 'base64', 'sha256');\n\n const challengeResponses = {};\n\n challengeResponses.USERNAME = this.username;\n challengeResponses.PASSWORD_CLAIM_SECRET_BLOCK = challengeParameters.SECRET_BLOCK;\n challengeResponses.TIMESTAMP = dateNow;\n challengeResponses.PASSWORD_CLAIM_SIGNATURE = signatureString;\n\n if (this.deviceKey != null) {\n challengeResponses.DEVICE_KEY = this.deviceKey;\n }\n\n const respondToAuthChallenge = (challenge, challengeCallback) =>\n this.client.makeUnauthenticatedRequest('respondToAuthChallenge', challenge,\n (errChallenge, dataChallenge) => {\n if (errChallenge && errChallenge.code === 'ResourceNotFoundException' &&\n errChallenge.message.toLowerCase().indexOf('device') !== -1) {\n challengeResponses.DEVICE_KEY = null;\n this.deviceKey = null;\n this.randomPassword = null;\n this.deviceGroupKey = null;\n this.clearCachedDeviceKeyAndPassword();\n return respondToAuthChallenge(challenge, challengeCallback);\n }\n return challengeCallback(errChallenge, dataChallenge);\n });\n\n const jsonReqResp = {\n ChallengeName: 'PASSWORD_VERIFIER',\n ClientId: this.pool.getClientId(),\n ChallengeResponses: challengeResponses,\n Session: data.Session,\n };\n if (this.getUserContextData()) {\n jsonReqResp.UserContextData = this.getUserContextData();\n }\n respondToAuthChallenge(jsonReqResp, (errAuthenticate, dataAuthenticate) => {\n if (errAuthenticate) {\n return callback.onFailure(errAuthenticate);\n }\n\n const challengeName = dataAuthenticate.ChallengeName;\n if (challengeName === 'NEW_PASSWORD_REQUIRED') {\n this.Session = dataAuthenticate.Session;\n let userAttributes = null;\n let rawRequiredAttributes = null;\n const requiredAttributes = [];\n const userAttributesPrefix = authenticationHelper\n .getNewPasswordRequiredChallengeUserAttributePrefix();\n\n if (dataAuthenticate.ChallengeParameters) {\n userAttributes = JSON.parse(\n dataAuthenticate.ChallengeParameters.userAttributes);\n rawRequiredAttributes = JSON.parse(\n dataAuthenticate.ChallengeParameters.requiredAttributes);\n }\n\n if (rawRequiredAttributes) {\n for (let i = 0; i < rawRequiredAttributes.length; i++) {\n requiredAttributes[i] = rawRequiredAttributes[i].substr(\n userAttributesPrefix.length\n );\n }\n }\n return callback.newPasswordRequired(userAttributes, requiredAttributes);\n }\n return this.authenticateUserInternal(\n dataAuthenticate,\n authenticationHelper,\n callback\n );\n });\n return undefined;\n // getPasswordAuthenticationKey callback end\n });\n return undefined;\n });\n // getLargeAValue callback end\n });\n }\n\n /**\n * PRIVATE ONLY: This is an internal only method and should not\n * be directly called by the consumers.\n * @param {object} dataAuthenticate authentication data\n * @param {object} authenticationHelper helper created\n * @param {callback} callback passed on from caller\n * @returns {void}\n */\n authenticateUserInternal(dataAuthenticate, authenticationHelper, callback) {\n const challengeName = dataAuthenticate.ChallengeName;\n const challengeParameters = dataAuthenticate.ChallengeParameters;\n\n if (challengeName === 'SMS_MFA') {\n this.Session = dataAuthenticate.Session;\n return callback.mfaRequired(challengeName, challengeParameters);\n }\n\n if (challengeName === 'SELECT_MFA_TYPE') {\n this.Session = dataAuthenticate.Session;\n return callback.selectMFAType(challengeName, challengeParameters);\n }\n\n if (challengeName === 'MFA_SETUP') {\n this.Session = dataAuthenticate.Session;\n return callback.mfaSetup(challengeName, challengeParameters);\n }\n\n if (challengeName === 'SOFTWARE_TOKEN_MFA') {\n this.Session = dataAuthenticate.Session;\n return callback.totpRequired(challengeName, challengeParameters);\n }\n\n if (challengeName === 'CUSTOM_CHALLENGE') {\n this.Session = dataAuthenticate.Session;\n return callback.customChallenge(challengeParameters);\n }\n\n if (challengeName === 'DEVICE_SRP_AUTH') {\n this.getDeviceResponse(callback);\n return undefined;\n }\n\n this.signInUserSession = this.getCognitoUserSession(dataAuthenticate.AuthenticationResult);\n this.cacheTokens();\n\n const newDeviceMetadata = dataAuthenticate.AuthenticationResult.NewDeviceMetadata;\n if (newDeviceMetadata == null) {\n return callback.onSuccess(this.signInUserSession);\n }\n\n authenticationHelper.generateHashDevice(\n dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,\n dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey,\n (errGenHash) => {\n if (errGenHash) {\n return callback.onFailure(errGenHash);\n }\n\n const deviceSecretVerifierConfig = {\n Salt: new util.Buffer(\n authenticationHelper.getSaltDevices(), 'hex'\n ).toString('base64'),\n PasswordVerifier: new util.Buffer(\n authenticationHelper.getVerifierDevices(), 'hex'\n ).toString('base64'),\n };\n\n this.verifierDevices = deviceSecretVerifierConfig.PasswordVerifier;\n this.deviceGroupKey = newDeviceMetadata.DeviceGroupKey;\n this.randomPassword = authenticationHelper.getRandomPassword();\n\n this.client.makeUnauthenticatedRequest('confirmDevice', {\n DeviceKey: newDeviceMetadata.DeviceKey,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceSecretVerifierConfig: deviceSecretVerifierConfig,\n DeviceName: navigator.userAgent,\n }, (errConfirm, dataConfirm) => {\n if (errConfirm) {\n return callback.onFailure(errConfirm);\n }\n\n this.deviceKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey;\n this.cacheDeviceKeyAndPassword();\n if (dataConfirm.UserConfirmationNecessary === true) {\n return callback.onSuccess(\n this.signInUserSession, dataConfirm.UserConfirmationNecessary);\n }\n return callback.onSuccess(this.signInUserSession);\n });\n return undefined;\n });\n return undefined;\n }\n\n /**\n * This method is user to complete the NEW_PASSWORD_REQUIRED challenge.\n * Pass the new password with any new user attributes to be updated.\n * User attribute keys must be of format userAttributes..\n * @param {string} newPassword new password for this user\n * @param {object} requiredAttributeData map with values for all required attributes\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {mfaRequired} callback.mfaRequired MFA code required to continue.\n * @param {customChallenge} callback.customChallenge Custom challenge\n * response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n completeNewPasswordChallenge(newPassword, requiredAttributeData, callback) {\n if (!newPassword) {\n return callback.onFailure(new Error('New password is required.'));\n }\n const authenticationHelper = new AuthenticationHelper(\n this.pool.getUserPoolId().split('_')[1]);\n const userAttributesPrefix = authenticationHelper\n .getNewPasswordRequiredChallengeUserAttributePrefix();\n\n const finalUserAttributes = {};\n if (requiredAttributeData) {\n Object.keys(requiredAttributeData).forEach((key) => {\n finalUserAttributes[userAttributesPrefix + key] = requiredAttributeData[key];\n });\n }\n\n finalUserAttributes.NEW_PASSWORD = newPassword;\n finalUserAttributes.USERNAME = this.username;\n const jsonReq = {\n ChallengeName: 'NEW_PASSWORD_REQUIRED',\n ClientId: this.pool.getClientId(),\n ChallengeResponses: finalUserAttributes,\n Session: this.Session,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n\n this.client.makeUnauthenticatedRequest('respondToAuthChallenge',\n jsonReq, (errAuthenticate, dataAuthenticate) => {\n if (errAuthenticate) {\n return callback.onFailure(errAuthenticate);\n }\n return this.authenticateUserInternal(dataAuthenticate, authenticationHelper, callback);\n });\n return undefined;\n }\n\n /**\n * This is used to get a session using device authentication. It is called at the end of user\n * authentication\n *\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n * @private\n */\n getDeviceResponse(callback) {\n const authenticationHelper = new AuthenticationHelper(\n this.deviceGroupKey);\n const dateHelper = new DateHelper();\n\n const authParameters = {};\n\n authParameters.USERNAME = this.username;\n authParameters.DEVICE_KEY = this.deviceKey;\n authenticationHelper.getLargeAValue((errAValue, aValue) => {\n // getLargeAValue callback start\n if (errAValue) {\n callback.onFailure(errAValue);\n }\n\n authParameters.SRP_A = aValue.toString(16);\n\n const jsonReq = {\n ChallengeName: 'DEVICE_SRP_AUTH',\n ClientId: this.pool.getClientId(),\n ChallengeResponses: authParameters,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.makeUnauthenticatedRequest('respondToAuthChallenge', jsonReq, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n\n const challengeParameters = data.ChallengeParameters;\n\n const serverBValue = new BigInteger(challengeParameters.SRP_B, 16);\n const salt = new BigInteger(challengeParameters.SALT, 16);\n\n authenticationHelper.getPasswordAuthenticationKey(\n this.deviceKey,\n this.randomPassword,\n serverBValue,\n salt,\n (errHkdf, hkdf) => {\n // getPasswordAuthenticationKey callback start\n if (errHkdf) {\n return callback.onFailure(errHkdf);\n }\n\n const dateNow = dateHelper.getNowString();\n\n const signatureString = util.crypto.hmac(hkdf, util.buffer.concat([\n new util.Buffer(this.deviceGroupKey, 'utf8'),\n new util.Buffer(this.deviceKey, 'utf8'),\n new util.Buffer(challengeParameters.SECRET_BLOCK, 'base64'),\n new util.Buffer(dateNow, 'utf8'),\n ]), 'base64', 'sha256');\n\n const challengeResponses = {};\n\n challengeResponses.USERNAME = this.username;\n challengeResponses.PASSWORD_CLAIM_SECRET_BLOCK = challengeParameters.SECRET_BLOCK;\n challengeResponses.TIMESTAMP = dateNow;\n challengeResponses.PASSWORD_CLAIM_SIGNATURE = signatureString;\n challengeResponses.DEVICE_KEY = this.deviceKey;\n\n const jsonReqResp = {\n ChallengeName: 'DEVICE_PASSWORD_VERIFIER',\n ClientId: this.pool.getClientId(),\n ChallengeResponses: challengeResponses,\n Session: data.Session,\n };\n if (this.getUserContextData()) {\n jsonReqResp.UserContextData = this.getUserContextData();\n }\n\n this.client.makeUnauthenticatedRequest('respondToAuthChallenge',\n jsonReqResp, (errAuthenticate, dataAuthenticate) => {\n if (errAuthenticate) {\n return callback.onFailure(errAuthenticate);\n }\n\n this.signInUserSession = this.getCognitoUserSession(\n dataAuthenticate.AuthenticationResult\n );\n this.cacheTokens();\n\n return callback.onSuccess(this.signInUserSession);\n });\n return undefined;\n // getPasswordAuthenticationKey callback end\n });\n return undefined;\n });\n // getLargeAValue callback end\n });\n }\n\n /**\n * This is used for a certain user to confirm the registration by using a confirmation code\n * @param {string} confirmationCode Code entered by user.\n * @param {bool} forceAliasCreation Allow migrating from an existing email / phone number.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n confirmRegistration(confirmationCode, forceAliasCreation, callback) {\n const jsonReq = {\n ClientId: this.pool.getClientId(),\n ConfirmationCode: confirmationCode,\n Username: this.username,\n ForceAliasCreation: forceAliasCreation,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.makeUnauthenticatedRequest('confirmSignUp', jsonReq, err => {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n }\n\n /**\n * This is used by the user once he has the responses to a custom challenge\n * @param {string} answerChallenge The custom challange answer.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {customChallenge} callback.customChallenge\n * Custom challenge response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n sendCustomChallengeAnswer(answerChallenge, callback) {\n const challengeResponses = {};\n challengeResponses.USERNAME = this.username;\n challengeResponses.ANSWER = answerChallenge;\n\n const authenticationHelper = new AuthenticationHelper(\n this.pool.getUserPoolId().split('_')[1]);\n this.getCachedDeviceKeyAndPassword();\n if (this.deviceKey != null) {\n challengeResponses.DEVICE_KEY = this.deviceKey;\n }\n\n const jsonReq = {\n ChallengeName: 'CUSTOM_CHALLENGE',\n ChallengeResponses: challengeResponses,\n ClientId: this.pool.getClientId(),\n Session: this.Session,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.makeUnauthenticatedRequest('respondToAuthChallenge', jsonReq, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n\n return this.authenticateUserInternal(data, authenticationHelper, callback);\n });\n }\n\n /**\n * This is used by the user once he has an MFA code\n * @param {string} confirmationCode The MFA code entered by the user.\n * @param {object} callback Result callback map.\n * @param {string} mfaType The mfa we are replying to.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n sendMFACode(confirmationCode, callback, mfaType) {\n const challengeResponses = {};\n challengeResponses.USERNAME = this.username;\n challengeResponses.SMS_MFA_CODE = confirmationCode;\n const mfaTypeSelection = mfaType || 'SMS_MFA';\n if (mfaTypeSelection === 'SOFTWARE_TOKEN_MFA') {\n challengeResponses.SOFTWARE_TOKEN_MFA_CODE = confirmationCode;\n }\n\n if (this.deviceKey != null) {\n challengeResponses.DEVICE_KEY = this.deviceKey;\n }\n\n const jsonReq = {\n ChallengeName: mfaTypeSelection,\n ChallengeResponses: challengeResponses,\n ClientId: this.pool.getClientId(),\n Session: this.Session,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n\n this.client.makeUnauthenticatedRequest('respondToAuthChallenge',\n jsonReq, (err, dataAuthenticate) => {\n if (err) {\n return callback.onFailure(err);\n }\n\n const challengeName = dataAuthenticate.ChallengeName;\n\n if (challengeName === 'DEVICE_SRP_AUTH') {\n this.getDeviceResponse(callback);\n return undefined;\n }\n\n this.signInUserSession =\n this.getCognitoUserSession(dataAuthenticate.AuthenticationResult);\n this.cacheTokens();\n\n if (dataAuthenticate.AuthenticationResult.NewDeviceMetadata == null) {\n return callback.onSuccess(this.signInUserSession);\n }\n\n const authenticationHelper = new AuthenticationHelper(\n this.pool.getUserPoolId().split('_')[1]);\n authenticationHelper.generateHashDevice(\n dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,\n dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey,\n (errGenHash) => {\n if (errGenHash) {\n return callback.onFailure(errGenHash);\n }\n\n const deviceSecretVerifierConfig = {\n Salt: new util.Buffer(\n authenticationHelper.getSaltDevices(), 'hex'\n ).toString('base64'),\n PasswordVerifier: new util.Buffer(\n authenticationHelper.getVerifierDevices(), 'hex'\n ).toString('base64'),\n };\n\n this.verifierDevices = deviceSecretVerifierConfig.PasswordVerifier;\n this.deviceGroupKey = dataAuthenticate.AuthenticationResult\n .NewDeviceMetadata.DeviceGroupKey;\n this.randomPassword = authenticationHelper.getRandomPassword();\n\n this.client.makeUnauthenticatedRequest('confirmDevice', {\n DeviceKey: dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceSecretVerifierConfig: deviceSecretVerifierConfig,\n DeviceName: navigator.userAgent,\n }, (errConfirm, dataConfirm) => {\n if (errConfirm) {\n return callback.onFailure(errConfirm);\n }\n\n this.deviceKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey;\n this.cacheDeviceKeyAndPassword();\n if (dataConfirm.UserConfirmationNecessary === true) {\n return callback.onSuccess(\n this.signInUserSession,\n dataConfirm.UserConfirmationNecessary);\n }\n return callback.onSuccess(this.signInUserSession);\n });\n return undefined;\n });\n return undefined;\n });\n }\n\n /**\n * This is used by an authenticated user to change the current password\n * @param {string} oldUserPassword The current password.\n * @param {string} newUserPassword The requested new password.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n changePassword(oldUserPassword, newUserPassword, callback) {\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.makeUnauthenticatedRequest('changePassword', {\n PreviousPassword: oldUserPassword,\n ProposedPassword: newUserPassword,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, err => {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used by an authenticated user to enable MFA for himself\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n enableMFA(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n const mfaOptions = [];\n const mfaEnabled = {\n DeliveryMedium: 'SMS',\n AttributeName: 'phone_number',\n };\n mfaOptions.push(mfaEnabled);\n\n this.client.makeUnauthenticatedRequest('setUserSettings', {\n MFAOptions: mfaOptions,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, err => {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used by an authenticated user to enable MFA for himself\n * @param {string[]} smsMfaSettings the sms mfa settings\n * @param {string[]} softwareTokenMfaSettings the software token mfa settings\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n setUserMfaPreference(smsMfaSettings, softwareTokenMfaSettings, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.makeUnauthenticatedRequest('setUserMFAPreference', {\n SMSMfaSettings: smsMfaSettings,\n SoftwareTokenMfaSettings: softwareTokenMfaSettings,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, err => {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used by an authenticated user to disable MFA for himself\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n disableMFA(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n const mfaOptions = [];\n\n this.client.makeUnauthenticatedRequest('setUserSettings', {\n MFAOptions: mfaOptions,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, err => {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n\n\n /**\n * This is used by an authenticated user to delete himself\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n deleteUser(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.makeUnauthenticatedRequest('deleteUser', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, err => {\n if (err) {\n return callback(err, null);\n }\n this.clearCachedTokens();\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n\n /**\n * @typedef {CognitoUserAttribute | { Name:string, Value:string }} AttributeArg\n */\n /**\n * This is used by an authenticated user to change a list of attributes\n * @param {AttributeArg[]} attributes A list of the new user attributes.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n updateAttributes(attributes, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.makeUnauthenticatedRequest('updateUserAttributes', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n UserAttributes: attributes,\n }, err => {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used by an authenticated user to get a list of attributes\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n getUserAttributes(callback) {\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.makeUnauthenticatedRequest('getUser', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, (err, userData) => {\n if (err) {\n return callback(err, null);\n }\n\n const attributeList = [];\n\n for (let i = 0; i < userData.UserAttributes.length; i++) {\n const attribute = {\n Name: userData.UserAttributes[i].Name,\n Value: userData.UserAttributes[i].Value,\n };\n const userAttribute = new CognitoUserAttribute(attribute);\n attributeList.push(userAttribute);\n }\n\n return callback(null, attributeList);\n });\n return undefined;\n }\n\n /**\n * This is used by an authenticated user to get the MFAOptions\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n getMFAOptions(callback) {\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.makeUnauthenticatedRequest('getUser', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, (err, userData) => {\n if (err) {\n return callback(err, null);\n }\n\n return callback(null, userData.MFAOptions);\n });\n return undefined;\n }\n\n /**\n * This is used by an authenticated user to delete a list of attributes\n * @param {string[]} attributeList Names of the attributes to delete.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n deleteAttributes(attributeList, callback) {\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.makeUnauthenticatedRequest('deleteUserAttributes', {\n UserAttributeNames: attributeList,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, err => {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used by a user to resend a confirmation code\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n resendConfirmationCode(callback) {\n const jsonReq = {\n ClientId: this.pool.getClientId(),\n Username: this.username,\n };\n\n this.client.makeUnauthenticatedRequest('resendConfirmationCode', jsonReq, (err, result) => {\n if (err) {\n return callback(err, null);\n }\n return callback(null, result);\n });\n }\n\n /**\n * This is used to get a session, either from the session object\n * or from the local storage, or by using a refresh token\n *\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n getSession(callback) {\n if (this.username == null) {\n return callback(new Error('Username is null. Cannot retrieve a new session'), null);\n }\n\n if (this.signInUserSession != null && this.signInUserSession.isValid()) {\n return callback(null, this.signInUserSession);\n }\n\n const keyPrefix = `CognitoIdentityServiceProvider.${this.pool.getClientId()}.${this.username}`;\n const idTokenKey = `${keyPrefix}.idToken`;\n const accessTokenKey = `${keyPrefix}.accessToken`;\n const refreshTokenKey = `${keyPrefix}.refreshToken`;\n const clockDriftKey = `${keyPrefix}.clockDrift`;\n\n if (this.storage.getItem(idTokenKey)) {\n const idToken = new CognitoIdToken({\n IdToken: this.storage.getItem(idTokenKey),\n });\n const accessToken = new CognitoAccessToken({\n AccessToken: this.storage.getItem(accessTokenKey),\n });\n const refreshToken = new CognitoRefreshToken({\n RefreshToken: this.storage.getItem(refreshTokenKey),\n });\n const clockDrift = parseInt(this.storage.getItem(clockDriftKey), 0) || 0;\n\n const sessionData = {\n IdToken: idToken,\n AccessToken: accessToken,\n RefreshToken: refreshToken,\n ClockDrift: clockDrift,\n };\n const cachedSession = new CognitoUserSession(sessionData);\n if (cachedSession.isValid()) {\n this.signInUserSession = cachedSession;\n return callback(null, this.signInUserSession);\n }\n\n if (refreshToken.getToken() == null) {\n return callback(new Error('Cannot retrieve a new session. Please authenticate.'), null);\n }\n\n this.refreshSession(refreshToken, callback);\n } else {\n callback(new Error('Local storage is missing an ID Token, Please authenticate'), null);\n }\n\n return undefined;\n }\n\n\n /**\n * This uses the refreshToken to retrieve a new session\n * @param {CognitoRefreshToken} refreshToken A previous session's refresh token.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n refreshSession(refreshToken, callback) {\n const authParameters = {};\n authParameters.REFRESH_TOKEN = refreshToken.getToken();\n const keyPrefix = `CognitoIdentityServiceProvider.${this.pool.getClientId()}`;\n const lastUserKey = `${keyPrefix}.LastAuthUser`;\n\n if (this.storage.getItem(lastUserKey)) {\n this.username = this.storage.getItem(lastUserKey);\n const deviceKeyKey = `${keyPrefix}.${this.username}.deviceKey`;\n this.deviceKey = this.storage.getItem(deviceKeyKey);\n authParameters.DEVICE_KEY = this.deviceKey;\n }\n\n const jsonReq = {\n ClientId: this.pool.getClientId(),\n AuthFlow: 'REFRESH_TOKEN_AUTH',\n AuthParameters: authParameters,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.makeUnauthenticatedRequest('initiateAuth', jsonReq, (err, authResult) => {\n if (err) {\n if (err.code === 'NotAuthorizedException') {\n this.clearCachedTokens();\n }\n return callback(err, null);\n }\n if (authResult) {\n const authenticationResult = authResult.AuthenticationResult;\n if (!Object.prototype.hasOwnProperty.call(authenticationResult, 'RefreshToken')) {\n authenticationResult.RefreshToken = refreshToken.getToken();\n }\n this.signInUserSession = this.getCognitoUserSession(authenticationResult);\n this.cacheTokens();\n return callback(null, this.signInUserSession);\n }\n return undefined;\n });\n }\n\n /**\n * This is used to save the session tokens to local storage\n * @returns {void}\n */\n cacheTokens() {\n const keyPrefix = `CognitoIdentityServiceProvider.${this.pool.getClientId()}`;\n const idTokenKey = `${keyPrefix}.${this.username}.idToken`;\n const accessTokenKey = `${keyPrefix}.${this.username}.accessToken`;\n const refreshTokenKey = `${keyPrefix}.${this.username}.refreshToken`;\n const clockDriftKey = `${keyPrefix}.${this.username}.clockDrift`;\n const lastUserKey = `${keyPrefix}.LastAuthUser`;\n\n this.storage.setItem(idTokenKey, this.signInUserSession.getIdToken().getJwtToken());\n this.storage.setItem(accessTokenKey, this.signInUserSession.getAccessToken().getJwtToken());\n this.storage.setItem(refreshTokenKey, this.signInUserSession.getRefreshToken().getToken());\n this.storage.setItem(clockDriftKey, `${this.signInUserSession.getClockDrift()}`);\n this.storage.setItem(lastUserKey, this.username);\n }\n\n /**\n * This is used to cache the device key and device group and device password\n * @returns {void}\n */\n cacheDeviceKeyAndPassword() {\n const keyPrefix = `CognitoIdentityServiceProvider.${this.pool.getClientId()}.${this.username}`;\n const deviceKeyKey = `${keyPrefix}.deviceKey`;\n const randomPasswordKey = `${keyPrefix}.randomPasswordKey`;\n const deviceGroupKeyKey = `${keyPrefix}.deviceGroupKey`;\n\n this.storage.setItem(deviceKeyKey, this.deviceKey);\n this.storage.setItem(randomPasswordKey, this.randomPassword);\n this.storage.setItem(deviceGroupKeyKey, this.deviceGroupKey);\n }\n\n /**\n * This is used to get current device key and device group and device password\n * @returns {void}\n */\n getCachedDeviceKeyAndPassword() {\n const keyPrefix = `CognitoIdentityServiceProvider.${this.pool.getClientId()}.${this.username}`;\n const deviceKeyKey = `${keyPrefix}.deviceKey`;\n const randomPasswordKey = `${keyPrefix}.randomPasswordKey`;\n const deviceGroupKeyKey = `${keyPrefix}.deviceGroupKey`;\n\n if (this.storage.getItem(deviceKeyKey)) {\n this.deviceKey = this.storage.getItem(deviceKeyKey);\n this.randomPassword = this.storage.getItem(randomPasswordKey);\n this.deviceGroupKey = this.storage.getItem(deviceGroupKeyKey);\n }\n }\n\n /**\n * This is used to clear the device key info from local storage\n * @returns {void}\n */\n clearCachedDeviceKeyAndPassword() {\n const keyPrefix = `CognitoIdentityServiceProvider.${this.pool.getClientId()}.${this.username}`;\n const deviceKeyKey = `${keyPrefix}.deviceKey`;\n const randomPasswordKey = `${keyPrefix}.randomPasswordKey`;\n const deviceGroupKeyKey = `${keyPrefix}.deviceGroupKey`;\n\n this.storage.removeItem(deviceKeyKey);\n this.storage.removeItem(randomPasswordKey);\n this.storage.removeItem(deviceGroupKeyKey);\n }\n\n /**\n * This is used to clear the session tokens from local storage\n * @returns {void}\n */\n clearCachedTokens() {\n const keyPrefix = `CognitoIdentityServiceProvider.${this.pool.getClientId()}`;\n const idTokenKey = `${keyPrefix}.${this.username}.idToken`;\n const accessTokenKey = `${keyPrefix}.${this.username}.accessToken`;\n const refreshTokenKey = `${keyPrefix}.${this.username}.refreshToken`;\n const lastUserKey = `${keyPrefix}.LastAuthUser`;\n\n this.storage.removeItem(idTokenKey);\n this.storage.removeItem(accessTokenKey);\n this.storage.removeItem(refreshTokenKey);\n this.storage.removeItem(lastUserKey);\n }\n\n /**\n * This is used to build a user session from tokens retrieved in the authentication result\n * @param {object} authResult Successful auth response from server.\n * @returns {CognitoUserSession} The new user session.\n * @private\n */\n getCognitoUserSession(authResult) {\n const idToken = new CognitoIdToken(authResult);\n const accessToken = new CognitoAccessToken(authResult);\n const refreshToken = new CognitoRefreshToken(authResult);\n\n const sessionData = {\n IdToken: idToken,\n AccessToken: accessToken,\n RefreshToken: refreshToken,\n };\n\n return new CognitoUserSession(sessionData);\n }\n\n /**\n * This is used to initiate a forgot password request\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {inputVerificationCode?} callback.inputVerificationCode\n * Optional callback raised instead of onSuccess with response data.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n forgotPassword(callback) {\n const jsonReq = {\n ClientId: this.pool.getClientId(),\n Username: this.username,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.makeUnauthenticatedRequest('forgotPassword', jsonReq, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n if (typeof callback.inputVerificationCode === 'function') {\n return callback.inputVerificationCode(data);\n }\n return callback.onSuccess(data);\n });\n }\n\n /**\n * This is used to confirm a new password using a confirmationCode\n * @param {string} confirmationCode Code entered by user.\n * @param {string} newPassword Confirm new password.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n confirmPassword(confirmationCode, newPassword, callback) {\n const jsonReq = {\n ClientId: this.pool.getClientId(),\n Username: this.username,\n ConfirmationCode: confirmationCode,\n Password: newPassword,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.makeUnauthenticatedRequest('confirmForgotPassword', jsonReq, err => {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess();\n });\n }\n\n /**\n * This is used to initiate an attribute confirmation request\n * @param {string} attributeName User attribute that needs confirmation.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {inputVerificationCode} callback.inputVerificationCode Called on success.\n * @returns {void}\n */\n getAttributeVerificationCode(attributeName, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.makeUnauthenticatedRequest('getUserAttributeVerificationCode', {\n AttributeName: attributeName,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n if (typeof callback.inputVerificationCode === 'function') {\n return callback.inputVerificationCode(data);\n }\n return callback.onSuccess();\n });\n return undefined;\n }\n\n /**\n * This is used to confirm an attribute using a confirmation code\n * @param {string} attributeName Attribute being confirmed.\n * @param {string} confirmationCode Code entered by user.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n verifyAttribute(attributeName, confirmationCode, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.makeUnauthenticatedRequest('verifyUserAttribute', {\n AttributeName: attributeName,\n Code: confirmationCode,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, err => {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used to get the device information using the current device key\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess<*>} callback.onSuccess Called on success with device data.\n * @returns {void}\n */\n getDevice(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.makeUnauthenticatedRequest('getDevice', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceKey: this.deviceKey,\n }, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess(data);\n });\n return undefined;\n }\n\n /**\n * This is used to forget a specific device\n * @param {string} deviceKey Device key.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n forgetSpecificDevice(deviceKey, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.makeUnauthenticatedRequest('forgetDevice', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceKey: deviceKey,\n }, err => {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used to forget the current device\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n forgetDevice(callback) {\n this.forgetSpecificDevice(this.deviceKey, {\n onFailure: callback.onFailure,\n onSuccess: result => {\n this.deviceKey = null;\n this.deviceGroupKey = null;\n this.randomPassword = null;\n this.clearCachedDeviceKeyAndPassword();\n return callback.onSuccess(result);\n },\n });\n }\n\n /**\n * This is used to set the device status as remembered\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n setDeviceStatusRemembered(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.makeUnauthenticatedRequest('updateDeviceStatus', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceKey: this.deviceKey,\n DeviceRememberedStatus: 'remembered',\n }, err => {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used to set the device status as not remembered\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n setDeviceStatusNotRemembered(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.makeUnauthenticatedRequest('updateDeviceStatus', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceKey: this.deviceKey,\n DeviceRememberedStatus: 'not_remembered',\n }, err => {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used to list all devices for a user\n *\n * @param {int} limit the number of devices returned in a call\n * @param {string} paginationToken the pagination token in case any was returned before\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess<*>} callback.onSuccess Called on success with device list.\n * @returns {void}\n */\n listDevices(limit, paginationToken, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.makeUnauthenticatedRequest('listDevices', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n Limit: limit,\n PaginationToken: paginationToken,\n }, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess(data);\n });\n return undefined;\n }\n\n /**\n * This is used to globally revoke all tokens issued to a user\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n globalSignOut(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.makeUnauthenticatedRequest('globalSignOut', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, err => {\n if (err) {\n return callback.onFailure(err);\n }\n this.clearCachedTokens();\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used for the user to signOut of the application and clear the cached tokens.\n * @returns {void}\n */\n signOut() {\n this.signInUserSession = null;\n this.clearCachedTokens();\n }\n\n /**\n * This is used by a user trying to select a given MFA\n * @param {string} answerChallenge the mfa the user wants\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n sendMFASelectionAnswer(answerChallenge, callback) {\n const challengeResponses = {};\n challengeResponses.USERNAME = this.username;\n challengeResponses.ANSWER = answerChallenge;\n\n const jsonReq = {\n ChallengeName: 'SELECT_MFA_TYPE',\n ChallengeResponses: challengeResponses,\n ClientId: this.pool.getClientId(),\n Session: this.Session,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.makeUnauthenticatedRequest('respondToAuthChallenge', jsonReq, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n this.Session = data.Session;\n if (answerChallenge === 'SMS_MFA') {\n return callback.mfaRequired(data.challengeName, data.challengeParameters);\n }\n if (answerChallenge === 'SOFTWARE_TOKEN_MFA') {\n return callback.totpRequired(data.challengeName, data.challengeParameters);\n }\n return undefined;\n });\n }\n\n /**\n * This returns the user context data for advanced security feature.\n * @returns {void}\n */\n getUserContextData() {\n const pool = this.pool;\n return pool.getUserContextData(this.username);\n }\n\n /**\n * This is used by an authenticated or a user trying to authenticate to associate a TOTP MFA\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n associateSoftwareToken(callback) {\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n this.client.makeUnauthenticatedRequest('associateSoftwareToken', {\n Session: this.Session,\n }, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n this.Session = data.Session;\n return callback.associateSecretCode(data.SecretCode);\n });\n } else {\n this.client.makeUnauthenticatedRequest('associateSoftwareToken', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.associateSecretCode(data.SecretCode);\n });\n }\n }\n\n /**\n * This is used by an authenticated or a user trying to authenticate to associate a TOTP MFA\n * @param {string} totpCode The MFA code entered by the user.\n * @param {string} friendlyDeviceName The device name we are assigning to the device.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n verifySoftwareToken(totpCode, friendlyDeviceName, callback) {\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n this.client.makeUnauthenticatedRequest('verifySoftwareToken', {\n Session: this.Session,\n UserCode: totpCode,\n FriendlyDeviceName: friendlyDeviceName,\n }, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n this.Session = data.Session;\n const challengeResponses = {};\n challengeResponses.USERNAME = this.username;\n const jsonReq = {\n ChallengeName: 'MFA_SETUP',\n ClientId: this.pool.getClientId(),\n ChallengeResponses: challengeResponses,\n Session: this.Session,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.makeUnauthenticatedRequest('respondToAuthChallenge',\n jsonReq, (errRespond, dataRespond) => {\n if (errRespond) {\n return callback.onFailure(errRespond);\n }\n this.signInUserSession = this.getCognitoUserSession(dataRespond.AuthenticationResult);\n this.cacheTokens();\n return callback.onSuccess(this.signInUserSession);\n });\n return undefined;\n });\n } else {\n this.client.makeUnauthenticatedRequest('verifySoftwareToken', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n UserCode: totpCode,\n FriendlyDeviceName: friendlyDeviceName,\n }, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n return callback(null, data);\n });\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/CognitoUser.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @class */\nexport default class CognitoUserAttribute {\n /**\n * Constructs a new CognitoUserAttribute object\n * @param {string=} Name The record's name\n * @param {string=} Value The record's value\n */\n constructor({ Name, Value } = {}) {\n this.Name = Name || '';\n this.Value = Value || '';\n }\n\n /**\n * @returns {string} the record's value.\n */\n getValue() {\n return this.Value;\n }\n\n /**\n * Sets the record's value.\n * @param {string} value The new value.\n * @returns {CognitoUserAttribute} The record for method chaining.\n */\n setValue(value) {\n this.Value = value;\n return this;\n }\n\n /**\n * @returns {string} the record's name.\n */\n getName() {\n return this.Name;\n }\n\n /**\n * Sets the record's name\n * @param {string} name The new name.\n * @returns {CognitoUserAttribute} The record for method chaining.\n */\n setName(name) {\n this.Name = name;\n return this;\n }\n\n /**\n * @returns {string} a string representation of the record.\n */\n toString() {\n return JSON.stringify(this);\n }\n\n /**\n * @returns {object} a flat object representing the record.\n */\n toJSON() {\n return {\n Name: this.Name,\n Value: this.Value,\n };\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/CognitoUserAttribute.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @class */\nexport default class CognitoUserSession {\n /**\n * Constructs a new CognitoUserSession object\n * @param {CognitoIdToken} IdToken The session's Id token.\n * @param {CognitoRefreshToken=} RefreshToken The session's refresh token.\n * @param {CognitoAccessToken} AccessToken The session's access token.\n * @param {int} ClockDrift The saved computer's clock drift or undefined to force calculation.\n */\n constructor({ IdToken, RefreshToken, AccessToken, ClockDrift } = {}) {\n if (AccessToken == null || IdToken == null) {\n throw new Error('Id token and Access Token must be present.');\n }\n\n this.idToken = IdToken;\n this.refreshToken = RefreshToken;\n this.accessToken = AccessToken;\n this.clockDrift = ClockDrift === undefined ? this.calculateClockDrift() : ClockDrift;\n }\n\n /**\n * @returns {CognitoIdToken} the session's Id token\n */\n getIdToken() {\n return this.idToken;\n }\n\n /**\n * @returns {CognitoRefreshToken} the session's refresh token\n */\n getRefreshToken() {\n return this.refreshToken;\n }\n\n /**\n * @returns {CognitoAccessToken} the session's access token\n */\n getAccessToken() {\n return this.accessToken;\n }\n\n /**\n * @returns {int} the session's clock drift\n */\n getClockDrift() {\n return this.clockDrift;\n }\n\n /**\n * @returns {int} the computer's clock drift\n */\n calculateClockDrift() {\n const now = Math.floor(new Date() / 1000);\n const iat = Math.min(this.accessToken.getIssuedAt(), this.idToken.getIssuedAt());\n\n return now - iat;\n }\n\n /**\n * Checks to see if the session is still valid based on session expiry information found\n * in tokens and the current time (adjusted with clock drift)\n * @returns {boolean} if the session is still valid\n */\n isValid() {\n const now = Math.floor(new Date() / 1000);\n const adjusted = now - this.clockDrift;\n\n return adjusted < this.accessToken.getExpiration() && adjusted < this.idToken.getExpiration();\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/CognitoUserSession.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst monthNames =\n ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\nconst weekNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\n\n/** @class */\nexport default class DateHelper {\n /**\n * @returns {string} The current time in \"ddd MMM D HH:mm:ss UTC YYYY\" format.\n */\n getNowString() {\n const now = new Date();\n\n const weekDay = weekNames[now.getUTCDay()];\n const month = monthNames[now.getUTCMonth()];\n const day = now.getUTCDate();\n\n let hours = now.getUTCHours();\n if (hours < 10) {\n hours = `0${hours}`;\n }\n\n let minutes = now.getUTCMinutes();\n if (minutes < 10) {\n minutes = `0${minutes}`;\n }\n\n let seconds = now.getUTCSeconds();\n if (seconds < 10) {\n seconds = `0${seconds}`;\n }\n\n const year = now.getUTCFullYear();\n\n // ddd MMM D HH:mm:ss UTC YYYY\n const dateNow = `${weekDay} ${month} ${day} ${hours}:${minutes}:${seconds} UTC ${year}`;\n\n return dateNow;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/DateHelper.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nlet dataMemory = {};\n\n/** @class */\nclass MemoryStorage {\n\n /**\n * This is used to set a specific item in storage\n * @param {string} key - the key for the item\n * @param {object} value - the value\n * @returns {string} value that was set\n */\n static setItem(key, value) {\n dataMemory[key] = value;\n return dataMemory[key];\n }\n\n /**\n * This is used to get a specific key from storage\n * @param {string} key - the key for the item\n * This is used to clear the storage\n * @returns {string} the data item\n */\n static getItem(key) {\n return Object.prototype.hasOwnProperty.call(dataMemory, key) ? dataMemory[key] : undefined;\n }\n\n /**\n * This is used to remove an item from storage\n * @param {string} key - the key being set\n * @returns {string} value - value that was deleted\n */\n static removeItem(key) {\n return delete dataMemory[key];\n }\n\n /**\n * This is used to clear the storage\n * @returns {string} nothing\n */\n static clear() {\n dataMemory = {};\n return dataMemory;\n }\n}\n\n/** @class */\nexport default class StorageHelper {\n\n /**\n * This is used to get a storage object\n * @returns {object} the storage\n */\n constructor() {\n try {\n this.storageWindow = window.localStorage;\n this.storageWindow.setItem('aws.cognito.test-ls', 1);\n this.storageWindow.removeItem('aws.cognito.test-ls');\n } catch (exception) {\n this.storageWindow = MemoryStorage;\n }\n }\n\n /**\n * This is used to return the storage\n * @returns {object} the storage\n */\n getStorage() {\n return this.storageWindow;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/StorageHelper.js","module.exports = __WEBPACK_EXTERNAL_MODULE_13__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"root\":[\"AWSCognito\",\"CognitoIdentityServiceProvider\"],\"commonjs2\":\"aws-sdk/clients/cognitoidentityserviceprovider\",\"commonjs\":\"aws-sdk/clients/cognitoidentityserviceprovider\",\"amd\":\"aws-sdk/clients/cognitoidentityserviceprovider\"}\n// module id = 13\n// module chunks = 0","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @class */\nexport default class AuthenticationDetails {\n /**\n * Constructs a new AuthenticationDetails object\n * @param {object=} data Creation options.\n * @param {string} data.Username User being authenticated.\n * @param {string} data.Password Plain-text password to authenticate with.\n * @param {(AttributeArg[])?} data.ValidationData Application extra metadata.\n * @param {(AttributeArg[])?} data.AuthParamaters Authentication paramaters for custom auth.\n */\n constructor(data) {\n const { ValidationData, Username, Password, AuthParameters } = data || {};\n this.validationData = ValidationData || [];\n this.authParameters = AuthParameters || [];\n this.username = Username;\n this.password = Password;\n }\n\n /**\n * @returns {string} the record's username\n */\n getUsername() {\n return this.username;\n }\n\n /**\n * @returns {string} the record's password\n */\n getPassword() {\n return this.password;\n }\n\n /**\n * @returns {Array} the record's validationData\n */\n getValidationData() {\n return this.validationData;\n }\n\n /**\n * @returns {Array} the record's authParameters\n */\n getAuthParameters() {\n return this.authParameters;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/AuthenticationDetails.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport CognitoIdentityServiceProvider from 'aws-sdk/clients/cognitoidentityserviceprovider';\n\nimport CognitoUser from './CognitoUser';\nimport StorageHelper from './StorageHelper';\n\n/** @class */\nexport default class CognitoUserPool {\n /**\n * Constructs a new CognitoUserPool object\n * @param {object} data Creation options.\n * @param {string} data.UserPoolId Cognito user pool id.\n * @param {string} data.ClientId User pool application client id.\n * @param {object} data.Storage Optional storage object.\n * @param {boolean} data.AdvancedSecurityDataCollectionFlag Optional:\n * boolean flag indicating if the data collection is enabled\n * to support cognito advanced security features. By default, this\n * flag is set to true.\n */\n constructor(data) {\n const { UserPoolId, ClientId, endpoint, AdvancedSecurityDataCollectionFlag } = data || {};\n if (!UserPoolId || !ClientId) {\n throw new Error('Both UserPoolId and ClientId are required.');\n }\n if (!/^[\\w-]+_.+$/.test(UserPoolId)) {\n throw new Error('Invalid UserPoolId format.');\n }\n const region = UserPoolId.split('_')[0];\n\n this.userPoolId = UserPoolId;\n this.clientId = ClientId;\n\n this.client = new CognitoIdentityServiceProvider({\n apiVersion: '2016-04-19',\n region,\n endpoint,\n });\n\n /**\n * By default, AdvancedSecurityDataCollectionFlag is set to true,\n * if no input value is provided.\n */\n this.advancedSecurityDataCollectionFlag = AdvancedSecurityDataCollectionFlag !== false;\n\n this.storage = data.Storage || new StorageHelper().getStorage();\n }\n\n /**\n * @returns {string} the user pool id\n */\n getUserPoolId() {\n return this.userPoolId;\n }\n\n /**\n * @returns {string} the client id\n */\n getClientId() {\n return this.clientId;\n }\n\n /**\n * @typedef {object} SignUpResult\n * @property {CognitoUser} user New user.\n * @property {bool} userConfirmed If the user is already confirmed.\n */\n /**\n * method for signing up a user\n * @param {string} username User's username.\n * @param {string} password Plain-text initial password entered by user.\n * @param {(AttributeArg[])=} userAttributes New user attributes.\n * @param {(AttributeArg[])=} validationData Application metadata.\n * @param {nodeCallback} callback Called on error or with the new user.\n * @returns {void}\n */\n signUp(username, password, userAttributes, validationData, callback) {\n const jsonReq = {\n ClientId: this.clientId,\n Username: username,\n Password: password,\n UserAttributes: userAttributes,\n ValidationData: validationData,\n };\n if (this.getUserContextData(username)) {\n jsonReq.UserContextData = this.getUserContextData(username);\n }\n this.client.makeUnauthenticatedRequest('signUp', jsonReq, (err, data) => {\n if (err) {\n return callback(err, null);\n }\n\n const cognitoUser = {\n Username: username,\n Pool: this,\n Storage: this.storage,\n };\n\n const returnData = {\n user: new CognitoUser(cognitoUser),\n userConfirmed: data.UserConfirmed,\n userSub: data.UserSub,\n };\n\n return callback(null, returnData);\n });\n }\n\n\n /**\n * method for getting the current user of the application from the local storage\n *\n * @returns {CognitoUser} the user retrieved from storage\n */\n getCurrentUser() {\n const lastUserKey = `CognitoIdentityServiceProvider.${this.clientId}.LastAuthUser`;\n\n const lastAuthUser = this.storage.getItem(lastUserKey);\n if (lastAuthUser) {\n const cognitoUser = {\n Username: lastAuthUser,\n Pool: this,\n Storage: this.storage,\n };\n\n return new CognitoUser(cognitoUser);\n }\n\n return null;\n }\n\n /**\n * This method returns the encoded data string used for cognito advanced security feature.\n * This would be generated only when developer has included the JS used for collecting the\n * data on their client. Please refer to documentation to know more about using AdvancedSecurity\n * features\n * @param {string} username the username for the context data\n * @returns {string} the user context data\n **/\n getUserContextData(username) {\n if (typeof AmazonCognitoAdvancedSecurityData === 'undefined') {\n return undefined;\n }\n /* eslint-disable */\n const amazonCognitoAdvancedSecurityDataConst = AmazonCognitoAdvancedSecurityData;\n /* eslint-enable */\n\n if (this.advancedSecurityDataCollectionFlag) {\n const advancedSecurityData = amazonCognitoAdvancedSecurityDataConst.getData(username,\n this.userPoolId, this.clientId);\n if (advancedSecurityData) {\n const userContextData = {\n EncodedData: advancedSecurityData,\n };\n return userContextData;\n }\n }\n return {};\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/CognitoUserPool.js","\nimport * as Cookies from 'js-cookie';\n\n/** @class */\nexport default class CookieStorage {\n\n /**\n * Constructs a new CookieStorage object\n * @param {object} data Creation options.\n * @param {string} data.domain Cookies domain (mandatory).\n * @param {string} data.path Cookies path (default: '/')\n * @param {integer} data.expires Cookie expiration (in days, default: 365)\n * @param {boolean} data.secure Cookie secure flag (default: true)\n */\n constructor(data) {\n this.domain = data.domain;\n if (data.path) {\n this.path = data.path;\n } else {\n this.path = '/';\n }\n if (Object.prototype.hasOwnProperty.call(data, 'expires')) {\n this.expires = data.expires;\n } else {\n this.expires = 365;\n }\n if (Object.prototype.hasOwnProperty.call(data, 'secure')) {\n this.secure = data.secure;\n } else {\n this.secure = true;\n }\n }\n\n /**\n * This is used to set a specific item in storage\n * @param {string} key - the key for the item\n * @param {object} value - the value\n * @returns {string} value that was set\n */\n setItem(key, value) {\n Cookies.set(key, value, {\n path: this.path,\n expires: this.expires,\n domain: this.domain,\n secure: this.secure,\n }\n );\n return Cookies.get(key);\n }\n\n /**\n * This is used to get a specific key from storage\n * @param {string} key - the key for the item\n * This is used to clear the storage\n * @returns {string} the data item\n */\n getItem(key) {\n return Cookies.get(key);\n }\n\n /**\n * This is used to remove an item from storage\n * @param {string} key - the key being set\n * @returns {string} value - value that was deleted\n */\n removeItem(key) {\n return Cookies.remove(key, {\n path: this.path,\n domain: this.domain,\n secure: this.secure,\n }\n );\n }\n\n /**\n * This is used to clear the storage\n * @returns {string} nothing\n */\n clear() {\n const cookies = Cookies.get();\n let index;\n for (index = 0; index < cookies.length; ++index) {\n Cookies.remove(cookies[index]);\n }\n return {};\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/CookieStorage.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { default as AuthenticationDetails } from './AuthenticationDetails';\nexport { default as AuthenticationHelper } from './AuthenticationHelper';\nexport { default as CognitoAccessToken } from './CognitoAccessToken';\nexport { default as CognitoIdToken } from './CognitoIdToken';\nexport { default as CognitoRefreshToken } from './CognitoRefreshToken';\nexport { default as CognitoUser } from './CognitoUser';\nexport { default as CognitoUserAttribute } from './CognitoUserAttribute';\nexport { default as CognitoUserPool } from './CognitoUserPool';\nexport { default as CognitoUserSession } from './CognitoUserSession';\nexport { default as CookieStorage } from './CookieStorage';\nexport { default as DateHelper } from './DateHelper';\n\n// The version of crypto-browserify included by aws-sdk only\n// checks for window.crypto, not window.msCrypto as used by\n// IE 11 – so we set it explicitly here\nif (typeof window !== 'undefined' && !window.crypto && window.msCrypto) {\n window.crypto = window.msCrypto;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","/*!\n * JavaScript Cookie v2.2.0\n * https://github.com/js-cookie/js-cookie\n *\n * Copyright 2006, 2015 Klaus Hartl & Fagner Brack\n * Released under the MIT license\n */\n;(function (factory) {\n\tvar registeredInModuleLoader = false;\n\tif (typeof define === 'function' && define.amd) {\n\t\tdefine(factory);\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (typeof exports === 'object') {\n\t\tmodule.exports = factory();\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (!registeredInModuleLoader) {\n\t\tvar OldCookies = window.Cookies;\n\t\tvar api = window.Cookies = factory();\n\t\tapi.noConflict = function () {\n\t\t\twindow.Cookies = OldCookies;\n\t\t\treturn api;\n\t\t};\n\t}\n}(function () {\n\tfunction extend () {\n\t\tvar i = 0;\n\t\tvar result = {};\n\t\tfor (; i < arguments.length; i++) {\n\t\t\tvar attributes = arguments[ i ];\n\t\t\tfor (var key in attributes) {\n\t\t\t\tresult[key] = attributes[key];\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tfunction init (converter) {\n\t\tfunction api (key, value, attributes) {\n\t\t\tvar result;\n\t\t\tif (typeof document === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Write\n\n\t\t\tif (arguments.length > 1) {\n\t\t\t\tattributes = extend({\n\t\t\t\t\tpath: '/'\n\t\t\t\t}, api.defaults, attributes);\n\n\t\t\t\tif (typeof attributes.expires === 'number') {\n\t\t\t\t\tvar expires = new Date();\n\t\t\t\t\texpires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);\n\t\t\t\t\tattributes.expires = expires;\n\t\t\t\t}\n\n\t\t\t\t// We're using \"expires\" because \"max-age\" is not supported by IE\n\t\t\t\tattributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';\n\n\t\t\t\ttry {\n\t\t\t\t\tresult = JSON.stringify(value);\n\t\t\t\t\tif (/^[\\{\\[]/.test(result)) {\n\t\t\t\t\t\tvalue = result;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {}\n\n\t\t\t\tif (!converter.write) {\n\t\t\t\t\tvalue = encodeURIComponent(String(value))\n\t\t\t\t\t\t.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);\n\t\t\t\t} else {\n\t\t\t\t\tvalue = converter.write(value, key);\n\t\t\t\t}\n\n\t\t\t\tkey = encodeURIComponent(String(key));\n\t\t\t\tkey = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);\n\t\t\t\tkey = key.replace(/[\\(\\)]/g, escape);\n\n\t\t\t\tvar stringifiedAttributes = '';\n\n\t\t\t\tfor (var attributeName in attributes) {\n\t\t\t\t\tif (!attributes[attributeName]) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tstringifiedAttributes += '; ' + attributeName;\n\t\t\t\t\tif (attributes[attributeName] === true) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tstringifiedAttributes += '=' + attributes[attributeName];\n\t\t\t\t}\n\t\t\t\treturn (document.cookie = key + '=' + value + stringifiedAttributes);\n\t\t\t}\n\n\t\t\t// Read\n\n\t\t\tif (!key) {\n\t\t\t\tresult = {};\n\t\t\t}\n\n\t\t\t// To prevent the for loop in the first place assign an empty array\n\t\t\t// in case there are no cookies at all. Also prevents odd result when\n\t\t\t// calling \"get()\"\n\t\t\tvar cookies = document.cookie ? document.cookie.split('; ') : [];\n\t\t\tvar rdecode = /(%[0-9A-Z]{2})+/g;\n\t\t\tvar i = 0;\n\n\t\t\tfor (; i < cookies.length; i++) {\n\t\t\t\tvar parts = cookies[i].split('=');\n\t\t\t\tvar cookie = parts.slice(1).join('=');\n\n\t\t\t\tif (!this.json && cookie.charAt(0) === '\"') {\n\t\t\t\t\tcookie = cookie.slice(1, -1);\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tvar name = parts[0].replace(rdecode, decodeURIComponent);\n\t\t\t\t\tcookie = converter.read ?\n\t\t\t\t\t\tconverter.read(cookie, name) : converter(cookie, name) ||\n\t\t\t\t\t\tcookie.replace(rdecode, decodeURIComponent);\n\n\t\t\t\t\tif (this.json) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcookie = JSON.parse(cookie);\n\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (key === name) {\n\t\t\t\t\t\tresult = cookie;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!key) {\n\t\t\t\t\t\tresult[name] = cookie;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\tapi.set = api;\n\t\tapi.get = function (key) {\n\t\t\treturn api.call(api, key);\n\t\t};\n\t\tapi.getJSON = function () {\n\t\t\treturn api.apply({\n\t\t\t\tjson: true\n\t\t\t}, [].slice.call(arguments));\n\t\t};\n\t\tapi.defaults = {};\n\n\t\tapi.remove = function (key, attributes) {\n\t\t\tapi(key, '', extend(attributes, {\n\t\t\t\texpires: -1\n\t\t\t}));\n\t\t};\n\n\t\tapi.withConverter = init;\n\n\t\treturn api;\n\t}\n\n\treturn init(function () {});\n}));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/js-cookie/src/js.cookie.js\n// module id = 18\n// module chunks = 0"],"sourceRoot":""}