Socket
Socket
Sign inDemoInstall

@pnp/config-store

Package Overview
Dependencies
Maintainers
6
Versions
155
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnp/config-store - npm Package Compare versions

Comparing version 1.1.5-1 to 1.1.5-2

2

dist/config-store.es5.js
/**
@license
* @pnp/config-store v1.1.5-1 - pnp - provides a way to manage configuration within your application
* @pnp/config-store v1.1.5-2 - pnp - provides a way to manage configuration within your application
* MIT (https://github.com/pnp/pnpjs/blob/master/LICENSE)

@@ -5,0 +5,0 @@ * Copyright (c) 2018 Microsoft

/**
@license
* @pnp/config-store v1.1.5-1 - pnp - provides a way to manage configuration within your application
* @pnp/config-store v1.1.5-2 - pnp - provides a way to manage configuration within your application
* MIT (https://github.com/pnp/pnpjs/blob/master/LICENSE)

@@ -10,12 +10,3 @@ * Copyright (c) 2018 Microsoft

*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["pnp.config-store"]=t():e["pnp.config-store"]=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(n){if(i[n])return i[n].exports;var r=i[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var i={};return t.m=e,t.c=i,t.d=function(e,i,n){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t,i){"use strict";(function(e){/**
@license
* @pnp/common v1.1.5-1 - pnp - provides shared functionality across all pnp libraries
* MIT (https://github.com/pnp/pnpjs/blob/master/LICENSE)
* Copyright (c) 2018 Microsoft
* docs: https://pnp.github.io/pnpjs/
* source: https:github.com/pnp/pnpjs
* bugs: https://github.com/pnp/pnpjs/issues
*/
function n(e,t){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];return function(){t.apply(e,i)}}function r(e,t,i){var n=new Date(e);switch(t.toLowerCase()){case"year":n.setFullYear(n.getFullYear()+i);break;case"quarter":n.setMonth(n.getMonth()+3*i);break;case"month":n.setMonth(n.getMonth()+i);break;case"week":n.setDate(n.getDate()+7*i);break;case"day":n.setDate(n.getDate()+i);break;case"hour":n.setTime(n.getTime()+36e5*i);break;case"minute":n.setTime(n.getTime()+6e4*i);break;case"second":n.setTime(n.getTime()+1e3*i);break;default:n=void 0}return n}function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(function(e){return!a(e)}).map(function(e){return e.replace(/^[\\|\/]/,"").replace(/[\\|\/]$/,"")}).join("/").replace(/\\/g,"/")}function s(e){return/^https?:\/\/|^\/\//i.test(e)}function a(e){return void 0===e||null===e||e.length<1}function c(e){return JSON.stringify(e)}function u(e,t){if(void 0!==t&&null!==t){new Request("",{headers:t}).headers.forEach(function(t,i){e.append(i,t)})}}function h(e){return void 0!==e&&null!==e?new Map(_(e)):new Map}function l(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];for(var n=0;n<t.length;n++)t[n].forEach(function(t,i){e.set(i,t)});return e}i.d(t,"d",function(){return h}),i.d(t,"c",function(){return l}),i.d(t,"a",function(){return m}),i.d(t,"b",function(){return c});var p=i(1),d=i(8),T=(i.n(d),function(){function t(){}return t.prototype.fetch=function(t,i){return e.fetch(t,i)},t}()),f=function(e){function t(t){var i=e.call(this)||this;return i._token=t,i}return Object(p.a)(t,e),Object.defineProperty(t.prototype,"token",{get:function(){return this._token},set:function(e){this._token=e},enumerable:!0,configurable:!0}),t.prototype.fetch=function(t,i){void 0===i&&(i={});var n=new Headers;return u(n,i.headers),n.set("Authorization","Bearer "+this._token),i.headers=n,e.prototype.fetch.call(this,t,i)},t}(T),_=(function(e){function t(t,i,n){var r=e.call(this,null)||this;return r.clientId=t,r.tenant=i,r.redirectUri=n,r}Object(p.a)(t,e),t.fromSPFxContext=function(e,i){return void 0===i&&(i="c58637bb-e2e1-4312-8a00-04b5ffcd3403"),new t(i,e.pageContext.aadInfo.tenantId.toString(),o(window.location.origin,"/_forms/spfxsinglesignon.aspx"))},t.prototype.fetch=function(t,i){var n=this;if(!s(t))throw new Error("You must supply absolute urls to AdalClient.fetch.");return this.getToken(this.getResource(t)).then(function(r){return n.token=r,e.prototype.fetch.call(n,t,i)})},t.prototype.getToken=function(e){var i=this;return new Promise(function(n,r){i.ensureAuthContext().then(function(e){return i.login()}).then(function(i){t._authContext.acquireToken(e,function(e,t){if(e)return r(new Error(e));n(t)})}).catch(r)})},t.prototype.ensureAuthContext=function(){var e=this;return new Promise(function(i){null===t._authContext&&(t._authContext=Object(d.inject)({clientId:e.clientId,displayCall:function(t){e._displayCallback&&e._displayCallback(t)},navigateToLoginRequestUrl:!1,redirectUri:e.redirectUri,tenant:e.tenant})),i()})},t.prototype.login=function(){var e=this;return this._loginPromise?this._loginPromise:(this._loginPromise=new Promise(function(i,n){if(t._authContext.getCachedUser())return i();e._displayCallback=function(r){var o=window.open(r,"login","width=483, height=600");if(!o)return n(new Error("Could not open pop-up window for auth. Likely pop-ups are blocked by the browser."));o&&o.focus&&o.focus();var s=window.setInterval(function(){o&&!o.closed&&void 0!==o.closed||window.clearInterval(s);try{-1!==o.document.URL.indexOf(e.redirectUri)&&(window.clearInterval(s),t._authContext.handleWindowCallback(o.location.hash),o.close(),i())}catch(e){n(e)}},30)},e.ensureAuthContext().then(function(i){t._authContext._loginInProgress=!1,t._authContext.login(),e._displayCallback=null})}),this._loginPromise)},t.prototype.getResource=function(e){var t=document.createElement("a");return t.href=e,t.protocol+"//"+t.hostname},t._authContext=null}(f),function(e){return"function"==typeof e}(Object.entries)?Object.entries:function(e){return Object.keys(e).map(function(t){return[t,e[t]]})}),S=["defaultCachingStore","defaultCachingTimeoutSeconds","globalCacheDisable","enableCacheExpiration","cacheExpirationIntervalMilliseconds","spfxContext"],E=function(){function e(e){void 0===e&&(e=new Map),this._v=e,this._v.set(S[0],"session"),this._v.set(S[1],60),this._v.set(S[2],!1),this._v.set(S[3],!1),this._v.set(S[4],750),this._v.set(S[5],null)}return e.prototype.extend=function(e){this._v=l(this._v,h(e))},e.prototype.get=function(e){return this._v.get(e)},Object.defineProperty(e.prototype,"defaultCachingStore",{get:function(){return this.get(S[0])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"defaultCachingTimeoutSeconds",{get:function(){return this.get(S[1])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"globalCacheDisable",{get:function(){return this.get(S[2])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enableCacheExpiration",{get:function(){return this.get(S[3])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cacheExpirationIntervalMilliseconds",{get:function(){return this.get(S[4])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spfxContext",{get:function(){return this.get(S[5])},enumerable:!0,configurable:!0}),e}(),g=new E,O=g,N=function(){function e(e,t){void 0===t&&(t=-1),this.store=e,this.defaultTimeoutMinutes=t,this.enabled=this.test(),O.enableCacheExpiration&&this.cacheExpirationHandler()}return e.prototype.get=function(e){if(!this.enabled)return null;var t=this.store.getItem(e);if(void 0===t)return null;var i=JSON.parse(t);return new Date(i.expiration)<=new Date?(this.delete(e),null):i.value},e.prototype.put=function(e,t,i){this.enabled&&this.store.setItem(e,this.createPersistable(t,i))},e.prototype.delete=function(e){this.enabled&&this.store.removeItem(e)},e.prototype.getOrPut=function(e,t,i){var n=this;return this.enabled?new Promise(function(r){var o=n.get(e);null==o?t().then(function(t){n.put(e,t,i),r(t)}):r(o)}):t()},e.prototype.deleteExpired=function(){var e=this;return new Promise(function(t,i){e.enabled||t();try{for(var n=0;n<e.store.length;n++){var r=e.store.key(n);null!==r&&/["|']?pnp["|']? ?: ?1/i.test(e.store.getItem(r))&&e.get(r)}t()}catch(e){i(e)}})},e.prototype.test=function(){try{return this.store.setItem("t","t"),this.store.removeItem("t"),!0}catch(e){return!1}},e.prototype.createPersistable=function(e,t){if(void 0===t){var i=O.defaultCachingTimeoutSeconds;this.defaultTimeoutMinutes>0&&(i=60*this.defaultTimeoutMinutes),t=r(new Date,"second",i)}return c({pnp:1,expiration:t,value:e})},e.prototype.cacheExpirationHandler=function(){var e=this;this.deleteExpired().then(function(t){setTimeout(n(e,e.cacheExpirationHandler),O.cacheExpirationIntervalMilliseconds)}).catch(function(e){console.error(e)})},e}(),R=function(){function e(e){void 0===e&&(e=new Map),this._store=e}return Object.defineProperty(e.prototype,"length",{get:function(){return this._store.size},enumerable:!0,configurable:!0}),e.prototype.clear=function(){this._store.clear()},e.prototype.getItem=function(e){return this._store.get(e)},e.prototype.key=function(e){return Array.from(this._store)[e][0]},e.prototype.removeItem=function(e){this._store.delete(e)},e.prototype.setItem=function(e,t){this._store.set(e,t)},e}(),m=function(){function e(e,t){void 0===e&&(e=null),void 0===t&&(t=null),this._local=e,this._session=t}return Object.defineProperty(e.prototype,"local",{get:function(){return null===this._local&&(this._local=this.getStore(localStorage)),this._local},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"session",{get:function(){return null===this._session&&(this._session=this.getStore(sessionStorage)),this._session},enumerable:!0,configurable:!0}),e.prototype.getStore=function(e){return new N(void 0!==e?e:new R)},e}()}).call(t,i(7))},function(e,t,i){"use strict";function n(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}t.a=n;/*! *****************************************************************************
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["pnp.config-store"]=t():e["pnp.config-store"]=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(n){if(i[n])return i[n].exports;var o=i[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var i={};return t.m=e,t.c=i,t.d=function(e,i,n){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t,i){"use strict";(function(e){function n(e,t){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];return function(){t.apply(e,i)}}function o(e,t,i){var n=new Date(e);switch(t.toLowerCase()){case"year":n.setFullYear(n.getFullYear()+i);break;case"quarter":n.setMonth(n.getMonth()+3*i);break;case"month":n.setMonth(n.getMonth()+i);break;case"week":n.setDate(n.getDate()+7*i);break;case"day":n.setDate(n.getDate()+i);break;case"hour":n.setTime(n.getTime()+36e5*i);break;case"minute":n.setTime(n.getTime()+6e4*i);break;case"second":n.setTime(n.getTime()+1e3*i);break;default:n=void 0}return n}function r(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(function(e){return!a(e)}).map(function(e){return e.replace(/^[\\|\/]/,"").replace(/[\\|\/]$/,"")}).join("/").replace(/\\/g,"/")}function s(e){return/^https?:\/\/|^\/\//i.test(e)}function a(e){return void 0===e||null===e||e.length<1}function c(e){return JSON.stringify(e)}function u(e,t){if(void 0!==t&&null!==t){new Request("",{headers:t}).headers.forEach(function(t,i){e.append(i,t)})}}function h(e){return void 0!==e&&null!==e?new Map(S(e)):new Map}function l(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];for(var n=0;n<t.length;n++)t[n].forEach(function(t,i){e.set(i,t)});return e}i.d(t,"d",function(){return h}),i.d(t,"c",function(){return l}),i.d(t,"a",function(){return v}),i.d(t,"b",function(){return c});var p=i(1),d=i(8),T=(i.n(d),void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),f=function(){function e(){}return e.prototype.fetch=function(e,t){return T.fetch(e,t)},e}(),_=function(e){function t(t){var i=e.call(this)||this;return i._token=t,i}return Object(p.a)(t,e),Object.defineProperty(t.prototype,"token",{get:function(){return this._token},set:function(e){this._token=e},enumerable:!0,configurable:!0}),t.prototype.fetch=function(t,i){void 0===i&&(i={});var n=new Headers;return u(n,i.headers),n.set("Authorization","Bearer "+this._token),i.headers=n,e.prototype.fetch.call(this,t,i)},t}(f),S=(function(e){function t(t,i,n){var o=e.call(this,null)||this;return o.clientId=t,o.tenant=i,o.redirectUri=n,o}Object(p.a)(t,e),t.fromSPFxContext=function(e,i){return void 0===i&&(i="c58637bb-e2e1-4312-8a00-04b5ffcd3403"),new t(i,e.pageContext.aadInfo.tenantId.toString(),r(window.location.origin,"/_forms/spfxsinglesignon.aspx"))},t.prototype.fetch=function(t,i){var n=this;if(!s(t))throw new Error("You must supply absolute urls to AdalClient.fetch.");return this.getToken(this.getResource(t)).then(function(o){return n.token=o,e.prototype.fetch.call(n,t,i)})},t.prototype.getToken=function(e){var i=this;return new Promise(function(n,o){i.ensureAuthContext().then(function(e){return i.login()}).then(function(i){t._authContext.acquireToken(e,function(e,t){if(e)return o(new Error(e));n(t)})}).catch(o)})},t.prototype.ensureAuthContext=function(){var e=this;return new Promise(function(i){null===t._authContext&&(t._authContext=Object(d.inject)({clientId:e.clientId,displayCall:function(t){e._displayCallback&&e._displayCallback(t)},navigateToLoginRequestUrl:!1,redirectUri:e.redirectUri,tenant:e.tenant})),i()})},t.prototype.login=function(){var e=this;return this._loginPromise?this._loginPromise:(this._loginPromise=new Promise(function(i,n){if(t._authContext.getCachedUser())return i();e._displayCallback=function(o){var r=window.open(o,"login","width=483, height=600");if(!r)return n(new Error("Could not open pop-up window for auth. Likely pop-ups are blocked by the browser."));r&&r.focus&&r.focus();var s=window.setInterval(function(){r&&!r.closed&&void 0!==r.closed||window.clearInterval(s);try{-1!==r.document.URL.indexOf(e.redirectUri)&&(window.clearInterval(s),t._authContext.handleWindowCallback(r.location.hash),r.close(),i())}catch(e){n(e)}},30)},e.ensureAuthContext().then(function(i){t._authContext._loginInProgress=!1,t._authContext.login(),e._displayCallback=null})}),this._loginPromise)},t.prototype.getResource=function(e){var t=document.createElement("a");return t.href=e,t.protocol+"//"+t.hostname},t._authContext=null}(_),function(e){return"function"==typeof e}(Object.entries)?Object.entries:function(e){return Object.keys(e).map(function(t){return[t,e[t]]})}),E=["defaultCachingStore","defaultCachingTimeoutSeconds","globalCacheDisable","enableCacheExpiration","cacheExpirationIntervalMilliseconds","spfxContext"],g=function(){function e(e){void 0===e&&(e=new Map),this._v=e,this._v.set(E[0],"session"),this._v.set(E[1],60),this._v.set(E[2],!1),this._v.set(E[3],!1),this._v.set(E[4],750),this._v.set(E[5],null)}return e.prototype.extend=function(e){this._v=l(this._v,h(e))},e.prototype.get=function(e){return this._v.get(e)},Object.defineProperty(e.prototype,"defaultCachingStore",{get:function(){return this.get(E[0])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"defaultCachingTimeoutSeconds",{get:function(){return this.get(E[1])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"globalCacheDisable",{get:function(){return this.get(E[2])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enableCacheExpiration",{get:function(){return this.get(E[3])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cacheExpirationIntervalMilliseconds",{get:function(){return this.get(E[4])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spfxContext",{get:function(){return this.get(E[5])},enumerable:!0,configurable:!0}),e}(),O=new g,N=O,R=function(){function e(e,t){void 0===t&&(t=-1),this.store=e,this.defaultTimeoutMinutes=t,this.enabled=this.test(),N.enableCacheExpiration&&this.cacheExpirationHandler()}return e.prototype.get=function(e){if(!this.enabled)return null;var t=this.store.getItem(e);if(void 0===t)return null;var i=JSON.parse(t);return new Date(i.expiration)<=new Date?(this.delete(e),null):i.value},e.prototype.put=function(e,t,i){this.enabled&&this.store.setItem(e,this.createPersistable(t,i))},e.prototype.delete=function(e){this.enabled&&this.store.removeItem(e)},e.prototype.getOrPut=function(e,t,i){var n=this;return this.enabled?new Promise(function(o){var r=n.get(e);null==r?t().then(function(t){n.put(e,t,i),o(t)}):o(r)}):t()},e.prototype.deleteExpired=function(){var e=this;return new Promise(function(t,i){e.enabled||t();try{for(var n=0;n<e.store.length;n++){var o=e.store.key(n);null!==o&&/["|']?pnp["|']? ?: ?1/i.test(e.store.getItem(o))&&e.get(o)}t()}catch(e){i(e)}})},e.prototype.test=function(){try{return this.store.setItem("t","t"),this.store.removeItem("t"),!0}catch(e){return!1}},e.prototype.createPersistable=function(e,t){if(void 0===t){var i=N.defaultCachingTimeoutSeconds;this.defaultTimeoutMinutes>0&&(i=60*this.defaultTimeoutMinutes),t=o(new Date,"second",i)}return c({pnp:1,expiration:t,value:e})},e.prototype.cacheExpirationHandler=function(){var e=this;this.deleteExpired().then(function(t){setTimeout(n(e,e.cacheExpirationHandler),N.cacheExpirationIntervalMilliseconds)}).catch(function(e){console.error(e)})},e}(),m=function(){function e(e){void 0===e&&(e=new Map),this._store=e}return Object.defineProperty(e.prototype,"length",{get:function(){return this._store.size},enumerable:!0,configurable:!0}),e.prototype.clear=function(){this._store.clear()},e.prototype.getItem=function(e){return this._store.get(e)},e.prototype.key=function(e){return Array.from(this._store)[e][0]},e.prototype.removeItem=function(e){this._store.delete(e)},e.prototype.setItem=function(e,t){this._store.set(e,t)},e}(),v=function(){function e(e,t){void 0===e&&(e=null),void 0===t&&(t=null),this._local=e,this._session=t}return Object.defineProperty(e.prototype,"local",{get:function(){return null===this._local&&(this._local=this.getStore(localStorage)),this._local},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"session",{get:function(){return null===this._session&&(this._session=this.getStore(sessionStorage)),this._session},enumerable:!0,configurable:!0}),e.prototype.getStore=function(e){return new R(void 0!==e?e:new m)},e}()}).call(t,i(7))},function(e,t,i){"use strict";function n(e,t){function i(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}t.a=n;/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.

@@ -34,6 +25,6 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use

***************************************************************************** */
var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)}},function(e,t,i){"use strict";var n=i(0),r=i(3),o=function(){function e(e,t,i){this.wrappedProvider=e,this.cacheKey=t,this.wrappedProvider=e,this.store=i||this.selectPnPCache()}return e.prototype.getWrappedProvider=function(){return this.wrappedProvider},e.prototype.getConfiguration=function(){var e=this;return this.store&&this.store.enabled?this.store.getOrPut(this.cacheKey,function(){return e.wrappedProvider.getConfiguration().then(function(t){return e.store.put(e.cacheKey,t),t})}):this.wrappedProvider.getConfiguration()},e.prototype.selectPnPCache=function(){var e=new n.a;if(e.local&&e.local.enabled)return e.local;if(e.session&&e.session.enabled)return e.session;throw new r.a},e}();t.a=o},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var n=i(1),r=i(10),o=function(e){function t(t){void 0===t&&(t="Cannot create a caching configuration provider since cache is not available.");var i=e.call(this,t)||this;return i.name="NoCacheAvailableException",r.a.log({data:{},level:3,message:"["+i.name+"]::"+i.message}),i}return n.a(t,e),t}(Error)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(5);i.d(t,"Settings",function(){return n.d}),i.d(t,"CachingConfigurationProvider",function(){return n.a}),i.d(t,"SPListConfigurationProvider",function(){return n.c}),i.d(t,"NoCacheAvailableException",function(){return n.b})},function(e,t,i){"use strict";var n=i(6);i.d(t,"d",function(){return n.a});var r=i(9);i.d(t,"a",function(){return r.a}),i.d(t,"c",function(){return r.b});var o=i(3);i.d(t,"b",function(){return o.a})},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var n=i(0),r=function(){function e(e){void 0===e&&(e=new Map),this._settings=e}return e.prototype.add=function(e,t){this._settings.set(e,t)},e.prototype.addJSON=function(e,t){this._settings.set(e,Object(n.b)(t))},e.prototype.apply=function(e){var t=this;return new Promise(function(i,r){try{t._settings=Object(n.c)(t._settings,Object(n.d)(e)),i()}catch(e){r(e)}})},e.prototype.load=function(e){var t=this;return new Promise(function(i,r){e.getConfiguration().then(function(e){t._settings=Object(n.c)(t._settings,Object(n.d)(e)),i()}).catch(r)})},e.prototype.get=function(e){return this._settings.get(e)},e.prototype.getJSON=function(e){var t=this.get(e);return void 0===t||null===t?t:JSON.parse(t)},e}()},function(e,t){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(i=window)}e.exports=i},function(e,t){/*! adal-angular v1.0.17 2018-02-27 */
var i=function(){"use strict";return i=function(e){if(this.REQUEST_TYPE={LOGIN:"LOGIN",RENEW_TOKEN:"RENEW_TOKEN",UNKNOWN:"UNKNOWN"},this.RESPONSE_TYPE={ID_TOKEN_TOKEN:"id_token token",TOKEN:"token"},this.CONSTANTS={ACCESS_TOKEN:"access_token",EXPIRES_IN:"expires_in",ID_TOKEN:"id_token",ERROR_DESCRIPTION:"error_description",SESSION_STATE:"session_state",ERROR:"error",STORAGE:{TOKEN_KEYS:"adal.token.keys",ACCESS_TOKEN_KEY:"adal.access.token.key",EXPIRATION_KEY:"adal.expiration.key",STATE_LOGIN:"adal.state.login",STATE_RENEW:"adal.state.renew",NONCE_IDTOKEN:"adal.nonce.idtoken",SESSION_STATE:"adal.session.state",USERNAME:"adal.username",IDTOKEN:"adal.idtoken",ERROR:"adal.error",ERROR_DESCRIPTION:"adal.error.description",LOGIN_REQUEST:"adal.login.request",LOGIN_ERROR:"adal.login.error",RENEW_STATUS:"adal.token.renew.status",ANGULAR_LOGIN_REQUEST:"adal.angular.login.request"},RESOURCE_DELIMETER:"|",CACHE_DELIMETER:"||",LOADFRAME_TIMEOUT:6e3,TOKEN_RENEW_STATUS_CANCELED:"Canceled",TOKEN_RENEW_STATUS_COMPLETED:"Completed",TOKEN_RENEW_STATUS_IN_PROGRESS:"In Progress",LOGGING_LEVEL:{ERROR:0,WARN:1,INFO:2,VERBOSE:3},LEVEL_STRING_MAP:{0:"ERROR:",1:"WARNING:",2:"INFO:",3:"VERBOSE:"},POPUP_WIDTH:483,POPUP_HEIGHT:600},i.prototype._singletonInstance)return i.prototype._singletonInstance;if(i.prototype._singletonInstance=this,this.instance="https://login.microsoftonline.com/",this.config={},this.callback=null,this.popUp=!1,this.isAngular=!1,this._user=null,this._activeRenewals={},this._loginInProgress=!1,this._acquireTokenInProgress=!1,this._renewStates=[],this._callBackMappedToRenewStates={},this._callBacksMappedToRenewStates={},this._openedWindows=[],this._requestType=this.REQUEST_TYPE.LOGIN,window._adalInstance=this,e.displayCall&&"function"!=typeof e.displayCall)throw new Error("displayCall is not a function");if(!e.clientId)throw new Error("clientId is required");this.config=this._cloneConfig(e),void 0===this.config.navigateToLoginRequestUrl&&(this.config.navigateToLoginRequestUrl=!0),this.config.popUp&&(this.popUp=!0),this.config.callback&&"function"==typeof this.config.callback&&(this.callback=this.config.callback),this.config.instance&&(this.instance=this.config.instance),this.config.loginResource||(this.config.loginResource=this.config.clientId),this.config.redirectUri||(this.config.redirectUri=window.location.href.split("?")[0].split("#")[0]),this.config.postLogoutRedirectUri||(this.config.postLogoutRedirectUri=window.location.href.split("?")[0].split("#")[0]),this.config.anonymousEndpoints||(this.config.anonymousEndpoints=[]),this.config.isAngular&&(this.isAngular=this.config.isAngular),this.config.loadFrameTimeout&&(this.CONSTANTS.LOADFRAME_TIMEOUT=this.config.loadFrameTimeout)},"undefined"!=typeof window&&(window.Logging={piiLoggingEnabled:!1,level:0,log:function(e){}}),i.prototype.login=function(){if(this._loginInProgress)return void this.info("Login in progress");this._loginInProgress=!0;var e=this._guid();this.config.state=e,this._idTokenNonce=this._guid();var t=this._getItem(this.CONSTANTS.STORAGE.ANGULAR_LOGIN_REQUEST);t&&""!==t?this._saveItem(this.CONSTANTS.STORAGE.ANGULAR_LOGIN_REQUEST,""):t=window.location.href,this.verbose("Expected state: "+e+" startPage:"+t),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_REQUEST,t),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN,e,!0),this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,this._idTokenNonce,!0),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,"");var i=this._getNavigateUrl("id_token",null)+"&nonce="+encodeURIComponent(this._idTokenNonce);this.config.displayCall?this.config.displayCall(i):this.popUp?(this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN,""),this._renewStates.push(e),this.registerCallback(e,this.config.clientId,this.callback),this._loginPopup(i)):this.promptUser(i)},i.prototype._openPopup=function(e,t,i,n){try{var r=window.screenLeft?window.screenLeft:window.screenX,o=window.screenTop?window.screenTop:window.screenY,s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,c=s/2-i/2+r,u=a/2-n/2+o,h=window.open(e,t,"width="+i+", height="+n+", top="+u+", left="+c);return h.focus&&h.focus(),h}catch(e){return this.warn("Error opening popup, "+e.message),this._loginInProgress=!1,this._acquireTokenInProgress=!1,null}},i.prototype._handlePopupError=function(e,t,i,n,r){this.warn(n),this._saveItem(this.CONSTANTS.STORAGE.ERROR,i),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,n),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,r),t&&this._activeRenewals[t]&&(this._activeRenewals[t]=null),this._loginInProgress=!1,this._acquireTokenInProgress=!1,e&&e(n,null,i)},i.prototype._loginPopup=function(e,t,i){var n=this._openPopup(e,"login",this.CONSTANTS.POPUP_WIDTH,this.CONSTANTS.POPUP_HEIGHT),r=i||this.callback;if(null==n){var o="Popup Window is null. This can happen if you are using IE";return void this._handlePopupError(r,t,"Error opening popup",o,o)}if(this._openedWindows.push(n),-1!=this.config.redirectUri.indexOf("#"))var s=this.config.redirectUri.split("#")[0];else var s=this.config.redirectUri;var a=this,c=window.setInterval(function(){if(!n||n.closed||void 0===n.closed){var e="Popup Window closed",i="Popup Window closed by UI action/ Popup Window handle destroyed due to cross zone navigation in IE/Edge";return a.isAngular&&a._broadcast("adal:popUpClosed",i+a.CONSTANTS.RESOURCE_DELIMETER+e),a._handlePopupError(r,t,e,i,i),void window.clearInterval(c)}try{var o=n.location;if(-1!=encodeURI(o.href).indexOf(encodeURI(s)))return a.isAngular?a._broadcast("adal:popUpHashChanged",o.hash):a.handleWindowCallback(o.hash),window.clearInterval(c),a._loginInProgress=!1,a._acquireTokenInProgress=!1,a.info("Closing popup window"),a._openedWindows=[],void n.close()}catch(e){}},1)},i.prototype._broadcast=function(e,t){!function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var i=document.createEvent("CustomEvent");return i.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),i}if("function"==typeof window.CustomEvent)return!1;e.prototype=window.Event.prototype,window.CustomEvent=e}();var i=new CustomEvent(e,{detail:t});window.dispatchEvent(i)},i.prototype.loginInProgress=function(){return this._loginInProgress},i.prototype._hasResource=function(e){var t=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS);return t&&!this._isEmpty(t)&&t.indexOf(e+this.CONSTANTS.RESOURCE_DELIMETER)>-1},i.prototype.getCachedToken=function(e){if(!this._hasResource(e))return null;var t=this._getItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+e),i=this._getItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+e),n=this.config.expireOffsetSeconds||300;return i&&i>this._now()+n?t:(this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+e,""),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+e,0),null)},i.prototype.getCachedUser=function(){if(this._user)return this._user;var e=this._getItem(this.CONSTANTS.STORAGE.IDTOKEN);return this._user=this._createUser(e),this._user},i.prototype.registerCallback=function(e,t,i){this._activeRenewals[t]=e,this._callBacksMappedToRenewStates[e]||(this._callBacksMappedToRenewStates[e]=[]);var n=this;this._callBacksMappedToRenewStates[e].push(i),this._callBackMappedToRenewStates[e]||(this._callBackMappedToRenewStates[e]=function(i,r,o,s){n._activeRenewals[t]=null;for(var a=0;a<n._callBacksMappedToRenewStates[e].length;++a)try{n._callBacksMappedToRenewStates[e][a](i,r,o,s)}catch(o){n.warn(o)}n._callBacksMappedToRenewStates[e]=null,n._callBackMappedToRenewStates[e]=null})},i.prototype._renewToken=function(e,t,i){this.info("renewToken is called for resource:"+e);var n=this._addAdalFrame("adalRenewFrame"+e),r=this._guid()+"|"+e;this.config.state=r,this._renewStates.push(r),this.verbose("Renew token Expected state: "+r),i=i||"token";var o=this._urlRemoveQueryStringParameter(this._getNavigateUrl(i,e),"prompt");i===this.RESPONSE_TYPE.ID_TOKEN_TOKEN&&(this._idTokenNonce=this._guid(),this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,this._idTokenNonce,!0),o+="&nonce="+encodeURIComponent(this._idTokenNonce)),o+="&prompt=none",o=this._addHintParameters(o),this.registerCallback(r,e,t),this.verbosePii("Navigate to:"+o),n.src="about:blank",this._loadFrameTimeout(o,"adalRenewFrame"+e,e)},i.prototype._renewIdToken=function(e,t){this.info("renewIdToken is called");var i=this._addAdalFrame("adalIdTokenFrame"),n=this._guid()+"|"+this.config.clientId;this._idTokenNonce=this._guid(),this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,this._idTokenNonce,!0),this.config.state=n,this._renewStates.push(n),this.verbose("Renew Idtoken Expected state: "+n);var r=null===t||void 0===t?null:this.config.clientId,t=t||"id_token",o=this._urlRemoveQueryStringParameter(this._getNavigateUrl(t,r),"prompt");o+="&prompt=none",o=this._addHintParameters(o),o+="&nonce="+encodeURIComponent(this._idTokenNonce),this.registerCallback(n,this.config.clientId,e),this.verbosePii("Navigate to:"+o),i.src="about:blank",this._loadFrameTimeout(o,"adalIdTokenFrame",this.config.clientId)},i.prototype._urlContainsQueryStringParameter=function(e,t){return new RegExp("[\\?&]"+e+"=").test(t)},i.prototype._urlRemoveQueryStringParameter=function(e,t){var i=new RegExp("(\\&"+t+"=)[^&]+");return e=e.replace(i,""),i=new RegExp("("+t+"=)[^&]+&"),e=e.replace(i,""),i=new RegExp("("+t+"=)[^&]+"),e=e.replace(i,"")},i.prototype._loadFrameTimeout=function(e,t,i){this.verbose("Set loading state to pending for: "+i),this._saveItem(this.CONSTANTS.STORAGE.RENEW_STATUS+i,this.CONSTANTS.TOKEN_RENEW_STATUS_IN_PROGRESS),this._loadFrame(e,t);var n=this;setTimeout(function(){if(n._getItem(n.CONSTANTS.STORAGE.RENEW_STATUS+i)===n.CONSTANTS.TOKEN_RENEW_STATUS_IN_PROGRESS){n.verbose("Loading frame has timed out after: "+n.CONSTANTS.LOADFRAME_TIMEOUT/1e3+" seconds for resource "+i);var e=n._activeRenewals[i];e&&n._callBackMappedToRenewStates[e]&&n._callBackMappedToRenewStates[e]("Token renewal operation failed due to timeout",null,"Token Renewal Failed"),n._saveItem(n.CONSTANTS.STORAGE.RENEW_STATUS+i,n.CONSTANTS.TOKEN_RENEW_STATUS_CANCELED)}},n.CONSTANTS.LOADFRAME_TIMEOUT)},i.prototype._loadFrame=function(e,t){var i=this;i.info("LoadFrame: "+t);var n=t;setTimeout(function(){var t=i._addAdalFrame(n);""!==t.src&&"about:blank"!==t.src||(t.src=e,i._loadFrame(e,n))},500)},i.prototype.acquireToken=function(e,t){if(this._isEmpty(e))return this.warn("resource is required"),void t("resource is required",null,"resource is required");var i=this.getCachedToken(e);return i?(this.info("Token is already in cache for resource:"+e),void t(null,i,null)):this._user||this.config.extraQueryParameter&&-1!==this.config.extraQueryParameter.indexOf("login_hint")?void(this._activeRenewals[e]?this.registerCallback(this._activeRenewals[e],e,t):(this._requestType=this.REQUEST_TYPE.RENEW_TOKEN,e===this.config.clientId?this._user?(this.verbose("renewing idtoken"),this._renewIdToken(t)):(this.verbose("renewing idtoken and access_token"),this._renewIdToken(t,this.RESPONSE_TYPE.ID_TOKEN_TOKEN)):this._user?(this.verbose("renewing access_token"),this._renewToken(e,t)):(this.verbose("renewing idtoken and access_token"),this._renewToken(e,t,this.RESPONSE_TYPE.ID_TOKEN_TOKEN)))):(this.warn("User login is required"),void t("User login is required",null,"login required"))},i.prototype.acquireTokenPopup=function(e,t,i,n){if(this._isEmpty(e))return this.warn("resource is required"),void n("resource is required",null,"resource is required");if(!this._user)return this.warn("User login is required"),void n("User login is required",null,"login required");if(this._acquireTokenInProgress)return this.warn("Acquire token interactive is already in progress"),void n("Acquire token interactive is already in progress",null,"Acquire token interactive is already in progress");var r=this._guid()+"|"+e;this.config.state=r,this._renewStates.push(r),this._requestType=this.REQUEST_TYPE.RENEW_TOKEN,this.verbose("Renew token Expected state: "+r);var o=this._urlRemoveQueryStringParameter(this._getNavigateUrl("token",e),"prompt");if(o+="&prompt=select_account",t&&(o+=t),i&&-1===o.indexOf("&claims"))o+="&claims="+encodeURIComponent(i);else if(i&&-1!==o.indexOf("&claims"))throw new Error("Claims cannot be passed as an extraQueryParameter");o=this._addHintParameters(o),this._acquireTokenInProgress=!0,this.info("acquireToken interactive is called for the resource "+e),this.registerCallback(r,e,n),this._loginPopup(o,e,n)},i.prototype.acquireTokenRedirect=function(e,t,i){if(this._isEmpty(e))return this.warn("resource is required"),void n("resource is required",null,"resource is required");var n=this.callback;if(!this._user)return this.warn("User login is required"),void n("User login is required",null,"login required");if(this._acquireTokenInProgress)return this.warn("Acquire token interactive is already in progress"),void n("Acquire token interactive is already in progress",null,"Acquire token interactive is already in progress");var r=this._guid()+"|"+e;this.config.state=r,this.verbose("Renew token Expected state: "+r);var o=this._urlRemoveQueryStringParameter(this._getNavigateUrl("token",e),"prompt");if(o+="&prompt=select_account",t&&(o+=t),i&&-1===o.indexOf("&claims"))o+="&claims="+encodeURIComponent(i);else if(i&&-1!==o.indexOf("&claims"))throw new Error("Claims cannot be passed as an extraQueryParameter");o=this._addHintParameters(o),this._acquireTokenInProgress=!0,this.info("acquireToken interactive is called for the resource "+e),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_REQUEST,window.location.href),this._saveItem(this.CONSTANTS.STORAGE.STATE_RENEW,r,!0),this.promptUser(o)},i.prototype.promptUser=function(e){e?(this.infoPii("Navigate to:"+e),window.location.replace(e)):this.info("Navigate url is empty")},i.prototype.clearCache=function(){this._saveItem(this.CONSTANTS.STORAGE.LOGIN_REQUEST,""),this._saveItem(this.CONSTANTS.STORAGE.ANGULAR_LOGIN_REQUEST,""),this._saveItem(this.CONSTANTS.STORAGE.SESSION_STATE,""),this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN,""),this._saveItem(this.CONSTANTS.STORAGE.STATE_RENEW,""),this._renewStates=[],this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,""),this._saveItem(this.CONSTANTS.STORAGE.IDTOKEN,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,""),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,"");var e=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS);if(!this._isEmpty(e)){e=e.split(this.CONSTANTS.RESOURCE_DELIMETER);for(var t=0;t<e.length&&""!==e[t];t++)this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+e[t],""),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+e[t],0)}this._saveItem(this.CONSTANTS.STORAGE.TOKEN_KEYS,"")},i.prototype.clearCacheForResource=function(e){this._saveItem(this.CONSTANTS.STORAGE.STATE_RENEW,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,""),this._hasResource(e)&&(this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+e,""),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+e,0))},i.prototype.logOut=function(){this.clearCache(),this._user=null;var e;if(this.config.logOutUri)e=this.config.logOutUri;else{var t="common",i="";this.config.tenant&&(t=this.config.tenant),this.config.postLogoutRedirectUri&&(i="post_logout_redirect_uri="+encodeURIComponent(this.config.postLogoutRedirectUri)),e=this.instance+t+"/oauth2/logout?"+i}this.infoPii("Logout navigate to: "+e),this.promptUser(e)},i.prototype._isEmpty=function(e){return void 0===e||!e||0===e.length},i.prototype.getUser=function(e){if("function"!=typeof e)throw new Error("callback is not a function");if(this._user)return void e(null,this._user);var t=this._getItem(this.CONSTANTS.STORAGE.IDTOKEN);this._isEmpty(t)?(this.warn("User information is not available"),e("User information is not available",null)):(this.info("User exists in cache: "),this._user=this._createUser(t),e(null,this._user))},i.prototype._addHintParameters=function(e){if(this._user&&this._user.profile)if(this._user.profile.sid&&-1!==e.indexOf("&prompt=none"))this._urlContainsQueryStringParameter("sid",e)||(e+="&sid="+encodeURIComponent(this._user.profile.sid));else if(this._user.profile.upn&&(this._urlContainsQueryStringParameter("login_hint",e)||(e+="&login_hint="+encodeURIComponent(this._user.profile.upn)),!this._urlContainsQueryStringParameter("domain_hint",e)&&this._user.profile.upn.indexOf("@")>-1)){var t=this._user.profile.upn.split("@");e+="&domain_hint="+encodeURIComponent(t[t.length-1])}return e},i.prototype._createUser=function(e){var t=null,i=this._extractIdToken(e);return i&&i.hasOwnProperty("aud")&&(i.aud.toLowerCase()===this.config.clientId.toLowerCase()?(t={userName:"",profile:i},i.hasOwnProperty("upn")?t.userName=i.upn:i.hasOwnProperty("email")&&(t.userName=i.email)):this.warn("IdToken has invalid aud field")),t},i.prototype._getHash=function(e){return e.indexOf("#/")>-1?e=e.substring(e.indexOf("#/")+2):e.indexOf("#")>-1&&(e=e.substring(1)),e},i.prototype.isCallback=function(e){e=this._getHash(e);var t=this._deserialize(e);return t.hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION)||t.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)||t.hasOwnProperty(this.CONSTANTS.ID_TOKEN)},i.prototype.getLoginError=function(){return this._getItem(this.CONSTANTS.STORAGE.LOGIN_ERROR)},i.prototype.getRequestInfo=function(e){e=this._getHash(e);var t=this._deserialize(e),i={valid:!1,parameters:{},stateMatch:!1,stateResponse:"",requestType:this.REQUEST_TYPE.UNKNOWN};if(t&&(i.parameters=t,t.hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION)||t.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)||t.hasOwnProperty(this.CONSTANTS.ID_TOKEN))){i.valid=!0;var n="";if(!t.hasOwnProperty("state"))return this.warn("No state returned"),i;if(this.verbose("State: "+t.state),n=t.state,i.stateResponse=n,this._matchState(i))return i;if(!i.stateMatch&&window.parent){i.requestType=this._requestType;for(var r=this._renewStates,o=0;o<r.length;o++)if(r[o]===i.stateResponse){i.stateMatch=!0;break}}}return i},i.prototype._matchNonce=function(e){var t=this._getItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN);if(t){t=t.split(this.CONSTANTS.CACHE_DELIMETER);for(var i=0;i<t.length;i++)if(t[i]===e.profile.nonce)return!0}return!1},i.prototype._matchState=function(e){var t=this._getItem(this.CONSTANTS.STORAGE.STATE_LOGIN);if(t){t=t.split(this.CONSTANTS.CACHE_DELIMETER);for(var i=0;i<t.length;i++)if(t[i]===e.stateResponse)return e.requestType=this.REQUEST_TYPE.LOGIN,e.stateMatch=!0,!0}var n=this._getItem(this.CONSTANTS.STORAGE.STATE_RENEW);if(n){n=n.split(this.CONSTANTS.CACHE_DELIMETER);for(var i=0;i<n.length;i++)if(n[i]===e.stateResponse)return e.requestType=this.REQUEST_TYPE.RENEW_TOKEN,e.stateMatch=!0,!0}return!1},i.prototype._getResourceFromState=function(e){if(e){var t=e.indexOf("|");if(t>-1&&t+1<e.length)return e.substring(t+1)}return""},i.prototype.saveTokenFromHash=function(e){this.info("State status:"+e.stateMatch+"; Request type:"+e.requestType),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,"");var t=this._getResourceFromState(e.stateResponse);if(e.parameters.hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION))this.infoPii("Error :"+e.parameters.error+"; Error description:"+e.parameters[this.CONSTANTS.ERROR_DESCRIPTION]),this._saveItem(this.CONSTANTS.STORAGE.ERROR,e.parameters.error),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,e.parameters[this.CONSTANTS.ERROR_DESCRIPTION]),e.requestType===this.REQUEST_TYPE.LOGIN&&(this._loginInProgress=!1,this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,e.parameters.error_description));else if(e.stateMatch){this.info("State is right"),e.parameters.hasOwnProperty(this.CONSTANTS.SESSION_STATE)&&this._saveItem(this.CONSTANTS.STORAGE.SESSION_STATE,e.parameters[this.CONSTANTS.SESSION_STATE]);var i;e.parameters.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)&&(this.info("Fragment has access token"),this._hasResource(t)||(i=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS)||"",this._saveItem(this.CONSTANTS.STORAGE.TOKEN_KEYS,i+t+this.CONSTANTS.RESOURCE_DELIMETER)),this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+t,e.parameters[this.CONSTANTS.ACCESS_TOKEN]),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+t,this._expiresIn(e.parameters[this.CONSTANTS.EXPIRES_IN]))),e.parameters.hasOwnProperty(this.CONSTANTS.ID_TOKEN)&&(this.info("Fragment has id token"),this._loginInProgress=!1,this._user=this._createUser(e.parameters[this.CONSTANTS.ID_TOKEN]),this._user&&this._user.profile?this._matchNonce(this._user)?(this._saveItem(this.CONSTANTS.STORAGE.IDTOKEN,e.parameters[this.CONSTANTS.ID_TOKEN]),t=this.config.loginResource?this.config.loginResource:this.config.clientId,this._hasResource(t)||(i=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS)||"",this._saveItem(this.CONSTANTS.STORAGE.TOKEN_KEYS,i+t+this.CONSTANTS.RESOURCE_DELIMETER)),this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+t,e.parameters[this.CONSTANTS.ID_TOKEN]),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+t,this._user.profile.exp)):(this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,"Nonce received: "+this._user.profile.nonce+" is not same as requested: "+this._getItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN)),this._user=null):(e.parameters.error="invalid id_token",e.parameters.error_description="Invalid id_token. id_token: "+e.parameters[this.CONSTANTS.ID_TOKEN],this._saveItem(this.CONSTANTS.STORAGE.ERROR,"invalid id_token"),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,"Invalid id_token. id_token: "+e.parameters[this.CONSTANTS.ID_TOKEN])))}else e.parameters.error="Invalid_state",e.parameters.error_description="Invalid_state. state: "+e.stateResponse,this._saveItem(this.CONSTANTS.STORAGE.ERROR,"Invalid_state"),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,"Invalid_state. state: "+e.stateResponse);this._saveItem(this.CONSTANTS.STORAGE.RENEW_STATUS+t,this.CONSTANTS.TOKEN_RENEW_STATUS_COMPLETED)},i.prototype.getResourceForEndpoint=function(e){if(this.config&&this.config.anonymousEndpoints)for(var t=0;t<this.config.anonymousEndpoints.length;t++)if(e.indexOf(this.config.anonymousEndpoints[t])>-1)return null;if(this.config&&this.config.endpoints)for(var i in this.config.endpoints)if(e.indexOf(i)>-1)return this.config.endpoints[i];return e.indexOf("http://")>-1||e.indexOf("https://")>-1?this._getHostFromUri(e)===this._getHostFromUri(this.config.redirectUri)?this.config.loginResource:null:this.config.loginResource},i.prototype._getHostFromUri=function(e){var t=String(e).replace(/^(https?:)\/\//,"");return t=t.split("/")[0]},i.prototype.handleWindowCallback=function(e){if(null==e&&(e=window.location.hash),this.isCallback(e)){var t=null,i=!1;this._openedWindows.length>0&&this._openedWindows[this._openedWindows.length-1].opener&&this._openedWindows[this._openedWindows.length-1].opener._adalInstance?(t=this._openedWindows[this._openedWindows.length-1].opener._adalInstance,i=!0):window.parent&&window.parent._adalInstance&&(t=window.parent._adalInstance);var n,r,o=t.getRequestInfo(e),s=null;r=i||window.parent!==window?t._callBackMappedToRenewStates[o.stateResponse]:t.callback,t.info("Returned from redirect url"),t.saveTokenFromHash(o),o.requestType===this.REQUEST_TYPE.RENEW_TOKEN&&window.parent?(window.parent!==window?t.verbose("Window is in iframe, acquiring token silently"):t.verbose("acquiring token interactive in progress"),n=o.parameters[t.CONSTANTS.ACCESS_TOKEN]||o.parameters[t.CONSTANTS.ID_TOKEN],s=t.CONSTANTS.ACCESS_TOKEN):o.requestType===this.REQUEST_TYPE.LOGIN&&(n=o.parameters[t.CONSTANTS.ID_TOKEN],s=t.CONSTANTS.ID_TOKEN);var a=o.parameters[t.CONSTANTS.ERROR_DESCRIPTION],c=o.parameters[t.CONSTANTS.ERROR];try{r&&r(a,n,c,s)}catch(e){t.error("Error occurred in user defined callback function: "+e)}window.parent!==window||i||(t.config.navigateToLoginRequestUrl?window.location.href=t._getItem(t.CONSTANTS.STORAGE.LOGIN_REQUEST):window.location.hash="")}},i.prototype._getNavigateUrl=function(e,t){var i="common";this.config.tenant&&(i=this.config.tenant);var n=this.instance+i+"/oauth2/authorize"+this._serialize(e,this.config,t)+this._addLibMetadata();return this.info("Navigate url:"+n),n},i.prototype._extractIdToken=function(e){var t=this._decodeJwt(e);if(!t)return null;try{var i=t.JWSPayload,n=this._base64DecodeStringUrlSafe(i);return n?JSON.parse(n):(this.info("The returned id_token could not be base64 url safe decoded."),null)}catch(e){this.error("The returned id_token could not be decoded",e)}return null},i.prototype._base64DecodeStringUrlSafe=function(e){return e=e.replace(/-/g,"+").replace(/_/g,"/"),window.atob?decodeURIComponent(escape(window.atob(e))):decodeURIComponent(escape(this._decode(e)))},i.prototype._decode=function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e=String(e).replace(/=+$/,"");var i=e.length;if(i%4==1)throw new Error("The token to be decoded is not correctly encoded.");for(var n,r,o,s,a,c,u,h,l="",p=0;p<i;p+=4){if(n=t.indexOf(e.charAt(p)),r=t.indexOf(e.charAt(p+1)),o=t.indexOf(e.charAt(p+2)),s=t.indexOf(e.charAt(p+3)),p+2===i-1){a=n<<18|r<<12|o<<6,c=a>>16&255,u=a>>8&255,l+=String.fromCharCode(c,u);break}if(p+1===i-1){a=n<<18|r<<12,c=a>>16&255,l+=String.fromCharCode(c);break}a=n<<18|r<<12|o<<6|s,c=a>>16&255,u=a>>8&255,h=255&a,l+=String.fromCharCode(c,u,h)}return l},i.prototype._decodeJwt=function(e){if(this._isEmpty(e))return null;var t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/,i=t.exec(e);return!i||i.length<4?(this.warn("The returned id_token is not parseable."),null):{header:i[1],JWSPayload:i[2],JWSSig:i[3]}},i.prototype._convertUrlSafeToRegularBase64EncodedString=function(e){return e.replace("-","+").replace("_","/")},i.prototype._serialize=function(e,t,i){var n=[];if(null!==t){n.push("?response_type="+e),n.push("client_id="+encodeURIComponent(t.clientId)),i&&n.push("resource="+encodeURIComponent(i)),n.push("redirect_uri="+encodeURIComponent(t.redirectUri)),n.push("state="+encodeURIComponent(t.state)),t.hasOwnProperty("slice")&&n.push("slice="+encodeURIComponent(t.slice)),t.hasOwnProperty("extraQueryParameter")&&n.push(t.extraQueryParameter);var r=t.correlationId?t.correlationId:this._guid();n.push("client-request-id="+encodeURIComponent(r))}return n.join("&")},i.prototype._deserialize=function(e){var t,i=/\+/g,n=/([^&=]+)=([^&]*)/g,r=function(e){return decodeURIComponent(e.replace(i," "))},o={};for(t=n.exec(e);t;)o[r(t[1])]=r(t[2]),t=n.exec(e);return o},i.prototype._decimalToHex=function(e){for(var t=e.toString(16);t.length<2;)t="0"+t;return t},i.prototype._guid=function(){var e=window.crypto||window.msCrypto;if(e&&e.getRandomValues){var t=new Uint8Array(16);return e.getRandomValues(t),t[6]|=64,t[6]&=79,t[8]|=128,t[8]&=191,this._decimalToHex(t[0])+this._decimalToHex(t[1])+this._decimalToHex(t[2])+this._decimalToHex(t[3])+"-"+this._decimalToHex(t[4])+this._decimalToHex(t[5])+"-"+this._decimalToHex(t[6])+this._decimalToHex(t[7])+"-"+this._decimalToHex(t[8])+this._decimalToHex(t[9])+"-"+this._decimalToHex(t[10])+this._decimalToHex(t[11])+this._decimalToHex(t[12])+this._decimalToHex(t[13])+this._decimalToHex(t[14])+this._decimalToHex(t[15])}for(var i="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",n="0123456789abcdef",r=0,o="",s=0;s<36;s++)"-"!==i[s]&&"4"!==i[s]&&(r=16*Math.random()|0),"x"===i[s]?o+=n[r]:"y"===i[s]?(r&=3,r|=8,o+=n[r]):o+=i[s];return o},i.prototype._expiresIn=function(e){return e||(e=3599),this._now()+parseInt(e,10)},i.prototype._now=function(){return Math.round((new Date).getTime()/1e3)},i.prototype._addAdalFrame=function(e){if(void 0!==e){this.info("Add adal frame to document:"+e);var t=document.getElementById(e);if(!t){if(document.createElement&&document.documentElement&&(window.opera||-1===window.navigator.userAgent.indexOf("MSIE 5.0"))){var i=document.createElement("iframe");i.setAttribute("id",e),i.setAttribute("aria-hidden","true"),i.style.visibility="hidden",i.style.position="absolute",i.style.width=i.style.height=i.borderWidth="0px",t=document.getElementsByTagName("body")[0].appendChild(i)}else document.body&&document.body.insertAdjacentHTML&&document.body.insertAdjacentHTML("beforeEnd",'<iframe name="'+e+'" id="'+e+'" style="display:none"></iframe>');window.frames&&window.frames[e]&&(t=window.frames[e])}return t}},i.prototype._saveItem=function(e,t,i){if(this.config&&this.config.cacheLocation&&"localStorage"===this.config.cacheLocation){if(!this._supportsLocalStorage())return this.info("Local storage is not supported"),!1;if(i){var n=this._getItem(e)||"";localStorage.setItem(e,n+t+this.CONSTANTS.CACHE_DELIMETER)}else localStorage.setItem(e,t);return!0}return this._supportsSessionStorage()?(sessionStorage.setItem(e,t),!0):(this.info("Session storage is not supported"),!1)},i.prototype._getItem=function(e){return this.config&&this.config.cacheLocation&&"localStorage"===this.config.cacheLocation?this._supportsLocalStorage()?localStorage.getItem(e):(this.info("Local storage is not supported"),null):this._supportsSessionStorage()?sessionStorage.getItem(e):(this.info("Session storage is not supported"),null)},i.prototype._supportsLocalStorage=function(){try{return!!window.localStorage&&(window.localStorage.setItem("storageTest","A"),"A"==window.localStorage.getItem("storageTest")&&(window.localStorage.removeItem("storageTest"),!window.localStorage.getItem("storageTest")))}catch(e){return!1}},i.prototype._supportsSessionStorage=function(){try{return!!window.sessionStorage&&(window.sessionStorage.setItem("storageTest","A"),"A"==window.sessionStorage.getItem("storageTest")&&(window.sessionStorage.removeItem("storageTest"),!window.sessionStorage.getItem("storageTest")))}catch(e){return!1}},i.prototype._cloneConfig=function(e){if(null===e||"object"!=typeof e)return e;var t={};for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t},i.prototype._addLibMetadata=function(){return"&x-client-SKU=Js&x-client-Ver="+this._libVersion()},i.prototype.log=function(e,t,i,n){if(e<=Logging.level){if(!Logging.piiLoggingEnabled&&n)return;var r=(new Date).toUTCString(),o="";o=this.config.correlationId?r+":"+this.config.correlationId+"-"+this._libVersion()+"-"+this.CONSTANTS.LEVEL_STRING_MAP[e]+" "+t:r+":"+this._libVersion()+"-"+this.CONSTANTS.LEVEL_STRING_MAP[e]+" "+t,i&&(o+="\nstack:\n"+i.stack),Logging.log(o)}},i.prototype.error=function(e,t){this.log(this.CONSTANTS.LOGGING_LEVEL.ERROR,e,t)},i.prototype.warn=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.WARN,e,null)},i.prototype.info=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.INFO,e,null)},i.prototype.verbose=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.VERBOSE,e,null)},i.prototype.errorPii=function(e,t){this.log(this.CONSTANTS.LOGGING_LEVEL.ERROR,e,t,!0)},i.prototype.warnPii=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.WARN,e,null,!0)},i.prototype.infoPii=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.INFO,e,null,!0)},i.prototype.verbosePii=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.VERBOSE,e,null,!0)},i.prototype._libVersion=function(){return"1.0.17"},void 0!==e&&e.exports&&(e.exports=i,e.exports.inject=function(e){return new i(e)}),i}()},function(e,t,i){"use strict";var n=i(2);i.d(t,"a",function(){return n.a});var r=i(11);i.d(t,"b",function(){return r.a})},function(e,t,i){"use strict";i.d(t,"a",function(){return r});/**
var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)}},function(e,t,i){"use strict";var n=i(0),o=i(3),r=function(){function e(e,t,i){this.wrappedProvider=e,this.cacheKey=t,this.wrappedProvider=e,this.store=i||this.selectPnPCache()}return e.prototype.getWrappedProvider=function(){return this.wrappedProvider},e.prototype.getConfiguration=function(){var e=this;return this.store&&this.store.enabled?this.store.getOrPut(this.cacheKey,function(){return e.wrappedProvider.getConfiguration().then(function(t){return e.store.put(e.cacheKey,t),t})}):this.wrappedProvider.getConfiguration()},e.prototype.selectPnPCache=function(){var e=new n.a;if(e.local&&e.local.enabled)return e.local;if(e.session&&e.session.enabled)return e.session;throw new o.a},e}();t.a=r},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var n=i(1),o=i(10),r=function(e){function t(t){void 0===t&&(t="Cannot create a caching configuration provider since cache is not available.");var i=e.call(this,t)||this;return i.name="NoCacheAvailableException",o.a.log({data:{},level:3,message:"["+i.name+"]::"+i.message}),i}return n.a(t,e),t}(Error)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(5);i.d(t,"Settings",function(){return n.d}),i.d(t,"CachingConfigurationProvider",function(){return n.a}),i.d(t,"SPListConfigurationProvider",function(){return n.c}),i.d(t,"NoCacheAvailableException",function(){return n.b})},function(e,t,i){"use strict";var n=i(6);i.d(t,"d",function(){return n.a});var o=i(9);i.d(t,"a",function(){return o.a}),i.d(t,"c",function(){return o.b});var r=i(3);i.d(t,"b",function(){return r.a})},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var n=i(0),o=function(){function e(e){void 0===e&&(e=new Map),this._settings=e}return e.prototype.add=function(e,t){this._settings.set(e,t)},e.prototype.addJSON=function(e,t){this._settings.set(e,Object(n.b)(t))},e.prototype.apply=function(e){var t=this;return new Promise(function(i,o){try{t._settings=Object(n.c)(t._settings,Object(n.d)(e)),i()}catch(e){o(e)}})},e.prototype.load=function(e){var t=this;return new Promise(function(i,o){e.getConfiguration().then(function(e){t._settings=Object(n.c)(t._settings,Object(n.d)(e)),i()}).catch(o)})},e.prototype.get=function(e){return this._settings.get(e)},e.prototype.getJSON=function(e){var t=this.get(e);return void 0===t||null===t?t:JSON.parse(t)},e}()},function(e,t){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(i=window)}e.exports=i},function(e,t){/*! adal-angular v1.0.17 2018-02-27 */
var i=function(){"use strict";return i=function(e){if(this.REQUEST_TYPE={LOGIN:"LOGIN",RENEW_TOKEN:"RENEW_TOKEN",UNKNOWN:"UNKNOWN"},this.RESPONSE_TYPE={ID_TOKEN_TOKEN:"id_token token",TOKEN:"token"},this.CONSTANTS={ACCESS_TOKEN:"access_token",EXPIRES_IN:"expires_in",ID_TOKEN:"id_token",ERROR_DESCRIPTION:"error_description",SESSION_STATE:"session_state",ERROR:"error",STORAGE:{TOKEN_KEYS:"adal.token.keys",ACCESS_TOKEN_KEY:"adal.access.token.key",EXPIRATION_KEY:"adal.expiration.key",STATE_LOGIN:"adal.state.login",STATE_RENEW:"adal.state.renew",NONCE_IDTOKEN:"adal.nonce.idtoken",SESSION_STATE:"adal.session.state",USERNAME:"adal.username",IDTOKEN:"adal.idtoken",ERROR:"adal.error",ERROR_DESCRIPTION:"adal.error.description",LOGIN_REQUEST:"adal.login.request",LOGIN_ERROR:"adal.login.error",RENEW_STATUS:"adal.token.renew.status",ANGULAR_LOGIN_REQUEST:"adal.angular.login.request"},RESOURCE_DELIMETER:"|",CACHE_DELIMETER:"||",LOADFRAME_TIMEOUT:6e3,TOKEN_RENEW_STATUS_CANCELED:"Canceled",TOKEN_RENEW_STATUS_COMPLETED:"Completed",TOKEN_RENEW_STATUS_IN_PROGRESS:"In Progress",LOGGING_LEVEL:{ERROR:0,WARN:1,INFO:2,VERBOSE:3},LEVEL_STRING_MAP:{0:"ERROR:",1:"WARNING:",2:"INFO:",3:"VERBOSE:"},POPUP_WIDTH:483,POPUP_HEIGHT:600},i.prototype._singletonInstance)return i.prototype._singletonInstance;if(i.prototype._singletonInstance=this,this.instance="https://login.microsoftonline.com/",this.config={},this.callback=null,this.popUp=!1,this.isAngular=!1,this._user=null,this._activeRenewals={},this._loginInProgress=!1,this._acquireTokenInProgress=!1,this._renewStates=[],this._callBackMappedToRenewStates={},this._callBacksMappedToRenewStates={},this._openedWindows=[],this._requestType=this.REQUEST_TYPE.LOGIN,window._adalInstance=this,e.displayCall&&"function"!=typeof e.displayCall)throw new Error("displayCall is not a function");if(!e.clientId)throw new Error("clientId is required");this.config=this._cloneConfig(e),void 0===this.config.navigateToLoginRequestUrl&&(this.config.navigateToLoginRequestUrl=!0),this.config.popUp&&(this.popUp=!0),this.config.callback&&"function"==typeof this.config.callback&&(this.callback=this.config.callback),this.config.instance&&(this.instance=this.config.instance),this.config.loginResource||(this.config.loginResource=this.config.clientId),this.config.redirectUri||(this.config.redirectUri=window.location.href.split("?")[0].split("#")[0]),this.config.postLogoutRedirectUri||(this.config.postLogoutRedirectUri=window.location.href.split("?")[0].split("#")[0]),this.config.anonymousEndpoints||(this.config.anonymousEndpoints=[]),this.config.isAngular&&(this.isAngular=this.config.isAngular),this.config.loadFrameTimeout&&(this.CONSTANTS.LOADFRAME_TIMEOUT=this.config.loadFrameTimeout)},"undefined"!=typeof window&&(window.Logging={piiLoggingEnabled:!1,level:0,log:function(e){}}),i.prototype.login=function(){if(this._loginInProgress)return void this.info("Login in progress");this._loginInProgress=!0;var e=this._guid();this.config.state=e,this._idTokenNonce=this._guid();var t=this._getItem(this.CONSTANTS.STORAGE.ANGULAR_LOGIN_REQUEST);t&&""!==t?this._saveItem(this.CONSTANTS.STORAGE.ANGULAR_LOGIN_REQUEST,""):t=window.location.href,this.verbose("Expected state: "+e+" startPage:"+t),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_REQUEST,t),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN,e,!0),this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,this._idTokenNonce,!0),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,"");var i=this._getNavigateUrl("id_token",null)+"&nonce="+encodeURIComponent(this._idTokenNonce);this.config.displayCall?this.config.displayCall(i):this.popUp?(this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN,""),this._renewStates.push(e),this.registerCallback(e,this.config.clientId,this.callback),this._loginPopup(i)):this.promptUser(i)},i.prototype._openPopup=function(e,t,i,n){try{var o=window.screenLeft?window.screenLeft:window.screenX,r=window.screenTop?window.screenTop:window.screenY,s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,c=s/2-i/2+o,u=a/2-n/2+r,h=window.open(e,t,"width="+i+", height="+n+", top="+u+", left="+c);return h.focus&&h.focus(),h}catch(e){return this.warn("Error opening popup, "+e.message),this._loginInProgress=!1,this._acquireTokenInProgress=!1,null}},i.prototype._handlePopupError=function(e,t,i,n,o){this.warn(n),this._saveItem(this.CONSTANTS.STORAGE.ERROR,i),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,n),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,o),t&&this._activeRenewals[t]&&(this._activeRenewals[t]=null),this._loginInProgress=!1,this._acquireTokenInProgress=!1,e&&e(n,null,i)},i.prototype._loginPopup=function(e,t,i){var n=this._openPopup(e,"login",this.CONSTANTS.POPUP_WIDTH,this.CONSTANTS.POPUP_HEIGHT),o=i||this.callback;if(null==n){var r="Popup Window is null. This can happen if you are using IE";return void this._handlePopupError(o,t,"Error opening popup",r,r)}if(this._openedWindows.push(n),-1!=this.config.redirectUri.indexOf("#"))var s=this.config.redirectUri.split("#")[0];else var s=this.config.redirectUri;var a=this,c=window.setInterval(function(){if(!n||n.closed||void 0===n.closed){var e="Popup Window closed",i="Popup Window closed by UI action/ Popup Window handle destroyed due to cross zone navigation in IE/Edge";return a.isAngular&&a._broadcast("adal:popUpClosed",i+a.CONSTANTS.RESOURCE_DELIMETER+e),a._handlePopupError(o,t,e,i,i),void window.clearInterval(c)}try{var r=n.location;if(-1!=encodeURI(r.href).indexOf(encodeURI(s)))return a.isAngular?a._broadcast("adal:popUpHashChanged",r.hash):a.handleWindowCallback(r.hash),window.clearInterval(c),a._loginInProgress=!1,a._acquireTokenInProgress=!1,a.info("Closing popup window"),a._openedWindows=[],void n.close()}catch(e){}},1)},i.prototype._broadcast=function(e,t){!function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var i=document.createEvent("CustomEvent");return i.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),i}if("function"==typeof window.CustomEvent)return!1;e.prototype=window.Event.prototype,window.CustomEvent=e}();var i=new CustomEvent(e,{detail:t});window.dispatchEvent(i)},i.prototype.loginInProgress=function(){return this._loginInProgress},i.prototype._hasResource=function(e){var t=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS);return t&&!this._isEmpty(t)&&t.indexOf(e+this.CONSTANTS.RESOURCE_DELIMETER)>-1},i.prototype.getCachedToken=function(e){if(!this._hasResource(e))return null;var t=this._getItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+e),i=this._getItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+e),n=this.config.expireOffsetSeconds||300;return i&&i>this._now()+n?t:(this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+e,""),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+e,0),null)},i.prototype.getCachedUser=function(){if(this._user)return this._user;var e=this._getItem(this.CONSTANTS.STORAGE.IDTOKEN);return this._user=this._createUser(e),this._user},i.prototype.registerCallback=function(e,t,i){this._activeRenewals[t]=e,this._callBacksMappedToRenewStates[e]||(this._callBacksMappedToRenewStates[e]=[]);var n=this;this._callBacksMappedToRenewStates[e].push(i),this._callBackMappedToRenewStates[e]||(this._callBackMappedToRenewStates[e]=function(i,o,r,s){n._activeRenewals[t]=null;for(var a=0;a<n._callBacksMappedToRenewStates[e].length;++a)try{n._callBacksMappedToRenewStates[e][a](i,o,r,s)}catch(r){n.warn(r)}n._callBacksMappedToRenewStates[e]=null,n._callBackMappedToRenewStates[e]=null})},i.prototype._renewToken=function(e,t,i){this.info("renewToken is called for resource:"+e);var n=this._addAdalFrame("adalRenewFrame"+e),o=this._guid()+"|"+e;this.config.state=o,this._renewStates.push(o),this.verbose("Renew token Expected state: "+o),i=i||"token";var r=this._urlRemoveQueryStringParameter(this._getNavigateUrl(i,e),"prompt");i===this.RESPONSE_TYPE.ID_TOKEN_TOKEN&&(this._idTokenNonce=this._guid(),this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,this._idTokenNonce,!0),r+="&nonce="+encodeURIComponent(this._idTokenNonce)),r+="&prompt=none",r=this._addHintParameters(r),this.registerCallback(o,e,t),this.verbosePii("Navigate to:"+r),n.src="about:blank",this._loadFrameTimeout(r,"adalRenewFrame"+e,e)},i.prototype._renewIdToken=function(e,t){this.info("renewIdToken is called");var i=this._addAdalFrame("adalIdTokenFrame"),n=this._guid()+"|"+this.config.clientId;this._idTokenNonce=this._guid(),this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,this._idTokenNonce,!0),this.config.state=n,this._renewStates.push(n),this.verbose("Renew Idtoken Expected state: "+n);var o=null===t||void 0===t?null:this.config.clientId,t=t||"id_token",r=this._urlRemoveQueryStringParameter(this._getNavigateUrl(t,o),"prompt");r+="&prompt=none",r=this._addHintParameters(r),r+="&nonce="+encodeURIComponent(this._idTokenNonce),this.registerCallback(n,this.config.clientId,e),this.verbosePii("Navigate to:"+r),i.src="about:blank",this._loadFrameTimeout(r,"adalIdTokenFrame",this.config.clientId)},i.prototype._urlContainsQueryStringParameter=function(e,t){return new RegExp("[\\?&]"+e+"=").test(t)},i.prototype._urlRemoveQueryStringParameter=function(e,t){var i=new RegExp("(\\&"+t+"=)[^&]+");return e=e.replace(i,""),i=new RegExp("("+t+"=)[^&]+&"),e=e.replace(i,""),i=new RegExp("("+t+"=)[^&]+"),e=e.replace(i,"")},i.prototype._loadFrameTimeout=function(e,t,i){this.verbose("Set loading state to pending for: "+i),this._saveItem(this.CONSTANTS.STORAGE.RENEW_STATUS+i,this.CONSTANTS.TOKEN_RENEW_STATUS_IN_PROGRESS),this._loadFrame(e,t);var n=this;setTimeout(function(){if(n._getItem(n.CONSTANTS.STORAGE.RENEW_STATUS+i)===n.CONSTANTS.TOKEN_RENEW_STATUS_IN_PROGRESS){n.verbose("Loading frame has timed out after: "+n.CONSTANTS.LOADFRAME_TIMEOUT/1e3+" seconds for resource "+i);var e=n._activeRenewals[i];e&&n._callBackMappedToRenewStates[e]&&n._callBackMappedToRenewStates[e]("Token renewal operation failed due to timeout",null,"Token Renewal Failed"),n._saveItem(n.CONSTANTS.STORAGE.RENEW_STATUS+i,n.CONSTANTS.TOKEN_RENEW_STATUS_CANCELED)}},n.CONSTANTS.LOADFRAME_TIMEOUT)},i.prototype._loadFrame=function(e,t){var i=this;i.info("LoadFrame: "+t);var n=t;setTimeout(function(){var t=i._addAdalFrame(n);""!==t.src&&"about:blank"!==t.src||(t.src=e,i._loadFrame(e,n))},500)},i.prototype.acquireToken=function(e,t){if(this._isEmpty(e))return this.warn("resource is required"),void t("resource is required",null,"resource is required");var i=this.getCachedToken(e);return i?(this.info("Token is already in cache for resource:"+e),void t(null,i,null)):this._user||this.config.extraQueryParameter&&-1!==this.config.extraQueryParameter.indexOf("login_hint")?void(this._activeRenewals[e]?this.registerCallback(this._activeRenewals[e],e,t):(this._requestType=this.REQUEST_TYPE.RENEW_TOKEN,e===this.config.clientId?this._user?(this.verbose("renewing idtoken"),this._renewIdToken(t)):(this.verbose("renewing idtoken and access_token"),this._renewIdToken(t,this.RESPONSE_TYPE.ID_TOKEN_TOKEN)):this._user?(this.verbose("renewing access_token"),this._renewToken(e,t)):(this.verbose("renewing idtoken and access_token"),this._renewToken(e,t,this.RESPONSE_TYPE.ID_TOKEN_TOKEN)))):(this.warn("User login is required"),void t("User login is required",null,"login required"))},i.prototype.acquireTokenPopup=function(e,t,i,n){if(this._isEmpty(e))return this.warn("resource is required"),void n("resource is required",null,"resource is required");if(!this._user)return this.warn("User login is required"),void n("User login is required",null,"login required");if(this._acquireTokenInProgress)return this.warn("Acquire token interactive is already in progress"),void n("Acquire token interactive is already in progress",null,"Acquire token interactive is already in progress");var o=this._guid()+"|"+e;this.config.state=o,this._renewStates.push(o),this._requestType=this.REQUEST_TYPE.RENEW_TOKEN,this.verbose("Renew token Expected state: "+o);var r=this._urlRemoveQueryStringParameter(this._getNavigateUrl("token",e),"prompt");if(r+="&prompt=select_account",t&&(r+=t),i&&-1===r.indexOf("&claims"))r+="&claims="+encodeURIComponent(i);else if(i&&-1!==r.indexOf("&claims"))throw new Error("Claims cannot be passed as an extraQueryParameter");r=this._addHintParameters(r),this._acquireTokenInProgress=!0,this.info("acquireToken interactive is called for the resource "+e),this.registerCallback(o,e,n),this._loginPopup(r,e,n)},i.prototype.acquireTokenRedirect=function(e,t,i){if(this._isEmpty(e))return this.warn("resource is required"),void n("resource is required",null,"resource is required");var n=this.callback;if(!this._user)return this.warn("User login is required"),void n("User login is required",null,"login required");if(this._acquireTokenInProgress)return this.warn("Acquire token interactive is already in progress"),void n("Acquire token interactive is already in progress",null,"Acquire token interactive is already in progress");var o=this._guid()+"|"+e;this.config.state=o,this.verbose("Renew token Expected state: "+o);var r=this._urlRemoveQueryStringParameter(this._getNavigateUrl("token",e),"prompt");if(r+="&prompt=select_account",t&&(r+=t),i&&-1===r.indexOf("&claims"))r+="&claims="+encodeURIComponent(i);else if(i&&-1!==r.indexOf("&claims"))throw new Error("Claims cannot be passed as an extraQueryParameter");r=this._addHintParameters(r),this._acquireTokenInProgress=!0,this.info("acquireToken interactive is called for the resource "+e),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_REQUEST,window.location.href),this._saveItem(this.CONSTANTS.STORAGE.STATE_RENEW,o,!0),this.promptUser(r)},i.prototype.promptUser=function(e){e?(this.infoPii("Navigate to:"+e),window.location.replace(e)):this.info("Navigate url is empty")},i.prototype.clearCache=function(){this._saveItem(this.CONSTANTS.STORAGE.LOGIN_REQUEST,""),this._saveItem(this.CONSTANTS.STORAGE.ANGULAR_LOGIN_REQUEST,""),this._saveItem(this.CONSTANTS.STORAGE.SESSION_STATE,""),this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN,""),this._saveItem(this.CONSTANTS.STORAGE.STATE_RENEW,""),this._renewStates=[],this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,""),this._saveItem(this.CONSTANTS.STORAGE.IDTOKEN,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,""),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,"");var e=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS);if(!this._isEmpty(e)){e=e.split(this.CONSTANTS.RESOURCE_DELIMETER);for(var t=0;t<e.length&&""!==e[t];t++)this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+e[t],""),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+e[t],0)}this._saveItem(this.CONSTANTS.STORAGE.TOKEN_KEYS,"")},i.prototype.clearCacheForResource=function(e){this._saveItem(this.CONSTANTS.STORAGE.STATE_RENEW,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,""),this._hasResource(e)&&(this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+e,""),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+e,0))},i.prototype.logOut=function(){this.clearCache(),this._user=null;var e;if(this.config.logOutUri)e=this.config.logOutUri;else{var t="common",i="";this.config.tenant&&(t=this.config.tenant),this.config.postLogoutRedirectUri&&(i="post_logout_redirect_uri="+encodeURIComponent(this.config.postLogoutRedirectUri)),e=this.instance+t+"/oauth2/logout?"+i}this.infoPii("Logout navigate to: "+e),this.promptUser(e)},i.prototype._isEmpty=function(e){return void 0===e||!e||0===e.length},i.prototype.getUser=function(e){if("function"!=typeof e)throw new Error("callback is not a function");if(this._user)return void e(null,this._user);var t=this._getItem(this.CONSTANTS.STORAGE.IDTOKEN);this._isEmpty(t)?(this.warn("User information is not available"),e("User information is not available",null)):(this.info("User exists in cache: "),this._user=this._createUser(t),e(null,this._user))},i.prototype._addHintParameters=function(e){if(this._user&&this._user.profile)if(this._user.profile.sid&&-1!==e.indexOf("&prompt=none"))this._urlContainsQueryStringParameter("sid",e)||(e+="&sid="+encodeURIComponent(this._user.profile.sid));else if(this._user.profile.upn&&(this._urlContainsQueryStringParameter("login_hint",e)||(e+="&login_hint="+encodeURIComponent(this._user.profile.upn)),!this._urlContainsQueryStringParameter("domain_hint",e)&&this._user.profile.upn.indexOf("@")>-1)){var t=this._user.profile.upn.split("@");e+="&domain_hint="+encodeURIComponent(t[t.length-1])}return e},i.prototype._createUser=function(e){var t=null,i=this._extractIdToken(e);return i&&i.hasOwnProperty("aud")&&(i.aud.toLowerCase()===this.config.clientId.toLowerCase()?(t={userName:"",profile:i},i.hasOwnProperty("upn")?t.userName=i.upn:i.hasOwnProperty("email")&&(t.userName=i.email)):this.warn("IdToken has invalid aud field")),t},i.prototype._getHash=function(e){return e.indexOf("#/")>-1?e=e.substring(e.indexOf("#/")+2):e.indexOf("#")>-1&&(e=e.substring(1)),e},i.prototype.isCallback=function(e){e=this._getHash(e);var t=this._deserialize(e);return t.hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION)||t.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)||t.hasOwnProperty(this.CONSTANTS.ID_TOKEN)},i.prototype.getLoginError=function(){return this._getItem(this.CONSTANTS.STORAGE.LOGIN_ERROR)},i.prototype.getRequestInfo=function(e){e=this._getHash(e);var t=this._deserialize(e),i={valid:!1,parameters:{},stateMatch:!1,stateResponse:"",requestType:this.REQUEST_TYPE.UNKNOWN};if(t&&(i.parameters=t,t.hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION)||t.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)||t.hasOwnProperty(this.CONSTANTS.ID_TOKEN))){i.valid=!0;var n="";if(!t.hasOwnProperty("state"))return this.warn("No state returned"),i;if(this.verbose("State: "+t.state),n=t.state,i.stateResponse=n,this._matchState(i))return i;if(!i.stateMatch&&window.parent){i.requestType=this._requestType;for(var o=this._renewStates,r=0;r<o.length;r++)if(o[r]===i.stateResponse){i.stateMatch=!0;break}}}return i},i.prototype._matchNonce=function(e){var t=this._getItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN);if(t){t=t.split(this.CONSTANTS.CACHE_DELIMETER);for(var i=0;i<t.length;i++)if(t[i]===e.profile.nonce)return!0}return!1},i.prototype._matchState=function(e){var t=this._getItem(this.CONSTANTS.STORAGE.STATE_LOGIN);if(t){t=t.split(this.CONSTANTS.CACHE_DELIMETER);for(var i=0;i<t.length;i++)if(t[i]===e.stateResponse)return e.requestType=this.REQUEST_TYPE.LOGIN,e.stateMatch=!0,!0}var n=this._getItem(this.CONSTANTS.STORAGE.STATE_RENEW);if(n){n=n.split(this.CONSTANTS.CACHE_DELIMETER);for(var i=0;i<n.length;i++)if(n[i]===e.stateResponse)return e.requestType=this.REQUEST_TYPE.RENEW_TOKEN,e.stateMatch=!0,!0}return!1},i.prototype._getResourceFromState=function(e){if(e){var t=e.indexOf("|");if(t>-1&&t+1<e.length)return e.substring(t+1)}return""},i.prototype.saveTokenFromHash=function(e){this.info("State status:"+e.stateMatch+"; Request type:"+e.requestType),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,"");var t=this._getResourceFromState(e.stateResponse);if(e.parameters.hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION))this.infoPii("Error :"+e.parameters.error+"; Error description:"+e.parameters[this.CONSTANTS.ERROR_DESCRIPTION]),this._saveItem(this.CONSTANTS.STORAGE.ERROR,e.parameters.error),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,e.parameters[this.CONSTANTS.ERROR_DESCRIPTION]),e.requestType===this.REQUEST_TYPE.LOGIN&&(this._loginInProgress=!1,this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,e.parameters.error_description));else if(e.stateMatch){this.info("State is right"),e.parameters.hasOwnProperty(this.CONSTANTS.SESSION_STATE)&&this._saveItem(this.CONSTANTS.STORAGE.SESSION_STATE,e.parameters[this.CONSTANTS.SESSION_STATE]);var i;e.parameters.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)&&(this.info("Fragment has access token"),this._hasResource(t)||(i=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS)||"",this._saveItem(this.CONSTANTS.STORAGE.TOKEN_KEYS,i+t+this.CONSTANTS.RESOURCE_DELIMETER)),this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+t,e.parameters[this.CONSTANTS.ACCESS_TOKEN]),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+t,this._expiresIn(e.parameters[this.CONSTANTS.EXPIRES_IN]))),e.parameters.hasOwnProperty(this.CONSTANTS.ID_TOKEN)&&(this.info("Fragment has id token"),this._loginInProgress=!1,this._user=this._createUser(e.parameters[this.CONSTANTS.ID_TOKEN]),this._user&&this._user.profile?this._matchNonce(this._user)?(this._saveItem(this.CONSTANTS.STORAGE.IDTOKEN,e.parameters[this.CONSTANTS.ID_TOKEN]),t=this.config.loginResource?this.config.loginResource:this.config.clientId,this._hasResource(t)||(i=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS)||"",this._saveItem(this.CONSTANTS.STORAGE.TOKEN_KEYS,i+t+this.CONSTANTS.RESOURCE_DELIMETER)),this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+t,e.parameters[this.CONSTANTS.ID_TOKEN]),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+t,this._user.profile.exp)):(this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,"Nonce received: "+this._user.profile.nonce+" is not same as requested: "+this._getItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN)),this._user=null):(e.parameters.error="invalid id_token",e.parameters.error_description="Invalid id_token. id_token: "+e.parameters[this.CONSTANTS.ID_TOKEN],this._saveItem(this.CONSTANTS.STORAGE.ERROR,"invalid id_token"),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,"Invalid id_token. id_token: "+e.parameters[this.CONSTANTS.ID_TOKEN])))}else e.parameters.error="Invalid_state",e.parameters.error_description="Invalid_state. state: "+e.stateResponse,this._saveItem(this.CONSTANTS.STORAGE.ERROR,"Invalid_state"),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,"Invalid_state. state: "+e.stateResponse);this._saveItem(this.CONSTANTS.STORAGE.RENEW_STATUS+t,this.CONSTANTS.TOKEN_RENEW_STATUS_COMPLETED)},i.prototype.getResourceForEndpoint=function(e){if(this.config&&this.config.anonymousEndpoints)for(var t=0;t<this.config.anonymousEndpoints.length;t++)if(e.indexOf(this.config.anonymousEndpoints[t])>-1)return null;if(this.config&&this.config.endpoints)for(var i in this.config.endpoints)if(e.indexOf(i)>-1)return this.config.endpoints[i];return e.indexOf("http://")>-1||e.indexOf("https://")>-1?this._getHostFromUri(e)===this._getHostFromUri(this.config.redirectUri)?this.config.loginResource:null:this.config.loginResource},i.prototype._getHostFromUri=function(e){var t=String(e).replace(/^(https?:)\/\//,"");return t=t.split("/")[0]},i.prototype.handleWindowCallback=function(e){if(null==e&&(e=window.location.hash),this.isCallback(e)){var t=null,i=!1;this._openedWindows.length>0&&this._openedWindows[this._openedWindows.length-1].opener&&this._openedWindows[this._openedWindows.length-1].opener._adalInstance?(t=this._openedWindows[this._openedWindows.length-1].opener._adalInstance,i=!0):window.parent&&window.parent._adalInstance&&(t=window.parent._adalInstance);var n,o,r=t.getRequestInfo(e),s=null;o=i||window.parent!==window?t._callBackMappedToRenewStates[r.stateResponse]:t.callback,t.info("Returned from redirect url"),t.saveTokenFromHash(r),r.requestType===this.REQUEST_TYPE.RENEW_TOKEN&&window.parent?(window.parent!==window?t.verbose("Window is in iframe, acquiring token silently"):t.verbose("acquiring token interactive in progress"),n=r.parameters[t.CONSTANTS.ACCESS_TOKEN]||r.parameters[t.CONSTANTS.ID_TOKEN],s=t.CONSTANTS.ACCESS_TOKEN):r.requestType===this.REQUEST_TYPE.LOGIN&&(n=r.parameters[t.CONSTANTS.ID_TOKEN],s=t.CONSTANTS.ID_TOKEN);var a=r.parameters[t.CONSTANTS.ERROR_DESCRIPTION],c=r.parameters[t.CONSTANTS.ERROR];try{o&&o(a,n,c,s)}catch(e){t.error("Error occurred in user defined callback function: "+e)}window.parent!==window||i||(t.config.navigateToLoginRequestUrl?window.location.href=t._getItem(t.CONSTANTS.STORAGE.LOGIN_REQUEST):window.location.hash="")}},i.prototype._getNavigateUrl=function(e,t){var i="common";this.config.tenant&&(i=this.config.tenant);var n=this.instance+i+"/oauth2/authorize"+this._serialize(e,this.config,t)+this._addLibMetadata();return this.info("Navigate url:"+n),n},i.prototype._extractIdToken=function(e){var t=this._decodeJwt(e);if(!t)return null;try{var i=t.JWSPayload,n=this._base64DecodeStringUrlSafe(i);return n?JSON.parse(n):(this.info("The returned id_token could not be base64 url safe decoded."),null)}catch(e){this.error("The returned id_token could not be decoded",e)}return null},i.prototype._base64DecodeStringUrlSafe=function(e){return e=e.replace(/-/g,"+").replace(/_/g,"/"),window.atob?decodeURIComponent(escape(window.atob(e))):decodeURIComponent(escape(this._decode(e)))},i.prototype._decode=function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e=String(e).replace(/=+$/,"");var i=e.length;if(i%4==1)throw new Error("The token to be decoded is not correctly encoded.");for(var n,o,r,s,a,c,u,h,l="",p=0;p<i;p+=4){if(n=t.indexOf(e.charAt(p)),o=t.indexOf(e.charAt(p+1)),r=t.indexOf(e.charAt(p+2)),s=t.indexOf(e.charAt(p+3)),p+2===i-1){a=n<<18|o<<12|r<<6,c=a>>16&255,u=a>>8&255,l+=String.fromCharCode(c,u);break}if(p+1===i-1){a=n<<18|o<<12,c=a>>16&255,l+=String.fromCharCode(c);break}a=n<<18|o<<12|r<<6|s,c=a>>16&255,u=a>>8&255,h=255&a,l+=String.fromCharCode(c,u,h)}return l},i.prototype._decodeJwt=function(e){if(this._isEmpty(e))return null;var t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/,i=t.exec(e);return!i||i.length<4?(this.warn("The returned id_token is not parseable."),null):{header:i[1],JWSPayload:i[2],JWSSig:i[3]}},i.prototype._convertUrlSafeToRegularBase64EncodedString=function(e){return e.replace("-","+").replace("_","/")},i.prototype._serialize=function(e,t,i){var n=[];if(null!==t){n.push("?response_type="+e),n.push("client_id="+encodeURIComponent(t.clientId)),i&&n.push("resource="+encodeURIComponent(i)),n.push("redirect_uri="+encodeURIComponent(t.redirectUri)),n.push("state="+encodeURIComponent(t.state)),t.hasOwnProperty("slice")&&n.push("slice="+encodeURIComponent(t.slice)),t.hasOwnProperty("extraQueryParameter")&&n.push(t.extraQueryParameter);var o=t.correlationId?t.correlationId:this._guid();n.push("client-request-id="+encodeURIComponent(o))}return n.join("&")},i.prototype._deserialize=function(e){var t,i=/\+/g,n=/([^&=]+)=([^&]*)/g,o=function(e){return decodeURIComponent(e.replace(i," "))},r={};for(t=n.exec(e);t;)r[o(t[1])]=o(t[2]),t=n.exec(e);return r},i.prototype._decimalToHex=function(e){for(var t=e.toString(16);t.length<2;)t="0"+t;return t},i.prototype._guid=function(){var e=window.crypto||window.msCrypto;if(e&&e.getRandomValues){var t=new Uint8Array(16);return e.getRandomValues(t),t[6]|=64,t[6]&=79,t[8]|=128,t[8]&=191,this._decimalToHex(t[0])+this._decimalToHex(t[1])+this._decimalToHex(t[2])+this._decimalToHex(t[3])+"-"+this._decimalToHex(t[4])+this._decimalToHex(t[5])+"-"+this._decimalToHex(t[6])+this._decimalToHex(t[7])+"-"+this._decimalToHex(t[8])+this._decimalToHex(t[9])+"-"+this._decimalToHex(t[10])+this._decimalToHex(t[11])+this._decimalToHex(t[12])+this._decimalToHex(t[13])+this._decimalToHex(t[14])+this._decimalToHex(t[15])}for(var i="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",n="0123456789abcdef",o=0,r="",s=0;s<36;s++)"-"!==i[s]&&"4"!==i[s]&&(o=16*Math.random()|0),"x"===i[s]?r+=n[o]:"y"===i[s]?(o&=3,o|=8,r+=n[o]):r+=i[s];return r},i.prototype._expiresIn=function(e){return e||(e=3599),this._now()+parseInt(e,10)},i.prototype._now=function(){return Math.round((new Date).getTime()/1e3)},i.prototype._addAdalFrame=function(e){if(void 0!==e){this.info("Add adal frame to document:"+e);var t=document.getElementById(e);if(!t){if(document.createElement&&document.documentElement&&(window.opera||-1===window.navigator.userAgent.indexOf("MSIE 5.0"))){var i=document.createElement("iframe");i.setAttribute("id",e),i.setAttribute("aria-hidden","true"),i.style.visibility="hidden",i.style.position="absolute",i.style.width=i.style.height=i.borderWidth="0px",t=document.getElementsByTagName("body")[0].appendChild(i)}else document.body&&document.body.insertAdjacentHTML&&document.body.insertAdjacentHTML("beforeEnd",'<iframe name="'+e+'" id="'+e+'" style="display:none"></iframe>');window.frames&&window.frames[e]&&(t=window.frames[e])}return t}},i.prototype._saveItem=function(e,t,i){if(this.config&&this.config.cacheLocation&&"localStorage"===this.config.cacheLocation){if(!this._supportsLocalStorage())return this.info("Local storage is not supported"),!1;if(i){var n=this._getItem(e)||"";localStorage.setItem(e,n+t+this.CONSTANTS.CACHE_DELIMETER)}else localStorage.setItem(e,t);return!0}return this._supportsSessionStorage()?(sessionStorage.setItem(e,t),!0):(this.info("Session storage is not supported"),!1)},i.prototype._getItem=function(e){return this.config&&this.config.cacheLocation&&"localStorage"===this.config.cacheLocation?this._supportsLocalStorage()?localStorage.getItem(e):(this.info("Local storage is not supported"),null):this._supportsSessionStorage()?sessionStorage.getItem(e):(this.info("Session storage is not supported"),null)},i.prototype._supportsLocalStorage=function(){try{return!!window.localStorage&&(window.localStorage.setItem("storageTest","A"),"A"==window.localStorage.getItem("storageTest")&&(window.localStorage.removeItem("storageTest"),!window.localStorage.getItem("storageTest")))}catch(e){return!1}},i.prototype._supportsSessionStorage=function(){try{return!!window.sessionStorage&&(window.sessionStorage.setItem("storageTest","A"),"A"==window.sessionStorage.getItem("storageTest")&&(window.sessionStorage.removeItem("storageTest"),!window.sessionStorage.getItem("storageTest")))}catch(e){return!1}},i.prototype._cloneConfig=function(e){if(null===e||"object"!=typeof e)return e;var t={};for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t},i.prototype._addLibMetadata=function(){return"&x-client-SKU=Js&x-client-Ver="+this._libVersion()},i.prototype.log=function(e,t,i,n){if(e<=Logging.level){if(!Logging.piiLoggingEnabled&&n)return;var o=(new Date).toUTCString(),r="";r=this.config.correlationId?o+":"+this.config.correlationId+"-"+this._libVersion()+"-"+this.CONSTANTS.LEVEL_STRING_MAP[e]+" "+t:o+":"+this._libVersion()+"-"+this.CONSTANTS.LEVEL_STRING_MAP[e]+" "+t,i&&(r+="\nstack:\n"+i.stack),Logging.log(r)}},i.prototype.error=function(e,t){this.log(this.CONSTANTS.LOGGING_LEVEL.ERROR,e,t)},i.prototype.warn=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.WARN,e,null)},i.prototype.info=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.INFO,e,null)},i.prototype.verbose=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.VERBOSE,e,null)},i.prototype.errorPii=function(e,t){this.log(this.CONSTANTS.LOGGING_LEVEL.ERROR,e,t,!0)},i.prototype.warnPii=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.WARN,e,null,!0)},i.prototype.infoPii=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.INFO,e,null,!0)},i.prototype.verbosePii=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.VERBOSE,e,null,!0)},i.prototype._libVersion=function(){return"1.0.17"},void 0!==e&&e.exports&&(e.exports=i,e.exports.inject=function(e){return new i(e)}),i}()},function(e,t,i){"use strict";var n=i(2);i.d(t,"a",function(){return n.a});var o=i(11);i.d(t,"b",function(){return o.a})},function(e,t,i){"use strict";i.d(t,"a",function(){return o});/**
@license
* @pnp/logging v1.1.5-1 - pnp - light-weight, subscribable logging framework
* @pnp/logging v1.1.5-2 - pnp - light-weight, subscribable logging framework
* MIT (https://github.com/pnp/pnpjs/blob/master/LICENSE)

@@ -45,3 +36,3 @@ * Copyright (c) 2018 Microsoft

*/
var n,r=function(){function e(){}return Object.defineProperty(e,"activeLogLevel",{get:function(){return e.instance.activeLogLevel},set:function(t){e.instance.activeLogLevel=t},enumerable:!0,configurable:!0}),Object.defineProperty(e,"instance",{get:function(){return void 0!==e._instance&&null!==e._instance||(e._instance=new o),e._instance},enumerable:!0,configurable:!0}),e.subscribe=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];t.map(function(t){return e.instance.subscribe(t)})},e.clearSubscribers=function(){return e.instance.clearSubscribers()},Object.defineProperty(e,"count",{get:function(){return e.instance.count},enumerable:!0,configurable:!0}),e.write=function(t,i){void 0===i&&(i=1),e.instance.log({level:i,message:t})},e.writeJSON=function(e,t){void 0===t&&(t=1),this.write(JSON.stringify(e),t)},e.log=function(t){e.instance.log(t)},e.error=function(t){e.instance.log({data:t,level:3,message:t.message})},e}(),o=function(){function e(e,t){void 0===e&&(e=2),void 0===t&&(t=[]),this.activeLogLevel=e,this.subscribers=t}return e.prototype.subscribe=function(e){this.subscribers.push(e)},e.prototype.clearSubscribers=function(){var e=this.subscribers.slice(0);return this.subscribers.length=0,e},Object.defineProperty(e.prototype,"count",{get:function(){return this.subscribers.length},enumerable:!0,configurable:!0}),e.prototype.write=function(e,t){void 0===t&&(t=1),this.log({level:t,message:e})},e.prototype.log=function(e){void 0!==e&&this.activeLogLevel<=e.level&&this.subscribers.map(function(t){return t.log(e)})},e}();!function(e){e[e.Verbose=0]="Verbose",e[e.Info=1]="Info",e[e.Warning=2]="Warning",e[e.Error=3]="Error",e[e.Off=99]="Off"}(n||(n={}));(function(){function e(){}e.prototype.log=function(e){var t=this.format(e);switch(e.level){case 0:case 1:console.log(t);break;case 2:console.warn(t);break;case 3:console.error(t)}},e.prototype.format=function(e){var t=[];return t.push("Message: "+e.message),void 0!==e.data&&t.push(" Data: "+JSON.stringify(e.data)),t.join("")}})(),function(){function e(e){this.method=e}e.prototype.log=function(e){this.method(e)}}()},function(e,t,i){"use strict";var n=i(2),r=function(){function e(e,t,i,n){void 0===t&&(t="config"),void 0===i&&(i="Title"),void 0===n&&(n="Value"),this.web=e,this.listTitle=t,this.keyFieldName=i,this.valueFieldName=n}return e.prototype.getConfiguration=function(){var e=this;return this.web.lists.getByTitle(this.listTitle).items.select(this.keyFieldName,this.valueFieldName).get().then(function(t){return t.reduce(function(t,i){return t[i[e.keyFieldName]]=i[e.valueFieldName],t},{})})},e.prototype.asCaching=function(e){return void 0===e&&(e="pnp_configcache_splist_"+this.web.toUrl()+"+"+this.listTitle),new n.a(this,e)},e}();t.a=r}])});
var n,o=function(){function e(){}return Object.defineProperty(e,"activeLogLevel",{get:function(){return e.instance.activeLogLevel},set:function(t){e.instance.activeLogLevel=t},enumerable:!0,configurable:!0}),Object.defineProperty(e,"instance",{get:function(){return void 0!==e._instance&&null!==e._instance||(e._instance=new r),e._instance},enumerable:!0,configurable:!0}),e.subscribe=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];t.map(function(t){return e.instance.subscribe(t)})},e.clearSubscribers=function(){return e.instance.clearSubscribers()},Object.defineProperty(e,"count",{get:function(){return e.instance.count},enumerable:!0,configurable:!0}),e.write=function(t,i){void 0===i&&(i=1),e.instance.log({level:i,message:t})},e.writeJSON=function(e,t){void 0===t&&(t=1),this.write(JSON.stringify(e),t)},e.log=function(t){e.instance.log(t)},e.error=function(t){e.instance.log({data:t,level:3,message:t.message})},e}(),r=function(){function e(e,t){void 0===e&&(e=2),void 0===t&&(t=[]),this.activeLogLevel=e,this.subscribers=t}return e.prototype.subscribe=function(e){this.subscribers.push(e)},e.prototype.clearSubscribers=function(){var e=this.subscribers.slice(0);return this.subscribers.length=0,e},Object.defineProperty(e.prototype,"count",{get:function(){return this.subscribers.length},enumerable:!0,configurable:!0}),e.prototype.write=function(e,t){void 0===t&&(t=1),this.log({level:t,message:e})},e.prototype.log=function(e){void 0!==e&&this.activeLogLevel<=e.level&&this.subscribers.map(function(t){return t.log(e)})},e}();!function(e){e[e.Verbose=0]="Verbose",e[e.Info=1]="Info",e[e.Warning=2]="Warning",e[e.Error=3]="Error",e[e.Off=99]="Off"}(n||(n={}));(function(){function e(){}e.prototype.log=function(e){var t=this.format(e);switch(e.level){case 0:case 1:console.log(t);break;case 2:console.warn(t);break;case 3:console.error(t)}},e.prototype.format=function(e){var t=[];return t.push("Message: "+e.message),void 0!==e.data&&t.push(" Data: "+JSON.stringify(e.data)),t.join("")}})(),function(){function e(e){this.method=e}e.prototype.log=function(e){this.method(e)}}()},function(e,t,i){"use strict";var n=i(2),o=function(){function e(e,t,i,n){void 0===t&&(t="config"),void 0===i&&(i="Title"),void 0===n&&(n="Value"),this.web=e,this.listTitle=t,this.keyFieldName=i,this.valueFieldName=n}return e.prototype.getConfiguration=function(){var e=this;return this.web.lists.getByTitle(this.listTitle).items.select(this.keyFieldName,this.valueFieldName).get().then(function(t){return t.reduce(function(t,i){return t[i[e.keyFieldName]]=i[e.valueFieldName],t},{})})},e.prototype.asCaching=function(e){return void 0===e&&(e="pnp_configcache_splist_"+this.web.toUrl()+"+"+this.listTitle),new n.a(this,e)},e}();t.a=o}])});
//# sourceMappingURL=config-store.es5.umd.bundle.min.js.map
/**
@license
* @pnp/config-store v1.1.5-1 - pnp - provides a way to manage configuration within your application
* @pnp/config-store v1.1.5-2 - pnp - provides a way to manage configuration within your application
* MIT (https://github.com/pnp/pnpjs/blob/master/LICENSE)

@@ -5,0 +5,0 @@ * Copyright (c) 2018 Microsoft

/**
@license
* @pnp/config-store v1.1.5-1 - pnp - provides a way to manage configuration within your application
* @pnp/config-store v1.1.5-2 - pnp - provides a way to manage configuration within your application
* MIT (https://github.com/pnp/pnpjs/blob/master/LICENSE)

@@ -5,0 +5,0 @@ * Copyright (c) 2018 Microsoft

/**
@license
* @pnp/config-store v1.1.5-1 - pnp - provides a way to manage configuration within your application
* @pnp/config-store v1.1.5-2 - pnp - provides a way to manage configuration within your application
* MIT (https://github.com/pnp/pnpjs/blob/master/LICENSE)

@@ -5,0 +5,0 @@ * Copyright (c) 2018 Microsoft

{
"name": "@pnp/config-store",
"version": "1.1.5-1",
"version": "1.1.5-2",
"description": "pnp - provides a way to manage configuration within your application",

@@ -11,5 +11,5 @@ "main": "./dist/config-store.es5.umd.js",

"peerDependencies": {
"@pnp/common": "1.1.5-1",
"@pnp/sp": "1.1.5-1",
"@pnp/logging": "1.1.5-1"
"@pnp/common": "1.1.5-2",
"@pnp/sp": "1.1.5-2",
"@pnp/logging": "1.1.5-2"
},

@@ -16,0 +16,0 @@ "author": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc