/* LinkedIn Edit - Changed origin to match https://edge-auth.microsoft.com to fix resource gathering/event handling when self hosting
 * Please verify any origin based issues if this file is updated to a new version
 * Other Edits (Per testing/debugging the full file):
 * RequestParameterBuilder.prototype.addAuthorizationCode sets authCode on msAuthState with the passed in code param
 * sendToClientSignInAccountInfo function adds authCode to accountInfo from msAuthState to be returned with user info
 */
(()=>{const kt="v0.5";let ir={};/*! @azure/msal-browser v2.22.0 2022-02-08 */(function(o,c){c(o.msal={})})(ir,function(o){"use strict";/*! *****************************************************************************
    Copyright (c) Microsoft Corporation.

    Permission to use, copy, modify, and/or distribute this software for any
    purpose with or without fee is hereby granted.

    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
    PERFORMANCE OF THIS SOFTWARE.
    ***************************************************************************** */var c=function(n,e){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])},c(n,e)};function h(n,e){c(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var g=function(){return g=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},g.apply(this,arguments)};function p(n,e,t,r){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function u(f){try{l(r.next(f))}catch(y){s(y)}}function d(f){try{l(r.throw(f))}catch(y){s(y)}}function l(f){f.done?a(f.value):i(f.value).then(u,d)}l((r=r.apply(n,e||[])).next())})}function m(n,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(l){return function(f){return d([l,f])}}function d(l){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,i=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){t.label=l[1];break}if(l[0]===6&&t.label<a[1]){t.label=a[1],a=l;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(l);break}a[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(n,t)}catch(f){l=[6,f],i=0}finally{r=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function q(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(s)throw s.error}}return a}function G(){for(var n=[],e=0;e<arguments.length;e++)n=n.concat(q(arguments[e]));return n}/*! @azure/msal-common v6.1.0 2022-02-08 *//*! *****************************************************************************
    Copyright (c) Microsoft Corporation.

    Permission to use, copy, modify, and/or distribute this software for any
    purpose with or without fee is hereby granted.

    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
    PERFORMANCE OF THIS SOFTWARE.
    ***************************************************************************** */var Z=function(n,e){return Z=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])},Z(n,e)};function te(n,e){Z(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Y=function(){return Y=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Y.apply(this,arguments)};function N(n,e,t,r){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function u(f){try{l(r.next(f))}catch(y){s(y)}}function d(f){try{l(r.throw(f))}catch(y){s(y)}}function l(f){f.done?a(f.value):i(f.value).then(u,d)}l((r=r.apply(n,e||[])).next())})}function T(n,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(l){return function(f){return d([l,f])}}function d(l){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,i=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){t.label=l[1];break}if(l[0]===6&&t.label<a[1]){t.label=a[1],a=l;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(l);break}a[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(n,t)}catch(f){l=[6,f],i=0}finally{r=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function B(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;for(var r=Array(n),i=0,e=0;e<t;e++)for(var a=arguments[e],s=0,u=a.length;s<u;s++,i++)r[i]=a[s];return r}/*! @azure/msal-common v6.1.0 2022-02-08 */var E={LIBRARY_NAME:"MSAL.JS",SKU:"msal.js.common",CACHE_PREFIX:"msal",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_AUTHORITY_HOST:"login.microsoftonline.com",DEFAULT_COMMON_TENANT:"common",ADFS:"adfs",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",RESOURCE_DELIM:"|",NO_ACCOUNT:"NO_ACCOUNT",CLAIMS:"claims",CONSUMER_UTID:"9188040d-6c67-4c5b-b112-36a304b66dad",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_RESPONSE_TYPE:"code",CODE_GRANT_TYPE:"authorization_code",RT_GRANT_TYPE:"refresh_token",FRAGMENT_RESPONSE_MODE:"fragment",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;charset=utf-8",AUTHORIZATION_PENDING:"authorization_pending",NOT_DEFINED:"not_defined",EMPTY_STRING:"",FORWARD_SLASH:"/",IMDS_ENDPOINT:"http://169.254.169.254/metadata/instance/compute/location",IMDS_VERSION:"2020-06-01",IMDS_TIMEOUT:2e3,AZURE_REGION_AUTO_DISCOVER_FLAG:"TryAutoDetect",REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:"login.microsoft.com",KNOWN_PUBLIC_CLOUDS:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},we=[E.OPENID_SCOPE,E.PROFILE_SCOPE,E.OFFLINE_ACCESS_SCOPE],pt=B(we,[E.EMAIL_SCOPE]),H;(function(n){n.CONTENT_TYPE="Content-Type",n.RETRY_AFTER="Retry-After",n.CCS_HEADER="X-AnchorMailbox",n.WWWAuthenticate="WWW-Authenticate",n.AuthenticationInfo="Authentication-Info"})(H||(H={}));var M;(function(n){n.ID_TOKEN="idtoken",n.CLIENT_INFO="client.info",n.ADAL_ID_TOKEN="adal.idtoken",n.ERROR="error",n.ERROR_DESC="error.description",n.ACTIVE_ACCOUNT="active-account"})(M||(M={}));var $;(function(n){n.COMMON="common",n.ORGANIZATIONS="organizations",n.CONSUMERS="consumers"})($||($={}));var O;(function(n){n.CLIENT_ID="client_id",n.REDIRECT_URI="redirect_uri",n.RESPONSE_TYPE="response_type",n.RESPONSE_MODE="response_mode",n.GRANT_TYPE="grant_type",n.CLAIMS="claims",n.SCOPE="scope",n.ERROR="error",n.ERROR_DESCRIPTION="error_description",n.ACCESS_TOKEN="access_token",n.ID_TOKEN="id_token",n.REFRESH_TOKEN="refresh_token",n.EXPIRES_IN="expires_in",n.STATE="state",n.NONCE="nonce",n.PROMPT="prompt",n.SESSION_STATE="session_state",n.CLIENT_INFO="client_info",n.CODE="code",n.CODE_CHALLENGE="code_challenge",n.CODE_CHALLENGE_METHOD="code_challenge_method",n.CODE_VERIFIER="code_verifier",n.CLIENT_REQUEST_ID="client-request-id",n.X_CLIENT_SKU="x-client-SKU",n.X_CLIENT_VER="x-client-VER",n.X_CLIENT_OS="x-client-OS",n.X_CLIENT_CPU="x-client-CPU",n.X_CLIENT_CURR_TELEM="x-client-current-telemetry",n.X_CLIENT_LAST_TELEM="x-client-last-telemetry",n.X_MS_LIB_CAPABILITY="x-ms-lib-capability",n.POST_LOGOUT_URI="post_logout_redirect_uri",n.ID_TOKEN_HINT="id_token_hint",n.DEVICE_CODE="device_code",n.CLIENT_SECRET="client_secret",n.CLIENT_ASSERTION="client_assertion",n.CLIENT_ASSERTION_TYPE="client_assertion_type",n.TOKEN_TYPE="token_type",n.REQ_CNF="req_cnf",n.OBO_ASSERTION="assertion",n.REQUESTED_TOKEN_USE="requested_token_use",n.ON_BEHALF_OF="on_behalf_of",n.FOCI="foci",n.CCS_HEADER="X-AnchorMailbox",n.RETURN_SPA_CODE="return_spa_code",n.LOGOUT_HINT="logout_hint"})(O||(O={}));var x;(function(n){n.ACCESS_TOKEN="access_token",n.XMS_CC="xms_cc"})(x||(x={}));var oe={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create"},be;(function(n){n.ACCOUNT="account",n.SID="sid",n.LOGIN_HINT="login_hint",n.ID_TOKEN="id_token",n.DOMAIN_HINT="domain_hint",n.ORGANIZATIONS="organizations",n.CONSUMERS="consumers",n.ACCOUNT_ID="accountIdentifier",n.HOMEACCOUNT_ID="homeAccountIdentifier"})(be||(be={}));var ze={PLAIN:"plain",S256:"S256"},ft;(function(n){n.QUERY="query",n.FRAGMENT="fragment",n.FORM_POST="form_post"})(ft||(ft={}));var gt;(function(n){n.IMPLICIT_GRANT="implicit",n.AUTHORIZATION_CODE_GRANT="authorization_code",n.CLIENT_CREDENTIALS_GRANT="client_credentials",n.RESOURCE_OWNER_PASSWORD_GRANT="password",n.REFRESH_TOKEN_GRANT="refresh_token",n.DEVICE_CODE_GRANT="device_code",n.JWT_BEARER="urn:ietf:params:oauth:grant-type:jwt-bearer"})(gt||(gt={}));var Te;(function(n){n.MSSTS_ACCOUNT_TYPE="MSSTS",n.ADFS_ACCOUNT_TYPE="ADFS",n.MSAV1_ACCOUNT_TYPE="MSA",n.GENERIC_ACCOUNT_TYPE="Generic"})(Te||(Te={}));var ce;(function(n){n.CACHE_KEY_SEPARATOR="-",n.CLIENT_INFO_SEPARATOR="."})(ce||(ce={}));var K;(function(n){n.ID_TOKEN="IdToken",n.ACCESS_TOKEN="AccessToken",n.ACCESS_TOKEN_WITH_AUTH_SCHEME="AccessToken_With_AuthScheme",n.REFRESH_TOKEN="RefreshToken"})(K||(K={}));var Me;(function(n){n.ACCOUNT="Account",n.CREDENTIAL="Credential",n.ID_TOKEN="IdToken",n.ACCESS_TOKEN="AccessToken",n.REFRESH_TOKEN="RefreshToken",n.APP_METADATA="AppMetadata",n.TEMPORARY="TempCache",n.TELEMETRY="Telemetry",n.UNDEFINED="Undefined",n.THROTTLING="Throttling"})(Me||(Me={}));var Se;(function(n){n[n.ADFS=1001]="ADFS",n[n.MSA=1002]="MSA",n[n.MSSTS=1003]="MSSTS",n[n.GENERIC=1004]="GENERIC",n[n.ACCESS_TOKEN=2001]="ACCESS_TOKEN",n[n.REFRESH_TOKEN=2002]="REFRESH_TOKEN",n[n.ID_TOKEN=2003]="ID_TOKEN",n[n.APP_METADATA=3001]="APP_METADATA",n[n.UNDEFINED=9999]="UNDEFINED"})(Se||(Se={}));var zt="appmetadata",uo="client_info",mt="1",$e={CACHE_KEY:"authority-metadata",REFRESH_TIME_SECONDS:3600*24},fe;(function(n){n.CONFIG="config",n.CACHE="cache",n.NETWORK="network"})(fe||(fe={}));var ne={SCHEMA_VERSION:5,MAX_CUR_HEADER_BYTES:80,MAX_LAST_HEADER_BYTES:330,MAX_CACHED_ERRORS:50,CACHE_KEY:"server-telemetry",CATEGORY_SEPARATOR:"|",VALUE_SEPARATOR:",",OVERFLOW_TRUE:"1",OVERFLOW_FALSE:"0",UNKNOWN_ERROR:"unknown_error"};o.AuthenticationScheme=void 0,function(n){n.BEARER="Bearer",n.POP="pop",n.SSH="ssh-cert"}(o.AuthenticationScheme||(o.AuthenticationScheme={}));var Ze={DEFAULT_THROTTLE_TIME_SECONDS:60,DEFAULT_MAX_THROTTLE_TIME_SECONDS:3600,THROTTLING_PREFIX:"throttling",X_MS_LIB_CAPABILITY_VALUE:"retry-after, h429"},Gr={INVALID_GRANT_ERROR:"invalid_grant",CLIENT_MISMATCH_ERROR:"client_mismatch"},vt;(function(n){n.username="username";/*![SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification = "Not used as a password")]*/n.password="password"})(vt||(vt={}));var We;(function(n){n[n.httpSuccess=200]="httpSuccess",n[n.httpBadRequest=400]="httpBadRequest"})(We||(We={}));var Oe;(function(n){n.FAILED_AUTO_DETECTION="1",n.INTERNAL_CACHE="2",n.ENVIRONMENT_VARIABLE="3",n.IMDS="4"})(Oe||(Oe={}));var Le;(function(n){n.CONFIGURED_MATCHES_DETECTED="1",n.CONFIGURED_NO_AUTO_DETECTION="2",n.CONFIGURED_NOT_DETECTED="3",n.AUTO_DETECTION_REQUESTED_SUCCESSFUL="4",n.AUTO_DETECTION_REQUESTED_FAILED="5"})(Le||(Le={}));var De;(function(n){n.NO_CACHE_HIT="0",n.FORCE_REFRESH="1",n.NO_CACHED_ACCESS_TOKEN="2",n.CACHED_ACCESS_TOKEN_EXPIRED="3",n.REFRESH_CACHED_ACCESS_TOKEN="4"})(De||(De={}));/*! @azure/msal-common v6.1.0 2022-02-08 */var Wt={unexpectedError:{code:"unexpected_error",desc:"Unexpected error in authentication."}},k=function(n){te(e,n);function e(t,r,i){var a=this,s=r?t+": "+r:t;return a=n.call(this,s)||this,Object.setPrototypeOf(a,e.prototype),a.errorCode=t||E.EMPTY_STRING,a.errorMessage=r||"",a.subError=i||"",a.name="AuthError",a}return e.prototype.setCorrelationId=function(t){this.correlationId=t},e.createUnexpectedError=function(t){return new e(Wt.unexpectedError.code,Wt.unexpectedError.desc+": "+t)},e}(Error);/*! @azure/msal-common v6.1.0 2022-02-08 */var yt={createNewGuid:function(){var n="Crypto interface - createNewGuid() has not been implemented";throw k.createUnexpectedError(n)},base64Decode:function(){var n="Crypto interface - base64Decode() has not been implemented";throw k.createUnexpectedError(n)},base64Encode:function(){var n="Crypto interface - base64Encode() has not been implemented";throw k.createUnexpectedError(n)},generatePkceCodes:function(){return N(this,void 0,void 0,function(){var n;return T(this,function(e){throw n="Crypto interface - generatePkceCodes() has not been implemented",k.createUnexpectedError(n)})})},getPublicKeyThumbprint:function(){return N(this,void 0,void 0,function(){var n;return T(this,function(e){throw n="Crypto interface - getPublicKeyThumbprint() has not been implemented",k.createUnexpectedError(n)})})},removeTokenBindingKey:function(){return N(this,void 0,void 0,function(){var n;return T(this,function(e){throw n="Crypto interface - removeTokenBindingKey() has not been implemented",k.createUnexpectedError(n)})})},clearKeystore:function(){return N(this,void 0,void 0,function(){var n;return T(this,function(e){throw n="Crypto interface - clearKeystore() has not been implemented",k.createUnexpectedError(n)})})},signJwt:function(){return N(this,void 0,void 0,function(){var n;return T(this,function(e){throw n="Crypto interface - signJwt() has not been implemented",k.createUnexpectedError(n)})})},hashString:function(){return N(this,void 0,void 0,function(){var n;return T(this,function(e){throw n="Crypto interface - hashString() has not been implemented",k.createUnexpectedError(n)})})}};/*! @azure/msal-common v6.1.0 2022-02-08 */var I={clientInfoDecodingError:{code:"client_info_decoding_error",desc:"The client info could not be parsed/decoded correctly. Please review the trace to determine the root cause."},clientInfoEmptyError:{code:"client_info_empty_error",desc:"The client info was empty. Please review the trace to determine the root cause."},tokenParsingError:{code:"token_parsing_error",desc:"Token cannot be parsed. Please review stack trace to determine root cause."},nullOrEmptyToken:{code:"null_or_empty_token",desc:"The token is null or empty. Please review the trace to determine the root cause."},endpointResolutionError:{code:"endpoints_resolution_error",desc:"Error: could not resolve endpoints. Please check network and try again."},networkError:{code:"network_error",desc:"Network request failed. Please check network trace to determine root cause."},unableToGetOpenidConfigError:{code:"openid_config_error",desc:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints."},hashNotDeserialized:{code:"hash_not_deserialized",desc:"The hash parameters could not be deserialized. Please review the trace to determine the root cause."},blankGuidGenerated:{code:"blank_guid_generated",desc:"The guid generated was blank. Please review the trace to determine the root cause."},invalidStateError:{code:"invalid_state",desc:"State was not the expected format. Please check the logs to determine whether the request was sent using ProtocolUtils.setRequestState()."},stateMismatchError:{code:"state_mismatch",desc:"State mismatch error. Please check your network. Continued requests may cause cache overflow."},stateNotFoundError:{code:"state_not_found",desc:"State not found"},nonceMismatchError:{code:"nonce_mismatch",desc:"Nonce mismatch error. This may be caused by a race condition in concurrent requests."},nonceNotFoundError:{code:"nonce_not_found",desc:"nonce not found"},noTokensFoundError:{code:"no_tokens_found",desc:"No tokens were found for the given scopes, and no authorization code was passed to acquireToken. You must retrieve an authorization code before making a call to acquireToken()."},multipleMatchingTokens:{code:"multiple_matching_tokens",desc:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account."},multipleMatchingAccounts:{code:"multiple_matching_accounts",desc:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account"},multipleMatchingAppMetadata:{code:"multiple_matching_appMetadata",desc:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata"},tokenRequestCannotBeMade:{code:"request_cannot_be_made",desc:"Token request cannot be made without authorization code or refresh token."},appendEmptyScopeError:{code:"cannot_append_empty_scope",desc:"Cannot append null or empty scope to ScopeSet. Please check the stack trace for more info."},removeEmptyScopeError:{code:"cannot_remove_empty_scope",desc:"Cannot remove null or empty scope from ScopeSet. Please check the stack trace for more info."},appendScopeSetError:{code:"cannot_append_scopeset",desc:"Cannot append ScopeSet due to error."},emptyInputScopeSetError:{code:"empty_input_scopeset",desc:"Empty input ScopeSet cannot be processed."},DeviceCodePollingCancelled:{code:"device_code_polling_cancelled",desc:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true."},DeviceCodeExpired:{code:"device_code_expired",desc:"Device code is expired."},DeviceCodeUnknownError:{code:"device_code_unknown_error",desc:"Device code stopped polling for unknown reasons."},NoAccountInSilentRequest:{code:"no_account_in_silent_request",desc:"Please pass an account object, silent flow is not supported without account information"},invalidCacheRecord:{code:"invalid_cache_record",desc:"Cache record object was null or undefined."},invalidCacheEnvironment:{code:"invalid_cache_environment",desc:"Invalid environment when attempting to create cache entry"},noAccountFound:{code:"no_account_found",desc:"No account found in cache for given key."},CachePluginError:{code:"no cache plugin set on CacheManager",desc:"ICachePlugin needs to be set before using readFromStorage or writeFromStorage"},noCryptoObj:{code:"no_crypto_object",desc:"No crypto object detected. This is required for the following operation: "},invalidCacheType:{code:"invalid_cache_type",desc:"Invalid cache type"},unexpectedAccountType:{code:"unexpected_account_type",desc:"Unexpected account type."},unexpectedCredentialType:{code:"unexpected_credential_type",desc:"Unexpected credential type."},invalidAssertion:{code:"invalid_assertion",desc:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515"},invalidClientCredential:{code:"invalid_client_credential",desc:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential"},tokenRefreshRequired:{code:"token_refresh_required",desc:"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired."},userTimeoutReached:{code:"user_timeout_reached",desc:"User defined timeout for device code polling reached"},tokenClaimsRequired:{code:"token_claims_cnf_required_for_signedjwt",desc:"Cannot generate a POP jwt if the token_claims are not populated"},noAuthorizationCodeFromServer:{code:"authorization_code_missing_from_server_response",desc:"Server response does not contain an authorization code to proceed"},noAzureRegionDetected:{code:"no_azure_region_detected",desc:"No azure region was detected and no fallback was made available"},accessTokenEntityNullError:{code:"access_token_entity_null",desc:"Access token entity is null, please check logs and cache to ensure a valid access token is present."},bindingKeyNotRemovedError:{code:"binding_key_not_removed",desc:"Could not remove the credential's binding key from storage."},logoutNotSupported:{code:"end_session_endpoint_not_supported",desc:"Provided authority does not support logout."}},b=function(n){te(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.name="ClientAuthError",Object.setPrototypeOf(i,e.prototype),i}return e.createClientInfoDecodingError=function(t){return new e(I.clientInfoDecodingError.code,I.clientInfoDecodingError.desc+" Failed with error: "+t)},e.createClientInfoEmptyError=function(){return new e(I.clientInfoEmptyError.code,""+I.clientInfoEmptyError.desc)},e.createTokenParsingError=function(t){return new e(I.tokenParsingError.code,I.tokenParsingError.desc+" Failed with error: "+t)},e.createTokenNullOrEmptyError=function(t){return new e(I.nullOrEmptyToken.code,I.nullOrEmptyToken.desc+" Raw Token Value: "+t)},e.createEndpointDiscoveryIncompleteError=function(t){return new e(I.endpointResolutionError.code,I.endpointResolutionError.desc+" Detail: "+t)},e.createNetworkError=function(t,r){return new e(I.networkError.code,I.networkError.desc+" | Fetch client threw: "+r+" | Attempted to reach: "+t.split("?")[0])},e.createUnableToGetOpenidConfigError=function(t){return new e(I.unableToGetOpenidConfigError.code,I.unableToGetOpenidConfigError.desc+" Attempted to retrieve endpoints from: "+t)},e.createHashNotDeserializedError=function(t){return new e(I.hashNotDeserialized.code,I.hashNotDeserialized.desc+" Given Object: "+t)},e.createInvalidStateError=function(t,r){return new e(I.invalidStateError.code,I.invalidStateError.desc+" Invalid State: "+t+", Root Err: "+r)},e.createStateMismatchError=function(){return new e(I.stateMismatchError.code,I.stateMismatchError.desc)},e.createStateNotFoundError=function(t){return new e(I.stateNotFoundError.code,I.stateNotFoundError.desc+":  "+t)},e.createNonceMismatchError=function(){return new e(I.nonceMismatchError.code,I.nonceMismatchError.desc)},e.createNonceNotFoundError=function(t){return new e(I.nonceNotFoundError.code,I.nonceNotFoundError.desc+":  "+t)},e.createMultipleMatchingTokensInCacheError=function(){return new e(I.multipleMatchingTokens.code,I.multipleMatchingTokens.desc+".")},e.createMultipleMatchingAccountsInCacheError=function(){return new e(I.multipleMatchingAccounts.code,I.multipleMatchingAccounts.desc)},e.createMultipleMatchingAppMetadataInCacheError=function(){return new e(I.multipleMatchingAppMetadata.code,I.multipleMatchingAppMetadata.desc)},e.createTokenRequestCannotBeMadeError=function(){return new e(I.tokenRequestCannotBeMade.code,I.tokenRequestCannotBeMade.desc)},e.createAppendEmptyScopeToSetError=function(t){return new e(I.appendEmptyScopeError.code,I.appendEmptyScopeError.desc+" Given Scope: "+t)},e.createRemoveEmptyScopeFromSetError=function(t){return new e(I.removeEmptyScopeError.code,I.removeEmptyScopeError.desc+" Given Scope: "+t)},e.createAppendScopeSetError=function(t){return new e(I.appendScopeSetError.code,I.appendScopeSetError.desc+" Detail Error: "+t)},e.createEmptyInputScopeSetError=function(){return new e(I.emptyInputScopeSetError.code,""+I.emptyInputScopeSetError.desc)},e.createDeviceCodeCancelledError=function(){return new e(I.DeviceCodePollingCancelled.code,""+I.DeviceCodePollingCancelled.desc)},e.createDeviceCodeExpiredError=function(){return new e(I.DeviceCodeExpired.code,""+I.DeviceCodeExpired.desc)},e.createDeviceCodeUnknownError=function(){return new e(I.DeviceCodeUnknownError.code,""+I.DeviceCodeUnknownError.desc)},e.createNoAccountInSilentRequestError=function(){return new e(I.NoAccountInSilentRequest.code,""+I.NoAccountInSilentRequest.desc)},e.createNullOrUndefinedCacheRecord=function(){return new e(I.invalidCacheRecord.code,I.invalidCacheRecord.desc)},e.createInvalidCacheEnvironmentError=function(){return new e(I.invalidCacheEnvironment.code,I.invalidCacheEnvironment.desc)},e.createNoAccountFoundError=function(){return new e(I.noAccountFound.code,I.noAccountFound.desc)},e.createCachePluginError=function(){return new e(I.CachePluginError.code,""+I.CachePluginError.desc)},e.createNoCryptoObjectError=function(t){return new e(I.noCryptoObj.code,""+I.noCryptoObj.desc+t)},e.createInvalidCacheTypeError=function(){return new e(I.invalidCacheType.code,""+I.invalidCacheType.desc)},e.createUnexpectedAccountTypeError=function(){return new e(I.unexpectedAccountType.code,""+I.unexpectedAccountType.desc)},e.createUnexpectedCredentialTypeError=function(){return new e(I.unexpectedCredentialType.code,""+I.unexpectedCredentialType.desc)},e.createInvalidAssertionError=function(){return new e(I.invalidAssertion.code,""+I.invalidAssertion.desc)},e.createInvalidCredentialError=function(){return new e(I.invalidClientCredential.code,""+I.invalidClientCredential.desc)},e.createRefreshRequiredError=function(){return new e(I.tokenRefreshRequired.code,I.tokenRefreshRequired.desc)},e.createUserTimeoutReachedError=function(){return new e(I.userTimeoutReached.code,I.userTimeoutReached.desc)},e.createTokenClaimsRequiredError=function(){return new e(I.tokenClaimsRequired.code,I.tokenClaimsRequired.desc)},e.createNoAuthCodeInServerResponseError=function(){return new e(I.noAuthorizationCodeFromServer.code,I.noAuthorizationCodeFromServer.desc)},e.createBindingKeyNotRemovedError=function(){return new e(I.bindingKeyNotRemovedError.code,I.bindingKeyNotRemovedError.desc)},e.createLogoutNotSupportedError=function(){return new e(I.logoutNotSupported.code,I.logoutNotSupported.desc)},e}(k);/*! @azure/msal-common v6.1.0 2022-02-08 */var _=function(){function n(){}return n.decodeAuthToken=function(e){if(n.isEmpty(e))throw b.createTokenNullOrEmptyError(e);var t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/,r=t.exec(e);if(!r||r.length<4)throw b.createTokenParsingError("Given token is malformed: "+JSON.stringify(e));var i={header:r[1],JWSPayload:r[2],JWSSig:r[3]};return i},n.isEmpty=function(e){return typeof e=="undefined"||!e||e.length===0},n.isEmptyObj=function(e){if(e&&!n.isEmpty(e))try{var t=JSON.parse(e);return Object.keys(t).length===0}catch(r){}return!0},n.startsWith=function(e,t){return e.indexOf(t)===0},n.endsWith=function(e,t){return e.length>=t.length&&e.lastIndexOf(t)===e.length-t.length},n.queryStringToObject=function(e){var t={},r=e.split("&"),i=function(a){return decodeURIComponent(a.replace(/\+/g," "))};return r.forEach(function(a){if(a.trim()){var s=a.split(/=(.+)/g,2),u=s[0],d=s[1];u&&d&&(t[i(u)]=i(d))}}),t},n.trimArrayEntries=function(e){return e.map(function(t){return t.trim()})},n.removeEmptyStringsFromArray=function(e){return e.filter(function(t){return!n.isEmpty(t)})},n.jsonParseHelper=function(e){try{return JSON.parse(e)}catch(t){return null}},n.matchPattern=function(e,t){var r=new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?"));return r.test(t)},n}();/*! @azure/msal-common v6.1.0 2022-02-08 */o.LogLevel=void 0,function(n){n[n.Error=0]="Error",n[n.Warning=1]="Warning",n[n.Info=2]="Info",n[n.Verbose=3]="Verbose",n[n.Trace=4]="Trace"}(o.LogLevel||(o.LogLevel={}));var Et=function(){function n(e,t,r){this.level=o.LogLevel.Info;var i=function(){};this.localCallback=e.loggerCallback||i,this.piiLoggingEnabled=e.piiLoggingEnabled||!1,this.level=typeof e.logLevel=="number"?e.logLevel:o.LogLevel.Info,this.correlationId=e.correlationId||"",this.packageName=t||E.EMPTY_STRING,this.packageVersion=r||E.EMPTY_STRING}return n.prototype.clone=function(e,t,r){return new n({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:r||this.correlationId},e,t)},n.prototype.logMessage=function(e,t){if(!(t.logLevel>this.level||!this.piiLoggingEnabled&&t.containsPii)){var r=new Date().toUTCString(),i;_.isEmpty(t.correlationId)?_.isEmpty(this.correlationId)?i="["+r+"]":i="["+r+"] : ["+this.correlationId+"]":i="["+r+"] : ["+t.correlationId+"]";var a=i+" : "+this.packageName+"@"+this.packageVersion+" : "+o.LogLevel[t.logLevel]+" - "+e;this.executeCallback(t.logLevel,a,t.containsPii||!1)}},n.prototype.executeCallback=function(e,t,r){this.localCallback&&this.localCallback(e,t,r)},n.prototype.error=function(e,t){this.logMessage(e,{logLevel:o.LogLevel.Error,containsPii:!1,correlationId:t||""})},n.prototype.errorPii=function(e,t){this.logMessage(e,{logLevel:o.LogLevel.Error,containsPii:!0,correlationId:t||""})},n.prototype.warning=function(e,t){this.logMessage(e,{logLevel:o.LogLevel.Warning,containsPii:!1,correlationId:t||""})},n.prototype.warningPii=function(e,t){this.logMessage(e,{logLevel:o.LogLevel.Warning,containsPii:!0,correlationId:t||""})},n.prototype.info=function(e,t){this.logMessage(e,{logLevel:o.LogLevel.Info,containsPii:!1,correlationId:t||""})},n.prototype.infoPii=function(e,t){this.logMessage(e,{logLevel:o.LogLevel.Info,containsPii:!0,correlationId:t||""})},n.prototype.verbose=function(e,t){this.logMessage(e,{logLevel:o.LogLevel.Verbose,containsPii:!1,correlationId:t||""})},n.prototype.verbosePii=function(e,t){this.logMessage(e,{logLevel:o.LogLevel.Verbose,containsPii:!0,correlationId:t||""})},n.prototype.trace=function(e,t){this.logMessage(e,{logLevel:o.LogLevel.Trace,containsPii:!1,correlationId:t||""})},n.prototype.tracePii=function(e,t){this.logMessage(e,{logLevel:o.LogLevel.Trace,containsPii:!0,correlationId:t||""})},n.prototype.isPiiLoggingEnabled=function(){return this.piiLoggingEnabled||!1},n}();/*! @azure/msal-common v6.1.0 2022-02-08 */var lo="@azure/msal-common",zr="6.1.0";/*! @azure/msal-common v6.1.0 2022-02-08 */o.AzureCloudInstance=void 0,function(n){n[n.None=0]="None",n.AzurePublic="https://login.microsoftonline.com",n.AzureChina="https://login.chinacloudapi.cn",n.AzureGermany="https://login.microsoftonline.de",n.AzureUsGovernment="https://login.microsoftonline.us"}(o.AzureCloudInstance||(o.AzureCloudInstance={}));/*! @azure/msal-common v6.1.0 2022-02-08 */var et=function(){function n(){}return n.prototype.generateAccountId=function(){return n.generateAccountIdForCacheKey(this.homeAccountId,this.environment)},n.prototype.generateCredentialId=function(){return n.generateCredentialIdForCacheKey(this.credentialType,this.clientId,this.realm,this.familyId)},n.prototype.generateTarget=function(){return n.generateTargetForCacheKey(this.target)},n.prototype.generateCredentialKey=function(){return n.generateCredentialCacheKey(this.homeAccountId,this.environment,this.credentialType,this.clientId,this.realm,this.target,this.familyId,this.tokenType,this.requestedClaimsHash)},n.prototype.generateType=function(){switch(this.credentialType){case K.ID_TOKEN:return Se.ID_TOKEN;case K.ACCESS_TOKEN:case K.ACCESS_TOKEN_WITH_AUTH_SCHEME:return Se.ACCESS_TOKEN;case K.REFRESH_TOKEN:return Se.REFRESH_TOKEN;default:throw b.createUnexpectedCredentialTypeError()}},n.getCredentialType=function(e){return e.indexOf(K.ACCESS_TOKEN.toLowerCase())!==-1?e.indexOf(K.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())!==-1?K.ACCESS_TOKEN_WITH_AUTH_SCHEME:K.ACCESS_TOKEN:e.indexOf(K.ID_TOKEN.toLowerCase())!==-1?K.ID_TOKEN:e.indexOf(K.REFRESH_TOKEN.toLowerCase())!==-1?K.REFRESH_TOKEN:E.NOT_DEFINED},n.generateCredentialCacheKey=function(e,t,r,i,a,s,u,d,l){var f=[this.generateAccountIdForCacheKey(e,t),this.generateCredentialIdForCacheKey(r,i,a,u),this.generateTargetForCacheKey(s),this.generateClaimsHashForCacheKey(l),this.generateSchemeForCacheKey(d)];return f.join(ce.CACHE_KEY_SEPARATOR).toLowerCase()},n.generateAccountIdForCacheKey=function(e,t){var r=[e,t];return r.join(ce.CACHE_KEY_SEPARATOR).toLowerCase()},n.generateCredentialIdForCacheKey=function(e,t,r,i){var a=e===K.REFRESH_TOKEN&&i||t,s=[e,a,r||""];return s.join(ce.CACHE_KEY_SEPARATOR).toLowerCase()},n.generateTargetForCacheKey=function(e){return(e||"").toLowerCase()},n.generateClaimsHashForCacheKey=function(e){return(e||"").toLowerCase()},n.generateSchemeForCacheKey=function(e){return e&&e.toLowerCase()!==o.AuthenticationScheme.BEARER.toLowerCase()?e.toLowerCase():""},n}();/*! @azure/msal-common v6.1.0 2022-02-08 */var L={redirectUriNotSet:{code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},postLogoutUriNotSet:{code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},claimsRequestParsingError:{code:"claims_request_parsing_error",desc:"Could not parse the given claims request object."},authorityUriInsecure:{code:"authority_uri_insecure",desc:"Authority URIs must use https.  Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options"},urlParseError:{code:"url_parse_error",desc:"URL could not be parsed into appropriate segments."},urlEmptyError:{code:"empty_url_error",desc:"URL was empty or null."},emptyScopesError:{code:"empty_input_scopes_error",desc:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token."},nonArrayScopesError:{code:"nonarray_input_scopes_error",desc:"Scopes cannot be passed as non-array."},clientIdSingleScopeError:{code:"clientid_input_scopes_error",desc:"Client ID can only be provided as a single scope."},invalidPrompt:{code:"invalid_prompt_value",desc:"Supported prompt values are 'login', 'select_account', 'consent', 'create' and 'none'.  Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest"},invalidClaimsRequest:{code:"invalid_claims",desc:"Given claims parameter must be a stringified JSON object."},tokenRequestEmptyError:{code:"token_request_empty",desc:"Token request was empty and not found in cache."},logoutRequestEmptyError:{code:"logout_request_empty",desc:"The logout request was null or undefined."},invalidCodeChallengeMethod:{code:"invalid_code_challenge_method",desc:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".'},invalidCodeChallengeParams:{code:"pkce_params_missing",desc:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request"},invalidCloudDiscoveryMetadata:{code:"invalid_cloud_discovery_metadata",desc:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields"},invalidAuthorityMetadata:{code:"invalid_authority_metadata",desc:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields."},untrustedAuthority:{code:"untrusted_authority",desc:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter."},invalidAzureCloudInstance:{code:"invalid_azure_cloud_instance",desc:"Invalid AzureCloudInstance provided. Please refer MSAL JS docs: aks.ms/msaljs/azure_cloud_instance for valid values"},missingSshJwk:{code:"missing_ssh_jwk",desc:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme."},missingSshKid:{code:"missing_ssh_kid",desc:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme."},missingNonceAuthenticationHeader:{code:"missing_nonce_authentication_header",desc:"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce."},invalidAuthenticationHeader:{code:"invalid_authentication_header",desc:"Invalid authentication header provided"}},W=function(n){te(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.name="ClientConfigurationError",Object.setPrototypeOf(i,e.prototype),i}return e.createRedirectUriEmptyError=function(){return new e(L.redirectUriNotSet.code,L.redirectUriNotSet.desc)},e.createPostLogoutRedirectUriEmptyError=function(){return new e(L.postLogoutUriNotSet.code,L.postLogoutUriNotSet.desc)},e.createClaimsRequestParsingError=function(t){return new e(L.claimsRequestParsingError.code,L.claimsRequestParsingError.desc+" Given value: "+t)},e.createInsecureAuthorityUriError=function(t){return new e(L.authorityUriInsecure.code,L.authorityUriInsecure.desc+" Given URI: "+t)},e.createUrlParseError=function(t){return new e(L.urlParseError.code,L.urlParseError.desc+" Given Error: "+t)},e.createUrlEmptyError=function(){return new e(L.urlEmptyError.code,L.urlEmptyError.desc)},e.createEmptyScopesArrayError=function(){return new e(L.emptyScopesError.code,""+L.emptyScopesError.desc)},e.createClientIdSingleScopeError=function(t){return new e(L.clientIdSingleScopeError.code,L.clientIdSingleScopeError.desc+" Given Scopes: "+t)},e.createInvalidPromptError=function(t){return new e(L.invalidPrompt.code,L.invalidPrompt.desc+" Given value: "+t)},e.createInvalidClaimsRequestError=function(){return new e(L.invalidClaimsRequest.code,L.invalidClaimsRequest.desc)},e.createEmptyLogoutRequestError=function(){return new e(L.logoutRequestEmptyError.code,L.logoutRequestEmptyError.desc)},e.createEmptyTokenRequestError=function(){return new e(L.tokenRequestEmptyError.code,L.tokenRequestEmptyError.desc)},e.createInvalidCodeChallengeMethodError=function(){return new e(L.invalidCodeChallengeMethod.code,L.invalidCodeChallengeMethod.desc)},e.createInvalidCodeChallengeParamsError=function(){return new e(L.invalidCodeChallengeParams.code,L.invalidCodeChallengeParams.desc)},e.createInvalidCloudDiscoveryMetadataError=function(){return new e(L.invalidCloudDiscoveryMetadata.code,L.invalidCloudDiscoveryMetadata.desc)},e.createInvalidAuthorityMetadataError=function(){return new e(L.invalidAuthorityMetadata.code,L.invalidAuthorityMetadata.desc)},e.createUntrustedAuthorityError=function(){return new e(L.untrustedAuthority.code,L.untrustedAuthority.desc)},e.createInvalidAzureCloudInstanceError=function(){return new e(L.invalidAzureCloudInstance.code,L.invalidAzureCloudInstance.desc)},e.createMissingSshJwkError=function(){return new e(L.missingSshJwk.code,L.missingSshJwk.desc)},e.createMissingSshKidError=function(){return new e(L.missingSshKid.code,L.missingSshKid.desc)},e.createMissingNonceAuthenticationHeadersError=function(){return new e(L.missingNonceAuthenticationHeader.code,L.missingNonceAuthenticationHeader.desc)},e.createInvalidAuthenticationHeaderError=function(t,r){return new e(L.invalidAuthenticationHeader.code,L.invalidAuthenticationHeader.desc+". Invalid header: "+t+". Details: "+r)},e}(b);/*! @azure/msal-common v6.1.0 2022-02-08 */var ge=function(){function n(e){var t=this,r=e?_.trimArrayEntries(B(e)):[],i=r?_.removeEmptyStringsFromArray(r):[];this.validateInputScopes(i),this.scopes=new Set,i.forEach(function(a){return t.scopes.add(a)})}return n.fromString=function(e){var t=e||"",r=t.split(" ");return new n(r)},n.prototype.validateInputScopes=function(e){if(!e||e.length<1)throw W.createEmptyScopesArrayError()},n.prototype.containsScope=function(e){var t=this.printScopesLowerCase().split(" "),r=new n(t);return _.isEmpty(e)?!1:r.scopes.has(e.toLowerCase())},n.prototype.containsScopeSet=function(e){var t=this;return!e||e.scopes.size<=0?!1:this.scopes.size>=e.scopes.size&&e.asArray().every(function(r){return t.containsScope(r)})},n.prototype.containsOnlyOIDCScopes=function(){var e=this,t=0;return pt.forEach(function(r){e.containsScope(r)&&(t+=1)}),this.scopes.size===t},n.prototype.appendScope=function(e){_.isEmpty(e)||this.scopes.add(e.trim())},n.prototype.appendScopes=function(e){var t=this;try{e.forEach(function(r){return t.appendScope(r)})}catch(r){throw b.createAppendScopeSetError(r)}},n.prototype.removeScope=function(e){if(_.isEmpty(e))throw b.createRemoveEmptyScopeFromSetError(e);this.scopes.delete(e.trim())},n.prototype.removeOIDCScopes=function(){var e=this;pt.forEach(function(t){e.scopes.delete(t)})},n.prototype.unionScopeSets=function(e){if(!e)throw b.createEmptyInputScopeSetError();var t=new Set;return e.scopes.forEach(function(r){return t.add(r.toLowerCase())}),this.scopes.forEach(function(r){return t.add(r.toLowerCase())}),t},n.prototype.intersectingScopeSets=function(e){if(!e)throw b.createEmptyInputScopeSetError();e.containsOnlyOIDCScopes()||e.removeOIDCScopes();var t=this.unionScopeSets(e),r=e.getScopeCount(),i=this.getScopeCount(),a=t.size;return a<i+r},n.prototype.getScopeCount=function(){return this.scopes.size},n.prototype.asArray=function(){var e=[];return this.scopes.forEach(function(t){return e.push(t)}),e},n.prototype.printScopes=function(){if(this.scopes){var e=this.asArray();return e.join(" ")}return""},n.prototype.printScopesLowerCase=function(){return this.printScopes().toLowerCase()},n}();/*! @azure/msal-common v6.1.0 2022-02-08 */function Ct(n,e){if(_.isEmpty(n))throw b.createClientInfoEmptyError();try{var t=e.base64Decode(n);return JSON.parse(t)}catch(r){throw b.createClientInfoDecodingError(r)}}function tt(n){if(_.isEmpty(n))throw b.createClientInfoDecodingError("Home account ID was empty.");var e=n.split(ce.CLIENT_INFO_SEPARATOR,2);return{uid:e[0],utid:e.length<2?E.EMPTY_STRING:e[1]}}/*! @azure/msal-common v6.1.0 2022-02-08 */var Pe;(function(n){n[n.Default=0]="Default",n[n.Adfs=1]="Adfs"})(Pe||(Pe={}));/*! @azure/msal-common v6.1.0 2022-02-08 */var ae=function(){function n(){}return n.prototype.generateAccountId=function(){var e=[this.homeAccountId,this.environment];return e.join(ce.CACHE_KEY_SEPARATOR).toLowerCase()},n.prototype.generateAccountKey=function(){return n.generateAccountCacheKey({homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId})},n.prototype.generateType=function(){switch(this.authorityType){case Te.ADFS_ACCOUNT_TYPE:return Se.ADFS;case Te.MSAV1_ACCOUNT_TYPE:return Se.MSA;case Te.MSSTS_ACCOUNT_TYPE:return Se.MSSTS;case Te.GENERIC_ACCOUNT_TYPE:return Se.GENERIC;default:throw b.createUnexpectedAccountTypeError()}},n.prototype.getAccountInfo=function(){return{homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId,name:this.name,idTokenClaims:this.idTokenClaims}},n.generateAccountCacheKey=function(e){var t=[e.homeAccountId,e.environment||"",e.tenantId||""];return t.join(ce.CACHE_KEY_SEPARATOR).toLowerCase()},n.createAccount=function(e,t,r,i,a,s,u,d){var l,f,y,w,U,P,F=new n;F.authorityType=Te.MSSTS_ACCOUNT_TYPE,F.clientInfo=e,F.homeAccountId=t;var z=d||i&&i.getPreferredCache();if(!z)throw b.createInvalidCacheEnvironmentError();return F.environment=z,F.realm=((l=r==null?void 0:r.claims)===null||l===void 0?void 0:l.tid)||"",F.oboAssertion=a,r&&(F.idTokenClaims=r.claims,F.localAccountId=((f=r==null?void 0:r.claims)===null||f===void 0?void 0:f.oid)||((y=r==null?void 0:r.claims)===null||y===void 0?void 0:y.sub)||"",F.username=((w=r==null?void 0:r.claims)===null||w===void 0?void 0:w.preferred_username)||(!((U=r==null?void 0:r.claims)===null||U===void 0)&&U.emails?r.claims.emails[0]:""),F.name=(P=r==null?void 0:r.claims)===null||P===void 0?void 0:P.name),F.cloudGraphHostName=s,F.msGraphHost=u,F},n.createGenericAccount=function(e,t,r,i,a,s,u){var d,l,f,y,w=new n;w.authorityType=r&&r.authorityType===Pe.Adfs?Te.ADFS_ACCOUNT_TYPE:Te.GENERIC_ACCOUNT_TYPE,w.homeAccountId=e,w.realm="",w.oboAssertion=i;var U=u||r&&r.getPreferredCache();if(!U)throw b.createInvalidCacheEnvironmentError();return t&&(w.localAccountId=((d=t==null?void 0:t.claims)===null||d===void 0?void 0:d.oid)||((l=t==null?void 0:t.claims)===null||l===void 0?void 0:l.sub)||"",w.username=((f=t==null?void 0:t.claims)===null||f===void 0?void 0:f.upn)||"",w.name=((y=t==null?void 0:t.claims)===null||y===void 0?void 0:y.name)||"",w.idTokenClaims=t==null?void 0:t.claims),w.environment=U,w.cloudGraphHostName=a,w.msGraphHost=s,w},n.generateHomeAccountId=function(e,t,r,i,a){var s,u=!((s=a==null?void 0:a.claims)===null||s===void 0)&&s.sub?a.claims.sub:E.EMPTY_STRING;if(t===Pe.Adfs)return u;if(e)try{var d=Ct(e,i);if(!_.isEmpty(d.uid)&&!_.isEmpty(d.utid))return""+d.uid+ce.CLIENT_INFO_SEPARATOR+d.utid}catch(l){}return r.verbose("No client info in response"),u},n.isAccountEntity=function(e){return e?e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType"):!1},n.accountInfoIsEqual=function(e,t,r){if(!e||!t)return!1;var i=!0;if(r){var a=e.idTokenClaims||{},s=t.idTokenClaims||{};i=a.iat===s.iat&&a.nonce===s.nonce}return e.homeAccountId===t.homeAccountId&&e.localAccountId===t.localAccountId&&e.username===t.username&&e.tenantId===t.tenantId&&e.environment===t.environment&&i},n}();/*! @azure/msal-common v6.1.0 2022-02-08 */var Ne=function(){function n(e,t){if(_.isEmpty(e))throw b.createTokenNullOrEmptyError(e);this.rawToken=e,this.claims=n.extractTokenClaims(e,t)}return n.extractTokenClaims=function(e,t){var r=_.decodeAuthToken(e);try{var i=r.JWSPayload,a=t.base64Decode(i);return JSON.parse(a)}catch(s){throw b.createTokenParsingError(s)}},n}();/*! @azure/msal-common v6.1.0 2022-02-08 */var he=function(){function n(e,t){this.clientId=e,this.cryptoImpl=t}return n.prototype.getAllAccounts=function(){var e=this,t=this.getAccountsFilteredBy(),r=Object.keys(t).map(function(s){return t[s]}),i=r.length;if(i<1)return[];var a=r.map(function(s){var u=n.toObject(new ae,s),d=u.getAccountInfo(),l=e.readIdTokenFromCache(e.clientId,d);return l&&!d.idTokenClaims&&(d.idTokenClaims=new Ne(l.secret,e.cryptoImpl).claims),d});return a},n.prototype.saveCacheRecord=function(e){return N(this,void 0,void 0,function(){return T(this,function(t){switch(t.label){case 0:if(!e)throw b.createNullOrUndefinedCacheRecord();return e.account&&this.setAccount(e.account),e.idToken&&this.setIdTokenCredential(e.idToken),e.accessToken?[4,this.saveAccessToken(e.accessToken)]:[3,2];case 1:t.sent(),t.label=2;case 2:return e.refreshToken&&this.setRefreshTokenCredential(e.refreshToken),e.appMetadata&&this.setAppMetadata(e.appMetadata),[2]}})})},n.prototype.saveAccessToken=function(e){return N(this,void 0,void 0,function(){var t,r,i,a,s=this;return T(this,function(u){switch(u.label){case 0:return t=this.getCredentialsFilteredBy({clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType,requestedClaimsHash:e.requestedClaimsHash}),r=ge.fromString(e.target),i=Object.keys(t.accessTokens).map(function(d){return t.accessTokens[d]}),i?(a=[],i.forEach(function(d){var l=ge.fromString(d.target);l.intersectingScopeSets(r)&&a.push(s.removeCredential(d))}),[4,Promise.all(a)]):[3,2];case 1:u.sent(),u.label=2;case 2:return this.setAccessTokenCredential(e),[2]}})})},n.prototype.getAccountsFilteredBy=function(e){return this.getAccountsFilteredByInternal(e?e.homeAccountId:"",e?e.environment:"",e?e.realm:"")},n.prototype.getAccountsFilteredByInternal=function(e,t,r){var i=this,a=this.getKeys(),s={};return a.forEach(function(u){var d=i.getAccount(u);!d||!!e&&!i.matchHomeAccountId(d,e)||!!t&&!i.matchEnvironment(d,t)||!!r&&!i.matchRealm(d,r)||(s[u]=d)}),s},n.prototype.getCredentialsFilteredBy=function(e){return this.getCredentialsFilteredByInternal(e.homeAccountId,e.environment,e.credentialType,e.clientId,e.familyId,e.realm,e.target,e.oboAssertion,e.tokenType,e.keyId,e.requestedClaimsHash)},n.prototype.getCredentialsFilteredByInternal=function(e,t,r,i,a,s,u,d,l,f,y){var w=this,U=this.getKeys(),P={idTokens:{},accessTokens:{},refreshTokens:{}};return U.forEach(function(F){var z=et.getCredentialType(F);if(z!==E.NOT_DEFINED){var D=w.getSpecificCredential(F,z);if(!!D&&!(!!d&&!w.matchOboAssertion(D,d))&&!(!!e&&!w.matchHomeAccountId(D,e))&&!(!!t&&!w.matchEnvironment(D,t))&&!(!!s&&!w.matchRealm(D,s))&&!(!!r&&!w.matchCredentialType(D,r))&&!(!!i&&!w.matchClientId(D,i))&&!(!!a&&!w.matchFamilyId(D,a))&&!(!!u&&!w.matchTarget(D,u))&&!((y||D.requestedClaimsHash)&&D.requestedClaimsHash!==y)&&!(r===K.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(!!l&&!w.matchTokenType(D,l)||l===o.AuthenticationScheme.SSH&&f&&!w.matchKeyId(D,f)))){var Q=w.updateCredentialCacheKey(F,D);switch(z){case K.ID_TOKEN:P.idTokens[Q]=D;break;case K.ACCESS_TOKEN:case K.ACCESS_TOKEN_WITH_AUTH_SCHEME:P.accessTokens[Q]=D;break;case K.REFRESH_TOKEN:P.refreshTokens[Q]=D;break}}}}),P},n.prototype.getAppMetadataFilteredBy=function(e){return this.getAppMetadataFilteredByInternal(e.environment,e.clientId)},n.prototype.getAppMetadataFilteredByInternal=function(e,t){var r=this,i=this.getKeys(),a={};return i.forEach(function(s){if(!!r.isAppMetadata(s)){var u=r.getAppMetadata(s);!u||!!e&&!r.matchEnvironment(u,e)||!!t&&!r.matchClientId(u,t)||(a[s]=u)}}),a},n.prototype.getAuthorityMetadataByAlias=function(e){var t=this,r=this.getAuthorityMetadataKeys(),i=null;return r.forEach(function(a){if(!(!t.isAuthorityMetadata(a)||a.indexOf(t.clientId)===-1)){var s=t.getAuthorityMetadata(a);!s||s.aliases.indexOf(e)!==-1&&(i=s)}}),i},n.prototype.removeAllAccounts=function(){return N(this,void 0,void 0,function(){var e,t,r=this;return T(this,function(i){switch(i.label){case 0:return e=this.getKeys(),t=[],e.forEach(function(a){var s=r.getAccount(a);!s||t.push(r.removeAccount(a))}),[4,Promise.all(t)];case 1:return i.sent(),[2,!0]}})})},n.prototype.removeAccount=function(e){return N(this,void 0,void 0,function(){var t;return T(this,function(r){switch(r.label){case 0:if(t=this.getAccount(e),!t)throw b.createNoAccountFoundError();return[4,this.removeAccountContext(t)];case 1:return[2,r.sent()&&this.removeItem(e,Me.ACCOUNT)]}})})},n.prototype.removeAccountContext=function(e){return N(this,void 0,void 0,function(){var t,r,i,a=this;return T(this,function(s){switch(s.label){case 0:return t=this.getKeys(),r=e.generateAccountId(),i=[],t.forEach(function(u){var d=et.getCredentialType(u);if(d!==E.NOT_DEFINED){var l=a.getSpecificCredential(u,d);!!l&&r===l.generateAccountId()&&i.push(a.removeCredential(l))}}),[4,Promise.all(i)];case 1:return s.sent(),[2,!0]}})})},n.prototype.removeCredential=function(e){return N(this,void 0,void 0,function(){var t,r,i;return T(this,function(a){switch(a.label){case 0:if(t=e.generateCredentialKey(),e.credentialType.toLowerCase()!==K.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())return[3,4];if(e.tokenType!==o.AuthenticationScheme.POP)return[3,4];if(r=e,i=r.keyId,!i)return[3,4];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.cryptoImpl.removeTokenBindingKey(i)];case 2:return a.sent(),[3,4];case 3:throw a.sent(),b.createBindingKeyNotRemovedError();case 4:return[2,this.removeItem(t,Me.CREDENTIAL)]}})})},n.prototype.removeAppMetadata=function(){var e=this,t=this.getKeys();return t.forEach(function(r){e.isAppMetadata(r)&&e.removeItem(r,Me.APP_METADATA)}),!0},n.prototype.readCacheRecord=function(e,t,r,i){var a=this.readAccountFromCache(e),s=this.readIdTokenFromCache(t,e),u=this.readAccessTokenFromCache(t,e,r),d=this.readRefreshTokenFromCache(t,e,!1),l=this.readAppMetadataFromCache(i,t);return a&&s&&(a.idTokenClaims=new Ne(s.secret,this.cryptoImpl).claims),{account:a,idToken:s,accessToken:u,refreshToken:d,appMetadata:l}},n.prototype.readAccountFromCache=function(e){var t=ae.generateAccountCacheKey(e);return this.getAccount(t)},n.prototype.readIdTokenFromCache=function(e,t){var r={homeAccountId:t.homeAccountId,environment:t.environment,credentialType:K.ID_TOKEN,clientId:e,realm:t.tenantId},i=this.getCredentialsFilteredBy(r),a=Object.keys(i.idTokens).map(function(u){return i.idTokens[u]}),s=a.length;if(s<1)return null;if(s>1)throw b.createMultipleMatchingTokensInCacheError();return a[0]},n.prototype.readAccessTokenFromCache=function(e,t,r){var i=new ge(r.scopes||[]),a=r.authenticationScheme||o.AuthenticationScheme.BEARER,s=a&&a.toLowerCase()!==o.AuthenticationScheme.BEARER.toLowerCase()?K.ACCESS_TOKEN_WITH_AUTH_SCHEME:K.ACCESS_TOKEN,u={homeAccountId:t.homeAccountId,environment:t.environment,credentialType:s,clientId:e,realm:t.tenantId,target:i.printScopesLowerCase(),tokenType:a,keyId:r.sshKid,requestedClaimsHash:r.requestedClaimsHash},d=this.getCredentialsFilteredBy(u),l=Object.keys(d.accessTokens).map(function(y){return d.accessTokens[y]}),f=l.length;if(f<1)return null;if(f>1)throw b.createMultipleMatchingTokensInCacheError();return l[0]},n.prototype.readRefreshTokenFromCache=function(e,t,r){var i=r?mt:void 0,a={homeAccountId:t.homeAccountId,environment:t.environment,credentialType:K.REFRESH_TOKEN,clientId:e,familyId:i},s=this.getCredentialsFilteredBy(a),u=Object.keys(s.refreshTokens).map(function(l){return s.refreshTokens[l]}),d=u.length;return d<1?null:u[0]},n.prototype.readAppMetadataFromCache=function(e,t){var r={environment:e,clientId:t},i=this.getAppMetadataFilteredBy(r),a=Object.keys(i).map(function(u){return i[u]}),s=a.length;if(s<1)return null;if(s>1)throw b.createMultipleMatchingAppMetadataInCacheError();return a[0]},n.prototype.isAppMetadataFOCI=function(e,t){var r=this.readAppMetadataFromCache(e,t);return!!(r&&r.familyId===mt)},n.prototype.matchHomeAccountId=function(e,t){return!!(e.homeAccountId&&t===e.homeAccountId)},n.prototype.matchOboAssertion=function(e,t){return!!(e.oboAssertion&&t===e.oboAssertion)},n.prototype.matchEnvironment=function(e,t){var r=this.getAuthorityMetadataByAlias(t);return!!(r&&r.aliases.indexOf(e.environment)>-1)},n.prototype.matchCredentialType=function(e,t){return e.credentialType&&t.toLowerCase()===e.credentialType.toLowerCase()},n.prototype.matchClientId=function(e,t){return!!(e.clientId&&t===e.clientId)},n.prototype.matchFamilyId=function(e,t){return!!(e.familyId&&t===e.familyId)},n.prototype.matchRealm=function(e,t){return!!(e.realm&&t===e.realm)},n.prototype.matchTarget=function(e,t){var r=e.credentialType!==K.ACCESS_TOKEN&&e.credentialType!==K.ACCESS_TOKEN_WITH_AUTH_SCHEME;if(r||!e.target)return!1;var i=ge.fromString(e.target),a=ge.fromString(t);return a.containsOnlyOIDCScopes()?a.removeScope(E.OFFLINE_ACCESS_SCOPE):a.removeOIDCScopes(),i.containsScopeSet(a)},n.prototype.matchTokenType=function(e,t){return!!(e.tokenType&&e.tokenType===t)},n.prototype.matchKeyId=function(e,t){return!!(e.keyId&&e.keyId===t)},n.prototype.isAppMetadata=function(e){return e.indexOf(zt)!==-1},n.prototype.isAuthorityMetadata=function(e){return e.indexOf($e.CACHE_KEY)!==-1},n.prototype.generateAuthorityMetadataCacheKey=function(e){return $e.CACHE_KEY+"-"+this.clientId+"-"+e},n.prototype.getSpecificCredential=function(e,t){switch(t){case K.ID_TOKEN:return this.getIdTokenCredential(e);case K.ACCESS_TOKEN:case K.ACCESS_TOKEN_WITH_AUTH_SCHEME:return this.getAccessTokenCredential(e);case K.REFRESH_TOKEN:return this.getRefreshTokenCredential(e);default:return null}},n.toObject=function(e,t){for(var r in t)e[r]=t[r];return e},n}(),ho=function(n){te(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.setAccount=function(){var t="Storage interface - setAccount() has not been implemented for the cacheStorage interface.";throw k.createUnexpectedError(t)},e.prototype.getAccount=function(){var t="Storage interface - getAccount() has not been implemented for the cacheStorage interface.";throw k.createUnexpectedError(t)},e.prototype.setIdTokenCredential=function(){var t="Storage interface - setIdTokenCredential() has not been implemented for the cacheStorage interface.";throw k.createUnexpectedError(t)},e.prototype.getIdTokenCredential=function(){var t="Storage interface - getIdTokenCredential() has not been implemented for the cacheStorage interface.";throw k.createUnexpectedError(t)},e.prototype.setAccessTokenCredential=function(){var t="Storage interface - setAccessTokenCredential() has not been implemented for the cacheStorage interface.";throw k.createUnexpectedError(t)},e.prototype.getAccessTokenCredential=function(){var t="Storage interface - getAccessTokenCredential() has not been implemented for the cacheStorage interface.";throw k.createUnexpectedError(t)},e.prototype.setRefreshTokenCredential=function(){var t="Storage interface - setRefreshTokenCredential() has not been implemented for the cacheStorage interface.";throw k.createUnexpectedError(t)},e.prototype.getRefreshTokenCredential=function(){var t="Storage interface - getRefreshTokenCredential() has not been implemented for the cacheStorage interface.";throw k.createUnexpectedError(t)},e.prototype.setAppMetadata=function(){var t="Storage interface - setAppMetadata() has not been implemented for the cacheStorage interface.";throw k.createUnexpectedError(t)},e.prototype.getAppMetadata=function(){var t="Storage interface - getAppMetadata() has not been implemented for the cacheStorage interface.";throw k.createUnexpectedError(t)},e.prototype.setServerTelemetry=function(){var t="Storage interface - setServerTelemetry() has not been implemented for the cacheStorage interface.";throw k.createUnexpectedError(t)},e.prototype.getServerTelemetry=function(){var t="Storage interface - getServerTelemetry() has not been implemented for the cacheStorage interface.";throw k.createUnexpectedError(t)},e.prototype.setAuthorityMetadata=function(){var t="Storage interface - setAuthorityMetadata() has not been implemented for the cacheStorage interface.";throw k.createUnexpectedError(t)},e.prototype.getAuthorityMetadata=function(){var t="Storage interface - getAuthorityMetadata() has not been implemented for the cacheStorage interface.";throw k.createUnexpectedError(t)},e.prototype.getAuthorityMetadataKeys=function(){var t="Storage interface - getAuthorityMetadataKeys() has not been implemented for the cacheStorage interface.";throw k.createUnexpectedError(t)},e.prototype.setThrottlingCache=function(){var t="Storage interface - setThrottlingCache() has not been implemented for the cacheStorage interface.";throw k.createUnexpectedError(t)},e.prototype.getThrottlingCache=function(){var t="Storage interface - getThrottlingCache() has not been implemented for the cacheStorage interface.";throw k.createUnexpectedError(t)},e.prototype.removeItem=function(){var t="Storage interface - removeItem() has not been implemented for the cacheStorage interface.";throw k.createUnexpectedError(t)},e.prototype.containsKey=function(){var t="Storage interface - containsKey() has not been implemented for the cacheStorage interface.";throw k.createUnexpectedError(t)},e.prototype.getKeys=function(){var t="Storage interface - getKeys() has not been implemented for the cacheStorage interface.";throw k.createUnexpectedError(t)},e.prototype.clear=function(){return N(this,void 0,void 0,function(){var t;return T(this,function(r){throw t="Storage interface - clear() has not been implemented for the cacheStorage interface.",k.createUnexpectedError(t)})})},e.prototype.updateCredentialCacheKey=function(){var t="Storage interface - updateCredentialCacheKey() has not been implemented for the cacheStorage interface.";throw k.createUnexpectedError(t)},e}(he);/*! @azure/msal-common v6.1.0 2022-02-08 */var po=300,Wr={tokenRenewalOffsetSeconds:po,preventCorsPreflight:!1,proxyUrl:""},fo={loggerCallback:function(){},piiLoggingEnabled:!1,logLevel:o.LogLevel.Info,correlationId:""},go={sendGetRequestAsync:function(){return N(this,void 0,void 0,function(){var n;return T(this,function(e){throw n="Network interface - sendGetRequestAsync() has not been implemented",k.createUnexpectedError(n)})})},sendPostRequestAsync:function(){return N(this,void 0,void 0,function(){var n;return T(this,function(e){throw n="Network interface - sendPostRequestAsync() has not been implemented",k.createUnexpectedError(n)})})}},mo={sku:E.SKU,version:zr,cpu:"",os:""},vo={clientSecret:"",clientAssertion:void 0},yo={azureCloudInstance:o.AzureCloudInstance.None,tenant:""+E.DEFAULT_COMMON_TENANT};function Eo(n){var e=n.authOptions,t=n.systemOptions,r=n.loggerOptions,i=n.storageInterface,a=n.networkInterface,s=n.cryptoInterface,u=n.clientCredentials,d=n.libraryInfo,l=n.serverTelemetryManager,f=n.persistencePlugin,y=n.serializableCache,w=Y(Y({},fo),r);return{authOptions:Co(e),systemOptions:Y(Y({},Wr),t),loggerOptions:w,storageInterface:i||new ho(e.clientId,yt),networkInterface:a||go,cryptoInterface:s||yt,clientCredentials:u||vo,libraryInfo:Y(Y({},mo),d),serverTelemetryManager:l||null,persistencePlugin:f||null,serializableCache:y||null}}function Co(n){return Y({clientCapabilities:[],azureCloudOptions:yo},n)}/*! @azure/msal-common v6.1.0 2022-02-08 */var je=function(n){te(e,n);function e(t,r,i){var a=n.call(this,t,r,i)||this;return a.name="ServerError",Object.setPrototypeOf(a,e.prototype),a}return e}(k);/*! @azure/msal-common v6.1.0 2022-02-08 */var It=function(){function n(){}return n.generateThrottlingStorageKey=function(e){return Ze.THROTTLING_PREFIX+"."+JSON.stringify(e)},n.preProcess=function(e,t){var r,i=n.generateThrottlingStorageKey(t),a=e.getThrottlingCache(i);if(a){if(a.throttleTime<Date.now()){e.removeItem(i,Me.THROTTLING);return}throw new je(((r=a.errorCodes)===null||r===void 0?void 0:r.join(" "))||E.EMPTY_STRING,a.errorMessage,a.subError)}},n.postProcess=function(e,t,r){if(n.checkResponseStatus(r)||n.checkResponseForRetryAfter(r)){var i={throttleTime:n.calculateThrottleTime(parseInt(r.headers[H.RETRY_AFTER])),error:r.body.error,errorCodes:r.body.error_codes,errorMessage:r.body.error_description,subError:r.body.suberror};e.setThrottlingCache(n.generateThrottlingStorageKey(t),i)}},n.checkResponseStatus=function(e){return e.status===429||e.status>=500&&e.status<600},n.checkResponseForRetryAfter=function(e){return e.headers?e.headers.hasOwnProperty(H.RETRY_AFTER)&&(e.status<200||e.status>=300):!1},n.calculateThrottleTime=function(e){var t=e<=0?0:e,r=Date.now()/1e3;return Math.floor(Math.min(r+(t||Ze.DEFAULT_THROTTLE_TIME_SECONDS),r+Ze.DEFAULT_MAX_THROTTLE_TIME_SECONDS)*1e3)},n.removeThrottle=function(e,t,r,i){var a={clientId:t,authority:r.authority,scopes:r.scopes,homeAccountIdentifier:i,claims:r.claims,authenticationScheme:r.authenticationScheme,resourceRequestMethod:r.resourceRequestMethod,resourceRequestUri:r.resourceRequestUri,shrClaims:r.shrClaims,sshKid:r.sshKid},s=this.generateThrottlingStorageKey(a);return e.removeItem(s,Me.THROTTLING)},n}();/*! @azure/msal-common v6.1.0 2022-02-08 */var Io=function(){function n(e,t){this.networkClient=e,this.cacheManager=t}return n.prototype.sendPostRequest=function(e,t,r){return N(this,void 0,void 0,function(){var i,a;return T(this,function(s){switch(s.label){case 0:It.preProcess(this.cacheManager,e),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.networkClient.sendPostRequestAsync(t,r)];case 2:return i=s.sent(),[3,4];case 3:throw a=s.sent(),a instanceof k?a:b.createNetworkError(t,a);case 4:return It.postProcess(this.cacheManager,e,i),[2,i]}})})},n}();/*! @azure/msal-common v6.1.0 2022-02-08 */var ue;(function(n){n.HOME_ACCOUNT_ID="home_account_id",n.UPN="UPN"})(ue||(ue={}));/*! @azure/msal-common v6.1.0 2022-02-08 */var jt=function(){function n(e){this.config=Eo(e),this.logger=new Et(this.config.loggerOptions,lo,zr),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.networkManager=new Io(this.networkClient,this.cacheManager),this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority}return n.prototype.createTokenRequestHeaders=function(e){var t={};if(t[H.CONTENT_TYPE]=E.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case ue.HOME_ACCOUNT_ID:try{var r=tt(e.credential);t[H.CCS_HEADER]="Oid:"+r.uid+"@"+r.utid}catch(i){this.logger.verbose("Could not parse home account ID for CCS Header: "+i)}break;case ue.UPN:t[H.CCS_HEADER]="UPN: "+e.credential;break}return t},n.prototype.executePostToTokenEndpoint=function(e,t,r,i){return N(this,void 0,void 0,function(){var a;return T(this,function(s){switch(s.label){case 0:return[4,this.networkManager.sendPostRequest(i,e,{body:t,headers:r,proxyUrl:this.config.systemOptions.proxyUrl})];case 1:return a=s.sent(),this.config.serverTelemetryManager&&a.status<500&&a.status!==429&&this.config.serverTelemetryManager.clearTelemetryCache(),[2,a]}})})},n.prototype.updateAuthority=function(e){if(!e.discoveryComplete())throw b.createEndpointDiscoveryIncompleteError("Updated authority has not completed endpoint discovery.");this.authority=e},n}();/*! @azure/msal-common v6.1.0 2022-02-08 */var He=function(){function n(){}return n.validateRedirectUri=function(e){if(_.isEmpty(e))throw W.createRedirectUriEmptyError()},n.validatePrompt=function(e){var t=[];for(var r in oe)t.push(oe[r]);if(t.indexOf(e)<0)throw W.createInvalidPromptError(e)},n.validateClaims=function(e){try{JSON.parse(e)}catch(t){throw W.createInvalidClaimsRequestError()}},n.validateCodeChallengeParams=function(e,t){if(_.isEmpty(e)||_.isEmpty(t))throw W.createInvalidCodeChallengeParamsError();this.validateCodeChallengeMethod(t)},n.validateCodeChallengeMethod=function(e){if([ze.PLAIN,ze.S256].indexOf(e)<0)throw W.createInvalidCodeChallengeMethodError()},n.sanitizeEQParams=function(e,t){return e?(t.forEach(function(r,i){e[i]&&delete e[i]}),e):{}},n}();/*! @azure/msal-common v6.1.0 2022-02-08 */var Ve=function(){function n(){this.parameters=new Map}return n.prototype.addResponseTypeCode=function(){this.parameters.set(O.RESPONSE_TYPE,encodeURIComponent(E.CODE_RESPONSE_TYPE))},n.prototype.addResponseMode=function(e){this.parameters.set(O.RESPONSE_MODE,encodeURIComponent(e||ft.QUERY))},n.prototype.addScopes=function(e,t){t===void 0&&(t=!0);var r=t?B(e||[],we):e||[],i=new ge(r);this.parameters.set(O.SCOPE,encodeURIComponent(i.printScopes()))},n.prototype.addClientId=function(e){this.parameters.set(O.CLIENT_ID,encodeURIComponent(e))},n.prototype.addRedirectUri=function(e){He.validateRedirectUri(e),this.parameters.set(O.REDIRECT_URI,encodeURIComponent(e))},n.prototype.addPostLogoutRedirectUri=function(e){He.validateRedirectUri(e),this.parameters.set(O.POST_LOGOUT_URI,encodeURIComponent(e))},n.prototype.addIdTokenHint=function(e){this.parameters.set(O.ID_TOKEN_HINT,encodeURIComponent(e))},n.prototype.addDomainHint=function(e){this.parameters.set(be.DOMAIN_HINT,encodeURIComponent(e))},n.prototype.addLoginHint=function(e){this.parameters.set(be.LOGIN_HINT,encodeURIComponent(e))},n.prototype.addCcsUpn=function(e){this.parameters.set(H.CCS_HEADER,encodeURIComponent("UPN:"+e))},n.prototype.addCcsOid=function(e){this.parameters.set(H.CCS_HEADER,encodeURIComponent("Oid:"+e.uid+"@"+e.utid))},n.prototype.addSid=function(e){this.parameters.set(be.SID,encodeURIComponent(e))},n.prototype.addClaims=function(e,t){var r=this.addClientCapabilitiesToClaims(e,t);He.validateClaims(r),this.parameters.set(O.CLAIMS,encodeURIComponent(r))},n.prototype.addCorrelationId=function(e){this.parameters.set(O.CLIENT_REQUEST_ID,encodeURIComponent(e))},n.prototype.addLibraryInfo=function(e){this.parameters.set(O.X_CLIENT_SKU,e.sku),this.parameters.set(O.X_CLIENT_VER,e.version),this.parameters.set(O.X_CLIENT_OS,e.os),this.parameters.set(O.X_CLIENT_CPU,e.cpu)},n.prototype.addPrompt=function(e){He.validatePrompt(e),this.parameters.set(""+O.PROMPT,encodeURIComponent(e))},n.prototype.addState=function(e){_.isEmpty(e)||this.parameters.set(O.STATE,encodeURIComponent(e))},n.prototype.addNonce=function(e){this.parameters.set(O.NONCE,encodeURIComponent(e))},n.prototype.addCodeChallengeParams=function(e,t){if(He.validateCodeChallengeParams(e,t),e&&t)this.parameters.set(O.CODE_CHALLENGE,encodeURIComponent(e)),this.parameters.set(O.CODE_CHALLENGE_METHOD,encodeURIComponent(t));else throw W.createInvalidCodeChallengeParamsError()},n.prototype.addAuthorizationCode=function(e){if(C)C.authCode=e;this.parameters.set(O.CODE,encodeURIComponent(e))},n.prototype.addDeviceCode=function(e){this.parameters.set(O.DEVICE_CODE,encodeURIComponent(e))},n.prototype.addRefreshToken=function(e){this.parameters.set(O.REFRESH_TOKEN,encodeURIComponent(e))},n.prototype.addCodeVerifier=function(e){this.parameters.set(O.CODE_VERIFIER,encodeURIComponent(e))},n.prototype.addClientSecret=function(e){this.parameters.set(O.CLIENT_SECRET,encodeURIComponent(e))},n.prototype.addClientAssertion=function(e){this.parameters.set(O.CLIENT_ASSERTION,encodeURIComponent(e))},n.prototype.addClientAssertionType=function(e){this.parameters.set(O.CLIENT_ASSERTION_TYPE,encodeURIComponent(e))},n.prototype.addOboAssertion=function(e){this.parameters.set(O.OBO_ASSERTION,encodeURIComponent(e))},n.prototype.addRequestTokenUse=function(e){this.parameters.set(O.REQUESTED_TOKEN_USE,encodeURIComponent(e))},n.prototype.addGrantType=function(e){this.parameters.set(O.GRANT_TYPE,encodeURIComponent(e))},n.prototype.addClientInfo=function(){this.parameters.set(uo,"1")},n.prototype.addExtraQueryParameters=function(e){var t=this;He.sanitizeEQParams(e,this.parameters),Object.keys(e).forEach(function(r){t.parameters.set(r,e[r])})},n.prototype.addClientCapabilitiesToClaims=function(e,t){var r;if(!e)r={};else try{r=JSON.parse(e)}catch(i){throw W.createInvalidClaimsRequestError()}return t&&t.length>0&&(r.hasOwnProperty(x.ACCESS_TOKEN)||(r[x.ACCESS_TOKEN]={}),r[x.ACCESS_TOKEN][x.XMS_CC]={values:t}),JSON.stringify(r)},n.prototype.addUsername=function(e){this.parameters.set(vt.username,e)},n.prototype.addPassword=function(e){this.parameters.set(vt.password,e)},n.prototype.addPopToken=function(e){_.isEmpty(e)||(this.parameters.set(O.TOKEN_TYPE,o.AuthenticationScheme.POP),this.parameters.set(O.REQ_CNF,encodeURIComponent(e)))},n.prototype.addSshJwk=function(e){_.isEmpty(e)||(this.parameters.set(O.TOKEN_TYPE,o.AuthenticationScheme.SSH),this.parameters.set(O.REQ_CNF,encodeURIComponent(e)))},n.prototype.addServerTelemetry=function(e){this.parameters.set(O.X_CLIENT_CURR_TELEM,e.generateCurrentRequestHeaderValue()),this.parameters.set(O.X_CLIENT_LAST_TELEM,e.generateLastRequestHeaderValue())},n.prototype.addThrottling=function(){this.parameters.set(O.X_MS_LIB_CAPABILITY,Ze.X_MS_LIB_CAPABILITY_VALUE)},n.prototype.addLogoutHint=function(e){this.parameters.set(O.LOGOUT_HINT,encodeURIComponent(e))},n.prototype.createQueryString=function(){var e=new Array;return this.parameters.forEach(function(t,r){e.push(r+"="+t)}),e.join("&")},n}();/*! @azure/msal-common v6.1.0 2022-02-08 */var wt=function(n){te(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.createIdTokenEntity=function(t,r,i,a,s,u){var d=new e;return d.credentialType=K.ID_TOKEN,d.homeAccountId=t,d.environment=r,d.clientId=a,d.secret=i,d.realm=s,d.oboAssertion=u,d},e.isIdTokenEntity=function(t){return t?t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("realm")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")&&t.credentialType===K.ID_TOKEN:!1},e}(et);/*! @azure/msal-common v6.1.0 2022-02-08 */var me=function(){function n(){}return n.nowSeconds=function(){return Math.round(new Date().getTime()/1e3)},n.isTokenExpired=function(e,t){var r=Number(e)||0,i=n.nowSeconds()+t;return i>r},n.wasClockTurnedBack=function(e){var t=Number(e);return t>n.nowSeconds()},n.delay=function(e,t){return new Promise(function(r){return setTimeout(function(){return r(t)},e)})},n}();/*! @azure/msal-common v6.1.0 2022-02-08 */var Tt=function(n){te(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.createAccessTokenEntity=function(t,r,i,a,s,u,d,l,f,y,w,U,P,F,z){var D,Q,V=new e;V.homeAccountId=t,V.credentialType=K.ACCESS_TOKEN,V.secret=i;var _e=me.nowSeconds();if(V.cachedAt=_e.toString(),V.expiresOn=d.toString(),V.extendedExpiresOn=l.toString(),y&&(V.refreshOn=y.toString()),V.environment=r,V.clientId=a,V.realm=s,V.target=u,V.oboAssertion=U,V.tokenType=_.isEmpty(w)?o.AuthenticationScheme.BEARER:w,F&&(V.requestedClaims=F,V.requestedClaimsHash=z),((D=V.tokenType)===null||D===void 0?void 0:D.toLowerCase())!==o.AuthenticationScheme.BEARER.toLowerCase())switch(V.credentialType=K.ACCESS_TOKEN_WITH_AUTH_SCHEME,V.tokenType){case o.AuthenticationScheme.POP:var Nt=Ne.extractTokenClaims(i,f);if(!(!((Q=Nt==null?void 0:Nt.cnf)===null||Q===void 0)&&Q.kid))throw b.createTokenClaimsRequiredError();V.keyId=Nt.cnf.kid;break;case o.AuthenticationScheme.SSH:V.keyId=P}return V},e.isAccessTokenEntity=function(t){return t?t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("realm")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")&&t.hasOwnProperty("target")&&(t.credentialType===K.ACCESS_TOKEN||t.credentialType===K.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1},e}(et);/*! @azure/msal-common v6.1.0 2022-02-08 */var Vt=function(n){te(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.createRefreshTokenEntity=function(t,r,i,a,s,u){var d=new e;return d.clientId=a,d.credentialType=K.REFRESH_TOKEN,d.environment=r,d.homeAccountId=t,d.secret=i,d.oboAssertion=u,s&&(d.familyId=s),d},e.isRefreshTokenEntity=function(t){return t?t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")&&t.credentialType===K.REFRESH_TOKEN:!1},e}(et);/*! @azure/msal-common v6.1.0 2022-02-08 */var jr=["interaction_required","consent_required","login_required"],wo=["message_only","additional_action","basic_action","user_password_expired","consent_required"],St={noTokensFoundError:{code:"no_tokens_found",desc:"No refresh token found in the cache. Please sign-in."}},ke=function(n){te(e,n);function e(t,r,i){var a=n.call(this,t,r,i)||this;return a.name="InteractionRequiredAuthError",Object.setPrototypeOf(a,e.prototype),a}return e.isInteractionRequiredError=function(t,r,i){var a=!!t&&jr.indexOf(t)>-1,s=!!i&&wo.indexOf(i)>-1,u=!!r&&jr.some(function(d){return r.indexOf(d)>-1});return a||u||s},e.createNoTokensFoundError=function(){return new e(St.noTokensFoundError.code,St.noTokensFoundError.desc)},e}(k);/*! @azure/msal-common v6.1.0 2022-02-08 */var To=function(){function n(e,t,r,i,a){this.account=e||null,this.idToken=t||null,this.accessToken=r||null,this.refreshToken=i||null,this.appMetadata=a||null}return n}();/*! @azure/msal-common v6.1.0 2022-02-08 */var Ye=function(){function n(){}return n.setRequestState=function(e,t,r){var i=n.generateLibraryState(e,r);return _.isEmpty(t)?i:""+i+E.RESOURCE_DELIM+t},n.generateLibraryState=function(e,t){if(!e)throw b.createNoCryptoObjectError("generateLibraryState");var r={id:e.createNewGuid()};t&&(r.meta=t);var i=JSON.stringify(r);return e.base64Encode(i)},n.parseRequestState=function(e,t){if(!e)throw b.createNoCryptoObjectError("parseRequestState");if(_.isEmpty(t))throw b.createInvalidStateError(t,"Null, undefined or empty state");try{var r=t.split(E.RESOURCE_DELIM),i=r[0],a=r.length>1?r.slice(1).join(E.RESOURCE_DELIM):"",s=e.base64Decode(i),u=JSON.parse(s);return{userRequestState:_.isEmpty(a)?"":a,libraryState:u}}catch(d){throw b.createInvalidStateError(t,d)}},n}();/*! @azure/msal-common v6.1.0 2022-02-08 */var j=function(){function n(e){if(this._urlString=e,_.isEmpty(this._urlString))throw W.createUrlEmptyError();_.isEmpty(this.getHash())&&(this._urlString=n.canonicalizeUri(e))}return Object.defineProperty(n.prototype,"urlString",{get:function(){return this._urlString},enumerable:!1,configurable:!0}),n.canonicalizeUri=function(e){if(e){var t=e.toLowerCase();return _.endsWith(t,"?")?t=t.slice(0,-1):_.endsWith(t,"?/")&&(t=t.slice(0,-2)),_.endsWith(t,"/")||(t+="/"),t}return e},n.prototype.validateAsUri=function(){var e;try{e=this.getUrlComponents()}catch(t){throw W.createUrlParseError(t)}if(!e.HostNameAndPort||!e.PathSegments)throw W.createUrlParseError("Given url string: "+this.urlString);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw W.createInsecureAuthorityUriError(this.urlString)},n.appendQueryString=function(e,t){return _.isEmpty(t)?e:e.indexOf("?")<0?e+"?"+t:e+"&"+t},n.removeHashFromUrl=function(e){return n.canonicalizeUri(e.split("#")[0])},n.prototype.replaceTenantPath=function(e){var t=this.getUrlComponents(),r=t.PathSegments;return e&&r.length!==0&&(r[0]===$.COMMON||r[0]===$.ORGANIZATIONS)&&(r[0]=e),n.constructAuthorityUriFromObject(t)},n.prototype.getHash=function(){return n.parseHash(this.urlString)},n.prototype.getUrlComponents=function(){var e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),t=this.urlString.match(e);if(!t)throw W.createUrlParseError("Given url string: "+this.urlString);var r={Protocol:t[1],HostNameAndPort:t[4],AbsolutePath:t[5],QueryString:t[7]},i=r.AbsolutePath.split("/");return i=i.filter(function(a){return a&&a.length>0}),r.PathSegments=i,!_.isEmpty(r.QueryString)&&r.QueryString.endsWith("/")&&(r.QueryString=r.QueryString.substring(0,r.QueryString.length-1)),r},n.getDomainFromUrl=function(e){var t=RegExp("^([^:/?#]+://)?([^/?#]*)"),r=e.match(t);if(!r)throw W.createUrlParseError("Given url string: "+e);return r[2]},n.getAbsoluteUrl=function(e,t){if(e[0]===E.FORWARD_SLASH){var r=new n(t),i=r.getUrlComponents();return i.Protocol+"//"+i.HostNameAndPort+e}return e},n.parseHash=function(e){var t=e.indexOf("#"),r=e.indexOf("#/");return r>-1?e.substring(r+2):t>-1?e.substring(t+1):""},n.constructAuthorityUriFromObject=function(e){return new n(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))},n.getDeserializedHash=function(e){if(_.isEmpty(e))return{};var t=n.parseHash(e),r=_.queryStringToObject(_.isEmpty(t)?e:t);if(!r)throw b.createHashNotDeserializedError(JSON.stringify(r));return r},n.hashContainsKnownProperties=function(e){if(_.isEmpty(e)||e.indexOf("=")<0)return!1;var t=n.getDeserializedHash(e);return!!(t.code||t.error_description||t.error||t.state)},n}();/*! @azure/msal-common v6.1.0 2022-02-08 */var Yt;(function(n){n.SW="sw",n.UHW="uhw"})(Yt||(Yt={}));var _t=function(){function n(e){this.cryptoUtils=e}return n.prototype.generateCnf=function(e){return N(this,void 0,void 0,function(){var t;return T(this,function(r){switch(r.label){case 0:return[4,this.generateKid(e)];case 1:return t=r.sent(),[2,this.cryptoUtils.base64Encode(JSON.stringify(t))]}})})},n.prototype.generateKid=function(e){return N(this,void 0,void 0,function(){var t;return T(this,function(r){switch(r.label){case 0:return[4,this.cryptoUtils.getPublicKeyThumbprint(e)];case 1:return t=r.sent(),[2,{kid:t,xms_ksl:Yt.SW}]}})})},n.prototype.signPopToken=function(e,t){var r;return N(this,void 0,void 0,function(){var i;return T(this,function(a){if(i=Ne.extractTokenClaims(e,this.cryptoUtils),!(!((r=i==null?void 0:i.cnf)===null||r===void 0)&&r.kid))throw b.createTokenClaimsRequiredError();return[2,this.signPayload(e,i.cnf.kid,t)]})})},n.prototype.signPayload=function(e,t,r,i){return N(this,void 0,void 0,function(){var a,s,u,d,l,f;return T(this,function(y){switch(y.label){case 0:return a=r.resourceRequestMethod,s=r.resourceRequestUri,u=r.shrClaims,d=r.shrNonce,l=s?new j(s):void 0,f=l==null?void 0:l.getUrlComponents(),[4,this.cryptoUtils.signJwt(Y({at:e,ts:me.nowSeconds(),m:a==null?void 0:a.toUpperCase(),u:f==null?void 0:f.HostNameAndPort,nonce:d||this.cryptoUtils.createNewGuid(),p:f==null?void 0:f.AbsolutePath,q:f!=null&&f.QueryString?[[],f.QueryString]:void 0,client_claims:u||void 0},i),t)];case 1:return[2,y.sent()]}})})},n}();/*! @azure/msal-common v6.1.0 2022-02-08 */var xt=function(){function n(){}return n.prototype.generateAppMetadataKey=function(){return n.generateAppMetadataCacheKey(this.environment,this.clientId)},n.generateAppMetadataCacheKey=function(e,t){var r=[zt,e,t];return r.join(ce.CACHE_KEY_SEPARATOR).toLowerCase()},n.createAppMetadataEntity=function(e,t,r){var i=new n;return i.clientId=e,i.environment=t,r&&(i.familyId=r),i},n.isAppMetadataEntity=function(e,t){return t?e.indexOf(zt)===0&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("environment"):!1},n}();/*! @azure/msal-common v6.1.0 2022-02-08 */var So=function(){function n(e,t){this.cache=e,this.hasChanged=t}return Object.defineProperty(n.prototype,"cacheHasChanged",{get:function(){return this.hasChanged},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"tokenCache",{get:function(){return this.cache},enumerable:!1,configurable:!0}),n}();/*! @azure/msal-common v6.1.0 2022-02-08 */var At=function(){function n(e,t,r,i,a,s){this.clientId=e,this.cacheStorage=t,this.cryptoObj=r,this.logger=i,this.serializableCache=a,this.persistencePlugin=s}return n.prototype.validateServerAuthorizationCodeResponse=function(e,t,r){if(!e.state||!t)throw e.state?b.createStateNotFoundError("Cached State"):b.createStateNotFoundError("Server State");if(decodeURIComponent(e.state)!==decodeURIComponent(t))throw b.createStateMismatchError();if(e.error||e.error_description||e.suberror)throw ke.isInteractionRequiredError(e.error,e.error_description,e.suberror)?new ke(e.error||E.EMPTY_STRING,e.error_description,e.suberror):new je(e.error||E.EMPTY_STRING,e.error_description,e.suberror);e.client_info&&Ct(e.client_info,r)},n.prototype.validateTokenResponse=function(e){if(e.error||e.error_description||e.suberror){if(ke.isInteractionRequiredError(e.error,e.error_description,e.suberror))throw new ke(e.error,e.error_description,e.suberror);var t=e.error_codes+" - ["+e.timestamp+"]: "+e.error_description+" - Correlation ID: "+e.correlation_id+" - Trace ID: "+e.trace_id;throw new je(e.error,t,e.suberror)}},n.prototype.handleServerTokenResponse=function(e,t,r,i,a,s,u){return N(this,void 0,void 0,function(){var d,l,f,y,w,U;return T(this,function(P){switch(P.label){case 0:if(e.id_token&&(d=new Ne(e.id_token||E.EMPTY_STRING,this.cryptoObj),a&&!_.isEmpty(a.nonce)&&d.claims.nonce!==a.nonce))throw b.createNonceMismatchError();this.homeAccountIdentifier=ae.generateHomeAccountId(e.client_info||E.EMPTY_STRING,t.authorityType,this.logger,this.cryptoObj,d),!!a&&!!a.state&&(l=Ye.parseRequestState(this.cryptoObj,a.state)),e.key_id=e.key_id||i.sshKid||void 0,f=this.generateCacheRecord(e,t,r,i,d,s,a),P.label=1;case 1:return P.trys.push([1,,5,8]),this.persistencePlugin&&this.serializableCache?(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),y=new So(this.serializableCache,!0),[4,this.persistencePlugin.beforeCacheAccess(y)]):[3,3];case 2:P.sent(),P.label=3;case 3:return u&&f.account&&(w=f.account.generateAccountKey(),U=this.cacheStorage.getAccount(w),!U)?(this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),[2,n.generateAuthenticationResult(this.cryptoObj,t,f,!1,i,d,l)]):[4,this.cacheStorage.saveCacheRecord(f)];case 4:return P.sent(),[3,8];case 5:return this.persistencePlugin&&this.serializableCache&&y?(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),[4,this.persistencePlugin.afterCacheAccess(y)]):[3,7];case 6:P.sent(),P.label=7;case 7:return[7];case 8:return[2,n.generateAuthenticationResult(this.cryptoObj,t,f,!1,i,d,l,e.spa_code)]}})})},n.prototype.generateCacheRecord=function(e,t,r,i,a,s,u){var d=t.getPreferredCache();if(_.isEmpty(d))throw b.createInvalidCacheEnvironmentError();var l,f;!_.isEmpty(e.id_token)&&!!a&&(l=wt.createIdTokenEntity(this.homeAccountIdentifier,d,e.id_token||E.EMPTY_STRING,this.clientId,a.claims.tid||E.EMPTY_STRING,s),f=this.generateAccountEntity(e,a,t,s,u));var y=null;if(!_.isEmpty(e.access_token)){var w=e.scope?ge.fromString(e.scope):new ge(i.scopes||[]),U=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,P=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,F=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,z=r+U,D=z+P,Q=F&&F>0?r+F:void 0;y=Tt.createAccessTokenEntity(this.homeAccountIdentifier,d,e.access_token||E.EMPTY_STRING,this.clientId,a?a.claims.tid||E.EMPTY_STRING:t.tenant,w.printScopes(),z,D,this.cryptoObj,Q,e.token_type,s,e.key_id,i.claims,i.requestedClaimsHash)}var V=null;_.isEmpty(e.refresh_token)||(V=Vt.createRefreshTokenEntity(this.homeAccountIdentifier,d,e.refresh_token||E.EMPTY_STRING,this.clientId,e.foci,s));var _e=null;return _.isEmpty(e.foci)||(_e=xt.createAppMetadataEntity(this.clientId,d,e.foci)),new To(f,l,y,V,_e)},n.prototype.generateAccountEntity=function(e,t,r,i,a){var s=r.authorityType,u=a?a.cloud_graph_host_name:"",d=a?a.msgraph_host:"";if(s===Pe.Adfs)return this.logger.verbose("Authority type is ADFS, creating ADFS account"),ae.createGenericAccount(this.homeAccountIdentifier,t,r,i,u,d);if(_.isEmpty(e.client_info)&&r.protocolMode==="AAD")throw b.createClientInfoEmptyError();return e.client_info?ae.createAccount(e.client_info,this.homeAccountIdentifier,t,r,i,u,d):ae.createGenericAccount(this.homeAccountIdentifier,t,r,i,u,d)},n.generateAuthenticationResult=function(e,t,r,i,a,s,u,d){var l,f,y;return N(this,void 0,void 0,function(){var w,U,P,F,z,D,Q,V;return T(this,function(_e){switch(_e.label){case 0:return w="",U=[],P=null,z=E.EMPTY_STRING,r.accessToken?r.accessToken.tokenType!==o.AuthenticationScheme.POP?[3,2]:(D=new _t(e),[4,D.signPopToken(r.accessToken.secret,a)]):[3,4];case 1:return w=_e.sent(),[3,3];case 2:w=r.accessToken.secret,_e.label=3;case 3:U=ge.fromString(r.accessToken.target).asArray(),P=new Date(Number(r.accessToken.expiresOn)*1e3),F=new Date(Number(r.accessToken.extendedExpiresOn)*1e3),_e.label=4;case 4:return r.appMetadata&&(z=r.appMetadata.familyId===mt?mt:E.EMPTY_STRING),Q=(s==null?void 0:s.claims.oid)||(s==null?void 0:s.claims.sub)||E.EMPTY_STRING,V=(s==null?void 0:s.claims.tid)||E.EMPTY_STRING,[2,{authority:t.canonicalAuthority,uniqueId:Q,tenantId:V,scopes:U,account:r.account?r.account.getAccountInfo():null,idToken:s?s.rawToken:E.EMPTY_STRING,idTokenClaims:s?s.claims:{},accessToken:w,fromCache:i,expiresOn:P,correlationId:a.correlationId,extExpiresOn:F,familyId:z,tokenType:((l=r.accessToken)===null||l===void 0?void 0:l.tokenType)||E.EMPTY_STRING,state:u?u.userRequestState:E.EMPTY_STRING,cloudGraphHostName:((f=r.account)===null||f===void 0?void 0:f.cloudGraphHostName)||E.EMPTY_STRING,msGraphHost:((y=r.account)===null||y===void 0?void 0:y.msGraphHost)||E.EMPTY_STRING,code:d}]}})})},n}();/*! @azure/msal-common v6.1.0 2022-02-08 */var Vr=function(n){te(e,n);function e(t){var r=n.call(this,t)||this;return r.includeRedirectUri=!0,r}return e.prototype.getAuthCodeUrl=function(t){return N(this,void 0,void 0,function(){var r;return T(this,function(i){return r=this.createAuthCodeUrlQueryString(t),[2,j.appendQueryString(this.authority.authorizationEndpoint,r)]})})},e.prototype.acquireToken=function(t,r){return N(this,void 0,void 0,function(){var i,a,s;return T(this,function(u){switch(u.label){case 0:if(this.logger.info("in acquireToken call"),!t||_.isEmpty(t.code))throw b.createTokenRequestCannotBeMadeError();return i=me.nowSeconds(),[4,this.executeTokenRequest(this.authority,t)];case 1:return a=u.sent(),s=new At(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin),s.validateTokenResponse(a.body),[4,s.handleServerTokenResponse(a.body,this.authority,i,t,r)];case 2:return[2,u.sent()]}})})},e.prototype.handleFragmentResponse=function(t,r){var i=new At(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null),a=new j(t),s=j.getDeserializedHash(a.getHash());if(i.validateServerAuthorizationCodeResponse(s,r,this.cryptoUtils),!s.code)throw b.createNoAuthCodeInServerResponseError();return Y(Y({},s),{code:s.code})},e.prototype.getLogoutUri=function(t){if(!t)throw W.createEmptyLogoutRequestError();var r=this.createLogoutUrlQueryString(t);return j.appendQueryString(this.authority.endSessionEndpoint,r)},e.prototype.executeTokenRequest=function(t,r){return N(this,void 0,void 0,function(){var i,a,s,u,d,l,f;return T(this,function(y){switch(y.label){case 0:return i={clientId:this.config.authOptions.clientId,authority:t.canonicalAuthority,scopes:r.scopes,claims:r.claims,authenticationScheme:r.authenticationScheme,resourceRequestMethod:r.resourceRequestMethod,resourceRequestUri:r.resourceRequestUri,shrClaims:r.shrClaims,sshKid:r.sshKid},[4,this.createTokenRequestBody(r)];case 1:if(a=y.sent(),s=this.createTokenQueryParameters(r),u=void 0,r.clientInfo)try{d=Ct(r.clientInfo,this.cryptoUtils),u={credential:""+d.uid+ce.CLIENT_INFO_SEPARATOR+d.utid,type:ue.HOME_ACCOUNT_ID}}catch(w){this.logger.verbose("Could not parse client info for CCS Header: "+w)}return l=this.createTokenRequestHeaders(u||r.ccsCredential),f=_.isEmpty(s)?t.tokenEndpoint:t.tokenEndpoint+"?"+s,[2,this.executePostToTokenEndpoint(f,a,l,i)]}})})},e.prototype.createTokenQueryParameters=function(t){var r=new Ve;return t.tokenQueryParameters&&r.addExtraQueryParameters(t.tokenQueryParameters),r.createQueryString()},e.prototype.createTokenRequestBody=function(t){return N(this,void 0,void 0,function(){var r,i,a,s,u,d,l,l,f;return T(this,function(y){switch(y.label){case 0:return r=new Ve,r.addClientId(this.config.authOptions.clientId),this.includeRedirectUri?r.addRedirectUri(t.redirectUri):He.validateRedirectUri(t.redirectUri),r.addScopes(t.scopes),r.addAuthorizationCode(t.code),r.addLibraryInfo(this.config.libraryInfo),r.addThrottling(),this.serverTelemetryManager&&r.addServerTelemetry(this.serverTelemetryManager),t.codeVerifier&&r.addCodeVerifier(t.codeVerifier),this.config.clientCredentials.clientSecret&&r.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion&&(i=this.config.clientCredentials.clientAssertion,r.addClientAssertion(i.assertion),r.addClientAssertionType(i.assertionType)),r.addGrantType(gt.AUTHORIZATION_CODE_GRANT),r.addClientInfo(),t.authenticationScheme!==o.AuthenticationScheme.POP?[3,2]:(a=new _t(this.cryptoUtils),[4,a.generateCnf(t)]);case 1:return s=y.sent(),r.addPopToken(s),[3,3];case 2:if(t.authenticationScheme===o.AuthenticationScheme.SSH)if(t.sshJwk)r.addSshJwk(t.sshJwk);else throw W.createMissingSshJwkError();y.label=3;case 3:if(u=t.correlationId||this.config.cryptoInterface.createNewGuid(),r.addCorrelationId(u),(!_.isEmptyObj(t.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(t.claims,this.config.authOptions.clientCapabilities),d=void 0,t.clientInfo)try{l=Ct(t.clientInfo,this.cryptoUtils),d={credential:""+l.uid+ce.CLIENT_INFO_SEPARATOR+l.utid,type:ue.HOME_ACCOUNT_ID}}catch(w){this.logger.verbose("Could not parse client info for CCS Header: "+w)}else d=t.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&d)switch(d.type){case ue.HOME_ACCOUNT_ID:try{l=tt(d.credential),r.addCcsOid(l)}catch(w){this.logger.verbose("Could not parse home account ID for CCS Header: "+w)}break;case ue.UPN:r.addCcsUpn(d.credential);break}return t.tokenBodyParameters&&r.addExtraQueryParameters(t.tokenBodyParameters),t.enableSpaAuthorizationCode&&(!t.tokenBodyParameters||!t.tokenBodyParameters[O.RETURN_SPA_CODE])&&r.addExtraQueryParameters((f={},f[O.RETURN_SPA_CODE]="1",f)),[2,r.createQueryString()]}})})},e.prototype.createAuthCodeUrlQueryString=function(t){var r=new Ve;r.addClientId(this.config.authOptions.clientId);var i=B(t.scopes||[],t.extraScopesToConsent||[]);r.addScopes(i),r.addRedirectUri(t.redirectUri);var a=t.correlationId||this.config.cryptoInterface.createNewGuid();if(r.addCorrelationId(a),r.addResponseMode(t.responseMode),r.addResponseTypeCode(),r.addLibraryInfo(this.config.libraryInfo),r.addClientInfo(),t.codeChallenge&&t.codeChallengeMethod&&r.addCodeChallengeParams(t.codeChallenge,t.codeChallengeMethod),t.prompt&&r.addPrompt(t.prompt),t.domainHint&&r.addDomainHint(t.domainHint),t.prompt!==oe.SELECT_ACCOUNT)if(t.sid&&t.prompt===oe.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),r.addSid(t.sid);else if(t.account){var s=this.extractAccountSid(t.account);if(s&&t.prompt===oe.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),r.addSid(s);try{var u=tt(t.account.homeAccountId);r.addCcsOid(u)}catch(d){this.logger.verbose("Could not parse home account ID for CCS Header: "+d)}}else if(t.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),r.addLoginHint(t.loginHint),r.addCcsUpn(t.loginHint);else if(t.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),r.addLoginHint(t.account.username);try{var u=tt(t.account.homeAccountId);r.addCcsOid(u)}catch(d){this.logger.verbose("Could not parse home account ID for CCS Header: "+d)}}}else t.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),r.addLoginHint(t.loginHint),r.addCcsUpn(t.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");return t.nonce&&r.addNonce(t.nonce),t.state&&r.addState(t.state),(!_.isEmpty(t.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(t.claims,this.config.authOptions.clientCapabilities),t.extraQueryParameters&&r.addExtraQueryParameters(t.extraQueryParameters),r.createQueryString()},e.prototype.createLogoutUrlQueryString=function(t){var r=new Ve;return t.postLogoutRedirectUri&&r.addPostLogoutRedirectUri(t.postLogoutRedirectUri),t.correlationId&&r.addCorrelationId(t.correlationId),t.idTokenHint&&r.addIdTokenHint(t.idTokenHint),t.state&&r.addState(t.state),t.logoutHint&&r.addLogoutHint(t.logoutHint),t.extraQueryParameters&&r.addExtraQueryParameters(t.extraQueryParameters),r.createQueryString()},e.prototype.extractAccountSid=function(t){if(t.idTokenClaims){var r=t.idTokenClaims;return r.sid||null}return null},e}(jt);/*! @azure/msal-common v6.1.0 2022-02-08 */var Yr=function(n){te(e,n);function e(t){return n.call(this,t)||this}return e.prototype.acquireToken=function(t){return N(this,void 0,void 0,function(){var r,i,a;return T(this,function(s){switch(s.label){case 0:return r=me.nowSeconds(),[4,this.executeTokenRequest(t,this.authority)];case 1:return i=s.sent(),a=new At(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin),a.validateTokenResponse(i.body),[2,a.handleServerTokenResponse(i.body,this.authority,r,t,void 0,void 0,!0)]}})})},e.prototype.acquireTokenByRefreshToken=function(t){return N(this,void 0,void 0,function(){var r,i,a;return T(this,function(s){if(!t)throw W.createEmptyTokenRequestError();if(!t.account)throw b.createNoAccountInSilentRequestError();if(r=this.cacheManager.isAppMetadataFOCI(t.account.environment,this.config.authOptions.clientId),r)try{return[2,this.acquireTokenWithCachedRefreshToken(t,!0)]}catch(u){if(i=u instanceof ke&&u.errorCode===St.noTokensFoundError.code,a=u instanceof je&&u.errorCode===Gr.INVALID_GRANT_ERROR&&u.subError===Gr.CLIENT_MISMATCH_ERROR,i||a)return[2,this.acquireTokenWithCachedRefreshToken(t,!1)];throw u}return[2,this.acquireTokenWithCachedRefreshToken(t,!1)]})})},e.prototype.acquireTokenWithCachedRefreshToken=function(t,r){return N(this,void 0,void 0,function(){var i,a;return T(this,function(s){if(i=this.cacheManager.readRefreshTokenFromCache(this.config.authOptions.clientId,t.account,r),!i)throw ke.createNoTokensFoundError();return a=Y(Y({},t),{refreshToken:i.secret,authenticationScheme:t.authenticationScheme||o.AuthenticationScheme.BEARER,ccsCredential:{credential:t.account.homeAccountId,type:ue.HOME_ACCOUNT_ID}}),[2,this.acquireToken(a)]})})},e.prototype.executeTokenRequest=function(t,r){return N(this,void 0,void 0,function(){var i,a,s,u,d;return T(this,function(l){switch(l.label){case 0:return[4,this.createTokenRequestBody(t)];case 1:return i=l.sent(),a=this.createTokenQueryParameters(t),s=this.createTokenRequestHeaders(t.ccsCredential),u={clientId:this.config.authOptions.clientId,authority:r.canonicalAuthority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid},d=j.appendQueryString(r.tokenEndpoint,a),[2,this.executePostToTokenEndpoint(d,i,s,u)]}})})},e.prototype.createTokenQueryParameters=function(t){var r=new Ve;return t.tokenQueryParameters&&r.addExtraQueryParameters(t.tokenQueryParameters),r.createQueryString()},e.prototype.createTokenRequestBody=function(t){return N(this,void 0,void 0,function(){var r,i,a,s,u,d;return T(this,function(l){switch(l.label){case 0:return r=new Ve,r.addClientId(this.config.authOptions.clientId),r.addScopes(t.scopes),r.addGrantType(gt.REFRESH_TOKEN_GRANT),r.addClientInfo(),r.addLibraryInfo(this.config.libraryInfo),r.addThrottling(),this.serverTelemetryManager&&r.addServerTelemetry(this.serverTelemetryManager),i=t.correlationId||this.config.cryptoInterface.createNewGuid(),r.addCorrelationId(i),r.addRefreshToken(t.refreshToken),this.config.clientCredentials.clientSecret&&r.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion&&(a=this.config.clientCredentials.clientAssertion,r.addClientAssertion(a.assertion),r.addClientAssertionType(a.assertionType)),t.authenticationScheme!==o.AuthenticationScheme.POP?[3,2]:(s=new _t(this.cryptoUtils),[4,s.generateCnf(t)]);case 1:return u=l.sent(),r.addPopToken(u),[3,3];case 2:if(t.authenticationScheme===o.AuthenticationScheme.SSH)if(t.sshJwk)r.addSshJwk(t.sshJwk);else throw W.createMissingSshJwkError();l.label=3;case 3:if((!_.isEmptyObj(t.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(t.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&t.ccsCredential)switch(t.ccsCredential.type){case ue.HOME_ACCOUNT_ID:try{d=tt(t.ccsCredential.credential),r.addCcsOid(d)}catch(f){this.logger.verbose("Could not parse home account ID for CCS Header: "+f)}break;case ue.UPN:r.addCcsUpn(t.ccsCredential.credential);break}return[2,r.createQueryString()]}})})},e}(jt);/*! @azure/msal-common v6.1.0 2022-02-08 */var _o=function(n){te(e,n);function e(t){return n.call(this,t)||this}return e.prototype.acquireToken=function(t){return N(this,void 0,void 0,function(){var r,i;return T(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.acquireCachedToken(t)];case 1:return[2,a.sent()];case 2:if(r=a.sent(),r instanceof b&&r.errorCode===I.tokenRefreshRequired.code)return i=new Yr(this.config),[2,i.acquireTokenByRefreshToken(t)];throw r;case 3:return[2]}})})},e.prototype.acquireCachedToken=function(t){var r,i,a,s;return N(this,void 0,void 0,function(){var u,d;return T(this,function(l){switch(l.label){case 0:if(!t)throw W.createEmptyTokenRequestError();if(t.forceRefresh)throw(r=this.serverTelemetryManager)===null||r===void 0||r.setCacheOutcome(De.FORCE_REFRESH),this.logger.info("SilentFlowClient:acquireCachedToken - Skipping cache because forceRefresh is true."),b.createRefreshRequiredError();if(!t.account)throw b.createNoAccountInSilentRequestError();if(u=t.authority||this.authority.getPreferredCache(),d=this.cacheManager.readCacheRecord(t.account,this.config.authOptions.clientId,t,u),d.accessToken){if(me.wasClockTurnedBack(d.accessToken.cachedAt)||me.isTokenExpired(d.accessToken.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw(a=this.serverTelemetryManager)===null||a===void 0||a.setCacheOutcome(De.CACHED_ACCESS_TOKEN_EXPIRED),this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token is expired or will expire within "+this.config.systemOptions.tokenRenewalOffsetSeconds+" seconds."),b.createRefreshRequiredError();if(d.accessToken.refreshOn&&me.isTokenExpired(d.accessToken.refreshOn,0))throw(s=this.serverTelemetryManager)===null||s===void 0||s.setCacheOutcome(De.REFRESH_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'."),b.createRefreshRequiredError()}else throw(i=this.serverTelemetryManager)===null||i===void 0||i.setCacheOutcome(De.NO_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties."),b.createRefreshRequiredError();return this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[4,this.generateResultFromCacheRecord(d,t)];case 1:return[2,l.sent()]}})})},e.prototype.generateResultFromCacheRecord=function(t,r){return N(this,void 0,void 0,function(){var i;return T(this,function(a){switch(a.label){case 0:return t.idToken&&(i=new Ne(t.idToken.secret,this.config.cryptoInterface)),[4,At.generateAuthenticationResult(this.cryptoUtils,this.authority,t,!0,r,i)];case 1:return[2,a.sent()]}})})},e}(jt);/*! @azure/msal-common v6.1.0 2022-02-08 */function Ao(n){return n.hasOwnProperty("authorization_endpoint")&&n.hasOwnProperty("token_endpoint")&&n.hasOwnProperty("issuer")}/*! @azure/msal-common v6.1.0 2022-02-08 */o.ProtocolMode=void 0,function(n){n.AAD="AAD",n.OIDC="OIDC"}(o.ProtocolMode||(o.ProtocolMode={}));/*! @azure/msal-common v6.1.0 2022-02-08 */var Qt=function(){function n(){this.expiresAt=me.nowSeconds()+$e.REFRESH_TIME_SECONDS}return n.prototype.updateCloudDiscoveryMetadata=function(e,t){this.aliases=e.aliases,this.preferred_cache=e.preferred_cache,this.preferred_network=e.preferred_network,this.aliasesFromNetwork=t},n.prototype.updateEndpointMetadata=function(e,t){this.authorization_endpoint=e.authorization_endpoint,this.token_endpoint=e.token_endpoint,this.end_session_endpoint=e.end_session_endpoint,this.issuer=e.issuer,this.endpointsFromNetwork=t},n.prototype.updateCanonicalAuthority=function(e){this.canonical_authority=e},n.prototype.resetExpiresAt=function(){this.expiresAt=me.nowSeconds()+$e.REFRESH_TIME_SECONDS},n.prototype.isExpired=function(){return this.expiresAt<=me.nowSeconds()},n.isAuthorityMetadataEntity=function(e,t){return t?e.indexOf($e.CACHE_KEY)===0&&t.hasOwnProperty("aliases")&&t.hasOwnProperty("preferred_cache")&&t.hasOwnProperty("preferred_network")&&t.hasOwnProperty("canonical_authority")&&t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("aliasesFromNetwork")&&t.hasOwnProperty("endpointsFromNetwork")&&t.hasOwnProperty("expiresAt"):!1},n}();/*! @azure/msal-common v6.1.0 2022-02-08 */function Ro(n){return n.hasOwnProperty("tenant_discovery_endpoint")&&n.hasOwnProperty("metadata")}/*! @azure/msal-common v6.1.0 2022-02-08 */var bo=function(){function n(e){this.networkInterface=e}return n.prototype.detectRegion=function(e,t,r){return N(this,void 0,void 0,function(){var i,a,s,u,d;return T(this,function(l){switch(l.label){case 0:if(i=e,i)return[3,8];a=n.IMDS_OPTIONS,r&&(a.proxyUrl=r),l.label=1;case 1:return l.trys.push([1,6,,7]),[4,this.getRegionFromIMDS(E.IMDS_VERSION,a)];case 2:return s=l.sent(),s.status===We.httpSuccess&&(i=s.body,t.region_source=Oe.IMDS),s.status!==We.httpBadRequest?[3,5]:[4,this.getCurrentVersion(a)];case 3:return u=l.sent(),u?[4,this.getRegionFromIMDS(u,a)]:(t.region_source=Oe.FAILED_AUTO_DETECTION,[2,null]);case 4:d=l.sent(),d.status===We.httpSuccess&&(i=d.body,t.region_source=Oe.IMDS),l.label=5;case 5:return[3,7];case 6:return l.sent(),t.region_source=Oe.FAILED_AUTO_DETECTION,[2,null];case 7:return[3,9];case 8:t.region_source=Oe.ENVIRONMENT_VARIABLE,l.label=9;case 9:return i||(t.region_source=Oe.FAILED_AUTO_DETECTION),[2,i||null]}})})},n.prototype.getRegionFromIMDS=function(e,t){return N(this,void 0,void 0,function(){return T(this,function(r){return[2,this.networkInterface.sendGetRequestAsync(E.IMDS_ENDPOINT+"?api-version="+e+"&format=text",t,E.IMDS_TIMEOUT)]})})},n.prototype.getCurrentVersion=function(e){return N(this,void 0,void 0,function(){var t;return T(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.networkInterface.sendGetRequestAsync(E.IMDS_ENDPOINT+"?format=json",e)];case 1:return t=r.sent(),t.status===We.httpBadRequest&&t.body&&t.body["newest-versions"]&&t.body["newest-versions"].length>0?[2,t.body["newest-versions"][0]]:[2,null];case 2:return r.sent(),[2,null];case 3:return[2]}})})},n.IMDS_OPTIONS={headers:{Metadata:"true"}},n}();/*! @azure/msal-common v6.1.0 2022-02-08 */var Rt=function(){function n(e,t,r,i,a){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=t,this.cacheManager=r,this.authorityOptions=i,this.regionDiscovery=new bo(t),this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.proxyUrl=a||E.EMPTY_STRING}return Object.defineProperty(n.prototype,"authorityType",{get:function(){var e=this.canonicalAuthorityUrlComponents.PathSegments;return e.length&&e[0].toLowerCase()===E.ADFS?Pe.Adfs:Pe.Default},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"protocolMode",{get:function(){return this.authorityOptions.protocolMode},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"options",{get:function(){return this.authorityOptions},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"canonicalAuthority",{get:function(){return this._canonicalAuthority.urlString},set:function(e){this._canonicalAuthority=new j(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"canonicalAuthorityUrlComponents",{get:function(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hostnameAndPort",{get:function(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"tenant",{get:function(){return this.canonicalAuthorityUrlComponents.PathSegments[0]},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"authorizationEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.authorization_endpoint);return this.replaceTenant(e)}else throw b.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"tokenEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.token_endpoint);return this.replaceTenant(e)}else throw b.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"deviceCodeEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));return this.replaceTenant(e)}else throw b.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"endSessionEndpoint",{get:function(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw b.createLogoutNotSupportedError();var e=this.replacePath(this.metadata.end_session_endpoint);return this.replaceTenant(e)}else throw b.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selfSignedJwtAudience",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.issuer);return this.replaceTenant(e)}else throw b.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),n.prototype.replaceTenant=function(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)},n.prototype.replacePath=function(e){var t=e,r=new j(this.metadata.canonical_authority),i=r.getUrlComponents().PathSegments,a=this.canonicalAuthorityUrlComponents.PathSegments;return a.forEach(function(s,u){var d=i[u];s!==d&&(t=t.replace("/"+d+"/","/"+s+"/"))}),t},Object.defineProperty(n.prototype,"defaultOpenIdConfigurationEndpoint",{get:function(){return this.authorityType===Pe.Adfs||this.protocolMode===o.ProtocolMode.OIDC?this.canonicalAuthority+".well-known/openid-configuration":this.canonicalAuthority+"v2.0/.well-known/openid-configuration"},enumerable:!1,configurable:!0}),n.prototype.discoveryComplete=function(){return!!this.metadata},n.prototype.resolveEndpointsAsync=function(){return N(this,void 0,void 0,function(){var e,t,r,i;return T(this,function(a){switch(a.label){case 0:return e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort),e||(e=new Qt,e.updateCanonicalAuthority(this.canonicalAuthority)),[4,this.updateCloudDiscoveryMetadata(e)];case 1:return t=a.sent(),this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network),[4,this.updateEndpointMetadata(e)];case 2:return r=a.sent(),t!==fe.CACHE&&r!==fe.CACHE&&(e.resetExpiresAt(),e.updateCanonicalAuthority(this.canonicalAuthority)),i=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache),this.cacheManager.setAuthorityMetadata(i,e),this.metadata=e,[2]}})})},n.prototype.updateEndpointMetadata=function(e){var t;return N(this,void 0,void 0,function(){var r,i,a;return T(this,function(s){switch(s.label){case 0:return r=this.getEndpointMetadataFromConfig(),r?(e.updateEndpointMetadata(r,!1),[2,fe.CONFIG]):this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!e.isExpired()?[2,fe.CACHE]:[4,this.getEndpointMetadataFromNetwork()];case 1:return r=s.sent(),r?!((t=this.authorityOptions.azureRegionConfiguration)===null||t===void 0)&&t.azureRegion?[4,this.regionDiscovery.detectRegion(this.authorityOptions.azureRegionConfiguration.environmentRegion,this.regionDiscoveryMetadata,this.proxyUrl)]:[3,3]:[3,4];case 2:i=s.sent(),a=this.authorityOptions.azureRegionConfiguration.azureRegion===E.AZURE_REGION_AUTO_DISCOVER_FLAG?i:this.authorityOptions.azureRegionConfiguration.azureRegion,this.authorityOptions.azureRegionConfiguration.azureRegion===E.AZURE_REGION_AUTO_DISCOVER_FLAG?this.regionDiscoveryMetadata.region_outcome=i?Le.AUTO_DETECTION_REQUESTED_SUCCESSFUL:Le.AUTO_DETECTION_REQUESTED_FAILED:i?this.regionDiscoveryMetadata.region_outcome=this.authorityOptions.azureRegionConfiguration.azureRegion===i?Le.CONFIGURED_MATCHES_DETECTED:Le.CONFIGURED_NOT_DETECTED:this.regionDiscoveryMetadata.region_outcome=Le.CONFIGURED_NO_AUTO_DETECTION,a&&(this.regionDiscoveryMetadata.region_used=a,r=n.replaceWithRegionalInformation(r,a)),s.label=3;case 3:return e.updateEndpointMetadata(r,!0),[2,fe.NETWORK];case 4:throw b.createUnableToGetOpenidConfigError(this.defaultOpenIdConfigurationEndpoint)}})})},n.prototype.isAuthoritySameType=function(e){var t=new j(e.canonical_authority),r=t.getUrlComponents().PathSegments;return r.length===this.canonicalAuthorityUrlComponents.PathSegments.length},n.prototype.getEndpointMetadataFromConfig=function(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch(e){throw W.createInvalidAuthorityMetadataError()}return null},n.prototype.getEndpointMetadataFromNetwork=function(){return N(this,void 0,void 0,function(){var e,t;return T(this,function(r){switch(r.label){case 0:e={},this.proxyUrl&&(e.proxyUrl=this.proxyUrl),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.networkInterface.sendGetRequestAsync(this.defaultOpenIdConfigurationEndpoint,e)];case 2:return t=r.sent(),[2,Ao(t.body)?t.body:null];case 3:return r.sent(),[2,null];case 4:return[2]}})})},n.prototype.updateCloudDiscoveryMetadata=function(e){return N(this,void 0,void 0,function(){var t;return T(this,function(r){switch(r.label){case 0:return t=this.getCloudDiscoveryMetadataFromConfig(),t?(e.updateCloudDiscoveryMetadata(t,!1),[2,fe.CONFIG]):this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!e.isExpired()?[2,fe.CACHE]:[4,this.getCloudDiscoveryMetadataFromNetwork()];case 1:if(t=r.sent(),t)return e.updateCloudDiscoveryMetadata(t,!0),[2,fe.NETWORK];throw W.createUntrustedAuthorityError()}})})},n.prototype.getCloudDiscoveryMetadataFromConfig=function(){if(this.authorityOptions.cloudDiscoveryMetadata)try{var e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),t=n.getCloudDiscoveryMetadataFromNetworkResponse(e.metadata,this.hostnameAndPort);if(t)return t}catch(r){throw W.createInvalidCloudDiscoveryMetadataError()}return this.isInKnownAuthorities()?n.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort):null},n.prototype.getCloudDiscoveryMetadataFromNetwork=function(){return N(this,void 0,void 0,function(){var e,t,r,i,a;return T(this,function(s){switch(s.label){case 0:e=""+E.AAD_INSTANCE_DISCOVERY_ENDPT+this.canonicalAuthority+"oauth2/v2.0/authorize",t={},this.proxyUrl&&(t.proxyUrl=this.proxyUrl),r=null,s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.networkInterface.sendGetRequestAsync(e,t)];case 2:return i=s.sent(),a=Ro(i.body)?i.body.metadata:[],a.length===0?[2,null]:(r=n.getCloudDiscoveryMetadataFromNetworkResponse(a,this.hostnameAndPort),[3,4]);case 3:return s.sent(),[2,null];case 4:return r||(r=n.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),[2,r]}})})},n.prototype.isInKnownAuthorities=function(){var e=this,t=this.authorityOptions.knownAuthorities.filter(function(r){return j.getDomainFromUrl(r).toLowerCase()===e.hostnameAndPort});return t.length>0},n.generateAuthority=function(e,t){var r;if(t&&t.azureCloudInstance!==o.AzureCloudInstance.None){var i=t.tenant?t.tenant:E.DEFAULT_COMMON_TENANT;r=t.azureCloudInstance+"/"+i+"/"}return r||e},n.createCloudDiscoveryMetadataFromHost=function(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}},n.getCloudDiscoveryMetadataFromNetworkResponse=function(e,t){for(var r=0;r<e.length;r++){var i=e[r];if(i.aliases.indexOf(t)>-1)return i}return null},n.prototype.getPreferredCache=function(){if(this.discoveryComplete())return this.metadata.preferred_cache;throw b.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},n.prototype.isAlias=function(e){return this.metadata.aliases.indexOf(e)>-1},n.isPublicCloudAuthority=function(e){return E.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0},n.buildRegionalAuthorityString=function(e,t,r){var i=new j(e);i.validateAsUri();var a=i.getUrlComponents(),s=t+"."+a.HostNameAndPort;this.isPublicCloudAuthority(a.HostNameAndPort)&&(s=t+"."+E.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX);var u=j.constructAuthorityUriFromObject(Y(Y({},i.getUrlComponents()),{HostNameAndPort:s})).urlString;return r?u+"?"+r:u},n.replaceWithRegionalInformation=function(e,t){return e.authorization_endpoint=n.buildRegionalAuthorityString(e.authorization_endpoint,t),e.token_endpoint=n.buildRegionalAuthorityString(e.token_endpoint,t,"allowestsrnonmsi=true"),e.end_session_endpoint&&(e.end_session_endpoint=n.buildRegionalAuthorityString(e.end_session_endpoint,t)),e},n}();/*! @azure/msal-common v6.1.0 2022-02-08 */var xr=function(){function n(){}return n.createDiscoveredInstance=function(e,t,r,i,a){return N(this,void 0,void 0,function(){var s,u;return T(this,function(d){switch(d.label){case 0:s=n.createInstance(e,t,r,i,a),d.label=1;case 1:return d.trys.push([1,3,,4]),[4,s.resolveEndpointsAsync()];case 2:return d.sent(),[2,s];case 3:throw u=d.sent(),b.createEndpointDiscoveryIncompleteError(u);case 4:return[2]}})})},n.createInstance=function(e,t,r,i,a){if(_.isEmpty(e))throw W.createUrlEmptyError();return new Rt(e,t,r,i,a)},n}();/*! @azure/msal-common v6.1.0 2022-02-08 */var bt=function(){function n(){this.failedRequests=[],this.errors=[],this.cacheHits=0}return n.isServerTelemetryEntity=function(e,t){var r=e.indexOf(ne.CACHE_KEY)===0,i=!0;return t&&(i=t.hasOwnProperty("failedRequests")&&t.hasOwnProperty("errors")&&t.hasOwnProperty("cacheHits")),r&&i},n}();/*! @azure/msal-common v6.1.0 2022-02-08 */var Qr=function(){function n(){}return n.isThrottlingEntity=function(e,t){var r=!1;e&&(r=e.indexOf(Ze.THROTTLING_PREFIX)===0);var i=!0;return t&&(i=t.hasOwnProperty("throttleTime")),r&&i},n}();/*! @azure/msal-common v6.1.0 2022-02-08 */var Oo={sendGetRequestAsync:function(){var n="Network interface - sendGetRequestAsync() has not been implemented for the Network interface.";return Promise.reject(k.createUnexpectedError(n))},sendPostRequestAsync:function(){var n="Network interface - sendPostRequestAsync() has not been implemented for the Network interface.";return Promise.reject(k.createUnexpectedError(n))}};/*! @azure/msal-common v6.1.0 2022-02-08 */var Po=function(){function n(e){this.headers=e}return n.prototype.getShrNonce=function(){var e=this.headers[H.AuthenticationInfo];if(e){var t=this.parseChallenges(e);if(t.nextnonce)return t.nextnonce;throw W.createInvalidAuthenticationHeaderError(H.AuthenticationInfo,"nextnonce challenge is missing.")}var r=this.headers[H.WWWAuthenticate];if(r){var i=this.parseChallenges(r);if(i.nonce)return i.nonce;throw W.createInvalidAuthenticationHeaderError(H.WWWAuthenticate,"nonce challenge is missing.")}throw W.createMissingNonceAuthenticationHeadersError()},n.prototype.parseChallenges=function(e){var t=e.indexOf(" "),r=e.substr(t+1).split(","),i={};return r.forEach(function(a){var s=a.split("="),u=s[0],d=s[1];i[u]=unescape(d.replace(/['"]+/g,""))}),i},n}();/*! @azure/msal-common v6.1.0 2022-02-08 */var No=function(){function n(e,t){this.cacheOutcome=De.NO_CACHE_HIT,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||E.EMPTY_STRING,this.wrapperVer=e.wrapperVer||E.EMPTY_STRING,this.telemetryCacheKey=ne.CACHE_KEY+ce.CACHE_KEY_SEPARATOR+e.clientId}return n.prototype.generateCurrentRequestHeaderValue=function(){var e=""+this.apiId+ne.VALUE_SEPARATOR+this.cacheOutcome,t=[this.wrapperSKU,this.wrapperVer].join(ne.VALUE_SEPARATOR),r=this.getRegionDiscoveryFields(),i=[e,r].join(ne.VALUE_SEPARATOR);return[ne.SCHEMA_VERSION,i,t].join(ne.CATEGORY_SEPARATOR)},n.prototype.generateLastRequestHeaderValue=function(){var e=this.getLastRequests(),t=n.maxErrorsToSend(e),r=e.failedRequests.slice(0,2*t).join(ne.VALUE_SEPARATOR),i=e.errors.slice(0,t).join(ne.VALUE_SEPARATOR),a=e.errors.length,s=t<a?ne.OVERFLOW_TRUE:ne.OVERFLOW_FALSE,u=[a,s].join(ne.VALUE_SEPARATOR);return[ne.SCHEMA_VERSION,e.cacheHits,r,i,u].join(ne.CATEGORY_SEPARATOR)},n.prototype.cacheFailedRequest=function(e){var t=this.getLastRequests();t.errors.length>=ne.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),_.isEmpty(e.subError)?_.isEmpty(e.errorCode)?!!e&&e.toString()?t.errors.push(e.toString()):t.errors.push(ne.UNKNOWN_ERROR):t.errors.push(e.errorCode):t.errors.push(e.subError),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)},n.prototype.incrementCacheHits=function(){var e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits},n.prototype.getLastRequests=function(){var e=new bt,t=this.cacheManager.getServerTelemetry(this.telemetryCacheKey);return t||e},n.prototype.clearTelemetryCache=function(){var e=this.getLastRequests(),t=n.maxErrorsToSend(e),r=e.errors.length;if(t===r)this.cacheManager.removeItem(this.telemetryCacheKey);else{var i=new bt;i.failedRequests=e.failedRequests.slice(t*2),i.errors=e.errors.slice(t),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,i)}},n.maxErrorsToSend=function(e){var t,r=0,i=0,a=e.errors.length;for(t=0;t<a;t++){var s=e.failedRequests[2*t]||E.EMPTY_STRING,u=e.failedRequests[2*t+1]||E.EMPTY_STRING,d=e.errors[t]||E.EMPTY_STRING;if(i+=s.toString().length+u.toString().length+d.length+3,i<ne.MAX_LAST_HEADER_BYTES)r+=1;else break}return r},n.prototype.getRegionDiscoveryFields=function(){var e=[];return e.push(this.regionUsed||""),e.push(this.regionSource||""),e.push(this.regionOutcome||""),e.join(",")},n.prototype.updateRegionDiscoveryMetadata=function(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome},n.prototype.setCacheOutcome=function(e){this.cacheOutcome=e},n}(),le={INTERACTION_IN_PROGRESS_VALUE:"interaction_in_progress",INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",POLL_INTERVAL_MS:50,MSAL_SKU:"msal.js.browser"};o.BrowserCacheLocation=void 0,function(n){n.LocalStorage="localStorage",n.SessionStorage="sessionStorage",n.MemoryStorage="memoryStorage"}(o.BrowserCacheLocation||(o.BrowserCacheLocation={}));var ve;(function(n){n.GET="GET",n.POST="POST"})(ve||(ve={})),o.TemporaryCacheKeys=void 0,function(n){n.AUTHORITY="authority",n.ACQUIRE_TOKEN_ACCOUNT="acquireToken.account",n.SESSION_STATE="session.state",n.REQUEST_STATE="request.state",n.NONCE_IDTOKEN="nonce.id_token",n.ORIGIN_URI="request.origin",n.RENEW_STATUS="token.renew.status",n.URL_HASH="urlHash",n.REQUEST_PARAMS="request.params",n.SCOPES="scopes",n.INTERACTION_STATUS_KEY="interaction.status",n.CCS_CREDENTIAL="ccs.credential",n.CORRELATION_ID="request.correlationId"}(o.TemporaryCacheKeys||(o.TemporaryCacheKeys={}));var xe;(function(n){n.WRAPPER_SKU="wrapper.sku",n.WRAPPER_VER="wrapper.version"})(xe||(xe={})),o.ApiId=void 0,function(n){n[n.acquireTokenRedirect=861]="acquireTokenRedirect",n[n.acquireTokenPopup=862]="acquireTokenPopup",n[n.ssoSilent=863]="ssoSilent",n[n.acquireTokenSilent_authCode=864]="acquireTokenSilent_authCode",n[n.handleRedirectPromise=865]="handleRedirectPromise",n[n.acquireTokenByCode=866]="acquireTokenByCode",n[n.acquireTokenSilent_silentFlow=61]="acquireTokenSilent_silentFlow",n[n.logout=961]="logout",n[n.logoutPopup=962]="logoutPopup"}(o.ApiId||(o.ApiId={})),o.InteractionType=void 0,function(n){n.Redirect="redirect",n.Popup="popup",n.Silent="silent",n.None="none"}(o.InteractionType||(o.InteractionType={})),o.InteractionStatus=void 0,function(n){n.Startup="startup",n.Login="login",n.Logout="logout",n.AcquireToken="acquireToken",n.SsoSilent="ssoSilent",n.HandleRedirect="handleRedirect",n.None="none"}(o.InteractionStatus||(o.InteractionStatus={}));var Jr={scopes:we},rt="jwk";o.WrapperSKU=void 0,function(n){n.React="@azure/msal-react",n.Angular="@azure/msal-angular"}(o.WrapperSKU||(o.WrapperSKU={}));var Jt="msal.db",ko=1,Uo=Jt+".keys",ie=function(){function n(){}return n.decimalToHex=function(e){for(var t=e.toString(16);t.length<2;)t="0"+t;return t},n}(),Mo=function(){function n(e){this.cryptoObj=e}return n.prototype.generateGuid=function(){try{var e=new Uint8Array(16);return this.cryptoObj.getRandomValues(e),e[6]|=64,e[6]&=79,e[8]|=128,e[8]&=191,ie.decimalToHex(e[0])+ie.decimalToHex(e[1])+ie.decimalToHex(e[2])+ie.decimalToHex(e[3])+"-"+ie.decimalToHex(e[4])+ie.decimalToHex(e[5])+"-"+ie.decimalToHex(e[6])+ie.decimalToHex(e[7])+"-"+ie.decimalToHex(e[8])+ie.decimalToHex(e[9])+"-"+ie.decimalToHex(e[10])+ie.decimalToHex(e[11])+ie.decimalToHex(e[12])+ie.decimalToHex(e[13])+ie.decimalToHex(e[14])+ie.decimalToHex(e[15])}catch(u){for(var t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",r="0123456789abcdef",i=0,a="",s=0;s<36;s++)t[s]!=="-"&&t[s]!=="4"&&(i=Math.random()*16|0),t[s]==="x"?a+=r[i]:t[s]==="y"?(i&=3,i|=8,a+=r[i]):a+=t[s];return a}},n.isGuid=function(e){var t=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;return t.test(e)},n}(),Qe=function(){function n(){}return n.stringToUtf8Arr=function(e){for(var t,r=0,i=e.length,a=0;a<i;a++)t=e.charCodeAt(a),r+=t<128?1:t<2048?2:t<65536?3:t<2097152?4:t<67108864?5:6;for(var s=new Uint8Array(r),u=0,d=0;u<r;d++)t=e.charCodeAt(d),t<128?s[u++]=t:t<2048?(s[u++]=192+(t>>>6),s[u++]=128+(t&63)):t<65536?(s[u++]=224+(t>>>12),s[u++]=128+(t>>>6&63),s[u++]=128+(t&63)):t<2097152?(s[u++]=240+(t>>>18),s[u++]=128+(t>>>12&63),s[u++]=128+(t>>>6&63),s[u++]=128+(t&63)):t<67108864?(s[u++]=248+(t>>>24),s[u++]=128+(t>>>18&63),s[u++]=128+(t>>>12&63),s[u++]=128+(t>>>6&63),s[u++]=128+(t&63)):(s[u++]=252+(t>>>30),s[u++]=128+(t>>>24&63),s[u++]=128+(t>>>18&63),s[u++]=128+(t>>>12&63),s[u++]=128+(t>>>6&63),s[u++]=128+(t&63));return s},n.stringToArrayBuffer=function(e){for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return t},n.utf8ArrToString=function(e){for(var t="",r=void 0,i=e.length,a=0;a<i;a++)r=e[a],t+=String.fromCharCode(r>251&&r<254&&a+5<i?(r-252)*1073741824+(e[++a]-128<<24)+(e[++a]-128<<18)+(e[++a]-128<<12)+(e[++a]-128<<6)+e[++a]-128:r>247&&r<252&&a+4<i?(r-248<<24)+(e[++a]-128<<18)+(e[++a]-128<<12)+(e[++a]-128<<6)+e[++a]-128:r>239&&r<248&&a+3<i?(r-240<<18)+(e[++a]-128<<12)+(e[++a]-128<<6)+e[++a]-128:r>223&&r<240&&a+2<i?(r-224<<12)+(e[++a]-128<<6)+e[++a]-128:r>191&&r<224&&a+1<i?(r-192<<6)+e[++a]-128:r);return t},n}(),Xr=function(){function n(){}return n.prototype.urlEncode=function(e){return encodeURIComponent(this.encode(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))},n.prototype.urlEncodeArr=function(e){return this.base64EncArr(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},n.prototype.encode=function(e){var t=Qe.stringToUtf8Arr(e);return this.base64EncArr(t)},n.prototype.base64EncArr=function(e){for(var t=(3-e.length%3)%3,r="",i=void 0,a=e.length,s=0,u=0;u<a;u++)i=u%3,s|=e[u]<<(16>>>i&24),(i===2||e.length-u===1)&&(r+=String.fromCharCode(this.uint6ToB64(s>>>18&63),this.uint6ToB64(s>>>12&63),this.uint6ToB64(s>>>6&63),this.uint6ToB64(s&63)),s=0);return t===0?r:r.substring(0,r.length-t)+(t===1?"=":"==")},n.prototype.uint6ToB64=function(e){return e<26?e+65:e<52?e+71:e<62?e-4:e===62?43:e===63?47:65},n}(),Lo=function(){function n(){}return n.prototype.decode=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("Invalid base64 string")}var r=this.base64DecToArr(t);return Qe.utf8ArrToString(r)},n.prototype.base64DecToArr=function(e,t){for(var r=e.replace(/[^A-Za-z0-9\+\/]/g,""),i=r.length,a=t?Math.ceil((i*3+1>>>2)/t)*t:i*3+1>>>2,s=new Uint8Array(a),u=void 0,d=void 0,l=0,f=0,y=0;y<i;y++)if(d=y&3,l|=this.b64ToUint6(r.charCodeAt(y))<<18-6*d,d===3||i-y===1){for(u=0;u<3&&f<a;u++,f++)s[f]=l>>>(16>>>u&24)&255;l=0}return s},n.prototype.b64ToUint6=function(e){return e>64&&e<91?e-65:e>96&&e<123?e-71:e>47&&e<58?e+4:e===43?62:e===47?63:0},n}(),S={pkceNotGenerated:{code:"pkce_not_created",desc:"The PKCE code challenge and verifier could not be generated."},cryptoDoesNotExist:{code:"crypto_nonexistent",desc:"The crypto object or function is not available."},httpMethodNotImplementedError:{code:"http_method_not_implemented",desc:"The HTTP method given has not been implemented in this library."},emptyNavigateUriError:{code:"empty_navigate_uri",desc:"Navigation URI is empty. Please check stack trace for more info."},hashEmptyError:{code:"hash_empty_error",desc:"Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash."},hashDoesNotContainStateError:{code:"no_state_in_hash",desc:"Hash does not contain state. Please verify that the request originated from msal."},hashDoesNotContainKnownPropertiesError:{code:"hash_does_not_contain_known_properties",desc:"Hash does not contain known properites. Please verify that your redirectUri is not changing the hash."},unableToParseStateError:{code:"unable_to_parse_state",desc:"Unable to parse state. Please verify that the request originated from msal."},stateInteractionTypeMismatchError:{code:"state_interaction_type_mismatch",desc:"Hash contains state but the interaction type does not match the caller."},interactionInProgress:{code:"interaction_in_progress",desc:"Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API.  For more visit: aka.ms/msaljs/browser-errors."},popupWindowError:{code:"popup_window_error",desc:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser."},emptyWindowError:{code:"empty_window_error",desc:"window.open returned null or undefined window object."},userCancelledError:{code:"user_cancelled",desc:"User cancelled the flow."},monitorPopupTimeoutError:{code:"monitor_window_timeout",desc:"Token acquisition in popup failed due to timeout. For more visit: aka.ms/msaljs/browser-errors."},monitorIframeTimeoutError:{code:"monitor_window_timeout",desc:"Token acquisition in iframe failed due to timeout. For more visit: aka.ms/msaljs/browser-errors."},redirectInIframeError:{code:"redirect_in_iframe",desc:"Code flow is not supported inside an iframe. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs."},blockTokenRequestsInHiddenIframeError:{code:"block_iframe_reload",desc:"Request was blocked inside an iframe because MSAL detected an authentication response. For more visit: aka.ms/msaljs/browser-errors"},blockAcquireTokenInPopupsError:{code:"block_nested_popups",desc:"Request was blocked inside a popup because MSAL detected it was running in a popup."},iframeClosedPrematurelyError:{code:"iframe_closed_prematurely",desc:"The iframe being monitored was closed prematurely."},silentLogoutUnsupportedError:{code:"silent_logout_unsupported",desc:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead."},noAccountError:{code:"no_account_error",desc:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request."},silentPromptValueError:{code:"silent_prompt_value_error",desc:"The value given for the prompt value is not valid for silent requests - must be set to 'none'."},noTokenRequestCacheError:{code:"no_token_request_cache_error",desc:"No token request found in cache."},unableToParseTokenRequestCacheError:{code:"unable_to_parse_token_request_cache_error",desc:"The cached token request could not be parsed."},noCachedAuthorityError:{code:"no_cached_authority_error",desc:"No cached authority found."},authRequestNotSet:{code:"auth_request_not_set_error",desc:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler"},invalidCacheType:{code:"invalid_cache_type",desc:"Invalid cache type"},notInBrowserEnvironment:{code:"non_browser_environment",desc:"Login and token requests are not supported in non-browser environments."},databaseNotOpen:{code:"database_not_open",desc:"Database is not open!"},noNetworkConnectivity:{code:"no_network_connectivity",desc:"No network connectivity. Check your internet connection."},postRequestFailed:{code:"post_request_failed",desc:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'"},getRequestFailed:{code:"get_request_failed",desc:"Network request failed. Please check the network trace to determine root cause."},failedToParseNetworkResponse:{code:"failed_to_parse_response",desc:"Failed to parse network response. Check network trace."},unableToLoadTokenError:{code:"unable_to_load_token",desc:"Error loading token to cache."},signingKeyNotFoundInStorage:{code:"crypto_key_not_found",desc:"Cryptographic Key or Keypair not found in browser storage."},authCodeRequired:{code:"auth_code_required",desc:"An authorization code must be provided (as the `code` property on the request) to this flow."},databaseUnavailable:{code:"database_unavailable",desc:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts."}},A=function(n){h(e,n);function e(t,r){var i=n.call(this,t,r)||this;return Object.setPrototypeOf(i,e.prototype),i.name="BrowserAuthError",i}return e.createPkceNotGeneratedError=function(t){return new e(S.pkceNotGenerated.code,S.pkceNotGenerated.desc+" Detail:"+t)},e.createCryptoNotAvailableError=function(t){return new e(S.cryptoDoesNotExist.code,S.cryptoDoesNotExist.desc+" Detail:"+t)},e.createHttpMethodNotImplementedError=function(t){return new e(S.httpMethodNotImplementedError.code,S.httpMethodNotImplementedError.desc+" Given Method: "+t)},e.createEmptyNavigationUriError=function(){return new e(S.emptyNavigateUriError.code,S.emptyNavigateUriError.desc)},e.createEmptyHashError=function(t){return new e(S.hashEmptyError.code,S.hashEmptyError.desc+" Given Url: "+t)},e.createHashDoesNotContainStateError=function(){return new e(S.hashDoesNotContainStateError.code,S.hashDoesNotContainStateError.desc)},e.createHashDoesNotContainKnownPropertiesError=function(){return new e(S.hashDoesNotContainKnownPropertiesError.code,S.hashDoesNotContainKnownPropertiesError.desc)},e.createUnableToParseStateError=function(){return new e(S.unableToParseStateError.code,S.unableToParseStateError.desc)},e.createStateInteractionTypeMismatchError=function(){return new e(S.stateInteractionTypeMismatchError.code,S.stateInteractionTypeMismatchError.desc)},e.createInteractionInProgressError=function(){return new e(S.interactionInProgress.code,S.interactionInProgress.desc)},e.createPopupWindowError=function(t){var r=S.popupWindowError.desc;return r=_.isEmpty(t)?r:r+" Details: "+t,new e(S.popupWindowError.code,r)},e.createEmptyWindowCreatedError=function(){return new e(S.emptyWindowError.code,S.emptyWindowError.desc)},e.createUserCancelledError=function(){return new e(S.userCancelledError.code,S.userCancelledError.desc)},e.createMonitorPopupTimeoutError=function(){return new e(S.monitorPopupTimeoutError.code,S.monitorPopupTimeoutError.desc)},e.createMonitorIframeTimeoutError=function(){return new e(S.monitorIframeTimeoutError.code,S.monitorIframeTimeoutError.desc)},e.createRedirectInIframeError=function(t){return new e(S.redirectInIframeError.code,S.redirectInIframeError.desc+" (window.parent !== window) => "+t)},e.createBlockReloadInHiddenIframeError=function(){return new e(S.blockTokenRequestsInHiddenIframeError.code,S.blockTokenRequestsInHiddenIframeError.desc)},e.createBlockAcquireTokenInPopupsError=function(){return new e(S.blockAcquireTokenInPopupsError.code,S.blockAcquireTokenInPopupsError.desc)},e.createIframeClosedPrematurelyError=function(){return new e(S.iframeClosedPrematurelyError.code,S.iframeClosedPrematurelyError.desc)},e.createSilentLogoutUnsupportedError=function(){return new e(S.silentLogoutUnsupportedError.code,S.silentLogoutUnsupportedError.desc)},e.createNoAccountError=function(){return new e(S.noAccountError.code,S.noAccountError.desc)},e.createSilentPromptValueError=function(t){return new e(S.silentPromptValueError.code,S.silentPromptValueError.desc+" Given value: "+t)},e.createUnableToParseTokenRequestCacheError=function(){return new e(S.unableToParseTokenRequestCacheError.code,S.unableToParseTokenRequestCacheError.desc)},e.createNoTokenRequestCacheError=function(){return new e(S.noTokenRequestCacheError.code,S.noTokenRequestCacheError.desc)},e.createAuthRequestNotSetError=function(){return new e(S.authRequestNotSet.code,S.authRequestNotSet.desc)},e.createNoCachedAuthorityError=function(){return new e(S.noCachedAuthorityError.code,S.noCachedAuthorityError.desc)},e.createInvalidCacheTypeError=function(){return new e(S.invalidCacheType.code,""+S.invalidCacheType.desc)},e.createNonBrowserEnvironmentError=function(){return new e(S.notInBrowserEnvironment.code,S.notInBrowserEnvironment.desc)},e.createDatabaseNotOpenError=function(){return new e(S.databaseNotOpen.code,S.databaseNotOpen.desc)},e.createNoNetworkConnectivityError=function(){return new e(S.noNetworkConnectivity.code,S.noNetworkConnectivity.desc)},e.createPostRequestFailedError=function(t,r){return new e(S.postRequestFailed.code,S.postRequestFailed.desc+" | Network client threw: "+t+" | Attempted to reach: "+r.split("?")[0])},e.createGetRequestFailedError=function(t,r){return new e(S.getRequestFailed.code,S.getRequestFailed.desc+" | Network client threw: "+t+" | Attempted to reach: "+r.split("?")[0])},e.createFailedToParseNetworkResponseError=function(t){return new e(S.failedToParseNetworkResponse.code,S.failedToParseNetworkResponse.desc+" | Attempted to reach: "+t.split("?")[0])},e.createUnableToLoadTokenError=function(t){return new e(S.unableToLoadTokenError.code,S.unableToLoadTokenError.desc+" | "+t)},e.createSigningKeyNotFoundInStorageError=function(t){return new e(S.signingKeyNotFoundInStorage.code,S.signingKeyNotFoundInStorage.desc+" | No match found for KeyId: "+t)},e.createAuthCodeRequiredError=function(){return new e(S.authCodeRequired.code,S.authCodeRequired.desc)},e.createDatabaseUnavailableError=function(){return new e(S.databaseUnavailable.code,S.databaseUnavailable.desc)},e}(k),Do=32,Ho=function(){function n(e){this.base64Encode=new Xr,this.cryptoObj=e}return n.prototype.generateCodes=function(){return p(this,void 0,void 0,function(){var e,t;return m(this,function(r){switch(r.label){case 0:return e=this.generateCodeVerifier(),[4,this.generateCodeChallengeFromVerifier(e)];case 1:return t=r.sent(),[2,{verifier:e,challenge:t}]}})})},n.prototype.generateCodeVerifier=function(){try{var e=new Uint8Array(Do);this.cryptoObj.getRandomValues(e);var t=this.base64Encode.urlEncodeArr(e);return t}catch(r){throw A.createPkceNotGeneratedError(r)}},n.prototype.generateCodeChallengeFromVerifier=function(e){return p(this,void 0,void 0,function(){var t,r;return m(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.cryptoObj.sha256Digest(e)];case 1:return t=i.sent(),[2,this.base64Encode.urlEncodeArr(new Uint8Array(t))];case 2:throw r=i.sent(),A.createPkceNotGeneratedError(r);case 3:return[2]}})})},n}(),Fo="RSASSA-PKCS1-v1_5",Xt="SHA-256",Bo=2048,Ko=new Uint8Array([1,0,1]),$t=function(){function n(e){if(this.logger=e,!this.hasCryptoAPI())throw A.createCryptoNotAvailableError("Browser crypto or msCrypto object not available.");this._keygenAlgorithmOptions={name:Fo,hash:Xt,modulusLength:Bo,publicExponent:Ko}}return n.prototype.sha256Digest=function(e){return p(this,void 0,void 0,function(){var t;return m(this,function(r){return t=Qe.stringToUtf8Arr(e),[2,this.hasIECrypto()?this.getMSCryptoDigest(Xt,t):this.getSubtleCryptoDigest(Xt,t)]})})},n.prototype.getRandomValues=function(e){var t=window.msCrypto||window.crypto;if(!t.getRandomValues)throw A.createCryptoNotAvailableError("getRandomValues does not exist.");t.getRandomValues(e)},n.prototype.generateKeyPair=function(e,t){return p(this,void 0,void 0,function(){return m(this,function(r){return[2,this.hasIECrypto()?this.msCryptoGenerateKey(e,t):window.crypto.subtle.generateKey(this._keygenAlgorithmOptions,e,t)]})})},n.prototype.exportJwk=function(e){return p(this,void 0,void 0,function(){return m(this,function(t){return[2,this.hasIECrypto()?this.msCryptoExportJwk(e):window.crypto.subtle.exportKey(rt,e)]})})},n.prototype.importJwk=function(e,t,r){return p(this,void 0,void 0,function(){var i,a;return m(this,function(s){return i=n.getJwkString(e),a=Qe.stringToArrayBuffer(i),[2,this.hasIECrypto()?this.msCryptoImportKey(a,t,r):window.crypto.subtle.importKey(rt,e,this._keygenAlgorithmOptions,t,r)]})})},n.prototype.sign=function(e,t){return p(this,void 0,void 0,function(){return m(this,function(r){return[2,this.hasIECrypto()?this.msCryptoSign(e,t):window.crypto.subtle.sign(this._keygenAlgorithmOptions,e,t)]})})},n.prototype.hasCryptoAPI=function(){return this.hasIECrypto()||this.hasBrowserCrypto()},n.prototype.hasIECrypto=function(){return"msCrypto"in window},n.prototype.hasBrowserCrypto=function(){return"crypto"in window},n.prototype.getSubtleCryptoDigest=function(e,t){return p(this,void 0,void 0,function(){return m(this,function(r){return[2,window.crypto.subtle.digest(e,t)]})})},n.prototype.getMSCryptoDigest=function(e,t){return p(this,void 0,void 0,function(){return m(this,function(r){return[2,new Promise(function(i,a){var s=window.msCrypto.subtle.digest(e,t.buffer);s.addEventListener("complete",function(u){i(u.target.result)}),s.addEventListener("error",function(u){a(u)})})]})})},n.prototype.msCryptoGenerateKey=function(e,t){return p(this,void 0,void 0,function(){var r=this;return m(this,function(i){return[2,new Promise(function(a,s){var u=window.msCrypto.subtle.generateKey(r._keygenAlgorithmOptions,e,t);u.addEventListener("complete",function(d){a(d.target.result)}),u.addEventListener("error",function(d){s(d)})})]})})},n.prototype.msCryptoExportJwk=function(e){return p(this,void 0,void 0,function(){return m(this,function(t){return[2,new Promise(function(r,i){var a=window.msCrypto.subtle.exportKey(rt,e);a.addEventListener("complete",function(s){var u=s.target.result,d=Qe.utf8ArrToString(new Uint8Array(u)).replace(/\r/g,"").replace(/\n/g,"").replace(/\t/g,"").split(" ").join("").replace("\0","");try{r(JSON.parse(d))}catch(l){i(l)}}),a.addEventListener("error",function(s){i(s)})})]})})},n.prototype.msCryptoImportKey=function(e,t,r){return p(this,void 0,void 0,function(){var i=this;return m(this,function(a){return[2,new Promise(function(s,u){var d=window.msCrypto.subtle.importKey(rt,e,i._keygenAlgorithmOptions,t,r);d.addEventListener("complete",function(l){s(l.target.result)}),d.addEventListener("error",function(l){u(l)})})]})})},n.prototype.msCryptoSign=function(e,t){return p(this,void 0,void 0,function(){var r=this;return m(this,function(i){return[2,new Promise(function(a,s){var u=window.msCrypto.subtle.sign(r._keygenAlgorithmOptions,e,t);u.addEventListener("complete",function(d){a(d.target.result)}),u.addEventListener("error",function(d){s(d)})})]})})},n.getJwkString=function(e){return JSON.stringify(e,Object.keys(e).sort())},n}(),qo=function(){function n(){this.dbName=Jt,this.version=ko,this.tableName=Uo,this.dbOpen=!1}return n.prototype.open=function(){return p(this,void 0,void 0,function(){var e=this;return m(this,function(t){return[2,new Promise(function(r,i){var a=window.indexedDB.open(e.dbName,e.version);a.addEventListener("upgradeneeded",function(s){var u=s;u.target.result.createObjectStore(e.tableName)}),a.addEventListener("success",function(s){var u=s;e.db=u.target.result,e.dbOpen=!0,r()}),a.addEventListener("error",function(){return i(A.createDatabaseUnavailableError())})})]})})},n.prototype.validateDbIsOpen=function(){return p(this,void 0,void 0,function(){return m(this,function(e){switch(e.label){case 0:return this.dbOpen?[3,2]:[4,this.open()];case 1:return[2,e.sent()];case 2:return[2]}})})},n.prototype.getItem=function(e){return p(this,void 0,void 0,function(){var t=this;return m(this,function(r){switch(r.label){case 0:return[4,this.validateDbIsOpen()];case 1:return r.sent(),[2,new Promise(function(i,a){if(!t.db)return a(A.createDatabaseNotOpenError());var s=t.db.transaction([t.tableName],"readonly"),u=s.objectStore(t.tableName),d=u.get(e);d.addEventListener("success",function(l){var f=l;i(f.target.result)}),d.addEventListener("error",function(l){return a(l)})})]}})})},n.prototype.setItem=function(e,t){return p(this,void 0,void 0,function(){var r=this;return m(this,function(i){switch(i.label){case 0:return[4,this.validateDbIsOpen()];case 1:return i.sent(),[2,new Promise(function(a,s){if(!r.db)return s(A.createDatabaseNotOpenError());var u=r.db.transaction([r.tableName],"readwrite"),d=u.objectStore(r.tableName),l=d.put(t,e);l.addEventListener("success",function(){return a()}),l.addEventListener("error",function(f){return s(f)})})]}})})},n.prototype.removeItem=function(e){return p(this,void 0,void 0,function(){var t=this;return m(this,function(r){switch(r.label){case 0:return[4,this.validateDbIsOpen()];case 1:return r.sent(),[2,new Promise(function(i,a){if(!t.db)return a(A.createDatabaseNotOpenError());var s=t.db.transaction([t.tableName],"readwrite"),u=s.objectStore(t.tableName),d=u.delete(e);d.addEventListener("success",function(){return i()}),d.addEventListener("error",function(l){return a(l)})})]}})})},n.prototype.getKeys=function(){return p(this,void 0,void 0,function(){var e=this;return m(this,function(t){switch(t.label){case 0:return[4,this.validateDbIsOpen()];case 1:return t.sent(),[2,new Promise(function(r,i){if(!e.db)return i(A.createDatabaseNotOpenError());var a=e.db.transaction([e.tableName],"readonly"),s=a.objectStore(e.tableName),u=s.getAllKeys();u.addEventListener("success",function(d){var l=d;r(l.target.result)}),u.addEventListener("error",function(d){return i(d)})})]}})})},n.prototype.containsKey=function(e){return p(this,void 0,void 0,function(){var t=this;return m(this,function(r){switch(r.label){case 0:return[4,this.validateDbIsOpen()];case 1:return r.sent(),[2,new Promise(function(i,a){if(!t.db)return a(A.createDatabaseNotOpenError());var s=t.db.transaction([t.tableName],"readonly"),u=s.objectStore(t.tableName),d=u.count(e);d.addEventListener("success",function(l){var f=l;i(f.target.result===1)}),d.addEventListener("error",function(l){return a(l)})})]}})})},n.prototype.deleteDatabase=function(){return p(this,void 0,void 0,function(){return m(this,function(e){return[2,new Promise(function(t,r){var i=window.indexedDB.deleteDatabase(Jt);i.addEventListener("success",function(){return t(!0)}),i.addEventListener("error",function(){return r(!1)})})]})})},n}(),Zt=function(){function n(){this.cache=new Map}return n.prototype.getItem=function(e){return this.cache.get(e)||null},n.prototype.setItem=function(e,t){this.cache.set(e,t)},n.prototype.removeItem=function(e){this.cache.delete(e)},n.prototype.getKeys=function(){var e=[];return this.cache.forEach(function(t,r){e.push(r)}),e},n.prototype.containsKey=function(e){return this.cache.has(e)},n.prototype.clear=function(){this.cache.clear()},n}(),$r=function(){function n(e){this.inMemoryCache=new Zt,this.indexedDBCache=new qo,this.logger=e}return n.prototype.handleDatabaseAccessError=function(e){e instanceof A&&e.errorCode===S.databaseUnavailable.code&&this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.")},n.prototype.getItem=function(e){return p(this,void 0,void 0,function(){var t,r;return m(this,function(i){switch(i.label){case 0:if(t=this.inMemoryCache.getItem(e),t)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),[4,this.indexedDBCache.getItem(e)];case 2:return[2,i.sent()];case 3:return r=i.sent(),this.handleDatabaseAccessError(r),[3,4];case 4:return[2,t]}})})},n.prototype.setItem=function(e,t){return p(this,void 0,void 0,function(){var r;return m(this,function(i){switch(i.label){case 0:this.inMemoryCache.setItem(e,t),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.indexedDBCache.setItem(e,t)];case 2:return i.sent(),[3,4];case 3:return r=i.sent(),this.handleDatabaseAccessError(r),[3,4];case 4:return[2]}})})},n.prototype.removeItem=function(e){return p(this,void 0,void 0,function(){var t;return m(this,function(r){switch(r.label){case 0:this.inMemoryCache.removeItem(e),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.indexedDBCache.removeItem(e)];case 2:return r.sent(),[3,4];case 3:return t=r.sent(),this.handleDatabaseAccessError(t),[3,4];case 4:return[2]}})})},n.prototype.getKeys=function(){return p(this,void 0,void 0,function(){var e,t;return m(this,function(r){switch(r.label){case 0:if(e=this.inMemoryCache.getKeys(),e.length!==0)return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),this.logger.verbose("In-memory cache is empty, now querying persistent storage."),[4,this.indexedDBCache.getKeys()];case 2:return[2,r.sent()];case 3:return t=r.sent(),this.handleDatabaseAccessError(t),[3,4];case 4:return[2,e]}})})},n.prototype.containsKey=function(e){return p(this,void 0,void 0,function(){var t,r;return m(this,function(i){switch(i.label){case 0:if(t=this.inMemoryCache.containsKey(e),t)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),[4,this.indexedDBCache.containsKey(e)];case 2:return[2,i.sent()];case 3:return r=i.sent(),this.handleDatabaseAccessError(r),[3,4];case 4:return[2,t]}})})},n.prototype.clear=function(){return p(this,void 0,void 0,function(){var e;return m(this,function(t){switch(t.label){case 0:this.inMemoryCache.clear(),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.indexedDBCache.deleteDatabase()];case 2:return t.sent(),[3,4];case 3:return e=t.sent(),this.handleDatabaseAccessError(e),[3,4];case 4:return[2]}})})},n}(),Zr=function(){function n(e){this.logger=e,this.browserCrypto=new $t(this.logger),this.b64Encode=new Xr,this.b64Decode=new Lo,this.guidGenerator=new Mo(this.browserCrypto),this.pkceGenerator=new Ho(this.browserCrypto),this.cache={asymmetricKeys:new $r(this.logger),symmetricKeys:new $r(this.logger)}}return n.prototype.createNewGuid=function(){return this.guidGenerator.generateGuid()},n.prototype.base64Encode=function(e){return this.b64Encode.encode(e)},n.prototype.base64Decode=function(e){return this.b64Decode.decode(e)},n.prototype.generatePkceCodes=function(){return p(this,void 0,void 0,function(){return m(this,function(e){return[2,this.pkceGenerator.generateCodes()]})})},n.prototype.getPublicKeyThumbprint=function(e){return p(this,void 0,void 0,function(){var t,r,i,a,s,u,d;return m(this,function(l){switch(l.label){case 0:return[4,this.browserCrypto.generateKeyPair(n.EXTRACTABLE,n.POP_KEY_USAGES)];case 1:return t=l.sent(),[4,this.browserCrypto.exportJwk(t.publicKey)];case 2:return r=l.sent(),i={e:r.e,kty:r.kty,n:r.n},a=$t.getJwkString(i),[4,this.hashString(a)];case 3:return s=l.sent(),[4,this.browserCrypto.exportJwk(t.privateKey)];case 4:return u=l.sent(),[4,this.browserCrypto.importJwk(u,!1,["sign"])];case 5:return d=l.sent(),[4,this.cache.asymmetricKeys.setItem(s,{privateKey:d,publicKey:t.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri})];case 6:return l.sent(),[2,s]}})})},n.prototype.removeTokenBindingKey=function(e){return p(this,void 0,void 0,function(){var t;return m(this,function(r){switch(r.label){case 0:return[4,this.cache.asymmetricKeys.removeItem(e)];case 1:return r.sent(),[4,this.cache.asymmetricKeys.containsKey(e)];case 2:return t=r.sent(),[2,!t]}})})},n.prototype.clearKeystore=function(){return p(this,void 0,void 0,function(){var e,t,r;return m(this,function(i){switch(i.label){case 0:return e=Object.keys(this.cache),t=this.cache[e[0]],t?[4,t.deleteDatabase()]:[3,2];case 1:return r=i.sent(),[3,3];case 2:r=!1,i.label=3;case 3:return[2,r]}})})},n.prototype.signJwt=function(e,t){return p(this,void 0,void 0,function(){var r,i,a,s,u,d,l,f,y,w;return m(this,function(U){switch(U.label){case 0:return[4,this.cache.asymmetricKeys.getItem(t)];case 1:if(r=U.sent(),!r)throw A.createSigningKeyNotFoundInStorageError(t);return[4,this.browserCrypto.exportJwk(r.publicKey)];case 2:return i=U.sent(),a=$t.getJwkString(i),s={alg:i.alg,type:rt},u=this.b64Encode.urlEncode(JSON.stringify(s)),e.cnf={jwk:JSON.parse(a)},d=this.b64Encode.urlEncode(JSON.stringify(e)),l=u+"."+d,f=Qe.stringToArrayBuffer(l),[4,this.browserCrypto.sign(r.privateKey,f)];case 3:return y=U.sent(),w=this.b64Encode.urlEncodeArr(new Uint8Array(y)),[2,l+"."+w]}})})},n.prototype.hashString=function(e){return p(this,void 0,void 0,function(){var t,r;return m(this,function(i){switch(i.label){case 0:return[4,this.browserCrypto.sha256Digest(e)];case 1:return t=i.sent(),r=new Uint8Array(t),[2,this.b64Encode.urlEncodeArr(r)]}})})},n.POP_KEY_USAGES=["sign","verify"],n.EXTRACTABLE=!0,n}(),de={redirectUriNotSet:{code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},postLogoutUriNotSet:{code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},storageNotSupportedError:{code:"storage_not_supported",desc:"Given storage configuration option was not supported."},noRedirectCallbacksSet:{code:"no_redirect_callbacks",desc:"No redirect callbacks have been set. Please call setRedirectCallbacks() with the appropriate function arguments before continuing. More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics."},invalidCallbackObject:{code:"invalid_callback_object",desc:"The object passed for the callback was invalid. More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics."},stubPcaInstanceCalled:{code:"stubbed_public_client_application_called",desc:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors"},inMemRedirectUnavailable:{code:"in_mem_redirect_unavailable",desc:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."}},re=function(n){h(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.name="BrowserConfigurationAuthError",Object.setPrototypeOf(i,e.prototype),i}return e.createRedirectUriEmptyError=function(){return new e(de.redirectUriNotSet.code,de.redirectUriNotSet.desc)},e.createPostLogoutRedirectUriEmptyError=function(){return new e(de.postLogoutUriNotSet.code,de.postLogoutUriNotSet.desc)},e.createStorageNotSupportedError=function(t){return new e(de.storageNotSupportedError.code,de.storageNotSupportedError.desc+" Given Location: "+t)},e.createRedirectCallbacksNotSetError=function(){return new e(de.noRedirectCallbacksSet.code,de.noRedirectCallbacksSet.desc)},e.createStubPcaInstanceCalledError=function(){return new e(de.stubPcaInstanceCalled.code,de.stubPcaInstanceCalled.desc)},e.createInMemoryRedirectUnavailableError=function(){return new e(de.inMemRedirectUnavailable.code,de.inMemRedirectUnavailable.desc)},e}(k),en=function(){function n(e){this.validateWindowStorage(e),this.windowStorage=window[e]}return n.prototype.validateWindowStorage=function(e){if(e!==o.BrowserCacheLocation.LocalStorage&&e!==o.BrowserCacheLocation.SessionStorage)throw re.createStorageNotSupportedError(e);var t=!!window[e];if(!t)throw re.createStorageNotSupportedError(e)},n.prototype.getItem=function(e){return this.windowStorage.getItem(e)},n.prototype.setItem=function(e,t){this.windowStorage.setItem(e,t)},n.prototype.removeItem=function(e){this.windowStorage.removeItem(e)},n.prototype.getKeys=function(){return Object.keys(this.windowStorage)},n.prototype.containsKey=function(e){return this.windowStorage.hasOwnProperty(e)},n}(),tn=function(){function n(){}return n.extractBrowserRequestState=function(e,t){if(_.isEmpty(t))return null;try{var r=Ye.parseRequestState(e,t);return r.libraryState.meta}catch(i){throw b.createInvalidStateError(t,i)}},n.parseServerResponseFromHash=function(e){if(!e)return{};var t=new j(e);return j.getDeserializedHash(t.getHash())},n}(),er=function(n){h(e,n);function e(t,r,i,a){var s=n.call(this,t,i)||this;return s.COOKIE_LIFE_MULTIPLIER=24*60*60*1e3,s.cacheConfig=r,s.logger=a,s.internalStorage=new Zt,s.browserStorage=s.setupBrowserStorage(s.cacheConfig.cacheLocation),s.temporaryCacheStorage=s.setupTemporaryCacheStorage(s.cacheConfig.cacheLocation),s.migrateCacheEntries(),s}return e.prototype.setupBrowserStorage=function(t){switch(t){case o.BrowserCacheLocation.LocalStorage:case o.BrowserCacheLocation.SessionStorage:try{return new en(t)}catch(r){this.logger.verbose(r);break}case o.BrowserCacheLocation.MemoryStorage:}return this.cacheConfig.cacheLocation=o.BrowserCacheLocation.MemoryStorage,new Zt},e.prototype.setupTemporaryCacheStorage=function(t){switch(t){case o.BrowserCacheLocation.LocalStorage:case o.BrowserCacheLocation.SessionStorage:try{return new en(o.BrowserCacheLocation.SessionStorage)}catch(r){return this.logger.verbose(r),this.internalStorage}case o.BrowserCacheLocation.MemoryStorage:default:return this.internalStorage}},e.prototype.migrateCacheEntries=function(){var t=this,r=E.CACHE_PREFIX+"."+M.ID_TOKEN,i=E.CACHE_PREFIX+"."+M.CLIENT_INFO,a=E.CACHE_PREFIX+"."+M.ERROR,s=E.CACHE_PREFIX+"."+M.ERROR_DESC,u=this.browserStorage.getItem(r),d=this.browserStorage.getItem(i),l=this.browserStorage.getItem(a),f=this.browserStorage.getItem(s),y=[u,d,l,f],w=[M.ID_TOKEN,M.CLIENT_INFO,M.ERROR,M.ERROR_DESC];w.forEach(function(U,P){return t.migrateCacheEntry(U,y[P])})},e.prototype.migrateCacheEntry=function(t,r){r&&this.setTemporaryCache(t,r,!0)},e.prototype.validateAndParseJson=function(t){try{var r=JSON.parse(t);return r&&typeof r=="object"?r:null}catch(i){return null}},e.prototype.getItem=function(t){return this.browserStorage.getItem(t)},e.prototype.setItem=function(t,r){this.browserStorage.setItem(t,r)},e.prototype.getAccount=function(t){var r=this.getItem(t);if(!r)return null;var i=this.validateAndParseJson(r);return!i||!ae.isAccountEntity(i)?null:he.toObject(new ae,i)},e.prototype.setAccount=function(t){this.logger.trace("BrowserCacheManager.setAccount called");var r=t.generateAccountKey();this.setItem(r,JSON.stringify(t))},e.prototype.getIdTokenCredential=function(t){var r=this.getItem(t);if(!r)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null;var i=this.validateAndParseJson(r);return!i||!wt.isIdTokenEntity(i)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),he.toObject(new wt,i))},e.prototype.setIdTokenCredential=function(t){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");var r=t.generateCredentialKey();this.setItem(r,JSON.stringify(t))},e.prototype.getAccessTokenCredential=function(t){var r=this.getItem(t);if(!r)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null;var i=this.validateAndParseJson(r);return!i||!Tt.isAccessTokenEntity(i)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),he.toObject(new Tt,i))},e.prototype.setAccessTokenCredential=function(t){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");var r=t.generateCredentialKey();this.setItem(r,JSON.stringify(t))},e.prototype.getRefreshTokenCredential=function(t){var r=this.getItem(t);if(!r)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null;var i=this.validateAndParseJson(r);return!i||!Vt.isRefreshTokenEntity(i)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),he.toObject(new Vt,i))},e.prototype.setRefreshTokenCredential=function(t){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");var r=t.generateCredentialKey();this.setItem(r,JSON.stringify(t))},e.prototype.getAppMetadata=function(t){var r=this.getItem(t);if(!r)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;var i=this.validateAndParseJson(r);return!i||!xt.isAppMetadataEntity(t,i)?(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),he.toObject(new xt,i))},e.prototype.setAppMetadata=function(t){this.logger.trace("BrowserCacheManager.setAppMetadata called");var r=t.generateAppMetadataKey();this.setItem(r,JSON.stringify(t))},e.prototype.getServerTelemetry=function(t){var r=this.getItem(t);if(!r)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;var i=this.validateAndParseJson(r);return!i||!bt.isServerTelemetryEntity(t,i)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),he.toObject(new bt,i))},e.prototype.setServerTelemetry=function(t,r){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(t,JSON.stringify(r))},e.prototype.getAuthorityMetadata=function(t){var r=this.internalStorage.getItem(t);if(!r)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;var i=this.validateAndParseJson(r);return i&&Qt.isAuthorityMetadataEntity(t,i)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),he.toObject(new Qt,i)):null},e.prototype.getAuthorityMetadataKeys=function(){var t=this,r=this.internalStorage.getKeys();return r.filter(function(i){return t.isAuthorityMetadata(i)})},e.prototype.setWrapperMetadata=function(t,r){this.internalStorage.setItem(xe.WRAPPER_SKU,t),this.internalStorage.setItem(xe.WRAPPER_VER,r)},e.prototype.getWrapperMetadata=function(){var t=this.internalStorage.getItem(xe.WRAPPER_SKU)||"",r=this.internalStorage.getItem(xe.WRAPPER_VER)||"";return[t,r]},e.prototype.setAuthorityMetadata=function(t,r){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(t,JSON.stringify(r))},e.prototype.getActiveAccount=function(){var t=this.generateCacheKey(M.ACTIVE_ACCOUNT),r=this.browserStorage.getItem(t);return r&&this.getAccountInfoByFilter({localAccountId:r})[0]||null},e.prototype.setActiveAccount=function(t){var r=this.generateCacheKey(M.ACTIVE_ACCOUNT);t?(this.logger.verbose("setActiveAccount: Active account set"),this.browserStorage.setItem(r,t.localAccountId)):(this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(r))},e.prototype.getAccountInfoByFilter=function(t){var r=this.getAllAccounts();return r.filter(function(i){return!(t.username&&t.username.toLowerCase()!==i.username.toLowerCase()||t.homeAccountId&&t.homeAccountId!==i.homeAccountId||t.localAccountId&&t.localAccountId!==i.localAccountId||t.tenantId&&t.tenantId!==i.tenantId||t.environment&&t.environment!==i.environment)})},e.prototype.getThrottlingCache=function(t){var r=this.getItem(t);if(!r)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;var i=this.validateAndParseJson(r);return!i||!Qr.isThrottlingEntity(t,i)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),he.toObject(new Qr,i))},e.prototype.setThrottlingCache=function(t,r){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(t,JSON.stringify(r))},e.prototype.getTemporaryCache=function(t,r){var i=r?this.generateCacheKey(t):t;if(this.cacheConfig.storeAuthStateInCookie){var a=this.getItemCookie(i);if(a)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),a}var s=this.temporaryCacheStorage.getItem(i);if(!s){if(this.cacheConfig.cacheLocation===o.BrowserCacheLocation.LocalStorage){var u=this.browserStorage.getItem(i);if(u)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),u}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),s},e.prototype.setTemporaryCache=function(t,r,i){var a=i?this.generateCacheKey(t):t;this.temporaryCacheStorage.setItem(a,r),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.setItemCookie(a,r))},e.prototype.removeItem=function(t){return this.browserStorage.removeItem(t),this.temporaryCacheStorage.removeItem(t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.clearItemCookie(t)),!0},e.prototype.containsKey=function(t){return this.browserStorage.containsKey(t)||this.temporaryCacheStorage.containsKey(t)},e.prototype.getKeys=function(){return G(this.browserStorage.getKeys(),this.temporaryCacheStorage.getKeys())},e.prototype.clear=function(){return p(this,void 0,void 0,function(){var t=this;return m(this,function(r){switch(r.label){case 0:return[4,this.removeAllAccounts()];case 1:return r.sent(),this.removeAppMetadata(),this.getKeys().forEach(function(i){(t.browserStorage.containsKey(i)||t.temporaryCacheStorage.containsKey(i))&&(i.indexOf(E.CACHE_PREFIX)!==-1||i.indexOf(t.clientId)!==-1)&&t.removeItem(i)}),this.internalStorage.clear(),[2]}})})},e.prototype.setItemCookie=function(t,r,i){var a=encodeURIComponent(t)+"="+encodeURIComponent(r)+";path=/;";if(i){var s=this.getCookieExpirationTime(i);a+="expires="+s+";"}this.cacheConfig.secureCookies&&(a+="Secure;"),document.cookie=a},e.prototype.getItemCookie=function(t){for(var r=encodeURIComponent(t)+"=",i=document.cookie.split(";"),a=0;a<i.length;a++){for(var s=i[a];s.charAt(0)===" ";)s=s.substring(1);if(s.indexOf(r)===0)return decodeURIComponent(s.substring(r.length,s.length))}return""},e.prototype.clearMsalCookies=function(){var t=this,r=E.CACHE_PREFIX+"."+this.clientId,i=document.cookie.split(";");i.forEach(function(a){for(;a.charAt(0)===" ";)a=a.substring(1);if(a.indexOf(r)===0){var s=a.split("=")[0];t.clearItemCookie(s)}})},e.prototype.clearItemCookie=function(t){this.setItemCookie(t,"",-1)},e.prototype.getCookieExpirationTime=function(t){var r=new Date,i=new Date(r.getTime()+t*this.COOKIE_LIFE_MULTIPLIER);return i.toUTCString()},e.prototype.getCache=function(){return this.browserStorage},e.prototype.setCache=function(){},e.prototype.generateCacheKey=function(t){var r=this.validateAndParseJson(t);return r?JSON.stringify(t):_.startsWith(t,E.CACHE_PREFIX)||_.startsWith(t,M.ADAL_ID_TOKEN)?t:E.CACHE_PREFIX+"."+this.clientId+"."+t},e.prototype.generateAuthorityKey=function(t){var r=Ye.parseRequestState(this.cryptoImpl,t).libraryState.id;return this.generateCacheKey(o.TemporaryCacheKeys.AUTHORITY+"."+r)},e.prototype.generateNonceKey=function(t){var r=Ye.parseRequestState(this.cryptoImpl,t).libraryState.id;return this.generateCacheKey(o.TemporaryCacheKeys.NONCE_IDTOKEN+"."+r)},e.prototype.generateStateKey=function(t){var r=Ye.parseRequestState(this.cryptoImpl,t).libraryState.id;return this.generateCacheKey(o.TemporaryCacheKeys.REQUEST_STATE+"."+r)},e.prototype.getCachedAuthority=function(t){var r=this.generateStateKey(t),i=this.getTemporaryCache(r);if(!i)return null;var a=this.generateAuthorityKey(i);return this.getTemporaryCache(a)},e.prototype.updateCacheEntries=function(t,r,i,a,s){this.logger.trace("BrowserCacheManager.updateCacheEntries called");var u=this.generateStateKey(t);this.setTemporaryCache(u,t,!1);var d=this.generateNonceKey(t);this.setTemporaryCache(d,r,!1);var l=this.generateAuthorityKey(t);if(this.setTemporaryCache(l,i,!1),s){var f={credential:s.homeAccountId,type:ue.HOME_ACCOUNT_ID};this.setTemporaryCache(o.TemporaryCacheKeys.CCS_CREDENTIAL,JSON.stringify(f),!0)}else if(!_.isEmpty(a)){var f={credential:a,type:ue.UPN};this.setTemporaryCache(o.TemporaryCacheKeys.CCS_CREDENTIAL,JSON.stringify(f),!0)}},e.prototype.resetRequestCache=function(t){var r=this;this.logger.trace("BrowserCacheManager.resetRequestCache called"),_.isEmpty(t)||this.getKeys().forEach(function(i){i.indexOf(t)!==-1&&r.removeItem(i)}),t&&(this.removeItem(this.generateStateKey(t)),this.removeItem(this.generateNonceKey(t)),this.removeItem(this.generateAuthorityKey(t))),this.removeItem(this.generateCacheKey(o.TemporaryCacheKeys.REQUEST_PARAMS)),this.removeItem(this.generateCacheKey(o.TemporaryCacheKeys.ORIGIN_URI)),this.removeItem(this.generateCacheKey(o.TemporaryCacheKeys.URL_HASH)),this.removeItem(this.generateCacheKey(o.TemporaryCacheKeys.CORRELATION_ID)),this.removeItem(this.generateCacheKey(o.TemporaryCacheKeys.CCS_CREDENTIAL)),this.setInteractionInProgress(!1)},e.prototype.cleanRequestByState=function(t){if(this.logger.trace("BrowserCacheManager.cleanRequestByState called"),t){var r=this.generateStateKey(t),i=this.temporaryCacheStorage.getItem(r);this.logger.infoPii("BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: "+i),this.resetRequestCache(i||"")}this.clearMsalCookies()},e.prototype.cleanRequestByInteractionType=function(t){var r=this;this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.getKeys().forEach(function(i){if(i.indexOf(o.TemporaryCacheKeys.REQUEST_STATE)!==-1){var a=r.temporaryCacheStorage.getItem(i);if(!!a){var s=tn.extractBrowserRequestState(r.cryptoImpl,a);s&&s.interactionType===t&&(r.logger.infoPii("BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: "+a),r.resetRequestCache(a))}}}),this.clearMsalCookies(),this.setInteractionInProgress(!1)},e.prototype.cacheCodeRequest=function(t,r){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");var i=r.base64Encode(JSON.stringify(t));this.setTemporaryCache(o.TemporaryCacheKeys.REQUEST_PARAMS,i,!0)},e.prototype.getCachedRequest=function(t,r){this.logger.trace("BrowserCacheManager.getCachedRequest called");var i=this.getTemporaryCache(o.TemporaryCacheKeys.REQUEST_PARAMS,!0);if(!i)throw A.createNoTokenRequestCacheError();var a=this.validateAndParseJson(r.base64Decode(i));if(!a)throw A.createUnableToParseTokenRequestCacheError();if(this.removeItem(this.generateCacheKey(o.TemporaryCacheKeys.REQUEST_PARAMS)),_.isEmpty(a.authority)){var s=this.generateAuthorityKey(t),u=this.getTemporaryCache(s);if(!u)throw A.createNoCachedAuthorityError();a.authority=u}return a},e.prototype.isInteractionInProgress=function(t){var r=this.getInteractionInProgress();return t?r===this.clientId:!!r},e.prototype.getInteractionInProgress=function(){var t=E.CACHE_PREFIX+"."+o.TemporaryCacheKeys.INTERACTION_STATUS_KEY;return this.getTemporaryCache(t,!1)},e.prototype.setInteractionInProgress=function(t){var r=E.CACHE_PREFIX+"."+o.TemporaryCacheKeys.INTERACTION_STATUS_KEY;if(t){if(this.getInteractionInProgress())throw A.createInteractionInProgressError();this.setTemporaryCache(r,this.clientId,!1)}else!t&&this.getInteractionInProgress()===this.clientId&&this.removeItem(r)},e.prototype.getLegacyLoginHint=function(){var t=this.getTemporaryCache(M.ADAL_ID_TOKEN);t&&(this.browserStorage.removeItem(M.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));var r=this.getTemporaryCache(M.ID_TOKEN,!0);r&&(this.removeItem(this.generateCacheKey(M.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));var i=r||t;if(i){var a=new Ne(i,this.cryptoImpl);if(a.claims&&a.claims.preferred_username)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint"),a.claims.preferred_username;if(a.claims&&a.claims.upn)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint"),a.claims.upn;this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, however, no account hint claim found. Enable preferred_username or upn id token claim to get SSO.")}return null},e.prototype.updateCredentialCacheKey=function(t,r){var i=r.generateCredentialKey();if(t!==i){var a=this.getItem(t);if(a)return this.removeItem(t),this.setItem(i,a),this.logger.verbose("Updated an outdated "+r.credentialType+" cache key"),i;this.logger.error("Attempted to update an outdated "+r.credentialType+" cache key but no item matching the outdated key was found in storage")}return t},e}(he),Go=function(n,e){var t={cacheLocation:o.BrowserCacheLocation.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1};return new er(n,t,yt,e)},zo=function(){function n(){}return n.prototype.sendGetRequestAsync=function(e,t){return p(this,void 0,void 0,function(){var r,i,a;return m(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,fetch(e,{method:ve.GET,headers:this.getFetchHeaders(t)})];case 1:return r=s.sent(),[3,3];case 2:throw i=s.sent(),window.navigator.onLine?A.createGetRequestFailedError(i,e):A.createNoNetworkConnectivityError();case 3:return s.trys.push([3,5,,6]),a={headers:this.getHeaderDict(r.headers)},[4,r.json()];case 4:return[2,(a.body=s.sent(),a.status=r.status,a)];case 5:throw s.sent(),A.createFailedToParseNetworkResponseError(e);case 6:return[2]}})})},n.prototype.sendPostRequestAsync=function(e,t){return p(this,void 0,void 0,function(){var r,i,a,s;return m(this,function(u){switch(u.label){case 0:r=t&&t.body||"",u.label=1;case 1:return u.trys.push([1,3,,4]),[4,fetch(e,{method:ve.POST,headers:this.getFetchHeaders(t),body:r})];case 2:return i=u.sent(),[3,4];case 3:throw a=u.sent(),window.navigator.onLine?A.createPostRequestFailedError(a,e):A.createNoNetworkConnectivityError();case 4:return u.trys.push([4,6,,7]),s={headers:this.getHeaderDict(i.headers)},[4,i.json()];case 5:return[2,(s.body=u.sent(),s.status=i.status,s)];case 6:throw u.sent(),A.createFailedToParseNetworkResponseError(e);case 7:return[2]}})})},n.prototype.getFetchHeaders=function(e){var t=new Headers;if(!(e&&e.headers))return t;var r=e.headers;return Object.keys(r).forEach(function(i){t.append(i,r[i])}),t},n.prototype.getHeaderDict=function(e){var t={};return e.forEach(function(r,i){t[i]=r}),t},n}(),Wo=function(){function n(){}return n.prototype.sendGetRequestAsync=function(e,t){return p(this,void 0,void 0,function(){return m(this,function(r){return[2,this.sendRequestAsync(e,ve.GET,t)]})})},n.prototype.sendPostRequestAsync=function(e,t){return p(this,void 0,void 0,function(){return m(this,function(r){return[2,this.sendRequestAsync(e,ve.POST,t)]})})},n.prototype.sendRequestAsync=function(e,t,r){var i=this;return new Promise(function(a,s){var u=new XMLHttpRequest;if(u.open(t,e,!0),i.setXhrHeaders(u,r),u.onload=function(){(u.status<200||u.status>=300)&&(t===ve.POST?s(A.createPostRequestFailedError("Failed with status "+u.status,e)):s(A.createGetRequestFailedError("Failed with status "+u.status,e)));try{var d=JSON.parse(u.responseText),l={headers:i.getHeaderDict(u),body:d,status:u.status};a(l)}catch(f){s(A.createFailedToParseNetworkResponseError(e))}},u.onerror=function(){window.navigator.onLine?t===ve.POST?s(A.createPostRequestFailedError("Failed with status "+u.status,e)):s(A.createGetRequestFailedError("Failed with status "+u.status,e)):s(A.createNoNetworkConnectivityError())},t===ve.POST&&r&&r.body)u.send(r.body);else if(t===ve.GET)u.send();else throw A.createHttpMethodNotImplementedError(t)})},n.prototype.setXhrHeaders=function(e,t){if(t&&t.headers){var r=t.headers;Object.keys(r).forEach(function(i){e.setRequestHeader(i,r[i])})}},n.prototype.getHeaderDict=function(e){var t=e.getAllResponseHeaders(),r=t.trim().split(/[\r\n]+/),i={};return r.forEach(function(a){var s=a.split(": "),u=s.shift(),d=s.join(": ");u&&d&&(i[u]=d)}),i},n}(),J=function(){function n(){}return n.clearHash=function(e){e.location.hash=E.EMPTY_STRING,typeof e.history.replaceState=="function"&&e.history.replaceState(null,E.EMPTY_STRING,""+e.location.origin+e.location.pathname+e.location.search)},n.replaceHash=function(e){var t=e.split("#");t.shift(),window.location.hash=t.length>0?t.join("#"):""},n.isInIframe=function(){return window.parent!==window},n.isInPopup=function(){return typeof window!="undefined"&&!!window.opener&&window.opener!==window&&typeof window.name=="string"&&window.name.indexOf(le.POPUP_NAME_PREFIX+".")===0},n.getCurrentUri=function(){return window.location.href.split("?")[0].split("#")[0]},n.getHomepage=function(){var e=new j(window.location.href),t=e.getUrlComponents();return t.Protocol+"//"+t.HostNameAndPort+"/"},n.getBrowserNetworkClient=function(){return window.fetch&&window.Headers?new zo:new Wo},n.blockReloadInHiddenIframes=function(){var e=j.hashContainsKnownProperties(window.location.hash);if(e&&n.isInIframe())throw A.createBlockReloadInHiddenIframeError()},n.blockRedirectInIframe=function(e,t){var r=n.isInIframe();if(e===o.InteractionType.Redirect&&r&&!t)throw A.createRedirectInIframeError(r)},n.blockAcquireTokenInPopups=function(){if(n.isInPopup())throw A.createBlockAcquireTokenInPopupsError()},n.blockNonBrowserEnvironment=function(e){if(!e)throw A.createNonBrowserEnvironmentError()},n.detectIEOrEdge=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE "),r=e.indexOf("Trident/"),i=e.indexOf("Edge/"),a=t>0||r>0,s=i>0;return a||s},n}(),rn=function(){function n(){}return n.prototype.navigateInternal=function(e,t){return n.defaultNavigateWindow(e,t)},n.prototype.navigateExternal=function(e,t){return n.defaultNavigateWindow(e,t)},n.defaultNavigateWindow=function(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise(function(r){setTimeout(function(){r(!0)},t.timeout)})},n}(),jo=6e4,Ot=6e3,Vo=3e4;function Yo(n,e){var t=n.auth,r=n.cache,i=n.system,a={clientId:"",authority:""+E.DEFAULT_AUTHORITY,knownAuthorities:[],cloudDiscoveryMetadata:"",authorityMetadata:"",redirectUri:"",postLogoutRedirectUri:"",navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:o.ProtocolMode.AAD,azureCloudOptions:{azureCloudInstance:o.AzureCloudInstance.None,tenant:""}},s={cacheLocation:o.BrowserCacheLocation.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1},u={loggerCallback:function(){},logLevel:o.LogLevel.Info,piiLoggingEnabled:!1},d=g(g({},Wr),{loggerOptions:u,networkClient:e?J.getBrowserNetworkClient():Oo,navigationClient:new rn,loadFrameTimeout:0,windowHashTimeout:i&&i.loadFrameTimeout||jo,iframeHashTimeout:i&&i.loadFrameTimeout||Ot,navigateFrameWait:e&&J.detectIEOrEdge()?500:0,redirectNavigationTimeout:Vo,asyncPopups:!1,allowRedirectInIframe:!1}),l={auth:g(g({},a),t),cache:g(g({},s),r),system:g(g({},d),i)};return l}var nn="@azure/msal-browser",nt="2.22.0";o.EventType=void 0,function(n){n.ACCOUNT_ADDED="msal:accountAdded",n.ACCOUNT_REMOVED="msal:accountRemoved",n.LOGIN_START="msal:loginStart",n.LOGIN_SUCCESS="msal:loginSuccess",n.LOGIN_FAILURE="msal:loginFailure",n.ACQUIRE_TOKEN_START="msal:acquireTokenStart",n.ACQUIRE_TOKEN_SUCCESS="msal:acquireTokenSuccess",n.ACQUIRE_TOKEN_FAILURE="msal:acquireTokenFailure",n.ACQUIRE_TOKEN_NETWORK_START="msal:acquireTokenFromNetworkStart",n.SSO_SILENT_START="msal:ssoSilentStart",n.SSO_SILENT_SUCCESS="msal:ssoSilentSuccess",n.SSO_SILENT_FAILURE="msal:ssoSilentFailure",n.ACQUIRE_TOKEN_BY_CODE_START="msal:acquireTokenByCodeStart",n.ACQUIRE_TOKEN_BY_CODE_SUCCESS="msal:acquireTokenByCodeSuccess",n.ACQUIRE_TOKEN_BY_CODE_FAILURE="msal:acquireTokenByCodeFailure",n.HANDLE_REDIRECT_START="msal:handleRedirectStart",n.HANDLE_REDIRECT_END="msal:handleRedirectEnd",n.POPUP_OPENED="msal:popupOpened",n.LOGOUT_START="msal:logoutStart",n.LOGOUT_SUCCESS="msal:logoutSuccess",n.LOGOUT_FAILURE="msal:logoutFailure",n.LOGOUT_END="msal:logoutEnd"}(o.EventType||(o.EventType={}));var on=function(){function n(e,t){this.eventCallbacks=new Map,this.logger=e,this.browserCrypto=t,this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}return n.prototype.addEventCallback=function(e){if(typeof window!="undefined"){var t=this.browserCrypto.createNewGuid();return this.eventCallbacks.set(t,e),this.logger.verbose("Event callback registered with id: "+t),t}return null},n.prototype.removeEventCallback=function(e){this.eventCallbacks.delete(e),this.logger.verbose("Event callback "+e+" removed.")},n.prototype.enableAccountStorageEvents=function(){typeof window!="undefined"&&(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))},n.prototype.disableAccountStorageEvents=function(){typeof window!="undefined"&&(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))},n.prototype.emitEvent=function(e,t,r,i){var a=this;if(typeof window!="undefined"){var s={eventType:e,interactionType:t||null,payload:r||null,error:i||null,timestamp:Date.now()};this.logger.info("Emitting event: "+e),this.eventCallbacks.forEach(function(u,d){a.logger.verbose("Emitting event to callback "+d+": "+e),u.apply(null,[s])})}},n.prototype.handleAccountCacheChange=function(e){try{var t=e.newValue||e.oldValue;if(!t)return;var r=JSON.parse(t);if(typeof r!="object"||!ae.isAccountEntity(r))return;var i=he.toObject(new ae,r),a=i.getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.emitEvent(o.EventType.ACCOUNT_ADDED,void 0,a)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.emitEvent(o.EventType.ACCOUNT_REMOVED,void 0,a))}catch(s){return}},n}(),xo=function(){function n(e,t,r,i,a,s){this.config=e,this.browserStorage=t,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=a,this.correlationId=s||this.browserCrypto.createNewGuid(),this.logger=i.clone(le.MSAL_SKU,nt,this.correlationId)}return n.prototype.clearCacheOnLogout=function(e){return p(this,void 0,void 0,function(){return m(this,function(t){switch(t.label){case 0:if(!e)return[3,5];ae.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null)),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.browserStorage.removeAccount(ae.generateAccountCacheKey(e))];case 2:return t.sent(),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request."),[3,4];case 3:return t.sent(),this.logger.error("Account provided in logout request was not found. Local cache unchanged."),[3,4];case 4:return[3,9];case 5:return t.trys.push([5,8,,9]),[4,this.browserStorage.clear()];case 6:return t.sent(),[4,this.browserCrypto.clearKeystore()];case 7:return t.sent(),this.logger.verbose("No account provided in logout request, clearing all cache items."),[3,9];case 8:return t.sent(),this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged."),[3,9];case 9:return[2]}})})},n.prototype.initializeBaseRequest=function(e){return p(this,void 0,void 0,function(){var t,r,i,a;return m(this,function(s){switch(s.label){case 0:if(this.logger.verbose("Initializing BaseAuthRequest"),t=e.authority||this.config.auth.authority,r=G(e&&e.scopes||[]),!e.authenticationScheme)e.authenticationScheme=o.AuthenticationScheme.BEARER,this.logger.verbose(`Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request`);else{if(e.authenticationScheme===o.AuthenticationScheme.SSH){if(!e.sshJwk)throw W.createMissingSshJwkError();if(!e.sshKid)throw W.createMissingSshKidError()}this.logger.verbose('Authentication Scheme set to "'+e.authenticationScheme+'" as configured in Auth request')}return e.claims&&!_.isEmpty(e.claims)?(i=e,[4,this.browserCrypto.hashString(e.claims)]):[3,2];case 1:i.requestedClaimsHash=s.sent(),s.label=2;case 2:return a=g(g({},e),{correlationId:this.correlationId,authority:t,scopes:r}),[2,a]}})})},n.prototype.getRedirectUri=function(e){this.logger.verbose("getRedirectUri called");var t=e||this.config.auth.redirectUri||J.getCurrentUri();return j.getAbsoluteUrl(t,J.getCurrentUri())},n.prototype.initializeServerTelemetryManager=function(e,t){this.logger.verbose("initializeServerTelemetryManager called");var r={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:t||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new No(r,this.browserStorage)},n}(),Fe=function(n){h(e,n);function e(t,r,i,a,s,u,d){var l=n.call(this,t,r,i,a,s,d)||this;return l.navigationClient=u,l}return e.prototype.initializeAuthorizationCodeRequest=function(t){return p(this,void 0,void 0,function(){var r,i;return m(this,function(a){switch(a.label){case 0:return this.logger.verbose("initializeAuthorizationRequest called",t.correlationId),[4,this.browserCrypto.generatePkceCodes()];case 1:return r=a.sent(),i=g(g({},t),{redirectUri:t.redirectUri,code:"",codeVerifier:r.verifier}),t.codeChallenge=r.challenge,t.codeChallengeMethod=E.S256_CODE_CHALLENGE_METHOD,[2,i]}})})},e.prototype.initializeLogoutRequest=function(t){this.logger.verbose("initializeLogoutRequest called",t==null?void 0:t.correlationId);var r=g({correlationId:this.browserCrypto.createNewGuid()},t);if(t)if(t.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(t.account){var i=this.getLogoutHintFromIdTokenClaims(t.account);i&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),r.logoutHint=i)}else this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");else this.logger.verbose("logoutHint will not be set since no logout request was configured");return!t||t.postLogoutRedirectUri!==null?t&&t.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",r.correlationId),r.postLogoutRedirectUri=j.getAbsoluteUrl(t.postLogoutRedirectUri,J.getCurrentUri())):this.config.auth.postLogoutRedirectUri===null?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",r.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",r.correlationId),r.postLogoutRedirectUri=j.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,J.getCurrentUri())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",r.correlationId),r.postLogoutRedirectUri=j.getAbsoluteUrl(J.getCurrentUri(),J.getCurrentUri())):this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",r.correlationId),r},e.prototype.getLogoutHintFromIdTokenClaims=function(t){var r=t.idTokenClaims;if(r){if(r.login_hint)return r.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null},e.prototype.createAuthCodeClient=function(t,r,i){return p(this,void 0,void 0,function(){var a;return m(this,function(s){switch(s.label){case 0:return[4,this.getClientConfiguration(t,r,i)];case 1:return a=s.sent(),[2,new Vr(a)]}})})},e.prototype.getClientConfiguration=function(t,r,i){return p(this,void 0,void 0,function(){var a;return m(this,function(s){switch(s.label){case 0:return this.logger.verbose("getClientConfiguration called"),[4,this.getDiscoveredAuthority(r,i)];case 1:return a=s.sent(),[2,{authOptions:{clientId:this.config.auth.clientId,authority:a,clientCapabilities:this.config.auth.clientCapabilities},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:this.config.system.loggerOptions.loggerCallback,piiLoggingEnabled:this.config.system.loggerOptions.piiLoggingEnabled,logLevel:this.config.system.loggerOptions.logLevel,correlationId:this.correlationId},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:t,libraryInfo:{sku:le.MSAL_SKU,version:nt,cpu:"",os:""}}]}})})},e.prototype.validateAndExtractStateFromHash=function(t,r,i){this.logger.verbose("validateAndExtractStateFromHash called",i);var a=j.getDeserializedHash(t);if(!a.state)throw A.createHashDoesNotContainStateError();var s=tn.extractBrowserRequestState(this.browserCrypto,a.state);if(!s)throw A.createUnableToParseStateError();if(s.interactionType!==r)throw A.createStateInteractionTypeMismatchError();return this.logger.verbose("Returning state from hash",i),a.state},e.prototype.getDiscoveredAuthority=function(t,r){return p(this,void 0,void 0,function(){var i,a,s;return m(this,function(u){switch(u.label){case 0:return this.logger.verbose("getDiscoveredAuthority called"),i={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata},a=t||this.config.auth.authority,s=Rt.generateAuthority(a,r||this.config.auth.azureCloudOptions),this.logger.verbose("Creating discovered authority with configured authority"),[4,xr.createDiscoveredInstance(s,this.config.system.networkClient,this.browserStorage,i)];case 1:return[2,u.sent()]}})})},e.prototype.initializeAuthorizationRequest=function(t,r){return p(this,void 0,void 0,function(){var i,a,s,u,d,l,f;return m(this,function(y){switch(y.label){case 0:return this.logger.verbose("initializeAuthorizationRequest called"),i=this.getRedirectUri(t.redirectUri),a={interactionType:r},s=Ye.setRequestState(this.browserCrypto,t&&t.state||E.EMPTY_STRING,a),d=[{}],[4,this.initializeBaseRequest(t)];case 1:return u=g.apply(void 0,[g.apply(void 0,d.concat([y.sent()])),{redirectUri:i,state:s,nonce:t.nonce||this.browserCrypto.createNewGuid(),responseMode:ft.FRAGMENT}]),l=t.account||this.browserStorage.getActiveAccount(),l&&(this.logger.verbose("Setting validated request account"),this.logger.verbosePii("Setting validated request account: "+l),u.account=l),_.isEmpty(u.loginHint)&&!l&&(f=this.browserStorage.getLegacyLoginHint(),f&&(u.loginHint=f)),[2,u]}})})},e}(xo),Be=function(){function n(e,t){this.browserStorage=e,this.logger=t,this.unloadWindow=this.unloadWindow.bind(this)}return n.prototype.openPopup=function(e,t){try{var r=void 0;if(t.popup?(r=t.popup,this.logger.verbosePii("Navigating popup window to: "+e),r.location.assign(e)):typeof t.popup=="undefined"&&(this.logger.verbosePii("Opening popup window to: "+e),r=n.openSizedPopup(e,t.popupName,t.popupWindowAttributes,this.logger)),!r)throw A.createEmptyWindowCreatedError();return r.focus&&r.focus(),this.currentWindow=r,window.addEventListener("beforeunload",this.unloadWindow),r}catch(i){throw this.logger.error("error opening popup "+i.message),this.browserStorage.setInteractionInProgress(!1),A.createPopupWindowError(i.toString())}},n.openSizedPopup=function(e,t,r,i){var a,s,u,d,l=window.screenLeft?window.screenLeft:window.screenX,f=window.screenTop?window.screenTop:window.screenY,y=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,w=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,U=(a=r.popupSize)===null||a===void 0?void 0:a.width,P=(s=r.popupSize)===null||s===void 0?void 0:s.height,F=(u=r.popupPosition)===null||u===void 0?void 0:u.top,z=(d=r.popupPosition)===null||d===void 0?void 0:d.left;return(!U||U<0||U>y)&&(i.verbose("Default popup window width used. Window width not configured or invalid."),U=le.POPUP_WIDTH),(!P||P<0||P>w)&&(i.verbose("Default popup window height used. Window height not configured or invalid."),P=le.POPUP_HEIGHT),(!F||F<0||F>w)&&(i.verbose("Default popup window top position used. Window top not configured or invalid."),F=Math.max(0,w/2-le.POPUP_HEIGHT/2+f)),(!z||z<0||z>y)&&(i.verbose("Default popup window left position used. Window left not configured or invalid."),z=Math.max(0,y/2-le.POPUP_WIDTH/2+l)),window.open(e,t,"width="+U+", height="+P+", top="+F+", left="+z+", scrollbars=yes")},n.prototype.unloadWindow=function(e){this.browserStorage.cleanRequestByInteractionType(o.InteractionType.Popup),this.currentWindow&&this.currentWindow.close(),e.preventDefault()},n.prototype.cleanPopup=function(e){e&&e.close(),window.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)},n.prototype.monitorPopupForSameOrigin=function(e){var t=this;return new Promise(function(r,i){var a=setInterval(function(){if(e.closed){t.cleanPopup(),clearInterval(a),i(A.createUserCancelledError());return}var s=E.EMPTY_STRING;try{s=e.location.href}catch(u){}_.isEmpty(s)||s==="about:blank"||s==="about:blank"+ur||(clearInterval(a),r())},le.POLL_INTERVAL_MS)})},n.generatePopupName=function(e,t,r,i){return le.POPUP_NAME_PREFIX+"."+e+"."+t.join("-")+"."+r+"."+i},n.generateLogoutPopupName=function(e,t){var r=t.account&&t.account.homeAccountId;return le.POPUP_NAME_PREFIX+"."+e+"."+r+"."+t.correlationId},n}(),tr=function(){function n(e,t,r,i){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.browserRequestLogger=i}return n.prototype.handleCodeResponseFromHash=function(e,t,r,i){return p(this,void 0,void 0,function(){var a,s,u;return m(this,function(d){if(this.browserRequestLogger.verbose("InteractionHandler.handleCodeResponse called"),_.isEmpty(e))throw A.createEmptyHashError(e);if(a=this.browserStorage.generateStateKey(t),s=this.browserStorage.getTemporaryCache(a),!s)throw b.createStateNotFoundError("Cached State");return u=this.authModule.handleFragmentResponse(e,s),[2,this.handleCodeResponseFromServer(u,t,r,i)]})})},n.prototype.handleCodeResponseFromServer=function(e,t,r,i,a){return a===void 0&&(a=!0),p(this,void 0,void 0,function(){var s,u,d,l,f,y;return m(this,function(w){switch(w.label){case 0:if(this.browserRequestLogger.trace("InteractionHandler.handleCodeResponseFromServer called"),s=this.browserStorage.generateStateKey(t),u=this.browserStorage.getTemporaryCache(s),!u)throw b.createStateNotFoundError("Cached State");return d=this.browserStorage.generateNonceKey(u),l=this.browserStorage.getTemporaryCache(d),this.authCodeRequest.code=e.code,e.cloud_instance_host_name?[4,this.updateTokenEndpointAuthority(e.cloud_instance_host_name,r,i)]:[3,2];case 1:w.sent(),w.label=2;case 2:return a&&(e.nonce=l||void 0),e.state=u,e.client_info?this.authCodeRequest.clientInfo=e.client_info:(f=this.checkCcsCredentials(),f&&(this.authCodeRequest.ccsCredential=f)),[4,this.authModule.acquireToken(this.authCodeRequest,e)];case 3:return y=w.sent(),this.browserStorage.cleanRequestByState(t),[2,y]}})})},n.prototype.updateTokenEndpointAuthority=function(e,t,r){return p(this,void 0,void 0,function(){var i,a;return m(this,function(s){switch(s.label){case 0:return i="https://"+e+"/"+t.tenant+"/",[4,xr.createDiscoveredInstance(i,r,this.browserStorage,t.options)];case 1:return a=s.sent(),this.authModule.updateAuthority(a),[2]}})})},n.prototype.checkCcsCredentials=function(){var e=this.browserStorage.getTemporaryCache(o.TemporaryCacheKeys.CCS_CREDENTIAL,!0);if(e)try{return JSON.parse(e)}catch(t){this.authModule.logger.error("Cache credential could not be parsed"),this.authModule.logger.errorPii("Cache credential could not be parsed: "+e)}return null},n}(),Qo=function(n){h(e,n);function e(t,r,i,a){var s=n.call(this,t,r,i,a)||this;return s.popupUtils=new Be(r,a),s}return e.prototype.initiateAuthRequest=function(t,r){if(_.isEmpty(t))throw this.browserRequestLogger.error("Navigate url is empty"),A.createEmptyNavigationUriError();return this.browserRequestLogger.infoPii("Navigate to: "+t),this.popupUtils.openPopup(t,r)},e.prototype.monitorPopupForHash=function(t){var r=this;return this.popupUtils.monitorPopupForSameOrigin(t).then(function(){var i=t.location.hash;if(J.clearHash(t),r.popupUtils.cleanPopup(t),!i)throw A.createEmptyHashError(t.location.href);if(j.hashContainsKnownProperties(i))return i;throw A.createHashDoesNotContainKnownPropertiesError()})},e}(tr),rr=function(n){h(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.acquireToken=function(t){try{var r=Be.generatePopupName(this.config.auth.clientId,t.scopes||we,t.authority||this.config.auth.authority,this.correlationId);t.extraPopupNameForQuickAuth&&(r+=t.extraPopupNameForQuickAuth),t.popupCallback&&t.popupCallback();var i=t.popupWindowAttributes||{};if(this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(t,r,i);{this.logger.verbose("asyncPopup set to false, opening popup before acquiring token");const s=t.quickAuthPopupHashTag?"about:blank"+t.quickAuthPopupHashTag:"about:blank";var a=Be.openSizedPopup(s,r,i,this.logger);return this.acquireTokenPopupAsync(t,r,i,a)}}catch(s){return Promise.reject(s)}},e.prototype.logout=function(t){try{this.logger.verbose("logoutPopup called");var r=this.initializeLogoutRequest(t),i=Be.generateLogoutPopupName(this.config.auth.clientId,r),a=t&&t.authority,s=t&&t.mainWindowRedirectUri,u=(t==null?void 0:t.popupWindowAttributes)||{};if(this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(r,i,u,a,void 0,s);this.logger.verbose("asyncPopup set to false, opening popup");var d=Be.openSizedPopup("about:blank",i,u,this.logger);return this.logoutPopupAsync(r,i,u,a,d,s)}catch(l){return Promise.reject(l)}},e.prototype.acquireTokenPopupAsync=function(t,r,i,a){return p(this,void 0,void 0,function(){var s,u,d,l,f,y,w,U,P,F,z,D;return m(this,function(Q){switch(Q.label){case 0:return this.logger.verbose("acquireTokenPopupAsync called"),s=this.initializeServerTelemetryManager(o.ApiId.acquireTokenPopup),[4,this.initializeAuthorizationRequest(t,o.InteractionType.Popup)];case 1:u=Q.sent(),this.browserStorage.updateCacheEntries(u.state,u.nonce,u.authority,u.loginHint||"",u.account||null),Q.label=2;case 2:return Q.trys.push([2,8,,9]),[4,this.initializeAuthorizationCodeRequest(u)];case 3:return d=Q.sent(),[4,this.createAuthCodeClient(s,u.authority,u.azureCloudOptions)];case 4:return l=Q.sent(),this.logger.verbose("Auth code client created"),[4,l.getAuthCodeUrl(u)];case 5:return f=Q.sent(),y=new Qo(l,this.browserStorage,d,this.logger),w={popup:a,popupName:r,popupWindowAttributes:i},U=y.initiateAuthRequest(f,w),this.eventHandler.emitEvent(o.EventType.POPUP_OPENED,o.InteractionType.Popup,{popupWindow:U},null),[4,y.monitorPopupForHash(U)];case 6:return P=Q.sent(),F=this.validateAndExtractStateFromHash(P,o.InteractionType.Popup,u.correlationId),It.removeThrottle(this.browserStorage,this.config.auth.clientId,d),[4,y.handleCodeResponseFromHash(P,F,l.authority,this.networkClient)];case 7:return z=Q.sent(),[2,z];case 8:throw D=Q.sent(),a&&a.close(),D instanceof k&&D.setCorrelationId(this.correlationId),s.cacheFailedRequest(D),this.browserStorage.cleanRequestByState(u.state),D;case 9:return[2]}})})},e.prototype.logoutPopupAsync=function(t,r,i,a,s,u){return p(this,void 0,void 0,function(){var d,l,f,y,w,U,P,F,z;return m(this,function(D){switch(D.label){case 0:this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(o.EventType.LOGOUT_START,o.InteractionType.Popup,t),d=this.initializeServerTelemetryManager(o.ApiId.logoutPopup),D.label=1;case 1:return D.trys.push([1,8,,9]),[4,this.clearCacheOnLogout(t.account)];case 2:return D.sent(),[4,this.createAuthCodeClient(d,a)];case 3:l=D.sent(),this.logger.verbose("Auth code client created"),f=l.getLogoutUri(t),this.eventHandler.emitEvent(o.EventType.LOGOUT_SUCCESS,o.InteractionType.Popup,t),y=new Be(this.browserStorage,this.logger),w=y.openPopup(f,{popupName:r,popupWindowAttributes:i,popup:s}),this.eventHandler.emitEvent(o.EventType.POPUP_OPENED,o.InteractionType.Popup,{popupWindow:w},null),D.label=4;case 4:return D.trys.push([4,6,,7]),[4,y.monitorPopupForSameOrigin(w)];case 5:return D.sent(),this.logger.verbose("Popup successfully redirected to postLogoutRedirectUri"),[3,7];case 6:return U=D.sent(),this.logger.verbose("Error occurred while monitoring popup for same origin. Session on server may remain active. Error: "+U),[3,7];case 7:return y.cleanPopup(w),u?(P={apiId:o.ApiId.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},F=j.getAbsoluteUrl(u,J.getCurrentUri()),this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii("Redirecting main window to: "+F),this.navigationClient.navigateInternal(F,P)):this.logger.verbose("No main window navigation requested"),[3,9];case 8:throw z=D.sent(),s&&s.close(),z instanceof k&&z.setCorrelationId(this.correlationId),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(o.EventType.LOGOUT_FAILURE,o.InteractionType.Popup,null,z),this.eventHandler.emitEvent(o.EventType.LOGOUT_END,o.InteractionType.Popup),d.cacheFailedRequest(z),z;case 9:return this.eventHandler.emitEvent(o.EventType.LOGOUT_END,o.InteractionType.Popup),[2]}})})},e}(Fe),nr=function(n){h(e,n);function e(t,r,i,a,s){var u=n.call(this,t,r,i,a)||this;return u.browserCrypto=s,u}return e.prototype.initiateAuthRequest=function(t,r){return p(this,void 0,void 0,function(){var i,a;return m(this,function(s){switch(s.label){case 0:return this.browserRequestLogger.verbose("RedirectHandler.initiateAuthRequest called"),_.isEmpty(t)?[3,7]:(r.redirectStartPage&&(this.browserRequestLogger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache(o.TemporaryCacheKeys.ORIGIN_URI,r.redirectStartPage,!0)),this.browserStorage.setTemporaryCache(o.TemporaryCacheKeys.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest,this.browserCrypto),this.browserRequestLogger.infoPii("RedirectHandler.initiateAuthRequest: Navigate to: "+t),i={apiId:o.ApiId.acquireTokenRedirect,timeout:r.redirectTimeout,noHistory:!1},typeof r.onRedirectNavigate!="function"?[3,4]:(this.browserRequestLogger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),a=r.onRedirectNavigate(t),a===!1?[3,2]:(this.browserRequestLogger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),[4,r.navigationClient.navigateExternal(t,i)])));case 1:return s.sent(),[2];case 2:return this.browserRequestLogger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation"),[2];case 3:return[3,6];case 4:return this.browserRequestLogger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),[4,r.navigationClient.navigateExternal(t,i)];case 5:return s.sent(),[2];case 6:return[3,8];case 7:throw this.browserRequestLogger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),A.createEmptyNavigationUriError();case 8:return[2]}})})},e.prototype.handleCodeResponseFromHash=function(t,r,i,a,s){return p(this,void 0,void 0,function(){var u,d,l,f,y,w,U;return m(this,function(P){switch(P.label){case 0:if(this.browserRequestLogger.verbose("RedirectHandler.handleCodeResponse called"),_.isEmpty(t))throw A.createEmptyHashError(t);if(this.browserStorage.setInteractionInProgress(!1),u=this.browserStorage.generateStateKey(r),d=this.browserStorage.getTemporaryCache(u),!d)throw b.createStateNotFoundError("Cached State");return l=this.authModule.handleFragmentResponse(t,d),f=this.browserStorage.generateNonceKey(d),y=this.browserStorage.getTemporaryCache(f),this.authCodeRequest.code=l.code,l.cloud_instance_host_name?[4,this.updateTokenEndpointAuthority(l.cloud_instance_host_name,i,a)]:[3,2];case 1:P.sent(),P.label=2;case 2:return l.nonce=y||void 0,l.state=d,l.client_info?this.authCodeRequest.clientInfo=l.client_info:(w=this.checkCcsCredentials(),w&&(this.authCodeRequest.ccsCredential=w)),s&&It.removeThrottle(this.browserStorage,s,this.authCodeRequest),[4,this.authModule.acquireToken(this.authCodeRequest,l)];case 3:return U=P.sent(),this.browserStorage.cleanRequestByState(r),[2,U]}})})},e}(tr),Pt=function(n){h(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.acquireToken=function(t){return p(this,void 0,void 0,function(){var r,i,a,s,u,d,l,f;return m(this,function(y){switch(y.label){case 0:return[4,this.initializeAuthorizationRequest(t,o.InteractionType.Redirect)];case 1:r=y.sent(),this.browserStorage.updateCacheEntries(r.state,r.nonce,r.authority,r.loginHint||"",r.account||null),i=this.initializeServerTelemetryManager(o.ApiId.acquireTokenRedirect),y.label=2;case 2:return y.trys.push([2,7,,8]),[4,this.initializeAuthorizationCodeRequest(r)];case 3:return a=y.sent(),[4,this.createAuthCodeClient(i,r.authority,r.azureCloudOptions)];case 4:return s=y.sent(),this.logger.verbose("Auth code client created"),u=new nr(s,this.browserStorage,a,this.logger,this.browserCrypto),[4,s.getAuthCodeUrl(r)];case 5:return d=y.sent(),l=this.getRedirectStartPage(t.redirectStartPage),this.logger.verbosePii("Redirect start page: "+l),[4,u.initiateAuthRequest(d,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:l,onRedirectNavigate:t.onRedirectNavigate})];case 6:return[2,y.sent()];case 7:throw f=y.sent(),f instanceof k&&f.setCorrelationId(this.correlationId),i.cacheFailedRequest(f),this.browserStorage.cleanRequestByState(r.state),f;case 8:return[2]}})})},e.prototype.handleRedirectPromise=function(t){return p(this,void 0,void 0,function(){var r,i,a,s,u,d,l,f,y,w,U;return m(this,function(P){switch(P.label){case 0:r=this.initializeServerTelemetryManager(o.ApiId.handleRedirectPromise),P.label=1;case 1:if(P.trys.push([1,10,,11]),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),[2,null];if(i=this.getRedirectResponseHash(t||window.location.hash),!i)return this.logger.info("handleRedirectPromise did not detect a response hash as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(o.InteractionType.Redirect),[2,null];a=void 0;try{a=this.validateAndExtractStateFromHash(i,o.InteractionType.Redirect),this.logger.verbose("State extracted from hash")}catch(F){return this.logger.info("handleRedirectPromise was unable to extract state due to: "+F),this.browserStorage.cleanRequestByInteractionType(o.InteractionType.Redirect),[2,null]}return s=this.browserStorage.getTemporaryCache(o.TemporaryCacheKeys.ORIGIN_URI,!0)||"",u=j.removeHashFromUrl(s),d=j.removeHashFromUrl(window.location.href),u===d&&this.config.auth.navigateToLoginRequestUrl?(this.logger.verbose("Current page is loginRequestUrl, handling hash"),[4,this.handleHash(i,a,r)]):[3,3];case 2:return l=P.sent(),s.indexOf("#")>-1&&J.replaceHash(s),[2,l];case 3:return this.config.auth.navigateToLoginRequestUrl?[3,4]:(this.logger.verbose("NavigateToLoginRequestUrl set to false, handling hash"),[2,this.handleHash(i,a,r)]);case 4:return!J.isInIframe()||this.config.system.allowRedirectInIframe?(this.browserStorage.setTemporaryCache(o.TemporaryCacheKeys.URL_HASH,i,!0),f={apiId:o.ApiId.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0},y=!0,!s||s==="null"?(w=J.getHomepage(),this.browserStorage.setTemporaryCache(o.TemporaryCacheKeys.ORIGIN_URI,w,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),[4,this.navigationClient.navigateInternal(w,f)]):[3,6]):[3,9];case 5:return y=P.sent(),[3,8];case 6:return this.logger.verbose("Navigating to loginRequestUrl: "+s),[4,this.navigationClient.navigateInternal(s,f)];case 7:y=P.sent(),P.label=8;case 8:if(!y)return[2,this.handleHash(i,a,r)];P.label=9;case 9:return[2,null];case 10:throw U=P.sent(),U instanceof k&&U.setCorrelationId(this.correlationId),r.cacheFailedRequest(U),this.browserStorage.cleanRequestByInteractionType(o.InteractionType.Redirect),U;case 11:return[2]}})})},e.prototype.getRedirectResponseHash=function(t){this.logger.verbose("getRedirectResponseHash called");var r=j.hashContainsKnownProperties(t);if(r)return J.clearHash(window),this.logger.verbose("Hash contains known properties, returning response hash"),t;var i=this.browserStorage.getTemporaryCache(o.TemporaryCacheKeys.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(o.TemporaryCacheKeys.URL_HASH)),this.logger.verbose("Hash does not contain known properties, returning cached hash"),i},e.prototype.handleHash=function(t,r,i){return p(this,void 0,void 0,function(){var a,s,u,d;return m(this,function(l){switch(l.label){case 0:if(a=this.browserStorage.getCachedRequest(r,this.browserCrypto),this.logger.verbose("handleHash called, retrieved cached request"),s=this.browserStorage.getCachedAuthority(r),!s)throw A.createNoCachedAuthorityError();return[4,this.createAuthCodeClient(i,s)];case 1:return u=l.sent(),this.logger.verbose("Auth code client created"),d=new nr(u,this.browserStorage,a,this.logger,this.browserCrypto),[4,d.handleCodeResponseFromHash(t,r,u.authority,this.networkClient,this.config.auth.clientId)];case 2:return[2,l.sent()]}})})},e.prototype.logout=function(t){return p(this,void 0,void 0,function(){var r,i,a,s,u,d,l;return m(this,function(f){switch(f.label){case 0:this.logger.verbose("logoutRedirect called"),r=this.initializeLogoutRequest(t),i=this.initializeServerTelemetryManager(o.ApiId.logout),f.label=1;case 1:return f.trys.push([1,10,,11]),this.eventHandler.emitEvent(o.EventType.LOGOUT_START,o.InteractionType.Redirect,t),[4,this.clearCacheOnLogout(r.account)];case 2:return f.sent(),a={apiId:o.ApiId.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},[4,this.createAuthCodeClient(i,t&&t.authority)];case 3:return s=f.sent(),this.logger.verbose("Auth code client created"),u=s.getLogoutUri(r),this.eventHandler.emitEvent(o.EventType.LOGOUT_SUCCESS,o.InteractionType.Redirect,r),t&&typeof t.onRedirectNavigate=="function"?(d=t.onRedirectNavigate(u),d===!1?[3,5]:(this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),[4,this.navigationClient.navigateExternal(u,a)])):[3,7];case 4:return f.sent(),[2];case 5:this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation"),f.label=6;case 6:return[3,9];case 7:return[4,this.navigationClient.navigateExternal(u,a)];case 8:return f.sent(),[2];case 9:return[3,11];case 10:throw l=f.sent(),l instanceof k&&l.setCorrelationId(this.correlationId),i.cacheFailedRequest(l),this.eventHandler.emitEvent(o.EventType.LOGOUT_FAILURE,o.InteractionType.Redirect,null,l),this.eventHandler.emitEvent(o.EventType.LOGOUT_END,o.InteractionType.Redirect),l;case 11:return this.eventHandler.emitEvent(o.EventType.LOGOUT_END,o.InteractionType.Redirect),[2]}})})},e.prototype.getRedirectStartPage=function(t){var r=t||window.location.href;return j.getAbsoluteUrl(r,J.getCurrentUri())},e}(Fe),an=function(n){h(e,n);function e(t,r,i,a,s){var u=n.call(this,t,r,i,a)||this;return u.navigateFrameWait=s,u}return e.prototype.initiateAuthRequest=function(t){return p(this,void 0,void 0,function(){var r;return m(this,function(i){switch(i.label){case 0:if(_.isEmpty(t))throw this.browserRequestLogger.info("Navigate url is empty"),A.createEmptyNavigationUriError();return this.navigateFrameWait?[4,this.loadFrame(t)]:[3,2];case 1:return r=i.sent(),[3,3];case 2:r=this.loadFrameSync(t),i.label=3;case 3:return[2,r]}})})},e.prototype.monitorIframeForHash=function(t,r){var i=this;return new Promise(function(a,s){r<Ot&&i.browserRequestLogger.warning("system.loadFrameTimeout or system.iframeHashTimeout set to lower ("+r+"ms) than the default ("+Ot+"ms). This may result in timeouts.");var u=window.performance.now(),d=u+r,l=setInterval(function(){if(window.performance.now()>d){i.removeHiddenIframe(t),clearInterval(l),s(A.createMonitorIframeTimeoutError());return}var f=E.EMPTY_STRING,y=t.contentWindow;try{f=y?y.location.href:E.EMPTY_STRING}catch(U){}if(!_.isEmpty(f)){var w=y?y.location.hash:E.EMPTY_STRING;if(j.hashContainsKnownProperties(w)){i.removeHiddenIframe(t),clearInterval(l),a(w);return}}},le.POLL_INTERVAL_MS)})},e.prototype.loadFrame=function(t){var r=this;return new Promise(function(i,a){var s=r.createHiddenIframe();setTimeout(function(){if(!s){a("Unable to load iframe");return}s.src=t,i(s)},r.navigateFrameWait)})},e.prototype.loadFrameSync=function(t){var r=this.createHiddenIframe();return r.src=t,r},e.prototype.createHiddenIframe=function(){var t=document.createElement("iframe");return t.style.visibility="hidden",t.style.position="absolute",t.style.width=t.style.height="0",t.style.border="0",t.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.getElementsByTagName("body")[0].appendChild(t),t},e.prototype.removeHiddenIframe=function(t){document.body===t.parentNode&&document.body.removeChild(t)},e}(tr),or=function(n){h(e,n);function e(t,r,i,a,s,u,d,l){var f=n.call(this,t,r,i,a,s,u,l)||this;return f.apiId=d,f}return e.prototype.acquireToken=function(t){return p(this,void 0,void 0,function(){var r,i,a,s,u,d;return m(this,function(l){switch(l.label){case 0:if(this.logger.verbose("acquireTokenByIframe called"),_.isEmpty(t.loginHint)&&_.isEmpty(t.sid)&&(!t.account||_.isEmpty(t.account.username))&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request."),t.prompt&&t.prompt!==oe.NONE)throw A.createSilentPromptValueError(t.prompt);return[4,this.initializeAuthorizationRequest(g(g({},t),{prompt:oe.NONE}),o.InteractionType.Silent)];case 1:r=l.sent(),this.browserStorage.updateCacheEntries(r.state,r.nonce,r.authority,r.loginHint||"",r.account||null),i=this.initializeServerTelemetryManager(this.apiId),l.label=2;case 2:return l.trys.push([2,7,,8]),[4,this.initializeAuthorizationCodeRequest(r)];case 3:return a=l.sent(),[4,this.createAuthCodeClient(i,r.authority,r.azureCloudOptions)];case 4:return s=l.sent(),this.logger.verbose("Auth code client created"),[4,s.getAuthCodeUrl(r)];case 5:return u=l.sent(),[4,this.silentTokenHelper(u,a,s,this.logger)];case 6:return[2,l.sent()];case 7:throw d=l.sent(),d instanceof k&&d.setCorrelationId(this.correlationId),i.cacheFailedRequest(d),this.browserStorage.cleanRequestByState(r.state),d;case 8:return[2]}})})},e.prototype.logout=function(){return Promise.reject(A.createSilentLogoutUnsupportedError())},e.prototype.silentTokenHelper=function(t,r,i,a){return p(this,void 0,void 0,function(){var s,u,d,l;return m(this,function(f){switch(f.label){case 0:return s=new an(i,this.browserStorage,r,a,this.config.system.navigateFrameWait),[4,s.initiateAuthRequest(t)];case 1:return u=f.sent(),[4,s.monitorIframeForHash(u,this.config.system.iframeHashTimeout)];case 2:return d=f.sent(),l=this.validateAndExtractStateFromHash(d,o.InteractionType.Silent,r.correlationId),[2,s.handleCodeResponseFromHash(d,l,i.authority,this.networkClient)]}})})},e}(Fe),sn=function(n){h(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.acquireToken=function(t){return p(this,void 0,void 0,function(){var r,i,a,s,u=this;return m(this,function(d){switch(d.label){case 0:return i=[g({},t)],[4,this.initializeBaseRequest(t)];case 1:return r=g.apply(void 0,i.concat([d.sent()])),a=this.initializeServerTelemetryManager(o.ApiId.acquireTokenSilent_silentFlow),[4,this.createRefreshTokenClient(a,r.authority,r.azureCloudOptions)];case 2:return s=d.sent(),this.logger.verbose("Refresh token client created"),[2,s.acquireTokenByRefreshToken(r).catch(function(l){throw l instanceof k&&l.setCorrelationId(u.correlationId),a.cacheFailedRequest(l),l})]}})})},e.prototype.logout=function(){return Promise.reject(A.createSilentLogoutUnsupportedError())},e.prototype.createRefreshTokenClient=function(t,r,i){return p(this,void 0,void 0,function(){var a;return m(this,function(s){switch(s.label){case 0:return[4,this.getClientConfiguration(t,r,i)];case 1:return a=s.sent(),[2,new Yr(a)]}})})},e}(Fe),Jo=function(){function n(e,t,r,i){this.isBrowserEnvironment=typeof window!="undefined",this.config=e,this.storage=t,this.logger=r,this.cryptoObj=i}return n.prototype.loadExternalTokens=function(e,t,r){if(this.logger.info("TokenCache - loadExternalTokens called"),!t.id_token)throw A.createUnableToLoadTokenError("Please ensure server response includes id token.");if(e.account)this.loadIdToken(t.id_token,e.account.homeAccountId,e.account.environment,e.account.tenantId,r),this.loadAccessToken(e,t,e.account.homeAccountId,e.account.environment,e.account.tenantId,r);else if(e.authority){var i=Rt.generateAuthority(e.authority,e.azureCloudOptions),a={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata},s=new Rt(i,this.config.system.networkClient,this.storage,a);if(r.clientInfo)this.logger.trace("TokenCache - homeAccountId from options"),this.loadIdToken(t.id_token,r.clientInfo,s.hostnameAndPort,s.tenant,r),this.loadAccessToken(e,t,r.clientInfo,s.hostnameAndPort,s.tenant,r);else if(t.client_info)this.logger.trace("TokenCache - homeAccountId from response"),this.loadIdToken(t.id_token,t.client_info,s.hostnameAndPort,s.tenant,r),this.loadAccessToken(e,t,t.client_info,s.hostnameAndPort,s.tenant,r);else throw A.createUnableToLoadTokenError("Please provide clientInfo in the response or options.")}else throw A.createUnableToLoadTokenError("Please provide a request with an account or a request with authority.")},n.prototype.loadIdToken=function(e,t,r,i,a){var s=wt.createIdTokenEntity(t,r,e,this.config.auth.clientId,i),u=new Ne(e,this.cryptoObj),d=a.clientInfo?ae.createAccount(a.clientInfo,t,u,void 0,void 0,void 0,void 0,r):ae.createGenericAccount(t,u,void 0,void 0,void 0,void 0,r);if(this.isBrowserEnvironment)this.logger.verbose("TokenCache - loading id token"),this.storage.setAccount(d),this.storage.setIdTokenCredential(s);else throw A.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},n.prototype.loadAccessToken=function(e,t,r,i,a,s){if(!t.access_token){this.logger.verbose("TokenCache - No access token provided for caching");return}if(!t.expires_in)throw A.createUnableToLoadTokenError("Please ensure server response includes expires_in value.");if(!s.extendedExpiresOn)throw A.createUnableToLoadTokenError("Please provide an extendedExpiresOn value in the options.");var u=new ge(e.scopes).printScopes(),d=t.expires_in,l=s.extendedExpiresOn,f=Tt.createAccessTokenEntity(r,i,t.access_token,this.config.auth.clientId,a,u,d,l,this.cryptoObj);if(this.isBrowserEnvironment)this.logger.verbose("TokenCache - loading access token"),this.storage.setAccessTokenCredential(f);else throw A.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},n}(),Xo=function(n){h(e,n);function e(t){var r=n.call(this,t)||this;return r.includeRedirectUri=!1,r}return e}(Vr),$o=function(n){h(e,n);function e(t,r,i,a,s,u,d,l){var f=n.call(this,t,r,i,a,s,u,l)||this;return f.apiId=d,f}return e.prototype.acquireToken=function(t){return p(this,void 0,void 0,function(){var r,i,a,s,u,d,l;return m(this,function(f){switch(f.label){case 0:if(this.logger.trace("SilentAuthCodeClient.acquireToken called"),!t.code)throw A.createAuthCodeRequiredError();return[4,this.initializeAuthorizationRequest(t,o.InteractionType.Silent)];case 1:r=f.sent(),this.browserStorage.updateCacheEntries(r.state,r.nonce,r.authority,r.loginHint||"",r.account||null),i=this.initializeServerTelemetryManager(this.apiId),f.label=2;case 2:return f.trys.push([2,4,,5]),a=g(g({},r),{code:t.code}),[4,this.getClientConfiguration(i,r.authority)];case 3:return s=f.sent(),u=new Xo(s),this.logger.verbose("Auth code client created"),d=new an(u,this.browserStorage,a,this.logger,this.config.system.navigateFrameWait),[2,d.handleCodeResponseFromServer({code:t.code,msgraph_host:t.msGraphHost,cloud_graph_host_name:t.cloudGraphHostName,cloud_instance_host_name:t.cloudInstanceHostName},r.state,u.authority,this.networkClient,!1)];case 4:throw l=f.sent(),l instanceof k&&l.setCorrelationId(this.correlationId),i.cacheFailedRequest(l),this.browserStorage.cleanRequestByState(r.state),l;case 5:return[2]}})})},e.prototype.logout=function(){return Promise.reject(A.createSilentLogoutUnsupportedError())},e}(Fe),Zo=function(){function n(e){this.isBrowserEnvironment=typeof window!="undefined",this.config=Yo(e,this.isBrowserEnvironment),this.logger=new Et(this.config.system.loggerOptions,nn,nt),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.browserCrypto=this.isBrowserEnvironment?new Zr(this.logger):yt,this.eventHandler=new on(this.logger,this.browserCrypto),this.browserStorage=this.isBrowserEnvironment?new er(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger):Go(this.config.auth.clientId,this.logger),this.tokenCache=new Jo(this.config,this.browserStorage,this.logger,this.browserCrypto)}return n.prototype.handleRedirectPromise=function(e){return p(this,void 0,void 0,function(){var t,r,i,a,s,u=this;return m(this,function(d){return this.logger.verbose("handleRedirectPromise called"),t=this.getAllAccounts(),this.isBrowserEnvironment?(r=e||E.EMPTY_STRING,i=this.redirectResponse.get(r),typeof i=="undefined"?(this.eventHandler.emitEvent(o.EventType.HANDLE_REDIRECT_START,o.InteractionType.Redirect),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise"),a=this.browserStorage.getTemporaryCache(o.TemporaryCacheKeys.CORRELATION_ID,!0)||"",s=new Pt(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,a),i=s.handleRedirectPromise(e).then(function(l){if(l){var f=t.length<u.getAllAccounts().length;f?(u.eventHandler.emitEvent(o.EventType.LOGIN_SUCCESS,o.InteractionType.Redirect,l),u.logger.verbose("handleRedirectResponse returned result, login success")):(u.eventHandler.emitEvent(o.EventType.ACQUIRE_TOKEN_SUCCESS,o.InteractionType.Redirect,l),u.logger.verbose("handleRedirectResponse returned result, acquire token success"))}return u.eventHandler.emitEvent(o.EventType.HANDLE_REDIRECT_END,o.InteractionType.Redirect),l}).catch(function(l){throw t.length>0?u.eventHandler.emitEvent(o.EventType.ACQUIRE_TOKEN_FAILURE,o.InteractionType.Redirect,null,l):u.eventHandler.emitEvent(o.EventType.LOGIN_FAILURE,o.InteractionType.Redirect,null,l),u.eventHandler.emitEvent(o.EventType.HANDLE_REDIRECT_END,o.InteractionType.Redirect),l}),this.redirectResponse.set(r,i)):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),[2,i]):(this.logger.verbose("handleRedirectPromise returns null, not browser environment"),[2,null])})})},n.prototype.acquireTokenRedirect=function(e){return p(this,void 0,void 0,function(){var t,r,i=this;return m(this,function(a){return this.logger.verbose("acquireTokenRedirect called"),this.preflightBrowserEnvironmentCheck(o.InteractionType.Redirect),t=this.getAllAccounts().length>0,t?this.eventHandler.emitEvent(o.EventType.ACQUIRE_TOKEN_START,o.InteractionType.Redirect,e):this.eventHandler.emitEvent(o.EventType.LOGIN_START,o.InteractionType.Redirect,e),r=new Pt(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,e.correlationId),[2,r.acquireToken(e).catch(function(s){throw t?i.eventHandler.emitEvent(o.EventType.ACQUIRE_TOKEN_FAILURE,o.InteractionType.Redirect,null,s):i.eventHandler.emitEvent(o.EventType.LOGIN_FAILURE,o.InteractionType.Redirect,null,s),s})]})})},n.prototype.acquireTokenPopup=function(e){var t=this;try{this.logger.verbose("acquireTokenPopup called",e.correlationId),this.preflightBrowserEnvironmentCheck(o.InteractionType.Popup)}catch(a){return Promise.reject(a)}var r=this.getAllAccounts();r.length>0?this.eventHandler.emitEvent(o.EventType.ACQUIRE_TOKEN_START,o.InteractionType.Popup,e):this.eventHandler.emitEvent(o.EventType.LOGIN_START,o.InteractionType.Popup,e);var i=new rr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,e.correlationId);return i.acquireToken(e).then(function(a){var s=r.length<t.getAllAccounts().length;return s?t.eventHandler.emitEvent(o.EventType.LOGIN_SUCCESS,o.InteractionType.Popup,a):t.eventHandler.emitEvent(o.EventType.ACQUIRE_TOKEN_SUCCESS,o.InteractionType.Popup,a),a}).catch(function(a){return r.length>0?t.eventHandler.emitEvent(o.EventType.ACQUIRE_TOKEN_FAILURE,o.InteractionType.Popup,null,a):t.eventHandler.emitEvent(o.EventType.LOGIN_FAILURE,o.InteractionType.Popup,null,a),Promise.reject(a)})},n.prototype.ssoSilent=function(e){return p(this,void 0,void 0,function(){var t,r,i;return m(this,function(a){switch(a.label){case 0:this.preflightBrowserEnvironmentCheck(o.InteractionType.Silent),this.logger.verbose("ssoSilent called",e.correlationId),this.eventHandler.emitEvent(o.EventType.SSO_SILENT_START,o.InteractionType.Silent,e),a.label=1;case 1:return a.trys.push([1,3,,4]),t=new or(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,o.ApiId.ssoSilent,e.correlationId),[4,t.acquireToken(e)];case 2:return r=a.sent(),this.eventHandler.emitEvent(o.EventType.SSO_SILENT_SUCCESS,o.InteractionType.Silent,r),[2,r];case 3:throw i=a.sent(),this.eventHandler.emitEvent(o.EventType.SSO_SILENT_FAILURE,o.InteractionType.Silent,null,i),i;case 4:return[2]}})})},n.prototype.acquireTokenByCode=function(e){return p(this,void 0,void 0,function(){var t,r=this;return m(this,function(i){this.preflightBrowserEnvironmentCheck(o.InteractionType.Silent),this.logger.trace("acquireTokenByCode called",e.correlationId),this.eventHandler.emitEvent(o.EventType.ACQUIRE_TOKEN_BY_CODE_START,o.InteractionType.Silent,e);try{if(!e.code)throw A.createAuthCodeRequiredError();return t=this.hybridAuthCodeResponses.get(e.code),t?this.logger.verbose("Existing acquireTokenByCode request found",e.correlationId):(this.logger.verbose("Initiating new acquireTokenByCode request",e.correlationId),t=this.acquireTokenByCodeAsync(e).then(function(a){return r.eventHandler.emitEvent(o.EventType.ACQUIRE_TOKEN_BY_CODE_SUCCESS,o.InteractionType.Silent,a),r.hybridAuthCodeResponses.delete(e.code),a}).catch(function(a){throw r.hybridAuthCodeResponses.delete(e.code),a}),this.hybridAuthCodeResponses.set(e.code,t)),[2,t]}catch(a){throw this.eventHandler.emitEvent(o.EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE,o.InteractionType.Silent,null,a),a}return[2]})})},n.prototype.acquireTokenByCodeAsync=function(e){return p(this,void 0,void 0,function(){var t,r;return m(this,function(i){switch(i.label){case 0:return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),t=new $o(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,o.ApiId.acquireTokenByCode,e.correlationId),[4,t.acquireToken(e)];case 1:return r=i.sent(),[2,r]}})})},n.prototype.acquireTokenByRefreshToken=function(e){return p(this,void 0,void 0,function(){var t,r=this;return m(this,function(i){return this.eventHandler.emitEvent(o.EventType.ACQUIRE_TOKEN_NETWORK_START,o.InteractionType.Silent,e),J.blockReloadInHiddenIframes(),t=new sn(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,e.correlationId),[2,t.acquireToken(e).catch(function(a){var s=a instanceof je,u=a instanceof ke,d=a.errorCode===le.INVALID_GRANT_ERROR;if(s&&d&&!u){r.logger.verbose("Refresh token expired or invalid, attempting acquire token by iframe",e.correlationId);var l=new or(r.config,r.browserStorage,r.browserCrypto,r.logger,r.eventHandler,r.navigationClient,o.ApiId.acquireTokenSilent_authCode,e.correlationId);return l.acquireToken(e)}throw a})]})})},n.prototype.logout=function(e){return p(this,void 0,void 0,function(){return m(this,function(t){return this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead."),[2,this.logoutRedirect(e)]})})},n.prototype.logoutRedirect=function(e){return p(this,void 0,void 0,function(){var t;return m(this,function(r){return this.preflightBrowserEnvironmentCheck(o.InteractionType.Redirect),t=new Pt(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,e==null?void 0:e.correlationId),[2,t.logout(e)]})})},n.prototype.logoutPopup=function(e){try{this.preflightBrowserEnvironmentCheck(o.InteractionType.Popup);var t=new rr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,e==null?void 0:e.correlationId);return t.logout(e)}catch(r){return Promise.reject(r)}},n.prototype.getAllAccounts=function(){return this.logger.verbose("getAllAccounts called"),this.isBrowserEnvironment?this.browserStorage.getAllAccounts():[]},n.prototype.getAccountByUsername=function(e){var t=this.getAllAccounts();return!_.isEmpty(e)&&t&&t.length?(this.logger.verbose("Account matching username found, returning"),this.logger.verbosePii("Returning signed-in accounts matching username: "+e),t.filter(function(r){return r.username.toLowerCase()===e.toLowerCase()})[0]||null):(this.logger.verbose("getAccountByUsername: No matching account found, returning null"),null)},n.prototype.getAccountByHomeId=function(e){var t=this.getAllAccounts();return!_.isEmpty(e)&&t&&t.length?(this.logger.verbose("Account matching homeAccountId found, returning"),this.logger.verbosePii("Returning signed-in accounts matching homeAccountId: "+e),t.filter(function(r){return r.homeAccountId===e})[0]||null):(this.logger.verbose("getAccountByHomeId: No matching account found, returning null"),null)},n.prototype.getAccountByLocalId=function(e){var t=this.getAllAccounts();return!_.isEmpty(e)&&t&&t.length?(this.logger.verbose("Account matching localAccountId found, returning"),this.logger.verbosePii("Returning signed-in accounts matching localAccountId: "+e),t.filter(function(r){return r.localAccountId===e})[0]||null):(this.logger.verbose("getAccountByLocalId: No matching account found, returning null"),null)},n.prototype.setActiveAccount=function(e){this.browserStorage.setActiveAccount(e)},n.prototype.getActiveAccount=function(){return this.browserStorage.getActiveAccount()},n.prototype.preflightBrowserEnvironmentCheck=function(e){if(this.logger.verbose("preflightBrowserEnvironmentCheck started"),J.blockNonBrowserEnvironment(this.isBrowserEnvironment),J.blockRedirectInIframe(e,this.config.system.allowRedirectInIframe),J.blockReloadInHiddenIframes(),J.blockAcquireTokenInPopups(),e===o.InteractionType.Redirect&&this.config.cache.cacheLocation===o.BrowserCacheLocation.MemoryStorage&&!this.config.cache.storeAuthStateInCookie)throw re.createInMemoryRedirectUnavailableError();(e===o.InteractionType.Redirect||e===o.InteractionType.Popup)&&this.preflightInteractiveRequest()},n.prototype.preflightInteractiveRequest=function(){this.logger.verbose("preflightInteractiveRequest called, validating app environment"),J.blockReloadInHiddenIframes(),this.browserStorage.setInteractionInProgress(!0)},n.prototype.addEventCallback=function(e){return this.eventHandler.addEventCallback(e)},n.prototype.removeEventCallback=function(e){this.eventHandler.removeEventCallback(e)},n.prototype.enableAccountStorageEvents=function(){this.eventHandler.enableAccountStorageEvents()},n.prototype.disableAccountStorageEvents=function(){this.eventHandler.disableAccountStorageEvents()},n.prototype.getTokenCache=function(){return this.tokenCache},n.prototype.getLogger=function(){return this.logger},n.prototype.setLogger=function(e){this.logger=e},n.prototype.initializeWrapperLibrary=function(e,t){this.browserStorage.setWrapperMetadata(e,t)},n.prototype.setNavigationClient=function(e){this.navigationClient=e},n.prototype.getConfiguration=function(){return this.config},n}(),cn=function(n){h(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.acquireToken=function(t){return p(this,void 0,void 0,function(){var r,i,a,s;return m(this,function(u){switch(u.label){case 0:return r=this.initializeServerTelemetryManager(o.ApiId.acquireTokenSilent_silentFlow),[4,this.createSilentFlowClient(r,t.authority,t.azureCloudOptions)];case 1:i=u.sent(),this.logger.verbose("Silent auth client created"),u.label=2;case 2:return u.trys.push([2,4,,5]),[4,i.acquireCachedToken(t)];case 3:return a=u.sent(),this.eventHandler.emitEvent(o.EventType.ACQUIRE_TOKEN_SUCCESS,o.InteractionType.Silent,a),[2,a];case 4:throw s=u.sent(),s instanceof A&&s.errorCode===S.signingKeyNotFoundInStorage.code&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),s;case 5:return[2]}})})},e.prototype.logout=function(){return Promise.reject(A.createSilentLogoutUnsupportedError())},e.prototype.createSilentFlowClient=function(t,r,i){return p(this,void 0,void 0,function(){var a;return m(this,function(s){switch(s.label){case 0:return[4,this.getClientConfiguration(t,r,i)];case 1:return a=s.sent(),[2,new _o(a)]}})})},e.prototype.initializeSilentRequest=function(t,r){return p(this,void 0,void 0,function(){var i;return m(this,function(a){switch(a.label){case 0:return i=[g({},t)],[4,this.initializeBaseRequest(t)];case 1:return[2,g.apply(void 0,[g.apply(void 0,i.concat([a.sent()])),{account:r,forceRefresh:t.forceRefresh||!1}])]}})})},e}(Fe),ei=function(n){h(e,n);function e(t){var r=n.call(this,t)||this;return r.activeSilentTokenRequests=new Map,r}return e.prototype.loginRedirect=function(t){return p(this,void 0,void 0,function(){return m(this,function(r){return this.logger.verbose("loginRedirect called"),[2,this.acquireTokenRedirect(t||Jr)]})})},e.prototype.loginPopup=function(t){return this.logger.verbose("loginPopup called"),this.acquireTokenPopup(t||Jr)},e.prototype.acquireTokenSilent=function(t){return p(this,void 0,void 0,function(){var r,i,a,s,u,d=this;return m(this,function(l){if(this.preflightBrowserEnvironmentCheck(o.InteractionType.Silent),this.logger.verbose("acquireTokenSilent called",t.correlationId),r=t.account||this.getActiveAccount(),!r)throw A.createNoAccountError();return i={clientId:this.config.auth.clientId,authority:t.authority||"",scopes:t.scopes,homeAccountIdentifier:r.homeAccountId,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid},a=JSON.stringify(i),s=this.activeSilentTokenRequests.get(a),typeof s=="undefined"?(this.logger.verbose("acquireTokenSilent called for the first time, storing active request",t.correlationId),u=this.acquireTokenSilentAsync(t,r).then(function(f){return d.activeSilentTokenRequests.delete(a),f}).catch(function(f){throw d.activeSilentTokenRequests.delete(a),f}),this.activeSilentTokenRequests.set(a,u),[2,u]):(this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",t.correlationId),[2,s])})})},e.prototype.acquireTokenSilentAsync=function(t,r){return p(this,void 0,void 0,function(){var i,a,s=this;return m(this,function(u){switch(u.label){case 0:return i=new cn(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t.correlationId),[4,i.initializeSilentRequest(t,r)];case 1:return a=u.sent(),this.eventHandler.emitEvent(o.EventType.ACQUIRE_TOKEN_START,o.InteractionType.Silent,t),[2,i.acquireToken(a).catch(function(){return p(s,void 0,void 0,function(){var d,l;return m(this,function(f){switch(f.label){case 0:return f.trys.push([0,2,,3]),[4,this.acquireTokenByRefreshToken(a)];case 1:return d=f.sent(),this.eventHandler.emitEvent(o.EventType.ACQUIRE_TOKEN_SUCCESS,o.InteractionType.Silent,d),[2,d];case 2:throw l=f.sent(),this.eventHandler.emitEvent(o.EventType.ACQUIRE_TOKEN_FAILURE,o.InteractionType.Silent,null,l),l;case 3:return[2]}})})})]}})})},e}(Zo),ti={acquireTokenPopup:function(){return Promise.reject(re.createStubPcaInstanceCalledError())},acquireTokenRedirect:function(){return Promise.reject(re.createStubPcaInstanceCalledError())},acquireTokenSilent:function(){return Promise.reject(re.createStubPcaInstanceCalledError())},acquireTokenByCode:function(){return Promise.reject(re.createStubPcaInstanceCalledError())},getAllAccounts:function(){return[]},getAccountByHomeId:function(){return null},getAccountByUsername:function(){return null},getAccountByLocalId:function(){return null},handleRedirectPromise:function(){return Promise.reject(re.createStubPcaInstanceCalledError())},loginPopup:function(){return Promise.reject(re.createStubPcaInstanceCalledError())},loginRedirect:function(){return Promise.reject(re.createStubPcaInstanceCalledError())},logout:function(){return Promise.reject(re.createStubPcaInstanceCalledError())},logoutRedirect:function(){return Promise.reject(re.createStubPcaInstanceCalledError())},logoutPopup:function(){return Promise.reject(re.createStubPcaInstanceCalledError())},ssoSilent:function(){return Promise.reject(re.createStubPcaInstanceCalledError())},addEventCallback:function(){return null},removeEventCallback:function(){},enableAccountStorageEvents:function(){},disableAccountStorageEvents:function(){},getTokenCache:function(){throw re.createStubPcaInstanceCalledError()},getLogger:function(){throw re.createStubPcaInstanceCalledError()},setLogger:function(){},setActiveAccount:function(){},getActiveAccount:function(){return null},initializeWrapperLibrary:function(){},setNavigationClient:function(){},getConfiguration:function(){throw re.createStubPcaInstanceCalledError()}},ri=function(){function n(){}return n.getInteractionStatusFromEvent=function(e,t){switch(e.eventType){case o.EventType.LOGIN_START:return o.InteractionStatus.Login;case o.EventType.SSO_SILENT_START:return o.InteractionStatus.SsoSilent;case o.EventType.ACQUIRE_TOKEN_START:if(e.interactionType===o.InteractionType.Redirect||e.interactionType===o.InteractionType.Popup)return o.InteractionStatus.AcquireToken;break;case o.EventType.HANDLE_REDIRECT_START:return o.InteractionStatus.HandleRedirect;case o.EventType.LOGOUT_START:return o.InteractionStatus.Logout;case o.EventType.SSO_SILENT_SUCCESS:case o.EventType.SSO_SILENT_FAILURE:if(t&&t!==o.InteractionStatus.SsoSilent)break;return o.InteractionStatus.None;case o.EventType.LOGOUT_END:if(t&&t!==o.InteractionStatus.Logout)break;return o.InteractionStatus.None;case o.EventType.HANDLE_REDIRECT_END:if(t&&t!==o.InteractionStatus.HandleRedirect)break;return o.InteractionStatus.None;case o.EventType.LOGIN_SUCCESS:case o.EventType.LOGIN_FAILURE:case o.EventType.ACQUIRE_TOKEN_SUCCESS:case o.EventType.ACQUIRE_TOKEN_FAILURE:if(e.interactionType===o.InteractionType.Redirect||e.interactionType===o.InteractionType.Popup){if(t&&t!==o.InteractionStatus.Login&&t!==o.InteractionStatus.AcquireToken)break;return o.InteractionStatus.None}break}return null},n}(),ni=function(){function n(e,t){var r=t&&t.loggerOptions||{};this.logger=new Et(r,nn,nt),this.cryptoOps=new Zr(this.logger),this.popTokenGenerator=new _t(this.cryptoOps),this.shrParameters=e}return n.prototype.generatePublicKeyThumbprint=function(){return p(this,void 0,void 0,function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,this.popTokenGenerator.generateKid(this.shrParameters)];case 1:return e=t.sent().kid,[2,e]}})})},n.prototype.signRequest=function(e,t,r){return p(this,void 0,void 0,function(){return m(this,function(i){return[2,this.popTokenGenerator.signPayload(e,t,this.shrParameters,r)]})})},n.prototype.removeKeys=function(e){return p(this,void 0,void 0,function(){return m(this,function(t){switch(t.label){case 0:return[4,this.cryptoOps.removeTokenBindingKey(e)];case 1:return[2,t.sent()]}})})},n}();o.AccountEntity=ae,o.AuthError=k,o.AuthErrorMessage=Wt,o.AuthenticationHeaderParser=Po,o.BrowserAuthError=A,o.BrowserAuthErrorMessage=S,o.BrowserCacheManager=er,o.BrowserConfigurationAuthError=re,o.BrowserConfigurationAuthErrorMessage=de,o.BrowserConstants=le,o.BrowserUtils=J,o.ClientAuthError=b,o.ClientAuthErrorMessage=I,o.ClientConfigurationError=W,o.ClientConfigurationErrorMessage=L,o.DEFAULT_IFRAME_TIMEOUT_MS=Ot,o.EventHandler=on,o.EventMessageUtils=ri,o.InteractionRequiredAuthError=ke,o.InteractionRequiredAuthErrorMessage=St,o.Logger=Et,o.NavigationClient=rn,o.OIDC_DEFAULT_SCOPES=we,o.PopupClient=rr,o.PopupUtils=Be,o.PublicClientApplication=ei,o.RedirectClient=Pt,o.RedirectHandler=nr,o.ServerError=je,o.SignedHttpRequest=ni,o.SilentCacheClient=cn,o.SilentIframeClient=or,o.SilentRefreshClient=sn,o.StandardInteractionClient=Fe,o.StringUtils=_,o.UrlString=j,o.stubbedPublicClientApplication=ti,o.version=nt,Object.defineProperty(o,"__esModule",{value:!0})});let ee=ir.msal;function se(o){return typeof o=="string"||o instanceof String}function ye(o){return se(o)&&!!o}function ar(o){return typeof o=="number"&&Number.isFinite(o)}function Ee(o){return typeof o=="function"}function Ae(o){return typeof o=="boolean"}function ot(o){return se(o)&&(o==="true"||o==="false")}function it(o){if(!se(o))return!1;try{return new URL(o),!0}catch(c){}return!1}function Ce(o,c){if(!!Array.isArray(c))return c.find(h=>o===h)}function sr(o,c,h){return Math.max(c,Math.min(o,h))}function cr(o){return se(o)?Number.isInteger(parseInt(o)):!1}function un(o){return ye(o)&&o.indexOf("@")!=-1}const ur="#quickAuthPopup",Ke=new URLSearchParams(new URL(document.currentScript.src).searchParams),v=(()=>{const o={ERROR:0,WARNING:1,INFO:2,VERBOSE:3,TRACE:4};let c=o.ERROR,h=!1,g=!1,p=o.ERROR;function m(T){for(const B of Object.values(o))if(B==T)return B}function q(){switch(p){case o.ERROR:return ee.LogLevel.Error;case o.WARNING:return ee.LogLevel.Warning;case o.INFO:return ee.LogLevel.Info;case o.VERBOSE:return ee.LogLevel.Verbose;case o.TRACE:return ee.LogLevel.Trace}}const G="autoLogEvents";(()=>{const T="logMsalEvents";if(Ke.has(G)){const B=m(Ke.get(G));if(B===void 0)return;if(c=B,h=!0,Ke.has(T)){const E=m(Ke.get(T));E!==void 0&&(g=!0,p=E)}}})();function Z(T,...B){B.length!==0?console.error(T,B):console.error(T)}function te(T,...B){B.length!==0?console.warn(T,B):console.warn(T)}function Y(T,...B){B.length!==0?console.log(T,B):console.log(T)}function N(T,B,...E){!h||T>c||(T===o.ERROR?Z(B,...E):T===o.WARNING?te(B,...E):Y(B,...E))}return{error:function(T,...B){N(o.ERROR,T,...B)},warning:function(T,...B){N(o.WARNING,T,...B)},info:function(T,...B){N(o.INFO,T,...B)},verbose:function(T,...B){N(o.VERBOSE,T,...B)},trace:function(T,...B){N(o.TRACE,T,...B)},appendLoggingParamsToURL:function(T){!h||T.searchParams.append(G,c)},getMsalLoggerOptions:function(){return g?{loggerCallback:(T,B,E)=>{switch(T){case ee.LogLevel.Error:Z(B);return;case ee.LogLevel.Warning:te(B);return;case ee.LogLevel.Info:case ee.LogLevel.Verbose:case ee.LogLevel.Trace:Y(B);return}},logLevel:q(),piiLoggingEnabled:!0}:{}}}})(),at="start-signin-api";v.info("Inside ms_auth_client.js");function Ie(o=""){throw o&&v.error(`${o}: Library not initialized: Throwing`),X(o,"ms-auth-not-initialized"),"Microsoft Quick Auth library not initialized"}function qe(o,c){throw v.error(`${o}: ${c}: Throwing`),c}function lr(o){return Ce(o,["signin","signup","use"])}function Ut(o){return Ce(o,["left","center","right"])}function dr(o){return Ce(o,["icon","standard"])}function hr(o){return Ce(o,["light","dark"])}function pr(o){return Ce(o,["small","medium","large"])}function fr(o){return Ce(o,["signin_with","signup_with","continue_with","signin"])}function gr(o){return Ce(o,["rectangular","pill","rounded"])}function mr(o){return Ce(o,["left","center"])}const Je={POPUP:"popup",REDIRECT:"redirect"};function Mt(o){return Ce(o,[Je.POPUP,Je.REDIRECT])}function st(o){return se(o)?/^[a-z]{2}-[A-Z]{2}$/.test(o):!1}function vr(o){const c=new Map;return(g=>{for(const p in g.dataset)c.set(p,g.dataset[p])})(o),c}function ln(o){let c={};return ye(o.client_id)&&(c.client_id=o.client_id),it(o.login_uri)&&(c.login_uri=o.login_uri),it(o.redirect_uri)&&(c.redirect_uri=o.redirect_uri),se(o.redirect_state)&&(c.redirect_state=o.redirect_state),(Ee(o.callback)||ye(o.callback))&&(c.callback=o.callback),Mt(o.ux_mode)&&(c.ux_mode=o.ux_mode),Ae(o.redirect_allow_account_selection)&&(c.redirect_allow_account_selection=o.redirect_allow_account_selection),Ae(o.auto_prompt)&&(c.auto_prompt=o.auto_prompt),Ae(o.auto_sign_in)&&(c.auto_sign_in=o.auto_sign_in),lr(o.context)&&(c.context=o.context),Ae(o.cancel_on_tap_outside)&&(c.cancel_on_tap_outside=o.cancel_on_tap_outside),Ut(o.prompt_position)&&(c.prompt_position=o.prompt_position),st(o.locale)&&(c.locale=o.locale),c}function dn(o){let c={};return ye(o.get("client_id"))&&(c.client_id=o.get("client_id")),it(o.get("login_uri"))&&(c.login_uri=o.get("login_uri")),it(o.get("redirect_uri"))&&(c.redirect_uri=o.get("redirect_uri")),se(o.get("redirect_state"))&&(c.redirect_state=o.get("redirect_state")),Mt(o.get("ux_mode"))&&(c.ux_mode=o.get("ux_mode")),ot(o.get("redirect_allow_account_selection"))&&(c.redirect_allow_account_selection=o.get("redirect_allow_account_selection")==="true"),ye(o.get("callback"))&&(c.callback=o.get("callback")),ot(o.get("auto_prompt"))&&(c.auto_prompt=o.get("auto_prompt")==="true"),ot(o.get("auto_sign_in"))&&(c.auto_sign_in=o.get("auto_sign_in")==="true"),lr(o.get("context"))&&(c.context=o.get("context")),ot(o.get("cancel_on_tap_outside"))&&(c.cancel_on_tap_outside=o.get("cancel_on_tap_outside")==="true"),Ut(o.get("prompt_position"))&&(c.prompt_position=o.get("prompt_position")),st(o.get("locale"))&&(c.locale=o.get("locale")),c}const yr=28,Er=36,Lt=42,Cr=400,hn=600,pn=200,fn=42,gn=100,mn=yr,vn=Er,yn=Lt,En=102,Cn=102,In=110;function Ir(){return{type:"standard",theme:"dark",size:"large",text:"signin_with",shape:"rectangular",width:Cr,height:Lt,logo_alignment:"left",locale:"en-US"}}function wr(o){return sr(o,pn,hn)}function Tr(o){return sr(o,fn,gn)}function Sr(o,c,h){return dr(c.type)&&(o.type=c.type),hr(c.theme)&&(o.theme=c.theme),pr(c.size)&&(o.size=c.size),fr(c.text)&&(o.text=c.text),gr(c.shape)&&(o.shape=c.shape),ar(c.width)&&(o.width=wr(Math.round(c.width))),ar(c.height)&&(o.height=Tr(Math.round(c.height))),mr(c.logo_alignment)&&(o.logo_alignment=c.logo_alignment),st(h)&&(o.locale=h),o}function wn(o){let c={};return dr(o.get("type"))&&(c.type=o.get("type")),hr(o.get("theme"))&&(c.theme=o.get("theme")),pr(o.get("size"))&&(c.size=o.get("size")),fr(o.get("text"))&&(c.text=o.get("text")),gr(o.get("shape"))&&(c.shape=o.get("shape")),cr(o.get("width"))&&(c.width=wr(Number.parseInt(o.get("width")))),cr(o.get("height"))&&(c.height=Tr(Number.parseInt(o.get("height")))),mr(o.get("logo_alignment"))&&(c.logo_alignment=o.get("logo_alignment")),c}const ct="https://edge-auth.microsoft.com";v.info(`ms_auth_client.js origin: ${ct}`);function Dt(o){return new URL(o,ct)}function Ge(o,c,h){c.uuid=h,o.postMessage(c,ct)}function Tn(o){const c=o.type==="icon",h=(()=>o.size==="large"?Lt:o.size==="medium"?Er:yr)(),g=!c&&o.height>h?o.height:h;let m=(()=>c?o.size==="large"?yn:o.size==="medium"?vn:mn:Cr)();return!c&&o.width!==m&&(m=o.width),{width:m,height:g}}function _r(o,c,h){let g=Ar(Dt("/"+kt+"/signinbutton"),h);g.searchParams.append("use_dropdown_list",encodeURIComponent(Sn().toString())),v.appendLoggingParamsToURL(g),g.searchParams.append("uuid",C.uuid),g.searchParams.append("client_id",C.config.client_id),v.info("addSignInButton: Final URL: ",g);let p=document.createElement("div");p.style.position="relative";const m=document.createElement("iframe");m.name=`microsoft_signin_iframe_${c}`,m.title="Sign in with Microsoft button",m.src=g;const q=Tn(h);return m.style=`display: block;position: relative;top: 0px;left: 0px;height: ${q.height}px;width: ${q.width}px;border: 0px;`,p.appendChild(m),o.appendChild(p),{parent:o,buttonIFrame:m,buttonInnerParent:p,index:c,buttonConfig:h}}function Sn(){const o=window.location.search,c=new URLSearchParams(o).get("use_dropdown_list");return!c||c==="true"}function Ar(o,c){for(const[h,g]of Object.entries(c)){v.info("appendSearchParamsFromConfig: Key: ",h,", value: ",g);let p=g;se(g)||(p=""+g),o.searchParams.append(h,encodeURIComponent(p))}return o}function _n(o){return{text:o.text,theme:o.theme,shape:o.shape,size:o.size,width:o.width,locale:o.locale}}function An(o,c,h,g){const p=document.createElement("iframe");p.name=`microsoft_signin_button_dropdown_iframe_${c}`,p.title="Sign in with Microsoft dropdown";const m=Dt("/"+kt+"/dropdownlist");m.searchParams.append("microsoft_signin_iframe_name",h),v.appendLoggingParamsToURL(m),m.searchParams.append("uuid",C.uuid),m.searchParams.append("client_id",C.config.client_id),p.src=Ar(m,g);const q=g.width;p.style=`display: none; position: absolute; z-index: 9999; width: ${q}px; border-width: 0px;`;let G=document.createElement("div");return G.style.position="relative",G.appendChild(p),o.appendChild(G),{msDropdownIframe:p,dropdownInnerParent:G}}function Rn(o){const c=()=>{o.forEach(h=>h())};document.readyState?document.readyState==="loading"?window.addEventListener("DOMContentLoaded",function(){v.info("ms_auth_client.js, DOMContentLoaded called"),c()}):(v.info(`ms_auth_client.js, document.readyState: ${document.readyState}, calling functions; `,o),c()):window.addEventListener("load",function(){v.info("ms_auth_client.js, window.load called"),c()})}function bn(){document.body.addEventListener("click",()=>{Hr()},!0),document.body.addEventListener("keydown",o=>{o.key==="Escape"&&Hr()})}const C={msalObj:null,config:{client_id:"",login_uri:window.location.origin+"/blank.html",redirect_uri:"",redirect_state:"",ux_mode:Je.POPUP,redirect_allow_account_selection:!1,callback:null,callbackAsStr:"",auto_prompt:!0,auto_sign_in:!1,context:"signin",cancel_on_tap_outside:!0,prompt_position:"left",locale:"en-US"},signInButtonCounter:0,signInButtonMap:new Map,signInButtonWindowToSignInButtonInfoMap:new Map,signInButtonWindowToDropdownIframeMap:new Map,signInButtonIframeToWindow:new Map,dropdownWindowToDropdownInfoMap:new Map,dropdownIFrameToWindow:new Map,signInPromptIframe:null,uuid:crypto.randomUUID(),startSignInInfoMap:new Map,isConfigValid:function(o,c=!1){const h=g=>{const p=Ee(g);return c?p?!0:ye(g)&&typeof window[g]=="function":p||ye(g)};return!o.client_id||!h(o.callback)?!1:o.ux_mode!==Je.REDIRECT?!0:!!o.redirect_uri},isInitialized:function(){return!!this.msalObj},tryInitialize:function(o,c=!1){if(this.isInitialized())return v.error("tryInitialize: failed because initialize was already called before"),{result:"failure",reason:"Library already initialized"};if(!this.isConfigValid(o,c))return v.error("tryInitialize: Initialization failed because of invalid config"),{result:"failure",reason:"Invalid configuration"};const h=ln(o);return v.info("tryInitialize: sanitizedConfig: ",h),this.config.client_id=h.client_id,se(h.login_uri)&&(this.config.login_uri=h.login_uri),se(h.redirect_uri)&&(this.config.redirect_uri=h.redirect_uri),Mt(h.ux_mode)&&(this.config.ux_mode=h.ux_mode),Ae(h.redirect_allow_account_selection)&&(this.config.redirect_allow_account_selection=h.redirect_allow_account_selection),ye(h.redirect_state)&&(this.config.redirect_state=h.redirect_state),Ee(h.callback)?this.config.callback=h.callback:se(h.callback)&&(this.config.callbackAsStr=h.callback),Ae(h.auto_prompt)&&(this.config.auto_prompt=h.auto_prompt),Ae(h.auto_sign_in)&&(this.config.auto_sign_in=h.auto_sign_in),se(h.context)&&(this.config.context=h.context),Ae(h.cancel_on_tap_outside)&&(this.config.cancel_on_tap_outside=h.cancel_on_tap_outside),se(h.prompt_position)&&(this.config.prompt_position=h.prompt_position),st(h.locale)&&(this.config.locale=h.locale),v.info("tryInitialize: this.config: ",this.config),this.msalObj=this.createMsalObject(),this.updateSignInCallback(),this.createSignInPromptIframe(),{result:"success"}},createMsalObject:function(){const o={auth:{clientId:this.config.client_id,authority:"https://login.microsoftonline.com/consumers",redirectUri:this.config.login_uri,postLogoutRedirectUri:this.config.login_uri},cache:{cacheLocation:"localStorage",storeAuthStateInCookie:!1},system:{loggerOptions:v.getMsalLoggerOptions()}};return new ee.PublicClientApplication(o)},usingRedirectFlow:function(){return this.config.ux_mode===Je.REDIRECT&&!!this.config.redirect_uri},getSignInCallback:function(){return this.config.callback},updateSignInCallback:function(){!this.isInitialized()||Ee(this.config.callback)||!ye(this.config.callbackAsStr)||typeof window[this.config.callbackAsStr]=="function"&&(this.config.callback=window[this.config.callbackAsStr])},updateAndGetSignInCallback:function(){return this.getSignInCallback()||this.updateSignInCallback(),this.getSignInCallback()},tryInitializeFromDiv:function(){const o="tryInitializeFromDiv";if(this.isInitialized()){v.error("tryInitializeFromDiv: already initialized: Exiting");return}const c=document.getElementById("ms-auth-initialize");if(!c){v.info("tryInitializeFromDiv: ms_auth_client: DID NOT FIND ms-auth-initialize div");return}v.info("tryInitializeFromDiv: ms_auth_client: found ms-auth-initialize div");const h=vr(c),g=dn(h),p=this.tryInitialize(g);p.result!=="success"&&v.info("tryInitializeFromDiv: initialization failed with reason: ",p.reason)},addButtonsFromMarkUp:function(){const o=document.getElementsByClassName("ms-auth-button"),c="addButtonsFromMarkUp";if(!this.isInitialized()){o.length>0&&console.error("Library not initialized: Adding 'ms-auth-button's failed"),X(c,"ms-auth-not-initialized");return}for(const h of o){++this.signInButtonCounter;const g=vr(h),p=wn(g),m=Sr(Ir(),p,this.config.locale),q=_r(h,this.signInButtonCounter,m);this.signInButtonMap.set(q.parent,q),this.signInButtonWindowToSignInButtonInfoMap.set(q.buttonIFrame.contentWindow,q),this.signInButtonIframeToWindow.set(q.buttonIFrame,q.buttonIFrame.contentWindow)}if(o.length>0){X(c,"success");return}X(c,"no-button-div")},renderSignInButton:function(o,c){const h="renderSignInButton";this.isInitialized()||Ie(h),o||(X(h,"no-parent"),qe(h,"No parent specified")),c=c||{};const g=Sr(Ir(),c,this.config.locale),p=this.signInButtonMap.get(o);if(p){const q=this.signInButtonIframeToWindow.get(p.buttonIFrame);if(p.dropdownInnerParent){const G=this.signInButtonWindowToDropdownIframeMap.get(q),Z=this.dropdownIFrameToWindow.get(G);this.dropdownWindowToDropdownInfoMap.delete(Z),this.signInButtonWindowToDropdownIframeMap.delete(q),this.dropdownIFrameToWindow.delete(G),p.dropdownInnerParent.remove()}p.buttonInnerParent&&p.buttonInnerParent.remove(),this.signInButtonWindowToSignInButtonInfoMap.delete(q),this.signInButtonMap.delete(o),this.signInButtonIframeToWindow.delete(p.buttonIFrame)}++this.signInButtonCounter;const m=_r(o,this.signInButtonCounter,g);this.signInButtonMap.set(m.parent,m),this.signInButtonWindowToSignInButtonInfoMap.set(m.buttonIFrame.contentWindow,m),this.signInButtonIframeToWindow.set(m.buttonIFrame,m.buttonIFrame.contentWindow),X(h,"success")},isAutoPromptOn:function(){return this.isInitialized()&&this.config.auto_prompt},getDefaultPromptPosition:function(){return this.config.prompt_position},updateButtonIframeUuid:function(o,c){const h=this.signInButtonWindowToSignInButtonInfoMap.get(o);if(!h){v.error("updateButtonIframeUuid: contentWindow for button iframe was not found");return}h.uuid=c},getButtonIFrameUuid:function(o){const c=this.signInButtonWindowToSignInButtonInfoMap.get(o);if(!c){v.error("getButtonIFrameUuid: contentWindow for button iframe was not found");return}const h=c.uuid;return h||v.error("getButtonIFrameUuid: invalid uuid"),h},updateDropdownIframeUuid:function(o,c){const h=this.dropdownWindowToDropdownInfoMap.get(o);if(!h){v.error("updateDropdownIframeUuid: contentWindow for dropdown iframe was not found");return}h.uuid=c},getDropdownIframeUuid:function(o){const c=this.dropdownWindowToDropdownInfoMap.get(o);if(!c){v.error("getDropdownIframeUuid: contentWindow for dropdown iframe was not found");return}const h=c.uuid;return h||h.error("getDropdownIframeUuid: invalid uuid"),h},postMessageToDropdown:function(o,c){const h=this.getDropdownIframeUuid(o);Ge(o,c,h)},postMessageToButtonOrDropDown:function(o,c){const h=this.signInButtonWindowToSignInButtonInfoMap.get(o);if(h){v.info("postMessageToButtonOrDropDown: contentWindow was button, so sending message"),Ge(o,c,h.uuid);return}const g=this.dropdownWindowToDropdownInfoMap.get(o);if(g){v.info("postMessageToButtonOrDropDown: contentWindow was dropdown, so sending message"),Ge(o,c,g.uuid);return}v.error("postMessageToButtonOrDropDown, did not find contentWindow, so message was dropped")},createSignInPromptIframe:function(){if(!this.isInitialized()||this.signInPromptIframe)return;const o=Dt("/"+kt+"/signinprompt");v.appendLoggingParamsToURL(o),o.searchParams.append("uuid",this.uuid),o.searchParams.append("send_session_started",!0),o.searchParams.append("client_id",this.config.client_id),o.searchParams.append("locale",this.config.locale),o.searchParams.append("context",this.config.context),this.appendSamplingDisabled(o),v.info("signInPromptUrl: ",o);const c=document.createElement("div");c.style="height: 0px;width: 0px;border: 0px; margin: 0px; padding: 0px";const h=document.createElement("iframe");h.id="microsoft_signin_prompt_holder",h.name="microsoft_signin_prompt_iframe",h.title="Sign in with Microsoft prompt",h.src=o,h.style="height: 0px;width: 0px;border: 0px",c.appendChild(h),document.body?document.body.appendChild(c):document.appendChild(c),v.info("Created sign-in prompt iframe"),this.signInPromptIframe=h},getAccountFromIdentifier:function(o){if(!this.msalObj)return null;let c=this.msalObj.getAccountByHomeId(o);return c||(v.warning(`msAuthState.getAccountFromIdentifier: getAccountByHomeId failed for ${o}`),c=this.msalObj.getAccountByUsername(o),c||v.warning(`msAuthState.getAccountFromIdentifier: getAccountByUsername failed for ${o}`),c)},startRedirectionFlow:function(o=!1){const c=lt.join(" "),h=new URL("https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize");h.searchParams.append("response_type","code"),h.searchParams.append("response_mode","form_post"),o&&h.searchParams.append("prompt","select_account"),h.searchParams.append("client_id",this.config.client_id),h.searchParams.append("redirect_uri",this.config.redirect_uri),h.searchParams.append("scope",c),this.config.redirect_state&&h.searchParams.append("state",this.config.redirect_state),v.info("startRedirectionFlow: url: ",h),window.location.href=h.toString()},setRedirectState:function(o){v.info(`setRedirectState: newState: ${o}`),se(o)&&(this.config.redirect_state=o)},addStartSignInOptionsIfNeeded:function(o){if(!o)return"";const c=crypto.randomUUID();return this.startSignInInfoMap.set(c,o),c},getStartSignInOptions:function(o){return this.startSignInInfoMap.get(o)},removeStartSignInOptions:function(o){return this.startSignInInfoMap.delete(o)},appendSamplingDisabled:function(o){const c="samplingDisabled";Ke.has(c)&&o.searchParams.append(c,Ke.get(c))}},On=()=>{const o=C.getDefaultPromptPosition();if(o){if(o==="left")return"LEFT";if(o==="center")return"CENTER"}return"RIGHT"},Pn=o=>Ut(o)?o.toUpperCase():On(),ut={IMAGE:0,JSON:1},Ht={graphMeV1EndPoint:"https://graph.microsoft.com/v1.0/me",graphPhotoEndpoint:"https://graph.microsoft.com/beta/me/photo/$value",graphV1PhotoEndPoint:"https://graph.microsoft.com/v1.0/users/%cid%/photo/$value",getV1CidPhotoEndPoint:function(o){return Ht.graphV1PhotoEndPoint.replace("%cid%",o)}};function Rr(o,c,h,g){const p=new Headers,m=`Bearer ${c}`;p.append("Authorization",m);const q={method:"GET",headers:p};v.info("callMSGraph: request made to Graph API at: "+new Date().toString()),fetch(o,q).then(G=>{if(G.ok){const Z=G.headers.get("content-type");if(!Z)return null;if(h===ut.IMAGE){if(Z.toLowerCase().indexOf("image/")===0)return G.blob()}else if(h===ut.JSON&&Z.toLowerCase().indexOf("application/json")>=0)return G.json()}return null}).then(G=>g(G)).catch(G=>{v.error(G),g(null)})}const lt=["openid","profile","User.Read","email","offline_access"],Nn={scopes:[...lt]};function kn(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(o){var c=Math.random()*16|0,h=o=="x"?c:c&3|8;return h.toString(16)})}const Ft=(()=>{const o="ms_quick_auth_db",c="prompt_store";let g=null,p=!1,m=!1,q=!1,G=[];function Z(){v.info("In runCachedRequests: number of requests: ",G.length);for(const H of G)H();G=[]}function te(H){const M=new Date;return H===1?M.setHours(M.getHours()+2):H===2?M.setDate(M.getDate()+1):H===3?M.setDate(M.getDate()+7):M.setDate(M.getDate()+28),M}function Y(){return p&&!m&&!q}function N(H="readonly"){return g.transaction(c,H).objectStore(c)}function T(){if(!p){p=!0;try{let H=indexedDB.open(o,1);H.onsuccess=function(){v.info("dbOpenRequest.onsuccess: Opened database"),g=this.result,g&&Z(),g.onversionchange=function(){g.close(),g=null,m=!0}},H.onupgradeneeded=function(M){v.info("Inside dbOpenRequest.onupgradeneeded");const $=M.target.result;M.oldVersion===0&&($.createObjectStore(c,{keyPath:"client_id"})||(v.error("dbOpenRequest.onupgradeneeded: Could not create store"),q=!0))},H.onerror=function(M){v.info("dbOpenRequest.onerror: evt: ",M),q=!0}}catch(H){v.error("promptDbWrapper.initialize: err: ",H),q=!0}}}function B(H,M){if(!p)return v.warning("startRecordPromptCancel: db was not initialized"),!1;if(!g&&!Y())return v.warning("startRecordPromptCancel: db is not usable in session"),!1;if(!g)return H?(v.info("startRecordPromptCancel: Putting in request queue."),G.push(function(){B(!1,M)}),!0):(v.warning("startRecordPromptCancel: db not found"),!1);function $(O){v.info("handleGetResult: ",O);try{const x=N("readwrite");let oe=null;const be=O?"Update: ":"Add: ";O?(O.cancel_count+=1,O.next_show_time=te(O.cancel_count),oe=x.put(O)):oe=x.add({client_id:M,cancel_count:1,next_show_time:te(1)}),oe.onsuccess=function(){v.info(`startRecordPromptCancel: ${be} succeeded!`)},oe.onerror=function(ze){ze.preventDefault(),ze.stopPropagation(),v.warning(`startRecordPromptCancel: ${be} error: `,ze)}}catch(x){v.error("handleGetResult: err: ",x)}}return we(H,M,$)}function E(H,M){if(!p)return v.warning("startClearPromptInfo: db was not initialized"),!1;if(!g&&!Y())return v.warning("startClearPromptInfo: db is not usable in session"),!1;if(!g)return H?(v.info("startClearPromptInfo: Putting in request queue."),G.push(function(){E(!1,M)}),!0):(v.warning("startClearPromptInfo: db not found"),!1);try{let O=N("readwrite").delete(M);O.onsuccess=function(){v.info("startClearPromptInfo: success")},O.onerror=function(x){x.preventDefault(),x.stopPropagation(),v.warning("startClearPromptInfo: failed with error: ",x)}}catch($){return v.error("startClearPromptInfo: err: ",$),!1}return!0}function we(H,M,$){if(!p)return v.warning("startGetPromptInfo: db was not initialized"),!1;if(!g&&!Y())return v.warning("startGetPromptInfo: db is not usable in session"),!1;if(!g)return H?(v.info("startGetPromptInfo: Putting in request queue."),G.push(function(){we(!1,M,$)}),!0):(v.warning("startGetPromptInfo: db not found"),$(null),!1);try{let x=N().get(M);x.onsuccess=function(){v.info("startGetPromptInfo: request.onsuccess: result: ",x.result),x.result?$(x.result):$(null)},x.onerror=function(oe){oe.preventDefault(),oe.stopPropagation(),v.error("startGetPromptInfo: request.onerror: event: ",oe),$(null)}}catch(O){return v.error("startGetPromptInfo: err: ",O),!1}return!0}function pt(H,M,$){return we(H,M,function(O){if(!O)$(!0);else if(!O.next_show_time)v.warning("startCanShowPrompt: Odd result: Missing next_show_time"),$(!0);else{const x=new Date>O.next_show_time;$(x)}})}return{startRecordPromptCancel:function(...H){return T(),B(!0,...H)},startClearPromptInfo:function(...H){return T(),E(!0,...H)},startCanShowPrompt:function(...H){return T(),pt(!0,...H)}}})(),R={currentId:"",callback:null,signInInProgress:!1,promptWindowUuid:"",promptReady:!1,messageQueue:[],hasMSAAccountCallbackMap:new Map,hasConsentPromptSuppressed:!1,isPromptForButton:!1,scenarioForButton:"",generateNewId:function(){return this.currentId=kn(),this.currentId},handleSignInCancel:function(){this.clearState()},handleSignout:function(){this.clearState()},handleOtherResult:function(){this.clearState()},isPromptActive:function(){return!!this.currentId},clearState:function(){this.currentId="",this.callback=null,this.signInInProgress=!1,this.isPromptForButton=!1,this.scenarioForButton=""},get contentWindow(){return C.signInPromptIframe.contentWindow},postMessage:function(o){if(this.promptReady){Ge(C.signInPromptIframe.contentWindow,o,this.promptWindowUuid);return}this.messageQueue.push(o)},setPromptReady:function(){v.info("In setPromptReady"),this.promptReady=!0;for(const o of this.messageQueue)v.info("Sending message after prompt iframe responded: ",o),Ge(C.signInPromptIframe.contentWindow,o,this.promptWindowUuid);this.messageQueue=[]},handlePromptResult:function(o){if(o.type==="display"){const c=o.displayed?"display":o.reason||"display-failed";v.info("Prompt displayed: ",c)}else o.type==="skipped"?v.info("Prompt skipped with reason: ",o.reason):o.type==="dismissed"?v.info("Prompt dismissed with reason: ",o.reason):v.info("Prompt: ",o.reason);o.type==="dismissed"&&o.reason==="cancel_called"&&X("cancel","success"),!this.isPromptForButton&&o.reason==="user_cancelled"&&(v.info("handlePromptResult, got user cancelled, so recording cooldown"),Ft.startRecordPromptCancel(C.config.client_id)),this.callback&&this.callback(o)},hasMSAAccount:function(o,c){Ee(c)||(X(o,"callback-not-a-function"),qe(o,"callback is not a function"));const h=crypto.randomUUID();this.postMessage({message:"has-msa-account",id:h}),this.hasMSAAccountCallbackMap.set(h,c)},handleHasMSAAccountResult:function(o,c){const h=this.hasMSAAccountCallbackMap.get(c);h&&(h(o),this.hasMSAAccountCallbackMap.delete(c))},showPromptInternal:function(o){R.callback=o.promptCallback;const c={message:o.message,url:window.location.href,unique_id:this.generateNewId(),position:Pn(o.position),context:C.config.context.toUpperCase(),cancel_on_tap_outside:C.config.cancel_on_tap_outside,auto_sign_in:C.config.auto_sign_in,redirect_mode:C.usingRedirectFlow(),will_show_verify_prompt:o.will_show_verify_prompt};R.postMessage(c)},showPrompt:function(o,c){const h={message:"start-sign-in-prompt",position:o,will_show_verify_prompt:!1,promptCallback:c};Ft.startCanShowPrompt(C.config.client_id,function(p){if(p){R.showPromptInternal(h);return}R.handlePromptResult({type:"display",displayed:!1,reason:"in_cooldown_period"})})||(v.warning("showPrompt: promptDbWrapper.startCanShowPrompt returned false, proceeding without cooldown check"),R.showPromptInternal(h))},showVerifyPrompt:function(){R.showPromptInternal({message:"start-verifing-prompt",position:"center",will_show_verify_prompt:!0})},showSignInPromptForButton:function(){R.isPromptForButton=!0,R.showPromptInternal({message:"start-sign-in-prompt-for-button",position:"center",will_show_verify_prompt:!1})},clearPromptInfo(){v.info("Message Eventhandler: clearPromptInfo: calling startClearPromptInfo"),Ft.startClearPromptInfo(C.config.client_id)}},br=()=>{if(!C.msalObj)return v.warning("ms_auth_client.js: getCurrentAccounts: not initialized"),[];const o=C.msalObj.getAllAccounts();return o?v.info(`ms_auth_client.js: getCurrentAccounts: current accounts: for ${C.config.client_id}`,o):v.info(`ms_auth_client.js: getCurrentAccounts: current accounts: for ${C.config.client_id}: EMPTY`),o};function Un(o){return o?o.username!==""&&o.homeAccountId!==""&&o.tenantId!==""&&o.environment!=="":!1}function Mn(){const o=br();return o&&o.length>0&&Un(o[0])}function Or(o){return o?o.username&&o.id:!1}function Ln(o,c,h,g){const p=o.isPromptSignIn()&&g?"-with-suppress-consent-prompt":"";h.length>0?o.handleSignInResult({result:"failure"+p,reason:h}):Or(c)?o.handleSignInResult({result:"success"+p}):o.handleSignInResult({result:"failure"+p,reason:"unknown"}),R.hasConsentPromptSuppressed=!1}function Ue(o,c,h=""){let g=(()=>c.callback?c.callback:C.updateAndGetSignInCallback())();if(o)o.authCode=C.authCode;if(Kt(o,c),Ln(c,o,h,R.hasConsentPromptSuppressed),!g){v.warning("sendToClientSignInAccountInfo: finalCallback not found - exiting");return}Or(o)?(g(o,null),R.postMessage({message:"account-info-received",accountInfo:o})):c.fireSignInErrorCallback({errorCode:"other_error",errorMessage:h})}function Pr(o,c=!1){v.info(`handleRedirectSignIn: showSelectAccount: ${c}`),o.handleSignInResult({result:"redirect"}),Dn(o),C.startRedirectionFlow(c)}function Nr(o){let c={};return c.fullName=o.name||"",c.username=o.username||"",c.id=o.localAccountId||"",c.email="",c.homeAccountId=o.homeAccountId||"",c.givenName="",c.surname="",c}function dt(o,c=!1){if(!o.contentWindow)return;const h={message:"sign-in-result",result:c?"success":"fail",scenario:o.scenario,duration:Math.round((Date.now()-o.startTime)/1e3)};o.contentWindow===R.contentWindow?R.postMessage(h):C.postMessageToButtonOrDropDown(o.contentWindow,h),c&&R.clearPromptInfo()}function Dn(o){if(!o.contentWindow)return;const c={message:"redirect-sign-in",scenario:o.scenario};o.contentWindow===R.contentWindow?R.postMessage(c):C.postMessageToButtonOrDropDown(o.contentWindow,c)}function Hn(o,c){if(c&&c.account&&c.idToken){const h=Nr(c.account);h&&(h.idToken=c.idToken),c.account&&C.msalObj.setActiveAccount(c.account),Mr(h,o),dt(o,!!h)}else{Kt(null,o);const h=(()=>{if(c){if(!c.idToken)return"idtoken_obtain_failed";if(!c.account)return"account_obtain_failed"}return"credential_obtain_failed"})();dt(o,!1),o.handleSignInResult({result:"failure",reason:h}),o.fireSignInErrorCallback({errorCode:h,errorMessage:"Failed to obtain token needed for sign-in"})}}function kr(o){return function(c){Hn(o,c)}}function Fn(){return/FxiOS/i.test(navigator.userAgent)}function Bn(){const o=navigator.userAgent;return/safari/i.test(o)&&!/chrome/i.test(o)}function Kn(){return/Edg/i.test(navigator.userAgent)}function qn(o){return o instanceof ee.BrowserAuthError?o.errorCode==ee.BrowserAuthErrorMessage.userCancelledError.code:!1}function Gn(o){return o instanceof ee.BrowserAuthError?o.errorCode==ee.BrowserAuthErrorMessage.popupWindowError.code:!1}function zn(o){return o instanceof ee.ServerError?o.errorCode=="access_denied":!1}function Ur(o,c){qn(c)?(v.info("signIn: loginPopup was cancelled by user"),o.handleSignInResult({result:"failure",reason:"canceled"})):Gn(c)?(v.info("signIn: loginPopup was blocked"),o.handleSignInResult({result:"failure",reason:"popup-blocked"})):zn(c)?o.handleSignInResult({result:"failure",reason:"access_denied"}):o.handleSignInResult({result:"failure",reason:"failure"})}function Re(o,c=!1){if(v.info("signIn"),!C.msalObj){v.warning("signIn: not initialized: exiting");return}if(o&&C.usingRedirectFlow()){v.warning("signIn: redirect flow - calling handleRedirectSignIn"),Pr(o);return}qt();const h={scopes:[...lt]};o.isPromptSignIn()?h.extraPopupNameForQuickAuth=`.origin='${window.location.origin}'.quickAuthSignInOnly`:c&&(h.extraPopupNameForQuickAuth=`.origin='${window.location.origin}'.quickAuthDetectOnly`,h.popupCallback=R.showVerifyPrompt),h.quickAuthPopupHashTag=ur;const g=kr(o),p=()=>{v.info("signIn: Calling loginPopup"),C.msalObj.loginPopup(h).then(g).catch(m=>{if(v.info("signIn: loginPopup failed with error: ",m),c&&R.isPromptActive()&&!R.isPromptForButton){Bt({type:"dismissed",reason:"consent-popup-detection-finished"});return}Ur(o,m),dt(o,!1),Kt(null,o),o.fireSignInErrorCallback(m)})};Bn()||Fn()?p():C.msalObj.ssoSilent(h).then(g).catch(m=>{v.info("signIn: ssoSilent failed with error: ",m),p()})}function Wn(o,c){const h="signOut";v.info(h),C.msalObj||Ie(h),c&&!Ee(c)&&(X(h,"callback-not-a-function"),qe(h,"callback is not a function"));const g=C.getAccountFromIdentifier(o);if(!g){c({result:"failure",error:"account identifier not found"}),X(h,"no-account-found");return}R.handleSignout();const p={account:g};C.msalObj.logoutPopup(p).then(()=>{v.info("signOut: Logout done"),c({result:"success"}),X(h,"success")}).catch(m=>{v.warning("signOut: logoutPopup failed: ",m),c({result:"failure",error:m}),X(h,"msal-logout-popup-failure")})}function jn(o,c){return o?(c.account=C.msalObj.getAccountByUsername(o),C.msalObj.acquireTokenSilent(c).catch(h=>{if(v.warning("getTokenPopup: silent token acquisition fails. acquiring token using redirect"),h instanceof ee.InteractionRequiredAuthError)return C.msalObj.acquireTokenPopup(c).then(g=>(v.info("getTokenPopup: ",g),g)).catch(g=>{throw v.error("getTokenPopup: ",g),g});throw v.warning("getTokenPopup: ",h),h})):Promise.reject(new Error("Invalid username"))}function Mr(o,c){jn(o.username,Nn).then(h=>{if(!h||h.accessToken===""){Ue(o,c,"account-id-access-token-fetch-failed");return}const g=h.accessToken;Rr(Ht.graphMeV1EndPoint,g,ut.JSON,function(p){if(!p){Ue(o,c,"account-cid-fetch-failed");return}const m=p.id;if(m!==""){o.id=m,o.givenName=p.givenName||"",o.surname=p.surname||"",un(p.userPrincipalName)&&(o.email=p.userPrincipalName);const q=Ht.getV1CidPhotoEndPoint(m);Rr(q,g,ut.IMAGE,function(G){if(!G){Ue(o,c);return}try{const Z=new FileReader;Z.readAsDataURL(G),Z.onloadend=function(){o.photoUrl=Z.result,Ue(o,c)}}catch(Z){v.warning(Z),Ue(o,c,"failure-load-image")}})}else Ue(o,c,"account-cid-not-found")})}).catch(h=>{Ue(o,c,"failure-get-token-popup"),v.error(h)})}function Lr(o,c){const h="promptForSignIn";C.isInitialized()||Ie(h);let g=null;if(Ee(c)?g=c:c&&(X(h,"callback-not-a-function"),qe(h,"callback is not a function")),R.isPromptActive()){v.info("promptForSignIn: Another prompt is open");const p={type:"display",displayed:!1,reason:"another_prompt_running"};R.handlePromptResult(p),g&&g(p);return}R.showPrompt(o,g)}function Dr(o=!0){if(C.isInitialized()||Ie("cancelPromptForSignIn"),!R.isPromptActive())return v.warning("cancelPromptForSignIn: No prompt open"),{result:"failure",reason:"no-prompt-open"};const c={message:"close-sign-in-prompt",url:window.location.href,unique_id:R.currentId,called_by_cancel_api:o};R.postMessage(c)}function Bt(o){v.info("closePromptWithResult: result: ",o),R.handlePromptResult(o),Dr(!1),R.clearState()}function Kt(o,c){if(!R.signInInProgress||R.contentWindow!=c.contentWindow)return;const h=(()=>o?{type:"dismissed",reason:"credential_returned"}:{type:"dismissed",reason:"credential_obtain_failed"})();Bt(h)}function Vn(o){if(!R.isPromptActive()){v.info("closeOpenPromptWithReason: no prompt open: exiting");return}Bt({type:"dismissed",reason:o})}function qt(){R.signInInProgress||Vn("flow_restarted")}function Yn(o){o.value==="PROCEED_WITH_SIGNIN"?Re(new pe("prompt-sign-in",null,!0)):o.value==="USER_CANCELLED"?R.handleSignInCancel():R.handleOtherResult()}function xn(o,c){if(v.info("handleNewSignInPromptResult: ",o),!o.type)return;let h=!1;if(o.type!=="internal"){o.type==="display"?o.displayed===!1?h=!0:o.displayed===!0&&C.config.auto_sign_in&&(Fr("prompt-auto-sign-in")||(R.signInInProgress=!0,Re(new pe("prompt-auto-sign-in",c,!0)))):(o.type==="skipped"||o.type==="dismissed")&&(h=!0),R.handlePromptResult(o),h&&R.clearState();return}if(o.reason==="user_clicked_continue"){R.signInInProgress=!0;const g=R.isPromptForButton?"prompt-sign-in-for-button":"prompt-sign-in";Re(new pe(g,c,!0))}}function Qn(o,c){if(o.type){xn(o,c);return}Yn(o,c)}function Jn(o){v.info("handleEasyAuthServerSignInPromptReady: promptWindowUuid: ",o),R.promptWindowUuid=o,R.setPromptReady(),C.isAutoPromptOn()&&(v.info("handleEasyAuthServerSignInPromptReady: Calling prompt for sign-in"),Lr())}function Xn(o,c){v.info("handleEasyAuthServerButtonReady: buttonWindow: ",o,", uuid: ",c),C.updateButtonIframeUuid(o,c)}function $n(o,c){v.info("handleEasyAuthServerDropdownReady: dropdownWindow: ",o,", uuid: ",c),C.updateDropdownIframeUuid(o,c)}function Gt(o){if(C.usingRedirectFlow()){Pr(o,!0);return}qt();const c={scopes:[...lt],prompt:"select_account"},h=kr(o);C.msalObj.loginPopup(c).then(h).catch(g=>{dt(o,!1),v.info("handleSignInWithDifferentAccount: loginPopup failed with error: ",g),Ur(o,g),o.fireSignInErrorCallback(g)})}function Zn(o){!o||(o.style.display="block",o.focus())}function ht(o){!o||(o.style.display="none")}function Hr(){C.signInButtonWindowToDropdownIframeMap.forEach((o,c)=>{if(o.style.display==="block"){ht(o);const h=C.getButtonIFrameUuid(c);Ge(c,{message:"dropdown-list-closed"},h)}})}function eo(o){return o==="medium"?Cn:o==="large"?In:En}function to(o,c,h){let g=window.innerHeight-c.buttonIFrame.getBoundingClientRect().bottom;const p=c.buttonConfig.size;o.style.height=`${eo(p)}px`;const m=parseInt(o.style.height);if(g<m){const q=c.buttonIFrame.getBoundingClientRect().height+m-2;o.style.marginTop=`${-q}px`}else{const q=h-c.buttonIFrame.getBoundingClientRect().height-1;o.style.marginTop=`${q}px`}}window.addEventListener("message",o=>{if(v.info("Message EventHandler: Event received: ",o),o.origin!==ct&&o.origin!=="https://account.live.com"){v.warning(`Message EventHandler: Neglecting message from different origin: ${o.origin}`);return}const c=o.data;if(c){if(v.info("Message EventHandler: DataObject: ",c),c.message==="sign-in-clicked"){const h=c.scenario!=="button-sign-in";Re(new pe(c.scenario,o.source,!0),h),h&&(R.scenarioForButton=c.scenario)}else if(c.message==="sign-in-prompt-result")Qn(c.result,o.source);else if(c.message==="easy-auth-server-button-ready")Xn(o.source,c.uuid);else if(c.message==="easy-auth-server-signin-prompt-ready")Jn(c.uuid);else if(c.message==="easy-auth-drop-down-ready")$n(o.source,c.uuid);else if(c.message==="ignore-caw-operation-done")if(c.context===at){let h=null,g=!1,p=!1;if(c.additionalInfo&&c.additionalInfo.optionsId){const q=c.additionalInfo.optionsId,G=C.getStartSignInOptions(q);G&&(h=G.callback,g=!!h,p=G.showAccountSelection===!0,C.removeStartSignInOptions(q))}const m=new pe(c.context,o.source,!0,"startSignIn",h,g);p?Gt(m):Re(m)}else c.context==="prompt-auto-sign-in"&&R.isPromptActive()&&(R.signInInProgress=!0,Re(new pe(c.context,o.source,!0)));else if(c.message==="close-dropdown-list-from-signin-button"){const h=C.signInButtonWindowToDropdownIframeMap.get(o.source);ht(h)}else if(c.message==="close-dropdown-list-from-dropdown-list"){const h=C.dropdownWindowToDropdownInfoMap.get(o.source);ht(h.iframe)}else if(c.message==="open-dropdown-list-from-signin-button"){const h=C.signInButtonWindowToDropdownIframeMap.get(o.source),g=C.signInButtonWindowToSignInButtonInfoMap.get(o.source);to(h,g,c.msButtonHeight),Zn(h),C.postMessageToDropdown(h.contentWindow,{message:"dropdown-list-shown"})}else if(c.message==="open-signin-popup"){const h=C.dropdownWindowToDropdownInfoMap.get(o.source);ht(h.iframe),Gt(new pe("different-account-sign-in",o.source,!0))}else if(c.message==="create-dropdown-list-iframe"){const h=C.signInButtonWindowToSignInButtonInfoMap.get(o.source);if(h){const{msDropdownIframe:g,dropdownInnerParent:p}=An(h.parent,h.index,h.buttonIFrame.name,_n(h.buttonConfig));h.dropdownInnerParent=p,C.signInButtonWindowToDropdownIframeMap.set(h.buttonIFrame.contentWindow,g),C.dropdownWindowToDropdownInfoMap.set(g.contentWindow,{iframe:g}),C.dropdownIFrameToWindow.set(g,g.contentWindow)}}else if(c.message==="has-msa-account-result")R.handleHasMSAAccountResult(c.result,c.id);else if(c.message==="simulate-click-for-quick-auth")Kr("simulate-click-for-quick-auth",c.result),c.result==="success"&&(R.hasConsentPromptSuppressed=!0);else if(c.message==="detect-msa-consent"){const h=o.source;h.close();const g=R.scenarioForButton;c.result?R.showSignInPromptForButton():Re(new pe(g,h,!0))}}});function ro(o){const c="startGetCurrentAccount";if(C.msalObj||Ie(c),Ee(o)||(Xe(c,{result:"failure",reason:"not-a-function"}),qe(c,"callback is not a function")),!Mn()){o(null),Xe(c,{result:"failure",reason:"no-account-found"});return}let h=C.msalObj.getActiveAccount();if(!h){const p=C.msalObj.getAllAccounts();h=p[p.length-1]}const g=Nr(h);Mr(g,new pe(c,null,!0,c,o))}function Fr(o,c){if(!Kn()||!C.signInPromptIframe)return!1;const h={message:"remove-ignore-caw",context:o,additionalInfo:c};return R.postMessage(h),!0}function no(o){const c="startSignIn";C.isInitialized()||Ie(c);let h,g=null,p=null;if(o&&(o.signInCallback&&(Ee(o.signInCallback)||qe(c,"signInCallback is not a valid function"),g=o.signInCallback),p=C.addStartSignInOptionsIfNeeded(o),p?(v.info(`msAuthStartSignIn, stored options with id: ${p}`),h={optionsId:p}):v.error("msAuthStartSignIn, could not store options")),qt(),!Fr(at,h)){C.removeStartSignInOptions(p);const m=new pe(at,null,!0,c,g,!0);o&&o.showAccountSelection===!0?Gt(m):Re(m)}}function oo(o,c=""){const h="msAuthAcquireTokenPopup";C.msalObj||Ie(h);const g=c||h;return C.msalObj.acquireTokenPopup(o).then(p=>(X(g,"success"),p)).catch(p=>{throw X(g,"failed"),p})}function io(o,c=""){const h="msAuthAcquireTokenSilent";C.msalObj||Ie(h);const g=c||h;return C.msalObj.acquireTokenSilent(o).then(p=>(X(g,"success"),p)).catch(p=>{throw X(g,"failed"),p})}function ao(o,c){C.renderSignInButton(o,c)}function so(o,c=""){const h="msAuthGetMSALAccount";C.msalObj||Ie(h);const g=c||h;if(!o)return X(g,"invalid-identifier"),null;const p=C.getAccountFromIdentifier(o);return p?X(g,"success"):X(g,"no-account-found"),p}let Br=!1;function co(){if(!Br){Br=!0;try{C.tryInitializeFromDiv()}catch(o){}C.isInitialized()&&(C.addButtonsFromMarkUp(),br())}}Rn([co,bn]);function X(o,c){R.postMessage({message:"method-result",method:o,result:c})}function Kr(o,c){R.postMessage({message:"scenario-result",scenario:o,result:c})}function qr(o,c){if(!c)return;function h(g){o.functionName?X(o.functionName,g):o.scenario&&Kr(o.scenario,g)}(c.result.startsWith("success")||c.result==="redirect")&&h(c.result),c.reason&&h(c.reason)}function Xe(o,c){qr({functionName:o},c)}class pe{constructor(c,h,g=!1,p="",m=null,q=!1){this.scenario=c,this.contentWindow=h,this.sendTelemetry=g,this.functionName=p,this.errorCallbackFired=!1,this.callback=m,this.canFireFailureCallback=q,this.startTime=Date.now()}isStartSignInApiScenario(){return this.scenario===at}isPromptSignIn(){return this.contentWindow===R.contentWindow&&!this.isStartSignInApiScenario()}fireSignInErrorCallback(c){if(this.errorCallbackFired||(this.errorCallbackFired=!0,this.callback&&!this.canFireFailureCallback))return;const h=this.callback||C.updateAndGetSignInCallback(),g={errorCode:c.errorCode||"unknown_error",errorMessage:c.errorMessage||"Unknown error"};h(null,g)}handleSignInResult(c){this.sendTelemetry&&(this.functionName?Xe(this.functionName,c):this.scenario&&qr({scenario:this.scenario},c))}}window.ms={auth:{InteractionRequiredAuthError:ee.InteractionRequiredAuthError,signOut:function(o,c){C.isInitialized()&&R.postMessage({message:"method-called",method:"signOut"}),Wn(o,c)},prompt:function(o,c){C.isInitialized()&&R.postMessage({message:"method-called",method:"prompt"}),Lr(o,c)},cancel:function(o){const c="cancel";C.isInitialized()&&R.postMessage({message:"method-called",method:c}),Xe(c,Dr(o))},startGetCurrentAccount:function(o){C.isInitialized()&&R.postMessage({message:"method-called",method:"startGetCurrentAccount"}),ro(o)},initialize:function(o){const c=C.tryInitialize(o,!0);return Xe("initialize",c),c},startSignIn:function(o){C.isInitialized()&&R.postMessage({message:"method-called",method:"startSignIn"}),no(o)},acquireTokenPopup:function(o){const c="acquireTokenPopup";return C.isInitialized()&&R.postMessage({message:"method-called",method:c}),oo(o,c)},acquireTokenSilent:function(o){const c="acquireTokenSilent";return C.isInitialized()&&R.postMessage({message:"method-called",method:c}),io(o,c)},renderSignInButton:function(o,c){C.isInitialized()&&R.postMessage({message:"method-called",method:"renderSignInButton"}),ao(o,c)},getMSALAccount:function(o){const c="getMSALAccount";return C.isInitialized()&&R.postMessage({message:"method-called",method:c}),so(o,c)},setRedirectState:function(o){C.isInitialized()&&R.postMessage({message:"method-called",method:"setRedirectState"}),C.setRedirectState(o)},hasMSAAccount:function(o){const c="hasMSAAccount";C.isInitialized()&&R.postMessage({message:"method-called",method:c}),R.hasMSAAccount(c,o)}}}})();
