@agentlang/lstudio 0.5.6 → 0.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/assets/_commonjs-dynamic-modules-CBoS8n4P.js +1 -0
  2. package/assets/example_app.png +0 -0
  3. package/assets/{index-CAsiSxeK.js → index-BLPvWbNs.js} +9 -9
  4. package/assets/{index-D4z_hbl0-CD1MieBA.js → index-BdO96dMW-BjEBMMER.js} +9 -9
  5. package/assets/{index-6mr3sa6o.js → index-BeE6X42x.js} +1 -1
  6. package/assets/index-Bg7mjqf1.js +1 -0
  7. package/assets/index-BhYX3qBc.js +1 -0
  8. package/assets/index-BqmQ6R7D-Cvh6Y-cG.js +1 -0
  9. package/assets/{index-BFv-M3PX.js → index-C4ZJ2fWH.js} +14 -14
  10. package/assets/index-CTxlCoxU.js +1 -0
  11. package/assets/index-Cd6-wDh7-w-5JgxLH.js +1 -0
  12. package/assets/index-CtaoM3Uk.css +1 -0
  13. package/assets/{index-KGBiLwKE-Doz2tX9S.js → index-DCVpGHYR-DncY2IUl.js} +4 -4
  14. package/assets/index-MQ64-2HE-2GyteIUG.js +6 -0
  15. package/assets/{index-BT-B0wMw.js → index-uGY2TZXj.js} +1124 -1052
  16. package/assets/index.browser-LD9_MBUR.js +6 -0
  17. package/assets/loadCognitoIdentity-CbXsi3Qd.js +1 -0
  18. package/assets/loadSts-DomLYfvn.js +1 -0
  19. package/assets/replService-CbuM5xLC.js +1 -0
  20. package/assets/{resolveDefaultsModeConfig-BaVgVWbD.js → resolveDefaultsModeConfig-ogrP3dYF.js} +1 -1
  21. package/assets/{winston-1qzyIKCb-DfRv1PO8.js → winston-BeL9Vq-B-C8Yb-h9y.js} +27 -27
  22. package/assets/winston-Bz1F2xmd-D4C41xs-.js +1 -0
  23. package/assets/{winston-DA9FnRtM.js → winston-CnYg22C6.js} +27 -27
  24. package/assets/{winston-fLGSL0tu.js → winston-DnkiK_Cl.js} +1 -1
  25. package/index.html +5 -9
  26. package/package.json +1 -1
  27. package/assets/__vite-browser-external-BDMct_Gn-FmFgRqLi.js +0 -1
  28. package/assets/__vite-browser-external-DLjrMatA.js +0 -1
  29. package/assets/_commonjs-dynamic-modules-DkOKMH7F.js +0 -1
  30. package/assets/_commonjsHelpers-B4e78b8K-W3E8ocG7.js +0 -1
  31. package/assets/index-69shuAsh-DF18H7zf.js +0 -1
  32. package/assets/index-B0dS78d1.js +0 -1
  33. package/assets/index-BXMy9UIl.js +0 -1
  34. package/assets/index-Bto-kj6R-C0A_3Pwb.js +0 -1
  35. package/assets/index-CpjrEQ_o.css +0 -1
  36. package/assets/index-DSosZ5sh-Ceejs_jv.js +0 -1
  37. package/assets/index-Dlh-KIx4.js +0 -1
  38. package/assets/index-DsIu-45t-Bejjlpz4.js +0 -6
  39. package/assets/index.browser-1cO3jWRU.js +0 -6
  40. package/assets/inherits_browser-nmOknR35-Bp0mvRSL.js +0 -1
  41. package/assets/loadCognitoIdentity-DbqOiF04.js +0 -1
  42. package/assets/loadSts-D8r_UqTz.js +0 -1
  43. package/assets/replService-CZE13KTw.js +0 -1
  44. package/assets/util-B4ZV5RJW.js +0 -10
  45. package/assets/util-CNqBjtt6-GUXK7Yxz.js +0 -10
  46. package/assets/util-DZRIOW0Z-CproX86h.js +0 -1
  47. package/assets/winston-CtxF18qc-B_oJRj0X.js +0 -1
@@ -1,7 +1,7 @@
1
- import{l as Pe,u as Le}from"./_commonjsHelpers-B4e78b8K-W3E8ocG7.js";import{I as xt,k as Nt}from"./index-DSosZ5sh-Ceejs_jv.js";import{g as me}from"./index.browser-BHPvGrwi-6Mh8eUw-.js";import{r as Kt}from"./_commonjs-dynamic-modules-BpilXLfW-DfYEAvWy.js";import{Y as we}from"./index-6mKfgpcs-DsgiI2lM.js";/*!
1
+ import{_ as Pe,b as xt,m as Nt,O as Le}from"./index-BqmQ6R7D-Cvh6Y-cG.js";import{g as me}from"./index.browser-BHPvGrwi-6Mh8eUw-.js";import{r as Kt}from"./_commonjs-dynamic-modules-BpilXLfW-DfYEAvWy.js";import{Y as we}from"./index-6mKfgpcs-DsgiI2lM.js";/*!
2
2
  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  * SPDX-License-Identifier: Apache-2.0
4
- */var jn=(function(){function o(e){var n=e||{},s=n.ValidationData,a=n.Username,c=n.Password,f=n.AuthParameters,g=n.ClientMetadata;this.validationData=s||{},this.authParameters=f||{},this.clientMetadata=g||{},this.username=a,this.password=c}var r=o.prototype;return r.getUsername=function(){return this.username},r.getPassword=function(){return this.password},r.getValidationData=function(){return this.validationData},r.getAuthParameters=function(){return this.authParameters},r.getClientMetadata=function(){return this.clientMetadata},o})(),qe={},Ae,je;function Vt(){if(je)return Ae;je=1;var o={}.toString;return Ae=Array.isArray||function(r){return o.call(r)=="[object Array]"},Ae}/*!
4
+ */var qn=(function(){function o(e){var n=e||{},s=n.ValidationData,a=n.Username,c=n.Password,f=n.AuthParameters,g=n.ClientMetadata;this.validationData=s||{},this.authParameters=f||{},this.clientMetadata=g||{},this.username=a,this.password=c}var r=o.prototype;return r.getUsername=function(){return this.username},r.getPassword=function(){return this.password},r.getValidationData=function(){return this.validationData},r.getAuthParameters=function(){return this.authParameters},r.getClientMetadata=function(){return this.clientMetadata},o})(),qe={},Ae,je;function Vt(){if(je)return Ae;je=1;var o={}.toString;return Ae=Array.isArray||function(r){return o.call(r)=="[object Array]"},Ae}/*!
5
5
  * The buffer module from node.js, for the browser.
6
6
  *
7
7
  * @author Feross Aboukhadijeh <http://feross.org>
@@ -49,10 +49,10 @@ PERFORMANCE OF THIS SOFTWARE.
49
49
  */var Un=typeof navigator<"u",ct=Un?At.isReactNative?"react-native":navigator.userAgent:"nodejs",ht=(function(){function o(e){if(e==null||e.Username==null||e.Pool==null)throw new Error("Username and Pool information are required.");this.username=e.Username||"",this.pool=e.Pool,this.Session=null,this.client=e.Pool.client,this.signInUserSession=null,this.authenticationFlowType="USER_SRP_AUTH",this.storage=e.Storage||new Ct().getStorage(),this.keyPrefix="CognitoIdentityServiceProvider."+this.pool.getClientId(),this.userDataKey=this.keyPrefix+"."+this.username+".userData"}var r=o.prototype;return r.setSignInUserSession=function(e){this.clearCachedUserData(),this.signInUserSession=e,this.cacheTokens()},r.getSignInUserSession=function(){return this.signInUserSession},r.getUsername=function(){return this.username},r.getAuthenticationFlowType=function(){return this.authenticationFlowType},r.setAuthenticationFlowType=function(e){this.authenticationFlowType=e},r.initiateAuth=function(e,n){var s=this,a=e.getAuthParameters();a.USERNAME=this.username;var c=Object.keys(e.getValidationData()).length!==0?e.getValidationData():e.getClientMetadata(),f={AuthFlow:"CUSTOM_AUTH",ClientId:this.pool.getClientId(),AuthParameters:a,ClientMetadata:c};this.getUserContextData()&&(f.UserContextData=this.getUserContextData()),this.client.request("InitiateAuth",f,function(g,l){if(g)return n.onFailure(g);var d=l.ChallengeName,y=l.ChallengeParameters;return d==="CUSTOM_CHALLENGE"?(s.Session=l.Session,n.customChallenge(y)):(s.signInUserSession=s.getCognitoUserSession(l.AuthenticationResult),s.cacheTokens(),n.onSuccess(s.signInUserSession))})},r.authenticateUser=function(e,n){return this.authenticationFlowType==="USER_PASSWORD_AUTH"?this.authenticateUserPlainUsernamePassword(e,n):this.authenticationFlowType==="USER_SRP_AUTH"||this.authenticationFlowType==="CUSTOM_AUTH"?this.authenticateUserDefaultAuth(e,n):n.onFailure(new Error("Authentication flow type is invalid."))},r.authenticateUserDefaultAuth=function(e,n){var s=this,a=new $(this.pool.getUserPoolName()),c=new ft,f,g,l={};this.deviceKey!=null&&(l.DEVICE_KEY=this.deviceKey),l.USERNAME=this.username,a.getLargeAValue(function(d,y){d&&n.onFailure(d),l.SRP_A=y.toString(16),s.authenticationFlowType==="CUSTOM_AUTH"&&(l.CHALLENGE_NAME="SRP_A");var S=Object.keys(e.getValidationData()).length!==0?e.getValidationData():e.getClientMetadata(),w={AuthFlow:s.authenticationFlowType,ClientId:s.pool.getClientId(),AuthParameters:l,ClientMetadata:S};s.getUserContextData(s.username)&&(w.UserContextData=s.getUserContextData(s.username)),s.client.request("InitiateAuth",w,function(U,A){if(U)return n.onFailure(U);var E=A.ChallengeParameters;s.username=E.USER_ID_FOR_SRP,s.userDataKey=s.keyPrefix+"."+s.username+".userData",f=new m(E.SRP_B,16),g=new m(E.SALT,16),s.getCachedDeviceKeyAndPassword(),a.getPasswordAuthenticationKey(s.username,e.getPassword(),f,g,function(T,B){T&&n.onFailure(T);var q=c.getNowString(),M=I.Buffer.concat([I.Buffer.from(s.pool.getUserPoolName(),"utf8"),I.Buffer.from(s.username,"utf8"),I.Buffer.from(E.SECRET_BLOCK,"base64"),I.Buffer.from(q,"utf8")]),Y=new ue.Sha256(B);Y.update(M);var W=Y.digestSync(),L=I.Buffer.from(W).toString("base64"),x={};x.USERNAME=s.username,x.PASSWORD_CLAIM_SECRET_BLOCK=E.SECRET_BLOCK,x.TIMESTAMP=q,x.PASSWORD_CLAIM_SIGNATURE=L,s.deviceKey!=null&&(x.DEVICE_KEY=s.deviceKey);var j=function(G,z){return s.client.request("RespondToAuthChallenge",G,function(X,he){return X&&X.code==="ResourceNotFoundException"&&X.message.toLowerCase().indexOf("device")!==-1?(x.DEVICE_KEY=null,s.deviceKey=null,s.randomPassword=null,s.deviceGroupKey=null,s.clearCachedDeviceKeyAndPassword(),j(G,z)):z(X,he)})},Z={ChallengeName:"PASSWORD_VERIFIER",ClientId:s.pool.getClientId(),ChallengeResponses:x,Session:A.Session,ClientMetadata:S};s.getUserContextData()&&(Z.UserContextData=s.getUserContextData()),j(Z,function(G,z){return G?n.onFailure(G):s.authenticateUserInternal(z,a,n)})})})})},r.authenticateUserPlainUsernamePassword=function(e,n){var s=this,a={};if(a.USERNAME=this.username,a.PASSWORD=e.getPassword(),!a.PASSWORD){n.onFailure(new Error("PASSWORD parameter is required"));return}var c=new $(this.pool.getUserPoolName());this.getCachedDeviceKeyAndPassword(),this.deviceKey!=null&&(a.DEVICE_KEY=this.deviceKey);var f=Object.keys(e.getValidationData()).length!==0?e.getValidationData():e.getClientMetadata(),g={AuthFlow:"USER_PASSWORD_AUTH",ClientId:this.pool.getClientId(),AuthParameters:a,ClientMetadata:f};this.getUserContextData(this.username)&&(g.UserContextData=this.getUserContextData(this.username)),this.client.request("InitiateAuth",g,function(l,d){return l?n.onFailure(l):s.authenticateUserInternal(d,c,n)})},r.authenticateUserInternal=function(e,n,s){var a=this,c=e.ChallengeName,f=e.ChallengeParameters;if(c==="SMS_MFA")return this.Session=e.Session,s.mfaRequired(c,f);if(c==="SELECT_MFA_TYPE")return this.Session=e.Session,s.selectMFAType(c,f);if(c==="MFA_SETUP")return this.Session=e.Session,s.mfaSetup(c,f);if(c==="SOFTWARE_TOKEN_MFA")return this.Session=e.Session,s.totpRequired(c,f);if(c==="CUSTOM_CHALLENGE")return this.Session=e.Session,s.customChallenge(f);if(c==="NEW_PASSWORD_REQUIRED"){this.Session=e.Session;var g=null,l=null,d=[],y=n.getNewPasswordRequiredChallengeUserAttributePrefix();if(f&&(g=JSON.parse(e.ChallengeParameters.userAttributes),l=JSON.parse(e.ChallengeParameters.requiredAttributes)),l)for(var S=0;S<l.length;S++)d[S]=l[S].substr(y.length);return s.newPasswordRequired(g,d)}if(c==="DEVICE_SRP_AUTH"){this.Session=e.Session,this.getDeviceResponse(s);return}this.signInUserSession=this.getCognitoUserSession(e.AuthenticationResult),this.challengeName=c,this.cacheTokens();var w=e.AuthenticationResult.NewDeviceMetadata;if(w==null)return s.onSuccess(this.signInUserSession);n.generateHashDevice(e.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,e.AuthenticationResult.NewDeviceMetadata.DeviceKey,function(U){if(U)return s.onFailure(U);var A={Salt:I.Buffer.from(n.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:I.Buffer.from(n.getVerifierDevices(),"hex").toString("base64")};a.verifierDevices=A.PasswordVerifier,a.deviceGroupKey=w.DeviceGroupKey,a.randomPassword=n.getRandomPassword(),a.client.request("ConfirmDevice",{DeviceKey:w.DeviceKey,AccessToken:a.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:A,DeviceName:ct},function(E,T){return E?s.onFailure(E):(a.deviceKey=e.AuthenticationResult.NewDeviceMetadata.DeviceKey,a.cacheDeviceKeyAndPassword(),T.UserConfirmationNecessary===!0?s.onSuccess(a.signInUserSession,T.UserConfirmationNecessary):s.onSuccess(a.signInUserSession))})})},r.completeNewPasswordChallenge=function(e,n,s,a){var c=this;if(!e)return s.onFailure(new Error("New password is required."));var f=new $(this.pool.getUserPoolName()),g=f.getNewPasswordRequiredChallengeUserAttributePrefix(),l={};n&&Object.keys(n).forEach(function(y){l[g+y]=n[y]}),l.NEW_PASSWORD=e,l.USERNAME=this.username;var d={ChallengeName:"NEW_PASSWORD_REQUIRED",ClientId:this.pool.getClientId(),ChallengeResponses:l,Session:this.Session,ClientMetadata:a};this.getUserContextData()&&(d.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",d,function(y,S){return y?s.onFailure(y):c.authenticateUserInternal(S,f,s)})},r.getDeviceResponse=function(e,n){var s=this,a=new $(this.deviceGroupKey),c=new ft,f={};f.USERNAME=this.username,f.DEVICE_KEY=this.deviceKey,a.getLargeAValue(function(g,l){g&&e.onFailure(g),f.SRP_A=l.toString(16);var d={ChallengeName:"DEVICE_SRP_AUTH",ClientId:s.pool.getClientId(),ChallengeResponses:f,ClientMetadata:n,Session:s.Session};s.getUserContextData()&&(d.UserContextData=s.getUserContextData()),s.client.request("RespondToAuthChallenge",d,function(y,S){if(y)return e.onFailure(y);var w=S.ChallengeParameters,U=new m(w.SRP_B,16),A=new m(w.SALT,16);a.getPasswordAuthenticationKey(s.deviceKey,s.randomPassword,U,A,function(E,T){if(E)return e.onFailure(E);var B=c.getNowString(),q=I.Buffer.concat([I.Buffer.from(s.deviceGroupKey,"utf8"),I.Buffer.from(s.deviceKey,"utf8"),I.Buffer.from(w.SECRET_BLOCK,"base64"),I.Buffer.from(B,"utf8")]),M=new ue.Sha256(T);M.update(q);var Y=M.digestSync(),W=I.Buffer.from(Y).toString("base64"),L={};L.USERNAME=s.username,L.PASSWORD_CLAIM_SECRET_BLOCK=w.SECRET_BLOCK,L.TIMESTAMP=B,L.PASSWORD_CLAIM_SIGNATURE=W,L.DEVICE_KEY=s.deviceKey;var x={ChallengeName:"DEVICE_PASSWORD_VERIFIER",ClientId:s.pool.getClientId(),ChallengeResponses:L,Session:S.Session};s.getUserContextData()&&(x.UserContextData=s.getUserContextData()),s.client.request("RespondToAuthChallenge",x,function(j,Z){return j?e.onFailure(j):(s.signInUserSession=s.getCognitoUserSession(Z.AuthenticationResult),s.cacheTokens(),e.onSuccess(s.signInUserSession))})})})})},r.confirmRegistration=function(e,n,s,a){var c={ClientId:this.pool.getClientId(),ConfirmationCode:e,Username:this.username,ForceAliasCreation:n,ClientMetadata:a};this.getUserContextData()&&(c.UserContextData=this.getUserContextData()),this.client.request("ConfirmSignUp",c,function(f){return f?s(f,null):s(null,"SUCCESS")})},r.sendCustomChallengeAnswer=function(e,n,s){var a=this,c={};c.USERNAME=this.username,c.ANSWER=e;var f=new $(this.pool.getUserPoolName());this.getCachedDeviceKeyAndPassword(),this.deviceKey!=null&&(c.DEVICE_KEY=this.deviceKey);var g={ChallengeName:"CUSTOM_CHALLENGE",ChallengeResponses:c,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:s};this.getUserContextData()&&(g.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",g,function(l,d){return l?n.onFailure(l):a.authenticateUserInternal(d,f,n)})},r.sendMFACode=function(e,n,s,a){var c=this,f={};f.USERNAME=this.username,f.SMS_MFA_CODE=e;var g=s||"SMS_MFA";g==="SOFTWARE_TOKEN_MFA"&&(f.SOFTWARE_TOKEN_MFA_CODE=e),this.deviceKey!=null&&(f.DEVICE_KEY=this.deviceKey);var l={ChallengeName:g,ChallengeResponses:f,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:a};this.getUserContextData()&&(l.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",l,function(d,y){if(d)return n.onFailure(d);var S=y.ChallengeName;if(S==="DEVICE_SRP_AUTH"){c.getDeviceResponse(n);return}if(c.signInUserSession=c.getCognitoUserSession(y.AuthenticationResult),c.cacheTokens(),y.AuthenticationResult.NewDeviceMetadata==null)return n.onSuccess(c.signInUserSession);var w=new $(c.pool.getUserPoolName());w.generateHashDevice(y.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,y.AuthenticationResult.NewDeviceMetadata.DeviceKey,function(U){if(U)return n.onFailure(U);var A={Salt:I.Buffer.from(w.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:I.Buffer.from(w.getVerifierDevices(),"hex").toString("base64")};c.verifierDevices=A.PasswordVerifier,c.deviceGroupKey=y.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,c.randomPassword=w.getRandomPassword(),c.client.request("ConfirmDevice",{DeviceKey:y.AuthenticationResult.NewDeviceMetadata.DeviceKey,AccessToken:c.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:A,DeviceName:ct},function(E,T){return E?n.onFailure(E):(c.deviceKey=y.AuthenticationResult.NewDeviceMetadata.DeviceKey,c.cacheDeviceKeyAndPassword(),T.UserConfirmationNecessary===!0?n.onSuccess(c.signInUserSession,T.UserConfirmationNecessary):n.onSuccess(c.signInUserSession))})})})},r.changePassword=function(e,n,s,a){if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return s(new Error("User is not authenticated"),null);this.client.request("ChangePassword",{PreviousPassword:e,ProposedPassword:n,AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:a},function(c){return c?s(c,null):s(null,"SUCCESS")})},r.enableMFA=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);var n=[],s={DeliveryMedium:"SMS",AttributeName:"phone_number"};n.push(s),this.client.request("SetUserSettings",{MFAOptions:n,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(a){return a?e(a,null):e(null,"SUCCESS")})},r.setUserMfaPreference=function(e,n,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return s(new Error("User is not authenticated"),null);this.client.request("SetUserMFAPreference",{SMSMfaSettings:e,SoftwareTokenMfaSettings:n,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(a){return a?s(a,null):s(null,"SUCCESS")})},r.disableMFA=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);var n=[];this.client.request("SetUserSettings",{MFAOptions:n,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(s){return s?e(s,null):e(null,"SUCCESS")})},r.deleteUser=function(e,n){var s=this;if(this.signInUserSession==null||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("DeleteUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:n},function(a){return a?e(a,null):(s.clearCachedUser(),e(null,"SUCCESS"))})},r.updateAttributes=function(e,n,s){var a=this;if(this.signInUserSession==null||!this.signInUserSession.isValid())return n(new Error("User is not authenticated"),null);this.client.request("UpdateUserAttributes",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),UserAttributes:e,ClientMetadata:s},function(c,f){return c?n(c,null):a.getUserData(function(){return n(null,"SUCCESS",f)},{bypassCache:!0})})},r.getUserAttributes=function(e){if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return e(new Error("User is not authenticated"),null);this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(n,s){if(n)return e(n,null);for(var a=[],c=0;c<s.UserAttributes.length;c++){var f={Name:s.UserAttributes[c].Name,Value:s.UserAttributes[c].Value},g=new An(f);a.push(g)}return e(null,a)})},r.getMFAOptions=function(e){if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return e(new Error("User is not authenticated"),null);this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(n,s){return n?e(n,null):e(null,s.MFAOptions)})},r.createGetUserRequest=function(){return this.client.promisifyRequest("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()})},r.refreshSessionIfPossible=function(e){var n=this;return e===void 0&&(e={}),new Promise(function(s){var a=n.signInUserSession.getRefreshToken();a&&a.getToken()?n.refreshSession(a,s,e.clientMetadata):s()})},r.getUserData=function(e,n){var s=this;if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return this.clearCachedUserData(),e(new Error("User is not authenticated"),null);var a=this.getUserDataFromCache();if(!a){this.fetchUserData().then(function(c){e(null,c)}).catch(e);return}if(this.isFetchUserDataAndTokenRequired(n)){this.fetchUserData().then(function(c){return s.refreshSessionIfPossible(n).then(function(){return c})}).then(function(c){return e(null,c)}).catch(e);return}try{e(null,JSON.parse(a));return}catch(c){this.clearCachedUserData(),e(c,null);return}},r.getUserDataFromCache=function(){var e=this.storage.getItem(this.userDataKey);return e},r.isFetchUserDataAndTokenRequired=function(e){var n=e||{},s=n.bypassCache,a=s===void 0?!1:s;return a},r.fetchUserData=function(){var e=this;return this.createGetUserRequest().then(function(n){return e.cacheUserData(n),n})},r.deleteAttributes=function(e,n){var s=this;if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return n(new Error("User is not authenticated"),null);this.client.request("DeleteUserAttributes",{UserAttributeNames:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(a){return a?n(a,null):s.getUserData(function(){return n(null,"SUCCESS")},{bypassCache:!0})})},r.resendConfirmationCode=function(e,n){var s={ClientId:this.pool.getClientId(),Username:this.username,ClientMetadata:n};this.client.request("ResendConfirmationCode",s,function(a,c){return a?e(a,null):e(null,c)})},r.getSession=function(e,n){if(n===void 0&&(n={}),this.username==null)return e(new Error("Username is null. Cannot retrieve a new session"),null);if(this.signInUserSession!=null&&this.signInUserSession.isValid())return e(null,this.signInUserSession);var s="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,a=s+".idToken",c=s+".accessToken",f=s+".refreshToken",g=s+".clockDrift";if(this.storage.getItem(a)){var l=new ot({IdToken:this.storage.getItem(a)}),d=new st({AccessToken:this.storage.getItem(c)}),y=new at({RefreshToken:this.storage.getItem(f)}),S=parseInt(this.storage.getItem(g),0)||0,w={IdToken:l,AccessToken:d,RefreshToken:y,ClockDrift:S},U=new ut(w);if(U.isValid())return this.signInUserSession=U,e(null,this.signInUserSession);if(!y.getToken())return e(new Error("Cannot retrieve a new session. Please authenticate."),null);this.refreshSession(y,e,n.clientMetadata)}else e(new Error("Local storage is missing an ID Token, Please authenticate"),null)},r.refreshSession=function(e,n,s){var a=this,c=this.pool.wrapRefreshSessionCallback?this.pool.wrapRefreshSessionCallback(n):n,f={};f.REFRESH_TOKEN=e.getToken();var g="CognitoIdentityServiceProvider."+this.pool.getClientId(),l=g+".LastAuthUser";if(this.storage.getItem(l)){this.username=this.storage.getItem(l);var d=g+"."+this.username+".deviceKey";this.deviceKey=this.storage.getItem(d),f.DEVICE_KEY=this.deviceKey}var y={ClientId:this.pool.getClientId(),AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:f,ClientMetadata:s};this.getUserContextData()&&(y.UserContextData=this.getUserContextData()),this.client.requestWithRetry("InitiateAuth",y,function(S,w){if(S)return S.code==="NotAuthorizedException"&&a.clearCachedUser(),c(S,null);if(w){var U=w.AuthenticationResult;return Object.prototype.hasOwnProperty.call(U,"RefreshToken")||(U.RefreshToken=e.getToken()),a.signInUserSession=a.getCognitoUserSession(U),a.cacheTokens(),c(null,a.signInUserSession)}})},r.cacheTokens=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId(),n=e+"."+this.username+".idToken",s=e+"."+this.username+".accessToken",a=e+"."+this.username+".refreshToken",c=e+"."+this.username+".clockDrift",f=e+".LastAuthUser";this.storage.setItem(n,this.signInUserSession.getIdToken().getJwtToken()),this.storage.setItem(s,this.signInUserSession.getAccessToken().getJwtToken()),this.storage.setItem(a,this.signInUserSession.getRefreshToken().getToken()),this.storage.setItem(c,""+this.signInUserSession.getClockDrift()),this.storage.setItem(f,this.username)},r.cacheUserData=function(e){this.storage.setItem(this.userDataKey,JSON.stringify(e))},r.clearCachedUserData=function(){this.storage.removeItem(this.userDataKey)},r.clearCachedUser=function(){this.clearCachedTokens(),this.clearCachedUserData()},r.cacheDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,n=e+".deviceKey",s=e+".randomPasswordKey",a=e+".deviceGroupKey";this.storage.setItem(n,this.deviceKey),this.storage.setItem(s,this.randomPassword),this.storage.setItem(a,this.deviceGroupKey)},r.getCachedDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,n=e+".deviceKey",s=e+".randomPasswordKey",a=e+".deviceGroupKey";this.storage.getItem(n)&&(this.deviceKey=this.storage.getItem(n),this.randomPassword=this.storage.getItem(s),this.deviceGroupKey=this.storage.getItem(a))},r.clearCachedDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,n=e+".deviceKey",s=e+".randomPasswordKey",a=e+".deviceGroupKey";this.storage.removeItem(n),this.storage.removeItem(s),this.storage.removeItem(a)},r.clearCachedTokens=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId(),n=e+"."+this.username+".idToken",s=e+"."+this.username+".accessToken",a=e+"."+this.username+".refreshToken",c=e+".LastAuthUser",f=e+"."+this.username+".clockDrift";this.storage.removeItem(n),this.storage.removeItem(s),this.storage.removeItem(a),this.storage.removeItem(c),this.storage.removeItem(f)},r.getCognitoUserSession=function(e){var n=new ot(e),s=new st(e),a=new at(e),c={IdToken:n,AccessToken:s,RefreshToken:a};return new ut(c)},r.forgotPassword=function(e,n){var s={ClientId:this.pool.getClientId(),Username:this.username,ClientMetadata:n};this.getUserContextData()&&(s.UserContextData=this.getUserContextData()),this.client.request("ForgotPassword",s,function(a,c){return a?e.onFailure(a):typeof e.inputVerificationCode=="function"?e.inputVerificationCode(c):e.onSuccess(c)})},r.confirmPassword=function(e,n,s,a){var c={ClientId:this.pool.getClientId(),Username:this.username,ConfirmationCode:e,Password:n,ClientMetadata:a};this.getUserContextData()&&(c.UserContextData=this.getUserContextData()),this.client.request("ConfirmForgotPassword",c,function(f){return f?s.onFailure(f):s.onSuccess("SUCCESS")})},r.getAttributeVerificationCode=function(e,n,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return n.onFailure(new Error("User is not authenticated"));this.client.request("GetUserAttributeVerificationCode",{AttributeName:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:s},function(a,c){return a?n.onFailure(a):typeof n.inputVerificationCode=="function"?n.inputVerificationCode(c):n.onSuccess("SUCCESS")})},r.verifyAttribute=function(e,n,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return s.onFailure(new Error("User is not authenticated"));this.client.request("VerifyUserAttribute",{AttributeName:e,Code:n,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(a){return a?s.onFailure(a):s.onSuccess("SUCCESS")})},r.getDevice=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("GetDevice",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey},function(n,s){return n?e.onFailure(n):e.onSuccess(s)})},r.forgetSpecificDevice=function(e,n){if(this.signInUserSession==null||!this.signInUserSession.isValid())return n.onFailure(new Error("User is not authenticated"));this.client.request("ForgetDevice",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:e},function(s){return s?n.onFailure(s):n.onSuccess("SUCCESS")})},r.forgetDevice=function(e){var n=this;this.forgetSpecificDevice(this.deviceKey,{onFailure:e.onFailure,onSuccess:function(s){return n.deviceKey=null,n.deviceGroupKey=null,n.randomPassword=null,n.clearCachedDeviceKeyAndPassword(),e.onSuccess(s)}})},r.setDeviceStatusRemembered=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("UpdateDeviceStatus",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey,DeviceRememberedStatus:"remembered"},function(n){return n?e.onFailure(n):e.onSuccess("SUCCESS")})},r.setDeviceStatusNotRemembered=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("UpdateDeviceStatus",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey,DeviceRememberedStatus:"not_remembered"},function(n){return n?e.onFailure(n):e.onSuccess("SUCCESS")})},r.listDevices=function(e,n,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return s.onFailure(new Error("User is not authenticated"));var a={AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),Limit:e};n&&(a.PaginationToken=n),this.client.request("ListDevices",a,function(c,f){return c?s.onFailure(c):s.onSuccess(f)})},r.globalSignOut=function(e){var n=this;if(this.signInUserSession==null||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("GlobalSignOut",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(s){return s?e.onFailure(s):(n.clearCachedUser(),e.onSuccess("SUCCESS"))})},r.signOut=function(e){var n=this;if(!e||typeof e!="function"){this.cleanClientData();return}this.getSession(function(s,a){if(s)return e(s);n.revokeTokens(function(c){n.cleanClientData(),e(c)})})},r.revokeTokens=function(e){if(e===void 0&&(e=function(){}),typeof e!="function")throw new Error("Invalid revokeTokenCallback. It should be a function.");if(!this.signInUserSession){var n=new Error("User is not authenticated");return e(n)}if(!this.signInUserSession.getAccessToken()){var s=new Error("No Access token available");return e(s)}var a=this.signInUserSession.getRefreshToken().getToken(),c=this.signInUserSession.getAccessToken();if(this.isSessionRevocable(c)&&a)return this.revokeToken({token:a,callback:e});e()},r.isSessionRevocable=function(e){if(e&&typeof e.decodePayload=="function")try{var n=e.decodePayload(),s=n.origin_jti;return!!s}catch{}return!1},r.cleanClientData=function(){this.signInUserSession=null,this.clearCachedUser()},r.revokeToken=function(e){var n=e.token,s=e.callback;this.client.requestWithRetry("RevokeToken",{Token:n,ClientId:this.pool.getClientId()},function(a){if(a)return s(a);s()})},r.sendMFASelectionAnswer=function(e,n){var s=this,a={};a.USERNAME=this.username,a.ANSWER=e;var c={ChallengeName:"SELECT_MFA_TYPE",ChallengeResponses:a,ClientId:this.pool.getClientId(),Session:this.Session};this.getUserContextData()&&(c.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",c,function(f,g){if(f)return n.onFailure(f);if(s.Session=g.Session,e==="SMS_MFA")return n.mfaRequired(g.ChallengeName,g.ChallengeParameters);if(e==="SOFTWARE_TOKEN_MFA")return n.totpRequired(g.ChallengeName,g.ChallengeParameters)})},r.getUserContextData=function(){var e=this.pool;return e.getUserContextData(this.username)},r.associateSoftwareToken=function(e){var n=this;this.signInUserSession!=null&&this.signInUserSession.isValid()?this.client.request("AssociateSoftwareToken",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(s,a){return s?e.onFailure(s):e.associateSecretCode(a.SecretCode)}):this.client.request("AssociateSoftwareToken",{Session:this.Session},function(s,a){return s?e.onFailure(s):(n.Session=a.Session,e.associateSecretCode(a.SecretCode))})},r.verifySoftwareToken=function(e,n,s){var a=this;this.signInUserSession!=null&&this.signInUserSession.isValid()?this.client.request("VerifySoftwareToken",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),UserCode:e,FriendlyDeviceName:n},function(c,f){return c?s.onFailure(c):s.onSuccess(f)}):this.client.request("VerifySoftwareToken",{Session:this.Session,UserCode:e,FriendlyDeviceName:n},function(c,f){if(c)return s.onFailure(c);a.Session=f.Session;var g={};g.USERNAME=a.username;var l={ChallengeName:"MFA_SETUP",ClientId:a.pool.getClientId(),ChallengeResponses:g,Session:a.Session};a.getUserContextData()&&(l.UserContextData=a.getUserContextData()),a.client.request("RespondToAuthChallenge",l,function(d,y){return d?s.onFailure(d):(a.signInUserSession=a.getCognitoUserSession(y.AuthenticationResult),a.cacheTokens(),s.onSuccess(a.signInUserSession))})})},o})();function En(o,r){return r=r||{},new Promise(function(e,n){var s=new XMLHttpRequest,a=[],c=[],f={},g=function(){return{ok:(s.status/100|0)==2,statusText:s.statusText,status:s.status,url:s.responseURL,text:function(){return Promise.resolve(s.responseText)},json:function(){return Promise.resolve(s.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([s.response]))},clone:g,headers:{keys:function(){return a},entries:function(){return c},get:function(d){return f[d.toLowerCase()]},has:function(d){return d.toLowerCase()in f}}}};for(var l in s.open(r.method||"get",o,!0),s.onload=function(){s.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(d,y,S){a.push(y=y.toLowerCase()),c.push([y,S]),f[y]=f[y]?f[y]+","+S:S}),e(g())},s.onerror=n,s.withCredentials=r.credentials=="include",r.headers)s.setRequestHeader(l,r.headers[l]);s.send(r.body||null)})}const Tn=Object.freeze(Object.defineProperty({__proto__:null,default:En},Symbol.toStringTag,{value:"Module"})),lt=Pe(Tn);var gt,pt;function Dn(){return pt||(pt=1,gt=self.fetch||(self.fetch=lt.default||lt)),gt}Dn();function Q(){}Q.prototype.userAgent=Sn();var In=function(o){var r=Q.category?" "+Q.category:"",e=Q.framework?" framework/"+Q.framework:"",n=""+Q.prototype.userAgent+r+e;return n};function bn(o,r){o.prototype=Object.create(r.prototype),o.prototype.constructor=o,ce(o,r)}function be(o){var r=typeof Map=="function"?new Map:void 0;return be=function(e){if(e===null||!Pn(e))return e;if(typeof e!="function")throw new TypeError("Super expression must either be null or a function");if(r!==void 0){if(r.has(e))return r.get(e);r.set(e,n)}function n(){return _n(e,arguments,_e(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),ce(n,e)},be(o)}function _n(o,r,e){if(Ut())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,r);var s=new(o.bind.apply(o,n));return e&&ce(s,e.prototype),s}function Ut(){try{var o=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ut=function(){return!!o})()}function Pn(o){try{return Function.toString.call(o).indexOf("[native code]")!==-1}catch{return typeof o=="function"}}function ce(o,r){return ce=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,n){return e.__proto__=n,e},ce(o,r)}function _e(o){return _e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},_e(o)}var Rn=(function(o){function r(e,n,s,a){var c;return c=o.call(this,e)||this,c.code=n,c.name=s,c.statusCode=a,c}return bn(r,o),r})(be(Error)),kn=(function(){function o(e,n,s){this.endpoint=n||"https://cognito-idp."+e+".amazonaws.com/";var a=s||{},c=a.credentials;this.fetchOptions=c?{credentials:c}:{}}var r=o.prototype;return r.promisifyRequest=function(e,n){var s=this;return new Promise(function(a,c){s.request(e,n,function(f,g){f?c(new Rn(f.message,f.code,f.name,f.statusCode)):a(g)})})},r.requestWithRetry=function(e,n,s){var a=this,c=5*1e3;Fn(function(f){return new Promise(function(g,l){a.request(e,f,function(d,y){d?l(d):g(y)})})},[n],c).then(function(f){return s(null,f)}).catch(function(f){return s(f)})},r.request=function(e,n,s){var a={"Content-Type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityProviderService."+e,"X-Amz-User-Agent":In(),"Cache-Control":"no-store"},c=Object.assign({},this.fetchOptions,{headers:a,method:"POST",mode:"cors",body:JSON.stringify(n)}),f;fetch(this.endpoint,c).then(function(g){return f=g,g},function(g){throw g instanceof TypeError?new Error("Network error"):g}).then(function(g){return g.json().catch(function(){return{}})}).then(function(g){if(f.ok)return s(null,g);var l=(g.__type||g.code).split("#").pop(),d=new Error(g.message||g.Message||null);return d.name=l,d.code=l,s(d)}).catch(function(g){if(f&&f.headers&&f.headers.get("x-amzn-errortype"))try{var l=f.headers.get("x-amzn-errortype").split(":")[0],d=new Error(f.status?f.status.toString():null);return d.code=l,d.name=l,d.statusCode=f.status,s(d)}catch{return s(g)}else g instanceof Error&&g.message==="Network error"&&(g.code="NetworkError");return s(g)})},o})(),ye={debug:function(){}},On=function(o){var r="nonRetryable";return o&&o[r]};function Et(o,r,e,n){if(n===void 0&&(n=1),typeof o!="function")throw Error("functionToRetry must be a function");return ye.debug(o.name+" attempt #"+n+" with args: "+JSON.stringify(r)),o.apply(void 0,r).catch(function(s){if(ye.debug("error on "+o.name,s),On(s))throw ye.debug(o.name+" non retryable error",s),s;var a=e(n,r,s);if(ye.debug(o.name+" retrying in "+a+" ms"),a!==!1)return new Promise(function(c){return setTimeout(c,a)}).then(function(){return Et(o,r,e,n+1)});throw s})}function Bn(o){var r=100,e=100;return function(n){var s=Math.pow(2,n)*r+e*Math.random();return s>o?!1:s}}function Fn(o,r,e){return Et(o,r,Bn(e))}/*!
50
50
  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
51
51
  * SPDX-License-Identifier: Apache-2.0
52
- */var Mn=55,Hn=(function(){function o(e,n){var s=e||{},a=s.UserPoolId,c=s.ClientId,f=s.endpoint,g=s.fetchOptions,l=s.AdvancedSecurityDataCollectionFlag;if(!a||!c)throw new Error("Both UserPoolId and ClientId are required.");if(a.length>Mn||!/^[\w-]+_[0-9a-zA-Z]+$/.test(a))throw new Error("Invalid UserPoolId format.");var d=a.split("_")[0];this.userPoolId=a,this.clientId=c,this.client=new kn(d,f,g),this.advancedSecurityDataCollectionFlag=l!==!1,this.storage=e.Storage||new Ct().getStorage(),n&&(this.wrapRefreshSessionCallback=n)}var r=o.prototype;return r.getUserPoolId=function(){return this.userPoolId},r.getUserPoolName=function(){return this.getUserPoolId().split("_")[1]},r.getClientId=function(){return this.clientId},r.signUp=function(e,n,s,a,c,f){var g=this,l={ClientId:this.clientId,Username:e,Password:n,UserAttributes:s,ValidationData:a,ClientMetadata:f};this.getUserContextData(e)&&(l.UserContextData=this.getUserContextData(e)),this.client.request("SignUp",l,function(d,y){if(d)return c(d,null);var S={Username:e,Pool:g,Storage:g.storage},w={user:new ht(S),userConfirmed:y.UserConfirmed,userSub:y.UserSub,codeDeliveryDetails:y.CodeDeliveryDetails};return c(null,w)})},r.getCurrentUser=function(){var e="CognitoIdentityServiceProvider."+this.clientId+".LastAuthUser",n=this.storage.getItem(e);if(n){var s={Username:n,Pool:this,Storage:this.storage};return new ht(s)}return null},r.getUserContextData=function(e){if(!(typeof AmazonCognitoAdvancedSecurityData>"u")){var n=AmazonCognitoAdvancedSecurityData;if(this.advancedSecurityDataCollectionFlag){var s=n.getData(e,this.userPoolId,this.clientId);if(s){var a={EncodedData:s};return a}}return{}}},o})(),dt={exports:{}};/*!
52
+ */var Mn=55,jn=(function(){function o(e,n){var s=e||{},a=s.UserPoolId,c=s.ClientId,f=s.endpoint,g=s.fetchOptions,l=s.AdvancedSecurityDataCollectionFlag;if(!a||!c)throw new Error("Both UserPoolId and ClientId are required.");if(a.length>Mn||!/^[\w-]+_[0-9a-zA-Z]+$/.test(a))throw new Error("Invalid UserPoolId format.");var d=a.split("_")[0];this.userPoolId=a,this.clientId=c,this.client=new kn(d,f,g),this.advancedSecurityDataCollectionFlag=l!==!1,this.storage=e.Storage||new Ct().getStorage(),n&&(this.wrapRefreshSessionCallback=n)}var r=o.prototype;return r.getUserPoolId=function(){return this.userPoolId},r.getUserPoolName=function(){return this.getUserPoolId().split("_")[1]},r.getClientId=function(){return this.clientId},r.signUp=function(e,n,s,a,c,f){var g=this,l={ClientId:this.clientId,Username:e,Password:n,UserAttributes:s,ValidationData:a,ClientMetadata:f};this.getUserContextData(e)&&(l.UserContextData=this.getUserContextData(e)),this.client.request("SignUp",l,function(d,y){if(d)return c(d,null);var S={Username:e,Pool:g,Storage:g.storage},w={user:new ht(S),userConfirmed:y.UserConfirmed,userSub:y.UserSub,codeDeliveryDetails:y.CodeDeliveryDetails};return c(null,w)})},r.getCurrentUser=function(){var e="CognitoIdentityServiceProvider."+this.clientId+".LastAuthUser",n=this.storage.getItem(e);if(n){var s={Username:n,Pool:this,Storage:this.storage};return new ht(s)}return null},r.getUserContextData=function(e){if(!(typeof AmazonCognitoAdvancedSecurityData>"u")){var n=AmazonCognitoAdvancedSecurityData;if(this.advancedSecurityDataCollectionFlag){var s=n.getData(e,this.userPoolId,this.clientId);if(s){var a={EncodedData:s};return a}}return{}}},o})(),dt={exports:{}};/*!
53
53
  * JavaScript Cookie v2.2.1
54
54
  * https://github.com/js-cookie/js-cookie
55
55
  *
56
56
  * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
57
57
  * Released under the MIT license
58
- */var vt;function xn(){return vt||(vt=1,(function(o,r){(function(e){var n;if(o.exports=e(),n=!0,!n){var s=window.Cookies,a=window.Cookies=e();a.noConflict=function(){return window.Cookies=s,a}}})(function(){function e(){for(var a=0,c={};a<arguments.length;a++){var f=arguments[a];for(var g in f)c[g]=f[g]}return c}function n(a){return a.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function s(a){function c(){}function f(l,d,y){if(!(typeof document>"u")){y=e({path:"/"},c.defaults,y),typeof y.expires=="number"&&(y.expires=new Date(new Date*1+y.expires*864e5)),y.expires=y.expires?y.expires.toUTCString():"";try{var S=JSON.stringify(d);/^[\{\[]/.test(S)&&(d=S)}catch{}d=a.write?a.write(d,l):encodeURIComponent(String(d)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),l=encodeURIComponent(String(l)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var w="";for(var U in y)y[U]&&(w+="; "+U,y[U]!==!0&&(w+="="+y[U].split(";")[0]));return document.cookie=l+"="+d+w}}function g(l,d){if(!(typeof document>"u")){for(var y={},S=document.cookie?document.cookie.split("; "):[],w=0;w<S.length;w++){var U=S[w].split("="),A=U.slice(1).join("=");!d&&A.charAt(0)==='"'&&(A=A.slice(1,-1));try{var E=n(U[0]);if(A=(a.read||a)(A,E)||n(A),d)try{A=JSON.parse(A)}catch{}if(y[E]=A,l===E)break}catch{}}return l?y[l]:y}}return c.set=f,c.get=function(l){return g(l,!1)},c.getJSON=function(l){return g(l,!0)},c.remove=function(l,d){f(l,"",e(d,{expires:-1}))},c.defaults={},c.withConverter=s,c}return s(function(){})})})(dt)),dt.exports}xn();export{jn as AuthenticationDetails,$ as AuthenticationHelper,st as CognitoAccessToken,ot as CognitoIdToken,at as CognitoRefreshToken,ht as CognitoUser,An as CognitoUserAttribute,Hn as CognitoUserPool,ut as CognitoUserSession,ft as DateHelper,Ht as WordArray};
58
+ */var vt;function xn(){return vt||(vt=1,(function(o,r){(function(e){var n;if(o.exports=e(),n=!0,!n){var s=window.Cookies,a=window.Cookies=e();a.noConflict=function(){return window.Cookies=s,a}}})(function(){function e(){for(var a=0,c={};a<arguments.length;a++){var f=arguments[a];for(var g in f)c[g]=f[g]}return c}function n(a){return a.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function s(a){function c(){}function f(l,d,y){if(!(typeof document>"u")){y=e({path:"/"},c.defaults,y),typeof y.expires=="number"&&(y.expires=new Date(new Date*1+y.expires*864e5)),y.expires=y.expires?y.expires.toUTCString():"";try{var S=JSON.stringify(d);/^[\{\[]/.test(S)&&(d=S)}catch{}d=a.write?a.write(d,l):encodeURIComponent(String(d)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),l=encodeURIComponent(String(l)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var w="";for(var U in y)y[U]&&(w+="; "+U,y[U]!==!0&&(w+="="+y[U].split(";")[0]));return document.cookie=l+"="+d+w}}function g(l,d){if(!(typeof document>"u")){for(var y={},S=document.cookie?document.cookie.split("; "):[],w=0;w<S.length;w++){var U=S[w].split("="),A=U.slice(1).join("=");!d&&A.charAt(0)==='"'&&(A=A.slice(1,-1));try{var E=n(U[0]);if(A=(a.read||a)(A,E)||n(A),d)try{A=JSON.parse(A)}catch{}if(y[E]=A,l===E)break}catch{}}return l?y[l]:y}}return c.set=f,c.get=function(l){return g(l,!1)},c.getJSON=function(l){return g(l,!0)},c.remove=function(l,d){f(l,"",e(d,{expires:-1}))},c.defaults={},c.withConverter=s,c}return s(function(){})})})(dt)),dt.exports}xn();export{qn as AuthenticationDetails,$ as AuthenticationHelper,st as CognitoAccessToken,ot as CognitoIdToken,at as CognitoRefreshToken,ht as CognitoUser,An as CognitoUserAttribute,jn as CognitoUserPool,ut as CognitoUserSession,ft as DateHelper,Ht as WordArray};
@@ -0,0 +1,6 @@
1
+ import{b as Yt,m as Gt}from"./index-BqmQ6R7D-Cvh6Y-cG.js";function Vt(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var mt={exports:{}},m=mt.exports={},O,L;function W(){throw new Error("setTimeout has not been defined")}function H(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?O=setTimeout:O=W}catch{O=W}try{typeof clearTimeout=="function"?L=clearTimeout:L=H}catch{L=H}})();function bt(u){if(O===setTimeout)return setTimeout(u,0);if((O===W||!O)&&setTimeout)return O=setTimeout,setTimeout(u,0);try{return O(u,0)}catch{try{return O.call(null,u,0)}catch{return O.call(this,u,0)}}}function qt(u){if(L===clearTimeout)return clearTimeout(u);if((L===H||!L)&&clearTimeout)return L=clearTimeout,clearTimeout(u);try{return L(u)}catch{try{return L.call(null,u)}catch{return L.call(this,u)}}}var S=[],j=!1,M,D=-1;function Jt(){!j||!M||(j=!1,M.length?S=M.concat(S):D=-1,S.length&&Et())}function Et(){if(!j){var u=bt(Jt);j=!0;for(var h=S.length;h;){for(M=S,S=[];++D<h;)M&&M[D].run();D=-1,h=S.length}M=null,j=!1,qt(u)}}m.nextTick=function(u){var h=new Array(arguments.length-1);if(arguments.length>1)for(var p=1;p<arguments.length;p++)h[p-1]=arguments[p];S.push(new Bt(u,h)),S.length===1&&!j&&bt(Et)};function Bt(u,h){this.fun=u,this.array=h}Bt.prototype.run=function(){this.fun.apply(null,this.array)};m.title="browser";m.browser=!0;m.env={};m.argv=[];m.version="";m.versions={};function _(){}m.on=_;m.addListener=_;m.once=_;m.off=_;m.removeListener=_;m.removeAllListeners=_;m.emit=_;m.prependListener=_;m.prependOnceListener=_;m.listeners=function(u){return[]};m.binding=function(u){throw new Error("process.binding is not supported")};m.cwd=function(){return"/"};m.chdir=function(u){throw new Error("process.chdir is not supported")};m.umask=function(){return 0};var Xt=mt.exports;const Wt=Vt(Xt);var X={exports:{}},pt;function Ht(){return pt||(pt=1,typeof Object.create=="function"?X.exports=function(u,h){h&&(u.super_=h,u.prototype=Object.create(h.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}))}:X.exports=function(u,h){if(h){u.super_=h;var p=function(){};p.prototype=h.prototype,u.prototype=new p,u.prototype.constructor=u}}),X.exports}var Z={exports:{}},yt={};/*!
2
+ * The buffer module from node.js, for the browser.
3
+ *
4
+ * @author Feross Aboukhadijeh <https://feross.org>
5
+ * @license MIT
6
+ */var gt;function Zt(){return gt||(gt=1,(function(u){const h=Yt(),p=Gt(),d=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;u.Buffer=i,u.SlowBuffer=At,u.INSPECT_MAX_BYTES=50;const x=2147483647;u.kMaxLength=x,i.TYPED_ARRAY_SUPPORT=T(),!i.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function T(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}});function c(t){if(t>x)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,i.prototype),e}function i(t,e,n){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return l(t)}return A(t,e,n)}i.poolSize=8192;function A(t,e,n){if(typeof t=="string")return v(t,e);if(ArrayBuffer.isView(t))return Y(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(R(t,ArrayBuffer)||t&&R(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(R(t,SharedArrayBuffer)||t&&R(t.buffer,SharedArrayBuffer)))return K(t,e,n);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const r=t.valueOf&&t.valueOf();if(r!=null&&r!==t)return i.from(r,e,n);const o=vt(t);if(o)return o;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return i.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}i.from=function(t,e,n){return A(t,e,n)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array);function U(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function a(t,e,n){return U(t),t<=0?c(t):e!==void 0?typeof n=="string"?c(t).fill(e,n):c(t).fill(e):c(t)}i.alloc=function(t,e,n){return a(t,e,n)};function l(t){return U(t),c(t<0?0:G(t)|0)}i.allocUnsafe=function(t){return l(t)},i.allocUnsafeSlow=function(t){return l(t)};function v(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!i.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const n=tt(t,e)|0;let r=c(n);const o=r.write(t,e);return o!==n&&(r=r.slice(0,o)),r}function P(t){const e=t.length<0?0:G(t.length)|0,n=c(e);for(let r=0;r<e;r+=1)n[r]=t[r]&255;return n}function Y(t){if(R(t,Uint8Array)){const e=new Uint8Array(t);return K(e.buffer,e.byteOffset,e.byteLength)}return P(t)}function K(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return e===void 0&&n===void 0?r=new Uint8Array(t):n===void 0?r=new Uint8Array(t,e):r=new Uint8Array(t,e,n),Object.setPrototypeOf(r,i.prototype),r}function vt(t){if(i.isBuffer(t)){const e=G(t.length)|0,n=c(e);return n.length===0||t.copy(n,0,0,e),n}if(t.length!==void 0)return typeof t.length!="number"||J(t.length)?c(0):P(t);if(t.type==="Buffer"&&Array.isArray(t.data))return P(t.data)}function G(t){if(t>=x)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+x.toString(16)+" bytes");return t|0}function At(t){return+t!=t&&(t=0),i.alloc(+t)}i.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==i.prototype},i.compare=function(t,e){if(R(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),R(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let n=t.length,r=e.length;for(let o=0,s=Math.min(n,r);o<s;++o)if(t[o]!==e[o]){n=t[o],r=e[o];break}return n<r?-1:r<n?1:0},i.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return i.alloc(0);let n;if(e===void 0)for(e=0,n=0;n<t.length;++n)e+=t[n].length;const r=i.allocUnsafe(e);let o=0;for(n=0;n<t.length;++n){let s=t[n];if(R(s,Uint8Array))o+s.length>r.length?(i.isBuffer(s)||(s=i.from(s)),s.copy(r,o)):Uint8Array.prototype.set.call(r,s,o);else if(i.isBuffer(s))s.copy(r,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=s.length}return r};function tt(t,e){if(i.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||R(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const n=t.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;let o=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return lt(t).length;default:if(o)return r?-1:q(t).length;e=(""+e).toLowerCase(),o=!0}}i.byteLength=tt;function It(t,e,n){let r=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,e>>>=0,n<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Pt(this,e,n);case"utf8":case"utf-8":return rt(this,e,n);case"ascii":return _t(this,e,n);case"latin1":case"binary":return $t(this,e,n);case"base64":return xt(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return kt(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}i.prototype._isBuffer=!0;function k(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}i.prototype.swap16=function(){const t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)k(this,e,e+1);return this},i.prototype.swap32=function(){const t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)k(this,e,e+3),k(this,e+1,e+2);return this},i.prototype.swap64=function(){const t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)k(this,e,e+7),k(this,e+1,e+6),k(this,e+2,e+5),k(this,e+3,e+4);return this},i.prototype.toString=function(){const t=this.length;return t===0?"":arguments.length===0?rt(this,0,t):It.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(t){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:i.compare(this,t)===0},i.prototype.inspect=function(){let t="";const e=u.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},d&&(i.prototype[d]=i.prototype.inspect),i.prototype.compare=function(t,e,n,r,o){if(R(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(e===void 0&&(e=0),n===void 0&&(n=t?t.length:0),r===void 0&&(r=0),o===void 0&&(o=this.length),e<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&e>=n)return 0;if(r>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,o>>>=0,this===t)return 0;let s=o-r,f=n-e;const g=Math.min(s,f),B=this.slice(r,o),w=t.slice(e,n);for(let y=0;y<g;++y)if(B[y]!==w[y]){s=B[y],f=w[y];break}return s<f?-1:f<s?1:0};function et(t,e,n,r,o){if(t.length===0)return-1;if(typeof n=="string"?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,J(n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0)if(o)n=0;else return-1;if(typeof e=="string"&&(e=i.from(e,r)),i.isBuffer(e))return e.length===0?-1:nt(t,e,n,r,o);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):nt(t,[e],n,r,o);throw new TypeError("val must be string, number or Buffer")}function nt(t,e,n,r,o){let s=1,f=t.length,g=e.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(t.length<2||e.length<2)return-1;s=2,f/=2,g/=2,n/=2}function B(y,b){return s===1?y[b]:y.readUInt16BE(b*s)}let w;if(o){let y=-1;for(w=n;w<f;w++)if(B(t,w)===B(e,y===-1?0:w-y)){if(y===-1&&(y=w),w-y+1===g)return y*s}else y!==-1&&(w-=w-y),y=-1}else for(n+g>f&&(n=f-g),w=n;w>=0;w--){let y=!0;for(let b=0;b<g;b++)if(B(t,w+b)!==B(e,b)){y=!1;break}if(y)return w}return-1}i.prototype.includes=function(t,e,n){return this.indexOf(t,e,n)!==-1},i.prototype.indexOf=function(t,e,n){return et(this,t,e,n,!0)},i.prototype.lastIndexOf=function(t,e,n){return et(this,t,e,n,!1)};function Ut(t,e,n,r){n=Number(n)||0;const o=t.length-n;r?(r=Number(r),r>o&&(r=o)):r=o;const s=e.length;r>s/2&&(r=s/2);let f;for(f=0;f<r;++f){const g=parseInt(e.substr(f*2,2),16);if(J(g))return f;t[n+f]=g}return f}function Tt(t,e,n,r){return z(q(e,t.length-n),t,n,r)}function Rt(t,e,n,r){return z(jt(e),t,n,r)}function Ot(t,e,n,r){return z(lt(e),t,n,r)}function Lt(t,e,n,r){return z(Ft(e,t.length-n),t,n,r)}i.prototype.write=function(t,e,n,r){if(e===void 0)r="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")r=e,n=this.length,e=0;else if(isFinite(e))e=e>>>0,isFinite(n)?(n=n>>>0,r===void 0&&(r="utf8")):(r=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const o=this.length-e;if((n===void 0||n>o)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let s=!1;for(;;)switch(r){case"hex":return Ut(this,t,e,n);case"utf8":case"utf-8":return Tt(this,t,e,n);case"ascii":case"latin1":case"binary":return Rt(this,t,e,n);case"base64":return Ot(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Lt(this,t,e,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function xt(t,e,n){return e===0&&n===t.length?h.fromByteArray(t):h.fromByteArray(t.slice(e,n))}function rt(t,e,n){n=Math.min(t.length,n);const r=[];let o=e;for(;o<n;){const s=t[o];let f=null,g=s>239?4:s>223?3:s>191?2:1;if(o+g<=n){let B,w,y,b;switch(g){case 1:s<128&&(f=s);break;case 2:B=t[o+1],(B&192)===128&&(b=(s&31)<<6|B&63,b>127&&(f=b));break;case 3:B=t[o+1],w=t[o+2],(B&192)===128&&(w&192)===128&&(b=(s&15)<<12|(B&63)<<6|w&63,b>2047&&(b<55296||b>57343)&&(f=b));break;case 4:B=t[o+1],w=t[o+2],y=t[o+3],(B&192)===128&&(w&192)===128&&(y&192)===128&&(b=(s&15)<<18|(B&63)<<12|(w&63)<<6|y&63,b>65535&&b<1114112&&(f=b))}}f===null?(f=65533,g=1):f>65535&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|f&1023),r.push(f),o+=g}return St(r)}const ot=4096;function St(t){const e=t.length;if(e<=ot)return String.fromCharCode.apply(String,t);let n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=ot));return n}function _t(t,e,n){let r="";n=Math.min(t.length,n);for(let o=e;o<n;++o)r+=String.fromCharCode(t[o]&127);return r}function $t(t,e,n){let r="";n=Math.min(t.length,n);for(let o=e;o<n;++o)r+=String.fromCharCode(t[o]);return r}function Pt(t,e,n){const r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);let o="";for(let s=e;s<n;++s)o+=zt[t[s]];return o}function kt(t,e,n){const r=t.slice(e,n);let o="";for(let s=0;s<r.length-1;s+=2)o+=String.fromCharCode(r[s]+r[s+1]*256);return o}i.prototype.slice=function(t,e){const n=this.length;t=~~t,e=e===void 0?n:~~e,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<t&&(e=t);const r=this.subarray(t,e);return Object.setPrototypeOf(r,i.prototype),r};function E(t,e,n){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUintLE=i.prototype.readUIntLE=function(t,e,n){t=t>>>0,e=e>>>0,n||E(t,e,this.length);let r=this[t],o=1,s=0;for(;++s<e&&(o*=256);)r+=this[t+s]*o;return r},i.prototype.readUintBE=i.prototype.readUIntBE=function(t,e,n){t=t>>>0,e=e>>>0,n||E(t,e,this.length);let r=this[t+--e],o=1;for(;e>0&&(o*=256);)r+=this[t+--e]*o;return r},i.prototype.readUint8=i.prototype.readUInt8=function(t,e){return t=t>>>0,e||E(t,1,this.length),this[t]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(t,e){return t=t>>>0,e||E(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(t,e){return t=t>>>0,e||E(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(t,e){return t=t>>>0,e||E(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(t,e){return t=t>>>0,e||E(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readBigUInt64LE=$(function(t){t=t>>>0,N(t,"offset");const e=this[t],n=this[t+7];(e===void 0||n===void 0)&&F(t,this.length-8);const r=e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,o=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(r)+(BigInt(o)<<BigInt(32))}),i.prototype.readBigUInt64BE=$(function(t){t=t>>>0,N(t,"offset");const e=this[t],n=this[t+7];(e===void 0||n===void 0)&&F(t,this.length-8);const r=e*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],o=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(r)<<BigInt(32))+BigInt(o)}),i.prototype.readIntLE=function(t,e,n){t=t>>>0,e=e>>>0,n||E(t,e,this.length);let r=this[t],o=1,s=0;for(;++s<e&&(o*=256);)r+=this[t+s]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*e)),r},i.prototype.readIntBE=function(t,e,n){t=t>>>0,e=e>>>0,n||E(t,e,this.length);let r=e,o=1,s=this[t+--r];for(;r>0&&(o*=256);)s+=this[t+--r]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*e)),s},i.prototype.readInt8=function(t,e){return t=t>>>0,e||E(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},i.prototype.readInt16LE=function(t,e){t=t>>>0,e||E(t,2,this.length);const n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n},i.prototype.readInt16BE=function(t,e){t=t>>>0,e||E(t,2,this.length);const n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n},i.prototype.readInt32LE=function(t,e){return t=t>>>0,e||E(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t=t>>>0,e||E(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readBigInt64LE=$(function(t){t=t>>>0,N(t,"offset");const e=this[t],n=this[t+7];(e===void 0||n===void 0)&&F(t,this.length-8);const r=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)}),i.prototype.readBigInt64BE=$(function(t){t=t>>>0,N(t,"offset");const e=this[t],n=this[t+7];(e===void 0||n===void 0)&&F(t,this.length-8);const r=(e<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(r)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n)}),i.prototype.readFloatLE=function(t,e){return t=t>>>0,e||E(t,4,this.length),p.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t=t>>>0,e||E(t,4,this.length),p.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t=t>>>0,e||E(t,8,this.length),p.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t=t>>>0,e||E(t,8,this.length),p.read(this,t,!1,52,8)};function I(t,e,n,r,o,s){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<s)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}i.prototype.writeUintLE=i.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e=e>>>0,n=n>>>0,!r){const f=Math.pow(2,8*n)-1;I(this,t,e,n,f,0)}let o=1,s=0;for(this[e]=t&255;++s<n&&(o*=256);)this[e+s]=t/o&255;return e+n},i.prototype.writeUintBE=i.prototype.writeUIntBE=function(t,e,n,r){if(t=+t,e=e>>>0,n=n>>>0,!r){const f=Math.pow(2,8*n)-1;I(this,t,e,n,f,0)}let o=n-1,s=1;for(this[e+o]=t&255;--o>=0&&(s*=256);)this[e+o]=t/s&255;return e+n},i.prototype.writeUint8=i.prototype.writeUInt8=function(t,e,n){return t=+t,e=e>>>0,n||I(this,t,e,1,255,0),this[e]=t&255,e+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||I(this,t,e,2,65535,0),this[e]=t&255,this[e+1]=t>>>8,e+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||I(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=t&255,e+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||I(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255,e+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||I(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};function it(t,e,n,r,o){ct(e,r,o,t,n,7);let s=Number(e&BigInt(4294967295));t[n++]=s,s=s>>8,t[n++]=s,s=s>>8,t[n++]=s,s=s>>8,t[n++]=s;let f=Number(e>>BigInt(32)&BigInt(4294967295));return t[n++]=f,f=f>>8,t[n++]=f,f=f>>8,t[n++]=f,f=f>>8,t[n++]=f,n}function st(t,e,n,r,o){ct(e,r,o,t,n,7);let s=Number(e&BigInt(4294967295));t[n+7]=s,s=s>>8,t[n+6]=s,s=s>>8,t[n+5]=s,s=s>>8,t[n+4]=s;let f=Number(e>>BigInt(32)&BigInt(4294967295));return t[n+3]=f,f=f>>8,t[n+2]=f,f=f>>8,t[n+1]=f,f=f>>8,t[n]=f,n+8}i.prototype.writeBigUInt64LE=$(function(t,e=0){return it(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeBigUInt64BE=$(function(t,e=0){return st(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e=e>>>0,!r){const g=Math.pow(2,8*n-1);I(this,t,e,n,g-1,-g)}let o=0,s=1,f=0;for(this[e]=t&255;++o<n&&(s*=256);)t<0&&f===0&&this[e+o-1]!==0&&(f=1),this[e+o]=(t/s>>0)-f&255;return e+n},i.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e=e>>>0,!r){const g=Math.pow(2,8*n-1);I(this,t,e,n,g-1,-g)}let o=n-1,s=1,f=0;for(this[e+o]=t&255;--o>=0&&(s*=256);)t<0&&f===0&&this[e+o+1]!==0&&(f=1),this[e+o]=(t/s>>0)-f&255;return e+n},i.prototype.writeInt8=function(t,e,n){return t=+t,e=e>>>0,n||I(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=t&255,e+1},i.prototype.writeInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||I(this,t,e,2,32767,-32768),this[e]=t&255,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||I(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=t&255,e+2},i.prototype.writeInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||I(this,t,e,4,2147483647,-2147483648),this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||I(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4},i.prototype.writeBigInt64LE=$(function(t,e=0){return it(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeBigInt64BE=$(function(t,e=0){return st(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ft(t,e,n,r,o,s){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function ut(t,e,n,r,o){return e=+e,n=n>>>0,o||ft(t,e,n,4),p.write(t,e,n,r,23,4),n+4}i.prototype.writeFloatLE=function(t,e,n){return ut(this,t,e,!0,n)},i.prototype.writeFloatBE=function(t,e,n){return ut(this,t,e,!1,n)};function ht(t,e,n,r,o){return e=+e,n=n>>>0,o||ft(t,e,n,8),p.write(t,e,n,r,52,8),n+8}i.prototype.writeDoubleLE=function(t,e,n){return ht(this,t,e,!0,n)},i.prototype.writeDoubleBE=function(t,e,n){return ht(this,t,e,!1,n)},i.prototype.copy=function(t,e,n,r){if(!i.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!r&&r!==0&&(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);const o=r-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(e,n,r):Uint8Array.prototype.set.call(t,this.subarray(n,r),e),o},i.prototype.fill=function(t,e,n,r){if(typeof t=="string"){if(typeof e=="string"?(r=e,e=0,n=this.length):typeof n=="string"&&(r=n,n=this.length),r!==void 0&&typeof r!="string")throw new TypeError("encoding must be a string");if(typeof r=="string"&&!i.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(t.length===1){const s=t.charCodeAt(0);(r==="utf8"&&s<128||r==="latin1")&&(t=s)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let o;if(typeof t=="number")for(o=e;o<n;++o)this[o]=t;else{const s=i.isBuffer(t)?t:i.from(t,r),f=s.length;if(f===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<n-e;++o)this[o+e]=s[o%f]}return this};const C={};function V(t,e,n){C[t]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(r){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:r,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}V("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),V("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),V("ERR_OUT_OF_RANGE",function(t,e,n){let r=`The value of "${t}" is out of range.`,o=n;return Number.isInteger(n)&&Math.abs(n)>2**32?o=at(String(n)):typeof n=="bigint"&&(o=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(o=at(o)),o+="n"),r+=` It must be ${e}. Received ${o}`,r},RangeError);function at(t){let e="",n=t.length;const r=t[0]==="-"?1:0;for(;n>=r+4;n-=3)e=`_${t.slice(n-3,n)}${e}`;return`${t.slice(0,n)}${e}`}function Mt(t,e,n){N(e,"offset"),(t[e]===void 0||t[e+n]===void 0)&&F(e,t.length-(n+1))}function ct(t,e,n,r,o,s){if(t>n||t<e){const f=typeof e=="bigint"?"n":"";let g;throw e===0||e===BigInt(0)?g=`>= 0${f} and < 2${f} ** ${(s+1)*8}${f}`:g=`>= -(2${f} ** ${(s+1)*8-1}${f}) and < 2 ** ${(s+1)*8-1}${f}`,new C.ERR_OUT_OF_RANGE("value",g,t)}Mt(r,o,s)}function N(t,e){if(typeof t!="number")throw new C.ERR_INVALID_ARG_TYPE(e,"number",t)}function F(t,e,n){throw Math.floor(t)!==t?(N(t,n),new C.ERR_OUT_OF_RANGE("offset","an integer",t)):e<0?new C.ERR_BUFFER_OUT_OF_BOUNDS:new C.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${e}`,t)}const Ct=/[^+/0-9A-Za-z-_]/g;function Nt(t){if(t=t.split("=")[0],t=t.trim().replace(Ct,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function q(t,e){e=e||1/0;let n;const r=t.length;let o=null;const s=[];for(let f=0;f<r;++f){if(n=t.charCodeAt(f),n>55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(f+1===r){(e-=3)>-1&&s.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&s.push(239,191,189),o=n;continue}n=(o-55296<<10|n-56320)+65536}else o&&(e-=3)>-1&&s.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;s.push(n)}else if(n<2048){if((e-=2)<0)break;s.push(n>>6|192,n&63|128)}else if(n<65536){if((e-=3)<0)break;s.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((e-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return s}function jt(t){const e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n)&255);return e}function Ft(t,e){let n,r,o;const s=[];for(let f=0;f<t.length&&!((e-=2)<0);++f)n=t.charCodeAt(f),r=n>>8,o=n%256,s.push(o),s.push(r);return s}function lt(t){return h.toByteArray(Nt(t))}function z(t,e,n,r){let o;for(o=0;o<r&&!(o+n>=e.length||o>=t.length);++o)e[o+n]=t[o];return o}function R(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function J(t){return t!==t}const zt=(function(){const t="0123456789abcdef",e=new Array(256);for(let n=0;n<16;++n){const r=n*16;for(let o=0;o<16;++o)e[r+o]=t[n]+t[o]}return e})();function $(t){return typeof BigInt>"u"?Dt:t}function Dt(){throw new Error("BigInt not supported")}})(yt)),yt}/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var wt;function Kt(){return wt||(wt=1,(function(u,h){var p=Zt(),d=p.Buffer;function x(c,i){for(var A in c)i[A]=c[A]}d.from&&d.alloc&&d.allocUnsafe&&d.allocUnsafeSlow?u.exports=p:(x(p,h),h.Buffer=T);function T(c,i,A){return d(c,i,A)}T.prototype=Object.create(d.prototype),x(d,T),T.from=function(c,i,A){if(typeof c=="number")throw new TypeError("Argument must not be a number");return d(c,i,A)},T.alloc=function(c,i,A){if(typeof c!="number")throw new TypeError("Argument must be a number");var U=d(c);return i!==void 0?typeof A=="string"?U.fill(i,A):U.fill(i):U.fill(0),U},T.allocUnsafe=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return d(c)},T.allocUnsafeSlow=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return p.SlowBuffer(c)}})(Z,Z.exports)),Z.exports}var Q,dt;function te(){if(dt)return Q;dt=1;var u=1e3,h=u*60,p=h*60,d=p*24,x=d*7,T=d*365.25;Q=function(a,l){l=l||{};var v=typeof a;if(v==="string"&&a.length>0)return c(a);if(v==="number"&&isFinite(a))return l.long?A(a):i(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))};function c(a){if(a=String(a),!(a.length>100)){var l=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(a);if(l){var v=parseFloat(l[1]),P=(l[2]||"ms").toLowerCase();switch(P){case"years":case"year":case"yrs":case"yr":case"y":return v*T;case"weeks":case"week":case"w":return v*x;case"days":case"day":case"d":return v*d;case"hours":case"hour":case"hrs":case"hr":case"h":return v*p;case"minutes":case"minute":case"mins":case"min":case"m":return v*h;case"seconds":case"second":case"secs":case"sec":case"s":return v*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return v;default:return}}}}function i(a){var l=Math.abs(a);return l>=d?Math.round(a/d)+"d":l>=p?Math.round(a/p)+"h":l>=h?Math.round(a/h)+"m":l>=u?Math.round(a/u)+"s":a+"ms"}function A(a){var l=Math.abs(a);return l>=d?U(a,l,d,"day"):l>=p?U(a,l,p,"hour"):l>=h?U(a,l,h,"minute"):l>=u?U(a,l,u,"second"):a+" ms"}function U(a,l,v,P){var Y=l>=v*1.5;return Math.round(a/v)+" "+P+(Y?"s":"")}return Q}export{Zt as Q,Wt as Z,Kt as r,te as t,Ht as z};