Socket
Socket
Sign inDemoInstall

@pnp/odata

Package Overview
Dependencies
Maintainers
6
Versions
154
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnp/odata - npm Package Compare versions

Comparing version 1.0.4-2 to 1.0.4-3

28

dist/odata.es5.js
/**
@license
* @pnp/odata v1.0.4-2 - pnp - provides shared odata functionality and base classes
* @pnp/odata v1.0.4-3 - pnp - provides shared odata functionality and base classes
* MIT (https://github.com/pnp/pnp/blob/master/LICENSE)

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

*/
import { Dictionary, PnPClientStorage, RuntimeConfig, Util, mergeOptions } from '@pnp/common';
import { Dictionary, PnPClientStorage, RuntimeConfig, combinePaths, dateAdd, extend, getGUID, isFunc, mergeOptions, objectDefinedNotNull } from '@pnp/common';
import { __decorate, __extends } from 'tslib';

@@ -18,3 +18,3 @@ import { Logger } from '@pnp/logging';

this.key = key;
this.expiration = Util.dateAdd(new Date(), "second", RuntimeConfig.defaultCachingTimeoutSeconds);
this.expiration = dateAdd(new Date(), "second", RuntimeConfig.defaultCachingTimeoutSeconds);
this.storeName = RuntimeConfig.defaultCachingStore;

@@ -180,3 +180,3 @@ }

BufferParser.prototype.parse = function (r) {
if (Util.isFunc(r.arrayBuffer)) {
if (isFunc(r.arrayBuffer)) {
return r.arrayBuffer();

@@ -294,3 +294,3 @@ }

if (typeof context.cachingOptions !== "undefined") {
cacheOptions = Util.extend(cacheOptions, context.cachingOptions);
cacheOptions = extend(cacheOptions, context.cachingOptions);
}

@@ -308,3 +308,5 @@ // we may not have a valid store

});
context.batchDependency();
if (isFunc(context.batchDependency)) {
context.batchDependency();
}
// handle the case where a parser needs to take special actions with a cached result (such as getAs)

@@ -335,3 +337,5 @@ if (context.parser.hasOwnProperty("hydrate")) {

// we release the dependency here to ensure the batch does not execute until the request is added to the batch
context.batchDependency();
if (isFunc(context.batchDependency)) {
context.batchDependency();
}
Logger.write("[" + context.requestId + "] (" + (new Date()).getTime() + ") Batching request in batch " + context.batch.batchId + ".", 1 /* Info */);

@@ -345,3 +349,3 @@ // we set the result as the promise which will be resolved by the batch's execution

var client = context.clientFactory();
var opts = Util.extend(context.options || {}, { method: context.verb });
var opts = extend(context.options || {}, { method: context.verb });
client.fetch(context.requestAbsoluteUrl, opts)

@@ -521,3 +525,3 @@ .then(function (response) { return context.parser.parse(response); })

Queryable.prototype.append = function (pathPart) {
this._url = Util.combinePaths(this._url, pathPart);
this._url = combinePaths(this._url, pathPart);
};

@@ -543,3 +547,3 @@ Object.defineProperty(Queryable.prototype, "parentUrl", {

this._parentUrl = parent._url;
this._url = Util.combinePaths(this._parentUrl, path);
this._url = combinePaths(this._parentUrl, path);
this.configureFrom(parent);

@@ -632,3 +636,3 @@ };

get: function () {
return Util.objectDefinedNotNull(this._batch);
return objectDefinedNotNull(this._batch);
},

@@ -654,3 +658,3 @@ enumerable: true,

function ODataBatch(_batchId) {
if (_batchId === void 0) { _batchId = Util.getGUID(); }
if (_batchId === void 0) { _batchId = getGUID(); }
this._batchId = _batchId;

@@ -657,0 +661,0 @@ this._requests = [];

/**
@license
* @pnp/odata v1.0.4-2 - pnp - provides shared odata functionality and base classes
* @pnp/odata v1.0.4-3 - pnp - provides shared odata functionality and base classes
* MIT (https://github.com/pnp/pnp/blob/master/LICENSE)

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

@license
* @pnp/common v1.0.4-2 - pnp - provides shared functionality across all pnp libraries
* @pnp/common v1.0.4-3 - pnp - provides shared functionality across all pnp libraries
* MIT (https://github.com/pnp/pnp/blob/master/LICENSE)

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

*/
function r(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return function(){t.apply(e,n)}}function i(e,t,n){var r=new Date(e);switch(t.toLowerCase()){case"year":r.setFullYear(r.getFullYear()+n);break;case"quarter":r.setMonth(r.getMonth()+3*n);break;case"month":r.setMonth(r.getMonth()+n);break;case"week":r.setDate(r.getDate()+7*n);break;case"day":r.setDate(r.getDate()+n);break;case"hour":r.setTime(r.getTime()+36e5*n);break;case"minute":r.setTime(r.getTime()+6e4*n);break;case"second":r.setTime(r.getTime()+1e3*n);break;default:r=void 0}return r}function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(function(e){return!E.stringIsNullOrEmpty(e)}).map(function(e){return e.replace(/^[\\|\/]/,"").replace(/[\\|\/]$/,"")}).join("/").replace(/\\/g,"/")}function s(e){for(var t=new Array(e),n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=0;r<e;r++)t[r]=n.charAt(Math.floor(Math.random()*n.length));return t.join("")}function a(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)})}function u(e){return"function"==typeof e}function c(e){return void 0!==e&&null!==e}function h(e){return Array.isArray?Array.isArray(e):e&&"number"==typeof e.length&&e.constructor===Array}function l(e,t,n){if(void 0===n&&(n=!1),!E.objectDefinedNotNull(t))return e;var r=n?function(e,t){return!(t in e)}:function(){return!0};return Object.getOwnPropertyNames(t).filter(function(t){return r(e,t)}).reduce(function(e,n){return e[n]=t[n],e},e)}function p(e){return/^https?:\/\/|^\/\//i.test(e)}function d(e){return void 0===e||null===e||e.length<1}function f(e,t){if(void 0!==t&&null!==t){new Request("",{headers:t}).headers.forEach(function(t,n){e.append(n,t)})}}function T(e,t){if(E.objectDefinedNotNull(t)){var n=E.extend(e.headers||{},t.headers);e=E.extend(e,t),e.headers=n}}n.d(t,"a",function(){return m}),n.d(t,"c",function(){return y}),n.d(t,"e",function(){return T}),n.d(t,"b",function(){return b}),n.d(t,"d",function(){return E});var _=n(1),g=n(10),S=(n.n(g),n(2)),E=function(){function e(){}return e.getCtxCallback=r,e.dateAdd=i,e.combinePaths=o,e.getRandomString=s,e.getGUID=a,e.isFunc=u,e.objectDefinedNotNull=c,e.isArray=h,e.extend=l,e.isUrlAbsolute=p,e.stringIsNullOrEmpty=d,e}(),O=function(){function t(){}return t.prototype.fetch=function(t,n){return e.fetch(t,n)},t}(),N=function(e){function t(t){var n=e.call(this)||this;return n._token=t,n}return Object(_.b)(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,n){void 0===n&&(n={});var r=new Headers;return f(r,n.headers),r.set("Authorization","Bearer "+this._token),n.headers=r,e.prototype.fetch.call(this,t,n)},t}(O),m=(function(e){function t(t,n,r){var i=e.call(this,null)||this;return i.clientId=t,i.tenant=n,i.redirectUri=r,i}Object(_.b)(t,e),t.fromSPFxContext=function(e,n){return void 0===n&&(n="c58637bb-e2e1-4312-8a00-04b5ffcd3403"),new t(n,e.pageContext.aadInfo.tenantId.toString(),o(window.location.origin,"/_forms/spfxsinglesignon.aspx"))},t.prototype.fetch=function(t,n){var r=this;if(!p(t))throw new Error("You must supply absolute urls to AdalClient.fetch.");return this.getToken(this.getResource(t)).then(function(i){return r.token=i,e.prototype.fetch.call(r,t,n)})},t.prototype.getToken=function(e){var n=this;return new Promise(function(r,i){n.ensureAuthContext().then(function(e){return n.login()}).then(function(n){t._authContext.acquireToken(e,function(e,t){if(e)return i(new Error(e));r(t)})}).catch(i)})},t.prototype.ensureAuthContext=function(){var e=this;return new Promise(function(n){null===t._authContext&&(t._authContext=Object(g.inject)({clientId:e.clientId,displayCall:function(t){e._displayCallback&&e._displayCallback(t)},navigateToLoginRequestUrl:!1,redirectUri:e.redirectUri,tenant:e.tenant})),n()})},t.prototype.login=function(){var e=this;return this._loginPromise?this._loginPromise:(this._loginPromise=new Promise(function(n,r){if(t._authContext.getCachedUser())return n();e._displayCallback=function(i){var o=window.open(i,"login","width=483, height=600");if(!o)return r(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(),n())}catch(e){r(e)}},30)},e.ensureAuthContext().then(function(n){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}(N),function(){function e(e,t){void 0===e&&(e=[]),void 0===t&&(t=[]),this.keys=e,this.values=t}return e.prototype.get=function(e){var t=this.keys.indexOf(e);return t<0?null:this.values[t]},e.prototype.add=function(e,t){var n=this.keys.indexOf(e);n>-1?null===t?this.remove(e):this.values[n]=t:null!==t&&(this.keys.push(e),this.values.push(t))},e.prototype.merge=function(e){var t=this;if("getKeys"in e){var n=e;n.getKeys().map(function(e){t.add(e,n.get(e))})}else{var r=e;for(var i in r)r.hasOwnProperty(i)&&this.add(i,r[i])}},e.prototype.remove=function(e){var t=this.keys.indexOf(e);if(t<0)return null;var n=this.values[t];return this.keys.splice(t,1),this.values.splice(t,1),n},e.prototype.getKeys=function(){return this.keys},e.prototype.getValues=function(){return this.values},e.prototype.clear=function(){this.keys=[],this.values=[]},Object.defineProperty(e.prototype,"count",{get:function(){return this.keys.length},enumerable:!0,configurable:!0}),e}()),v=(function(e){function t(t){var n=e.call(this,t)||this;return n.name="UrlException",S.a.log({data:{},level:3,message:"["+n.name+"]::"+n.message}),n}Object(_.b)(t,e)}(Error),function(){function e(){this._v=new m,this._v.add("defaultCachingStore","session"),this._v.add("defaultCachingTimeoutSeconds",60),this._v.add("globalCacheDisable",!1),this._v.add("enableCacheExpiration",!1),this._v.add("cacheExpirationIntervalMilliseconds",750),this._v.add("spfxContext",null)}return e.prototype.extend=function(e){var t=this;Object.keys(e).forEach(function(n){t._v.add(n,e[n])})},e.prototype.get=function(e){return this._v.get(e)},Object.defineProperty(e.prototype,"defaultCachingStore",{get:function(){return this.get("defaultCachingStore")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"defaultCachingTimeoutSeconds",{get:function(){return this.get("defaultCachingTimeoutSeconds")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"globalCacheDisable",{get:function(){return this.get("globalCacheDisable")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enableCacheExpiration",{get:function(){return this.get("enableCacheExpiration")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cacheExpirationIntervalMilliseconds",{get:function(){return this.get("cacheExpirationIntervalMilliseconds")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spfxContext",{get:function(){return this.get("spfxContext")},enumerable:!0,configurable:!0}),e}()),R=new v,y=R,I=function(){function e(e,t){void 0===t&&(t=-1),this.store=e,this.defaultTimeoutMinutes=t,this.enabled=this.test(),y.enableCacheExpiration&&(S.a.write("Enabling cache expiration.",1),this.cacheExpirationHandler())}return e.prototype.get=function(e){if(!this.enabled)return null;var t=this.store.getItem(e);if(null==t)return null;var n=JSON.parse(t);return new Date(n.expiration)<=new Date?(S.a.write("Removing item with key '"+e+"' from cache due to expiration.",1),this.delete(e),null):n.value},e.prototype.put=function(e,t,n){this.enabled&&this.store.setItem(e,this.createPersistable(t,n))},e.prototype.delete=function(e){this.enabled&&this.store.removeItem(e)},e.prototype.getOrPut=function(e,t,n){var r=this;return this.enabled?new Promise(function(i){var o=r.get(e);null==o?t().then(function(t){r.put(e,t,n),i(t)}):i(o)}):t()},e.prototype.deleteExpired=function(){var e=this;return new Promise(function(t,n){e.enabled||t();try{for(var r=0;r<e.store.length;r++){var i=e.store.key(r);null!==i&&/["|']?pnp["|']? ?: ?1/i.test(e.store.getItem(i))&&e.get(i)}t()}catch(e){n(e)}})},e.prototype.test=function(){try{return this.store.setItem("test","test"),this.store.removeItem("test"),!0}catch(e){return!1}},e.prototype.createPersistable=function(e,t){if(void 0===t){var n=y.defaultCachingTimeoutSeconds;this.defaultTimeoutMinutes>0&&(n=60*this.defaultTimeoutMinutes),t=E.dateAdd(new Date,"second",n)}return JSON.stringify({pnp:1,expiration:t,value:e})},e.prototype.cacheExpirationHandler=function(){var e=this;S.a.write("Called cache expiration handler.",0),this.deleteExpired().then(function(t){setTimeout(E.getCtxCallback(e,e.cacheExpirationHandler),y.cacheExpirationIntervalMilliseconds)}).catch(function(e){S.a.log({data:e,level:3,message:"Error deleting expired cache entries, see data for details. Timeout not reset."})})},e}(),w=function(){function e(e){void 0===e&&(e=new m),this._store=e}return Object.defineProperty(e.prototype,"length",{get:function(){return this._store.count},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 this._store.getKeys()[e]},e.prototype.removeItem=function(e){this._store.remove(e)},e.prototype.setItem=function(e,t){this._store.add(e,t)},e}(),b=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=new I("undefined"!=typeof localStorage?localStorage:new w)),this._local},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"session",{get:function(){return null===this._session&&(this._session=new I("undefined"!=typeof sessionStorage?sessionStorage:new w)),this._session},enumerable:!0,configurable:!0}),e}()}).call(t,n(9))},function(e,t,n){"use strict";function r(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function i(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}t.b=r,t.a=i;/*! *****************************************************************************
function r(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return function(){t.apply(e,n)}}function i(e,t,n){var r=new Date(e);switch(t.toLowerCase()){case"year":r.setFullYear(r.getFullYear()+n);break;case"quarter":r.setMonth(r.getMonth()+3*n);break;case"month":r.setMonth(r.getMonth()+n);break;case"week":r.setDate(r.getDate()+7*n);break;case"day":r.setDate(r.getDate()+n);break;case"hour":r.setTime(r.getTime()+36e5*n);break;case"minute":r.setTime(r.getTime()+6e4*n);break;case"second":r.setTime(r.getTime()+1e3*n);break;default:r=void 0}return r}function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(function(e){return!d(e)}).map(function(e){return e.replace(/^[\\|\/]/,"").replace(/[\\|\/]$/,"")}).join("/").replace(/\\/g,"/")}function s(e){for(var t=new Array(e),n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=0;r<e;r++)t[r]=n.charAt(Math.floor(Math.random()*n.length));return t.join("")}function a(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)})}function c(e){return"function"==typeof e}function u(e){return void 0!==e&&null!==e}function h(e){return Array.isArray?Array.isArray(e):e&&"number"==typeof e.length&&e.constructor===Array}function l(e,t,n){if(void 0===n&&(n=!1),!u(t))return e;var r=n?function(e,t){return!(t in e)}:function(){return!0};return Object.getOwnPropertyNames(t).filter(function(t){return r(e,t)}).reduce(function(e,n){return e[n]=t[n],e},e)}function p(e){return/^https?:\/\/|^\/\//i.test(e)}function d(e){return void 0===e||null===e||e.length<1}function f(e,t){if(void 0!==t&&null!==t){new Request("",{headers:t}).headers.forEach(function(t,n){e.append(n,t)})}}function T(e,t){if(u(t)){var n=l(e.headers||{},t.headers);e=l(e,t),e.headers=n}}n.d(t,"a",function(){return N}),n.d(t,"c",function(){return R}),n.d(t,"i",function(){return T}),n.d(t,"b",function(){return w}),n.d(t,"e",function(){return i}),n.d(t,"d",function(){return o}),n.d(t,"g",function(){return a}),n.d(t,"h",function(){return c}),n.d(t,"j",function(){return u}),n.d(t,"f",function(){return l});var _=n(1),g=n(10),S=(n.n(g),n(2)),E=(function(){function e(){}e.getCtxCallback=r,e.dateAdd=i,e.combinePaths=o,e.getRandomString=s,e.getGUID=a,e.isFunc=c,e.objectDefinedNotNull=u,e.isArray=h,e.extend=l,e.isUrlAbsolute=p,e.stringIsNullOrEmpty=d}(),function(){function t(){}return t.prototype.fetch=function(t,n){return e.fetch(t,n)},t}()),O=function(e){function t(t){var n=e.call(this)||this;return n._token=t,n}return Object(_.b)(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,n){void 0===n&&(n={});var r=new Headers;return f(r,n.headers),r.set("Authorization","Bearer "+this._token),n.headers=r,e.prototype.fetch.call(this,t,n)},t}(E),N=(function(e){function t(t,n,r){var i=e.call(this,null)||this;return i.clientId=t,i.tenant=n,i.redirectUri=r,i}Object(_.b)(t,e),t.fromSPFxContext=function(e,n){return void 0===n&&(n="c58637bb-e2e1-4312-8a00-04b5ffcd3403"),new t(n,e.pageContext.aadInfo.tenantId.toString(),o(window.location.origin,"/_forms/spfxsinglesignon.aspx"))},t.prototype.fetch=function(t,n){var r=this;if(!p(t))throw new Error("You must supply absolute urls to AdalClient.fetch.");return this.getToken(this.getResource(t)).then(function(i){return r.token=i,e.prototype.fetch.call(r,t,n)})},t.prototype.getToken=function(e){var n=this;return new Promise(function(r,i){n.ensureAuthContext().then(function(e){return n.login()}).then(function(n){t._authContext.acquireToken(e,function(e,t){if(e)return i(new Error(e));r(t)})}).catch(i)})},t.prototype.ensureAuthContext=function(){var e=this;return new Promise(function(n){null===t._authContext&&(t._authContext=Object(g.inject)({clientId:e.clientId,displayCall:function(t){e._displayCallback&&e._displayCallback(t)},navigateToLoginRequestUrl:!1,redirectUri:e.redirectUri,tenant:e.tenant})),n()})},t.prototype.login=function(){var e=this;return this._loginPromise?this._loginPromise:(this._loginPromise=new Promise(function(n,r){if(t._authContext.getCachedUser())return n();e._displayCallback=function(i){var o=window.open(i,"login","width=483, height=600");if(!o)return r(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(),n())}catch(e){r(e)}},30)},e.ensureAuthContext().then(function(n){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}(O),function(){function e(e,t){void 0===e&&(e=[]),void 0===t&&(t=[]),this.keys=e,this.values=t}return e.prototype.get=function(e){var t=this.keys.indexOf(e);return t<0?null:this.values[t]},e.prototype.add=function(e,t){var n=this.keys.indexOf(e);n>-1?null===t?this.remove(e):this.values[n]=t:null!==t&&(this.keys.push(e),this.values.push(t))},e.prototype.merge=function(e){var t=this;if("getKeys"in e){var n=e;n.getKeys().map(function(e){t.add(e,n.get(e))})}else{var r=e;for(var i in r)r.hasOwnProperty(i)&&this.add(i,r[i])}},e.prototype.remove=function(e){var t=this.keys.indexOf(e);if(t<0)return null;var n=this.values[t];return this.keys.splice(t,1),this.values.splice(t,1),n},e.prototype.getKeys=function(){return this.keys},e.prototype.getValues=function(){return this.values},e.prototype.clear=function(){this.keys=[],this.values=[]},Object.defineProperty(e.prototype,"count",{get:function(){return this.keys.length},enumerable:!0,configurable:!0}),e}()),m=(function(e){function t(t){var n=e.call(this,t)||this;return n.name="UrlException",S.a.log({data:{},level:3,message:"["+n.name+"]::"+n.message}),n}Object(_.b)(t,e)}(Error),function(){function e(){this._v=new N,this._v.add("defaultCachingStore","session"),this._v.add("defaultCachingTimeoutSeconds",60),this._v.add("globalCacheDisable",!1),this._v.add("enableCacheExpiration",!1),this._v.add("cacheExpirationIntervalMilliseconds",750),this._v.add("spfxContext",null)}return e.prototype.extend=function(e){var t=this;Object.keys(e).forEach(function(n){t._v.add(n,e[n])})},e.prototype.get=function(e){return this._v.get(e)},Object.defineProperty(e.prototype,"defaultCachingStore",{get:function(){return this.get("defaultCachingStore")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"defaultCachingTimeoutSeconds",{get:function(){return this.get("defaultCachingTimeoutSeconds")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"globalCacheDisable",{get:function(){return this.get("globalCacheDisable")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enableCacheExpiration",{get:function(){return this.get("enableCacheExpiration")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cacheExpirationIntervalMilliseconds",{get:function(){return this.get("cacheExpirationIntervalMilliseconds")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spfxContext",{get:function(){return this.get("spfxContext")},enumerable:!0,configurable:!0}),e}()),v=new m,R=v,y=function(){function e(e,t){void 0===t&&(t=-1),this.store=e,this.defaultTimeoutMinutes=t,this.enabled=this.test(),R.enableCacheExpiration&&(S.a.write("Enabling cache expiration.",1),this.cacheExpirationHandler())}return e.prototype.get=function(e){if(!this.enabled)return null;var t=this.store.getItem(e);if(null==t)return null;var n=JSON.parse(t);return new Date(n.expiration)<=new Date?(S.a.write("Removing item with key '"+e+"' from cache due to expiration.",1),this.delete(e),null):n.value},e.prototype.put=function(e,t,n){this.enabled&&this.store.setItem(e,this.createPersistable(t,n))},e.prototype.delete=function(e){this.enabled&&this.store.removeItem(e)},e.prototype.getOrPut=function(e,t,n){var r=this;return this.enabled?new Promise(function(i){var o=r.get(e);null==o?t().then(function(t){r.put(e,t,n),i(t)}):i(o)}):t()},e.prototype.deleteExpired=function(){var e=this;return new Promise(function(t,n){e.enabled||t();try{for(var r=0;r<e.store.length;r++){var i=e.store.key(r);null!==i&&/["|']?pnp["|']? ?: ?1/i.test(e.store.getItem(i))&&e.get(i)}t()}catch(e){n(e)}})},e.prototype.test=function(){try{return this.store.setItem("test","test"),this.store.removeItem("test"),!0}catch(e){return!1}},e.prototype.createPersistable=function(e,t){if(void 0===t){var n=R.defaultCachingTimeoutSeconds;this.defaultTimeoutMinutes>0&&(n=60*this.defaultTimeoutMinutes),t=i(new Date,"second",n)}return JSON.stringify({pnp:1,expiration:t,value:e})},e.prototype.cacheExpirationHandler=function(){var e=this;S.a.write("Called cache expiration handler.",0),this.deleteExpired().then(function(t){setTimeout(r(e,e.cacheExpirationHandler),R.cacheExpirationIntervalMilliseconds)}).catch(function(e){S.a.log({data:e,level:3,message:"Error deleting expired cache entries, see data for details. Timeout not reset."})})},e}(),I=function(){function e(e){void 0===e&&(e=new N),this._store=e}return Object.defineProperty(e.prototype,"length",{get:function(){return this._store.count},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 this._store.getKeys()[e]},e.prototype.removeItem=function(e){this._store.remove(e)},e.prototype.setItem=function(e,t){this._store.add(e,t)},e}(),w=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=new y("undefined"!=typeof localStorage?localStorage:new I)),this._local},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"session",{get:function(){return null===this._session&&(this._session=new y("undefined"!=typeof sessionStorage?sessionStorage:new I)),this._session},enumerable:!0,configurable:!0}),e}()}).call(t,n(9))},function(e,t,n){"use strict";function r(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function i(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}t.b=r,t.a=i;/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.

@@ -37,3 +37,3 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use

@license
* @pnp/logging v1.0.4-2 - pnp - light-weight, subscribable logging framework
* @pnp/logging v1.0.4-3 - pnp - light-weight, subscribable logging framework
* MIT (https://github.com/pnp/pnp/blob/master/LICENSE)

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

*/
var 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 i),e._instance},enumerable:!0,configurable:!0}),e.subscribe=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];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,n){void 0===n&&(n=0),e.instance.log({level:n,message:t})},e.writeJSON=function(t,n){void 0===n&&(n=0),e.instance.log({level:n,message:JSON.stringify(t)})},e.log=function(t){e.instance.log(t)},e.error=function(t){e.instance.log({data:t,level:3,message:t.message})},e}(),i=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=0),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(){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,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return o});var r=n(0),i=function(){function e(e){this.key=e,this.expiration=r.d.dateAdd(new Date,"second",r.c.defaultCachingTimeoutSeconds),this.storeName=r.c.defaultCachingStore}return Object.defineProperty(e.prototype,"store",{get:function(){return"local"===this.storeName?e.storage.local:e.storage.session},enumerable:!0,configurable:!0}),e.storage=new r.b,e}(),o=function(){function e(e,t){this._parser=e,this._cacheOptions=t}return e.prototype.parse=function(e){var t=this;return this._parser.parse(e).then(function(e){return null!==t._cacheOptions.store&&t._cacheOptions.store.put(t._cacheOptions.key,e,t._cacheOptions.expiration),e})},e}()},function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var r=n(1),i=n(2),o=function(e){function t(t,n,r){var o=e.call(this,"Error making HttpClient request in queryable: ["+t+"] "+n)||this;return o.status=t,o.statusText=n,o.data=r,o.name="ProcessHttpClientResponseException",i.a.log({data:o.data,level:3,message:o.message}),o}return r.b(t,e),t}(Error),s=function(){function e(){}return e.prototype.parse=function(e){var t=this;return new Promise(function(n,r){t.handleError(e,r)&&e.text().then(function(e){return e.replace(/\s/gi,"").length>0?JSON.parse(e):{}}).then(function(e){return n(t.parseODataJSON(e))}).catch(function(e){return r(e)})})},e.prototype.handleError=function(e,t){return e.ok||e.json().then(function(n){var r={responseBody:n,responseHeaders:e.headers};t(new o(e.status,e.statusText,r))}).catch(function(n){i.a.log({data:n,level:2,message:"There was an error parsing the error response body. See data for details."});var r={responseBody:"[[body not available]]",responseHeaders:e.headers};t(new o(e.status,e.statusText,r))}),e.ok},e.prototype.parseODataJSON=function(e){var t=e;return e.hasOwnProperty("d")?t=e.d.hasOwnProperty("results")?e.d.results:e.d:e.hasOwnProperty("value")&&(t=e.value),t},e}()},function(e,t,n){"use strict";n.d(t,"d",function(){return s}),n.d(t,"e",function(){return a}),n.d(t,"a",function(){return u}),n.d(t,"c",function(){return c}),n.d(t,"b",function(){return h});var r=n(1),i=n(4),o=n(0),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.b(t,e),t}(i.a),a=function(){function e(){}return e.prototype.parse=function(e){return e.text()},e}(),u=function(){function e(){}return e.prototype.parse=function(e){return e.blob()},e}(),c=function(){function e(){}return e.prototype.parse=function(e){return e.json()},e}(),h=function(){function e(){}return e.prototype.parse=function(e){return o.d.isFunc(e.arrayBuffer)?e.arrayBuffer():e.buffer()},e}()},function(e,t,n){"use strict";function r(e){return l.a.log({data:e.result,level:0,message:"["+e.requestId+"] ("+(new Date).getTime()+") Returning result, see data property for value."}),Promise.resolve(e.result||null)}function i(e,t){return new Promise(function(n){e.result=t,e.hasResult=!0,n(e)})}function o(e){return e.pipeline.length>0?e.pipeline.shift()(e):Promise.resolve(e)}function s(e){return e.pipeline.length<1&&l.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Request pipeline contains no methods!",2),o(e).then(function(e){return r(e)}).catch(function(e){throw l.a.error(e),e})}function a(e){return void 0===e&&(e=!1),function(t,n,r){var i=r.value;r.value=function(){for(var r=[],s=0;s<arguments.length;s++)r[s]=arguments[s];return!e&&r.length>0&&r[0].hasOwnProperty("hasResult")&&r[0].hasResult?(l.a.write("["+r[0].requestId+"] ("+(new Date).getTime()+") Skipping request pipeline method "+n+", existing result in pipeline.",0),Promise.resolve(r[0])):(l.a.write("["+r[0].requestId+"] ("+(new Date).getTime()+") Calling request pipeline method "+n+".",0),i.apply(t,r).then(function(e){return o(e)}))}}}function u(){return[d.logStart,d.caching,d.send,d.logEnd].slice(0)}t.e=i,t.c=s,t.d=a,n.d(t,"a",function(){return d}),t.b=u;var c=n(1),h=n(3),l=n(2),p=n(0),d=function(){function e(){}return e.logStart=function(e){return new Promise(function(t){l.a.log({data:1===l.a.activeLogLevel?{}:e,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") Beginning "+e.verb+" request ("+e.requestAbsoluteUrl+")"}),t(e)})},e.caching=function(e){return new Promise(function(t){if("GET"===e.verb&&e.isCached){l.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Caching is enabled for request, checking cache...",1);var n=new h.a(e.requestAbsoluteUrl.toLowerCase());if(void 0!==e.cachingOptions&&(n=p.d.extend(n,e.cachingOptions)),null!==n.store){var r=n.store.get(n.key);if(null!==r)return l.a.log({data:1===l.a.activeLogLevel?{}:r,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") Value returned from cache."}),e.batchDependency(),e.parser.hasOwnProperty("hydrate")&&(r=e.parser.hydrate(r)),i(e,r).then(function(e){return t(e)})}l.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Value not found in cache.",1),e.parser=new h.b(e.parser,n)}return t(e)})},e.send=function(e){return new Promise(function(t,n){if(e.isBatched){var r=e.batch.add(e.requestAbsoluteUrl,e.verb,e.options,e.parser);e.batchDependency(),l.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Batching request in batch "+e.batch.batchId+".",1),t(i(e,r))}else{l.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Sending request.",1);var o=e.clientFactory(),s=p.d.extend(e.options||{},{method:e.verb});o.fetch(e.requestAbsoluteUrl,s).then(function(t){return e.parser.parse(t)}).then(function(t){return i(e,t)}).then(function(e){return t(e)}).catch(function(e){return n(e)})}})},e.logEnd=function(e){return new Promise(function(t){e.isBatched?l.a.log({data:1===l.a.activeLogLevel?{}:e,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") "+e.verb+" request will complete in batch "+e.batch.batchId+"."}):l.a.log({data:1===l.a.activeLogLevel?{}:e,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") Completing "+e.verb+" request."}),t(e)})},c.a([a(!0)],e,"logStart",null),c.a([a()],e,"caching",null),c.a([a()],e,"send",null),c.a([a(!0)],e,"logEnd",null),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8);n.d(t,"CachingOptions",function(){return r.d}),n.d(t,"CachingParserWrapper",function(){return r.e}),n.d(t,"ProcessHttpClientResponseException",function(){return r.l}),n.d(t,"ODataParserBase",function(){return r.i}),n.d(t,"ODataDefaultParser",function(){return r.h}),n.d(t,"TextParser",function(){return r.n}),n.d(t,"BlobParser",function(){return r.b}),n.d(t,"JSONParser",function(){return r.f}),n.d(t,"BufferParser",function(){return r.c}),n.d(t,"setResult",function(){return r.r}),n.d(t,"pipe",function(){return r.p}),n.d(t,"requestPipelineMethod",function(){return r.q}),n.d(t,"PipelineMethods",function(){return r.k}),n.d(t,"getDefaultPipeline",function(){return r.o}),n.d(t,"AlreadyInBatchException",function(){return r.a}),n.d(t,"Queryable",function(){return r.m}),n.d(t,"ODataQueryable",function(){return r.j}),n.d(t,"ODataBatch",function(){return r.g})},function(e,t,n){"use strict";var r=n(3);n.d(t,"d",function(){return r.a}),n.d(t,"e",function(){return r.b});var i=n(4);n.d(t,"i",function(){return i.a}),n.d(t,"l",function(){return i.b});var o=n(5);n.d(t,"b",function(){return o.a}),n.d(t,"c",function(){return o.b}),n.d(t,"f",function(){return o.c}),n.d(t,"h",function(){return o.d}),n.d(t,"n",function(){return o.e});var s=n(6);n.d(t,"k",function(){return s.a}),n.d(t,"o",function(){return s.b}),n.d(t,"p",function(){return s.c}),n.d(t,"q",function(){return s.d}),n.d(t,"r",function(){return s.e});var a=n(11);n.d(t,"a",function(){return a.a}),n.d(t,"j",function(){return a.b}),n.d(t,"m",function(){return a.c});var u=n(12);n.d(t,"g",function(){return u.a})},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){
var 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 i),e._instance},enumerable:!0,configurable:!0}),e.subscribe=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];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,n){void 0===n&&(n=0),e.instance.log({level:n,message:t})},e.writeJSON=function(t,n){void 0===n&&(n=0),e.instance.log({level:n,message:JSON.stringify(t)})},e.log=function(t){e.instance.log(t)},e.error=function(t){e.instance.log({data:t,level:3,message:t.message})},e}(),i=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=0),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(){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,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return o});var r=n(0),i=function(){function e(e){this.key=e,this.expiration=Object(r.e)(new Date,"second",r.c.defaultCachingTimeoutSeconds),this.storeName=r.c.defaultCachingStore}return Object.defineProperty(e.prototype,"store",{get:function(){return"local"===this.storeName?e.storage.local:e.storage.session},enumerable:!0,configurable:!0}),e.storage=new r.b,e}(),o=function(){function e(e,t){this._parser=e,this._cacheOptions=t}return e.prototype.parse=function(e){var t=this;return this._parser.parse(e).then(function(e){return null!==t._cacheOptions.store&&t._cacheOptions.store.put(t._cacheOptions.key,e,t._cacheOptions.expiration),e})},e}()},function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var r=n(1),i=n(2),o=function(e){function t(t,n,r){var o=e.call(this,"Error making HttpClient request in queryable: ["+t+"] "+n)||this;return o.status=t,o.statusText=n,o.data=r,o.name="ProcessHttpClientResponseException",i.a.log({data:o.data,level:3,message:o.message}),o}return r.b(t,e),t}(Error),s=function(){function e(){}return e.prototype.parse=function(e){var t=this;return new Promise(function(n,r){t.handleError(e,r)&&e.text().then(function(e){return e.replace(/\s/gi,"").length>0?JSON.parse(e):{}}).then(function(e){return n(t.parseODataJSON(e))}).catch(function(e){return r(e)})})},e.prototype.handleError=function(e,t){return e.ok||e.json().then(function(n){var r={responseBody:n,responseHeaders:e.headers};t(new o(e.status,e.statusText,r))}).catch(function(n){i.a.log({data:n,level:2,message:"There was an error parsing the error response body. See data for details."});var r={responseBody:"[[body not available]]",responseHeaders:e.headers};t(new o(e.status,e.statusText,r))}),e.ok},e.prototype.parseODataJSON=function(e){var t=e;return e.hasOwnProperty("d")?t=e.d.hasOwnProperty("results")?e.d.results:e.d:e.hasOwnProperty("value")&&(t=e.value),t},e}()},function(e,t,n){"use strict";n.d(t,"d",function(){return s}),n.d(t,"e",function(){return a}),n.d(t,"a",function(){return c}),n.d(t,"c",function(){return u}),n.d(t,"b",function(){return h});var r=n(1),i=n(4),o=n(0),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.b(t,e),t}(i.a),a=function(){function e(){}return e.prototype.parse=function(e){return e.text()},e}(),c=function(){function e(){}return e.prototype.parse=function(e){return e.blob()},e}(),u=function(){function e(){}return e.prototype.parse=function(e){return e.json()},e}(),h=function(){function e(){}return e.prototype.parse=function(e){return Object(o.h)(e.arrayBuffer)?e.arrayBuffer():e.buffer()},e}()},function(e,t,n){"use strict";function r(e){return l.a.log({data:e.result,level:0,message:"["+e.requestId+"] ("+(new Date).getTime()+") Returning result, see data property for value."}),Promise.resolve(e.result||null)}function i(e,t){return new Promise(function(n){e.result=t,e.hasResult=!0,n(e)})}function o(e){return e.pipeline.length>0?e.pipeline.shift()(e):Promise.resolve(e)}function s(e){return e.pipeline.length<1&&l.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Request pipeline contains no methods!",2),o(e).then(function(e){return r(e)}).catch(function(e){throw l.a.error(e),e})}function a(e){return void 0===e&&(e=!1),function(t,n,r){var i=r.value;r.value=function(){for(var r=[],s=0;s<arguments.length;s++)r[s]=arguments[s];return!e&&r.length>0&&r[0].hasOwnProperty("hasResult")&&r[0].hasResult?(l.a.write("["+r[0].requestId+"] ("+(new Date).getTime()+") Skipping request pipeline method "+n+", existing result in pipeline.",0),Promise.resolve(r[0])):(l.a.write("["+r[0].requestId+"] ("+(new Date).getTime()+") Calling request pipeline method "+n+".",0),i.apply(t,r).then(function(e){return o(e)}))}}}function c(){return[d.logStart,d.caching,d.send,d.logEnd].slice(0)}t.e=i,t.c=s,t.d=a,n.d(t,"a",function(){return d}),t.b=c;var u=n(1),h=n(3),l=n(2),p=n(0),d=function(){function e(){}return e.logStart=function(e){return new Promise(function(t){l.a.log({data:1===l.a.activeLogLevel?{}:e,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") Beginning "+e.verb+" request ("+e.requestAbsoluteUrl+")"}),t(e)})},e.caching=function(e){return new Promise(function(t){if("GET"===e.verb&&e.isCached){l.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Caching is enabled for request, checking cache...",1);var n=new h.a(e.requestAbsoluteUrl.toLowerCase());if(void 0!==e.cachingOptions&&(n=Object(p.f)(n,e.cachingOptions)),null!==n.store){var r=n.store.get(n.key);if(null!==r)return l.a.log({data:1===l.a.activeLogLevel?{}:r,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") Value returned from cache."}),Object(p.h)(e.batchDependency)&&e.batchDependency(),e.parser.hasOwnProperty("hydrate")&&(r=e.parser.hydrate(r)),i(e,r).then(function(e){return t(e)})}l.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Value not found in cache.",1),e.parser=new h.b(e.parser,n)}return t(e)})},e.send=function(e){return new Promise(function(t,n){if(e.isBatched){var r=e.batch.add(e.requestAbsoluteUrl,e.verb,e.options,e.parser);Object(p.h)(e.batchDependency)&&e.batchDependency(),l.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Batching request in batch "+e.batch.batchId+".",1),t(i(e,r))}else{l.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Sending request.",1);var o=e.clientFactory(),s=Object(p.f)(e.options||{},{method:e.verb});o.fetch(e.requestAbsoluteUrl,s).then(function(t){return e.parser.parse(t)}).then(function(t){return i(e,t)}).then(function(e){return t(e)}).catch(function(e){return n(e)})}})},e.logEnd=function(e){return new Promise(function(t){e.isBatched?l.a.log({data:1===l.a.activeLogLevel?{}:e,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") "+e.verb+" request will complete in batch "+e.batch.batchId+"."}):l.a.log({data:1===l.a.activeLogLevel?{}:e,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") Completing "+e.verb+" request."}),t(e)})},u.a([a(!0)],e,"logStart",null),u.a([a()],e,"caching",null),u.a([a()],e,"send",null),u.a([a(!0)],e,"logEnd",null),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8);n.d(t,"CachingOptions",function(){return r.d}),n.d(t,"CachingParserWrapper",function(){return r.e}),n.d(t,"ProcessHttpClientResponseException",function(){return r.l}),n.d(t,"ODataParserBase",function(){return r.i}),n.d(t,"ODataDefaultParser",function(){return r.h}),n.d(t,"TextParser",function(){return r.n}),n.d(t,"BlobParser",function(){return r.b}),n.d(t,"JSONParser",function(){return r.f}),n.d(t,"BufferParser",function(){return r.c}),n.d(t,"setResult",function(){return r.r}),n.d(t,"pipe",function(){return r.p}),n.d(t,"requestPipelineMethod",function(){return r.q}),n.d(t,"PipelineMethods",function(){return r.k}),n.d(t,"getDefaultPipeline",function(){return r.o}),n.d(t,"AlreadyInBatchException",function(){return r.a}),n.d(t,"Queryable",function(){return r.m}),n.d(t,"ODataQueryable",function(){return r.j}),n.d(t,"ODataBatch",function(){return r.g})},function(e,t,n){"use strict";var r=n(3);n.d(t,"d",function(){return r.a}),n.d(t,"e",function(){return r.b});var i=n(4);n.d(t,"i",function(){return i.a}),n.d(t,"l",function(){return i.b});var o=n(5);n.d(t,"b",function(){return o.a}),n.d(t,"c",function(){return o.b}),n.d(t,"f",function(){return o.c}),n.d(t,"h",function(){return o.d}),n.d(t,"n",function(){return o.e});var s=n(6);n.d(t,"k",function(){return s.a}),n.d(t,"o",function(){return s.b}),n.d(t,"p",function(){return s.c}),n.d(t,"q",function(){return s.d}),n.d(t,"r",function(){return s.e});var a=n(11);n.d(t,"a",function(){return a.a}),n.d(t,"j",function(){return a.b}),n.d(t,"m",function(){return a.c});var c=n(12);n.d(t,"g",function(){return c.a})},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){
// @preserve Copyright (c) Microsoft Open Technologies, Inc.
var n=function(){"use strict";return n=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},n.prototype._singletonInstance)return n.prototype._singletonInstance;if(n.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){}}),n.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 n=this._getNavigateUrl("id_token",null)+"&nonce="+encodeURIComponent(this._idTokenNonce);this.config.displayCall?this.config.displayCall(n):this.popUp?(this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN,""),this._renewStates.push(e),this.registerCallback(e,this.config.clientId,this.callback),this._loginPopup(n)):this.promptUser(n)},n.prototype._openPopup=function(e,t,n,r){try{var i=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,u=s/2-n/2+i,c=a/2-r/2+o,h=window.open(e,t,"width="+n+", height="+r+", top="+c+", left="+u);return h.focus&&h.focus(),h}catch(e){return this.warn("Error opening popup, "+e.message),this._loginInProgress=!1,this._acquireTokenInProgress=!1,null}},n.prototype._handlePopupError=function(e,t,n,r,i){this.warn(r),this._saveItem(this.CONSTANTS.STORAGE.ERROR,n),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,r),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,i),t&&this._activeRenewals[t]&&(this._activeRenewals[t]=null),this._loginInProgress=!1,this._acquireTokenInProgress=!1,e&&e(r,null,n)},n.prototype._loginPopup=function(e,t,n){var r=this._openPopup(e,"login",this.CONSTANTS.POPUP_WIDTH,this.CONSTANTS.POPUP_HEIGHT),i=n||this.callback;if(null==r){var o="Popup Window is null. This can happen if you are using IE";return void this._handlePopupError(i,t,"Error opening popup",o,o)}if(this._openedWindows.push(r),-1!=this.config.redirectUri.indexOf("#"))var s=this.config.redirectUri.split("#")[0];else var s=this.config.redirectUri;var a=this,u=window.setInterval(function(){if(!r||r.closed||void 0===r.closed){var e="Popup Window closed",n="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",n+a.CONSTANTS.RESOURCE_DELIMETER+e),a._handlePopupError(i,t,e,n,n),void window.clearInterval(u)}try{var o=r.location;if(-1!=encodeURI(o.href).indexOf(encodeURI(s)))return a.isAngular?a._broadcast("adal:popUpHashChanged",o.hash):a.handleWindowCallback(o.hash),window.clearInterval(u),a._loginInProgress=!1,a._acquireTokenInProgress=!1,a.info("Closing popup window"),a._openedWindows=[],void r.close()}catch(e){}},1)},n.prototype._broadcast=function(e,t){!function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}if("function"==typeof window.CustomEvent)return!1;e.prototype=window.Event.prototype,window.CustomEvent=e}();var n=new CustomEvent(e,{detail:t});window.dispatchEvent(n)},n.prototype.loginInProgress=function(){return this._loginInProgress},n.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},n.prototype.getCachedToken=function(e){if(!this._hasResource(e))return null;var t=this._getItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+e),n=this._getItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+e),r=this.config.expireOffsetSeconds||300;return n&&n>this._now()+r?t:(this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+e,""),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+e,0),null)},n.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},n.prototype.registerCallback=function(e,t,n){this._activeRenewals[t]=e,this._callBacksMappedToRenewStates[e]||(this._callBacksMappedToRenewStates[e]=[]);var r=this;this._callBacksMappedToRenewStates[e].push(n),this._callBackMappedToRenewStates[e]||(this._callBackMappedToRenewStates[e]=function(n,i,o,s){r._activeRenewals[t]=null;for(var a=0;a<r._callBacksMappedToRenewStates[e].length;++a)try{r._callBacksMappedToRenewStates[e][a](n,i,o,s)}catch(o){r.warn(o)}r._callBacksMappedToRenewStates[e]=null,r._callBackMappedToRenewStates[e]=null})},n.prototype._renewToken=function(e,t,n){this.info("renewToken is called for resource:"+e);var r=this._addAdalFrame("adalRenewFrame"+e),i=this._guid()+"|"+e;this.config.state=i,this._renewStates.push(i),this.verbose("Renew token Expected state: "+i),n=n||"token";var o=this._urlRemoveQueryStringParameter(this._getNavigateUrl(n,e),"prompt");n===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(i,e,t),this.verbosePii("Navigate to:"+o),r.src="about:blank",this._loadFrameTimeout(o,"adalRenewFrame"+e,e)},n.prototype._renewIdToken=function(e,t){this.info("renewIdToken is called");var n=this._addAdalFrame("adalIdTokenFrame"),r=this._guid()+"|"+this.config.clientId;this._idTokenNonce=this._guid(),this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,this._idTokenNonce,!0),this.config.state=r,this._renewStates.push(r),this.verbose("Renew Idtoken Expected state: "+r);var i=null===t||void 0===t?null:this.config.clientId,t=t||"id_token",o=this._urlRemoveQueryStringParameter(this._getNavigateUrl(t,i),"prompt");o+="&prompt=none",o=this._addHintParameters(o),o+="&nonce="+encodeURIComponent(this._idTokenNonce),this.registerCallback(r,this.config.clientId,e),this.verbosePii("Navigate to:"+o),n.src="about:blank",this._loadFrameTimeout(o,"adalIdTokenFrame",this.config.clientId)},n.prototype._urlContainsQueryStringParameter=function(e,t){return new RegExp("[\\?&]"+e+"=").test(t)},n.prototype._urlRemoveQueryStringParameter=function(e,t){var n=new RegExp("(\\&"+t+"=)[^&]+");return e=e.replace(n,""),n=new RegExp("("+t+"=)[^&]+&"),e=e.replace(n,""),n=new RegExp("("+t+"=)[^&]+"),e=e.replace(n,"")},n.prototype._loadFrameTimeout=function(e,t,n){this.verbose("Set loading state to pending for: "+n),this._saveItem(this.CONSTANTS.STORAGE.RENEW_STATUS+n,this.CONSTANTS.TOKEN_RENEW_STATUS_IN_PROGRESS),this._loadFrame(e,t);var r=this;setTimeout(function(){if(r._getItem(r.CONSTANTS.STORAGE.RENEW_STATUS+n)===r.CONSTANTS.TOKEN_RENEW_STATUS_IN_PROGRESS){r.verbose("Loading frame has timed out after: "+r.CONSTANTS.LOADFRAME_TIMEOUT/1e3+" seconds for resource "+n);var e=r._activeRenewals[n];e&&r._callBackMappedToRenewStates[e]&&r._callBackMappedToRenewStates[e]("Token renewal operation failed due to timeout",null,"Token Renewal Failed"),r._saveItem(r.CONSTANTS.STORAGE.RENEW_STATUS+n,r.CONSTANTS.TOKEN_RENEW_STATUS_CANCELED)}},r.CONSTANTS.LOADFRAME_TIMEOUT)},n.prototype._loadFrame=function(e,t){var n=this;n.info("LoadFrame: "+t);var r=t;setTimeout(function(){var t=n._addAdalFrame(r);""!==t.src&&"about:blank"!==t.src||(t.src=e,n._loadFrame(e,r))},500)},n.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 n=this.getCachedToken(e);return n?(this.info("Token is already in cache for resource:"+e),void t(null,n,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"))},n.prototype.acquireTokenPopup=function(e,t,n,r){if(this._isEmpty(e))return this.warn("resource is required"),void r("resource is required",null,"resource is required");if(!this._user)return this.warn("User login is required"),void r("User login is required",null,"login required");if(this._acquireTokenInProgress)return this.warn("Acquire token interactive is already in progress"),void r("Acquire token interactive is already in progress",null,"Acquire token interactive is already in progress");var i=this._guid()+"|"+e;this.config.state=i,this._renewStates.push(i),this._requestType=this.REQUEST_TYPE.RENEW_TOKEN,this.verbose("Renew token Expected state: "+i);var o=this._urlRemoveQueryStringParameter(this._getNavigateUrl("token",e),"prompt");if(o+="&prompt=select_account",t&&(o+=t),n&&-1===o.indexOf("&claims"))o+="&claims="+encodeURIComponent(n);else if(n&&-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(i,e,r),this._loginPopup(o,e,r)},n.prototype.acquireTokenRedirect=function(e,t,n){if(this._isEmpty(e))return this.warn("resource is required"),void r("resource is required",null,"resource is required");var r=this.callback;if(!this._user)return this.warn("User login is required"),void r("User login is required",null,"login required");if(this._acquireTokenInProgress)return this.warn("Acquire token interactive is already in progress"),void r("Acquire token interactive is already in progress",null,"Acquire token interactive is already in progress");var i=this._guid()+"|"+e;this.config.state=i,this.verbose("Renew token Expected state: "+i);var o=this._urlRemoveQueryStringParameter(this._getNavigateUrl("token",e),"prompt");if(o+="&prompt=select_account",t&&(o+=t),n&&-1===o.indexOf("&claims"))o+="&claims="+encodeURIComponent(n);else if(n&&-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,i,!0),this.promptUser(o)},n.prototype.promptUser=function(e){e?(this.infoPii("Navigate to:"+e),window.location.replace(e)):this.info("Navigate url is empty")},n.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,"")},n.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))},n.prototype.logOut=function(){this.clearCache(),this._user=null;var e;if(this.config.logOutUri)e=this.config.logOutUri;else{var t="common",n="";this.config.tenant&&(t=this.config.tenant),this.config.postLogoutRedirectUri&&(n="post_logout_redirect_uri="+encodeURIComponent(this.config.postLogoutRedirectUri)),e=this.instance+t+"/oauth2/logout?"+n}this.infoPii("Logout navigate to: "+e),this.promptUser(e)},n.prototype._isEmpty=function(e){return void 0===e||!e||0===e.length},n.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))},n.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},n.prototype._createUser=function(e){var t=null,n=this._extractIdToken(e);return n&&n.hasOwnProperty("aud")&&(n.aud.toLowerCase()===this.config.clientId.toLowerCase()?(t={userName:"",profile:n},n.hasOwnProperty("upn")?t.userName=n.upn:n.hasOwnProperty("email")&&(t.userName=n.email)):this.warn("IdToken has invalid aud field")),t},n.prototype._getHash=function(e){return e.indexOf("#/")>-1?e=e.substring(e.indexOf("#/")+2):e.indexOf("#")>-1&&(e=e.substring(1)),e},n.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)},n.prototype.getLoginError=function(){return this._getItem(this.CONSTANTS.STORAGE.LOGIN_ERROR)},n.prototype.getRequestInfo=function(e){e=this._getHash(e);var t=this._deserialize(e),n={valid:!1,parameters:{},stateMatch:!1,stateResponse:"",requestType:this.REQUEST_TYPE.UNKNOWN};if(t&&(n.parameters=t,t.hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION)||t.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)||t.hasOwnProperty(this.CONSTANTS.ID_TOKEN))){n.valid=!0;var r="";if(!t.hasOwnProperty("state"))return this.warn("No state returned"),n;if(this.verbose("State: "+t.state),r=t.state,n.stateResponse=r,this._matchState(n))return n;if(!n.stateMatch&&window.parent){n.requestType=this._requestType;for(var i=this._renewStates,o=0;o<i.length;o++)if(i[o]===n.stateResponse){n.stateMatch=!0;break}}}return n},n.prototype._matchNonce=function(e){var t=this._getItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN);if(t){t=t.split(this.CONSTANTS.CACHE_DELIMETER);for(var n=0;n<t.length;n++)if(t[n]===e.profile.nonce)return!0}return!1},n.prototype._matchState=function(e){var t=this._getItem(this.CONSTANTS.STORAGE.STATE_LOGIN);if(t){t=t.split(this.CONSTANTS.CACHE_DELIMETER);for(var n=0;n<t.length;n++)if(t[n]===e.stateResponse)return e.requestType=this.REQUEST_TYPE.LOGIN,e.stateMatch=!0,!0}var r=this._getItem(this.CONSTANTS.STORAGE.STATE_RENEW);if(r){r=r.split(this.CONSTANTS.CACHE_DELIMETER);for(var n=0;n<r.length;n++)if(r[n]===e.stateResponse)return e.requestType=this.REQUEST_TYPE.RENEW_TOKEN,e.stateMatch=!0,!0}return!1},n.prototype._getResourceFromState=function(e){if(e){var t=e.indexOf("|");if(t>-1&&t+1<e.length)return e.substring(t+1)}return""},n.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 n;e.parameters.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)&&(this.info("Fragment has access token"),this._hasResource(t)||(n=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS)||"",this._saveItem(this.CONSTANTS.STORAGE.TOKEN_KEYS,n+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)||(n=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS)||"",this._saveItem(this.CONSTANTS.STORAGE.TOKEN_KEYS,n+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)},n.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 n in this.config.endpoints)if(e.indexOf(n)>-1)return this.config.endpoints[n];return e.indexOf("http://")>-1||e.indexOf("https://")>-1?this._getHostFromUri(e)===this._getHostFromUri(this.config.redirectUri)?this.config.loginResource:null:this.config.loginResource},n.prototype._getHostFromUri=function(e){var t=String(e).replace(/^(https?:)\/\//,"");return t=t.split("/")[0]},n.prototype.handleWindowCallback=function(e){if(null==e&&(e=window.location.hash),this.isCallback(e)){var t=null,n=!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,n=!0):window.parent&&window.parent._adalInstance&&(t=window.parent._adalInstance);var r,i,o=t.getRequestInfo(e),s=null;i=n||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"),r=o.parameters[t.CONSTANTS.ACCESS_TOKEN]||o.parameters[t.CONSTANTS.ID_TOKEN],s=t.CONSTANTS.ACCESS_TOKEN):o.requestType===this.REQUEST_TYPE.LOGIN&&(r=o.parameters[t.CONSTANTS.ID_TOKEN],s=t.CONSTANTS.ID_TOKEN);var a=o.parameters[t.CONSTANTS.ERROR_DESCRIPTION],u=o.parameters[t.CONSTANTS.ERROR];try{i&&i(a,r,u,s)}catch(e){t.error("Error occurred in user defined callback function: "+e)}window.parent!==window||n||(t.config.navigateToLoginRequestUrl?window.location.href=t._getItem(t.CONSTANTS.STORAGE.LOGIN_REQUEST):window.location.hash="")}},n.prototype._getNavigateUrl=function(e,t){var n="common";this.config.tenant&&(n=this.config.tenant);var r=this.instance+n+"/oauth2/authorize"+this._serialize(e,this.config,t)+this._addLibMetadata();return this.info("Navigate url:"+r),r},n.prototype._extractIdToken=function(e){var t=this._decodeJwt(e);if(!t)return null;try{var n=t.JWSPayload,r=this._base64DecodeStringUrlSafe(n);return r?JSON.parse(r):(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},n.prototype._base64DecodeStringUrlSafe=function(e){return e=e.replace(/-/g,"+").replace(/_/g,"/"),window.atob?decodeURIComponent(escape(window.atob(e))):decodeURIComponent(escape(this._decode(e)))},n.prototype._decode=function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e=String(e).replace(/=+$/,"");var n=e.length;if(n%4==1)throw new Error("The token to be decoded is not correctly encoded.");for(var r,i,o,s,a,u,c,h,l="",p=0;p<n;p+=4){if(r=t.indexOf(e.charAt(p)),i=t.indexOf(e.charAt(p+1)),o=t.indexOf(e.charAt(p+2)),s=t.indexOf(e.charAt(p+3)),p+2===n-1){a=r<<18|i<<12|o<<6,u=a>>16&255,c=a>>8&255,l+=String.fromCharCode(u,c);break}if(p+1===n-1){a=r<<18|i<<12,u=a>>16&255,l+=String.fromCharCode(u);break}a=r<<18|i<<12|o<<6|s,u=a>>16&255,c=a>>8&255,h=255&a,l+=String.fromCharCode(u,c,h)}return l},n.prototype._decodeJwt=function(e){if(this._isEmpty(e))return null;var t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/,n=t.exec(e);return!n||n.length<4?(this.warn("The returned id_token is not parseable."),null):{header:n[1],JWSPayload:n[2],JWSSig:n[3]}},n.prototype._convertUrlSafeToRegularBase64EncodedString=function(e){return e.replace("-","+").replace("_","/")},n.prototype._serialize=function(e,t,n){var r=[];if(null!==t){r.push("?response_type="+e),r.push("client_id="+encodeURIComponent(t.clientId)),n&&r.push("resource="+encodeURIComponent(n)),r.push("redirect_uri="+encodeURIComponent(t.redirectUri)),r.push("state="+encodeURIComponent(t.state)),t.hasOwnProperty("slice")&&r.push("slice="+encodeURIComponent(t.slice)),t.hasOwnProperty("extraQueryParameter")&&r.push(t.extraQueryParameter);var i=t.correlationId?t.correlationId:this._guid();r.push("client-request-id="+encodeURIComponent(i))}return r.join("&")},n.prototype._deserialize=function(e){var t,n=/\+/g,r=/([^&=]+)=([^&]*)/g,i=function(e){return decodeURIComponent(e.replace(n," "))},o={};for(t=r.exec(e);t;)o[i(t[1])]=i(t[2]),t=r.exec(e);return o},n.prototype._decimalToHex=function(e){for(var t=e.toString(16);t.length<2;)t="0"+t;return t},n.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 n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",r="0123456789abcdef",i=0,o="",s=0;s<36;s++)"-"!==n[s]&&"4"!==n[s]&&(i=16*Math.random()|0),"x"===n[s]?o+=r[i]:"y"===n[s]?(i&=3,i|=8,o+=r[i]):o+=n[s];return o},n.prototype._expiresIn=function(e){return e||(e=3599),this._now()+parseInt(e,10)},n.prototype._now=function(){return Math.round((new Date).getTime()/1e3)},n.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 n=document.createElement("iframe");n.setAttribute("id",e),n.setAttribute("aria-hidden","true"),n.style.visibility="hidden",n.style.position="absolute",n.style.width=n.style.height=n.borderWidth="0px",t=document.getElementsByTagName("body")[0].appendChild(n)}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}},n.prototype._saveItem=function(e,t,n){if(this.config&&this.config.cacheLocation&&"localStorage"===this.config.cacheLocation){if(!this._supportsLocalStorage())return this.info("Local storage is not supported"),!1;if(n){var r=this._getItem(e)||"";localStorage.setItem(e,r+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)},n.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)},n.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}},n.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}},n.prototype._cloneConfig=function(e){if(null===e||"object"!=typeof e)return e;var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},n.prototype._addLibMetadata=function(){return"&x-client-SKU=Js&x-client-Ver="+this._libVersion()},n.prototype.log=function(e,t,n,r){if(e<=Logging.level){if(!Logging.piiLoggingEnabled&&r)return;var i=(new Date).toUTCString(),o="";o=this.config.correlationId?i+":"+this.config.correlationId+"-"+this._libVersion()+"-"+this.CONSTANTS.LEVEL_STRING_MAP[e]+" "+t:i+":"+this._libVersion()+"-"+this.CONSTANTS.LEVEL_STRING_MAP[e]+" "+t,n&&(o+="\nstack:\n"+n.stack),Logging.log(o)}},n.prototype.error=function(e,t){this.log(this.CONSTANTS.LOGGING_LEVEL.ERROR,e,t)},n.prototype.warn=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.WARN,e,null)},n.prototype.info=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.INFO,e,null)},n.prototype.verbose=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.VERBOSE,e,null)},n.prototype.errorPii=function(e,t){this.log(this.CONSTANTS.LOGGING_LEVEL.ERROR,e,t,!0)},n.prototype.warnPii=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.WARN,e,null,!0)},n.prototype.infoPii=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.INFO,e,null,!0)},n.prototype.verbosePii=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.VERBOSE,e,null,!0)},n.prototype._libVersion=function(){return"1.0.17"},void 0!==e&&e.exports&&(e.exports=n,e.exports.inject=function(e){return new n(e)}),n}()},function(e,t,n){"use strict";n.d(t,"a",function(){return u}),n.d(t,"c",function(){return c}),n.d(t,"b",function(){return h});var r=n(1),i=n(0),o=n(2),s=n(5),a=n(6),u=function(e){function t(t){void 0===t&&(t="This query is already part of a batch.");var n=e.call(this,t)||this;return n.name="AlreadyInBatchException",o.a.error(n),n}return r.b(t,e),t}(Error),c=function(){function e(){this._query=new i.a,this._options={},this._url="",this._parentUrl="",this._useCaching=!1,this._cachingOptions=null}return e.prototype.toUrl=function(){return this._url},e.prototype.concat=function(e){return this._url+=e,this},Object.defineProperty(e.prototype,"query",{get:function(){return this._query},enumerable:!0,configurable:!0}),e.prototype.configure=function(e){return Object(i.e)(this._options,e),this},e.prototype.configureFrom=function(e){return Object(i.e)(this._options,e._options),this},e.prototype.usingCaching=function(e){return i.c.globalCacheDisable||(this._useCaching=!0,void 0!==e&&(this._cachingOptions=e)),this},e.prototype.get=function(e,t){return void 0===e&&(e=new s.c),void 0===t&&(t={}),this.getCore(e,t)},e.prototype.getCore=function(e,t){return void 0===e&&(e=new s.c),void 0===t&&(t={}),this.toRequestContext("GET",t,e,Object(a.b)()).then(function(e){return Object(a.c)(e)})},e.prototype.postCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.c),this.toRequestContext("POST",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},e.prototype.patchCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.c),this.toRequestContext("PATCH",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},e.prototype.deleteCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.c),this.toRequestContext("DELETE",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},e.prototype.putCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.c),this.toRequestContext("PUT",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},e.prototype.append=function(e){this._url=i.d.combinePaths(this._url,e)},Object.defineProperty(e.prototype,"parentUrl",{get:function(){return this._parentUrl},enumerable:!0,configurable:!0}),e.prototype.extend=function(e,t){this._parentUrl=e._url,this._url=i.d.combinePaths(this._parentUrl,t),this.configureFrom(e)},e}(),h=function(e){function t(){var t=e.call(this)||this;return t._batch=null,t}return r.b(t,e),t.prototype.inBatch=function(e){if(null!==this.batch)throw new u;return this._batch=e,this},t.prototype.toUrl=function(){return this._url},t.prototype.get=function(e,t){return void 0===e&&(e=new s.d),void 0===t&&(t={}),this.getCore(e,t)},t.prototype.getCore=function(e,t){return void 0===e&&(e=new s.d),void 0===t&&(t={}),this.toRequestContext("GET",t,e,Object(a.b)()).then(function(e){return Object(a.c)(e)})},t.prototype.postCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.d),this.toRequestContext("POST",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},t.prototype.patchCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.d),this.toRequestContext("PATCH",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},t.prototype.deleteCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.d),this.toRequestContext("DELETE",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},t.prototype.putCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.d),this.toRequestContext("PUT",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},t.prototype.addBatchDependency=function(){return null!==this._batch?this._batch.addDependency():function(){return null}},Object.defineProperty(t.prototype,"hasBatch",{get:function(){return i.d.objectDefinedNotNull(this._batch)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"batch",{get:function(){return this.hasBatch?this._batch:null},enumerable:!0,configurable:!0}),t}(c)},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(0),i=function(){function e(e){void 0===e&&(e=r.d.getGUID()),this._batchId=e,this._requests=[],this._dependencies=[]}return Object.defineProperty(e.prototype,"batchId",{get:function(){return this._batchId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"requests",{get:function(){return this._requests},enumerable:!0,configurable:!0}),e.prototype.add=function(e,t,n,r){var i={method:t.toUpperCase(),options:n,parser:r,reject:null,resolve:null,url:e},o=new Promise(function(e,t){i.resolve=e,i.reject=t});return this._requests.push(i),o},e.prototype.addDependency=function(){var e=function(){},t=new Promise(function(t){e=t});return this._dependencies.push(t),e},e.prototype.execute=function(){var e=this;return Promise.all(this._dependencies).then(function(){return Promise.all(e._dependencies)}).then(function(){return e.executeImpl()})},e}()}])});
var n=function(){"use strict";return n=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},n.prototype._singletonInstance)return n.prototype._singletonInstance;if(n.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){}}),n.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 n=this._getNavigateUrl("id_token",null)+"&nonce="+encodeURIComponent(this._idTokenNonce);this.config.displayCall?this.config.displayCall(n):this.popUp?(this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN,""),this._renewStates.push(e),this.registerCallback(e,this.config.clientId,this.callback),this._loginPopup(n)):this.promptUser(n)},n.prototype._openPopup=function(e,t,n,r){try{var i=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-n/2+i,u=a/2-r/2+o,h=window.open(e,t,"width="+n+", height="+r+", 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}},n.prototype._handlePopupError=function(e,t,n,r,i){this.warn(r),this._saveItem(this.CONSTANTS.STORAGE.ERROR,n),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,r),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,i),t&&this._activeRenewals[t]&&(this._activeRenewals[t]=null),this._loginInProgress=!1,this._acquireTokenInProgress=!1,e&&e(r,null,n)},n.prototype._loginPopup=function(e,t,n){var r=this._openPopup(e,"login",this.CONSTANTS.POPUP_WIDTH,this.CONSTANTS.POPUP_HEIGHT),i=n||this.callback;if(null==r){var o="Popup Window is null. This can happen if you are using IE";return void this._handlePopupError(i,t,"Error opening popup",o,o)}if(this._openedWindows.push(r),-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(!r||r.closed||void 0===r.closed){var e="Popup Window closed",n="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",n+a.CONSTANTS.RESOURCE_DELIMETER+e),a._handlePopupError(i,t,e,n,n),void window.clearInterval(c)}try{var o=r.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 r.close()}catch(e){}},1)},n.prototype._broadcast=function(e,t){!function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}if("function"==typeof window.CustomEvent)return!1;e.prototype=window.Event.prototype,window.CustomEvent=e}();var n=new CustomEvent(e,{detail:t});window.dispatchEvent(n)},n.prototype.loginInProgress=function(){return this._loginInProgress},n.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},n.prototype.getCachedToken=function(e){if(!this._hasResource(e))return null;var t=this._getItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+e),n=this._getItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+e),r=this.config.expireOffsetSeconds||300;return n&&n>this._now()+r?t:(this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+e,""),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+e,0),null)},n.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},n.prototype.registerCallback=function(e,t,n){this._activeRenewals[t]=e,this._callBacksMappedToRenewStates[e]||(this._callBacksMappedToRenewStates[e]=[]);var r=this;this._callBacksMappedToRenewStates[e].push(n),this._callBackMappedToRenewStates[e]||(this._callBackMappedToRenewStates[e]=function(n,i,o,s){r._activeRenewals[t]=null;for(var a=0;a<r._callBacksMappedToRenewStates[e].length;++a)try{r._callBacksMappedToRenewStates[e][a](n,i,o,s)}catch(o){r.warn(o)}r._callBacksMappedToRenewStates[e]=null,r._callBackMappedToRenewStates[e]=null})},n.prototype._renewToken=function(e,t,n){this.info("renewToken is called for resource:"+e);var r=this._addAdalFrame("adalRenewFrame"+e),i=this._guid()+"|"+e;this.config.state=i,this._renewStates.push(i),this.verbose("Renew token Expected state: "+i),n=n||"token";var o=this._urlRemoveQueryStringParameter(this._getNavigateUrl(n,e),"prompt");n===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(i,e,t),this.verbosePii("Navigate to:"+o),r.src="about:blank",this._loadFrameTimeout(o,"adalRenewFrame"+e,e)},n.prototype._renewIdToken=function(e,t){this.info("renewIdToken is called");var n=this._addAdalFrame("adalIdTokenFrame"),r=this._guid()+"|"+this.config.clientId;this._idTokenNonce=this._guid(),this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,this._idTokenNonce,!0),this.config.state=r,this._renewStates.push(r),this.verbose("Renew Idtoken Expected state: "+r);var i=null===t||void 0===t?null:this.config.clientId,t=t||"id_token",o=this._urlRemoveQueryStringParameter(this._getNavigateUrl(t,i),"prompt");o+="&prompt=none",o=this._addHintParameters(o),o+="&nonce="+encodeURIComponent(this._idTokenNonce),this.registerCallback(r,this.config.clientId,e),this.verbosePii("Navigate to:"+o),n.src="about:blank",this._loadFrameTimeout(o,"adalIdTokenFrame",this.config.clientId)},n.prototype._urlContainsQueryStringParameter=function(e,t){return new RegExp("[\\?&]"+e+"=").test(t)},n.prototype._urlRemoveQueryStringParameter=function(e,t){var n=new RegExp("(\\&"+t+"=)[^&]+");return e=e.replace(n,""),n=new RegExp("("+t+"=)[^&]+&"),e=e.replace(n,""),n=new RegExp("("+t+"=)[^&]+"),e=e.replace(n,"")},n.prototype._loadFrameTimeout=function(e,t,n){this.verbose("Set loading state to pending for: "+n),this._saveItem(this.CONSTANTS.STORAGE.RENEW_STATUS+n,this.CONSTANTS.TOKEN_RENEW_STATUS_IN_PROGRESS),this._loadFrame(e,t);var r=this;setTimeout(function(){if(r._getItem(r.CONSTANTS.STORAGE.RENEW_STATUS+n)===r.CONSTANTS.TOKEN_RENEW_STATUS_IN_PROGRESS){r.verbose("Loading frame has timed out after: "+r.CONSTANTS.LOADFRAME_TIMEOUT/1e3+" seconds for resource "+n);var e=r._activeRenewals[n];e&&r._callBackMappedToRenewStates[e]&&r._callBackMappedToRenewStates[e]("Token renewal operation failed due to timeout",null,"Token Renewal Failed"),r._saveItem(r.CONSTANTS.STORAGE.RENEW_STATUS+n,r.CONSTANTS.TOKEN_RENEW_STATUS_CANCELED)}},r.CONSTANTS.LOADFRAME_TIMEOUT)},n.prototype._loadFrame=function(e,t){var n=this;n.info("LoadFrame: "+t);var r=t;setTimeout(function(){var t=n._addAdalFrame(r);""!==t.src&&"about:blank"!==t.src||(t.src=e,n._loadFrame(e,r))},500)},n.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 n=this.getCachedToken(e);return n?(this.info("Token is already in cache for resource:"+e),void t(null,n,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"))},n.prototype.acquireTokenPopup=function(e,t,n,r){if(this._isEmpty(e))return this.warn("resource is required"),void r("resource is required",null,"resource is required");if(!this._user)return this.warn("User login is required"),void r("User login is required",null,"login required");if(this._acquireTokenInProgress)return this.warn("Acquire token interactive is already in progress"),void r("Acquire token interactive is already in progress",null,"Acquire token interactive is already in progress");var i=this._guid()+"|"+e;this.config.state=i,this._renewStates.push(i),this._requestType=this.REQUEST_TYPE.RENEW_TOKEN,this.verbose("Renew token Expected state: "+i);var o=this._urlRemoveQueryStringParameter(this._getNavigateUrl("token",e),"prompt");if(o+="&prompt=select_account",t&&(o+=t),n&&-1===o.indexOf("&claims"))o+="&claims="+encodeURIComponent(n);else if(n&&-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(i,e,r),this._loginPopup(o,e,r)},n.prototype.acquireTokenRedirect=function(e,t,n){if(this._isEmpty(e))return this.warn("resource is required"),void r("resource is required",null,"resource is required");var r=this.callback;if(!this._user)return this.warn("User login is required"),void r("User login is required",null,"login required");if(this._acquireTokenInProgress)return this.warn("Acquire token interactive is already in progress"),void r("Acquire token interactive is already in progress",null,"Acquire token interactive is already in progress");var i=this._guid()+"|"+e;this.config.state=i,this.verbose("Renew token Expected state: "+i);var o=this._urlRemoveQueryStringParameter(this._getNavigateUrl("token",e),"prompt");if(o+="&prompt=select_account",t&&(o+=t),n&&-1===o.indexOf("&claims"))o+="&claims="+encodeURIComponent(n);else if(n&&-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,i,!0),this.promptUser(o)},n.prototype.promptUser=function(e){e?(this.infoPii("Navigate to:"+e),window.location.replace(e)):this.info("Navigate url is empty")},n.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,"")},n.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))},n.prototype.logOut=function(){this.clearCache(),this._user=null;var e;if(this.config.logOutUri)e=this.config.logOutUri;else{var t="common",n="";this.config.tenant&&(t=this.config.tenant),this.config.postLogoutRedirectUri&&(n="post_logout_redirect_uri="+encodeURIComponent(this.config.postLogoutRedirectUri)),e=this.instance+t+"/oauth2/logout?"+n}this.infoPii("Logout navigate to: "+e),this.promptUser(e)},n.prototype._isEmpty=function(e){return void 0===e||!e||0===e.length},n.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))},n.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},n.prototype._createUser=function(e){var t=null,n=this._extractIdToken(e);return n&&n.hasOwnProperty("aud")&&(n.aud.toLowerCase()===this.config.clientId.toLowerCase()?(t={userName:"",profile:n},n.hasOwnProperty("upn")?t.userName=n.upn:n.hasOwnProperty("email")&&(t.userName=n.email)):this.warn("IdToken has invalid aud field")),t},n.prototype._getHash=function(e){return e.indexOf("#/")>-1?e=e.substring(e.indexOf("#/")+2):e.indexOf("#")>-1&&(e=e.substring(1)),e},n.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)},n.prototype.getLoginError=function(){return this._getItem(this.CONSTANTS.STORAGE.LOGIN_ERROR)},n.prototype.getRequestInfo=function(e){e=this._getHash(e);var t=this._deserialize(e),n={valid:!1,parameters:{},stateMatch:!1,stateResponse:"",requestType:this.REQUEST_TYPE.UNKNOWN};if(t&&(n.parameters=t,t.hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION)||t.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)||t.hasOwnProperty(this.CONSTANTS.ID_TOKEN))){n.valid=!0;var r="";if(!t.hasOwnProperty("state"))return this.warn("No state returned"),n;if(this.verbose("State: "+t.state),r=t.state,n.stateResponse=r,this._matchState(n))return n;if(!n.stateMatch&&window.parent){n.requestType=this._requestType;for(var i=this._renewStates,o=0;o<i.length;o++)if(i[o]===n.stateResponse){n.stateMatch=!0;break}}}return n},n.prototype._matchNonce=function(e){var t=this._getItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN);if(t){t=t.split(this.CONSTANTS.CACHE_DELIMETER);for(var n=0;n<t.length;n++)if(t[n]===e.profile.nonce)return!0}return!1},n.prototype._matchState=function(e){var t=this._getItem(this.CONSTANTS.STORAGE.STATE_LOGIN);if(t){t=t.split(this.CONSTANTS.CACHE_DELIMETER);for(var n=0;n<t.length;n++)if(t[n]===e.stateResponse)return e.requestType=this.REQUEST_TYPE.LOGIN,e.stateMatch=!0,!0}var r=this._getItem(this.CONSTANTS.STORAGE.STATE_RENEW);if(r){r=r.split(this.CONSTANTS.CACHE_DELIMETER);for(var n=0;n<r.length;n++)if(r[n]===e.stateResponse)return e.requestType=this.REQUEST_TYPE.RENEW_TOKEN,e.stateMatch=!0,!0}return!1},n.prototype._getResourceFromState=function(e){if(e){var t=e.indexOf("|");if(t>-1&&t+1<e.length)return e.substring(t+1)}return""},n.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 n;e.parameters.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)&&(this.info("Fragment has access token"),this._hasResource(t)||(n=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS)||"",this._saveItem(this.CONSTANTS.STORAGE.TOKEN_KEYS,n+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)||(n=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS)||"",this._saveItem(this.CONSTANTS.STORAGE.TOKEN_KEYS,n+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)},n.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 n in this.config.endpoints)if(e.indexOf(n)>-1)return this.config.endpoints[n];return e.indexOf("http://")>-1||e.indexOf("https://")>-1?this._getHostFromUri(e)===this._getHostFromUri(this.config.redirectUri)?this.config.loginResource:null:this.config.loginResource},n.prototype._getHostFromUri=function(e){var t=String(e).replace(/^(https?:)\/\//,"");return t=t.split("/")[0]},n.prototype.handleWindowCallback=function(e){if(null==e&&(e=window.location.hash),this.isCallback(e)){var t=null,n=!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,n=!0):window.parent&&window.parent._adalInstance&&(t=window.parent._adalInstance);var r,i,o=t.getRequestInfo(e),s=null;i=n||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"),r=o.parameters[t.CONSTANTS.ACCESS_TOKEN]||o.parameters[t.CONSTANTS.ID_TOKEN],s=t.CONSTANTS.ACCESS_TOKEN):o.requestType===this.REQUEST_TYPE.LOGIN&&(r=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{i&&i(a,r,c,s)}catch(e){t.error("Error occurred in user defined callback function: "+e)}window.parent!==window||n||(t.config.navigateToLoginRequestUrl?window.location.href=t._getItem(t.CONSTANTS.STORAGE.LOGIN_REQUEST):window.location.hash="")}},n.prototype._getNavigateUrl=function(e,t){var n="common";this.config.tenant&&(n=this.config.tenant);var r=this.instance+n+"/oauth2/authorize"+this._serialize(e,this.config,t)+this._addLibMetadata();return this.info("Navigate url:"+r),r},n.prototype._extractIdToken=function(e){var t=this._decodeJwt(e);if(!t)return null;try{var n=t.JWSPayload,r=this._base64DecodeStringUrlSafe(n);return r?JSON.parse(r):(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},n.prototype._base64DecodeStringUrlSafe=function(e){return e=e.replace(/-/g,"+").replace(/_/g,"/"),window.atob?decodeURIComponent(escape(window.atob(e))):decodeURIComponent(escape(this._decode(e)))},n.prototype._decode=function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e=String(e).replace(/=+$/,"");var n=e.length;if(n%4==1)throw new Error("The token to be decoded is not correctly encoded.");for(var r,i,o,s,a,c,u,h,l="",p=0;p<n;p+=4){if(r=t.indexOf(e.charAt(p)),i=t.indexOf(e.charAt(p+1)),o=t.indexOf(e.charAt(p+2)),s=t.indexOf(e.charAt(p+3)),p+2===n-1){a=r<<18|i<<12|o<<6,c=a>>16&255,u=a>>8&255,l+=String.fromCharCode(c,u);break}if(p+1===n-1){a=r<<18|i<<12,c=a>>16&255,l+=String.fromCharCode(c);break}a=r<<18|i<<12|o<<6|s,c=a>>16&255,u=a>>8&255,h=255&a,l+=String.fromCharCode(c,u,h)}return l},n.prototype._decodeJwt=function(e){if(this._isEmpty(e))return null;var t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/,n=t.exec(e);return!n||n.length<4?(this.warn("The returned id_token is not parseable."),null):{header:n[1],JWSPayload:n[2],JWSSig:n[3]}},n.prototype._convertUrlSafeToRegularBase64EncodedString=function(e){return e.replace("-","+").replace("_","/")},n.prototype._serialize=function(e,t,n){var r=[];if(null!==t){r.push("?response_type="+e),r.push("client_id="+encodeURIComponent(t.clientId)),n&&r.push("resource="+encodeURIComponent(n)),r.push("redirect_uri="+encodeURIComponent(t.redirectUri)),r.push("state="+encodeURIComponent(t.state)),t.hasOwnProperty("slice")&&r.push("slice="+encodeURIComponent(t.slice)),t.hasOwnProperty("extraQueryParameter")&&r.push(t.extraQueryParameter);var i=t.correlationId?t.correlationId:this._guid();r.push("client-request-id="+encodeURIComponent(i))}return r.join("&")},n.prototype._deserialize=function(e){var t,n=/\+/g,r=/([^&=]+)=([^&]*)/g,i=function(e){return decodeURIComponent(e.replace(n," "))},o={};for(t=r.exec(e);t;)o[i(t[1])]=i(t[2]),t=r.exec(e);return o},n.prototype._decimalToHex=function(e){for(var t=e.toString(16);t.length<2;)t="0"+t;return t},n.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 n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",r="0123456789abcdef",i=0,o="",s=0;s<36;s++)"-"!==n[s]&&"4"!==n[s]&&(i=16*Math.random()|0),"x"===n[s]?o+=r[i]:"y"===n[s]?(i&=3,i|=8,o+=r[i]):o+=n[s];return o},n.prototype._expiresIn=function(e){return e||(e=3599),this._now()+parseInt(e,10)},n.prototype._now=function(){return Math.round((new Date).getTime()/1e3)},n.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 n=document.createElement("iframe");n.setAttribute("id",e),n.setAttribute("aria-hidden","true"),n.style.visibility="hidden",n.style.position="absolute",n.style.width=n.style.height=n.borderWidth="0px",t=document.getElementsByTagName("body")[0].appendChild(n)}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}},n.prototype._saveItem=function(e,t,n){if(this.config&&this.config.cacheLocation&&"localStorage"===this.config.cacheLocation){if(!this._supportsLocalStorage())return this.info("Local storage is not supported"),!1;if(n){var r=this._getItem(e)||"";localStorage.setItem(e,r+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)},n.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)},n.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}},n.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}},n.prototype._cloneConfig=function(e){if(null===e||"object"!=typeof e)return e;var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},n.prototype._addLibMetadata=function(){return"&x-client-SKU=Js&x-client-Ver="+this._libVersion()},n.prototype.log=function(e,t,n,r){if(e<=Logging.level){if(!Logging.piiLoggingEnabled&&r)return;var i=(new Date).toUTCString(),o="";o=this.config.correlationId?i+":"+this.config.correlationId+"-"+this._libVersion()+"-"+this.CONSTANTS.LEVEL_STRING_MAP[e]+" "+t:i+":"+this._libVersion()+"-"+this.CONSTANTS.LEVEL_STRING_MAP[e]+" "+t,n&&(o+="\nstack:\n"+n.stack),Logging.log(o)}},n.prototype.error=function(e,t){this.log(this.CONSTANTS.LOGGING_LEVEL.ERROR,e,t)},n.prototype.warn=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.WARN,e,null)},n.prototype.info=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.INFO,e,null)},n.prototype.verbose=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.VERBOSE,e,null)},n.prototype.errorPii=function(e,t){this.log(this.CONSTANTS.LOGGING_LEVEL.ERROR,e,t,!0)},n.prototype.warnPii=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.WARN,e,null,!0)},n.prototype.infoPii=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.INFO,e,null,!0)},n.prototype.verbosePii=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.VERBOSE,e,null,!0)},n.prototype._libVersion=function(){return"1.0.17"},void 0!==e&&e.exports&&(e.exports=n,e.exports.inject=function(e){return new n(e)}),n}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c}),n.d(t,"c",function(){return u}),n.d(t,"b",function(){return h});var r=n(1),i=n(0),o=n(2),s=n(5),a=n(6),c=function(e){function t(t){void 0===t&&(t="This query is already part of a batch.");var n=e.call(this,t)||this;return n.name="AlreadyInBatchException",o.a.error(n),n}return r.b(t,e),t}(Error),u=function(){function e(){this._query=new i.a,this._options={},this._url="",this._parentUrl="",this._useCaching=!1,this._cachingOptions=null}return e.prototype.toUrl=function(){return this._url},e.prototype.concat=function(e){return this._url+=e,this},Object.defineProperty(e.prototype,"query",{get:function(){return this._query},enumerable:!0,configurable:!0}),e.prototype.configure=function(e){return Object(i.i)(this._options,e),this},e.prototype.configureFrom=function(e){return Object(i.i)(this._options,e._options),this},e.prototype.usingCaching=function(e){return i.c.globalCacheDisable||(this._useCaching=!0,void 0!==e&&(this._cachingOptions=e)),this},e.prototype.get=function(e,t){return void 0===e&&(e=new s.c),void 0===t&&(t={}),this.getCore(e,t)},e.prototype.getCore=function(e,t){return void 0===e&&(e=new s.c),void 0===t&&(t={}),this.toRequestContext("GET",t,e,Object(a.b)()).then(function(e){return Object(a.c)(e)})},e.prototype.postCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.c),this.toRequestContext("POST",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},e.prototype.patchCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.c),this.toRequestContext("PATCH",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},e.prototype.deleteCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.c),this.toRequestContext("DELETE",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},e.prototype.putCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.c),this.toRequestContext("PUT",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},e.prototype.append=function(e){this._url=Object(i.d)(this._url,e)},Object.defineProperty(e.prototype,"parentUrl",{get:function(){return this._parentUrl},enumerable:!0,configurable:!0}),e.prototype.extend=function(e,t){this._parentUrl=e._url,this._url=Object(i.d)(this._parentUrl,t),this.configureFrom(e)},e}(),h=function(e){function t(){var t=e.call(this)||this;return t._batch=null,t}return r.b(t,e),t.prototype.inBatch=function(e){if(null!==this.batch)throw new c;return this._batch=e,this},t.prototype.toUrl=function(){return this._url},t.prototype.get=function(e,t){return void 0===e&&(e=new s.d),void 0===t&&(t={}),this.getCore(e,t)},t.prototype.getCore=function(e,t){return void 0===e&&(e=new s.d),void 0===t&&(t={}),this.toRequestContext("GET",t,e,Object(a.b)()).then(function(e){return Object(a.c)(e)})},t.prototype.postCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.d),this.toRequestContext("POST",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},t.prototype.patchCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.d),this.toRequestContext("PATCH",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},t.prototype.deleteCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.d),this.toRequestContext("DELETE",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},t.prototype.putCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.d),this.toRequestContext("PUT",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},t.prototype.addBatchDependency=function(){return null!==this._batch?this._batch.addDependency():function(){return null}},Object.defineProperty(t.prototype,"hasBatch",{get:function(){return Object(i.j)(this._batch)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"batch",{get:function(){return this.hasBatch?this._batch:null},enumerable:!0,configurable:!0}),t}(u)},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(0),i=function(){function e(e){void 0===e&&(e=Object(r.g)()),this._batchId=e,this._requests=[],this._dependencies=[]}return Object.defineProperty(e.prototype,"batchId",{get:function(){return this._batchId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"requests",{get:function(){return this._requests},enumerable:!0,configurable:!0}),e.prototype.add=function(e,t,n,r){var i={method:t.toUpperCase(),options:n,parser:r,reject:null,resolve:null,url:e},o=new Promise(function(e,t){i.resolve=e,i.reject=t});return this._requests.push(i),o},e.prototype.addDependency=function(){var e=function(){},t=new Promise(function(t){e=t});return this._dependencies.push(t),e},e.prototype.execute=function(){var e=this;return Promise.all(this._dependencies).then(function(){return Promise.all(e._dependencies)}).then(function(){return e.executeImpl()})},e}()}])});
//# sourceMappingURL=odata.es5.umd.bundle.min.js.map
/**
@license
* @pnp/odata v1.0.4-2 - pnp - provides shared odata functionality and base classes
* @pnp/odata v1.0.4-3 - pnp - provides shared odata functionality and base classes
* MIT (https://github.com/pnp/pnp/blob/master/LICENSE)

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

this.key = key;
this.expiration = common.Util.dateAdd(new Date(), "second", common.RuntimeConfig.defaultCachingTimeoutSeconds);
this.expiration = common.dateAdd(new Date(), "second", common.RuntimeConfig.defaultCachingTimeoutSeconds);
this.storeName = common.RuntimeConfig.defaultCachingStore;

@@ -181,3 +181,3 @@ }

BufferParser.prototype.parse = function (r) {
if (common.Util.isFunc(r.arrayBuffer)) {
if (common.isFunc(r.arrayBuffer)) {
return r.arrayBuffer();

@@ -295,3 +295,3 @@ }

if (typeof context.cachingOptions !== "undefined") {
cacheOptions = common.Util.extend(cacheOptions, context.cachingOptions);
cacheOptions = common.extend(cacheOptions, context.cachingOptions);
}

@@ -309,3 +309,5 @@ // we may not have a valid store

});
context.batchDependency();
if (common.isFunc(context.batchDependency)) {
context.batchDependency();
}
// handle the case where a parser needs to take special actions with a cached result (such as getAs)

@@ -336,3 +338,5 @@ if (context.parser.hasOwnProperty("hydrate")) {

// we release the dependency here to ensure the batch does not execute until the request is added to the batch
context.batchDependency();
if (common.isFunc(context.batchDependency)) {
context.batchDependency();
}
logging.Logger.write("[" + context.requestId + "] (" + (new Date()).getTime() + ") Batching request in batch " + context.batch.batchId + ".", 1 /* Info */);

@@ -346,3 +350,3 @@ // we set the result as the promise which will be resolved by the batch's execution

var client = context.clientFactory();
var opts = common.Util.extend(context.options || {}, { method: context.verb });
var opts = common.extend(context.options || {}, { method: context.verb });
client.fetch(context.requestAbsoluteUrl, opts)

@@ -522,3 +526,3 @@ .then(function (response) { return context.parser.parse(response); })

Queryable.prototype.append = function (pathPart) {
this._url = common.Util.combinePaths(this._url, pathPart);
this._url = common.combinePaths(this._url, pathPart);
};

@@ -544,3 +548,3 @@ Object.defineProperty(Queryable.prototype, "parentUrl", {

this._parentUrl = parent._url;
this._url = common.Util.combinePaths(this._parentUrl, path);
this._url = common.combinePaths(this._parentUrl, path);
this.configureFrom(parent);

@@ -633,3 +637,3 @@ };

get: function () {
return common.Util.objectDefinedNotNull(this._batch);
return common.objectDefinedNotNull(this._batch);
},

@@ -655,3 +659,3 @@ enumerable: true,

function ODataBatch(_batchId) {
if (_batchId === void 0) { _batchId = common.Util.getGUID(); }
if (_batchId === void 0) { _batchId = common.getGUID(); }
this._batchId = _batchId;

@@ -658,0 +662,0 @@ this._requests = [];

/**
@license
* @pnp/odata v1.0.4-2 - pnp - provides shared odata functionality and base classes
* @pnp/odata v1.0.4-3 - pnp - provides shared odata functionality and base classes
* MIT (https://github.com/pnp/pnp/blob/master/LICENSE)

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

*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@pnp/common"),require("tslib"),require("@pnp/logging")):"function"==typeof define&&define.amd?define(["exports","@pnp/common","tslib","@pnp/logging"],t):t((e.pnp=e.pnp||{},e.pnp.odata={}),e.pnp.common,e.tslib_1,e.pnp.logging)}(this,function(e,t,n,r){"use strict";var o=function(){function e(e){this.key=e,this.expiration=t.Util.dateAdd(new Date,"second",t.RuntimeConfig.defaultCachingTimeoutSeconds),this.storeName=t.RuntimeConfig.defaultCachingStore}return Object.defineProperty(e.prototype,"store",{get:function(){return"local"===this.storeName?e.storage.local:e.storage.session},enumerable:!0,configurable:!0}),e.storage=new t.PnPClientStorage,e}(),i=function(){function e(e,t){this._parser=e,this._cacheOptions=t}return e.prototype.parse=function(e){var t=this;return this._parser.parse(e).then(function(e){return null!==t._cacheOptions.store&&t._cacheOptions.store.put(t._cacheOptions.key,e,t._cacheOptions.expiration),e})},e}(),u=function(e){function t(t,n,o){var i=e.call(this,"Error making HttpClient request in queryable: ["+t+"] "+n)||this;return i.status=t,i.statusText=n,i.data=o,i.name="ProcessHttpClientResponseException",r.Logger.log({data:i.data,level:3,message:i.message}),i}return n.__extends(t,e),t}(Error),s=function(){function e(){}return e.prototype.parse=function(e){var t=this;return new Promise(function(n,r){t.handleError(e,r)&&e.text().then(function(e){return e.replace(/\s/gi,"").length>0?JSON.parse(e):{}}).then(function(e){return n(t.parseODataJSON(e))}).catch(function(e){return r(e)})})},e.prototype.handleError=function(e,t){return e.ok||e.json().then(function(n){var r={responseBody:n,responseHeaders:e.headers};t(new u(e.status,e.statusText,r))}).catch(function(n){r.Logger.log({data:n,level:2,message:"There was an error parsing the error response body. See data for details."});var o={responseBody:"[[body not available]]",responseHeaders:e.headers};t(new u(e.status,e.statusText,o))}),e.ok},e.prototype.parseODataJSON=function(e){var t=e;return e.hasOwnProperty("d")?t=e.d.hasOwnProperty("results")?e.d.results:e.d:e.hasOwnProperty("value")&&(t=e.value),t},e}(),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t}(s),c=function(){function e(){}return e.prototype.parse=function(e){return e.text()},e}(),p=function(){function e(){}return e.prototype.parse=function(e){return e.blob()},e}(),l=function(){function e(){}return e.prototype.parse=function(e){return e.json()},e}(),h=function(){function e(){}return e.prototype.parse=function(e){return t.Util.isFunc(e.arrayBuffer)?e.arrayBuffer():e.buffer()},e}();function f(e,t){return new Promise(function(n){e.result=t,e.hasResult=!0,n(e)})}function d(e){return e.pipeline.length>0?e.pipeline.shift()(e):Promise.resolve(e)}function g(e){return e.pipeline.length<1&&r.Logger.write("["+e.requestId+"] ("+(new Date).getTime()+") Request pipeline contains no methods!",2),d(e).then(function(e){return t=e,r.Logger.log({data:t.result,level:0,message:"["+t.requestId+"] ("+(new Date).getTime()+") Returning result, see data property for value."}),Promise.resolve(t.result||null);var t}).catch(function(e){throw r.Logger.error(e),e})}function y(e){return void 0===e&&(e=!1),function(t,n,o){var i=o.value;o.value=function(){for(var o=[],u=0;u<arguments.length;u++)o[u]=arguments[u];return!e&&o.length>0&&o[0].hasOwnProperty("hasResult")&&o[0].hasResult?(r.Logger.write("["+o[0].requestId+"] ("+(new Date).getTime()+") Skipping request pipeline method "+n+", existing result in pipeline.",0),Promise.resolve(o[0])):(r.Logger.write("["+o[0].requestId+"] ("+(new Date).getTime()+") Calling request pipeline method "+n+".",0),i.apply(t,o).then(function(e){return d(e)}))}}}var v=function(){function e(){}return e.logStart=function(e){return new Promise(function(t){r.Logger.log({data:1===r.Logger.activeLogLevel?{}:e,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") Beginning "+e.verb+" request ("+e.requestAbsoluteUrl+")"}),t(e)})},e.caching=function(e){return new Promise(function(n){if("GET"===e.verb&&e.isCached){r.Logger.write("["+e.requestId+"] ("+(new Date).getTime()+") Caching is enabled for request, checking cache...",1);var u=new o(e.requestAbsoluteUrl.toLowerCase());if(void 0!==e.cachingOptions&&(u=t.Util.extend(u,e.cachingOptions)),null!==u.store){var s=u.store.get(u.key);if(null!==s)return r.Logger.log({data:1===r.Logger.activeLogLevel?{}:s,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") Value returned from cache."}),e.batchDependency(),e.parser.hasOwnProperty("hydrate")&&(s=e.parser.hydrate(s)),f(e,s).then(function(e){return n(e)})}r.Logger.write("["+e.requestId+"] ("+(new Date).getTime()+") Value not found in cache.",1),e.parser=new i(e.parser,u)}return n(e)})},e.send=function(e){return new Promise(function(n,o){if(e.isBatched){var i=e.batch.add(e.requestAbsoluteUrl,e.verb,e.options,e.parser);e.batchDependency(),r.Logger.write("["+e.requestId+"] ("+(new Date).getTime()+") Batching request in batch "+e.batch.batchId+".",1),n(f(e,i))}else{r.Logger.write("["+e.requestId+"] ("+(new Date).getTime()+") Sending request.",1);var u=e.clientFactory(),s=t.Util.extend(e.options||{},{method:e.verb});u.fetch(e.requestAbsoluteUrl,s).then(function(t){return e.parser.parse(t)}).then(function(t){return f(e,t)}).then(function(e){return n(e)}).catch(function(e){return o(e)})}})},e.logEnd=function(e){return new Promise(function(t){e.isBatched?r.Logger.log({data:1===r.Logger.activeLogLevel?{}:e,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") "+e.verb+" request will complete in batch "+e.batch.batchId+"."}):r.Logger.log({data:1===r.Logger.activeLogLevel?{}:e,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") Completing "+e.verb+" request."}),t(e)})},n.__decorate([y(!0)],e,"logStart",null),n.__decorate([y()],e,"caching",null),n.__decorate([y()],e,"send",null),n.__decorate([y(!0)],e,"logEnd",null),e}();function b(){return[v.logStart,v.caching,v.send,v.logEnd].slice(0)}var m=function(e){function t(t){void 0===t&&(t="This query is already part of a batch.");var n=e.call(this,t)||this;return n.name="AlreadyInBatchException",r.Logger.error(n),n}return n.__extends(t,e),t}(Error),_=function(){function e(){this._query=new t.Dictionary,this._options={},this._url="",this._parentUrl="",this._useCaching=!1,this._cachingOptions=null}return e.prototype.toUrl=function(){return this._url},e.prototype.concat=function(e){return this._url+=e,this},Object.defineProperty(e.prototype,"query",{get:function(){return this._query},enumerable:!0,configurable:!0}),e.prototype.configure=function(e){return t.mergeOptions(this._options,e),this},e.prototype.configureFrom=function(e){return t.mergeOptions(this._options,e._options),this},e.prototype.usingCaching=function(e){return t.RuntimeConfig.globalCacheDisable||(this._useCaching=!0,void 0!==e&&(this._cachingOptions=e)),this},e.prototype.get=function(e,t){return void 0===e&&(e=new l),void 0===t&&(t={}),this.getCore(e,t)},e.prototype.getCore=function(e,t){return void 0===e&&(e=new l),void 0===t&&(t={}),this.toRequestContext("GET",t,e,b()).then(function(e){return g(e)})},e.prototype.postCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new l),this.toRequestContext("POST",e,t,b()).then(function(e){return g(e)})},e.prototype.patchCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new l),this.toRequestContext("PATCH",e,t,b()).then(function(e){return g(e)})},e.prototype.deleteCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new l),this.toRequestContext("DELETE",e,t,b()).then(function(e){return g(e)})},e.prototype.putCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new l),this.toRequestContext("PUT",e,t,b()).then(function(e){return g(e)})},e.prototype.append=function(e){this._url=t.Util.combinePaths(this._url,e)},Object.defineProperty(e.prototype,"parentUrl",{get:function(){return this._parentUrl},enumerable:!0,configurable:!0}),e.prototype.extend=function(e,n){this._parentUrl=e._url,this._url=t.Util.combinePaths(this._parentUrl,n),this.configureFrom(e)},e}(),w=function(e){function r(){var t=e.call(this)||this;return t._batch=null,t}return n.__extends(r,e),r.prototype.inBatch=function(e){if(null!==this.batch)throw new m;return this._batch=e,this},r.prototype.toUrl=function(){return this._url},r.prototype.get=function(e,t){return void 0===e&&(e=new a),void 0===t&&(t={}),this.getCore(e,t)},r.prototype.getCore=function(e,t){return void 0===e&&(e=new a),void 0===t&&(t={}),this.toRequestContext("GET",t,e,b()).then(function(e){return g(e)})},r.prototype.postCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new a),this.toRequestContext("POST",e,t,b()).then(function(e){return g(e)})},r.prototype.patchCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new a),this.toRequestContext("PATCH",e,t,b()).then(function(e){return g(e)})},r.prototype.deleteCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new a),this.toRequestContext("DELETE",e,t,b()).then(function(e){return g(e)})},r.prototype.putCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new a),this.toRequestContext("PUT",e,t,b()).then(function(e){return g(e)})},r.prototype.addBatchDependency=function(){return null!==this._batch?this._batch.addDependency():function(){return null}},Object.defineProperty(r.prototype,"hasBatch",{get:function(){return t.Util.objectDefinedNotNull(this._batch)},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"batch",{get:function(){return this.hasBatch?this._batch:null},enumerable:!0,configurable:!0}),r}(_),q=function(){function e(e){void 0===e&&(e=t.Util.getGUID()),this._batchId=e,this._requests=[],this._dependencies=[]}return Object.defineProperty(e.prototype,"batchId",{get:function(){return this._batchId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"requests",{get:function(){return this._requests},enumerable:!0,configurable:!0}),e.prototype.add=function(e,t,n,r){var o={method:t.toUpperCase(),options:n,parser:r,reject:null,resolve:null,url:e},i=new Promise(function(e,t){o.resolve=e,o.reject=t});return this._requests.push(o),i},e.prototype.addDependency=function(){var e=function(){},t=new Promise(function(t){e=t});return this._dependencies.push(t),e},e.prototype.execute=function(){var e=this;return Promise.all(this._dependencies).then(function(){return Promise.all(e._dependencies)}).then(function(){return e.executeImpl()})},e}();e.CachingOptions=o,e.CachingParserWrapper=i,e.ProcessHttpClientResponseException=u,e.ODataParserBase=s,e.ODataDefaultParser=a,e.TextParser=c,e.BlobParser=p,e.JSONParser=l,e.BufferParser=h,e.setResult=f,e.pipe=g,e.requestPipelineMethod=y,e.PipelineMethods=v,e.getDefaultPipeline=b,e.AlreadyInBatchException=m,e.Queryable=_,e.ODataQueryable=w,e.ODataBatch=q,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@pnp/common"),require("tslib"),require("@pnp/logging")):"function"==typeof define&&define.amd?define(["exports","@pnp/common","tslib","@pnp/logging"],t):t((e.pnp=e.pnp||{},e.pnp.odata={}),e.pnp.common,e.tslib_1,e.pnp.logging)}(this,function(e,t,n,r){"use strict";var o=function(){function e(e){this.key=e,this.expiration=t.dateAdd(new Date,"second",t.RuntimeConfig.defaultCachingTimeoutSeconds),this.storeName=t.RuntimeConfig.defaultCachingStore}return Object.defineProperty(e.prototype,"store",{get:function(){return"local"===this.storeName?e.storage.local:e.storage.session},enumerable:!0,configurable:!0}),e.storage=new t.PnPClientStorage,e}(),i=function(){function e(e,t){this._parser=e,this._cacheOptions=t}return e.prototype.parse=function(e){var t=this;return this._parser.parse(e).then(function(e){return null!==t._cacheOptions.store&&t._cacheOptions.store.put(t._cacheOptions.key,e,t._cacheOptions.expiration),e})},e}(),u=function(e){function t(t,n,o){var i=e.call(this,"Error making HttpClient request in queryable: ["+t+"] "+n)||this;return i.status=t,i.statusText=n,i.data=o,i.name="ProcessHttpClientResponseException",r.Logger.log({data:i.data,level:3,message:i.message}),i}return n.__extends(t,e),t}(Error),s=function(){function e(){}return e.prototype.parse=function(e){var t=this;return new Promise(function(n,r){t.handleError(e,r)&&e.text().then(function(e){return e.replace(/\s/gi,"").length>0?JSON.parse(e):{}}).then(function(e){return n(t.parseODataJSON(e))}).catch(function(e){return r(e)})})},e.prototype.handleError=function(e,t){return e.ok||e.json().then(function(n){var r={responseBody:n,responseHeaders:e.headers};t(new u(e.status,e.statusText,r))}).catch(function(n){r.Logger.log({data:n,level:2,message:"There was an error parsing the error response body. See data for details."});var o={responseBody:"[[body not available]]",responseHeaders:e.headers};t(new u(e.status,e.statusText,o))}),e.ok},e.prototype.parseODataJSON=function(e){var t=e;return e.hasOwnProperty("d")?t=e.d.hasOwnProperty("results")?e.d.results:e.d:e.hasOwnProperty("value")&&(t=e.value),t},e}(),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t}(s),c=function(){function e(){}return e.prototype.parse=function(e){return e.text()},e}(),p=function(){function e(){}return e.prototype.parse=function(e){return e.blob()},e}(),l=function(){function e(){}return e.prototype.parse=function(e){return e.json()},e}(),h=function(){function e(){}return e.prototype.parse=function(e){return t.isFunc(e.arrayBuffer)?e.arrayBuffer():e.buffer()},e}();function f(e,t){return new Promise(function(n){e.result=t,e.hasResult=!0,n(e)})}function d(e){return e.pipeline.length>0?e.pipeline.shift()(e):Promise.resolve(e)}function g(e){return e.pipeline.length<1&&r.Logger.write("["+e.requestId+"] ("+(new Date).getTime()+") Request pipeline contains no methods!",2),d(e).then(function(e){return t=e,r.Logger.log({data:t.result,level:0,message:"["+t.requestId+"] ("+(new Date).getTime()+") Returning result, see data property for value."}),Promise.resolve(t.result||null);var t}).catch(function(e){throw r.Logger.error(e),e})}function y(e){return void 0===e&&(e=!1),function(t,n,o){var i=o.value;o.value=function(){for(var o=[],u=0;u<arguments.length;u++)o[u]=arguments[u];return!e&&o.length>0&&o[0].hasOwnProperty("hasResult")&&o[0].hasResult?(r.Logger.write("["+o[0].requestId+"] ("+(new Date).getTime()+") Skipping request pipeline method "+n+", existing result in pipeline.",0),Promise.resolve(o[0])):(r.Logger.write("["+o[0].requestId+"] ("+(new Date).getTime()+") Calling request pipeline method "+n+".",0),i.apply(t,o).then(function(e){return d(e)}))}}}var v=function(){function e(){}return e.logStart=function(e){return new Promise(function(t){r.Logger.log({data:1===r.Logger.activeLogLevel?{}:e,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") Beginning "+e.verb+" request ("+e.requestAbsoluteUrl+")"}),t(e)})},e.caching=function(e){return new Promise(function(n){if("GET"===e.verb&&e.isCached){r.Logger.write("["+e.requestId+"] ("+(new Date).getTime()+") Caching is enabled for request, checking cache...",1);var u=new o(e.requestAbsoluteUrl.toLowerCase());if(void 0!==e.cachingOptions&&(u=t.extend(u,e.cachingOptions)),null!==u.store){var s=u.store.get(u.key);if(null!==s)return r.Logger.log({data:1===r.Logger.activeLogLevel?{}:s,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") Value returned from cache."}),t.isFunc(e.batchDependency)&&e.batchDependency(),e.parser.hasOwnProperty("hydrate")&&(s=e.parser.hydrate(s)),f(e,s).then(function(e){return n(e)})}r.Logger.write("["+e.requestId+"] ("+(new Date).getTime()+") Value not found in cache.",1),e.parser=new i(e.parser,u)}return n(e)})},e.send=function(e){return new Promise(function(n,o){if(e.isBatched){var i=e.batch.add(e.requestAbsoluteUrl,e.verb,e.options,e.parser);t.isFunc(e.batchDependency)&&e.batchDependency(),r.Logger.write("["+e.requestId+"] ("+(new Date).getTime()+") Batching request in batch "+e.batch.batchId+".",1),n(f(e,i))}else{r.Logger.write("["+e.requestId+"] ("+(new Date).getTime()+") Sending request.",1);var u=e.clientFactory(),s=t.extend(e.options||{},{method:e.verb});u.fetch(e.requestAbsoluteUrl,s).then(function(t){return e.parser.parse(t)}).then(function(t){return f(e,t)}).then(function(e){return n(e)}).catch(function(e){return o(e)})}})},e.logEnd=function(e){return new Promise(function(t){e.isBatched?r.Logger.log({data:1===r.Logger.activeLogLevel?{}:e,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") "+e.verb+" request will complete in batch "+e.batch.batchId+"."}):r.Logger.log({data:1===r.Logger.activeLogLevel?{}:e,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") Completing "+e.verb+" request."}),t(e)})},n.__decorate([y(!0)],e,"logStart",null),n.__decorate([y()],e,"caching",null),n.__decorate([y()],e,"send",null),n.__decorate([y(!0)],e,"logEnd",null),e}();function b(){return[v.logStart,v.caching,v.send,v.logEnd].slice(0)}var m=function(e){function t(t){void 0===t&&(t="This query is already part of a batch.");var n=e.call(this,t)||this;return n.name="AlreadyInBatchException",r.Logger.error(n),n}return n.__extends(t,e),t}(Error),_=function(){function e(){this._query=new t.Dictionary,this._options={},this._url="",this._parentUrl="",this._useCaching=!1,this._cachingOptions=null}return e.prototype.toUrl=function(){return this._url},e.prototype.concat=function(e){return this._url+=e,this},Object.defineProperty(e.prototype,"query",{get:function(){return this._query},enumerable:!0,configurable:!0}),e.prototype.configure=function(e){return t.mergeOptions(this._options,e),this},e.prototype.configureFrom=function(e){return t.mergeOptions(this._options,e._options),this},e.prototype.usingCaching=function(e){return t.RuntimeConfig.globalCacheDisable||(this._useCaching=!0,void 0!==e&&(this._cachingOptions=e)),this},e.prototype.get=function(e,t){return void 0===e&&(e=new l),void 0===t&&(t={}),this.getCore(e,t)},e.prototype.getCore=function(e,t){return void 0===e&&(e=new l),void 0===t&&(t={}),this.toRequestContext("GET",t,e,b()).then(function(e){return g(e)})},e.prototype.postCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new l),this.toRequestContext("POST",e,t,b()).then(function(e){return g(e)})},e.prototype.patchCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new l),this.toRequestContext("PATCH",e,t,b()).then(function(e){return g(e)})},e.prototype.deleteCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new l),this.toRequestContext("DELETE",e,t,b()).then(function(e){return g(e)})},e.prototype.putCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new l),this.toRequestContext("PUT",e,t,b()).then(function(e){return g(e)})},e.prototype.append=function(e){this._url=t.combinePaths(this._url,e)},Object.defineProperty(e.prototype,"parentUrl",{get:function(){return this._parentUrl},enumerable:!0,configurable:!0}),e.prototype.extend=function(e,n){this._parentUrl=e._url,this._url=t.combinePaths(this._parentUrl,n),this.configureFrom(e)},e}(),w=function(e){function r(){var t=e.call(this)||this;return t._batch=null,t}return n.__extends(r,e),r.prototype.inBatch=function(e){if(null!==this.batch)throw new m;return this._batch=e,this},r.prototype.toUrl=function(){return this._url},r.prototype.get=function(e,t){return void 0===e&&(e=new a),void 0===t&&(t={}),this.getCore(e,t)},r.prototype.getCore=function(e,t){return void 0===e&&(e=new a),void 0===t&&(t={}),this.toRequestContext("GET",t,e,b()).then(function(e){return g(e)})},r.prototype.postCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new a),this.toRequestContext("POST",e,t,b()).then(function(e){return g(e)})},r.prototype.patchCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new a),this.toRequestContext("PATCH",e,t,b()).then(function(e){return g(e)})},r.prototype.deleteCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new a),this.toRequestContext("DELETE",e,t,b()).then(function(e){return g(e)})},r.prototype.putCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new a),this.toRequestContext("PUT",e,t,b()).then(function(e){return g(e)})},r.prototype.addBatchDependency=function(){return null!==this._batch?this._batch.addDependency():function(){return null}},Object.defineProperty(r.prototype,"hasBatch",{get:function(){return t.objectDefinedNotNull(this._batch)},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"batch",{get:function(){return this.hasBatch?this._batch:null},enumerable:!0,configurable:!0}),r}(_),q=function(){function e(e){void 0===e&&(e=t.getGUID()),this._batchId=e,this._requests=[],this._dependencies=[]}return Object.defineProperty(e.prototype,"batchId",{get:function(){return this._batchId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"requests",{get:function(){return this._requests},enumerable:!0,configurable:!0}),e.prototype.add=function(e,t,n,r){var o={method:t.toUpperCase(),options:n,parser:r,reject:null,resolve:null,url:e},i=new Promise(function(e,t){o.resolve=e,o.reject=t});return this._requests.push(o),i},e.prototype.addDependency=function(){var e=function(){},t=new Promise(function(t){e=t});return this._dependencies.push(t),e},e.prototype.execute=function(){var e=this;return Promise.all(this._dependencies).then(function(){return Promise.all(e._dependencies)}).then(function(){return e.executeImpl()})},e}();e.CachingOptions=o,e.CachingParserWrapper=i,e.ProcessHttpClientResponseException=u,e.ODataParserBase=s,e.ODataDefaultParser=a,e.TextParser=c,e.BlobParser=p,e.JSONParser=l,e.BufferParser=h,e.setResult=f,e.pipe=g,e.requestPipelineMethod=y,e.PipelineMethods=v,e.getDefaultPipeline=b,e.AlreadyInBatchException=m,e.Queryable=_,e.ODataQueryable=w,e.ODataBatch=q,Object.defineProperty(e,"__esModule",{value:!0})});
/**
@license
* @pnp/odata v1.0.4-2 - pnp - provides shared odata functionality and base classes
* @pnp/odata v1.0.4-3 - pnp - provides shared odata functionality and base classes
* MIT (https://github.com/pnp/pnp/blob/master/LICENSE)

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

*/
import { Dictionary, PnPClientStorage, RuntimeConfig, Util, mergeOptions } from '@pnp/common';
import { Dictionary, PnPClientStorage, RuntimeConfig, combinePaths, dateAdd, extend, getGUID, isFunc, mergeOptions, objectDefinedNotNull } from '@pnp/common';
import { Logger } from '@pnp/logging';

@@ -18,3 +18,3 @@ import { __decorate } from 'tslib';

this.key = key;
this.expiration = Util.dateAdd(new Date(), "second", RuntimeConfig.defaultCachingTimeoutSeconds);
this.expiration = dateAdd(new Date(), "second", RuntimeConfig.defaultCachingTimeoutSeconds);
this.storeName = RuntimeConfig.defaultCachingStore;

@@ -150,3 +150,3 @@ }

parse(r) {
if (Util.isFunc(r.arrayBuffer)) {
if (isFunc(r.arrayBuffer)) {
return r.arrayBuffer();

@@ -256,3 +256,3 @@ }

if (typeof context.cachingOptions !== "undefined") {
cacheOptions = Util.extend(cacheOptions, context.cachingOptions);
cacheOptions = extend(cacheOptions, context.cachingOptions);
}

@@ -270,3 +270,5 @@ // we may not have a valid store

});
context.batchDependency();
if (isFunc(context.batchDependency)) {
context.batchDependency();
}
// handle the case where a parser needs to take special actions with a cached result (such as getAs)

@@ -297,3 +299,5 @@ if (context.parser.hasOwnProperty("hydrate")) {

// we release the dependency here to ensure the batch does not execute until the request is added to the batch
context.batchDependency();
if (isFunc(context.batchDependency)) {
context.batchDependency();
}
Logger.write(`[${context.requestId}] (${(new Date()).getTime()}) Batching request in batch ${context.batch.batchId}.`, 1 /* Info */);

@@ -307,3 +311,3 @@ // we set the result as the promise which will be resolved by the batch's execution

const client = context.clientFactory();
const opts = Util.extend(context.options || {}, { method: context.verb });
const opts = extend(context.options || {}, { method: context.verb });
client.fetch(context.requestAbsoluteUrl, opts)

@@ -462,3 +466,3 @@ .then(response => context.parser.parse(response))

append(pathPart) {
this._url = Util.combinePaths(this._url, pathPart);
this._url = combinePaths(this._url, pathPart);
}

@@ -480,3 +484,3 @@ /**

this._parentUrl = parent._url;
this._url = Util.combinePaths(this._parentUrl, path);
this._url = combinePaths(this._parentUrl, path);
this.configureFrom(parent);

@@ -553,3 +557,3 @@ }

get hasBatch() {
return Util.objectDefinedNotNull(this._batch);
return objectDefinedNotNull(this._batch);
}

@@ -566,3 +570,3 @@ /**

class ODataBatch {
constructor(_batchId = Util.getGUID()) {
constructor(_batchId = getGUID()) {
this._batchId = _batchId;

@@ -569,0 +573,0 @@ this._requests = [];

{
"name": "@pnp/odata",
"version": "1.0.4-2",
"version": "1.0.4-3",
"description": "pnp - provides shared odata functionality and base classes",

@@ -11,4 +11,4 @@ "main": "./dist/odata.es5.umd.js",

"peerDependencies": {
"@pnp/logging": "1.0.4-2",
"@pnp/common": "1.0.4-2"
"@pnp/logging": "1.0.4-3",
"@pnp/common": "1.0.4-3"
},

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

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

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