forked from IdentityModel/oidc-client-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoidc-client.rsa256.slim.min.js
3 lines (3 loc) · 167 KB
/
oidc-client.rsa256.slim.min.js
1
2
3
var Oidc=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function t(){return e.default}:function t(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=93)}([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){(function(t){var r=function(e){return e&&e.Math==Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof t&&t)||Function("return this")()}).call(this,r(98))},function(e,t,r){var n=r(1),o=r(52),i=r(5),s=r(55),a=r(56),u=r(99),c=o("wks"),f=n.Symbol,l=u?f:f&&f.withoutSetter||s;e.exports=function(e){return i(c,e)||(a&&i(f,e)?c[e]=f[e]:c[e]=l("Symbol."+e)),c[e]}},function(e,t,r){var n=r(1),o=r(41).f,i=r(9),s=r(14),a=r(34),u=r(104),c=r(63);e.exports=function(e,t){var r,f,l,p,d,h=e.target,g=e.global,v=e.stat;if(r=g?n:v?n[h]||a(h,{}):(n[h]||{}).prototype)for(f in t){if(p=t[f],l=e.noTargetGet?(d=o(r,f))&&d.value:r[f],!c(g?f:h+(v?".":"#")+f,e.forced)&&void 0!==l){if(typeof p==typeof l)continue;u(p,l)}(e.sham||l&&l.sham)&&i(p,"sham",!0),s(r,f,p,e)}}},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){var n=r(4);e.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,r){var n=r(7);e.exports=function(e){if(!n(e))throw TypeError(String(e)+" is not an object");return e}},function(e,t,r){var n=r(6),o=r(10),i=r(18);e.exports=n?function(e,t,r){return o.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t,r){var n=r(6),o=r(54),i=r(8),s=r(36),a=Object.defineProperty;t.f=n?a:function e(t,r,n){if(i(t),r=s(r,!0),i(n),o)try{return a(t,r,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[r]=n.value),t}},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(25),o=r(1),i=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?i(n[e])||i(o[e]):n[e]&&n[e][t]||o[e]&&o[e][t]}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},function(e,t,r){var n=r(1),o=r(9),i=r(5),s=r(34),a=r(37),u=r(19),c=u.get,f=u.enforce,l=String(String).split("String");(e.exports=function(e,t,r,a){var u=!!a&&!!a.unsafe,c=!!a&&!!a.enumerable,p=!!a&&!!a.noTargetGet;"function"==typeof r&&("string"!=typeof t||i(r,"name")||o(r,"name",t),f(r).source=l.join("string"==typeof t?t:"")),e!==n?(u?!p&&e[t]&&(c=!0):delete e[t],c?e[t]=r:o(e,t,r)):c?e[t]=r:s(t,r)})(Function.prototype,"toString",(function e(){return"function"==typeof this&&c(this).source||a(this)}))},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},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(50);function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.MetadataService=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.JsonService;if(s(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){e.exports=!1},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,r){var n,o,i,s=r(100),a=r(1),u=r(7),c=r(9),f=r(5),l=r(38),p=r(39),d=a.WeakMap;if(s){var h=new d,g=h.get,v=h.has,_=h.set;n=function(e,t){return _.call(h,e,t),t},o=function(e){return g.call(h,e)||{}},i=function(e){return v.call(h,e)}}else{var y=l("state");p[y]=!0,n=function(e,t){return c(e,y,t),t},o=function(e){return f(e,y)?e[y]:{}},i=function(e){return f(e,y)}}e.exports={set:n,get:o,has:i,enforce:function(e){return i(e)?o(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!u(t)||(r=o(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return r}}}},function(e,t){e.exports={}},function(e,t,r){"use strict";var n=r(13),o=function(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.exports.f=function(e){return new o(e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UrlUtility=void 0;var n=r(0),o=r(11);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,f=0;a=c.exec(t);)if(u[decodeURIComponent(a[1])]=decodeURIComponent(a[2].replace(/\+/g," ")),f++>50)return n.Log.error("UrlUtility.parseUrlFragment: response exceeded expected number of parameters",t),{error:"Response exceeded expected number of parameters"};for(var l in u)return u;return{}},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,r){var n=r(42),o=r(40);e.exports=function(e){return n(o(e))}},function(e,t,r){var n=r(1);e.exports=n},function(e,t,r){var n=r(23),o=Math.min;e.exports=function(e){return e>0?o(n(e),9007199254740991):0}},function(e,t,r){var n=r(40);e.exports=function(e){return Object(n(e))}},function(e,t,r){var n=r(8),o=r(119),i=r(26),s=r(29),a=r(120),u=r(121),c=function(e,t){this.stopped=e,this.result=t};(e.exports=function(e,t,r,f,l){var p,d,h,g,v,_,y,m=s(t,r,f?2:1);if(l)p=e;else{if("function"!=typeof(d=a(e)))throw TypeError("Target is not iterable");if(o(d)){for(h=0,g=i(e.length);g>h;h++)if((v=f?m(n(y=e[h])[0],y[1]):m(e[h]))&&v instanceof c)return v;return new c(!1)}p=d.call(e)}for(_=p.next;!(y=_.call(p)).done;)if("object"==typeof(v=u(p,m,y.value,f))&&v&&v instanceof c)return v;return new c(!1)}).stop=function(e){return new c(!0,e)}},function(e,t,r){var n=r(13);e.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 0:return function(){return e.call(t)};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){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},function(e,t,r){var n=r(1),o=r(29),i=Function.call;e.exports=function(e,t,r){return o(i,n[e].prototype[t],r)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JoseUtil=void 0;var n=r(156),o=function i(e){return e&&e.__esModule?e:{default:e}}(r(161));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={};n[r(2)("toStringTag")]="z",e.exports="[object z]"===String(n)},function(e,t,r){var n=r(1),o=r(9);e.exports=function(e,t){try{o(n,e,t)}catch(r){n[e]=t}return t}},function(e,t,r){var n=r(1),o=r(7),i=n.document,s=o(i)&&o(i.createElement);e.exports=function(e){return s?i.createElement(e):{}}},function(e,t,r){var n=r(7);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){var n=r(53),o=Function.toString;"function"!=typeof n.inspectSource&&(n.inspectSource=function(e){return o.call(e)}),e.exports=n.inspectSource},function(e,t,r){var n=r(52),o=r(55),i=n("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},function(e,t){e.exports={}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,r){var n=r(6),o=r(59),i=r(18),s=r(24),a=r(36),u=r(5),c=r(54),f=Object.getOwnPropertyDescriptor;t.f=n?f:function e(t,r){if(t=s(t),r=a(r,!0),c)try{return f(t,r)}catch(e){}if(u(t,r))return i(!o.f.call(t,r),t[r])}},function(e,t,r){var n=r(4),o=r(15),i="".split;e.exports=n((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==o(e)?i.call(e,""):Object(e)}:Object},function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(e,t,r){var n=r(5),o=r(27),i=r(38),s=r(109),a=i("IE_PROTO"),u=Object.prototype;e.exports=s?Object.getPrototypeOf:function(e){return e=o(e),n(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?u:null}},function(e,t,r){var n,o=r(8),i=r(110),s=r(43),a=r(39),u=r(66),c=r(35),f=r(38),l=f("IE_PROTO"),p=function(){},d=function(e){return"<script>"+e+"<\/script>"},h=function(){try{n=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;h=n?function(e){e.write(d("")),e.close();var t=e.parentWindow.Object;return e=null,t}(n):((t=c("iframe")).style.display="none",u.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(d("document.F=Object")),e.close(),e.F);for(var r=s.length;r--;)delete h.prototype[s[r]];return h()};a[l]=!0,e.exports=Object.create||function e(t,r){var n;return null!==t?(p.prototype=o(t),n=new p,p.prototype=null,n[l]=t):n=h(),void 0===r?n:i(n,r)}},function(e,t,r){var n=r(10).f,o=r(5),i=r(2)("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(6),o=r(4),i=r(5),s=Object.defineProperty,a={},u=function(e){throw e};e.exports=function(e,t){if(i(a,e))return a[e];t||(t={});var r=[][e],c=!!i(t,"ACCESSORS")&&t.ACCESSORS,f=i(t,0)?t[0]:u,l=i(t,1)?t[1]:void 0;return a[e]=!!r&&!o((function(){if(c&&!n)return!0;var e={length:-1};c?s(e,1,{enumerable:!0,get:u}):e[1]=1,r.call(e,f,l)}))}},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(49),a=r(154),u=r(16);function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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,f=t.signingKeys,l=t.client_id,p=t.client_secret,d=t.response_type,h=void 0===d?"id_token":d,g=t.scope,v=void 0===g?"openid":g,_=t.redirect_uri,y=t.post_logout_redirect_uri,m=t.prompt,b=t.display,S=t.max_age,w=t.ui_locales,k=t.acr_values,T=t.resource,E=t.response_mode,P=t.filterProtocolClaims,L=void 0===P||P,x=t.loadUserInfo,R=void 0===x||x,C=t.staleStateAge,U=void 0===C?900:C,O=t.clockSkew,j=void 0===O?300:O,M=t.userInfoJwtIssuer,I=void 0===M?"OP":M,A=t.stateStore,N=void 0===A?new s.WebStorageStateStore:A,q=t.ResponseValidatorCtor,F=void 0===q?a.ResponseValidator:q,J=t.MetadataServiceCtor,B=void 0===J?u.MetadataService:J,V=t.extraQueryParams,W=void 0===V?{}:V,D=t.extraTokenParams,H=void 0===D?{}:D;c(this,e),this._authority=r,this._metadataUrl=o,this._metadata=i,this._signingKeys=f,this._client_id=l,this._client_secret=p,this._response_type=h,this._scope=v,this._redirect_uri=_,this._post_logout_redirect_uri=y,this._prompt=m,this._display=b,this._max_age=S,this._ui_locales=w,this._acr_values=k,this._resource=T,this._response_mode=E,this._filterProtocolClaims=!!L,this._loadUserInfo=!!R,this._staleStateAge=U,this._clockSkew=j,this._userInfoJwtIssuer=I,this._stateStore=N,this._validator=new F(this),this._metadataService=new B(this),this._extraQueryParams="object"===(void 0===W?"undefined":n(W))?W:{},this._extraTokenParams="object"===(void 0===H?"undefined":n(H))?H:{}}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(11);function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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,s=t.store,a=void 0===s?o.Global.localStorage:s;i(this,e),this._store=a,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(11);function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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;i(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 f=r[c];f&&(u.length>0&&(u+="&"),u+=encodeURIComponent(c),u+="=",u+=encodeURIComponent(f))}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(85));function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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;a(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,r){var n=r(17),o=r(53);(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:n?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(e,t,r){var n=r(1),o=r(34),i=n["__core-js_shared__"]||o("__core-js_shared__",{});e.exports=i},function(e,t,r){var n=r(6),o=r(4),i=r(35);e.exports=!n&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},function(e,t){var r=0,n=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++r+n).toString(36)}},function(e,t,r){var n=r(4);e.exports=!!Object.getOwnPropertySymbols&&!n((function(){return!String(Symbol())}))},function(e,t,r){var n=r(33),o=r(15),i=r(2)("toStringTag"),s="Arguments"==o(function(){return arguments}());e.exports=n?o:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?r:s?o(t):"Object"==(n=o(t))&&"function"==typeof t.callee?"Arguments":n}},function(e,t,r){"use strict";var n=r(3),o=r(108),i=r(44),s=r(67),a=r(46),u=r(9),c=r(14),f=r(2),l=r(17),p=r(20),d=r(64),h=d.IteratorPrototype,g=d.BUGGY_SAFARI_ITERATORS,v=f("iterator"),_=function(){return this};e.exports=function(e,t,r,f,d,y,m){o(r,t,f);var b,S,w,k=function(e){if(e===d&&x)return x;if(!g&&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)};case"entries":return function t(){return new r(this,e)}}return function(){return new r(this)}},T=t+" Iterator",E=!1,P=e.prototype,L=P[v]||P["@@iterator"]||d&&P[d],x=!g&&L||k(d),R="Array"==t&&P.entries||L;if(R&&(b=i(R.call(new e)),h!==Object.prototype&&b.next&&(l||i(b)===h||(s?s(b,h):"function"!=typeof b[v]&&u(b,v,_)),a(b,T,!0,!0),l&&(p[T]=_))),"values"==d&&L&&"values"!==L.name&&(E=!0,x=function e(){return L.call(this)}),l&&!m||P[v]===x||u(P,v,x),p[t]=x,d)if(S={values:k("values"),keys:y?x:k("keys"),entries:k("entries")},m)for(w in S)(g||E||!(w in P))&&c(P,w,S[w]);else n({target:t,proto:!0,forced:g||E},S);return S}},function(e,t,r){"use strict";var n={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!n.call({1:2},1);t.f=i?function e(t){var r=o(this,t);return!!r&&r.enumerable}:n},function(e,t,r){var n=r(5),o=r(24),i=r(107).indexOf,s=r(39);e.exports=function(e,t){var r,a=o(e),u=0,c=[];for(r in a)!n(s,r)&&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(23),o=Math.max,i=Math.min;e.exports=function(e,t){var r=n(e);return r<0?o(r+t,0):i(r,t)}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,r){var n=r(4),o=/#|\.prototype\./,i=function(e,t){var r=a[s(e)];return r==c||r!=u&&("function"==typeof t?n(t):!!t)},s=i.normalize=function(e){return String(e).replace(o,".").toLowerCase()},a=i.data={},u=i.NATIVE="N",c=i.POLYFILL="P";e.exports=i},function(e,t,r){"use strict";var n,o,i,s=r(44),a=r(9),u=r(5),c=r(2),f=r(17),l=c("iterator"),p=!1;[].keys&&("next"in(i=[].keys())?(o=s(s(i)))!==Object.prototype&&(n=o):p=!0),null==n&&(n={}),f||u(n,l)||a(n,l,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:p}},function(e,t,r){var n=r(60),o=r(43);e.exports=Object.keys||function e(t){return n(t,o)}},function(e,t,r){var n=r(12);e.exports=n("document","documentElement")},function(e,t,r){var n=r(8),o=r(111);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),t=r instanceof Array}catch(e){}return function r(i,s){return n(i),o(s),t?e.call(i,s):i.__proto__=s,i}}():void 0)},function(e,t,r){var n=r(2),o=r(45),i=r(10),s=n("unscopables"),a=Array.prototype;null==a[s]&&i.f(a,s,{configurable:!0,value:o(null)}),e.exports=function(e){a[s][e]=!0}},function(e,t,r){var n=r(1);e.exports=n.Promise},function(e,t,r){var n=r(8),o=r(13),i=r(2)("species");e.exports=function(e,t){var r,s=n(e).constructor;return void 0===s||null==(r=n(s)[i])?t:o(r)}},function(e,t,r){var n,o,i,s=r(1),a=r(4),u=r(15),c=r(29),f=r(66),l=r(35),p=r(72),d=s.location,h=s.setImmediate,g=s.clearImmediate,v=s.process,_=s.MessageChannel,y=s.Dispatch,m=0,b={},S=function(e){if(b.hasOwnProperty(e)){var t=b[e];delete b[e],t()}},w=function(e){return function(){S(e)}},k=function(e){S(e.data)},T=function(e){s.postMessage(e+"",d.protocol+"//"+d.host)};h&&g||(h=function e(t){for(var r=[],o=1;arguments.length>o;)r.push(arguments[o++]);return b[++m]=function(){("function"==typeof t?t:Function(t)).apply(void 0,r)},n(m),m},g=function e(t){delete b[t]},"process"==u(v)?n=function(e){v.nextTick(w(e))}:y&&y.now?n=function(e){y.now(w(e))}:_&&!p?(i=(o=new _).port2,o.port1.onmessage=k,n=c(i.postMessage,i,1)):!s.addEventListener||"function"!=typeof postMessage||s.importScripts||a(T)||"file:"===d.protocol?n="onreadystatechange"in l("script")?function(e){f.appendChild(l("script")).onreadystatechange=function(){f.removeChild(this),S(e)}}:function(e){setTimeout(w(e),0)}:(n=T,s.addEventListener("message",k,!1))),e.exports={set:h,clear:g}},function(e,t,r){var n=r(73);e.exports=/(iphone|ipod|ipad).*applewebkit/i.test(n)},function(e,t,r){var n=r(12);e.exports=n("navigator","userAgent")||""},function(e,t,r){var n=r(8),o=r(7),i=r(21);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,o,i=r(1),s=r(73),a=i.process,u=a&&a.versions,c=u&&u.v8;c?o=(n=c.split("."))[0]+n[1]:s&&(!(n=s.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=s.match(/Chrome\/(\d+)/))&&(o=n[1]),e.exports=o&&+o},function(e,t,r){"use strict";var n=r(3),o=r(13),i=r(21),s=r(30),a=r(28);n({target:"Promise",stat:!0},{allSettled:function e(t){var r=this,n=i.f(r),u=n.resolve,c=n.reject,f=s((function(){var e=o(r.resolve),n=[],i=0,s=1;a(t,(function(t){var o=i++,a=!1;n.push(void 0),s++,e.call(r,t).then((function(e){a||(a=!0,n[o]={status:"fulfilled",value:e},--s||u(n))}),(function(e){a||(a=!0,n[o]={status:"rejected",reason:e},--s||u(n))}))})),--s||u(n)}));return f.error&&c(f.value),n.promise}})},function(e,t,r){var n=r(29),o=r(42),i=r(27),s=r(26),a=r(78),u=[].push,c=function(e){var t=1==e,r=2==e,c=3==e,f=4==e,l=6==e,p=5==e||l;return function(d,h,g,v){for(var _,y,m=i(d),b=o(m),S=n(h,g,3),w=s(b.length),k=0,T=v||a,E=t?T(d,w):r?T(d,0):void 0;w>k;k++)if((p||k in b)&&(y=S(_=b[k],k,m),e))if(t)E[k]=y;else if(y)switch(e){case 3:return!0;case 5:return _;case 6:return k;case 2:u.call(E,_)}else if(f)return!1;return l?-1:c||f?f:E}};e.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6)}},function(e,t,r){var n=r(7),o=r(79),i=r(2)("species");e.exports=function(e,t){var r;return o(e)&&("function"!=typeof(r=e.constructor)||r!==Array&&!o(r.prototype)?n(r)&&null===(r=r[i])&&(r=void 0):r=void 0),new(void 0===r?Array:r)(0===t?0:t)}},function(e,t,r){var n=r(15);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(48),s=r(82),a=r(83),u=r(162),c=r(163),f=r(164),l=r(84),p=r(51);function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.OidcClient=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d(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,f=r.prompt,l=r.display,p=r.max_age,d=r.ui_locales,h=r.id_token_hint,g=r.login_hint,v=r.acr_values,_=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,E=arguments[1];o.Log.debug("OidcClient.createSigninRequest");var P=this._settings.client_id;n=n||this._settings.response_type,i=i||this._settings.scope,s=s||this._settings.redirect_uri,f=f||this._settings.prompt,l=l||this._settings.display,p=p||this._settings.max_age,d=d||this._settings.ui_locales,v=v||this._settings.acr_values,_=_||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:P,redirect_uri:s,response_type:n,scope:i,data:u||c,authority:L,prompt:f,display:l,max_age:p,ui_locales:d,id_token_hint:h,login_hint:g,acr_values:v,resource:_,request:y,request_uri:m,extraQueryParams:S,extraTokenParams:w,request_type:k,response_mode:b,client_secret:t._settings.client_secret,skipUserInfo:T}),x=r.state;return(E=E||t._stateStore).set(x.id,x.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=i?"?":"#",c=new u.SigninResponse(t,s);if(!c.state)return o.Log.error("OidcClient.readSigninResponseState: No state in response"),Promise.reject(new Error("No state in response"));r=r||this._stateStore;var f=n?r.remove.bind(r):r.get.bind(r);return f(c.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:l.SigninState.fromStorageString(e),response:c}}))},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,f=r.request_type,l=arguments[1];return o.Log.debug("OidcClient.createSignoutRequest"),a=a||this._settings.post_logout_redirect_uri,u=u||this._settings.extraQueryParams,this._metadataService.getEndSessionEndpoint().then((function(e){if(!e)throw o.Log.error("OidcClient.createSignoutRequest: No end session endpoint url returned"),new Error("no end session endpoint");o.Log.debug("OidcClient.createSignoutRequest: Received end session endpoint",e);var r=new c.SignoutRequest({url:e,id_token_hint:n,post_logout_redirect_uri:a,data:i||s,extraQueryParams:u,request_type:f}),p=r.state;return p&&(o.Log.debug("OidcClient.createSignoutRequest: Signout request has state to persist"),(l=l||t._stateStore).set(p.id,p.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 f.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({state:void 0,response:i});var a=i.state;r=r||this._stateStore;var u=n?r.remove.bind(r):r.get.bind(r);return u(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:p.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,p.State.clearStaleState(t,this.settings.staleStateAge)},n(e,[{key:"_stateStore",get:function e(){return this.settings.stateStore}},{key:"_validator",get:function e(){return this.settings.validator}},{key:"_metadataService",get:function e(){return this.settings.metadataService}},{key:"settings",get:function e(){return this._settings}},{key:"metadataService",get:function e(){return this._metadataService}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClient=void 0;var n=r(50),o=r(16),i=r(0);function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.TokenClient=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;if(s(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 a(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);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}t.ErrorResponse=function(e){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=r.error,a=r.error_description,u=r.error_uri,c=r.state,f=r.session_state;if(o(this,t),!s)throw n.Log.error("No error passed to ErrorResponse"),new Error("error");var l=i(this,e.call(this,a||s));return l.name="ErrorResponse",l.error=s,l.error_description=a,l.error_uri=u,l.state=c,l.session_state=f,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(22),i=r(84);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,f=t.authority,l=t.data,p=t.prompt,d=t.display,h=t.max_age,g=t.ui_locales,v=t.id_token_hint,_=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,E=t.client_secret,P=t.extraTokenParams,L=t.skipUserInfo;if(function x(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(!f)throw n.Log.error("SigninRequest.ctor: No authority passed"),new Error("authority");var R=e.isOidc(u),C=e.isCode(u);b||(b=e.isCode(u)?"query":null),this.state=new i.SigninState({nonce:R,data:l,client_id:s,authority:f,redirect_uri:a,code_verifier:C,request_type:T,response_mode:b,client_secret:E,scope:c,extraTokenParams:P,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),R&&(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:p,display:d,max_age:h,ui_locales:g,id_token_hint:v,login_hint:_,acr_values:y,resource:m,request:S,request_uri:w,response_mode:b};for(var O in U)U[O]&&(r=o.UrlUtility.addQueryParam(r,O,U[O]));for(var j in k)r=o.UrlUtility.addQueryParam(r,j,k[j]);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(51),s=r(32),a=function u(e){return e&&e.__esModule?e:{default:e}}(r(85));function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(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}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,l=r.code_verifier,p=r.response_mode,d=r.client_secret,h=r.scope,g=r.extraTokenParams,v=r.skipUserInfo;c(this,t);var _=f(this,e.call(this,arguments[0]));if(!0===n?_._nonce=(0,a.default)():n&&(_._nonce=n),!0===l?_._code_verifier=(0,a.default)()+(0,a.default)()+(0,a.default)():l&&(_._code_verifier=l),_.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=p,_._client_secret=d,_._scope=h,_._extraTokenParams=g,_._skipUserInfo=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.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("undefined"!=o&&null!==o&&void 0!==o.getRandomValues?i:s)().replace(/-/g,"")};var o="undefined"!=typeof window?window.crypto||window.msCrypto:null;function i(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(e){return(e^o.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)}))}function s(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(e){return(e^16*Math.random()>>e/4).toString(16)}))}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,f=t.state;!function l(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=f}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(174);function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.AccessTokenEvents=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.accessTokenExpiringNotificationTime,n=void 0===r?60: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;i(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(90),s=r(11);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.SessionMonitor=function(){function e(t){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.CheckSessionIFrame,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.Global.timer;if(a(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=u,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);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.CheckSessionIFrame=function(){function e(t,r,n,i){var s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];o(this,e),this._callback=t,this._client_id=r,this._url=n,this._interval=i||2e3,this._stopOnError=s;var a=n.indexOf("/",n.indexOf("//")+2);this._frame_origin=n.substr(0,a),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(16),i=r(11);function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.TokenRevocationClient=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.Global.XMLHttpRequest,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.MetadataService;if(s(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 a(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 f="client_id="+encodeURIComponent(r);o&&(f+="&client_secret="+encodeURIComponent(o)),f+="&token_type_hint="+encodeURIComponent(s),f+="&token="+encodeURIComponent(i),c.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),c.send(f)}))},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);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||"location=no,toolbar=no,zoom=no",this.target=t.popupWindowTarget||"_blank",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(94),e.exports=r(153)},function(e,t,r){"use strict";r(95),r(130),r(134),r(138),r(141),r(145),r(148)},function(e,t,r){var n=r(96);r(126),r(127),r(128),r(129),e.exports=n},function(e,t,r){r(97),r(102),r(112),r(115),r(76),r(125);var n=r(25);e.exports=n.Promise},function(e,t,r){var n=r(33),o=r(14),i=r(101);n||o(Object.prototype,"toString",i,{unsafe:!0})},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){var n=r(56);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(e,t,r){var n=r(1),o=r(37),i=n.WeakMap;e.exports="function"==typeof i&&/native code/.test(o(i))},function(e,t,r){"use strict";var n=r(33),o=r(57);e.exports=n?{}.toString:function e(){return"[object "+o(this)+"]"}},function(e,t,r){"use strict";var n=r(103).charAt,o=r(19),i=r(58),s=o.set,a=o.getterFor("String Iterator");i(String,"String",(function(e){s(this,{type:"String Iterator",string:String(e),index:0})}),(function e(){var t,r=a(this),o=r.string,i=r.index;return i>=o.length?{value:void 0,done:!0}:(t=n(o,i),r.index+=t.length,{value:t,done:!1})}))},function(e,t,r){var n=r(23),o=r(40),i=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}};e.exports={codeAt:i(!1),charAt:i(!0)}},function(e,t,r){var n=r(5),o=r(105),i=r(41),s=r(10);e.exports=function(e,t){for(var r=o(t),a=s.f,u=i.f,c=0;c<r.length;c++){var f=r[c];n(e,f)||a(e,f,u(t,f))}}},function(e,t,r){var n=r(12),o=r(106),i=r(62),s=r(8);e.exports=n("Reflect","ownKeys")||function e(t){var r=o.f(s(t)),n=i.f;return n?r.concat(n(t)):r}},function(e,t,r){var n=r(60),o=r(43).concat("length","prototype");t.f=Object.getOwnPropertyNames||function e(t){return n(t,o)}},function(e,t,r){var n=r(24),o=r(26),i=r(61),s=function(e){return function(t,r,s){var a,u=n(t),c=o(u.length),f=i(s,c);if(e&&r!=r){for(;c>f;)if((a=u[f++])!=a)return!0}else for(;c>f;f++)if((e||f in u)&&u[f]===r)return e||f||0;return!e&&-1}};e.exports={includes:s(!0),indexOf:s(!1)}},function(e,t,r){"use strict";var n=r(64).IteratorPrototype,o=r(45),i=r(18),s=r(46),a=r(20),u=function(){return this};e.exports=function(e,t,r){var c=t+" Iterator";return e.prototype=o(n,{next:i(1,r)}),s(e,c,!1,!0),a[c]=u,e}},function(e,t,r){var n=r(4);e.exports=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},function(e,t,r){var n=r(6),o=r(10),i=r(8),s=r(65);e.exports=n?Object.defineProperties:function e(t,r){i(t);for(var n,a=s(r),u=a.length,c=0;u>c;)o.f(t,n=a[c++],r[n]);return t}},function(e,t,r){var n=r(7);e.exports=function(e){if(!n(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},function(e,t,r){var n=r(1),o=r(113),i=r(114),s=r(9),a=r(2),u=a("iterator"),c=a("toStringTag"),f=i.values;for(var l in o){var p=n[l],d=p&&p.prototype;if(d){if(d[u]!==f)try{s(d,u,f)}catch(e){d[u]=f}if(d[c]||s(d,c,l),o[l])for(var h in i)if(d[h]!==i[h])try{s(d,h,i[h])}catch(e){d[h]=i[h]}}}},function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(e,t,r){"use strict";var n=r(24),o=r(68),i=r(20),s=r(19),a=r(58),u=s.set,c=s.getterFor("Array Iterator");e.exports=a(Array,"Array",(function(e,t){u(this,{type:"Array Iterator",target:n(e),index:0,kind:t})}),(function(){var e=c(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values"),i.Arguments=i.Array,o("keys"),o("values"),o("entries")},function(e,t,r){"use strict";var n,o,i,s,a=r(3),u=r(17),c=r(1),f=r(12),l=r(69),p=r(14),d=r(116),h=r(46),g=r(117),v=r(7),_=r(13),y=r(118),m=r(15),b=r(37),S=r(28),w=r(122),k=r(70),T=r(71).set,E=r(123),P=r(74),L=r(124),x=r(21),R=r(30),C=r(19),U=r(63),O=r(2),j=r(75),M=O("species"),I="Promise",A=C.get,N=C.set,q=C.getterFor(I),F=l,J=c.TypeError,B=c.document,V=c.process,W=f("fetch"),D=x.f,H=D,z="process"==m(V),K=!!(B&&B.createEvent&&c.dispatchEvent),Q=U(I,(function(){if(!(b(F)!==String(F))){if(66===j)return!0;if(!z&&"function"!=typeof PromiseRejectionEvent)return!0}if(u&&!F.prototype.finally)return!0;if(j>=51&&/native code/.test(F))return!1;var e=F.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[M]=t,!(e.then((function(){}))instanceof t)})),G=Q||!w((function(e){F.all(e).catch((function(){}))})),X=function(e){var t;return!(!v(e)||"function"!=typeof(t=e.then))&&t},Z=function(e,t,r){if(!t.notified){t.notified=!0;var n=t.reactions;E((function(){for(var o=t.value,i=1==t.state,s=0;n.length>s;){var a,u,c,f=n[s++],l=i?f.ok:f.fail,p=f.resolve,d=f.reject,h=f.domain;try{l?(i||(2===t.rejection&&te(e,t),t.rejection=1),!0===l?a=o:(h&&h.enter(),a=l(o),h&&(h.exit(),c=!0)),a===f.promise?d(J("Promise-chain cycle")):(u=X(a))?u.call(a,p,d):p(a)):d(o)}catch(e){h&&!c&&h.exit(),d(e)}}t.reactions=[],t.notified=!1,r&&!t.rejection&&$(e,t)}))}},Y=function(e,t,r){var n,o;K?((n=B.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),c.dispatchEvent(n)):n={promise:t,reason:r},(o=c["on"+e])?o(n):"unhandledrejection"===e&&L("Unhandled promise rejection",r)},$=function(e,t){T.call(c,(function(){var r,n=t.value;if(ee(t)&&(r=R((function(){z?V.emit("unhandledRejection",n,e):Y("unhandledrejection",e,n)})),t.rejection=z||ee(t)?2:1,r.error))throw r.value}))},ee=function(e){return 1!==e.rejection&&!e.parent},te=function(e,t){T.call(c,(function(){z?V.emit("rejectionHandled",e):Y("rejectionhandled",e,t.value)}))},re=function(e,t,r,n){return function(o){e(t,r,o,n)}},ne=function(e,t,r,n){t.done||(t.done=!0,n&&(t=n),t.value=r,t.state=2,Z(e,t,!0))},oe=function(e,t,r,n){if(!t.done){t.done=!0,n&&(t=n);try{if(e===r)throw J("Promise can't be resolved itself");var o=X(r);o?E((function(){var n={done:!1};try{o.call(r,re(oe,e,n,t),re(ne,e,n,t))}catch(r){ne(e,n,r,t)}})):(t.value=r,t.state=1,Z(e,t,!1))}catch(r){ne(e,{done:!1},r,t)}}};Q&&(F=function e(t){y(this,F,I),_(t),n.call(this);var r=A(this);try{t(re(oe,this,r),re(ne,this,r))}catch(e){ne(this,r,e)}},(n=function e(t){N(this,{type:I,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=d(F.prototype,{then:function e(t,r){var n=q(this),o=D(k(this,F));return o.ok="function"!=typeof t||t,o.fail="function"==typeof r&&r,o.domain=z?V.domain:void 0,n.parent=!0,n.reactions.push(o),0!=n.state&&Z(this,n,!1),o.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new n,t=A(e);this.promise=e,this.resolve=re(oe,e,t),this.reject=re(ne,e,t)},x.f=D=function(e){return e===F||e===i?new o(e):H(e)},u||"function"!=typeof l||(s=l.prototype.then,p(l.prototype,"then",(function e(t,r){var n=this;return new F((function(e,t){s.call(n,e,t)})).then(t,r)}),{unsafe:!0}),"function"==typeof W&&a({global:!0,enumerable:!0,forced:!0},{fetch:function e(t){return P(F,W.apply(c,arguments))}}))),a({global:!0,wrap:!0,forced:Q},{Promise:F}),h(F,I,!1,!0),g(I),i=f(I),a({target:I,stat:!0,forced:Q},{reject:function e(t){var r=D(this);return r.reject.call(void 0,t),r.promise}}),a({target:I,stat:!0,forced:u||Q},{resolve:function e(t){return P(u&&this===i?F:this,t)}}),a({target:I,stat:!0,forced:G},{all:function e(t){var r=this,n=D(r),o=n.resolve,i=n.reject,s=R((function(){var e=_(r.resolve),n=[],s=0,a=1;S(t,(function(t){var u=s++,c=!1;n.push(void 0),a++,e.call(r,t).then((function(e){c||(c=!0,n[u]=e,--a||o(n))}),i)})),--a||o(n)}));return s.error&&i(s.value),n.promise},race:function e(t){var r=this,n=D(r),o=n.reject,i=R((function(){var e=_(r.resolve);S(t,(function(t){e.call(r,t).then(n.resolve,o)}))}));return i.error&&o(i.value),n.promise}})},function(e,t,r){var n=r(14);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(12),o=r(10),i=r(2),s=r(6),a=i("species");e.exports=function(e){var t=n(e),r=o.f;s&&t&&!t[a]&&r(t,a,{configurable:!0,get:function(){return this}})}},function(e,t){e.exports=function(e,t,r){if(!(e instanceof t))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return e}},function(e,t,r){var n=r(2),o=r(20),i=n("iterator"),s=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||s[i]===e)}},function(e,t,r){var n=r(57),o=r(20),i=r(2)("iterator");e.exports=function(e){if(null!=e)return e[i]||e["@@iterator"]||o[n(e)]}},function(e,t,r){var n=r(8);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(2)("iterator"),o=!1;try{var i=0,s={next:function(){return{done:!!i++}},return:function(){o=!0}};s[n]=function(){return this},Array.from(s,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var r=!1;try{var i={};i[n]=function(){return{next:function(){return{done:r=!0}}}},e(i)}catch(e){}return r}},function(e,t,r){var n,o,i,s,a,u,c,f,l=r(1),p=r(41).f,d=r(15),h=r(71).set,g=r(72),v=l.MutationObserver||l.WebKitMutationObserver,_=l.process,y=l.Promise,m="process"==d(_),b=p(l,"queueMicrotask"),S=b&&b.value;S||(n=function(){var e,t;for(m&&(e=_.domain)&&e.exit();o;){t=o.fn,o=o.next;try{t()}catch(e){throw o?s():i=void 0,e}}i=void 0,e&&e.enter()},m?s=function(){_.nextTick(n)}:v&&!g?(a=!0,u=document.createTextNode(""),new v(n).observe(u,{characterData:!0}),s=function(){u.data=a=!a}):y&&y.resolve?(c=y.resolve(void 0),f=c.then,s=function(){f.call(c,n)}):s=function(){h.call(l,n)}),e.exports=S||function(e){var t={fn:e,next:void 0};i&&(i.next=t),o||(o=t,s()),i=t}},function(e,t,r){var n=r(1);e.exports=function(e,t){var r=n.console;r&&r.error&&(1===arguments.length?r.error(e):r.error(e,t))}},function(e,t,r){"use strict";var n=r(3),o=r(17),i=r(69),s=r(4),a=r(12),u=r(70),c=r(74),f=r(14);n({target:"Promise",proto:!0,real:!0,forced:!!i&&s((function(){i.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=u(this,a("Promise")),r="function"==typeof e;return this.then(r?function(r){return c(t,e()).then((function(){return r}))}:e,r?function(r){return c(t,e()).then((function(){throw r}))}:e)}}),o||"function"!=typeof i||i.prototype.finally||f(i.prototype,"finally",a("Promise").prototype.finally)},function(e,t,r){"use strict";var n=r(3),o=r(6),i=r(44),s=r(67),a=r(45),u=r(10),c=r(18),f=r(28),l=r(9),p=r(19),d=p.set,h=p.getterFor("AggregateError"),g=function e(t,r){var n=this;if(!(n instanceof g))return new g(t,r);s&&(n=s(new Error(r),i(n)));var a=[];return f(t,a.push,a),o?d(n,{errors:a,type:"AggregateError"}):n.errors=a,void 0!==r&&l(n,"message",String(r)),n};g.prototype=a(Error.prototype,{constructor:c(5,g),message:c(5,""),name:c(5,"AggregateError")}),o&&u.f(g.prototype,"errors",{get:function(){return h(this).errors},configurable:!0}),n({global:!0},{AggregateError:g})},function(e,t,r){r(76)},function(e,t,r){"use strict";var n=r(3),o=r(21),i=r(30);n({target:"Promise",stat:!0},{try:function(e){var t=o.f(this),r=i(e);return(r.error?t.reject:t.resolve)(r.value),t.promise}})},function(e,t,r){"use strict";var n=r(3),o=r(13),i=r(12),s=r(21),a=r(30),u=r(28);n({target:"Promise",stat:!0},{any:function e(t){var r=this,n=s.f(r),c=n.resolve,f=n.reject,l=a((function(){var e=o(r.resolve),n=[],s=0,a=1,l=!1;u(t,(function(t){var o=s++,u=!1;n.push(void 0),a++,e.call(r,t).then((function(e){u||l||(l=!0,c(e))}),(function(e){u||l||(u=!0,n[o]=e,--a||f(new(i("AggregateError"))(n,"No one promise resolved")))}))})),--a||f(new(i("AggregateError"))(n,"No one promise resolved"))}));return l.error&&f(l.value),n.promise}})},function(e,t,r){var n=r(131);e.exports=n},function(e,t,r){r(132);var n=r(31);e.exports=n("Function","bind")},function(e,t,r){r(3)({target:"Function",proto:!0},{bind:r(133)})},function(e,t,r){"use strict";var n=r(13),o=r(7),i=[].slice,s={},a=function(e,t,r){if(!(t in s)){for(var n=[],o=0;o<t;o++)n[o]="a["+o+"]";s[t]=Function("C,a","return new C("+n.join(",")+")")}return s[t](e,r)};e.exports=Function.bind||function e(t){var r=n(this),s=i.call(arguments,1),u=function e(){var n=s.concat(i.call(arguments));return this instanceof u?a(r,n.length,n):r.apply(t,n)};return o(r.prototype)&&(u.prototype=r.prototype),u}},function(e,t,r){var n=r(135);e.exports=n},function(e,t,r){r(136);var n=r(25);e.exports=n.Object.assign},function(e,t,r){var n=r(3),o=r(137);n({target:"Object",stat:!0,forced:Object.assign!==o},{assign:o})},function(e,t,r){"use strict";var n=r(6),o=r(4),i=r(65),s=r(62),a=r(59),u=r(27),c=r(42),f=Object.assign,l=Object.defineProperty;e.exports=!f||o((function(){if(n&&1!==f({b:1},f(l({},"a",{enumerable:!0,get:function(){l(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol();return e[r]=7,"abcdefghijklmnopqrst".split("").forEach((function(e){t[e]=e})),7!=f({},e)[r]||"abcdefghijklmnopqrst"!=i(f({},t)).join("")}))?function e(t,r){for(var o=u(t),f=arguments.length,l=1,p=s.f,d=a.f;f>l;)for(var h,g=c(arguments[l++]),v=p?i(g).concat(p(g)):i(g),_=v.length,y=0;_>y;)h=v[y++],n&&!d.call(g,h)||(o[h]=g[h]);return o}:f},function(e,t,r){var n=r(139);e.exports=n},function(e,t,r){r(140);var n=r(31);e.exports=n("Array","find")},function(e,t,r){"use strict";var n=r(3),o=r(77).find,i=r(68),s=r(47),a=!0,u=s("find");"find"in[]&&Array(1).find((function(){a=!1})),n({target:"Array",proto:!0,forced:a||!u},{find:function e(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),i("find")},function(e,t,r){var n=r(142);e.exports=n},function(e,t,r){r(143);var n=r(31);e.exports=n("Array","some")},function(e,t,r){"use strict";var n=r(3),o=r(77).some,i=r(144),s=r(47),a=i("some"),u=s("some");n({target:"Array",proto:!0,forced:!a||!u},{some:function e(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},function(e,t,r){"use strict";var n=r(4);e.exports=function(e,t){var r=[][e];return!!r&&n((function(){r.call(null,t||function(){throw 1},1)}))}},function(e,t,r){var n=r(146);e.exports=n},function(e,t,r){r(147);var n=r(25);e.exports=n.Array.isArray},function(e,t,r){r(3)({target:"Array",stat:!0},{isArray:r(79)})},function(e,t,r){var n=r(149);e.exports=n},function(e,t,r){r(150);var n=r(31);e.exports=n("Array","splice")},function(e,t,r){"use strict";var n=r(3),o=r(61),i=r(23),s=r(26),a=r(27),u=r(78),c=r(151),f=r(152),l=r(47),p=f("splice"),d=l("splice",{ACCESSORS:!0,0:0,1:2}),h=Math.max,g=Math.min;n({target:"Array",proto:!0,forced:!p||!d},{splice:function e(t,r){var n,f,l,p,d,v,_=a(this),y=s(_.length),m=o(t,y),b=arguments.length;if(0===b?n=f=0:1===b?(n=0,f=y-m):(n=b-2,f=g(h(i(r),0),y-m)),y+n-f>9007199254740991)throw TypeError("Maximum allowed length exceeded");for(l=u(_,f),p=0;p<f;p++)(d=m+p)in _&&c(l,p,_[d]);if(l.length=f,n<f){for(p=m;p<y-f;p++)v=p+n,(d=p+f)in _?_[v]=_[d]:delete _[v];for(p=y;p>y-f+n;p--)delete _[p-1]}else if(n>f)for(p=y-f;p>m;p--)v=p+n-1,(d=p+f-1)in _?_[v]=_[d]:delete _[v];for(p=0;p<n;p++)_[p+m]=arguments[p+2];return _.length=y-f+n,l}})},function(e,t,r){"use strict";var n=r(36),o=r(10),i=r(18);e.exports=function(e,t,r){var s=n(t);s in e?o.f(e,s,i(0,r)):e[s]=r}},function(e,t,r){var n=r(4),o=r(2),i=r(75),s=o("species");e.exports=function(e){return i>=51||!n((function(){var t=[];return(t.constructor={})[s]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),o=r(80),i=r(48),s=r(49),a=r(165),u=r(166),c=r(87),f=r(16),l=r(176),p=r(177),d=r(90),h=r(91),g=r(89),v=r(11),_=r(86),y=r(178);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:f.MetadataService,CordovaPopupNavigator:l.CordovaPopupNavigator,CordovaIFrameNavigator:p.CordovaIFrameNavigator,CheckSessionIFrame:d.CheckSessionIFrame,TokenRevocationClient:h.TokenRevocationClient,SessionMonitor:g.SessionMonitor,Global:v.Global,User:_.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(16),s=r(155),a=r(81),u=r(82),c=r(32);function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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(f(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,f=n._settings.clockSkew;return o.Log.debug("ResponseValidator._validateIdToken: Validaing JWT; using clock skew (in seconds) of: ",f),n._joseUtil.validateJwt(r.id_token,u,e,c,f).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(50),o=r(16),i=r(0),s=r(32);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.UserInfoService=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.JsonService,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.MetadataService,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:s.JoseUtil;if(a(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 u(this._settings),this._joseUtil=c}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(157)),o=s(r(158)),i=s(r(160));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)}},f={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},l={sha256:o.default,SHA256:o.default};
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
*/function p(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)}p.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 f){var r=f[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(!l.hasOwnProperty(n.alg))throw new Error("Hashing algorithm is not supported.");var i=l[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){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];n.forEach((function(e){if(-1===d.indexOf(e))throw new Error("Invalid signing algorithm: "+e)}));var e=new p(r.n,r.e),o=t.split("."),i=[o[0],o[1]].join(".");return e.verify(i,o[2])}}},g={getKey:function e(t){return"RSA"===t.kty?{e:c.decodeToHEX(t.e),n:c.decodeToHEX(t.n)}:null}},v={getPublicKeyFromCertPEM:function e(){throw new Error("Not implemented. Use the full oidc-client library if you need support for X509.")}},_={Util:{hashString:function e(t,r){return(0,l[r])(t).toString()}}};var y=c.b64tohex;t.jws=h,t.KeyUtil=g,t.X509=v,t.crypto=_,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],f=this[e++]>>15,l=u*c+f*a;o=((c=a*c+((32767&l)<<15)+r[n]+(1073741823&o))>>>30)+(l>>>15)+u*f+(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,f=a*u+c*s;o=((u=s*u+((16383&f)<<14)+r[n]+o)>>28)+(f>>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,f=new Array;for(u="0".charCodeAt(0),c=0;c<=9;++c)f[u++]=c;for(u="a".charCodeAt(0),c=10;c<36;++c)f[u++]=c;for(u="A".charCodeAt(0),c=10;c<36;++c)f[u++]=c;function l(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function p(e,t){var r=f[e.charCodeAt(t)];return null==r?-1:r}function d(e){var t=n();return t.fromInt(e),t}function h(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 g(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 _(e,t){return 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){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 w(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function k(){}function T(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}g.prototype.convert=function P(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},g.prototype.revert=function L(e){return e},g.prototype.reduce=function x(e){e.divRemTo(this.m,null,e)},g.prototype.mulTo=function R(e,t,r){e.multiplyTo(t,r),this.reduce(r)},g.prototype.sqrTo=function C(e,t){e.squareTo(t),this.reduce(t)},v.prototype.convert=function U(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 M(e,t,r){e.multiplyTo(t,r),this.reduce(r)},v.prototype.sqrTo=function I(e,t){e.squareTo(t),this.reduce(t)},r.prototype.copyTo=function A(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 N(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 q(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]:p(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 F(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},r.prototype.dlShiftTo=function J(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 B(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 V(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 W(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 D(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 H(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 z(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 K(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,f=this.DB-h(i[i.t-1]);f>0?(i.lShiftTo(f,a),s.lShiftTo(f,o)):(i.copyTo(a),s.copyTo(o));var l=a.t,p=a[l-1];if(0!=p){var d=p*(1<<this.F1)+(l>1?a[l-2]>>this.F2:0),g=this.FV/d,v=(1<<this.F1)/d,_=1<<this.F2,y=o.t,m=y-l,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(l,b),b.subTo(a,a);a.t<l;)a[a.t++]=0;for(;--m>=0;){var S=o[--y]==p?this.DM:Math.floor(o[y]*g+(o[y-1]+_)*v);if((o[y]+=a.am(0,S,o,m,0,l))<S)for(a.dlShiftTo(m,b),o.subTo(b,o);o[y]<--S;)o.subTo(b,o)}null!=t&&(o.drShiftTo(l,t),u!=c&&r.ZERO.subTo(t,t)),o.t=l,o.clamp(),f>0&&o.rShiftTo(f,o),u<0&&r.ZERO.subTo(o,o)}}},r.prototype.invDigit=function Q(){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 G(){return 0==(this.t>0?1&this[0]:this.s)},r.prototype.exp=function X(e,t){if(e>4294967295||e<1)return r.ONE;var o=n(),i=n(),s=t.convert(this),a=h(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 Z(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=l(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+=l(r));return o?i:"0"},r.prototype.negate=function Y(){var e=n();return r.ZERO.subTo(this,e),e},r.prototype.abs=function $(){return this.s<0?this.negate():this},r.prototype.compareTo=function ee(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 te(){return this.t<=0?0:this.DB*(this.t-1)+h(this[this.t-1]^this.s&this.DM)},r.prototype.mod=function re(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 ne(e,t){var r;return r=e<256||t.isEven()?new g(t):new v(t),this.exp(e,r)},r.ZERO=d(0),r.ONE=d(1),k.prototype.convert=T,k.prototype.revert=T,k.prototype.mulTo=function oe(e,t,r){e.multiplyTo(t,r)},k.prototype.sqrTo=function ie(e,t){e.squareTo(t)},E.prototype.convert=function se(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 ae(e){return e},E.prototype.reduce=function ue(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 ce(e,t,r){e.multiplyTo(t,r),this.reduce(r)},E.prototype.sqrTo=function fe(e,t){e.squareTo(t),this.reduce(t)};var le,pe,de,he=[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],ge=(1<<26)/he[he.length-1];function ve(){!function e(t){pe[de++]^=255&t,pe[de++]^=t>>8&255,pe[de++]^=t>>16&255,pe[de++]^=t>>24&255,de>=mt&&(de-=mt)}((new Date).getTime())}if(r.prototype.chunkSize=function _e(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},r.prototype.toRadix=function ye(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=d(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 me(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=p(e,u);c<0?"-"==e.charAt(u)&&0==this.signum()&&(i=!0):(a=t*a+c,++s>=n&&(this.dMultiply(o),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(t,s)),this.dAddOffset(a,0)),i&&r.ZERO.subTo(this,this)},r.prototype.fromNumber=function be(e,t,n){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(r.ONE.shiftLeft(e-1),y,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(r.ONE.shiftLeft(e-1),this);else{var o=new Array,i=7&e;o.length=1+(e>>3),t.nextBytes(o),i>0?o[0]&=(1<<i)-1:o[0]=0,this.fromString(o,256)}},r.prototype.bitwiseTo=function Se(e,t,r){var n,o,i=Math.min(e.t,this.t);for(n=0;n<i;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(o=e.s&this.DM,n=i;n<this.t;++n)r[n]=t(this[n],o);r.t=this.t}else{for(o=this.s&this.DM,n=i;n<e.t;++n)r[n]=t(o,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},r.prototype.changeBit=function we(e,t){var n=r.ONE.shiftLeft(e);return this.bitwiseTo(n,t,n),n},r.prototype.addTo=function ke(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 Te(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 Pe(e,t,r){var n,o=Math.min(this.t+e.t,t);for(r.s=0,r.t=o;o>0;)r[--o]=0;for(n=r.t-this.t;o<n;++o)r[o+this.t]=this.am(0,e[o],r,o,0,this.t);for(n=Math.min(e.t,t);o<n;++o)this.am(0,e[o],r,o,0,t-o);r.clamp()},r.prototype.multiplyUpperTo=function Le(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 Re(e){var t=this.subtract(r.ONE),o=t.getLowestSetBit();if(o<=0)return!1;var i=t.shiftRight(o);(e=e+1>>1)>he.length&&(e=he.length);for(var s=n(),a=0;a<e;++a){s.fromInt(he[Math.floor(Math.random()*he.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 Ce(){var e=n();return this.copyTo(e),e},r.prototype.intValue=function Ue(){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 Me(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},r.prototype.toByteArray=function Ie(){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 Ae(e){return 0==this.compareTo(e)},r.prototype.min=function Ne(e){return this.compareTo(e)<0?this:e},r.prototype.max=function qe(e){return this.compareTo(e)>0?this:e},r.prototype.and=function Fe(e){var t=n();return this.bitwiseTo(e,_,t),t},r.prototype.or=function Je(e){var t=n();return this.bitwiseTo(e,y,t),t},r.prototype.xor=function Be(e){var t=n();return this.bitwiseTo(e,m,t),t},r.prototype.andNot=function Ve(e){var t=n();return this.bitwiseTo(e,b,t),t},r.prototype.not=function We(){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 De(e){var t=n();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},r.prototype.shiftRight=function He(e){var t=n();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},r.prototype.getLowestSetBit=function ze(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+S(this[e]);return this.s<0?this.t*this.DB:-1},r.prototype.bitCount=function Ke(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=w(this[r]^t);return e},r.prototype.testBit=function Qe(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 Ge(e){return this.changeBit(e,y)},r.prototype.clearBit=function Xe(e){return this.changeBit(e,b)},r.prototype.flipBit=function Ze(e){return this.changeBit(e,m)},r.prototype.add=function Ye(e){var t=n();return this.addTo(e,t),t},r.prototype.subtract=function $e(e){var t=n();return this.subTo(e,t),t},r.prototype.multiply=function et(e){var t=n();return this.multiplyTo(e,t),t},r.prototype.divide=function tt(e){var t=n();return this.divRemTo(e,t,null),t},r.prototype.remainder=function rt(e){var t=n();return this.divRemTo(e,null,t),t},r.prototype.divideAndRemainder=function nt(e){var t=n(),r=n();return this.divRemTo(e,t,r),new Array(t,r)},r.prototype.modPow=function ot(e,t){var r,o,i=e.bitLength(),s=d(1);if(i<=0)return s;r=i<18?1:i<48?3:i<144?4:i<768?5:6,o=i<8?new g(t):t.isEven()?new E(t):new v(t);var a=new Array,u=3,c=r-1,f=(1<<r)-1;if(a[1]=o.convert(this),r>1){var l=n();for(o.sqrTo(a[1],l);u<=f;)a[u]=n(),o.mulTo(l,a[u-2],a[u]),u+=2}var p,_,y=e.t-1,m=!0,b=n();for(i=h(e[y])-1;y>=0;){for(i>=c?p=e[y]>>i-c&f:(p=(e[y]&(1<<i+1)-1)<<c-i,y>0&&(p|=e[y-1]>>this.DB+i-c)),u=r;0==(1&p);)p>>=1,--u;if((i-=u)<0&&(i+=this.DB,--y),m)a[p].copyTo(s),m=!1;else{for(;u>1;)o.sqrTo(s,b),o.sqrTo(b,s),u-=2;u>0?o.sqrTo(s,b):(_=s,s=b,b=_),o.mulTo(b,a[p],s)}for(;y>=0&&0==(e[y]&1<<i);)o.sqrTo(s,b),_=s,s=b,b=_,--i<0&&(i=this.DB-1,--y)}return o.revert(s)},r.prototype.modInverse=function it(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return r.ZERO;for(var n=e.clone(),o=this.clone(),i=d(1),s=d(0),a=d(0),u=d(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 st(e){return this.exp(e,new k)},r.prototype.gcd=function at(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 ut(e){var t,r=this.abs();if(1==r.t&&r[0]<=he[he.length-1]){for(t=0;t<he.length;++t)if(r[0]==he[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<he.length;){for(var n=he[t],o=t+1;o<he.length&&n<ge;)n*=he[o++];for(n=r.modInt(n);t<o;)if(n%he[t++]==0)return!1}return r.millerRabin(e)},r.prototype.square=function ct(){var e=n();return this.squareTo(e),e},r.prototype.Barrett=E,null==pe){var ft;if(pe=new Array,de=0,"undefined"!=typeof window&&window.crypto)if(window.crypto.getRandomValues){var lt=new Uint8Array(32);for(window.crypto.getRandomValues(lt),ft=0;ft<32;++ft)pe[de++]=lt[ft]}else if("Netscape"==navigator.appName&&navigator.appVersion<"5"){var pt=window.crypto.random(32);for(ft=0;ft<pt.length;++ft)pe[de++]=255&pt.charCodeAt(ft)}for(;de<mt;)ft=Math.floor(65536*Math.random()),pe[de++]=ft>>>8,pe[de++]=255&ft;de=0,ve()}function dt(){if(null==le){for(ve(),(le=function e(){return new gt}()).init(pe),de=0;de<pe.length;++de)pe[de]=0;de=0}return le.next()}function ht(){}function gt(){this.i=0,this.j=0,this.S=new Array}ht.prototype.nextBytes=function vt(e){var t;for(t=0;t<e.length;++t)e[t]=dt()},gt.prototype.init=function _t(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},gt.prototype.next=function yt(){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 mt=256;e.exports={default:r,BigInteger:r,SecureRandom:ht}}).call(this)},function(e,t,r){var n;e.exports=(n=r(159),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=[],f=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],f=r[5],l=r[6],p=r[7],d=0;d<64;d++){if(d<16)c[d]=0|e[t+d];else{var h=c[d-15],g=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,v=c[d-2],_=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;c[d]=g+c[d-7]+_+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=p+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&f^~a&l)+u[d]+c[d];p=l,l=f,f=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]+f|0,r[6]=r[6]+l|0,r[7]=r[7]+p|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,o=8*t.sigBytes;return r[o>>>5]|=128<<24-o%32,r[14+(o+64>>>9<<4)]=e.floor(n/4294967296),r[15+(o+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=i._createHelper(f),t.HmacSHA256=i._createHmacHelper(f)}(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,r){e=this.words=e||[],this.sigBytes=r!=t?r: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(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){t=t;var 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)}},f=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)))}},l=o.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.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=o/(4*i),u=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*i,c=e.min(4*u,o);if(u){for(var f=0;f<u;f+=i)this._doProcessBlock(n,f);var l=n.splice(0,u);r.sigBytes-=c}return new s.init(l,c)},clone:function(){var e=i.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),p=(o.Hasher=l.extend({cfg:i.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){l.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new p.HMAC.init(e,r).finalize(t)}}}),n.algo={});return n}(Math),n)},function(e,t,r){"use strict";t.byteLength=function n(e){var t=p(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function o(e){for(var t,r=p(e),n=r[0],o=r[1],i=new u(function s(e,t,r){return 3*(t+r)/4-r}(0,n,o)),c=0,f=o>0?n-4:n,l=0;l<f;l+=4)t=a[e.charCodeAt(l)]<<18|a[e.charCodeAt(l+1)]<<12|a[e.charCodeAt(l+2)]<<6|a[e.charCodeAt(l+3)],i[c++]=t>>16&255,i[c++]=t>>8&255,i[c++]=255&t;2===o&&(t=a[e.charCodeAt(l)]<<2|a[e.charCodeAt(l+1)]>>4,i[c++]=255&t);1===o&&(t=a[e.charCodeAt(l)]<<10|a[e.charCodeAt(l+1)]<<4|a[e.charCodeAt(l+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+/",f=0,l=c.length;f<l;++f)s[f]=c[f],a[c.charCodeAt(f)]=f;function p(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function d(e,t,r){for(var n,o,i=[],a=t;a<r;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),i.push(s[(o=n)>>18&63]+s[o>>12&63]+s[o>>6&63]+s[63&o]);return i.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function n(e){var t=e.jws,r=e.KeyUtil,n=e.X509,i=e.crypto,s=e.hextob64u,a=e.b64tohex,u=e.AllowedSigningAlgs;return function(){function e(){!function t(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.parseJwt=function e(r){o.Log.debug("JoseUtil.parseJwt");try{var n=t.JWS.parse(r);return{header:n.headerObj,payload:n.payloadObj}}catch(e){o.Log.error(e)}},e.validateJwt=function t(i,s,u,c,f,l,p){o.Log.debug("JoseUtil.validateJwt");try{if("RSA"===s.kty)if(s.e&&s.n)s=r.getKey(s);else{if(!s.x5c||!s.x5c.length)return o.Log.error("JoseUtil.validateJwt: RSA key missing key material",s),Promise.reject(new Error("RSA key missing key material"));var d=a(s.x5c[0]);s=n.getPublicKeyFromCertHex(d)}else{if("EC"!==s.kty)return o.Log.error("JoseUtil.validateJwt: Unsupported key type",s&&s.kty),Promise.reject(new Error(s.kty));if(!(s.crv&&s.x&&s.y))return o.Log.error("JoseUtil.validateJwt: EC key missing key material",s),Promise.reject(new Error("EC key missing key material"));s=r.getKey(s)}return e._validateJwt(i,s,u,c,f,l,p)}catch(e){return o.Log.error(e&&e.message||e),Promise.reject("JWT validation failed")}},e.validateJwtAttributes=function t(r,n,i,s,a,u){s||(s=0),a||(a=parseInt(Date.now()/1e3));var c=e.parseJwt(r).payload;if(!c.iss)return o.Log.error("JoseUtil._validateJwt: issuer was not provided"),Promise.reject(new Error("issuer was not provided"));if(c.iss!==n)return o.Log.error("JoseUtil._validateJwt: Invalid issuer in token",c.iss),Promise.reject(new Error("Invalid issuer in token: "+c.iss));if(!c.aud)return o.Log.error("JoseUtil._validateJwt: aud was not provided"),Promise.reject(new Error("aud was not provided"));if(!(c.aud===i||Array.isArray(c.aud)&&c.aud.indexOf(i)>=0))return o.Log.error("JoseUtil._validateJwt: Invalid audience in token",c.aud),Promise.reject(new Error("Invalid audience in token: "+c.aud));if(c.azp&&c.azp!==i)return o.Log.error("JoseUtil._validateJwt: Invalid azp in token",c.azp),Promise.reject(new Error("Invalid azp in token: "+c.azp));if(!u){var f=a+s,l=a-s;if(!c.iat)return o.Log.error("JoseUtil._validateJwt: iat was not provided"),Promise.reject(new Error("iat was not provided"));if(f<c.iat)return o.Log.error("JoseUtil._validateJwt: iat is in the future",c.iat),Promise.reject(new Error("iat is in the future: "+c.iat));if(c.nbf&&f<c.nbf)return o.Log.error("JoseUtil._validateJwt: nbf is in the future",c.nbf),Promise.reject(new Error("nbf is in the future: "+c.nbf));if(!c.exp)return o.Log.error("JoseUtil._validateJwt: exp was not provided"),Promise.reject(new Error("exp was not provided"));if(c.exp<l)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,f,l){return e.validateJwtAttributes(n,s,a,c,f,l).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){"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(22);function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.SigninResponse=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#";i(this,e);var n=o.UrlUtility.parseUrlFragment(t,r);this.error=n.error,this.error_description=n.error_description,this.error_uri=n.error_uri,this.code=n.code,this.state=n.state,this.id_token=n.id_token,this.session_state=n.session_state,this.access_token=n.access_token,this.token_type=n.token_type,this.scope=n.scope,this.profile=void 0,this.expires_in=n.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(22),i=r(51);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,f=t.request_type;if(function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!r)throw n.Log.error("SignoutRequest.ctor: No url passed"),new Error("url");for(var p 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:f}),r=o.UrlUtility.addQueryParam(r,"state",this.state.id))),c)r=o.UrlUtility.addQueryParam(r,p,c[p]);this.url=r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignoutResponse=void 0;var n=r(22);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(80),s=r(167),a=r(86),u=r(173),c=r(175),f=r(89),l=r(91),p=r(81),d=r(32);function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(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}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]:f.SessionMonitor,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.TokenRevocationClient,v=arguments.length>4&&void 0!==arguments[4]?arguments[4]:p.TokenClient,_=arguments.length>5&&void 0!==arguments[5]?arguments[5]:d.JoseUtil;h(this,t),r instanceof s.UserManagerSettings||(r=new s.UserManagerSettings(r));var y=g(this,e.call(this,r));return y._events=new u.UserManagerEvents(r),y._silentRenewService=new n(y),y.settings.automaticSilentRenew&&(o.Log.debug("UserManager.ctor: automaticSilentRenew is configured, setting up silent renew"),y.startSilentRenew()),y.settings.monitorSession&&(o.Log.debug("UserManager.ctor: monitorSession is configured, setting up session monitor"),y._sessionMonitor=new i(y)),y._tokenRevocationClient=new a(y._settings),y._tokenClient=new v(y._settings),y._joseUtil=_,y}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(48)),i=r(168),s=r(169),a=r(171),u=r(49),c=r(11),f=r(83);function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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}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,v=r.silentRequestTimeout,_=r.automaticSilentRenew,y=void 0!==_&&_,m=r.validateSubOnSilentRenew,b=void 0!==m&&m,S=r.includeIdTokenInSilentRenew,w=void 0===S||S,k=r.monitorSession,T=void 0===k||k,E=r.monitorAnonymousSession,P=void 0!==E&&E,L=r.checkSessionInterval,x=void 0===L?2e3:L,R=r.stopCheckSessionOnError,C=void 0===R||R,U=r.query_status_response_type,O=r.revokeAccessTokenOnSignout,j=void 0!==O&&O,M=r.accessTokenExpiringNotificationTime,I=void 0===M?60:M,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;l(this,t);var D=p(this,e.call(this,arguments[0]));return D._popup_redirect_uri=n,D._popup_post_logout_redirect_uri=o,D._popupWindowFeatures=d,D._popupWindowTarget=h,D._silent_redirect_uri=g,D._silentRequestTimeout=v,D._automaticSilentRenew=y,D._validateSubOnSilentRenew=b,D._includeIdTokenInSilentRenew=w,D._accessTokenExpiringNotificationTime=I,D._monitorSession=T,D._monitorAnonymousSession=P,D._checkSessionInterval=x,D._stopCheckSessionOnError=C,U?D._query_status_response_type=U:arguments[0]&&arguments[0].response_type?D._query_status_response_type=f.SigninRequest.isOidc(arguments[0].response_type)?"id_token":"code":D._query_status_response_type="id_token",D._revokeAccessTokenOnSignout=j,D._redirectNavigator=N,D._popupNavigator=F,D._iframeNavigator=B,D._userStore=W,D}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(170);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(22);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||"_blank",s=t.popupWindowFeatures||"location=no,toolbar=no,width=500,height=500,left=100,top=100;";this._popup=window.open("",i,s),this._popup&&(o.Log.debug("PopupWindow.ctor: popup successfully created"),this._checkForPopupClosedTimer=window.setInterval(this._checkForPopupClosed.bind(this),500))}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(172);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"),(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(87),i=r(88);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(11),s=r(88);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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}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;a(this,t);var s=u(this,e.call(this,r));return s._timer=n,s._nowFunc=o||function(){return Date.now()/1e3},s}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(92);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(92);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"}]);