forked from IdentityModel/oidc-client-js
-
Notifications
You must be signed in to change notification settings - Fork 1
/
oidc-client.rsa256.slim.min.js
3 lines (3 loc) · 151 KB
/
oidc-client.rsa256.slim.min.js
1
2
3
var Oidc=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function t(){return e.default}:function t(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=62)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var o={debug:function e(){},info:function e(){},warn:function e(){},error:function e(){}},i=void 0,s=void 0;(t.Log=function(){function e(){!function t(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.reset=function e(){s=3,i=o},e.debug=function e(){if(s>=4){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];i.debug.apply(i,Array.from(r))}},e.info=function e(){if(s>=3){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];i.info.apply(i,Array.from(r))}},e.warn=function e(){if(s>=2){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];i.warn.apply(i,Array.from(r))}},e.error=function e(){if(s>=1){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];i.error.apply(i,Array.from(r))}},n(e,null,[{key:"NONE",get:function e(){return 0}},{key:"ERROR",get:function e(){return 1}},{key:"WARN",get:function e(){return 2}},{key:"INFO",get:function e(){return 3}},{key:"DEBUG",get:function e(){return 4}},{key:"level",get:function e(){return s},set:function e(t){if(!(0<=t&&t<=4))throw new Error("Invalid log level");s=t}},{key:"logger",get:function e(){return i},set:function e(t){if(!t.debug&&t.info&&(t.debug=t.info),!(t.debug&&t.info&&t.warn&&t.error))throw new Error("Invalid logger");i=t}}]),e}()).reset()},function(e,t,r){var n=r(22)("wks"),o=r(24),i=r(2).Symbol,s="function"==typeof i;(e.exports=function(e){return n[e]||(n[e]=s&&i[e]||(s?i:o)("Symbol."+e))}).store=n},function(e,t){var r=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(e,t){var r=e.exports={version:"2.6.4"};"number"==typeof __e&&(__e=r)},function(e,t,r){var n=r(5);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,r){var n=r(2),o=r(3),i=r(8),s=r(11),a=r(13),u=function(e,t,r){var c,l,f,p,d=e&u.F,h=e&u.G,g=e&u.S,_=e&u.P,v=e&u.B,y=h?n:g?n[t]||(n[t]={}):(n[t]||{}).prototype,m=h?o:o[t]||(o[t]={}),w=m.prototype||(m.prototype={});for(c in h&&(r=t),r)f=((l=!d&&y&&void 0!==y[c])?y:r)[c],p=v&&l?a(f,n):_&&"function"==typeof f?a(Function.call,f):f,y&&s(y,c,f,e&u.U),m[c]!=f&&i(m,c,p),_&&w[c]!=f&&(w[c]=f)};n.core=o,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var o={setInterval:function(e){function t(t,r){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e,t){return setInterval(e,t)}),clearInterval:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e){return clearInterval(e)})},i=!1,s=null;t.Global=function(){function e(){!function t(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e)}return e._testing=function e(){i=!0},e.setXMLHttpRequest=function e(t){s=t},n(e,null,[{key:"location",get:function e(){if(!i)return location}},{key:"localStorage",get:function e(){if(!i&&"undefined"!=typeof window)return localStorage}},{key:"sessionStorage",get:function e(){if(!i&&"undefined"!=typeof window)return sessionStorage}},{key:"XMLHttpRequest",get:function e(){if(!i&&"undefined"!=typeof window)return s||XMLHttpRequest}},{key:"timer",get:function e(){if(!i)return o}}]),e}()},function(e,t,r){var n=r(17),o=r(39);e.exports=r(12)?function(e,t,r){return n.f(e,t,o(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MetadataService=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=r(0),i=r(37);t.MetadataService=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.JsonService;if(function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t)throw o.Log.error("MetadataService: No settings passed to MetadataService"),new Error("settings");this._settings=t,this._jsonService=new r(["application/jwk-set+json"])}return e.prototype.getMetadata=function e(){var t=this;return this._settings.metadata?(o.Log.debug("MetadataService.getMetadata: Returning metadata from settings"),Promise.resolve(this._settings.metadata)):this.metadataUrl?(o.Log.debug("MetadataService.getMetadata: getting metadata from",this.metadataUrl),this._jsonService.getJson(this.metadataUrl).then(function(e){return o.Log.debug("MetadataService.getMetadata: json received"),t._settings.metadata=e,e})):(o.Log.error("MetadataService.getMetadata: No authority or metadataUrl configured on settings"),Promise.reject(new Error("No authority or metadataUrl configured on settings")))},e.prototype.getIssuer=function e(){return this._getMetadataProperty("issuer")},e.prototype.getAuthorizationEndpoint=function e(){return this._getMetadataProperty("authorization_endpoint")},e.prototype.getUserInfoEndpoint=function e(){return this._getMetadataProperty("userinfo_endpoint")},e.prototype.getTokenEndpoint=function e(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._getMetadataProperty("token_endpoint",t)},e.prototype.getCheckSessionIframe=function e(){return this._getMetadataProperty("check_session_iframe",!0)},e.prototype.getEndSessionEndpoint=function e(){return this._getMetadataProperty("end_session_endpoint",!0)},e.prototype.getRevocationEndpoint=function e(){return this._getMetadataProperty("revocation_endpoint",!0)},e.prototype.getKeysEndpoint=function e(){return this._getMetadataProperty("jwks_uri",!0)},e.prototype._getMetadataProperty=function e(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return o.Log.debug("MetadataService.getMetadataProperty for: "+t),this.getMetadata().then(function(e){if(o.Log.debug("MetadataService.getMetadataProperty: metadata recieved"),void 0===e[t]){if(!0===r)return void o.Log.warn("MetadataService.getMetadataProperty: Metadata does not contain optional property "+t);throw o.Log.error("MetadataService.getMetadataProperty: Metadata does not contain property "+t),new Error("Metadata does not contain property "+t)}return e[t]})},e.prototype.getSigningKeys=function e(){var t=this;return this._settings.signingKeys?(o.Log.debug("MetadataService.getSigningKeys: Returning signingKeys from settings"),Promise.resolve(this._settings.signingKeys)):this._getMetadataProperty("jwks_uri").then(function(e){return o.Log.debug("MetadataService.getSigningKeys: jwks_uri received",e),t._jsonService.getJson(e).then(function(e){if(o.Log.debug("MetadataService.getSigningKeys: key set received",e),!e.keys)throw o.Log.error("MetadataService.getSigningKeys: Missing keys on keyset"),new Error("Missing keys on keyset");return t._settings.signingKeys=e.keys,t._settings.signingKeys})})},n(e,[{key:"metadataUrl",get:function e(){return this._metadataUrl||(this._settings.metadataUrl?this._metadataUrl=this._settings.metadataUrl:(this._metadataUrl=this._settings.authority,this._metadataUrl&&this._metadataUrl.indexOf(".well-known/openid-configuration")<0&&("/"!==this._metadataUrl[this._metadataUrl.length-1]&&(this._metadataUrl+="/"),this._metadataUrl+=".well-known/openid-configuration"))),this._metadataUrl}}]),e}()},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t,r){var n=r(2),o=r(8),i=r(19),s=r(24)("src"),a=r(68),u=(""+a).split("toString");r(3).inspectSource=function(e){return a.call(e)},(e.exports=function(e,t,r,a){var c="function"==typeof r;c&&(i(r,"name")||o(r,"name",t)),e[t]!==r&&(c&&(i(r,s)||o(r,s,e[t]?""+e[t]:u.join(String(t)))),e===n?e[t]=r:a?e[t]?e[t]=r:o(e,t,r):(delete e[t],o(e,t,r)))})(Function.prototype,"toString",function e(){return"function"==typeof this&&this[s]||a.call(this)})},function(e,t,r){e.exports=!r(18)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,r){var n=r(14);e.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,o){return e.call(t,r,n,o)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){e.exports={}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UrlUtility=void 0;var n=r(0),o=r(7);t.UrlUtility=function(){function e(){!function t(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.addQueryParam=function e(t,r,n){return t.indexOf("?")<0&&(t+="?"),"?"!==t[t.length-1]&&(t+="&"),t+=encodeURIComponent(r),t+="=",t+=encodeURIComponent(n)},e.parseUrlFragment=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.Global;"string"!=typeof t&&(t=i.location.href);var s=t.lastIndexOf(r);s>=0&&(t=t.substr(s+1)),"?"===r&&(s=t.indexOf("#"))>=0&&(t=t.substr(0,s));for(var a,u={},c=/([^&=]+)=([^&]*)/g,l=0;a=c.exec(t);)if(u[decodeURIComponent(a[1])]=decodeURIComponent(a[2]),l++>50)return n.Log.error("UrlUtility.parseUrlFragment: response exceeded expected number of parameters",t),{error:"Response exceeded expected number of parameters"};for(var f in u)return u;return{}},e}()},function(e,t,r){var n=r(4),o=r(66),i=r(67),s=Object.defineProperty;t.f=r(12)?Object.defineProperty:function e(t,r,a){if(n(t),r=i(r,!0),n(a),o)try{return s(t,r,a)}catch(e){}if("get"in a||"set"in a)throw TypeError("Accessors not supported!");return"value"in a&&(t[r]=a.value),t}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JoseUtil=void 0;var n=r(116),o=function i(e){return e&&e.__esModule?e:{default:e}}(r(121));t.JoseUtil=(0,o.default)({jws:n.jws,KeyUtil:n.KeyUtil,X509:n.X509,crypto:n.crypto,hextob64u:n.hextob64u,b64tohex:n.b64tohex,AllowedSigningAlgs:n.AllowedSigningAlgs})},function(e,t,r){var n=r(10),o=r(1)("toStringTag"),i="Arguments"==n(function(){return arguments}());e.exports=function(e){var t,r,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),o))?r:i?n(t):"Object"==(s=n(t))&&"function"==typeof t.callee?"Arguments":s}},function(e,t,r){var n=r(3),o=r(2),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:n.version,mode:r(23)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports=!1},function(e,t){var r=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++r+n).toString(36))}},function(e,t,r){var n=r(5),o=r(2).document,i=n(o)&&n(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},function(e,t){var r=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:r)(e)}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,r){var n=r(74),o=r(41);e.exports=Object.keys||function e(t){return n(t,o)}},function(e,t,r){var n=r(30),o=r(27);e.exports=function(e){return n(o(e))}},function(e,t,r){var n=r(10);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}},function(e,t,r){var n=r(26),o=Math.min;e.exports=function(e){return e>0?o(n(e),9007199254740991):0}},function(e,t,r){var n=r(22)("keys"),o=r(24);e.exports=function(e){return n[e]||(n[e]=o(e))}},function(e,t,r){var n=r(17).f,o=r(19),i=r(1)("toStringTag");e.exports=function(e,t,r){e&&!o(e=r?e:e.prototype,i)&&n(e,i,{configurable:!0,value:t})}},function(e,t,r){var n=r(27);e.exports=function(e){return Object(n(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OidcClientSettings=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0),s=r(36),a=r(114),u=r(9);var c="id_token",l="openid",f=900,p=300;t.OidcClientSettings=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.authority,o=t.metadataUrl,i=t.metadata,d=t.signingKeys,h=t.client_id,g=t.client_secret,_=t.response_type,v=void 0===_?c:_,y=t.scope,m=void 0===y?l:y,w=t.redirect_uri,b=t.post_logout_redirect_uri,S=t.prompt,k=t.display,T=t.max_age,E=t.ui_locales,L=t.acr_values,P=t.resource,R=t.response_mode,x=t.filterProtocolClaims,C=void 0===x||x,U=t.loadUserInfo,M=void 0===U||U,O=t.staleStateAge,j=void 0===O?f:O,I=t.clockSkew,A=void 0===I?p:I,N=t.userInfoJwtIssuer,F=void 0===N?"OP":N,J=t.stateStore,B=void 0===J?new s.WebStorageStateStore:J,q=t.ResponseValidatorCtor,V=void 0===q?a.ResponseValidator:q,W=t.MetadataServiceCtor,D=void 0===W?u.MetadataService:W,H=t.extraQueryParams,z=void 0===H?{}:H;!function K(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._authority=r,this._metadataUrl=o,this._metadata=i,this._signingKeys=d,this._client_id=h,this._client_secret=g,this._response_type=v,this._scope=m,this._redirect_uri=w,this._post_logout_redirect_uri=b,this._prompt=S,this._display=k,this._max_age=T,this._ui_locales=E,this._acr_values=L,this._resource=P,this._response_mode=R,this._filterProtocolClaims=!!C,this._loadUserInfo=!!M,this._staleStateAge=j,this._clockSkew=A,this._userInfoJwtIssuer=F,this._stateStore=B,this._validator=new V(this),this._metadataService=new D(this),this._extraQueryParams="object"===(void 0===z?"undefined":n(z))?z:{}}return o(e,[{key:"client_id",get:function e(){return this._client_id},set:function e(t){if(this._client_id)throw i.Log.error("OidcClientSettings.set_client_id: client_id has already been assigned."),new Error("client_id has already been assigned.");this._client_id=t}},{key:"client_secret",get:function e(){return this._client_secret}},{key:"response_type",get:function e(){return this._response_type}},{key:"scope",get:function e(){return this._scope}},{key:"redirect_uri",get:function e(){return this._redirect_uri}},{key:"post_logout_redirect_uri",get:function e(){return this._post_logout_redirect_uri}},{key:"prompt",get:function e(){return this._prompt}},{key:"display",get:function e(){return this._display}},{key:"max_age",get:function e(){return this._max_age}},{key:"ui_locales",get:function e(){return this._ui_locales}},{key:"acr_values",get:function e(){return this._acr_values}},{key:"resource",get:function e(){return this._resource}},{key:"response_mode",get:function e(){return this._response_mode}},{key:"authority",get:function e(){return this._authority},set:function e(t){if(this._authority)throw i.Log.error("OidcClientSettings.set_authority: authority has already been assigned."),new Error("authority has already been assigned.");this._authority=t}},{key:"metadataUrl",get:function e(){return this._metadataUrl||(this._metadataUrl=this.authority,this._metadataUrl&&this._metadataUrl.indexOf(".well-known/openid-configuration")<0&&("/"!==this._metadataUrl[this._metadataUrl.length-1]&&(this._metadataUrl+="/"),this._metadataUrl+=".well-known/openid-configuration")),this._metadataUrl}},{key:"metadata",get:function e(){return this._metadata},set:function e(t){this._metadata=t}},{key:"signingKeys",get:function e(){return this._signingKeys},set:function e(t){this._signingKeys=t}},{key:"filterProtocolClaims",get:function e(){return this._filterProtocolClaims}},{key:"loadUserInfo",get:function e(){return this._loadUserInfo}},{key:"staleStateAge",get:function e(){return this._staleStateAge}},{key:"clockSkew",get:function e(){return this._clockSkew}},{key:"userInfoJwtIssuer",get:function e(){return this._userInfoJwtIssuer}},{key:"stateStore",get:function e(){return this._stateStore}},{key:"validator",get:function e(){return this._validator}},{key:"metadataService",get:function e(){return this._metadataService}},{key:"extraQueryParams",get:function e(){return this._extraQueryParams},set:function e(t){"object"===(void 0===t?"undefined":n(t))?this._extraQueryParams=t:this._extraQueryParams={}}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebStorageStateStore=void 0;var n=r(0),o=r(7);t.WebStorageStateStore=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.prefix,n=void 0===r?"oidc.":r,i=t.store,s=void 0===i?o.Global.localStorage:i;!function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._store=s,this._prefix=n}return e.prototype.set=function e(t,r){return n.Log.debug("WebStorageStateStore.set",t),t=this._prefix+t,this._store.setItem(t,r),Promise.resolve()},e.prototype.get=function e(t){n.Log.debug("WebStorageStateStore.get",t),t=this._prefix+t;var r=this._store.getItem(t);return Promise.resolve(r)},e.prototype.remove=function e(t){n.Log.debug("WebStorageStateStore.remove",t),t=this._prefix+t;var r=this._store.getItem(t);return this._store.removeItem(t),Promise.resolve(r)},e.prototype.getAllKeys=function e(){n.Log.debug("WebStorageStateStore.getAllKeys");for(var t=[],r=0;r<this._store.length;r++){var o=this._store.key(r);0===o.indexOf(this._prefix)&&t.push(o.substr(this._prefix.length))}return Promise.resolve(t)},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JsonService=void 0;var n=r(0),o=r(7);t.JsonService=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.Global.XMLHttpRequest,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;!function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t&&Array.isArray(t)?this._contentTypes=t.slice():this._contentTypes=[],this._contentTypes.push("application/json"),n&&this._contentTypes.push("application/jwt"),this._XMLHttpRequest=r,this._jwtHandler=n}return e.prototype.getJson=function e(t,r){var o=this;if(!t)throw n.Log.error("JsonService.getJson: No url passed"),new Error("url");return n.Log.debug("JsonService.getJson, url: ",t),new Promise(function(e,i){var s=new o._XMLHttpRequest;s.open("GET",t);var a=o._contentTypes,u=o._jwtHandler;s.onload=function(){if(n.Log.debug("JsonService.getJson: HTTP response received, status",s.status),200===s.status){var r=s.getResponseHeader("Content-Type");if(r){var o=a.find(function(e){if(r.startsWith(e))return!0});if("application/jwt"==o)return void u(s).then(e,i);if(o)try{return void e(JSON.parse(s.responseText))}catch(e){return n.Log.error("JsonService.getJson: Error parsing JSON response",e.message),void i(e)}}i(Error("Invalid response Content-Type: "+r+", from URL: "+t))}else i(Error(s.statusText+" ("+s.status+")"))},s.onerror=function(){n.Log.error("JsonService.getJson: network error"),i(Error("Network Error"))},r&&(n.Log.debug("JsonService.getJson: token passed, setting Authorization header"),s.setRequestHeader("Authorization","Bearer "+r)),s.send()})},e.prototype.postForm=function e(t,r){var o=this;if(!t)throw n.Log.error("JsonService.postForm: No url passed"),new Error("url");return n.Log.debug("JsonService.postForm, url: ",t),new Promise(function(e,i){var s=new o._XMLHttpRequest;s.open("POST",t);var a=o._contentTypes;s.onload=function(){if(n.Log.debug("JsonService.postForm: HTTP response received, status",s.status),200!==s.status){if(400===s.status)if(o=s.getResponseHeader("Content-Type"))if(a.find(function(e){if(o.startsWith(e))return!0}))try{var r=JSON.parse(s.responseText);if(r&&r.error)return n.Log.error("JsonService.postForm: Error from server: ",r.error),void i(new Error(r.error))}catch(e){return n.Log.error("JsonService.postForm: Error parsing JSON response",e.message),void i(e)}i(Error(s.statusText+" ("+s.status+")"))}else{var o;if((o=s.getResponseHeader("Content-Type"))&&a.find(function(e){if(o.startsWith(e))return!0}))try{return void e(JSON.parse(s.responseText))}catch(e){return n.Log.error("JsonService.postForm: Error parsing JSON response",e.message),void i(e)}i(Error("Invalid response Content-Type: "+o+", from URL: "+t))}},s.onerror=function(){n.Log.error("JsonService.postForm: network error"),i(Error("Network Error"))};var u="";for(var c in r){var l=r[c];l&&(u.length>0&&(u+="&"),u+=encodeURIComponent(c),u+="=",u+=encodeURIComponent(l))}s.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),s.send(u)})},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.State=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=r(0),i=function s(e){return e&&e.__esModule?e:{default:e}}(r(54));t.State=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.id,n=t.data,o=t.created;!function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._id=r||(0,i.default)(),this._data=n,this._created="number"==typeof o&&o>0?o:parseInt(Date.now()/1e3)}return e.prototype.toStorageString=function e(){return o.Log.debug("State.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created})},e.fromStorageString=function t(r){return o.Log.debug("State.fromStorageString"),new e(JSON.parse(r))},e.clearStaleState=function t(r,n){var i=Date.now()/1e3-n;return r.getAllKeys().then(function(t){o.Log.debug("State.clearStaleState: got keys",t);for(var n=[],s=function s(a){var c=t[a];u=r.get(c).then(function(t){var n=!1;if(t)try{var s=e.fromStorageString(t);o.Log.debug("State.clearStaleState: got item from key: ",c,s.created),s.created<=i&&(n=!0)}catch(e){o.Log.error("State.clearStaleState: Error parsing state for key",c,e.message),n=!0}else o.Log.debug("State.clearStaleState: no item in storage for key: ",c),n=!0;if(n)return o.Log.debug("State.clearStaleState: removed item for key: ",c),r.remove(c)}),n.push(u)},a=0;a<t.length;a++){var u;s(a)}return o.Log.debug("State.clearStaleState: waiting on promise count:",n.length),Promise.all(n)})},n(e,[{key:"id",get:function e(){return this._id}},{key:"data",get:function e(){return this._data}},{key:"created",get:function e(){return this._created}}]),e}()},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,r){"use strict";var n=r(23),o=r(6),i=r(11),s=r(8),a=r(15),u=r(71),c=r(33),l=r(77),f=r(1)("iterator"),p=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,r,h,g,_,v){u(r,t,h);var y,m,w,b=function(e){if(!p&&e in E)return E[e];switch(e){case"keys":return function t(){return new r(this,e)};case"values":return function t(){return new r(this,e)}}return function t(){return new r(this,e)}},S=t+" Iterator",k="values"==g,T=!1,E=e.prototype,L=E[f]||E["@@iterator"]||g&&E[g],P=L||b(g),R=g?k?b("entries"):P:void 0,x="Array"==t&&E.entries||L;if(x&&(w=l(x.call(new e)))!==Object.prototype&&w.next&&(c(w,S,!0),n||"function"==typeof w[f]||s(w,f,d)),k&&L&&"values"!==L.name&&(T=!0,P=function e(){return L.call(this)}),n&&!v||!p&&!T&&E[f]||s(E,f,P),a[t]=P,a[S]=d,g)if(y={values:k?P:b("values"),keys:_?P:b("keys"),entries:R},v)for(m in y)m in E||i(E,m,y[m]);else o(o.P+o.F*(p||T),t,y);return y}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,r){var n=r(2).document;e.exports=n&&n.documentElement},function(e,t,r){var n=r(1)("unscopables"),o=Array.prototype;void 0==o[n]&&r(8)(o,n,{}),e.exports=function(e){o[n][e]=!0}},function(e,t,r){var n,o,i,s=r(13),a=r(45),u=r(42),c=r(25),l=r(2),f=l.process,p=l.setImmediate,d=l.clearImmediate,h=l.MessageChannel,g=l.Dispatch,_=0,v={},y=function(){var e=+this;if(v.hasOwnProperty(e)){var t=v[e];delete v[e],t()}},m=function(e){y.call(e.data)};p&&d||(p=function e(t){for(var r=[],o=1;arguments.length>o;)r.push(arguments[o++]);return v[++_]=function(){a("function"==typeof t?t:Function(t),r)},n(_),_},d=function e(t){delete v[t]},"process"==r(10)(f)?n=function(e){f.nextTick(s(y,e,1))}:g&&g.now?n=function(e){g.now(s(y,e,1))}:h?(i=(o=new h).port2,o.port1.onmessage=m,n=s(i.postMessage,i,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(n=function(e){l.postMessage(e+"","*")},l.addEventListener("message",m,!1)):n="onreadystatechange"in c("script")?function(e){u.appendChild(c("script")).onreadystatechange=function(){u.removeChild(this),y.call(e)}}:function(e){setTimeout(s(y,e,1),0)}),e.exports={set:p,clear:d}},function(e,t){e.exports=function(e,t,r){var n=void 0===r;switch(t.length){case 0:return n?e():e.call(r);case 1:return n?e(t[0]):e.call(r,t[0]);case 2:return n?e(t[0],t[1]):e.call(r,t[0],t[1]);case 3:return n?e(t[0],t[1],t[2]):e.call(r,t[0],t[1],t[2]);case 4:return n?e(t[0],t[1],t[2],t[3]):e.call(r,t[0],t[1],t[2],t[3])}return e.apply(r,t)}},function(e,t,r){"use strict";var n=r(14);e.exports.f=function(e){return new function t(e){var t,r;this.promise=new e(function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n}),this.resolve=n(t),this.reject=n(r)}(e)}},function(e,t,r){var n=r(13),o=r(30),i=r(34),s=r(31),a=r(105);e.exports=function(e,t){var r=1==e,u=2==e,c=3==e,l=4==e,f=6==e,p=5==e||f,d=t||a;return function(t,a,h){for(var g,_,v=i(t),y=o(v),m=n(a,h,3),w=s(y.length),b=0,S=r?d(t,w):u?d(t,0):void 0;w>b;b++)if((p||b in y)&&(_=m(g=y[b],b,v),e))if(r)S[b]=_;else if(_)switch(e){case 3:return!0;case 5:return g;case 6:return b;case 2:S.push(g)}else if(l)return!1;return f?-1:c||l?l:S}}},function(e,t,r){var n=r(10);e.exports=Array.isArray||function e(t){return"Array"==n(t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OidcClient=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=r(0),i=r(35),s=r(51),a=r(52),u=r(125),c=r(126),l=r(127),f=r(53),p=r(38);t.OidcClient=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t instanceof i.OidcClientSettings?this._settings=t:this._settings=new i.OidcClientSettings(t)}return e.prototype.createSigninRequest=function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.response_type,i=r.scope,s=r.redirect_uri,u=r.data,c=r.state,l=r.prompt,f=r.display,p=r.max_age,d=r.ui_locales,h=r.id_token_hint,g=r.login_hint,_=r.acr_values,v=r.resource,y=r.request,m=r.request_uri,w=r.response_mode,b=r.extraQueryParams,S=arguments[1];o.Log.debug("OidcClient.createSigninRequest");var k=this._settings.client_id;n=n||this._settings.response_type,i=i||this._settings.scope,s=s||this._settings.redirect_uri,l=l||this._settings.prompt,f=f||this._settings.display,p=p||this._settings.max_age,d=d||this._settings.ui_locales,_=_||this._settings.acr_values,v=v||this._settings.resource,w=w||this._settings.response_mode,b=b||this._settings.extraQueryParams;var T=this._settings.authority;return a.SigninRequest.isCode(n)&&"code"!==n?Promise.reject(new Error("OpenID Connect hybrid flow is not supported")):this._metadataService.getAuthorizationEndpoint().then(function(e){o.Log.debug("OidcClient.createSigninRequest: Received authorization endpoint",e);var r=new a.SigninRequest({url:e,client_id:k,redirect_uri:s,response_type:n,scope:i,data:u||c,authority:T,prompt:l,display:f,max_age:p,ui_locales:d,id_token_hint:h,login_hint:g,acr_values:_,resource:v,request:y,request_uri:m,extraQueryParams:b,response_mode:w}),E=r.state;return(S=S||t._stateStore).set(E.id,E.toStorageString()).then(function(){return r})})},e.prototype.processSigninResponse=function e(t,r){var n=this;o.Log.debug("OidcClient.processSigninResponse");var i="query"===this._settings.response_mode||!this._settings.response_mode&&a.SigninRequest.isCode(this._settings.response_type)?"?":"#",s=new u.SigninResponse(t,i);return s.state?(r=r||this._stateStore).remove(s.state).then(function(e){if(!e)throw o.Log.error("OidcClient.processSigninResponse: No matching state found in storage"),new Error("No matching state found in storage");var t=f.SigninState.fromStorageString(e);return o.Log.debug("OidcClient.processSigninResponse: Received state from storage; validating response"),n._validator.validateSigninResponse(t,s)}):(o.Log.error("OidcClient.processSigninResponse: No state in response"),Promise.reject(new Error("No state in response")))},e.prototype.createSignoutRequest=function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.id_token_hint,i=r.data,s=r.state,a=r.post_logout_redirect_uri,u=r.extraQueryParams,l=arguments[1];return o.Log.debug("OidcClient.createSignoutRequest"),a=a||this._settings.post_logout_redirect_uri,u=u||this._settings.extraQueryParams,this._metadataService.getEndSessionEndpoint().then(function(e){if(!e)throw o.Log.error("OidcClient.createSignoutRequest: No end session endpoint url returned"),new Error("no end session endpoint");o.Log.debug("OidcClient.createSignoutRequest: Received end session endpoint",e);var r=new c.SignoutRequest({url:e,id_token_hint:n,post_logout_redirect_uri:a,data:i||s,extraQueryParams:u}),f=r.state;return f&&(o.Log.debug("OidcClient.createSignoutRequest: Signout request has state to persist"),(l=l||t._stateStore).set(f.id,f.toStorageString())),r})},e.prototype.processSignoutResponse=function e(t,r){var n=this;o.Log.debug("OidcClient.processSignoutResponse");var i=new l.SignoutResponse(t);if(!i.state)return o.Log.debug("OidcClient.processSignoutResponse: No state in response"),i.error?(o.Log.warn("OidcClient.processSignoutResponse: Response was error: ",i.error),Promise.reject(new s.ErrorResponse(i))):Promise.resolve(i);var a=i.state;return(r=r||this._stateStore).remove(a).then(function(e){if(!e)throw o.Log.error("OidcClient.processSignoutResponse: No matching state found in storage"),new Error("No matching state found in storage");var t=p.State.fromStorageString(e);return o.Log.debug("OidcClient.processSignoutResponse: Received state from storage; validating response"),n._validator.validateSignoutResponse(t,i)})},e.prototype.clearStaleState=function e(t){return o.Log.debug("OidcClient.clearStaleState"),t=t||this._stateStore,p.State.clearStaleState(t,this.settings.staleStateAge)},n(e,[{key:"_stateStore",get:function e(){return this.settings.stateStore}},{key:"_validator",get:function e(){return this.settings.validator}},{key:"_metadataService",get:function e(){return this.settings.metadataService}},{key:"settings",get:function e(){return this._settings}},{key:"metadataService",get:function e(){return this._metadataService}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClient=void 0;var n=r(37),o=r(9),i=r(0);t.TokenClient=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.JsonService,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.MetadataService;if(function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t)throw i.Log.error("TokenClient.ctor: No settings passed"),new Error("settings");this._settings=t,this._jsonService=new r,this._metadataService=new s(this._settings)}return e.prototype.exchangeCode=function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r.grant_type=r.grant_type||"authorization_code",r.client_id=r.client_id||this._settings.client_id,r.redirect_uri=r.redirect_uri||this._settings.redirect_uri,r.code?r.redirect_uri?r.code_verifier?r.client_id?this._metadataService.getTokenEndpoint(!1).then(function(e){return i.Log.debug("TokenClient.exchangeCode: Received token endpoint"),t._jsonService.postForm(e,r).then(function(e){return i.Log.debug("TokenClient.exchangeCode: response received"),e})}):(i.Log.error("TokenClient.exchangeCode: No client_id passed"),Promise.reject(new Error("A client_id is required"))):(i.Log.error("TokenClient.exchangeCode: No code_verifier passed"),Promise.reject(new Error("A code_verifier is required"))):(i.Log.error("TokenClient.exchangeCode: No redirect_uri passed"),Promise.reject(new Error("A redirect_uri is required"))):(i.Log.error("TokenClient.exchangeCode: No code passed"),Promise.reject(new Error("A code is required")))},e.prototype.exchangeRefreshToken=function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r.grant_type=r.grant_type||"refresh_token",r.client_id=r.client_id||this._settings.client_id,r.refresh_token?r.client_id?this._metadataService.getTokenEndpoint(!1).then(function(e){return i.Log.debug("TokenClient.exchangeRefreshToken: Received token endpoint"),t._jsonService.postForm(e,r).then(function(e){return i.Log.debug("TokenClient.exchangeRefreshToken: response received"),e})}):(i.Log.error("TokenClient.exchangeRefreshToken: No client_id passed"),Promise.reject(new Error("A client_id is required"))):(i.Log.error("TokenClient.exchangeRefreshToken: No refresh_token passed"),Promise.reject(new Error("A refresh_token is required")))},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorResponse=void 0;var n=r(0);t.ErrorResponse=function(e){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=r.error,i=r.error_description,s=r.error_uri,a=r.state;if(function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),!o)throw n.Log.error("No error passed to ErrorResponse"),new Error("error");var c=function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,i||o));return c.name="ErrorResponse",c.error=o,c.error_description=i,c.error_uri=s,c.state=a,c}return function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(Error)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SigninRequest=void 0;var n=r(0),o=r(16),i=r(53);t.SigninRequest=function(){function e(t){var r=t.url,s=t.client_id,a=t.redirect_uri,u=t.response_type,c=t.scope,l=t.authority,f=t.data,p=t.prompt,d=t.display,h=t.max_age,g=t.ui_locales,_=t.id_token_hint,v=t.login_hint,y=t.acr_values,m=t.resource,w=t.response_mode,b=t.request,S=t.request_uri,k=t.extraQueryParams;if(function T(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!r)throw n.Log.error("SigninRequest.ctor: No url passed"),new Error("url");if(!s)throw n.Log.error("SigninRequest.ctor: No client_id passed"),new Error("client_id");if(!a)throw n.Log.error("SigninRequest.ctor: No redirect_uri passed"),new Error("redirect_uri");if(!u)throw n.Log.error("SigninRequest.ctor: No response_type passed"),new Error("response_type");if(!c)throw n.Log.error("SigninRequest.ctor: No scope passed"),new Error("scope");if(!l)throw n.Log.error("SigninRequest.ctor: No authority passed"),new Error("authority");var E=e.isOidc(u),L=e.isCode(u);this.state=new i.SigninState({nonce:E,data:f,client_id:s,authority:l,redirect_uri:a,code_verifier:L}),r=o.UrlUtility.addQueryParam(r,"client_id",s),r=o.UrlUtility.addQueryParam(r,"redirect_uri",a),r=o.UrlUtility.addQueryParam(r,"response_type",u),r=o.UrlUtility.addQueryParam(r,"scope",c),r=o.UrlUtility.addQueryParam(r,"state",this.state.id),E&&(r=o.UrlUtility.addQueryParam(r,"nonce",this.state.nonce)),L&&(r=o.UrlUtility.addQueryParam(r,"code_challenge",this.state.code_challenge),r=o.UrlUtility.addQueryParam(r,"code_challenge_method","S256"));var P={prompt:p,display:d,max_age:h,ui_locales:g,id_token_hint:_,login_hint:v,acr_values:y,resource:m,request:b,request_uri:S,response_mode:w};for(var R in P)P[R]&&(r=o.UrlUtility.addQueryParam(r,R,P[R]));for(var x in k)r=o.UrlUtility.addQueryParam(r,x,k[x]);this.url=r}return e.isOidc=function e(t){return!!t.split(/\s+/g).filter(function(e){return"id_token"===e})[0]},e.isOAuth=function e(t){return!!t.split(/\s+/g).filter(function(e){return"token"===e})[0]},e.isCode=function e(t){return!!t.split(/\s+/g).filter(function(e){return"code"===e})[0]},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SigninState=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=r(0),i=r(38),s=r(20),a=function u(e){return e&&e.__esModule?e:{default:e}}(r(54));t.SigninState=function(e){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.nonce,o=r.authority,i=r.client_id,u=r.redirect_uri,c=r.code_verifier;!function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var f=function p(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,arguments[0]));if(!0===n?f._nonce=(0,a.default)():n&&(f._nonce=n),!0===c?f._code_verifier=(0,a.default)()+(0,a.default)()+(0,a.default)():c&&(f._code_verifier=c),f.code_verifier){var d=s.JoseUtil.hashString(f.code_verifier,"SHA256");f._code_challenge=s.JoseUtil.hexToBase64Url(d)}return f._redirect_uri=u,f._authority=o,f._client_id=i,f}return function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.toStorageString=function e(){return o.Log.debug("SigninState.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,nonce:this.nonce,code_verifier:this.code_verifier,redirect_uri:this.redirect_uri,authority:this.authority,client_id:this.client_id})},t.fromStorageString=function e(r){return o.Log.debug("SigninState.fromStorageString"),new t(JSON.parse(r))},n(t,[{key:"nonce",get:function e(){return this._nonce}},{key:"authority",get:function e(){return this._authority}},{key:"client_id",get:function e(){return this._client_id}},{key:"redirect_uri",get:function e(){return this._redirect_uri}},{key:"code_verifier",get:function e(){return this._code_verifier}},{key:"code_challenge",get:function e(){return this._code_challenge}}]),t}(i.State)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function n(){return(0,o.default)().replace(/-/g,"")};var o=function i(e){return e&&e.__esModule?e:{default:e}}(r(122));e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.User=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=r(0);t.User=function(){function e(t){var r=t.id_token,n=t.session_state,o=t.access_token,i=t.refresh_token,s=t.token_type,a=t.scope,u=t.profile,c=t.expires_at,l=t.state;!function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id_token=r,this.session_state=n,this.access_token=o,this.refresh_token=i,this.token_type=s,this.scope=a,this.profile=u,this.expires_at=c,this.state=l}return e.prototype.toStorageString=function e(){return o.Log.debug("User.toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})},e.fromStorageString=function t(r){return o.Log.debug("User.fromStorageString"),new e(JSON.parse(r))},n(e,[{key:"expires_in",get:function e(){if(this.expires_at){var t=parseInt(Date.now()/1e3);return this.expires_at-t}},set:function e(t){var r=parseInt(t);if("number"==typeof r&&r>0){var n=parseInt(Date.now()/1e3);this.expires_at=n+r}}},{key:"expired",get:function e(){var t=this.expires_in;if(void 0!==t)return t<=0}},{key:"scopes",get:function e(){return(this.scope||"").split(" ")}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AccessTokenEvents=void 0;var n=r(0),o=r(137);var i=60;t.AccessTokenEvents=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.accessTokenExpiringNotificationTime,n=void 0===r?i:r,s=t.accessTokenExpiringTimer,a=void 0===s?new o.Timer("Access token expiring"):s,u=t.accessTokenExpiredTimer,c=void 0===u?new o.Timer("Access token expired"):u;!function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._accessTokenExpiringNotificationTime=n,this._accessTokenExpiring=a,this._accessTokenExpired=c}return e.prototype.load=function e(t){if(t.access_token&&void 0!==t.expires_in){var r=t.expires_in;if(n.Log.debug("AccessTokenEvents.load: access token present, remaining duration:",r),r>0){var o=r-this._accessTokenExpiringNotificationTime;o<=0&&(o=1),n.Log.debug("AccessTokenEvents.load: registering expiring timer in:",o),this._accessTokenExpiring.init(o)}else n.Log.debug("AccessTokenEvents.load: canceling existing expiring timer becase we're past expiration."),this._accessTokenExpiring.cancel();var i=r+1;n.Log.debug("AccessTokenEvents.load: registering expired timer in:",i),this._accessTokenExpired.init(i)}else this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()},e.prototype.unload=function e(){n.Log.debug("AccessTokenEvents.unload: canceling existing access token timers"),this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()},e.prototype.addAccessTokenExpiring=function e(t){this._accessTokenExpiring.addHandler(t)},e.prototype.removeAccessTokenExpiring=function e(t){this._accessTokenExpiring.removeHandler(t)},e.prototype.addAccessTokenExpired=function e(t){this._accessTokenExpired.addHandler(t)},e.prototype.removeAccessTokenExpired=function e(t){this._accessTokenExpired.removeHandler(t)},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Event=void 0;var n=r(0);t.Event=function(){function e(t){!function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._name=t,this._callbacks=[]}return e.prototype.addHandler=function e(t){this._callbacks.push(t)},e.prototype.removeHandler=function e(t){var r=this._callbacks.findIndex(function(e){return e===t});r>=0&&this._callbacks.splice(r,1)},e.prototype.raise=function e(){n.Log.debug("Event: Raising event: "+this._name);for(var t=0;t<this._callbacks.length;t++){var r;(r=this._callbacks)[t].apply(r,arguments)}},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SessionMonitor=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=r(0),i=r(59);t.SessionMonitor=function(){function e(t){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.CheckSessionIFrame;if(function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t)throw o.Log.error("SessionMonitor.ctor: No user manager passed to SessionMonitor"),new Error("userManager");this._userManager=t,this._CheckSessionIFrameCtor=n,this._userManager.events.addUserLoaded(this._start.bind(this)),this._userManager.events.addUserUnloaded(this._stop.bind(this)),this._userManager.getUser().then(function(e){e&&r._start(e)}).catch(function(e){o.Log.error("SessionMonitor ctor: error from getUser:",e.message)})}return e.prototype._start=function e(t){var r=this,n=t.session_state;n&&(this._sub=t.profile.sub,this._sid=t.profile.sid,o.Log.debug("SessionMonitor._start: session_state:",n,", sub:",this._sub),this._checkSessionIFrame?this._checkSessionIFrame.start(n):this._metadataService.getCheckSessionIframe().then(function(e){if(e){o.Log.debug("SessionMonitor._start: Initializing check session iframe");var t=r._client_id,i=r._checkSessionInterval,s=r._stopCheckSessionOnError;r._checkSessionIFrame=new r._CheckSessionIFrameCtor(r._callback.bind(r),t,e,i,s),r._checkSessionIFrame.load().then(function(){r._checkSessionIFrame.start(n)})}else o.Log.warn("SessionMonitor._start: No check session iframe found in the metadata")}).catch(function(e){o.Log.error("SessionMonitor._start: Error from getCheckSessionIframe:",e.message)}))},e.prototype._stop=function e(){this._sub=null,this._sid=null,this._checkSessionIFrame&&(o.Log.debug("SessionMonitor._stop"),this._checkSessionIFrame.stop())},e.prototype._callback=function e(){var t=this;this._userManager.querySessionStatus().then(function(e){var r=!0;e?e.sub===t._sub?(r=!1,t._checkSessionIFrame.start(e.session_state),e.sid===t._sid?o.Log.debug("SessionMonitor._callback: Same sub still logged in at OP, restarting check session iframe; session_state:",e.session_state):(o.Log.debug("SessionMonitor._callback: Same sub still logged in at OP, session state has changed, restarting check session iframe; session_state:",e.session_state),t._userManager.events._raiseUserSessionChanged())):o.Log.debug("SessionMonitor._callback: Different subject signed into OP:",e.sub):o.Log.debug("SessionMonitor._callback: Subject no longer signed into OP"),r&&(o.Log.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed out event"),t._userManager.events._raiseUserSignedOut())}).catch(function(e){o.Log.debug("SessionMonitor._callback: Error calling queryCurrentSigninSession; raising signed out event",e.message),t._userManager.events._raiseUserSignedOut()})},n(e,[{key:"_settings",get:function e(){return this._userManager.settings}},{key:"_metadataService",get:function e(){return this._userManager.metadataService}},{key:"_client_id",get:function e(){return this._settings.client_id}},{key:"_checkSessionInterval",get:function e(){return this._settings.checkSessionInterval}},{key:"_stopCheckSessionOnError",get:function e(){return this._settings.stopCheckSessionOnError}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CheckSessionIFrame=void 0;var n=r(0);var o=2e3;t.CheckSessionIFrame=function(){function e(t,r,n,i){var s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];!function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._callback=t,this._client_id=r,this._url=n,this._interval=i||o,this._stopOnError=s;var u=n.indexOf("/",n.indexOf("//")+2);this._frame_origin=n.substr(0,u),this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="absolute",this._frame.style.display="none",this._frame.style.width=0,this._frame.style.height=0,this._frame.src=n}return e.prototype.load=function e(){var t=this;return new Promise(function(e){t._frame.onload=function(){e()},window.document.body.appendChild(t._frame),t._boundMessageEvent=t._message.bind(t),window.addEventListener("message",t._boundMessageEvent,!1)})},e.prototype._message=function e(t){t.origin===this._frame_origin&&t.source===this._frame.contentWindow&&("error"===t.data?(n.Log.error("CheckSessionIFrame: error message from check session op iframe"),this._stopOnError&&this.stop()):"changed"===t.data?(n.Log.debug("CheckSessionIFrame: changed message from check session op iframe"),this.stop(),this._callback()):n.Log.debug("CheckSessionIFrame: "+t.data+" message from check session op iframe"))},e.prototype.start=function e(t){var r=this;if(this._session_state!==t){n.Log.debug("CheckSessionIFrame.start"),this.stop(),this._session_state=t;var o=function e(){r._frame.contentWindow.postMessage(r._client_id+" "+r._session_state,r._frame_origin)};o(),this._timer=window.setInterval(o,this._interval)}},e.prototype.stop=function e(){this._session_state=null,this._timer&&(n.Log.debug("CheckSessionIFrame.stop"),window.clearInterval(this._timer),this._timer=null)},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenRevocationClient=void 0;var n=r(0),o=r(9),i=r(7);t.TokenRevocationClient=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.Global.XMLHttpRequest,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.MetadataService;if(function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t)throw n.Log.error("TokenRevocationClient.ctor: No settings provided"),new Error("No settings provided.");this._settings=t,this._XMLHttpRequestCtor=r,this._metadataService=new s(this._settings)}return e.prototype.revoke=function e(t,r){var o=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"access_token";if(!t)throw n.Log.error("TokenRevocationClient.revoke: No token provided"),new Error("No token provided.");if("access_token"!==i&&"refresh_token"!=i)throw n.Log.error("TokenRevocationClient.revoke: Invalid token type"),new Error("Invalid token type.");return this._metadataService.getRevocationEndpoint().then(function(e){if(e){n.Log.debug("TokenRevocationClient.revoke: Revoking "+i);var s=o._settings.client_id,a=o._settings.client_secret;return o._revoke(e,s,a,t,i)}if(r)throw n.Log.error("TokenRevocationClient.revoke: Revocation not supported"),new Error("Revocation not supported")})},e.prototype._revoke=function e(t,r,o,i,s){var a=this;return new Promise(function(e,u){var c=new a._XMLHttpRequestCtor;c.open("POST",t),c.onload=function(){n.Log.debug("TokenRevocationClient.revoke: HTTP response received, status",c.status),200===c.status?e():u(Error(c.statusText+" ("+c.status+")"))},c.onerror=function(){n.Log.debug("TokenRevocationClient.revoke: Network Error."),u("Network Error")};var l="client_id="+encodeURIComponent(r);o&&(l+="&client_secret="+encodeURIComponent(o)),l+="&token_type_hint="+encodeURIComponent(s),l+="&token="+encodeURIComponent(i),c.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),c.send(l)})},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CordovaPopupWindow=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=r(0);var i="location=no,toolbar=no,zoom=no",s="_blank";t.CordovaPopupWindow=function(){function e(t){var r=this;!function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._promise=new Promise(function(e,t){r._resolve=e,r._reject=t}),this.features=t.popupWindowFeatures||i,this.target=t.popupWindowTarget||s,this.redirect_uri=t.startUrl,o.Log.debug("CordovaPopupWindow.ctor: redirect_uri: "+this.redirect_uri)}return e.prototype._isInAppBrowserInstalled=function e(t){return["cordova-plugin-inappbrowser","cordova-plugin-inappbrowser.inappbrowser","org.apache.cordova.inappbrowser"].some(function(e){return t.hasOwnProperty(e)})},e.prototype.navigate=function e(t){if(t&&t.url){if(!window.cordova)return this._error("cordova is undefined");var r=window.cordova.require("cordova/plugin_list").metadata;if(!1===this._isInAppBrowserInstalled(r))return this._error("InAppBrowser plugin not found");this._popup=cordova.InAppBrowser.open(t.url,this.target,this.features),this._popup?(o.Log.debug("CordovaPopupWindow.navigate: popup successfully created"),this._exitCallbackEvent=this._exitCallback.bind(this),this._loadStartCallbackEvent=this._loadStartCallback.bind(this),this._popup.addEventListener("exit",this._exitCallbackEvent,!1),this._popup.addEventListener("loadstart",this._loadStartCallbackEvent,!1)):this._error("Error opening popup window")}else this._error("No url provided");return this.promise},e.prototype._loadStartCallback=function e(t){0===t.url.indexOf(this.redirect_uri)&&this._success({url:t.url})},e.prototype._exitCallback=function e(t){this._error(t)},e.prototype._success=function e(t){this._cleanup(),o.Log.debug("CordovaPopupWindow: Successful response from cordova popup window"),this._resolve(t)},e.prototype._error=function e(t){this._cleanup(),o.Log.error(t),this._reject(new Error(t))},e.prototype.close=function e(){this._cleanup()},e.prototype._cleanup=function e(){this._popup&&(o.Log.debug("CordovaPopupWindow: cleaning up popup"),this._popup.removeEventListener("exit",this._exitCallbackEvent,!1),this._popup.removeEventListener("loadstart",this._loadStartCallbackEvent,!1),this._popup.close()),this._popup=null},n(e,[{key:"promise",get:function e(){return this._promise}}]),e}()},function(e,t,r){r(63),e.exports=r(113)},function(e,t,r){"use strict";r(64),r(95),r(98),r(103),r(107),r(110),r(112)},function(e,t,r){r(65),r(69),r(78),r(81),e.exports=r(3).Promise},function(e,t,r){"use strict";var n=r(21),o={};o[r(1)("toStringTag")]="z",o+""!="[object z]"&&r(11)(Object.prototype,"toString",function e(){return"[object "+n(this)+"]"},!0)},function(e,t,r){e.exports=!r(12)&&!r(18)(function(){return 7!=Object.defineProperty(r(25)("div"),"a",{get:function(){return 7}}).a})},function(e,t,r){var n=r(5);e.exports=function(e,t){if(!n(e))return e;var r,o;if(t&&"function"==typeof(r=e.toString)&&!n(o=r.call(e)))return o;if("function"==typeof(r=e.valueOf)&&!n(o=r.call(e)))return o;if(!t&&"function"==typeof(r=e.toString)&&!n(o=r.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t,r){e.exports=r(22)("native-function-to-string",Function.toString)},function(e,t,r){"use strict";var n=r(70)(!0);r(40)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,r=this._i;return r>=t.length?{value:void 0,done:!0}:(e=n(t,r),this._i+=e.length,{value:e,done:!1})})},function(e,t,r){var n=r(26),o=r(27);e.exports=function(e){return function(t,r){var i,s,a=String(o(t)),u=n(r),c=a.length;return u<0||u>=c?e?"":void 0:(i=a.charCodeAt(u))<55296||i>56319||u+1===c||(s=a.charCodeAt(u+1))<56320||s>57343?e?a.charAt(u):i:e?a.slice(u,u+2):s-56320+(i-55296<<10)+65536}}},function(e,t,r){"use strict";var n=r(72),o=r(39),i=r(33),s={};r(8)(s,r(1)("iterator"),function(){return this}),e.exports=function(e,t,r){e.prototype=n(s,{next:o(1,r)}),i(e,t+" Iterator")}},function(e,t,r){var n=r(4),o=r(73),i=r(41),s=r(32)("IE_PROTO"),a=function(){},u=function(){var e,t=r(25)("iframe"),n=i.length;for(t.style.display="none",r(42).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;n--;)delete u.prototype[i[n]];return u()};e.exports=Object.create||function e(t,r){var i;return null!==t?(a.prototype=n(t),i=new a,a.prototype=null,i[s]=t):i=u(),void 0===r?i:o(i,r)}},function(e,t,r){var n=r(17),o=r(4),i=r(28);e.exports=r(12)?Object.defineProperties:function e(t,r){o(t);for(var s,a=i(r),u=a.length,c=0;u>c;)n.f(t,s=a[c++],r[s]);return t}},function(e,t,r){var n=r(19),o=r(29),i=r(75)(!1),s=r(32)("IE_PROTO");e.exports=function(e,t){var r,a=o(e),u=0,c=[];for(r in a)r!=s&&n(a,r)&&c.push(r);for(;t.length>u;)n(a,r=t[u++])&&(~i(c,r)||c.push(r));return c}},function(e,t,r){var n=r(29),o=r(31),i=r(76);e.exports=function(e){return function(t,r,s){var a,u=n(t),c=o(u.length),l=i(s,c);if(e&&r!=r){for(;c>l;)if((a=u[l++])!=a)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===r)return e||l||0;return!e&&-1}}},function(e,t,r){var n=r(26),o=Math.max,i=Math.min;e.exports=function(e,t){return(e=n(e))<0?o(e+t,0):i(e,t)}},function(e,t,r){var n=r(19),o=r(34),i=r(32)("IE_PROTO"),s=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),n(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?s:null}},function(e,t,r){for(var n=r(79),o=r(28),i=r(11),s=r(2),a=r(8),u=r(15),c=r(1),l=c("iterator"),f=c("toStringTag"),p=u.Array,d={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},h=o(d),g=0;g<h.length;g++){var _,v=h[g],y=d[v],m=s[v],w=m&&m.prototype;if(w&&(w[l]||a(w,l,p),w[f]||a(w,f,v),u[v]=p,y))for(_ in n)w[_]||i(w,_,n[_],!0)}},function(e,t,r){"use strict";var n=r(43),o=r(80),i=r(15),s=r(29);e.exports=r(40)(Array,"Array",function(e,t){this._t=s(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,r=this._i++;return!e||r>=e.length?(this._t=void 0,o(1)):o(0,"keys"==t?r:"values"==t?e[r]:[r,e[r]])},"values"),i.Arguments=i.Array,n("keys"),n("values"),n("entries")},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,r){"use strict";var n,o,i,s,a=r(23),u=r(2),c=r(13),l=r(21),f=r(6),p=r(5),d=r(14),h=r(82),g=r(83),_=r(87),v=r(44).set,y=r(88)(),m=r(46),w=r(89),b=r(90),S=r(91),k=u.TypeError,T=u.process,E=T&&T.versions,L=E&&E.v8||"",P=u.Promise,R="process"==l(T),x=function(){},C=o=m.f,U=!!function(){try{var e=P.resolve(1),t=(e.constructor={})[r(1)("species")]=function(e){e(x,x)};return(R||"function"==typeof PromiseRejectionEvent)&&e.then(x)instanceof t&&0!==L.indexOf("6.6")&&-1===b.indexOf("Chrome/66")}catch(e){}}(),M=function(e){var t;return!(!p(e)||"function"!=typeof(t=e.then))&&t},O=function(e,t){if(!e._n){e._n=!0;var r=e._c;y(function(){for(var n=e._v,o=1==e._s,i=0,s=function(t){var r,i,s,a=o?t.ok:t.fail,u=t.resolve,c=t.reject,l=t.domain;try{a?(o||(2==e._h&&A(e),e._h=1),!0===a?r=n:(l&&l.enter(),r=a(n),l&&(l.exit(),s=!0)),r===t.promise?c(k("Promise-chain cycle")):(i=M(r))?i.call(r,u,c):u(r)):c(n)}catch(e){l&&!s&&l.exit(),c(e)}};r.length>i;)s(r[i++]);e._c=[],e._n=!1,t&&!e._h&&j(e)})}},j=function(e){v.call(u,function(){var t,r,n,o=e._v,i=I(e);if(i&&(t=w(function(){R?T.emit("unhandledRejection",o,e):(r=u.onunhandledrejection)?r({promise:e,reason:o}):(n=u.console)&&n.error&&n.error("Unhandled promise rejection",o)}),e._h=R||I(e)?2:1),e._a=void 0,i&&t.e)throw t.v})},I=function(e){return 1!==e._h&&0===(e._a||e._c).length},A=function(e){v.call(u,function(){var t;R?T.emit("rejectionHandled",e):(t=u.onrejectionhandled)&&t({promise:e,reason:e._v})})},N=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),O(t,!0))},F=function(e){var t,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===e)throw k("Promise can't be resolved itself");(t=M(e))?y(function(){var n={_w:r,_d:!1};try{t.call(e,c(F,n,1),c(N,n,1))}catch(e){N.call(n,e)}}):(r._v=e,r._s=1,O(r,!1))}catch(e){N.call({_w:r,_d:!1},e)}}};U||(P=function e(t){h(this,P,"Promise","_h"),d(t),n.call(this);try{t(c(F,this,1),c(N,this,1))}catch(e){N.call(this,e)}},(n=function e(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=r(92)(P.prototype,{then:function e(t,r){var n=C(_(this,P));return n.ok="function"!=typeof t||t,n.fail="function"==typeof r&&r,n.domain=R?T.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&O(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new n;this.promise=e,this.resolve=c(F,e,1),this.reject=c(N,e,1)},m.f=C=function(e){return e===P||e===s?new i(e):o(e)}),f(f.G+f.W+f.F*!U,{Promise:P}),r(33)(P,"Promise"),r(93)("Promise"),s=r(3).Promise,f(f.S+f.F*!U,"Promise",{reject:function e(t){var r=C(this);return(0,r.reject)(t),r.promise}}),f(f.S+f.F*(a||!U),"Promise",{resolve:function e(t){return S(a&&this===s?P:this,t)}}),f(f.S+f.F*!(U&&r(94)(function(e){P.all(e).catch(x)})),"Promise",{all:function e(t){var r=this,n=C(r),o=n.resolve,i=n.reject,s=w(function(){var e=[],n=0,s=1;g(t,!1,function(t){var a=n++,u=!1;e.push(void 0),s++,r.resolve(t).then(function(t){u||(u=!0,e[a]=t,--s||o(e))},i)}),--s||o(e)});return s.e&&i(s.v),n.promise},race:function e(t){var r=this,n=C(r),o=n.reject,i=w(function(){g(t,!1,function(e){r.resolve(e).then(n.resolve,o)})});return i.e&&o(i.v),n.promise}})},function(e,t){e.exports=function(e,t,r,n){if(!(e instanceof t)||void 0!==n&&n in e)throw TypeError(r+": incorrect invocation!");return e}},function(e,t,r){var n=r(13),o=r(84),i=r(85),s=r(4),a=r(31),u=r(86),c={},l={};(t=e.exports=function(e,t,r,f,p){var d,h,g,_,v=p?function(){return e}:u(e),y=n(r,f,t?2:1),m=0;if("function"!=typeof v)throw TypeError(e+" is not iterable!");if(i(v)){for(d=a(e.length);d>m;m++)if((_=t?y(s(h=e[m])[0],h[1]):y(e[m]))===c||_===l)return _}else for(g=v.call(e);!(h=g.next()).done;)if((_=o(g,y,h.value,t))===c||_===l)return _}).BREAK=c,t.RETURN=l},function(e,t,r){var n=r(4);e.exports=function(e,t,r,o){try{return o?t(n(r)[0],r[1]):t(r)}catch(t){var i=e.return;throw void 0!==i&&n(i.call(e)),t}}},function(e,t,r){var n=r(15),o=r(1)("iterator"),i=Array.prototype;e.exports=function(e){return void 0!==e&&(n.Array===e||i[o]===e)}},function(e,t,r){var n=r(21),o=r(1)("iterator"),i=r(15);e.exports=r(3).getIteratorMethod=function(e){if(void 0!=e)return e[o]||e["@@iterator"]||i[n(e)]}},function(e,t,r){var n=r(4),o=r(14),i=r(1)("species");e.exports=function(e,t){var r,s=n(e).constructor;return void 0===s||void 0==(r=n(s)[i])?t:o(r)}},function(e,t,r){var n=r(2),o=r(44).set,i=n.MutationObserver||n.WebKitMutationObserver,s=n.process,a=n.Promise,u="process"==r(10)(s);e.exports=function(){var e,t,r,c=function(){var n,o;for(u&&(n=s.domain)&&n.exit();e;){o=e.fn,e=e.next;try{o()}catch(n){throw e?r():t=void 0,n}}t=void 0,n&&n.enter()};if(u)r=function(){s.nextTick(c)};else if(!i||n.navigator&&n.navigator.standalone)if(a&&a.resolve){var l=a.resolve(void 0);r=function(){l.then(c)}}else r=function(){o.call(n,c)};else{var f=!0,p=document.createTextNode("");new i(c).observe(p,{characterData:!0}),r=function(){p.data=f=!f}}return function(n){var o={fn:n,next:void 0};t&&(t.next=o),e||(e=o,r()),t=o}}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,r){var n=r(2).navigator;e.exports=n&&n.userAgent||""},function(e,t,r){var n=r(4),o=r(5),i=r(46);e.exports=function(e,t){if(n(e),o(t)&&t.constructor===e)return t;var r=i.f(e);return(0,r.resolve)(t),r.promise}},function(e,t,r){var n=r(11);e.exports=function(e,t,r){for(var o in t)n(e,o,t[o],r);return e}},function(e,t,r){"use strict";var n=r(2),o=r(17),i=r(12),s=r(1)("species");e.exports=function(e){var t=n[e];i&&t&&!t[s]&&o.f(t,s,{configurable:!0,get:function(){return this}})}},function(e,t,r){var n=r(1)("iterator"),o=!1;try{var i=[7][n]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var r=!1;try{var i=[7],s=i[n]();s.next=function(){return{done:r=!0}},i[n]=function(){return s},e(i)}catch(e){}return r}},function(e,t,r){r(96),e.exports=r(3).Function.bind},function(e,t,r){var n=r(6);n(n.P,"Function",{bind:r(97)})},function(e,t,r){"use strict";var n=r(14),o=r(5),i=r(45),s=[].slice,a={};e.exports=Function.bind||function e(t){var r=n(this),u=s.call(arguments,1),c=function(){var e=u.concat(s.call(arguments));return this instanceof c?function(e,t,r){if(!(t in a)){for(var n=[],o=0;o<t;o++)n[o]="a["+o+"]";a[t]=Function("F,a","return new F("+n.join(",")+")")}return a[t](e,r)}(r,e.length,e):i(r,e,t)};return o(r.prototype)&&(c.prototype=r.prototype),c}},function(e,t,r){r(99),e.exports=r(3).Object.assign},function(e,t,r){var n=r(6);n(n.S+n.F,"Object",{assign:r(100)})},function(e,t,r){"use strict";var n=r(28),o=r(101),i=r(102),s=r(34),a=r(30),u=Object.assign;e.exports=!u||r(18)(function(){var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(e){t[e]=e}),7!=u({},e)[r]||Object.keys(u({},t)).join("")!=n})?function e(t,r){for(var u=s(t),c=arguments.length,l=1,f=o.f,p=i.f;c>l;)for(var d,h=a(arguments[l++]),g=f?n(h).concat(f(h)):n(h),_=g.length,v=0;_>v;)p.call(h,d=g[v++])&&(u[d]=h[d]);return u}:u},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,r){r(104),e.exports=r(3).Array.find},function(e,t,r){"use strict";var n=r(6),o=r(47)(5),i=!0;"find"in[]&&Array(1).find(function(){i=!1}),n(n.P+n.F*i,"Array",{find:function e(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),r(43)("find")},function(e,t,r){var n=r(106);e.exports=function(e,t){return new(n(e))(t)}},function(e,t,r){var n=r(5),o=r(48),i=r(1)("species");e.exports=function(e){var t;return o(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!o(t.prototype)||(t=void 0),n(t)&&null===(t=t[i])&&(t=void 0)),void 0===t?Array:t}},function(e,t,r){r(108),e.exports=r(3).Array.some},function(e,t,r){"use strict";var n=r(6),o=r(47)(3);n(n.P+n.F*!r(109)([].some,!0),"Array",{some:function e(t){return o(this,t,arguments[1])}})},function(e,t,r){"use strict";var n=r(18);e.exports=function(e,t){return!!e&&n(function(){t?e.call(null,function(){},1):e.call(null)})}},function(e,t,r){r(111),e.exports=r(3).Array.isArray},function(e,t,r){var n=r(6);n(n.S,"Array",{isArray:r(48)})},function(e,t){e.exports=function(){return Function.call.apply(Array.prototype.splice,arguments)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),o=r(49),i=r(35),s=r(36),a=r(128),u=r(129),c=r(56),l=r(9),f=r(139),p=r(140),d=r(59),h=r(60),g=r(58),_=r(7),v=r(55);t.default={Log:n.Log,OidcClient:o.OidcClient,OidcClientSettings:i.OidcClientSettings,WebStorageStateStore:s.WebStorageStateStore,InMemoryWebStorage:a.InMemoryWebStorage,UserManager:u.UserManager,AccessTokenEvents:c.AccessTokenEvents,MetadataService:l.MetadataService,CordovaPopupNavigator:f.CordovaPopupNavigator,CordovaIFrameNavigator:p.CordovaIFrameNavigator,CheckSessionIFrame:d.CheckSessionIFrame,TokenRevocationClient:h.TokenRevocationClient,SessionMonitor:g.SessionMonitor,Global:_.Global,User:v.User},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResponseValidator=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=r(0),i=r(9),s=r(115),a=r(50),u=r(51),c=r(20);var l=["nonce","at_hash","iat","nbf","exp","aud","iss","c_hash"];t.ResponseValidator=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.MetadataService,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.UserInfoService,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:c.JoseUtil,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:a.TokenClient;if(function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t)throw o.Log.error("ResponseValidator.ctor: No settings passed to ResponseValidator"),new Error("settings");this._settings=t,this._metadataService=new r(this._settings),this._userInfoService=new n(this._settings),this._joseUtil=u,this._tokenClient=new l(this._settings)}return e.prototype.validateSigninResponse=function e(t,r){var n=this;return o.Log.debug("ResponseValidator.validateSigninResponse"),this._processSigninParams(t,r).then(function(e){return o.Log.debug("ResponseValidator.validateSigninResponse: state processed"),n._validateTokens(t,e).then(function(e){return o.Log.debug("ResponseValidator.validateSigninResponse: tokens validated"),n._processClaims(e).then(function(e){return o.Log.debug("ResponseValidator.validateSigninResponse: claims processed"),e})})})},e.prototype.validateSignoutResponse=function e(t,r){return t.id!==r.state?(o.Log.error("ResponseValidator.validateSignoutResponse: State does not match"),Promise.reject(new Error("State does not match"))):(o.Log.debug("ResponseValidator.validateSignoutResponse: state validated"),r.state=t.data,r.error?(o.Log.warn("ResponseValidator.validateSignoutResponse: Response was error",r.error),Promise.reject(new u.ErrorResponse(r))):Promise.resolve(r))},e.prototype._processSigninParams=function e(t,r){if(t.id!==r.state)return o.Log.error("ResponseValidator._processSigninParams: State does not match"),Promise.reject(new Error("State does not match"));if(!t.client_id)return o.Log.error("ResponseValidator._processSigninParams: No client_id on state"),Promise.reject(new Error("No client_id on state"));if(!t.authority)return o.Log.error("ResponseValidator._processSigninParams: No authority on state"),Promise.reject(new Error("No authority on state"));if(this._settings.authority){if(this._settings.authority&&this._settings.authority!==t.authority)return o.Log.error("ResponseValidator._processSigninParams: authority mismatch on settings vs. signin state"),Promise.reject(new Error("authority mismatch on settings vs. signin state"))}else this._settings.authority=t.authority;if(this._settings.client_id){if(this._settings.client_id&&this._settings.client_id!==t.client_id)return o.Log.error("ResponseValidator._processSigninParams: client_id mismatch on settings vs. signin state"),Promise.reject(new Error("client_id mismatch on settings vs. signin state"))}else this._settings.client_id=t.client_id;return o.Log.debug("ResponseValidator._processSigninParams: state validated"),r.state=t.data,r.error?(o.Log.warn("ResponseValidator._processSigninParams: Response was error",r.error),Promise.reject(new u.ErrorResponse(r))):t.nonce&&!r.id_token?(o.Log.error("ResponseValidator._processSigninParams: Expecting id_token in response"),Promise.reject(new Error("No id_token in response"))):!t.nonce&&r.id_token?(o.Log.error("ResponseValidator._processSigninParams: Not expecting id_token in response"),Promise.reject(new Error("Unexpected id_token in response"))):t.code_verifier&&!r.code?(o.Log.error("ResponseValidator._processSigninParams: Expecting code in response"),Promise.reject(new Error("No code in response"))):!t.code_verifier&&r.code?(o.Log.error("ResponseValidator._processSigninParams: Not expecting code in response"),Promise.reject(new Error("Unexpected code in response"))):Promise.resolve(r)},e.prototype._processClaims=function e(t){var r=this;if(t.isOpenIdConnect){if(o.Log.debug("ResponseValidator._processClaims: response is OIDC, processing claims"),t.profile=this._filterProtocolClaims(t.profile),this._settings.loadUserInfo&&t.access_token)return o.Log.debug("ResponseValidator._processClaims: loading user info"),this._userInfoService.getClaims(t.access_token).then(function(e){return o.Log.debug("ResponseValidator._processClaims: user info claims received from user info endpoint"),e.sub!==t.profile.sub?(o.Log.error("ResponseValidator._processClaims: sub from user info endpoint does not match sub in access_token"),Promise.reject(new Error("sub from user info endpoint does not match sub in access_token"))):(t.profile=r._mergeClaims(t.profile,e),o.Log.debug("ResponseValidator._processClaims: user info claims received, updated profile:",t.profile),t)});o.Log.debug("ResponseValidator._processClaims: not loading user info")}else o.Log.debug("ResponseValidator._processClaims: response is not OIDC, not processing claims");return Promise.resolve(t)},e.prototype._mergeClaims=function e(t,r){var o=Object.assign({},t);for(var i in r){var s=r[i];Array.isArray(s)||(s=[s]);for(var a=0;a<s.length;a++){var u=s[a];o[i]?Array.isArray(o[i])?o[i].indexOf(u)<0&&o[i].push(u):o[i]!==u&&("object"===(void 0===u?"undefined":n(u))?o[i]=this._mergeClaims(o[i],u):o[i]=[o[i],u]):o[i]=u}}return o},e.prototype._filterProtocolClaims=function e(t){o.Log.debug("ResponseValidator._filterProtocolClaims, incoming claims:",t);var r=Object.assign({},t);return this._settings._filterProtocolClaims?(l.forEach(function(e){delete r[e]}),o.Log.debug("ResponseValidator._filterProtocolClaims: protocol claims filtered",r)):o.Log.debug("ResponseValidator._filterProtocolClaims: protocol claims not filtered"),r},e.prototype._validateTokens=function e(t,r){return r.code?(o.Log.debug("ResponseValidator._validateTokens: Validating code"),this._processCode(t,r)):r.id_token?r.access_token?(o.Log.debug("ResponseValidator._validateTokens: Validating id_token and access_token"),this._validateIdTokenAndAccessToken(t,r)):(o.Log.debug("ResponseValidator._validateTokens: Validating id_token"),this._validateIdToken(t,r)):(o.Log.debug("ResponseValidator._validateTokens: No code to process or id_token to validate"),Promise.resolve(r))},e.prototype._processCode=function e(t,r){var n=this,i={client_id:t.client_id,client_secret:this._settings.client_secret,code:r.code,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier};return this._tokenClient.exchangeCode(i).then(function(e){for(var i in e)r[i]=e[i];return r.id_token?(o.Log.debug("ResponseValidator._processCode: token response successful, processing id_token"),n._validateIdTokenAttributes(t,r)):(o.Log.debug("ResponseValidator._processCode: token response successful, returning response"),r)})},e.prototype._validateIdTokenAttributes=function e(t,r){var n=this;return this._metadataService.getIssuer().then(function(e){var i=t.client_id,s=n._settings.clockSkew;return o.Log.debug("ResponseValidator._validateIdTokenAttributes: Validaing JWT attributes; using clock skew (in seconds) of: ",s),n._joseUtil.validateJwtAttributes(r.id_token,e,i,s).then(function(e){return t.nonce&&t.nonce!==e.nonce?(o.Log.error("ResponseValidator._validateIdTokenAttributes: Invalid nonce in id_token"),Promise.reject(new Error("Invalid nonce in id_token"))):e.sub?(r.profile=e,r):(o.Log.error("ResponseValidator._validateIdTokenAttributes: No sub present in id_token"),Promise.reject(new Error("No sub present in id_token")))})})},e.prototype._validateIdTokenAndAccessToken=function e(t,r){var n=this;return this._validateIdToken(t,r).then(function(e){return n._validateAccessToken(e)})},e.prototype._validateIdToken=function e(t,r){var n=this;if(!t.nonce)return o.Log.error("ResponseValidator._validateIdToken: No nonce on state"),Promise.reject(new Error("No nonce on state"));var i=this._joseUtil.parseJwt(r.id_token);if(!i||!i.header||!i.payload)return o.Log.error("ResponseValidator._validateIdToken: Failed to parse id_token",i),Promise.reject(new Error("Failed to parse id_token"));if(t.nonce!==i.payload.nonce)return o.Log.error("ResponseValidator._validateIdToken: Invalid nonce in id_token"),Promise.reject(new Error("Invalid nonce in id_token"));var s=i.header.kid;return this._metadataService.getIssuer().then(function(e){return o.Log.debug("ResponseValidator._validateIdToken: Received issuer"),n._metadataService.getSigningKeys().then(function(a){if(!a)return o.Log.error("ResponseValidator._validateIdToken: No signing keys from metadata"),Promise.reject(new Error("No signing keys from metadata"));o.Log.debug("ResponseValidator._validateIdToken: Received signing keys");var u=void 0;if(s)u=a.filter(function(e){return e.kid===s})[0];else{if((a=n._filterByAlg(a,i.header.alg)).length>1)return o.Log.error("ResponseValidator._validateIdToken: No kid found in id_token and more than one key found in metadata"),Promise.reject(new Error("No kid found in id_token and more than one key found in metadata"));u=a[0]}if(!u)return o.Log.error("ResponseValidator._validateIdToken: No key matching kid or alg found in signing keys"),Promise.reject(new Error("No key matching kid or alg found in signing keys"));var c=t.client_id,l=n._settings.clockSkew;return o.Log.debug("ResponseValidator._validateIdToken: Validaing JWT; using clock skew (in seconds) of: ",l),n._joseUtil.validateJwt(r.id_token,u,e,c,l).then(function(){return o.Log.debug("ResponseValidator._validateIdToken: JWT validation successful"),i.payload.sub?(r.profile=i.payload,r):(o.Log.error("ResponseValidator._validateIdToken: No sub present in id_token"),Promise.reject(new Error("No sub present in id_token")))})})})},e.prototype._filterByAlg=function e(t,r){var n=null;if(r.startsWith("RS"))n="RSA";else if(r.startsWith("PS"))n="PS";else{if(!r.startsWith("ES"))return o.Log.debug("ResponseValidator._filterByAlg: alg not supported: ",r),[];n="EC"}return o.Log.debug("ResponseValidator._filterByAlg: Looking for keys that match kty: ",n),t=t.filter(function(e){return e.kty===n}),o.Log.debug("ResponseValidator._filterByAlg: Number of keys that match kty: ",n,t.length),t},e.prototype._validateAccessToken=function e(t){if(!t.profile)return o.Log.error("ResponseValidator._validateAccessToken: No profile loaded from id_token"),Promise.reject(new Error("No profile loaded from id_token"));if(!t.profile.at_hash)return o.Log.error("ResponseValidator._validateAccessToken: No at_hash in id_token"),Promise.reject(new Error("No at_hash in id_token"));if(!t.id_token)return o.Log.error("ResponseValidator._validateAccessToken: No id_token"),Promise.reject(new Error("No id_token"));var r=this._joseUtil.parseJwt(t.id_token);if(!r||!r.header)return o.Log.error("ResponseValidator._validateAccessToken: Failed to parse id_token",r),Promise.reject(new Error("Failed to parse id_token"));var n=r.header.alg;if(!n||5!==n.length)return o.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",n),Promise.reject(new Error("Unsupported alg: "+n));var i=n.substr(2,3);if(!i)return o.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",n,i),Promise.reject(new Error("Unsupported alg: "+n));if(256!==(i=parseInt(i))&&384!==i&&512!==i)return o.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",n,i),Promise.reject(new Error("Unsupported alg: "+n));var s="sha"+i,a=this._joseUtil.hashString(t.access_token,s);if(!a)return o.Log.error("ResponseValidator._validateAccessToken: access_token hash failed:",s),Promise.reject(new Error("Failed to validate at_hash"));var u=a.substr(0,a.length/2),c=this._joseUtil.hexToBase64Url(u);return c!==t.profile.at_hash?(o.Log.error("ResponseValidator._validateAccessToken: Failed to validate at_hash",c,t.profile.at_hash),Promise.reject(new Error("Failed to validate at_hash"))):(o.Log.debug("ResponseValidator._validateAccessToken: success"),Promise.resolve(t))},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserInfoService=void 0;var n=r(37),o=r(9),i=r(0),s=r(20);t.UserInfoService=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.JsonService,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.MetadataService,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:s.JoseUtil;if(function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t)throw i.Log.error("UserInfoService.ctor: No settings passed"),new Error("settings");this._settings=t,this._jsonService=new r(void 0,void 0,this._getClaimsFromJwt.bind(this)),this._metadataService=new a(this._settings),this._joseUtil=u}return e.prototype.getClaims=function e(t){var r=this;return t?this._metadataService.getUserInfoEndpoint().then(function(e){return i.Log.debug("UserInfoService.getClaims: received userinfo url",e),r._jsonService.getJson(e,t).then(function(e){return i.Log.debug("UserInfoService.getClaims: claims received",e),e})}):(i.Log.error("UserInfoService.getClaims: No token passed"),Promise.reject(new Error("A token is required")))},e.prototype._getClaimsFromJwt=function e(t){var r=this;try{var n=this._joseUtil.parseJwt(t.responseText);if(!n||!n.header||!n.payload)return i.Log.error("UserInfoService._getClaimsFromJwt: Failed to parse JWT",n),Promise.reject(new Error("Failed to parse id_token"));var o=n.header.kid,s=void 0;switch(this._settings.userInfoJwtIssuer){case"OP":s=this._metadataService.getIssuer();break;case"ANY":s=Promise.resolve(n.payload.iss);break;default:s=Promise.resolve(this._settings.userInfoJwtIssuer)}return s.then(function(e){return i.Log.debug("UserInfoService._getClaimsFromJwt: Received issuer:"+e),r._metadataService.getSigningKeys().then(function(s){if(!s)return i.Log.error("UserInfoService._getClaimsFromJwt: No signing keys from metadata"),Promise.reject(new Error("No signing keys from metadata"));i.Log.debug("UserInfoService._getClaimsFromJwt: Received signing keys");var a=void 0;if(o)a=s.filter(function(e){return e.kid===o})[0];else{if((s=r._filterByAlg(s,n.header.alg)).length>1)return i.Log.error("UserInfoService._getClaimsFromJwt: No kid found in id_token and more than one key found in metadata"),Promise.reject(new Error("No kid found in id_token and more than one key found in metadata"));a=s[0]}if(!a)return i.Log.error("UserInfoService._getClaimsFromJwt: No key matching kid or alg found in signing keys"),Promise.reject(new Error("No key matching kid or alg found in signing keys"));var u=r._settings.client_id,c=r._settings.clockSkew;return i.Log.debug("UserInfoService._getClaimsFromJwt: Validaing JWT; using clock skew (in seconds) of: ",c),r._joseUtil.validateJwt(t.responseText,a,e,u,c,void 0,!0).then(function(){return i.Log.debug("UserInfoService._getClaimsFromJwt: JWT validation successful"),n.payload})})})}catch(e){return i.Log.error("UserInfoService._getClaimsFromJwt: Error parsing JWT response",e.message),void reject(e)}},e.prototype._filterByAlg=function e(t,r){var n=null;if(r.startsWith("RS"))n="RSA";else if(r.startsWith("PS"))n="PS";else{if(!r.startsWith("ES"))return i.Log.debug("UserInfoService._filterByAlg: alg not supported: ",r),[];n="EC"}return i.Log.debug("UserInfoService._filterByAlg: Looking for keys that match kty: ",n),t=t.filter(function(e){return e.kty===n}),i.Log.debug("UserInfoService._filterByAlg: Number of keys that match kty: ",n,t.length),t},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AllowedSigningAlgs=t.b64tohex=t.hextob64u=t.crypto=t.X509=t.KeyUtil=t.jws=void 0;var n=r(117),o=s(r(118)),i=s(r(120));function s(e){return e&&e.__esModule?e:{default:e}}
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
*/var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u={b64tohex:function e(t){var r,n,o="",i=0;for(r=0;r<t.length&&"="!==t.charAt(r);++r){var s=a.indexOf(t.charAt(r));s<0||(0===i?(o+=String.fromCharCode(s>>2),n=3&s,i=1):1===i?(o+=String.fromCharCode(n<<2|s>>4),n=15&s,i=2):2===i?(o+=String.fromCharCode(n),o+=String.fromCharCode(s>>2),n=3&s,i=3):(o+=String.fromCharCode(n<<2|s>>4),o+=String.fromCharCode(15&s),i=0))}return 1===i&&(o+=String.fromCharCode(n<<2)),o},hexToBase64:function e(t){var r,n,o="";for(r=0;r+3<=t.length;r+=3)n=parseInt(t.substring(r,r+3),16),o+=a.charAt(n>>6)+a.charAt(63&n);for(r+1===t.length?(n=parseInt(t.substring(r,r+1),16),o+=a.charAt(n<<2)):r+2===t.length&&(n=parseInt(t.substring(r,r+2),16),o+=a.charAt(n>>2)+a.charAt((3&n)<<4)),"=";(3&o.length)>0;)o+="=";return o},padding:function e(t){var r=t.length%4;return 0===r?t:t+new Array(1+(4-r)).join("=")},byteArrayToHex:function e(t){for(var r="",n=0;n<t.length;n++){var o=t[n].toString(16);r+=2===o.length?o:"0"+o}return r},decodeToHEX:function e(t){return u.byteArrayToHex(i.default.toByteArray(u.padding(t)))},base64ToBase64Url:function e(t){return t=(t=(t=t.replace(/=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")},urlDecode:function e(t){return t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g," "),atob(t)}},c={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},l={sha256:o.default,SHA256:o.default};function f(e,t){if(this.n=null,this.e=0,!(null!=e&&null!=t&&e.length>0&&t.length>0))throw new Error("Invalid key data");this.n=new n.BigInteger(e,16),this.e=parseInt(t,16)}f.prototype.verify=function(e,t){t=(t=u.decodeToHEX(t)).replace(/[^0-9a-f]|[\s\n]]/gi,"");var r=new n.BigInteger(t,16);if(r.bitLength()>this.n.bitLength())throw new Error("Signature does not match with the key modulus.");var o=function i(e){for(var t in c){var r=c[t],n=r.length;if(e.substring(0,n)===r)return{alg:t,hash:e.substring(n)}}return[]}(r.modPowInt(this.e,this.n).toString(16).replace(/^1f+00/,""));if(0===o.length)return!1;if(!l.hasOwnProperty(o.alg))throw new Error("Hashing algorithm is not supported.");var s=l[o.alg](e).toString();return o.hash===s};var p=["RS256"],d={JWS:{parse:function e(t){var r,n,o=t.split(".");if(3===o.length){try{r=JSON.parse(u.urlDecode(o[0])),n=JSON.parse(u.urlDecode(o[1]))}catch(e){return new Error("Token header or payload is not valid JSON")}return{headerObj:r,payloadObj:n}}},verify:function e(t,r){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]).forEach(function(e){if(-1===p.indexOf(e))throw new Error("Invalid signing algorithm: "+e)});var e=new f(r.n,r.e),n=t.split("."),o=[n[0],n[1]].join(".");return e.verify(o,n[2])}}},h={getKey:function e(t){return"RSA"===t.kty?{e:u.decodeToHEX(t.e),n:u.decodeToHEX(t.n)}:null}},g={getPublicKeyFromCertPEM:function e(){throw new Error("Not implemented. Use the full oidc-client library if you need support for X509.")}},_={Util:{hashString:function e(t,r){return(0,l[r])(t).toString()}}};var v=u.b64tohex;t.jws=d,t.KeyUtil=h,t.X509=g,t.crypto=_,t.hextob64u=function y(e){return e.length%2==1&&(e="0"+e),u.base64ToBase64Url(u.hexToBase64(e))},t.b64tohex=v,t.AllowedSigningAlgs=p},function(e,t,r){(function(){var t;function r(e,t,r){null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function n(){return new r(null)}var o="undefined"!=typeof navigator;o&&"Microsoft Internet Explorer"==navigator.appName?(r.prototype.am=function i(e,t,r,n,o,s){for(var a=32767&t,u=t>>15;--s>=0;){var c=32767&this[e],l=this[e++]>>15,f=u*c+l*a;o=((c=a*c+((32767&f)<<15)+r[n]+(1073741823&o))>>>30)+(f>>>15)+u*l+(o>>>30),r[n++]=1073741823&c}return o},t=30):o&&"Netscape"!=navigator.appName?(r.prototype.am=function s(e,t,r,n,o,i){for(;--i>=0;){var s=t*this[e++]+r[n]+o;o=Math.floor(s/67108864),r[n++]=67108863&s}return o},t=26):(r.prototype.am=function a(e,t,r,n,o,i){for(var s=16383&t,a=t>>14;--i>=0;){var u=16383&this[e],c=this[e++]>>14,l=a*u+c*s;o=((u=s*u+((16383&l)<<14)+r[n]+o)>>28)+(l>>14)+a*c,r[n++]=268435455&u}return o},t=28),r.prototype.DB=t,r.prototype.DM=(1<<t)-1,r.prototype.DV=1<<t;r.prototype.FV=Math.pow(2,52),r.prototype.F1=52-t,r.prototype.F2=2*t-52;var u,c,l="0123456789abcdefghijklmnopqrstuvwxyz",f=new Array;for(u="0".charCodeAt(0),c=0;c<=9;++c)f[u++]=c;for(u="a".charCodeAt(0),c=10;c<36;++c)f[u++]=c;for(u="A".charCodeAt(0),c=10;c<36;++c)f[u++]=c;function p(e){return l.charAt(e)}function d(e,t){var r=f[e.charCodeAt(t)];return null==r?-1:r}function h(e){var t=n();return t.fromInt(e),t}function g(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function _(e){this.m=e}function v(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function y(e,t){return e&t}function m(e,t){return e|t}function w(e,t){return e^t}function b(e,t){return e&~t}function S(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function k(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function T(){}function E(e){return e}function L(e){this.r2=n(),this.q3=n(),r.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}_.prototype.convert=function P(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},_.prototype.revert=function R(e){return e},_.prototype.reduce=function x(e){e.divRemTo(this.m,null,e)},_.prototype.mulTo=function C(e,t,r){e.multiplyTo(t,r),this.reduce(r)},_.prototype.sqrTo=function U(e,t){e.squareTo(t),this.reduce(t)},v.prototype.convert=function M(e){var t=n();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(r.ZERO)>0&&this.m.subTo(t,t),t},v.prototype.revert=function O(e){var t=n();return e.copyTo(t),this.reduce(t),t},v.prototype.reduce=function j(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e[t],n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[r=t+this.m.t]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},v.prototype.mulTo=function I(e,t,r){e.multiplyTo(t,r),this.reduce(r)},v.prototype.sqrTo=function A(e,t){e.squareTo(t),this.reduce(t)},r.prototype.copyTo=function N(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},r.prototype.fromInt=function F(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},r.prototype.fromString=function J(e,t){var n;if(16==t)n=4;else if(8==t)n=3;else if(256==t)n=8;else if(2==t)n=1;else if(32==t)n=5;else{if(4!=t)return void this.fromRadix(e,t);n=2}this.t=0,this.s=0;for(var o=e.length,i=!1,s=0;--o>=0;){var a=8==n?255&e[o]:d(e,o);a<0?"-"==e.charAt(o)&&(i=!0):(i=!1,0==s?this[this.t++]=a:s+n>this.DB?(this[this.t-1]|=(a&(1<<this.DB-s)-1)<<s,this[this.t++]=a>>this.DB-s):this[this.t-1]|=a<<s,(s+=n)>=this.DB&&(s-=this.DB))}8==n&&0!=(128&e[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),i&&r.ZERO.subTo(this,this)},r.prototype.clamp=function B(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},r.prototype.dlShiftTo=function q(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s},r.prototype.drShiftTo=function V(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s},r.prototype.lShiftTo=function W(e,t){var r,n=e%this.DB,o=this.DB-n,i=(1<<o)-1,s=Math.floor(e/this.DB),a=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)t[r+s+1]=this[r]>>o|a,a=(this[r]&i)<<n;for(r=s-1;r>=0;--r)t[r]=0;t[s]=a,t.t=this.t+s+1,t.s=this.s,t.clamp()},r.prototype.rShiftTo=function D(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,o=this.DB-n,i=(1<<n)-1;t[0]=this[r]>>n;for(var s=r+1;s<this.t;++s)t[s-r-1]|=(this[s]&i)<<o,t[s-r]=this[s]>>n;n>0&&(t[this.t-r-1]|=(this.s&i)<<o),t.t=this.t-r,t.clamp()}},r.prototype.subTo=function H(e,t){for(var r=0,n=0,o=Math.min(e.t,this.t);r<o;)n+=this[r]-e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e[r],t[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()},r.prototype.multiplyTo=function z(e,t){var n=this.abs(),o=e.abs(),i=n.t;for(t.t=i+o.t;--i>=0;)t[i]=0;for(i=0;i<o.t;++i)t[i+n.t]=n.am(0,o[i],t,i,0,n.t);t.s=0,t.clamp(),this.s!=e.s&&r.ZERO.subTo(t,t)},r.prototype.squareTo=function K(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()},r.prototype.divRemTo=function Q(e,t,o){var i=e.abs();if(!(i.t<=0)){var s=this.abs();if(s.t<i.t)return null!=t&&t.fromInt(0),void(null!=o&&this.copyTo(o));null==o&&(o=n());var a=n(),u=this.s,c=e.s,l=this.DB-g(i[i.t-1]);l>0?(i.lShiftTo(l,a),s.lShiftTo(l,o)):(i.copyTo(a),s.copyTo(o));var f=a.t,p=a[f-1];if(0!=p){var d=p*(1<<this.F1)+(f>1?a[f-2]>>this.F2:0),h=this.FV/d,_=(1<<this.F1)/d,v=1<<this.F2,y=o.t,m=y-f,w=null==t?n():t;for(a.dlShiftTo(m,w),o.compareTo(w)>=0&&(o[o.t++]=1,o.subTo(w,o)),r.ONE.dlShiftTo(f,w),w.subTo(a,a);a.t<f;)a[a.t++]=0;for(;--m>=0;){var b=o[--y]==p?this.DM:Math.floor(o[y]*h+(o[y-1]+v)*_);if((o[y]+=a.am(0,b,o,m,0,f))<b)for(a.dlShiftTo(m,w),o.subTo(w,o);o[y]<--b;)o.subTo(w,o)}null!=t&&(o.drShiftTo(f,t),u!=c&&r.ZERO.subTo(t,t)),o.t=f,o.clamp(),l>0&&o.rShiftTo(l,o),u<0&&r.ZERO.subTo(o,o)}}},r.prototype.invDigit=function G(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},r.prototype.isEven=function X(){return 0==(this.t>0?1&this[0]:this.s)},r.prototype.exp=function Z(e,t){if(e>4294967295||e<1)return r.ONE;var o=n(),i=n(),s=t.convert(this),a=g(e)-1;for(s.copyTo(o);--a>=0;)if(t.sqrTo(o,i),(e&1<<a)>0)t.mulTo(i,s,o);else{var u=o;o=i,i=u}return t.revert(o)},r.prototype.toString=function Y(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<<t)-1,o=!1,i="",s=this.t,a=this.DB-s*this.DB%t;if(s-- >0)for(a<this.DB&&(r=this[s]>>a)>0&&(o=!0,i=p(r));s>=0;)a<t?(r=(this[s]&(1<<a)-1)<<t-a,r|=this[--s]>>(a+=this.DB-t)):(r=this[s]>>(a-=t)&n,a<=0&&(a+=this.DB,--s)),r>0&&(o=!0),o&&(i+=p(r));return o?i:"0"},r.prototype.negate=function $(){var e=n();return r.ZERO.subTo(this,e),e},r.prototype.abs=function ee(){return this.s<0?this.negate():this},r.prototype.compareTo=function te(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this[r]-e[r]))return t;return 0},r.prototype.bitLength=function re(){return this.t<=0?0:this.DB*(this.t-1)+g(this[this.t-1]^this.s&this.DM)},r.prototype.mod=function ne(e){var t=n();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(r.ZERO)>0&&e.subTo(t,t),t},r.prototype.modPowInt=function oe(e,t){var r;return r=e<256||t.isEven()?new _(t):new v(t),this.exp(e,r)},r.ZERO=h(0),r.ONE=h(1),T.prototype.convert=E,T.prototype.revert=E,T.prototype.mulTo=function ie(e,t,r){e.multiplyTo(t,r)},T.prototype.sqrTo=function se(e,t){e.squareTo(t)},L.prototype.convert=function ae(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=n();return e.copyTo(t),this.reduce(t),t},L.prototype.revert=function ue(e){return e},L.prototype.reduce=function ce(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},L.prototype.mulTo=function le(e,t,r){e.multiplyTo(t,r),this.reduce(r)},L.prototype.sqrTo=function fe(e,t){e.squareTo(t),this.reduce(t)};var pe,de,he,ge=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],_e=(1<<26)/ge[ge.length-1];function ve(){!function e(t){de[he++]^=255&t,de[he++]^=t>>8&255,de[he++]^=t>>16&255,de[he++]^=t>>24&255,he>=wt&&(he-=wt)}((new Date).getTime())}if(r.prototype.chunkSize=function ye(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},r.prototype.toRadix=function me(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),o=h(r),i=n(),s=n(),a="";for(this.divRemTo(o,i,s);i.signum()>0;)a=(r+s.intValue()).toString(e).substr(1)+a,i.divRemTo(o,i,s);return s.intValue().toString(e)+a},r.prototype.fromRadix=function we(e,t){this.fromInt(0),null==t&&(t=10);for(var n=this.chunkSize(t),o=Math.pow(t,n),i=!1,s=0,a=0,u=0;u<e.length;++u){var c=d(e,u);c<0?"-"==e.charAt(u)&&0==this.signum()&&(i=!0):(a=t*a+c,++s>=n&&(this.dMultiply(o),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(t,s)),this.dAddOffset(a,0)),i&&r.ZERO.subTo(this,this)},r.prototype.fromNumber=function be(e,t,n){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(r.ONE.shiftLeft(e-1),m,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(r.ONE.shiftLeft(e-1),this);else{var o=new Array,i=7&e;o.length=1+(e>>3),t.nextBytes(o),i>0?o[0]&=(1<<i)-1:o[0]=0,this.fromString(o,256)}},r.prototype.bitwiseTo=function Se(e,t,r){var n,o,i=Math.min(e.t,this.t);for(n=0;n<i;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(o=e.s&this.DM,n=i;n<this.t;++n)r[n]=t(this[n],o);r.t=this.t}else{for(o=this.s&this.DM,n=i;n<e.t;++n)r[n]=t(o,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},r.prototype.changeBit=function ke(e,t){var n=r.ONE.shiftLeft(e);return this.bitwiseTo(n,t,n),n},r.prototype.addTo=function Te(e,t){for(var r=0,n=0,o=Math.min(e.t,this.t);r<o;)n+=this[r]+e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e[r],t[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()},r.prototype.dMultiply=function Ee(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},r.prototype.dAddOffset=function Le(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},r.prototype.multiplyLowerTo=function Pe(e,t,r){var n,o=Math.min(this.t+e.t,t);for(r.s=0,r.t=o;o>0;)r[--o]=0;for(n=r.t-this.t;o<n;++o)r[o+this.t]=this.am(0,e[o],r,o,0,this.t);for(n=Math.min(e.t,t);o<n;++o)this.am(0,e[o],r,o,0,t-o);r.clamp()},r.prototype.multiplyUpperTo=function Re(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r[this.t+n-t]=this.am(t-n,e[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},r.prototype.modInt=function xe(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r},r.prototype.millerRabin=function Ce(e){var t=this.subtract(r.ONE),o=t.getLowestSetBit();if(o<=0)return!1;var i=t.shiftRight(o);(e=e+1>>1)>ge.length&&(e=ge.length);for(var s=n(),a=0;a<e;++a){s.fromInt(ge[Math.floor(Math.random()*ge.length)]);var u=s.modPow(i,this);if(0!=u.compareTo(r.ONE)&&0!=u.compareTo(t)){for(var c=1;c++<o&&0!=u.compareTo(t);)if(0==(u=u.modPowInt(2,this)).compareTo(r.ONE))return!1;if(0!=u.compareTo(t))return!1}}return!0},r.prototype.clone=function Ue(){var e=n();return this.copyTo(e),e},r.prototype.intValue=function Me(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},r.prototype.byteValue=function Oe(){return 0==this.t?this.s:this[0]<<24>>24},r.prototype.shortValue=function je(){return 0==this.t?this.s:this[0]<<16>>16},r.prototype.signum=function Ie(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},r.prototype.toByteArray=function Ae(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,o=0;if(e-- >0)for(n<this.DB&&(r=this[e]>>n)!=(this.s&this.DM)>>n&&(t[o++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this[e]&(1<<n)-1)<<8-n,r|=this[--e]>>(n+=this.DB-8)):(r=this[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==o&&(128&this.s)!=(128&r)&&++o,(o>0||r!=this.s)&&(t[o++]=r);return t},r.prototype.equals=function Ne(e){return 0==this.compareTo(e)},r.prototype.min=function Fe(e){return this.compareTo(e)<0?this:e},r.prototype.max=function Je(e){return this.compareTo(e)>0?this:e},r.prototype.and=function Be(e){var t=n();return this.bitwiseTo(e,y,t),t},r.prototype.or=function qe(e){var t=n();return this.bitwiseTo(e,m,t),t},r.prototype.xor=function Ve(e){var t=n();return this.bitwiseTo(e,w,t),t},r.prototype.andNot=function We(e){var t=n();return this.bitwiseTo(e,b,t),t},r.prototype.not=function De(){for(var e=n(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},r.prototype.shiftLeft=function He(e){var t=n();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},r.prototype.shiftRight=function ze(e){var t=n();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},r.prototype.getLowestSetBit=function Ke(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+S(this[e]);return this.s<0?this.t*this.DB:-1},r.prototype.bitCount=function Qe(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=k(this[r]^t);return e},r.prototype.testBit=function Ge(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this[t]&1<<e%this.DB)},r.prototype.setBit=function Xe(e){return this.changeBit(e,m)},r.prototype.clearBit=function Ze(e){return this.changeBit(e,b)},r.prototype.flipBit=function Ye(e){return this.changeBit(e,w)},r.prototype.add=function $e(e){var t=n();return this.addTo(e,t),t},r.prototype.subtract=function et(e){var t=n();return this.subTo(e,t),t},r.prototype.multiply=function tt(e){var t=n();return this.multiplyTo(e,t),t},r.prototype.divide=function rt(e){var t=n();return this.divRemTo(e,t,null),t},r.prototype.remainder=function nt(e){var t=n();return this.divRemTo(e,null,t),t},r.prototype.divideAndRemainder=function ot(e){var t=n(),r=n();return this.divRemTo(e,t,r),new Array(t,r)},r.prototype.modPow=function it(e,t){var r,o,i=e.bitLength(),s=h(1);if(i<=0)return s;r=i<18?1:i<48?3:i<144?4:i<768?5:6,o=i<8?new _(t):t.isEven()?new L(t):new v(t);var a=new Array,u=3,c=r-1,l=(1<<r)-1;if(a[1]=o.convert(this),r>1){var f=n();for(o.sqrTo(a[1],f);u<=l;)a[u]=n(),o.mulTo(f,a[u-2],a[u]),u+=2}var p,d,y=e.t-1,m=!0,w=n();for(i=g(e[y])-1;y>=0;){for(i>=c?p=e[y]>>i-c&l:(p=(e[y]&(1<<i+1)-1)<<c-i,y>0&&(p|=e[y-1]>>this.DB+i-c)),u=r;0==(1&p);)p>>=1,--u;if((i-=u)<0&&(i+=this.DB,--y),m)a[p].copyTo(s),m=!1;else{for(;u>1;)o.sqrTo(s,w),o.sqrTo(w,s),u-=2;u>0?o.sqrTo(s,w):(d=s,s=w,w=d),o.mulTo(w,a[p],s)}for(;y>=0&&0==(e[y]&1<<i);)o.sqrTo(s,w),d=s,s=w,w=d,--i<0&&(i=this.DB-1,--y)}return o.revert(s)},r.prototype.modInverse=function st(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return r.ZERO;for(var n=e.clone(),o=this.clone(),i=h(1),s=h(0),a=h(0),u=h(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),t?(i.isEven()&&s.isEven()||(i.addTo(this,i),s.subTo(e,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);for(;o.isEven();)o.rShiftTo(1,o),t?(a.isEven()&&u.isEven()||(a.addTo(this,a),u.subTo(e,u)),a.rShiftTo(1,a)):u.isEven()||u.subTo(e,u),u.rShiftTo(1,u);n.compareTo(o)>=0?(n.subTo(o,n),t&&i.subTo(a,i),s.subTo(u,s)):(o.subTo(n,o),t&&a.subTo(i,a),u.subTo(s,u))}return 0!=o.compareTo(r.ONE)?r.ZERO:u.compareTo(e)>=0?u.subtract(e):u.signum()<0?(u.addTo(e,u),u.signum()<0?u.add(e):u):u},r.prototype.pow=function at(e){return this.exp(e,new T)},r.prototype.gcd=function ut(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var o=t.getLowestSetBit(),i=r.getLowestSetBit();if(i<0)return t;for(o<i&&(i=o),i>0&&(t.rShiftTo(i,t),r.rShiftTo(i,r));t.signum()>0;)(o=t.getLowestSetBit())>0&&t.rShiftTo(o,t),(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return i>0&&r.lShiftTo(i,r),r},r.prototype.isProbablePrime=function ct(e){var t,r=this.abs();if(1==r.t&&r[0]<=ge[ge.length-1]){for(t=0;t<ge.length;++t)if(r[0]==ge[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<ge.length;){for(var n=ge[t],o=t+1;o<ge.length&&n<_e;)n*=ge[o++];for(n=r.modInt(n);t<o;)if(n%ge[t++]==0)return!1}return r.millerRabin(e)},r.prototype.square=function lt(){var e=n();return this.squareTo(e),e},r.prototype.Barrett=L,null==de){var ft;if(de=new Array,he=0,"undefined"!=typeof window&&window.crypto)if(window.crypto.getRandomValues){var pt=new Uint8Array(32);for(window.crypto.getRandomValues(pt),ft=0;ft<32;++ft)de[he++]=pt[ft]}else if("Netscape"==navigator.appName&&navigator.appVersion<"5"){var dt=window.crypto.random(32);for(ft=0;ft<dt.length;++ft)de[he++]=255&dt.charCodeAt(ft)}for(;he<wt;)ft=Math.floor(65536*Math.random()),de[he++]=ft>>>8,de[he++]=255&ft;he=0,ve()}function ht(){if(null==pe){for(ve(),(pe=function e(){return new _t}()).init(de),he=0;he<de.length;++he)de[he]=0;he=0}return pe.next()}function gt(){}function _t(){this.i=0,this.j=0,this.S=new Array}gt.prototype.nextBytes=function vt(e){var t;for(t=0;t<e.length;++t)e[t]=ht()},_t.prototype.init=function yt(e){var t,r,n;for(t=0;t<256;++t)this.S[t]=t;for(r=0,t=0;t<256;++t)r=r+this.S[t]+e[t%e.length]&255,n=this.S[t],this.S[t]=this.S[r],this.S[r]=n;this.i=0,this.j=0},_t.prototype.next=function mt(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]};var wt=256;e.exports={default:r,BigInteger:r,SecureRandom:gt}}).call(this)},function(e,t,r){var n;e.exports=(n=r(119),function(e){var t=n,r=t.lib,o=r.WordArray,i=r.Hasher,s=t.algo,a=[],u=[];!function(){function t(t){for(var r=e.sqrt(t),n=2;n<=r;n++)if(!(t%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,o=0;o<64;)t(n)&&(o<8&&(a[o]=r(e.pow(n,.5))),u[o]=r(e.pow(n,1/3)),o++),n++}();var c=[],l=s.SHA256=i.extend({_doReset:function(){this._hash=new o.init(a.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],o=r[1],i=r[2],s=r[3],a=r[4],l=r[5],f=r[6],p=r[7],d=0;d<64;d++){if(d<16)c[d]=0|e[t+d];else{var h=c[d-15],g=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,_=c[d-2],v=(_<<15|_>>>17)^(_<<13|_>>>19)^_>>>10;c[d]=g+c[d-7]+v+c[d-16]}var y=n&o^n&i^o&i,m=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),w=p+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&l^~a&f)+u[d]+c[d];p=f,f=l,l=a,a=s+w|0,s=i,i=o,o=n,n=w+(m+y)|0}r[0]=r[0]+n|0,r[1]=r[1]+o|0,r[2]=r[2]+i|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+l|0,r[6]=r[6]+f|0,r[7]=r[7]+p|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,o=8*t.sigBytes;return r[o>>>5]|=128<<24-o%32,r[14+(o+64>>>9<<4)]=e.floor(n/4294967296),r[15+(o+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=i._createHelper(l),t.HmacSHA256=i._createHmacHelper(l)}(Math),n.SHA256)},function(e,t,r){var n;e.exports=(n=n||function(e,t){var r=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),n={},o=n.lib={},i=o.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},s=o.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=void 0!=t?t:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,o=e.sigBytes;if(this.clamp(),n%4)for(var i=0;i<o;i++){var s=r[i>>>2]>>>24-i%4*8&255;t[n+i>>>2]|=s<<24-(n+i)%4*8}else for(var i=0;i<o;i+=4)t[n+i>>>2]=r[i>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r,n=[],o=function(t){var t=t,r=987654321,n=4294967295;return function(){var o=((r=36969*(65535&r)+(r>>16)&n)<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n;return o/=4294967296,(o+=.5)*(e.random()>.5?1:-1)}},i=0;i<t;i+=4){var a=o(4294967296*(r||e.random()));r=987654071*a(),n.push(4294967296*a()|0)}return new s.init(n,t)}}),a=n.enc={},u=a.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o++){var i=t[o>>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new s.init(r,t/2)}},c=a.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o++){var i=t[o>>>2]>>>24-o%4*8&255;n.push(String.fromCharCode(i))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new s.init(r,t)}},l=a.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},f=o.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,n=r.words,o=r.sigBytes,i=this.blockSize,a=4*i,u=o/a,c=(u=t?e.ceil(u):e.max((0|u)-this._minBufferSize,0))*i,l=e.min(4*c,o);if(c){for(var f=0;f<c;f+=i)this._doProcessBlock(n,f);var p=n.splice(0,c);r.sigBytes-=l}return new s.init(p,l)},clone:function(){var e=i.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),p=(o.Hasher=f.extend({cfg:i.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){e&&this._append(e);var t=this._doFinalize();return t},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new p.HMAC.init(e,r).finalize(t)}}}),n.algo={});return n}(Math),n)},function(e,t,r){"use strict";t.byteLength=function n(e){var t=p(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function o(e){for(var t,r=p(e),n=r[0],o=r[1],i=new u(function s(e,t,r){return 3*(t+r)/4-r}(0,n,o)),c=0,l=o>0?n-4:n,f=0;f<l;f+=4)t=a[e.charCodeAt(f)]<<18|a[e.charCodeAt(f+1)]<<12|a[e.charCodeAt(f+2)]<<6|a[e.charCodeAt(f+3)],i[c++]=t>>16&255,i[c++]=t>>8&255,i[c++]=255&t;2===o&&(t=a[e.charCodeAt(f)]<<2|a[e.charCodeAt(f+1)]>>4,i[c++]=255&t);1===o&&(t=a[e.charCodeAt(f)]<<10|a[e.charCodeAt(f+1)]<<4|a[e.charCodeAt(f+2)]>>2,i[c++]=t>>8&255,i[c++]=255&t);return i},t.fromByteArray=function i(e){for(var t,r=e.length,n=r%3,o=[],i=0,a=r-n;i<a;i+=16383)o.push(d(e,i,i+16383>a?a:i+16383));1===n?(t=e[r-1],o.push(s[t>>2]+s[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],o.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return o.join("")};for(var s=[],a=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,f=c.length;l<f;++l)s[l]=c[l],a[c.charCodeAt(l)]=l;function p(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function d(e,t,r){for(var n,o,i=[],a=t;a<r;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),i.push(s[(o=n)>>18&63]+s[o>>12&63]+s[o>>6&63]+s[63&o]);return i.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function n(e){var t=e.jws,r=e.KeyUtil,n=e.X509,i=e.crypto,s=e.hextob64u,a=e.b64tohex,u=e.AllowedSigningAlgs;return function(){function e(){!function t(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.parseJwt=function e(r){o.Log.debug("JoseUtil.parseJwt");try{var n=t.JWS.parse(r);return{header:n.headerObj,payload:n.payloadObj}}catch(e){o.Log.error(e)}},e.validateJwt=function t(i,s,u,c,l,f,p){o.Log.debug("JoseUtil.validateJwt");try{if("RSA"===s.kty)if(s.e&&s.n)s=r.getKey(s);else{if(!s.x5c||!s.x5c.length)return o.Log.error("JoseUtil.validateJwt: RSA key missing key material",s),Promise.reject(new Error("RSA key missing key material"));var d=a(s.x5c[0]);s=n.getPublicKeyFromCertHex(d)}else{if("EC"!==s.kty)return o.Log.error("JoseUtil.validateJwt: Unsupported key type",s&&s.kty),Promise.reject(new Error(s.kty));if(!(s.crv&&s.x&&s.y))return o.Log.error("JoseUtil.validateJwt: EC key missing key material",s),Promise.reject(new Error("EC key missing key material"));s=r.getKey(s)}return e._validateJwt(i,s,u,c,l,f,p)}catch(e){return o.Log.error(e&&e.message||e),Promise.reject("JWT validation failed")}},e.validateJwtAttributes=function t(r,n,i,s,a,u){s||(s=0),a||(a=parseInt(Date.now()/1e3));var c=e.parseJwt(r).payload;if(!c.iss)return o.Log.error("JoseUtil._validateJwt: issuer was not provided"),Promise.reject(new Error("issuer was not provided"));if(c.iss!==n)return o.Log.error("JoseUtil._validateJwt: Invalid issuer in token",c.iss),Promise.reject(new Error("Invalid issuer in token: "+c.iss));if(!c.aud)return o.Log.error("JoseUtil._validateJwt: aud was not provided"),Promise.reject(new Error("aud was not provided"));var l=c.aud===i||Array.isArray(c.aud)&&c.aud.indexOf(i)>=0;if(!l)return o.Log.error("JoseUtil._validateJwt: Invalid audience in token",c.aud),Promise.reject(new Error("Invalid audience in token: "+c.aud));if(c.azp&&c.azp!==i)return o.Log.error("JoseUtil._validateJwt: Invalid azp in token",c.azp),Promise.reject(new Error("Invalid azp in token: "+c.azp));if(!u){var f=a+s,p=a-s;if(!c.iat)return o.Log.error("JoseUtil._validateJwt: iat was not provided"),Promise.reject(new Error("iat was not provided"));if(f<c.iat)return o.Log.error("JoseUtil._validateJwt: iat is in the future",c.iat),Promise.reject(new Error("iat is in the future: "+c.iat));if(c.nbf&&f<c.nbf)return o.Log.error("JoseUtil._validateJwt: nbf is in the future",c.nbf),Promise.reject(new Error("nbf is in the future: "+c.nbf));if(!c.exp)return o.Log.error("JoseUtil._validateJwt: exp was not provided"),Promise.reject(new Error("exp was not provided"));if(c.exp<p)return o.Log.error("JoseUtil._validateJwt: exp is in the past",c.exp),Promise.reject(new Error("exp is in the past:"+c.exp))}return Promise.resolve(c)},e._validateJwt=function r(n,i,s,a,c,l,f){return e.validateJwtAttributes(n,s,a,c,l,f).then(function(e){try{return t.JWS.verify(n,i,u)?e:(o.Log.error("JoseUtil._validateJwt: signature validation failed"),Promise.reject(new Error("signature validation failed")))}catch(e){return o.Log.error(e&&e.message||e),Promise.reject(new Error("signature validation failed"))}})},e.hashString=function e(t,r){try{return i.Util.hashString(t,r)}catch(e){o.Log.error(e)}},e.hexToBase64Url=function e(t){try{return s(t)}catch(e){o.Log.error(e)}},e}()};var o=r(0);e.exports=t.default},function(e,t,r){var n=r(123),o=r(124);e.exports=function i(e,t,r){var i=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var s=(e=e||{}).random||(e.rng||n)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(var a=0;a<16;++a)t[i+a]=s[a];return t||o(s)}},function(e,t){var r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(r){var n=new Uint8Array(16);e.exports=function e(){return r(n),n}}else{var o=new Array(16);e.exports=function e(){for(var t,r=0;r<16;r++)0==(3&r)&&(t=4294967296*Math.random()),o[r]=t>>>((3&r)<<3)&255;return o}}},function(e,t){for(var r=[],n=0;n<256;++n)r[n]=(n+256).toString(16).substr(1);e.exports=function o(e,t){var n=t||0,o=r;return[o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]]].join("")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SigninResponse=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=r(16);t.SigninResponse=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#";!function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var i=o.UrlUtility.parseUrlFragment(t,r);this.error=i.error,this.error_description=i.error_description,this.error_uri=i.error_uri,this.code=i.code,this.state=i.state,this.id_token=i.id_token,this.session_state=i.session_state,this.access_token=i.access_token,this.token_type=i.token_type,this.scope=i.scope,this.profile=void 0,this.expires_in=i.expires_in}return n(e,[{key:"expires_in",get:function e(){if(this.expires_at){var t=parseInt(Date.now()/1e3);return this.expires_at-t}},set:function e(t){var r=parseInt(t);if("number"==typeof r&&r>0){var n=parseInt(Date.now()/1e3);this.expires_at=n+r}}},{key:"expired",get:function e(){var t=this.expires_in;if(void 0!==t)return t<=0}},{key:"scopes",get:function e(){return(this.scope||"").split(" ")}},{key:"isOpenIdConnect",get:function e(){return this.scopes.indexOf("openid")>=0||!!this.id_token}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignoutRequest=void 0;var n=r(0),o=r(16),i=r(38);t.SignoutRequest=function e(t){var r=t.url,s=t.id_token_hint,a=t.post_logout_redirect_uri,u=t.data,c=t.extraQueryParams;if(function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!r)throw n.Log.error("SignoutRequest.ctor: No url passed"),new Error("url");for(var f in s&&(r=o.UrlUtility.addQueryParam(r,"id_token_hint",s)),a&&(r=o.UrlUtility.addQueryParam(r,"post_logout_redirect_uri",a),u&&(this.state=new i.State({data:u}),r=o.UrlUtility.addQueryParam(r,"state",this.state.id))),c)r=o.UrlUtility.addQueryParam(r,f,c[f]);this.url=r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignoutResponse=void 0;var n=r(16);t.SignoutResponse=function e(t){!function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var o=n.UrlUtility.parseUrlFragment(t,"?");this.error=o.error,this.error_description=o.error_description,this.error_uri=o.error_uri,this.state=o.state}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InMemoryWebStorage=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=r(0);t.InMemoryWebStorage=function(){function e(){!function t(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e),this._data={}}return e.prototype.getItem=function e(t){return o.Log.debug("InMemoryWebStorage.getItem",t),this._data[t]},e.prototype.setItem=function e(t,r){o.Log.debug("InMemoryWebStorage.setItem",t),this._data[t]=r},e.prototype.removeItem=function e(t){o.Log.debug("InMemoryWebStorage.removeItem",t),delete this._data[t]},e.prototype.key=function e(t){return Object.getOwnPropertyNames(this._data)[t]},n(e,[{key:"length",get:function e(){return Object.getOwnPropertyNames(this._data).length}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserManager=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=r(0),i=r(49),s=r(130),a=r(55),u=r(136),c=r(138),l=r(58),f=r(60),p=r(50),d=r(20);t.UserManager=function(e){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c.SilentRenewService,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.SessionMonitor,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:f.TokenRevocationClient,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:p.TokenClient,g=arguments.length>5&&void 0!==arguments[5]?arguments[5]:d.JoseUtil;!function _(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),r instanceof s.UserManagerSettings||(r=new s.UserManagerSettings(r));var v=function y(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,r));return v._events=new u.UserManagerEvents(r),v._silentRenewService=new n(v),v.settings.automaticSilentRenew&&(o.Log.debug("UserManager.ctor: automaticSilentRenew is configured, setting up silent renew"),v.startSilentRenew()),v.settings.monitorSession&&(o.Log.debug("UserManager.ctor: monitorSession is configured, setting up session monitor"),v._sessionMonitor=new i(v)),v._tokenRevocationClient=new a(v._settings),v._tokenClient=new h(v._settings),v._joseUtil=g,v}return function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getUser=function e(){var t=this;return this._loadUser().then(function(e){return e?(o.Log.info("UserManager.getUser: user loaded"),t._events.load(e,!1),e):(o.Log.info("UserManager.getUser: user not found in storage"),null)})},t.prototype.removeUser=function e(){var t=this;return this.storeUser(null).then(function(){o.Log.info("UserManager.removeUser: user removed from storage"),t._events.unload()})},t.prototype.signinRedirect=function e(t){return this._signinStart(t,this._redirectNavigator).then(function(){o.Log.info("UserManager.signinRedirect: successful")})},t.prototype.signinRedirectCallback=function e(t){return this._signinEnd(t||this._redirectNavigator.url).then(function(e){return e&&(e.profile&&e.profile.sub?o.Log.info("UserManager.signinRedirectCallback: successful, signed in sub: ",e.profile.sub):o.Log.info("UserManager.signinRedirectCallback: no sub")),e})},t.prototype.signinPopup=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.redirect_uri||this.settings.popup_redirect_uri||this.settings.redirect_uri;return r?(t.redirect_uri=r,t.display="popup",this._signin(t,this._popupNavigator,{startUrl:r,popupWindowFeatures:t.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:t.popupWindowTarget||this.settings.popupWindowTarget}).then(function(e){return e&&(e.profile&&e.profile.sub?o.Log.info("UserManager.signinPopup: signinPopup successful, signed in sub: ",e.profile.sub):o.Log.info("UserManager.signinPopup: no sub")),e})):(o.Log.error("UserManager.signinPopup: No popup_redirect_uri or redirect_uri configured"),Promise.reject(new Error("No popup_redirect_uri or redirect_uri configured")))},t.prototype.signinPopupCallback=function e(t){return this._signinCallback(t,this._popupNavigator).then(function(e){return e&&(e.profile&&e.profile.sub?o.Log.info("UserManager.signinPopupCallback: successful, signed in sub: ",e.profile.sub):o.Log.info("UserManager.signinPopupCallback: no sub")),e}).catch(function(e){o.Log.error(e.message)})},t.prototype.signinSilent=function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._loadUser().then(function(e){return e&&e.refresh_token?(r.refresh_token=e.refresh_token,t._useRefreshToken(r)):(r.id_token_hint=r.id_token_hint||t.settings.includeIdTokenInSilentRenew&&e&&e.id_token,t._signinSilentIframe(r))})},t.prototype._useRefreshToken=function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._tokenClient.exchangeRefreshToken(r).then(function(e){return e?e.access_token?t._loadUser().then(function(r){if(r){var n=Promise.resolve();return e.id_token&&(n=t._validateIdTokenFromTokenRefreshToken(r.profile,e.id_token)),n.then(function(){return o.Log.debug("UserManager._useRefreshToken: refresh token response success"),r.access_token=e.access_token,r.refresh_token=e.refresh_token||r.refresh_token,r.expires_in=e.expires_in,t.storeUser(r).then(function(){return t._events.load(r),r})})}return null}):(o.Log.error("UserManager._useRefreshToken: No access token returned from token endpoint"),Promise.reject("No access token returned from token endpoint")):(o.Log.error("UserManager._useRefreshToken: No response returned from token endpoint"),Promise.reject("No response returned from token endpoint"))})},t.prototype._validateIdTokenFromTokenRefreshToken=function e(t,r){var n=this;return this._metadataService.getIssuer().then(function(e){return n._joseUtil.validateJwtAttributes(r,e,n._settings.client_id,n._settings.clockSkew).then(function(e){return e?e.sub!==t.sub?(o.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: sub in id_token does not match current sub"),Promise.reject(new Error("sub in id_token does not match current sub"))):e.auth_time&&e.auth_time!==t.auth_time?(o.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: auth_time in id_token does not match original auth_time"),Promise.reject(new Error("auth_time in id_token does not match original auth_time"))):e.azp&&e.azp!==t.azp?(o.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: azp in id_token does not match original azp"),Promise.reject(new Error("azp in id_token does not match original azp"))):!e.azp&&t.azp?(o.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: azp not in id_token, but present in original id_token"),Promise.reject(new Error("azp not in id_token, but present in original id_token"))):void 0:(o.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: Failed to validate id_token"),Promise.reject(new Error("Failed to validate id_token")))})})},t.prototype._signinSilentIframe=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.redirect_uri||this.settings.silent_redirect_uri;return r?(t.redirect_uri=r,t.prompt=t.prompt||"none",this._signin(t,this._iframeNavigator,{startUrl:r,silentRequestTimeout:t.silentRequestTimeout||this.settings.silentRequestTimeout}).then(function(e){return e&&(e.profile&&e.profile.sub?o.Log.info("UserManager.signinSilent: successful, signed in sub: ",e.profile.sub):o.Log.info("UserManager.signinSilent: no sub")),e})):(o.Log.error("UserManager.signinSilent: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},t.prototype.signinSilentCallback=function e(t){return this._signinCallback(t,this._iframeNavigator).then(function(e){return e&&(e.profile&&e.profile.sub?o.Log.info("UserManager.signinSilentCallback: successful, signed in sub: ",e.profile.sub):o.Log.info("UserManager.signinSilentCallback: no sub")),e})},t.prototype.querySessionStatus=function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.redirect_uri||this.settings.silent_redirect_uri;return n?(r.redirect_uri=n,r.prompt="none",r.response_type=r.response_type||this.settings.query_status_response_type,r.scope="openid",this._signinStart(r,this._iframeNavigator,{startUrl:n,silentRequestTimeout:r.silentRequestTimeout||this.settings.silentRequestTimeout}).then(function(e){return t.processSigninResponse(e.url).then(function(e){if(o.Log.debug("UserManager.querySessionStatus: got signin response"),e.session_state&&e.profile.sub)return o.Log.info("UserManager.querySessionStatus: querySessionStatus success for sub: ",e.profile.sub),{session_state:e.session_state,sub:e.profile.sub,sid:e.profile.sid};o.Log.info("querySessionStatus successful, user not authenticated")})})):(o.Log.error("UserManager.querySessionStatus: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},t.prototype._signin=function e(t,r){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signinStart(t,r,o).then(function(e){return n._signinEnd(e.url)})},t.prototype._signinStart=function e(t,r){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.prepare(i).then(function(e){return o.Log.debug("UserManager._signinStart: got navigator window handle"),n.createSigninRequest(t).then(function(t){return o.Log.debug("UserManager._signinStart: got signin request"),i.url=t.url,i.id=t.state.id,e.navigate(i)}).catch(function(t){throw e.close&&(o.Log.debug("UserManager._signinStart: Error after preparing navigator, closing navigator window"),e.close()),t})})},t.prototype._signinEnd=function e(t){var r=this;return this.processSigninResponse(t).then(function(e){o.Log.debug("UserManager._signinEnd: got signin response");var t=new a.User(e);return r.storeUser(t).then(function(){return o.Log.debug("UserManager._signinEnd: user stored"),r._events.load(t),t})})},t.prototype._signinCallback=function e(t,r){return o.Log.debug("UserManager._signinCallback"),r.callback(t)},t.prototype.signoutRedirect=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.post_logout_redirect_uri||this.settings.post_logout_redirect_uri;return r&&(t.post_logout_redirect_uri=r),this._signoutStart(t,this._redirectNavigator).then(function(){o.Log.info("UserManager.signoutRedirect: successful")})},t.prototype.signoutRedirectCallback=function e(t){return this._signoutEnd(t||this._redirectNavigator.url).then(function(e){return o.Log.info("UserManager.signoutRedirectCallback: successful"),e})},t.prototype.signoutPopup=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.post_logout_redirect_uri||this.settings.popup_post_logout_redirect_uri||this.settings.post_logout_redirect_uri;return t.post_logout_redirect_uri=r,t.display="popup",t.post_logout_redirect_uri&&(t.state=t.state||{}),this._signout(t,this._popupNavigator,{startUrl:r,popupWindowFeatures:t.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:t.popupWindowTarget||this.settings.popupWindowTarget}).then(function(){o.Log.info("UserManager.signoutPopup: successful")})},t.prototype.signoutPopupCallback=function e(t,r){void 0===r&&"boolean"==typeof t&&(r=t,t=null);return this._popupNavigator.callback(t,r,"?").then(function(){o.Log.info("UserManager.signoutPopupCallback: successful")})},t.prototype._signout=function e(t,r){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signoutStart(t,r,o).then(function(e){return n._signoutEnd(e.url)})},t.prototype._signoutStart=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=this,n=arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.prepare(i).then(function(e){return o.Log.debug("UserManager._signoutStart: got navigator window handle"),r._loadUser().then(function(n){return o.Log.debug("UserManager._signoutStart: loaded current user from storage"),(r._settings.revokeAccessTokenOnSignout?r._revokeInternal(n):Promise.resolve()).then(function(){var s=t.id_token_hint||n&&n.id_token;return s&&(o.Log.debug("UserManager._signoutStart: Setting id_token into signout request"),t.id_token_hint=s),r.removeUser().then(function(){return o.Log.debug("UserManager._signoutStart: user removed, creating signout request"),r.createSignoutRequest(t).then(function(t){return o.Log.debug("UserManager._signoutStart: got signout request"),i.url=t.url,t.state&&(i.id=t.state.id),e.navigate(i)})})})}).catch(function(t){throw e.close&&(o.Log.debug("UserManager._signoutStart: Error after preparing navigator, closing navigator window"),e.close()),t})})},t.prototype._signoutEnd=function e(t){return this.processSignoutResponse(t).then(function(e){return o.Log.debug("UserManager._signoutEnd: got signout response"),e})},t.prototype.revokeAccessToken=function e(){var t=this;return this._loadUser().then(function(e){return t._revokeInternal(e,!0).then(function(r){if(r)return o.Log.debug("UserManager.revokeAccessToken: removing token properties from user and re-storing"),e.access_token=null,e.refresh_token=null,e.expires_at=null,e.token_type=null,t.storeUser(e).then(function(){o.Log.debug("UserManager.revokeAccessToken: user stored"),t._events.load(e)})})}).then(function(){o.Log.info("UserManager.revokeAccessToken: access token revoked successfully")})},t.prototype._revokeInternal=function e(t,r){var n=this;if(t){var i=t.access_token,s=t.refresh_token;return this._revokeAccessTokenInternal(i,r).then(function(e){return n._revokeRefreshTokenInternal(s,r).then(function(t){return e||t||o.Log.debug("UserManager.revokeAccessToken: no need to revoke due to no token(s), or JWT format"),e||t})})}return Promise.resolve(!1)},t.prototype._revokeAccessTokenInternal=function e(t,r){return!t||t.indexOf(".")>=0?Promise.resolve(!1):this._tokenRevocationClient.revoke(t,r).then(function(){return!0})},t.prototype._revokeRefreshTokenInternal=function e(t,r){return t?this._tokenRevocationClient.revoke(t,r,"refresh_token").then(function(){return!0}):Promise.resolve(!1)},t.prototype.startSilentRenew=function e(){this._silentRenewService.start()},t.prototype.stopSilentRenew=function e(){this._silentRenewService.stop()},t.prototype._loadUser=function e(){return this._userStore.get(this._userStoreKey).then(function(e){return e?(o.Log.debug("UserManager._loadUser: user storageString loaded"),a.User.fromStorageString(e)):(o.Log.debug("UserManager._loadUser: no user storageString"),null)})},t.prototype.storeUser=function e(t){if(t){o.Log.debug("UserManager.storeUser: storing user");var r=t.toStorageString();return this._userStore.set(this._userStoreKey,r)}return o.Log.debug("storeUser.storeUser: removing user"),this._userStore.remove(this._userStoreKey)},n(t,[{key:"_redirectNavigator",get:function e(){return this.settings.redirectNavigator}},{key:"_popupNavigator",get:function e(){return this.settings.popupNavigator}},{key:"_iframeNavigator",get:function e(){return this.settings.iframeNavigator}},{key:"_userStore",get:function e(){return this.settings.userStore}},{key:"events",get:function e(){return this._events}},{key:"_userStoreKey",get:function e(){return"user:"+this.settings.authority+":"+this.settings.client_id}}]),t}(i.OidcClient)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserManagerSettings=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=(r(0),r(35)),i=r(131),s=r(132),a=r(134),u=r(36),c=r(7),l=r(52);var f=60,p=2e3;t.UserManagerSettings=function(e){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.popup_redirect_uri,o=r.popup_post_logout_redirect_uri,d=r.popupWindowFeatures,h=r.popupWindowTarget,g=r.silent_redirect_uri,_=r.silentRequestTimeout,v=r.automaticSilentRenew,y=void 0!==v&&v,m=r.includeIdTokenInSilentRenew,w=void 0===m||m,b=r.monitorSession,S=void 0===b||b,k=r.checkSessionInterval,T=void 0===k?p:k,E=r.stopCheckSessionOnError,L=void 0===E||E,P=r.query_status_response_type,R=r.revokeAccessTokenOnSignout,x=void 0!==R&&R,C=r.accessTokenExpiringNotificationTime,U=void 0===C?f:C,M=r.redirectNavigator,O=void 0===M?new i.RedirectNavigator:M,j=r.popupNavigator,I=void 0===j?new s.PopupNavigator:j,A=r.iframeNavigator,N=void 0===A?new a.IFrameNavigator:A,F=r.userStore,J=void 0===F?new u.WebStorageStateStore({store:c.Global.sessionStorage}):F;!function B(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var q=function V(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,arguments[0]));return q._popup_redirect_uri=n,q._popup_post_logout_redirect_uri=o,q._popupWindowFeatures=d,q._popupWindowTarget=h,q._silent_redirect_uri=g,q._silentRequestTimeout=_,q._automaticSilentRenew=y,q._includeIdTokenInSilentRenew=w,q._accessTokenExpiringNotificationTime=U,q._monitorSession=S,q._checkSessionInterval=T,q._stopCheckSessionOnError=L,P?q._query_status_response_type=P:arguments[0]&&arguments[0].response_type?q._query_status_response_type=l.SigninRequest.isOidc(arguments[0].response_type)?"id_token":"code":q._query_status_response_type="id_token",q._revokeAccessTokenOnSignout=x,q._redirectNavigator=O,q._popupNavigator=I,q._iframeNavigator=N,q._userStore=J,q}return function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"popup_redirect_uri",get:function e(){return this._popup_redirect_uri}},{key:"popup_post_logout_redirect_uri",get:function e(){return this._popup_post_logout_redirect_uri}},{key:"popupWindowFeatures",get:function e(){return this._popupWindowFeatures}},{key:"popupWindowTarget",get:function e(){return this._popupWindowTarget}},{key:"silent_redirect_uri",get:function e(){return this._silent_redirect_uri}},{key:"silentRequestTimeout",get:function e(){return this._silentRequestTimeout}},{key:"automaticSilentRenew",get:function e(){return this._automaticSilentRenew}},{key:"includeIdTokenInSilentRenew",get:function e(){return this._includeIdTokenInSilentRenew}},{key:"accessTokenExpiringNotificationTime",get:function e(){return this._accessTokenExpiringNotificationTime}},{key:"monitorSession",get:function e(){return this._monitorSession}},{key:"checkSessionInterval",get:function e(){return this._checkSessionInterval}},{key:"stopCheckSessionOnError",get:function e(){return this._stopCheckSessionOnError}},{key:"query_status_response_type",get:function e(){return this._query_status_response_type}},{key:"revokeAccessTokenOnSignout",get:function e(){return this._revokeAccessTokenOnSignout}},{key:"redirectNavigator",get:function e(){return this._redirectNavigator}},{key:"popupNavigator",get:function e(){return this._popupNavigator}},{key:"iframeNavigator",get:function e(){return this._iframeNavigator}},{key:"userStore",get:function e(){return this._userStore}}]),t}(o.OidcClientSettings)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RedirectNavigator=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=r(0);t.RedirectNavigator=function(){function e(){!function t(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.prototype.prepare=function e(){return Promise.resolve(this)},e.prototype.navigate=function e(t){return t&&t.url?(window.location=t.url,Promise.resolve()):(o.Log.error("RedirectNavigator.navigate: No url provided"),Promise.reject(new Error("No url provided")))},n(e,[{key:"url",get:function e(){return window.location.href}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PopupNavigator=void 0;var n=r(0),o=r(133);t.PopupNavigator=function(){function e(){!function t(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.prototype.prepare=function e(t){var r=new o.PopupWindow(t);return Promise.resolve(r)},e.prototype.callback=function e(t,r,i){n.Log.debug("PopupNavigator.callback");try{return o.PopupWindow.notifyOpener(t,r,i),Promise.resolve()}catch(e){return Promise.reject(e)}},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PopupWindow=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=r(0),i=r(16);var s=500,a="location=no,toolbar=no,width=500,height=500,left=100,top=100;",u="_blank";t.PopupWindow=function(){function e(t){var r=this;!function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._promise=new Promise(function(e,t){r._resolve=e,r._reject=t});var i=t.popupWindowTarget||u,c=t.popupWindowFeatures||a;this._popup=window.open("",i,c),this._popup&&(o.Log.debug("PopupWindow.ctor: popup successfully created"),this._checkForPopupClosedTimer=window.setInterval(this._checkForPopupClosed.bind(this),s))}return e.prototype.navigate=function e(t){return this._popup?t&&t.url?(o.Log.debug("PopupWindow.navigate: Setting URL in popup"),this._id=t.id,this._id&&(window["popupCallback_"+t.id]=this._callback.bind(this)),this._popup.focus(),this._popup.window.location=t.url):(this._error("PopupWindow.navigate: no url provided"),this._error("No url provided")):this._error("PopupWindow.navigate: Error opening popup window"),this.promise},e.prototype._success=function e(t){o.Log.debug("PopupWindow.callback: Successful response from popup window"),this._cleanup(),this._resolve(t)},e.prototype._error=function e(t){o.Log.error("PopupWindow.error: ",t),this._cleanup(),this._reject(new Error(t))},e.prototype.close=function e(){this._cleanup(!1)},e.prototype._cleanup=function e(t){o.Log.debug("PopupWindow.cleanup"),window.clearInterval(this._checkForPopupClosedTimer),this._checkForPopupClosedTimer=null,delete window["popupCallback_"+this._id],this._popup&&!t&&this._popup.close(),this._popup=null},e.prototype._checkForPopupClosed=function e(){this._popup&&!this._popup.closed||this._error("Popup window closed")},e.prototype._callback=function e(t,r){this._cleanup(r),t?(o.Log.debug("PopupWindow.callback success"),this._success({url:t})):(o.Log.debug("PopupWindow.callback: Invalid response from popup"),this._error("Invalid response from popup"))},e.notifyOpener=function e(t,r,n){if(window.opener){if(t=t||window.location.href){var s=i.UrlUtility.parseUrlFragment(t,n);if(s.state){var a="popupCallback_"+s.state,u=window.opener[a];u?(o.Log.debug("PopupWindow.notifyOpener: passing url message to opener"),u(t,r)):o.Log.warn("PopupWindow.notifyOpener: no matching callback found on opener")}else o.Log.warn("PopupWindow.notifyOpener: no state found in response url")}}else o.Log.warn("PopupWindow.notifyOpener: no window.opener. Can't complete notification.")},n(e,[{key:"promise",get:function e(){return this._promise}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IFrameNavigator=void 0;var n=r(0),o=r(135);t.IFrameNavigator=function(){function e(){!function t(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.prototype.prepare=function e(t){var r=new o.IFrameWindow(t);return Promise.resolve(r)},e.prototype.callback=function e(t){n.Log.debug("IFrameNavigator.callback");try{return o.IFrameWindow.notifyParent(t),Promise.resolve()}catch(e){return Promise.reject(e)}},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IFrameWindow=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=r(0);t.IFrameWindow=function(){function e(t){var r=this;!function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._promise=new Promise(function(e,t){r._resolve=e,r._reject=t}),this._boundMessageEvent=this._message.bind(this),window.addEventListener("message",this._boundMessageEvent,!1),this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="absolute",this._frame.style.display="none",this._frame.style.width=0,this._frame.style.height=0,window.document.body.appendChild(this._frame)}return e.prototype.navigate=function e(t){if(t&&t.url){var r=t.silentRequestTimeout||1e4;o.Log.debug("IFrameWindow.navigate: Using timeout of:",r),this._timer=window.setTimeout(this._timeout.bind(this),r),this._frame.src=t.url}else this._error("No url provided");return this.promise},e.prototype._success=function e(t){this._cleanup(),o.Log.debug("IFrameWindow: Successful response from frame window"),this._resolve(t)},e.prototype._error=function e(t){this._cleanup(),o.Log.error(t),this._reject(new Error(t))},e.prototype.close=function e(){this._cleanup()},e.prototype._cleanup=function e(){this._frame&&(o.Log.debug("IFrameWindow: cleanup"),window.removeEventListener("message",this._boundMessageEvent,!1),window.clearTimeout(this._timer),window.document.body.removeChild(this._frame),this._timer=null,this._frame=null,this._boundMessageEvent=null)},e.prototype._timeout=function e(){o.Log.debug("IFrameWindow.timeout"),this._error("Frame window timed out")},e.prototype._message=function e(t){if(o.Log.debug("IFrameWindow.message"),this._timer&&t.origin===this._origin&&t.source===this._frame.contentWindow){var r=t.data;r?this._success({url:r}):this._error("Invalid response from frame")}},e.notifyParent=function e(t){o.Log.debug("IFrameWindow.notifyParent"),window.frameElement&&(t=t||window.location.href)&&(o.Log.debug("IFrameWindow.notifyParent: posting url message to parent"),window.parent.postMessage(t,location.protocol+"//"+location.host))},n(e,[{key:"promise",get:function e(){return this._promise}},{key:"_origin",get:function e(){return location.protocol+"//"+location.host}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserManagerEvents=void 0;var n=r(0),o=r(56),i=r(57);t.UserManagerEvents=function(e){function t(r){!function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,r));return o._userLoaded=new i.Event("User loaded"),o._userUnloaded=new i.Event("User unloaded"),o._silentRenewError=new i.Event("Silent renew error"),o._userSignedOut=new i.Event("User signed out"),o._userSessionChanged=new i.Event("User session changed"),o}return function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.load=function t(r){var o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];n.Log.debug("UserManagerEvents.load"),e.prototype.load.call(this,r),o&&this._userLoaded.raise(r)},t.prototype.unload=function t(){n.Log.debug("UserManagerEvents.unload"),e.prototype.unload.call(this),this._userUnloaded.raise()},t.prototype.addUserLoaded=function e(t){this._userLoaded.addHandler(t)},t.prototype.removeUserLoaded=function e(t){this._userLoaded.removeHandler(t)},t.prototype.addUserUnloaded=function e(t){this._userUnloaded.addHandler(t)},t.prototype.removeUserUnloaded=function e(t){this._userUnloaded.removeHandler(t)},t.prototype.addSilentRenewError=function e(t){this._silentRenewError.addHandler(t)},t.prototype.removeSilentRenewError=function e(t){this._silentRenewError.removeHandler(t)},t.prototype._raiseSilentRenewError=function e(t){n.Log.debug("UserManagerEvents._raiseSilentRenewError",t.message),this._silentRenewError.raise(t)},t.prototype.addUserSignedOut=function e(t){this._userSignedOut.addHandler(t)},t.prototype.removeUserSignedOut=function e(t){this._userSignedOut.removeHandler(t)},t.prototype._raiseUserSignedOut=function e(t){n.Log.debug("UserManagerEvents._raiseUserSignedOut"),this._userSignedOut.raise(t)},t.prototype.addUserSessionChanged=function e(t){this._userSessionChanged.addHandler(t)},t.prototype.removeUserSessionChanged=function e(t){this._userSessionChanged.removeHandler(t)},t.prototype._raiseUserSessionChanged=function e(t){n.Log.debug("UserManagerEvents._raiseUserSessionChanged"),this._userSessionChanged.raise(t)},t}(o.AccessTokenEvents)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Timer=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=r(0),i=r(7),s=r(57);t.Timer=function(e){function t(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.Global.timer,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;!function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,r));return a._timer=n,a._nowFunc=o||function(){return Date.now()/1e3},a}return function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.init=function e(t){t<=0&&(t=1),t=parseInt(t);var r=this.now+t;if(this.expiration===r&&this._timerHandle)o.Log.debug("Timer.init timer "+this._name+" skipping initialization since already initialized for expiration:",this.expiration);else{this.cancel(),o.Log.debug("Timer.init timer "+this._name+" for duration:",t),this._expiration=r;var n=5;t<n&&(n=t),this._timerHandle=this._timer.setInterval(this._callback.bind(this),1e3*n)}},t.prototype.cancel=function e(){this._timerHandle&&(o.Log.debug("Timer.cancel: ",this._name),this._timer.clearInterval(this._timerHandle),this._timerHandle=null)},t.prototype._callback=function t(){var r=this._expiration-this.now;o.Log.debug("Timer.callback; "+this._name+" timer expires in:",r),this._expiration<=this.now&&(this.cancel(),e.prototype.raise.call(this))},n(t,[{key:"now",get:function e(){return parseInt(this._nowFunc())}},{key:"expiration",get:function e(){return this._expiration}}]),t}(s.Event)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SilentRenewService=void 0;var n=r(0);t.SilentRenewService=function(){function e(t){!function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._userManager=t}return e.prototype.start=function e(){this._callback||(this._callback=this._tokenExpiring.bind(this),this._userManager.events.addAccessTokenExpiring(this._callback),this._userManager.getUser().then(function(e){}).catch(function(e){n.Log.error("SilentRenewService.start: Error from getUser:",e.message)}))},e.prototype.stop=function e(){this._callback&&(this._userManager.events.removeAccessTokenExpiring(this._callback),delete this._callback)},e.prototype._tokenExpiring=function e(){var t=this;this._userManager.signinSilent().then(function(e){n.Log.debug("SilentRenewService._tokenExpiring: Silent token renewal successful")},function(e){n.Log.error("SilentRenewService._tokenExpiring: Error from signinSilent:",e.message),t._userManager.events._raiseSilentRenewError(e)})},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CordovaPopupNavigator=void 0;var n=r(61);t.CordovaPopupNavigator=function(){function e(){!function t(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.prototype.prepare=function e(t){var r=new n.CordovaPopupWindow(t);return Promise.resolve(r)},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CordovaIFrameNavigator=void 0;var n=r(61);t.CordovaIFrameNavigator=function(){function e(){!function t(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.prototype.prepare=function e(t){t.popupWindowFeatures="hidden=yes";var r=new n.CordovaPopupWindow(t);return Promise.resolve(r)},e}()}]);