Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

keycloak-js

Package Overview
Dependencies
Maintainers
2
Versions
150
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

keycloak-js - npm Package Compare versions

Comparing version 18.0.1 to 19.0.0

6

dist/keycloak-authz.js

@@ -9,3 +9,3 @@ (function (global, factory) {

function commonjsRequire (path) {
function commonjsRequire(path) {
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');

@@ -17,4 +17,4 @@ }

(function (module, exports) {
!function(t,e){module.exports=e();}(commonjsGlobal,function(){function t(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function e(t){return "function"==typeof t}function n(t){W=t;}function r(t){z=t;}function o(){return function(){return process.nextTick(a)}}function i(){return "undefined"!=typeof U?function(){U(a);}:c()}function s(){var t=0,e=new H(a),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2;}}function u(){var t=new MessageChannel;return t.port1.onmessage=a,function(){return t.port2.postMessage(0)}}function c(){var t=setTimeout;return function(){return t(a,1)}}function a(){for(var t=0;t<N;t+=2){var e=Q[t],n=Q[t+1];e(n),Q[t]=void 0,Q[t+1]=void 0;}N=0;}function f(){try{var t=Function("return this")().require("vertx");return U=t.runOnLoop||t.runOnContext,i()}catch(e){return c()}}function l(t,e){var n=this,r=new this.constructor(v);void 0===r[V]&&x(r);var o=n._state;if(o){var i=arguments[o-1];z(function(){return T(o,r,i,n._result)});}else j(n,r,t,e);return r}function h(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(v);return w(n,t),n}function v(){}function p(){return new TypeError("You cannot resolve a promise with itself")}function d(){return new TypeError("A promises callback cannot return that same promise.")}function _(t,e,n,r){try{t.call(e,n,r);}catch(o){return o}}function y(t,e,n){z(function(t){var r=!1,o=_(n,e,function(n){r||(r=!0,e!==n?w(t,n):A(t,n));},function(e){r||(r=!0,S(t,e));},"Settle: "+(t._label||" unknown promise"));!r&&o&&(r=!0,S(t,o));},t);}function m(t,e){e._state===Z?A(t,e._result):e._state===$?S(t,e._result):j(e,void 0,function(e){return w(t,e)},function(e){return S(t,e)});}function b(t,n,r){n.constructor===t.constructor&&r===l&&n.constructor.resolve===h?m(t,n):void 0===r?A(t,n):e(r)?y(t,n,r):A(t,n);}function w(e,n){if(e===n)S(e,p());else if(t(n)){var r=void 0;try{r=n.then;}catch(o){return void S(e,o)}b(e,n,r);}else A(e,n);}function g(t){t._onerror&&t._onerror(t._result),E(t);}function A(t,e){t._state===X&&(t._result=e,t._state=Z,0!==t._subscribers.length&&z(E,t));}function S(t,e){t._state===X&&(t._state=$,t._result=e,z(g,t));}function j(t,e,n,r){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+Z]=n,o[i+$]=r,0===i&&t._state&&z(E,t);}function E(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,o=void 0,i=t._result,s=0;s<e.length;s+=3)r=e[s],o=e[s+n],r?T(n,r,o,i):o(i);t._subscribers.length=0;}}function T(t,n,r,o){var i=e(r),s=void 0,u=void 0,c=!0;if(i){try{s=r(o);}catch(a){c=!1,u=a;}if(n===s)return void S(n,d())}else s=o;n._state!==X||(i&&c?w(n,s):c===!1?S(n,u):t===Z?A(n,s):t===$&&S(n,s));}function M(t,e){try{e(function(e){w(t,e);},function(e){S(t,e);});}catch(n){S(t,n);}}function P(){return tt++}function x(t){t[V]=tt++,t._state=void 0,t._result=void 0,t._subscribers=[];}function C(){return new Error("Array Methods must be provided an Array")}function O(t){return new et(this,t).promise}function k(t){var e=this;return new e(L(t)?function(n,r){for(var o=t.length,i=0;i<o;i++)e.resolve(t[i]).then(n,r);}:function(t,e){return e(new TypeError("You must pass an array to race."))})}function F(t){var e=this,n=new e(v);return S(n,t),n}function Y(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function q(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function D(){var t=void 0;if("undefined"!=typeof commonjsGlobal)t=commonjsGlobal;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")();}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=t.Promise;if(n){var r=null;try{r=Object.prototype.toString.call(n.resolve());}catch(e){}if("[object Promise]"===r&&!n.cast)return}t.Promise=nt;}var K=void 0;K=Array.isArray?Array.isArray:function(t){return "[object Array]"===Object.prototype.toString.call(t)};var L=K,N=0,U=void 0,W=void 0,z=function(t,e){Q[N]=t,Q[N+1]=e,N+=2,2===N&&(W?W(a):R());},B="undefined"!=typeof window?window:void 0,G=B||{},H=G.MutationObserver||G.WebKitMutationObserver,I="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),J="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,Q=new Array(1e3),R=void 0;R=I?o():H?s():J?u():void 0===B&&"function"==typeof commonjsRequire?f():c();var V=Math.random().toString(36).substring(2),X=void 0,Z=1,$=2,tt=0,et=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(v),this.promise[V]||x(this.promise),L(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?A(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&A(this.promise,this._result))):S(this.promise,C());}return t.prototype._enumerate=function(t){for(var e=0;this._state===X&&e<t.length;e++)this._eachEntry(t[e],e);},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===h){var o=void 0,i=void 0,s=!1;try{o=t.then;}catch(u){s=!0,i=u;}if(o===l&&t._state!==X)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(n===nt){var c=new n(v);s?S(c,i):b(c,t,o),this._willSettleAt(c,e);}else this._willSettleAt(new n(function(e){return e(t)}),e);}else this._willSettleAt(r(t),e);},t.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===X&&(this._remaining--,t===$?S(r,n):this._result[e]=n),0===this._remaining&&A(r,this._result);},t.prototype._willSettleAt=function(t,e){var n=this;j(t,void 0,function(t){return n._settledAt(Z,e,t)},function(t){return n._settledAt($,e,t)});},t}(),nt=function(){function t(e){this[V]=P(),this._result=this._state=void 0,this._subscribers=[],v!==e&&("function"!=typeof e&&Y(),this instanceof t?M(this,e):q());}return t.prototype["catch"]=function(t){return this.then(null,t)},t.prototype["finally"]=function(t){var n=this,r=n.constructor;return e(t)?n.then(function(e){return r.resolve(t()).then(function(){return e})},function(e){return r.resolve(t()).then(function(){throw e})}):n.then(t,t)},t}();return nt.prototype.then=l,nt.all=O,nt.race=k,nt.resolve=h,nt.reject=F,nt._setScheduler=n,nt._setAsap=r,nt._asap=z,nt.polyfill=D,nt.Promise=nt,nt});
}(es6Promise_min));
!function(t,e){module.exports=e();}(commonjsGlobal,function(){function t(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function e(t){return "function"==typeof t}function n(t){W=t;}function r(t){z=t;}function o(){return function(){return process.nextTick(a)}}function i(){return "undefined"!=typeof U?function(){U(a);}:c()}function s(){var t=0,e=new H(a),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2;}}function u(){var t=new MessageChannel;return t.port1.onmessage=a,function(){return t.port2.postMessage(0)}}function c(){var t=setTimeout;return function(){return t(a,1)}}function a(){for(var t=0;t<N;t+=2){var e=Q[t],n=Q[t+1];e(n),Q[t]=void 0,Q[t+1]=void 0;}N=0;}function f(){try{var t=Function("return this")().require("vertx");return U=t.runOnLoop||t.runOnContext,i()}catch(e){return c()}}function l(t,e){var n=this,r=new this.constructor(v);void 0===r[V]&&x(r);var o=n._state;if(o){var i=arguments[o-1];z(function(){return T(o,r,i,n._result)});}else j(n,r,t,e);return r}function h(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(v);return w(n,t),n}function v(){}function p(){return new TypeError("You cannot resolve a promise with itself")}function d(){return new TypeError("A promises callback cannot return that same promise.")}function _(t,e,n,r){try{t.call(e,n,r);}catch(o){return o}}function y(t,e,n){z(function(t){var r=!1,o=_(n,e,function(n){r||(r=!0,e!==n?w(t,n):A(t,n));},function(e){r||(r=!0,S(t,e));},"Settle: "+(t._label||" unknown promise"));!r&&o&&(r=!0,S(t,o));},t);}function m(t,e){e._state===Z?A(t,e._result):e._state===$?S(t,e._result):j(e,void 0,function(e){return w(t,e)},function(e){return S(t,e)});}function b(t,n,r){n.constructor===t.constructor&&r===l&&n.constructor.resolve===h?m(t,n):void 0===r?A(t,n):e(r)?y(t,n,r):A(t,n);}function w(e,n){if(e===n)S(e,p());else if(t(n)){var r=void 0;try{r=n.then;}catch(o){return void S(e,o)}b(e,n,r);}else A(e,n);}function g(t){t._onerror&&t._onerror(t._result),E(t);}function A(t,e){t._state===X&&(t._result=e,t._state=Z,0!==t._subscribers.length&&z(E,t));}function S(t,e){t._state===X&&(t._state=$,t._result=e,z(g,t));}function j(t,e,n,r){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+Z]=n,o[i+$]=r,0===i&&t._state&&z(E,t);}function E(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,o=void 0,i=t._result,s=0;s<e.length;s+=3)r=e[s],o=e[s+n],r?T(n,r,o,i):o(i);t._subscribers.length=0;}}function T(t,n,r,o){var i=e(r),s=void 0,u=void 0,c=!0;if(i){try{s=r(o);}catch(a){c=!1,u=a;}if(n===s)return void S(n,d())}else s=o;n._state!==X||(i&&c?w(n,s):c===!1?S(n,u):t===Z?A(n,s):t===$&&S(n,s));}function M(t,e){try{e(function(e){w(t,e);},function(e){S(t,e);});}catch(n){S(t,n);}}function P(){return tt++}function x(t){t[V]=tt++,t._state=void 0,t._result=void 0,t._subscribers=[];}function C(){return new Error("Array Methods must be provided an Array")}function O(t){return new et(this,t).promise}function k(t){var e=this;return new e(L(t)?function(n,r){for(var o=t.length,i=0;i<o;i++)e.resolve(t[i]).then(n,r);}:function(t,e){return e(new TypeError("You must pass an array to race."))})}function F(t){var e=this,n=new e(v);return S(n,t),n}function Y(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function q(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function D(){var t=void 0;if("undefined"!=typeof commonjsGlobal)t=commonjsGlobal;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")();}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=t.Promise;if(n){var r=null;try{r=Object.prototype.toString.call(n.resolve());}catch(e){}if("[object Promise]"===r&&!n.cast)return}t.Promise=nt;}var K=void 0;K=Array.isArray?Array.isArray:function(t){return "[object Array]"===Object.prototype.toString.call(t)};var L=K,N=0,U=void 0,W=void 0,z=function(t,e){Q[N]=t,Q[N+1]=e,N+=2,2===N&&(W?W(a):R());},B="undefined"!=typeof window?window:void 0,G=B||{},H=G.MutationObserver||G.WebKitMutationObserver,I="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),J="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,Q=new Array(1e3),R=void 0;R=I?o():H?s():J?u():void 0===B&&"function"==typeof commonjsRequire?f():c();var V=Math.random().toString(36).substring(2),X=void 0,Z=1,$=2,tt=0,et=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(v),this.promise[V]||x(this.promise),L(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?A(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&A(this.promise,this._result))):S(this.promise,C());}return t.prototype._enumerate=function(t){for(var e=0;this._state===X&&e<t.length;e++)this._eachEntry(t[e],e);},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===h){var o=void 0,i=void 0,s=!1;try{o=t.then;}catch(u){s=!0,i=u;}if(o===l&&t._state!==X)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(n===nt){var c=new n(v);s?S(c,i):b(c,t,o),this._willSettleAt(c,e);}else this._willSettleAt(new n(function(e){return e(t)}),e);}else this._willSettleAt(r(t),e);},t.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===X&&(this._remaining--,t===$?S(r,n):this._result[e]=n),0===this._remaining&&A(r,this._result);},t.prototype._willSettleAt=function(t,e){var n=this;j(t,void 0,function(t){return n._settledAt(Z,e,t)},function(t){return n._settledAt($,e,t)});},t}(),nt=function(){function t(e){this[V]=P(),this._result=this._state=void 0,this._subscribers=[],v!==e&&("function"!=typeof e&&Y(),this instanceof t?M(this,e):q());}return t.prototype["catch"]=function(t){return this.then(null,t)},t.prototype["finally"]=function(t){var n=this,r=n.constructor;return e(t)?n.then(function(e){return r.resolve(t()).then(function(){return e})},function(e){return r.resolve(t()).then(function(){throw e})}):n.then(t,t)},t}();return nt.prototype.then=l,nt.all=O,nt.race=k,nt.resolve=h,nt.reject=F,nt._setScheduler=n,nt._setAsap=r,nt._asap=z,nt.polyfill=D,nt.Promise=nt,nt});
} (es6Promise_min));

@@ -21,0 +21,0 @@ /*

@@ -154,3 +154,3 @@ /*

* Silent check-sso will only happen, when this redirect uri is given and
* the specified uri is available whithin the application.
* the specified uri is available within the application.
*/

@@ -186,2 +186,9 @@ silentCheckSsoRedirectUri?: string;

/**
* Set the default scope parameter to the login endpoint. Use a space-delimited list of scopes.
* Note that the scope 'openid' will be always be added to the list of scopes by the adapter.
* Note that the default scope specified here is overwritten if the `login()` options specify scope explicitly.
*/
scope?: string
/**
* Configures how long will Keycloak adapter wait for receiving messages from server in ms. This is used,

@@ -188,0 +195,0 @@ * for example, when waiting for response of 3rd party cookies check.

@@ -9,3 +9,3 @@ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("keycloak",t):(e="undefined"!=typeof globalThis?globalThis:e||self).Keycloak=t()}(this,(function(){"use strict";var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var es6Promise_min={exports:{}};!function(e,t){e.exports=function(){function e(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function t(e){return"function"==typeof e}function r(e){F=e}function n(e){K=e}function o(){return function(){return process.nextTick(u)}}function i(){return void 0!==B?function(){B(u)}:c()}function s(){var e=0,t=new q(u),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function a(){var e=new MessageChannel;return e.port1.onmessage=u,function(){return e.port2.postMessage(0)}}function c(){var e=setTimeout;return function(){return e(u,1)}}function u(){for(var e=0;e<j;e+=2)(0,V[e])(V[e+1]),V[e]=void 0,V[e+1]=void 0;j=0}function l(){try{var e=Function("return this")().require("vertx");return B=e.runOnLoop||e.runOnContext,i()}catch(e){return c()}}function h(e,t){var r=this,n=new this.constructor(f);void 0===n[G]&&U(n);var o=r._state;if(o){var i=arguments[o-1];K((function(){return E(o,n,i,r._result)}))}else A(r,n,e,t);return n}function d(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var r=new t(f);return _(r,e),r}function f(){}function p(){return new TypeError("You cannot resolve a promise with itself")}function m(){return new TypeError("A promises callback cannot return that same promise.")}function v(e,t,r,n){try{e.call(t,r,n)}catch(e){return e}}function k(e,t,r){K((function(e){var n=!1,o=v(r,t,(function(r){n||(n=!0,t!==r?_(e,r):S(e,r))}),(function(t){n||(n=!0,b(e,t))}),"Settle: "+(e._label||" unknown promise"));!n&&o&&(n=!0,b(e,o))}),e)}function g(e,t){t._state===Q?S(e,t._result):t._state===Z?b(e,t._result):A(t,void 0,(function(t){return _(e,t)}),(function(t){return b(e,t)}))}function y(e,r,n){r.constructor===e.constructor&&n===h&&r.constructor.resolve===d?g(e,r):void 0===n?S(e,r):t(n)?k(e,r,n):S(e,r)}function _(t,r){if(t===r)b(t,p());else if(e(r)){var n=void 0;try{n=r.then}catch(e){return void b(t,e)}y(t,r,n)}else S(t,r)}function w(e){e._onerror&&e._onerror(e._result),R(e)}function S(e,t){e._state===$&&(e._result=t,e._state=Q,0!==e._subscribers.length&&K(R,e))}function b(e,t){e._state===$&&(e._state=Z,e._result=t,K(w,e))}function A(e,t,r,n){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=t,o[i+Q]=r,o[i+Z]=n,0===i&&e._state&&K(R,e)}function R(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var n=void 0,o=void 0,i=e._result,s=0;s<t.length;s+=3)n=t[s],o=t[s+r],n?E(r,n,o,i):o(i);e._subscribers.length=0}}function E(e,r,n,o){var i=t(n),s=void 0,a=void 0,c=!0;if(i){try{s=n(o)}catch(e){c=!1,a=e}if(r===s)return void b(r,m())}else s=o;r._state!==$||(i&&c?_(r,s):!1===c?b(r,a):e===Q?S(r,s):e===Z&&b(r,s))}function H(e,t){try{t((function(t){_(e,t)}),(function(t){b(e,t)}))}catch(t){b(e,t)}}function C(){return ee++}function U(e){e[G]=ee++,e._state=void 0,e._result=void 0,e._subscribers=[]}function T(){return new Error("Array Methods must be provided an Array")}function O(e){return new te(this,e).promise}function I(e){var t=this;return new t(N(e)?function(r,n){for(var o=e.length,i=0;i<o;i++)t.resolve(e[i]).then(r,n)}:function(e,t){return t(new TypeError("You must pass an array to race."))})}function L(e){var t=new this(f);return b(t,e),t}function x(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function P(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function X(){var e=void 0;if(void 0!==commonjsGlobal)e=commonjsGlobal;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var r=null;try{r=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===r&&!t.cast)return}e.Promise=re}var M=void 0;M=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var N=M,j=0,B=void 0,F=void 0,K=function(e,t){V[j]=e,V[j+1]=t,2===(j+=2)&&(F?F(u):z())},D="undefined"!=typeof window?window:void 0,J=D||{},q=J.MutationObserver||J.WebKitMutationObserver,Y="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),W="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,V=new Array(1e3),z=void 0;z=Y?o():q?s():W?a():void 0===D&&"function"==typeof commonjsRequire?l():c();var G=Math.random().toString(36).substring(2),$=void 0,Q=1,Z=2,ee=0,te=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(f),this.promise[G]||U(this.promise),N(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?S(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&S(this.promise,this._result))):b(this.promise,T())}return e.prototype._enumerate=function(e){for(var t=0;this._state===$&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var r=this._instanceConstructor,n=r.resolve;if(n===d){var o=void 0,i=void 0,s=!1;try{o=e.then}catch(e){s=!0,i=e}if(o===h&&e._state!==$)this._settledAt(e._state,t,e._result);else if("function"!=typeof o)this._remaining--,this._result[t]=e;else if(r===re){var a=new r(f);s?b(a,i):y(a,e,o),this._willSettleAt(a,t)}else this._willSettleAt(new r((function(t){return t(e)})),t)}else this._willSettleAt(n(e),t)},e.prototype._settledAt=function(e,t,r){var n=this.promise;n._state===$&&(this._remaining--,e===Z?b(n,r):this._result[t]=r),0===this._remaining&&S(n,this._result)},e.prototype._willSettleAt=function(e,t){var r=this;A(e,void 0,(function(e){return r._settledAt(Q,t,e)}),(function(e){return r._settledAt(Z,t,e)}))},e}(),re=function(){function e(t){this[G]=C(),this._result=this._state=void 0,this._subscribers=[],f!==t&&("function"!=typeof t&&x(),this instanceof e?H(this,t):P())}return e.prototype.catch=function(e){return this.then(null,e)},e.prototype.finally=function(e){var r=this,n=r.constructor;return t(e)?r.then((function(t){return n.resolve(e()).then((function(){return t}))}),(function(t){return n.resolve(e()).then((function(){throw t}))})):r.then(e,e)},e}();return re.prototype.then=h,re.all=O,re.race=I,re.resolve=d,re.reject=L,re._setScheduler=r,re._setAsap=n,re._asap=K,re.polyfill=X,re.Promise=re,re}()}(es6Promise_min);var base64Js={};base64Js.byteLength=byteLength,base64Js.toByteArray=toByteArray,base64Js.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;function getLens(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function byteLength(e){var t=getLens(e),r=t[0],n=t[1];return 3*(r+n)/4-n}function _byteLength(e,t,r){return 3*(t+r)/4-r}function toByteArray(e){var t,r,n=getLens(e),o=n[0],i=n[1],s=new Arr(_byteLength(e,o,i)),a=0,c=i>0?o-4:o;for(r=0;r<c;r+=4)t=revLookup[e.charCodeAt(r)]<<18|revLookup[e.charCodeAt(r+1)]<<12|revLookup[e.charCodeAt(r+2)]<<6|revLookup[e.charCodeAt(r+3)],s[a++]=t>>16&255,s[a++]=t>>8&255,s[a++]=255&t;return 2===i&&(t=revLookup[e.charCodeAt(r)]<<2|revLookup[e.charCodeAt(r+1)]>>4,s[a++]=255&t),1===i&&(t=revLookup[e.charCodeAt(r)]<<10|revLookup[e.charCodeAt(r+1)]<<4|revLookup[e.charCodeAt(r+2)]>>2,s[a++]=t>>8&255,s[a++]=255&t),s}function tripletToBase64(e){return lookup[e>>18&63]+lookup[e>>12&63]+lookup[e>>6&63]+lookup[63&e]}function encodeChunk(e,t,r){for(var n,o=[],i=t;i<r;i+=3)n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(tripletToBase64(n));return o.join("")}function fromByteArray(e){for(var t,r=e.length,n=r%3,o=[],i=16383,s=0,a=r-n;s<a;s+=i)o.push(encodeChunk(e,s,s+i>a?a:s+i));return 1===n?(t=e[r-1],o.push(lookup[t>>2]+lookup[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],o.push(lookup[t>>10]+lookup[t>>4&63]+lookup[t<<2&63]+"=")),o.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;var sha256$1={exports:{}};

* @license MIT
*/(function(module){(function(){var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS?root=commonjsGlobal:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&module.exports,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];!root.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!ARRAY_BUFFER||!root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e,t){return function(r){return new Sha256(t,!0).update(r)[e]()}},createMethod=function(e){var t=createOutputMethod("hex",e);NODE_JS&&(t=nodeWrap(t,e)),t.create=function(){return new Sha256(e)},t.update=function(e){return t.create().update(e)};for(var r=0;r<OUTPUT_TYPES.length;++r){var n=OUTPUT_TYPES[r];t[n]=createOutputMethod(n,e)}return t},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(e){if("string"==typeof e)return crypto.createHash(algorithm).update(e,"utf8").digest("hex");if(null==e)throw new Error(ERROR);return e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),Array.isArray(e)||ArrayBuffer.isView(e)||e.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(e)).digest("hex"):method(e)};return nodeMethod},createHmacOutputMethod=function(e,t){return function(r,n){return new HmacSha256(r,t,!0).update(n)[e]()}},createHmacMethod=function(e){var t=createHmacOutputMethod("hex",e);t.create=function(t){return new HmacSha256(t,e)},t.update=function(e,r){return t.create(e).update(r)};for(var r=0;r<OUTPUT_TYPES.length;++r){var n=OUTPUT_TYPES[r];t[n]=createHmacOutputMethod(n,e)}return t};function Sha256(e,t){t?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=e}function HmacSha256(e,t,r){var n,o=typeof e;if("string"===o){var i,s=[],a=e.length,c=0;for(n=0;n<a;++n)(i=e.charCodeAt(n))<128?s[c++]=i:i<2048?(s[c++]=192|i>>6,s[c++]=128|63&i):i<55296||i>=57344?(s[c++]=224|i>>12,s[c++]=128|i>>6&63,s[c++]=128|63&i):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++n)),s[c++]=240|i>>18,s[c++]=128|i>>12&63,s[c++]=128|i>>6&63,s[c++]=128|63&i);e=s}else{if("object"!==o)throw new Error(ERROR);if(null===e)throw new Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||ARRAY_BUFFER&&ArrayBuffer.isView(e)))throw new Error(ERROR)}e.length>64&&(e=new Sha256(t,!0).update(e).array());var u=[],l=[];for(n=0;n<64;++n){var h=e[n]||0;u[n]=92^h,l[n]=54^h}Sha256.call(this,t,r),this.update(l),this.oKeyPad=u,this.inner=!0,this.sharedMemory=r}Sha256.prototype.update=function(e){if(!this.finalized){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(ERROR);if(null===e)throw new Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||ARRAY_BUFFER&&ArrayBuffer.isView(e)))throw new Error(ERROR);t=!0}for(var n,o,i=0,s=e.length,a=this.blocks;i<s;){if(this.hashed&&(this.hashed=!1,a[0]=this.block,a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),t)for(o=this.start;i<s&&o<64;++i)a[o>>2]|=e[i]<<SHIFT[3&o++];else for(o=this.start;i<s&&o<64;++i)(n=e.charCodeAt(i))<128?a[o>>2]|=n<<SHIFT[3&o++]:n<2048?(a[o>>2]|=(192|n>>6)<<SHIFT[3&o++],a[o>>2]|=(128|63&n)<<SHIFT[3&o++]):n<55296||n>=57344?(a[o>>2]|=(224|n>>12)<<SHIFT[3&o++],a[o>>2]|=(128|n>>6&63)<<SHIFT[3&o++],a[o>>2]|=(128|63&n)<<SHIFT[3&o++]):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++i)),a[o>>2]|=(240|n>>18)<<SHIFT[3&o++],a[o>>2]|=(128|n>>12&63)<<SHIFT[3&o++],a[o>>2]|=(128|n>>6&63)<<SHIFT[3&o++],a[o>>2]|=(128|63&n)<<SHIFT[3&o++]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.block=a[16],this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>2]|=EXTRA[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var e,t,r,n,o,i,s,a,c,u=this.h0,l=this.h1,h=this.h2,d=this.h3,f=this.h4,p=this.h5,m=this.h6,v=this.h7,k=this.blocks;for(e=16;e<64;++e)t=((o=k[e-15])>>>7|o<<25)^(o>>>18|o<<14)^o>>>3,r=((o=k[e-2])>>>17|o<<15)^(o>>>19|o<<13)^o>>>10,k[e]=k[e-16]+t+k[e-7]+r<<0;for(c=l&h,e=0;e<64;e+=4)this.first?(this.is224?(i=300032,v=(o=k[0]-1413257819)-150054599<<0,d=o+24177077<<0):(i=704751109,v=(o=k[0]-210244248)-1521486534<<0,d=o+143694565<<0),this.first=!1):(t=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),n=(i=u&l)^u&h^c,v=d+(o=v+(r=(f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(f&p^~f&m)+K[e]+k[e])<<0,d=o+(t+n)<<0),t=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),n=(s=d&u)^d&l^i,m=h+(o=m+(r=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+(v&f^~v&p)+K[e+1]+k[e+1])<<0,t=((h=o+(t+n)<<0)>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),n=(a=h&d)^h&u^s,p=l+(o=p+(r=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&v^~m&f)+K[e+2]+k[e+2])<<0,t=((l=o+(t+n)<<0)>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),n=(c=l&h)^l&d^a,f=u+(o=f+(r=(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&m^~p&v)+K[e+3]+k[e+3])<<0,u=o+(t+n)<<0;this.h0=this.h0+u<<0,this.h1=this.h1+l<<0,this.h2=this.h2+h<<0,this.h3=this.h3+d<<0,this.h4=this.h4+f<<0,this.h5=this.h5+p<<0,this.h6=this.h6+m<<0,this.h7=this.h7+v<<0},Sha256.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,o=this.h4,i=this.h5,s=this.h6,a=this.h7,c=HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[15&o]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[15&s];return this.is224||(c+=HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[15&a]),c},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,o=this.h4,i=this.h5,s=this.h6,a=this.h7,c=[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24&255,r>>16&255,r>>8&255,255&r,n>>24&255,n>>16&255,n>>8&255,255&n,o>>24&255,o>>16&255,o>>8&255,255&o,i>>24&255,i>>16&255,i>>8&255,255&i,s>>24&255,s>>16&255,s>>8&255,255&s];return this.is224||c.push(a>>24&255,a>>16&255,a>>8&255,255&a),c},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224)})()})(sha256$1);var sha256=sha256$1.exports;if(void 0===es6Promise_min.exports.Promise)throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");var loggedPromiseDeprecation=!1;function logPromiseDeprecation(){loggedPromiseDeprecation||(loggedPromiseDeprecation=!0,console.warn("[KEYCLOAK] Usage of legacy style promise methods such as `.error()` and `.success()` has been deprecated and support will be removed in future versions. Use standard style promise methods such as `.then() and `.catch()` instead."))}function Keycloak(e){if(!(this instanceof Keycloak))return new Keycloak(e);for(var t,r,n=this,o=[],i={enable:!0,callbackList:[],interval:5},s=document.getElementsByTagName("script"),a=0;a<s.length;a++)-1===s[a].src.indexOf("keycloak.js")&&-1===s[a].src.indexOf("keycloak.min.js")||-1===s[a].src.indexOf("version=")||(n.iframeVersion=s[a].src.substring(s[a].src.indexOf("version=")+8).split("&")[0]);var c=!0,u=C(console.info),l=C(console.warn);function h(e,t){for(var r=function(e){var t=null,r=window.crypto||window.msCrypto;if(r&&r.getRandomValues&&window.Uint8Array)return t=new Uint8Array(e),r.getRandomValues(t),t;t=new Array(e);for(var n=0;n<t.length;n++)t[n]=Math.floor(256*Math.random());return t}(e),n=new Array(e),o=0;o<e;o++)n[o]=t.charCodeAt(r[o]%t.length);return String.fromCharCode.apply(null,n)}function d(){return void 0!==n.authServerUrl?"/"==n.authServerUrl.charAt(n.authServerUrl.length-1)?n.authServerUrl+"realms/"+encodeURIComponent(n.realm):n.authServerUrl+"/realms/"+encodeURIComponent(n.realm):void 0}function f(e,t){var r=e.code,o=e.error,i=e.prompt,s=(new Date).getTime();if(e.kc_action_status&&n.onActionUpdate&&n.onActionUpdate(e.kc_action_status),o)if("none"!=i){var a={error:o,error_description:e.error_description};n.onAuthError&&n.onAuthError(a),t&&t.setError(a)}else t&&t.setSuccess();else if("standard"!=n.flow&&(e.access_token||e.id_token)&&f(e.access_token,null,e.id_token,!0),"implicit"!=n.flow&&r){var l="code="+r+"&grant_type=authorization_code",h=n.endpoints.token(),d=new XMLHttpRequest;d.open("POST",h,!0),d.setRequestHeader("Content-type","application/x-www-form-urlencoded"),l+="&client_id="+encodeURIComponent(n.clientId),l+="&redirect_uri="+e.redirectUri,e.pkceCodeVerifier&&(l+="&code_verifier="+e.pkceCodeVerifier),d.withCredentials=!0,d.onreadystatechange=function(){if(4==d.readyState)if(200==d.status){var e=JSON.parse(d.responseText);f(e.access_token,e.refresh_token,e.id_token,"standard"===n.flow),S()}else n.onAuthError&&n.onAuthError(),t&&t.setError()},d.send(l)}function f(r,o,i,a){m(r,o,i,s=(s+(new Date).getTime())/2),c&&(n.tokenParsed&&n.tokenParsed.nonce!=e.storedNonce||n.refreshTokenParsed&&n.refreshTokenParsed.nonce!=e.storedNonce||n.idTokenParsed&&n.idTokenParsed.nonce!=e.storedNonce)?(u("[KEYCLOAK] Invalid nonce, clearing token"),n.clearToken(),t&&t.setError()):a&&(n.onAuthSuccess&&n.onAuthSuccess(),t&&t.setSuccess())}}function p(e){return 0==e.status&&e.responseText&&e.responseURL.startsWith("file:")}function m(e,t,r,o){if(n.tokenTimeoutHandle&&(clearTimeout(n.tokenTimeoutHandle),n.tokenTimeoutHandle=null),t?(n.refreshToken=t,n.refreshTokenParsed=v(t)):(delete n.refreshToken,delete n.refreshTokenParsed),r?(n.idToken=r,n.idTokenParsed=v(r)):(delete n.idToken,delete n.idTokenParsed),e){if(n.token=e,n.tokenParsed=v(e),n.sessionId=n.tokenParsed.session_state,n.authenticated=!0,n.subject=n.tokenParsed.sub,n.realmAccess=n.tokenParsed.realm_access,n.resourceAccess=n.tokenParsed.resource_access,o&&(n.timeSkew=Math.floor(o/1e3)-n.tokenParsed.iat),null!=n.timeSkew&&(u("[KEYCLOAK] Estimated time difference between browser and server is "+n.timeSkew+" seconds"),n.onTokenExpired)){var i=1e3*(n.tokenParsed.exp-(new Date).getTime()/1e3+n.timeSkew);u("[KEYCLOAK] Token expires in "+Math.round(i/1e3)+" s"),i<=0?n.onTokenExpired():n.tokenTimeoutHandle=setTimeout(n.onTokenExpired,i)}}else delete n.token,delete n.tokenParsed,delete n.subject,delete n.realmAccess,delete n.resourceAccess,n.authenticated=!1}function v(e){switch((e=(e=(e=e.split(".")[1]).replace(/-/g,"+")).replace(/_/g,"/")).length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw"Invalid token"}return e=decodeURIComponent(escape(atob(e))),e=JSON.parse(e)}function k(){var e="0123456789abcdef",t=h(36,e).split("");return t[14]="4",t[19]=e.substr(3&t[19]|8,1),t[8]=t[13]=t[18]=t[23]="-",t.join("")}function g(e){var t=function(e){var t;switch(n.flow){case"standard":t=["code","state","session_state","kc_action_status"];break;case"implicit":t=["access_token","token_type","id_token","state","session_state","expires_in","kc_action_status"];break;case"hybrid":t=["access_token","token_type","id_token","code","state","session_state","expires_in","kc_action_status"]}t.push("error"),t.push("error_description"),t.push("error_uri");var r,o,i=e.indexOf("?"),s=e.indexOf("#");"query"===n.responseMode&&-1!==i?(r=e.substring(0,i),""!==(o=y(e.substring(i+1,-1!==s?s:e.length),t)).paramsString&&(r+="?"+o.paramsString),-1!==s&&(r+=e.substring(s))):"fragment"===n.responseMode&&-1!==s&&(r=e.substring(0,s),""!==(o=y(e.substring(s+1),t)).paramsString&&(r+="#"+o.paramsString));if(o&&o.oauthParams)if("standard"===n.flow||"hybrid"===n.flow){if((o.oauthParams.code||o.oauthParams.error)&&o.oauthParams.state)return o.oauthParams.newUrl=r,o.oauthParams}else if("implicit"===n.flow&&(o.oauthParams.access_token||o.oauthParams.error)&&o.oauthParams.state)return o.oauthParams.newUrl=r,o.oauthParams}(e);if(t){var o=r.get(t.state);return o&&(t.valid=!0,t.redirectUri=o.redirectUri,t.storedNonce=o.nonce,t.prompt=o.prompt,t.pkceCodeVerifier=o.pkceCodeVerifier),t}}function y(e,t){for(var r=e.split("&"),n={paramsString:"",oauthParams:{}},o=0;o<r.length;o++){var i=r[o].indexOf("="),s=r[o].slice(0,i);-1!==t.indexOf(s)?n.oauthParams[s]=r[o].slice(i+1):(""!==n.paramsString&&(n.paramsString+="&"),n.paramsString+=r[o])}return n}function _(){var e={setSuccess:function(t){e.resolve(t)},setError:function(t){e.reject(t)}};return e.promise=new es6Promise_min.exports.Promise((function(t,r){e.resolve=t,e.reject=r})),e.promise.success=function(e){return logPromiseDeprecation(),this.then((function(t){e(t)})),this},e.promise.error=function(e){return logPromiseDeprecation(),this.catch((function(t){e(t)})),this},e}function w(){var e=_();if(!i.enable)return e.setSuccess(),e.promise;if(i.iframe)return e.setSuccess(),e.promise;var t=document.createElement("iframe");i.iframe=t,t.onload=function(){var t=n.endpoints.authorize();"/"===t.charAt(0)?i.iframeOrigin=window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""):i.iframeOrigin=t.substring(0,t.indexOf("/",8)),e.setSuccess()};var r=n.endpoints.checkSessionIframe();t.setAttribute("src",r),t.setAttribute("title","keycloak-session-iframe"),t.style.display="none",document.body.appendChild(t);return window.addEventListener("message",(function(e){if(e.origin===i.iframeOrigin&&i.iframe.contentWindow===e.source&&("unchanged"==e.data||"changed"==e.data||"error"==e.data)){"unchanged"!=e.data&&n.clearToken();for(var t=i.callbackList.splice(0,i.callbackList.length),r=t.length-1;r>=0;--r){var o=t[r];"error"==e.data?o.setError():o.setSuccess("unchanged"==e.data)}}}),!1),e.promise}function S(){i.enable&&n.token&&setTimeout((function(){b().then((function(e){e&&S()}))}),1e3*i.interval)}function b(){var e=_();if(i.iframe&&i.iframeOrigin){var t=n.clientId+" "+(n.sessionId?n.sessionId:"");i.callbackList.push(e);var r=i.iframeOrigin;1==i.callbackList.length&&i.iframe.contentWindow.postMessage(t,r)}else e.setSuccess();return e.promise}function A(){var e=_();if(i.enable||n.silentCheckSsoRedirectUri){var t=document.createElement("iframe");t.setAttribute("src",n.endpoints.thirdPartyCookiesIframe()),t.setAttribute("title","keycloak-3p-check-iframe"),t.style.display="none",document.body.appendChild(t);var r=function(o){t.contentWindow===o.source&&("supported"!==o.data&&"unsupported"!==o.data||("unsupported"===o.data&&(i.enable=!1,n.silentCheckSsoFallback&&(n.silentCheckSsoRedirectUri=!1),l("[KEYCLOAK] 3rd party cookies aren't supported by this browser. checkLoginIframe and silent check-sso are not available.")),document.body.removeChild(t),window.removeEventListener("message",r),e.setSuccess()))};window.addEventListener("message",r,!1)}else e.setSuccess();return function(e,t,r){var n=null,o=new es6Promise_min.exports.Promise((function(e,o){n=setTimeout((function(){o({error:r||"Promise is not settled within timeout of "+t+"ms"})}),t)}));return es6Promise_min.exports.Promise.race([e,o]).finally((function(){clearTimeout(n)}))}(e.promise,n.messageReceiveTimeout,"Timeout when waiting for 3rd party check iframe message.")}function R(e){if(!e||"default"==e)return{login:function(e){return window.location.replace(n.createLoginUrl(e)),_().promise},logout:function(e){return window.location.replace(n.createLogoutUrl(e)),_().promise},register:function(e){return window.location.replace(n.createRegisterUrl(e)),_().promise},accountManagement:function(){var e=n.createAccountUrl();if(void 0===e)throw"Not supported by the OIDC server";return window.location.href=e,_().promise},redirectUri:function(e,t){return e&&e.redirectUri?e.redirectUri:n.redirectUri?n.redirectUri:location.href}};if("cordova"==e){i.enable=!1;var t=function(e,t,r){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(e,t,r):window.open(e,t,r)},r=function(e){var t=function(e){return e&&e.cordovaOptions?Object.keys(e.cordovaOptions).reduce((function(t,r){return t[r]=e.cordovaOptions[r],t}),{}):{}}(e);return t.location="no",e&&"none"==e.prompt&&(t.hidden="yes"),function(e){return Object.keys(e).reduce((function(t,r){return t.push(r+"="+e[r]),t}),[]).join(",")}(t)};return{login:function(e){var o=_(),i=r(e),s=n.createLoginUrl(e),a=t(s,"_blank",i),c=!1,u=!1,l=function(){u=!0,a.close()};return a.addEventListener("loadstart",(function(e){0==e.url.indexOf("http://localhost")&&(f(g(e.url),o),l(),c=!0)})),a.addEventListener("loaderror",(function(e){c||(0==e.url.indexOf("http://localhost")?(f(g(e.url),o),l(),c=!0):(o.setError(),l()))})),a.addEventListener("exit",(function(e){u||o.setError({reason:"closed_by_user"})})),o.promise},logout:function(e){var r,o=_(),i=n.createLogoutUrl(e),s=t(i,"_blank","location=no,hidden=yes,clearcache=yes");return s.addEventListener("loadstart",(function(e){0==e.url.indexOf("http://localhost")&&s.close()})),s.addEventListener("loaderror",(function(e){0==e.url.indexOf("http://localhost")||(r=!0),s.close()})),s.addEventListener("exit",(function(e){r?o.setError():(n.clearToken(),o.setSuccess())})),o.promise},register:function(e){var o=_(),i=n.createRegisterUrl(),s=r(e),a=t(i,"_blank",s);return a.addEventListener("loadstart",(function(e){0==e.url.indexOf("http://localhost")&&(a.close(),f(g(e.url),o))})),o.promise},accountManagement:function(){var e=n.createAccountUrl();if(void 0===e)throw"Not supported by the OIDC server";var r=t(e,"_blank","location=no");r.addEventListener("loadstart",(function(e){0==e.url.indexOf("http://localhost")&&r.close()}))},redirectUri:function(e){return"http://localhost"}}}if("cordova-native"==e)return i.enable=!1,{login:function(e){var t=_(),r=n.createLoginUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),f(g(e.url),t)})),window.cordova.plugins.browsertab.openUrl(r),t.promise},logout:function(e){var t=_(),r=n.createLogoutUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),n.clearToken(),t.setSuccess()})),window.cordova.plugins.browsertab.openUrl(r),t.promise},register:function(e){var t=_(),r=n.createRegisterUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),f(g(e.url),t)})),window.cordova.plugins.browsertab.openUrl(r),t.promise},accountManagement:function(){var e=n.createAccountUrl();if(void 0===e)throw"Not supported by the OIDC server";window.cordova.plugins.browsertab.openUrl(e)},redirectUri:function(e){return e&&e.redirectUri?e.redirectUri:n.redirectUri?n.redirectUri:"http://localhost"}};throw"invalid adapter type: "+e}n.init=function(o){n.authenticated=!1,r=function(){try{return new E}catch(e){}return new H}();if(t=o&&["default","cordova","cordova-native"].indexOf(o.adapter)>-1?R(o.adapter):o&&"object"==typeof o.adapter?o.adapter:window.Cordova||window.cordova?R("cordova"):R(),o){if(void 0!==o.useNonce&&(c=o.useNonce),void 0!==o.checkLoginIframe&&(i.enable=o.checkLoginIframe),o.checkLoginIframeInterval&&(i.interval=o.checkLoginIframeInterval),"login-required"===o.onLoad&&(n.loginRequired=!0),o.responseMode){if("query"!==o.responseMode&&"fragment"!==o.responseMode)throw"Invalid value for responseMode";n.responseMode=o.responseMode}if(o.flow){switch(o.flow){case"standard":n.responseType="code";break;case"implicit":n.responseType="id_token token";break;case"hybrid":n.responseType="code id_token token";break;default:throw"Invalid value for flow"}n.flow=o.flow}if(null!=o.timeSkew&&(n.timeSkew=o.timeSkew),o.redirectUri&&(n.redirectUri=o.redirectUri),o.silentCheckSsoRedirectUri&&(n.silentCheckSsoRedirectUri=o.silentCheckSsoRedirectUri),"boolean"==typeof o.silentCheckSsoFallback?n.silentCheckSsoFallback=o.silentCheckSsoFallback:n.silentCheckSsoFallback=!0,o.pkceMethod){if("S256"!==o.pkceMethod)throw"Invalid value for pkceMethod";n.pkceMethod=o.pkceMethod}"boolean"==typeof o.enableLogging?n.enableLogging=o.enableLogging:n.enableLogging=!1,"string"==typeof o.scope&&(n.scope=o.scope),"number"==typeof o.messageReceiveTimeout&&o.messageReceiveTimeout>0?n.messageReceiveTimeout=o.messageReceiveTimeout:n.messageReceiveTimeout=1e4}n.responseMode||(n.responseMode="fragment"),n.responseType||(n.responseType="code",n.flow="standard");var s=_(),a=_();a.promise.then((function(){n.onReady&&n.onReady(n.authenticated),s.setSuccess(n.authenticated)})).catch((function(e){s.setError(e)}));var u=function(t){var r,o=_();e?"string"==typeof e&&(r=e):r="keycloak.json";function i(e){n.endpoints=e?{authorize:function(){return e.authorization_endpoint},token:function(){return e.token_endpoint},logout:function(){if(!e.end_session_endpoint)throw"Not supported by the OIDC server";return e.end_session_endpoint},checkSessionIframe:function(){if(!e.check_session_iframe)throw"Not supported by the OIDC server";return e.check_session_iframe},register:function(){throw'Redirection to "Register user" page not supported in standard OIDC mode'},userinfo:function(){if(!e.userinfo_endpoint)throw"Not supported by the OIDC server";return e.userinfo_endpoint}}:{authorize:function(){return d()+"/protocol/openid-connect/auth"},token:function(){return d()+"/protocol/openid-connect/token"},logout:function(){return d()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var e=d()+"/protocol/openid-connect/login-status-iframe.html";return n.iframeVersion&&(e=e+"?version="+n.iframeVersion),e},thirdPartyCookiesIframe:function(){var e=d()+"/protocol/openid-connect/3p-cookies/step1.html";return n.iframeVersion&&(e=e+"?version="+n.iframeVersion),e},register:function(){return d()+"/protocol/openid-connect/registrations"},userinfo:function(){return d()+"/protocol/openid-connect/userinfo"}}}if(r){(c=new XMLHttpRequest).open("GET",r,!0),c.setRequestHeader("Accept","application/json"),c.onreadystatechange=function(){if(4==c.readyState)if(200==c.status||p(c)){var e=JSON.parse(c.responseText);n.authServerUrl=e["auth-server-url"],n.realm=e.realm,n.clientId=e.resource,i(null),o.setSuccess()}else o.setError()},c.send()}else{if(!e.clientId)throw"clientId missing";n.clientId=e.clientId;var s=e.oidcProvider;if(s){var a,c;if("string"==typeof s)a="/"==s.charAt(s.length-1)?s+".well-known/openid-configuration":s+"/.well-known/openid-configuration",(c=new XMLHttpRequest).open("GET",a,!0),c.setRequestHeader("Accept","application/json"),c.onreadystatechange=function(){4==c.readyState&&(200==c.status||p(c)?(i(JSON.parse(c.responseText)),o.setSuccess()):o.setError())},c.send();else i(s),o.setSuccess()}else{if(!e.url)for(var u=document.getElementsByTagName("script"),l=0;l<u.length;l++)if(u[l].src.match(/.*keycloak\.js/)){e.url=u[l].src.substr(0,u[l].src.indexOf("/js/keycloak.js"));break}if(!e.realm)throw"realm missing";n.authServerUrl=e.url,n.realm=e.realm,i(null),o.setSuccess()}}return o.promise}();function l(){var e=function(e){e||(r.prompt="none"),n.login(r).then((function(){a.setSuccess()})).catch((function(e){a.setError(e)}))},t=function(){var e=document.createElement("iframe"),t=n.createLoginUrl({prompt:"none",redirectUri:n.silentCheckSsoRedirectUri});e.setAttribute("src",t),e.setAttribute("title","keycloak-silent-check-sso"),e.style.display="none",document.body.appendChild(e);var r=function(t){t.origin===window.location.origin&&e.contentWindow===t.source&&(f(g(t.data),a),document.body.removeChild(e),window.removeEventListener("message",r))};window.addEventListener("message",r)},r={};switch(o.onLoad){case"check-sso":i.enable?w().then((function(){b().then((function(r){r?a.setSuccess():n.silentCheckSsoRedirectUri?t():e(!1)})).catch((function(e){a.setError(e)}))})):n.silentCheckSsoRedirectUri?t():e(!1);break;case"login-required":e(!0);break;default:throw"Invalid value for onLoad"}}function h(){var e=g(window.location.href);if(e&&window.history.replaceState(window.history.state,null,e.newUrl),e&&e.valid)return w().then((function(){f(e,a)})).catch((function(e){a.setError(e)}));o?o.token&&o.refreshToken?(m(o.token,o.refreshToken,o.idToken),i.enable?w().then((function(){b().then((function(e){e?(n.onAuthSuccess&&n.onAuthSuccess(),a.setSuccess(),S()):a.setSuccess()})).catch((function(e){a.setError(e)}))})):n.updateToken(-1).then((function(){n.onAuthSuccess&&n.onAuthSuccess(),a.setSuccess()})).catch((function(e){n.onAuthError&&n.onAuthError(),o.onLoad?l():a.setError(e)}))):o.onLoad?l():a.setSuccess():a.setSuccess()}return u.then((function(){(function(){var e=_(),t=function(){"interactive"!==document.readyState&&"complete"!==document.readyState||(document.removeEventListener("readystatechange",t),e.setSuccess())};return document.addEventListener("readystatechange",t),t(),e.promise})().then(A).then(h).catch((function(e){s.setError(e)}))})),u.catch((function(e){s.setError(e)})),s.promise},n.login=function(e){return t.login(e)},n.createLoginUrl=function(e){var o,i=k(),s=k(),a=t.redirectUri(e),u={state:i,nonce:s,redirectUri:encodeURIComponent(a)};e&&e.prompt&&(u.prompt=e.prompt),o=e&&"register"==e.action?n.endpoints.register():n.endpoints.authorize();var l=e&&e.scope||n.scope;l?-1===l.indexOf("openid")&&(l="openid "+l):l="openid";var d,f,p=o+"?client_id="+encodeURIComponent(n.clientId)+"&redirect_uri="+encodeURIComponent(a)+"&state="+encodeURIComponent(i)+"&response_mode="+encodeURIComponent(n.responseMode)+"&response_type="+encodeURIComponent(n.responseType)+"&scope="+encodeURIComponent(l);if(c&&(p=p+"&nonce="+encodeURIComponent(s)),e&&e.prompt&&(p+="&prompt="+encodeURIComponent(e.prompt)),e&&e.maxAge&&(p+="&max_age="+encodeURIComponent(e.maxAge)),e&&e.loginHint&&(p+="&login_hint="+encodeURIComponent(e.loginHint)),e&&e.idpHint&&(p+="&kc_idp_hint="+encodeURIComponent(e.idpHint)),e&&e.action&&"register"!=e.action&&(p+="&kc_action="+encodeURIComponent(e.action)),e&&e.locale&&(p+="&ui_locales="+encodeURIComponent(e.locale)),e&&e.acr){var m=(d=e.acr,f={id_token:{acr:d}},JSON.stringify(f));p+="&claims="+encodeURIComponent(m)}if(n.pkceMethod){var v=function(e){return h(e,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")}(96);u.pkceCodeVerifier=v;var g=function(e,t){if("S256"===e){var r=new Uint8Array(sha256.arrayBuffer(t));return base64Js.fromByteArray(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}throw"Invalid value for pkceMethod"}(n.pkceMethod,v);p+="&code_challenge="+g,p+="&code_challenge_method="+n.pkceMethod}return r.add(u),p},n.logout=function(e){return t.logout(e)},n.createLogoutUrl=function(e){return n.endpoints.logout()+"?post_logout_redirect_uri="+encodeURIComponent(t.redirectUri(e,!1))+"&id_token_hint="+encodeURIComponent(n.idToken)},n.register=function(e){return t.register(e)},n.createRegisterUrl=function(e){return e||(e={}),e.action="register",n.createLoginUrl(e)},n.createAccountUrl=function(e){var r=d(),o=void 0;return void 0!==r&&(o=r+"/account?referrer="+encodeURIComponent(n.clientId)+"&referrer_uri="+encodeURIComponent(t.redirectUri(e))),o},n.accountManagement=function(){return t.accountManagement()},n.hasRealmRole=function(e){var t=n.realmAccess;return!!t&&t.roles.indexOf(e)>=0},n.hasResourceRole=function(e,t){if(!n.resourceAccess)return!1;var r=n.resourceAccess[t||n.clientId];return!!r&&r.roles.indexOf(e)>=0},n.loadUserProfile=function(){var e=d()+"/account",t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+n.token);var r=_();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(n.profile=JSON.parse(t.responseText),r.setSuccess(n.profile)):r.setError())},t.send(),r.promise},n.loadUserInfo=function(){var e=n.endpoints.userinfo(),t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+n.token);var r=_();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(n.userInfo=JSON.parse(t.responseText),r.setSuccess(n.userInfo)):r.setError())},t.send(),r.promise},n.isTokenExpired=function(e){if(!n.tokenParsed||!n.refreshToken&&"implicit"!=n.flow)throw"Not authenticated";if(null==n.timeSkew)return u("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var t=n.tokenParsed.exp-Math.ceil((new Date).getTime()/1e3)+n.timeSkew;if(e){if(isNaN(e))throw"Invalid minValidity";t-=e}return t<0},n.updateToken=function(e){var t=_();if(!n.refreshToken)return t.setError(),t.promise;e=e||5;var r=function(){var r=!1;if(-1==e?(r=!0,u("[KEYCLOAK] Refreshing token: forced refresh")):n.tokenParsed&&!n.isTokenExpired(e)||(r=!0,u("[KEYCLOAK] Refreshing token: token expired")),r){var i="grant_type=refresh_token&refresh_token="+n.refreshToken,s=n.endpoints.token();if(o.push(t),1==o.length){var a=new XMLHttpRequest;a.open("POST",s,!0),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.withCredentials=!0,i+="&client_id="+encodeURIComponent(n.clientId);var c=(new Date).getTime();a.onreadystatechange=function(){if(4==a.readyState)if(200==a.status){u("[KEYCLOAK] Token refreshed"),c=(c+(new Date).getTime())/2;var e=JSON.parse(a.responseText);m(e.access_token,e.refresh_token,e.id_token,c),n.onAuthRefreshSuccess&&n.onAuthRefreshSuccess();for(var t=o.pop();null!=t;t=o.pop())t.setSuccess(!0)}else{l("[KEYCLOAK] Failed to refresh token"),400==a.status&&n.clearToken(),n.onAuthRefreshError&&n.onAuthRefreshError();for(t=o.pop();null!=t;t=o.pop())t.setError(!0)}},a.send(i)}}else t.setSuccess(!1)};i.enable?b().then((function(){r()})).catch((function(e){t.setError(e)})):r();return t.promise},n.clearToken=function(){n.token&&(m(null,null,null),n.onAuthLogout&&n.onAuthLogout(),n.loginRequired&&n.login())};var E=function(){if(!(this instanceof E))return new E;localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test");function e(){for(var e=(new Date).getTime(),t=0;t<localStorage.length;t++){var r=localStorage.key(t);if(r&&0==r.indexOf("kc-callback-")){var n=localStorage.getItem(r);if(n)try{var o=JSON.parse(n).expires;(!o||o<e)&&localStorage.removeItem(r)}catch(e){localStorage.removeItem(r)}}}}this.get=function(t){if(t){var r="kc-callback-"+t,n=localStorage.getItem(r);return n&&(localStorage.removeItem(r),n=JSON.parse(n)),e(),n}},this.add=function(t){e();var r="kc-callback-"+t.state;t.expires=(new Date).getTime()+36e5,localStorage.setItem(r,JSON.stringify(t))}},H=function(){if(!(this instanceof H))return new H;var e=this;e.get=function(e){if(e){var o=r("kc-callback-"+e);return n("kc-callback-"+e,"",t(-100)),o?JSON.parse(o):void 0}},e.add=function(e){n("kc-callback-"+e.state,JSON.stringify(e),t(60))},e.removeItem=function(e){n(e,"",t(-100))};var t=function(e){var t=new Date;return t.setTime(t.getTime()+60*e*1e3),t},r=function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var o=r[n];" "==o.charAt(0);)o=o.substring(1);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""},n=function(e,t,r){var n=e+"="+t+"; expires="+r.toUTCString()+"; ";document.cookie=n}};function C(e){return function(){n.enableLogging&&e.apply(console,Array.prototype.slice.call(arguments))}}}return Keycloak}));
*/(function(module){(function(){var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS?root=commonjsGlobal:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&module.exports,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];!root.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!ARRAY_BUFFER||!root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e,t){return function(r){return new Sha256(t,!0).update(r)[e]()}},createMethod=function(e){var t=createOutputMethod("hex",e);NODE_JS&&(t=nodeWrap(t,e)),t.create=function(){return new Sha256(e)},t.update=function(e){return t.create().update(e)};for(var r=0;r<OUTPUT_TYPES.length;++r){var n=OUTPUT_TYPES[r];t[n]=createOutputMethod(n,e)}return t},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(e){if("string"==typeof e)return crypto.createHash(algorithm).update(e,"utf8").digest("hex");if(null==e)throw new Error(ERROR);return e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),Array.isArray(e)||ArrayBuffer.isView(e)||e.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(e)).digest("hex"):method(e)};return nodeMethod},createHmacOutputMethod=function(e,t){return function(r,n){return new HmacSha256(r,t,!0).update(n)[e]()}},createHmacMethod=function(e){var t=createHmacOutputMethod("hex",e);t.create=function(t){return new HmacSha256(t,e)},t.update=function(e,r){return t.create(e).update(r)};for(var r=0;r<OUTPUT_TYPES.length;++r){var n=OUTPUT_TYPES[r];t[n]=createHmacOutputMethod(n,e)}return t};function Sha256(e,t){t?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=e}function HmacSha256(e,t,r){var n,o=typeof e;if("string"===o){var i,s=[],a=e.length,c=0;for(n=0;n<a;++n)(i=e.charCodeAt(n))<128?s[c++]=i:i<2048?(s[c++]=192|i>>6,s[c++]=128|63&i):i<55296||i>=57344?(s[c++]=224|i>>12,s[c++]=128|i>>6&63,s[c++]=128|63&i):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++n)),s[c++]=240|i>>18,s[c++]=128|i>>12&63,s[c++]=128|i>>6&63,s[c++]=128|63&i);e=s}else{if("object"!==o)throw new Error(ERROR);if(null===e)throw new Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||ARRAY_BUFFER&&ArrayBuffer.isView(e)))throw new Error(ERROR)}e.length>64&&(e=new Sha256(t,!0).update(e).array());var u=[],l=[];for(n=0;n<64;++n){var h=e[n]||0;u[n]=92^h,l[n]=54^h}Sha256.call(this,t,r),this.update(l),this.oKeyPad=u,this.inner=!0,this.sharedMemory=r}Sha256.prototype.update=function(e){if(!this.finalized){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(ERROR);if(null===e)throw new Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||ARRAY_BUFFER&&ArrayBuffer.isView(e)))throw new Error(ERROR);t=!0}for(var n,o,i=0,s=e.length,a=this.blocks;i<s;){if(this.hashed&&(this.hashed=!1,a[0]=this.block,a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),t)for(o=this.start;i<s&&o<64;++i)a[o>>2]|=e[i]<<SHIFT[3&o++];else for(o=this.start;i<s&&o<64;++i)(n=e.charCodeAt(i))<128?a[o>>2]|=n<<SHIFT[3&o++]:n<2048?(a[o>>2]|=(192|n>>6)<<SHIFT[3&o++],a[o>>2]|=(128|63&n)<<SHIFT[3&o++]):n<55296||n>=57344?(a[o>>2]|=(224|n>>12)<<SHIFT[3&o++],a[o>>2]|=(128|n>>6&63)<<SHIFT[3&o++],a[o>>2]|=(128|63&n)<<SHIFT[3&o++]):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++i)),a[o>>2]|=(240|n>>18)<<SHIFT[3&o++],a[o>>2]|=(128|n>>12&63)<<SHIFT[3&o++],a[o>>2]|=(128|n>>6&63)<<SHIFT[3&o++],a[o>>2]|=(128|63&n)<<SHIFT[3&o++]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.block=a[16],this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>2]|=EXTRA[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var e,t,r,n,o,i,s,a,c,u=this.h0,l=this.h1,h=this.h2,d=this.h3,f=this.h4,p=this.h5,m=this.h6,v=this.h7,k=this.blocks;for(e=16;e<64;++e)t=((o=k[e-15])>>>7|o<<25)^(o>>>18|o<<14)^o>>>3,r=((o=k[e-2])>>>17|o<<15)^(o>>>19|o<<13)^o>>>10,k[e]=k[e-16]+t+k[e-7]+r<<0;for(c=l&h,e=0;e<64;e+=4)this.first?(this.is224?(i=300032,v=(o=k[0]-1413257819)-150054599<<0,d=o+24177077<<0):(i=704751109,v=(o=k[0]-210244248)-1521486534<<0,d=o+143694565<<0),this.first=!1):(t=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),n=(i=u&l)^u&h^c,v=d+(o=v+(r=(f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(f&p^~f&m)+K[e]+k[e])<<0,d=o+(t+n)<<0),t=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),n=(s=d&u)^d&l^i,m=h+(o=m+(r=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+(v&f^~v&p)+K[e+1]+k[e+1])<<0,t=((h=o+(t+n)<<0)>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),n=(a=h&d)^h&u^s,p=l+(o=p+(r=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&v^~m&f)+K[e+2]+k[e+2])<<0,t=((l=o+(t+n)<<0)>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),n=(c=l&h)^l&d^a,f=u+(o=f+(r=(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&m^~p&v)+K[e+3]+k[e+3])<<0,u=o+(t+n)<<0;this.h0=this.h0+u<<0,this.h1=this.h1+l<<0,this.h2=this.h2+h<<0,this.h3=this.h3+d<<0,this.h4=this.h4+f<<0,this.h5=this.h5+p<<0,this.h6=this.h6+m<<0,this.h7=this.h7+v<<0},Sha256.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,o=this.h4,i=this.h5,s=this.h6,a=this.h7,c=HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[15&o]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[15&s];return this.is224||(c+=HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[15&a]),c},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,o=this.h4,i=this.h5,s=this.h6,a=this.h7,c=[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24&255,r>>16&255,r>>8&255,255&r,n>>24&255,n>>16&255,n>>8&255,255&n,o>>24&255,o>>16&255,o>>8&255,255&o,i>>24&255,i>>16&255,i>>8&255,255&i,s>>24&255,s>>16&255,s>>8&255,255&s];return this.is224||c.push(a>>24&255,a>>16&255,a>>8&255,255&a),c},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224)})()})(sha256$1);var sha256=sha256$1.exports;if(void 0===es6Promise_min.exports.Promise)throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");var loggedPromiseDeprecation=!1;function logPromiseDeprecation(){loggedPromiseDeprecation||(loggedPromiseDeprecation=!0,console.warn("[KEYCLOAK] Usage of legacy style promise methods such as `.error()` and `.success()` has been deprecated and support will be removed in future versions. Use standard style promise methods such as `.then() and `.catch()` instead."))}function Keycloak(e){if(!(this instanceof Keycloak))return new Keycloak(e);for(var t,r,n=this,o=[],i={enable:!0,callbackList:[],interval:5},s=document.getElementsByTagName("script"),a=0;a<s.length;a++)-1===s[a].src.indexOf("keycloak.js")&&-1===s[a].src.indexOf("keycloak.min.js")||-1===s[a].src.indexOf("version=")||(n.iframeVersion=s[a].src.substring(s[a].src.indexOf("version=")+8).split("&")[0]);var c=!0,u=C(console.info),l=C(console.warn);function h(e,t){for(var r=function(e){var t=null,r=window.crypto||window.msCrypto;if(r&&r.getRandomValues&&window.Uint8Array)return t=new Uint8Array(e),r.getRandomValues(t),t;t=new Array(e);for(var n=0;n<t.length;n++)t[n]=Math.floor(256*Math.random());return t}(e),n=new Array(e),o=0;o<e;o++)n[o]=t.charCodeAt(r[o]%t.length);return String.fromCharCode.apply(null,n)}function d(){return void 0!==n.authServerUrl?"/"==n.authServerUrl.charAt(n.authServerUrl.length-1)?n.authServerUrl+"realms/"+encodeURIComponent(n.realm):n.authServerUrl+"/realms/"+encodeURIComponent(n.realm):void 0}function f(e,t){var r=e.code,o=e.error,i=e.prompt,s=(new Date).getTime();if(e.kc_action_status&&n.onActionUpdate&&n.onActionUpdate(e.kc_action_status),o)if("none"!=i){var a={error:o,error_description:e.error_description};n.onAuthError&&n.onAuthError(a),t&&t.setError(a)}else t&&t.setSuccess();else if("standard"!=n.flow&&(e.access_token||e.id_token)&&f(e.access_token,null,e.id_token,!0),"implicit"!=n.flow&&r){var l="code="+r+"&grant_type=authorization_code",h=n.endpoints.token(),d=new XMLHttpRequest;d.open("POST",h,!0),d.setRequestHeader("Content-type","application/x-www-form-urlencoded"),l+="&client_id="+encodeURIComponent(n.clientId),l+="&redirect_uri="+e.redirectUri,e.pkceCodeVerifier&&(l+="&code_verifier="+e.pkceCodeVerifier),d.withCredentials=!0,d.onreadystatechange=function(){if(4==d.readyState)if(200==d.status){var e=JSON.parse(d.responseText);f(e.access_token,e.refresh_token,e.id_token,"standard"===n.flow),S()}else n.onAuthError&&n.onAuthError(),t&&t.setError()},d.send(l)}function f(r,o,i,a){m(r,o,i,s=(s+(new Date).getTime())/2),c&&(n.tokenParsed&&n.tokenParsed.nonce!=e.storedNonce||n.refreshTokenParsed&&n.refreshTokenParsed.nonce!=e.storedNonce||n.idTokenParsed&&n.idTokenParsed.nonce!=e.storedNonce)?(u("[KEYCLOAK] Invalid nonce, clearing token"),n.clearToken(),t&&t.setError()):a&&(n.onAuthSuccess&&n.onAuthSuccess(),t&&t.setSuccess())}}function p(e){return 0==e.status&&e.responseText&&e.responseURL.startsWith("file:")}function m(e,t,r,o){if(n.tokenTimeoutHandle&&(clearTimeout(n.tokenTimeoutHandle),n.tokenTimeoutHandle=null),t?(n.refreshToken=t,n.refreshTokenParsed=v(t)):(delete n.refreshToken,delete n.refreshTokenParsed),r?(n.idToken=r,n.idTokenParsed=v(r)):(delete n.idToken,delete n.idTokenParsed),e){if(n.token=e,n.tokenParsed=v(e),n.sessionId=n.tokenParsed.session_state,n.authenticated=!0,n.subject=n.tokenParsed.sub,n.realmAccess=n.tokenParsed.realm_access,n.resourceAccess=n.tokenParsed.resource_access,o&&(n.timeSkew=Math.floor(o/1e3)-n.tokenParsed.iat),null!=n.timeSkew&&(u("[KEYCLOAK] Estimated time difference between browser and server is "+n.timeSkew+" seconds"),n.onTokenExpired)){var i=1e3*(n.tokenParsed.exp-(new Date).getTime()/1e3+n.timeSkew);u("[KEYCLOAK] Token expires in "+Math.round(i/1e3)+" s"),i<=0?n.onTokenExpired():n.tokenTimeoutHandle=setTimeout(n.onTokenExpired,i)}}else delete n.token,delete n.tokenParsed,delete n.subject,delete n.realmAccess,delete n.resourceAccess,n.authenticated=!1}function v(e){switch((e=(e=(e=e.split(".")[1]).replace(/-/g,"+")).replace(/_/g,"/")).length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw"Invalid token"}return e=decodeURIComponent(escape(atob(e))),e=JSON.parse(e)}function k(){var e="0123456789abcdef",t=h(36,e).split("");return t[14]="4",t[19]=e.substr(3&t[19]|8,1),t[8]=t[13]=t[18]=t[23]="-",t.join("")}function g(e){var t=function(e){var t;switch(n.flow){case"standard":t=["code","state","session_state","kc_action_status"];break;case"implicit":t=["access_token","token_type","id_token","state","session_state","expires_in","kc_action_status"];break;case"hybrid":t=["access_token","token_type","id_token","code","state","session_state","expires_in","kc_action_status"]}t.push("error"),t.push("error_description"),t.push("error_uri");var r,o,i=e.indexOf("?"),s=e.indexOf("#");"query"===n.responseMode&&-1!==i?(r=e.substring(0,i),""!==(o=y(e.substring(i+1,-1!==s?s:e.length),t)).paramsString&&(r+="?"+o.paramsString),-1!==s&&(r+=e.substring(s))):"fragment"===n.responseMode&&-1!==s&&(r=e.substring(0,s),""!==(o=y(e.substring(s+1),t)).paramsString&&(r+="#"+o.paramsString));if(o&&o.oauthParams)if("standard"===n.flow||"hybrid"===n.flow){if((o.oauthParams.code||o.oauthParams.error)&&o.oauthParams.state)return o.oauthParams.newUrl=r,o.oauthParams}else if("implicit"===n.flow&&(o.oauthParams.access_token||o.oauthParams.error)&&o.oauthParams.state)return o.oauthParams.newUrl=r,o.oauthParams}(e);if(t){var o=r.get(t.state);return o&&(t.valid=!0,t.redirectUri=o.redirectUri,t.storedNonce=o.nonce,t.prompt=o.prompt,t.pkceCodeVerifier=o.pkceCodeVerifier),t}}function y(e,t){for(var r=e.split("&"),n={paramsString:"",oauthParams:{}},o=0;o<r.length;o++){var i=r[o].indexOf("="),s=r[o].slice(0,i);-1!==t.indexOf(s)?n.oauthParams[s]=r[o].slice(i+1):(""!==n.paramsString&&(n.paramsString+="&"),n.paramsString+=r[o])}return n}function _(){var e={setSuccess:function(t){e.resolve(t)},setError:function(t){e.reject(t)}};return e.promise=new es6Promise_min.exports.Promise((function(t,r){e.resolve=t,e.reject=r})),e.promise.success=function(e){return logPromiseDeprecation(),this.then((function(t){e(t)})),this},e.promise.error=function(e){return logPromiseDeprecation(),this.catch((function(t){e(t)})),this},e}function w(){var e=_();if(!i.enable)return e.setSuccess(),e.promise;if(i.iframe)return e.setSuccess(),e.promise;var t=document.createElement("iframe");i.iframe=t,t.onload=function(){var t=n.endpoints.authorize();"/"===t.charAt(0)?i.iframeOrigin=window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""):i.iframeOrigin=t.substring(0,t.indexOf("/",8)),e.setSuccess()};var r=n.endpoints.checkSessionIframe();t.setAttribute("src",r),t.setAttribute("title","keycloak-session-iframe"),t.style.display="none",document.body.appendChild(t);return window.addEventListener("message",(function(e){if(e.origin===i.iframeOrigin&&i.iframe.contentWindow===e.source&&("unchanged"==e.data||"changed"==e.data||"error"==e.data)){"unchanged"!=e.data&&n.clearToken();for(var t=i.callbackList.splice(0,i.callbackList.length),r=t.length-1;r>=0;--r){var o=t[r];"error"==e.data?o.setError():o.setSuccess("unchanged"==e.data)}}}),!1),e.promise}function S(){i.enable&&n.token&&setTimeout((function(){b().then((function(e){e&&S()}))}),1e3*i.interval)}function b(){var e=_();if(i.iframe&&i.iframeOrigin){var t=n.clientId+" "+(n.sessionId?n.sessionId:"");i.callbackList.push(e);var r=i.iframeOrigin;1==i.callbackList.length&&i.iframe.contentWindow.postMessage(t,r)}else e.setSuccess();return e.promise}function A(){var e=_();if(i.enable||n.silentCheckSsoRedirectUri){var t=document.createElement("iframe");t.setAttribute("src",n.endpoints.thirdPartyCookiesIframe()),t.setAttribute("title","keycloak-3p-check-iframe"),t.style.display="none",document.body.appendChild(t);var r=function(o){t.contentWindow===o.source&&("supported"!==o.data&&"unsupported"!==o.data||("unsupported"===o.data&&(i.enable=!1,n.silentCheckSsoFallback&&(n.silentCheckSsoRedirectUri=!1),l("[KEYCLOAK] 3rd party cookies aren't supported by this browser. checkLoginIframe and silent check-sso are not available.")),document.body.removeChild(t),window.removeEventListener("message",r),e.setSuccess()))};window.addEventListener("message",r,!1)}else e.setSuccess();return function(e,t,r){var n=null,o=new es6Promise_min.exports.Promise((function(e,o){n=setTimeout((function(){o({error:r||"Promise is not settled within timeout of "+t+"ms"})}),t)}));return es6Promise_min.exports.Promise.race([e,o]).finally((function(){clearTimeout(n)}))}(e.promise,n.messageReceiveTimeout,"Timeout when waiting for 3rd party check iframe message.")}function R(e){if(!e||"default"==e)return{login:function(e){return window.location.replace(n.createLoginUrl(e)),_().promise},logout:function(e){return window.location.replace(n.createLogoutUrl(e)),_().promise},register:function(e){return window.location.replace(n.createRegisterUrl(e)),_().promise},accountManagement:function(){var e=n.createAccountUrl();if(void 0===e)throw"Not supported by the OIDC server";return window.location.href=e,_().promise},redirectUri:function(e,t){return e&&e.redirectUri?e.redirectUri:n.redirectUri?n.redirectUri:location.href}};if("cordova"==e){i.enable=!1;var t=function(e,t,r){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(e,t,r):window.open(e,t,r)},r=function(e){var t=function(e){return e&&e.cordovaOptions?Object.keys(e.cordovaOptions).reduce((function(t,r){return t[r]=e.cordovaOptions[r],t}),{}):{}}(e);return t.location="no",e&&"none"==e.prompt&&(t.hidden="yes"),function(e){return Object.keys(e).reduce((function(t,r){return t.push(r+"="+e[r]),t}),[]).join(",")}(t)};return{login:function(e){var o=_(),i=r(e),s=n.createLoginUrl(e),a=t(s,"_blank",i),c=!1,u=!1,l=function(){u=!0,a.close()};return a.addEventListener("loadstart",(function(e){0==e.url.indexOf("http://localhost")&&(f(g(e.url),o),l(),c=!0)})),a.addEventListener("loaderror",(function(e){c||(0==e.url.indexOf("http://localhost")?(f(g(e.url),o),l(),c=!0):(o.setError(),l()))})),a.addEventListener("exit",(function(e){u||o.setError({reason:"closed_by_user"})})),o.promise},logout:function(e){var r,o=_(),i=n.createLogoutUrl(e),s=t(i,"_blank","location=no,hidden=yes,clearcache=yes");return s.addEventListener("loadstart",(function(e){0==e.url.indexOf("http://localhost")&&s.close()})),s.addEventListener("loaderror",(function(e){0==e.url.indexOf("http://localhost")||(r=!0),s.close()})),s.addEventListener("exit",(function(e){r?o.setError():(n.clearToken(),o.setSuccess())})),o.promise},register:function(e){var o=_(),i=n.createRegisterUrl(),s=r(e),a=t(i,"_blank",s);return a.addEventListener("loadstart",(function(e){0==e.url.indexOf("http://localhost")&&(a.close(),f(g(e.url),o))})),o.promise},accountManagement:function(){var e=n.createAccountUrl();if(void 0===e)throw"Not supported by the OIDC server";var r=t(e,"_blank","location=no");r.addEventListener("loadstart",(function(e){0==e.url.indexOf("http://localhost")&&r.close()}))},redirectUri:function(e){return"http://localhost"}}}if("cordova-native"==e)return i.enable=!1,{login:function(e){var t=_(),r=n.createLoginUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),f(g(e.url),t)})),window.cordova.plugins.browsertab.openUrl(r),t.promise},logout:function(e){var t=_(),r=n.createLogoutUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),n.clearToken(),t.setSuccess()})),window.cordova.plugins.browsertab.openUrl(r),t.promise},register:function(e){var t=_(),r=n.createRegisterUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),f(g(e.url),t)})),window.cordova.plugins.browsertab.openUrl(r),t.promise},accountManagement:function(){var e=n.createAccountUrl();if(void 0===e)throw"Not supported by the OIDC server";window.cordova.plugins.browsertab.openUrl(e)},redirectUri:function(e){return e&&e.redirectUri?e.redirectUri:n.redirectUri?n.redirectUri:"http://localhost"}};throw"invalid adapter type: "+e}n.init=function(o){n.authenticated=!1,r=function(){try{return new E}catch(e){}return new H}();if(t=o&&["default","cordova","cordova-native"].indexOf(o.adapter)>-1?R(o.adapter):o&&"object"==typeof o.adapter?o.adapter:window.Cordova||window.cordova?R("cordova"):R(),o){if(void 0!==o.useNonce&&(c=o.useNonce),void 0!==o.checkLoginIframe&&(i.enable=o.checkLoginIframe),o.checkLoginIframeInterval&&(i.interval=o.checkLoginIframeInterval),"login-required"===o.onLoad&&(n.loginRequired=!0),o.responseMode){if("query"!==o.responseMode&&"fragment"!==o.responseMode)throw"Invalid value for responseMode";n.responseMode=o.responseMode}if(o.flow){switch(o.flow){case"standard":n.responseType="code";break;case"implicit":n.responseType="id_token token";break;case"hybrid":n.responseType="code id_token token";break;default:throw"Invalid value for flow"}n.flow=o.flow}if(null!=o.timeSkew&&(n.timeSkew=o.timeSkew),o.redirectUri&&(n.redirectUri=o.redirectUri),o.silentCheckSsoRedirectUri&&(n.silentCheckSsoRedirectUri=o.silentCheckSsoRedirectUri),"boolean"==typeof o.silentCheckSsoFallback?n.silentCheckSsoFallback=o.silentCheckSsoFallback:n.silentCheckSsoFallback=!0,o.pkceMethod){if("S256"!==o.pkceMethod)throw"Invalid value for pkceMethod";n.pkceMethod=o.pkceMethod}"boolean"==typeof o.enableLogging?n.enableLogging=o.enableLogging:n.enableLogging=!1,"string"==typeof o.scope&&(n.scope=o.scope),"number"==typeof o.messageReceiveTimeout&&o.messageReceiveTimeout>0?n.messageReceiveTimeout=o.messageReceiveTimeout:n.messageReceiveTimeout=1e4}n.responseMode||(n.responseMode="fragment"),n.responseType||(n.responseType="code",n.flow="standard");var s=_(),a=_();a.promise.then((function(){n.onReady&&n.onReady(n.authenticated),s.setSuccess(n.authenticated)})).catch((function(e){s.setError(e)}));var u=function(t){var r,o=_();e?"string"==typeof e&&(r=e):r="keycloak.json";function i(e){n.endpoints=e?{authorize:function(){return e.authorization_endpoint},token:function(){return e.token_endpoint},logout:function(){if(!e.end_session_endpoint)throw"Not supported by the OIDC server";return e.end_session_endpoint},checkSessionIframe:function(){if(!e.check_session_iframe)throw"Not supported by the OIDC server";return e.check_session_iframe},register:function(){throw'Redirection to "Register user" page not supported in standard OIDC mode'},userinfo:function(){if(!e.userinfo_endpoint)throw"Not supported by the OIDC server";return e.userinfo_endpoint}}:{authorize:function(){return d()+"/protocol/openid-connect/auth"},token:function(){return d()+"/protocol/openid-connect/token"},logout:function(){return d()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var e=d()+"/protocol/openid-connect/login-status-iframe.html";return n.iframeVersion&&(e=e+"?version="+n.iframeVersion),e},thirdPartyCookiesIframe:function(){var e=d()+"/protocol/openid-connect/3p-cookies/step1.html";return n.iframeVersion&&(e=e+"?version="+n.iframeVersion),e},register:function(){return d()+"/protocol/openid-connect/registrations"},userinfo:function(){return d()+"/protocol/openid-connect/userinfo"}}}if(r){(c=new XMLHttpRequest).open("GET",r,!0),c.setRequestHeader("Accept","application/json"),c.onreadystatechange=function(){if(4==c.readyState)if(200==c.status||p(c)){var e=JSON.parse(c.responseText);n.authServerUrl=e["auth-server-url"],n.realm=e.realm,n.clientId=e.resource,i(null),o.setSuccess()}else o.setError()},c.send()}else{if(!e.clientId)throw"clientId missing";n.clientId=e.clientId;var s=e.oidcProvider;if(s){var a,c;if("string"==typeof s)a="/"==s.charAt(s.length-1)?s+".well-known/openid-configuration":s+"/.well-known/openid-configuration",(c=new XMLHttpRequest).open("GET",a,!0),c.setRequestHeader("Accept","application/json"),c.onreadystatechange=function(){4==c.readyState&&(200==c.status||p(c)?(i(JSON.parse(c.responseText)),o.setSuccess()):o.setError())},c.send();else i(s),o.setSuccess()}else{if(!e.url)for(var u=document.getElementsByTagName("script"),l=0;l<u.length;l++)if(u[l].src.match(/.*keycloak\.js/)){e.url=u[l].src.substr(0,u[l].src.indexOf("/js/keycloak.js"));break}if(!e.realm)throw"realm missing";n.authServerUrl=e.url,n.realm=e.realm,i(null),o.setSuccess()}}return o.promise}();function l(){var e=function(e){e||(r.prompt="none"),n.login(r).then((function(){a.setSuccess()})).catch((function(e){a.setError(e)}))},t=function(){var e=document.createElement("iframe"),t=n.createLoginUrl({prompt:"none",redirectUri:n.silentCheckSsoRedirectUri});e.setAttribute("src",t),e.setAttribute("title","keycloak-silent-check-sso"),e.style.display="none",document.body.appendChild(e);var r=function(t){t.origin===window.location.origin&&e.contentWindow===t.source&&(f(g(t.data),a),document.body.removeChild(e),window.removeEventListener("message",r))};window.addEventListener("message",r)},r={};switch(o.onLoad){case"check-sso":i.enable?w().then((function(){b().then((function(r){r?a.setSuccess():n.silentCheckSsoRedirectUri?t():e(!1)})).catch((function(e){a.setError(e)}))})):n.silentCheckSsoRedirectUri?t():e(!1);break;case"login-required":e(!0);break;default:throw"Invalid value for onLoad"}}function h(){var e=g(window.location.href);if(e&&window.history.replaceState(window.history.state,null,e.newUrl),e&&e.valid)return w().then((function(){f(e,a)})).catch((function(e){a.setError(e)}));o?o.token&&o.refreshToken?(m(o.token,o.refreshToken,o.idToken),i.enable?w().then((function(){b().then((function(e){e?(n.onAuthSuccess&&n.onAuthSuccess(),a.setSuccess(),S()):a.setSuccess()})).catch((function(e){a.setError(e)}))})):n.updateToken(-1).then((function(){n.onAuthSuccess&&n.onAuthSuccess(),a.setSuccess()})).catch((function(e){n.onAuthError&&n.onAuthError(),o.onLoad?l():a.setError(e)}))):o.onLoad?l():a.setSuccess():a.setSuccess()}return u.then((function(){(function(){var e=_(),t=function(){"interactive"!==document.readyState&&"complete"!==document.readyState||(document.removeEventListener("readystatechange",t),e.setSuccess())};return document.addEventListener("readystatechange",t),t(),e.promise})().then(A).then(h).catch((function(e){s.setError(e)}))})),u.catch((function(e){s.setError(e)})),s.promise},n.login=function(e){return t.login(e)},n.createLoginUrl=function(e){var o,i=k(),s=k(),a=t.redirectUri(e),u={state:i,nonce:s,redirectUri:encodeURIComponent(a)};e&&e.prompt&&(u.prompt=e.prompt),o=e&&"register"==e.action?n.endpoints.register():n.endpoints.authorize();var l=e&&e.scope||n.scope;l?-1===l.indexOf("openid")&&(l="openid "+l):l="openid";var d,f,p=o+"?client_id="+encodeURIComponent(n.clientId)+"&redirect_uri="+encodeURIComponent(a)+"&state="+encodeURIComponent(i)+"&response_mode="+encodeURIComponent(n.responseMode)+"&response_type="+encodeURIComponent(n.responseType)+"&scope="+encodeURIComponent(l);if(c&&(p=p+"&nonce="+encodeURIComponent(s)),e&&e.prompt&&(p+="&prompt="+encodeURIComponent(e.prompt)),e&&e.maxAge&&(p+="&max_age="+encodeURIComponent(e.maxAge)),e&&e.loginHint&&(p+="&login_hint="+encodeURIComponent(e.loginHint)),e&&e.idpHint&&(p+="&kc_idp_hint="+encodeURIComponent(e.idpHint)),e&&e.action&&"register"!=e.action&&(p+="&kc_action="+encodeURIComponent(e.action)),e&&e.locale&&(p+="&ui_locales="+encodeURIComponent(e.locale)),e&&e.acr){var m=(d=e.acr,f={id_token:{acr:d}},JSON.stringify(f));p+="&claims="+encodeURIComponent(m)}if(n.pkceMethod){var v=function(e){return h(e,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")}(96);u.pkceCodeVerifier=v;var g=function(e,t){if("S256"===e){var r=new Uint8Array(sha256.arrayBuffer(t));return base64Js.fromByteArray(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}throw"Invalid value for pkceMethod"}(n.pkceMethod,v);p+="&code_challenge="+g,p+="&code_challenge_method="+n.pkceMethod}return r.add(u),p},n.logout=function(e){return t.logout(e)},n.createLogoutUrl=function(e){var r=n.endpoints.logout()+"?client_id="+encodeURIComponent(n.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(t.redirectUri(e,!1));return n.idToken&&(r+="&id_token_hint="+encodeURIComponent(n.idToken)),r},n.register=function(e){return t.register(e)},n.createRegisterUrl=function(e){return e||(e={}),e.action="register",n.createLoginUrl(e)},n.createAccountUrl=function(e){var r=d(),o=void 0;return void 0!==r&&(o=r+"/account?referrer="+encodeURIComponent(n.clientId)+"&referrer_uri="+encodeURIComponent(t.redirectUri(e))),o},n.accountManagement=function(){return t.accountManagement()},n.hasRealmRole=function(e){var t=n.realmAccess;return!!t&&t.roles.indexOf(e)>=0},n.hasResourceRole=function(e,t){if(!n.resourceAccess)return!1;var r=n.resourceAccess[t||n.clientId];return!!r&&r.roles.indexOf(e)>=0},n.loadUserProfile=function(){var e=d()+"/account",t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+n.token);var r=_();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(n.profile=JSON.parse(t.responseText),r.setSuccess(n.profile)):r.setError())},t.send(),r.promise},n.loadUserInfo=function(){var e=n.endpoints.userinfo(),t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+n.token);var r=_();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(n.userInfo=JSON.parse(t.responseText),r.setSuccess(n.userInfo)):r.setError())},t.send(),r.promise},n.isTokenExpired=function(e){if(!n.tokenParsed||!n.refreshToken&&"implicit"!=n.flow)throw"Not authenticated";if(null==n.timeSkew)return u("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var t=n.tokenParsed.exp-Math.ceil((new Date).getTime()/1e3)+n.timeSkew;if(e){if(isNaN(e))throw"Invalid minValidity";t-=e}return t<0},n.updateToken=function(e){var t=_();if(!n.refreshToken)return t.setError(),t.promise;e=e||5;var r=function(){var r=!1;if(-1==e?(r=!0,u("[KEYCLOAK] Refreshing token: forced refresh")):n.tokenParsed&&!n.isTokenExpired(e)||(r=!0,u("[KEYCLOAK] Refreshing token: token expired")),r){var i="grant_type=refresh_token&refresh_token="+n.refreshToken,s=n.endpoints.token();if(o.push(t),1==o.length){var a=new XMLHttpRequest;a.open("POST",s,!0),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.withCredentials=!0,i+="&client_id="+encodeURIComponent(n.clientId);var c=(new Date).getTime();a.onreadystatechange=function(){if(4==a.readyState)if(200==a.status){u("[KEYCLOAK] Token refreshed"),c=(c+(new Date).getTime())/2;var e=JSON.parse(a.responseText);m(e.access_token,e.refresh_token,e.id_token,c),n.onAuthRefreshSuccess&&n.onAuthRefreshSuccess();for(var t=o.pop();null!=t;t=o.pop())t.setSuccess(!0)}else{l("[KEYCLOAK] Failed to refresh token"),400==a.status&&n.clearToken(),n.onAuthRefreshError&&n.onAuthRefreshError();for(t=o.pop();null!=t;t=o.pop())t.setError(!0)}},a.send(i)}}else t.setSuccess(!1)};i.enable?b().then((function(){r()})).catch((function(e){t.setError(e)})):r();return t.promise},n.clearToken=function(){n.token&&(m(null,null,null),n.onAuthLogout&&n.onAuthLogout(),n.loginRequired&&n.login())};var E=function(){if(!(this instanceof E))return new E;localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test");function e(){for(var e=(new Date).getTime(),t=0;t<localStorage.length;t++){var r=localStorage.key(t);if(r&&0==r.indexOf("kc-callback-")){var n=localStorage.getItem(r);if(n)try{var o=JSON.parse(n).expires;(!o||o<e)&&localStorage.removeItem(r)}catch(e){localStorage.removeItem(r)}}}}this.get=function(t){if(t){var r="kc-callback-"+t,n=localStorage.getItem(r);return n&&(localStorage.removeItem(r),n=JSON.parse(n)),e(),n}},this.add=function(t){e();var r="kc-callback-"+t.state;t.expires=(new Date).getTime()+36e5,localStorage.setItem(r,JSON.stringify(t))}},H=function(){if(!(this instanceof H))return new H;var e=this;e.get=function(e){if(e){var o=r("kc-callback-"+e);return n("kc-callback-"+e,"",t(-100)),o?JSON.parse(o):void 0}},e.add=function(e){n("kc-callback-"+e.state,JSON.stringify(e),t(60))},e.removeItem=function(e){n(e,"",t(-100))};var t=function(e){var t=new Date;return t.setTime(t.getTime()+60*e*1e3),t},r=function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var o=r[n];" "==o.charAt(0);)o=o.substring(1);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""},n=function(e,t,r){var n=e+"="+t+"; expires="+r.toUTCString()+"; ";document.cookie=n}};function C(e){return function(){n.enableLogging&&e.apply(console,Array.prototype.slice.call(arguments))}}}return Keycloak}));
//# sourceMappingURL=keycloak.min.js.map
{
"name": "keycloak-js",
"version": "18.0.1",
"version": "19.0.0",
"description": "Keycloak Adapter",

@@ -29,7 +29,7 @@ "main": "dist/keycloak.js",

"devDependencies": {
"@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-commonjs": "^22.0.1",
"@rollup/plugin-inject": "^4.0.4",
"@rollup/plugin-node-resolve": "^13.1.3",
"@rollup/plugin-typescript": "^8.3.0",
"@types/node": "^17.0.16",
"@types/node": "^18.0.3",
"es6-promise": "^4.2.8",

@@ -36,0 +36,0 @@ "rollup": "^2.67.1",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc