-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathload-utils-e25145f5c0.min.js
More file actions
4 lines (4 loc) · 232 KB
/
load-utils-e25145f5c0.min.js
File metadata and controls
4 lines (4 loc) · 232 KB
1
2
3
4
SW.Cookie={},SW.Cookie.REDIRECT_COUNT="redirect_count",SW.Cookie._getSecondLevelDomain=()=>{const t=window.location.host.split(".").slice(-2).join(".");return t.indexOf("localhost")>=0?"localhost":t},SW.Cookie.get=function(t){return(t=>{const e=`${t}=`,n=document.cookie.split(";");let r,o;for(o=0;o<n.length;o+=1){for(r=n[o];" "===r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(e))return r.substring(e.length,r.length)}return null})(`sw.${t}`)},SW.Cookie.set=function(t,e,n,r,o=!1){((t,e,n,r)=>{const o=24*(n||7),i=new Date((new Date).getTime()+60*o*60*1e3);document.cookie=`${t}=${e}${r?`;path=${r}`:""}; expires=${i.toUTCString()}; domain=${SW.Cookie._getSecondLevelDomain()}`})(`sw.${t}`,o?JSON.stringify(e):encodeURIComponent(e),n,r)},SW.Cookie.expire=function(t,e){document.cookie=`sw.${t}=${e?`;path=${e}`:""}; expires=Thu, 01 Jan 1970 00:00:01 GMT;`,document.cookie=`sw.${t}=${e?`;path=${e}`:""}; expires=Thu, 01 Jan 1970 00:00:01 GMT; domain=${SW.Cookie._getSecondLevelDomain()}`},SW.Cookie.setTrackingCookie=t=>{SW.Cookie.set("track_id",t,730,"/")},SW.Cookie.getTrackingCookie=()=>SW.Cookie.get("track_id"),SW.Cookie.setRedirectCookie=()=>{SW.Cookie.set(SW.Cookie.REDIRECT_COUNT,1,1,"/")},SW.Cookie.getRedirectCookie=()=>SW.Cookie.get(SW.Cookie.REDIRECT_COUNT),SW.Cookie.clearRedirectCookie=()=>{SW.Cookie.set(SW.Cookie.REDIRECT_COUNT,"",1,"/")};var SW,Oidc=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=62)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o={debug:function(){},info:function(){},warn:function(){},error:function(){}},i=void 0,s=void 0;(e.Log=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.reset=function(){s=3,i=o},t.debug=function(){if(s>=4){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];i.debug.apply(i,Array.from(e))}},t.info=function(){if(s>=3){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];i.info.apply(i,Array.from(e))}},t.warn=function(){if(s>=2){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];i.warn.apply(i,Array.from(e))}},t.error=function(){if(s>=1){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];i.error.apply(i,Array.from(e))}},r(t,null,[{key:"NONE",get:function(){return 0}},{key:"ERROR",get:function(){return 1}},{key:"WARN",get:function(){return 2}},{key:"INFO",get:function(){return 3}},{key:"DEBUG",get:function(){return 4}},{key:"level",get:function(){return s},set:function(t){if(!(0<=t&&t<=4))throw new Error("Invalid log level");s=t}},{key:"logger",get:function(){return i},set:function(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}}]),t}()).reset()},function(t,e,n){var r=n(22)("wks"),o=n(24),i=n(2).Symbol,s="function"==typeof i;(t.exports=function(t){return r[t]||(r[t]=s&&i[t]||(s?i:o)("Symbol."+t))}).store=r},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){var n=t.exports={version:"2.6.4"};"number"==typeof __e&&(__e=n)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o={setInterval:function(t){function e(e,n){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t,e){return setInterval(t,e)})),clearInterval:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){return clearInterval(t)}))},i=!1,s=null;e.Global=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t._testing=function(){i=!0},t.setXMLHttpRequest=function(t){s=t},r(t,null,[{key:"location",get:function(){if(!i)return location}},{key:"localStorage",get:function(){if(!i&&"undefined"!=typeof window)return localStorage}},{key:"sessionStorage",get:function(){if(!i&&"undefined"!=typeof window)return sessionStorage}},{key:"XMLHttpRequest",get:function(){if(!i&&"undefined"!=typeof window)return s||XMLHttpRequest}},{key:"timer",get:function(){if(!i)return o}}]),t}()},function(t,e,n){var r=n(6);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var r=n(2),o=n(3),i=n(8),s=n(11),a=n(13),u=function(t,e,n){var c,p,l,f,d=t&u.F,h=t&u.G,g=t&u.S,v=t&u.P,_=t&u.B,y=h?r:g?r[e]||(r[e]={}):(r[e]||{}).prototype,m=h?o:o[e]||(o[e]={}),b=m.prototype||(m.prototype={});for(c in h&&(n=e),n)l=((p=!d&&y&&void 0!==y[c])?y:n)[c],f=_&&p?a(l,r):v&&"function"==typeof l?a(Function.call,l):l,y&&s(y,c,l,t&u.U),m[c]!=l&&i(m,c,f),v&&b[c]!=l&&(b[c]=l)};r.core=o,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,e,n){var r=n(17),o=n(39);t.exports=n(12)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataService=void 0;var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(0),i=n(37);e.MetadataService=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.JsonService;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!e)throw o.Log.error("MetadataService: No settings passed to MetadataService"),new Error("settings");this._settings=e,this._jsonService=new n(["application/jwk-set+json"])}return t.prototype.getMetadata=function(){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")))},t.prototype.getIssuer=function(){return this._getMetadataProperty("issuer")},t.prototype.getAuthorizationEndpoint=function(){return this._getMetadataProperty("authorization_endpoint")},t.prototype.getUserInfoEndpoint=function(){return this._getMetadataProperty("userinfo_endpoint")},t.prototype.getTokenEndpoint=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._getMetadataProperty("token_endpoint",t)},t.prototype.getCheckSessionIframe=function(){return this._getMetadataProperty("check_session_iframe",!0)},t.prototype.getEndSessionEndpoint=function(){return this._getMetadataProperty("end_session_endpoint",!0)},t.prototype.getRevocationEndpoint=function(){return this._getMetadataProperty("revocation_endpoint",!0)},t.prototype.getKeysEndpoint=function(){return this._getMetadataProperty("jwks_uri",!0)},t.prototype._getMetadataProperty=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return o.Log.debug("MetadataService.getMetadataProperty for: "+t),this.getMetadata().then((function(n){if(o.Log.debug("MetadataService.getMetadataProperty: metadata recieved"),void 0===n[t]){if(!0===e)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 n[t]}))},t.prototype.getSigningKeys=function(){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}))}))},r(t,[{key:"metadataUrl",get:function(){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}}]),t}()},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(2),o=n(8),i=n(19),s=n(24)("src"),a=n(68),u=(""+a).split("toString");n(3).inspectSource=function(t){return a.call(t)},(t.exports=function(t,e,n,a){var c="function"==typeof n;c&&(i(n,"name")||o(n,"name",e)),t[e]!==n&&(c&&(i(n,s)||o(n,s,t[e]?""+t[e]:u.join(String(e)))),t===r?t[e]=n:a?t[e]?t[e]=n:o(t,e,n):(delete t[e],o(t,e,n)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[s]||a.call(this)}))},function(t,e,n){t.exports=!n(18)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e,n){var r=n(14);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e){t.exports={}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UrlUtility=void 0;var r=n(0),o=n(4);e.UrlUtility=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.addQueryParam=function(t,e,n){return t.indexOf("?")<0&&(t+="?"),"?"!==t[t.length-1]&&(t+="&"),t+=encodeURIComponent(e),(t+="=")+encodeURIComponent(n)},t.parseUrlFragment=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.Global;"string"!=typeof t&&(t=n.location.href);var i=t.lastIndexOf(e);i>=0&&(t=t.substr(i+1)),"?"===e&&(i=t.indexOf("#"))>=0&&(t=t.substr(0,i));for(var s,a={},u=/([^&=]+)=([^&]*)/g,c=0;s=u.exec(t);)if(a[decodeURIComponent(s[1])]=decodeURIComponent(s[2]),c++>50)return r.Log.error("UrlUtility.parseUrlFragment: response exceeded expected number of parameters",t),{error:"Response exceeded expected number of parameters"};for(var p in a)return a;return{}},t}()},function(t,e,n){var r=n(5),o=n(66),i=n(67),s=Object.defineProperty;e.f=n(12)?Object.defineProperty:function(e,n,a){if(r(e),n=i(n,!0),r(a),o)try{return s(e,n,a)}catch(t){}if("get"in a||"set"in a)throw TypeError("Accessors not supported!");return"value"in a&&(e[n]=a.value),e}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.JoseUtil=void 0;var r=n(116),o=function(t){return t&&t.__esModule?t:{default:t}}(n(121));e.JoseUtil=(0,o.default)({jws:r.jws,KeyUtil:r.KeyUtil,X509:r.X509,crypto:r.crypto,hextob64u:r.hextob64u,b64tohex:r.b64tohex,AllowedSigningAlgs:r.AllowedSigningAlgs})},function(t,e,n){var r=n(10),o=n(1)("toStringTag"),i="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),o))?n:i?r(e):"Object"==(s=r(e))&&"function"==typeof e.callee?"Arguments":s}},function(t,e,n){var r=n(3),o=n(2),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(23)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,e){t.exports=!1},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){var r=n(6),o=n(2).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var r=n(74),o=n(41);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e,n){var r=n(30),o=n(27);t.exports=function(t){return r(o(t))}},function(t,e,n){var r=n(10);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){var r=n(26),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e,n){var r=n(22)("keys"),o=n(24);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,e,n){var r=n(17).f,o=n(19),i=n(1)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e,n){var r=n(27);t.exports=function(t){return Object(r(t))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OidcClientSettings=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=n(0),s=n(36),a=n(114),u=n(9),c="id_token",p="openid";e.OidcClientSettings=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.authority,o=e.metadataUrl,i=e.metadata,l=e.signingKeys,f=e.client_id,d=e.client_secret,h=e.response_type,g=void 0===h?c:h,v=e.scope,_=void 0===v?p:v,y=e.redirect_uri,m=e.post_logout_redirect_uri,b=e.prompt,S=e.display,w=e.max_age,k=e.ui_locales,E=e.acr_values,T=e.resource,x=e.response_mode,O=e.filterProtocolClaims,R=void 0===O||O,C=e.loadUserInfo,P=void 0===C||C,L=e.staleStateAge,U=void 0===L?900:L,j=e.clockSkew,I=void 0===j?300:j,M=e.userInfoJwtIssuer,A=void 0===M?"OP":M,N=e.stateStore,D=void 0===N?new s.WebStorageStateStore:N,q=e.ResponseValidatorCtor,W=void 0===q?a.ResponseValidator:q,F=e.MetadataServiceCtor,B=void 0===F?u.MetadataService:F,J=e.extraQueryParams,V=void 0===J?{}:J,H=e.extraTokenParams,z=void 0===H?{}:H;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._authority=n,this._metadataUrl=o,this._metadata=i,this._signingKeys=l,this._client_id=f,this._client_secret=d,this._response_type=g,this._scope=_,this._redirect_uri=y,this._post_logout_redirect_uri=m,this._prompt=b,this._display=S,this._max_age=w,this._ui_locales=k,this._acr_values=E,this._resource=T,this._response_mode=x,this._filterProtocolClaims=!!R,this._loadUserInfo=!!P,this._staleStateAge=U,this._clockSkew=I,this._userInfoJwtIssuer=A,this._stateStore=D,this._validator=new W(this),this._metadataService=new B(this),this._extraQueryParams="object"===(void 0===V?"undefined":r(V))?V:{},this._extraTokenParams="object"===(void 0===z?"undefined":r(z))?z:{}}return o(t,[{key:"client_id",get:function(){return this._client_id},set:function(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(){return this._client_secret}},{key:"response_type",get:function(){return this._response_type}},{key:"scope",get:function(){return this._scope}},{key:"redirect_uri",get:function(){return this._redirect_uri}},{key:"post_logout_redirect_uri",get:function(){return this._post_logout_redirect_uri}},{key:"prompt",get:function(){return this._prompt}},{key:"display",get:function(){return this._display}},{key:"max_age",get:function(){return this._max_age}},{key:"ui_locales",get:function(){return this._ui_locales}},{key:"acr_values",get:function(){return this._acr_values}},{key:"resource",get:function(){return this._resource}},{key:"response_mode",get:function(){return this._response_mode}},{key:"authority",get:function(){return this._authority},set:function(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(){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(){return this._metadata},set:function(t){this._metadata=t}},{key:"signingKeys",get:function(){return this._signingKeys},set:function(t){this._signingKeys=t}},{key:"filterProtocolClaims",get:function(){return this._filterProtocolClaims}},{key:"loadUserInfo",get:function(){return this._loadUserInfo}},{key:"staleStateAge",get:function(){return this._staleStateAge}},{key:"clockSkew",get:function(){return this._clockSkew}},{key:"userInfoJwtIssuer",get:function(){return this._userInfoJwtIssuer}},{key:"stateStore",get:function(){return this._stateStore}},{key:"validator",get:function(){return this._validator}},{key:"metadataService",get:function(){return this._metadataService}},{key:"extraQueryParams",get:function(){return this._extraQueryParams},set:function(t){"object"===(void 0===t?"undefined":r(t))?this._extraQueryParams=t:this._extraQueryParams={}}},{key:"extraTokenParams",get:function(){return this._extraTokenParams},set:function(t){"object"===(void 0===t?"undefined":r(t))?this._extraTokenParams=t:this._extraTokenParams={}}}]),t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebStorageStateStore=void 0;var r=n(0),o=n(4);e.WebStorageStateStore=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.prefix,r=void 0===n?"oidc.":n,i=e.store,s=void 0===i?o.Global.localStorage:i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._store=s,this._prefix=r}return t.prototype.set=function(t,e){return r.Log.debug("WebStorageStateStore.set",t),t=this._prefix+t,this._store.setItem(t,e),Promise.resolve()},t.prototype.get=function(t){r.Log.debug("WebStorageStateStore.get",t),t=this._prefix+t;var e=this._store.getItem(t);return Promise.resolve(e)},t.prototype.remove=function(t){r.Log.debug("WebStorageStateStore.remove",t),t=this._prefix+t;var e=this._store.getItem(t);return this._store.removeItem(t),Promise.resolve(e)},t.prototype.getAllKeys=function(){r.Log.debug("WebStorageStateStore.getAllKeys");for(var t=[],e=0;e<this._store.length;e++){var n=this._store.key(e);0===n.indexOf(this._prefix)&&t.push(n.substr(this._prefix.length))}return Promise.resolve(t)},t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.JsonService=void 0;var r=n(0),o=n(4);e.JsonService=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.Global.XMLHttpRequest,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e&&Array.isArray(e)?this._contentTypes=e.slice():this._contentTypes=[],this._contentTypes.push("application/json"),r&&this._contentTypes.push("application/jwt"),this._XMLHttpRequest=n,this._jwtHandler=r}return t.prototype.getJson=function(t,e){var n=this;if(!t)throw r.Log.error("JsonService.getJson: No url passed"),new Error("url");return r.Log.debug("JsonService.getJson, url: ",t),new Promise((function(o,i){var s=new n._XMLHttpRequest;s.open("GET",t);var a=n._contentTypes,u=n._jwtHandler;s.onload=function(){if(r.Log.debug("JsonService.getJson: HTTP response received, status",s.status),200===s.status){var e=s.getResponseHeader("Content-Type");if(e){var n=a.find((function(t){if(e.startsWith(t))return!0}));if("application/jwt"==n)return void u(s).then(o,i);if(n)try{return void o(JSON.parse(s.responseText))}catch(o){return r.Log.error("JsonService.getJson: Error parsing JSON response",o.message),void i(o)}}i(Error("Invalid response Content-Type: "+e+", from URL: "+t))}else i(Error(s.statusText+" ("+s.status+")"))},s.onerror=function(){r.Log.error("JsonService.getJson: network error"),i(Error("Network Error"))},e&&(r.Log.debug("JsonService.getJson: token passed, setting Authorization header"),s.setRequestHeader("Authorization","Bearer "+e)),s.send()}))},t.prototype.postForm=function(t,e){var n=this;if(!t)throw r.Log.error("JsonService.postForm: No url passed"),new Error("url");return r.Log.debug("JsonService.postForm, url: ",t),new Promise((function(o,i){var s=new n._XMLHttpRequest;s.open("POST",t);var a=n._contentTypes;s.onload=function(){if(r.Log.debug("JsonService.postForm: HTTP response received, status",s.status),200!==s.status){if(400===s.status&&(n=s.getResponseHeader("Content-Type"))&&a.find((function(t){if(n.startsWith(t))return!0})))try{var e=JSON.parse(s.responseText);if(e&&e.error)return r.Log.error("JsonService.postForm: Error from server: ",e.error),void i(new Error(e.error))}catch(o){return r.Log.error("JsonService.postForm: Error parsing JSON response",o.message),void i(o)}i(Error(s.statusText+" ("+s.status+")"))}else{var n;if((n=s.getResponseHeader("Content-Type"))&&a.find((function(t){if(n.startsWith(t))return!0})))try{return void o(JSON.parse(s.responseText))}catch(o){return r.Log.error("JsonService.postForm: Error parsing JSON response",o.message),void i(o)}i(Error("Invalid response Content-Type: "+n+", from URL: "+t))}},s.onerror=function(){r.Log.error("JsonService.postForm: network error"),i(Error("Network Error"))};var u="";for(var c in e){var p=e[c];p&&(u.length>0&&(u+="&"),u+=encodeURIComponent(c),u+="=",u+=encodeURIComponent(p))}s.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),s.send(u)}))},t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.State=void 0;var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(0),i=function(t){return t&&t.__esModule?t:{default:t}}(n(54));e.State=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.id,r=e.data,o=e.created,s=e.request_type;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._id=n||(0,i.default)(),this._data=r,this._created="number"==typeof o&&o>0?o:parseInt(Date.now()/1e3),this._request_type=s}return t.prototype.toStorageString=function(){return o.Log.debug("State.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})},t.fromStorageString=function(e){return o.Log.debug("State.fromStorageString"),new t(JSON.parse(e))},t.clearStaleState=function(e,n){var r=Date.now()/1e3-n;return e.getAllKeys().then((function(n){o.Log.debug("State.clearStaleState: got keys",n);for(var i=[],s=function(s){var a=n[s];u=e.get(a).then((function(n){var i=!1;if(n)try{var s=t.fromStorageString(n);o.Log.debug("State.clearStaleState: got item from key: ",a,s.created),s.created<=r&&(i=!0)}catch(t){o.Log.error("State.clearStaleState: Error parsing state for key",a,t.message),i=!0}else o.Log.debug("State.clearStaleState: no item in storage for key: ",a),i=!0;if(i)return o.Log.debug("State.clearStaleState: removed item for key: ",a),e.remove(a)})),i.push(u)},a=0;a<n.length;a++){var u;s(a)}return o.Log.debug("State.clearStaleState: waiting on promise count:",i.length),Promise.all(i)}))},r(t,[{key:"id",get:function(){return this._id}},{key:"data",get:function(){return this._data}},{key:"created",get:function(){return this._created}},{key:"request_type",get:function(){return this._request_type}}]),t}()},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){"use strict";var r=n(23),o=n(7),i=n(11),s=n(8),a=n(15),u=n(71),c=n(33),p=n(77),l=n(1)("iterator"),f=!([].keys&&"next"in[].keys()),d=function(){return this};t.exports=function(t,e,n,h,g,v,_){u(n,e,h);var y,m,b,S=function(t){if(!f&&t in T)return T[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},w=e+" Iterator",k="values"==g,E=!1,T=t.prototype,x=T[l]||T["@@iterator"]||g&&T[g],O=x||S(g),R=g?k?S("entries"):O:void 0,C="Array"==e&&T.entries||x;if(C&&(b=p(C.call(new t)))!==Object.prototype&&b.next&&(c(b,w,!0),r||"function"==typeof b[l]||s(b,l,d)),k&&x&&"values"!==x.name&&(E=!0,O=function(){return x.call(this)}),r&&!_||!f&&!E&&T[l]||s(T,l,O),a[e]=O,a[w]=d,g)if(y={values:k?O:S("values"),keys:v?O:S("keys"),entries:R},_)for(m in y)m in T||i(T,m,y[m]);else o(o.P+o.F*(f||E),e,y);return y}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(2).document;t.exports=r&&r.documentElement},function(t,e,n){var r=n(1)("unscopables"),o=Array.prototype;null==o[r]&&n(8)(o,r,{}),t.exports=function(t){o[r][t]=!0}},function(t,e,n){var r,o,i,s=n(13),a=n(45),u=n(42),c=n(25),p=n(2),l=p.process,f=p.setImmediate,d=p.clearImmediate,h=p.MessageChannel,g=p.Dispatch,v=0,_={},y=function(){var t=+this;if(_.hasOwnProperty(t)){var e=_[t];delete _[t],e()}},m=function(t){y.call(t.data)};f&&d||(f=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return _[++v]=function(){a("function"==typeof t?t:Function(t),e)},r(v),v},d=function(t){delete _[t]},"process"==n(10)(l)?r=function(t){l.nextTick(s(y,t,1))}:g&&g.now?r=function(t){g.now(s(y,t,1))}:h?(i=(o=new h).port2,o.port1.onmessage=m,r=s(i.postMessage,i,1)):p.addEventListener&&"function"==typeof postMessage&&!p.importScripts?(r=function(t){p.postMessage(t+"","*")},p.addEventListener("message",m,!1)):r="onreadystatechange"in c("script")?function(t){u.appendChild(c("script")).onreadystatechange=function(){u.removeChild(this),y.call(t)}}:function(t){setTimeout(s(y,t,1),0)}),t.exports={set:f,clear:d}},function(t,e){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},function(t,e,n){"use strict";var r=n(14);t.exports.f=function(t){return new function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)}(t)}},function(t,e,n){var r=n(13),o=n(30),i=n(34),s=n(31),a=n(105);t.exports=function(t,e){var n=1==t,u=2==t,c=3==t,p=4==t,l=6==t,f=5==t||l,d=e||a;return function(e,a,h){for(var g,v,_=i(e),y=o(_),m=r(a,h,3),b=s(y.length),S=0,w=n?d(e,b):u?d(e,0):void 0;b>S;S++)if((f||S in y)&&(v=m(g=y[S],S,_),t))if(n)w[S]=v;else if(v)switch(t){case 3:return!0;case 5:return g;case 6:return S;case 2:w.push(g)}else if(p)return!1;return l?-1:c||p?p:w}}},function(t,e,n){var r=n(10);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OidcClient=void 0;var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(0),i=n(35),s=n(51),a=n(52),u=n(125),c=n(126),p=n(127),l=n(53),f=n(38);e.OidcClient=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e instanceof i.OidcClientSettings?this._settings=e:this._settings=new i.OidcClientSettings(e)}return t.prototype.createSigninRequest=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.response_type,r=e.scope,i=e.redirect_uri,s=e.data,u=e.state,c=e.prompt,p=e.display,l=e.max_age,f=e.ui_locales,d=e.id_token_hint,h=e.login_hint,g=e.acr_values,v=e.resource,_=e.request,y=e.request_uri,m=e.response_mode,b=e.extraQueryParams,S=e.extraTokenParams,w=e.request_type,k=e.skipUserInfo,E=arguments[1];o.Log.debug("OidcClient.createSigninRequest");var T=this._settings.client_id;n=n||this._settings.response_type,r=r||this._settings.scope,i=i||this._settings.redirect_uri,c=c||this._settings.prompt,p=p||this._settings.display,l=l||this._settings.max_age,f=f||this._settings.ui_locales,g=g||this._settings.acr_values,v=v||this._settings.resource,m=m||this._settings.response_mode,b=b||this._settings.extraQueryParams,S=S||this._settings.extraTokenParams;var x=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 O=new a.SigninRequest({url:e,client_id:T,redirect_uri:i,response_type:n,scope:r,data:s||u,authority:x,prompt:c,display:p,max_age:l,ui_locales:f,id_token_hint:d,login_hint:h,acr_values:g,resource:v,request:_,request_uri:y,extraQueryParams:b,extraTokenParams:S,request_type:w,response_mode:m,client_secret:t._settings.client_secret,skipUserInfo:k}),R=O.state;return(E=E||t._stateStore).set(R.id,R.toStorageString()).then((function(){return O}))}))},t.prototype.readSigninResponseState=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];o.Log.debug("OidcClient.readSigninResponseState");var r="query"===this._settings.response_mode||!this._settings.response_mode&&a.SigninRequest.isCode(this._settings.response_type)?"?":"#",i=new u.SigninResponse(t,r);return i.state?(e=e||this._stateStore,(n?e.remove.bind(e):e.get.bind(e))(i.state).then((function(t){if(!t)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(t),response:i}}))):(o.Log.error("OidcClient.readSigninResponseState: No state in response"),Promise.reject(new Error("No state in response")))},t.prototype.processSigninResponse=function(t,e){var n=this;return o.Log.debug("OidcClient.processSigninResponse"),this.readSigninResponseState(t,e,!0).then((function(t){var e=t.state,r=t.response;return o.Log.debug("OidcClient.processSigninResponse: Received state from storage; validating response"),n._validator.validateSigninResponse(e,r)}))},t.prototype.createSignoutRequest=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.id_token_hint,r=e.data,i=e.state,s=e.post_logout_redirect_uri,a=e.extraQueryParams,u=e.request_type,p=arguments[1];return o.Log.debug("OidcClient.createSignoutRequest"),s=s||this._settings.post_logout_redirect_uri,a=a||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 l=new c.SignoutRequest({url:e,id_token_hint:n,post_logout_redirect_uri:s,data:r||i,extraQueryParams:a,request_type:u}),f=l.state;return f&&(o.Log.debug("OidcClient.createSignoutRequest: Signout request has state to persist"),(p=p||t._stateStore).set(f.id,f.toStorageString())),l}))},t.prototype.readSignoutResponseState=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];o.Log.debug("OidcClient.readSignoutResponseState");var r=new p.SignoutResponse(t);if(!r.state)return o.Log.debug("OidcClient.readSignoutResponseState: No state in response"),r.error?(o.Log.warn("OidcClient.readSignoutResponseState: Response was error: ",r.error),Promise.reject(new s.ErrorResponse(r))):Promise.resolve({undefined:void 0,response:r});var i=r.state;return e=e||this._stateStore,(n?e.remove.bind(e):e.get.bind(e))(i).then((function(t){if(!t)throw o.Log.error("OidcClient.readSignoutResponseState: No matching state found in storage"),new Error("No matching state found in storage");return{state:f.State.fromStorageString(t),response:r}}))},t.prototype.processSignoutResponse=function(t,e){var n=this;return o.Log.debug("OidcClient.processSignoutResponse"),this.readSignoutResponseState(t,e,!0).then((function(t){var e=t.state,r=t.response;return e?(o.Log.debug("OidcClient.processSignoutResponse: Received state from storage; validating response"),n._validator.validateSignoutResponse(e,r)):(o.Log.debug("OidcClient.processSignoutResponse: No state from storage; skipping validating response"),r)}))},t.prototype.clearStaleState=function(t){return o.Log.debug("OidcClient.clearStaleState"),t=t||this._stateStore,f.State.clearStaleState(t,this.settings.staleStateAge)},r(t,[{key:"_stateStore",get:function(){return this.settings.stateStore}},{key:"_validator",get:function(){return this.settings.validator}},{key:"_metadataService",get:function(){return this.settings.metadataService}},{key:"settings",get:function(){return this._settings}},{key:"metadataService",get:function(){return this._metadataService}}]),t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TokenClient=void 0;var r=n(37),o=n(9),i=n(0);e.TokenClient=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.JsonService,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.MetadataService;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!e)throw i.Log.error("TokenClient.ctor: No settings passed"),new Error("settings");this._settings=e,this._jsonService=new n,this._metadataService=new s(this._settings)}return t.prototype.exchangeCode=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(e=Object.assign({},e)).grant_type=e.grant_type||"authorization_code",e.client_id=e.client_id||this._settings.client_id,e.redirect_uri=e.redirect_uri||this._settings.redirect_uri,e.code?e.redirect_uri?e.code_verifier?e.client_id?this._metadataService.getTokenEndpoint(!1).then((function(n){return i.Log.debug("TokenClient.exchangeCode: Received token endpoint"),t._jsonService.postForm(n,e).then((function(t){return i.Log.debug("TokenClient.exchangeCode: response received"),t}))})):(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")))},t.prototype.exchangeRefreshToken=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(e=Object.assign({},e)).grant_type=e.grant_type||"refresh_token",e.client_id=e.client_id||this._settings.client_id,e.client_secret=e.client_secret||this._settings.client_secret,e.refresh_token?e.client_id?this._metadataService.getTokenEndpoint(!1).then((function(n){return i.Log.debug("TokenClient.exchangeRefreshToken: Received token endpoint"),t._jsonService.postForm(n,e).then((function(t){return i.Log.debug("TokenClient.exchangeRefreshToken: response received"),t}))})):(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")))},t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorResponse=void 0;var r=n(0);e.ErrorResponse=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=n.error,i=n.error_description,s=n.error_uri,a=n.state,u=n.session_state;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),!o)throw r.Log.error("No error passed to ErrorResponse"),new Error("error");var c=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,i||o));return c.name="ErrorResponse",c.error=o,c.error_description=i,c.error_uri=s,c.state=a,c.session_state=u,c}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e}(Error)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SigninRequest=void 0;var r=n(0),o=n(16),i=n(53);e.SigninRequest=function(){function t(e){var n=e.url,s=e.client_id,a=e.redirect_uri,u=e.response_type,c=e.scope,p=e.authority,l=e.data,f=e.prompt,d=e.display,h=e.max_age,g=e.ui_locales,v=e.id_token_hint,_=e.login_hint,y=e.acr_values,m=e.resource,b=e.response_mode,S=e.request,w=e.request_uri,k=e.extraQueryParams,E=e.request_type,T=e.client_secret,x=e.extraTokenParams,O=e.skipUserInfo;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!n)throw r.Log.error("SigninRequest.ctor: No url passed"),new Error("url");if(!s)throw r.Log.error("SigninRequest.ctor: No client_id passed"),new Error("client_id");if(!a)throw r.Log.error("SigninRequest.ctor: No redirect_uri passed"),new Error("redirect_uri");if(!u)throw r.Log.error("SigninRequest.ctor: No response_type passed"),new Error("response_type");if(!c)throw r.Log.error("SigninRequest.ctor: No scope passed"),new Error("scope");if(!p)throw r.Log.error("SigninRequest.ctor: No authority passed"),new Error("authority");var R=t.isOidc(u),C=t.isCode(u);b||(b=t.isCode(u)?"query":null),this.state=new i.SigninState({nonce:R,data:l,client_id:s,authority:p,redirect_uri:a,code_verifier:C,request_type:E,response_mode:b,client_secret:T,scope:c,extraTokenParams:x,skipUserInfo:O}),n=o.UrlUtility.addQueryParam(n,"client_id",s),n=o.UrlUtility.addQueryParam(n,"redirect_uri",a),n=o.UrlUtility.addQueryParam(n,"response_type",u),n=o.UrlUtility.addQueryParam(n,"scope",c),n=o.UrlUtility.addQueryParam(n,"state",this.state.id),R&&(n=o.UrlUtility.addQueryParam(n,"nonce",this.state.nonce)),C&&(n=o.UrlUtility.addQueryParam(n,"code_challenge",this.state.code_challenge),n=o.UrlUtility.addQueryParam(n,"code_challenge_method","S256"));var P={prompt:f,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 L in P)P[L]&&(n=o.UrlUtility.addQueryParam(n,L,P[L]));for(var U in k)n=o.UrlUtility.addQueryParam(n,U,k[U]);this.url=n}return t.isOidc=function(t){return!!t.split(/\s+/g).filter((function(t){return"id_token"===t}))[0]},t.isOAuth=function(t){return!!t.split(/\s+/g).filter((function(t){return"token"===t}))[0]},t.isCode=function(t){return!!t.split(/\s+/g).filter((function(t){return"code"===t}))[0]},t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SigninState=void 0;var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(0),i=n(38),s=n(20),a=function(t){return t&&t.__esModule?t:{default:t}}(n(54));e.SigninState=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.nonce,o=n.authority,i=n.client_id,u=n.redirect_uri,c=n.code_verifier,p=n.response_mode,l=n.client_secret,f=n.scope,d=n.extraTokenParams,h=n.skipUserInfo;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var g=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,arguments[0]));if(!0===r?g._nonce=(0,a.default)():r&&(g._nonce=r),!0===c?g._code_verifier=(0,a.default)()+(0,a.default)()+(0,a.default)():c&&(g._code_verifier=c),g.code_verifier){var v=s.JoseUtil.hashString(g.code_verifier,"SHA256");g._code_challenge=s.JoseUtil.hexToBase64Url(v)}return g._redirect_uri=u,g._authority=o,g._client_id=i,g._response_mode=p,g._client_secret=l,g._scope=f,g._extraTokenParams=d,g._skipUserInfo=h,g}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.toStorageString=function(){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})},e.fromStorageString=function(t){return o.Log.debug("SigninState.fromStorageString"),new e(JSON.parse(t))},r(e,[{key:"nonce",get:function(){return this._nonce}},{key:"authority",get:function(){return this._authority}},{key:"client_id",get:function(){return this._client_id}},{key:"redirect_uri",get:function(){return this._redirect_uri}},{key:"code_verifier",get:function(){return this._code_verifier}},{key:"code_challenge",get:function(){return this._code_challenge}},{key:"response_mode",get:function(){return this._response_mode}},{key:"client_secret",get:function(){return this._client_secret}},{key:"scope",get:function(){return this._scope}},{key:"extraTokenParams",get:function(){return this._extraTokenParams}},{key:"skipUserInfo",get:function(){return this._skipUserInfo}}]),e}(i.State)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){return(0,r.default)().replace(/-/g,"")};var r=function(t){return t&&t.__esModule?t:{default:t}}(n(122));t.exports=e.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.User=void 0;var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(0);e.User=function(){function t(e){var n=e.id_token,r=e.session_state,o=e.access_token,i=e.refresh_token,s=e.token_type,a=e.scope,u=e.profile,c=e.expires_at,p=e.state;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.id_token=n,this.session_state=r,this.access_token=o,this.refresh_token=i,this.token_type=s,this.scope=a,this.profile=u,this.expires_at=c,this.state=p}return t.prototype.toStorageString=function(){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})},t.fromStorageString=function(e){return o.Log.debug("User.fromStorageString"),new t(JSON.parse(e))},r(t,[{key:"expires_in",get:function(){if(this.expires_at){var t=parseInt(Date.now()/1e3);return this.expires_at-t}},set:function(t){var e=parseInt(t);if("number"==typeof e&&e>0){var n=parseInt(Date.now()/1e3);this.expires_at=n+e}}},{key:"expired",get:function(){var t=this.expires_in;if(void 0!==t)return t<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}}]),t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AccessTokenEvents=void 0;var r=n(0),o=n(137);e.AccessTokenEvents=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.accessTokenExpiringNotificationTime,r=void 0===n?60:n,i=e.accessTokenExpiringTimer,s=void 0===i?new o.Timer("Access token expiring"):i,a=e.accessTokenExpiredTimer,u=void 0===a?new o.Timer("Access token expired"):a;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._accessTokenExpiringNotificationTime=r,this._accessTokenExpiring=s,this._accessTokenExpired=u}return t.prototype.load=function(t){if(t.access_token&&void 0!==t.expires_in){var e=t.expires_in;if(r.Log.debug("AccessTokenEvents.load: access token present, remaining duration:",e),e>0){var n=e-this._accessTokenExpiringNotificationTime;n<=0&&(n=1),r.Log.debug("AccessTokenEvents.load: registering expiring timer in:",n),this._accessTokenExpiring.init(n)}else r.Log.debug("AccessTokenEvents.load: canceling existing expiring timer becase we're past expiration."),this._accessTokenExpiring.cancel();var o=e+1;r.Log.debug("AccessTokenEvents.load: registering expired timer in:",o),this._accessTokenExpired.init(o)}else this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()},t.prototype.unload=function(){r.Log.debug("AccessTokenEvents.unload: canceling existing access token timers"),this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()},t.prototype.addAccessTokenExpiring=function(t){this._accessTokenExpiring.addHandler(t)},t.prototype.removeAccessTokenExpiring=function(t){this._accessTokenExpiring.removeHandler(t)},t.prototype.addAccessTokenExpired=function(t){this._accessTokenExpired.addHandler(t)},t.prototype.removeAccessTokenExpired=function(t){this._accessTokenExpired.removeHandler(t)},t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Event=void 0;var r=n(0);e.Event=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._name=e,this._callbacks=[]}return t.prototype.addHandler=function(t){this._callbacks.push(t)},t.prototype.removeHandler=function(t){var e=this._callbacks.findIndex((function(e){return e===t}));e>=0&&this._callbacks.splice(e,1)},t.prototype.raise=function(){r.Log.debug("Event: Raising event: "+this._name);for(var t=0;t<this._callbacks.length;t++){var e;(e=this._callbacks)[t].apply(e,arguments)}},t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SessionMonitor=void 0;var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(0),i=n(59),s=n(4);e.SessionMonitor=function(){function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.CheckSessionIFrame,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.Global.timer;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!e)throw o.Log.error("SessionMonitor.ctor: No user manager passed to SessionMonitor"),new Error("userManager");this._userManager=e,this._CheckSessionIFrameCtor=r,this._timer=a,this._userManager.events.addUserLoaded(this._start.bind(this)),this._userManager.events.addUserUnloaded(this._stop.bind(this)),this._userManager.getUser().then((function(t){t?n._start(t):n._settings.monitorAnonymousSession&&n._userManager.querySessionStatus().then((function(t){var e={session_state:t.session_state};t.sub&&t.sid&&(e.profile={sub:t.sub,sid:t.sid}),n._start(e)})).catch((function(t){o.Log.error("SessionMonitor ctor: error from querySessionStatus:",t.message)}))})).catch((function(t){o.Log.error("SessionMonitor ctor: error from getUser:",t.message)}))}return t.prototype._start=function(t){var e=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(t){if(t){o.Log.debug("SessionMonitor._start: Initializing check session iframe");var r=e._client_id,i=e._checkSessionInterval,s=e._stopCheckSessionOnError;e._checkSessionIFrame=new e._CheckSessionIFrameCtor(e._callback.bind(e),r,t,i,s),e._checkSessionIFrame.load().then((function(){e._checkSessionIFrame.start(n)}))}else o.Log.warn("SessionMonitor._start: No check session iframe found in the metadata")})).catch((function(t){o.Log.error("SessionMonitor._start: Error from getCheckSessionIframe:",t.message)})))},t.prototype._stop=function(){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 e=this._timer.setInterval((function(){t._timer.clearInterval(e),t._userManager.querySessionStatus().then((function(e){var n={session_state:e.session_state};e.sub&&e.sid&&(n.profile={sub:e.sub,sid:e.sid}),t._start(n)})).catch((function(t){o.Log.error("SessionMonitor: error from querySessionStatus:",t.message)}))}),1e3)},t.prototype._callback=function(){var t=this;this._userManager.querySessionStatus().then((function(e){var n=!0;e?e.sub===t._sub?(n=!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"),n&&(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())}))},r(t,[{key:"_settings",get:function(){return this._userManager.settings}},{key:"_metadataService",get:function(){return this._userManager.metadataService}},{key:"_client_id",get:function(){return this._settings.client_id}},{key:"_checkSessionInterval",get:function(){return this._settings.checkSessionInterval}},{key:"_stopCheckSessionOnError",get:function(){return this._settings.stopCheckSessionOnError}}]),t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CheckSessionIFrame=void 0;var r=n(0);e.CheckSessionIFrame=function(){function t(e,n,r,o){var i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._callback=e,this._client_id=n,this._url=r,this._interval=o||2e3,this._stopOnError=i;var s=r.indexOf("/",r.indexOf("//")+2);this._frame_origin=r.substr(0,s),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=r}return t.prototype.load=function(){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)}))},t.prototype._message=function(t){t.origin===this._frame_origin&&t.source===this._frame.contentWindow&&("error"===t.data?(r.Log.error("CheckSessionIFrame: error message from check session op iframe"),this._stopOnError&&this.stop()):"changed"===t.data?(r.Log.debug("CheckSessionIFrame: changed message from check session op iframe"),this.stop(),this._callback()):r.Log.debug("CheckSessionIFrame: "+t.data+" message from check session op iframe"))},t.prototype.start=function(t){var e=this;if(this._session_state!==t){r.Log.debug("CheckSessionIFrame.start"),this.stop(),this._session_state=t;var n=function(){e._frame.contentWindow.postMessage(e._client_id+" "+e._session_state,e._frame_origin)};n(),this._timer=window.setInterval(n,this._interval)}},t.prototype.stop=function(){this._session_state=null,this._timer&&(r.Log.debug("CheckSessionIFrame.stop"),window.clearInterval(this._timer),this._timer=null)},t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TokenRevocationClient=void 0;var r=n(0),o=n(9),i=n(4);e.TokenRevocationClient=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.Global.XMLHttpRequest,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.MetadataService;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!e)throw r.Log.error("TokenRevocationClient.ctor: No settings provided"),new Error("No settings provided.");this._settings=e,this._XMLHttpRequestCtor=n,this._metadataService=new s(this._settings)}return t.prototype.revoke=function(t,e){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"access_token";if(!t)throw r.Log.error("TokenRevocationClient.revoke: No token provided"),new Error("No token provided.");if("access_token"!==o&&"refresh_token"!=o)throw r.Log.error("TokenRevocationClient.revoke: Invalid token type"),new Error("Invalid token type.");return this._metadataService.getRevocationEndpoint().then((function(i){if(i){r.Log.debug("TokenRevocationClient.revoke: Revoking "+o);var s=n._settings.client_id,a=n._settings.client_secret;return n._revoke(i,s,a,t,o)}if(e)throw r.Log.error("TokenRevocationClient.revoke: Revocation not supported"),new Error("Revocation not supported")}))},t.prototype._revoke=function(t,e,n,o,i){var s=this;return new Promise((function(a,u){var c=new s._XMLHttpRequestCtor;c.open("POST",t),c.onload=function(){r.Log.debug("TokenRevocationClient.revoke: HTTP response received, status",c.status),200===c.status?a():u(Error(c.statusText+" ("+c.status+")"))},c.onerror=function(){r.Log.debug("TokenRevocationClient.revoke: Network Error."),u("Network Error")};var p="client_id="+encodeURIComponent(e);n&&(p+="&client_secret="+encodeURIComponent(n)),p+="&token_type_hint="+encodeURIComponent(i),p+="&token="+encodeURIComponent(o),c.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),c.send(p)}))},t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CordovaPopupWindow=void 0;var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(0);e.CordovaPopupWindow=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._promise=new Promise((function(t,e){n._resolve=t,n._reject=e})),this.features=e.popupWindowFeatures||"location=no,toolbar=no,zoom=no",this.target=e.popupWindowTarget||"_blank",this.redirect_uri=e.startUrl,o.Log.debug("CordovaPopupWindow.ctor: redirect_uri: "+this.redirect_uri)}return t.prototype._isInAppBrowserInstalled=function(t){return["cordova-plugin-inappbrowser","cordova-plugin-inappbrowser.inappbrowser","org.apache.cordova.inappbrowser"].some((function(e){return t.hasOwnProperty(e)}))},t.prototype.navigate=function(t){if(t&&t.url){if(!window.cordova)return this._error("cordova is undefined");var e=window.cordova.require("cordova/plugin_list").metadata;if(!1===this._isInAppBrowserInstalled(e))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},t.prototype._loadStartCallback=function(t){0===t.url.indexOf(this.redirect_uri)&&this._success({url:t.url})},t.prototype._exitCallback=function(t){this._error(t)},t.prototype._success=function(t){this._cleanup(),o.Log.debug("CordovaPopupWindow: Successful response from cordova popup window"),this._resolve(t)},t.prototype._error=function(t){this._cleanup(),o.Log.error(t),this._reject(new Error(t))},t.prototype.close=function(){this._cleanup()},t.prototype._cleanup=function(){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},r(t,[{key:"promise",get:function(){return this._promise}}]),t}()},function(t,e,n){n(63),t.exports=n(113)},function(t,e,n){"use strict";n(64),n(95),n(98),n(103),n(107),n(110),n(112)},function(t,e,n){n(65),n(69),n(78),n(81),t.exports=n(3).Promise},function(t,e,n){"use strict";var r=n(21),o={};o[n(1)("toStringTag")]="z",o+""!="[object z]"&&n(11)(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},function(t,e,n){t.exports=!n(12)&&!n(18)((function(){return 7!=Object.defineProperty(n(25)("div"),"a",{get:function(){return 7}}).a}))},function(t,e,n){var r=n(6);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){t.exports=n(22)("native-function-to-string",Function.toString)},function(t,e,n){"use strict";var r=n(70)(!0);n(40)(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})}))},function(t,e,n){var r=n(26),o=n(27);t.exports=function(t){return function(e,n){var i,s,a=String(o(e)),u=r(n),c=a.length;return u<0||u>=c?t?"":void 0:(i=a.charCodeAt(u))<55296||i>56319||u+1===c||(s=a.charCodeAt(u+1))<56320||s>57343?t?a.charAt(u):i:t?a.slice(u,u+2):s-56320+(i-55296<<10)+65536}}},function(t,e,n){"use strict";var r=n(72),o=n(39),i=n(33),s={};n(8)(s,n(1)("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=r(s,{next:o(1,n)}),i(t,e+" Iterator")}},function(t,e,n){var r=n(5),o=n(73),i=n(41),s=n(32)("IE_PROTO"),a=function(){},u=function(){var t,e=n(25)("iframe"),r=i.length;for(e.style.display="none",n(42).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),u=t.F;r--;)delete u.prototype[i[r]];return u()};t.exports=Object.create||function(t,e){var n;return null!==t?(a.prototype=r(t),n=new a,a.prototype=null,n[s]=t):n=u(),void 0===e?n:o(n,e)}},function(t,e,n){var r=n(17),o=n(5),i=n(28);t.exports=n(12)?Object.defineProperties:function(t,e){o(t);for(var n,s=i(e),a=s.length,u=0;a>u;)r.f(t,n=s[u++],e[n]);return t}},function(t,e,n){var r=n(19),o=n(29),i=n(75)(!1),s=n(32)("IE_PROTO");t.exports=function(t,e){var n,a=o(t),u=0,c=[];for(n in a)n!=s&&r(a,n)&&c.push(n);for(;e.length>u;)r(a,n=e[u++])&&(~i(c,n)||c.push(n));return c}},function(t,e,n){var r=n(29),o=n(31),i=n(76);t.exports=function(t){return function(e,n,s){var a,u=r(e),c=o(u.length),p=i(s,c);if(t&&n!=n){for(;c>p;)if((a=u[p++])!=a)return!0}else for(;c>p;p++)if((t||p in u)&&u[p]===n)return t||p||0;return!t&&-1}}},function(t,e,n){var r=n(26),o=Math.max,i=Math.min;t.exports=function(t,e){return(t=r(t))<0?o(t+e,0):i(t,e)}},function(t,e,n){var r=n(19),o=n(34),i=n(32)("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),r(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,e,n){for(var r=n(79),o=n(28),i=n(11),s=n(2),a=n(8),u=n(15),c=n(1),p=c("iterator"),l=c("toStringTag"),f=u.Array,d={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},h=o(d),g=0;g<h.length;g++){var v,_=h[g],y=d[_],m=s[_],b=m&&m.prototype;if(b&&(b[p]||a(b,p,f),b[l]||a(b,l,_),u[_]=f,y))for(v in r)b[v]||i(b,v,r[v],!0)}},function(t,e,n){"use strict";var r=n(43),o=n(80),i=n(15),s=n(29);t.exports=n(40)(Array,"Array",(function(t,e){this._t=s(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,o(1)):o(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])}),"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){"use strict";var r,o,i,s,a=n(23),u=n(2),c=n(13),p=n(21),l=n(7),f=n(6),d=n(14),h=n(82),g=n(83),v=n(87),_=n(44).set,y=n(88)(),m=n(46),b=n(89),S=n(90),w=n(91),k=u.TypeError,E=u.process,T=E&&E.versions,x=T&&T.v8||"",O=u.Promise,R="process"==p(E),C=function(){},P=o=m.f,L=!!function(){try{var t=O.resolve(1),e=(t.constructor={})[n(1)("species")]=function(t){t(C,C)};return(R||"function"==typeof PromiseRejectionEvent)&&t.then(C)instanceof e&&0!==x.indexOf("6.6")&&-1===S.indexOf("Chrome/66")}catch(t){}}(),U=function(t){var e;return!(!f(t)||"function"!=typeof(e=t.then))&&e},j=function(t,e){if(!t._n){t._n=!0;var n=t._c;y((function(){for(var r=t._v,o=1==t._s,i=0,s=function(e){var n,i,s,a=o?e.ok:e.fail,u=e.resolve,c=e.reject,p=e.domain;try{a?(o||(2==t._h&&A(t),t._h=1),!0===a?n=r:(p&&p.enter(),n=a(r),p&&(p.exit(),s=!0)),n===e.promise?c(k("Promise-chain cycle")):(i=U(n))?i.call(n,u,c):u(n)):c(r)}catch(t){p&&!s&&p.exit(),c(t)}};n.length>i;)s(n[i++]);t._c=[],t._n=!1,e&&!t._h&&I(t)}))}},I=function(t){_.call(u,(function(){var e,n,r,o=t._v,i=M(t);if(i&&(e=b((function(){R?E.emit("unhandledRejection",o,t):(n=u.onunhandledrejection)?n({promise:t,reason:o}):(r=u.console)&&r.error&&r.error("Unhandled promise rejection",o)})),t._h=R||M(t)?2:1),t._a=void 0,i&&e.e)throw e.v}))},M=function(t){return 1!==t._h&&0===(t._a||t._c).length},A=function(t){_.call(u,(function(){var e;R?E.emit("rejectionHandled",t):(e=u.onrejectionhandled)&&e({promise:t,reason:t._v})}))},N=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),j(e,!0))},D=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw k("Promise can't be resolved itself");(e=U(t))?y((function(){var r={_w:n,_d:!1};try{e.call(t,c(D,r,1),c(N,r,1))}catch(t){N.call(r,t)}})):(n._v=t,n._s=1,j(n,!1))}catch(t){N.call({_w:n,_d:!1},t)}}};L||(O=function t(e){h(this,O,"Promise","_h"),d(e),r.call(this);try{e(c(D,this,1),c(N,this,1))}catch(t){N.call(this,t)}},(r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(92)(O.prototype,{then:function(t,e){var n=P(v(this,O));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=R?E.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&j(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),i=function(){var t=new r;this.promise=t,this.resolve=c(D,t,1),this.reject=c(N,t,1)},m.f=P=function(t){return t===O||t===s?new i(t):o(t)}),l(l.G+l.W+l.F*!L,{Promise:O}),n(33)(O,"Promise"),n(93)("Promise"),s=n(3).Promise,l(l.S+l.F*!L,"Promise",{reject:function(t){var e=P(this);return(0,e.reject)(t),e.promise}}),l(l.S+l.F*(a||!L),"Promise",{resolve:function(t){return w(a&&this===s?O:this,t)}}),l(l.S+l.F*!(L&&n(94)((function(t){O.all(t).catch(C)}))),"Promise",{all:function(t){var e=this,n=P(e),r=n.resolve,o=n.reject,i=b((function(){var n=[],i=0,s=1;g(t,!1,(function(t){var a=i++,u=!1;n.push(void 0),s++,e.resolve(t).then((function(t){u||(u=!0,n[a]=t,--s||r(n))}),o)})),--s||r(n)}));return i.e&&o(i.v),n.promise},race:function(t){var e=this,n=P(e),r=n.reject,o=b((function(){g(t,!1,(function(t){e.resolve(t).then(n.resolve,r)}))}));return o.e&&r(o.v),n.promise}})},function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){var r=n(13),o=n(84),i=n(85),s=n(5),a=n(31),u=n(86),c={},p={};(e=t.exports=function(t,e,n,l,f){var d,h,g,v,_=f?function(){return t}:u(t),y=r(n,l,e?2:1),m=0;if("function"!=typeof _)throw TypeError(t+" is not iterable!");if(i(_)){for(d=a(t.length);d>m;m++)if((v=e?y(s(h=t[m])[0],h[1]):y(t[m]))===c||v===p)return v}else for(g=_.call(t);!(h=g.next()).done;)if((v=o(g,y,h.value,e))===c||v===p)return v}).BREAK=c,e.RETURN=p},function(t,e,n){var r=n(5);t.exports=function(t,e,n,o){try{return o?e(r(n)[0],n[1]):e(n)}catch(e){var i=t.return;throw void 0!==i&&r(i.call(t)),e}}},function(t,e,n){var r=n(15),o=n(1)("iterator"),i=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||i[o]===t)}},function(t,e,n){var r=n(21),o=n(1)("iterator"),i=n(15);t.exports=n(3).getIteratorMethod=function(t){if(null!=t)return t[o]||t["@@iterator"]||i[r(t)]}},function(t,e,n){var r=n(5),o=n(14),i=n(1)("species");t.exports=function(t,e){var n,s=r(t).constructor;return void 0===s||null==(n=r(s)[i])?e:o(n)}},function(t,e,n){var r=n(2),o=n(44).set,i=r.MutationObserver||r.WebKitMutationObserver,s=r.process,a=r.Promise,u="process"==n(10)(s);t.exports=function(){var t,e,n,c=function(){var r,o;for(u&&(r=s.domain)&&r.exit();t;){o=t.fn,t=t.next;try{o()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(u)n=function(){s.nextTick(c)};else if(!i||r.navigator&&r.navigator.standalone)if(a&&a.resolve){var p=a.resolve(void 0);n=function(){p.then(c)}}else n=function(){o.call(r,c)};else{var l=!0,f=document.createTextNode("");new i(c).observe(f,{characterData:!0}),n=function(){f.data=l=!l}}return function(r){var o={fn:r,next:void 0};e&&(e.next=o),t||(t=o,n()),e=o}}},function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},function(t,e,n){var r=n(2).navigator;t.exports=r&&r.userAgent||""},function(t,e,n){var r=n(5),o=n(6),i=n(46);t.exports=function(t,e){if(r(t),o(e)&&e.constructor===t)return e;var n=i.f(t);return(0,n.resolve)(e),n.promise}},function(t,e,n){var r=n(11);t.exports=function(t,e,n){for(var o in e)r(t,o,e[o],n);return t}},function(t,e,n){"use strict";var r=n(2),o=n(17),i=n(12),s=n(1)("species");t.exports=function(t){var e=r[t];i&&e&&!e[s]&&o.f(e,s,{configurable:!0,get:function(){return this}})}},function(t,e,n){var r=n(1)("iterator"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var i=[7],s=i[r]();s.next=function(){return{done:n=!0}},i[r]=function(){return s},t(i)}catch(t){}return n}},function(t,e,n){n(96),t.exports=n(3).Function.bind},function(t,e,n){var r=n(7);r(r.P,"Function",{bind:n(97)})},function(t,e,n){"use strict";var r=n(14),o=n(6),i=n(45),s=[].slice,a={};t.exports=Function.bind||function(t){var e=r(this),n=s.call(arguments,1),u=function(){var r=n.concat(s.call(arguments));return this instanceof u?function(t,e,n){if(!(e in a)){for(var r=[],o=0;o<e;o++)r[o]="a["+o+"]";a[e]=Function("F,a","return new F("+r.join(",")+")")}return a[e](t,n)}(e,r.length,r):i(e,r,t)};return o(e.prototype)&&(u.prototype=e.prototype),u}},function(t,e,n){n(99),t.exports=n(3).Object.assign},function(t,e,n){var r=n(7);r(r.S+r.F,"Object",{assign:n(100)})},function(t,e,n){"use strict";var r=n(28),o=n(101),i=n(102),s=n(34),a=n(30),u=Object.assign;t.exports=!u||n(18)((function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=u({},t)[n]||Object.keys(u({},e)).join("")!=r}))?function(t,e){for(var n=s(t),u=arguments.length,c=1,p=o.f,l=i.f;u>c;)for(var f,d=a(arguments[c++]),h=p?r(d).concat(p(d)):r(d),g=h.length,v=0;g>v;)l.call(d,f=h[v++])&&(n[f]=d[f]);return n}:u},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){n(104),t.exports=n(3).Array.find},function(t,e,n){"use strict";var r=n(7),o=n(47)(5),i=!0;"find"in[]&&Array(1).find((function(){i=!1})),r(r.P+r.F*i,"Array",{find:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),n(43)("find")},function(t,e,n){var r=n(106);t.exports=function(t,e){return new(r(t))(e)}},function(t,e,n){var r=n(6),o=n(48),i=n(1)("species");t.exports=function(t){var e;return o(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!o(e.prototype)||(e=void 0),r(e)&&null===(e=e[i])&&(e=void 0)),void 0===e?Array:e}},function(t,e,n){n(108),t.exports=n(3).Array.some},function(t,e,n){"use strict";var r=n(7),o=n(47)(3);r(r.P+r.F*!n(109)([].some,!0),"Array",{some:function(t){return o(this,t,arguments[1])}})},function(t,e,n){"use strict";var r=n(18);t.exports=function(t,e){return!!t&&r((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},function(t,e,n){n(111),t.exports=n(3).Array.isArray},function(t,e,n){var r=n(7);r(r.S,"Array",{isArray:n(48)})},function(t,e){t.exports=function(){return Function.call.apply(Array.prototype.splice,arguments)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(49),i=n(35),s=n(36),a=n(128),u=n(129),c=n(56),p=n(9),l=n(139),f=n(140),d=n(59),h=n(60),g=n(58),v=n(4),_=n(55),y=n(141);e.default={Version:y.Version,Log:r.Log,OidcClient:o.OidcClient,OidcClientSettings:i.OidcClientSettings,WebStorageStateStore:s.WebStorageStateStore,InMemoryWebStorage:a.InMemoryWebStorage,UserManager:u.UserManager,AccessTokenEvents:c.AccessTokenEvents,MetadataService:p.MetadataService,CordovaPopupNavigator:l.CordovaPopupNavigator,CordovaIFrameNavigator:f.CordovaIFrameNavigator,CheckSessionIFrame:d.CheckSessionIFrame,TokenRevocationClient:h.TokenRevocationClient,SessionMonitor:g.SessionMonitor,Global:v.Global,User:_.User},t.exports=e.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ResponseValidator=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=n(0),i=n(9),s=n(115),a=n(50),u=n(51),c=n(20),p=["nonce","at_hash","iat","nbf","exp","aud","iss","c_hash"];e.ResponseValidator=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.MetadataService,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.UserInfoService,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:c.JoseUtil,p=arguments.length>4&&void 0!==arguments[4]?arguments[4]:a.TokenClient;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!e)throw o.Log.error("ResponseValidator.ctor: No settings passed to ResponseValidator"),new Error("settings");this._settings=e,this._metadataService=new n(this._settings),this._userInfoService=new r(this._settings),this._joseUtil=u,this._tokenClient=new p(this._settings)}return t.prototype.validateSigninResponse=function(t,e){var n=this;return o.Log.debug("ResponseValidator.validateSigninResponse"),this._processSigninParams(t,e).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(t){return o.Log.debug("ResponseValidator.validateSigninResponse: claims processed"),t}))}))}))},t.prototype.validateSignoutResponse=function(t,e){return t.id!==e.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"),e.state=t.data,e.error?(o.Log.warn("ResponseValidator.validateSignoutResponse: Response was error",e.error),Promise.reject(new u.ErrorResponse(e))):Promise.resolve(e))},t.prototype._processSigninParams=function(t,e){if(t.id!==e.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"),e.state=t.data,e.error?(o.Log.warn("ResponseValidator._processSigninParams: Response was error",e.error),Promise.reject(new u.ErrorResponse(e))):t.nonce&&!e.id_token?(o.Log.error("ResponseValidator._processSigninParams: Expecting id_token in response"),Promise.reject(new Error("No id_token in response"))):!t.nonce&&e.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&&!e.code?(o.Log.error("ResponseValidator._processSigninParams: Expecting code in response"),Promise.reject(new Error("No code in response"))):!t.code_verifier&&e.code?(o.Log.error("ResponseValidator._processSigninParams: Not expecting code in response"),Promise.reject(new Error("Unexpected code in response"))):(e.scope||(e.scope=t.scope),Promise.resolve(e))},t.prototype._processClaims=function(t,e){var n=this;if(e.isOpenIdConnect){if(o.Log.debug("ResponseValidator._processClaims: response is OIDC, processing claims"),e.profile=this._filterProtocolClaims(e.profile),!0!==t.skipUserInfo&&this._settings.loadUserInfo&&e.access_token)return o.Log.debug("ResponseValidator._processClaims: loading user info"),this._userInfoService.getClaims(e.access_token).then((function(t){return o.Log.debug("ResponseValidator._processClaims: user info claims received from user info endpoint"),t.sub!==e.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"))):(e.profile=n._mergeClaims(e.profile,t),o.Log.debug("ResponseValidator._processClaims: user info claims received, updated profile:",e.profile),e)}));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(e)},t.prototype._mergeClaims=function(t,e){var n=Object.assign({},t);for(var o in e){var i=e[o];Array.isArray(i)||(i=[i]);for(var s=0;s<i.length;s++){var a=i[s];n[o]?Array.isArray(n[o])?n[o].indexOf(a)<0&&n[o].push(a):n[o]!==a&&("object"===(void 0===a?"undefined":r(a))?n[o]=this._mergeClaims(n[o],a):n[o]=[n[o],a]):n[o]=a}}return n},t.prototype._filterProtocolClaims=function(t){o.Log.debug("ResponseValidator._filterProtocolClaims, incoming claims:",t);var e=Object.assign({},t);return this._settings._filterProtocolClaims?(p.forEach((function(t){delete e[t]})),o.Log.debug("ResponseValidator._filterProtocolClaims: protocol claims filtered",e)):o.Log.debug("ResponseValidator._filterProtocolClaims: protocol claims not filtered"),e},t.prototype._validateTokens=function(t,e){return e.code?(o.Log.debug("ResponseValidator._validateTokens: Validating code"),this._processCode(t,e)):e.id_token?e.access_token?(o.Log.debug("ResponseValidator._validateTokens: Validating id_token and access_token"),this._validateIdTokenAndAccessToken(t,e)):(o.Log.debug("ResponseValidator._validateTokens: Validating id_token"),this._validateIdToken(t,e)):(o.Log.debug("ResponseValidator._validateTokens: No code to process or id_token to validate"),Promise.resolve(e))},t.prototype._processCode=function(t,e){var n=this,i={client_id:t.client_id,client_secret:t.client_secret,code:e.code,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier};return t.extraTokenParams&&"object"===r(t.extraTokenParams)&&Object.assign(i,t.extraTokenParams),this._tokenClient.exchangeCode(i).then((function(r){for(var i in r)e[i]=r[i];return e.id_token?(o.Log.debug("ResponseValidator._processCode: token response successful, processing id_token"),n._validateIdTokenAttributes(t,e)):(o.Log.debug("ResponseValidator._processCode: token response successful, returning response"),e)}))},t.prototype._validateIdTokenAttributes=function(t,e){var n=this;return this._metadataService.getIssuer().then((function(r){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(e.id_token,r,i,s).then((function(n){return t.nonce&&t.nonce!==n.nonce?(o.Log.error("ResponseValidator._validateIdTokenAttributes: Invalid nonce in id_token"),Promise.reject(new Error("Invalid nonce in id_token"))):n.sub?(e.profile=n,e):(o.Log.error("ResponseValidator._validateIdTokenAttributes: No sub present in id_token"),Promise.reject(new Error("No sub present in id_token")))}))}))},t.prototype._validateIdTokenAndAccessToken=function(t,e){var n=this;return this._validateIdToken(t,e).then((function(t){return n._validateAccessToken(t)}))},t.prototype._validateIdToken=function(t,e){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 r=this._joseUtil.parseJwt(e.id_token);if(!r||!r.header||!r.payload)return o.Log.error("ResponseValidator._validateIdToken: Failed to parse id_token",r),Promise.reject(new Error("Failed to parse id_token"));if(t.nonce!==r.payload.nonce)return o.Log.error("ResponseValidator._validateIdToken: Invalid nonce in id_token"),Promise.reject(new Error("Invalid nonce in id_token"));var i=r.header.kid;return this._metadataService.getIssuer().then((function(s){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(i)u=a.filter((function(t){return t.kid===i}))[0];else{if((a=n._filterByAlg(a,r.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,p=n._settings.clockSkew;return o.Log.debug("ResponseValidator._validateIdToken: Validaing JWT; using clock skew (in seconds) of: ",p),n._joseUtil.validateJwt(e.id_token,u,s,c,p).then((function(){return o.Log.debug("ResponseValidator._validateIdToken: JWT validation successful"),r.payload.sub?(e.profile=r.payload,e):(o.Log.error("ResponseValidator._validateIdToken: No sub present in id_token"),Promise.reject(new Error("No sub present in id_token")))}))}))}))},t.prototype._filterByAlg=function(t,e){var n=null;if(e.startsWith("RS"))n="RSA";else if(e.startsWith("PS"))n="PS";else{if(!e.startsWith("ES"))return o.Log.debug("ResponseValidator._filterByAlg: alg not supported: ",e),[];n="EC"}return o.Log.debug("ResponseValidator._filterByAlg: Looking for keys that match kty: ",n),t=t.filter((function(t){return t.kty===n})),o.Log.debug("ResponseValidator._filterByAlg: Number of keys that match kty: ",n,t.length),t},t.prototype._validateAccessToken=function(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 e=this._joseUtil.parseJwt(t.id_token);if(!e||!e.header)return o.Log.error("ResponseValidator._validateAccessToken: Failed to parse id_token",e),Promise.reject(new Error("Failed to parse id_token"));var n=e.header.alg;if(!n||5!==n.length)return o.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",n),Promise.reject(new Error("Unsupported alg: "+n));var r=n.substr(2,3);if(!r)return o.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",n,r),Promise.reject(new Error("Unsupported alg: "+n));if(256!==(r=parseInt(r))&&384!==r&&512!==r)return o.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",n,r),Promise.reject(new Error("Unsupported alg: "+n));var i="sha"+r,s=this._joseUtil.hashString(t.access_token,i);if(!s)return o.Log.error("ResponseValidator._validateAccessToken: access_token hash failed:",i),Promise.reject(new Error("Failed to validate at_hash"));var a=s.substr(0,s.length/2),u=this._joseUtil.hexToBase64Url(a);return u!==t.profile.at_hash?(o.Log.error("ResponseValidator._validateAccessToken: Failed to validate at_hash",u,t.profile.at_hash),Promise.reject(new Error("Failed to validate at_hash"))):(o.Log.debug("ResponseValidator._validateAccessToken: success"),Promise.resolve(t))},t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserInfoService=void 0;var r=n(37),o=n(9),i=n(0),s=n(20);e.UserInfoService=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.JsonService,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.MetadataService,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:s.JoseUtil;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!e)throw i.Log.error("UserInfoService.ctor: No settings passed"),new Error("settings");this._settings=e,this._jsonService=new n(void 0,void 0,this._getClaimsFromJwt.bind(this)),this._metadataService=new a(this._settings),this._joseUtil=u}return t.prototype.getClaims=function(t){var e=this;return t?this._metadataService.getUserInfoEndpoint().then((function(n){return i.Log.debug("UserInfoService.getClaims: received userinfo url",n),e._jsonService.getJson(n,t).then((function(t){return i.Log.debug("UserInfoService.getClaims: claims received",t),t}))})):(i.Log.error("UserInfoService.getClaims: No token passed"),Promise.reject(new Error("A token is required")))},t.prototype._getClaimsFromJwt=function t(e){var n=this;try{var r=this._joseUtil.parseJwt(e.responseText);if(!r||!r.header||!r.payload)return i.Log.error("UserInfoService._getClaimsFromJwt: Failed to parse JWT",r),Promise.reject(new Error("Failed to parse id_token"));var o=r.header.kid,s=void 0;switch(this._settings.userInfoJwtIssuer){case"OP":s=this._metadataService.getIssuer();break;case"ANY":s=Promise.resolve(r.payload.iss);break;default:s=Promise.resolve(this._settings.userInfoJwtIssuer)}return s.then((function(t){return i.Log.debug("UserInfoService._getClaimsFromJwt: Received issuer:"+t),n._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(t){return t.kid===o}))[0];else{if((s=n._filterByAlg(s,r.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=n._settings.client_id,c=n._settings.clockSkew;return i.Log.debug("UserInfoService._getClaimsFromJwt: Validaing JWT; using clock skew (in seconds) of: ",c),n._joseUtil.validateJwt(e.responseText,a,t,u,c,void 0,!0).then((function(){return i.Log.debug("UserInfoService._getClaimsFromJwt: JWT validation successful"),r.payload}))}))}))}catch(t){return i.Log.error("UserInfoService._getClaimsFromJwt: Error parsing JWT response",t.message),void reject(t)}},t.prototype._filterByAlg=function(t,e){var n=null;if(e.startsWith("RS"))n="RSA";else if(e.startsWith("PS"))n="PS";else{if(!e.startsWith("ES"))return i.Log.debug("UserInfoService._filterByAlg: alg not supported: ",e),[];n="EC"}return i.Log.debug("UserInfoService._filterByAlg: Looking for keys that match kty: ",n),t=t.filter((function(t){return t.kty===n})),i.Log.debug("UserInfoService._filterByAlg: Number of keys that match kty: ",n,t.length),t},t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AllowedSigningAlgs=e.b64tohex=e.hextob64u=e.crypto=e.X509=e.KeyUtil=e.jws=void 0;var r=s(n(117)),o=s(n(118)),i=s(n(120));function s(t){return t&&t.__esModule?t:{default:t}}var a=r.default.BigInteger,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c={b64tohex:function(t){var e,n,r="",o=0;for(e=0;e<t.length&&"="!==t.charAt(e);++e){var i=u.indexOf(t.charAt(e));i<0||(0===o?(r+=String.fromCharCode(i>>2),n=3&i,o=1):1===o?(r+=String.fromCharCode(n<<2|i>>4),n=15&i,o=2):2===o?(r+=String.fromCharCode(n),r+=String.fromCharCode(i>>2),n=3&i,o=3):(r+=String.fromCharCode(n<<2|i>>4),r+=String.fromCharCode(15&i),o=0))}return 1===o&&(r+=String.fromCharCode(n<<2)),r},hexToBase64:function(t){var e,n,r="";for(e=0;e+3<=t.length;e+=3)n=parseInt(t.substring(e,e+3),16),r+=u.charAt(n>>6)+u.charAt(63&n);for(e+1===t.length?(n=parseInt(t.substring(e,e+1),16),r+=u.charAt(n<<2)):e+2===t.length&&(n=parseInt(t.substring(e,e+2),16),r+=u.charAt(n>>2)+u.charAt((3&n)<<4));(3&r.length)>0;)r+="=";return r},padding:function(t){var e=t.length%4;return 0===e?t:t+new Array(4-e+1).join("=")},byteArrayToHex:function(t){for(var e="",n=0;n<t.length;n++){var r=t[n].toString(16);e+=2===r.length?r:"0"+r}return e},decodeToHEX:function(t){return c.byteArrayToHex(i.default.toByteArray(c.padding(t)))},base64ToBase64Url:function(t){return(t=(t=t.replace(/=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")},urlDecode:function(t){return t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g," "),atob(t)}},p={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 f(t,e){if(this.n=null,this.e=0,!(null!=t&&null!=e&&t.length>0&&e.length>0))throw new Error("Invalid key data");this.n=new a(t,16),this.e=parseInt(e,16)}f.prototype.verify=function(t,e){e=(e=c.decodeToHEX(e)).replace(/[^0-9a-f]|[\s\n]]/gi,"");var n=new a(e,16);if(n.bitLength()>this.n.bitLength())throw new Error("Signature does not match with the key modulus.");var r=function(t){for(var e in p){var n=p[e],r=n.length;if(t.substring(0,r)===n)return{alg:e,hash:t.substring(r)}}return[]}(n.modPowInt(this.e,this.n).toString(16).replace(/^1f+00/,""));if(0===r.length)return!1;if(!l.hasOwnProperty(r.alg))throw new Error("Hashing algorithm is not supported.");var o=l[r.alg](t).toString();return r.hash===o};var d=["RS256"],h={JWS:{parse:function(e){var n,r,o=e.split(".");if(3===o.length){try{n=JSON.parse(c.urlDecode(o[0])),r=JSON.parse(c.urlDecode(o[1]))}catch(t){return new Error("Token header or payload is not valid JSON")}return{headerObj:n,payloadObj:r}}},verify:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]).forEach((function(t){if(-1===d.indexOf(t))throw new Error("Invalid signing algorithm: "+t)}));var n=new f(e.n,e.e),r=t.split("."),o=[r[0],r[1]].join(".");return n.verify(o,r[2])}}},g={getKey:function(t){return"RSA"===t.kty?{e:c.decodeToHEX(t.e),n:c.decodeToHEX(t.n)}:null}},v={getPublicKeyFromCertPEM:function(){throw new Error("Not implemented. Use the full oidc-client library if you need support for X509.")}},_={Util:{hashString:function(t,e){return(0,l[e])(t).toString()}}},y=c.b64tohex;e.jws=h,e.KeyUtil=g,e.X509=v,e.crypto=_,e.hextob64u=function(t){return t.length%2==1&&(t="0"+t),c.base64ToBase64Url(c.hexToBase64(t))},e.b64tohex=y,e.AllowedSigningAlgs=d},function(t,e,n){(function(){var e;function n(t,e,n){null!=t&&("number"==typeof t?this.fromNumber(t,e,n):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function r(){return new n(null)}var o="undefined"!=typeof navigator;o&&"Microsoft Internet Explorer"==navigator.appName?(n.prototype.am=function(t,e,n,r,o,i){for(var s=32767&e,a=e>>15;--i>=0;){var u=32767&this[t],c=this[t++]>>15,p=a*u+c*s;o=((u=s*u+((32767&p)<<15)+n[r]+(1073741823&o))>>>30)+(p>>>15)+a*c+(o>>>30),n[r++]=1073741823&u}return o},e=30):o&&"Netscape"!=navigator.appName?(n.prototype.am=function(t,e,n,r,o,i){for(;--i>=0;){var s=e*this[t++]+n[r]+o;o=Math.floor(s/67108864),n[r++]=67108863&s}return o},e=26):(n.prototype.am=function(t,e,n,r,o,i){for(var s=16383&e,a=e>>14;--i>=0;){var u=16383&this[t],c=this[t++]>>14,p=a*u+c*s;o=((u=s*u+((16383&p)<<14)+n[r]+o)>>28)+(p>>14)+a*c,n[r++]=268435455&u}return o},e=28),n.prototype.DB=e,n.prototype.DM=(1<<e)-1,n.prototype.DV=1<<e,n.prototype.FV=Math.pow(2,52),n.prototype.F1=52-e,n.prototype.F2=2*e-52;var i,s,a=new Array;for(i="0".charCodeAt(0),s=0;s<=9;++s)a[i++]=s;for(i="a".charCodeAt(0),s=10;s<36;++s)a[i++]=s;for(i="A".charCodeAt(0),s=10;s<36;++s)a[i++]=s;function u(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)}function c(t,e){var n=a[t.charCodeAt(e)];return null==n?-1:n}function p(t){var e=r();return e.fromInt(t),e}function l(t){var e,n=1;return 0!=(e=t>>>16)&&(t=e,n+=16),0!=(e=t>>8)&&(t=e,n+=8),0!=(e=t>>4)&&(t=e,n+=4),0!=(e=t>>2)&&(t=e,n+=2),0!=(e=t>>1)&&(t=e,n+=1),n}function f(t){this.m=t}function d(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function h(t,e){return t&e}function g(t,e){return t|e}function v(t,e){return t^e}function _(t,e){return t&~e}function y(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function m(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function b(){}function S(t){return t}function w(t){this.r2=r(),this.q3=r(),n.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}f.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},f.prototype.revert=function(t){return t},f.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},f.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},f.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},d.prototype.convert=function(t){var e=r();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(n.ZERO)>0&&this.m.subTo(e,e),e},d.prototype.revert=function(t){var e=r();return t.copyTo(e),this.reduce(e),e},d.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var n=32767&t[e],r=n*this.mpl+((n*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[n=e+this.m.t]+=this.m.am(0,r,t,e,0,this.m.t);t[n]>=t.DV;)t[n]-=t.DV,t[++n]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},d.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},d.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},n.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},n.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},n.prototype.fromString=function(t,e){var r;if(16==e)r=4;else if(8==e)r=3;else if(256==e)r=8;else if(2==e)r=1;else if(32==e)r=5;else{if(4!=e)return void this.fromRadix(t,e);r=2}this.t=0,this.s=0;for(var o=t.length,i=!1,s=0;--o>=0;){var a=8==r?255&t[o]:c(t,o);a<0?"-"==t.charAt(o)&&(i=!0):(i=!1,0==s?this[this.t++]=a:s+r>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+=r)>=this.DB&&(s-=this.DB))}8==r&&0!=(128&t[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),i&&n.ZERO.subTo(this,this)},n.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},n.prototype.dlShiftTo=function(t,e){var n;for(n=this.t-1;n>=0;--n)e[n+t]=this[n];for(n=t-1;n>=0;--n)e[n]=0;e.t=this.t+t,e.s=this.s},n.prototype.drShiftTo=function(t,e){for(var n=t;n<this.t;++n)e[n-t]=this[n];e.t=Math.max(this.t-t,0),e.s=this.s},n.prototype.lShiftTo=function(t,e){var n,r=t%this.DB,o=this.DB-r,i=(1<<o)-1,s=Math.floor(t/this.DB),a=this.s<<r&this.DM;for(n=this.t-1;n>=0;--n)e[n+s+1]=this[n]>>o|a,a=(this[n]&i)<<r;for(n=s-1;n>=0;--n)e[n]=0;e[s]=a,e.t=this.t+s+1,e.s=this.s,e.clamp()},n.prototype.rShiftTo=function(t,e){e.s=this.s;var n=Math.floor(t/this.DB);if(n>=this.t)e.t=0;else{var r=t%this.DB,o=this.DB-r,i=(1<<r)-1;e[0]=this[n]>>r;for(var s=n+1;s<this.t;++s)e[s-n-1]|=(this[s]&i)<<o,e[s-n]=this[s]>>r;r>0&&(e[this.t-n-1]|=(this.s&i)<<o),e.t=this.t-n,e.clamp()}},n.prototype.subTo=function(t,e){for(var n=0,r=0,o=Math.min(t.t,this.t);n<o;)r+=this[n]-t[n],e[n++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r-=t.s;n<this.t;)r+=this[n],e[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<t.t;)r-=t[n],e[n++]=r&this.DM,r>>=this.DB;r-=t.s}e.s=r<0?-1:0,r<-1?e[n++]=this.DV+r:r>0&&(e[n++]=r),e.t=n,e.clamp()},n.prototype.multiplyTo=function(t,e){var r=this.abs(),o=t.abs(),i=r.t;for(e.t=i+o.t;--i>=0;)e[i]=0;for(i=0;i<o.t;++i)e[i+r.t]=r.am(0,o[i],e,i,0,r.t);e.s=0,e.clamp(),this.s!=t.s&&n.ZERO.subTo(e,e)},n.prototype.squareTo=function(t){for(var e=this.abs(),n=t.t=2*e.t;--n>=0;)t[n]=0;for(n=0;n<e.t-1;++n){var r=e.am(n,e[n],t,2*n,0,1);(t[n+e.t]+=e.am(n+1,2*e[n],t,2*n+1,r,e.t-n-1))>=e.DV&&(t[n+e.t]-=e.DV,t[n+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(n,e[n],t,2*n,0,1)),t.s=0,t.clamp()},n.prototype.divRemTo=function(t,e,o){var i=t.abs();if(!(i.t<=0)){var s=this.abs();if(s.t<i.t)return null!=e&&e.fromInt(0),void(null!=o&&this.copyTo(o));null==o&&(o=r());var a=r(),u=this.s,c=t.s,p=this.DB-l(i[i.t-1]);p>0?(i.lShiftTo(p,a),s.lShiftTo(p,o)):(i.copyTo(a),s.copyTo(o));var f=a.t,d=a[f-1];if(0!=d){var h=d*(1<<this.F1)+(f>1?a[f-2]>>this.F2:0),g=this.FV/h,v=(1<<this.F1)/h,_=1<<this.F2,y=o.t,m=y-f,b=null==e?r():e;for(a.dlShiftTo(m,b),o.compareTo(b)>=0&&(o[o.t++]=1,o.subTo(b,o)),n.ONE.dlShiftTo(f,b),b.subTo(a,a);a.t<f;)a[a.t++]=0;for(;--m>=0;){var S=o[--y]==d?this.DM:Math.floor(o[y]*g+(o[y-1]+_)*v);if((o[y]+=a.am(0,S,o,m,0,f))<S)for(a.dlShiftTo(m,b),o.subTo(b,o);o[y]<--S;)o.subTo(b,o)}null!=e&&(o.drShiftTo(f,e),u!=c&&n.ZERO.subTo(e,e)),o.t=f,o.clamp(),p>0&&o.rShiftTo(p,o),u<0&&n.ZERO.subTo(o,o)}}},n.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},n.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},n.prototype.exp=function(t,e){if(t>4294967295||t<1)return n.ONE;var o=r(),i=r(),s=e.convert(this),a=l(t)-1;for(s.copyTo(o);--a>=0;)if(e.sqrTo(o,i),(t&1<<a)>0)e.mulTo(i,s,o);else{var u=o;o=i,i=u}return e.revert(o)},n.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var n,r=(1<<e)-1,o=!1,i="",s=this.t,a=this.DB-s*this.DB%e;if(s-- >0)for(a<this.DB&&(n=this[s]>>a)>0&&(o=!0,i=u(n));s>=0;)a<e?(n=(this[s]&(1<<a)-1)<<e-a,n|=this[--s]>>(a+=this.DB-e)):(n=this[s]>>(a-=e)&r,a<=0&&(a+=this.DB,--s)),n>0&&(o=!0),o&&(i+=u(n));return o?i:"0"},n.prototype.negate=function(){var t=r();return n.ZERO.subTo(this,t),t},n.prototype.abs=function(){return this.s<0?this.negate():this},n.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var n=this.t;if(0!=(e=n-t.t))return this.s<0?-e:e;for(;--n>=0;)if(0!=(e=this[n]-t[n]))return e;return 0},n.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+l(this[this.t-1]^this.s&this.DM)},n.prototype.mod=function(t){var e=r();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(n.ZERO)>0&&t.subTo(e,e),e},n.prototype.modPowInt=function(t,e){var n;return n=t<256||e.isEven()?new f(e):new d(e),this.exp(t,n)},n.ZERO=p(0),n.ONE=p(1),b.prototype.convert=S,b.prototype.revert=S,b.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n)},b.prototype.sqrTo=function(t,e){t.squareTo(e)},w.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=r();return t.copyTo(e),this.reduce(e),e},w.prototype.revert=function(t){return t},w.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},w.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},w.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var k,E,T,x=[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],O=(1<<26)/x[x.length-1];function R(){!function(t){E[T++]^=255&t,E[T++]^=t>>8&255,E[T++]^=t>>16&255,E[T++]^=t>>24&255,T>=M&&(T-=M)}((new Date).getTime())}if(n.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},n.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),n=Math.pow(t,e),o=p(n),i=r(),s=r(),a="";for(this.divRemTo(o,i,s);i.signum()>0;)a=(n+s.intValue()).toString(t).substr(1)+a,i.divRemTo(o,i,s);return s.intValue().toString(t)+a},n.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var r=this.chunkSize(e),o=Math.pow(e,r),i=!1,s=0,a=0,u=0;u<t.length;++u){var p=c(t,u);p<0?"-"==t.charAt(u)&&0==this.signum()&&(i=!0):(a=e*a+p,++s>=r&&(this.dMultiply(o),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(a,0)),i&&n.ZERO.subTo(this,this)},n.prototype.fromNumber=function(t,e,r){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(n.ONE.shiftLeft(t-1),g,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(n.ONE.shiftLeft(t-1),this);else{var o=new Array,i=7&t;o.length=1+(t>>3),e.nextBytes(o),i>0?o[0]&=(1<<i)-1:o[0]=0,this.fromString(o,256)}},n.prototype.bitwiseTo=function(t,e,n){var r,o,i=Math.min(t.t,this.t);for(r=0;r<i;++r)n[r]=e(this[r],t[r]);if(t.t<this.t){for(o=t.s&this.DM,r=i;r<this.t;++r)n[r]=e(this[r],o);n.t=this.t}else{for(o=this.s&this.DM,r=i;r<t.t;++r)n[r]=e(o,t[r]);n.t=t.t}n.s=e(this.s,t.s),n.clamp()},n.prototype.changeBit=function(t,e){var r=n.ONE.shiftLeft(t);return this.bitwiseTo(r,e,r),r},n.prototype.addTo=function(t,e){for(var n=0,r=0,o=Math.min(t.t,this.t);n<o;)r+=this[n]+t[n],e[n++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r+=t.s;n<this.t;)r+=this[n],e[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<t.t;)r+=t[n],e[n++]=r&this.DM,r>>=this.DB;r+=t.s}e.s=r<0?-1:0,r>0?e[n++]=r:r<-1&&(e[n++]=this.DV+r),e.t=n,e.clamp()},n.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},n.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},n.prototype.multiplyLowerTo=function(t,e,n){var r,o=Math.min(this.t+t.t,e);for(n.s=0,n.t=o;o>0;)n[--o]=0;for(r=n.t-this.t;o<r;++o)n[o+this.t]=this.am(0,t[o],n,o,0,this.t);for(r=Math.min(t.t,e);o<r;++o)this.am(0,t[o],n,o,0,e-o);n.clamp()},n.prototype.multiplyUpperTo=function(t,e,n){--e;var r=n.t=this.t+t.t-e;for(n.s=0;--r>=0;)n[r]=0;for(r=Math.max(e-this.t,0);r<t.t;++r)n[this.t+r-e]=this.am(e-r,t[r],n,0,0,this.t+r-e);n.clamp(),n.drShiftTo(1,n)},n.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,n=this.s<0?t-1:0;if(this.t>0)if(0==e)n=this[0]%t;else for(var r=this.t-1;r>=0;--r)n=(e*n+this[r])%t;return n},n.prototype.millerRabin=function(t){var e=this.subtract(n.ONE),o=e.getLowestSetBit();if(o<=0)return!1;var i=e.shiftRight(o);(t=t+1>>1)>x.length&&(t=x.length);for(var s=r(),a=0;a<t;++a){s.fromInt(x[Math.floor(Math.random()*x.length)]);var u=s.modPow(i,this);if(0!=u.compareTo(n.ONE)&&0!=u.compareTo(e)){for(var c=1;c++<o&&0!=u.compareTo(e);)if(0==(u=u.modPowInt(2,this)).compareTo(n.ONE))return!1;if(0!=u.compareTo(e))return!1}}return!0},n.prototype.clone=function(){var t=r();return this.copyTo(t),t},n.prototype.intValue=function(){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]},n.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},n.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},n.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},n.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var n,r=this.DB-t*this.DB%8,o=0;if(t-- >0)for(r<this.DB&&(n=this[t]>>r)!=(this.s&this.DM)>>r&&(e[o++]=n|this.s<<this.DB-r);t>=0;)r<8?(n=(this[t]&(1<<r)-1)<<8-r,n|=this[--t]>>(r+=this.DB-8)):(n=this[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),0!=(128&n)&&(n|=-256),0==o&&(128&this.s)!=(128&n)&&++o,(o>0||n!=this.s)&&(e[o++]=n);return e},n.prototype.equals=function(t){return 0==this.compareTo(t)},n.prototype.min=function(t){return this.compareTo(t)<0?this:t},n.prototype.max=function(t){return this.compareTo(t)>0?this:t},n.prototype.and=function(t){var e=r();return this.bitwiseTo(t,h,e),e},n.prototype.or=function(t){var e=r();return this.bitwiseTo(t,g,e),e},n.prototype.xor=function(t){var e=r();return this.bitwiseTo(t,v,e),e},n.prototype.andNot=function(t){var e=r();return this.bitwiseTo(t,_,e),e},n.prototype.not=function(){for(var t=r(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},n.prototype.shiftLeft=function(t){var e=r();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},n.prototype.shiftRight=function(t){var e=r();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},n.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+y(this[t]);return this.s<0?this.t*this.DB:-1},n.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,n=0;n<this.t;++n)t+=m(this[n]^e);return t},n.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)},n.prototype.setBit=function(t){return this.changeBit(t,g)},n.prototype.clearBit=function(t){return this.changeBit(t,_)},n.prototype.flipBit=function(t){return this.changeBit(t,v)},n.prototype.add=function(t){var e=r();return this.addTo(t,e),e},n.prototype.subtract=function(t){var e=r();return this.subTo(t,e),e},n.prototype.multiply=function(t){var e=r();return this.multiplyTo(t,e),e},n.prototype.divide=function(t){var e=r();return this.divRemTo(t,e,null),e},n.prototype.remainder=function(t){var e=r();return this.divRemTo(t,null,e),e},n.prototype.divideAndRemainder=function(t){var e=r(),n=r();return this.divRemTo(t,e,n),new Array(e,n)},n.prototype.modPow=function(t,e){var n,o,i=t.bitLength(),s=p(1);if(i<=0)return s;n=i<18?1:i<48?3:i<144?4:i<768?5:6,o=i<8?new f(e):e.isEven()?new w(e):new d(e);var a=new Array,u=3,c=n-1,h=(1<<n)-1;if(a[1]=o.convert(this),n>1){var g=r();for(o.sqrTo(a[1],g);u<=h;)a[u]=r(),o.mulTo(g,a[u-2],a[u]),u+=2}var v,_,y=t.t-1,m=!0,b=r();for(i=l(t[y])-1;y>=0;){for(i>=c?v=t[y]>>i-c&h:(v=(t[y]&(1<<i+1)-1)<<c-i,y>0&&(v|=t[y-1]>>this.DB+i-c)),u=n;0==(1&v);)v>>=1,--u;if((i-=u)<0&&(i+=this.DB,--y),m)a[v].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[v],s)}for(;y>=0&&0==(t[y]&1<<i);)o.sqrTo(s,b),_=s,s=b,b=_,--i<0&&(i=this.DB-1,--y)}return o.revert(s)},n.prototype.modInverse=function(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return n.ZERO;for(var r=t.clone(),o=this.clone(),i=p(1),s=p(0),a=p(0),u=p(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),e?(i.isEven()&&s.isEven()||(i.addTo(this,i),s.subTo(t,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;o.isEven();)o.rShiftTo(1,o),e?(a.isEven()&&u.isEven()||(a.addTo(this,a),u.subTo(t,u)),a.rShiftTo(1,a)):u.isEven()||u.subTo(t,u),u.rShiftTo(1,u);r.compareTo(o)>=0?(r.subTo(o,r),e&&i.subTo(a,i),s.subTo(u,s)):(o.subTo(r,o),e&&a.subTo(i,a),u.subTo(s,u))}return 0!=o.compareTo(n.ONE)?n.ZERO:u.compareTo(t)>=0?u.subtract(t):u.signum()<0?(u.addTo(t,u),u.signum()<0?u.add(t):u):u},n.prototype.pow=function(t){return this.exp(t,new b)},n.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),n=t.s<0?t.negate():t.clone();if(e.compareTo(n)<0){var r=e;e=n,n=r}var o=e.getLowestSetBit(),i=n.getLowestSetBit();if(i<0)return e;for(o<i&&(i=o),i>0&&(e.rShiftTo(i,e),n.rShiftTo(i,n));e.signum()>0;)(o=e.getLowestSetBit())>0&&e.rShiftTo(o,e),(o=n.getLowestSetBit())>0&&n.rShiftTo(o,n),e.compareTo(n)>=0?(e.subTo(n,e),e.rShiftTo(1,e)):(n.subTo(e,n),n.rShiftTo(1,n));return i>0&&n.lShiftTo(i,n),n},n.prototype.isProbablePrime=function(t){var e,n=this.abs();if(1==n.t&&n[0]<=x[x.length-1]){for(e=0;e<x.length;++e)if(n[0]==x[e])return!0;return!1}if(n.isEven())return!1;for(e=1;e<x.length;){for(var r=x[e],o=e+1;o<x.length&&r<O;)r*=x[o++];for(r=n.modInt(r);e<o;)if(r%x[e++]==0)return!1}return n.millerRabin(t)},n.prototype.square=function(){var t=r();return this.squareTo(t),t},n.prototype.Barrett=w,null==E){var C;if(E=new Array,T=0,"undefined"!=typeof window&&window.crypto)if(window.crypto.getRandomValues){var P=new Uint8Array(32);for(window.crypto.getRandomValues(P),C=0;C<32;++C)E[T++]=P[C]}else if("Netscape"==navigator.appName&&navigator.appVersion<"5"){var L=window.crypto.random(32);for(C=0;C<L.length;++C)E[T++]=255&L.charCodeAt(C)}for(;T<M;)C=Math.floor(65536*Math.random()),E[T++]=C>>>8,E[T++]=255&C;T=0,R()}function U(){if(null==k){for(R(),(k=new I).init(E),T=0;T<E.length;++T)E[T]=0;T=0}return k.next()}function j(){}function I(){this.i=0,this.j=0,this.S=new Array}j.prototype.nextBytes=function(t){var e;for(e=0;e<t.length;++e)t[e]=U()},I.prototype.init=function(t){var e,n,r;for(e=0;e<256;++e)this.S[e]=e;for(n=0,e=0;e<256;++e)n=n+this.S[e]+t[e%t.length]&255,r=this.S[e],this.S[e]=this.S[n],this.S[n]=r;this.i=0,this.j=0},I.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]};var M=256;t.exports={default:n,BigInteger:n,SecureRandom:j}}).call(this)},function(t,e,n){var r;t.exports=(r=n(119),function(t){var e=r,n=e.lib,o=n.WordArray,i=n.Hasher,s=e.algo,a=[],u=[];!function(){function e(e){for(var n=t.sqrt(e),r=2;r<=n;r++)if(!(e%r))return!1;return!0}function n(t){return 4294967296*(t-(0|t))|0}for(var r=2,o=0;o<64;)e(r)&&(o<8&&(a[o]=n(t.pow(r,.5))),u[o]=n(t.pow(r,1/3)),o++),r++}();var c=[],p=s.SHA256=i.extend({_doReset:function(){this._hash=new o.init(a.slice(0))},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],s=n[3],a=n[4],p=n[5],l=n[6],f=n[7],d=0;d<64;d++){if(d<16)c[d]=0|t[e+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=r&o^r&i^o&i,m=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),b=f+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&p^~a&l)+u[d]+c[d];f=l,l=p,p=a,a=s+b|0,s=i,i=o,o=r,r=b+(m+y)|0}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+s|0,n[4]=n[4]+a|0,n[5]=n[5]+p|0,n[6]=n[6]+l|0,n[7]=n[7]+f|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,o=8*e.sigBytes;return n[o>>>5]|=128<<24-o%32,n[14+(o+64>>>9<<4)]=t.floor(r/4294967296),n[15+(o+64>>>9<<4)]=r,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=i._createHelper(p),e.HmacSHA256=i._createHmacHelper(p)}(Math),r.SHA256)},function(t,e,n){var r;t.exports=(r=r||function(t,e){var n=Object.create||function(){function t(){}return function(e){var n;return t.prototype=e,n=new t,t.prototype=null,n}}(),r={},o=r.lib={},i=o.Base={extend:function(t){var e=n(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},s=o.WordArray=i.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||u).stringify(this)},concat:function(t){var e=this.words,n=t.words,r=this.sigBytes,o=t.sigBytes;if(this.clamp(),r%4)for(var i=0;i<o;i++){var s=n[i>>>2]>>>24-i%4*8&255;e[r+i>>>2]|=s<<24-(r+i)%4*8}else for(i=0;i<o;i+=4)e[r+i>>>2]=n[i>>>2];return this.sigBytes+=o,this},clamp:function(){var e=this.words,n=this.sigBytes;e[n>>>2]&=4294967295<<32-n%4*8,e.length=t.ceil(n/4)},clone:function(){var t=i.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var n,r=[],o=function(e){var n=987654321,r=4294967295;return function(){var o=((n=36969*(65535&n)+(n>>16)&r)<<16)+(e=18e3*(65535&e)+(e>>16)&r)&r;return o/=4294967296,(o+=.5)*(t.random()>.5?1:-1)}},i=0;i<e;i+=4){var a=o(4294967296*(n||t.random()));n=987654071*a(),r.push(4294967296*a()|0)}return new s.init(r,e)}}),a=r.enc={},u=a.Hex={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],o=0;o<n;o++){var i=e[o>>>2]>>>24-o%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r+=2)n[r>>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new s.init(n,e/2)}},c=a.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],o=0;o<n;o++){var i=e[o>>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r++)n[r>>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new s.init(n,e)}},p=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},l=o.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var n=this._data,r=n.words,o=n.sigBytes,i=this.blockSize,a=o/(4*i),u=(a=e?t.ceil(a):t.max((0|a)-this._minBufferSize,0))*i,c=t.min(4*u,o);if(u){for(var p=0;p<u;p+=i)this._doProcessBlock(r,p);var l=r.splice(0,u);n.sigBytes-=c}return new s.init(l,c)},clone:function(){var t=i.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),f=(o.Hasher=l.extend({cfg:i.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){l.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,n){return new t.init(n).finalize(e)}},_createHmacHelper:function(t){return function(e,n){return new f.HMAC.init(t,n).finalize(e)}}}),r.algo={});return r}(Math),r)},function(t,e,n){"use strict";e.byteLength=function(t){var e=c(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){for(var e,n=c(t),r=n[0],s=n[1],a=new i(function(t,e,n){return 3*(e+n)/4-n}(0,r,s)),u=0,p=s>0?r-4:r,l=0;l<p;l+=4)e=o[t.charCodeAt(l)]<<18|o[t.charCodeAt(l+1)]<<12|o[t.charCodeAt(l+2)]<<6|o[t.charCodeAt(l+3)],a[u++]=e>>16&255,a[u++]=e>>8&255,a[u++]=255&e;return 2===s&&(e=o[t.charCodeAt(l)]<<2|o[t.charCodeAt(l+1)]>>4,a[u++]=255&e),1===s&&(e=o[t.charCodeAt(l)]<<10|o[t.charCodeAt(l+1)]<<4|o[t.charCodeAt(l+2)]>>2,a[u++]=e>>8&255,a[u++]=255&e),a},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],s=0,a=n-o;s<a;s+=16383)i.push(p(t,s,s+16383>a?a:s+16383));return 1===o?(e=t[n-1],i.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],i.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)r[a]=s[a],o[s.charCodeAt(a)]=a;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function p(t,e,n){for(var o,i,s=[],a=e;a<n;a+=3)o=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=t.jws,n=t.KeyUtil,o=t.X509,i=t.crypto,s=t.hextob64u,a=t.b64tohex,u=t.AllowedSigningAlgs;return function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.parseJwt=function t(n){r.Log.debug("JoseUtil.parseJwt");try{var o=e.JWS.parse(n);return{header:o.headerObj,payload:o.payloadObj}}catch(t){r.Log.error(t)}},t.validateJwt=function(e,i,s,u,c,p,l){r.Log.debug("JoseUtil.validateJwt");try{if("RSA"===i.kty)if(i.e&&i.n)i=n.getKey(i);else{if(!i.x5c||!i.x5c.length)return r.Log.error("JoseUtil.validateJwt: RSA key missing key material",i),Promise.reject(new Error("RSA key missing key material"));var f=a(i.x5c[0]);i=o.getPublicKeyFromCertHex(f)}else{if("EC"!==i.kty)return r.Log.error("JoseUtil.validateJwt: Unsupported key type",i&&i.kty),Promise.reject(new Error(i.kty));if(!(i.crv&&i.x&&i.y))return r.Log.error("JoseUtil.validateJwt: EC key missing key material",i),Promise.reject(new Error("EC key missing key material"));i=n.getKey(i)}return t._validateJwt(e,i,s,u,c,p,l)}catch(t){return r.Log.error(t&&t.message||t),Promise.reject("JWT validation failed")}},t.validateJwtAttributes=function(e,n,o,i,s,a){i||(i=0),s||(s=parseInt(Date.now()/1e3));var u=t.parseJwt(e).payload;if(!u.iss)return r.Log.error("JoseUtil._validateJwt: issuer was not provided"),Promise.reject(new Error("issuer was not provided"));if(u.iss!==n)return r.Log.error("JoseUtil._validateJwt: Invalid issuer in token",u.iss),Promise.reject(new Error("Invalid issuer in token: "+u.iss));if(!u.aud)return r.Log.error("JoseUtil._validateJwt: aud was not provided"),Promise.reject(new Error("aud was not provided"));if(!(u.aud===o||Array.isArray(u.aud)&&u.aud.indexOf(o)>=0))return r.Log.error("JoseUtil._validateJwt: Invalid audience in token",u.aud),Promise.reject(new Error("Invalid audience in token: "+u.aud));if(u.azp&&u.azp!==o)return r.Log.error("JoseUtil._validateJwt: Invalid azp in token",u.azp),Promise.reject(new Error("Invalid azp in token: "+u.azp));if(!a){var c=s+i,p=s-i;if(!u.iat)return r.Log.error("JoseUtil._validateJwt: iat was not provided"),Promise.reject(new Error("iat was not provided"));if(c<u.iat)return r.Log.error("JoseUtil._validateJwt: iat is in the future",u.iat),Promise.reject(new Error("iat is in the future: "+u.iat));if(u.nbf&&c<u.nbf)return r.Log.error("JoseUtil._validateJwt: nbf is in the future",u.nbf),Promise.reject(new Error("nbf is in the future: "+u.nbf));if(!u.exp)return r.Log.error("JoseUtil._validateJwt: exp was not provided"),Promise.reject(new Error("exp was not provided"));if(u.exp<p)return r.Log.error("JoseUtil._validateJwt: exp is in the past",u.exp),Promise.reject(new Error("exp is in the past:"+u.exp))}return Promise.resolve(u)},t._validateJwt=function(n,o,i,s,a,c,p){return t.validateJwtAttributes(n,i,s,a,c,p).then((function(t){try{return e.JWS.verify(n,o,u)?t:(r.Log.error("JoseUtil._validateJwt: signature validation failed"),Promise.reject(new Error("signature validation failed")))}catch(t){return r.Log.error(t&&t.message||t),Promise.reject(new Error("signature validation failed"))}}))},t.hashString=function t(e,n){try{return i.Util.hashString(e,n)}catch(t){r.Log.error(t)}},t.hexToBase64Url=function t(e){try{return s(e)}catch(t){r.Log.error(t)}},t}()};var r=n(0);t.exports=e.default},function(t,e,n){var r=n(123),o=n(124);t.exports=function(t,e,n){var i=e&&n||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var s=(t=t||{}).random||(t.rng||r)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,e)for(var a=0;a<16;++a)e[i+a]=s[a];return e||o(s)}},function(t,e){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);t.exports=function(){return n(r),r}}else{var o=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),o[e]=t>>>((3&e)<<3)&255;return o}}},function(t,e){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);t.exports=function(t,e){var r=e||0,o=n;return[o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]]].join("")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SigninResponse=void 0;var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(16);e.SigninResponse=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var r=o.UrlUtility.parseUrlFragment(e,n);this.error=r.error,this.error_description=r.error_description,this.error_uri=r.error_uri,this.code=r.code,this.state=r.state,this.id_token=r.id_token,this.session_state=r.session_state,this.access_token=r.access_token,this.token_type=r.token_type,this.scope=r.scope,this.profile=void 0,this.expires_in=r.expires_in}return r(t,[{key:"expires_in",get:function(){if(this.expires_at){var t=parseInt(Date.now()/1e3);return this.expires_at-t}},set:function(t){var e=parseInt(t);if("number"==typeof e&&e>0){var n=parseInt(Date.now()/1e3);this.expires_at=n+e}}},{key:"expired",get:function(){var t=this.expires_in;if(void 0!==t)return t<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}},{key:"isOpenIdConnect",get:function(){return this.scopes.indexOf("openid")>=0||!!this.id_token}}]),t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SignoutRequest=void 0;var r=n(0),o=n(16),i=n(38);e.SignoutRequest=function t(e){var n=e.url,s=e.id_token_hint,a=e.post_logout_redirect_uri,u=e.data,c=e.extraQueryParams,p=e.request_type;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!n)throw r.Log.error("SignoutRequest.ctor: No url passed"),new Error("url");for(var l in s&&(n=o.UrlUtility.addQueryParam(n,"id_token_hint",s)),a&&(n=o.UrlUtility.addQueryParam(n,"post_logout_redirect_uri",a),u&&(this.state=new i.State({data:u,request_type:p}),n=o.UrlUtility.addQueryParam(n,"state",this.state.id))),c)n=o.UrlUtility.addQueryParam(n,l,c[l]);this.url=n}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SignoutResponse=void 0;var r=n(16);e.SignoutResponse=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=r.UrlUtility.parseUrlFragment(e,"?");this.error=n.error,this.error_description=n.error_description,this.error_uri=n.error_uri,this.state=n.state}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InMemoryWebStorage=void 0;var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(0);e.InMemoryWebStorage=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._data={}}return t.prototype.getItem=function(t){return o.Log.debug("InMemoryWebStorage.getItem",t),this._data[t]},t.prototype.setItem=function(t,e){o.Log.debug("InMemoryWebStorage.setItem",t),this._data[t]=e},t.prototype.removeItem=function(t){o.Log.debug("InMemoryWebStorage.removeItem",t),delete this._data[t]},t.prototype.key=function(t){return Object.getOwnPropertyNames(this._data)[t]},r(t,[{key:"length",get:function(){return Object.getOwnPropertyNames(this._data).length}}]),t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserManager=void 0;var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(0),i=n(49),s=n(130),a=n(55),u=n(136),c=n(138),p=n(58),l=n(60),f=n(50),d=n(20);e.UserManager=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c.SilentRenewService,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p.SessionMonitor,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.TokenRevocationClient,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:f.TokenClient,g=arguments.length>5&&void 0!==arguments[5]?arguments[5]:d.JoseUtil;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n instanceof s.UserManagerSettings||(n=new s.UserManagerSettings(n));var v=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n));return v._events=new u.UserManagerEvents(n),v._silentRenewService=new r(v),v.settings.automaticSilentRenew&&(o.Log.debug("UserManager.ctor: automaticSilentRenew is configured, setting up silent renew"),v.startSilentRenew()),v.settings.monitorSession&&(o.Log.debug("UserManager.ctor: monitorSession is configured, setting up session monitor"),v._sessionMonitor=new i(v)),v._tokenRevocationClient=new a(v._settings),v._tokenClient=new h(v._settings),v._joseUtil=g,v}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.getUser=function(){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)}))},e.prototype.removeUser=function(){var t=this;return this.storeUser(null).then((function(){o.Log.info("UserManager.removeUser: user removed from storage"),t._events.unload()}))},e.prototype.signinRedirect=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="si:r";var e={useReplaceToNavigate:t.useReplaceToNavigate};return this._signinStart(t,this._redirectNavigator,e).then((function(){o.Log.info("UserManager.signinRedirect: successful")}))},e.prototype.signinRedirectCallback=function(t){return this._signinEnd(t||this._redirectNavigator.url).then((function(t){return t.profile&&t.profile.sub?o.Log.info("UserManager.signinRedirectCallback: successful, signed in sub: ",t.profile.sub):o.Log.info("UserManager.signinRedirectCallback: no sub"),t}))},e.prototype.signinPopup=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="si:p";var e=t.redirect_uri||this.settings.popup_redirect_uri||this.settings.redirect_uri;return e?(t.redirect_uri=e,t.display="popup",this._signin(t,this._popupNavigator,{startUrl:e,popupWindowFeatures:t.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:t.popupWindowTarget||this.settings.popupWindowTarget}).then((function(t){return t&&(t.profile&&t.profile.sub?o.Log.info("UserManager.signinPopup: signinPopup successful, signed in sub: ",t.profile.sub):o.Log.info("UserManager.signinPopup: no sub")),t}))):(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")))},e.prototype.signinPopupCallback=function(t){return this._signinCallback(t,this._popupNavigator).then((function(t){return t&&(t.profile&&t.profile.sub?o.Log.info("UserManager.signinPopupCallback: successful, signed in sub: ",t.profile.sub):o.Log.info("UserManager.signinPopupCallback: no sub")),t})).catch((function(t){o.Log.error(t.message)}))},e.prototype.signinSilent=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(e=Object.assign({},e)).request_type="si:s",this._loadUser().then((function(n){return n&&n.refresh_token?(e.refresh_token=n.refresh_token,t._useRefreshToken(e)):(e.id_token_hint=e.id_token_hint||t.settings.includeIdTokenInSilentRenew&&n&&n.id_token,n&&t._settings.validateSubOnSilentRenew&&(o.Log.debug("UserManager.signinSilent, subject prior to silent renew: ",n.profile.sub),e.current_sub=n.profile.sub),t._signinSilentIframe(e))}))},e.prototype._useRefreshToken=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._tokenClient.exchangeRefreshToken(e).then((function(e){return e?e.access_token?t._loadUser().then((function(n){if(n){var r=Promise.resolve();return e.id_token&&(r=t._validateIdTokenFromTokenRefreshToken(n.profile,e.id_token)),r.then((function(){return o.Log.debug("UserManager._useRefreshToken: refresh token response success"),n.id_token=e.id_token,n.access_token=e.access_token,n.refresh_token=e.refresh_token||n.refresh_token,n.expires_in=e.expires_in,t.storeUser(n).then((function(){return t._events.load(n),n}))}))}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"))}))},e.prototype._validateIdTokenFromTokenRefreshToken=function(t,e){var n=this;return this._metadataService.getIssuer().then((function(r){return n._joseUtil.validateJwtAttributes(e,r,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")))}))}))},e.prototype._signinSilentIframe=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return e?(t.redirect_uri=e,t.prompt=t.prompt||"none",this._signin(t,this._iframeNavigator,{startUrl:e,silentRequestTimeout:t.silentRequestTimeout||this.settings.silentRequestTimeout}).then((function(t){return t&&(t.profile&&t.profile.sub?o.Log.info("UserManager.signinSilent: successful, signed in sub: ",t.profile.sub):o.Log.info("UserManager.signinSilent: no sub")),t}))):(o.Log.error("UserManager.signinSilent: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},e.prototype.signinSilentCallback=function(t){return this._signinCallback(t,this._iframeNavigator).then((function(t){return t&&(t.profile&&t.profile.sub?o.Log.info("UserManager.signinSilentCallback: successful, signed in sub: ",t.profile.sub):o.Log.info("UserManager.signinSilentCallback: no sub")),t}))},e.prototype.signinCallback=function(t){var e=this;return this.readSigninResponseState(t).then((function(n){var r=n.state;return n.response,"si:r"===r.request_type?e.signinRedirectCallback(t):"si:p"===r.request_type?e.signinPopupCallback(t):"si:s"===r.request_type?e.signinSilentCallback(t):Promise.reject(new Error("invalid response_type in state"))}))},e.prototype.signoutCallback=function(t,e){var n=this;return this.readSignoutResponseState(t).then((function(r){var o=r.state,i=r.response;return o?"so:r"===o.request_type?n.signoutRedirectCallback(t):"so:p"===o.request_type?n.signoutPopupCallback(t,e):Promise.reject(new Error("invalid response_type in state")):i}))},e.prototype.querySessionStatus=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="si:s";var n=e.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return n?(e.redirect_uri=n,e.prompt="none",e.response_type=e.response_type||this.settings.query_status_response_type,e.scope=e.scope||"openid",e.skipUserInfo=!0,this._signinStart(e,this._iframeNavigator,{startUrl:n,silentRequestTimeout:e.silentRequestTimeout||this.settings.silentRequestTimeout}).then((function(e){return t.processSigninResponse(e.url).then((function(t){if(o.Log.debug("UserManager.querySessionStatus: got signin response"),t.session_state&&t.profile.sub)return o.Log.info("UserManager.querySessionStatus: querySessionStatus success for sub: ",t.profile.sub),{session_state:t.session_state,sub:t.profile.sub,sid:t.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")))},e.prototype._signin=function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signinStart(t,e,r).then((function(e){return n._signinEnd(e.url,t)}))},e.prototype._signinStart=function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.prepare(r).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"),r.url=t.url,r.id=t.state.id,e.navigate(r)})).catch((function(t){throw e.close&&(o.Log.debug("UserManager._signinStart: Error after preparing navigator, closing navigator window"),e.close()),t}))}))},e.prototype._signinEnd=function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.processSigninResponse(t).then((function(t){o.Log.debug("UserManager._signinEnd: got signin response");var r=new a.User(t);if(n.current_sub){if(n.current_sub!==r.profile.sub)return o.Log.debug("UserManager._signinEnd: current user does not match user returned from signin. sub from signin: ",r.profile.sub),Promise.reject(new Error("login_required"));o.Log.debug("UserManager._signinEnd: current user matches user returned from signin")}return e.storeUser(r).then((function(){return o.Log.debug("UserManager._signinEnd: user stored"),e._events.load(r),r}))}))},e.prototype._signinCallback=function(t,e){return o.Log.debug("UserManager._signinCallback"),e.callback(t)},e.prototype.signoutRedirect=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="so:r";var e=t.post_logout_redirect_uri||this.settings.post_logout_redirect_uri;e&&(t.post_logout_redirect_uri=e);var n={useReplaceToNavigate:t.useReplaceToNavigate};return this._signoutStart(t,this._redirectNavigator,n).then((function(){o.Log.info("UserManager.signoutRedirect: successful")}))},e.prototype.signoutRedirectCallback=function(t){return this._signoutEnd(t||this._redirectNavigator.url).then((function(t){return o.Log.info("UserManager.signoutRedirectCallback: successful"),t}))},e.prototype.signoutPopup=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="so:p";var e=t.post_logout_redirect_uri||this.settings.popup_post_logout_redirect_uri||this.settings.post_logout_redirect_uri;return t.post_logout_redirect_uri=e,t.display="popup",t.post_logout_redirect_uri&&(t.state=t.state||{}),this._signout(t,this._popupNavigator,{startUrl:e,popupWindowFeatures:t.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:t.popupWindowTarget||this.settings.popupWindowTarget}).then((function(){o.Log.info("UserManager.signoutPopup: successful")}))},e.prototype.signoutPopupCallback=function(t,e){return void 0===e&&"boolean"==typeof t&&(e=t,t=null),this._popupNavigator.callback(t,e,"?").then((function(){o.Log.info("UserManager.signoutPopupCallback: successful")}))},e.prototype._signout=function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signoutStart(t,e,r).then((function(t){return n._signoutEnd(t.url)}))},e.prototype._signoutStart=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this,n=arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.prepare(r).then((function(n){return o.Log.debug("UserManager._signoutStart: got navigator window handle"),e._loadUser().then((function(i){return o.Log.debug("UserManager._signoutStart: loaded current user from storage"),(e._settings.revokeAccessTokenOnSignout?e._revokeInternal(i):Promise.resolve()).then((function(){var s=t.id_token_hint||i&&i.id_token;return s&&(o.Log.debug("UserManager._signoutStart: Setting id_token into signout request"),t.id_token_hint=s),e.removeUser().then((function(){return o.Log.debug("UserManager._signoutStart: user removed, creating signout request"),e.createSignoutRequest(t).then((function(t){return o.Log.debug("UserManager._signoutStart: got signout request"),r.url=t.url,t.state&&(r.id=t.state.id),n.navigate(r)}))}))}))})).catch((function(t){throw n.close&&(o.Log.debug("UserManager._signoutStart: Error after preparing navigator, closing navigator window"),n.close()),t}))}))},e.prototype._signoutEnd=function(t){return this.processSignoutResponse(t).then((function(t){return o.Log.debug("UserManager._signoutEnd: got signout response"),t}))},e.prototype.revokeAccessToken=function(){var t=this;return this._loadUser().then((function(e){return t._revokeInternal(e,!0).then((function(n){if(n)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")}))},e.prototype._revokeInternal=function(t,e){var n=this;if(t){var r=t.access_token,i=t.refresh_token;return this._revokeAccessTokenInternal(r,e).then((function(t){return n._revokeRefreshTokenInternal(i,e).then((function(e){return t||e||o.Log.debug("UserManager.revokeAccessToken: no need to revoke due to no token(s), or JWT format"),t||e}))}))}return Promise.resolve(!1)},e.prototype._revokeAccessTokenInternal=function(t,e){return!t||t.indexOf(".")>=0?Promise.resolve(!1):this._tokenRevocationClient.revoke(t,e).then((function(){return!0}))},e.prototype._revokeRefreshTokenInternal=function(t,e){return t?this._tokenRevocationClient.revoke(t,e,"refresh_token").then((function(){return!0})):Promise.resolve(!1)},e.prototype.startSilentRenew=function(){this._silentRenewService.start()},e.prototype.stopSilentRenew=function(){this._silentRenewService.stop()},e.prototype._loadUser=function(){return this._userStore.get(this._userStoreKey).then((function(t){return t?(o.Log.debug("UserManager._loadUser: user storageString loaded"),a.User.fromStorageString(t)):(o.Log.debug("UserManager._loadUser: no user storageString"),null)}))},e.prototype.storeUser=function(t){if(t){o.Log.debug("UserManager.storeUser: storing user");var e=t.toStorageString();return this._userStore.set(this._userStoreKey,e)}return o.Log.debug("storeUser.storeUser: removing user"),this._userStore.remove(this._userStoreKey)},r(e,[{key:"_redirectNavigator",get:function(){return this.settings.redirectNavigator}},{key:"_popupNavigator",get:function(){return this.settings.popupNavigator}},{key:"_iframeNavigator",get:function(){return this.settings.iframeNavigator}},{key:"_userStore",get:function(){return this.settings.userStore}},{key:"events",get:function(){return this._events}},{key:"_userStoreKey",get:function(){return"user:"+this.settings.authority+":"+this.settings.client_id}}]),e}(i.OidcClient)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserManagerSettings=void 0;var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=(n(0),n(35)),i=n(131),s=n(132),a=n(134),u=n(36),c=n(4),p=n(52);e.UserManagerSettings=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.popup_redirect_uri,o=n.popup_post_logout_redirect_uri,l=n.popupWindowFeatures,f=n.popupWindowTarget,d=n.silent_redirect_uri,h=n.silentRequestTimeout,g=n.automaticSilentRenew,v=void 0!==g&&g,_=n.validateSubOnSilentRenew,y=void 0!==_&&_,m=n.includeIdTokenInSilentRenew,b=void 0===m||m,S=n.monitorSession,w=void 0===S||S,k=n.monitorAnonymousSession,E=void 0!==k&&k,T=n.checkSessionInterval,x=void 0===T?2e3:T,O=n.stopCheckSessionOnError,R=void 0===O||O,C=n.query_status_response_type,P=n.revokeAccessTokenOnSignout,L=void 0!==P&&P,U=n.accessTokenExpiringNotificationTime,j=void 0===U?60:U,I=n.redirectNavigator,M=void 0===I?new i.RedirectNavigator:I,A=n.popupNavigator,N=void 0===A?new s.PopupNavigator:A,D=n.iframeNavigator,q=void 0===D?new a.IFrameNavigator:D,W=n.userStore,F=void 0===W?new u.WebStorageStateStore({store:c.Global.sessionStorage}):W;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var B=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,arguments[0]));return B._popup_redirect_uri=r,B._popup_post_logout_redirect_uri=o,B._popupWindowFeatures=l,B._popupWindowTarget=f,B._silent_redirect_uri=d,B._silentRequestTimeout=h,B._automaticSilentRenew=v,B._validateSubOnSilentRenew=y,B._includeIdTokenInSilentRenew=b,B._accessTokenExpiringNotificationTime=j,B._monitorSession=w,B._monitorAnonymousSession=E,B._checkSessionInterval=x,B._stopCheckSessionOnError=R,C?B._query_status_response_type=C:arguments[0]&&arguments[0].response_type?B._query_status_response_type=p.SigninRequest.isOidc(arguments[0].response_type)?"id_token":"code":B._query_status_response_type="id_token",B._revokeAccessTokenOnSignout=L,B._redirectNavigator=M,B._popupNavigator=N,B._iframeNavigator=q,B._userStore=F,B}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),r(e,[{key:"popup_redirect_uri",get:function(){return this._popup_redirect_uri}},{key:"popup_post_logout_redirect_uri",get:function(){return this._popup_post_logout_redirect_uri}},{key:"popupWindowFeatures",get:function(){return this._popupWindowFeatures}},{key:"popupWindowTarget",get:function(){return this._popupWindowTarget}},{key:"silent_redirect_uri",get:function(){return this._silent_redirect_uri}},{key:"silentRequestTimeout",get:function(){return this._silentRequestTimeout}},{key:"automaticSilentRenew",get:function(){return this._automaticSilentRenew}},{key:"validateSubOnSilentRenew",get:function(){return this._validateSubOnSilentRenew}},{key:"includeIdTokenInSilentRenew",get:function(){return this._includeIdTokenInSilentRenew}},{key:"accessTokenExpiringNotificationTime",get:function(){return this._accessTokenExpiringNotificationTime}},{key:"monitorSession",get:function(){return this._monitorSession}},{key:"monitorAnonymousSession",get:function(){return this._monitorAnonymousSession}},{key:"checkSessionInterval",get:function(){return this._checkSessionInterval}},{key:"stopCheckSessionOnError",get:function(){return this._stopCheckSessionOnError}},{key:"query_status_response_type",get:function(){return this._query_status_response_type}},{key:"revokeAccessTokenOnSignout",get:function(){return this._revokeAccessTokenOnSignout}},{key:"redirectNavigator",get:function(){return this._redirectNavigator}},{key:"popupNavigator",get:function(){return this._popupNavigator}},{key:"iframeNavigator",get:function(){return this._iframeNavigator}},{key:"userStore",get:function(){return this._userStore}}]),e}(o.OidcClientSettings)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RedirectNavigator=void 0;var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(0);e.RedirectNavigator=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.prepare=function(){return Promise.resolve(this)},t.prototype.navigate=function(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")))},r(t,[{key:"url",get:function(){return window.location.href}}]),t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PopupNavigator=void 0;var r=n(0),o=n(133);e.PopupNavigator=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.prepare=function(t){var e=new o.PopupWindow(t);return Promise.resolve(e)},t.prototype.callback=function t(e,n,i){r.Log.debug("PopupNavigator.callback");try{return o.PopupWindow.notifyOpener(e,n,i),Promise.resolve()}catch(t){return Promise.reject(t)}},t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PopupWindow=void 0;var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(0),i=n(16);e.PopupWindow=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._promise=new Promise((function(t,e){n._resolve=t,n._reject=e}));var r=e.popupWindowTarget||"_blank",i=e.popupWindowFeatures||"location=no,toolbar=no,width=500,height=500,left=100,top=100;";this._popup=window.open("",r,i),this._popup&&(o.Log.debug("PopupWindow.ctor: popup successfully created"),this._checkForPopupClosedTimer=window.setInterval(this._checkForPopupClosed.bind(this),500))}return t.prototype.navigate=function(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},t.prototype._success=function(t){o.Log.debug("PopupWindow.callback: Successful response from popup window"),this._cleanup(),this._resolve(t)},t.prototype._error=function(t){o.Log.error("PopupWindow.error: ",t),this._cleanup(),this._reject(new Error(t))},t.prototype.close=function(){this._cleanup(!1)},t.prototype._cleanup=function(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},t.prototype._checkForPopupClosed=function(){this._popup&&!this._popup.closed||this._error("Popup window closed")},t.prototype._callback=function(t,e){this._cleanup(e),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"))},t.notifyOpener=function(t,e,n){if(window.opener){if(t=t||window.location.href){var r=i.UrlUtility.parseUrlFragment(t,n);if(r.state){var s="popupCallback_"+r.state,a=window.opener[s];a?(o.Log.debug("PopupWindow.notifyOpener: passing url message to opener"),a(t,e)):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.")},r(t,[{key:"promise",get:function(){return this._promise}}]),t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IFrameNavigator=void 0;var r=n(0),o=n(135);e.IFrameNavigator=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.prepare=function(t){var e=new o.IFrameWindow(t);return Promise.resolve(e)},t.prototype.callback=function t(e){r.Log.debug("IFrameNavigator.callback");try{return o.IFrameWindow.notifyParent(e),Promise.resolve()}catch(t){return Promise.reject(t)}},t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IFrameWindow=void 0;var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(0);e.IFrameWindow=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._promise=new Promise((function(t,e){n._resolve=t,n._reject=e})),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 t.prototype.navigate=function(t){if(t&&t.url){var e=t.silentRequestTimeout||1e4;o.Log.debug("IFrameWindow.navigate: Using timeout of:",e),this._timer=window.setTimeout(this._timeout.bind(this),e),this._frame.src=t.url}else this._error("No url provided");return this.promise},t.prototype._success=function(t){this._cleanup(),o.Log.debug("IFrameWindow: Successful response from frame window"),this._resolve(t)},t.prototype._error=function(t){this._cleanup(),o.Log.error(t),this._reject(new Error(t))},t.prototype.close=function(){this._cleanup()},t.prototype._cleanup=function(){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)},t.prototype._timeout=function(){o.Log.debug("IFrameWindow.timeout"),this._error("Frame window timed out")},t.prototype._message=function(t){if(o.Log.debug("IFrameWindow.message"),this._timer&&t.origin===this._origin&&t.source===this._frame.contentWindow){var e=t.data;e?this._success({url:e}):this._error("Invalid response from frame")}},t.notifyParent=function(t){o.Log.debug("IFrameWindow.notifyParent"),window.frameElement&&(t=t||window.location.href)&&(o.Log.debug("IFrameWindow.notifyParent: posting url message to parent"),window.parent.postMessage(t,location.protocol+"//"+location.host))},r(t,[{key:"promise",get:function(){return this._promise}},{key:"_origin",get:function(){return location.protocol+"//"+location.host}}]),t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserManagerEvents=void 0;var r=n(0),o=n(56),i=n(57);e.UserManagerEvents=function(t){function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n));return r._userLoaded=new i.Event("User loaded"),r._userUnloaded=new i.Event("User unloaded"),r._silentRenewError=new i.Event("Silent renew error"),r._userSignedIn=new i.Event("User signed in"),r._userSignedOut=new i.Event("User signed out"),r._userSessionChanged=new i.Event("User session changed"),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.load=function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];r.Log.debug("UserManagerEvents.load"),t.prototype.load.call(this,e),n&&this._userLoaded.raise(e)},e.prototype.unload=function(){r.Log.debug("UserManagerEvents.unload"),t.prototype.unload.call(this),this._userUnloaded.raise()},e.prototype.addUserLoaded=function(t){this._userLoaded.addHandler(t)},e.prototype.removeUserLoaded=function(t){this._userLoaded.removeHandler(t)},e.prototype.addUserUnloaded=function(t){this._userUnloaded.addHandler(t)},e.prototype.removeUserUnloaded=function(t){this._userUnloaded.removeHandler(t)},e.prototype.addSilentRenewError=function(t){this._silentRenewError.addHandler(t)},e.prototype.removeSilentRenewError=function(t){this._silentRenewError.removeHandler(t)},e.prototype._raiseSilentRenewError=function(t){r.Log.debug("UserManagerEvents._raiseSilentRenewError",t.message),this._silentRenewError.raise(t)},e.prototype.addUserSignedIn=function(t){this._userSignedIn.addHandler(t)},e.prototype.removeUserSignedIn=function(t){this._userSignedIn.removeHandler(t)},e.prototype._raiseUserSignedIn=function(){r.Log.debug("UserManagerEvents._raiseUserSignedIn"),this._userSignedIn.raise()},e.prototype.addUserSignedOut=function(t){this._userSignedOut.addHandler(t)},e.prototype.removeUserSignedOut=function(t){this._userSignedOut.removeHandler(t)},e.prototype._raiseUserSignedOut=function(){r.Log.debug("UserManagerEvents._raiseUserSignedOut"),this._userSignedOut.raise()},e.prototype.addUserSessionChanged=function(t){this._userSessionChanged.addHandler(t)},e.prototype.removeUserSessionChanged=function(t){this._userSessionChanged.removeHandler(t)},e.prototype._raiseUserSessionChanged=function(){r.Log.debug("UserManagerEvents._raiseUserSessionChanged"),this._userSessionChanged.raise()},e}(o.AccessTokenEvents)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Timer=void 0;var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(0),i=n(4),s=n(57);e.Timer=function(t){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.Global.timer,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var s=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n));return s._timer=r,s._nowFunc=o||function(){return Date.now()/1e3},s}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.init=function(t){t<=0&&(t=1),t=parseInt(t);var e=this.now+t;if(this.expiration===e&&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=e;var n=5;t<n&&(n=t),this._timerHandle=this._timer.setInterval(this._callback.bind(this),1e3*n)}},e.prototype.cancel=function(){this._timerHandle&&(o.Log.debug("Timer.cancel: ",this._name),this._timer.clearInterval(this._timerHandle),this._timerHandle=null)},e.prototype._callback=function(){var e=this._expiration-this.now;o.Log.debug("Timer.callback; "+this._name+" timer expires in:",e),this._expiration<=this.now&&(this.cancel(),t.prototype.raise.call(this))},r(e,[{key:"now",get:function(){return parseInt(this._nowFunc())}},{key:"expiration",get:function(){return this._expiration}}]),e}(s.Event)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SilentRenewService=void 0;var r=n(0);e.SilentRenewService=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._userManager=e}return t.prototype.start=function(){this._callback||(this._callback=this._tokenExpiring.bind(this),this._userManager.events.addAccessTokenExpiring(this._callback),this._userManager.getUser().then((function(t){})).catch((function(t){r.Log.error("SilentRenewService.start: Error from getUser:",t.message)})))},t.prototype.stop=function(){this._callback&&(this._userManager.events.removeAccessTokenExpiring(this._callback),delete this._callback)},t.prototype._tokenExpiring=function(){var t=this;this._userManager.signinSilent().then((function(t){r.Log.debug("SilentRenewService._tokenExpiring: Silent token renewal successful")}),(function(e){r.Log.error("SilentRenewService._tokenExpiring: Error from signinSilent:",e.message),t._userManager.events._raiseSilentRenewError(e)}))},t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CordovaPopupNavigator=void 0;var r=n(61);e.CordovaPopupNavigator=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.prepare=function(t){var e=new r.CordovaPopupWindow(t);return Promise.resolve(e)},t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CordovaIFrameNavigator=void 0;var r=n(61);e.CordovaIFrameNavigator=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.prepare=function(t){t.popupWindowFeatures="hidden=yes";var e=new r.CordovaPopupWindow(t);return Promise.resolve(e)},t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Version="1.10.1"}]),Sentry=function(t){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,n)};function n(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r,o,i,s,a,u,c,p=function(){return(p=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function l(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function f(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function d(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(f(arguments[e]));return t}function h(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}!function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Debug=2]="Debug",t[t.Verbose=3]="Verbose"}(r||(r={})),function(t){t.Ok="ok",t.Exited="exited",t.Crashed="crashed",t.Abnormal="abnormal"}(o||(o={})),function(t){t.Ok="ok",t.Errored="errored",t.Crashed="crashed"}(i||(i={})),(s=t.Severity||(t.Severity={})).Fatal="fatal",s.Error="error",s.Warning="warning",s.Log="log",s.Info="info",s.Debug="debug",s.Critical="critical",function(t){t.fromString=function(e){switch(e){case"debug":return t.Debug;case"info":return t.Info;case"warn":case"warning":return t.Warning;case"error":return t.Error;case"fatal":return t.Fatal;case"critical":return t.Critical;default:return t.Log}}}(t.Severity||(t.Severity={})),(a=t.Status||(t.Status={})).Unknown="unknown",a.Skipped="skipped",a.Success="success",a.RateLimit="rate_limit",a.Invalid="invalid",a.Failed="failed",function(t){t.fromHttpCode=function(e){return e>=200&&e<300?t.Success:429===e?t.RateLimit:e>=400&&e<500?t.Invalid:e>=500?t.Failed:t.Unknown}}(t.Status||(t.Status={})),function(t){t.Explicit="explicitly_set",t.Sampler="client_sampler",t.Rate="client_rate",t.Inheritance="inheritance"}(u||(u={})),function(t){t.BeforeSend="before_send",t.EventProcessor="event_processor",t.NetworkError="network_error",t.QueueOverflow="queue_overflow",t.RateLimitBackoff="ratelimit_backoff",t.SampleRate="sample_rate"}(c||(c={}));var g={};function v(){return h()?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:g}function _(t){switch(Object.prototype.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return x(t,Error)}}function y(t){return"[object ErrorEvent]"===Object.prototype.toString.call(t)}function m(t){return"[object DOMError]"===Object.prototype.toString.call(t)}function b(t){return"[object String]"===Object.prototype.toString.call(t)}function S(t){return null===t||"object"!=typeof t&&"function"!=typeof t}function w(t){return"[object Object]"===Object.prototype.toString.call(t)}function k(t){return"undefined"!=typeof Event&&x(t,Event)}function E(t){return"undefined"!=typeof Element&&x(t,Element)}function T(t){return Boolean(t&&t.then&&"function"==typeof t.then)}function x(t,e){try{return t instanceof e}catch(t){return!1}}function O(t,e){try{for(var n=t,r=[],o=0,i=0,s=" > ".length,a=void 0;n&&o++<5&&!("html"===(a=R(n,e))||o>1&&i+r.length*s+a.length>=80);)r.push(a),i+=a.length,n=n.parentNode;return r.reverse().join(" > ")}catch(t){return"<unknown>"}}function R(t,e){var n,r,o,i,s,a,u,c=t,p=[];if(!c||!c.tagName)return"";p.push(c.tagName.toLowerCase());var l=(null===(n=e)||void 0===n?void 0:n.length)?e.filter((function(t){return c.getAttribute(t)})).map((function(t){return[t,c.getAttribute(t)]})):null;if(null===(r=l)||void 0===r?void 0:r.length)l.forEach((function(t){p.push("["+t[0]+'="'+t[1]+'"]')}));else if(c.id&&p.push("#"+c.id),(o=c.className)&&b(o))for(i=o.split(/\s+/),u=0;u<i.length;u++)p.push("."+i[u]);var f=["type","name","title","alt"];for(u=0;u<f.length;u++)s=f[u],(a=c.getAttribute(s))&&p.push("["+s+'="'+a+'"]');return p.join("")}var C=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){return t.__proto__=e,t}:function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n]);return t}),P=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return r.message=e,r.name=n.prototype.constructor.name,C(r,n.prototype),r}return n(e,t),e}(Error),L=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/,U=function(){function t(t){"string"==typeof t?this.t(t):this.i(t),this.o()}return t.prototype.toString=function(t){void 0===t&&(t=!1);var e=this,n=e.host,r=e.path,o=e.pass,i=e.port,s=e.projectId;return e.protocol+"://"+e.publicKey+(t&&o?":"+o:"")+"@"+n+(i?":"+i:"")+"/"+(r?r+"/":r)+s},t.prototype.t=function(t){var e=L.exec(t);if(!e)throw new P("Invalid Dsn");var n=f(e.slice(1),6),r=n[0],o=n[1],i=n[2],s=void 0===i?"":i,a=n[3],u=n[4],c=void 0===u?"":u,p="",l=n[5],d=l.split("/");if(d.length>1&&(p=d.slice(0,-1).join("/"),l=d.pop()),l){var h=l.match(/^\d+/);h&&(l=h[0])}this.i({host:a,pass:s,path:p,projectId:l,port:c,protocol:r,publicKey:o})},t.prototype.i=function(t){"user"in t&&!("publicKey"in t)&&(t.publicKey=t.user),this.user=t.publicKey||"",this.protocol=t.protocol,this.publicKey=t.publicKey||"",this.pass=t.pass||"",this.host=t.host,this.port=t.port||"",this.path=t.path||"",this.projectId=t.projectId},t.prototype.o=function(){var t=this;if(["protocol","publicKey","host","projectId"].forEach((function(e){if(!t[e])throw new P("Invalid Dsn: "+e+" missing")})),!this.projectId.match(/^\d+$/))throw new P("Invalid Dsn: Invalid projectId "+this.projectId);if("http"!==this.protocol&&"https"!==this.protocol)throw new P("Invalid Dsn: Invalid protocol "+this.protocol);if(this.port&&isNaN(parseInt(this.port,10)))throw new P("Invalid Dsn: Invalid port "+this.port)},t}(),j=v(),I="Sentry Logger ";function M(t){var e=v();if(!("console"in e))return t();var n=e.console,r={};["debug","info","warn","error","log","assert"].forEach((function(t){t in e.console&&n[t].__sentry_original__&&(r[t]=n[t],n[t]=n[t].__sentry_original__)}));var o=t();return Object.keys(r).forEach((function(t){n[t]=r[t]})),o}var A=function(){function t(){this.u=!1}return t.prototype.disable=function(){this.u=!1},t.prototype.enable=function(){this.u=!0},t.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.u&&M((function(){j.console.log(I+"[Log]: "+t.join(" "))}))},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.u&&M((function(){j.console.warn(I+"[Warn]: "+t.join(" "))}))},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.u&&M((function(){j.console.error(I+"[Error]: "+t.join(" "))}))},t}();j.__SENTRY__=j.__SENTRY__||{};var N=j.__SENTRY__.logger||(j.__SENTRY__.logger=new A),D=function(){function t(){this.s="function"==typeof WeakSet,this.h=this.s?new WeakSet:[]}return t.prototype.memoize=function(t){if(this.s)return!!this.h.has(t)||(this.h.add(t),!1);for(var e=0;e<this.h.length;e++)if(this.h[e]===t)return!0;return this.h.push(t),!1},t.prototype.unmemoize=function(t){if(this.s)this.h.delete(t);else for(var e=0;e<this.h.length;e++)if(this.h[e]===t){this.h.splice(e,1);break}},t}(),q="<anonymous>";function W(t){try{return t&&"function"==typeof t&&t.name||q}catch(t){return q}}function F(t,e){return void 0===e&&(e=0),"string"!=typeof t||0===e||t.length<=e?t:t.substr(0,e)+"..."}function B(t,e){if(!Array.isArray(t))return"";for(var n=[],r=0;r<t.length;r++){var o=t[r];try{n.push(String(o))}catch(t){n.push("[value cannot be serialized]")}}return n.join(e)}function J(t,e){return!!b(t)&&(n=e,"[object RegExp]"===Object.prototype.toString.call(n)?e.test(t):"string"==typeof e&&-1!==t.indexOf(e));var n}function V(t,e,n){if(e in t){var r=t[e],o=n(r);if("function"==typeof o)try{o.prototype=o.prototype||{},Object.defineProperties(o,{__sentry_original__:{enumerable:!1,value:r}})}catch(t){}t[e]=o}}function H(t){if(_(t)){var e=t,n={message:e.message,name:e.name,stack:e.stack};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}if(k(t)){var o=t,i={};i.type=o.type;try{i.target=E(o.target)?O(o.target):Object.prototype.toString.call(o.target)}catch(t){i.target="<unknown>"}try{i.currentTarget=E(o.currentTarget)?O(o.currentTarget):Object.prototype.toString.call(o.currentTarget)}catch(t){i.currentTarget="<unknown>"}for(var s in"undefined"!=typeof CustomEvent&&x(t,CustomEvent)&&(i.detail=o.detail),o)Object.prototype.hasOwnProperty.call(o,s)&&(i[s]=o[s]);return i}return t}function z(t,e,n){void 0===e&&(e=3),void 0===n&&(n=102400);var r=G(t,e);return function(t){return function(t){return~-encodeURI(t).split(/%..|./).length}(JSON.stringify(t))}(r)>n?z(t,e-1,n):r}function K(t,e){return"domain"===e&&t&&"object"==typeof t&&t.v?"[Domain]":"domainEmitter"===e?"[DomainEmitter]":"undefined"!=typeof global&&t===global?"[Global]":"undefined"!=typeof window&&t===window?"[Window]":"undefined"!=typeof document&&t===document?"[Document]":w(n=t)&&"nativeEvent"in n&&"preventDefault"in n&&"stopPropagation"in n?"[SyntheticEvent]":"number"==typeof t&&t!=t?"[NaN]":void 0===t?"[undefined]":"function"==typeof t?"[Function: "+W(t)+"]":"symbol"==typeof t?"["+String(t)+"]":"bigint"==typeof t?"[BigInt: "+String(t)+"]":t;var n}function X(t,e,n,r){if(void 0===n&&(n=1/0),void 0===r&&(r=new D),0===n)return function(t){var e=Object.prototype.toString.call(t);if("string"==typeof t)return t;if("[object Object]"===e)return"[Object]";if("[object Array]"===e)return"[Array]";var n=K(t);return S(n)?n:e}(e);if(null!=e&&"function"==typeof e.toJSON)return e.toJSON();var o=K(e,t);if(S(o))return o;var i=H(e),s=Array.isArray(e)?[]:{};if(r.memoize(e))return"[Circular ~]";for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(s[a]=X(a,i[a],n-1,r));return r.unmemoize(e),s}function G(t,e){try{return JSON.parse(JSON.stringify(t,(function(t,n){return X(t,n,e)})))}catch(t){return"**non-serializable**"}}function $(t,e){void 0===e&&(e=40);var n=Object.keys(H(t));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=e)return F(n[0],e);for(var r=n.length;r>0;r--){var o=n.slice(0,r).join(", ");if(!(o.length>e))return r===n.length?o:F(o,e)}return""}function Q(t){var e,n;if(w(t)){var r=t,o={};try{for(var i=l(Object.keys(r)),s=i.next();!s.done;s=i.next()){var a=s.value;void 0!==r[a]&&(o[a]=Q(r[a]))}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return o}return Array.isArray(t)?t.map(Q):t}function Y(){if(!("fetch"in v()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(t){return!1}}function Z(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function tt(){if(!Y())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch(t){return!1}}var et,nt=v(),rt={},ot={};function it(t){t&&"string"==typeof t.type&&"function"==typeof t.callback&&(rt[t.type]=rt[t.type]||[],rt[t.type].push(t.callback),function(t){if(!ot[t])switch(ot[t]=!0,t){case"console":"console"in nt&&["debug","info","warn","error","log","assert"].forEach((function(t){t in nt.console&&V(nt.console,t,(function(e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];st("console",{args:n,level:t}),e&&Function.prototype.apply.call(e,nt.console,n)}}))}));break;case"dom":!function(){if("document"in nt){var t=st.bind(null,"dom"),e=lt(t,!0);nt.document.addEventListener("click",e,!1),nt.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach((function(e){var n=nt[e]&&nt[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(V(n,"addEventListener",(function(e){return function(n,r,o){if("click"===n||"keypress"==n)try{var i=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},s=i[n]=i[n]||{refCount:0};if(!s.handler){var a=lt(t);s.handler=a,e.call(this,n,a,o)}s.refCount+=1}catch(t){}return e.call(this,n,r,o)}})),V(n,"removeEventListener",(function(t){return function(e,n,r){if("click"===e||"keypress"==e)try{var o=this.__sentry_instrumentation_handlers__||{},i=o[e];i&&(i.refCount-=1,i.refCount<=0&&(t.call(this,e,i.handler,r),i.handler=void 0,delete o[e]),0===Object.keys(o).length&&delete this.__sentry_instrumentation_handlers__)}catch(t){}return t.call(this,e,n,r)}})))}))}}();break;case"xhr":!function(){if("XMLHttpRequest"in nt){var t=[],e=[],n=XMLHttpRequest.prototype;V(n,"open",(function(n){return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var i=this,s=r[1];i.__sentry_xhr__={method:b(r[0])?r[0].toUpperCase():r[0],url:r[1]},b(s)&&"POST"===i.__sentry_xhr__.method&&s.match(/sentry_key/)&&(i.__sentry_own_request__=!0);var a=function(){if(4===i.readyState){try{i.__sentry_xhr__&&(i.__sentry_xhr__.status_code=i.status)}catch(t){}try{var n=t.indexOf(i);if(-1!==n){t.splice(n);var o=e.splice(n)[0];i.__sentry_xhr__&&void 0!==o[0]&&(i.__sentry_xhr__.body=o[0])}}catch(t){}st("xhr",{args:r,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:i})}};return"onreadystatechange"in i&&"function"==typeof i.onreadystatechange?V(i,"onreadystatechange",(function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return a(),t.apply(i,e)}})):i.addEventListener("readystatechange",a),n.apply(i,r)}})),V(n,"send",(function(n){return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return t.push(this),e.push(r),st("xhr",{args:r,startTimestamp:Date.now(),xhr:this}),n.apply(this,r)}}))}}();break;case"fetch":(function(){if(!Y())return!1;var t=v();if(Z(t.fetch))return!0;var e=!1,n=t.document;if(n&&"function"==typeof n.createElement)try{var r=n.createElement("iframe");r.hidden=!0,n.head.appendChild(r),r.contentWindow&&r.contentWindow.fetch&&(e=Z(r.contentWindow.fetch)),n.head.removeChild(r)}catch(t){N.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return e})()&&V(nt,"fetch",(function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r={args:e,fetchData:{method:at(e),url:ut(e)},startTimestamp:Date.now()};return st("fetch",p({},r)),t.apply(nt,e).then((function(t){return st("fetch",p(p({},r),{endTimestamp:Date.now(),response:t})),t}),(function(t){throw st("fetch",p(p({},r),{endTimestamp:Date.now(),error:t})),t}))}}));break;case"history":!function(){if(n=(e=(t=v()).chrome)&&e.app&&e.app.runtime,r="history"in t&&!!t.history.pushState&&!!t.history.replaceState,!n&&r){var t,e,n,r,o=nt.onpopstate;nt.onpopstate=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=nt.location.href,r=et;if(et=n,st("history",{from:r,to:n}),o)try{return o.apply(this,t)}catch(t){}},V(nt.history,"pushState",i),V(nt.history,"replaceState",i)}function i(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e.length>2?e[2]:void 0;if(r){var o=et,i=String(r);et=i,st("history",{from:o,to:i})}return t.apply(this,e)}}}();break;case"error":ft=nt.onerror,nt.onerror=function(t,e,n,r,o){return st("error",{column:r,error:o,line:n,msg:t,url:e}),!!ft&&ft.apply(this,arguments)};break;case"unhandledrejection":dt=nt.onunhandledrejection,nt.onunhandledrejection=function(t){return st("unhandledrejection",t),!dt||dt.apply(this,arguments)};break;default:N.warn("unknown instrumentation type:",t)}}(t.type))}function st(t,e){var n,r;if(t&&rt[t])try{for(var o=l(rt[t]||[]),i=o.next();!i.done;i=o.next()){var s=i.value;try{s(e)}catch(e){N.error("Error while triggering instrumentation handler.\nType: "+t+"\nName: "+W(s)+"\nError: "+e)}}}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}function at(t){return void 0===t&&(t=[]),"Request"in nt&&x(t[0],Request)&&t[0].method?String(t[0].method).toUpperCase():t[1]&&t[1].method?String(t[1].method).toUpperCase():"GET"}function ut(t){return void 0===t&&(t=[]),"string"==typeof t[0]?t[0]:"Request"in nt&&x(t[0],Request)?t[0].url:String(t[0])}var ct,pt;function lt(t,e){return void 0===e&&(e=!1),function(n){if(n&&pt!==n&&!function(t){if("keypress"!==t.type)return!1;try{var e=t.target;if(!e||!e.tagName)return!0;if("INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.isContentEditable)return!1}catch(t){}return!0}(n)){var r="keypress"===n.type?"input":n.type;(void 0===ct||function(t,e){if(!t)return!0;if(t.type!==e.type)return!0;try{if(t.target!==e.target)return!0}catch(t){}return!1}(pt,n))&&(t({event:n,name:r,global:e}),pt=n),clearTimeout(ct),ct=nt.setTimeout((function(){ct=void 0}),1e3)}}}var ft=null,dt=null;function ht(){var t=v(),e=t.crypto||t.msCrypto;if(void 0!==e&&e.getRandomValues){var n=new Uint16Array(8);e.getRandomValues(n),n[3]=4095&n[3]|16384,n[4]=16383&n[4]|32768;var r=function(t){for(var e=t.toString(16);e.length<4;)e="0"+e;return e};return r(n[0])+r(n[1])+r(n[2])+r(n[3])+r(n[4])+r(n[5])+r(n[6])+r(n[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}function gt(t){if(!t)return{};var e=t.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};var n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],relative:e[5]+n+r}}function vt(t){if(t.message)return t.message;if(t.exception&&t.exception.values&&t.exception.values[0]){var e=t.exception.values[0];return e.type&&e.value?e.type+": "+e.value:e.type||e.value||t.event_id||"<unknown>"}return t.event_id||"<unknown>"}function _t(t,e,n){t.exception=t.exception||{},t.exception.values=t.exception.values||[],t.exception.values[0]=t.exception.values[0]||{},t.exception.values[0].value=t.exception.values[0].value||e||"",t.exception.values[0].type=t.exception.values[0].type||n||"Error"}function yt(t,e){var n;if(t.exception&&t.exception.values){var r=t.exception.values[0],o=r.mechanism;if(r.mechanism=p(p(p({},{type:"generic",handled:!0}),o),e),e&&"data"in e){var i=p(p({},null===(n=o)||void 0===n?void 0:n.data),e.data);r.mechanism.data=i}}}var mt;function bt(t){var e;if(null===(e=t)||void 0===e?void 0:e.__sentry_captured__)return!0;try{Object.defineProperty(t,"__sentry_captured__",{value:!0})}catch(t){}return!1}!function(t){t.PENDING="PENDING",t.RESOLVED="RESOLVED",t.REJECTED="REJECTED"}(mt||(mt={}));var St=function(){function t(t){var e=this;this.l=mt.PENDING,this.p=[],this.m=function(t){e.g(mt.RESOLVED,t)},this.j=function(t){e.g(mt.REJECTED,t)},this.g=function(t,n){e.l===mt.PENDING&&(T(n)?n.then(e.m,e.j):(e.l=t,e._=n,e.k()))},this.S=function(t){e.p=e.p.concat(t),e.k()},this.k=function(){if(e.l!==mt.PENDING){var t=e.p.slice();e.p=[],t.forEach((function(t){t.done||(e.l===mt.RESOLVED&&t.onfulfilled&&t.onfulfilled(e._),e.l===mt.REJECTED&&t.onrejected&&t.onrejected(e._),t.done=!0)}))}};try{t(this.m,this.j)}catch(t){this.j(t)}}return t.resolve=function(e){return new t((function(t){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.all=function(e){return new t((function(n,r){if(Array.isArray(e))if(0!==e.length){var o=e.length,i=[];e.forEach((function(e,s){t.resolve(e).then((function(t){i[s]=t,0==(o-=1)&&n(i)})).then(null,r)}))}else n([]);else r(new TypeError("Promise.all requires an array as input."))}))},t.prototype.then=function(e,n){var r=this;return new t((function(t,o){r.S({done:!1,onfulfilled:function(n){if(e)try{return void t(e(n))}catch(t){return void o(t)}else t(n)},onrejected:function(e){if(n)try{return void t(n(e))}catch(t){return void o(t)}else o(e)}})}))},t.prototype.catch=function(t){return this.then((function(t){return t}),t)},t.prototype.finally=function(e){var n=this;return new t((function(t,r){var o,i;return n.then((function(t){i=!1,o=t,e&&e()}),(function(t){i=!0,o=t,e&&e()})).then((function(){i?r(o):t(o)}))}))},t.prototype.toString=function(){return"[object SyncPromise]"},t}(),wt=function(){function t(t){this.O=t,this.D=[]}return t.prototype.isReady=function(){return void 0===this.O||this.length()<this.O},t.prototype.add=function(t){var e=this;if(!this.isReady())return St.reject(new P("Not adding Promise due to buffer limit reached."));var n=t();return-1===this.D.indexOf(n)&&this.D.push(n),n.then((function(){return e.remove(n)})).then(null,(function(){return e.remove(n).then(null,(function(){}))})),n},t.prototype.remove=function(t){return this.D.splice(this.D.indexOf(t),1)[0]},t.prototype.length=function(){return this.D.length},t.prototype.drain=function(t){var e=this;return new St((function(n){var r=setTimeout((function(){t&&t>0&&n(!1)}),t);St.all(e.D).then((function(){clearTimeout(r),n(!0)})).then(null,(function(){n(!0)}))}))},t}(),kt={nowSeconds:function(){return Date.now()/1e3}},Et=h()?function(){try{return(t=module,"perf_hooks",t.require("perf_hooks")).performance}catch(t){return}var t}():function(){var t=v().performance;if(t&&t.now)return{now:function(){return t.now()},timeOrigin:Date.now()-t.now()}}(),Tt=void 0===Et?kt:{nowSeconds:function(){return(Et.timeOrigin+Et.now())/1e3}},xt=kt.nowSeconds.bind(kt),Ot=Tt.nowSeconds.bind(Tt),Rt=(function(){var t=v().performance;if(t&&t.now){var e=t.now(),n=Date.now(),r=t.timeOrigin?Math.abs(t.timeOrigin+e-n):36e5,o=r<36e5,i=t.timing&&t.timing.navigationStart,s="number"==typeof i?Math.abs(i+e-n):36e5;(o||s<36e5)&&r<=s&&t.timeOrigin}}(),function(){function t(){this.T=!1,this.N=[],this.R=[],this.I=[],this.C={},this.M={},this.A={},this.q={}}return t.clone=function(e){var n=new t;return e&&(n.I=d(e.I),n.M=p({},e.M),n.A=p({},e.A),n.q=p({},e.q),n.C=e.C,n.L=e.L,n.U=e.U,n.H=e.H,n.F=e.F,n.P=e.P,n.R=d(e.R),n.J=e.J),n},t.prototype.addScopeListener=function(t){this.N.push(t)},t.prototype.addEventProcessor=function(t){return this.R.push(t),this},t.prototype.setUser=function(t){return this.C=t||{},this.H&&this.H.update({user:t}),this.X(),this},t.prototype.getUser=function(){return this.C},t.prototype.getRequestSession=function(){return this.J},t.prototype.setRequestSession=function(t){return this.J=t,this},t.prototype.setTags=function(t){return this.M=p(p({},this.M),t),this.X(),this},t.prototype.setTag=function(t,e){var n;return this.M=p(p({},this.M),((n={})[t]=e,n)),this.X(),this},t.prototype.setExtras=function(t){return this.A=p(p({},this.A),t),this.X(),this},t.prototype.setExtra=function(t,e){var n;return this.A=p(p({},this.A),((n={})[t]=e,n)),this.X(),this},t.prototype.setFingerprint=function(t){return this.P=t,this.X(),this},t.prototype.setLevel=function(t){return this.L=t,this.X(),this},t.prototype.setTransactionName=function(t){return this.F=t,this.X(),this},t.prototype.setTransaction=function(t){return this.setTransactionName(t)},t.prototype.setContext=function(t,e){var n;return null===e?delete this.q[t]:this.q=p(p({},this.q),((n={})[t]=e,n)),this.X(),this},t.prototype.setSpan=function(t){return this.U=t,this.X(),this},t.prototype.getSpan=function(){return this.U},t.prototype.getTransaction=function(){var t,e,n,r,o=this.getSpan();return(null===(t=o)||void 0===t?void 0:t.transaction)?null===(e=o)||void 0===e?void 0:e.transaction:(null===(r=null===(n=o)||void 0===n?void 0:n.spanRecorder)||void 0===r?void 0:r.spans[0])?o.spanRecorder.spans[0]:void 0},t.prototype.setSession=function(t){return t?this.H=t:delete this.H,this.X(),this},t.prototype.getSession=function(){return this.H},t.prototype.update=function(e){if(!e)return this;if("function"==typeof e){var n=e(this);return n instanceof t?n:this}return e instanceof t?(this.M=p(p({},this.M),e.M),this.A=p(p({},this.A),e.A),this.q=p(p({},this.q),e.q),e.C&&Object.keys(e.C).length&&(this.C=e.C),e.L&&(this.L=e.L),e.P&&(this.P=e.P),e.J&&(this.J=e.J)):w(e)&&(this.M=p(p({},this.M),e.tags),this.A=p(p({},this.A),e.extra),this.q=p(p({},this.q),e.contexts),e.user&&(this.C=e.user),e.level&&(this.L=e.level),e.fingerprint&&(this.P=e.fingerprint),e.requestSession&&(this.J=e.requestSession)),this},t.prototype.clear=function(){return this.I=[],this.M={},this.A={},this.C={},this.q={},this.L=void 0,this.F=void 0,this.P=void 0,this.J=void 0,this.U=void 0,this.H=void 0,this.X(),this},t.prototype.addBreadcrumb=function(t,e){var n="number"==typeof e?Math.min(e,100):100;if(n<=0)return this;var r=p({timestamp:xt()},t);return this.I=d(this.I,[r]).slice(-n),this.X(),this},t.prototype.clearBreadcrumbs=function(){return this.I=[],this.X(),this},t.prototype.applyToEvent=function(t,e){var n;if(this.A&&Object.keys(this.A).length&&(t.extra=p(p({},this.A),t.extra)),this.M&&Object.keys(this.M).length&&(t.tags=p(p({},this.M),t.tags)),this.C&&Object.keys(this.C).length&&(t.user=p(p({},this.C),t.user)),this.q&&Object.keys(this.q).length&&(t.contexts=p(p({},this.q),t.contexts)),this.L&&(t.level=this.L),this.F&&(t.transaction=this.F),this.U){t.contexts=p({trace:this.U.getTraceContext()},t.contexts);var r=null===(n=this.U.transaction)||void 0===n?void 0:n.name;r&&(t.tags=p({transaction:r},t.tags))}return this.B(t),t.breadcrumbs=d(t.breadcrumbs||[],this.I),t.breadcrumbs=t.breadcrumbs.length>0?t.breadcrumbs:void 0,this.W(d(Ct(),this.R),t,e)},t.prototype.W=function(t,e,n,r){var o=this;return void 0===r&&(r=0),new St((function(i,s){var a=t[r];if(null===e||"function"!=typeof a)i(e);else{var u=a(p({},e),n);T(u)?u.then((function(e){return o.W(t,e,n,r+1).then(i)})).then(null,s):o.W(t,u,n,r+1).then(i).then(null,s)}}))},t.prototype.X=function(){var t=this;this.T||(this.T=!0,this.N.forEach((function(e){e(t)})),this.T=!1)},t.prototype.B=function(t){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],this.P&&(t.fingerprint=t.fingerprint.concat(this.P)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint},t}());function Ct(){var t=v();return t.__SENTRY__=t.__SENTRY__||{},t.__SENTRY__.globalEventProcessors=t.__SENTRY__.globalEventProcessors||[],t.__SENTRY__.globalEventProcessors}function Pt(t){Ct().push(t)}var Lt=function(){function t(t){this.errors=0,this.sid=ht(),this.duration=0,this.status=o.Ok,this.init=!0,this.ignoreDuration=!1;var e=Ot();this.timestamp=e,this.started=e,t&&this.update(t)}return t.prototype.update=function(t){if(void 0===t&&(t={}),t.user&&(!this.ipAddress&&t.user.ip_address&&(this.ipAddress=t.user.ip_address),this.did||t.did||(this.did=t.user.id||t.user.email||t.user.username)),this.timestamp=t.timestamp||Ot(),t.ignoreDuration&&(this.ignoreDuration=t.ignoreDuration),t.sid&&(this.sid=32===t.sid.length?t.sid:ht()),void 0!==t.init&&(this.init=t.init),!this.did&&t.did&&(this.did=""+t.did),"number"==typeof t.started&&(this.started=t.started),this.ignoreDuration)this.duration=void 0;else if("number"==typeof t.duration)this.duration=t.duration;else{var e=this.timestamp-this.started;this.duration=e>=0?e:0}t.release&&(this.release=t.release),t.environment&&(this.environment=t.environment),!this.ipAddress&&t.ipAddress&&(this.ipAddress=t.ipAddress),!this.userAgent&&t.userAgent&&(this.userAgent=t.userAgent),"number"==typeof t.errors&&(this.errors=t.errors),t.status&&(this.status=t.status)},t.prototype.close=function(t){t?this.update({status:t}):this.status===o.Ok?this.update({status:o.Exited}):this.update()},t.prototype.toJSON=function(){return Q({sid:""+this.sid,init:this.init,started:new Date(1e3*this.started).toISOString(),timestamp:new Date(1e3*this.timestamp).toISOString(),status:this.status,errors:this.errors,did:"number"==typeof this.did||"string"==typeof this.did?""+this.did:void 0,duration:this.duration,attrs:Q({release:this.release,environment:this.environment,ip_address:this.ipAddress,user_agent:this.userAgent})})},t}(),Ut=function(){function t(t,e,n){void 0===e&&(e=new Rt),void 0===n&&(n=4),this.$=n,this.G=[{}],this.getStackTop().scope=e,t&&this.bindClient(t)}return t.prototype.isOlderThan=function(t){return this.$<t},t.prototype.bindClient=function(t){this.getStackTop().client=t,t&&t.setupIntegrations&&t.setupIntegrations()},t.prototype.pushScope=function(){var t=Rt.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:t}),t},t.prototype.popScope=function(){return!(this.getStack().length<=1||!this.getStack().pop())},t.prototype.withScope=function(t){var e=this.pushScope();try{t(e)}finally{this.popScope()}},t.prototype.getClient=function(){return this.getStackTop().client},t.prototype.getScope=function(){return this.getStackTop().scope},t.prototype.getStack=function(){return this.G},t.prototype.getStackTop=function(){return this.G[this.G.length-1]},t.prototype.captureException=function(t,e){var n=this.K=ht(),r=e;if(!e){var o=void 0;try{throw new Error("Sentry syntheticException")}catch(t){o=t}r={originalException:t,syntheticException:o}}return this.V("captureException",t,p(p({},r),{event_id:n})),n},t.prototype.captureMessage=function(t,e,n){var r=this.K=ht(),o=n;if(!n){var i=void 0;try{throw new Error(t)}catch(t){i=t}o={originalException:t,syntheticException:i}}return this.V("captureMessage",t,e,p(p({},o),{event_id:r})),r},t.prototype.captureEvent=function(t,e){var n=ht();return"transaction"!==t.type&&(this.K=n),this.V("captureEvent",t,p(p({},e),{event_id:n})),n},t.prototype.lastEventId=function(){return this.K},t.prototype.addBreadcrumb=function(t,e){var n=this.getStackTop(),r=n.scope,o=n.client;if(r&&o){var i=o.getOptions&&o.getOptions()||{},s=i.beforeBreadcrumb,a=void 0===s?null:s,u=i.maxBreadcrumbs,c=void 0===u?100:u;if(!(c<=0)){var l=xt(),f=p({timestamp:l},t),d=a?M((function(){return a(f,e)})):f;null!==d&&r.addBreadcrumb(d,c)}}},t.prototype.setUser=function(t){var e=this.getScope();e&&e.setUser(t)},t.prototype.setTags=function(t){var e=this.getScope();e&&e.setTags(t)},t.prototype.setExtras=function(t){var e=this.getScope();e&&e.setExtras(t)},t.prototype.setTag=function(t,e){var n=this.getScope();n&&n.setTag(t,e)},t.prototype.setExtra=function(t,e){var n=this.getScope();n&&n.setExtra(t,e)},t.prototype.setContext=function(t,e){var n=this.getScope();n&&n.setContext(t,e)},t.prototype.configureScope=function(t){var e=this.getStackTop(),n=e.scope,r=e.client;n&&r&&t(n)},t.prototype.run=function(t){var e=It(this);try{t(this)}finally{It(e)}},t.prototype.getIntegration=function(t){var e=this.getClient();if(!e)return null;try{return e.getIntegration(t)}catch(e){return N.warn("Cannot retrieve integration "+t.id+" from the current Hub"),null}},t.prototype.startSpan=function(t){return this.Y("startSpan",t)},t.prototype.startTransaction=function(t,e){return this.Y("startTransaction",t,e)},t.prototype.traceHeaders=function(){return this.Y("traceHeaders")},t.prototype.captureSession=function(t){if(void 0===t&&(t=!1),t)return this.endSession();this.Z()},t.prototype.endSession=function(){var t,e,n,r,o;null===(n=null===(e=null===(t=this.getStackTop())||void 0===t?void 0:t.scope)||void 0===e?void 0:e.getSession())||void 0===n||n.close(),this.Z(),null===(o=null===(r=this.getStackTop())||void 0===r?void 0:r.scope)||void 0===o||o.setSession()},t.prototype.startSession=function(t){var e=this.getStackTop(),n=e.scope,r=e.client,i=r&&r.getOptions()||{},s=i.release,a=i.environment,u=(v().navigator||{}).userAgent,c=new Lt(p(p(p({release:s,environment:a},n&&{user:n.getUser()}),u&&{userAgent:u}),t));if(n){var l=n.getSession&&n.getSession();l&&l.status===o.Ok&&l.update({status:o.Exited}),this.endSession(),n.setSession(c)}return c},t.prototype.Z=function(){var t=this.getStackTop(),e=t.scope,n=t.client;if(e){var r=e.getSession&&e.getSession();r&&n&&n.captureSession&&n.captureSession(r)}},t.prototype.V=function(t){for(var e,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=this.getStackTop(),i=o.scope,s=o.client;s&&s[t]&&(e=s)[t].apply(e,d(n,[i]))},t.prototype.Y=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=jt().__SENTRY__;if(r&&r.extensions&&"function"==typeof r.extensions[t])return r.extensions[t].apply(this,e);N.warn("Extension method "+t+" couldn't be found, doing nothing.")},t}();function jt(){var t=v();return t.__SENTRY__=t.__SENTRY__||{extensions:{},hub:void 0},t}function It(t){var e=jt(),n=Nt(e);return Dt(e,t),n}function Mt(){var t=jt();return At(t)&&!Nt(t).isOlderThan(4)||Dt(t,new Ut),h()?function(t){var e,n,r;try{var o=null===(r=null===(n=null===(e=jt().__SENTRY__)||void 0===e?void 0:e.extensions)||void 0===n?void 0:n.domain)||void 0===r?void 0:r.active;if(!o)return Nt(t);if(!At(o)||Nt(o).isOlderThan(4)){var i=Nt(t).getStackTop();Dt(o,new Ut(i.client,Rt.clone(i.scope)))}return Nt(o)}catch(e){return Nt(t)}}(t):Nt(t)}function At(t){return!!(t&&t.__SENTRY__&&t.__SENTRY__.hub)}function Nt(t){return t&&t.__SENTRY__&&t.__SENTRY__.hub||(t.__SENTRY__=t.__SENTRY__||{},t.__SENTRY__.hub=new Ut),t.__SENTRY__.hub}function Dt(t,e){return!!t&&(t.__SENTRY__=t.__SENTRY__||{},t.__SENTRY__.hub=e,!0)}function qt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=Mt();if(r&&r[t])return r[t].apply(r,d(e));throw new Error("No hub defined or "+t+" was not found on the hub, please open a bug report.")}function Wt(t,e){var n;try{throw new Error("Sentry syntheticException")}catch(t){n=t}return qt("captureException",t,{captureContext:e,originalException:t,syntheticException:n})}function Ft(t){qt("withScope",t)}var Bt=function(){function t(t,e,n){void 0===e&&(e={}),this.dsn=t,this.tt=new U(t),this.metadata=e,this.nt=n}return t.prototype.getDsn=function(){return this.tt},t.prototype.forceEnvelope=function(){return!!this.nt},t.prototype.getBaseApiEndpoint=function(){var t=this.getDsn(),e=t.protocol?t.protocol+":":"",n=t.port?":"+t.port:"";return e+"//"+t.host+n+(t.path?"/"+t.path:"")+"/api/"},t.prototype.getStoreEndpoint=function(){return this.rt("store")},t.prototype.getStoreEndpointWithUrlEncodedAuth=function(){return this.getStoreEndpoint()+"?"+this.it()},t.prototype.getEnvelopeEndpointWithUrlEncodedAuth=function(){return this.forceEnvelope()?this.nt:this.et()+"?"+this.it()},t.prototype.getStoreEndpointPath=function(){var t=this.getDsn();return(t.path?"/"+t.path:"")+"/api/"+t.projectId+"/store/"},t.prototype.getRequestHeaders=function(t,e){var n=this.getDsn(),r=["Sentry sentry_version=7"];return r.push("sentry_client="+t+"/"+e),r.push("sentry_key="+n.publicKey),n.pass&&r.push("sentry_secret="+n.pass),{"Content-Type":"application/json","X-Sentry-Auth":r.join(", ")}},t.prototype.getReportDialogEndpoint=function(t){void 0===t&&(t={});var e=this.getDsn(),n=this.getBaseApiEndpoint()+"embed/error-page/",r=[];for(var o in r.push("dsn="+e.toString()),t)if("dsn"!==o)if("user"===o){if(!t.user)continue;t.user.name&&r.push("name="+encodeURIComponent(t.user.name)),t.user.email&&r.push("email="+encodeURIComponent(t.user.email))}else r.push(encodeURIComponent(o)+"="+encodeURIComponent(t[o]));return r.length?n+"?"+r.join("&"):n},t.prototype.et=function(){return this.rt("envelope")},t.prototype.rt=function(t){return this.nt?this.nt:""+this.getBaseApiEndpoint()+this.getDsn().projectId+"/"+t+"/"},t.prototype.it=function(){var t,e={sentry_key:this.getDsn().publicKey,sentry_version:"7"};return t=e,Object.keys(t).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&")},t}(),Jt=[];function Vt(t){return t.reduce((function(t,e){return t.every((function(t){return e.name!==t.name}))&&t.push(e),t}),[])}var Ht="Not capturing exception because it's already been captured.",zt=function(){function t(t,e){this.ot={},this.ut=0,this.st=new t(e),this.at=e,e.dsn&&(this.ct=new U(e.dsn))}return t.prototype.captureException=function(t,e,n){var r=this;if(!bt(t)){var o=e&&e.event_id;return this.ft(this.ht().eventFromException(t,e).then((function(t){return r.vt(t,e,n)})).then((function(t){o=t}))),o}N.log(Ht)},t.prototype.captureMessage=function(t,e,n,r){var o=this,i=n&&n.event_id,s=S(t)?this.ht().eventFromMessage(String(t),e,n):this.ht().eventFromException(t,n);return this.ft(s.then((function(t){return o.vt(t,n,r)})).then((function(t){i=t}))),i},t.prototype.captureEvent=function(t,e,n){var r;if(!(null===(r=e)||void 0===r?void 0:r.originalException)||!bt(e.originalException)){var o=e&&e.event_id;return this.ft(this.vt(t,e,n).then((function(t){o=t}))),o}N.log(Ht)},t.prototype.captureSession=function(t){this.lt()?"string"!=typeof t.release?N.warn("Discarded session because of missing or non-string release"):(this.dt(t),t.update({init:!1})):N.warn("SDK not enabled, will not capture session.")},t.prototype.getDsn=function(){return this.ct},t.prototype.getOptions=function(){return this.at},t.prototype.getTransport=function(){return this.ht().getTransport()},t.prototype.flush=function(t){var e=this;return this.pt(t).then((function(n){return e.getTransport().close(t).then((function(t){return n&&t}))}))},t.prototype.close=function(t){var e=this;return this.flush(t).then((function(t){return e.getOptions().enabled=!1,t}))},t.prototype.setupIntegrations=function(){this.lt()&&!this.ot.initialized&&(this.ot=function(t){var e={};return function(t){var e=t.defaultIntegrations&&d(t.defaultIntegrations)||[],n=t.integrations,r=d(Vt(e));Array.isArray(n)?r=d(r.filter((function(t){return n.every((function(e){return e.name!==t.name}))})),Vt(n)):"function"==typeof n&&(r=n(r),r=Array.isArray(r)?r:[r]);var o=r.map((function(t){return t.name}));return-1!==o.indexOf("Debug")&&r.push.apply(r,d(r.splice(o.indexOf("Debug"),1))),r}(t).forEach((function(t){e[t.name]=t,function(t){-1===Jt.indexOf(t.name)&&(t.setupOnce(Pt,Mt),Jt.push(t.name),N.log("Integration installed: "+t.name))}(t)})),Object.defineProperty(e,"initialized",{value:!0}),e}(this.at))},t.prototype.getIntegration=function(t){try{return this.ot[t.id]||null}catch(e){return N.warn("Cannot retrieve integration "+t.id+" from the current Client"),null}},t.prototype.yt=function(t,e){var n,r,i=!1,s=!1,a=e.exception&&e.exception.values;if(a){s=!0;try{for(var u=l(a),c=u.next();!c.done;c=u.next()){var f=c.value.mechanism;if(f&&!1===f.handled){i=!0;break}}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}var d=t.status===o.Ok;(d&&0===t.errors||d&&i)&&(t.update(p(p({},i&&{status:o.Crashed}),{errors:t.errors||Number(s||i)})),this.captureSession(t))},t.prototype.dt=function(t){this.ht().sendSession(t)},t.prototype.pt=function(t){var e=this;return new St((function(n){var r=0,o=setInterval((function(){0==e.ut?(clearInterval(o),n(!0)):(r+=1,t&&r>=t&&(clearInterval(o),n(!1)))}),1)}))},t.prototype.ht=function(){return this.st},t.prototype.lt=function(){return!1!==this.getOptions().enabled&&void 0!==this.ct},t.prototype.bt=function(t,e,n){var r=this,o=this.getOptions().normalizeDepth,i=void 0===o?3:o,s=p(p({},t),{event_id:t.event_id||(n&&n.event_id?n.event_id:ht()),timestamp:t.timestamp||xt()});this.wt(s),this.gt(s);var a=e;n&&n.captureContext&&(a=Rt.clone(a).update(n.captureContext));var u=St.resolve(s);return a&&(u=a.applyToEvent(s,n)),u.then((function(t){return"number"==typeof i&&i>0?r.Et(t,i):t}))},t.prototype.Et=function(t,e){if(!t)return null;var n=p(p(p(p(p({},t),t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map((function(t){return p(p({},t),t.data&&{data:G(t.data,e)})}))}),t.user&&{user:G(t.user,e)}),t.contexts&&{contexts:G(t.contexts,e)}),t.extra&&{extra:G(t.extra,e)});t.contexts&&t.contexts.trace&&(n.contexts.trace=t.contexts.trace);var r=this.getOptions().xt;return(void 0===r?{}:r).ensureNoCircularStructures?G(n):n},t.prototype.wt=function(t){var e=this.getOptions(),n=e.environment,r=e.release,o=e.dist,i=e.maxValueLength,s=void 0===i?250:i;"environment"in t||(t.environment="environment"in e?n:"production"),void 0===t.release&&void 0!==r&&(t.release=r),void 0===t.dist&&void 0!==o&&(t.dist=o),t.message&&(t.message=F(t.message,s));var a=t.exception&&t.exception.values&&t.exception.values[0];a&&a.value&&(a.value=F(a.value,s));var u=t.request;u&&u.url&&(u.url=F(u.url,s))},t.prototype.gt=function(t){var e=Object.keys(this.ot);e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=d(t.sdk.integrations||[],e))},t.prototype.jt=function(t){this.ht().sendEvent(t)},t.prototype.vt=function(t,e,n){return this._t(t,e,n).then((function(t){return t.event_id}),(function(t){N.error(t)}))},t.prototype._t=function(t,e,n){var r,o,i=this,s=this.getOptions(),a=s.beforeSend,u=s.sampleRate,p=this.getTransport();if(!this.lt())return St.reject(new P("SDK not enabled, will not capture event."));var l="transaction"===t.type;return!l&&"number"==typeof u&&Math.random()>u?(null===(o=(r=p).recordLostEvent)||void 0===o||o.call(r,c.SampleRate,"event"),St.reject(new P("Discarding event because it's not included in the random sample (sampling rate = "+u+")"))):this.bt(t,n,e).then((function(n){var r,o;if(null===n)throw null===(o=(r=p).recordLostEvent)||void 0===o||o.call(r,c.EventProcessor,t.type||"event"),new P("An event processor returned null, will not send event.");if(e&&e.data&&!0===e.data.__sentry__||l||!a)return n;var s=a(n,e);return i.kt(s)})).then((function(e){var r,o;if(null===e)throw null===(o=(r=p).recordLostEvent)||void 0===o||o.call(r,c.BeforeSend,t.type||"event"),new P("`beforeSend` returned `null`, will not send event.");var s=n&&n.getSession&&n.getSession();return!l&&s&&i.yt(s,e),i.jt(e),e})).then(null,(function(t){if(t instanceof P)throw t;throw i.captureException(t,{data:{__sentry__:!0},originalException:t}),new P("Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: "+t)}))},t.prototype.ft=function(t){var e=this;this.ut+=1,t.then((function(t){return e.ut-=1,t}),(function(t){return e.ut-=1,t}))},t.prototype.kt=function(t){var e="`beforeSend` method has to return `null` or a valid event.";if(T(t))return t.then((function(t){if(!w(t)&&null!==t)throw new P(e);return t}),(function(t){throw new P("beforeSend rejected with "+t)}));if(!w(t)&&null!==t)throw new P(e);return t},t}(),Kt=function(){function e(){}return e.prototype.sendEvent=function(e){return St.resolve({reason:"NoopTransport: Event has been skipped because no Dsn is configured.",status:t.Status.Skipped})},e.prototype.close=function(t){return St.resolve(!0)},e}(),Xt=function(){function t(t){this.at=t,this.at.dsn||N.warn("No DSN provided, backend will not do anything."),this.St=this.Ot()}return t.prototype.eventFromException=function(t,e){throw new P("Backend has to implement `eventFromException` method")},t.prototype.eventFromMessage=function(t,e,n){throw new P("Backend has to implement `eventFromMessage` method")},t.prototype.sendEvent=function(t){this.St.sendEvent(t).then(null,(function(t){N.error("Error while sending event: "+t)}))},t.prototype.sendSession=function(t){this.St.sendSession?this.St.sendSession(t).then(null,(function(t){N.error("Error while sending session: "+t)})):N.warn("Dropping session because custom transport doesn't implement sendSession")},t.prototype.getTransport=function(){return this.St},t.prototype.Ot=function(){return new Kt},t}();function Gt(t){if(t.metadata&&t.metadata.sdk){var e=t.metadata.sdk;return{name:e.name,version:e.version}}}function $t(t,e){return e?(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=d(t.sdk.integrations||[],e.integrations||[]),t.sdk.packages=d(t.sdk.packages||[],e.packages||[]),t):t}function Qt(t,e){var n=Gt(e),r="aggregates"in t?"sessions":"session";return{body:JSON.stringify(p(p({sent_at:(new Date).toISOString()},n&&{sdk:n}),e.forceEnvelope()&&{dsn:e.getDsn().toString()}))+"\n"+JSON.stringify({type:r})+"\n"+JSON.stringify(t),type:r,url:e.getEnvelopeEndpointWithUrlEncodedAuth()}}function Yt(t,e){var n=Gt(e),r=t.type||"event",o="transaction"===r||e.forceEnvelope(),i=t.debug_meta||{},s=i.transactionSampling,a=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&(n[r[o]]=t[r[o]])}return n}(i,["transactionSampling"]),u=s||{},c=u.method,l=u.rate;0===Object.keys(a).length?delete t.debug_meta:t.debug_meta=a;var f={body:JSON.stringify(n?$t(t,e.metadata.sdk):t),type:r,url:o?e.getEnvelopeEndpointWithUrlEncodedAuth():e.getStoreEndpointWithUrlEncodedAuth()};if(o){var d=JSON.stringify(p(p({event_id:t.event_id,sent_at:(new Date).toISOString()},n&&{sdk:n}),e.forceEnvelope()&&{dsn:e.getDsn().toString()}))+"\n"+JSON.stringify({type:r,sample_rates:[{id:c,rate:l}]})+"\n"+f.body;f.body=d}return f}var Zt,te="6.14.1",ee=function(){function t(){this.name=t.id}return t.prototype.setupOnce=function(){Zt=Function.prototype.toString,Function.prototype.toString=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.__sentry_original__||this;return Zt.apply(n,t)}},t.id="FunctionToString",t}(),ne=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],re=function(){function t(e){void 0===e&&(e={}),this.at=e,this.name=t.id}return t.prototype.setupOnce=function(){Pt((function(e){var n=Mt();if(!n)return e;var r=n.getIntegration(t);if(r){var o=n.getClient(),i=o?o.getOptions():{},s="function"==typeof r._mergeOptions?r._mergeOptions(i):{};return"function"!=typeof r.Dt?e:r.Dt(e,s)?null:e}return e}))},t.prototype.Dt=function(t,e){return this.Tt(t,e)?(N.warn("Event dropped due to being internal Sentry Error.\nEvent: "+vt(t)),!0):this.Nt(t,e)?(N.warn("Event dropped due to being matched by `ignoreErrors` option.\nEvent: "+vt(t)),!0):this.Rt(t,e)?(N.warn("Event dropped due to being matched by `denyUrls` option.\nEvent: "+vt(t)+".\nUrl: "+this.It(t)),!0):!this.Ct(t,e)&&(N.warn("Event dropped due to not being matched by `allowUrls` option.\nEvent: "+vt(t)+".\nUrl: "+this.It(t)),!0)},t.prototype.Tt=function(t,e){if(!e.ignoreInternal)return!1;try{return t&&t.exception&&t.exception.values&&t.exception.values[0]&&"SentryError"===t.exception.values[0].type||!1}catch(t){return!1}},t.prototype.Nt=function(t,e){return!(!e.ignoreErrors||!e.ignoreErrors.length)&&this.Mt(t).some((function(t){return e.ignoreErrors.some((function(e){return J(t,e)}))}))},t.prototype.Rt=function(t,e){if(!e.denyUrls||!e.denyUrls.length)return!1;var n=this.It(t);return!!n&&e.denyUrls.some((function(t){return J(n,t)}))},t.prototype.Ct=function(t,e){if(!e.allowUrls||!e.allowUrls.length)return!0;var n=this.It(t);return!n||e.allowUrls.some((function(t){return J(n,t)}))},t.prototype._mergeOptions=function(t){return void 0===t&&(t={}),{allowUrls:d(this.at.whitelistUrls||[],this.at.allowUrls||[],t.whitelistUrls||[],t.allowUrls||[]),denyUrls:d(this.at.blacklistUrls||[],this.at.denyUrls||[],t.blacklistUrls||[],t.denyUrls||[]),ignoreErrors:d(this.at.ignoreErrors||[],t.ignoreErrors||[],ne),ignoreInternal:void 0===this.at.ignoreInternal||this.at.ignoreInternal}},t.prototype.Mt=function(t){if(t.message)return[t.message];if(t.exception)try{var e=t.exception.values&&t.exception.values[0]||{},n=e.type,r=void 0===n?"":n,o=e.value,i=void 0===o?"":o;return[""+i,r+": "+i]}catch(e){return N.error("Cannot extract message for event "+vt(t)),[]}return[]},t.prototype.At=function(t){var e,n;void 0===t&&(t=[]);for(var r=t.length-1;r>=0;r--){var o=t[r];if("<anonymous>"!==(null===(e=o)||void 0===e?void 0:e.filename)&&"[native code]"!==(null===(n=o)||void 0===n?void 0:n.filename))return o.filename||null}return null},t.prototype.It=function(t){try{if(t.stacktrace){var e=t.stacktrace.frames;return this.At(e)}if(t.exception){var n=t.exception.values&&t.exception.values[0].stacktrace&&t.exception.values[0].stacktrace.frames;return this.At(n)}return null}catch(e){return N.error("Cannot extract url for event "+vt(t)),null}},t.id="InboundFilters",t}(),oe=Object.freeze({__proto__:null,FunctionToString:ee,InboundFilters:re}),ie="?",se=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ae=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ue=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,ce=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,pe=/\((\S*)(?::(\d+))(?::(\d+))\)/,le=/Minified React error #\d+;/i;function fe(t){var e=null,n=0;t&&("number"==typeof t.framesToPop?n=t.framesToPop:le.test(t.message)&&(n=1));try{if(e=function(t){if(!t||!t.stacktrace)return null;for(var e,n=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,r=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\((.*)\))? in (.*):\s*$/i,o=t.stacktrace.split("\n"),i=[],s=0;s<o.length;s+=2){var a=null;(e=n.exec(o[s]))?a={url:e[2],func:e[3],args:[],line:+e[1],column:null}:(e=r.exec(o[s]))&&(a={url:e[6],func:e[3]||e[4],args:e[5]?e[5].split(","):[],line:+e[1],column:+e[2]}),a&&(!a.func&&a.line&&(a.func=ie),i.push(a))}return i.length?{message:ge(t),name:t.name,stack:i}:null}(t))return he(e,n)}catch(t){}try{if(e=function(t){var e,n;if(!t||!t.stack)return null;for(var r,o,i,s=[],a=t.stack.split("\n"),u=0;u<a.length;++u){if(o=se.exec(a[u])){var c=o[2]&&0===o[2].indexOf("native");o[2]&&0===o[2].indexOf("eval")&&(r=pe.exec(o[2]))&&(o[2]=r[1],o[3]=r[2],o[4]=r[3]);var p=o[2]&&0===o[2].indexOf("address at ")?o[2].substr("address at ".length):o[2],l=o[1]||ie;l=(e=f(de(l,p),2))[0],i={url:p=e[1],func:l,args:c?[o[2]]:[],line:o[3]?+o[3]:null,column:o[4]?+o[4]:null}}else if(o=ue.exec(a[u]))i={url:o[2],func:o[1]||ie,args:[],line:+o[3],column:o[4]?+o[4]:null};else{if(!(o=ae.exec(a[u])))continue;o[3]&&o[3].indexOf(" > eval")>-1&&(r=ce.exec(o[3]))?(o[1]=o[1]||"eval",o[3]=r[1],o[4]=r[2],o[5]=""):0!==u||o[5]||void 0===t.columnNumber||(s[0].column=t.columnNumber+1);p=o[3],l=o[1]||ie;l=(n=f(de(l,p),2))[0],i={url:p=n[1],func:l,args:o[2]?o[2].split(","):[],line:o[4]?+o[4]:null,column:o[5]?+o[5]:null}}!i.func&&i.line&&(i.func=ie),s.push(i)}return s.length?{message:ge(t),name:t.name,stack:s}:null}(t))return he(e,n)}catch(t){}return{message:ge(t),name:t&&t.name,stack:[],failed:!0}}var de=function(t,e){var n=-1!==t.indexOf("safari-extension"),r=-1!==t.indexOf("safari-web-extension");return n||r?[-1!==t.indexOf("@")?t.split("@")[0]:ie,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]};function he(t,e){try{return p(p({},t),{stack:t.stack.slice(e)})}catch(e){return t}}function ge(t){var e=t&&t.message;return e?e.error&&"string"==typeof e.error.message?e.error.message:e:"No error message"}function ve(t){var e=ye(t.stack),n={type:t.name,value:t.message};return e&&e.length&&(n.stacktrace={frames:e}),void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}function _e(t){return{exception:{values:[ve(t)]}}}function ye(t){if(!t||!t.length)return[];var e=t,n=e[0].func||"",r=e[e.length-1].func||"";return-1===n.indexOf("captureMessage")&&-1===n.indexOf("captureException")||(e=e.slice(1)),-1!==r.indexOf("sentryWrapped")&&(e=e.slice(0,-1)),e.slice(0,50).map((function(t){return{colno:null===t.column?void 0:t.column,filename:t.url||e[0].url,function:t.func||"?",in_app:!0,lineno:null===t.line?void 0:t.line}})).reverse()}function me(e,n,r){var o=Se(n,r&&r.syntheticException||void 0,{attachStacktrace:e.attachStacktrace});return yt(o),o.level=t.Severity.Error,r&&r.event_id&&(o.event_id=r.event_id),St.resolve(o)}function be(e,n,r,o){void 0===r&&(r=t.Severity.Info);var i=we(n,o&&o.syntheticException||void 0,{attachStacktrace:e.attachStacktrace});return i.level=r,o&&o.event_id&&(i.event_id=o.event_id),St.resolve(i)}function Se(t,e,n){var r,o;if(void 0===n&&(n={}),y(t)&&t.error)return _e(fe(t=t.error));if(m(t)||(o=t,"[object DOMException]"===Object.prototype.toString.call(o))){var i=t,s=i.name||(m(i)?"DOMError":"DOMException"),a=i.message?s+": "+i.message:s;return _t(r=we(a,e,n),a),"code"in i&&(r.tags=p(p({},r.tags),{"DOMException.code":""+i.code})),r}return _(t)?r=_e(fe(t)):w(t)||k(t)?(yt(r=function(t,e,n){var r={exception:{values:[{type:k(t)?t.constructor.name:n?"UnhandledRejection":"Error",value:"Non-Error "+(n?"promise rejection":"exception")+" captured with keys: "+$(t)}]},extra:{__serialized__:z(t)}};if(e){var o=ye(fe(e).stack);r.stacktrace={frames:o}}return r}(t,e,n.rejection),{synthetic:!0}),r):(_t(r=we(t,e,n),""+t,void 0),yt(r,{synthetic:!0}),r)}function we(t,e,n){void 0===n&&(n={});var r={message:t};if(n.attachStacktrace&&e){var o=ye(fe(e).stack);r.stacktrace={frames:o}}return r}var ke,Ee=v();function Te(){var t,e;if(ke)return ke;if(Z(Ee.fetch))return ke=Ee.fetch.bind(Ee);var n=Ee.document,r=Ee.fetch;if("function"==typeof(null===(t=n)||void 0===t?void 0:t.createElement))try{var o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o),(null===(e=o.contentWindow)||void 0===e?void 0:e.fetch)&&(r=o.contentWindow.fetch),n.head.removeChild(o)}catch(t){N.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return ke=r.bind(Ee)}var xe={event:"error",transaction:"transaction",session:"session",attachment:"attachment"},Oe=v(),Re=function(){function e(t){var e=this;this.options=t,this.D=new wt(30),this.qt={},this.Lt={},this.Ut=new Bt(t.dsn,t.Ht,t.tunnel),this.url=this.Ut.getStoreEndpointWithUrlEncodedAuth(),this.options.sendClientReports&&Oe.document&&Oe.document.addEventListener("visibilitychange",(function(){"hidden"===Oe.document.visibilityState&&e.Ft()}))}return e.prototype.sendEvent=function(t){throw new P("Transport Class has to implement `sendEvent` method")},e.prototype.close=function(t){return this.D.drain(t)},e.prototype.recordLostEvent=function(t,e){var n;if(this.options.sendClientReports){var r=xe[e]+":"+t;N.log("Adding outcome: "+r),this.Lt[r]=(null!=(n=this.Lt[r])?n:0)+1}},e.prototype.Ft=function(){if(this.options.sendClientReports){var t=this.Lt;if(this.Lt={},Object.keys(t).length){N.log("Flushing outcomes:\n"+JSON.stringify(t,null,2));var e=this.Ut.getEnvelopeEndpointWithUrlEncodedAuth(),n=JSON.stringify(p({},this.options.tunnel&&{dsn:this.Ut.getDsn().toString()}))+"\n"+JSON.stringify({type:"client_report"})+"\n"+JSON.stringify({timestamp:xt(),discarded_events:Object.keys(t).map((function(e){var n=f(e.split(":"),2),r=n[0];return{reason:n[1],category:r,quantity:t[e]}}))});try{!function(t,e){if("[object Navigator]"===Object.prototype.toString.call(Ee&&Ee.navigator)&&"function"==typeof Ee.navigator.sendBeacon)return Ee.navigator.sendBeacon.bind(Ee.navigator)(t,e);Y()&&Te()(t,{body:e,method:"POST",credentials:"omit",keepalive:!0}).then(null,(function(t){console.error(t)}))}(e,n)}catch(t){N.error(t)}}else N.log("No outcomes to flush")}},e.prototype.Pt=function(e){var n=e.requestType,r=e.response,o=e.headers,i=e.resolve,s=e.reject,a=t.Status.fromHttpCode(r.status);this.Jt(o)&&N.warn("Too many "+n+" requests, backing off until: "+this.Xt(n)),a!==t.Status.Success?s(r):i({status:a})},e.prototype.Xt=function(t){var e=xe[t];return this.qt[e]||this.qt.all},e.prototype.Bt=function(t){return this.Xt(t)>new Date(Date.now())},e.prototype.Jt=function(t){var e,n,r,o,i=Date.now(),s=t["x-sentry-rate-limits"],a=t["retry-after"];if(s){try{for(var u=l(s.trim().split(",")),c=u.next();!c.done;c=u.next()){var p=c.value.split(":",2),f=parseInt(p[0],10),d=1e3*(isNaN(f)?60:f);try{for(var h=(r=void 0,l(p[1].split(";"))),g=h.next();!g.done;g=h.next()){var v=g.value;this.qt[v||"all"]=new Date(i+d)}}catch(t){r={error:t}}finally{try{g&&!g.done&&(o=h.return)&&o.call(h)}finally{if(r)throw r.error}}}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}return!0}return!!a&&(this.qt.all=new Date(i+function(t,e){if(!e)return 6e4;var n=parseInt(""+e,10);if(!isNaN(n))return 1e3*n;var r=Date.parse(""+e);return isNaN(r)?6e4:r-t}(i,a)),!0)},e}(),Ce=function(t){function e(e,n){void 0===n&&(n=Te());var r=t.call(this,e)||this;return r.Wt=n,r}return n(e,t),e.prototype.sendEvent=function(t){return this.$t(Yt(t,this.Ut),t)},e.prototype.sendSession=function(t){return this.$t(Qt(t,this.Ut),t)},e.prototype.$t=function(t,e){var n=this;if(this.Bt(t.type))return this.recordLostEvent(c.RateLimitBackoff,t.type),Promise.reject({event:e,type:t.type,reason:"Transport for "+t.type+" requests locked till "+this.Xt(t.type)+" due to too many requests.",status:429});var r={body:t.body,method:"POST",referrerPolicy:tt()?"origin":""};return void 0!==this.options.fetchParameters&&Object.assign(r,this.options.fetchParameters),void 0!==this.options.headers&&(r.headers=this.options.headers),this.D.add((function(){return new St((function(e,o){n.Wt(t.url,r).then((function(r){var i={"x-sentry-rate-limits":r.headers.get("X-Sentry-Rate-Limits"),"retry-after":r.headers.get("Retry-After")};n.Pt({requestType:t.type,response:r,headers:i,resolve:e,reject:o})})).catch(o)}))})).then(void 0,(function(e){throw e instanceof P?n.recordLostEvent(c.QueueOverflow,t.type):n.recordLostEvent(c.NetworkError,t.type),e}))},e}(Re),Pe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.sendEvent=function(t){return this.$t(Yt(t,this.Ut),t)},e.prototype.sendSession=function(t){return this.$t(Qt(t,this.Ut),t)},e.prototype.$t=function(t,e){var n=this;return this.Bt(t.type)?(this.recordLostEvent(c.RateLimitBackoff,t.type),Promise.reject({event:e,type:t.type,reason:"Transport for "+t.type+" requests locked till "+this.Xt(t.type)+" due to too many requests.",status:429})):this.D.add((function(){return new St((function(e,r){var o=new XMLHttpRequest;for(var i in o.onreadystatechange=function(){if(4===o.readyState){var i={"x-sentry-rate-limits":o.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":o.getResponseHeader("Retry-After")};n.Pt({requestType:t.type,response:o,headers:i,resolve:e,reject:r})}},o.open("POST",t.url),n.options.headers)Object.prototype.hasOwnProperty.call(n.options.headers,i)&&o.setRequestHeader(i,n.options.headers[i]);o.send(t.body)}))})).then(void 0,(function(e){throw e instanceof P?n.recordLostEvent(c.QueueOverflow,t.type):n.recordLostEvent(c.NetworkError,t.type),e}))},e}(Re),Le=Object.freeze({__proto__:null,BaseTransport:Re,FetchTransport:Ce,XHRTransport:Pe}),Ue=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return n(r,e),r.prototype.eventFromException=function(t,e){return me(this.at,t,e)},r.prototype.eventFromMessage=function(e,n,r){return void 0===n&&(n=t.Severity.Info),be(this.at,e,n,r)},r.prototype.Ot=function(){if(!this.at.dsn)return e.prototype.Ot.call(this);var t=p(p({},this.at.transportOptions),{dsn:this.at.dsn,tunnel:this.at.tunnel,sendClientReports:this.at.sendClientReports,Ht:this.at.Ht});return this.at.transport?new this.at.transport(t):Y()?new Ce(t):new Pe(t)},r}(Xt),je=v(),Ie=0;function Me(){return Ie>0}function Ae(t,e,n){if(void 0===e&&(e={}),"function"!=typeof t)return t;try{if(t.__sentry__)return t;if(t.__sentry_wrapped__)return t.__sentry_wrapped__}catch(e){return t}var r=function(){var r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);var o=r.map((function(t){return Ae(t,e)}));return t.handleEvent?t.handleEvent.apply(this,o):t.apply(this,o)}catch(t){throw Ie+=1,setTimeout((function(){Ie-=1})),Ft((function(o){o.addEventProcessor((function(t){var n=p({},t);return e.mechanism&&(_t(n,void 0,void 0),yt(n,e.mechanism)),n.extra=p(p({},n.extra),{arguments:r}),n})),Wt(t)})),t}};try{for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o])}catch(t){}t.prototype=t.prototype||{},r.prototype=t.prototype,Object.defineProperty(t,"__sentry_wrapped__",{enumerable:!1,value:r}),Object.defineProperties(r,{__sentry__:{enumerable:!1,value:!0},__sentry_original__:{enumerable:!1,value:t}});try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:function(){return t.name}})}catch(t){}return r}function Ne(t){if(void 0===t&&(t={}),je.document)if(t.eventId)if(t.dsn){var e=je.document.createElement("script");e.async=!0,e.src=new Bt(t.dsn).getReportDialogEndpoint(t),t.onLoad&&(e.onload=t.onLoad);var n=je.document.head||je.document.body;n&&n.appendChild(e)}else N.error("Missing dsn option in showReportDialog call");else N.error("Missing eventId option in showReportDialog call")}var De=function(){function e(t){this.name=e.id,this.Gt=!1,this.Kt=!1,this.at=p({onerror:!0,onunhandledrejection:!0},t)}return e.prototype.setupOnce=function(){Error.stackTraceLimit=50,this.at.onerror&&(N.log("Global Handler attached: onerror"),this.zt()),this.at.onunhandledrejection&&(N.log("Global Handler attached: onunhandledrejection"),this.Vt())},e.prototype.zt=function(){var t=this;this.Gt||(it({callback:function(n){var r=n.error,o=Mt(),i=o.getIntegration(e),s=r&&!0===r.__sentry_own_request__;if(i&&!Me()&&!s){var a=o.getClient(),u=void 0===r&&b(n.msg)?t.Qt(n.msg,n.url,n.line,n.column):t.Yt(Se(r||n.msg,void 0,{attachStacktrace:a&&a.getOptions().attachStacktrace,rejection:!1}),n.url,n.line,n.column);yt(u,{handled:!1,type:"onerror"}),o.captureEvent(u,{originalException:r})}},type:"error"}),this.Gt=!0)},e.prototype.Vt=function(){var n=this;this.Kt||(it({callback:function(r){var o=r;try{"reason"in r?o=r.reason:"detail"in r&&"reason"in r.detail&&(o=r.detail.reason)}catch(t){}var i=Mt(),s=i.getIntegration(e),a=o&&!0===o.__sentry_own_request__;if(!s||Me()||a)return!0;var u=i.getClient(),c=S(o)?n.Zt(o):Se(o,void 0,{attachStacktrace:u&&u.getOptions().attachStacktrace,rejection:!0});c.level=t.Severity.Error,yt(c,{handled:!1,type:"onunhandledrejection"}),i.captureEvent(c,{originalException:o})},type:"unhandledrejection"}),this.Kt=!0)},e.prototype.Qt=function(t,e,n,r){var o,i=y(t)?t.message:t,s=i.match(/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i);s&&(o=s[1],i=s[2]);var a={exception:{values:[{type:o||"Error",value:i}]}};return this.Yt(a,e,n,r)},e.prototype.Zt=function(t){return{exception:{values:[{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(t)}]}}},e.prototype.Yt=function(t,e,n,r){t.exception=t.exception||{},t.exception.values=t.exception.values||[],t.exception.values[0]=t.exception.values[0]||{},t.exception.values[0].stacktrace=t.exception.values[0].stacktrace||{},t.exception.values[0].stacktrace.frames=t.exception.values[0].stacktrace.frames||[];var o=isNaN(parseInt(r,10))?void 0:r,i=isNaN(parseInt(n,10))?void 0:n,s=b(e)&&e.length>0?e:function(){var t=v();try{return t.document.location.href}catch(t){return""}}();return 0===t.exception.values[0].stacktrace.frames.length&&t.exception.values[0].stacktrace.frames.push({colno:o,filename:s,function:"?",in_app:!0,lineno:i}),t},e.id="GlobalHandlers",e}(),qe=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],We=function(){function t(e){this.name=t.id,this.at=p({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},e)}return t.prototype.setupOnce=function(){var t=v();this.at.setTimeout&&V(t,"setTimeout",this.tn.bind(this)),this.at.setInterval&&V(t,"setInterval",this.tn.bind(this)),this.at.requestAnimationFrame&&V(t,"requestAnimationFrame",this.nn.bind(this)),this.at.XMLHttpRequest&&"XMLHttpRequest"in t&&V(XMLHttpRequest.prototype,"send",this.rn.bind(this)),this.at.eventTarget&&(Array.isArray(this.at.eventTarget)?this.at.eventTarget:qe).forEach(this.in.bind(this))},t.prototype.tn=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e[0];return e[0]=Ae(r,{mechanism:{data:{function:W(t)},handled:!0,type:"instrument"}}),t.apply(this,e)}},t.prototype.nn=function(t){return function(e){return t.call(this,Ae(e,{mechanism:{data:{function:"requestAnimationFrame",handler:W(t)},handled:!0,type:"instrument"}}))}},t.prototype.in=function(t){var e=v(),n=e[t]&&e[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(V(n,"addEventListener",(function(e){return function(n,r,o){try{"function"==typeof r.handleEvent&&(r.handleEvent=Ae(r.handleEvent.bind(r),{mechanism:{data:{function:"handleEvent",handler:W(r),target:t},handled:!0,type:"instrument"}}))}catch(t){}return e.call(this,n,Ae(r,{mechanism:{data:{function:"addEventListener",handler:W(r),target:t},handled:!0,type:"instrument"}}),o)}})),V(n,"removeEventListener",(function(t){return function(e,n,r){var o,i=n;try{var s=null===(o=i)||void 0===o?void 0:o.__sentry_wrapped__;s&&t.call(this,e,s,r)}catch(t){}return t.call(this,e,i,r)}})))},t.prototype.rn=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((function(t){t in r&&"function"==typeof r[t]&&V(r,t,(function(e){var n={mechanism:{data:{function:t,handler:W(e)},handled:!0,type:"instrument"}};return e.__sentry_original__&&(n.mechanism.data.handler=W(e.__sentry_original__)),Ae(e,n)}))})),t.apply(this,e)}},t.id="TryCatch",t}(),Fe=function(){function e(t){this.name=e.id,this.at=p({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t)}return e.prototype.addSentryBreadcrumb=function(t){this.at.sentry&&Mt().addBreadcrumb({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:vt(t)},{event:t})},e.prototype.setupOnce=function(){var t=this;this.at.console&&it({callback:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.en.apply(t,d(e))},type:"console"}),this.at.dom&&it({callback:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.on.apply(t,d(e))},type:"dom"}),this.at.xhr&&it({callback:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.un.apply(t,d(e))},type:"xhr"}),this.at.fetch&&it({callback:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.sn.apply(t,d(e))},type:"fetch"}),this.at.history&&it({callback:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.an.apply(t,d(e))},type:"history"})},e.prototype.en=function(e){var n={category:"console",data:{arguments:e.args,logger:"console"},level:t.Severity.fromString(e.level),message:B(e.args," ")};if("assert"===e.level){if(!1!==e.args[0])return;n.message="Assertion failed: "+(B(e.args.slice(1)," ")||"console.assert"),n.data.arguments=e.args.slice(1)}Mt().addBreadcrumb(n,{input:e.args,level:e.level})},e.prototype.on=function(t){var e,n="object"==typeof this.at.dom?this.at.dom.serializeAttribute:void 0;"string"==typeof n&&(n=[n]);try{e=t.event.target?O(t.event.target,n):O(t.event,n)}catch(t){e="<unknown>"}0!==e.length&&Mt().addBreadcrumb({category:"ui."+t.name,message:e},{event:t.event,name:t.name,global:t.global})},e.prototype.un=function(t){if(t.endTimestamp){if(t.xhr.__sentry_own_request__)return;var e=t.xhr.__sentry_xhr__||{},n=e.method,r=e.url,o=e.status_code,i=e.body;Mt().addBreadcrumb({category:"xhr",data:{method:n,url:r,status_code:o},type:"http"},{xhr:t.xhr,input:i})}},e.prototype.sn=function(e){e.endTimestamp&&(e.fetchData.url.match(/sentry_key/)&&"POST"===e.fetchData.method||(e.error?Mt().addBreadcrumb({category:"fetch",data:e.fetchData,level:t.Severity.Error,type:"http"},{data:e.error,input:e.args}):Mt().addBreadcrumb({category:"fetch",data:p(p({},e.fetchData),{status_code:e.response.status}),type:"http"},{input:e.args,response:e.response})))},e.prototype.an=function(t){var e=v(),n=t.from,r=t.to,o=gt(e.location.href),i=gt(n),s=gt(r);i.path||(i=o),o.protocol===s.protocol&&o.host===s.host&&(r=s.relative),o.protocol===i.protocol&&o.host===i.host&&(n=i.relative),Mt().addBreadcrumb({category:"navigation",data:{from:n,to:r}})},e.id="Breadcrumbs",e}(),Be=function(){function t(e){void 0===e&&(e={}),this.name=t.id,this.cn=e.key||"cause",this.O=e.limit||5}return t.prototype.setupOnce=function(){Pt((function(e,n){var r=Mt().getIntegration(t);if(r){var o=r.fn&&r.fn.bind(r);return"function"==typeof o?o(e,n):e}return e}))},t.prototype.fn=function(t,e){if(!(t.exception&&t.exception.values&&e&&x(e.originalException,Error)))return t;var n=this.hn(e.originalException,this.cn);return t.exception.values=d(n,t.exception.values),t},t.prototype.hn=function(t,e,n){if(void 0===n&&(n=[]),!x(t[e],Error)||n.length+1>=this.O)return n;var r=ve(fe(t[e]));return this.hn(t[e],e,d([r],n))},t.id="LinkedErrors",t}(),Je=v(),Ve=function(){function t(){this.name=t.id}return t.prototype.setupOnce=function(){Pt((function(e){var n,r,o;if(Mt().getIntegration(t)){if(!Je.navigator&&!Je.location&&!Je.document)return e;var i=(null===(n=e.request)||void 0===n?void 0:n.url)||(null===(r=Je.location)||void 0===r?void 0:r.href),s=(Je.document||{}).referrer,a=(Je.navigator||{}).userAgent,u=p(p(p({},null===(o=e.request)||void 0===o?void 0:o.headers),s&&{Referer:s}),a&&{"User-Agent":a}),c=p(p({},i&&{url:i}),{headers:u});return p(p({},e),{request:c})}return e}))},t.id="UserAgent",t}(),He=function(){function t(){this.name=t.id}return t.prototype.setupOnce=function(e,n){e((function(e){var r=n().getIntegration(t);if(r){try{if(r.Dt(e,r.vn))return N.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(t){return r.vn=e}return r.vn=e}return e}))},t.prototype.Dt=function(t,e){return!(!e||!this.ln(t,e)&&!this.dn(t,e))},t.prototype.ln=function(t,e){var n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!this.pn(t,e)||!this.yn(t,e))},t.prototype.mn=function(t){var e=t.exception;if(e)try{return e.values[0].stacktrace.frames}catch(t){return}else if(t.stacktrace)return t.stacktrace.frames},t.prototype.yn=function(t,e){var n=this.mn(t),r=this.mn(e);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(var o=0;o<r.length;o++){var i=r[o],s=n[o];if(i.filename!==s.filename||i.lineno!==s.lineno||i.colno!==s.colno||i.function!==s.function)return!1}return!0},t.prototype.bn=function(t){return t.exception&&t.exception.values&&t.exception.values[0]},t.prototype.dn=function(t,e){var n=this.bn(e),r=this.bn(t);return!!(n&&r&&n.type===r.type&&n.value===r.value&&this.pn(t,e)&&this.yn(t,e))},t.prototype.pn=function(t,e){var n=t.fingerprint,r=e.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch(t){return!1}},t.id="Dedupe",t}(),ze=Object.freeze({__proto__:null,GlobalHandlers:De,TryCatch:We,Breadcrumbs:Fe,LinkedErrors:Be,UserAgent:Ve,Dedupe:He}),Ke=function(t){function e(e){return void 0===e&&(e={}),e.Ht=e.Ht||{},e.Ht.sdk=e.Ht.sdk||{name:"sentry.javascript.browser",packages:[{name:"npm:@sentry/browser",version:te}],version:te},t.call(this,Ue,e)||this}return n(e,t),e.prototype.showReportDialog=function(t){void 0===t&&(t={}),v().document&&(this.lt()?Ne(p(p({},t),{dsn:t.dsn||this.getDsn()})):N.error("Trying to call showReportDialog with Sentry Client disabled"))},e.prototype.bt=function(e,n,r){return e.platform=e.platform||"javascript",t.prototype.bt.call(this,e,n,r)},e.prototype.jt=function(e){var n=this.getIntegration(Fe);n&&n.addSentryBreadcrumb(e),t.prototype.jt.call(this,e)},e}(zt),Xe=[new re,new ee,new We,new Fe,new De,new Be,new He,new Ve],Ge={},$e=v();$e.Sentry&&$e.Sentry.Integrations&&(Ge=$e.Sentry.Integrations);var Qe=p(p(p({},Ge),oe),ze);return t.BrowserClient=Ke,t.Hub=Ut,t.Integrations=Qe,t.SDK_NAME="sentry.javascript.browser",t.SDK_VERSION=te,t.Scope=Rt,t.Transports=Le,t.addBreadcrumb=function(t){qt("addBreadcrumb",t)},t.addGlobalEventProcessor=Pt,t.captureEvent=function(t){return qt("captureEvent",t)},t.captureException=Wt,t.captureMessage=function(t,e){var n;try{throw new Error(t)}catch(t){n=t}return qt("captureMessage",t,"string"==typeof e?e:void 0,p({originalException:t,syntheticException:n},"string"!=typeof e?{captureContext:e}:void 0))},t.close=function(t){var e=Mt().getClient();return e?e.close(t):(N.warn("Cannot flush events and disable SDK. No client defined."),St.resolve(!1))},t.configureScope=function(t){qt("configureScope",t)},t.defaultIntegrations=Xe,t.eventFromException=me,t.eventFromMessage=be,t.flush=function(t){var e=Mt().getClient();return e?e.flush(t):(N.warn("Cannot flush events. No client defined."),St.resolve(!1))},t.forceLoad=function(){},t.getCurrentHub=Mt,t.getHubFromCarrier=Nt,t.init=function(t){if(void 0===t&&(t={}),void 0===t.defaultIntegrations&&(t.defaultIntegrations=Xe),void 0===t.release){var e=v();e.SENTRY_RELEASE&&e.SENTRY_RELEASE.id&&(t.release=e.SENTRY_RELEASE.id)}void 0===t.autoSessionTracking&&(t.autoSessionTracking=!0),void 0===t.sendClientReports&&(t.sendClientReports=!0),function(t,e){var n;!0===e.debug&&N.enable();var r=Mt();null===(n=r.getScope())||void 0===n||n.update(e.initialScope);var o=new t(e);r.bindClient(o)}(Ke,t),t.autoSessionTracking&&function(){if(void 0!==v().document){var t=Mt();"function"==typeof t.startSession&&"function"==typeof t.captureSession&&(t.startSession({ignoreDuration:!0}),t.captureSession(),it({callback:function(e){var n=e.from,r=e.to;void 0!==n&&n!==r&&(t.startSession({ignoreDuration:!0}),t.captureSession())},type:"history"}))}else N.warn("Session tracking in non-browser environment with @sentry/browser is not supported.")}()},t.injectReportDialog=Ne,t.lastEventId=function(){return Mt().lastEventId()},t.makeMain=It,t.onLoad=function(t){t()},t.setContext=function(t,e){qt("setContext",t,e)},t.setExtra=function(t,e){qt("setExtra",t,e)},t.setExtras=function(t){qt("setExtras",t)},t.setTag=function(t,e){qt("setTag",t,e)},t.setTags=function(t){qt("setTags",t)},t.setUser=function(t){qt("setUser",t)},t.showReportDialog=function(t){void 0===t&&(t={});var e=Mt(),n=e.getScope();n&&(t.user=p(p({},n.getUser()),t.user)),t.eventId||(t.eventId=e.lastEventId());var r=e.getClient();r&&r.showReportDialog(t)},t.startTransaction=function(t,e){return qt("startTransaction",p({},t),e)},t.withScope=Ft,t.wrap=function(t){return Ae(t)()},t}({});
/*! @sentry/browser 6.14.1 (687b6c4) | https://github.com/getsentry/sentry-javascript */(SW=SW||{}).Device={},SW.Device.getOS=()=>{const t=window.navigator.userAgent,e=window.navigator.platform;let n="Unknown";return-1!==["Macintosh","MacIntel","MacPPC","Mac68K"].indexOf(e)?n="macOS":-1!==["iPhone","iPad","iPod"].indexOf(e)?n="iOS":-1!==["Win32","Win64","Windows","WinCE"].indexOf(e)?n="Windows":/Android/.test(t)&&(n="Android"),n},SW.Device.isTablet=()=>SW.Device.isIpad()||/Android/.test(navigator.userAgent)&&!/Mobile/.test(navigator.userAgent),SW.Device.isIpad=()=>null!=navigator.userAgent.match(/iPad/i),SW.Device.isNativeApp=()=>"1"===SW.Utility.getUrlVar("nativeApp"),SW.Device.isNativeIosApp=()=>"1"===SW.Utility.getUrlVar("nativeApp")&&"ios"===SW.Utility.getUrlVar("mobilePlatform"),SW.Device.isNativeAndroidApp=()=>"1"===SW.Utility.getUrlVar("nativeApp")&&("android"===SW.Utility.getUrlVar("mobilePlatform")||"amazon"===SW.Utility.getUrlVar("mobilePlatform")),SW.Device.getMobileVersion=()=>SW.Utility.getUrlVar("nativeVersion")||"",SW.Device.openWebsite=function(t){const e=`https://${t}`;SW.Device.isNativeApp()?window.postMessage(JSON.stringify({type:"OPEN_URL_IN_BROWSER",payload:e}),"*"):"iOS"===SW.Device.getOS()?window.location.href=e:window.open(e)},SW.Device.isWebGLSupported=function(){if("true"===SW.Load.getUrlVariables(window.location.href).webGLqa)return console.log("QA Testing feature is enabled for Canvas Sunsetting"),!1;const t={stencil:!0,failIfMajorPerformanceCaveat:!1};try{if(!window.WebGLRenderingContext)return!1;const e=document.createElement("canvas");let n=e.getContext("webgl",t)||e.getContext("experimental-webgl",t);const r=!(!n||!n.getContextAttributes().stencil);if(n){const t=n.getExtension("WEBGL_lose_context");t&&t.loseContext()}return n=null,r}catch(e){return console.error(e),!1}},(SW=SW||{}).Utility={},SW.Utility.getUrlVars=()=>{var t=decodeURIComponent(window.location.href),e={};t.replace(/[?&]+([^=&]+)=([^&]*)/gi,(function(t,n,r){e[n]=r.replace(/\+/g," ")}));return e},SW.Utility.getUrlVar=function(t){var e=SW.Utility.getUrlVars();for(var n in e)if(n==t)return e[n];return!1};