imng-oidc-client 4.102.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -0
- package/esm2020/imng-oidc-client.mjs +5 -0
- package/esm2020/index.mjs +24 -0
- package/esm2020/lib/+state/oidc-user.facade.mjs +28 -0
- package/esm2020/lib/+state/oidc-user.selectors.mjs +13 -0
- package/esm2020/lib/+state/oidc.actions.mjs +37 -0
- package/esm2020/lib/+state/oidc.effects.mjs +66 -0
- package/esm2020/lib/+state/oidc.facade.mjs +136 -0
- package/esm2020/lib/+state/oidc.reducer.mjs +93 -0
- package/esm2020/lib/+state/oidc.selectors.mjs +40 -0
- package/esm2020/lib/components/access-denied.component.mjs +14 -0
- package/esm2020/lib/components/logout-success.component.mjs +18 -0
- package/esm2020/lib/img-oidc-client-routing.module.mjs +44 -0
- package/esm2020/lib/imng-oidc-client.module.mjs +96 -0
- package/esm2020/lib/models/arguments.model.mjs +2 -0
- package/esm2020/lib/models/constants.mjs +17 -0
- package/esm2020/lib/models/oidc-client-config.mjs +3 -0
- package/esm2020/lib/models/oidc-library-config.mjs +3 -0
- package/esm2020/lib/models/oidc-user-profile.mjs +2 -0
- package/esm2020/lib/models/oidc-user.mjs +2 -0
- package/esm2020/lib/services/auth-guard.mjs +40 -0
- package/esm2020/lib/services/oidc.service.mjs +166 -0
- package/esm2020/lib/services/permissions.guard.mjs +22 -0
- package/esm2020/lib/services/token-interceptor.service.mjs +35 -0
- package/esm2020/lib/support/support.component.mjs +85 -0
- package/esm2020/lib/util/jwt-decoder.mjs +11 -0
- package/esm2020/lib/util/oidc-client-configurator.mjs +24 -0
- package/fesm2015/imng-oidc-client.mjs +844 -0
- package/fesm2015/imng-oidc-client.mjs.map +1 -0
- package/fesm2020/imng-oidc-client.mjs +907 -0
- package/fesm2020/imng-oidc-client.mjs.map +1 -0
- package/imng-oidc-client.d.ts +5 -0
- package/index.d.ts +23 -0
- package/lib/+state/oidc-user.facade.d.ts +16 -0
- package/lib/+state/oidc-user.selectors.d.ts +7 -0
- package/lib/+state/oidc.actions.d.ts +72 -0
- package/lib/+state/oidc.effects.d.ts +58 -0
- package/lib/+state/oidc.facade.d.ts +56 -0
- package/lib/+state/oidc.reducer.d.ts +22 -0
- package/lib/+state/oidc.selectors.d.ts +20 -0
- package/lib/components/access-denied.component.d.ts +5 -0
- package/lib/components/logout-success.component.d.ts +5 -0
- package/lib/img-oidc-client-routing.module.d.ts +12 -0
- package/lib/imng-oidc-client.module.d.ts +17 -0
- package/lib/models/arguments.model.d.ts +21 -0
- package/lib/models/constants.d.ts +14 -0
- package/lib/models/oidc-client-config.d.ts +12 -0
- package/lib/models/oidc-library-config.d.ts +12 -0
- package/lib/models/oidc-user-profile.d.ts +4 -0
- package/lib/models/oidc-user.d.ts +15 -0
- package/lib/services/auth-guard.d.ts +14 -0
- package/lib/services/oidc.service.d.ts +37 -0
- package/lib/services/permissions.guard.d.ts +12 -0
- package/lib/services/token-interceptor.service.d.ts +12 -0
- package/lib/support/support.component.d.ts +15 -0
- package/lib/util/jwt-decoder.d.ts +1 -0
- package/lib/util/oidc-client-configurator.d.ts +3 -0
- package/package.json +54 -0
- package/src/assets/callback.html +44 -0
- package/src/assets/oidc-client.rsa256.slim.min.js +3 -0
- package/src/assets/renew-callback.html +18 -0
- package/src/assets/signout-callback.html +29 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
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){"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(6);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,p,f,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]={}),b=m.prototype||(m.prototype={});for(c in h&&(r=t),r)p=((l=!d&&y&&void 0!==y[c])?y:r)[c],f=v&&l?a(p,n):_&&"function"==typeof p?a(Function.call,p):p,y&&s(y,c,p,e&u.U),m[c]!=p&&i(m,c,f),_&&b[c]!=p&&(b[c]=p)};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){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(4);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 p in u)return u;return{}},e}()},function(e,t,r){var n=r(5),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(6),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",p=900,f=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,b=t.redirect_uri,S=t.post_logout_redirect_uri,w=t.prompt,k=t.display,T=t.max_age,P=t.ui_locales,E=t.acr_values,L=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?p:O,I=t.clockSkew,A=void 0===I?f:I,N=t.userInfoJwtIssuer,q=void 0===N?"OP":N,F=t.stateStore,J=void 0===F?new s.WebStorageStateStore:F,B=t.ResponseValidatorCtor,V=void 0===B?a.ResponseValidator:B,W=t.MetadataServiceCtor,D=void 0===W?u.MetadataService:W,H=t.extraQueryParams,z=void 0===H?{}:H,K=t.extraTokenParams,Q=void 0===K?{}:K;!function G(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=b,this._post_logout_redirect_uri=S,this._prompt=w,this._display=k,this._max_age=T,this._ui_locales=P,this._acr_values=E,this._resource=L,this._response_mode=R,this._filterProtocolClaims=!!C,this._loadUserInfo=!!M,this._staleStateAge=j,this._clockSkew=A,this._userInfoJwtIssuer=q,this._stateStore=J,this._validator=new V(this),this._metadataService=new D(this),this._extraQueryParams="object"===(void 0===z?"undefined":n(z))?z:{},this._extraTokenParams="object"===(void 0===Q?"undefined":n(Q))?Q:{}}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={}}},{key:"extraTokenParams",get:function e(){return this._extraTokenParams},set:function e(t){"object"===(void 0===t?"undefined":n(t))?this._extraTokenParams=t:this._extraTokenParams={}}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebStorageStateStore=void 0;var n=r(0),o=r(4);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(4);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,s=t.request_type;!function a(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),this._request_type=s}return e.prototype.toStorageString=function e(){return o.Log.debug("State.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})},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}},{key:"request_type",get:function e(){return this._request_type}}]),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(7),i=r(11),s=r(8),a=r(15),u=r(71),c=r(33),l=r(77),p=r(1)("iterator"),f=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,r,h,g,_,v){u(r,t,h);var y,m,b,S=function(e){if(!f&&e in P)return P[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)}},w=t+" Iterator",k="values"==g,T=!1,P=e.prototype,E=P[p]||P["@@iterator"]||g&&P[g],L=E||S(g),R=g?k?S("entries"):L:void 0,x="Array"==t&&P.entries||E;if(x&&(b=l(x.call(new e)))!==Object.prototype&&b.next&&(c(b,w,!0),n||"function"==typeof b[p]||s(b,p,d)),k&&E&&"values"!==E.name&&(T=!0,L=function e(){return E.call(this)}),n&&!v||!f&&!T&&P[p]||s(P,p,L),a[t]=L,a[w]=d,g)if(y={values:k?L:S("values"),keys:_?L:S("keys"),entries:R},v)for(m in y)m in P||i(P,m,y[m]);else o(o.P+o.F*(f||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),p=l.process,f=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)};f&&d||(f=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)(p)?n=function(e){p.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:f,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,p=6==e,f=5==e||p,d=t||a;return function(t,a,h){for(var g,_,v=i(t),y=o(v),m=n(a,h,3),b=s(y.length),S=0,w=r?d(t,b):u?d(t,0):void 0;b>S;S++)if((f||S in y)&&(_=m(g=y[S],S,v),e))if(r)w[S]=_;else if(_)switch(e){case 3:return!0;case 5:return g;case 6:return S;case 2:w.push(g)}else if(l)return!1;return p?-1:c||l?l:w}}},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),p=r(53),f=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,p=r.display,f=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,b=r.response_mode,S=r.extraQueryParams,w=r.extraTokenParams,k=r.request_type,T=r.skipUserInfo,P=arguments[1];o.Log.debug("OidcClient.createSigninRequest");var E=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,p=p||this._settings.display,f=f||this._settings.max_age,d=d||this._settings.ui_locales,_=_||this._settings.acr_values,v=v||this._settings.resource,b=b||this._settings.response_mode,S=S||this._settings.extraQueryParams,w=w||this._settings.extraTokenParams;var L=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:E,redirect_uri:s,response_type:n,scope:i,data:u||c,authority:L,prompt:l,display:p,max_age:f,ui_locales:d,id_token_hint:h,login_hint:g,acr_values:_,resource:v,request:y,request_uri:m,extraQueryParams:S,extraTokenParams:w,request_type:k,response_mode:b,client_secret:t._settings.client_secret,skipUserInfo:T}),R=r.state;return(P=P||t._stateStore).set(R.id,R.toStorageString()).then(function(){return r})})},e.prototype.readSigninResponseState=function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];o.Log.debug("OidcClient.readSigninResponseState");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,(n?r.remove.bind(r):r.get.bind(r))(s.state).then(function(e){if(!e)throw o.Log.error("OidcClient.readSigninResponseState: No matching state found in storage"),new Error("No matching state found in storage");return{state:p.SigninState.fromStorageString(e),response:s}})):(o.Log.error("OidcClient.readSigninResponseState: No state in response"),Promise.reject(new Error("No state in response")))},e.prototype.processSigninResponse=function e(t,r){var n=this;return o.Log.debug("OidcClient.processSigninResponse"),this.readSigninResponseState(t,r,!0).then(function(e){var t=e.state,r=e.response;return o.Log.debug("OidcClient.processSigninResponse: Received state from storage; validating response"),n._validator.validateSigninResponse(t,r)})},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=r.request_type,p=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,request_type:l}),f=r.state;return f&&(o.Log.debug("OidcClient.createSignoutRequest: Signout request has state to persist"),(p=p||t._stateStore).set(f.id,f.toStorageString())),r})},e.prototype.readSignoutResponseState=function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];o.Log.debug("OidcClient.readSignoutResponseState");var i=new l.SignoutResponse(t);if(!i.state)return o.Log.debug("OidcClient.readSignoutResponseState: No state in response"),i.error?(o.Log.warn("OidcClient.readSignoutResponseState: Response was error: ",i.error),Promise.reject(new s.ErrorResponse(i))):Promise.resolve({undefined:void 0,response:i});var a=i.state;return r=r||this._stateStore,(n?r.remove.bind(r):r.get.bind(r))(a).then(function(e){if(!e)throw o.Log.error("OidcClient.readSignoutResponseState: No matching state found in storage"),new Error("No matching state found in storage");return{state:f.State.fromStorageString(e),response:i}})},e.prototype.processSignoutResponse=function e(t,r){var n=this;return o.Log.debug("OidcClient.processSignoutResponse"),this.readSignoutResponseState(t,r,!0).then(function(e){var t=e.state,r=e.response;return t?(o.Log.debug("OidcClient.processSignoutResponse: Received state from storage; validating response"),n._validator.validateSignoutResponse(t,r)):(o.Log.debug("OidcClient.processSignoutResponse: No state from storage; skipping validating response"),r)})},e.prototype.clearStaleState=function e(t){return o.Log.debug("OidcClient.clearStaleState"),t=t||this._stateStore,f.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=Object.assign({},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=Object.assign({},r)).grant_type=r.grant_type||"refresh_token",r.client_id=r.client_id||this._settings.client_id,r.client_secret=r.client_secret||this._settings.client_secret,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,u=r.session_state;if(function c(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 l=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,i||o));return l.name="ErrorResponse",l.error=o,l.error_description=i,l.error_uri=s,l.state=a,l.session_state=u,l}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,p=t.data,f=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,b=t.response_mode,S=t.request,w=t.request_uri,k=t.extraQueryParams,T=t.request_type,P=t.client_secret,E=t.extraTokenParams,L=t.skipUserInfo;if(function R(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 x=e.isOidc(u),C=e.isCode(u);b||(b=e.isCode(u)?"query":null),this.state=new i.SigninState({nonce:x,data:p,client_id:s,authority:l,redirect_uri:a,code_verifier:C,request_type:T,response_mode:b,client_secret:P,scope:c,extraTokenParams:E,skipUserInfo: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),x&&(r=o.UrlUtility.addQueryParam(r,"nonce",this.state.nonce)),C&&(r=o.UrlUtility.addQueryParam(r,"code_challenge",this.state.code_challenge),r=o.UrlUtility.addQueryParam(r,"code_challenge_method","S256"));var U={prompt:f,display:d,max_age:h,ui_locales:g,id_token_hint:_,login_hint:v,acr_values:y,resource:m,request:S,request_uri:w,response_mode:b};for(var M in U)U[M]&&(r=o.UrlUtility.addQueryParam(r,M,U[M]));for(var O in k)r=o.UrlUtility.addQueryParam(r,O,k[O]);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,l=r.response_mode,p=r.client_secret,f=r.scope,d=r.extraTokenParams,h=r.skipUserInfo;!function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var _=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]));if(!0===n?_._nonce=(0,a.default)():n&&(_._nonce=n),!0===c?_._code_verifier=(0,a.default)()+(0,a.default)()+(0,a.default)():c&&(_._code_verifier=c),_.code_verifier){var y=s.JoseUtil.hashString(_.code_verifier,"SHA256");_._code_challenge=s.JoseUtil.hexToBase64Url(y)}return _._redirect_uri=u,_._authority=o,_._client_id=i,_._response_mode=l,_._client_secret=p,_._scope=f,_._extraTokenParams=d,_._skipUserInfo=h,_}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,request_type:this.request_type,nonce:this.nonce,code_verifier:this.code_verifier,redirect_uri:this.redirect_uri,authority:this.authority,client_id:this.client_id,response_mode:this.response_mode,client_secret:this.client_secret,scope:this.scope,extraTokenParams:this.extraTokenParams,skipUserInfo:this.skipUserInfo})},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}},{key:"response_mode",get:function e(){return this._response_mode}},{key:"client_secret",get:function e(){return this._client_secret}},{key:"scope",get:function e(){return this._scope}},{key:"extraTokenParams",get:function e(){return this._extraTokenParams}},{key:"skipUserInfo",get:function e(){return this._skipUserInfo}}]),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 p(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),s=r(4);t.SessionMonitor=function(){function e(t){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.CheckSessionIFrame,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.Global.timer;if(function u(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._timer=a,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):r._settings.monitorAnonymousSession&&r._userManager.querySessionStatus().then(function(e){var t={session_state:e.session_state};e.sub&&e.sid&&(t.profile={sub:e.sub,sid:e.sid}),r._start(t)}).catch(function(e){o.Log.error("SessionMonitor ctor: error from querySessionStatus:",e.message)})}).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&&(t.profile?(this._sub=t.profile.sub,this._sid=t.profile.sid,o.Log.debug("SessionMonitor._start: session_state:",n,", sub:",this._sub)):(this._sub=void 0,this._sid=void 0,o.Log.debug("SessionMonitor._start: session_state:",n,", anonymous user")),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(){var t=this;if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&(o.Log.debug("SessionMonitor._stop"),this._checkSessionIFrame.stop()),this._settings.monitorAnonymousSession)var r=this._timer.setInterval(function(){t._timer.clearInterval(r),t._userManager.querySessionStatus().then(function(e){var r={session_state:e.session_state};e.sub&&e.sid&&(r.profile={sub:e.sub,sid:e.sid}),t._start(r)}).catch(function(e){o.Log.error("SessionMonitor: error from querySessionStatus:",e.message)})},1e3)},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&&(t._sub?(o.Log.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed out event"),t._userManager.events._raiseUserSignedOut()):(o.Log.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed in event"),t._userManager.events._raiseUserSignedIn()))}).catch(function(e){t._sub&&(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(4);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(6);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(5),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(5),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"),p=c("toStringTag"),f=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],b=m&&m.prototype;if(b&&(b[l]||a(b,l,f),b[p]||a(b,p,v),u[v]=f,y))for(_ in n)b[_]||i(b,_,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),p=r(7),f=r(6),d=r(14),h=r(82),g=r(83),_=r(87),v=r(44).set,y=r(88)(),m=r(46),b=r(89),S=r(90),w=r(91),k=u.TypeError,T=u.process,P=T&&T.versions,E=P&&P.v8||"",L=u.Promise,R="process"==l(T),x=function(){},C=o=m.f,U=!!function(){try{var e=L.resolve(1),t=(e.constructor={})[r(1)("species")]=function(e){e(x,x)};return(R||"function"==typeof PromiseRejectionEvent)&&e.then(x)instanceof t&&0!==E.indexOf("6.6")&&-1===S.indexOf("Chrome/66")}catch(e){}}(),M=function(e){var t;return!(!f(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=b(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))},q=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(q,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||(L=function e(t){h(this,L,"Promise","_h"),d(t),n.call(this);try{t(c(q,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)(L.prototype,{then:function e(t,r){var n=C(_(this,L));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(q,e,1),this.reject=c(N,e,1)},m.f=C=function(e){return e===L||e===s?new i(e):o(e)}),p(p.G+p.W+p.F*!U,{Promise:L}),r(33)(L,"Promise"),r(93)("Promise"),s=r(3).Promise,p(p.S+p.F*!U,"Promise",{reject:function e(t){var r=C(this);return(0,r.reject)(t),r.promise}}),p(p.S+p.F*(a||!U),"Promise",{resolve:function e(t){return w(a&&this===s?L:this,t)}}),p(p.S+p.F*!(U&&r(94)(function(e){L.all(e).catch(x)})),"Promise",{all:function e(t){var r=this,n=C(r),o=n.resolve,i=n.reject,s=b(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=b(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(5),a=r(31),u=r(86),c={},l={};(t=e.exports=function(e,t,r,p,f){var d,h,g,_,v=f?function(){return e}:u(e),y=n(r,p,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(5);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(5),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 p=!0,f=document.createTextNode("");new i(c).observe(f,{characterData:!0}),r=function(){f.data=p=!p}}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(5),o=r(6),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(7);n(n.P,"Function",{bind:r(97)})},function(e,t,r){"use strict";var n=r(14),o=r(6),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(7);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,p=o.f,f=i.f;c>l;)for(var d,h=a(arguments[l++]),g=p?n(h).concat(p(h)):n(h),_=g.length,v=0;_>v;)f.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(7),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(6),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(7),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(7);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),p=r(139),f=r(140),d=r(59),h=r(60),g=r(58),_=r(4),v=r(55),y=r(141);t.default={Version:y.Version,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:p.CordovaPopupNavigator,CordovaIFrameNavigator:f.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 p(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(t,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"))):(r.scope||(r.scope=t.scope),Promise.resolve(r))},e.prototype._processClaims=function e(t,r){var n=this;if(r.isOpenIdConnect){if(o.Log.debug("ResponseValidator._processClaims: response is OIDC, processing claims"),r.profile=this._filterProtocolClaims(r.profile),!0!==t.skipUserInfo&&this._settings.loadUserInfo&&r.access_token)return o.Log.debug("ResponseValidator._processClaims: loading user info"),this._userInfoService.getClaims(r.access_token).then(function(e){return o.Log.debug("ResponseValidator._processClaims: user info claims received from user info endpoint"),e.sub!==r.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"))):(r.profile=n._mergeClaims(r.profile,e),o.Log.debug("ResponseValidator._processClaims: user info claims received, updated profile:",r.profile),r)});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(r)},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 i=this,s={client_id:t.client_id,client_secret:t.client_secret,code:r.code,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier};return t.extraTokenParams&&"object"===n(t.extraTokenParams)&&Object.assign(s,t.extraTokenParams),this._tokenClient.exchangeCode(s).then(function(e){for(var n in e)r[n]=e[n];return r.id_token?(o.Log.debug("ResponseValidator._processCode: token response successful, processing id_token"),i._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=s(r(117)),o=s(r(118)),i=s(r(120));function s(e){return e&&e.__esModule?e:{default:e}}var a=n.default.BigInteger,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c={b64tohex:function e(t){var r,n,o="",i=0;for(r=0;r<t.length&&"="!==t.charAt(r);++r){var s=u.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+=u.charAt(n>>6)+u.charAt(63&n);for(r+1===t.length?(n=parseInt(t.substring(r,r+1),16),o+=u.charAt(n<<2)):r+2===t.length&&(n=parseInt(t.substring(r,r+2),16),o+=u.charAt(n>>2)+u.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 c.byteArrayToHex(i.default.toByteArray(c.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)}},l={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},p={sha256:o.default,SHA256:o.default};
|
|
2
|
+
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
|
|
3
|
+
*/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 a(e,16),this.e=parseInt(t,16)}f.prototype.verify=function(e,t){t=(t=c.decodeToHEX(t)).replace(/[^0-9a-f]|[\s\n]]/gi,"");var r=new a(t,16);if(r.bitLength()>this.n.bitLength())throw new Error("Signature does not match with the key modulus.");var n=function o(e){for(var t in l){var r=l[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===n.length)return!1;if(!p.hasOwnProperty(n.alg))throw new Error("Hashing algorithm is not supported.");var i=p[n.alg](e).toString();return n.hash===i};var d=["RS256"],h={JWS:{parse:function e(t){var r,n,o=t.split(".");if(3===o.length){try{r=JSON.parse(c.urlDecode(o[0])),n=JSON.parse(c.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===d.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])}}},g={getKey:function e(t){return"RSA"===t.kty?{e:c.decodeToHEX(t.e),n:c.decodeToHEX(t.n)}:null}},_={getPublicKeyFromCertPEM:function e(){throw new Error("Not implemented. Use the full oidc-client library if you need support for X509.")}},v={Util:{hashString:function e(t,r){return(0,p[r])(t).toString()}}};var y=c.b64tohex;t.jws=h,t.KeyUtil=g,t.X509=_,t.crypto=v,t.hextob64u=function m(e){return e.length%2==1&&(e="0"+e),c.base64ToBase64Url(c.hexToBase64(e))},t.b64tohex=y,t.AllowedSigningAlgs=d},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,p=u*c+l*a;o=((c=a*c+((32767&p)<<15)+r[n]+(1073741823&o))>>>30)+(p>>>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",p=new Array;for(u="0".charCodeAt(0),c=0;c<=9;++c)p[u++]=c;for(u="a".charCodeAt(0),c=10;c<36;++c)p[u++]=c;for(u="A".charCodeAt(0),c=10;c<36;++c)p[u++]=c;function f(e){return l.charAt(e)}function d(e,t){var r=p[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 b(e,t){return e^t}function S(e,t){return e&~t}function w(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 P(e){return e}function E(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 L(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 q(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 F(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 J(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},r.prototype.dlShiftTo=function B(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 p=a.t,f=a[p-1];if(0!=f){var d=f*(1<<this.F1)+(p>1?a[p-2]>>this.F2:0),h=this.FV/d,_=(1<<this.F1)/d,v=1<<this.F2,y=o.t,m=y-p,b=null==t?n():t;for(a.dlShiftTo(m,b),o.compareTo(b)>=0&&(o[o.t++]=1,o.subTo(b,o)),r.ONE.dlShiftTo(p,b),b.subTo(a,a);a.t<p;)a[a.t++]=0;for(;--m>=0;){var S=o[--y]==f?this.DM:Math.floor(o[y]*h+(o[y-1]+v)*_);if((o[y]+=a.am(0,S,o,m,0,p))<S)for(a.dlShiftTo(m,b),o.subTo(b,o);o[y]<--S;)o.subTo(b,o)}null!=t&&(o.drShiftTo(p,t),u!=c&&r.ZERO.subTo(t,t)),o.t=p,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=f(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+=f(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=P,T.prototype.revert=P,T.prototype.mulTo=function ie(e,t,r){e.multiplyTo(t,r)},T.prototype.sqrTo=function se(e,t){e.squareTo(t)},E.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},E.prototype.revert=function ue(e){return e},E.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)},E.prototype.mulTo=function le(e,t,r){e.multiplyTo(t,r),this.reduce(r)},E.prototype.sqrTo=function pe(e,t){e.squareTo(t),this.reduce(t)};var fe,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>=bt&&(he-=bt)}((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 be(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 Se(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 we(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 Pe(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},r.prototype.dAddOffset=function Ee(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 Le(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 qe(e){return this.compareTo(e)<0?this:e},r.prototype.max=function Fe(e){return this.compareTo(e)>0?this:e},r.prototype.and=function Je(e){var t=n();return this.bitwiseTo(e,y,t),t},r.prototype.or=function Be(e){var t=n();return this.bitwiseTo(e,m,t),t},r.prototype.xor=function Ve(e){var t=n();return this.bitwiseTo(e,b,t),t},r.prototype.andNot=function We(e){var t=n();return this.bitwiseTo(e,S,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+w(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,S)},r.prototype.flipBit=function Ye(e){return this.changeBit(e,b)},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 E(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 p=n();for(o.sqrTo(a[1],p);u<=l;)a[u]=n(),o.mulTo(p,a[u-2],a[u]),u+=2}var f,d,y=e.t-1,m=!0,b=n();for(i=g(e[y])-1;y>=0;){for(i>=c?f=e[y]>>i-c&l:(f=(e[y]&(1<<i+1)-1)<<c-i,y>0&&(f|=e[y-1]>>this.DB+i-c)),u=r;0==(1&f);)f>>=1,--u;if((i-=u)<0&&(i+=this.DB,--y),m)a[f].copyTo(s),m=!1;else{for(;u>1;)o.sqrTo(s,b),o.sqrTo(b,s),u-=2;u>0?o.sqrTo(s,b):(d=s,s=b,b=d),o.mulTo(b,a[f],s)}for(;y>=0&&0==(e[y]&1<<i);)o.sqrTo(s,b),d=s,s=b,b=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=E,null==de){var pt;if(de=new Array,he=0,"undefined"!=typeof window&&window.crypto)if(window.crypto.getRandomValues){var ft=new Uint8Array(32);for(window.crypto.getRandomValues(ft),pt=0;pt<32;++pt)de[he++]=ft[pt]}else if("Netscape"==navigator.appName&&navigator.appVersion<"5"){var dt=window.crypto.random(32);for(pt=0;pt<dt.length;++pt)de[he++]=255&dt.charCodeAt(pt)}for(;he<bt;)pt=Math.floor(65536*Math.random()),de[he++]=pt>>>8,de[he++]=255&pt;he=0,ve()}function ht(){if(null==fe){for(ve(),(fe=function e(){return new _t}()).init(de),he=0;he<de.length;++he)de[he]=0;he=0}return fe.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 bt=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],p=r[6],f=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),b=f+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&l^~a&p)+u[d]+c[d];f=p,p=l,l=a,a=s+b|0,s=i,i=o,o=n,n=b+(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]+p|0,r[7]=r[7]+f|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)))}},p=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 p=0;p<c;p+=i)this._doProcessBlock(n,p);var f=n.splice(0,c);r.sigBytes-=l}return new s.init(f,l)},clone:function(){var e=i.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),f=(o.Hasher=p.extend({cfg:i.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.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 f.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=f(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function o(e){for(var t,r=f(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,p=0;p<l;p+=4)t=a[e.charCodeAt(p)]<<18|a[e.charCodeAt(p+1)]<<12|a[e.charCodeAt(p+2)]<<6|a[e.charCodeAt(p+3)],i[c++]=t>>16&255,i[c++]=t>>8&255,i[c++]=255&t;2===o&&(t=a[e.charCodeAt(p)]<<2|a[e.charCodeAt(p+1)]>>4,i[c++]=255&t);1===o&&(t=a[e.charCodeAt(p)]<<10|a[e.charCodeAt(p+1)]<<4|a[e.charCodeAt(p+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,p=c.length;l<p;++l)s[l]=c[l],a[c.charCodeAt(l)]=l;function f(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,p,f){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,p,f)}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 p=a+s,f=a-s;if(!c.iat)return o.Log.error("JoseUtil._validateJwt: iat was not provided"),Promise.reject(new Error("iat was not provided"));if(p<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&&p<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<f)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,p){return e.validateJwtAttributes(n,s,a,c,l,p).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,l=t.request_type;if(function p(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,request_type:l}),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),p=r(60),f=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]:p.TokenRevocationClient,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:f.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(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="si:r";var r={useReplaceToNavigate:t.useReplaceToNavigate};return this._signinStart(t,this._redirectNavigator,r).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.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]:{};(t=Object.assign({},t)).request_type="si:p";var 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(r=Object.assign({},r)).request_type="si:s",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,e&&t._settings.validateSubOnSilentRenew&&(o.Log.debug("UserManager.signinSilent, subject prior to silent renew: ",e.profile.sub),r.current_sub=e.profile.sub),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.id_token=e.id_token,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||this.settings.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.signinCallback=function e(t){var r=this;return this.readSigninResponseState(t).then(function(e){var n=e.state;e.response;return"si:r"===n.request_type?r.signinRedirectCallback(t):"si:p"===n.request_type?r.signinPopupCallback(t):"si:s"===n.request_type?r.signinSilentCallback(t):Promise.reject(new Error("invalid response_type in state"))})},t.prototype.signoutCallback=function e(t,r){var n=this;return this.readSignoutResponseState(t).then(function(e){var o=e.state,i=e.response;return o?"so:r"===o.request_type?n.signoutRedirectCallback(t):"so:p"===o.request_type?n.signoutPopupCallback(t,r):Promise.reject(new Error("invalid response_type in state")):i})},t.prototype.querySessionStatus=function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(r=Object.assign({},r)).request_type="si:s";var n=r.redirect_uri||this.settings.silent_redirect_uri||this.settings.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=r.scope||"openid",r.skipUserInfo=!0,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")}).catch(function(e){if(e.session_state&&t.settings.monitorAnonymousSession&&("login_required"==e.message||"consent_required"==e.message||"interaction_required"==e.message||"account_selection_required"==e.message))return o.Log.info("UserManager.querySessionStatus: querySessionStatus success for anonymous user"),{session_state:e.session_state};throw e})})):(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)})},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,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.processSigninResponse(t).then(function(e){o.Log.debug("UserManager._signinEnd: got signin response");var t=new a.User(e);if(n.current_sub){if(n.current_sub!==t.profile.sub)return o.Log.debug("UserManager._signinEnd: current user does not match user returned from signin. sub from signin: ",t.profile.sub),Promise.reject(new Error("login_required"));o.Log.debug("UserManager._signinEnd: current user matches user returned from signin")}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]:{};(t=Object.assign({},t)).request_type="so:r";var r=t.post_logout_redirect_uri||this.settings.post_logout_redirect_uri;r&&(t.post_logout_redirect_uri=r);var n={useReplaceToNavigate:t.useReplaceToNavigate};return this._signoutStart(t,this._redirectNavigator,n).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]:{};(t=Object.assign({},t)).request_type="so:p";var 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(4),l=r(52);var p=60,f=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.validateSubOnSilentRenew,b=void 0!==m&&m,S=r.includeIdTokenInSilentRenew,w=void 0===S||S,k=r.monitorSession,T=void 0===k||k,P=r.monitorAnonymousSession,E=void 0!==P&&P,L=r.checkSessionInterval,R=void 0===L?f:L,x=r.stopCheckSessionOnError,C=void 0===x||x,U=r.query_status_response_type,M=r.revokeAccessTokenOnSignout,O=void 0!==M&&M,j=r.accessTokenExpiringNotificationTime,I=void 0===j?p:j,A=r.redirectNavigator,N=void 0===A?new i.RedirectNavigator:A,q=r.popupNavigator,F=void 0===q?new s.PopupNavigator:q,J=r.iframeNavigator,B=void 0===J?new a.IFrameNavigator:J,V=r.userStore,W=void 0===V?new u.WebStorageStateStore({store:c.Global.sessionStorage}):V;!function D(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var H=function z(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 H._popup_redirect_uri=n,H._popup_post_logout_redirect_uri=o,H._popupWindowFeatures=d,H._popupWindowTarget=h,H._silent_redirect_uri=g,H._silentRequestTimeout=_,H._automaticSilentRenew=y,H._validateSubOnSilentRenew=b,H._includeIdTokenInSilentRenew=w,H._accessTokenExpiringNotificationTime=I,H._monitorSession=T,H._monitorAnonymousSession=E,H._checkSessionInterval=R,H._stopCheckSessionOnError=C,U?H._query_status_response_type=U:arguments[0]&&arguments[0].response_type?H._query_status_response_type=l.SigninRequest.isOidc(arguments[0].response_type)?"id_token":"code":H._query_status_response_type="id_token",H._revokeAccessTokenOnSignout=O,H._redirectNavigator=N,H._popupNavigator=F,H._iframeNavigator=B,H._userStore=W,H}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:"validateSubOnSilentRenew",get:function e(){return this._validateSubOnSilentRenew}},{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:"monitorAnonymousSession",get:function e(){return this._monitorAnonymousSession}},{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?(t.useReplaceToNavigate?window.location.replace(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._userSignedIn=new i.Event("User signed in"),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.addUserSignedIn=function e(t){this._userSignedIn.addHandler(t)},t.prototype.removeUserSignedIn=function e(t){this._userSignedIn.removeHandler(t)},t.prototype._raiseUserSignedIn=function e(){n.Log.debug("UserManagerEvents._raiseUserSignedIn"),this._userSignedIn.raise()},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(){n.Log.debug("UserManagerEvents._raiseUserSignedOut"),this._userSignedOut.raise()},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(){n.Log.debug("UserManagerEvents._raiseUserSessionChanged"),this._userSessionChanged.raise()},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(4),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}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Version="1.10.1"}]);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>Renew Callback</title>
|
|
6
|
+
<link rel="icon" type="image/x-icon" href="favicon.png" />
|
|
7
|
+
</head>
|
|
8
|
+
|
|
9
|
+
<body>
|
|
10
|
+
<script src="oidc-client.rsa256.slim.min.js"></script>
|
|
11
|
+
<script>
|
|
12
|
+
var promise = new Oidc.UserManager().signinSilentCallback();
|
|
13
|
+
promise.catch(function (e) {
|
|
14
|
+
console.error(e);
|
|
15
|
+
});
|
|
16
|
+
</script>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>Signout Callback</title>
|
|
6
|
+
<link rel="icon" type="image/x-icon" href="favicon.png" />
|
|
7
|
+
<script
|
|
8
|
+
src="oidc-client.rsa256.slim.min.js"
|
|
9
|
+
type="application/javascript"
|
|
10
|
+
></script>
|
|
11
|
+
</head>
|
|
12
|
+
|
|
13
|
+
<body>
|
|
14
|
+
<script>
|
|
15
|
+
var Oidc = window.Oidc;
|
|
16
|
+
var isPopupCallback = JSON.parse(
|
|
17
|
+
window.localStorage.getItem('ngoidc:isPopupCallback')
|
|
18
|
+
);
|
|
19
|
+
if (isPopupCallback) {
|
|
20
|
+
new Oidc.UserManager(config).signoutPopupCallback();
|
|
21
|
+
} else {
|
|
22
|
+
var promise = new Oidc.UserManager().signoutRedirectCallback();
|
|
23
|
+
promise.then(function () {
|
|
24
|
+
window.location.href = '/';
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
28
|
+
</body>
|
|
29
|
+
</html>
|