(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,467034,(e,t,r)=>{var i={675:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),r=t[0],i=t[1];return(r+i)*3/4-i},t.toByteArray=function(e){var t,r,n=l(e),s=n[0],a=n[1],c=new o((s+a)*3/4-a),h=0,u=a>0?s-4:s;for(r=0;r>16&255,c[h++]=t>>8&255,c[h++]=255&t;return 2===a&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,c[h++]=255&t),1===a&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,c[h++]=t>>8&255,c[h++]=255&t),c},t.fromByteArray=function(e){for(var t,i=e.length,o=i%3,n=[],s=0,a=i-o;s>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return n.join("")}(e,s,s+16383>a?a:s+16383));return 1===o?n.push(r[(t=e[i-1])>>2]+r[t<<4&63]+"=="):2===o&&n.push(r[(t=(e[i-2]<<8)+e[i-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),n.join("")};for(var r=[],i=[],o="u">typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=n.length;s0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var i=r===t?0:4-r%4;return[r,i]}i[45]=62,i[95]=63},72:function(e,t,r){"use strict";var i=r(675),o=r(783),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function s(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return h(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e){var i=e,o=t;if(("string"!=typeof o||""===o)&&(o="utf8"),!a.isEncoding(o))throw TypeError("Unknown encoding: "+o);var n=0|d(i,o),l=s(n),c=l.write(i,o);return c!==n&&(l=l.slice(0,c)),l}if(ArrayBuffer.isView(e))return u(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(L(e,ArrayBuffer)||e&&L(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(L(e,SharedArrayBuffer)||e&&L(e.buffer,SharedArrayBuffer)))return function(e,t,r){var i;if(t<0||e.byteLengthtypeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return c(e),s(e<0?0:0|f(e))}function u(e){for(var t=e.length<0?0:0|f(e.length),r=s(t),i=0;itypeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(e,t,r){return(c(e),e<=0)?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)},a.allocUnsafe=function(e){return h(e)},a.allocUnsafeSlow=function(e){return h(e)};function f(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function d(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||L(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return S(e).length;default:if(o)return i?-1:U(e).length;t=(""+t).toLowerCase(),o=!0}}function p(e,t,r){var o,n,s,a=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var i=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>i)&&(r=i);for(var o="",n=t;n0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(n=r*=1)!=n&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(o)return -1;else r=e.length-1;else if(r<0)if(!o)return -1;else r=0;if("string"==typeof t&&(t=a.from(t,i)),a.isBuffer(t))return 0===t.length?-1:w(e,t,r,i,o);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(o)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return w(e,[t],r,i,o)}throw TypeError("val must be string, number or Buffer")}function w(e,t,r,i,o){var n,s=1,a=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return -1;s=2,a/=2,l/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(o){var h=-1;for(n=r;na&&(r=a-l),n=r;n>=0;n--){for(var u=!0,f=0;fr&&(e+=" ... "),""},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(e,t,r,i,o){if(L(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),t<0||r>e.length||i<0||o>this.length)throw RangeError("out of range index");if(i>=o&&t>=r)return 0;if(i>=o)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var n=o-i,s=r-t,l=Math.min(n,s),c=this.slice(i,o),h=e.slice(t,r),u=0;u239?4:c>223?3:c>191?2:1;if(o+u<=r)switch(u){case 1:c<128&&(h=c);break;case 2:(192&(n=e[o+1]))==128&&(l=(31&c)<<6|63&n)>127&&(h=l);break;case 3:n=e[o+1],s=e[o+2],(192&n)==128&&(192&s)==128&&(l=(15&c)<<12|(63&n)<<6|63&s)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:n=e[o+1],s=e[o+2],a=e[o+3],(192&n)==128&&(192&s)==128&&(192&a)==128&&(l=(15&c)<<18|(63&n)<<12|(63&s)<<6|63&a)>65535&&l<1114112&&(h=l)}null===h?(h=65533,u=1):h>65535&&(h-=65536,i.push(h>>>10&1023|55296),h=56320|1023&h),i.push(h),o+=u}var f=i,d=f.length;if(d<=4096)return String.fromCharCode.apply(String,f);for(var p="",g=0;gr)throw RangeError("Trying to access beyond buffer length")}function b(e,t,r,i,o,n){if(!a.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw RangeError("Index out of range")}function v(e,t,r,i,o,n){if(r+i>e.length||r<0)throw RangeError("Index out of range")}function E(e,t,r,i,n){return t*=1,r>>>=0,n||v(e,t,r,4,34028234663852886e22,-34028234663852886e22),o.write(e,t,r,i,23,4),r+4}function I(e,t,r,i,n){return t*=1,r>>>=0,n||v(e,t,r,8,17976931348623157e292,-17976931348623157e292),o.write(e,t,r,i,52,8),r+8}a.prototype.write=function(e,t,r,i){if(void 0===t)i="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)i=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o,n,s,a,l,c,h,u,f=this.length-t;if((void 0===r||r>f)&&(r=f),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var d=!1;;)switch(i){case"hex":return function(e,t,r,i){r=Number(r)||0;var o=e.length-r;i?(i=Number(i))>o&&(i=o):i=o;var n=t.length;i>n/2&&(i=n/2);for(var s=0;s>8,o.push(r%256),o.push(i);return o}(e,this.length-h),this,h,u);default:if(d)throw TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),d=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||k(e,t,this.length);for(var i=this[e],o=1,n=0;++n>>=0,t>>>=0,r||k(e,t,this.length);for(var i=this[e+--t],o=1;t>0&&(o*=256);)i+=this[e+--t]*o;return i},a.prototype.readUInt8=function(e,t){return e>>>=0,t||k(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||k(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||k(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);for(var i=this[e],o=1,n=0;++n=(o*=128)&&(i-=Math.pow(2,8*t)),i},a.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);for(var i=t,o=1,n=this[e+--i];i>0&&(o*=256);)n+=this[e+--i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},a.prototype.readInt8=function(e,t){return(e>>>=0,t||k(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||k(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt16BE=function(e,t){e>>>=0,t||k(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||k(e,4,this.length),o.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||k(e,4,this.length),o.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||k(e,8,this.length),o.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||k(e,8,this.length),o.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,r,i){if(e*=1,t>>>=0,r>>>=0,!i){var o=Math.pow(2,8*r)-1;b(this,e,t,r,o,0)}var n=1,s=0;for(this[t]=255&e;++s>>=0,r>>>=0,!i){var o=Math.pow(2,8*r)-1;b(this,e,t,r,o,0)}var n=r-1,s=1;for(this[t+n]=255&e;--n>=0&&(s*=256);)this[t+n]=e/s&255;return t+r},a.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,r,i){if(e*=1,t>>>=0,!i){var o=Math.pow(2,8*r-1);b(this,e,t,r,o-1,-o)}var n=0,s=1,a=0;for(this[t]=255&e;++n>>=0,!i){var o=Math.pow(2,8*r-1);b(this,e,t,r,o-1,-o)}var n=r-1,s=1,a=0;for(this[t+n]=255&e;--n>=0&&(s*=256);)e<0&&0===a&&0!==this[t+n+1]&&(a=1),this[t+n]=(e/s|0)-a&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,r){return E(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return E(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return I(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return I(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,i){if(!a.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i=this.length)throw RangeError("Index out of range");if(i<0)throw RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t=0;--n)e[n+t]=this[n+r];else Uint8Array.prototype.set.call(e,this.subarray(r,i),t);return o},a.prototype.fill=function(e,t,r,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw TypeError("encoding must be a string");if("string"==typeof i&&!a.isEncoding(i))throw TypeError("Unknown encoding: "+i);if(1===e.length){var o,n=e.charCodeAt(0);("utf8"===i&&n<128||"latin1"===i)&&(e=n)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&r<57344){if(!o){if(r>56319||s+1===i){(t-=3)>-1&&n.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&n.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(t-=3)>-1&&n.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;n.push(r)}else if(r<2048){if((t-=2)<0)break;n.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;n.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;n.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return n}function T(e){for(var t=[],r=0;r=t.length)&&!(o>=e.length);++o)t[o+r]=e[o];return o}function L(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var _=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var i=16*r,o=0;o<16;++o)t[i+o]=e[r]+e[o];return t}()},783:function(e,t){t.read=function(e,t,r,i,o){var n,s,a=8*o-i-1,l=(1<>1,h=-7,u=r?o-1:0,f=r?-1:1,d=e[t+u];for(u+=f,n=d&(1<<-h)-1,d>>=-h,h+=a;h>0;n=256*n+e[t+u],u+=f,h-=8);for(s=n&(1<<-h)-1,n>>=-h,h+=i;h>0;s=256*s+e[t+u],u+=f,h-=8);if(0===n)n=1-c;else{if(n===l)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,i),n-=c}return(d?-1:1)*s*Math.pow(2,n-i)},t.write=function(e,t,r,i,o,n){var s,a,l,c=8*n-o-1,h=(1<>1,f=5960464477539062e-23*(23===o),d=i?0:n-1,p=i?1:-1,g=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(a=+!!isNaN(t),s=h):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+u>=1?t+=f/l:t+=f*Math.pow(2,1-u),t*l>=2&&(s++,l/=2),s+u>=h?(a=0,s=h):s+u>=1?(a=(t*l-1)*Math.pow(2,o),s+=u):(a=t*Math.pow(2,u-1)*Math.pow(2,o),s=0));o>=8;e[r+d]=255&a,d+=p,a/=256,o-=8);for(s=s<0;e[r+d]=255&s,d+=p,s/=256,c-=8);e[r+d-p]|=128*g}}},o={};function n(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={exports:{}},s=!0;try{i[e](r,r.exports,n),s=!1}finally{s&&delete o[e]}return r.exports}n.ab="/ROOT/node_modules/next/dist/compiled/buffer/",t.exports=n(72)},396529,e=>{"use strict";e.i(247167);class t{#e=[];#t;#r=!0;#i;#o=this.#n(console.info);#s=this.#n(console.warn);#a={enable:!0,callbackList:[],interval:5};#l;didInitialize=!1;authenticated=!1;loginRequired=!1;responseMode="fragment";responseType="code";flow="standard";timeSkew=null;redirectUri;silentCheckSsoRedirectUri;silentCheckSsoFallback=!0;pkceMethod="S256";enableLogging=!1;logoutMethod="GET";scope;messageReceiveTimeout=1e4;idToken;idTokenParsed;token;tokenParsed;refreshToken;refreshTokenParsed;clientId;sessionId;subject;authServerUrl;realm;realmAccess;resourceAccess;profile;userInfo;endpoints;tokenTimeoutHandle;onAuthSuccess;onAuthError;onAuthRefreshSuccess;onAuthRefreshError;onTokenExpired;onAuthLogout;onReady;onActionUpdate;constructor(e){if("string"!=typeof e&&!c(e))throw Error("The 'Keycloak' constructor must be provided with a configuration object, or a URL to a JSON configuration file.");if(c(e)){for(const t of"oidcProvider"in e?["clientId"]:["url","realm","clientId"])if(!(t in e))throw Error(`The configuration object is missing the required '${t}' property.`)}globalThis.isSecureContext||this.#s("[KEYCLOAK] Keycloak JS must be used in a 'secure context' to function properly as it relies on browser APIs that are otherwise not available.\nContinuing to run your application insecurely will lead to unexpected behavior and breakage.\n\nFor more information see: https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts"),this.#l=e}async init(e={}){if(this.didInitialize)throw Error("A 'Keycloak' instance can only be initialized once.");if(this.didInitialize=!0,this.#i=function(){try{return new n}catch(e){return new s}}(),"string"==typeof e.adapter&&["default","cordova","cordova-native"].includes(e.adapter)?this.#t=this.#c(e.adapter):"object"==typeof e.adapter?this.#t=e.adapter:"Cordova"in window||"cordova"in window?this.#t=this.#c("cordova"):this.#t=this.#c("default"),void 0!==e.useNonce&&(this.#r=e.useNonce),void 0!==e.checkLoginIframe&&(this.#a.enable=e.checkLoginIframe),e.checkLoginIframeInterval&&(this.#a.interval=e.checkLoginIframeInterval),"login-required"===e.onLoad&&(this.loginRequired=!0),e.responseMode)if("query"===e.responseMode||"fragment"===e.responseMode)this.responseMode=e.responseMode;else throw Error("Invalid value for responseMode");if(e.flow){switch(e.flow){case"standard":this.responseType="code";break;case"implicit":this.responseType="id_token token";break;case"hybrid":this.responseType="code id_token token";break;default:throw Error("Invalid value for flow")}this.flow=e.flow}if("number"==typeof e.timeSkew&&(this.timeSkew=e.timeSkew),e.redirectUri&&(this.redirectUri=e.redirectUri),e.silentCheckSsoRedirectUri&&(this.silentCheckSsoRedirectUri=e.silentCheckSsoRedirectUri),"boolean"==typeof e.silentCheckSsoFallback&&(this.silentCheckSsoFallback=e.silentCheckSsoFallback),void 0!==e.pkceMethod){if("S256"!==e.pkceMethod&&!1!==e.pkceMethod)throw TypeError(`Invalid value for pkceMethod', expected 'S256' or false but got ${e.pkceMethod}.`);this.pkceMethod=e.pkceMethod}return"boolean"==typeof e.enableLogging&&(this.enableLogging=e.enableLogging),"POST"===e.logoutMethod&&(this.logoutMethod="POST"),"string"==typeof e.scope&&(this.scope=e.scope),"number"==typeof e.messageReceiveTimeout&&e.messageReceiveTimeout>0&&(this.messageReceiveTimeout=e.messageReceiveTimeout),await this.#h(),await this.#u(),await this.#f(e),this.onReady?.(this.authenticated),this.authenticated}#c(e){if("default"===e)return this.#d();if("cordova"===e)return this.#a.enable=!1,this.#p();if("cordova-native"===e)return this.#a.enable=!1,this.#g();throw Error("invalid adapter type: "+e)}#d(){let e=e=>e?.redirectUri||this.redirectUri||globalThis.location.href;return{login:async e=>(window.location.assign(await this.createLoginUrl(e)),await new Promise(()=>{})),logout:async t=>{if("GET"===(t?.logoutMethod??this.logoutMethod))return void window.location.replace(this.createLogoutUrl(t));let r=document.createElement("form");for(let[i,o]of(r.setAttribute("method","POST"),r.setAttribute("action",this.createLogoutUrl(t)),r.style.display="none",Object.entries({id_token_hint:this.idToken,client_id:this.clientId,post_logout_redirect_uri:e(t)}))){let e=document.createElement("input");e.setAttribute("type","hidden"),e.setAttribute("name",i),e.setAttribute("value",o),r.appendChild(e)}document.body.appendChild(r),r.submit()},register:async e=>(window.location.assign(await this.createRegisterUrl(e)),await new Promise(()=>{})),accountManagement:async()=>{let e=this.createAccountUrl();if(void 0!==e)window.location.href=e;else throw Error("Not supported by the OIDC server");return await new Promise(()=>{})},redirectUri:e}}#p(){let e=(e,t,r)=>window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(e,t,r):window.open(e,t,r),t=e=>{let t=e&&e.cordovaOptions?Object.keys(e.cordovaOptions).reduce((t,r)=>(t[r]=e.cordovaOptions[r],t),{}):{};return t.location="no",e&&"none"===e.prompt&&(t.hidden="yes"),Object.keys(t).reduce((e,r)=>(e.push(r+"="+t[r]),e),[]).join(",")},r=()=>this.redirectUri||"http://localhost";return{login:async i=>{let o=t(i),n=e(await this.createLoginUrl(i),"_blank",o),s=!1,a=!1;function l(){a=!0,n.close()}return await new Promise((e,t)=>{n.addEventListener("loadstart",async i=>{if(0===i.url.indexOf(r())){let r=this.#y(i.url);try{await this.#w(r),e()}catch(e){t(e)}l(),s=!0}}),n.addEventListener("loaderror",async i=>{if(!s)if(0===i.url.indexOf(r())){let r=this.#y(i.url);try{await this.#w(r),e()}catch(e){t(e)}l(),s=!0}else t(Error("Unable to process login.")),l()}),n.addEventListener("exit",function(e){a||t(Error("User closed the login window."))})})},logout:async t=>{let i=e(this.createLogoutUrl(t),"_blank","location=no,hidden=yes,clearcache=yes"),o=!1;i.addEventListener("loadstart",e=>{0===e.url.indexOf(r())&&i.close()}),i.addEventListener("loaderror",e=>{0===e.url.indexOf(r())||(o=!0),i.close()}),await new Promise((e,t)=>{i.addEventListener("exit",()=>{o?t(Error("User closed the login window.")):(this.clearToken(),e())})})},register:async i=>{let o=e(await this.createRegisterUrl(),"_blank",t(i)),n=new Promise((e,t)=>{o.addEventListener("loadstart",async i=>{if(0===i.url.indexOf(r())){o.close();let r=this.#y(i.url);try{await this.#w(r),e()}catch(e){t(e)}}})});await n},accountManagement:async()=>{let t=this.createAccountUrl();if(void 0!==t){let i=e(t,"_blank","location=no");i.addEventListener("loadstart",function(e){0===e.url.indexOf(r())&&i.close()})}else throw Error("Not supported by the OIDC server")},redirectUri:()=>r()}}#g(){return{login:async e=>{let t=await this.createLoginUrl(e);await new Promise((e,r)=>{universalLinks.subscribe("keycloak",async t=>{universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close();let i=this.#y(t.url);try{await this.#w(i),e()}catch(e){r(e)}}),window.cordova.plugins.browsertab.openUrl(t)})},logout:async e=>{let t=this.createLogoutUrl(e);await new Promise(e=>{universalLinks.subscribe("keycloak",()=>{universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),this.clearToken(),e()}),window.cordova.plugins.browsertab.openUrl(t)})},register:async e=>{let t=await this.createRegisterUrl(e);await new Promise((e,r)=>{universalLinks.subscribe("keycloak",async t=>{universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close();let i=this.#y(t.url);try{await this.#w(i),e()}catch(e){r(e)}}),window.cordova.plugins.browsertab.openUrl(t)})},accountManagement:async()=>{let e=this.createAccountUrl();if(void 0!==e)window.cordova.plugins.browsertab.openUrl(e);else throw Error("Not supported by the OIDC server")},redirectUri:e=>e&&e.redirectUri?e.redirectUri:this.redirectUri?this.redirectUri:"http://localhost"}}async #h(){if("string"==typeof this.#l){let e=await h(this.#l);this.authServerUrl=e["auth-server-url"],this.realm=e.realm,this.clientId=e.resource,this.#m()}else this.clientId=this.#l.clientId,"oidcProvider"in this.#l?await this.#k(this.#l.oidcProvider):(this.authServerUrl=this.#l.url,this.realm=this.#l.realm,this.#m())}#m(){this.endpoints={authorize:()=>this.#b()+"/protocol/openid-connect/auth",token:()=>this.#b()+"/protocol/openid-connect/token",logout:()=>this.#b()+"/protocol/openid-connect/logout",checkSessionIframe:()=>this.#b()+"/protocol/openid-connect/login-status-iframe.html",thirdPartyCookiesIframe:()=>this.#b()+"/protocol/openid-connect/3p-cookies/step1.html",register:()=>this.#b()+"/protocol/openid-connect/registrations",userinfo:()=>this.#b()+"/protocol/openid-connect/userinfo"}}async #k(e){if("string"==typeof e){let t=`${w(e)}/.well-known/openid-configuration`,r=await u(t);this.#v(r)}else this.#v(e)}#v(e){this.endpoints={authorize:()=>e.authorization_endpoint,token:()=>e.token_endpoint,logout(){if(!e.end_session_endpoint)throw Error("Not supported by the OIDC server");return e.end_session_endpoint},checkSessionIframe(){if(!e.check_session_iframe)throw Error("Not supported by the OIDC server");return e.check_session_iframe},register(){throw Error('Redirection to "Register user" page not supported in standard OIDC mode')},userinfo(){if(!e.userinfo_endpoint)throw Error("Not supported by the OIDC server");return e.userinfo_endpoint}}}async #u(){var e,t;let r;if(!this.#a.enable&&!this.silentCheckSsoRedirectUri||"function"!=typeof this.endpoints.thirdPartyCookiesIframe)return;let i=document.createElement("iframe");i.setAttribute("src",this.endpoints.thirdPartyCookiesIframe()),i.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),i.setAttribute("title","keycloak-3p-check-iframe"),i.style.display="none",document.body.appendChild(i);let o=new Promise(e=>{let t=r=>{i.contentWindow===r.source&&("supported"===r.data||"unsupported"===r.data)&&("unsupported"===r.data&&(this.#s("[KEYCLOAK] Your browser is blocking access to 3rd-party cookies, this means:\n\n - It is not possible to retrieve tokens without redirecting to the Keycloak server (a.k.a. no support for silent authentication).\n - It is not possible to automatically detect changes to the session status (such as the user logging out in another tab).\n\nFor more information see: https://www.keycloak.org/securing-apps/javascript-adapter#_modern_browsers"),this.#a.enable=!1,this.silentCheckSsoFallback&&(this.silentCheckSsoRedirectUri=void 0)),document.body.removeChild(i),window.removeEventListener("message",t),e())};window.addEventListener("message",t,!1)});return await (e=o,t=this.messageReceiveTimeout,Promise.race([e,new Promise(function(e,i){r=window.setTimeout(function(){i(Error("Timeout when waiting for 3rd party check iframe message."))},t)})]).finally(function(){clearTimeout(r)}))}async #f(e){let t=this.#y(window.location.href);if(t?.redirectUri&&window.history.replaceState(window.history.state,"",t.redirectUri),t&&t.valid){await this.#E(),await this.#w(t);return}let r=async t=>{let r={};t||(r.prompt="none"),e.locale&&(r.locale=e.locale),await this.login(r)},i=async()=>{switch(e.onLoad){case"check-sso":this.#a.enable?(await this.#E(),await this.#I()||(this.silentCheckSsoRedirectUri?await this.#A():await r(!1))):this.silentCheckSsoRedirectUri?await this.#A():await r(!1);break;case"login-required":await r(!0);break;default:throw Error("Invalid value for onLoad")}};if(e.token&&e.refreshToken)if(this.#U(e.token,e.refreshToken,e.idToken),this.#a.enable)await this.#E(),await this.#I()&&(this.onAuthSuccess?.(),this.#T());else try{await this.updateToken(-1),this.onAuthSuccess?.()}catch(t){if(this.onAuthError?.(),e.onLoad)await i();else throw t}else e.onLoad&&await i()}async #E(){if(!this.#a.enable||this.#a.iframe)return;let e=document.createElement("iframe");this.#a.iframe=e,e.setAttribute("src",this.endpoints.checkSessionIframe()),e.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),e.setAttribute("title","keycloak-session-iframe"),e.style.display="none",document.body.appendChild(e);let t=e=>{if(e.origin!==this.#a.iframeOrigin||this.#a.iframe?.contentWindow!==e.source||"unchanged"!==e.data&&"changed"!==e.data&&"error"!==e.data)return;"unchanged"!==e.data&&this.clearToken();let t=this.#a.callbackList;for(let r of(this.#a.callbackList=[],t.reverse()))"error"===e.data?r(Error("Error while checking login iframe")):r(null,"unchanged"===e.data)};window.addEventListener("message",t,!1);let r=new Promise(t=>{e.addEventListener("load",()=>{let e=this.endpoints.authorize();e.startsWith("/")?this.#a.iframeOrigin=globalThis.location.origin:this.#a.iframeOrigin=new URL(e).origin,t()})});await r}async #I(){if(!this.#a.iframe||!this.#a.iframeOrigin)return;let e=`${this.clientId} ${this.sessionId?this.sessionId:""}`,t=this.#a.iframeOrigin,r=new Promise((r,i)=>{this.#a.callbackList.push((e,t)=>e?i(e):r(t)),1===this.#a.callbackList.length&&this.#a.iframe?.contentWindow?.postMessage(e,t)});return await r}async #A(){let e=document.createElement("iframe"),t=await this.createLoginUrl({prompt:"none",redirectUri:this.silentCheckSsoRedirectUri});return e.setAttribute("src",t),e.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),e.setAttribute("title","keycloak-silent-check-sso"),e.style.display="none",document.body.appendChild(e),await new Promise((t,r)=>{let i=async o=>{if(o.origin!==window.location.origin||e.contentWindow!==o.source)return;let n=this.#y(o.data);try{await this.#w(n),t()}catch(e){r(e)}document.body.removeChild(e),window.removeEventListener("message",i)};window.addEventListener("message",i)})}#y(e){let t=this.#S(e);if(!t)return;let r=this.#i.get(t.state);return r&&(t.valid=!0,t.redirectUri=r.redirectUri,t.storedNonce=r.nonce,t.prompt=r.prompt,t.pkceCodeVerifier=r.pkceCodeVerifier,t.loginOptions=r.loginOptions),t}#S(e){let t,r=[];switch(this.flow){case"standard":r=["code","state","session_state","kc_action_status","kc_action","iss"];break;case"implicit":r=["access_token","token_type","id_token","state","session_state","expires_in","kc_action_status","kc_action","iss"];break;case"hybrid":r=["access_token","token_type","id_token","code","state","session_state","expires_in","kc_action_status","kc_action","iss"]}r.push("error"),r.push("error_description"),r.push("error_uri");let i=new URL(e),o="";if("query"===this.responseMode&&i.searchParams.size>0?(t=this.#C(i.search,r),i.search=t.paramsString,o=i.toString()):"fragment"===this.responseMode&&i.hash.length>0&&(t=this.#C(i.hash.substring(1),r),i.hash="",o=i.toString()),t?.oauthParams){if("standard"===this.flow||"hybrid"===this.flow){if((t.oauthParams.code||t.oauthParams.error)&&t.oauthParams.state)return t.oauthParams.redirectUri=o,t.oauthParams}else if("implicit"===this.flow&&(t.oauthParams.access_token||t.oauthParams.error)&&t.oauthParams.state)return t.oauthParams.redirectUri=o,t.oauthParams}}#C(e,t){let r=new URLSearchParams(e),i={};for(let[e,o]of Array.from(r.entries()))t.includes(e)&&(i[e]=o,r.delete(e));return{paramsString:r.toString(),oauthParams:i}}async #w(e){let{code:t,error:r,prompt:i}=e,o=new Date().getTime(),n=(t,r,i)=>{if(o=(o+new Date().getTime())/2,this.#U(t,r,i,o),this.#r&&this.idTokenParsed&&this.idTokenParsed.nonce!==e.storedNonce)throw this.#o("[KEYCLOAK] Invalid nonce, clearing token"),this.clearToken(),Error("Invalid nonce.")};if(e.kc_action_status&&this.onActionUpdate&&this.onActionUpdate(e.kc_action_status,e.kc_action),r){if("none"!==i)if(e.error_description&&"authentication_expired"===e.error_description)await this.login(e.loginOptions);else{let t={error:r,error_description:e.error_description};throw this.onAuthError?.(t),t}return}if("standard"!==this.flow&&(e.access_token||e.id_token)&&(n(e.access_token,void 0,e.id_token),this.onAuthSuccess?.()),"implicit"!==this.flow&&t)try{let r=await f(this.endpoints.token(),t,this.clientId,e.redirectUri,e.pkceCodeVerifier);n(r.access_token,r.refresh_token,r.id_token),"standard"===this.flow&&this.onAuthSuccess?.(),this.#T()}catch(e){throw this.onAuthError?.(),e}}async #T(){this.#a.enable&&this.token&&(await b(1e3*this.#a.interval),await this.#I()&&await this.#T())}login(e){return this.#t.login(e)}async createLoginUrl(e){let t=r(),o=r(),n=this.#t.redirectUri(e),s={state:t,nonce:o,redirectUri:n,loginOptions:e};e?.prompt&&(s.prompt=e.prompt);let a=e?.action==="register"?this.endpoints.register():this.endpoints.authorize(),l=e?.scope||this.scope,c=l?l.split(" "):[];c.includes("openid")||c.unshift("openid"),l=c.join(" ");let h=new URLSearchParams([["client_id",this.clientId],["redirect_uri",m(n)],["state",t],["response_mode",this.responseMode],["response_type",this.responseType],["scope",l]]);if(this.#r&&h.append("nonce",o),e?.prompt&&h.append("prompt",e.prompt),"number"==typeof e?.maxAge&&h.append("max_age",e.maxAge.toString()),e?.loginHint&&h.append("login_hint",e.loginHint),e?.idpHint&&h.append("kc_idp_hint",e.idpHint),e?.action&&"register"!==e.action&&h.append("kc_action",e.action),e?.locale&&h.append("ui_locales",e.locale),e?.acr&&h.append("claims",JSON.stringify({id_token:{acr:e.acr}})),e?.acrValues&&h.append("acr_values",e.acrValues),this.pkceMethod)try{let e=function(){var e=96,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let r=function(e){if("u"=0}hasResourceRole(e,t){if(!this.resourceAccess)return!1;let r=this.resourceAccess[t||this.clientId];return!!r&&r.roles.indexOf(e)>=0}async loadUserProfile(){let e=this.#b();if(!e)throw Error("Unable to load user profile, make sure the adapter is not configured using a generic OIDC provider.");let t=`${e}/account`,r=await p(t,{headers:[y(this.token)]});return this.profile=r}async loadUserInfo(){let e=this.endpoints.userinfo(),t=await p(e,{headers:[y(this.token)]});return this.userInfo=t}isTokenExpired(e){if(!this.tokenParsed||!this.refreshToken&&"implicit"!==this.flow)throw Error("Not authenticated");if(null==this.timeSkew)return this.#o("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;if("number"!=typeof this.tokenParsed.exp)return!1;let t=this.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+this.timeSkew;if(e){if(isNaN(e))throw Error("Invalid minValidity");t-=e}return t<0}async updateToken(e){if(!this.refreshToken)throw Error("Unable to update token, no refresh token available.");e=e||5,this.#a.enable&&await this.#I();let t=!1;if(-1===e?(t=!0,this.#o("[KEYCLOAK] Refreshing token: forced refresh")):(!this.tokenParsed||this.isTokenExpired(e))&&(t=!0,this.#o("[KEYCLOAK] Refreshing token: token expired")),!t)return!1;let{promise:r,resolve:i,reject:o}=Promise.withResolvers();if(this.#e.push({resolve:i,reject:o}),1===this.#e.length){let e=this.endpoints.token(),t=new Date().getTime();try{let r=await d(e,this.refreshToken,this.clientId);this.#o("[KEYCLOAK] Token refreshed"),t=(t+new Date().getTime())/2,this.#U(r.access_token,r.refresh_token,r.id_token,t),this.onAuthRefreshSuccess?.();for(let e=this.#e.pop();null!=e;e=this.#e.pop())e.resolve(!0)}catch(e){this.#s("[KEYCLOAK] Failed to refresh token"),e instanceof k&&400===e.response.status&&this.clearToken(),this.onAuthRefreshError?.();for(let t=this.#e.pop();null!=t;t=this.#e.pop())t.reject(e)}}return await r}clearToken(){this.token&&(this.#U(),this.onAuthLogout?.(),this.loginRequired&&this.login())}#U(e,t,r,i){if(this.tokenTimeoutHandle&&(clearTimeout(this.tokenTimeoutHandle),this.tokenTimeoutHandle=void 0),t?(this.refreshToken=t,this.refreshTokenParsed=l(t)):(delete this.refreshToken,delete this.refreshTokenParsed),r?(this.idToken=r,this.idTokenParsed=l(r)):(delete this.idToken,delete this.idTokenParsed),e){if(this.token=e,this.tokenParsed=l(e),this.sessionId=this.tokenParsed.sid,this.authenticated=!0,this.subject=this.tokenParsed.sub,this.realmAccess=this.tokenParsed.realm_access,this.resourceAccess=this.tokenParsed.resource_access,i&&(this.timeSkew=Math.floor(i/1e3)-this.tokenParsed.iat),null!==this.timeSkew&&(this.#o("[KEYCLOAK] Estimated time difference between browser and server is "+this.timeSkew+" seconds"),this.onTokenExpired)){let e=(this.tokenParsed.exp-new Date().getTime()/1e3+this.timeSkew)*1e3;this.#o("[KEYCLOAK] Token expires in "+Math.round(e/1e3)+" s"),e<=0?this.onTokenExpired():this.tokenTimeoutHandle=window.setTimeout(this.onTokenExpired,e)}}else delete this.token,delete this.tokenParsed,delete this.subject,delete this.realmAccess,delete this.resourceAccess,this.authenticated=!1}#b(){if(void 0!==this.authServerUrl)return`${w(this.authServerUrl)}/realms/${encodeURIComponent(this.realm)}`}#n(e){return t=>{this.enableLogging&&e.call(console,t)}}}function r(){if("u"e.startsWith(o))}#P(e){let t;try{t=JSON.parse(e)}catch(e){return null}return c(t)&&"expires"in t&&"number"==typeof t.expires?t.expires:null}}class s{get(e){if(!e)return null;let t=this.#O(o+e);return(this.#R(o+e,"",this.#B(-100)),t)?JSON.parse(t):null}add(e){this.#R(o+e.state,JSON.stringify(e),this.#B(60))}#O(e){let t=e+"=",r=document.cookie.split(";");for(let e=0;e{let r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}catch(e){return atob(t)}}(r)}catch(e){throw Error("Unable to decode token, payload is not a valid Base64URL value.",{cause:e})}try{return JSON.parse(t)}catch(e){throw Error("Unable to decode token, payload is not a valid JSON value.",{cause:e})}}function c(e){return"object"==typeof e&&null!==e}async function h(e){return await p(e)}async function u(e){return await p(e)}async function f(e,t,r,i,o){let n=new URLSearchParams([["code",t],["grant_type","authorization_code"],["client_id",r],["redirect_uri",m(i)]]);return o&&n.append("code_verifier",o),await p(e,{method:"POST",credentials:"include",body:n})}async function d(e,t,r){let i=new URLSearchParams([["grant_type","refresh_token"],["refresh_token",t],["client_id",r]]);return await p(e,{method:"POST",credentials:"include",body:i})}async function p(e,t={}){let r=new Headers(t.headers);r.set("Accept","application/json");let i=await g(e,{...t,headers:r});return await i.json()}async function g(e,t){let r=await fetch(e,t);if(!r.ok)throw new k("Server responded with an invalid status.",{response:r});return r}function y(e){if(!e)throw Error("Unable to build authorization header, token is not set, make sure the user is authenticated.");return["Authorization",`bearer ${e}`]}function w(e){return e.endsWith("/")?e.slice(0,-1):e}function m(e){let t=new URL(e);return t.hash="",t.toString()}class k extends Error{response;constructor(e,t){super(e,t),this.response=t.response}}let b=e=>new Promise(t=>setTimeout(t,e)),v=null;try{v=new t({url:"https://auth.cofinex.io",realm:"Cofinex",clientId:"cofinex-exchange"}),console.log("✅ Keycloak instance created successfully")}catch(e){console.error("❌ Error creating Keycloak instance:",e),v=null}let E=v;e.s(["default",0,E],396529)},454625,e=>{"use strict";var t=e.i(581949),r=e.i(396529);let i=()=>r.default&&r.default.token?r.default.token:null,o=async()=>{if(r.default&&r.default.token)try{return await r.default.updateToken(70),!0}catch(e){console.error("Failed to refresh token:",e)}return!1},n=()=>{try{let e=i();if(!e)return!0;let t=JSON.parse(atob(e.split(".")[1])),r=Math.floor(Date.now()/1e3);return t.exp{let e=i(),t={"Content-Type":"application/json"};return e&&(t.Authorization=`Bearer ${e}`),t},a=async(e,r={})=>{let{timeout:i=1e4,refreshToken:a=!0,checkTokenExpiry:l=!1}=r;try{if(a&&await o(),l&&n())throw Error("Token is expired");let r=e.replace(/([^:]\/)\/+/g,"$1");return(await t.default.get(r,{headers:s(),timeout:i})).data}catch(r){if(r?.response?.status===401&&a)try{await o();let r=e.replace(/([^:]\/)\/+/g,"$1");return(await t.default.get(r,{headers:s(),timeout:i})).data}catch(e){throw e}throw r}},l=async(e,r,i={})=>{let{timeout:a=1e4,refreshToken:l=!0,checkTokenExpiry:c=!1}=i;try{if(l&&await o(),c&&n())throw Error("Token is expired");let i=e.replace(/([^:]\/)\/+/g,"$1");return(await t.default.post(i,r,{headers:s(),timeout:a})).data}catch(i){if(i?.response?.status===401&&l)try{await o();let i=e.replace(/([^:]\/)\/+/g,"$1");return(await t.default.post(i,r,{headers:s(),timeout:a})).data}catch(e){throw e}throw i}},c=async(e,r,i={})=>{let{timeout:a=1e4,refreshToken:l=!0,checkTokenExpiry:c=!1}=i;try{if(l&&await o(),c&&n())throw Error("Token is expired");let i=e.replace(/([^:]\/)\/+/g,"$1");return(await t.default.patch(i,r,{headers:s(),timeout:a})).data}catch(i){if(i?.response?.status===401&&l)try{await o();let i=e.replace(/([^:]\/)\/+/g,"$1");return(await t.default.patch(i,r,{headers:s(),timeout:a})).data}catch(e){throw e}throw i}},h=async(e,r={})=>{let{timeout:i=1e4,refreshToken:a=!0,checkTokenExpiry:l=!1}=r;try{if(a&&await o(),l&&n())throw Error("Token is expired");let r=e.replace(/([^:]\/)\/+/g,"$1");return(await t.default.delete(r,{headers:s(),timeout:i})).data}catch(e){throw e}};e.s(["apiDelete",0,h,"apiGet",0,a,"apiPatch",0,c,"apiPost",0,l,"getHeaders",0,s,"refreshTokenIfNeeded",0,o])}]);