@openremote/or-scheduler 1.32.0 → 1.32.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1713,7 +1713,7 @@ var ORScheduler;(()=>{var e={3260(e){"use strict";let t=(async function(){}).con
1713
1713
  >
1714
1714
  <slot name="overlay"></slot>
1715
1715
  </vaadin-date-picker-overlay>
1716
- `}ready(){super.ready(),this.addController(new rS(this,e=>{this._setInputElement(e),this._setFocusElement(e),this.stateTarget=e,this.ariaTarget=e},{uniqueIdPrefix:"search-input"})),this.addController(new rY(this.inputElement,this._labelController)),this._tooltipController=new iu(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this._tooltipController.setShouldShow(e=>!e.opened),this._positionTarget=this.shadowRoot.querySelector('[part="input-field"]'),this.shadowRoot.querySelector('[part="field-button toggle-button"]').addEventListener("mousedown",e=>e.preventDefault())}_onOpenedChanged(e){this.opened=e.detail.value}_onVaadinOverlayClose(e){let t=e.detail.sourceEvent;t?.composedPath().includes(this)&&!t.composedPath().includes(this._overlayElement)&&e.preventDefault()}_toggle(e){e.stopPropagation(),this.$.overlay.opened?this.close():this.open()}}ox(a6),n(4532);var a8=n(4867),a7=n.n(a8);n(3472);class a9{get resolve(){return this._resolve}get reject(){return this._reject}get promise(){return this._promise}constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t}),Object.freeze(this)}}function se(e,t,n=!0){if(null==e||null==t)return e===t;if(e.constructor!==t.constructor)return!1;if(e instanceof Function||e instanceof RegExp)return e===t;if(e===t||e.valueOf()===t.valueOf())return!0;if(Array.isArray(e)&&e.length!==t.length||e instanceof Date||!(e instanceof Object)||!(t instanceof Object))return!1;if(n){if(Array.isArray(e))return e.every((e,n)=>se(e,t[n]));let n=Object.keys(e);return Object.keys(t).every(e=>-1!==n.indexOf(e))&&n.every(n=>se(e[n],t[n]))}return!1}class st{constructor(e){e&&Object.assign(this,e)}matches(e){var t,n,o,i,r,a,s;if((null==(t=this.ids)?void 0:t.length)&&(!e.id||!this.ids.includes(e.id))||(null==(n=this.types)?void 0:n.length)&&(!e.type||!this.types.includes(e.type))||(null==(o=this.realm)?void 0:o.name)&&e.realm!==this.realm.name||(null==(i=this.parents)?void 0:i.length)&&!this.parents.some(t=>!t.id||e.parentId===t.id))return!1;if(null==(r=this.paths)?void 0:r.length){let t=null!=(a=e.path)?a:[];if(!this.paths.some(e=>{var n;return(null!=(n=e.path)?n:[]).every((e,n)=>t[n]===e)}))return!1}return(null==(s=this.names)||!s.length||!!this.names.every(t=>st._evalValuePredicate(e.name,t)))&&(!this.attributes||st._evalGroup(e,this.attributes))}static getUnsupportedFields(e){return Object.keys(e).filter(e=>!st._SUPPORTED_FIELDS.has(e))}collectAttributeNames(){return this.attributes?st._collectNames(this.attributes):[]}static _evalValuePredicate(e,t){var n;switch(t.predicateType){case"string":{let o;if(null==e)return!1;let i=!1!==t.caseSensitive?String(e):String(e).toLowerCase(),r=!1!==t.caseSensitive?t.value:null==(n=t.value)?void 0:n.toLowerCase();switch(t.match){case"BEGIN":o=i.startsWith(r);break;case"END":o=i.endsWith(r);break;case"CONTAINS":o=i.includes(r);break;default:o=i===r}return t.negate?!o:o}case"boolean":return e===t.value;case"number":{let n;if("number"!=typeof e)return!1;switch(t.operator){case"GREATER_THAN":n=e>t.value;break;case"GREATER_EQUALS":n=e>=t.value;break;case"LESS_THAN":n=e<t.value;break;case"LESS_EQUALS":n=e<=t.value;break;case"BETWEEN":n=e>=t.value&&e<=t.rangeValue;break;default:n=e===t.value}return t.negate?!n:n}}return!1}static _evalPredicate(e,t){var n,o;let i=null==(n=t.name)?void 0:n.value;if(!i)return!0;let r=null==(o=e.attributes)?void 0:o[i];if(!r)return!!t.negated;let a=!t.value||st._evalValuePredicate(r.value,t.value);return t.negated?!a:a}static _evalGroup(e,t){var n,o,i;let r=null!=(n=t.operator)?n:"AND",a=[...(null!=(o=t.items)?o:[]).map(t=>st._evalPredicate(e,t)),...(null!=(i=t.groups)?i:[]).map(t=>st._evalGroup(e,t))];return!a.length||("OR"===r?a.some(Boolean):a.every(Boolean))}static _collectNames(e){var t,n;return[...(null!=(t=e.items)?t:[]).map(e=>{var t;return null==(t=e.name)?void 0:t.value}).filter(e=>!!e),...(null!=(n=e.groups)?n:[]).flatMap(e=>st._collectNames(e))]}}st._SUPPORTED_FIELDS=new Set(["ids","types","names","parents","paths","realm","attributes"]);var sn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function a(e){try{d(o.next(e))}catch(e){r(e)}}function s(e){try{d(o.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}d((o=o.apply(e,t||[])).next())})};let so=n(4461);class si{constructor(e,t,n){this._autoEnable=!1,this._initialised=!1,this._initialiseInProgress=!1,this._pendingProviderPromises={},this._providerMessageListeners={},this._pendingProviderEnables=[],this._registrationTimer=null,this._realm=e,this._autoEnable=t,this._enableCompleteCallback=n,window.OpenRemoteConsole=this;let o=new URLSearchParams(window.location.search),i=o.get("consoleName"),r=o.get("consoleVersion"),a=o.get("consolePlatform"),s=o.get("consoleProviders"),d=o.get("consoleAutoEnable"),l=s&&s.length>0?s.split(" "):["push"];this._pendingProviderEnables=l;let c=si._createConsoleRegistration(),u=window.localStorage.getItem(this._storageKey);if(u)try{let e=JSON.parse(u);e.id&&(c.id=e.id),e.name&&(c.name=e.name),e.providers&&(c.providers=e.providers),e.apps&&(c.apps=e.apps)}catch(e){console.error("Failed to deserialise console registration")}let m=c.providers;for(let e of(c.providers={},l)){let t=m&&m.hasOwnProperty(e)?m[e]:{enabled:!1,disabled:!1};c.providers[e]=t}let h=cH.getAppName();h.length>0&&0>c.apps.indexOf(h)&&c.apps.push(h),this._registration=c,i&&(c.name=i),r&&(c.version=r),a&&(c.platform=a),d&&(this._autoEnable="TRUE"===d||"true"===d)}get registration(){return this._registration}get autoEnable(){return this._autoEnable}get pendingProviderEnables(){return this._pendingProviderEnables.slice(0)}get shellApple(){let e=navigator.userAgentData&&navigator.userAgentData.platform?navigator.userAgentData.platform:navigator.platform;return e&&("iP"===e.substring(0,2)||"Mac"===e.substring(0,3))&&window.webkit&&window.webkit.messageHandlers}get shellAndroid(){return!!window.MobileInterface}get isMobile(){return this.shellApple||this.shellAndroid}initialise(){return sn(this,void 0,void 0,function*(){if(!this._initialised&&!this._initialiseInProgress){console.debug("Console: initialising"),this._initialiseInProgress=!0;try{if(this._registration.providers)for(let e of Object.keys(this._registration.providers))yield this._initialiseProvider(e);this._registration.id||(yield this.sendRegistration()),this._initialised=!0,this._initialiseInProgress=!1,0===this._pendingProviderEnables.length?(yield this.sendRegistration(),this._callCompletedCallback()):this._autoEnable&&(yield this.enableProviders())}catch(e){console.error(e)}finally{this._initialiseInProgress=!1}}})}enableProviders(){return sn(this,void 0,void 0,function*(){if(!this._initialised)throw Error("Console must be initialised before enabling providers");for(let e=this._pendingProviderEnables.length-1;e>-1;e--){let t=this._pendingProviderEnables[e];yield this.enableProvider(t)}})}enableProvider(e,t){return sn(this,void 0,void 0,function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),Error("Console must be initialised before enabling providers");if(!this._registration.providers.hasOwnProperty(e))throw console.debug("Invalid console provider '"+e+"'"),Error("Invalid console provider '"+e+"'");console.debug("Console: enabling provider '"+e+"'");let n={provider:e,action:"PROVIDER_ENABLE",consoleId:this._registration.id,data:t},o=yield this.sendProviderMessage(n,!0);this._registration.providers[e].hasPermission=o.hasPermission,this._registration.providers[e].success=o.success,this._registration.providers[e].enabled=o.success,this._registration.providers[e].data=o.data;let i=this._pendingProviderEnables.indexOf(e);return i>=0&&(this._pendingProviderEnables.splice(i,1),0===this._pendingProviderEnables.length&&(this.sendRegistration().catch(()=>void 0),this._callCompletedCallback())),o})}disableProvider(e){return sn(this,void 0,void 0,function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),Error("Console must be initialised before disabling providers");if(!this._registration.providers.hasOwnProperty(e))throw console.debug("Invalid console provider '"+e+"'"),Error("Invalid console provider '"+e+"'");console.debug("Console: disabling provider '"+e+"'");let t=yield this.sendProviderMessage({provider:e,action:"PROVIDER_DISABLE"},!0);return this._registration.providers[e].disabled=!0,this._registration.providers[e].enabled=!1,t})}getProvider(e){return this._registration&&this._registration.providers?this._registration.providers[e]:void 0}sendProviderMessage(e,t){return sn(this,void 0,void 0,function*(){if("storage"!==e.provider&&!this._registration.providers.hasOwnProperty(e.provider))throw console.debug("Invalid console provider '"+e.provider+"'"),Error("Invalid console provider '"+e.provider+"'");if(!t)return void this._doSendProviderMessage(e);let n=e.provider+e.action;if(this._pendingProviderPromises[n])throw Error("Message already pending for provider '"+e.provider+"' with action '"+e.action+"'");let o=new a9,i=()=>{delete this._pendingProviderPromises[n],o.reject("No response from provider")};return this._pendingProviderPromises[n]=[o,window.setTimeout(i,5e3)],this._doSendProviderMessage(e),o.promise})}sendRegistration(){return this._registrationTimer&&(window.clearTimeout(this._registrationTimer),this._registrationTimer=null),new Promise((e,t)=>{this._registrationTimer=window.setTimeout(()=>sn(this,void 0,void 0,function*(){this._registrationTimer=null,console.debug("Console: updating registration");try{yield this._sendRegistration(!0),e()}catch(e){console.error("Failed to register console",e),t(e)}}))})}_sendRegistration(e){return sn(this,void 0,void 0,function*(){this._normaliseRegistration();let t=!!this._registration.id;try{let e=yield cH.rest.api.ConsoleResource.register(this._registration);if(200!==e.status)throw Error("Failed to register console");this._registration=e.data,console.debug("Console: registration successful"),console.debug("Console: updating locally stored registration"),window.localStorage.setItem(this._storageKey,JSON.stringify(this._registration))}catch(n){if(e&&t&&si._isStaleRegistrationResponse(n)){console.warn("Console registration ID is stale or cannot be claimed; creating a new console registration"),window.localStorage.removeItem(this._storageKey),delete this._registration.id,yield this._sendRegistration(!1);return}throw n}})}_normaliseRegistration(){this._registration.name||(this._registration.name="Console"),this._registration.platform||(this._registration.platform="N/A"),this._registration.version||(this._registration.version="N/A"),this._registration.providers||(this._registration.providers={})}get _storageKey(){return"OpenRemoteConsole:"+this._realm}static _isStaleRegistrationResponse(e){let t=e&&e.response?e.response.status:void 0;return 403===t||409===t}storeData(e,t){this.sendProviderMessage({provider:"storage",action:"STORE",key:e,value:t},!1)}retrieveData(e){return sn(this,void 0,void 0,function*(){let t=this.sendProviderMessage({provider:"storage",action:"RETRIEVE",key:e},!0);try{let e=yield Promise.race([t,new Promise((e,t)=>setTimeout(t,2e3))]);if(e&&e.value){let t=e.value;return"null"===t?void 0:t}}catch(e){console.log("Failed to retrieve data from storage provider")}})}addProviderMessageListener(e,t){this._providerMessageListeners[e.provider+e.action]=t}removeProviderMessageListener(e){delete this._providerMessageListeners[e.provider+e.action]}_postNativeShellMessage(e){try{if(this.shellAndroid)return window.MobileInterface.postMessage(JSON.stringify(e));if(this.shellApple)return window.webkit.messageHandlers.int.postMessage(e)}catch(e){console.error("Failed to send shell message towards console",e)}}_doSendGenericMessage(e,t){let n={type:e,data:t};this.isMobile?this._postNativeShellMessage(n):console.warn("Failed to send generic message to console.",n)}_doSendProviderMessage(e){if(this.isMobile)this._postNativeShellMessage({type:"provider",data:e});else{if(!e.provider||!e.action)return;switch(e.provider.trim().toUpperCase()){case"PUSH":switch(e.action.trim().toUpperCase()){case"PROVIDER_INIT":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_INIT",provider:"push",version:"web",enabled:!0,disabled:!1,hasPermission:!0,requiresPermission:!1,success:!0}));break;case"PROVIDER_ENABLE":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_ENABLE",provider:"push",hasPermission:!0,success:!0}));break;default:throw Error("Unsupported provider '"+e.provider+"' and action '"+e.action+"'")}break;case"STORAGE":switch(e.action){case"PROVIDER_INIT":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_INIT",provider:"storage",version:"1.0.0",disabled:!1,enabled:!0,hasPermission:!0,requiresPermission:!1,success:!0}));break;case"PROVIDER_ENABLE":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_ENABLE",provider:"storage",hasPermission:!0,success:!0}));break;case"STORE":{let t=e.key?e.key.trim():null;if(!t||0===t.length)throw Error("Storage provider 'store' action requires a `key`");null===e.value?window.localStorage.removeItem(t):window.localStorage.setItem(t,JSON.stringify(e.value))}break;case"RETRIEVE":{let t=e.key?e.key.trim():null;if(!t||0===t.length)throw Error("Storage provider 'retrieve' action requires a `key`");let n=window.localStorage.getItem(t);if(null!==n)try{n=JSON.parse(n)}catch(e){}this._handleProviderResponse(JSON.stringify({action:"RETRIEVE",provider:"storage",key:t,value:n}))}break;default:throw Error("Unsupported provider '"+e.provider+"' and action '"+e.action+"'")}break;default:console.error("Unsupported provider: "+e.provider)}}}_handleProviderResponse(e){if(!e)return;let t=JSON.parse(e),n=t.provider,o=t.action,i=this._pendingProviderPromises[n+o];i&&(window.clearTimeout(i[1]),delete this._pendingProviderPromises[n+o],i[0].resolve(t));let r=this._providerMessageListeners[n+o];r&&r(t)}_callCompletedCallback(){let e=this._enableCompleteCallback;this._enableCompleteCallback=null,e&&window.setTimeout(()=>{e()},0)}static _createConsoleRegistration(){return{name:so.name,version:so.version,platform:so.os.toString(),apps:[],model:((so.manufacturer?so.manufacturer+" ":"")+(so.product?so.product:"")).trim()}}_initialiseProvider(e){return sn(this,void 0,void 0,function*(){let t;console.debug("Console: initialising provider '"+e+"'");try{t=yield this.sendProviderMessage({provider:e,action:"PROVIDER_INIT"},!0),this._registration.providers[e].version=t.version,this._registration.providers[e].requiresPermission=t.requiresPermission,this._registration.providers[e].hasPermission=t.hasPermission,this._registration.providers[e].success=t.success,this._registration.providers[e].enabled=t.enabled,this._registration.providers[e].disabled=t.disabled,this._registration.providers[e].data=t.data}catch(e){console.error(e),t={action:"",disabled:!1,enabled:!1,hasPermission:!1,provider:"",requiresPermission:!1,version:"",success:!1}}if(t.success||(console.debug("Provider initialisation failed: '"+e+"'"),t.disabled=!0,this._registration.providers[e].disabled=!0),t.disabled||t.enabled){let t=this._pendingProviderEnables.indexOf(e);t>=0&&this._pendingProviderEnables.splice(t,1)}})}}function sr(e,t){return function(){return e.apply(t,arguments)}}let{toString:sa}=Object.prototype,{getPrototypeOf:ss}=Object,{iterator:sd,toStringTag:sl}=Symbol,sc=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),su=e=>"string"==typeof e&&("__proto__"===e||"constructor"===e||"prototype"===e),sm=(e,t,n)=>e===Object.prototype||!n&&null===t,sh=(e,t)=>{let n=e,o=[];for(;null!=n&&-1===o.indexOf(n);){o.push(n);let i=ss(n);if(sm(n,i,n===e))break;if(sc(n,t))return!0;n=i}return!1},sf=(r=Object.create(null),e=>{let t=sa.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())}),sb=e=>(e=e.toLowerCase(),t=>sf(t)===e),sp=e=>t=>typeof t===e,{isArray:s_}=Array,sg=sp("undefined");function sF(e){return null!==e&&!sg(e)&&null!==e.constructor&&!sg(e.constructor)&&sw(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}let sy=sb("ArrayBuffer"),sv=sp("string"),sw=sp("function"),sk=sp("number"),sE=e=>null!==e&&"object"==typeof e,sD=e=>{if(!sE(e))return!1;let t=ss(e);return(null===t||t===Object.prototype||null===ss(t))&&!sh(e,sl)&&!sh(e,sd)},sM=sb("Date"),sL=sb("File"),sC=sb("Blob"),sA=sb("FileList"),sT=sb("Set"),sx="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},sS=void 0!==sx.FormData?sx.FormData:void 0,sY=sb("URLSearchParams"),[sO,sI,sP,sB]=["ReadableStream","Request","Response","Headers"].map(sb);function sR(e,t,{allOwnKeys:n=!1}={}){let o,i;if(null!=e)if("object"!=typeof e&&(e=[e]),s_(e))for(o=0,i=e.length;o<i;o++)t.call(null,e[o],o,e);else{let i;if(sF(e))return;let r=n?Object.getOwnPropertyNames(e):Object.keys(e),a=r.length;for(o=0;o<a;o++)i=r[o],t.call(null,e[i],i,e)}}function sN(e,t){let n;if(sF(e))return null;t=t.toLowerCase();let o=Object.keys(e),i=o.length;for(;i-- >0;)if(t===(n=o[i]).toLowerCase())return n;return null}let sj="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,sH=e=>!sg(e)&&e!==sj,sU=(a="u">typeof Uint8Array&&ss(Uint8Array),e=>a&&e instanceof a),sz=sb("HTMLFormElement"),{propertyIsEnumerable:s$}=Object.prototype,sW=sb("RegExp"),sV=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),o={};sR(n,(n,i)=>{let r;!1!==(r=t(n,i,e))&&(o[i]=r||n)}),Object.defineProperties(e,o)},sq=sb("AsyncFunction"),sG=(l="function"==typeof setImmediate,c=sw(sj.postMessage),l?setImmediate:c?(u=`axios@${Math.random()}`,m=[],sj.addEventListener("message",({source:e,data:t})=>{e===sj&&t===u&&m.length&&m.shift()()},!1),e=>{m.push(e),sj.postMessage(u,"*")}):e=>setTimeout(e)),sK="u">typeof queueMicrotask?queueMicrotask.bind(sj):"u">typeof process&&process.nextTick||sG,sJ=e=>null!=e&&sw(e[sd]),sX={isArray:s_,isArrayBuffer:sy,isBuffer:sF,isFormData:e=>{if(!e)return!1;if(sS&&e instanceof sS)return!0;let t=ss(e);if(!t||t===Object.prototype||!sw(e.append))return!1;let n=sf(e);return"formdata"===n||"object"===n&&sw(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&sy(e.buffer)},isString:sv,isNumber:sk,isBoolean:e=>!0===e||!1===e,isObject:sE,isPlainObject:sD,isEmptyObject:e=>{if(!sE(e)||sF(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:sO,isRequest:sI,isResponse:sP,isHeaders:sB,isUndefined:sg,isDate:sM,isFile:sL,isReactNativeBlob:e=>!!(e&&void 0!==e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:sC,isRegExp:sW,isFunction:sw,isStream:e=>sE(e)&&sw(e.pipe),isURLSearchParams:sY,isTypedArray:sU,isFileList:sA,forEach:sR,merge:function e(...t){let{caseless:n,skipUndefined:o}=sH(this)&&this||{},i={},r=(t,r)=>{if("__proto__"===r||"constructor"===r||"prototype"===r)return;let a=n&&"string"==typeof r&&sN(i,r)||r,s=sc(i,a)?i[a]:void 0;sD(s)&&sD(t)?i[a]=e(s,t):sD(t)?i[a]=e({},t):s_(t)?i[a]=t.slice():o&&sg(t)||(i[a]=t)};for(let e=0,n=t.length;e<n;e++){let n=t[e];if(!n||sF(n)||(sR(n,r),"object"!=typeof n||s_(n)))continue;let o=Object.getOwnPropertySymbols(n);for(let e=0;e<o.length;e++){let t=o[e];s$.call(n,t)&&r(n[t],t)}}return i},extend:(e,t,n,{allOwnKeys:o}={})=>(sR(t,(t,o)=>{n&&sw(t)?Object.defineProperty(e,o,{__proto__:null,value:sr(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,o)=>{let i,r,a,s={};if(t=t||{},null==e)return t;do{for(r=(i=Object.getOwnPropertyNames(e)).length;r-- >0;)a=i[r],(!o||o(a,e,t))&&!s[a]&&(t[a]=e[a],s[a]=!0);e=!1!==n&&ss(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:sf,kindOfTest:sb,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;let o=e.indexOf(t,n);return -1!==o&&o===n},toArray:e=>{if(!e)return null;if(s_(e))return e;let t=e.length;if(!sk(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{let n,o=(e&&e[sd]).call(e);for(;(n=o.next())&&!n.done;){let o=n.value;t.call(e,o[0],o[1])}},matchAll:(e,t)=>{let n,o=[];for(;null!==(n=e.exec(t));)o.push(n);return o},isHTMLForm:sz,hasOwnProperty:sc,hasOwnProp:sc,hasOwnInPrototypeChain:sh,getSafeProp:(e,t)=>null!=e&&sh(e,t)?e[t]:void 0,toSafeFlatObject:e=>{if(null==e||"object"!=typeof e&&"function"!=typeof e)return e;let t=ss(e);if(null===t&&(e=>{if(!Object.isExtensible(e))return!1;let t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push(...Object.getOwnPropertySymbols(e)),t.every(t=>{if(su(t))return!1;let n=Object.getOwnPropertyDescriptor(e,t);return!!n&&n.configurable&&!0===n.writable})})(e))return e;let n=Object.create(null),o=Object.create(null),i=[],r=e;for(;null!=r&&-1===i.indexOf(r);){i.push(r);let a=r===e?t:ss(r);if(sm(r,a,r===e))break;let s=Object.getOwnPropertyNames(r);for(let t of(Object.getOwnPropertySymbols&&s.push(...Object.getOwnPropertySymbols(r)),s))!su(t)&&(sc(o,t)||(n[t]=e[t],o[t]=!0));r=a}return n},reduceDescriptors:sV,freezeMethods:e=>{sV(e,(t,n)=>{if(sw(e)&&["arguments","caller","callee"].includes(n))return!1;if(sw(e[n])){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},toObjectSet:(e,t)=>{let n={};return(s_(e)?e:String(e).split(t)).forEach(e=>{n[e]=!0}),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e*=1)?e:t,findKey:sN,global:sj,isContextDefined:sH,isSpecCompliantForm:function(e){return!!(e&&sw(e.append)&&"FormData"===e[sl]&&e[sd])},toJSONObject:e=>{let t=new WeakSet,n=e=>{if(sE(e)){if(t.has(e))return;if(sF(e))return e;if(!("toJSON"in e)){let o;if(t.add(e),sT(e))for(let t of(o=[],e)){let e=n(t);sg(e)||o.push(e)}else o=s_(e)?[]:{},sR(e,(e,t)=>{let i=n(e);sg(i)||(o[t]=i)});return t.delete(e),o}}return e};return n(e)},isAsyncFn:sq,isThenable:e=>e&&(sE(e)||sw(e))&&sw(e.then)&&sw(e.catch),setImmediate:sG,asap:sK,isIterable:sJ,isSafeIterable:e=>null!=e&&sh(e,sd)&&sJ(e)},sQ=sX.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),sZ=RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),s0=RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function s1(e,t){return sX.isArray(e)?e.map(e=>s1(e,t)):function(e){let t=0,n=e.length;for(;t<n;){let n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){let t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function s2(e){let t=Object.create(null);return sX.forEach(e.toJSON(),(e,n)=>{t[n]=s1(e,s0)}),t}let s4=Symbol("internals");function s3(e){return e&&String(e).trim().toLowerCase()}function s5(e){return!1===e||null==e?e:sX.isArray(e)?e.map(s5):s1(String(e),sZ)}let s6=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function s8(e){let t=0,n=e.length;for(;t<n;){let n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){let t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}function s7(e,t,n,o,i){if(sX.isFunction(o))return o.call(this,t,n);if(i&&(t=n),sX.isString(t)){if(sX.isString(o))return -1!==t.indexOf(o);if(sX.isRegExp(o))return o.test(t)}}class s9{constructor(e){e&&this.set(e)}set(e,t,n){let o=this;function i(e,t,n){let i=s3(t);if(!i)return;let r=sX.findKey(o,i);r&&void 0!==o[r]&&!0!==n&&(void 0!==n||!1===o[r])||(o[r||t]=s5(e))}let r=(e,t)=>sX.forEach(e,(e,n)=>i(e,n,t));if(sX.isPlainObject(e)||e instanceof this.constructor)r(e,t);else{let o;if(sX.isString(e)&&(e=e.trim())&&(o=e,!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(o.trim()))){var a;let n,o,i,s;r((s={},(a=e)&&a.split("\n").forEach(function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),o=e.substring(i+1).trim();let t=sX.hasOwnProp(s,n);!n||t&&sX.hasOwnProp(sQ,n)||("set-cookie"===n?t?s[n].push(o):s[n]=[o]:s[n]=t?s[n]+", "+o:o)}),s),t)}else if(sX.isObject(e)&&sX.isSafeIterable(e)){let n=Object.create(null),o,i;for(let t of e){if(!sX.isArray(t))throw TypeError("Object iterator must return a key-value pair");i=t[0],sX.hasOwnProp(n,i)?(o=n[i],n[i]=sX.isArray(o)?[...o,t[1]]:[o,t[1]]):n[i]=t[1]}r(n,t)}else null!=e&&i(t,e,n)}return this}get(e,t){if(e=s3(e)){let n=sX.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(!0===t){let t,n=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;t=o.exec(e);)n[t[1]]=t[2];return n}if(sX.isFunction(t))return t.call(this,e,n);if(sX.isRegExp(t))return t.exec(e);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=s3(e)){let n=sX.findKey(this,e);return!!(n&&void 0!==this[n]&&(!t||s7(this,this[n],n,t)))}return!1}delete(e,t){let n=this,o=!1;function i(e){if(e=s3(e)){let i=sX.findKey(n,e);i&&(!t||s7(n,n[i],i,t))&&(delete n[i],o=!0)}}return sX.isArray(e)?e.forEach(i):i(e),o}clear(e){let t=Object.keys(this),n=t.length,o=!1;for(;n--;){let i=t[n];(!e||s7(this,this[i],i,e,!0))&&(delete this[i],o=!0)}return o}normalize(e){let t=this,n={};return sX.forEach(this,(o,i)=>{let r=sX.findKey(n,i);if(r){t[r]=s5(o),delete t[i];return}let a=e?i.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n):String(i).trim();a!==i&&delete t[i],t[a]=s5(o),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return sX.forEach(this,(n,o)=>{null!=n&&!1!==n&&(t[o]=e&&sX.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){let e=this.get("set-cookie");return sX.isArray(e)?e:null==e||!1===e?[]:[e]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static parseParameters(e){return function(e){let t=Object.create(null),n=String(e),o=0,i=!1,r=!1;function a(e){let i=s8(n.slice(o,e)),r=i.indexOf("=");if(r<1)return;let a=s8(i.slice(0,r));if(!s6.test(a))return;let s=a.toLowerCase();if("__proto__"===s||"constructor"===s||"prototype"===s)return;let d=s8(i.slice(r+1));t[s]=function(e){let t=e.length-1;if(t<1||34!==e.charCodeAt(0)||34!==e.charCodeAt(t))return e;let n="";for(let o=1;o<t;o++){let i=e.charCodeAt(o);if(34===i||92===i&&(o+=1)>=t)return e;n+=e[o]}return n}(d)}for(let e=0;e<n.length;e++){let t=n.charCodeAt(e);i?r?r=!1:92===t?r=!0:34===t&&(i=!1):34===t?i=!0:(44===t||59===t)&&(a(e),o=e+1)}return a(n.length),t}(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[s4]=this[s4]={accessors:{}}).accessors,n=this.prototype;function o(e){let o=s3(e);if(!t[o]){let i;i=sX.toCamelCase(" "+e),["get","set","has"].forEach(t=>{Object.defineProperty(n,t+i,{__proto__:null,value:function(n,o,i){return this[t].call(this,e,n,o,i)},configurable:!0})}),t[o]=!0}}return sX.isArray(e)?e.forEach(o):o(e),this}}s9.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),sX.reduceDescriptors(s9.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),sX.freezeMethods(s9);let de="[REDACTED ****]";function dt(e){try{return String(e)}catch(e){return""}}class dn extends Error{static from(e,t,n,o,i,r){let a=e.message;!a&&sX.isArray(e.errors)&&e.errors.length&&(a=e.errors.map(e=>{try{return e&&e.message?dt(e.message):dt(e)}catch(e){return""}}).filter(Boolean).join("; ")||e.name||"AggregateError");let s=new dn(a,t||e.code,n,o,i);return Object.defineProperty(s,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),s.name=e.name,null!=e.status&&null==s.status&&(s.status=e.status),r&&Object.assign(s,r),s}constructor(e,t,n,o,i){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),o&&(this.request=o),i&&(this.response=i,this.status=i.status)}toJSON(){let e,t,n,o=this.config,i=o&&sX.hasOwnProp(o,"redact")?o.redact:void 0,r=sX.isArray(i)&&i.length>0?(e=new Set(i.map(e=>String(e).toLowerCase())),t=[],(n=o=>{let i;if(null===o||"object"!=typeof o||sX.isBuffer(o))return o;if(-1===t.indexOf(o)){if(o instanceof s9&&(o=o.toJSON()),t.push(o),sX.isArray(o))i=[],o.forEach((e,t)=>{let o=n(e);sX.isUndefined(o)||(i[t]=o)});else{if(!sX.isPlainObject(o)&&function(e){if(sX.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(sX.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(o))return t.pop(),o;for(let[t,r]of(i=Object.create(null),Object.entries(o))){let o=e.has(t.toLowerCase())?de:n(r);sX.isUndefined(o)||(i[t]=o)}}return t.pop(),i}})(o)):sX.toJSONObject(o);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:r,code:this.code,status:this.status}}}dn.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",dn.ERR_BAD_OPTION="ERR_BAD_OPTION",dn.ECONNABORTED="ECONNABORTED",dn.ETIMEDOUT="ETIMEDOUT",dn.ECONNREFUSED="ECONNREFUSED",dn.ERR_NETWORK="ERR_NETWORK",dn.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",dn.ERR_DEPRECATED="ERR_DEPRECATED",dn.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",dn.ERR_BAD_REQUEST="ERR_BAD_REQUEST",dn.ERR_CANCELED="ERR_CANCELED",dn.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",dn.ERR_INVALID_URL="ERR_INVALID_URL",dn.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";let di=dn;function dr(e){return sX.isPlainObject(e)||sX.isArray(e)}function da(e){return sX.endsWith(e,"[]")?e.slice(0,-2):e}function ds(e,t,n){return e?e.concat(t).map(function(e,t){return e=da(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}let dd=sX.toFlatObject(sX,{},null,function(e){return/^is[A-Z]/.test(e)}),dl=function(e,t,n){if(!sX.isObject(e))throw TypeError("target must be an object");t=t||new FormData;let o=(e,t)=>{let o=sX.getSafeProp(n,e);return sX.isUndefined(o)?t:o},i=o("metaTokens",!0),r=o("visitor")||f,a=o("dots",!1),s=o("indexes",!1),d=o("Blob")||"u">typeof Blob&&Blob,l=o("maxDepth",100),c=d&&sX.isSpecCompliantForm(t),u=[];if(!sX.isFunction(r))throw TypeError("visitor must be a function");function m(e){if(null===e)return"";if(sX.isDate(e))return e.toISOString();if(sX.isBoolean(e))return e.toString();if(!c&&sX.isBlob(e))throw new di("Blob is not supported. Use a Buffer instead.");if(sX.isArrayBuffer(e)||sX.isTypedArray(e)){if(c&&"function"==typeof d)return new d([e]);throw new di("Blob is not supported. Use a Buffer instead.",di.ERR_NOT_SUPPORT)}return e}function h(e){if(e>l)throw new di("Object is too deeply nested ("+e+" levels). Max depth: "+l,di.ERR_FORM_DATA_DEPTH_EXCEEDED)}function f(e,n,o){let r=e;if(sX.isReactNative(t)&&sX.isReactNativeBlob(e))return t.append(ds(o,n,a),m(e)),!1;if(e&&!o&&"object"==typeof e)if(sX.endsWith(n,"{}"))n=i?n:n.slice(0,-2),e=function(e){if(1/0===l)return JSON.stringify(e);let t=[];return JSON.stringify(e,function(e,n){if(!sX.isObject(n))return n;for(;t.length&&t[t.length-1]!==this;)t.pop();return t.push(n),h(1+t.length-1),n})}(e);else{var d;if(sX.isArray(e)&&(d=e,sX.isArray(d)&&!d.some(dr))||(sX.isFileList(e)||sX.endsWith(n,"[]"))&&(r=sX.toArray(e)))return n=da(n),r.forEach(function(e,o){sX.isUndefined(e)||null===e||t.append(!0===s?ds([n],o,a):null===s?n:n+"[]",m(e))}),!1}return!!dr(e)||(t.append(ds(o,n,a),m(e)),!1)}let b=Object.assign(dd,{defaultVisitor:f,convertValue:m,isVisitable:dr});if(!sX.isObject(e))throw TypeError("data must be an object");return!function e(n,o,i=0){if(!sX.isUndefined(n)){if(h(i),-1!==u.indexOf(n))throw Error("Circular reference detected in "+o.join("."));u.push(n),sX.forEach(n,function(n,a){!0===(!(sX.isUndefined(n)||null===n)&&r.call(t,n,sX.isString(a)?a.trim():a,o,b))&&e(n,o?o.concat(a):[a],i+1)}),u.pop()}}(e),t};function dc(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function du(e,t){this._pairs=[],e&&dl(e,this,t)}let dm=du.prototype;function dh(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function df(e,t,n){let o;if(!t)return e;e=e||"";let i=sX.isFunction(n)?{serialize:n}:n,r=sX.getSafeProp(i,"encode")||dh,a=sX.getSafeProp(i,"serialize");if(o=a?a(t,i):sX.isURLSearchParams(t)?t.toString():new du(t,i).toString(r)){let t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}dm.append=function(e,t){this._pairs.push([e,t])},dm.toString=function(e){let t=e?t=>e.call(this,t,dc):dc;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};let db=Symbol("internals");function dp(e){return e?e.length:0}function d_(e){if(e)for(;e.length&&null===e[e.length-1];)e.pop()}function dg(e,t){let n=e.handlers,o=dp(n);n!==t.handlersRef?(t.handlersRef=n,t.handlerEntries.clear()):o!==t.handlersLength&&(o?t.handlerEntries.forEach(function(e,o){n[e.index]!==e.handler&&t.handlerEntries.delete(o)}):t.handlerEntries.clear()),t.handlersLength=o}let dF=class{constructor(){this.handlers=[],this[db]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(e,t,n){let o={fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null},i=this[db];null==this.handlers&&(this.handlers=[]),dg(this,i);let r=i.nextId++;return this.handlers.push(o),i.handlerEntries.set(r,{handler:o,index:this.handlers.length-1}),i.handlersLength=this.handlers.length,r}eject(e){let t=this[db];dg(this,t);let n=t.handlerEntries.get(e);if(n){if(t.handlerEntries.delete(e),this.handlers[n.index]!==n.handler)return;this.handlers[n.index]=null,t.iterationDepth||(d_(this.handlers),t.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],dg(this,this[db]))}forEach(e){let t=this[db];dg(this,t),t.iterationDepth++;try{sX.forEach(this.handlers,function(t){null!==t&&e(t)})}finally{--t.iterationDepth||(dg(this,t),d_(this.handlers),t.handlersLength=dp(this.handlers))}}},dy={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},dv="u">typeof URLSearchParams?URLSearchParams:du,dw="u">typeof FormData?FormData:null,dk="u">typeof Blob?Blob:null,dE="u">typeof window&&"u">typeof document,dD="object"==typeof navigator&&navigator||void 0,dM=dE&&(!dD||0>["ReactNative","NativeScript","NS"].indexOf(dD.product)),dL="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,dC=dE&&window.location.href||"http://localhost",dA={...tS,isBrowser:!0,classes:{URLSearchParams:dv,FormData:dw,Blob:dk},protocols:["http","https","file","blob","url","data"]};function dT(e){if(e>100)throw new di("FormData field is too deeply nested ("+e+" levels). Max depth: 100",di.ERR_FORM_DATA_DEPTH_EXCEEDED)}let dx=function(e){if(sX.isFormData(e)&&sX.isFunction(e.entries)){let t={};return sX.forEachEntry(e,(e,n)=>{!function e(t,n,o,i){dT(i);let r=t[i++];if("__proto__"===r)return!0;let a=Number.isFinite(+r),s=i>=t.length;return(r=!r&&sX.isArray(o)?o.length:r,s)?sX.hasOwnProp(o,r)?o[r]=sX.isArray(o[r])?o[r].concat(n):[o[r],n]:o[r]=n:(sX.hasOwnProp(o,r)&&sX.isObject(o[r])||(o[r]=[]),e(t,n,o[r],i)&&sX.isArray(o[r])&&(o[r]=function(e){let t,n,o={},i=Object.keys(e),r=i.length;for(t=0;t<r;t++)o[n=i[t]]=e[n];return o}(o[r]))),!a}(function(e){let t,n=[],o=/[^.[\]]+|\[([^.[\]]*)]/g;for(;null!==(t=o.exec(e));)dT(n.length),n.push("[]"===t[0]?"":t[1]||t[0]);return n}(e),n,t,0)}),t}return null},dS=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),dY=(e,t)=>null!=e&&sX.hasOwnProp(e,t)?e[t]:void 0,dO={transitional:dy,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let n,o=t.getContentType()||"",i=o.indexOf("application/json")>-1,r=sX.isObject(e);if(r&&sX.isHTMLForm(e)&&(e=new FormData(e)),sX.isFormData(e))return i?JSON.stringify(dx(e)):e;if(sX.isArrayBuffer(e)||sX.isBuffer(e)||sX.isStream(e)||sX.isFile(e)||sX.isBlob(e)||sX.isReadableStream(e))return e;if(sX.isArrayBufferView(e))return e.buffer;if(sX.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(r){let t=dY(this,"formSerializer");if(o.indexOf("application/x-www-form-urlencoded")>-1)return dl(e,new dA.classes.URLSearchParams,{visitor:function(e,t,n,o){return dA.isNode&&sX.isBuffer(e)?(this.append(t,e.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t}).toString();if((n=sX.isFileList(e))||o.indexOf("multipart/form-data")>-1){let o=dY(this,"env"),i=o&&o.FormData;return dl(n?{"files[]":e}:e,i&&new i,t)}}if(r||i){t.setContentType("application/json",!1);var a=e;if(sX.isString(a))try{return(0,JSON.parse)(a),sX.trim(a)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(a)}return e}],transformResponse:[function(e){let t=dY(this,"transitional")||dO.transitional,n=t&&t.forcedJSONParsing,o=dY(this,"responseType"),i="json"===o;if(sX.isResponse(e)||sX.isReadableStream(e))return e;if(e&&sX.isString(e)&&(n&&!o||i)){let n=t&&t.silentJSONParsing;try{return JSON.parse(e,dY(this,"parseReviver"))}catch(e){if(!n&&i){if("SyntaxError"===e.name)throw di.from(e,di.ERR_BAD_RESPONSE,this,null,dY(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:dA.classes.FormData,Blob:dA.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function dI(e,t){let n=this||dO,o=t||n,i=s9.from(o.headers),r=o.data;return sX.forEach(e,function(e){r=e.call(n,r,i.normalize(),t?t.status:void 0)}),i.normalize(),r}function dP(e){return!!(e&&e.__CANCEL__)}sX.forEach(dS,e=>{dO.headers[e]={}});let dB=class extends di{constructor(e,t,n){super(null==e?"canceled":e,di.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function dR(e,t,n){let o=n.config.validateStatus;!n.status||!o||o(n.status)?e(n):t(new di("Request failed with status code "+n.status,n.status>=400&&n.status<500?di.ERR_BAD_REQUEST:di.ERR_BAD_RESPONSE,n.config,n.request,n))}let dN=/[\t\n\r]/g;function dj(e){if("string"!=typeof e)return e;let t=0;for(;t<e.length&&32>=e.charCodeAt(t);)t++;return e.slice(t).replace(dN,"")}function dH(e){let t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}let dU=function(e,t){let n,o=Array(e=e||10),i=Array(e),r=0,a=0;return t=void 0!==t?t:1e3,function(s){let d=Date.now(),l=i[a];n||(n=d),o[r]=s,i[r]=d;let c=a,u=0;for(;c!==r;)u+=o[c++],c%=e;if((r=(r+1)%e)===a&&(a=(a+1)%e),d-n<t)return;let m=l&&d-l;return m?Math.round(1e3*u/m):void 0}},dz=function(e,t){let n,o,i=0,r=1e3/t,a=(t,r=Date.now())=>{i=r,n=null,o&&(clearTimeout(o),o=null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-i;s>=r?a(e,t):(n=e,o||(o=setTimeout(()=>{o=null,a(n)},r-s)))},()=>n&&a(n),(...e)=>a(e)]},d$=(e,t,n=3)=>{let o=0,i=dU(50,250);return dz(n=>{if(!n||!sX.isNumber(n.loaded))return;let r=n.loaded,a=n.lengthComputable?n.total:void 0,s=Math.max(0,null!=a?Math.min(r,a):r),d=Math.max(0,s-o),l=i(d);o=Math.max(o,s),e({loaded:s,total:a,progress:a?s/a:void 0,bytes:d,rate:l||void 0,estimated:l&&a?(a-s)/l:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})},n)},dW=(e,t)=>{let n=null!=e;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},dV=(e,t=sX.asap)=>(...n)=>t(()=>e(...n)),dq=dA.hasStandardBrowserEnv?(s=new URL(dA.origin),d=dA.navigator&&/(msie|trident)/i.test(dA.navigator.userAgent),e=>(e=new URL(e,dA.origin),s.protocol===e.protocol&&s.host===e.host&&(d||s.port===e.port))):()=>!0,dG=dA.hasStandardBrowserEnv?{write(e,t,n,o,i,r,a){if("u"<typeof document)return;let s=[`${e}=${encodeURIComponent(t)}`];sX.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),sX.isString(o)&&s.push(`path=${o}`),sX.isString(i)&&s.push(`domain=${i}`),!0===r&&s.push("secure"),sX.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if("u"<typeof document)return null;let t=document.cookie.split(";");for(let n=0;n<t.length;n++){let o=t[n].replace(/^\s+/,""),i=o.indexOf("=");if(-1!==i&&o.slice(0,i)===e)try{return decodeURIComponent(o.slice(i+1))}catch(e){return o.slice(i+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}},dK=/^https?:(?!\/\/)/i;function dJ(e,t){if("string"==typeof e){let o=dj(e);if(dK.test(o)){var n;let e,i,r;throw new di(`Invalid URL ${JSON.stringify((r=(-1===(i=(e=o.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${de}@`)).indexOf("#"))?e:e.slice(0,i)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${de}`),-1===i?r:`${r}#${!(n=e.slice(i+1))?n:n.replace(/(^|&)([^=&]*=)?[^&]+/g,(e,t,n="")=>`${t}${n}${de}`)}`))}: missing "//" after protocol`,di.ERR_INVALID_URL,t)}}}function dX(e,t,n,o){dJ(t,o);let i=!("string"==typeof t&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t));if(e&&(i||!1===n)){dJ(e,o);if(!t)return e;let n=e.length;for(;n>0&&47===e.charCodeAt(n-1);)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}return t}let dQ=e=>e instanceof s9?{...e}:e;function dZ(e,t){var n;e=e||{},t=t||{};let o=Object.create(null);function i(e,t,n,o){return sX.isPlainObject(e)&&sX.isPlainObject(t)?sX.merge.call({caseless:o},e,t):sX.isPlainObject(t)?sX.merge({},t):sX.isArray(t)?t.slice():t}function r(e,t,n,o){return sX.isUndefined(t)?sX.isUndefined(e)?void 0:i(void 0,e,n,o):i(e,t,n,o)}function a(e,t){if(!sX.isUndefined(t))return i(void 0,t)}function s(e,t){return sX.isUndefined(t)?sX.isUndefined(e)?void 0:i(void 0,e):i(void 0,t)}function d(n,o,r){return sX.hasOwnProp(t,r)?i(n,o):sX.hasOwnProp(e,r)?i(void 0,n):void 0}Object.defineProperty(o,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});let l={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutErrorMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,allowedSocketPaths:s,responseEncoding:s,validateStatus:d,headers:(e,t,n)=>r(dQ(e),dQ(t),n,!0)};return sX.forEach((n={...e,...t},Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(n).concat(Object.getOwnPropertySymbols(n).filter(e=>Object.getOwnPropertyDescriptor(n,e).enumerable)):Object.keys(n)),function(n){if("__proto__"===n||"constructor"===n||"prototype"===n)return;let i=sX.hasOwnProp(l,n)?l[n]:r,a=i(sX.hasOwnProp(e,n)?e[n]:void 0,sX.hasOwnProp(t,n)?t[n]:void 0,n);sX.isUndefined(a)&&i!==d||(o[n]=a)}),sX.hasOwnProp(t,"validateStatus")&&sX.isUndefined(t.validateStatus)&&!1===function(n){let o=sX.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!sX.isUndefined(o)){if(!sX.isPlainObject(o))return;else if(sX.hasOwnProp(o,n))return o[n]}let i=sX.hasOwnProp(e,"transitional")?e.transitional:void 0;if(sX.isPlainObject(i)&&sX.hasOwnProp(i,n))return i[n]}("validateStatusUndefinedResolves")&&(sX.hasOwnProp(e,"validateStatus")?o.validateStatus=i(void 0,e.validateStatus):delete o.validateStatus),o}let d0=["content-type","content-length"],d1=function(e){let t=dZ({},e),n=e=>sX.hasOwnProp(t,e)?t[e]:void 0,o=n("data"),i=n("withXSRFToken"),r=n("xsrfHeaderName"),a=n("xsrfCookieName"),s=n("headers"),d=n("auth"),l=n("baseURL"),c=n("allowAbsoluteUrls"),u=n("url");if(t.headers=s=s9.from(s),t.url=df(dX(l,u,c,t),n("params"),n("paramsSerializer")),d){let t=sX.getSafeProp(d,"username")||"",n=sX.getSafeProp(d,"password")||"";try{s.set("Authorization","Basic "+btoa(t+":"+(n?encodeURIComponent(n).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))):"")))}catch(t){throw di.from(t,di.ERR_BAD_OPTION_VALUE,e)}}if(sX.isFormData(o)){let e=sX.getSafeProp(o,"getHeaders");if(dA.hasStandardBrowserEnv||dA.hasStandardBrowserWebWorkerEnv||sX.isReactNative(o))s.setContentType(void 0);else{var m,h;sX.isFunction(e)&&(m=s,h=e.call(o),"content-only"!==n("formDataHeaderPolicy")?m.set(h):Object.entries(h||{}).forEach(([e,t])=>{d0.includes(e.toLowerCase())&&m.set(e,t)}))}}if(dA.hasStandardBrowserEnv&&(sX.isFunction(i)&&(i=i(t)),!0===i||null==i&&dq(t.url))){let e=r&&a&&dG.read(a);e&&s.set(r,e)}return t},d2="u">typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){let o,i,r,a,s,d,l=d1(e),c=l.data,u=s9.from(l.headers).normalize(),{responseType:m,onUploadProgress:h,onDownloadProgress:f}=l;function b(){a&&a(),s&&s(),l.cancelToken&&l.cancelToken.unsubscribe(o),l.signal&&l.signal.removeEventListener("abort",o)}let p=new XMLHttpRequest;function _(o){if(!p)return;if(0===p.status&&"file"!==(dH(dj(l.url))||dH(dA.origin))&&!(p.responseURL&&p.responseURL.startsWith("file:"))){n(new di("Request aborted",di.ECONNABORTED,e,p)),b(),p=null;return}try{o?d&&d(o):s&&s()}catch(e){setTimeout(()=>{throw e})}if(!p)return;let i=s9.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders());dR(function(e){t(e),b()},function(e){n(e),b()},{data:m&&"text"!==m&&"json"!==m?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:i,config:e,request:p}),p=null}p.open(l.method.toUpperCase(),l.url,!0),p.timeout=l.timeout,"onloadend"in p?p.onloadend=_:p.onreadystatechange=function(){!p||4!==p.readyState||(0!==p.status||p.responseURL&&p.responseURL.startsWith("file:"))&&setTimeout(_)},p.onabort=function(){p&&(n(new di("Request aborted",di.ECONNABORTED,e,p)),b(),p=null)},p.onerror=function(t){let o=new di(t&&t.message?t.message:"Network Error",di.ERR_NETWORK,e,p);o.event=t||null,n(o),b(),p=null},p.ontimeout=function(){let t=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded",o=l.transitional||dy;l.timeoutErrorMessage&&(t=l.timeoutErrorMessage),n(new di(t,o.clarifyTimeoutError?di.ETIMEDOUT:di.ECONNABORTED,e,p)),b(),p=null},void 0===c&&u.setContentType(null),"setRequestHeader"in p&&sX.forEach(s2(u),function(e,t){p.setRequestHeader(t,e)}),sX.isUndefined(l.withCredentials)||(p.withCredentials=!!l.withCredentials),m&&"json"!==m&&(p.responseType=l.responseType),f&&([r,s,d]=d$(f,!0),p.addEventListener("progress",r)),h&&p.upload&&([i,a]=d$(h),p.upload.addEventListener("progress",i),p.upload.addEventListener("loadend",a)),(l.cancelToken||l.signal)&&(o=t=>{p&&(n(!t||t.type?new dB(null,e,p):t),p.abort(),b(),p=null)},l.cancelToken&&l.cancelToken.subscribe(o),l.signal&&(l.signal.aborted?o():l.signal.addEventListener("abort",o)));let g=dH(l.url);if(g&&!dA.protocols.includes(g)){n(new di("Unsupported protocol "+g+":",di.ERR_BAD_REQUEST,e)),b();return}p.send(c||null)})},d4=function*(e,t){let n,o=e.byteLength;if(!t||o<t)return void(yield e);let i=0;for(;i<o;)n=i+t,yield e.slice(i,n),i=n},d3=async function*(e,t){for await(let n of d5(e))yield*d4(n,t)},d5=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},d6=(e,t,n,o)=>{let i,r=d3(e,t),a=0,s=e=>{!i&&(i=!0,o&&o(e))};return new ReadableStream({async pull(e){try{let{done:t,value:o}=await r.next();if(t){s(),e.close();return}let i=o.byteLength;if(n){let e=a+=i;n(e)}e.enqueue(new Uint8Array(o))}catch(e){throw s(e),e}},cancel:e=>(s(e),r.return())},{highWaterMark:2})},d8=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,d7=(e,t,n)=>t+2<n&&d8(e.charCodeAt(t+1))&&d8(e.charCodeAt(t+2)),d9=e=>e<=57?e-48:(223&e)-55,le=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||43===e||47===e||45===e||95===e,lt=e=>9===e||10===e||12===e||13===e||32===e,ln=e=>{var t;let n,o,i=e.length,r=0,a=0,s=!1;for(let t=0;t<i;t++){let n=e.charCodeAt(t);if(37===n&&d7(e,t,i)&&(n=16*d9(e.charCodeAt(t+1))+d9(e.charCodeAt(t+2)),t+=2),!lt(n)){if(61===n){a++;continue}if(!le(n)||a>0){s=!0;continue}r++}}if(s||a>2||a>0&&(r+a)%4!=0||r%4==1){let t,n;return t=e.length,n=0,t>0&&61===e.charCodeAt(t-1)&&(n++,t>1&&61===e.charCodeAt(t-2)&&n++),Math.floor((t-n)*3/4)}return n=Math.floor((t=r)/4),3*n+(2==(o=t%4)?1:2*(3===o))},lo={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},{isFunction:li}=sX,lr=e=>{if(!sX.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},la=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},ls=e=>{let t,n=void 0!==sX.global&&null!==sX.global?sX.global:globalThis,{ReadableStream:o,TextEncoder:i}=n,{fetch:r,Request:a,Response:s}=e=sX.merge.call({skipUndefined:!0},{Request:n.Request,Response:n.Response},e),d=r?li(r):"function"==typeof fetch,l=li(a),c=li(s);if(!d)return!1;let u=d&&li(o),m=d&&("function"==typeof i?(t=new i,e=>t.encode(e)):async e=>new Uint8Array(await new a(e).arrayBuffer())),h=l&&u&&la(()=>{let e=!1,t=new a(dA.origin,{body:new o,method:"POST",get duplex(){return e=!0,"half"}}),n=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!n}),f=c&&u&&la(()=>sX.isReadableStream(new s("").body)),b={stream:f&&(e=>e.body)};d&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{b[e]||(b[e]=(t,n)=>{let o=t&&t[e];if(o)return o.call(t);throw new di(`Response type '${e}' is not supported`,di.ERR_NOT_SUPPORT,n)})});let p=async e=>{if(null==e)return 0;if(sX.isBlob(e))return e.size;if(sX.isSpecCompliantForm(e)){let t=new a(dA.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return sX.isArrayBufferView(e)||sX.isArrayBuffer(e)?e.byteLength:(sX.isURLSearchParams(e)&&(e+=""),sX.isString(e))?(await m(e)).byteLength:void 0},_=async(e,t)=>{let n=sX.toFiniteNumber(e.getContentLength());return null==n?p(t):n};return async e=>{let t,{url:n,method:o,data:d,signal:c,cancelToken:m,timeout:g,onDownloadProgress:F,onUploadProgress:y,responseType:v,headers:w,withCredentials:k="same-origin",fetchOptions:E,maxContentLength:D,maxBodyLength:M,maxRedirects:L}=d1(e),C=sX.isNumber(D)&&D>-1,A=sX.isNumber(M)&&M>-1,T=r||fetch;v=v?(v+"").toLowerCase():"text";let x=((e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;let n=new AbortController,o=!1,i=function(e){if(!o){o=!0,a();let t=e instanceof Error?e:this.reason;n.abort(t instanceof di?t:new dB(t instanceof Error?t.message:t))}},r=t&&setTimeout(()=>{r=null,i(new di(`timeout of ${t}ms exceeded`,di.ETIMEDOUT))},t),a=()=>{e&&(r&&clearTimeout(r),r=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>{if(!o){if(e.aborted)return void i.call(e);e.addEventListener("abort",i,{once:!0})}});let{signal:s}=n;return s.unsubscribe=()=>sX.asap(a),s})([c,m&&m.toAbortSignal()],g),S=null,Y=x&&x.unsubscribe&&(()=>{x.unsubscribe()}),O=null,I=()=>new di("Request body larger than maxBodyLength limit",di.ERR_BAD_REQUEST,e,S);try{var P,B;let r,c,m,g,R=(c="auth",sX.hasOwnProp(e,c)?e[c]:void 0);if(R){let e=sX.getSafeProp(R,"username")||"",t=sX.getSafeProp(R,"password")||"";r={username:e,password:t}}if(m=(P=n).indexOf("://"),g=P,-1!==m&&(g=g.slice(m+3)),g.includes("@")||g.includes(":")){let e=new URL(n,dA.origin);if(!r&&(e.username||e.password)){let t=lr(e.username),n=lr(e.password);r={username:t,password:n}}(e.username||e.password)&&(e.username="",e.password="",n=e.href)}if(r){let e;w.delete("authorization"),w.set("Authorization","Basic "+btoa((e=(r.username||"")+":"+(r.password||""),encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))))}if(C&&"string"==typeof n&&n.startsWith("data:")){let t;if(B=n,t="string"==typeof B?B.indexOf("#"):-1,((e,t)=>{if(!e||"string"!=typeof e||!e.startsWith("data:"))return 0;let n=e.indexOf(",");if(n<0)return 0;let o=e.slice(5,n),i=e.slice(n+1);if(/;base64/i.test(o))return t(i);let r=0;for(let e=0,t=i.length;e<t;e++){let n=i.charCodeAt(e);if(37===n&&d7(i,e,t))r+=1,e+=2;else if(n<128)r+=1;else if(n<2048)r+=2;else if(n>=55296&&n<=56319&&e+1<t){let t=i.charCodeAt(e+1);t>=56320&&t<=57343?(r+=4,e++):r+=3}else r+=3}return r})(-1===t?B:B.slice(0,t),ln)>D)throw new di("maxContentLength size of "+D+" exceeded",di.ERR_BAD_RESPONSE,e,S)}if(A&&"get"!==o&&"head"!==o){let e=await p(d);if("number"==typeof e&&isFinite(e)&&(t=e,e>M))throw I()}let N=A&&(sX.isReadableStream(d)||sX.isStream(d)),j=(e,t,n)=>d6(e,65536,e=>{if(A&&e>M)throw O=I();t&&t(e)},n);if(h&&"get"!==o&&"head"!==o&&(y||N)){if(t=null==t?await _(w,d):t,0!==t||N){let e,o=new a(n,{method:"POST",body:d,duplex:"half"});if(sX.isFormData(d)&&(e=o.headers.get("content-type"))&&w.setContentType(e),o.body){let[e,n]=y&&dW(t,d$(dV(y)))||[];d=j(o.body,e,n)}}}else if(N&&!l&&u&&"get"!==o&&"head"!==o)d=j(d);else if(N&&l&&!h&&"get"!==o&&"head"!==o)throw new di("Stream request bodies are not supported by the current fetch implementation",di.ERR_NOT_SUPPORT,e,S);sX.isString(k)||(k=k?"include":"omit");let H=l&&"credentials"in a.prototype;if(sX.isFormData(d)){let e=w.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&w.delete("content-type")}w.set("User-Agent","axios/1.20.0",!1);let U=null==E?E:Object.assign(Object.create(null),E);U&&(delete U.body,delete U.headers,delete U.method,delete U.signal,delete U.duplex,delete U.credentials);let z=Object.assign(Object.create(null),U,{signal:x,method:o.toUpperCase(),headers:s2(w.normalize()),body:d,duplex:"half",credentials:H?k:void 0});l&&(sX.forEach(lo,(e,t)=>{void 0===z[t]&&(z[t]=e)}),void 0===z.signal&&(z.signal=null),void 0===z.body&&(z.body=null)),0===L&&(z.redirect="manual",U&&(U.redirect="manual")),S=l&&new a(n,z);let $=await (l?T(S,U):T(n,z)),W=s9.from($.headers);if(C){let t=sX.toFiniteNumber(W.getContentLength());if(null!=t&&t>D)throw new di("maxContentLength size of "+D+" exceeded",di.ERR_BAD_RESPONSE,e,S)}let V=f&&("stream"===v||"response"===v);if(f&&$.body&&(F||C||V&&Y)){let t={};["status","statusText","headers"].forEach(e=>{t[e]=$[e]});let n=sX.toFiniteNumber(W.getContentLength()),[o,i]=F&&dW(n,d$(dV(F),!0))||[];$=new s(d6($.body,65536,t=>{if(C&&t>D)throw new di("maxContentLength size of "+D+" exceeded",di.ERR_BAD_RESPONSE,e,S);o&&o(t)},()=>{i&&i(),Y&&Y()}),t)}v=v||"text";let q=await b[sX.findKey(b,v)||"text"]($,e);if(C&&!f&&!V){let t;if(null!=q&&("number"==typeof q.byteLength?t=q.byteLength:"number"==typeof q.size?t=q.size:"string"==typeof q&&(t="function"==typeof i?new i().encode(q).byteLength:q.length)),"number"==typeof t&&t>D)throw new di("maxContentLength size of "+D+" exceeded",di.ERR_BAD_RESPONSE,e,S)}return!V&&Y&&Y(),await new Promise((t,n)=>{dR(t,n,{data:q,headers:s9.from($.headers),status:$.status,statusText:$.statusText,config:e,request:S})})}catch(t){if(Y&&Y(),x&&x.aborted&&x.reason instanceof di){let n=x.reason;throw n.config=e,S&&(n.request=S),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(O)throw S&&!O.request&&(O.request=S),O;if(t instanceof di)throw S&&!t.request&&(t.request=S),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){let n=new di("Network Error",di.ERR_NETWORK,e,S,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw di.from(t,t&&t.code,e,S,t&&t.response)}}},ld=new Map,ll=e=>{let t=e&&e.env||{},{fetch:n,Request:o,Response:i}=t,r=[o,i,n],a=r.length,s,d,l=ld;for(;a--;)s=r[a],void 0===(d=l.get(s))&&l.set(s,d=a?new Map:ls(t)),l=d;return d};ll();let lc={http:null,xhr:d2,fetch:{get:ll}};sX.forEach(lc,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});let lu=e=>`- ${e}`,lm=e=>sX.isFunction(e)||null===e||!1===e,lh=function(e,t){let n,o,{length:i}=e=sX.isArray(e)?e:[e],r={};for(let a=0;a<i;a++){let i;if(o=n=e[a],!lm(n)&&void 0===(o=lc[(i=String(n)).toLowerCase()]))throw new di(`Unknown adapter '${i}'`);if(o&&(sX.isFunction(o)||(o=o.get(t))))break;r[i||"#"+a]=o}if(!o){let e=Object.entries(r).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new di("There is no suitable adapter to dispatch the request "+(i?e.length>1?"since :\n"+e.map(lu).join("\n"):" "+lu(e[0]):"as no adapter specified"),di.ERR_NOT_SUPPORT)}return o};function lf(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new dB(null,e)}function lb(e){let t=sX.toSafeFlatObject(e);return lf(t),t.headers=s9.from(sX.getSafeProp(t,"headers")),t.data=dI.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),lh(t.adapter||dO.adapter,t)(t).then(function(e){lf(t),t.response=e;try{e.data=dI.call(t,t.transformResponse,e)}finally{delete t.response}return e.headers=s9.from(e.headers),e},function(e){if(!dP(e)&&(lf(t),e&&e.response)){t.response=e.response;try{e.response.data=dI.call(t,t.transformResponse,e.response)}finally{delete t.response}e.response.headers=s9.from(e.response.headers)}return Promise.reject(e)})}let lp={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{lp[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});let l_={};lp.transitional=function(e,t,n){function o(e,t){return"[Axios v1.20.0] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,r)=>{if(!1===e)throw new di(o(i," has been removed"+(t?" in "+t:"")),di.ERR_DEPRECATED);return t&&!l_[i]&&(l_[i]=!0,console.warn(o(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,r)}},lp.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};let lg=function(e,t,n){if("object"!=typeof e||null===e)throw new di("options must be an object",di.ERR_BAD_OPTION_VALUE);let o=Object.keys(e),i=o.length;for(;i-- >0;){let r=o[i],a=Object.prototype.hasOwnProperty.call(t,r)?t[r]:void 0;if(a){let t=e[r],n=void 0===t||a(t,r,e);if(!0!==n)throw new di("option "+r+" must be "+n,di.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new di("Unknown option "+r,di.ERR_BAD_OPTION)}};class lF{constructor(e){this.defaults=e||{},this.interceptors={request:new dF,response:new dF}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error)try{let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let n=t.stack,o="";if("string"==typeof n){let e=n.indexOf("\n");o=-1===e?"":n.slice(e+1)}if(e.stack){if(o){let t=o.indexOf("\n"),n=-1===t?-1:o.indexOf("\n",t+1),i=-1===n?"":o.slice(n+1);String(e.stack).endsWith(i)||(e.stack+="\n"+o)}}else e.stack=o}catch(e){}throw e}}_request(e,t){let n,o;"string"==typeof e?(t=t||{}).url=e:t=e||{};let{transitional:i,paramsSerializer:r,headers:a}=t=dZ(this.defaults,t);void 0!==i&&lg(i,{silentJSONParsing:lp.transitional(lp.boolean),forcedJSONParsing:lp.transitional(lp.boolean),clarifyTimeoutError:lp.transitional(lp.boolean),legacyInterceptorReqResOrdering:lp.transitional(lp.boolean),advertiseZstdAcceptEncoding:lp.transitional(lp.boolean),validateStatusUndefinedResolves:lp.transitional(lp.boolean)},!1),null!=r&&(sX.isFunction(r)?t.paramsSerializer={serialize:r}:lg(r,{encode:lp.function,serialize:lp.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),lg(t,{baseUrl:lp.spelling("baseURL"),withXsrfToken:lp.spelling("withXSRFToken")},!0),t.method=(sX.getSafeProp(t,"method")||sX.getSafeProp(this.defaults,"method")||"get").toLowerCase();let s=a&&sX.merge(a.common,a[t.method]);a&&sX.forEach(dS.concat("common"),e=>{delete a[e]}),t.headers=s9.concat(s,a);let d=[],l=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;l=l&&e.synchronous;let n=t.transitional||dy;n&&n.legacyInterceptorReqResOrdering?d.unshift(e.fulfilled,e.rejected):d.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u=0;if(!l){let e=[lb.bind(this),void 0];for(e.unshift(...d),e.push(...c),o=e.length,n=Promise.resolve(t);u<o;)n=n.then(e[u++],e[u++]);return n}o=d.length;let m=t;for(;u<o;){let e=d[u++],t=d[u++];try{m=e?e(m):m}catch(e){if(!t){n=Promise.reject(e);break}try{let o=t.call(this,e);sX.isThenable(o)&&(n=Promise.resolve(o).then(()=>lb.call(this,m)))}catch(e){n=Promise.reject(e)}break}}if(!n)try{n=lb.call(this,m)}catch(e){n=Promise.reject(e)}for(u=0,o=c.length;u<o;)n=n.then(c[u++],c[u++]);return n}getUri(e){return df(dX((e=dZ(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}sX.forEach(["delete","get","head","options"],function(e){lF.prototype[e]=function(t,n){return this.request(dZ(n||{},{method:e,url:t,data:n&&sX.hasOwnProp(n,"data")?n.data:void 0}))}}),sX.forEach(["post","put","patch","query"],function(e){function t(t){return function(n,o,i){return this.request(dZ(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:o}))}}lF.prototype[e]=t(),"query"!==e&&(lF.prototype[e+"Form"]=t(!0))});let ly=class e{constructor(e){let t;if("function"!=typeof e)throw TypeError("executor must be a function.");this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,o=new Promise(e=>{n.subscribe(e),t=e}).then(e);return o.cancel=function(){n.unsubscribe(t)},o},e(function(e,o,i){n.reason||(n.reason=new dB(e,o,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},lv={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(lv).forEach(([e,t])=>{void 0===lv[t]&&(lv[t]=e)});let lw=function e(t){let n=new lF(t),o=sr(lF.prototype.request,n);return sX.extend(o,lF.prototype,n,{allOwnKeys:!0}),sX.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return e(dZ(t,n))},o}(dO);lw.Axios=lF,lw.CanceledError=dB,lw.CancelToken=ly,lw.isCancel=dP,lw.VERSION="1.20.0",lw.toFormData=dl,lw.AxiosError=di,lw.Cancel=lw.CanceledError,lw.all=function(e){return Promise.all(e)},lw.spread=function(e){return function(t){return e.apply(null,t)}},lw.isAxiosError=function(e){return sX.isObject(e)&&!0===e.isAxiosError},lw.mergeConfig=dZ,lw.AxiosHeaders=s9,lw.formToJSON=e=>dx(sX.isHTMLForm(e)?new FormData(e):e),lw.getAdapter=lh,lw.HttpStatusCode=lv,lw.default=lw;class lk{constructor(e){this.httpClient=e}getHealthStatus(e){return this.httpClient.request({method:"GET",url:lW`health`,options:e})}getInfo(e){return this.httpClient.request({method:"GET",url:lW`info`,options:e})}}class lE{constructor(e){this.httpClient=e}updateCurrentUserLocale(e,t){return this.httpClient.request({method:"PUT",url:lW`user/locale`,data:e,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:lW`user/query`,data:e,options:t})}requestPasswordResetCurrent(e){return this.httpClient.request({method:"PUT",url:lW`user/request-password-reset`,options:e})}updatePasswordCurrent(e,t){return this.httpClient.request({method:"PUT",url:lW`user/reset-password`,data:e,options:t})}updateCurrent(e,t){return this.httpClient.request({method:"PUT",url:lW`user/update`,data:e,options:t})}getCurrent(e){return this.httpClient.request({method:"GET",url:lW`user/user`,options:e})}getCurrentUserRealmRoles(e){return this.httpClient.request({method:"GET",url:lW`user/userRealmRoles`,options:e})}getCurrentUserClientRoles(e,t){return this.httpClient.request({method:"GET",url:lW`user/userRoles/${e}`,options:t})}disconnectUserSession(e,t,n){return this.httpClient.request({method:"DELETE",url:lW`user/${e}/disconnect/${t}`,options:n})}requestPasswordReset(e,t,n){return this.httpClient.request({method:"PUT",url:lW`user/${e}/request-password-reset/${t}`,options:n})}updatePassword(e,t,n,o){return this.httpClient.request({method:"PUT",url:lW`user/${e}/reset-password/${t}`,data:n,options:o})}resetSecret(e,t,n){return this.httpClient.request({method:"GET",url:lW`user/${e}/reset-secret/${t}`,options:n})}updateRoles(e,t,n){return this.httpClient.request({method:"PUT",url:lW`user/${e}/roles`,data:t,options:n})}getUserRealmRoles(e,t,n){return this.httpClient.request({method:"GET",url:lW`user/${e}/userRealmRoles/${t}`,options:n})}updateUserRealmRoles(e,t,n,o){return this.httpClient.request({method:"PUT",url:lW`user/${e}/userRealmRoles/${t}`,data:n,options:o})}getUserClientRoles(e,t,n,o){return this.httpClient.request({method:"GET",url:lW`user/${e}/userRoles/${t}/${n}`,options:o})}updateUserClientRoles(e,t,n,o,i){return this.httpClient.request({method:"PUT",url:lW`user/${e}/userRoles/${t}/${n}`,data:o,options:i})}getUserSessions(e,t,n){return this.httpClient.request({method:"GET",url:lW`user/${e}/userSessions/${t}`,options:n})}create(e,t,n){return this.httpClient.request({method:"POST",url:lW`user/${e}/users`,data:t,options:n})}update(e,t,n){return this.httpClient.request({method:"PUT",url:lW`user/${e}/users`,data:t,options:n})}delete(e,t,n){return this.httpClient.request({method:"DELETE",url:lW`user/${e}/users/${t}`,options:n})}getClientRoles(e,t,n){return this.httpClient.request({method:"GET",url:lW`user/${e}/${t}/roles`,options:n})}updateClientRoles(e,t,n,o){return this.httpClient.request({method:"PUT",url:lW`user/${e}/${t}/roles`,data:n,options:o})}get(e,t,n){return this.httpClient.request({method:"GET",url:lW`user/${e}/${t}`,options:n})}}class lD{constructor(e){this.httpClient=e}createProvisioningConfig(e,t){return this.httpClient.request({method:"POST",url:lW`provisioning`,data:e,options:t})}getProvisioningConfigs(e){return this.httpClient.request({method:"GET",url:lW`provisioning`,options:e})}deleteProvisioningConfig(e,t){return this.httpClient.request({method:"DELETE",url:lW`provisioning/${e}`,options:t})}updateProvisioningConfig(e,t,n){return this.httpClient.request({method:"PUT",url:lW`provisioning/${e}`,data:t,options:n})}}class lM{constructor(e){this.httpClient=e}getPredictedDatapoints(e,t,n,o){return this.httpClient.request({method:"POST",url:lW`asset/predicted/${e}/${t}`,data:n,options:o})}writePredictedDatapoints(e,t,n,o){return this.httpClient.request({method:"PUT",url:lW`asset/predicted/${e}/${t}`,data:n,options:o})}}class lL{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:lW`dashboard`,data:e,options:t})}update(e,t){return this.httpClient.request({method:"PUT",url:lW`dashboard`,data:e,options:t})}getAllRealmDashboards(e,t){return this.httpClient.request({method:"GET",url:lW`dashboard/all/${e}`,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:lW`dashboard/query`,data:e,options:t})}delete(e,t,n){return this.httpClient.request({method:"DELETE",url:lW`dashboard/${e}/${t}`,options:n})}get(e,t,n){return this.httpClient.request({method:"GET",url:lW`dashboard/${e}/${t}`,options:n})}}class lC{constructor(e){this.httpClient=e}createAlarm(e,t,n){return this.httpClient.request({method:"POST",url:lW`alarm`,queryParams:t,data:e,options:n})}getAlarms(e,t){return this.httpClient.request({method:"GET",url:lW`alarm`,queryParams:e,options:t})}removeAlarms(e,t){return this.httpClient.request({method:"DELETE",url:lW`alarm`,data:e,options:t})}setAssetLinks(e,t){return this.httpClient.request({method:"PUT",url:lW`alarm/assets`,data:e,options:t})}getAlarm(e,t){return this.httpClient.request({method:"GET",url:lW`alarm/${e}`,options:t})}removeAlarm(e,t){return this.httpClient.request({method:"DELETE",url:lW`alarm/${e}`,options:t})}updateAlarm(e,t,n){return this.httpClient.request({method:"PUT",url:lW`alarm/${e}`,data:t,options:n})}getAssetLinks(e,t,n){return this.httpClient.request({method:"GET",url:lW`alarm/${e}/assets`,queryParams:t,options:n})}}class lA{constructor(e){this.httpClient=e}deleteConnections(e,t){return this.httpClient.request({method:"DELETE",url:lW`gateway/connection`,queryParams:e,options:t})}getConnections(e){return this.httpClient.request({method:"GET",url:lW`gateway/connection`,options:e})}deleteConnection(e,t){return this.httpClient.request({method:"DELETE",url:lW`gateway/connection/${e}`,options:t})}getConnection(e,t){return this.httpClient.request({method:"GET",url:lW`gateway/connection/${e}`,options:t})}setConnection(e,t,n){return this.httpClient.request({method:"PUT",url:lW`gateway/connection/${e}`,data:t,options:n})}getConnectionStatus(e,t){return this.httpClient.request({method:"GET",url:lW`gateway/status/${e}`,options:t})}}class lT{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:lW`asset`,data:e,options:t})}delete(e,t){return this.httpClient.request({method:"DELETE",url:lW`asset`,queryParams:e,options:t})}writeAttributeValues(e,t){return this.httpClient.request({method:"PUT",url:lW`asset/attributes`,data:e,options:t})}writeAttributeEvents(e,t){return this.httpClient.request({method:"PUT",url:lW`asset/attributes/timestamp`,data:e,options:t})}queryCount(e,t){return this.httpClient.request({method:"POST",url:lW`asset/count`,data:e,options:t})}updateNoneParent(e,t){return this.httpClient.request({method:"DELETE",url:lW`asset/parent`,queryParams:e,options:t})}getPartial(e,t){return this.httpClient.request({method:"GET",url:lW`asset/partial/${e}`,options:t})}queryAssets(e,t){return this.httpClient.request({method:"POST",url:lW`asset/query`,data:e,options:t})}queryAssetTree(e,t){return this.httpClient.request({method:"POST",url:lW`asset/tree`,data:e,options:t})}getCurrentUserAssets(e){return this.httpClient.request({method:"GET",url:lW`asset/user/current`,options:e})}createUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:lW`asset/user/link`,data:e,options:t})}getUserAssetLinks(e,t){return this.httpClient.request({method:"GET",url:lW`asset/user/link`,queryParams:e,options:t})}deleteUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:lW`asset/user/link/delete`,data:e,options:t})}deleteAllUserAssetLinks(e,t,n){return this.httpClient.request({method:"DELETE",url:lW`asset/user/link/${e}/${t}`,options:n})}deleteUserAssetLink(e,t,n,o){return this.httpClient.request({method:"DELETE",url:lW`asset/user/link/${e}/${t}/${n}`,options:o})}get(e,t){return this.httpClient.request({method:"GET",url:lW`asset/${e}`,options:t})}update(e,t,n){return this.httpClient.request({method:"PUT",url:lW`asset/${e}`,data:t,options:n})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName(e,t,n,o){return this.httpClient.request({method:"PUT",url:lW`asset/${e}/attribute/${t}`,data:n,options:o})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName_timestamp(e,t,n,o,i){return this.httpClient.request({method:"PUT",url:lW`asset/${e}/attribute/${t}/${n}`,data:o,options:i})}updateParent(e,t,n){return this.httpClient.request({method:"PUT",url:lW`asset/${e}/child`,queryParams:t,options:n})}}class lx{constructor(e){this.httpClient=e}getManagerConfig(e){return this.httpClient.request({method:"GET",url:lW`configuration/manager`,options:e})}update(e,t){return this.httpClient.request({method:"PUT",url:lW`configuration/manager`,data:e,options:t})}fileUpload(e,t,n){return this.httpClient.request({method:"POST",url:lW`configuration/manager/file`,queryParams:t,data:e,options:n})}getManagerConfigImage(e,t){return this.httpClient.request({method:"GET",url:lW`configuration/manager/image/${e}`,options:t})}}class lS{constructor(e){this.httpClient=e}getServices(e,t){return this.httpClient.request({method:"GET",url:lW`service`,queryParams:e,options:t})}registerService(e,t){return this.httpClient.request({method:"POST",url:lW`service`,data:e,options:t})}getGlobalServices(e){return this.httpClient.request({method:"GET",url:lW`service/global`,options:e})}registerGlobalService(e,t){return this.httpClient.request({method:"POST",url:lW`service/global`,data:e,options:t})}deregisterService(e,t,n){return this.httpClient.request({method:"DELETE",url:lW`service/${e}/${t}`,options:n})}getService(e,t,n){return this.httpClient.request({method:"GET",url:lW`service/${e}/${t}`,options:n})}heartbeat(e,t,n){return this.httpClient.request({method:"PUT",url:lW`service/${e}/${t}`,options:n})}}class lY{constructor(e){this.httpClient=e}getSettings(e){return this.httpClient.request({method:"GET",url:lW`map`,options:e})}saveSettings(e,t){return this.httpClient.request({method:"PUT",url:lW`map`,data:e,options:t})}deleteMap(e){return this.httpClient.request({method:"DELETE",url:lW`map/deleteMap`,options:e})}getCustomMapInfo(e){return this.httpClient.request({method:"GET",url:lW`map/getCustomMapInfo`,options:e})}getTile(e,t,n,o){return this.httpClient.request({method:"GET",url:lW`map/tile/${e}/${t}/${n}`,options:o})}uploadMap(e,t){return this.httpClient.request({method:"POST",url:lW`map/upload`,queryParams:e,options:t})}}class lO{constructor(e){this.httpClient=e}getDatapointExport(e,t){return this.httpClient.request({method:"GET",url:lW`asset/datapoint/export`,queryParams:e,options:t})}getDatapointPeriod(e,t){return this.httpClient.request({method:"GET",url:lW`asset/datapoint/periods`,queryParams:e,options:t})}getDatapoints(e,t,n,o){return this.httpClient.request({method:"POST",url:lW`asset/datapoint/${e}/${t}`,data:n,options:o})}}class lI{constructor(e){this.httpClient=e}getConfig(e){return this.httpClient.request({method:"GET",url:lW`syslog/config`,options:e})}updateConfig(e,t){return this.httpClient.request({method:"PUT",url:lW`syslog/config`,data:e,options:t})}clearEvents(e){return this.httpClient.request({method:"DELETE",url:lW`syslog/event`,options:e})}getEvents(e,t){return this.httpClient.request({method:"GET",url:lW`syslog/event`,queryParams:e,options:t})}}class lP{constructor(e){this.httpClient=e}getAllNodeDefinitions(e){return this.httpClient.request({method:"GET",url:lW`flow`,options:e})}getNodeDefinition(e,t){return this.httpClient.request({method:"GET",url:lW`flow/${e}`,options:t})}getAllNodeDefinitionsByType(e,t){return this.httpClient.request({method:"GET",url:lW`flow/${e}`,options:t})}}class lB{constructor(e){this.httpClient=e}getNotifications(e,t){return this.httpClient.request({method:"GET",url:lW`notification`,queryParams:e,options:t})}removeNotifications(e,t){return this.httpClient.request({method:"DELETE",url:lW`notification`,queryParams:e,options:t})}sendNotification(e,t){return this.httpClient.request({method:"POST",url:lW`notification/alert`,data:e,options:t})}getNotificationsCount(e,t){return this.httpClient.request({method:"GET",url:lW`notification/count`,queryParams:e,options:t})}removeNotification(e,t){return this.httpClient.request({method:"DELETE",url:lW`notification/${e}`,options:t})}notificationAcknowledged(e,t,n,o){return this.httpClient.request({method:"PUT",url:lW`notification/${e}/acknowledged`,queryParams:n,data:t,options:o})}notificationDelivered(e,t,n){return this.httpClient.request({method:"PUT",url:lW`notification/${e}/delivered`,queryParams:t,options:n})}}class lR{constructor(e){this.httpClient=e}createGlobalRuleset(e,t){return this.httpClient.request({method:"POST",url:lW`rules`,data:e,options:t})}getGlobalRulesets(e,t){return this.httpClient.request({method:"GET",url:lW`rules`,queryParams:e,options:t})}createAssetRuleset(e,t){return this.httpClient.request({method:"POST",url:lW`rules/asset`,data:e,options:t})}getAssetRulesets(e,t,n){return this.httpClient.request({method:"GET",url:lW`rules/asset/for/${e}`,queryParams:t,options:n})}deleteAssetRuleset(e,t){return this.httpClient.request({method:"DELETE",url:lW`rules/asset/${e}`,options:t})}getAssetRuleset(e,t){return this.httpClient.request({method:"GET",url:lW`rules/asset/${e}`,options:t})}updateAssetRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:lW`rules/asset/${e}`,data:t,options:n})}getAssetGeofences(e,t){return this.httpClient.request({method:"GET",url:lW`rules/geofences/${e}`,options:t})}getAssetEngineInfo(e,t){return this.httpClient.request({method:"GET",url:lW`rules/info/asset/${e}`,options:t})}getGlobalEngineInfo(e){return this.httpClient.request({method:"GET",url:lW`rules/info/global`,options:e})}getRealmEngineInfo(e,t){return this.httpClient.request({method:"GET",url:lW`rules/info/realm/${e}`,options:t})}createRealmRuleset(e,t){return this.httpClient.request({method:"POST",url:lW`rules/realm`,data:e,options:t})}getRealmRulesets(e,t,n){return this.httpClient.request({method:"GET",url:lW`rules/realm/for/${e}`,queryParams:t,options:n})}deleteRealmRuleset(e,t){return this.httpClient.request({method:"DELETE",url:lW`rules/realm/${e}`,options:t})}getRealmRuleset(e,t){return this.httpClient.request({method:"GET",url:lW`rules/realm/${e}`,options:t})}updateRealmRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:lW`rules/realm/${e}`,data:t,options:n})}deleteGlobalRuleset(e,t){return this.httpClient.request({method:"DELETE",url:lW`rules/${e}`,options:t})}getGlobalRuleset(e,t){return this.httpClient.request({method:"GET",url:lW`rules/${e}`,options:t})}updateGlobalRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:lW`rules/${e}`,data:t,options:n})}}class lN{constructor(e){this.httpClient=e}getAssetDescriptors(e,t){return this.httpClient.request({method:"GET",url:lW`model/assetDescriptors`,queryParams:e,options:t})}getAssetInfo(e,t,n){return this.httpClient.request({method:"GET",url:lW`model/assetInfo/${e}`,queryParams:t,options:n})}getAssetInfos(e,t){return this.httpClient.request({method:"GET",url:lW`model/assetInfos`,queryParams:e,options:t})}getValueDescriptorSchema(e,t){return this.httpClient.request({method:"GET",url:lW`model/getValueDescriptorSchema`,queryParams:e,options:t})}getMetaItemDescriptors(e,t){return this.httpClient.request({method:"GET",url:lW`model/metaItemDescriptors`,queryParams:e,options:t})}getValueDescriptors(e,t){return this.httpClient.request({method:"GET",url:lW`model/valueDescriptors`,queryParams:e,options:t})}}class lj{constructor(e){this.httpClient=e}startTunnel(e,t){return this.httpClient.request({method:"POST",url:lW`gateway/tunnel`,data:e,options:t})}stopTunnel(e,t){return this.httpClient.request({method:"DELETE",url:lW`gateway/tunnel`,data:e,options:t})}getAllActiveTunnelInfos(e,t){return this.httpClient.request({method:"GET",url:lW`gateway/tunnel/${e}`,options:t})}getGatewayActiveTunnelInfos(e,t,n){return this.httpClient.request({method:"GET",url:lW`gateway/tunnel/${e}/${t}`,options:n})}getActiveTunnelInfo(e,t,n,o,i){return this.httpClient.request({method:"GET",url:lW`gateway/tunnel/${e}/${t}/${n}/${o}`,options:i})}}class lH{constructor(e){this.httpClient=e}getApps(e){return this.httpClient.request({method:"GET",url:lW`apps`,options:e})}getConsoleConfig(e){return this.httpClient.request({method:"GET",url:lW`apps/consoleConfig`,options:e})}getAppInfos(e){return this.httpClient.request({method:"GET",url:lW`apps/info`,options:e})}}class lU{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:lW`realm`,data:e,options:t})}getAll(e){return this.httpClient.request({method:"GET",url:lW`realm`,options:e})}getAccessible(e){return this.httpClient.request({method:"GET",url:lW`realm/accessible`,options:e})}delete(e,t){return this.httpClient.request({method:"DELETE",url:lW`realm/${e}`,options:t})}get(e,t){return this.httpClient.request({method:"GET",url:lW`realm/${e}`,options:t})}update(e,t,n){return this.httpClient.request({method:"PUT",url:lW`realm/${e}`,data:t,options:n})}}class lz{constructor(e){this.httpClient=e}doProtocolAssetDiscovery(e,t,n){return this.httpClient.request({method:"GET",url:lW`agent/assetDiscovery/${e}`,queryParams:t,options:n})}doProtocolAssetImport(e,t,n,o){return this.httpClient.request({method:"POST",url:lW`agent/assetImport/${e}`,queryParams:n,data:t,options:o})}doProtocolInstanceDiscovery(e,t,n){return this.httpClient.request({method:"GET",url:lW`agent/instanceDiscovery/${e}`,queryParams:t,options:n})}}class l${constructor(e){this.httpClient=e}register(e,t){return this.httpClient.request({method:"POST",url:lW`console/register`,data:e,options:t})}}function lW(e,...t){let n="";for(let o=0;o<t.length;o++)n+=e[o],n+=encodeURIComponent(t[o]);return n+e[e.length-1]}class lV{constructor(e,t=lw.create()){this._statusResource=new lG(e,t),this._userResource=new lK(e,t),this._provisioningResource=new lJ(e,t),this._assetPredictedDatapointResource=new lX(e,t),this._dashboardResource=new lQ(e,t),this._alarmResource=new lZ(e,t),this._gatewayClientResource=new l0(e,t),this._assetResource=new l1(e,t),this._configurationResource=new l2(e,t),this._externalServiceResource=new l4(e,t),this._mapResource=new l3(e,t),this._assetDatapointResource=new l5(e,t),this._syslogResource=new l6(e,t),this._flowResource=new l8(e,t),this._notificationResource=new l7(e,t),this._rulesResource=new l9(e,t),this._assetModelResource=new ce(e,t),this._gatewayServiceResource=new ct(e,t),this._appResource=new cn(e,t),this._realmResource=new co(e,t),this._agentResource=new ci(e,t),this._consoleResource=new cr(e,t),this._assetResource=new l1(e,t)}get StatusResource(){return this._statusResource}get UserResource(){return this._userResource}get ProvisioningResource(){return this._provisioningResource}get AssetPredictedDatapointResource(){return this._assetPredictedDatapointResource}get DashboardResource(){return this._dashboardResource}get AlarmResource(){return this._alarmResource}get GatewayClientResource(){return this._gatewayClientResource}get AssetResource(){return this._assetResource}get ConfigurationResource(){return this._configurationResource}get ExternalServiceResource(){return this._externalServiceResource}get MapResource(){return this._mapResource}get AssetDatapointResource(){return this._assetDatapointResource}get SyslogResource(){return this._syslogResource}get FlowResource(){return this._flowResource}get NotificationResource(){return this._notificationResource}get RulesResource(){return this._rulesResource}get AssetModelResource(){return this._assetModelResource}get GatewayServiceResource(){return this._gatewayServiceResource}get AppResource(){return this._appResource}get RealmResource(){return this._realmResource}get AgentResource(){return this._agentResource}get ConsoleResource(){return this._consoleResource}}class lq{constructor(e){this.axios=e}request(e){let t={};t.method=e.method,t.url=e.url,t.params=e.queryParams,t.data=e.data,function(e,t){if(void 0!=t)for(let n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}(t,e.options);let n=e.copyFn;return this.axios.request(t).then(e=>(n&&e.data&&(e.originalData=e.data,e.data=n(e.data)),e))}}class lG extends lk{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class lK extends lE{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class lJ extends lD{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class lX extends lM{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class lQ extends lL{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class lZ extends lC{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class l0 extends lA{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class l1 extends lT{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class l2 extends lx{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class l4 extends lS{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class l3 extends lY{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class l5 extends lO{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class l6 extends lI{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class l8 extends lP{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class l7 extends lB{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class l9 extends lR{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class ce extends lN{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class ct extends lj{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class cn extends lH{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class co extends lU{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class ci extends lz{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class cr extends l${constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}var ca=n(8183),cs=n.n(ca);lw.isAxiosError;let cd=new class{get api(){return this._client}constructor(){this._axiosInstance=lw.create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use(e=>(e.paramsSerializer=e=>cs().stringify(e,{arrayFormat:"repeat"}),e))}get axiosInstance(){return this._axiosInstance}get baseUrl(){return this._baseUrl}setTimeout(e){this._axiosInstance.defaults.timeout=e}addRequestInterceptor(e){this._axiosInstance.interceptors.request.use(e)}initialise(e){this._baseUrl=e,this._client=new lV(e,this._axiosInstance)}};var cl=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function a(e){try{d(o.next(e))}catch(e){r(e)}}function s(e){try{d(o.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}d((o=o.apply(e,t||[])).next())})};(ev=tM||(tM={})).DISCONNECTED="DISCONNECTED",ev.CONNECTED="CONNECTED",ev.CONNECTING="CONNECTING";let cc="SUBSCRIBED:",cu="UNAUTHORIZED:",cm="TRIGGERED:",ch="EVENT:";class cf{constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=cb.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=tM.DISCONNECTED,this._connectingDeferred=null,this._statusCallbacks=[],this._pendingSubscription=null,this._queuedSubscriptions=[],this._subscriptionMap=new Map,this._assetEventCallbackMap=new Map,this._attributeEventCallbackMap=new Map,this._unloading=!1}get status(){return this._status}subscribeStatusChange(e){this._statusCallbacks.push(e)}unsubscribeStatusChange(e){!function(e,t){if(0===e.length)return;let n=e.indexOf(t);n>=0&&e.splice(n,1)}(this._statusCallbacks,e)}connect(){return(console.debug("Attempting to connect to events:",this.endpointUrl),this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this._status===tM.CONNECTED)?(console.debug("Already connected to events!"),Promise.resolve(!0)):((this._disconnectRequested=!1,this._connectingDeferred)?console.warn("Already connecting to events, continuing the previous one."):(this._onStatusChanged(tM.CONNECTING),this._connectingDeferred=new a9,this._doConnect().then(e=>{if(this._connectingDeferred){let t=this._connectingDeferred;e?(console.debug("Connected to event service: "+this.endpointUrl),this._reconnectDelayMillis=cb.MIN_RECONNECT_DELAY,this._onStatusChanged(tM.CONNECTED),window.setTimeout(()=>{this._onConnect()},0)):console.debug("Failed to connect to event service: "+this.endpointUrl),t.resolve(e)}}).finally(()=>{this._connectingDeferred=null})),this._connectingDeferred.promise)}disconnect(){console.debug("Disconnecting from event service: "+this.endpointUrl),this._disconnectRequested||(this._disconnectRequested=!0,this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this.status!==tM.DISCONNECTED&&this._doDisconnect())}subscribe(e,t){let n={eventSubscription:e,callback:t,deferred:new a9};return null!=this._pendingSubscription||this._status!==tM.CONNECTED?(this._queuedSubscriptions.push(n),n.deferred.promise):(this._pendingSubscription=n,this._doSubscribe(e).then(e=>{if(this._pendingSubscription){let t=this._pendingSubscription;this._pendingSubscription=null,this._subscriptionMap.set(e,t),this._processNextSubscription();let n=t.deferred;t.deferred=null,n&&n.resolve(e)}},e=>{if(console.error(e),this._pendingSubscription){let t=this._pendingSubscription;this._pendingSubscription=null,this._processNextSubscription();let n=t.deferred;t.deferred=null,n&&n.reject(e)}}),this._pendingSubscription.deferred.promise)}unsubscribe(e){return cl(this,void 0,void 0,function*(){if(this._subscriptionMap.delete(e))return void this._doUnsubscribe(e);if(this._assetEventCallbackMap.delete(e)){if(this._assetEventPromise&&0===this._assetEventCallbackMap.size){let e=yield this._assetEventPromise;this._assetEventPromise=void 0,this.unsubscribe(e)}return}if(this._attributeEventCallbackMap.delete(e)&&this._attributeEventPromise&&0===this._attributeEventCallbackMap.size){let e=yield this._attributeEventPromise;this._attributeEventPromise=void 0,this.unsubscribe(e)}})}sendEvent(e){this._status===tM.CONNECTED&&this._doSend(e)}sendEventWithReply(e){return this._status!==tM.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(e)}subscribeAssetEvents(e,t,n){return cl(this,void 0,void 0,function*(){let o=e&&"string"!=typeof e[0]?e.map(e=>e.id):e,i="AssetEvent"+cf._subscriptionCounter++;if(!this._assetEventPromise){let e;cH.authenticated||(e={filterType:"asset",realm:cH.displayRealm});let t={eventType:"asset",filter:e};this._assetEventPromise=this.subscribe(t,e=>{this._assetEventCallbackMap.forEach(t=>t(e))})}return this._assetEventCallbackMap.set(i,e=>{let t=e.asset.id;o?o.find(e=>t===e)&&n(e):e.asset.realm===cH.displayRealm&&n(e)}),this._assetEventPromise.then(()=>{try{if(o&&t){let e={messageID:"read-assets:"+o.join(",")+":"+i,eventType:"read-assets",assetQuery:{ids:o}};this.sendEventWithReply(e).then(e=>{e.assets&&this._assetEventCallbackMap.has(i)&&e.assets.forEach(e=>{n({eventType:"asset",asset:e,cause:"READ"})})})}}catch(t){throw console.error("Failed to subscribe to asset events for assets: "+e),i&&this.unsubscribe(i),t}return i})})}subscribeAttributeEvents(e,t,n){return cl(this,void 0,void 0,function*(){let o=e&&"string"!=typeof e[0],i=o?e.map(e=>e.id):e,r=o?e:void 0,a="AttributeEvent"+cf._subscriptionCounter++;if(!this._attributeEventPromise){let e;cH.authenticated||(e={filterType:"asset",realm:cH.displayRealm});let t={eventType:"attribute",filter:e};this._attributeEventPromise=this.subscribe(t,e=>{this._attributeEventCallbackMap.forEach(t=>t(e))})}let s=t=>{let r=t.ref;o?e.forEach(e=>{r.id===e.id&&r.name===e.name&&n(t)}):i?i.find(e=>r.id===e)&&n(t):t.realm===cH.displayRealm&&n(t)};return this._attributeEventCallbackMap.set(a,s),this._attributeEventPromise.then(()=>{try{if(t&&i){let e={messageID:"read-assets:"+i.join(",")+":"+a,eventType:"read-assets",assetQuery:{ids:i}};this.sendEventWithReply(e).then(e=>{e.assets&&this._attributeEventCallbackMap.has(a)&&e.assets.forEach(e=>{e.attributes&&Object.entries(e.attributes).forEach(([t,n])=>{(!r||r.find(n=>n.id===e.id&&n.name===t))&&s({eventType:"attribute",timestamp:n.timestamp,value:n.value,ref:{id:e.id,name:t}})})})})}}catch(t){throw console.error("Failed to subscribe to asset events for assets: "+e),a&&this.unsubscribe(a),t}return a})})}_processNextSubscription(){this._status===tM.CONNECTED&&0!==this._queuedSubscriptions.length&&setTimeout(()=>{let e=this._queuedSubscriptions.shift();e&&this.subscribe(e.eventSubscription,e.callback).then(t=>{let n=e.deferred;e.deferred=null,n&&n.resolve(t)},t=>{let n=e.deferred;e.deferred=null,n&&n.reject(t)})},0)}_onStatusChanged(e){e!==this._status&&(console.debug("Event provider status changed: "+e),this._status=e,this._unloading||window.setTimeout(()=>{this._statusCallbacks.forEach(t=>t(e))},0))}_onMessageReceived(e,t){let n=this._subscriptionMap.get(e);n&&n.callback(t)}_onConnect(){if(Object.keys(this._subscriptionMap).length>0){for(let e in this._subscriptionMap)this._subscriptionMap.has(e)&&this._queuedSubscriptions.unshift(this._subscriptionMap.get(e));this._subscriptionMap.clear()}this._processNextSubscription()}_onDisconnect(){this._status===tM.CONNECTED&&this._onStatusChanged(tM.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._onStatusChanged(tM.CONNECTING),this._scheduleReconnect()}_scheduleReconnect(){this._reconnectTimer||!this._disconnectRequested&&(console.debug("Event provider scheduling reconnect in "+this._reconnectDelayMillis+"ms"),this._reconnectTimer=window.setTimeout(()=>{this._disconnectRequested||this.connect()},this._reconnectDelayMillis),this._reconnectDelayMillis<cb.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(cb.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}cf.MIN_RECONNECT_DELAY=0,cf.MAX_RECONNECT_DELAY=3e4,cf._subscriptionCounter=0;class cb extends cf{get endpointUrl(){return this._endpointUrl}constructor(e){super(),this._webSocket=void 0,this._connectDeferred=null,this._subscribeDeferred=null,this._repliesDeferred=new Map,this._endpointUrl=(e.startsWith("https:")?"wss":"ws")+"://"+e.substr(e.indexOf("://")+3)+"/websocket/events",window.addEventListener("beforeunload",()=>{this._unloading=!0,this.disconnect()})}_doConnect(){let e=this._endpointUrl+"?Realm="+cH.config.realm;return this._connectDeferred=new a9,(cH.authenticated?cH.retrieveAuthorizationHeader().then(t=>{e+="&Authorization="+t}):Promise.resolve()).finally(()=>{this._webSocket=new WebSocket(e),this._webSocket.onopen=e=>{if(this._connectDeferred){let e=this._connectDeferred;this._connectDeferred=null,e.resolve(!0)}},this._webSocket.onerror=e=>{if(console.error("Event provider error:",e),this._connectDeferred){let e=this._connectDeferred;this._connectDeferred=null,e.resolve(!1)}else this._beforeDisconnect()},this._webSocket.onclose=()=>{if(console.warn("The WebSocket connection of the event provider has been closed."),this._webSocket=void 0,this._connectDeferred){let e=this._connectDeferred;this._connectDeferred=null,e.resolve(!1)}else this._beforeDisconnect()},this._webSocket.onmessage=e=>{let t=e.data;if(t&&t.startsWith(cc)){let e=JSON.parse(t.substring(cc.length)),n=this._subscribeDeferred;this._subscribeDeferred=null,n&&n.resolve(e.subscriptionId)}else if(t.startsWith(cu)){let e=JSON.parse(t.substring(cu.length)),n=this._subscribeDeferred;this._subscribeDeferred=null,n&&(console.warn("Unauthorized event subscription: "+JSON.stringify(e,null,2)),n.reject("Unauthorized"))}else if(t.startsWith(cm)){let e=JSON.parse(t.substring(cm.length));e.events&&e.events.forEach(t=>{this._onMessageReceived(e.subscriptionId,t)})}else if(t.startsWith(ch)){let e=JSON.parse(t.substring(ch.length));if(e.messageID){let t=this._repliesDeferred.get(e.messageID);this._repliesDeferred.delete(e.messageID),t&&t.resolve(e)}}}}),this._connectDeferred.promise}_beforeDisconnect(){this._onDisconnect()}_doDisconnect(){var e;null==(e=this._webSocket)||e.close(),this._subscribeDeferred=null,this._repliesDeferred.clear()}_doSubscribe(e){return this._webSocket?this._subscribeDeferred?Promise.reject("There's already a pending subscription"):(this._subscribeDeferred=new a9,e.subscriptionId||(e.subscriptionId=cb._subscriptionCounter+++""),this._webSocket.send("SUBSCRIBE:"+JSON.stringify(e)),this._subscribeDeferred.promise):Promise.reject("Not connected")}_doUnsubscribe(e){this._webSocket&&this._webSocket.send("UNSUBSCRIBE:"+JSON.stringify({subscriptionId:e}))}_doSend(e){let t=ch+JSON.stringify(e);this._webSocket.send(t)}_doSendWithReply(e){if(e.messageID||(e.messageID=(new Date().getTime()+10*Math.random()).toString(10)),this._repliesDeferred.has(e.messageID))return Promise.reject("There's already a pending send and reply with this ID");let t=new a9;return this._repliesDeferred.set(e.messageID,t),this._webSocket.send(ch+JSON.stringify(e)),t.promise}}cb._subscriptionCounter=1;let cp=["__proto__","constructor","prototype"];function c_(e){return!("string"!=typeof e||0===e.length||e.length>128||cp.indexOf(e)>-1||e.indexOf("..")>-1||e.indexOf("\\")>-1||/[?#%:\s]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function cg(e){return!(!c_(e)||e.indexOf("/")>-1||e.indexOf("@")>-1)}let cF={lng:cg,ns:function(e){return!(!c_(e)||e.indexOf("//")>-1)}};function cy(e){return"string"!=typeof e?e:e.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function cv(){return"function"==typeof XMLHttpRequest||"object"==typeof XMLHttpRequest}let cw=/\{\{(.+?)\}\}/g;function ck(e,t){let n=!1,o=e.replace(cw,(e,o)=>{let i=o.trim();if(cp.indexOf(i)>-1)return e;let r=t[i];if(null==r)return e;let a=cF[i]||cg,s=String(r).split("+");for(let t of s)if(!a(t))return n=!0,e;return s.join("+")});return n?null:o}let cE="u">typeof globalThis?globalThis:"u">typeof global?global:"u">typeof window?window:void 0;"function"==typeof fetch?i=fetch:cE&&"function"==typeof cE.fetch&&(i=cE.fetch);let cD=cv()&&cE?cE.XMLHttpRequest:void 0,cM="function"==typeof ActiveXObject&&cE?cE.ActiveXObject:void 0,cL=["__proto__","constructor","prototype"],cC=(e,t)=>{if(t&&"object"==typeof t){let n="";for(let e of Object.keys(t))cL.indexOf(e)>-1||(n+="&"+encodeURIComponent(e)+"="+encodeURIComponent(t[e]));if(!n)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+n.slice(1)}return e},cA=(e,t,n,o)=>{let r=e=>{if(!e.ok)return n(e.statusText||"Error",{status:e.status});e.text().then(t=>{n(null,{status:e.status,data:t})}).catch(n)};if(o){let i=o(e,t);if(i instanceof Promise)return void i.then(r).catch(n)}"function"==typeof fetch?fetch(e,t).then(r).catch(n):i(e,t).then(r).catch(n)},cT=(e,t,n,o)=>{if("function"==typeof n&&(o=n,n=void 0),o=o||(()=>{}),i&&0!==t.indexOf("file:")){var r=t,a=n,s=o;e.queryStringParams&&(r=cC(r,e.queryStringParams));let i={..."function"==typeof e.customHeaders?e.customHeaders():e.customHeaders};"u"<typeof window&&"u">typeof global&&void 0!==global.process&&global.process.versions&&global.process.versions.node&&(i["User-Agent"]=`i18next-http-backend (node/${global.process.version}; ${global.process.platform} ${global.process.arch})`),a&&(i["Content-Type"]="application/json");let d="function"==typeof e.requestOptions?e.requestOptions(a):e.requestOptions,l={method:a?"POST":"GET",body:a?e.stringify(a):void 0,headers:i,...e._omitFetchOptions?{}:d},c="function"==typeof e.alternateFetch&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{cA(r,l,s,c)}catch(t){if(!d||0===Object.keys(d).length||!t.message||0>t.message.indexOf("not implemented"))return s(t);try{Object.keys(d).forEach(e=>{delete l[e]}),cA(r,l,s,c),e._omitFetchOptions=!0}catch(e){s(e)}}return}if(cv()||"function"==typeof ActiveXObject){var d=t,l=n,c=o;l&&"object"==typeof l&&(l=cC("",l).slice(1)),e.queryStringParams&&(d=cC(d,e.queryStringParams));try{let t=cD?new cD:new cM("MSXML2.XMLHTTP.3.0");t.open(l?"POST":"GET",d,1),e.crossDomain||t.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.withCredentials=!!e.withCredentials,l&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),t.overrideMimeType&&t.overrideMimeType("application/json");let n=e.customHeaders;if(n="function"==typeof n?n():n)for(let e of Object.keys(n))cL.indexOf(e)>-1||t.setRequestHeader(e,n[e]);t.onreadystatechange=()=>{t.readyState>3&&c(t.status>=400?t.statusText:null,{status:t.status,data:t.responseText})},t.send(l)}catch(e){console&&console.log(e)}return}o(Error("No fetch and no xhr implementation found!"))};var cx=class{constructor(e,t={},n={}){this.services=e,this.options=t,this.allOptions=n,this.type="backend",this.init(e,t,n)}init(e,t={},n={}){if(this.services=e,this.options={...{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:e=>JSON.parse(e),stringify:JSON.stringify,parsePayload:(e,t,n)=>({[t]:n||""}),parseLoadPayload:(e,t)=>void 0,request:cT,reloadInterval:"u"<typeof window&&36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}},...this.options||{},...t},this.allOptions=n,this.services&&this.options.reloadInterval){let e=setInterval(()=>this.reload(),this.options.reloadInterval);"object"==typeof e&&"function"==typeof e.unref&&e.unref()}}readMulti(e,t,n){this._readAny(e,e,t,t,n)}read(e,t,n){this._readAny([e],e,[t],t,n)}_readAny(e,t,n,o,i){var r,a;let s=this.options.loadPath;"function"==typeof this.options.loadPath&&(s=this.options.loadPath(e,n)),(s=(a=r=s)&&"function"==typeof a.then?r:Promise.resolve(r)).then(r=>{if(!r)return i(null,{});let a=ck(r,{lng:e.join("+"),ns:n.join("+")});if(null==a)return i(Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+e.map(cy).join(", ")+"] namespaces=["+n.map(cy).join(", ")+"]"),!1);this.loadUrl(a,i,t,o)})}loadUrl(e,t,n,o){let i=this.options.parseLoadPayload("string"==typeof n?[n]:n,"string"==typeof o?[o]:o),r=cy(function(e){if("string"!=typeof e||0===e.length)return e;try{let t=new URL(e);if(t.username||t.password)return t.username="",t.password="",t.toString();return e}catch(t){return e.replace(/(\/\/)[^/@\s]+@/g,"$1")}}(e));this.options.request(this.options,e,i,(e,i)=>{let a,s;if(i&&(i.status>=500&&i.status<600||!i.status))return t("failed loading "+r+"; status code: "+i.status,!0);if(i&&i.status>=400&&i.status<500)return t("failed loading "+r+"; status code: "+i.status,!1);if(!i&&e&&e.message){let n=e.message.toLowerCase();if(["failed","fetch","network","load"].find(e=>n.indexOf(e)>-1))return t("failed loading "+r+": "+cy(e.message),!0)}if(e)return t(e,!1);try{a="string"==typeof i.data?this.options.parse(i.data,n,o):i.data}catch(e){s="failed parsing "+r+" to json"}if(s)return t(s,!1);t(null,a)})}create(e,t,n,o,i){if(!this.options.addPath)return;"string"==typeof e&&(e=[e]);let r=this.options.parsePayload(t,n,o),a=0,s=[],d=[];e.forEach(n=>{let o=this.options.addPath;"function"==typeof this.options.addPath&&(o=this.options.addPath(n,t));let l=ck(o,{lng:n,ns:t});if(null==l){a+=1,i&&a===e.length&&i(s,d);return}this.options.request(this.options,l,r,(t,n)=>{a+=1,s.push(t),d.push(n),a===e.length&&"function"==typeof i&&i(s,d)})})}reload(){let{backendConnector:e,languageUtils:t,logger:n}=this.services,o=e.language;if(o&&"cimode"===o.toLowerCase())return;let i=[],r=e=>{t.toResolveHierarchy(e).forEach(e=>{0>i.indexOf(e)&&i.push(e)})};r(o),this.allOptions.preload&&this.allOptions.preload.forEach(e=>r(e)),i.forEach(t=>{this.allOptions.ns.forEach(o=>{e.read(t,o,"read",null,null,(i,r)=>{i&&n.warn(`loading namespace ${o} for language ${t} failed`,i),!i&&r&&n.log(`loaded namespace ${o} for language ${t}`,r),e.loaded(`${t}|${o}`,i,r)})})})}};cx.type="backend";var cS=n(4954);class cY extends Error{}function cO(e,t){let n;if("string"!=typeof e)throw new cY("Invalid token specified: must be a string");t||(t={});let o=+(!0!==t.header),i=e.split(".")[o];if("string"!=typeof i)throw new cY(`Invalid token specified: missing part #${o+1}`);try{n=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw Error("base64 string is not of the correct length")}try{var n;return n=t,decodeURIComponent(atob(n).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}catch(e){return atob(t)}}(i)}catch(e){throw new cY(`Invalid token specified: invalid base64 for part #${o+1} (${e.message})`)}try{return JSON.parse(n)}catch(e){throw new cY(`Invalid token specified: invalid json for part #${o+1} (${e.message})`)}}if(cY.prototype.name="InvalidTokenError","u"<typeof Promise)throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function cI(e){if(!(this instanceof cI))throw Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var t,n,o=this,i=[],r={enable:!0,callbackList:[],interval:5},a=document.getElementsByTagName("script"),s=0;s<a.length;s++)(-1!==a[s].src.indexOf("keycloak.js")||-1!==a[s].src.indexOf("keycloak.min.js"))&&-1!==a[s].src.indexOf("version=")&&(o.iframeVersion=a[s].src.substring(a[s].src.indexOf("version=")+8).split("&")[0]);var d=!0,l=L(console.info),c=L(console.warn);function u(e,t){for(var n=function(e){var t=null,n=window.crypto||window.msCrypto;if(n&&n.getRandomValues&&window.Uint8Array)return t=new Uint8Array(e),n.getRandomValues(t),t;t=Array(e);for(var o=0;o<t.length;o++)t[o]=Math.floor(256*Math.random());return t}(e),o=Array(e),i=0;i<e;i++)o[i]=t.charCodeAt(n[i]%t.length);return String.fromCharCode.apply(null,o)}function m(){return void 0===o.authServerUrl?void 0:"/"==o.authServerUrl.charAt(o.authServerUrl.length-1)?o.authServerUrl+"realms/"+encodeURIComponent(o.realm):o.authServerUrl+"/realms/"+encodeURIComponent(o.realm)}function h(e,t){var n=e.code,i=e.error,r=e.prompt,a=new Date().getTime();if(e.kc_action_status&&o.onActionUpdate&&o.onActionUpdate(e.kc_action_status),i){if("none"!=r)if(e.error_description&&"authentication_expired"===e.error_description)o.login(e.loginOptions);else{var s={error:i,error_description:e.error_description};o.onAuthError&&o.onAuthError(s),t&&t.setError(s)}else t&&t.setSuccess();return}if("standard"!=o.flow&&(e.access_token||e.id_token)&&h(e.access_token,null,e.id_token,!0),"implicit"!=o.flow&&n){var c="code="+n+"&grant_type=authorization_code",u=o.endpoints.token(),m=new XMLHttpRequest;m.open("POST",u,!0),m.setRequestHeader("Content-type","application/x-www-form-urlencoded"),c+="&client_id="+encodeURIComponent(o.clientId)+"&redirect_uri="+e.redirectUri,e.pkceCodeVerifier&&(c+="&code_verifier="+e.pkceCodeVerifier),m.withCredentials=!0,m.onreadystatechange=function(){if(4==m.readyState)if(200==m.status){var e=JSON.parse(m.responseText);h(e.access_token,e.refresh_token,e.id_token,"standard"===o.flow),v()}else o.onAuthError&&o.onAuthError(),t&&t.setError()},m.send(c)}function h(n,i,r,s){b(n,i,r,a=(a+new Date().getTime())/2),d&&o.idTokenParsed&&o.idTokenParsed.nonce!=e.storedNonce?(l("[KEYCLOAK] Invalid nonce, clearing token"),o.clearToken(),t&&t.setError()):s&&(o.onAuthSuccess&&o.onAuthSuccess(),t&&t.setSuccess())}}function f(e){return 0==e.status&&e.responseText&&e.responseURL.startsWith("file:")}function b(e,t,n,i){if(o.tokenTimeoutHandle&&(clearTimeout(o.tokenTimeoutHandle),o.tokenTimeoutHandle=null),t?(o.refreshToken=t,o.refreshTokenParsed=cO(t)):(delete o.refreshToken,delete o.refreshTokenParsed),n?(o.idToken=n,o.idTokenParsed=cO(n)):(delete o.idToken,delete o.idTokenParsed),e){if(o.token=e,o.tokenParsed=cO(e),o.sessionId=o.tokenParsed.sid,o.authenticated=!0,o.subject=o.tokenParsed.sub,o.realmAccess=o.tokenParsed.realm_access,o.resourceAccess=o.tokenParsed.resource_access,i&&(o.timeSkew=Math.floor(i/1e3)-o.tokenParsed.iat),null!=o.timeSkew&&(l("[KEYCLOAK] Estimated time difference between browser and server is "+o.timeSkew+" seconds"),o.onTokenExpired)){var r=(o.tokenParsed.exp-new Date().getTime()/1e3+o.timeSkew)*1e3;l("[KEYCLOAK] Token expires in "+Math.round(r/1e3)+" s"),r<=0?o.onTokenExpired():o.tokenTimeoutHandle=setTimeout(o.onTokenExpired,r)}}else delete o.token,delete o.tokenParsed,delete o.subject,delete o.realmAccess,delete o.resourceAccess,o.authenticated=!1}function p(){var e="0123456789abcdef",t=u(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 _(e){var t=function(e){switch(o.flow){case"standard":t=["code","state","session_state","kc_action_status","iss"];break;case"implicit":t=["access_token","token_type","id_token","state","session_state","expires_in","kc_action_status","iss"];break;case"hybrid":t=["access_token","token_type","id_token","code","state","session_state","expires_in","kc_action_status","iss"]}t.push("error"),t.push("error_description"),t.push("error_uri");var t,n,i,r=e.indexOf("?"),a=e.indexOf("#");if("query"===o.responseMode&&-1!==r?(n=e.substring(0,r),""!==(i=g(e.substring(r+1,-1!==a?a:e.length),t)).paramsString&&(n+="?"+i.paramsString),-1!==a&&(n+=e.substring(a))):"fragment"===o.responseMode&&-1!==a&&(n=e.substring(0,a),""!==(i=g(e.substring(a+1),t)).paramsString&&(n+="#"+i.paramsString)),i&&i.oauthParams){if("standard"===o.flow||"hybrid"===o.flow){if((i.oauthParams.code||i.oauthParams.error)&&i.oauthParams.state)return i.oauthParams.newUrl=n,i.oauthParams}else if("implicit"===o.flow&&(i.oauthParams.access_token||i.oauthParams.error)&&i.oauthParams.state)return i.oauthParams.newUrl=n,i.oauthParams}}(e);if(t){var i=n.get(t.state);return i&&(t.valid=!0,t.redirectUri=i.redirectUri,t.storedNonce=i.nonce,t.prompt=i.prompt,t.pkceCodeVerifier=i.pkceCodeVerifier,t.loginOptions=i.loginOptions),t}}function g(e,t){for(var n=e.split("&"),o={paramsString:"",oauthParams:{}},i=0;i<n.length;i++){var r=n[i].indexOf("="),a=n[i].slice(0,r);-1!==t.indexOf(a)?o.oauthParams[a]=n[i].slice(r+1):(""!==o.paramsString&&(o.paramsString+="&"),o.paramsString+=n[i])}return o}function F(){var e={setSuccess:function(t){e.resolve(t)},setError:function(t){e.reject(t)}};return e.promise=new Promise(function(t,n){e.resolve=t,e.reject=n}),e}function y(){var e=F();if(!r.enable||r.iframe)return e.setSuccess(),e.promise;var t=document.createElement("iframe");r.iframe=t,t.onload=function(){var t=o.endpoints.authorize();"/"===t.charAt(0)?r.iframeOrigin=window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""):r.iframeOrigin=t.substring(0,t.indexOf("/",8)),e.setSuccess()};var n=o.endpoints.checkSessionIframe();return t.setAttribute("src",n),t.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),t.setAttribute("title","keycloak-session-iframe"),t.style.display="none",document.body.appendChild(t),window.addEventListener("message",function(e){if(e.origin===r.iframeOrigin&&r.iframe.contentWindow===e.source&&("unchanged"==e.data||"changed"==e.data||"error"==e.data)){"unchanged"!=e.data&&o.clearToken();for(var t=r.callbackList.splice(0,r.callbackList.length),n=t.length-1;n>=0;--n){var i=t[n];"error"==e.data?i.setError():i.setSuccess("unchanged"==e.data)}}},!1),e.promise}function v(){r.enable&&o.token&&setTimeout(function(){w().then(function(e){e&&v()})},1e3*r.interval)}function w(){var e=F();if(r.iframe&&r.iframeOrigin){var t=o.clientId+" "+(o.sessionId?o.sessionId:"");r.callbackList.push(e);var n=r.iframeOrigin;1==r.callbackList.length&&r.iframe.contentWindow.postMessage(t,n)}else e.setSuccess();return e.promise}function k(){var e,t,n,i=F();if(r.enable||o.silentCheckSsoRedirectUri){var a=document.createElement("iframe");a.setAttribute("src",o.endpoints.thirdPartyCookiesIframe()),a.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),a.setAttribute("title","keycloak-3p-check-iframe"),a.style.display="none",document.body.appendChild(a);var s=function(e){a.contentWindow===e.source&&("supported"===e.data||"unsupported"===e.data)&&("unsupported"===e.data&&(c("[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/docs/latest/securing_apps/#_modern_browsers"),r.enable=!1,o.silentCheckSsoFallback&&(o.silentCheckSsoRedirectUri=!1)),document.body.removeChild(a),window.removeEventListener("message",s),i.setSuccess())};window.addEventListener("message",s,!1)}else i.setSuccess();return e=i.promise,t=o.messageReceiveTimeout,n=null,Promise.race([e,new Promise(function(e,o){n=setTimeout(function(){o({error:"Timeout when waiting for 3rd party check iframe message."})},t)})]).finally(function(){clearTimeout(n)})}function E(e){if(!e||"default"==e)return{login:function(e){return window.location.assign(o.createLoginUrl(e)),F().promise},logout:async function(e){if("GET"===(e?.logoutMethod??o.logoutMethod))return void window.location.replace(o.createLogoutUrl(e));let n=o.createLogoutUrl(e),i=await fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({id_token_hint:o.idToken,client_id:o.clientId,post_logout_redirect_uri:t.redirectUri(e,!1)})});if(i.redirected){window.location.href=i.url;return}if(i.ok)return void window.location.reload();throw Error("Logout failed, request returned an error code.")},register:function(e){return window.location.assign(o.createRegisterUrl(e)),F().promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0!==e)window.location.href=e;else throw"Not supported by the OIDC server";return F().promise},redirectUri:function(e,t){return e&&e.redirectUri?e.redirectUri:o.redirectUri?o.redirectUri:location.href}};if("cordova"==e){r.enable=!1;var n=function(e,t,n){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(e,t,n):window.open(e,t,n)},i=function(e){var t=e&&e.cordovaOptions?Object.keys(e.cordovaOptions).reduce(function(t,n){return t[n]=e.cordovaOptions[n],t},{}):{};return t.location="no",e&&"none"==e.prompt&&(t.hidden="yes"),Object.keys(t).reduce(function(e,n){return e.push(n+"="+t[n]),e},[]).join(",")},a=function(){return o.redirectUri||"http://localhost"};return{login:function(e){var t=F(),r=i(e),s=n(o.createLoginUrl(e),"_blank",r),d=!1,l=!1,c=function(){l=!0,s.close()};return s.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&(h(_(e.url),t),c(),d=!0)}),s.addEventListener("loaderror",function(e){d||(0==e.url.indexOf(a())?(h(_(e.url),t),c(),d=!0):(t.setError(),c()))}),s.addEventListener("exit",function(e){l||t.setError({reason:"closed_by_user"})}),t.promise},logout:function(e){var t,i=F(),r=n(o.createLogoutUrl(e),"_blank","location=no,hidden=yes,clearcache=yes");return r.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&r.close()}),r.addEventListener("loaderror",function(e){0==e.url.indexOf(a())||(t=!0),r.close()}),r.addEventListener("exit",function(e){t?i.setError():(o.clearToken(),i.setSuccess())}),i.promise},register:function(e){var t=F(),r=n(o.createRegisterUrl(),"_blank",i(e));return r.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&(r.close(),h(_(e.url),t))}),t.promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0!==e){var t=n(e,"_blank","location=no");t.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&t.close()})}else throw"Not supported by the OIDC server"},redirectUri:function(e){return a()}}}if("cordova-native"==e)return r.enable=!1,{login:function(e){var t=F(),n=o.createLoginUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),h(_(e.url),t)}),window.cordova.plugins.browsertab.openUrl(n),t.promise},logout:function(e){var t=F(),n=o.createLogoutUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),o.clearToken(),t.setSuccess()}),window.cordova.plugins.browsertab.openUrl(n),t.promise},register:function(e){var t=F(),n=o.createRegisterUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),h(_(e.url),t)}),window.cordova.plugins.browsertab.openUrl(n),t.promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0!==e)window.cordova.plugins.browsertab.openUrl(e);else throw"Not supported by the OIDC server"},redirectUri:function(e){return e&&e.redirectUri?e.redirectUri:o.redirectUri?o.redirectUri:"http://localhost"}};throw"invalid adapter type: "+e}o.init=function(i){if(o.didInitialize)throw Error("A 'Keycloak' instance can only be initialized once.");if(o.didInitialize=!0,o.authenticated=!1,n=function(){try{return new D}catch(e){}return new M}(),t=i&&["default","cordova","cordova-native"].indexOf(i.adapter)>-1?E(i.adapter):i&&"object"==typeof i.adapter?i.adapter:window.Cordova||window.cordova?E("cordova"):E(),i){if(void 0!==i.useNonce&&(d=i.useNonce),void 0!==i.checkLoginIframe&&(r.enable=i.checkLoginIframe),i.checkLoginIframeInterval&&(r.interval=i.checkLoginIframeInterval),"login-required"===i.onLoad&&(o.loginRequired=!0),i.responseMode)if("query"===i.responseMode||"fragment"===i.responseMode)o.responseMode=i.responseMode;else throw"Invalid value for responseMode";if(i.flow){switch(i.flow){case"standard":o.responseType="code";break;case"implicit":o.responseType="id_token token";break;case"hybrid":o.responseType="code id_token token";break;default:throw"Invalid value for flow"}o.flow=i.flow}if(null!=i.timeSkew&&(o.timeSkew=i.timeSkew),i.redirectUri&&(o.redirectUri=i.redirectUri),i.silentCheckSsoRedirectUri&&(o.silentCheckSsoRedirectUri=i.silentCheckSsoRedirectUri),"boolean"==typeof i.silentCheckSsoFallback?o.silentCheckSsoFallback=i.silentCheckSsoFallback:o.silentCheckSsoFallback=!0,void 0!==i.pkceMethod){if("S256"!==i.pkceMethod&&!1!==i.pkceMethod)throw TypeError(`Invalid value for pkceMethod', expected 'S256' or false but got ${i.pkceMethod}.`);o.pkceMethod=i.pkceMethod}else o.pkceMethod="S256";"boolean"==typeof i.enableLogging?o.enableLogging=i.enableLogging:o.enableLogging=!1,"POST"===i.logoutMethod?o.logoutMethod="POST":o.logoutMethod="GET","string"==typeof i.scope&&(o.scope=i.scope),"string"==typeof i.acrValues&&(o.acrValues=i.acrValues),"number"==typeof i.messageReceiveTimeout&&i.messageReceiveTimeout>0?o.messageReceiveTimeout=i.messageReceiveTimeout:o.messageReceiveTimeout=1e4}o.responseMode||(o.responseMode="fragment"),o.responseType||(o.responseType="code",o.flow="standard");var a=F(),s=F();s.promise.then(function(){o.onReady&&o.onReady(o.authenticated),a.setSuccess(o.authenticated)}).catch(function(e){a.setError(e)});var l=function(){var t=F();function n(e){e?o.endpoints={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}}:o.endpoints={authorize:function(){return m()+"/protocol/openid-connect/auth"},token:function(){return m()+"/protocol/openid-connect/token"},logout:function(){return m()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var e=m()+"/protocol/openid-connect/login-status-iframe.html";return o.iframeVersion&&(e=e+"?version="+o.iframeVersion),e},thirdPartyCookiesIframe:function(){var e=m()+"/protocol/openid-connect/3p-cookies/step1.html";return o.iframeVersion&&(e=e+"?version="+o.iframeVersion),e},register:function(){return m()+"/protocol/openid-connect/registrations"},userinfo:function(){return m()+"/protocol/openid-connect/userinfo"}}}if(e?"string"==typeof e&&(a=e):a="keycloak.json",a){var i=new XMLHttpRequest;i.open("GET",a,!0),i.setRequestHeader("Accept","application/json"),i.onreadystatechange=function(){if(4==i.readyState)if(200==i.status||f(i)){var e=JSON.parse(i.responseText);o.authServerUrl=e["auth-server-url"],o.realm=e.realm,o.clientId=e.resource,n(null),t.setSuccess()}else t.setError()},i.send()}else{if(!e.clientId)throw"clientId missing";o.clientId=e.clientId;var r=e.oidcProvider;if(r)if("string"==typeof r){var a,s="/"==r.charAt(r.length-1)?r+".well-known/openid-configuration":r+"/.well-known/openid-configuration",i=new XMLHttpRequest;i.open("GET",s,!0),i.setRequestHeader("Accept","application/json"),i.onreadystatechange=function(){4==i.readyState&&(200==i.status||f(i)?(n(JSON.parse(i.responseText)),t.setSuccess()):t.setError())},i.send()}else n(r),t.setSuccess();else{if(!e.url){for(var d=document.getElementsByTagName("script"),l=0;l<d.length;l++)if(d[l].src.match(/.*keycloak\.js/)){e.url=d[l].src.substr(0,d[l].src.indexOf("/js/keycloak.js"));break}}if(!e.realm)throw"realm missing";o.authServerUrl=e.url,o.realm=e.realm,n(null),t.setSuccess()}}return t.promise}();function c(){var e=function(e){e||(n.prompt="none"),i&&i.locale&&(n.locale=i.locale),o.login(n).then(function(){s.setSuccess()}).catch(function(e){s.setError(e)})},t=function(){var e=document.createElement("iframe"),t=o.createLoginUrl({prompt:"none",redirectUri:o.silentCheckSsoRedirectUri});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);var n=function(t){t.origin===window.location.origin&&e.contentWindow===t.source&&(h(_(t.data),s),document.body.removeChild(e),window.removeEventListener("message",n))};window.addEventListener("message",n)},n={};switch(i.onLoad){case"check-sso":r.enable?y().then(function(){w().then(function(n){n?s.setSuccess():o.silentCheckSsoRedirectUri?t():e(!1)}).catch(function(e){s.setError(e)})}):o.silentCheckSsoRedirectUri?t():e(!1);break;case"login-required":e(!0);break;default:throw"Invalid value for onLoad"}}function u(){var e=_(window.location.href);if(e&&window.history.replaceState(window.history.state,null,e.newUrl),e&&e.valid)return y().then(function(){h(e,s)}).catch(function(e){s.setError(e)});i?i.token&&i.refreshToken?(b(i.token,i.refreshToken,i.idToken),r.enable?y().then(function(){w().then(function(e){e?(o.onAuthSuccess&&o.onAuthSuccess(),s.setSuccess(),v()):s.setSuccess()}).catch(function(e){s.setError(e)})}):o.updateToken(-1).then(function(){o.onAuthSuccess&&o.onAuthSuccess(),s.setSuccess()}).catch(function(e){o.onAuthError&&o.onAuthError(),i.onLoad?c():s.setError(e)})):i.onLoad?c():s.setSuccess():s.setSuccess()}return l.then(function(){var e,t;(e=F(),t=function(){("interactive"===document.readyState||"complete"===document.readyState)&&(document.removeEventListener("readystatechange",t),e.setSuccess())},document.addEventListener("readystatechange",t),t(),e.promise).then(k).then(u).catch(function(e){a.setError(e)})}),l.catch(function(e){a.setError(e)}),a.promise},o.login=function(e){return t.login(e)},o.createLoginUrl=function(e){var i,r=p(),a=p(),s=t.redirectUri(e),l={state:r,nonce:a,redirectUri:encodeURIComponent(s),loginOptions:e};e&&e.prompt&&(l.prompt=e.prompt),i=e&&"register"==e.action?o.endpoints.register():o.endpoints.authorize();var c=e&&e.scope||o.scope;c?-1===c.indexOf("openid")&&(c="openid "+c):c="openid";var m=i+"?client_id="+encodeURIComponent(o.clientId)+"&redirect_uri="+encodeURIComponent(s)+"&state="+encodeURIComponent(r)+"&response_mode="+encodeURIComponent(o.responseMode)+"&response_type="+encodeURIComponent(o.responseType)+"&scope="+encodeURIComponent(c);if(d&&(m=m+"&nonce="+encodeURIComponent(a)),e&&e.prompt&&(m+="&prompt="+encodeURIComponent(e.prompt)),e&&e.maxAge&&(m+="&max_age="+encodeURIComponent(e.maxAge)),e&&e.loginHint&&(m+="&login_hint="+encodeURIComponent(e.loginHint)),e&&e.idpHint&&(m+="&kc_idp_hint="+encodeURIComponent(e.idpHint)),e&&e.action&&"register"!=e.action&&(m+="&kc_action="+encodeURIComponent(e.action)),e&&e.locale&&(m+="&ui_locales="+encodeURIComponent(e.locale)),e&&e.acr&&(m+="&claims="+encodeURIComponent(JSON.stringify({id_token:{acr:e.acr}}))),(e&&e.acrValues||o.acrValues)&&(m+="&acr_values="+encodeURIComponent(e.acrValues||o.acrValues)),o.pkceMethod){var h=u(96,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");l.pkceCodeVerifier=h,m+="&code_challenge="+function(e,t){if("S256"!==e)throw TypeError(`Invalid value for 'pkceMethod', expected 'S256' but got '${e}'.`);return btoa(String.fromCodePoint(...new Uint8Array(cS.arrayBuffer(t)))).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}(o.pkceMethod,h)+"&code_challenge_method="+o.pkceMethod}return n.add(l),m},o.logout=function(e){return t.logout(e)},o.createLogoutUrl=function(e){if("POST"===(e?.logoutMethod??o.logoutMethod))return o.endpoints.logout();var n=o.endpoints.logout()+"?client_id="+encodeURIComponent(o.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(t.redirectUri(e,!1));return o.idToken&&(n+="&id_token_hint="+encodeURIComponent(o.idToken)),n},o.register=function(e){return t.register(e)},o.createRegisterUrl=function(e){return e||(e={}),e.action="register",o.createLoginUrl(e)},o.createAccountUrl=function(e){var n=m(),i=void 0;return void 0!==n&&(i=n+"/account?referrer="+encodeURIComponent(o.clientId)+"&referrer_uri="+encodeURIComponent(t.redirectUri(e))),i},o.accountManagement=function(){return t.accountManagement()},o.hasRealmRole=function(e){var t=o.realmAccess;return!!t&&t.roles.indexOf(e)>=0},o.hasResourceRole=function(e,t){if(!o.resourceAccess)return!1;var n=o.resourceAccess[t||o.clientId];return!!n&&n.roles.indexOf(e)>=0},o.loadUserProfile=function(){var e=m()+"/account",t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+o.token);var n=F();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(o.profile=JSON.parse(t.responseText),n.setSuccess(o.profile)):n.setError())},t.send(),n.promise},o.loadUserInfo=function(){var e=o.endpoints.userinfo(),t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+o.token);var n=F();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(o.userInfo=JSON.parse(t.responseText),n.setSuccess(o.userInfo)):n.setError())},t.send(),n.promise},o.isTokenExpired=function(e){if(!o.tokenParsed||!o.refreshToken&&"implicit"!=o.flow)throw"Not authenticated";if(null==o.timeSkew)return l("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var t=o.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+o.timeSkew;if(e){if(isNaN(e))throw"Invalid minValidity";t-=e}return t<0},o.updateToken=function(e){var t=F();if(!o.refreshToken)return t.setError(),t.promise;e=e||5;var n=function(){var n=!1;if(-1==e?(n=!0,l("[KEYCLOAK] Refreshing token: forced refresh")):(!o.tokenParsed||o.isTokenExpired(e))&&(n=!0,l("[KEYCLOAK] Refreshing token: token expired")),n){var r="grant_type=refresh_token&refresh_token="+o.refreshToken,a=o.endpoints.token();if(i.push(t),1==i.length){var s=new XMLHttpRequest;s.open("POST",a,!0),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),s.withCredentials=!0,r+="&client_id="+encodeURIComponent(o.clientId);var d=new Date().getTime();s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status){l("[KEYCLOAK] Token refreshed"),d=(d+new Date().getTime())/2;var e=JSON.parse(s.responseText);b(e.access_token,e.refresh_token,e.id_token,d),o.onAuthRefreshSuccess&&o.onAuthRefreshSuccess();for(var t=i.pop();null!=t;t=i.pop())t.setSuccess(!0)}else{c("[KEYCLOAK] Failed to refresh token"),400==s.status&&o.clearToken(),o.onAuthRefreshError&&o.onAuthRefreshError();for(var t=i.pop();null!=t;t=i.pop())t.setError(!0)}},s.send(r)}}else t.setSuccess(!1)};return r.enable?w().then(function(){n()}).catch(function(e){t.setError(e)}):n(),t.promise},o.clearToken=function(){o.token&&(b(null,null,null),o.onAuthLogout&&o.onAuthLogout(),o.loginRequired&&o.login())};var D=function(){if(!(this instanceof D))return new D;function e(){for(var e=new Date().getTime(),t=0;t<localStorage.length;t++){var n=localStorage.key(t);if(n&&0==n.indexOf("kc-callback-")){var o=localStorage.getItem(n);if(o)try{var i=JSON.parse(o).expires;(!i||i<e)&&localStorage.removeItem(n)}catch(e){localStorage.removeItem(n)}}}}localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test"),this.get=function(t){if(t){var n="kc-callback-"+t,o=localStorage.getItem(n);return o&&(localStorage.removeItem(n),o=JSON.parse(o)),e(),o}},this.add=function(t){e();var n="kc-callback-"+t.state;t.expires=new Date().getTime()+36e5,localStorage.setItem(n,JSON.stringify(t))}},M=function(){if(!(this instanceof M))return new M;this.get=function(o){if(o){var i=t("kc-callback-"+o);if(n("kc-callback-"+o,"",e(-100)),i)return JSON.parse(i)}},this.add=function(t){n("kc-callback-"+t.state,JSON.stringify(t),e(60))},this.removeItem=function(t){n(t,"",e(-100))};var e=function(e){var t=new Date;return t.setTime(t.getTime()+60*e*1e3),t},t=function(e){for(var t=e+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){for(var i=n[o];" "==i.charAt(0);)i=i.substring(1);if(0==i.indexOf(t))return i.substring(t.length,i.length)}return""},n=function(e,t,n){var o=e+"="+t+"; expires="+n.toUTCString()+"; ";document.cookie=o}};function L(e){return function(){o.enableLogging&&e.apply(console,Array.prototype.slice.call(arguments))}}}var cP=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function a(e){try{d(o.next(e))}catch(e){r(e)}}function s(e){try{d(o.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}d((o=o.apply(e,t||[])).next())})};let cB="openremote";(ew=tL||(tL={})).MANAGER_FAILED_TO_LOAD="MANAGER_FAILED_TO_LOAD",ew.AUTH_FAILED="AUTH_FAILED",ew.AUTH_TYPE_UNSUPPORTED="AUTH_TYPE_UNSUPPORTED",ew.CONSOLE_ERROR="CONSOLE_INIT_ERROR",ew.EVENTS_CONNECTION_ERROR="EVENTS_CONNECTION_ERROR",ew.TRANSLATION_ERROR="TRANSLATION_ERROR",(ek=tC||(tC={})).ERROR="ERROR",ek.READY="READY",ek.ONLINE="ONLINE",ek.OFFLINE="OFFLINE",ek.CONNECTING="CONNECTING",ek.CONSOLE_INIT="CONSOLE_INIT",ek.CONSOLE_READY="CONSOLE_READY",ek.TRANSLATE_INIT="TRANSLATE_INIT",ek.TRANSLATE_LANGUAGE_CHANGED="TRANSLATE_LANGUAGE_CHANGED",ek.DISPLAY_REALM_CHANGED="DISPLAY_REALM_CHANGED",ek.LOGIN="LOGIN";let cR={cn:"zh-cn"};class cN{constructor(){this._authenticated=!1,this._ready=!1,this._name="",this._username="",this._keycloakUpdateTokenInterval=void 0,this._managerVersion="",this._authServerUrl="",this._listeners=[],this._disconnected=!1}get username(){return this._username}get error(){return this._error}get authenticated(){return this._authenticated}get ready(){return this._ready}get config(){return this._config}get roles(){let e=new Map;return this._keycloak&&this._keycloak.resourceAccess&&this._config.clientId&&this._keycloak.resourceAccess&&Object.entries(this._keycloak.resourceAccess).forEach(([t,n])=>{let o=n.roles;e.set(t,o)}),e}get managerVersion(){return this._managerVersion}get isManagerAvailable(){return this._managerVersion&&""!==this._managerVersion}get managerUrl(){var e;return null==(e=this._config)?void 0:e.managerUrl}get keycloakUrl(){var e;return null==(e=this._config)?void 0:e.keycloakUrl}get isError(){return!!this._error}get connectionStatus(){return this._events&&this._events.status}get console(){return this._console}get consoleAppConfig(){return this._consoleAppConfig}get events(){return this._events}get rest(){return cd}get language(){return oL.language}set language(e){console.debug(`Changing language to ${e}.`),e&&(oL.changeLanguage(e),this.console.storeData("LANGUAGE",e),this.authenticated&&this.updateKeycloakUserLanguage(e).catch(e=>console.error(e)))}get displayRealm(){return this._displayRealm||this._config.realm}set displayRealm(e){this.isSuperUser()&&this._displayRealm!==e&&(this._displayRealm=e,this._emitEvent(tC.DISPLAY_REALM_CHANGED))}get clientId(){return this._config.clientId||cB}getEventProvider(){return this.events}isManagerSameOrigin(){if(!this.ready)return!1;let e=new URL(this._config.managerUrl),t=window.location;return e.protocol===t.protocol&&e.hostname===t.hostname&&e.port===t.port}addListener(e){0>this._listeners.indexOf(e)&&this._listeners.push(e)}removeListener(e){let t=this._listeners.indexOf(e);t>=0&&this._listeners.splice(t,1)}init(e){return cP(this,void 0,void 0,function*(){let t;this._config&&console.debug("Already initialised"),this._config=((t=e?Object.assign({},e):{}).managerUrl&&""!==t.managerUrl?t.managerUrl=t.managerUrl.replace(/\/+$/,""):t.managerUrl=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")+window.location.pathname.replace(/\/[^/]+\/?$/,""),t.realm&&""!==t.realm||(t.realm="master"),t.auth||(t.auth="KEYCLOAK"),void 0===t.consoleAutoEnable&&(t.consoleAutoEnable=!0),void 0===t.applyConfigToAdmin&&(t.applyConfigToAdmin=!0),t.eventProviderType||(t.eventProviderType="WEBSOCKET"),(!t.pollingIntervalMillis||t.pollingIntervalMillis<5e3)&&(t.pollingIntervalMillis=1e4),void 0===t.loadIcons&&(t.loadIcons=!0),void 0===t.loadTranslations&&(t.loadTranslations=["or"]),void 0===t.translationsLoadPath&&(t.translationsLoadPath="locales/{{lng}}/{{ns}}.json"),void 0===t.loadDescriptors&&(t.loadDescriptors=!0),void 0===t.clientId&&(t.clientId=cB),t);let n=yield this.loadManagerInfo(),o=new si(this._config.realm,this._config.consoleAutoEnable,()=>{this._emitEvent(tC.CONSOLE_READY)});if(this._console=o,"KEYCLOAK"===this._config.auth){if(!this._config.keycloakUrl&&this._authServerUrl){let e,t=new URL(this._config.managerUrl);this._authServerUrl.startsWith("//")?(this._authServerUrl=t.protocol+this._authServerUrl,this._config.keycloakUrl=this._authServerUrl):this._authServerUrl.startsWith("http")?this._config.keycloakUrl=this._authServerUrl:((e=new URL(t)).pathname=this._authServerUrl,e.protocol||(e.protocol=t.protocol),e.hostname||(e.hostname=t.hostname),e.port||(e.port=t.port),this._config.keycloakUrl=e.toString())}this._config.keycloakUrl||(this._config.keycloakUrl=this._config.managerUrl+"/auth"),this._config.keycloakUrl=this._config.keycloakUrl.replace(/\/+$/,""),n=yield this.doAuthInit()}return!!n&&(n&&(n=this.doRestApiInit()),(yield this.doConsoleInit())&&this._clearWebHistory(),(n=(yield this.doTranslateInit())&&n)&&(n=yield this.doDescriptorsInit(),n=yield this.getConsoleAppConfig()),this.doIconInit(),n?(n=yield this.doEventsSubscriptionInit(),this._ready=!0,this._emitEvent(tC.READY)):(this._config=void 0,console.warn("Failed to initialise the manager")),this.displayRealm=e.realm||"master",n)})}loadManagerInfo(){return cP(this,void 0,void 0,function*(){try{let e=yield new Promise((e,t)=>{let n=new XMLHttpRequest;n.addEventListener("load",()=>{e(JSON.parse(n.responseText))}),n.addEventListener("error",()=>{t(Error("Failed to contact the manager"))}),n.open("GET",this._config.managerUrl+"/api/master/info"),n.send()});return this._managerVersion=e&&e.version?e.version:"",this._authServerUrl=e&&e.authServerUrl?e.authServerUrl:"",!0}catch(e){return console.error("Failed to contact the manager",e),this._setError(tL.MANAGER_FAILED_TO_LOAD),!1}})}doTranslateInit(){return cP(this,void 0,void 0,function*(){if(oL.isInitialized)return!0;oL.on("initialized",e=>{this._emitEvent(tC.TRANSLATE_INIT)}),oL.on("languageChanged",e=>{var t;a7().locale(null!=(t=cR[e])?t:e),this._emitEvent(tC.TRANSLATE_LANGUAGE_CHANGED)});let e={lng:(yield this.getConsolePreferredLanguage())||(yield this.getUserPreferredLanguage())||this.config.defaultLanguage||"en",fallbackLng:"en",defaultNS:"app",fallbackNS:"or",ns:this.config.loadTranslations,backend:{loadPath:(e,t)=>1===t.length&&"or"===t[0]?this.config.managerUrl+"/shared/locales/{{lng}}/{{ns}}.json":this.config.translationsLoadPath?this.config.translationsLoadPath:"locales/{{lng}}/{{ns}}.json"}};this.config.configureTranslationsOptions&&this.config.configureTranslationsOptions(e);try{yield oL.use(cx).init(e),oL.services.formatter.add("uppercase",e=>"string"==typeof e?e.toUpperCase():String(e)),oL.services.formatter.add("lll",(e,t)=>{var n;return a7()(e).locale(null!=(n=cR[t])?n:t).format("lll")}),oL.services.formatter.add("llll",(e,t,n)=>{var o;return a7()(e).locale(null!=(o=cR[t])?o:t).format((null==n?void 0:n.weekday)==="long"?"LLLL":"llll")})}catch(e){return console.error(e),this._setError(tL.TRANSLATION_ERROR),!1}return!0})}doDescriptorsInit(){return cP(this,void 0,void 0,function*(){if(!this.config.loadDescriptors)return!0;try{let e=yield cd.api.AssetModelResource.getAssetInfos(),t=yield cd.api.AssetModelResource.getMetaItemDescriptors(),n=yield cd.api.AssetModelResource.getValueDescriptors();n$._assetTypeInfos=e.data,n$._metaItemDescriptors=Object.values(t.data),n$._valueDescriptors=Object.values(n.data)}catch(e){return console.error(e),!1}return!0})}doAuthInit(){return cP(this,void 0,void 0,function*(){let e=!0;switch(this._config.auth){case"KEYCLOAK":e=yield this.loadAndInitialiseKeycloak();break;case"NONE":return!0;default:return this._setError(tL.AUTH_TYPE_UNSUPPORTED),!1}return!!e&&(cd.addRequestInterceptor(e=>{if(!e.headers.Authorization){let t=this.getAuthorizationHeader();t&&(e.headers.Authorization=t)}return e}),e)})}doRestApiInit(){return cd.setTimeout(2e4),cd.initialise(this.getApiBaseUrl()),!0}doEventsSubscriptionInit(){return cP(this,void 0,void 0,function*(){let e=!1;return"WEBSOCKET"===this._config.eventProviderType&&(this._events=new cb(this._config.managerUrl),this._events.subscribeStatusChange(e=>this._onEventProviderStatusChanged(e)),e=yield this._events.connect()),e||this._setError(tL.EVENTS_CONNECTION_ERROR),e})}_connectEvents(){var e;(null==(e=this.events)?void 0:e.status)===tM.DISCONNECTED?this.events.connect().catch(e=>{console.error("Failed to connect EventProvider."),console.error(e)}):console.warn("Tried to connect EventProvider, but it wasn't disconnected!")}_onEventProviderStatusChanged(e){switch(e){case tM.DISCONNECTED:this._onDisconnect();break;case tM.CONNECTED:break;case tM.CONNECTING:this._emitEvent(tC.CONNECTING)}}doConsoleInit(){return cP(this,void 0,void 0,function*(){try{return yield this.console.initialise(),this._emitEvent(tC.CONSOLE_INIT),!0}catch(e){return this._setError(tL.CONSOLE_ERROR),!1}})}doIconInit(){var e;this._config.loadIcons&&(nG.addIconSet("mdi",(e=cj.managerUrl,{getIconTemplate:e=>nm`<span style="font-family: 'Material Design Icons';" class="mdi-${e}"></span>`,onAdd(){let t=document.createElement("style");t.id="mdiFontStyle",t.textContent='@font-face {\n font-family: "Material Design Icons";\n src: url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.woff2") format("woff2");\n font-weight: normal;\n font-style: normal;\n}',document.head.appendChild(t)}})),nG.addIconSet("or",{getIconTemplate:e=>{let t=nW[e];return t?nm`
1716
+ `}ready(){super.ready(),this.addController(new rS(this,e=>{this._setInputElement(e),this._setFocusElement(e),this.stateTarget=e,this.ariaTarget=e},{uniqueIdPrefix:"search-input"})),this.addController(new rY(this.inputElement,this._labelController)),this._tooltipController=new iu(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this._tooltipController.setShouldShow(e=>!e.opened),this._positionTarget=this.shadowRoot.querySelector('[part="input-field"]'),this.shadowRoot.querySelector('[part="field-button toggle-button"]').addEventListener("mousedown",e=>e.preventDefault())}_onOpenedChanged(e){this.opened=e.detail.value}_onVaadinOverlayClose(e){let t=e.detail.sourceEvent;t?.composedPath().includes(this)&&!t.composedPath().includes(this._overlayElement)&&e.preventDefault()}_toggle(e){e.stopPropagation(),this.$.overlay.opened?this.close():this.open()}}ox(a6),n(4532);var a8=n(4867),a7=n.n(a8);n(3472);class a9{get resolve(){return this._resolve}get reject(){return this._reject}get promise(){return this._promise}constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t}),Object.freeze(this)}}function se(e,t,n=!0){if(null==e||null==t)return e===t;if(e.constructor!==t.constructor)return!1;if(e instanceof Function||e instanceof RegExp)return e===t;if(e===t||e.valueOf()===t.valueOf())return!0;if(Array.isArray(e)&&e.length!==t.length||e instanceof Date||!(e instanceof Object)||!(t instanceof Object))return!1;if(n){if(Array.isArray(e))return e.every((e,n)=>se(e,t[n]));let n=Object.keys(e);return Object.keys(t).every(e=>-1!==n.indexOf(e))&&n.every(n=>se(e[n],t[n]))}return!1}class st{constructor(e){e&&Object.assign(this,e)}matches(e){var t,n,o,i,r,a,s;if((null==(t=this.ids)?void 0:t.length)&&(!e.id||!this.ids.includes(e.id))||(null==(n=this.types)?void 0:n.length)&&(!e.type||!this.types.includes(e.type))||(null==(o=this.realm)?void 0:o.name)&&e.realm!==this.realm.name||(null==(i=this.parents)?void 0:i.length)&&!this.parents.some(t=>!t.id||e.parentId===t.id))return!1;if(null==(r=this.paths)?void 0:r.length){let t=null!=(a=e.path)?a:[];if(!this.paths.some(e=>{var n;return(null!=(n=e.path)?n:[]).every((e,n)=>t[n]===e)}))return!1}return(null==(s=this.names)||!s.length||!!this.names.every(t=>st._evalValuePredicate(e.name,t)))&&(!this.attributes||st._evalGroup(e,this.attributes))}static getUnsupportedFields(e){return Object.keys(e).filter(e=>!st._SUPPORTED_FIELDS.has(e))}collectAttributeNames(){return this.attributes?st._collectNames(this.attributes):[]}static _evalValuePredicate(e,t){var n;switch(t.predicateType){case"string":{let o;if(null==e)return!1;let i=!1!==t.caseSensitive?String(e):String(e).toLowerCase(),r=!1!==t.caseSensitive?t.value:null==(n=t.value)?void 0:n.toLowerCase();switch(t.match){case"BEGIN":o=i.startsWith(r);break;case"END":o=i.endsWith(r);break;case"CONTAINS":o=i.includes(r);break;default:o=i===r}return t.negate?!o:o}case"boolean":return e===t.value;case"number":{let n;if("number"!=typeof e)return!1;switch(t.operator){case"GREATER_THAN":n=e>t.value;break;case"GREATER_EQUALS":n=e>=t.value;break;case"LESS_THAN":n=e<t.value;break;case"LESS_EQUALS":n=e<=t.value;break;case"BETWEEN":n=e>=t.value&&e<=t.rangeValue;break;default:n=e===t.value}return t.negate?!n:n}}return!1}static _evalPredicate(e,t){var n,o;let i=null==(n=t.name)?void 0:n.value;if(!i)return!0;let r=null==(o=e.attributes)?void 0:o[i];if(!r)return!!t.negated;let a=!t.value||st._evalValuePredicate(r.value,t.value);return t.negated?!a:a}static _evalGroup(e,t){var n,o,i;let r=null!=(n=t.operator)?n:"AND",a=[...(null!=(o=t.items)?o:[]).map(t=>st._evalPredicate(e,t)),...(null!=(i=t.groups)?i:[]).map(t=>st._evalGroup(e,t))];return!a.length||("OR"===r?a.some(Boolean):a.every(Boolean))}static _collectNames(e){var t,n;return[...(null!=(t=e.items)?t:[]).map(e=>{var t;return null==(t=e.name)?void 0:t.value}).filter(e=>!!e),...(null!=(n=e.groups)?n:[]).flatMap(e=>st._collectNames(e))]}}st._SUPPORTED_FIELDS=new Set(["ids","types","names","parents","paths","realm","attributes"]);var sn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function a(e){try{d(o.next(e))}catch(e){r(e)}}function s(e){try{d(o.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}d((o=o.apply(e,t||[])).next())})};let so=n(4461);class si{constructor(e,t,n){this._autoEnable=!1,this._initialised=!1,this._initialiseInProgress=!1,this._pendingProviderPromises={},this._providerMessageListeners={},this._pendingProviderEnables=[],this._registrationTimer=null,this._realm=e,this._autoEnable=t,this._enableCompleteCallback=n,window.OpenRemoteConsole=this;let o=new URLSearchParams(window.location.search),i=o.get("consoleName"),r=o.get("consoleVersion"),a=o.get("consolePlatform"),s=o.get("consoleProviders"),d=o.get("consoleAutoEnable"),l=s&&s.length>0?s.split(" "):["push"];this._pendingProviderEnables=l;let c=si._createConsoleRegistration(),u=window.localStorage.getItem(this._storageKey);if(u)try{let e=JSON.parse(u);e.id&&(c.id=e.id),e.name&&(c.name=e.name),e.providers&&(c.providers=e.providers),e.apps&&(c.apps=e.apps)}catch(e){console.error("Failed to deserialise console registration")}let m=c.providers;for(let e of(c.providers={},l)){let t=m&&m.hasOwnProperty(e)?m[e]:{enabled:!1,disabled:!1};c.providers[e]=t}let h=cH.getAppName();h.length>0&&0>c.apps.indexOf(h)&&c.apps.push(h),this._registration=c,i&&(c.name=i),r&&(c.version=r),a&&(c.platform=a),d&&(this._autoEnable="TRUE"===d||"true"===d)}get registration(){return this._registration}get autoEnable(){return this._autoEnable}get pendingProviderEnables(){return this._pendingProviderEnables.slice(0)}get shellApple(){let e=navigator.userAgentData&&navigator.userAgentData.platform?navigator.userAgentData.platform:navigator.platform;return e&&("iP"===e.substring(0,2)||"Mac"===e.substring(0,3))&&window.webkit&&window.webkit.messageHandlers}get shellAndroid(){return!!window.MobileInterface}get isMobile(){return this.shellApple||this.shellAndroid}initialise(){return sn(this,void 0,void 0,function*(){if(!this._initialised&&!this._initialiseInProgress){console.debug("Console: initialising"),this._initialiseInProgress=!0;try{if(this._registration.providers)for(let e of Object.keys(this._registration.providers))yield this._initialiseProvider(e);this._registration.id||(yield this.sendRegistration()),this._initialised=!0,this._initialiseInProgress=!1,0===this._pendingProviderEnables.length?(yield this.sendRegistration(),this._callCompletedCallback()):this._autoEnable&&(yield this.enableProviders())}catch(e){console.error(e)}finally{this._initialiseInProgress=!1}}})}enableProviders(){return sn(this,void 0,void 0,function*(){if(!this._initialised)throw Error("Console must be initialised before enabling providers");for(let e=this._pendingProviderEnables.length-1;e>-1;e--){let t=this._pendingProviderEnables[e];yield this.enableProvider(t)}})}enableProvider(e,t){return sn(this,void 0,void 0,function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),Error("Console must be initialised before enabling providers");if(!this._registration.providers.hasOwnProperty(e))throw console.debug("Invalid console provider '"+e+"'"),Error("Invalid console provider '"+e+"'");console.debug("Console: enabling provider '"+e+"'");let n={provider:e,action:"PROVIDER_ENABLE",consoleId:this._registration.id,data:t},o=yield this.sendProviderMessage(n,!0);this._registration.providers[e].hasPermission=o.hasPermission,this._registration.providers[e].success=o.success,this._registration.providers[e].enabled=o.success,this._registration.providers[e].data=o.data;let i=this._pendingProviderEnables.indexOf(e);return i>=0&&(this._pendingProviderEnables.splice(i,1),0===this._pendingProviderEnables.length&&(this.sendRegistration().catch(()=>void 0),this._callCompletedCallback())),o})}disableProvider(e){return sn(this,void 0,void 0,function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),Error("Console must be initialised before disabling providers");if(!this._registration.providers.hasOwnProperty(e))throw console.debug("Invalid console provider '"+e+"'"),Error("Invalid console provider '"+e+"'");console.debug("Console: disabling provider '"+e+"'");let t=yield this.sendProviderMessage({provider:e,action:"PROVIDER_DISABLE"},!0);return this._registration.providers[e].disabled=!0,this._registration.providers[e].enabled=!1,t})}getProvider(e){return this._registration&&this._registration.providers?this._registration.providers[e]:void 0}sendProviderMessage(e,t){return sn(this,void 0,void 0,function*(){if("storage"!==e.provider&&!this._registration.providers.hasOwnProperty(e.provider))throw console.debug("Invalid console provider '"+e.provider+"'"),Error("Invalid console provider '"+e.provider+"'");if(!t)return void this._doSendProviderMessage(e);let n=e.provider+e.action;if(this._pendingProviderPromises[n])throw Error("Message already pending for provider '"+e.provider+"' with action '"+e.action+"'");let o=new a9,i=()=>{delete this._pendingProviderPromises[n],o.reject("No response from provider")};return this._pendingProviderPromises[n]=[o,window.setTimeout(i,5e3)],this._doSendProviderMessage(e),o.promise})}sendRegistration(){return this._registrationTimer&&(window.clearTimeout(this._registrationTimer),this._registrationTimer=null),new Promise((e,t)=>{this._registrationTimer=window.setTimeout(()=>sn(this,void 0,void 0,function*(){this._registrationTimer=null,console.debug("Console: updating registration");try{yield this._sendRegistration(!0),e()}catch(e){console.error("Failed to register console",e),t(e)}}))})}_sendRegistration(e){return sn(this,void 0,void 0,function*(){this._normaliseRegistration();let t=!!this._registration.id;try{let e=yield cH.rest.api.ConsoleResource.register(this._registration);if(200!==e.status)throw Error("Failed to register console");this._registration=e.data,console.debug("Console: registration successful"),console.debug("Console: updating locally stored registration"),window.localStorage.setItem(this._storageKey,JSON.stringify(this._registration))}catch(n){if(e&&t&&si._isStaleRegistrationResponse(n)){console.warn("Console registration ID is stale or cannot be claimed; creating a new console registration"),window.localStorage.removeItem(this._storageKey),delete this._registration.id,yield this._sendRegistration(!1);return}throw n}})}_normaliseRegistration(){this._registration.name||(this._registration.name="Console"),this._registration.platform||(this._registration.platform="N/A"),this._registration.version||(this._registration.version="N/A"),this._registration.providers||(this._registration.providers={})}get _storageKey(){return"OpenRemoteConsole:"+this._realm}static _isStaleRegistrationResponse(e){let t=e&&e.response?e.response.status:void 0;return 403===t||409===t}storeData(e,t){this.sendProviderMessage({provider:"storage",action:"STORE",key:e,value:t},!1)}retrieveData(e){return sn(this,void 0,void 0,function*(){let t=this.sendProviderMessage({provider:"storage",action:"RETRIEVE",key:e},!0);try{let e=yield Promise.race([t,new Promise((e,t)=>setTimeout(t,2e3))]);if(e&&e.value){let t=e.value;return"null"===t?void 0:t}}catch(e){console.log("Failed to retrieve data from storage provider")}})}addProviderMessageListener(e,t){this._providerMessageListeners[e.provider+e.action]=t}removeProviderMessageListener(e){delete this._providerMessageListeners[e.provider+e.action]}_postNativeShellMessage(e){try{if(this.shellAndroid)return window.MobileInterface.postMessage(JSON.stringify(e));if(this.shellApple)return window.webkit.messageHandlers.int.postMessage(e)}catch(e){console.error("Failed to send shell message towards console",e)}}_doSendGenericMessage(e,t){let n={type:e,data:t};this.isMobile?this._postNativeShellMessage(n):console.warn("Failed to send generic message to console.",n)}_doSendProviderMessage(e){if(this.isMobile)this._postNativeShellMessage({type:"provider",data:e});else{if(!e.provider||!e.action)return;switch(e.provider.trim().toUpperCase()){case"PUSH":switch(e.action.trim().toUpperCase()){case"PROVIDER_INIT":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_INIT",provider:"push",version:"web",enabled:!0,disabled:!1,hasPermission:!0,requiresPermission:!1,success:!0}));break;case"PROVIDER_ENABLE":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_ENABLE",provider:"push",hasPermission:!0,success:!0}));break;default:throw Error("Unsupported provider '"+e.provider+"' and action '"+e.action+"'")}break;case"STORAGE":switch(e.action){case"PROVIDER_INIT":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_INIT",provider:"storage",version:"1.0.0",disabled:!1,enabled:!0,hasPermission:!0,requiresPermission:!1,success:!0}));break;case"PROVIDER_ENABLE":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_ENABLE",provider:"storage",hasPermission:!0,success:!0}));break;case"STORE":{let t=e.key?e.key.trim():null;if(!t||0===t.length)throw Error("Storage provider 'store' action requires a `key`");null===e.value?window.localStorage.removeItem(t):window.localStorage.setItem(t,JSON.stringify(e.value))}break;case"RETRIEVE":{let t=e.key?e.key.trim():null;if(!t||0===t.length)throw Error("Storage provider 'retrieve' action requires a `key`");let n=window.localStorage.getItem(t);if(null!==n)try{n=JSON.parse(n)}catch(e){}this._handleProviderResponse(JSON.stringify({action:"RETRIEVE",provider:"storage",key:t,value:n}))}break;default:throw Error("Unsupported provider '"+e.provider+"' and action '"+e.action+"'")}break;default:console.error("Unsupported provider: "+e.provider)}}}_handleProviderResponse(e){if(!e)return;let t=JSON.parse(e),n=t.provider,o=t.action,i=this._pendingProviderPromises[n+o];i&&(window.clearTimeout(i[1]),delete this._pendingProviderPromises[n+o],i[0].resolve(t));let r=this._providerMessageListeners[n+o];r&&r(t)}_callCompletedCallback(){let e=this._enableCompleteCallback;this._enableCompleteCallback=null,e&&window.setTimeout(()=>{e()},0)}static _createConsoleRegistration(){return{name:so.name,version:so.version,platform:so.os.toString(),apps:[],model:((so.manufacturer?so.manufacturer+" ":"")+(so.product?so.product:"")).trim()}}_initialiseProvider(e){return sn(this,void 0,void 0,function*(){let t;console.debug("Console: initialising provider '"+e+"'");try{t=yield this.sendProviderMessage({provider:e,action:"PROVIDER_INIT"},!0),this._registration.providers[e].version=t.version,this._registration.providers[e].requiresPermission=t.requiresPermission,this._registration.providers[e].hasPermission=t.hasPermission,this._registration.providers[e].success=t.success,this._registration.providers[e].enabled=t.enabled,this._registration.providers[e].disabled=t.disabled,this._registration.providers[e].data=t.data}catch(e){console.error(e),t={action:"",disabled:!1,enabled:!1,hasPermission:!1,provider:"",requiresPermission:!1,version:"",success:!1}}if(t.success||(console.debug("Provider initialisation failed: '"+e+"'"),t.disabled=!0,this._registration.providers[e].disabled=!0),t.disabled||t.enabled){let t=this._pendingProviderEnables.indexOf(e);t>=0&&this._pendingProviderEnables.splice(t,1)}})}}function sr(e,t){return function(){return e.apply(t,arguments)}}let{toString:sa}=Object.prototype,{getPrototypeOf:ss}=Object,{iterator:sd,toStringTag:sl}=Symbol,sc=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),su=e=>"string"==typeof e&&("__proto__"===e||"constructor"===e||"prototype"===e),sm=(e,t,n)=>e===Object.prototype||!n&&null===t,sh=(e,t)=>{let n=e,o=[];for(;null!=n&&-1===o.indexOf(n);){o.push(n);let i=ss(n);if(sm(n,i,n===e))break;if(sc(n,t))return!0;n=i}return!1},sf=(r=Object.create(null),e=>{let t=sa.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())}),sb=e=>(e=e.toLowerCase(),t=>sf(t)===e),sp=e=>t=>typeof t===e,{isArray:s_}=Array,sg=sp("undefined");function sF(e){return null!==e&&!sg(e)&&null!==e.constructor&&!sg(e.constructor)&&sw(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}let sy=sb("ArrayBuffer"),sv=sp("string"),sw=sp("function"),sk=sp("number"),sE=e=>null!==e&&"object"==typeof e,sD=e=>{if(!sE(e))return!1;let t=ss(e);return(null===t||t===Object.prototype||null===ss(t))&&!sh(e,sl)&&!sh(e,sd)},sM=sb("Date"),sL=sb("File"),sC=sb("Blob"),sA=sb("FileList"),sT=sb("Set"),sx="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},sS=void 0!==sx.FormData?sx.FormData:void 0,sY=sb("URLSearchParams"),[sO,sI,sP,sB]=["ReadableStream","Request","Response","Headers"].map(sb);function sR(e,t,{allOwnKeys:n=!1}={}){let o,i;if(null!=e)if("object"!=typeof e&&(e=[e]),s_(e))for(o=0,i=e.length;o<i;o++)t.call(null,e[o],o,e);else{let i;if(sF(e))return;let r=n?Object.getOwnPropertyNames(e):Object.keys(e),a=r.length;for(o=0;o<a;o++)i=r[o],t.call(null,e[i],i,e)}}function sN(e,t){let n;if(sF(e))return null;t=t.toLowerCase();let o=Object.keys(e),i=o.length;for(;i-- >0;)if(t===(n=o[i]).toLowerCase())return n;return null}let sj="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,sH=e=>!sg(e)&&e!==sj,sU=(a="u">typeof Uint8Array&&ss(Uint8Array),e=>a&&e instanceof a),sz=sb("HTMLFormElement"),{propertyIsEnumerable:s$}=Object.prototype,sW=sb("RegExp"),sV=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),o={};sR(n,(n,i)=>{let r;!1!==(r=t(n,i,e))&&(o[i]=r||n)}),Object.defineProperties(e,o)},sq=sb("AsyncFunction"),sG=(l="function"==typeof setImmediate,c=sw(sj.postMessage),l?setImmediate:c?(u=`axios@${Math.random()}`,m=[],sj.addEventListener("message",({source:e,data:t})=>{e===sj&&t===u&&m.length&&m.shift()()},!1),e=>{m.push(e),sj.postMessage(u,"*")}):e=>setTimeout(e)),sK="u">typeof queueMicrotask?queueMicrotask.bind(sj):"u">typeof process&&process.nextTick||sG,sJ=e=>null!=e&&sw(e[sd]),sX={isArray:s_,isArrayBuffer:sy,isBuffer:sF,isFormData:e=>{if(!e)return!1;if(sS&&e instanceof sS)return!0;let t=ss(e);if(!t||t===Object.prototype||!sw(e.append))return!1;let n=sf(e);return"formdata"===n||"object"===n&&sw(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&sy(e.buffer)},isString:sv,isNumber:sk,isBoolean:e=>!0===e||!1===e,isObject:sE,isPlainObject:sD,isEmptyObject:e=>{if(!sE(e)||sF(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:sO,isRequest:sI,isResponse:sP,isHeaders:sB,isUndefined:sg,isDate:sM,isFile:sL,isReactNativeBlob:e=>!!(e&&void 0!==e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:sC,isRegExp:sW,isFunction:sw,isStream:e=>sE(e)&&sw(e.pipe),isURLSearchParams:sY,isTypedArray:sU,isFileList:sA,forEach:sR,merge:function e(...t){let{caseless:n,skipUndefined:o}=sH(this)&&this||{},i={},r=(t,r)=>{if("__proto__"===r||"constructor"===r||"prototype"===r)return;let a=n&&"string"==typeof r&&sN(i,r)||r,s=sc(i,a)?i[a]:void 0;sD(s)&&sD(t)?i[a]=e(s,t):sD(t)?i[a]=e({},t):s_(t)?i[a]=t.slice():o&&sg(t)||(i[a]=t)};for(let e=0,n=t.length;e<n;e++){let n=t[e];if(!n||sF(n)||(sR(n,r),"object"!=typeof n||s_(n)))continue;let o=Object.getOwnPropertySymbols(n);for(let e=0;e<o.length;e++){let t=o[e];s$.call(n,t)&&r(n[t],t)}}return i},extend:(e,t,n,{allOwnKeys:o}={})=>(sR(t,(t,o)=>{n&&sw(t)?Object.defineProperty(e,o,{__proto__:null,value:sr(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,o)=>{let i,r,a,s={};if(t=t||{},null==e)return t;do{for(r=(i=Object.getOwnPropertyNames(e)).length;r-- >0;)a=i[r],(!o||o(a,e,t))&&!s[a]&&(t[a]=e[a],s[a]=!0);e=!1!==n&&ss(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:sf,kindOfTest:sb,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;let o=e.indexOf(t,n);return -1!==o&&o===n},toArray:e=>{if(!e)return null;if(s_(e))return e;let t=e.length;if(!sk(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{let n,o=(e&&e[sd]).call(e);for(;(n=o.next())&&!n.done;){let o=n.value;t.call(e,o[0],o[1])}},matchAll:(e,t)=>{let n,o=[];for(;null!==(n=e.exec(t));)o.push(n);return o},isHTMLForm:sz,hasOwnProperty:sc,hasOwnProp:sc,hasOwnInPrototypeChain:sh,getSafeProp:(e,t)=>null!=e&&sh(e,t)?e[t]:void 0,toSafeFlatObject:e=>{if(null==e||"object"!=typeof e&&"function"!=typeof e)return e;let t=ss(e);if(null===t&&(e=>{if(!Object.isExtensible(e))return!1;let t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push(...Object.getOwnPropertySymbols(e)),t.every(t=>{if(su(t))return!1;let n=Object.getOwnPropertyDescriptor(e,t);return!!n&&n.configurable&&!0===n.writable})})(e))return e;let n=Object.create(null),o=Object.create(null),i=[],r=e;for(;null!=r&&-1===i.indexOf(r);){i.push(r);let a=r===e?t:ss(r);if(sm(r,a,r===e))break;let s=Object.getOwnPropertyNames(r);for(let t of(Object.getOwnPropertySymbols&&s.push(...Object.getOwnPropertySymbols(r)),s))!su(t)&&(sc(o,t)||(n[t]=e[t],o[t]=!0));r=a}return n},reduceDescriptors:sV,freezeMethods:e=>{sV(e,(t,n)=>{if(sw(e)&&["arguments","caller","callee"].includes(n))return!1;if(sw(e[n])){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},toObjectSet:(e,t)=>{let n={};return(s_(e)?e:String(e).split(t)).forEach(e=>{n[e]=!0}),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e*=1)?e:t,findKey:sN,global:sj,isContextDefined:sH,isSpecCompliantForm:function(e){return!!(e&&sw(e.append)&&"FormData"===e[sl]&&e[sd])},toJSONObject:e=>{let t=new WeakSet,n=e=>{if(sE(e)){if(t.has(e))return;if(sF(e))return e;if(!("toJSON"in e)){let o;if(t.add(e),sT(e))for(let t of(o=[],e)){let e=n(t);sg(e)||o.push(e)}else o=s_(e)?[]:{},sR(e,(e,t)=>{let i=n(e);sg(i)||(o[t]=i)});return t.delete(e),o}}return e};return n(e)},isAsyncFn:sq,isThenable:e=>e&&(sE(e)||sw(e))&&sw(e.then)&&sw(e.catch),setImmediate:sG,asap:sK,isIterable:sJ,isSafeIterable:e=>null!=e&&sh(e,sd)&&sJ(e)},sQ=sX.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),sZ=RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),s0=RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function s1(e,t){return sX.isArray(e)?e.map(e=>s1(e,t)):function(e){let t=0,n=e.length;for(;t<n;){let n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){let t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function s2(e){let t=Object.create(null);return sX.forEach(e.toJSON(),(e,n)=>{t[n]=s1(e,s0)}),t}let s4=Symbol("internals");function s3(e){return e&&String(e).trim().toLowerCase()}function s5(e){return!1===e||null==e?e:sX.isArray(e)?e.map(s5):s1(String(e),sZ)}let s6=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function s8(e){let t=0,n=e.length;for(;t<n;){let n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){let t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}function s7(e,t,n,o,i){if(sX.isFunction(o))return o.call(this,t,n);if(i&&(t=n),sX.isString(t)){if(sX.isString(o))return -1!==t.indexOf(o);if(sX.isRegExp(o))return o.test(t)}}class s9{constructor(e){e&&this.set(e)}set(e,t,n){let o=this;function i(e,t,n){let i=s3(t);if(!i)return;let r=sX.findKey(o,i);r&&void 0!==o[r]&&!0!==n&&(void 0!==n||!1===o[r])||(o[r||t]=s5(e))}let r=(e,t)=>sX.forEach(e,(e,n)=>i(e,n,t));if(sX.isPlainObject(e)||e instanceof this.constructor)r(e,t);else{let o;if(sX.isString(e)&&(e=e.trim())&&(o=e,!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(o.trim()))){var a;let n,o,i,s;r((s={},(a=e)&&a.split("\n").forEach(function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),o=e.substring(i+1).trim();let t=sX.hasOwnProp(s,n);!n||t&&sX.hasOwnProp(sQ,n)||("set-cookie"===n?t?s[n].push(o):s[n]=[o]:s[n]=t?s[n]+", "+o:o)}),s),t)}else if(sX.isObject(e)&&sX.isSafeIterable(e)){let n=Object.create(null),o,i;for(let t of e){if(!sX.isArray(t))throw TypeError("Object iterator must return a key-value pair");i=t[0],sX.hasOwnProp(n,i)?(o=n[i],n[i]=sX.isArray(o)?[...o,t[1]]:[o,t[1]]):n[i]=t[1]}r(n,t)}else null!=e&&i(t,e,n)}return this}get(e,t){if(e=s3(e)){let n=sX.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(!0===t){let t,n=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;t=o.exec(e);)n[t[1]]=t[2];return n}if(sX.isFunction(t))return t.call(this,e,n);if(sX.isRegExp(t))return t.exec(e);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=s3(e)){let n=sX.findKey(this,e);return!!(n&&void 0!==this[n]&&(!t||s7(this,this[n],n,t)))}return!1}delete(e,t){let n=this,o=!1;function i(e){if(e=s3(e)){let i=sX.findKey(n,e);i&&(!t||s7(n,n[i],i,t))&&(delete n[i],o=!0)}}return sX.isArray(e)?e.forEach(i):i(e),o}clear(e){let t=Object.keys(this),n=t.length,o=!1;for(;n--;){let i=t[n];(!e||s7(this,this[i],i,e,!0))&&(delete this[i],o=!0)}return o}normalize(e){let t=this,n={};return sX.forEach(this,(o,i)=>{let r=sX.findKey(n,i);if(r){t[r]=s5(o),delete t[i];return}let a=e?i.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n):String(i).trim();a!==i&&delete t[i],t[a]=s5(o),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return sX.forEach(this,(n,o)=>{null!=n&&!1!==n&&(t[o]=e&&sX.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){let e=this.get("set-cookie");return sX.isArray(e)?e:null==e||!1===e?[]:[e]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static parseParameters(e){return function(e){let t=Object.create(null),n=String(e),o=0,i=!1,r=!1;function a(e){let i=s8(n.slice(o,e)),r=i.indexOf("=");if(r<1)return;let a=s8(i.slice(0,r));if(!s6.test(a))return;let s=a.toLowerCase();if("__proto__"===s||"constructor"===s||"prototype"===s)return;let d=s8(i.slice(r+1));t[s]=function(e){let t=e.length-1;if(t<1||34!==e.charCodeAt(0)||34!==e.charCodeAt(t))return e;let n="";for(let o=1;o<t;o++){let i=e.charCodeAt(o);if(34===i||92===i&&(o+=1)>=t)return e;n+=e[o]}return n}(d)}for(let e=0;e<n.length;e++){let t=n.charCodeAt(e);i?r?r=!1:92===t?r=!0:34===t&&(i=!1):34===t?i=!0:(44===t||59===t)&&(a(e),o=e+1)}return a(n.length),t}(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[s4]=this[s4]={accessors:{}}).accessors,n=this.prototype;function o(e){let o=s3(e);if(!t[o]){let i;i=sX.toCamelCase(" "+e),["get","set","has"].forEach(t=>{Object.defineProperty(n,t+i,{__proto__:null,value:function(n,o,i){return this[t].call(this,e,n,o,i)},configurable:!0})}),t[o]=!0}}return sX.isArray(e)?e.forEach(o):o(e),this}}s9.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),sX.reduceDescriptors(s9.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),sX.freezeMethods(s9);let de="[REDACTED ****]";function dt(e){try{return String(e)}catch(e){return""}}class dn extends Error{static from(e,t,n,o,i,r){let a=e.message;!a&&sX.isArray(e.errors)&&e.errors.length&&(a=e.errors.map(e=>{try{return e&&e.message?dt(e.message):dt(e)}catch(e){return""}}).filter(Boolean).join("; ")||e.name||"AggregateError");let s=new dn(a,t||e.code,n,o,i);return Object.defineProperty(s,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),s.name=e.name,null!=e.status&&null==s.status&&(s.status=e.status),r&&Object.assign(s,r),s}constructor(e,t,n,o,i){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),o&&(this.request=o),i&&(this.response=i,this.status=i.status)}toJSON(){let e,t,n,o=this.config,i=o&&sX.hasOwnProp(o,"redact")?o.redact:void 0,r=sX.isArray(i)&&i.length>0?(e=new Set(i.map(e=>String(e).toLowerCase())),t=[],(n=o=>{let i;if(null===o||"object"!=typeof o||sX.isBuffer(o))return o;if(-1===t.indexOf(o)){if(o instanceof s9&&(o=o.toJSON()),t.push(o),sX.isArray(o))i=[],o.forEach((e,t)=>{let o=n(e);sX.isUndefined(o)||(i[t]=o)});else{if(!sX.isPlainObject(o)&&function(e){if(sX.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(sX.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(o))return t.pop(),o;for(let[t,r]of(i=Object.create(null),Object.entries(o))){let o=e.has(t.toLowerCase())?de:n(r);sX.isUndefined(o)||(i[t]=o)}}return t.pop(),i}})(o)):sX.toJSONObject(o);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:r,code:this.code,status:this.status}}}dn.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",dn.ERR_BAD_OPTION="ERR_BAD_OPTION",dn.ECONNABORTED="ECONNABORTED",dn.ETIMEDOUT="ETIMEDOUT",dn.ECONNREFUSED="ECONNREFUSED",dn.ERR_NETWORK="ERR_NETWORK",dn.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",dn.ERR_DEPRECATED="ERR_DEPRECATED",dn.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",dn.ERR_BAD_REQUEST="ERR_BAD_REQUEST",dn.ERR_CANCELED="ERR_CANCELED",dn.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",dn.ERR_INVALID_URL="ERR_INVALID_URL",dn.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";let di=dn;function dr(e){return sX.isPlainObject(e)||sX.isArray(e)}function da(e){return sX.endsWith(e,"[]")?e.slice(0,-2):e}function ds(e,t,n){return e?e.concat(t).map(function(e,t){return e=da(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}let dd=sX.toFlatObject(sX,{},null,function(e){return/^is[A-Z]/.test(e)}),dl=function(e,t,n){if(!sX.isObject(e))throw TypeError("target must be an object");t=t||new FormData;let o=(e,t)=>{let o=sX.getSafeProp(n,e);return sX.isUndefined(o)?t:o},i=o("metaTokens",!0),r=o("visitor")||f,a=o("dots",!1),s=o("indexes",!1),d=o("Blob")||"u">typeof Blob&&Blob,l=o("maxDepth",100),c=d&&sX.isSpecCompliantForm(t),u=[];if(!sX.isFunction(r))throw TypeError("visitor must be a function");function m(e){if(null===e)return"";if(sX.isDate(e))return e.toISOString();if(sX.isBoolean(e))return e.toString();if(!c&&sX.isBlob(e))throw new di("Blob is not supported. Use a Buffer instead.");if(sX.isArrayBuffer(e)||sX.isTypedArray(e)){if(c&&"function"==typeof d)return new d([e]);throw new di("Blob is not supported. Use a Buffer instead.",di.ERR_NOT_SUPPORT)}return e}function h(e){if(e>l)throw new di("Object is too deeply nested ("+e+" levels). Max depth: "+l,di.ERR_FORM_DATA_DEPTH_EXCEEDED)}function f(e,n,o){let r=e;if(sX.isReactNative(t)&&sX.isReactNativeBlob(e))return t.append(ds(o,n,a),m(e)),!1;if(e&&!o&&"object"==typeof e)if(sX.endsWith(n,"{}"))n=i?n:n.slice(0,-2),e=function(e){if(1/0===l)return JSON.stringify(e);let t=[];return JSON.stringify(e,function(e,n){if(!sX.isObject(n))return n;for(;t.length&&t[t.length-1]!==this;)t.pop();return t.push(n),h(1+t.length-1),n})}(e);else{var d;if(sX.isArray(e)&&(d=e,sX.isArray(d)&&!d.some(dr))||(sX.isFileList(e)||sX.endsWith(n,"[]"))&&(r=sX.toArray(e)))return n=da(n),r.forEach(function(e,o){sX.isUndefined(e)||null===e||t.append(!0===s?ds([n],o,a):null===s?n:n+"[]",m(e))}),!1}return!!dr(e)||(t.append(ds(o,n,a),m(e)),!1)}let b=Object.assign(dd,{defaultVisitor:f,convertValue:m,isVisitable:dr});if(!sX.isObject(e))throw TypeError("data must be an object");return!function e(n,o,i=0){if(!sX.isUndefined(n)){if(h(i),-1!==u.indexOf(n))throw Error("Circular reference detected in "+o.join("."));u.push(n),sX.forEach(n,function(n,a){!0===(!(sX.isUndefined(n)||null===n)&&r.call(t,n,sX.isString(a)?a.trim():a,o,b))&&e(n,o?o.concat(a):[a],i+1)}),u.pop()}}(e),t};function dc(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function du(e,t){this._pairs=[],e&&dl(e,this,t)}let dm=du.prototype;function dh(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function df(e,t,n){let o;if(!t)return e;e=e||"";let i=sX.isFunction(n)?{serialize:n}:n,r=sX.getSafeProp(i,"encode")||dh,a=sX.getSafeProp(i,"serialize");if(o=a?a(t,i):sX.isURLSearchParams(t)?t.toString():new du(t,i).toString(r)){let t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}dm.append=function(e,t){this._pairs.push([e,t])},dm.toString=function(e){let t=e?t=>e.call(this,t,dc):dc;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};let db=Symbol("internals");function dp(e){return e?e.length:0}function d_(e){if(e)for(;e.length&&null===e[e.length-1];)e.pop()}function dg(e,t){let n=e.handlers,o=dp(n);n!==t.handlersRef?(t.handlersRef=n,t.handlerEntries.clear()):o!==t.handlersLength&&(o?t.handlerEntries.forEach(function(e,o){n[e.index]!==e.handler&&t.handlerEntries.delete(o)}):t.handlerEntries.clear()),t.handlersLength=o}let dF=class{constructor(){this.handlers=[],this[db]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(e,t,n){let o={fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null},i=this[db];null==this.handlers&&(this.handlers=[]),dg(this,i);let r=i.nextId++;return this.handlers.push(o),i.handlerEntries.set(r,{handler:o,index:this.handlers.length-1}),i.handlersLength=this.handlers.length,r}eject(e){let t=this[db];dg(this,t);let n=t.handlerEntries.get(e);if(n){if(t.handlerEntries.delete(e),this.handlers[n.index]!==n.handler)return;this.handlers[n.index]=null,t.iterationDepth||(d_(this.handlers),t.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],dg(this,this[db]))}forEach(e){let t=this[db];dg(this,t),t.iterationDepth++;try{sX.forEach(this.handlers,function(t){null!==t&&e(t)})}finally{--t.iterationDepth||(dg(this,t),d_(this.handlers),t.handlersLength=dp(this.handlers))}}},dy={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},dv="u">typeof URLSearchParams?URLSearchParams:du,dw="u">typeof FormData?FormData:null,dk="u">typeof Blob?Blob:null,dE="u">typeof window&&"u">typeof document,dD="object"==typeof navigator&&navigator||void 0,dM=dE&&(!dD||0>["ReactNative","NativeScript","NS"].indexOf(dD.product)),dL="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,dC=dE&&window.location.href||"http://localhost",dA={...tS,isBrowser:!0,classes:{URLSearchParams:dv,FormData:dw,Blob:dk},protocols:["http","https","file","blob","url","data"]};function dT(e){if(e>100)throw new di("FormData field is too deeply nested ("+e+" levels). Max depth: 100",di.ERR_FORM_DATA_DEPTH_EXCEEDED)}let dx=function(e){if(sX.isFormData(e)&&sX.isFunction(e.entries)){let t={};return sX.forEachEntry(e,(e,n)=>{!function e(t,n,o,i){dT(i);let r=t[i++];if("__proto__"===r)return!0;let a=Number.isFinite(+r),s=i>=t.length;return(r=!r&&sX.isArray(o)?o.length:r,s)?sX.hasOwnProp(o,r)?o[r]=sX.isArray(o[r])?o[r].concat(n):[o[r],n]:o[r]=n:(sX.hasOwnProp(o,r)&&sX.isObject(o[r])||(o[r]=[]),e(t,n,o[r],i)&&sX.isArray(o[r])&&(o[r]=function(e){let t,n,o={},i=Object.keys(e),r=i.length;for(t=0;t<r;t++)o[n=i[t]]=e[n];return o}(o[r]))),!a}(function(e){let t,n=[],o=/[^.[\]]+|\[([^.[\]]*)]/g;for(;null!==(t=o.exec(e));)dT(n.length),n.push("[]"===t[0]?"":t[1]||t[0]);return n}(e),n,t,0)}),t}return null},dS=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),dY=(e,t)=>null!=e&&sX.hasOwnProp(e,t)?e[t]:void 0,dO={transitional:dy,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let n,o=t.getContentType()||"",i=o.indexOf("application/json")>-1,r=sX.isObject(e);if(r&&sX.isHTMLForm(e)&&(e=new FormData(e)),sX.isFormData(e))return i?JSON.stringify(dx(e)):e;if(sX.isArrayBuffer(e)||sX.isBuffer(e)||sX.isStream(e)||sX.isFile(e)||sX.isBlob(e)||sX.isReadableStream(e))return e;if(sX.isArrayBufferView(e))return e.buffer;if(sX.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(r){let t=dY(this,"formSerializer");if(o.indexOf("application/x-www-form-urlencoded")>-1)return dl(e,new dA.classes.URLSearchParams,{visitor:function(e,t,n,o){return dA.isNode&&sX.isBuffer(e)?(this.append(t,e.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t}).toString();if((n=sX.isFileList(e))||o.indexOf("multipart/form-data")>-1){let o=dY(this,"env"),i=o&&o.FormData;return dl(n?{"files[]":e}:e,i&&new i,t)}}if(r||i){t.setContentType("application/json",!1);var a=e;if(sX.isString(a))try{return(0,JSON.parse)(a),sX.trim(a)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(a)}return e}],transformResponse:[function(e){let t=dY(this,"transitional")||dO.transitional,n=t&&t.forcedJSONParsing,o=dY(this,"responseType"),i="json"===o;if(sX.isResponse(e)||sX.isReadableStream(e))return e;if(e&&sX.isString(e)&&(n&&!o||i)){let n=t&&t.silentJSONParsing;try{return JSON.parse(e,dY(this,"parseReviver"))}catch(e){if(!n&&i){if("SyntaxError"===e.name)throw di.from(e,di.ERR_BAD_RESPONSE,this,null,dY(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:dA.classes.FormData,Blob:dA.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function dI(e,t){let n=this||dO,o=t||n,i=s9.from(o.headers),r=o.data;return sX.forEach(e,function(e){r=e.call(n,r,i.normalize(),t?t.status:void 0)}),i.normalize(),r}function dP(e){return!!(e&&e.__CANCEL__)}sX.forEach(dS,e=>{dO.headers[e]={}});let dB=class extends di{constructor(e,t,n){super(null==e?"canceled":e,di.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function dR(e,t,n){let o=n.config.validateStatus;!n.status||!o||o(n.status)?e(n):t(new di("Request failed with status code "+n.status,n.status>=400&&n.status<500?di.ERR_BAD_REQUEST:di.ERR_BAD_RESPONSE,n.config,n.request,n))}let dN=/[\t\n\r]/g;function dj(e){if("string"!=typeof e)return e;let t=0;for(;t<e.length&&32>=e.charCodeAt(t);)t++;return e.slice(t).replace(dN,"")}function dH(e){let t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}let dU=function(e,t){let n,o=Array(e=e||10),i=Array(e),r=0,a=0;return t=void 0!==t?t:1e3,function(s){let d=Date.now(),l=i[a];n||(n=d),o[r]=s,i[r]=d;let c=a,u=0;for(;c!==r;)u+=o[c++],c%=e;if((r=(r+1)%e)===a&&(a=(a+1)%e),d-n<t)return;let m=l&&d-l;return m?Math.round(1e3*u/m):void 0}},dz=function(e,t){let n,o,i=0,r=1e3/t,a=(t,r=Date.now())=>{i=r,n=null,o&&(clearTimeout(o),o=null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-i;s>=r?a(e,t):(n=e,o||(o=setTimeout(()=>{o=null,a(n)},r-s)))},()=>n&&a(n),(...e)=>a(e)]},d$=(e,t,n=3)=>{let o=0,i=dU(50,250);return dz(n=>{if(!n||!sX.isNumber(n.loaded))return;let r=n.loaded,a=n.lengthComputable?n.total:void 0,s=Math.max(0,null!=a?Math.min(r,a):r),d=Math.max(0,s-o),l=i(d);o=Math.max(o,s),e({loaded:s,total:a,progress:a?s/a:void 0,bytes:d,rate:l||void 0,estimated:l&&a?(a-s)/l:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})},n)},dW=(e,t)=>{let n=null!=e;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},dV=(e,t=sX.asap)=>(...n)=>t(()=>e(...n)),dq=dA.hasStandardBrowserEnv?(s=new URL(dA.origin),d=dA.navigator&&/(msie|trident)/i.test(dA.navigator.userAgent),e=>(e=new URL(e,dA.origin),s.protocol===e.protocol&&s.host===e.host&&(d||s.port===e.port))):()=>!0,dG=dA.hasStandardBrowserEnv?{write(e,t,n,o,i,r,a){if("u"<typeof document)return;let s=[`${e}=${encodeURIComponent(t)}`];sX.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),sX.isString(o)&&s.push(`path=${o}`),sX.isString(i)&&s.push(`domain=${i}`),!0===r&&s.push("secure"),sX.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if("u"<typeof document)return null;let t=document.cookie.split(";");for(let n=0;n<t.length;n++){let o=t[n].replace(/^\s+/,""),i=o.indexOf("=");if(-1!==i&&o.slice(0,i)===e)try{return decodeURIComponent(o.slice(i+1))}catch(e){return o.slice(i+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}},dK=/^https?:(?!\/\/)/i;function dJ(e,t){if("string"==typeof e){let o=dj(e);if(dK.test(o)){var n;let e,i,r;throw new di(`Invalid URL ${JSON.stringify((r=(-1===(i=(e=o.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${de}@`)).indexOf("#"))?e:e.slice(0,i)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${de}`),-1===i?r:`${r}#${!(n=e.slice(i+1))?n:n.replace(/(^|&)([^=&]*=)?[^&]+/g,(e,t,n="")=>`${t}${n}${de}`)}`))}: missing "//" after protocol`,di.ERR_INVALID_URL,t)}}}function dX(e,t,n,o){dJ(t,o);let i=!("string"==typeof t&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t));if(e&&(i||!1===n)){dJ(e,o);if(!t)return e;let n=e.length;for(;n>0&&47===e.charCodeAt(n-1);)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}return t}let dQ=e=>e instanceof s9?{...e}:e;function dZ(e,t){var n;e=e||{},t=t||{};let o=Object.create(null);function i(e,t,n,o){return sX.isPlainObject(e)&&sX.isPlainObject(t)?sX.merge.call({caseless:o},e,t):sX.isPlainObject(t)?sX.merge({},t):sX.isArray(t)?t.slice():t}function r(e,t,n,o){return sX.isUndefined(t)?sX.isUndefined(e)?void 0:i(void 0,e,n,o):i(e,t,n,o)}function a(e,t){if(!sX.isUndefined(t))return i(void 0,t)}function s(e,t){return sX.isUndefined(t)?sX.isUndefined(e)?void 0:i(void 0,e):i(void 0,t)}function d(n,o,r){return sX.hasOwnProp(t,r)?i(n,o):sX.hasOwnProp(e,r)?i(void 0,n):void 0}Object.defineProperty(o,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});let l={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutErrorMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,allowedSocketPaths:s,responseEncoding:s,validateStatus:d,headers:(e,t,n)=>r(dQ(e),dQ(t),n,!0)};return sX.forEach((n={...e,...t},Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(n).concat(Object.getOwnPropertySymbols(n).filter(e=>Object.getOwnPropertyDescriptor(n,e).enumerable)):Object.keys(n)),function(n){if("__proto__"===n||"constructor"===n||"prototype"===n)return;let i=sX.hasOwnProp(l,n)?l[n]:r,a=i(sX.hasOwnProp(e,n)?e[n]:void 0,sX.hasOwnProp(t,n)?t[n]:void 0,n);sX.isUndefined(a)&&i!==d||(o[n]=a)}),sX.hasOwnProp(t,"validateStatus")&&sX.isUndefined(t.validateStatus)&&!1===function(n){let o=sX.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!sX.isUndefined(o)){if(!sX.isPlainObject(o))return;else if(sX.hasOwnProp(o,n))return o[n]}let i=sX.hasOwnProp(e,"transitional")?e.transitional:void 0;if(sX.isPlainObject(i)&&sX.hasOwnProp(i,n))return i[n]}("validateStatusUndefinedResolves")&&(sX.hasOwnProp(e,"validateStatus")?o.validateStatus=i(void 0,e.validateStatus):delete o.validateStatus),o}let d0=["content-type","content-length"],d1=function(e){let t=dZ({},e),n=e=>sX.hasOwnProp(t,e)?t[e]:void 0,o=n("data"),i=n("withXSRFToken"),r=n("xsrfHeaderName"),a=n("xsrfCookieName"),s=n("headers"),d=n("auth"),l=n("baseURL"),c=n("allowAbsoluteUrls"),u=n("url");if(t.headers=s=s9.from(s),t.url=df(dX(l,u,c,t),n("params"),n("paramsSerializer")),d){let t=sX.getSafeProp(d,"username")||"",n=sX.getSafeProp(d,"password")||"";try{s.set("Authorization","Basic "+btoa(t+":"+(n?encodeURIComponent(n).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))):"")))}catch(t){throw di.from(t,di.ERR_BAD_OPTION_VALUE,e)}}if(sX.isFormData(o)){let e=sX.getSafeProp(o,"getHeaders");if(dA.hasStandardBrowserEnv||dA.hasStandardBrowserWebWorkerEnv||sX.isReactNative(o))s.setContentType(void 0);else{var m,h;sX.isFunction(e)&&(m=s,h=e.call(o),"content-only"!==n("formDataHeaderPolicy")?m.set(h):Object.entries(h||{}).forEach(([e,t])=>{d0.includes(e.toLowerCase())&&m.set(e,t)}))}}if(dA.hasStandardBrowserEnv&&(sX.isFunction(i)&&(i=i(t)),!0===i||null==i&&dq(t.url))){let e=r&&a&&dG.read(a);e&&s.set(r,e)}return t},d2="u">typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){let o,i,r,a,s,d,l=d1(e),c=l.data,u=s9.from(l.headers).normalize(),{responseType:m,onUploadProgress:h,onDownloadProgress:f}=l;function b(){a&&a(),s&&s(),l.cancelToken&&l.cancelToken.unsubscribe(o),l.signal&&l.signal.removeEventListener("abort",o)}let p=new XMLHttpRequest;function _(o){if(!p)return;if(0===p.status&&"file"!==(dH(dj(l.url))||dH(dA.origin))&&!(p.responseURL&&p.responseURL.startsWith("file:"))){n(new di("Request aborted",di.ECONNABORTED,e,p)),b(),p=null;return}try{o?d&&d(o):s&&s()}catch(e){setTimeout(()=>{throw e})}if(!p)return;let i=s9.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders());dR(function(e){t(e),b()},function(e){n(e),b()},{data:m&&"text"!==m&&"json"!==m?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:i,config:e,request:p}),p=null}p.open(l.method.toUpperCase(),l.url,!0),p.timeout=l.timeout,"onloadend"in p?p.onloadend=_:p.onreadystatechange=function(){!p||4!==p.readyState||(0!==p.status||p.responseURL&&p.responseURL.startsWith("file:"))&&setTimeout(_)},p.onabort=function(){p&&(n(new di("Request aborted",di.ECONNABORTED,e,p)),b(),p=null)},p.onerror=function(t){let o=new di(t&&t.message?t.message:"Network Error",di.ERR_NETWORK,e,p);o.event=t||null,n(o),b(),p=null},p.ontimeout=function(){let t=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded",o=l.transitional||dy;l.timeoutErrorMessage&&(t=l.timeoutErrorMessage),n(new di(t,o.clarifyTimeoutError?di.ETIMEDOUT:di.ECONNABORTED,e,p)),b(),p=null},void 0===c&&u.setContentType(null),"setRequestHeader"in p&&sX.forEach(s2(u),function(e,t){p.setRequestHeader(t,e)}),sX.isUndefined(l.withCredentials)||(p.withCredentials=!!l.withCredentials),m&&"json"!==m&&(p.responseType=l.responseType),f&&([r,s,d]=d$(f,!0),p.addEventListener("progress",r)),h&&p.upload&&([i,a]=d$(h),p.upload.addEventListener("progress",i),p.upload.addEventListener("loadend",a)),(l.cancelToken||l.signal)&&(o=t=>{p&&(n(!t||t.type?new dB(null,e,p):t),p.abort(),b(),p=null)},l.cancelToken&&l.cancelToken.subscribe(o),l.signal&&(l.signal.aborted?o():l.signal.addEventListener("abort",o)));let g=dH(l.url);if(g&&!dA.protocols.includes(g)){n(new di("Unsupported protocol "+g+":",di.ERR_BAD_REQUEST,e)),b();return}p.send(c||null)})},d4=function*(e,t){let n,o=e.byteLength;if(!t||o<t)return void(yield e);let i=0;for(;i<o;)n=i+t,yield e.slice(i,n),i=n},d3=async function*(e,t){for await(let n of d5(e))yield*d4(n,t)},d5=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},d6=(e,t,n,o)=>{let i,r=d3(e,t),a=0,s=e=>{!i&&(i=!0,o&&o(e))};return new ReadableStream({async pull(e){try{let{done:t,value:o}=await r.next();if(t){s(),e.close();return}let i=o.byteLength;if(n){let e=a+=i;n(e)}e.enqueue(new Uint8Array(o))}catch(e){throw s(e),e}},cancel:e=>(s(e),r.return())},{highWaterMark:2})},d8=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,d7=(e,t,n)=>t+2<n&&d8(e.charCodeAt(t+1))&&d8(e.charCodeAt(t+2)),d9=e=>e<=57?e-48:(223&e)-55,le=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||43===e||47===e||45===e||95===e,lt=e=>9===e||10===e||12===e||13===e||32===e,ln=e=>{var t;let n,o,i=e.length,r=0,a=0,s=!1;for(let t=0;t<i;t++){let n=e.charCodeAt(t);if(37===n&&d7(e,t,i)&&(n=16*d9(e.charCodeAt(t+1))+d9(e.charCodeAt(t+2)),t+=2),!lt(n)){if(61===n){a++;continue}if(!le(n)||a>0){s=!0;continue}r++}}if(s||a>2||a>0&&(r+a)%4!=0||r%4==1){let t,n;return t=e.length,n=0,t>0&&61===e.charCodeAt(t-1)&&(n++,t>1&&61===e.charCodeAt(t-2)&&n++),Math.floor((t-n)*3/4)}return n=Math.floor((t=r)/4),3*n+(2==(o=t%4)?1:2*(3===o))},lo={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},{isFunction:li}=sX,lr=e=>{if(!sX.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},la=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},ls=e=>{let t,n=void 0!==sX.global&&null!==sX.global?sX.global:globalThis,{ReadableStream:o,TextEncoder:i}=n,{fetch:r,Request:a,Response:s}=e=sX.merge.call({skipUndefined:!0},{Request:n.Request,Response:n.Response},e),d=r?li(r):"function"==typeof fetch,l=li(a),c=li(s);if(!d)return!1;let u=d&&li(o),m=d&&("function"==typeof i?(t=new i,e=>t.encode(e)):async e=>new Uint8Array(await new a(e).arrayBuffer())),h=l&&u&&la(()=>{let e=!1,t=new a(dA.origin,{body:new o,method:"POST",get duplex(){return e=!0,"half"}}),n=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!n}),f=c&&u&&la(()=>sX.isReadableStream(new s("").body)),b={stream:f&&(e=>e.body)};d&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{b[e]||(b[e]=(t,n)=>{let o=t&&t[e];if(o)return o.call(t);throw new di(`Response type '${e}' is not supported`,di.ERR_NOT_SUPPORT,n)})});let p=async e=>{if(null==e)return 0;if(sX.isBlob(e))return e.size;if(sX.isSpecCompliantForm(e)){let t=new a(dA.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return sX.isArrayBufferView(e)||sX.isArrayBuffer(e)?e.byteLength:(sX.isURLSearchParams(e)&&(e+=""),sX.isString(e))?(await m(e)).byteLength:void 0},_=async(e,t)=>{let n=sX.toFiniteNumber(e.getContentLength());return null==n?p(t):n};return async e=>{let t,{url:n,method:o,data:d,signal:c,cancelToken:m,timeout:g,onDownloadProgress:F,onUploadProgress:y,responseType:v,headers:w,withCredentials:k="same-origin",fetchOptions:E,maxContentLength:D,maxBodyLength:M,maxRedirects:L}=d1(e),C=sX.isNumber(D)&&D>-1,A=sX.isNumber(M)&&M>-1,T=r||fetch;v=v?(v+"").toLowerCase():"text";let x=((e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;let n=new AbortController,o=!1,i=function(e){if(!o){o=!0,a();let t=e instanceof Error?e:this.reason;n.abort(t instanceof di?t:new dB(t instanceof Error?t.message:t))}},r=t&&setTimeout(()=>{r=null,i(new di(`timeout of ${t}ms exceeded`,di.ETIMEDOUT))},t),a=()=>{e&&(r&&clearTimeout(r),r=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>{if(!o){if(e.aborted)return void i.call(e);e.addEventListener("abort",i,{once:!0})}});let{signal:s}=n;return s.unsubscribe=()=>sX.asap(a),s})([c,m&&m.toAbortSignal()],g),S=null,Y=x&&x.unsubscribe&&(()=>{x.unsubscribe()}),O=null,I=()=>new di("Request body larger than maxBodyLength limit",di.ERR_BAD_REQUEST,e,S);try{var P,B;let r,c,m,g,R=(c="auth",sX.hasOwnProp(e,c)?e[c]:void 0);if(R){let e=sX.getSafeProp(R,"username")||"",t=sX.getSafeProp(R,"password")||"";r={username:e,password:t}}if(m=(P=n).indexOf("://"),g=P,-1!==m&&(g=g.slice(m+3)),g.includes("@")||g.includes(":")){let e=new URL(n,dA.origin);if(!r&&(e.username||e.password)){let t=lr(e.username),n=lr(e.password);r={username:t,password:n}}(e.username||e.password)&&(e.username="",e.password="",n=e.href)}if(r){let e;w.delete("authorization"),w.set("Authorization","Basic "+btoa((e=(r.username||"")+":"+(r.password||""),encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))))}if(C&&"string"==typeof n&&n.startsWith("data:")){let t;if(B=n,t="string"==typeof B?B.indexOf("#"):-1,((e,t)=>{if(!e||"string"!=typeof e||!e.startsWith("data:"))return 0;let n=e.indexOf(",");if(n<0)return 0;let o=e.slice(5,n),i=e.slice(n+1);if(/;base64/i.test(o))return t(i);let r=0;for(let e=0,t=i.length;e<t;e++){let n=i.charCodeAt(e);if(37===n&&d7(i,e,t))r+=1,e+=2;else if(n<128)r+=1;else if(n<2048)r+=2;else if(n>=55296&&n<=56319&&e+1<t){let t=i.charCodeAt(e+1);t>=56320&&t<=57343?(r+=4,e++):r+=3}else r+=3}return r})(-1===t?B:B.slice(0,t),ln)>D)throw new di("maxContentLength size of "+D+" exceeded",di.ERR_BAD_RESPONSE,e,S)}if(A&&"get"!==o&&"head"!==o){let e=await p(d);if("number"==typeof e&&isFinite(e)&&(t=e,e>M))throw I()}let N=A&&(sX.isReadableStream(d)||sX.isStream(d)),j=(e,t,n)=>d6(e,65536,e=>{if(A&&e>M)throw O=I();t&&t(e)},n);if(h&&"get"!==o&&"head"!==o&&(y||N)){if(t=null==t?await _(w,d):t,0!==t||N){let e,o=new a(n,{method:"POST",body:d,duplex:"half"});if(sX.isFormData(d)&&(e=o.headers.get("content-type"))&&w.setContentType(e),o.body){let[e,n]=y&&dW(t,d$(dV(y)))||[];d=j(o.body,e,n)}}}else if(N&&!l&&u&&"get"!==o&&"head"!==o)d=j(d);else if(N&&l&&!h&&"get"!==o&&"head"!==o)throw new di("Stream request bodies are not supported by the current fetch implementation",di.ERR_NOT_SUPPORT,e,S);sX.isString(k)||(k=k?"include":"omit");let H=l&&"credentials"in a.prototype;if(sX.isFormData(d)){let e=w.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&w.delete("content-type")}w.set("User-Agent","axios/1.20.0",!1);let U=null==E?E:Object.assign(Object.create(null),E);U&&(delete U.body,delete U.headers,delete U.method,delete U.signal,delete U.duplex,delete U.credentials);let z=Object.assign(Object.create(null),U,{signal:x,method:o.toUpperCase(),headers:s2(w.normalize()),body:d,duplex:"half",credentials:H?k:void 0});l&&(sX.forEach(lo,(e,t)=>{void 0===z[t]&&(z[t]=e)}),void 0===z.signal&&(z.signal=null),void 0===z.body&&(z.body=null)),0===L&&(z.redirect="manual",U&&(U.redirect="manual")),S=l&&new a(n,z);let $=await (l?T(S,U):T(n,z)),W=s9.from($.headers);if(C){let t=sX.toFiniteNumber(W.getContentLength());if(null!=t&&t>D)throw new di("maxContentLength size of "+D+" exceeded",di.ERR_BAD_RESPONSE,e,S)}let V=f&&("stream"===v||"response"===v);if(f&&$.body&&(F||C||V&&Y)){let t={};["status","statusText","headers"].forEach(e=>{t[e]=$[e]});let n=sX.toFiniteNumber(W.getContentLength()),[o,i]=F&&dW(n,d$(dV(F),!0))||[];$=new s(d6($.body,65536,t=>{if(C&&t>D)throw new di("maxContentLength size of "+D+" exceeded",di.ERR_BAD_RESPONSE,e,S);o&&o(t)},()=>{i&&i(),Y&&Y()}),t)}v=v||"text";let q=await b[sX.findKey(b,v)||"text"]($,e);if(C&&!f&&!V){let t;if(null!=q&&("number"==typeof q.byteLength?t=q.byteLength:"number"==typeof q.size?t=q.size:"string"==typeof q&&(t="function"==typeof i?new i().encode(q).byteLength:q.length)),"number"==typeof t&&t>D)throw new di("maxContentLength size of "+D+" exceeded",di.ERR_BAD_RESPONSE,e,S)}return!V&&Y&&Y(),await new Promise((t,n)=>{dR(t,n,{data:q,headers:s9.from($.headers),status:$.status,statusText:$.statusText,config:e,request:S})})}catch(t){if(Y&&Y(),x&&x.aborted&&x.reason instanceof di){let n=x.reason;throw n.config=e,S&&(n.request=S),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(O)throw S&&!O.request&&(O.request=S),O;if(t instanceof di)throw S&&!t.request&&(t.request=S),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){let n=new di("Network Error",di.ERR_NETWORK,e,S,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw di.from(t,t&&t.code,e,S,t&&t.response)}}},ld=new Map,ll=e=>{let t=e&&e.env||{},{fetch:n,Request:o,Response:i}=t,r=[o,i,n],a=r.length,s,d,l=ld;for(;a--;)s=r[a],void 0===(d=l.get(s))&&l.set(s,d=a?new Map:ls(t)),l=d;return d};ll();let lc={http:null,xhr:d2,fetch:{get:ll}};sX.forEach(lc,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});let lu=e=>`- ${e}`,lm=e=>sX.isFunction(e)||null===e||!1===e,lh=function(e,t){let n,o,{length:i}=e=sX.isArray(e)?e:[e],r={};for(let a=0;a<i;a++){let i;if(o=n=e[a],!lm(n)&&void 0===(o=lc[(i=String(n)).toLowerCase()]))throw new di(`Unknown adapter '${i}'`);if(o&&(sX.isFunction(o)||(o=o.get(t))))break;r[i||"#"+a]=o}if(!o){let e=Object.entries(r).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new di("There is no suitable adapter to dispatch the request "+(i?e.length>1?"since :\n"+e.map(lu).join("\n"):" "+lu(e[0]):"as no adapter specified"),di.ERR_NOT_SUPPORT)}return o};function lf(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new dB(null,e)}function lb(e){let t=sX.toSafeFlatObject(e);return lf(t),t.headers=s9.from(sX.getSafeProp(t,"headers")),t.data=dI.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),lh(t.adapter||dO.adapter,t)(t).then(function(e){lf(t),t.response=e;try{e.data=dI.call(t,t.transformResponse,e)}finally{delete t.response}return e.headers=s9.from(e.headers),e},function(e){if(!dP(e)&&(lf(t),e&&e.response)){t.response=e.response;try{e.response.data=dI.call(t,t.transformResponse,e.response)}finally{delete t.response}e.response.headers=s9.from(e.response.headers)}return Promise.reject(e)})}let lp={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{lp[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});let l_={};lp.transitional=function(e,t,n){function o(e,t){return"[Axios v1.20.0] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,r)=>{if(!1===e)throw new di(o(i," has been removed"+(t?" in "+t:"")),di.ERR_DEPRECATED);return t&&!l_[i]&&(l_[i]=!0,console.warn(o(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,r)}},lp.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};let lg=function(e,t,n){if("object"!=typeof e||null===e)throw new di("options must be an object",di.ERR_BAD_OPTION_VALUE);let o=Object.keys(e),i=o.length;for(;i-- >0;){let r=o[i],a=Object.prototype.hasOwnProperty.call(t,r)?t[r]:void 0;if(a){let t=e[r],n=void 0===t||a(t,r,e);if(!0!==n)throw new di("option "+r+" must be "+n,di.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new di("Unknown option "+r,di.ERR_BAD_OPTION)}};class lF{constructor(e){this.defaults=e||{},this.interceptors={request:new dF,response:new dF}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error)try{let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let n=t.stack,o="";if("string"==typeof n){let e=n.indexOf("\n");o=-1===e?"":n.slice(e+1)}if(e.stack){if(o){let t=o.indexOf("\n"),n=-1===t?-1:o.indexOf("\n",t+1),i=-1===n?"":o.slice(n+1);String(e.stack).endsWith(i)||(e.stack+="\n"+o)}}else e.stack=o}catch(e){}throw e}}_request(e,t){let n,o;"string"==typeof e?(t=t||{}).url=e:t=e||{};let{transitional:i,paramsSerializer:r,headers:a}=t=dZ(this.defaults,t);void 0!==i&&lg(i,{silentJSONParsing:lp.transitional(lp.boolean),forcedJSONParsing:lp.transitional(lp.boolean),clarifyTimeoutError:lp.transitional(lp.boolean),legacyInterceptorReqResOrdering:lp.transitional(lp.boolean),advertiseZstdAcceptEncoding:lp.transitional(lp.boolean),validateStatusUndefinedResolves:lp.transitional(lp.boolean)},!1),null!=r&&(sX.isFunction(r)?t.paramsSerializer={serialize:r}:lg(r,{encode:lp.function,serialize:lp.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),lg(t,{baseUrl:lp.spelling("baseURL"),withXsrfToken:lp.spelling("withXSRFToken")},!0),t.method=(sX.getSafeProp(t,"method")||sX.getSafeProp(this.defaults,"method")||"get").toLowerCase();let s=a&&sX.merge(a.common,a[t.method]);a&&sX.forEach(dS.concat("common"),e=>{delete a[e]}),t.headers=s9.concat(s,a);let d=[],l=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;l=l&&e.synchronous;let n=t.transitional||dy;n&&n.legacyInterceptorReqResOrdering?d.unshift(e.fulfilled,e.rejected):d.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u=0;if(!l){let e=[lb.bind(this),void 0];for(e.unshift(...d),e.push(...c),o=e.length,n=Promise.resolve(t);u<o;)n=n.then(e[u++],e[u++]);return n}o=d.length;let m=t;for(;u<o;){let e=d[u++],t=d[u++];try{m=e?e(m):m}catch(e){if(!t){n=Promise.reject(e);break}try{let o=t.call(this,e);sX.isThenable(o)&&(n=Promise.resolve(o).then(()=>lb.call(this,m)))}catch(e){n=Promise.reject(e)}break}}if(!n)try{n=lb.call(this,m)}catch(e){n=Promise.reject(e)}for(u=0,o=c.length;u<o;)n=n.then(c[u++],c[u++]);return n}getUri(e){return df(dX((e=dZ(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}sX.forEach(["delete","get","head","options"],function(e){lF.prototype[e]=function(t,n){return this.request(dZ(n||{},{method:e,url:t,data:n&&sX.hasOwnProp(n,"data")?n.data:void 0}))}}),sX.forEach(["post","put","patch","query"],function(e){function t(t){return function(n,o,i){return this.request(dZ(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:o}))}}lF.prototype[e]=t(),"query"!==e&&(lF.prototype[e+"Form"]=t(!0))});let ly=class e{constructor(e){let t;if("function"!=typeof e)throw TypeError("executor must be a function.");this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,o=new Promise(e=>{n.subscribe(e),t=e}).then(e);return o.cancel=function(){n.unsubscribe(t)},o},e(function(e,o,i){n.reason||(n.reason=new dB(e,o,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},lv={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(lv).forEach(([e,t])=>{void 0===lv[t]&&(lv[t]=e)});let lw=function e(t){let n=new lF(t),o=sr(lF.prototype.request,n);return sX.extend(o,lF.prototype,n,{allOwnKeys:!0}),sX.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return e(dZ(t,n))},o}(dO);lw.Axios=lF,lw.CanceledError=dB,lw.CancelToken=ly,lw.isCancel=dP,lw.VERSION="1.20.0",lw.toFormData=dl,lw.AxiosError=di,lw.Cancel=lw.CanceledError,lw.all=function(e){return Promise.all(e)},lw.spread=function(e){return function(t){return e.apply(null,t)}},lw.isAxiosError=function(e){return sX.isObject(e)&&!0===e.isAxiosError},lw.mergeConfig=dZ,lw.AxiosHeaders=s9,lw.formToJSON=e=>dx(sX.isHTMLForm(e)?new FormData(e):e),lw.getAdapter=lh,lw.HttpStatusCode=lv,lw.default=lw;class lk{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:lW`dashboard`,data:e,options:t})}update(e,t){return this.httpClient.request({method:"PUT",url:lW`dashboard`,data:e,options:t})}getAllRealmDashboards(e,t){return this.httpClient.request({method:"GET",url:lW`dashboard/all/${e}`,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:lW`dashboard/query`,data:e,options:t})}delete(e,t,n){return this.httpClient.request({method:"DELETE",url:lW`dashboard/${e}/${t}`,options:n})}get(e,t,n){return this.httpClient.request({method:"GET",url:lW`dashboard/${e}/${t}`,options:n})}}class lE{constructor(e){this.httpClient=e}getApps(e){return this.httpClient.request({method:"GET",url:lW`apps`,options:e})}getConsoleConfig(e){return this.httpClient.request({method:"GET",url:lW`apps/consoleConfig`,options:e})}getAppInfos(e){return this.httpClient.request({method:"GET",url:lW`apps/info`,options:e})}}class lD{constructor(e){this.httpClient=e}createProvisioningConfig(e,t){return this.httpClient.request({method:"POST",url:lW`provisioning`,data:e,options:t})}getProvisioningConfigs(e){return this.httpClient.request({method:"GET",url:lW`provisioning`,options:e})}deleteProvisioningConfig(e,t){return this.httpClient.request({method:"DELETE",url:lW`provisioning/${e}`,options:t})}updateProvisioningConfig(e,t,n){return this.httpClient.request({method:"PUT",url:lW`provisioning/${e}`,data:t,options:n})}}class lM{constructor(e){this.httpClient=e}startTunnel(e,t){return this.httpClient.request({method:"POST",url:lW`gateway/tunnel`,data:e,options:t})}stopTunnel(e,t){return this.httpClient.request({method:"DELETE",url:lW`gateway/tunnel`,data:e,options:t})}getAllActiveTunnelInfos(e,t){return this.httpClient.request({method:"GET",url:lW`gateway/tunnel/${e}`,options:t})}getGatewayActiveTunnelInfos(e,t,n){return this.httpClient.request({method:"GET",url:lW`gateway/tunnel/${e}/${t}`,options:n})}getActiveTunnelInfo(e,t,n,o,i){return this.httpClient.request({method:"GET",url:lW`gateway/tunnel/${e}/${t}/${n}/${o}`,options:i})}}class lL{constructor(e){this.httpClient=e}getDatapointExport(e,t){return this.httpClient.request({method:"GET",url:lW`asset/datapoint/export`,queryParams:e,options:t})}getDatapointPeriod(e,t){return this.httpClient.request({method:"GET",url:lW`asset/datapoint/periods`,queryParams:e,options:t})}getDatapoints(e,t,n,o){return this.httpClient.request({method:"POST",url:lW`asset/datapoint/${e}/${t}`,data:n,options:o})}}class lC{constructor(e){this.httpClient=e}getServices(e,t){return this.httpClient.request({method:"GET",url:lW`service`,queryParams:e,options:t})}registerService(e,t){return this.httpClient.request({method:"POST",url:lW`service`,data:e,options:t})}getGlobalServices(e){return this.httpClient.request({method:"GET",url:lW`service/global`,options:e})}registerGlobalService(e,t){return this.httpClient.request({method:"POST",url:lW`service/global`,data:e,options:t})}deregisterService(e,t,n){return this.httpClient.request({method:"DELETE",url:lW`service/${e}/${t}`,options:n})}getService(e,t,n){return this.httpClient.request({method:"GET",url:lW`service/${e}/${t}`,options:n})}heartbeat(e,t,n){return this.httpClient.request({method:"PUT",url:lW`service/${e}/${t}`,options:n})}}class lA{constructor(e){this.httpClient=e}deleteConnections(e,t){return this.httpClient.request({method:"DELETE",url:lW`gateway/connection`,queryParams:e,options:t})}getConnections(e){return this.httpClient.request({method:"GET",url:lW`gateway/connection`,options:e})}deleteConnection(e,t){return this.httpClient.request({method:"DELETE",url:lW`gateway/connection/${e}`,options:t})}getConnection(e,t){return this.httpClient.request({method:"GET",url:lW`gateway/connection/${e}`,options:t})}setConnection(e,t,n){return this.httpClient.request({method:"PUT",url:lW`gateway/connection/${e}`,data:t,options:n})}getConnectionStatus(e,t){return this.httpClient.request({method:"GET",url:lW`gateway/status/${e}`,options:t})}}class lT{constructor(e){this.httpClient=e}getSettings(e){return this.httpClient.request({method:"GET",url:lW`map`,options:e})}saveSettings(e,t){return this.httpClient.request({method:"PUT",url:lW`map`,data:e,options:t})}deleteMap(e){return this.httpClient.request({method:"DELETE",url:lW`map/deleteMap`,options:e})}getCustomMapInfo(e){return this.httpClient.request({method:"GET",url:lW`map/getCustomMapInfo`,options:e})}getTile(e,t,n,o){return this.httpClient.request({method:"GET",url:lW`map/tile/${e}/${t}/${n}`,options:o})}uploadMap(e,t){return this.httpClient.request({method:"POST",url:lW`map/upload`,queryParams:e,options:t})}}class lx{constructor(e){this.httpClient=e}createGlobalRuleset(e,t){return this.httpClient.request({method:"POST",url:lW`rules`,data:e,options:t})}getGlobalRulesets(e,t){return this.httpClient.request({method:"GET",url:lW`rules`,queryParams:e,options:t})}createAssetRuleset(e,t){return this.httpClient.request({method:"POST",url:lW`rules/asset`,data:e,options:t})}getAssetRulesets(e,t,n){return this.httpClient.request({method:"GET",url:lW`rules/asset/for/${e}`,queryParams:t,options:n})}deleteAssetRuleset(e,t){return this.httpClient.request({method:"DELETE",url:lW`rules/asset/${e}`,options:t})}getAssetRuleset(e,t){return this.httpClient.request({method:"GET",url:lW`rules/asset/${e}`,options:t})}updateAssetRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:lW`rules/asset/${e}`,data:t,options:n})}getAssetGeofences(e,t){return this.httpClient.request({method:"GET",url:lW`rules/geofences/${e}`,options:t})}getAssetEngineInfo(e,t){return this.httpClient.request({method:"GET",url:lW`rules/info/asset/${e}`,options:t})}getGlobalEngineInfo(e){return this.httpClient.request({method:"GET",url:lW`rules/info/global`,options:e})}getRealmEngineInfo(e,t){return this.httpClient.request({method:"GET",url:lW`rules/info/realm/${e}`,options:t})}createRealmRuleset(e,t){return this.httpClient.request({method:"POST",url:lW`rules/realm`,data:e,options:t})}getRealmRulesets(e,t,n){return this.httpClient.request({method:"GET",url:lW`rules/realm/for/${e}`,queryParams:t,options:n})}deleteRealmRuleset(e,t){return this.httpClient.request({method:"DELETE",url:lW`rules/realm/${e}`,options:t})}getRealmRuleset(e,t){return this.httpClient.request({method:"GET",url:lW`rules/realm/${e}`,options:t})}updateRealmRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:lW`rules/realm/${e}`,data:t,options:n})}deleteGlobalRuleset(e,t){return this.httpClient.request({method:"DELETE",url:lW`rules/${e}`,options:t})}getGlobalRuleset(e,t){return this.httpClient.request({method:"GET",url:lW`rules/${e}`,options:t})}updateGlobalRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:lW`rules/${e}`,data:t,options:n})}}class lS{constructor(e){this.httpClient=e}register(e,t){return this.httpClient.request({method:"POST",url:lW`console/register`,data:e,options:t})}}class lY{constructor(e){this.httpClient=e}getAllNodeDefinitions(e){return this.httpClient.request({method:"GET",url:lW`flow`,options:e})}getNodeDefinition(e,t){return this.httpClient.request({method:"GET",url:lW`flow/${e}`,options:t})}getAllNodeDefinitionsByType(e,t){return this.httpClient.request({method:"GET",url:lW`flow/${e}`,options:t})}}class lO{constructor(e){this.httpClient=e}updateCurrentUserLocale(e,t){return this.httpClient.request({method:"PUT",url:lW`user/locale`,data:e,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:lW`user/query`,data:e,options:t})}requestPasswordResetCurrent(e){return this.httpClient.request({method:"PUT",url:lW`user/request-password-reset`,options:e})}updatePasswordCurrent(e,t){return this.httpClient.request({method:"PUT",url:lW`user/reset-password`,data:e,options:t})}updateCurrent(e,t){return this.httpClient.request({method:"PUT",url:lW`user/update`,data:e,options:t})}getCurrent(e){return this.httpClient.request({method:"GET",url:lW`user/user`,options:e})}getCurrentUserRealmRoles(e){return this.httpClient.request({method:"GET",url:lW`user/userRealmRoles`,options:e})}getCurrentUserClientRoles(e,t){return this.httpClient.request({method:"GET",url:lW`user/userRoles/${e}`,options:t})}disconnectUserSession(e,t,n){return this.httpClient.request({method:"DELETE",url:lW`user/${e}/disconnect/${t}`,options:n})}requestPasswordReset(e,t,n){return this.httpClient.request({method:"PUT",url:lW`user/${e}/request-password-reset/${t}`,options:n})}updatePassword(e,t,n,o){return this.httpClient.request({method:"PUT",url:lW`user/${e}/reset-password/${t}`,data:n,options:o})}resetSecret(e,t,n){return this.httpClient.request({method:"GET",url:lW`user/${e}/reset-secret/${t}`,options:n})}updateRoles(e,t,n){return this.httpClient.request({method:"PUT",url:lW`user/${e}/roles`,data:t,options:n})}getUserRealmRoles(e,t,n){return this.httpClient.request({method:"GET",url:lW`user/${e}/userRealmRoles/${t}`,options:n})}updateUserRealmRoles(e,t,n,o){return this.httpClient.request({method:"PUT",url:lW`user/${e}/userRealmRoles/${t}`,data:n,options:o})}getUserClientRoles(e,t,n,o){return this.httpClient.request({method:"GET",url:lW`user/${e}/userRoles/${t}/${n}`,options:o})}updateUserClientRoles(e,t,n,o,i){return this.httpClient.request({method:"PUT",url:lW`user/${e}/userRoles/${t}/${n}`,data:o,options:i})}getUserSessions(e,t,n){return this.httpClient.request({method:"GET",url:lW`user/${e}/userSessions/${t}`,options:n})}create(e,t,n){return this.httpClient.request({method:"POST",url:lW`user/${e}/users`,data:t,options:n})}update(e,t,n){return this.httpClient.request({method:"PUT",url:lW`user/${e}/users`,data:t,options:n})}delete(e,t,n){return this.httpClient.request({method:"DELETE",url:lW`user/${e}/users/${t}`,options:n})}getClientRoles(e,t,n){return this.httpClient.request({method:"GET",url:lW`user/${e}/${t}/roles`,options:n})}updateClientRoles(e,t,n,o){return this.httpClient.request({method:"PUT",url:lW`user/${e}/${t}/roles`,data:n,options:o})}get(e,t,n){return this.httpClient.request({method:"GET",url:lW`user/${e}/${t}`,options:n})}}class lI{constructor(e){this.httpClient=e}getNotifications(e,t){return this.httpClient.request({method:"GET",url:lW`notification`,queryParams:e,options:t})}removeNotifications(e,t){return this.httpClient.request({method:"DELETE",url:lW`notification`,queryParams:e,options:t})}sendNotification(e,t){return this.httpClient.request({method:"POST",url:lW`notification/alert`,data:e,options:t})}getNotificationsCount(e,t){return this.httpClient.request({method:"GET",url:lW`notification/count`,queryParams:e,options:t})}removeNotification(e,t){return this.httpClient.request({method:"DELETE",url:lW`notification/${e}`,options:t})}notificationAcknowledged(e,t,n,o){return this.httpClient.request({method:"PUT",url:lW`notification/${e}/acknowledged`,queryParams:n,data:t,options:o})}notificationDelivered(e,t,n){return this.httpClient.request({method:"PUT",url:lW`notification/${e}/delivered`,queryParams:t,options:n})}}class lP{constructor(e){this.httpClient=e}getPredictedDatapoints(e,t,n,o){return this.httpClient.request({method:"POST",url:lW`asset/predicted/${e}/${t}`,data:n,options:o})}writePredictedDatapoints(e,t,n,o){return this.httpClient.request({method:"PUT",url:lW`asset/predicted/${e}/${t}`,data:n,options:o})}}class lB{constructor(e){this.httpClient=e}getAssetDescriptors(e,t){return this.httpClient.request({method:"GET",url:lW`model/assetDescriptors`,queryParams:e,options:t})}getAssetInfo(e,t,n){return this.httpClient.request({method:"GET",url:lW`model/assetInfo/${e}`,queryParams:t,options:n})}getAssetInfos(e,t){return this.httpClient.request({method:"GET",url:lW`model/assetInfos`,queryParams:e,options:t})}getValueDescriptorSchema(e,t){return this.httpClient.request({method:"GET",url:lW`model/getValueDescriptorSchema`,queryParams:e,options:t})}getMetaItemDescriptors(e,t){return this.httpClient.request({method:"GET",url:lW`model/metaItemDescriptors`,queryParams:e,options:t})}getValueDescriptors(e,t){return this.httpClient.request({method:"GET",url:lW`model/valueDescriptors`,queryParams:e,options:t})}}class lR{constructor(e){this.httpClient=e}getHealthStatus(e){return this.httpClient.request({method:"GET",url:lW`health`,options:e})}getInfo(e){return this.httpClient.request({method:"GET",url:lW`info`,options:e})}}class lN{constructor(e){this.httpClient=e}doProtocolAssetDiscovery(e,t,n){return this.httpClient.request({method:"GET",url:lW`agent/assetDiscovery/${e}`,queryParams:t,options:n})}doProtocolAssetImport(e,t,n,o){return this.httpClient.request({method:"POST",url:lW`agent/assetImport/${e}`,queryParams:n,data:t,options:o})}doProtocolInstanceDiscovery(e,t,n){return this.httpClient.request({method:"GET",url:lW`agent/instanceDiscovery/${e}`,queryParams:t,options:n})}}class lj{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:lW`asset`,data:e,options:t})}delete(e,t){return this.httpClient.request({method:"DELETE",url:lW`asset`,queryParams:e,options:t})}writeAttributeValues(e,t){return this.httpClient.request({method:"PUT",url:lW`asset/attributes`,data:e,options:t})}writeAttributeEvents(e,t){return this.httpClient.request({method:"PUT",url:lW`asset/attributes/timestamp`,data:e,options:t})}queryCount(e,t){return this.httpClient.request({method:"POST",url:lW`asset/count`,data:e,options:t})}updateNoneParent(e,t){return this.httpClient.request({method:"DELETE",url:lW`asset/parent`,queryParams:e,options:t})}getPartial(e,t){return this.httpClient.request({method:"GET",url:lW`asset/partial/${e}`,options:t})}queryAssets(e,t){return this.httpClient.request({method:"POST",url:lW`asset/query`,data:e,options:t})}queryAssetTree(e,t){return this.httpClient.request({method:"POST",url:lW`asset/tree`,data:e,options:t})}getCurrentUserAssets(e){return this.httpClient.request({method:"GET",url:lW`asset/user/current`,options:e})}createUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:lW`asset/user/link`,data:e,options:t})}getUserAssetLinks(e,t){return this.httpClient.request({method:"GET",url:lW`asset/user/link`,queryParams:e,options:t})}deleteUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:lW`asset/user/link/delete`,data:e,options:t})}deleteAllUserAssetLinks(e,t,n){return this.httpClient.request({method:"DELETE",url:lW`asset/user/link/${e}/${t}`,options:n})}deleteUserAssetLink(e,t,n,o){return this.httpClient.request({method:"DELETE",url:lW`asset/user/link/${e}/${t}/${n}`,options:o})}get(e,t){return this.httpClient.request({method:"GET",url:lW`asset/${e}`,options:t})}update(e,t,n){return this.httpClient.request({method:"PUT",url:lW`asset/${e}`,data:t,options:n})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName(e,t,n,o){return this.httpClient.request({method:"PUT",url:lW`asset/${e}/attribute/${t}`,data:n,options:o})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName_timestamp(e,t,n,o,i){return this.httpClient.request({method:"PUT",url:lW`asset/${e}/attribute/${t}/${n}`,data:o,options:i})}updateParent(e,t,n){return this.httpClient.request({method:"PUT",url:lW`asset/${e}/child`,queryParams:t,options:n})}}class lH{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:lW`realm`,data:e,options:t})}getAll(e){return this.httpClient.request({method:"GET",url:lW`realm`,options:e})}getAccessible(e){return this.httpClient.request({method:"GET",url:lW`realm/accessible`,options:e})}delete(e,t){return this.httpClient.request({method:"DELETE",url:lW`realm/${e}`,options:t})}get(e,t){return this.httpClient.request({method:"GET",url:lW`realm/${e}`,options:t})}update(e,t,n){return this.httpClient.request({method:"PUT",url:lW`realm/${e}`,data:t,options:n})}}class lU{constructor(e){this.httpClient=e}createAlarm(e,t,n){return this.httpClient.request({method:"POST",url:lW`alarm`,queryParams:t,data:e,options:n})}getAlarms(e,t){return this.httpClient.request({method:"GET",url:lW`alarm`,queryParams:e,options:t})}removeAlarms(e,t){return this.httpClient.request({method:"DELETE",url:lW`alarm`,data:e,options:t})}setAssetLinks(e,t){return this.httpClient.request({method:"PUT",url:lW`alarm/assets`,data:e,options:t})}getAlarm(e,t){return this.httpClient.request({method:"GET",url:lW`alarm/${e}`,options:t})}removeAlarm(e,t){return this.httpClient.request({method:"DELETE",url:lW`alarm/${e}`,options:t})}updateAlarm(e,t,n){return this.httpClient.request({method:"PUT",url:lW`alarm/${e}`,data:t,options:n})}getAssetLinks(e,t,n){return this.httpClient.request({method:"GET",url:lW`alarm/${e}/assets`,queryParams:t,options:n})}}class lz{constructor(e){this.httpClient=e}getManagerConfig(e){return this.httpClient.request({method:"GET",url:lW`configuration/manager`,options:e})}update(e,t){return this.httpClient.request({method:"PUT",url:lW`configuration/manager`,data:e,options:t})}fileUpload(e,t,n){return this.httpClient.request({method:"POST",url:lW`configuration/manager/file`,queryParams:t,data:e,options:n})}getManagerConfigImage(e,t){return this.httpClient.request({method:"GET",url:lW`configuration/manager/image/${e}`,options:t})}}class l${constructor(e){this.httpClient=e}getConfig(e){return this.httpClient.request({method:"GET",url:lW`syslog/config`,options:e})}updateConfig(e,t){return this.httpClient.request({method:"PUT",url:lW`syslog/config`,data:e,options:t})}clearEvents(e){return this.httpClient.request({method:"DELETE",url:lW`syslog/event`,options:e})}getEvents(e,t){return this.httpClient.request({method:"GET",url:lW`syslog/event`,queryParams:e,options:t})}}function lW(e,...t){let n="";for(let o=0;o<t.length;o++)n+=e[o],n+=encodeURIComponent(t[o]);return n+e[e.length-1]}class lV{constructor(e,t=lw.create()){this._dashboardResource=new lG(e,t),this._appResource=new lK(e,t),this._provisioningResource=new lJ(e,t),this._gatewayServiceResource=new lX(e,t),this._assetDatapointResource=new lQ(e,t),this._externalServiceResource=new lZ(e,t),this._gatewayClientResource=new l0(e,t),this._mapResource=new l1(e,t),this._rulesResource=new l2(e,t),this._consoleResource=new l4(e,t),this._flowResource=new l3(e,t),this._userResource=new l5(e,t),this._notificationResource=new l6(e,t),this._assetPredictedDatapointResource=new l8(e,t),this._assetModelResource=new l7(e,t),this._statusResource=new l9(e,t),this._agentResource=new ce(e,t),this._assetResource=new ct(e,t),this._realmResource=new cn(e,t),this._alarmResource=new co(e,t),this._configurationResource=new ci(e,t),this._syslogResource=new cr(e,t),this._assetResource=new ct(e,t)}get DashboardResource(){return this._dashboardResource}get AppResource(){return this._appResource}get ProvisioningResource(){return this._provisioningResource}get GatewayServiceResource(){return this._gatewayServiceResource}get AssetDatapointResource(){return this._assetDatapointResource}get ExternalServiceResource(){return this._externalServiceResource}get GatewayClientResource(){return this._gatewayClientResource}get MapResource(){return this._mapResource}get RulesResource(){return this._rulesResource}get ConsoleResource(){return this._consoleResource}get FlowResource(){return this._flowResource}get UserResource(){return this._userResource}get NotificationResource(){return this._notificationResource}get AssetPredictedDatapointResource(){return this._assetPredictedDatapointResource}get AssetModelResource(){return this._assetModelResource}get StatusResource(){return this._statusResource}get AgentResource(){return this._agentResource}get AssetResource(){return this._assetResource}get RealmResource(){return this._realmResource}get AlarmResource(){return this._alarmResource}get ConfigurationResource(){return this._configurationResource}get SyslogResource(){return this._syslogResource}}class lq{constructor(e){this.axios=e}request(e){let t={};t.method=e.method,t.url=e.url,t.params=e.queryParams,t.data=e.data,function(e,t){if(void 0!=t)for(let n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}(t,e.options);let n=e.copyFn;return this.axios.request(t).then(e=>(n&&e.data&&(e.originalData=e.data,e.data=n(e.data)),e))}}class lG extends lk{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class lK extends lE{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class lJ extends lD{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class lX extends lM{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class lQ extends lL{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class lZ extends lC{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class l0 extends lA{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class l1 extends lT{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class l2 extends lx{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class l4 extends lS{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class l3 extends lY{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class l5 extends lO{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class l6 extends lI{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class l8 extends lP{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class l7 extends lB{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class l9 extends lR{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class ce extends lN{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class ct extends lj{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class cn extends lH{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class co extends lU{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class ci extends lz{constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}class cr extends l${constructor(e,t=lw.create()){t.defaults.baseURL=e,super(new lq(t))}}var ca=n(8183),cs=n.n(ca);lw.isAxiosError;let cd=new class{get api(){return this._client}constructor(){this._axiosInstance=lw.create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use(e=>(e.paramsSerializer=e=>cs().stringify(e,{arrayFormat:"repeat"}),e))}get axiosInstance(){return this._axiosInstance}get baseUrl(){return this._baseUrl}setTimeout(e){this._axiosInstance.defaults.timeout=e}addRequestInterceptor(e){this._axiosInstance.interceptors.request.use(e)}initialise(e){this._baseUrl=e,this._client=new lV(e,this._axiosInstance)}};var cl=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function a(e){try{d(o.next(e))}catch(e){r(e)}}function s(e){try{d(o.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}d((o=o.apply(e,t||[])).next())})};(ev=tM||(tM={})).DISCONNECTED="DISCONNECTED",ev.CONNECTED="CONNECTED",ev.CONNECTING="CONNECTING";let cc="SUBSCRIBED:",cu="UNAUTHORIZED:",cm="TRIGGERED:",ch="EVENT:";class cf{constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=cb.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=tM.DISCONNECTED,this._connectingDeferred=null,this._statusCallbacks=[],this._pendingSubscription=null,this._queuedSubscriptions=[],this._subscriptionMap=new Map,this._assetEventCallbackMap=new Map,this._attributeEventCallbackMap=new Map,this._unloading=!1}get status(){return this._status}subscribeStatusChange(e){this._statusCallbacks.push(e)}unsubscribeStatusChange(e){!function(e,t){if(0===e.length)return;let n=e.indexOf(t);n>=0&&e.splice(n,1)}(this._statusCallbacks,e)}connect(){return(console.debug("Attempting to connect to events:",this.endpointUrl),this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this._status===tM.CONNECTED)?(console.debug("Already connected to events!"),Promise.resolve(!0)):((this._disconnectRequested=!1,this._connectingDeferred)?console.warn("Already connecting to events, continuing the previous one."):(this._onStatusChanged(tM.CONNECTING),this._connectingDeferred=new a9,this._doConnect().then(e=>{if(this._connectingDeferred){let t=this._connectingDeferred;e?(console.debug("Connected to event service: "+this.endpointUrl),this._reconnectDelayMillis=cb.MIN_RECONNECT_DELAY,this._onStatusChanged(tM.CONNECTED),window.setTimeout(()=>{this._onConnect()},0)):console.debug("Failed to connect to event service: "+this.endpointUrl),t.resolve(e)}}).finally(()=>{this._connectingDeferred=null})),this._connectingDeferred.promise)}disconnect(){console.debug("Disconnecting from event service: "+this.endpointUrl),this._disconnectRequested||(this._disconnectRequested=!0,this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this.status!==tM.DISCONNECTED&&this._doDisconnect())}subscribe(e,t){let n={eventSubscription:e,callback:t,deferred:new a9};return null!=this._pendingSubscription||this._status!==tM.CONNECTED?(this._queuedSubscriptions.push(n),n.deferred.promise):(this._pendingSubscription=n,this._doSubscribe(e).then(e=>{if(this._pendingSubscription){let t=this._pendingSubscription;this._pendingSubscription=null,this._subscriptionMap.set(e,t),this._processNextSubscription();let n=t.deferred;t.deferred=null,n&&n.resolve(e)}},e=>{if(console.error(e),this._pendingSubscription){let t=this._pendingSubscription;this._pendingSubscription=null,this._processNextSubscription();let n=t.deferred;t.deferred=null,n&&n.reject(e)}}),this._pendingSubscription.deferred.promise)}unsubscribe(e){return cl(this,void 0,void 0,function*(){if(this._subscriptionMap.delete(e))return void this._doUnsubscribe(e);if(this._assetEventCallbackMap.delete(e)){if(this._assetEventPromise&&0===this._assetEventCallbackMap.size){let e=yield this._assetEventPromise;this._assetEventPromise=void 0,this.unsubscribe(e)}return}if(this._attributeEventCallbackMap.delete(e)&&this._attributeEventPromise&&0===this._attributeEventCallbackMap.size){let e=yield this._attributeEventPromise;this._attributeEventPromise=void 0,this.unsubscribe(e)}})}sendEvent(e){this._status===tM.CONNECTED&&this._doSend(e)}sendEventWithReply(e){return this._status!==tM.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(e)}subscribeAssetEvents(e,t,n){return cl(this,void 0,void 0,function*(){let o=e&&"string"!=typeof e[0]?e.map(e=>e.id):e,i="AssetEvent"+cf._subscriptionCounter++;if(!this._assetEventPromise){let e;cH.authenticated||(e={filterType:"asset",realm:cH.displayRealm});let t={eventType:"asset",filter:e};this._assetEventPromise=this.subscribe(t,e=>{this._assetEventCallbackMap.forEach(t=>t(e))})}return this._assetEventCallbackMap.set(i,e=>{let t=e.asset.id;o?o.find(e=>t===e)&&n(e):e.asset.realm===cH.displayRealm&&n(e)}),this._assetEventPromise.then(()=>{try{if(o&&t){let e={messageID:"read-assets:"+o.join(",")+":"+i,eventType:"read-assets",assetQuery:{ids:o}};this.sendEventWithReply(e).then(e=>{e.assets&&this._assetEventCallbackMap.has(i)&&e.assets.forEach(e=>{n({eventType:"asset",asset:e,cause:"READ"})})})}}catch(t){throw console.error("Failed to subscribe to asset events for assets: "+e),i&&this.unsubscribe(i),t}return i})})}subscribeAttributeEvents(e,t,n){return cl(this,void 0,void 0,function*(){let o=e&&"string"!=typeof e[0],i=o?e.map(e=>e.id):e,r=o?e:void 0,a="AttributeEvent"+cf._subscriptionCounter++;if(!this._attributeEventPromise){let e;cH.authenticated||(e={filterType:"asset",realm:cH.displayRealm});let t={eventType:"attribute",filter:e};this._attributeEventPromise=this.subscribe(t,e=>{this._attributeEventCallbackMap.forEach(t=>t(e))})}let s=t=>{let r=t.ref;o?e.forEach(e=>{r.id===e.id&&r.name===e.name&&n(t)}):i?i.find(e=>r.id===e)&&n(t):t.realm===cH.displayRealm&&n(t)};return this._attributeEventCallbackMap.set(a,s),this._attributeEventPromise.then(()=>{try{if(t&&i){let e={messageID:"read-assets:"+i.join(",")+":"+a,eventType:"read-assets",assetQuery:{ids:i}};this.sendEventWithReply(e).then(e=>{e.assets&&this._attributeEventCallbackMap.has(a)&&e.assets.forEach(e=>{e.attributes&&Object.entries(e.attributes).forEach(([t,n])=>{(!r||r.find(n=>n.id===e.id&&n.name===t))&&s({eventType:"attribute",timestamp:n.timestamp,value:n.value,ref:{id:e.id,name:t}})})})})}}catch(t){throw console.error("Failed to subscribe to asset events for assets: "+e),a&&this.unsubscribe(a),t}return a})})}_processNextSubscription(){this._status===tM.CONNECTED&&0!==this._queuedSubscriptions.length&&setTimeout(()=>{let e=this._queuedSubscriptions.shift();e&&this.subscribe(e.eventSubscription,e.callback).then(t=>{let n=e.deferred;e.deferred=null,n&&n.resolve(t)},t=>{let n=e.deferred;e.deferred=null,n&&n.reject(t)})},0)}_onStatusChanged(e){e!==this._status&&(console.debug("Event provider status changed: "+e),this._status=e,this._unloading||window.setTimeout(()=>{this._statusCallbacks.forEach(t=>t(e))},0))}_onMessageReceived(e,t){let n=this._subscriptionMap.get(e);n&&n.callback(t)}_onConnect(){if(Object.keys(this._subscriptionMap).length>0){for(let e in this._subscriptionMap)this._subscriptionMap.has(e)&&this._queuedSubscriptions.unshift(this._subscriptionMap.get(e));this._subscriptionMap.clear()}this._processNextSubscription()}_onDisconnect(){this._status===tM.CONNECTED&&this._onStatusChanged(tM.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._onStatusChanged(tM.CONNECTING),this._scheduleReconnect()}_scheduleReconnect(){this._reconnectTimer||!this._disconnectRequested&&(console.debug("Event provider scheduling reconnect in "+this._reconnectDelayMillis+"ms"),this._reconnectTimer=window.setTimeout(()=>{this._disconnectRequested||this.connect()},this._reconnectDelayMillis),this._reconnectDelayMillis<cb.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(cb.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}cf.MIN_RECONNECT_DELAY=0,cf.MAX_RECONNECT_DELAY=3e4,cf._subscriptionCounter=0;class cb extends cf{get endpointUrl(){return this._endpointUrl}constructor(e){super(),this._webSocket=void 0,this._connectDeferred=null,this._subscribeDeferred=null,this._repliesDeferred=new Map,this._endpointUrl=(e.startsWith("https:")?"wss":"ws")+"://"+e.substr(e.indexOf("://")+3)+"/websocket/events",window.addEventListener("beforeunload",()=>{this._unloading=!0,this.disconnect()})}_doConnect(){let e=this._endpointUrl+"?Realm="+cH.config.realm;return this._connectDeferred=new a9,(cH.authenticated?cH.retrieveAuthorizationHeader().then(t=>{e+="&Authorization="+t}):Promise.resolve()).finally(()=>{this._webSocket=new WebSocket(e),this._webSocket.onopen=e=>{if(this._connectDeferred){let e=this._connectDeferred;this._connectDeferred=null,e.resolve(!0)}},this._webSocket.onerror=e=>{if(console.error("Event provider error:",e),this._connectDeferred){let e=this._connectDeferred;this._connectDeferred=null,e.resolve(!1)}else this._beforeDisconnect()},this._webSocket.onclose=()=>{if(console.warn("The WebSocket connection of the event provider has been closed."),this._webSocket=void 0,this._connectDeferred){let e=this._connectDeferred;this._connectDeferred=null,e.resolve(!1)}else this._beforeDisconnect()},this._webSocket.onmessage=e=>{let t=e.data;if(t&&t.startsWith(cc)){let e=JSON.parse(t.substring(cc.length)),n=this._subscribeDeferred;this._subscribeDeferred=null,n&&n.resolve(e.subscriptionId)}else if(t.startsWith(cu)){let e=JSON.parse(t.substring(cu.length)),n=this._subscribeDeferred;this._subscribeDeferred=null,n&&(console.warn("Unauthorized event subscription: "+JSON.stringify(e,null,2)),n.reject("Unauthorized"))}else if(t.startsWith(cm)){let e=JSON.parse(t.substring(cm.length));e.events&&e.events.forEach(t=>{this._onMessageReceived(e.subscriptionId,t)})}else if(t.startsWith(ch)){let e=JSON.parse(t.substring(ch.length));if(e.messageID){let t=this._repliesDeferred.get(e.messageID);this._repliesDeferred.delete(e.messageID),t&&t.resolve(e)}}}}),this._connectDeferred.promise}_beforeDisconnect(){this._onDisconnect()}_doDisconnect(){var e;null==(e=this._webSocket)||e.close(),this._subscribeDeferred=null,this._repliesDeferred.clear()}_doSubscribe(e){return this._webSocket?this._subscribeDeferred?Promise.reject("There's already a pending subscription"):(this._subscribeDeferred=new a9,e.subscriptionId||(e.subscriptionId=cb._subscriptionCounter+++""),this._webSocket.send("SUBSCRIBE:"+JSON.stringify(e)),this._subscribeDeferred.promise):Promise.reject("Not connected")}_doUnsubscribe(e){this._webSocket&&this._webSocket.send("UNSUBSCRIBE:"+JSON.stringify({subscriptionId:e}))}_doSend(e){let t=ch+JSON.stringify(e);this._webSocket.send(t)}_doSendWithReply(e){if(e.messageID||(e.messageID=(new Date().getTime()+10*Math.random()).toString(10)),this._repliesDeferred.has(e.messageID))return Promise.reject("There's already a pending send and reply with this ID");let t=new a9;return this._repliesDeferred.set(e.messageID,t),this._webSocket.send(ch+JSON.stringify(e)),t.promise}}cb._subscriptionCounter=1;let cp=["__proto__","constructor","prototype"];function c_(e){return!("string"!=typeof e||0===e.length||e.length>128||cp.indexOf(e)>-1||e.indexOf("..")>-1||e.indexOf("\\")>-1||/[?#%:\s]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function cg(e){return!(!c_(e)||e.indexOf("/")>-1||e.indexOf("@")>-1)}let cF={lng:cg,ns:function(e){return!(!c_(e)||e.indexOf("//")>-1)}};function cy(e){return"string"!=typeof e?e:e.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function cv(){return"function"==typeof XMLHttpRequest||"object"==typeof XMLHttpRequest}let cw=/\{\{(.+?)\}\}/g;function ck(e,t){let n=!1,o=e.replace(cw,(e,o)=>{let i=o.trim();if(cp.indexOf(i)>-1)return e;let r=t[i];if(null==r)return e;let a=cF[i]||cg,s=String(r).split("+");for(let t of s)if(!a(t))return n=!0,e;return s.join("+")});return n?null:o}let cE="u">typeof globalThis?globalThis:"u">typeof global?global:"u">typeof window?window:void 0;"function"==typeof fetch?i=fetch:cE&&"function"==typeof cE.fetch&&(i=cE.fetch);let cD=cv()&&cE?cE.XMLHttpRequest:void 0,cM="function"==typeof ActiveXObject&&cE?cE.ActiveXObject:void 0,cL=["__proto__","constructor","prototype"],cC=(e,t)=>{if(t&&"object"==typeof t){let n="";for(let e of Object.keys(t))cL.indexOf(e)>-1||(n+="&"+encodeURIComponent(e)+"="+encodeURIComponent(t[e]));if(!n)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+n.slice(1)}return e},cA=(e,t,n,o)=>{let r=e=>{if(!e.ok)return n(e.statusText||"Error",{status:e.status});e.text().then(t=>{n(null,{status:e.status,data:t})}).catch(n)};if(o){let i=o(e,t);if(i instanceof Promise)return void i.then(r).catch(n)}"function"==typeof fetch?fetch(e,t).then(r).catch(n):i(e,t).then(r).catch(n)},cT=(e,t,n,o)=>{if("function"==typeof n&&(o=n,n=void 0),o=o||(()=>{}),i&&0!==t.indexOf("file:")){var r=t,a=n,s=o;e.queryStringParams&&(r=cC(r,e.queryStringParams));let i={..."function"==typeof e.customHeaders?e.customHeaders():e.customHeaders};"u"<typeof window&&"u">typeof global&&void 0!==global.process&&global.process.versions&&global.process.versions.node&&(i["User-Agent"]=`i18next-http-backend (node/${global.process.version}; ${global.process.platform} ${global.process.arch})`),a&&(i["Content-Type"]="application/json");let d="function"==typeof e.requestOptions?e.requestOptions(a):e.requestOptions,l={method:a?"POST":"GET",body:a?e.stringify(a):void 0,headers:i,...e._omitFetchOptions?{}:d},c="function"==typeof e.alternateFetch&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{cA(r,l,s,c)}catch(t){if(!d||0===Object.keys(d).length||!t.message||0>t.message.indexOf("not implemented"))return s(t);try{Object.keys(d).forEach(e=>{delete l[e]}),cA(r,l,s,c),e._omitFetchOptions=!0}catch(e){s(e)}}return}if(cv()||"function"==typeof ActiveXObject){var d=t,l=n,c=o;l&&"object"==typeof l&&(l=cC("",l).slice(1)),e.queryStringParams&&(d=cC(d,e.queryStringParams));try{let t=cD?new cD:new cM("MSXML2.XMLHTTP.3.0");t.open(l?"POST":"GET",d,1),e.crossDomain||t.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.withCredentials=!!e.withCredentials,l&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),t.overrideMimeType&&t.overrideMimeType("application/json");let n=e.customHeaders;if(n="function"==typeof n?n():n)for(let e of Object.keys(n))cL.indexOf(e)>-1||t.setRequestHeader(e,n[e]);t.onreadystatechange=()=>{t.readyState>3&&c(t.status>=400?t.statusText:null,{status:t.status,data:t.responseText})},t.send(l)}catch(e){console&&console.log(e)}return}o(Error("No fetch and no xhr implementation found!"))};var cx=class{constructor(e,t={},n={}){this.services=e,this.options=t,this.allOptions=n,this.type="backend",this.init(e,t,n)}init(e,t={},n={}){if(this.services=e,this.options={...{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:e=>JSON.parse(e),stringify:JSON.stringify,parsePayload:(e,t,n)=>({[t]:n||""}),parseLoadPayload:(e,t)=>void 0,request:cT,reloadInterval:"u"<typeof window&&36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}},...this.options||{},...t},this.allOptions=n,this.services&&this.options.reloadInterval){let e=setInterval(()=>this.reload(),this.options.reloadInterval);"object"==typeof e&&"function"==typeof e.unref&&e.unref()}}readMulti(e,t,n){this._readAny(e,e,t,t,n)}read(e,t,n){this._readAny([e],e,[t],t,n)}_readAny(e,t,n,o,i){var r,a;let s=this.options.loadPath;"function"==typeof this.options.loadPath&&(s=this.options.loadPath(e,n)),(s=(a=r=s)&&"function"==typeof a.then?r:Promise.resolve(r)).then(r=>{if(!r)return i(null,{});let a=ck(r,{lng:e.join("+"),ns:n.join("+")});if(null==a)return i(Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+e.map(cy).join(", ")+"] namespaces=["+n.map(cy).join(", ")+"]"),!1);this.loadUrl(a,i,t,o)})}loadUrl(e,t,n,o){let i=this.options.parseLoadPayload("string"==typeof n?[n]:n,"string"==typeof o?[o]:o),r=cy(function(e){if("string"!=typeof e||0===e.length)return e;try{let t=new URL(e);if(t.username||t.password)return t.username="",t.password="",t.toString();return e}catch(t){return e.replace(/(\/\/)[^/@\s]+@/g,"$1")}}(e));this.options.request(this.options,e,i,(e,i)=>{let a,s;if(i&&(i.status>=500&&i.status<600||!i.status))return t("failed loading "+r+"; status code: "+i.status,!0);if(i&&i.status>=400&&i.status<500)return t("failed loading "+r+"; status code: "+i.status,!1);if(!i&&e&&e.message){let n=e.message.toLowerCase();if(["failed","fetch","network","load"].find(e=>n.indexOf(e)>-1))return t("failed loading "+r+": "+cy(e.message),!0)}if(e)return t(e,!1);try{a="string"==typeof i.data?this.options.parse(i.data,n,o):i.data}catch(e){s="failed parsing "+r+" to json"}if(s)return t(s,!1);t(null,a)})}create(e,t,n,o,i){if(!this.options.addPath)return;"string"==typeof e&&(e=[e]);let r=this.options.parsePayload(t,n,o),a=0,s=[],d=[];e.forEach(n=>{let o=this.options.addPath;"function"==typeof this.options.addPath&&(o=this.options.addPath(n,t));let l=ck(o,{lng:n,ns:t});if(null==l){a+=1,i&&a===e.length&&i(s,d);return}this.options.request(this.options,l,r,(t,n)=>{a+=1,s.push(t),d.push(n),a===e.length&&"function"==typeof i&&i(s,d)})})}reload(){let{backendConnector:e,languageUtils:t,logger:n}=this.services,o=e.language;if(o&&"cimode"===o.toLowerCase())return;let i=[],r=e=>{t.toResolveHierarchy(e).forEach(e=>{0>i.indexOf(e)&&i.push(e)})};r(o),this.allOptions.preload&&this.allOptions.preload.forEach(e=>r(e)),i.forEach(t=>{this.allOptions.ns.forEach(o=>{e.read(t,o,"read",null,null,(i,r)=>{i&&n.warn(`loading namespace ${o} for language ${t} failed`,i),!i&&r&&n.log(`loaded namespace ${o} for language ${t}`,r),e.loaded(`${t}|${o}`,i,r)})})})}};cx.type="backend";var cS=n(4954);class cY extends Error{}function cO(e,t){let n;if("string"!=typeof e)throw new cY("Invalid token specified: must be a string");t||(t={});let o=+(!0!==t.header),i=e.split(".")[o];if("string"!=typeof i)throw new cY(`Invalid token specified: missing part #${o+1}`);try{n=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw Error("base64 string is not of the correct length")}try{var n;return n=t,decodeURIComponent(atob(n).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}catch(e){return atob(t)}}(i)}catch(e){throw new cY(`Invalid token specified: invalid base64 for part #${o+1} (${e.message})`)}try{return JSON.parse(n)}catch(e){throw new cY(`Invalid token specified: invalid json for part #${o+1} (${e.message})`)}}if(cY.prototype.name="InvalidTokenError","u"<typeof Promise)throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function cI(e){if(!(this instanceof cI))throw Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var t,n,o=this,i=[],r={enable:!0,callbackList:[],interval:5},a=document.getElementsByTagName("script"),s=0;s<a.length;s++)(-1!==a[s].src.indexOf("keycloak.js")||-1!==a[s].src.indexOf("keycloak.min.js"))&&-1!==a[s].src.indexOf("version=")&&(o.iframeVersion=a[s].src.substring(a[s].src.indexOf("version=")+8).split("&")[0]);var d=!0,l=L(console.info),c=L(console.warn);function u(e,t){for(var n=function(e){var t=null,n=window.crypto||window.msCrypto;if(n&&n.getRandomValues&&window.Uint8Array)return t=new Uint8Array(e),n.getRandomValues(t),t;t=Array(e);for(var o=0;o<t.length;o++)t[o]=Math.floor(256*Math.random());return t}(e),o=Array(e),i=0;i<e;i++)o[i]=t.charCodeAt(n[i]%t.length);return String.fromCharCode.apply(null,o)}function m(){return void 0===o.authServerUrl?void 0:"/"==o.authServerUrl.charAt(o.authServerUrl.length-1)?o.authServerUrl+"realms/"+encodeURIComponent(o.realm):o.authServerUrl+"/realms/"+encodeURIComponent(o.realm)}function h(e,t){var n=e.code,i=e.error,r=e.prompt,a=new Date().getTime();if(e.kc_action_status&&o.onActionUpdate&&o.onActionUpdate(e.kc_action_status),i){if("none"!=r)if(e.error_description&&"authentication_expired"===e.error_description)o.login(e.loginOptions);else{var s={error:i,error_description:e.error_description};o.onAuthError&&o.onAuthError(s),t&&t.setError(s)}else t&&t.setSuccess();return}if("standard"!=o.flow&&(e.access_token||e.id_token)&&h(e.access_token,null,e.id_token,!0),"implicit"!=o.flow&&n){var c="code="+n+"&grant_type=authorization_code",u=o.endpoints.token(),m=new XMLHttpRequest;m.open("POST",u,!0),m.setRequestHeader("Content-type","application/x-www-form-urlencoded"),c+="&client_id="+encodeURIComponent(o.clientId)+"&redirect_uri="+e.redirectUri,e.pkceCodeVerifier&&(c+="&code_verifier="+e.pkceCodeVerifier),m.withCredentials=!0,m.onreadystatechange=function(){if(4==m.readyState)if(200==m.status){var e=JSON.parse(m.responseText);h(e.access_token,e.refresh_token,e.id_token,"standard"===o.flow),v()}else o.onAuthError&&o.onAuthError(),t&&t.setError()},m.send(c)}function h(n,i,r,s){b(n,i,r,a=(a+new Date().getTime())/2),d&&o.idTokenParsed&&o.idTokenParsed.nonce!=e.storedNonce?(l("[KEYCLOAK] Invalid nonce, clearing token"),o.clearToken(),t&&t.setError()):s&&(o.onAuthSuccess&&o.onAuthSuccess(),t&&t.setSuccess())}}function f(e){return 0==e.status&&e.responseText&&e.responseURL.startsWith("file:")}function b(e,t,n,i){if(o.tokenTimeoutHandle&&(clearTimeout(o.tokenTimeoutHandle),o.tokenTimeoutHandle=null),t?(o.refreshToken=t,o.refreshTokenParsed=cO(t)):(delete o.refreshToken,delete o.refreshTokenParsed),n?(o.idToken=n,o.idTokenParsed=cO(n)):(delete o.idToken,delete o.idTokenParsed),e){if(o.token=e,o.tokenParsed=cO(e),o.sessionId=o.tokenParsed.sid,o.authenticated=!0,o.subject=o.tokenParsed.sub,o.realmAccess=o.tokenParsed.realm_access,o.resourceAccess=o.tokenParsed.resource_access,i&&(o.timeSkew=Math.floor(i/1e3)-o.tokenParsed.iat),null!=o.timeSkew&&(l("[KEYCLOAK] Estimated time difference between browser and server is "+o.timeSkew+" seconds"),o.onTokenExpired)){var r=(o.tokenParsed.exp-new Date().getTime()/1e3+o.timeSkew)*1e3;l("[KEYCLOAK] Token expires in "+Math.round(r/1e3)+" s"),r<=0?o.onTokenExpired():o.tokenTimeoutHandle=setTimeout(o.onTokenExpired,r)}}else delete o.token,delete o.tokenParsed,delete o.subject,delete o.realmAccess,delete o.resourceAccess,o.authenticated=!1}function p(){var e="0123456789abcdef",t=u(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 _(e){var t=function(e){switch(o.flow){case"standard":t=["code","state","session_state","kc_action_status","iss"];break;case"implicit":t=["access_token","token_type","id_token","state","session_state","expires_in","kc_action_status","iss"];break;case"hybrid":t=["access_token","token_type","id_token","code","state","session_state","expires_in","kc_action_status","iss"]}t.push("error"),t.push("error_description"),t.push("error_uri");var t,n,i,r=e.indexOf("?"),a=e.indexOf("#");if("query"===o.responseMode&&-1!==r?(n=e.substring(0,r),""!==(i=g(e.substring(r+1,-1!==a?a:e.length),t)).paramsString&&(n+="?"+i.paramsString),-1!==a&&(n+=e.substring(a))):"fragment"===o.responseMode&&-1!==a&&(n=e.substring(0,a),""!==(i=g(e.substring(a+1),t)).paramsString&&(n+="#"+i.paramsString)),i&&i.oauthParams){if("standard"===o.flow||"hybrid"===o.flow){if((i.oauthParams.code||i.oauthParams.error)&&i.oauthParams.state)return i.oauthParams.newUrl=n,i.oauthParams}else if("implicit"===o.flow&&(i.oauthParams.access_token||i.oauthParams.error)&&i.oauthParams.state)return i.oauthParams.newUrl=n,i.oauthParams}}(e);if(t){var i=n.get(t.state);return i&&(t.valid=!0,t.redirectUri=i.redirectUri,t.storedNonce=i.nonce,t.prompt=i.prompt,t.pkceCodeVerifier=i.pkceCodeVerifier,t.loginOptions=i.loginOptions),t}}function g(e,t){for(var n=e.split("&"),o={paramsString:"",oauthParams:{}},i=0;i<n.length;i++){var r=n[i].indexOf("="),a=n[i].slice(0,r);-1!==t.indexOf(a)?o.oauthParams[a]=n[i].slice(r+1):(""!==o.paramsString&&(o.paramsString+="&"),o.paramsString+=n[i])}return o}function F(){var e={setSuccess:function(t){e.resolve(t)},setError:function(t){e.reject(t)}};return e.promise=new Promise(function(t,n){e.resolve=t,e.reject=n}),e}function y(){var e=F();if(!r.enable||r.iframe)return e.setSuccess(),e.promise;var t=document.createElement("iframe");r.iframe=t,t.onload=function(){var t=o.endpoints.authorize();"/"===t.charAt(0)?r.iframeOrigin=window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""):r.iframeOrigin=t.substring(0,t.indexOf("/",8)),e.setSuccess()};var n=o.endpoints.checkSessionIframe();return t.setAttribute("src",n),t.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),t.setAttribute("title","keycloak-session-iframe"),t.style.display="none",document.body.appendChild(t),window.addEventListener("message",function(e){if(e.origin===r.iframeOrigin&&r.iframe.contentWindow===e.source&&("unchanged"==e.data||"changed"==e.data||"error"==e.data)){"unchanged"!=e.data&&o.clearToken();for(var t=r.callbackList.splice(0,r.callbackList.length),n=t.length-1;n>=0;--n){var i=t[n];"error"==e.data?i.setError():i.setSuccess("unchanged"==e.data)}}},!1),e.promise}function v(){r.enable&&o.token&&setTimeout(function(){w().then(function(e){e&&v()})},1e3*r.interval)}function w(){var e=F();if(r.iframe&&r.iframeOrigin){var t=o.clientId+" "+(o.sessionId?o.sessionId:"");r.callbackList.push(e);var n=r.iframeOrigin;1==r.callbackList.length&&r.iframe.contentWindow.postMessage(t,n)}else e.setSuccess();return e.promise}function k(){var e,t,n,i=F();if(r.enable||o.silentCheckSsoRedirectUri){var a=document.createElement("iframe");a.setAttribute("src",o.endpoints.thirdPartyCookiesIframe()),a.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),a.setAttribute("title","keycloak-3p-check-iframe"),a.style.display="none",document.body.appendChild(a);var s=function(e){a.contentWindow===e.source&&("supported"===e.data||"unsupported"===e.data)&&("unsupported"===e.data&&(c("[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/docs/latest/securing_apps/#_modern_browsers"),r.enable=!1,o.silentCheckSsoFallback&&(o.silentCheckSsoRedirectUri=!1)),document.body.removeChild(a),window.removeEventListener("message",s),i.setSuccess())};window.addEventListener("message",s,!1)}else i.setSuccess();return e=i.promise,t=o.messageReceiveTimeout,n=null,Promise.race([e,new Promise(function(e,o){n=setTimeout(function(){o({error:"Timeout when waiting for 3rd party check iframe message."})},t)})]).finally(function(){clearTimeout(n)})}function E(e){if(!e||"default"==e)return{login:function(e){return window.location.assign(o.createLoginUrl(e)),F().promise},logout:async function(e){if("GET"===(e?.logoutMethod??o.logoutMethod))return void window.location.replace(o.createLogoutUrl(e));let n=o.createLogoutUrl(e),i=await fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({id_token_hint:o.idToken,client_id:o.clientId,post_logout_redirect_uri:t.redirectUri(e,!1)})});if(i.redirected){window.location.href=i.url;return}if(i.ok)return void window.location.reload();throw Error("Logout failed, request returned an error code.")},register:function(e){return window.location.assign(o.createRegisterUrl(e)),F().promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0!==e)window.location.href=e;else throw"Not supported by the OIDC server";return F().promise},redirectUri:function(e,t){return e&&e.redirectUri?e.redirectUri:o.redirectUri?o.redirectUri:location.href}};if("cordova"==e){r.enable=!1;var n=function(e,t,n){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(e,t,n):window.open(e,t,n)},i=function(e){var t=e&&e.cordovaOptions?Object.keys(e.cordovaOptions).reduce(function(t,n){return t[n]=e.cordovaOptions[n],t},{}):{};return t.location="no",e&&"none"==e.prompt&&(t.hidden="yes"),Object.keys(t).reduce(function(e,n){return e.push(n+"="+t[n]),e},[]).join(",")},a=function(){return o.redirectUri||"http://localhost"};return{login:function(e){var t=F(),r=i(e),s=n(o.createLoginUrl(e),"_blank",r),d=!1,l=!1,c=function(){l=!0,s.close()};return s.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&(h(_(e.url),t),c(),d=!0)}),s.addEventListener("loaderror",function(e){d||(0==e.url.indexOf(a())?(h(_(e.url),t),c(),d=!0):(t.setError(),c()))}),s.addEventListener("exit",function(e){l||t.setError({reason:"closed_by_user"})}),t.promise},logout:function(e){var t,i=F(),r=n(o.createLogoutUrl(e),"_blank","location=no,hidden=yes,clearcache=yes");return r.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&r.close()}),r.addEventListener("loaderror",function(e){0==e.url.indexOf(a())||(t=!0),r.close()}),r.addEventListener("exit",function(e){t?i.setError():(o.clearToken(),i.setSuccess())}),i.promise},register:function(e){var t=F(),r=n(o.createRegisterUrl(),"_blank",i(e));return r.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&(r.close(),h(_(e.url),t))}),t.promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0!==e){var t=n(e,"_blank","location=no");t.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&t.close()})}else throw"Not supported by the OIDC server"},redirectUri:function(e){return a()}}}if("cordova-native"==e)return r.enable=!1,{login:function(e){var t=F(),n=o.createLoginUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),h(_(e.url),t)}),window.cordova.plugins.browsertab.openUrl(n),t.promise},logout:function(e){var t=F(),n=o.createLogoutUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),o.clearToken(),t.setSuccess()}),window.cordova.plugins.browsertab.openUrl(n),t.promise},register:function(e){var t=F(),n=o.createRegisterUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),h(_(e.url),t)}),window.cordova.plugins.browsertab.openUrl(n),t.promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0!==e)window.cordova.plugins.browsertab.openUrl(e);else throw"Not supported by the OIDC server"},redirectUri:function(e){return e&&e.redirectUri?e.redirectUri:o.redirectUri?o.redirectUri:"http://localhost"}};throw"invalid adapter type: "+e}o.init=function(i){if(o.didInitialize)throw Error("A 'Keycloak' instance can only be initialized once.");if(o.didInitialize=!0,o.authenticated=!1,n=function(){try{return new D}catch(e){}return new M}(),t=i&&["default","cordova","cordova-native"].indexOf(i.adapter)>-1?E(i.adapter):i&&"object"==typeof i.adapter?i.adapter:window.Cordova||window.cordova?E("cordova"):E(),i){if(void 0!==i.useNonce&&(d=i.useNonce),void 0!==i.checkLoginIframe&&(r.enable=i.checkLoginIframe),i.checkLoginIframeInterval&&(r.interval=i.checkLoginIframeInterval),"login-required"===i.onLoad&&(o.loginRequired=!0),i.responseMode)if("query"===i.responseMode||"fragment"===i.responseMode)o.responseMode=i.responseMode;else throw"Invalid value for responseMode";if(i.flow){switch(i.flow){case"standard":o.responseType="code";break;case"implicit":o.responseType="id_token token";break;case"hybrid":o.responseType="code id_token token";break;default:throw"Invalid value for flow"}o.flow=i.flow}if(null!=i.timeSkew&&(o.timeSkew=i.timeSkew),i.redirectUri&&(o.redirectUri=i.redirectUri),i.silentCheckSsoRedirectUri&&(o.silentCheckSsoRedirectUri=i.silentCheckSsoRedirectUri),"boolean"==typeof i.silentCheckSsoFallback?o.silentCheckSsoFallback=i.silentCheckSsoFallback:o.silentCheckSsoFallback=!0,void 0!==i.pkceMethod){if("S256"!==i.pkceMethod&&!1!==i.pkceMethod)throw TypeError(`Invalid value for pkceMethod', expected 'S256' or false but got ${i.pkceMethod}.`);o.pkceMethod=i.pkceMethod}else o.pkceMethod="S256";"boolean"==typeof i.enableLogging?o.enableLogging=i.enableLogging:o.enableLogging=!1,"POST"===i.logoutMethod?o.logoutMethod="POST":o.logoutMethod="GET","string"==typeof i.scope&&(o.scope=i.scope),"string"==typeof i.acrValues&&(o.acrValues=i.acrValues),"number"==typeof i.messageReceiveTimeout&&i.messageReceiveTimeout>0?o.messageReceiveTimeout=i.messageReceiveTimeout:o.messageReceiveTimeout=1e4}o.responseMode||(o.responseMode="fragment"),o.responseType||(o.responseType="code",o.flow="standard");var a=F(),s=F();s.promise.then(function(){o.onReady&&o.onReady(o.authenticated),a.setSuccess(o.authenticated)}).catch(function(e){a.setError(e)});var l=function(){var t=F();function n(e){e?o.endpoints={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}}:o.endpoints={authorize:function(){return m()+"/protocol/openid-connect/auth"},token:function(){return m()+"/protocol/openid-connect/token"},logout:function(){return m()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var e=m()+"/protocol/openid-connect/login-status-iframe.html";return o.iframeVersion&&(e=e+"?version="+o.iframeVersion),e},thirdPartyCookiesIframe:function(){var e=m()+"/protocol/openid-connect/3p-cookies/step1.html";return o.iframeVersion&&(e=e+"?version="+o.iframeVersion),e},register:function(){return m()+"/protocol/openid-connect/registrations"},userinfo:function(){return m()+"/protocol/openid-connect/userinfo"}}}if(e?"string"==typeof e&&(a=e):a="keycloak.json",a){var i=new XMLHttpRequest;i.open("GET",a,!0),i.setRequestHeader("Accept","application/json"),i.onreadystatechange=function(){if(4==i.readyState)if(200==i.status||f(i)){var e=JSON.parse(i.responseText);o.authServerUrl=e["auth-server-url"],o.realm=e.realm,o.clientId=e.resource,n(null),t.setSuccess()}else t.setError()},i.send()}else{if(!e.clientId)throw"clientId missing";o.clientId=e.clientId;var r=e.oidcProvider;if(r)if("string"==typeof r){var a,s="/"==r.charAt(r.length-1)?r+".well-known/openid-configuration":r+"/.well-known/openid-configuration",i=new XMLHttpRequest;i.open("GET",s,!0),i.setRequestHeader("Accept","application/json"),i.onreadystatechange=function(){4==i.readyState&&(200==i.status||f(i)?(n(JSON.parse(i.responseText)),t.setSuccess()):t.setError())},i.send()}else n(r),t.setSuccess();else{if(!e.url){for(var d=document.getElementsByTagName("script"),l=0;l<d.length;l++)if(d[l].src.match(/.*keycloak\.js/)){e.url=d[l].src.substr(0,d[l].src.indexOf("/js/keycloak.js"));break}}if(!e.realm)throw"realm missing";o.authServerUrl=e.url,o.realm=e.realm,n(null),t.setSuccess()}}return t.promise}();function c(){var e=function(e){e||(n.prompt="none"),i&&i.locale&&(n.locale=i.locale),o.login(n).then(function(){s.setSuccess()}).catch(function(e){s.setError(e)})},t=function(){var e=document.createElement("iframe"),t=o.createLoginUrl({prompt:"none",redirectUri:o.silentCheckSsoRedirectUri});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);var n=function(t){t.origin===window.location.origin&&e.contentWindow===t.source&&(h(_(t.data),s),document.body.removeChild(e),window.removeEventListener("message",n))};window.addEventListener("message",n)},n={};switch(i.onLoad){case"check-sso":r.enable?y().then(function(){w().then(function(n){n?s.setSuccess():o.silentCheckSsoRedirectUri?t():e(!1)}).catch(function(e){s.setError(e)})}):o.silentCheckSsoRedirectUri?t():e(!1);break;case"login-required":e(!0);break;default:throw"Invalid value for onLoad"}}function u(){var e=_(window.location.href);if(e&&window.history.replaceState(window.history.state,null,e.newUrl),e&&e.valid)return y().then(function(){h(e,s)}).catch(function(e){s.setError(e)});i?i.token&&i.refreshToken?(b(i.token,i.refreshToken,i.idToken),r.enable?y().then(function(){w().then(function(e){e?(o.onAuthSuccess&&o.onAuthSuccess(),s.setSuccess(),v()):s.setSuccess()}).catch(function(e){s.setError(e)})}):o.updateToken(-1).then(function(){o.onAuthSuccess&&o.onAuthSuccess(),s.setSuccess()}).catch(function(e){o.onAuthError&&o.onAuthError(),i.onLoad?c():s.setError(e)})):i.onLoad?c():s.setSuccess():s.setSuccess()}return l.then(function(){var e,t;(e=F(),t=function(){("interactive"===document.readyState||"complete"===document.readyState)&&(document.removeEventListener("readystatechange",t),e.setSuccess())},document.addEventListener("readystatechange",t),t(),e.promise).then(k).then(u).catch(function(e){a.setError(e)})}),l.catch(function(e){a.setError(e)}),a.promise},o.login=function(e){return t.login(e)},o.createLoginUrl=function(e){var i,r=p(),a=p(),s=t.redirectUri(e),l={state:r,nonce:a,redirectUri:encodeURIComponent(s),loginOptions:e};e&&e.prompt&&(l.prompt=e.prompt),i=e&&"register"==e.action?o.endpoints.register():o.endpoints.authorize();var c=e&&e.scope||o.scope;c?-1===c.indexOf("openid")&&(c="openid "+c):c="openid";var m=i+"?client_id="+encodeURIComponent(o.clientId)+"&redirect_uri="+encodeURIComponent(s)+"&state="+encodeURIComponent(r)+"&response_mode="+encodeURIComponent(o.responseMode)+"&response_type="+encodeURIComponent(o.responseType)+"&scope="+encodeURIComponent(c);if(d&&(m=m+"&nonce="+encodeURIComponent(a)),e&&e.prompt&&(m+="&prompt="+encodeURIComponent(e.prompt)),e&&e.maxAge&&(m+="&max_age="+encodeURIComponent(e.maxAge)),e&&e.loginHint&&(m+="&login_hint="+encodeURIComponent(e.loginHint)),e&&e.idpHint&&(m+="&kc_idp_hint="+encodeURIComponent(e.idpHint)),e&&e.action&&"register"!=e.action&&(m+="&kc_action="+encodeURIComponent(e.action)),e&&e.locale&&(m+="&ui_locales="+encodeURIComponent(e.locale)),e&&e.acr&&(m+="&claims="+encodeURIComponent(JSON.stringify({id_token:{acr:e.acr}}))),(e&&e.acrValues||o.acrValues)&&(m+="&acr_values="+encodeURIComponent(e.acrValues||o.acrValues)),o.pkceMethod){var h=u(96,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");l.pkceCodeVerifier=h,m+="&code_challenge="+function(e,t){if("S256"!==e)throw TypeError(`Invalid value for 'pkceMethod', expected 'S256' but got '${e}'.`);return btoa(String.fromCodePoint(...new Uint8Array(cS.arrayBuffer(t)))).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}(o.pkceMethod,h)+"&code_challenge_method="+o.pkceMethod}return n.add(l),m},o.logout=function(e){return t.logout(e)},o.createLogoutUrl=function(e){if("POST"===(e?.logoutMethod??o.logoutMethod))return o.endpoints.logout();var n=o.endpoints.logout()+"?client_id="+encodeURIComponent(o.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(t.redirectUri(e,!1));return o.idToken&&(n+="&id_token_hint="+encodeURIComponent(o.idToken)),n},o.register=function(e){return t.register(e)},o.createRegisterUrl=function(e){return e||(e={}),e.action="register",o.createLoginUrl(e)},o.createAccountUrl=function(e){var n=m(),i=void 0;return void 0!==n&&(i=n+"/account?referrer="+encodeURIComponent(o.clientId)+"&referrer_uri="+encodeURIComponent(t.redirectUri(e))),i},o.accountManagement=function(){return t.accountManagement()},o.hasRealmRole=function(e){var t=o.realmAccess;return!!t&&t.roles.indexOf(e)>=0},o.hasResourceRole=function(e,t){if(!o.resourceAccess)return!1;var n=o.resourceAccess[t||o.clientId];return!!n&&n.roles.indexOf(e)>=0},o.loadUserProfile=function(){var e=m()+"/account",t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+o.token);var n=F();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(o.profile=JSON.parse(t.responseText),n.setSuccess(o.profile)):n.setError())},t.send(),n.promise},o.loadUserInfo=function(){var e=o.endpoints.userinfo(),t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+o.token);var n=F();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(o.userInfo=JSON.parse(t.responseText),n.setSuccess(o.userInfo)):n.setError())},t.send(),n.promise},o.isTokenExpired=function(e){if(!o.tokenParsed||!o.refreshToken&&"implicit"!=o.flow)throw"Not authenticated";if(null==o.timeSkew)return l("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var t=o.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+o.timeSkew;if(e){if(isNaN(e))throw"Invalid minValidity";t-=e}return t<0},o.updateToken=function(e){var t=F();if(!o.refreshToken)return t.setError(),t.promise;e=e||5;var n=function(){var n=!1;if(-1==e?(n=!0,l("[KEYCLOAK] Refreshing token: forced refresh")):(!o.tokenParsed||o.isTokenExpired(e))&&(n=!0,l("[KEYCLOAK] Refreshing token: token expired")),n){var r="grant_type=refresh_token&refresh_token="+o.refreshToken,a=o.endpoints.token();if(i.push(t),1==i.length){var s=new XMLHttpRequest;s.open("POST",a,!0),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),s.withCredentials=!0,r+="&client_id="+encodeURIComponent(o.clientId);var d=new Date().getTime();s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status){l("[KEYCLOAK] Token refreshed"),d=(d+new Date().getTime())/2;var e=JSON.parse(s.responseText);b(e.access_token,e.refresh_token,e.id_token,d),o.onAuthRefreshSuccess&&o.onAuthRefreshSuccess();for(var t=i.pop();null!=t;t=i.pop())t.setSuccess(!0)}else{c("[KEYCLOAK] Failed to refresh token"),400==s.status&&o.clearToken(),o.onAuthRefreshError&&o.onAuthRefreshError();for(var t=i.pop();null!=t;t=i.pop())t.setError(!0)}},s.send(r)}}else t.setSuccess(!1)};return r.enable?w().then(function(){n()}).catch(function(e){t.setError(e)}):n(),t.promise},o.clearToken=function(){o.token&&(b(null,null,null),o.onAuthLogout&&o.onAuthLogout(),o.loginRequired&&o.login())};var D=function(){if(!(this instanceof D))return new D;function e(){for(var e=new Date().getTime(),t=0;t<localStorage.length;t++){var n=localStorage.key(t);if(n&&0==n.indexOf("kc-callback-")){var o=localStorage.getItem(n);if(o)try{var i=JSON.parse(o).expires;(!i||i<e)&&localStorage.removeItem(n)}catch(e){localStorage.removeItem(n)}}}}localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test"),this.get=function(t){if(t){var n="kc-callback-"+t,o=localStorage.getItem(n);return o&&(localStorage.removeItem(n),o=JSON.parse(o)),e(),o}},this.add=function(t){e();var n="kc-callback-"+t.state;t.expires=new Date().getTime()+36e5,localStorage.setItem(n,JSON.stringify(t))}},M=function(){if(!(this instanceof M))return new M;this.get=function(o){if(o){var i=t("kc-callback-"+o);if(n("kc-callback-"+o,"",e(-100)),i)return JSON.parse(i)}},this.add=function(t){n("kc-callback-"+t.state,JSON.stringify(t),e(60))},this.removeItem=function(t){n(t,"",e(-100))};var e=function(e){var t=new Date;return t.setTime(t.getTime()+60*e*1e3),t},t=function(e){for(var t=e+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){for(var i=n[o];" "==i.charAt(0);)i=i.substring(1);if(0==i.indexOf(t))return i.substring(t.length,i.length)}return""},n=function(e,t,n){var o=e+"="+t+"; expires="+n.toUTCString()+"; ";document.cookie=o}};function L(e){return function(){o.enableLogging&&e.apply(console,Array.prototype.slice.call(arguments))}}}var cP=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function a(e){try{d(o.next(e))}catch(e){r(e)}}function s(e){try{d(o.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}d((o=o.apply(e,t||[])).next())})};let cB="openremote";(ew=tL||(tL={})).MANAGER_FAILED_TO_LOAD="MANAGER_FAILED_TO_LOAD",ew.AUTH_FAILED="AUTH_FAILED",ew.AUTH_TYPE_UNSUPPORTED="AUTH_TYPE_UNSUPPORTED",ew.CONSOLE_ERROR="CONSOLE_INIT_ERROR",ew.EVENTS_CONNECTION_ERROR="EVENTS_CONNECTION_ERROR",ew.TRANSLATION_ERROR="TRANSLATION_ERROR",(ek=tC||(tC={})).ERROR="ERROR",ek.READY="READY",ek.ONLINE="ONLINE",ek.OFFLINE="OFFLINE",ek.CONNECTING="CONNECTING",ek.CONSOLE_INIT="CONSOLE_INIT",ek.CONSOLE_READY="CONSOLE_READY",ek.TRANSLATE_INIT="TRANSLATE_INIT",ek.TRANSLATE_LANGUAGE_CHANGED="TRANSLATE_LANGUAGE_CHANGED",ek.DISPLAY_REALM_CHANGED="DISPLAY_REALM_CHANGED",ek.LOGIN="LOGIN";let cR={cn:"zh-cn"};class cN{constructor(){this._authenticated=!1,this._ready=!1,this._name="",this._username="",this._keycloakUpdateTokenInterval=void 0,this._managerVersion="",this._authServerUrl="",this._listeners=[],this._disconnected=!1}get username(){return this._username}get error(){return this._error}get authenticated(){return this._authenticated}get ready(){return this._ready}get config(){return this._config}get roles(){let e=new Map;return this._keycloak&&this._keycloak.resourceAccess&&this._config.clientId&&this._keycloak.resourceAccess&&Object.entries(this._keycloak.resourceAccess).forEach(([t,n])=>{let o=n.roles;e.set(t,o)}),e}get managerVersion(){return this._managerVersion}get isManagerAvailable(){return this._managerVersion&&""!==this._managerVersion}get managerUrl(){var e;return null==(e=this._config)?void 0:e.managerUrl}get keycloakUrl(){var e;return null==(e=this._config)?void 0:e.keycloakUrl}get isError(){return!!this._error}get connectionStatus(){return this._events&&this._events.status}get console(){return this._console}get consoleAppConfig(){return this._consoleAppConfig}get events(){return this._events}get rest(){return cd}get language(){return oL.language}set language(e){console.debug(`Changing language to ${e}.`),e&&(oL.changeLanguage(e),this.console.storeData("LANGUAGE",e),this.authenticated&&this.updateKeycloakUserLanguage(e).catch(e=>console.error(e)))}get displayRealm(){return this._displayRealm||this._config.realm}set displayRealm(e){this.isSuperUser()&&this._displayRealm!==e&&(this._displayRealm=e,this._emitEvent(tC.DISPLAY_REALM_CHANGED))}get clientId(){return this._config.clientId||cB}getEventProvider(){return this.events}isManagerSameOrigin(){if(!this.ready)return!1;let e=new URL(this._config.managerUrl),t=window.location;return e.protocol===t.protocol&&e.hostname===t.hostname&&e.port===t.port}addListener(e){0>this._listeners.indexOf(e)&&this._listeners.push(e)}removeListener(e){let t=this._listeners.indexOf(e);t>=0&&this._listeners.splice(t,1)}init(e){return cP(this,void 0,void 0,function*(){let t;this._config&&console.debug("Already initialised"),this._config=((t=e?Object.assign({},e):{}).managerUrl&&""!==t.managerUrl?t.managerUrl=t.managerUrl.replace(/\/+$/,""):t.managerUrl=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")+window.location.pathname.replace(/\/[^/]+\/?$/,""),t.realm&&""!==t.realm||(t.realm="master"),t.auth||(t.auth="KEYCLOAK"),void 0===t.consoleAutoEnable&&(t.consoleAutoEnable=!0),void 0===t.applyConfigToAdmin&&(t.applyConfigToAdmin=!0),t.eventProviderType||(t.eventProviderType="WEBSOCKET"),(!t.pollingIntervalMillis||t.pollingIntervalMillis<5e3)&&(t.pollingIntervalMillis=1e4),void 0===t.loadIcons&&(t.loadIcons=!0),void 0===t.loadTranslations&&(t.loadTranslations=["or"]),void 0===t.translationsLoadPath&&(t.translationsLoadPath="locales/{{lng}}/{{ns}}.json"),void 0===t.loadDescriptors&&(t.loadDescriptors=!0),void 0===t.clientId&&(t.clientId=cB),t);let n=yield this.loadManagerInfo(),o=new si(this._config.realm,this._config.consoleAutoEnable,()=>{this._emitEvent(tC.CONSOLE_READY)});if(this._console=o,"KEYCLOAK"===this._config.auth){if(!this._config.keycloakUrl&&this._authServerUrl){let e,t=new URL(this._config.managerUrl);this._authServerUrl.startsWith("//")?(this._authServerUrl=t.protocol+this._authServerUrl,this._config.keycloakUrl=this._authServerUrl):this._authServerUrl.startsWith("http")?this._config.keycloakUrl=this._authServerUrl:((e=new URL(t)).pathname=this._authServerUrl,e.protocol||(e.protocol=t.protocol),e.hostname||(e.hostname=t.hostname),e.port||(e.port=t.port),this._config.keycloakUrl=e.toString())}this._config.keycloakUrl||(this._config.keycloakUrl=this._config.managerUrl+"/auth"),this._config.keycloakUrl=this._config.keycloakUrl.replace(/\/+$/,""),n=yield this.doAuthInit()}return!!n&&(n&&(n=this.doRestApiInit()),(yield this.doConsoleInit())&&this._clearWebHistory(),(n=(yield this.doTranslateInit())&&n)&&(n=yield this.doDescriptorsInit(),n=yield this.getConsoleAppConfig()),this.doIconInit(),n?(n=yield this.doEventsSubscriptionInit(),this._ready=!0,this._emitEvent(tC.READY)):(this._config=void 0,console.warn("Failed to initialise the manager")),this.displayRealm=e.realm||"master",n)})}loadManagerInfo(){return cP(this,void 0,void 0,function*(){try{let e=yield new Promise((e,t)=>{let n=new XMLHttpRequest;n.addEventListener("load",()=>{e(JSON.parse(n.responseText))}),n.addEventListener("error",()=>{t(Error("Failed to contact the manager"))}),n.open("GET",this._config.managerUrl+"/api/master/info"),n.send()});return this._managerVersion=e&&e.version?e.version:"",this._authServerUrl=e&&e.authServerUrl?e.authServerUrl:"",!0}catch(e){return console.error("Failed to contact the manager",e),this._setError(tL.MANAGER_FAILED_TO_LOAD),!1}})}doTranslateInit(){return cP(this,void 0,void 0,function*(){if(oL.isInitialized)return!0;oL.on("initialized",e=>{this._emitEvent(tC.TRANSLATE_INIT)}),oL.on("languageChanged",e=>{var t;a7().locale(null!=(t=cR[e])?t:e),this._emitEvent(tC.TRANSLATE_LANGUAGE_CHANGED)});let e={lng:(yield this.getConsolePreferredLanguage())||(yield this.getUserPreferredLanguage())||this.config.defaultLanguage||"en",fallbackLng:"en",defaultNS:"app",fallbackNS:"or",ns:this.config.loadTranslations,backend:{loadPath:(e,t)=>1===t.length&&"or"===t[0]?this.config.managerUrl+"/shared/locales/{{lng}}/{{ns}}.json":this.config.translationsLoadPath?this.config.translationsLoadPath:"locales/{{lng}}/{{ns}}.json"}};this.config.configureTranslationsOptions&&this.config.configureTranslationsOptions(e);try{yield oL.use(cx).init(e),oL.services.formatter.add("uppercase",e=>"string"==typeof e?e.toUpperCase():String(e)),oL.services.formatter.add("lll",(e,t)=>{var n;return a7()(e).locale(null!=(n=cR[t])?n:t).format("lll")}),oL.services.formatter.add("llll",(e,t,n)=>{var o;return a7()(e).locale(null!=(o=cR[t])?o:t).format((null==n?void 0:n.weekday)==="long"?"LLLL":"llll")})}catch(e){return console.error(e),this._setError(tL.TRANSLATION_ERROR),!1}return!0})}doDescriptorsInit(){return cP(this,void 0,void 0,function*(){if(!this.config.loadDescriptors)return!0;try{let e=yield cd.api.AssetModelResource.getAssetInfos(),t=yield cd.api.AssetModelResource.getMetaItemDescriptors(),n=yield cd.api.AssetModelResource.getValueDescriptors();n$._assetTypeInfos=e.data,n$._metaItemDescriptors=Object.values(t.data),n$._valueDescriptors=Object.values(n.data)}catch(e){return console.error(e),!1}return!0})}doAuthInit(){return cP(this,void 0,void 0,function*(){let e=!0;switch(this._config.auth){case"KEYCLOAK":e=yield this.loadAndInitialiseKeycloak();break;case"NONE":return!0;default:return this._setError(tL.AUTH_TYPE_UNSUPPORTED),!1}return!!e&&(cd.addRequestInterceptor(e=>{if(!e.headers.Authorization){let t=this.getAuthorizationHeader();t&&(e.headers.Authorization=t)}return e}),e)})}doRestApiInit(){return cd.setTimeout(2e4),cd.initialise(this.getApiBaseUrl()),!0}doEventsSubscriptionInit(){return cP(this,void 0,void 0,function*(){let e=!1;return"WEBSOCKET"===this._config.eventProviderType&&(this._events=new cb(this._config.managerUrl),this._events.subscribeStatusChange(e=>this._onEventProviderStatusChanged(e)),e=yield this._events.connect()),e||this._setError(tL.EVENTS_CONNECTION_ERROR),e})}_connectEvents(){var e;(null==(e=this.events)?void 0:e.status)===tM.DISCONNECTED?this.events.connect().catch(e=>{console.error("Failed to connect EventProvider."),console.error(e)}):console.warn("Tried to connect EventProvider, but it wasn't disconnected!")}_onEventProviderStatusChanged(e){switch(e){case tM.DISCONNECTED:this._onDisconnect();break;case tM.CONNECTED:break;case tM.CONNECTING:this._emitEvent(tC.CONNECTING)}}doConsoleInit(){return cP(this,void 0,void 0,function*(){try{return yield this.console.initialise(),this._emitEvent(tC.CONSOLE_INIT),!0}catch(e){return this._setError(tL.CONSOLE_ERROR),!1}})}doIconInit(){var e;this._config.loadIcons&&(nG.addIconSet("mdi",(e=cj.managerUrl,{getIconTemplate:e=>nm`<span style="font-family: 'Material Design Icons';" class="mdi-${e}"></span>`,onAdd(){let t=document.createElement("style");t.id="mdiFontStyle",t.textContent='@font-face {\n font-family: "Material Design Icons";\n src: url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.woff2") format("woff2");\n font-weight: normal;\n font-style: normal;\n}',document.head.appendChild(t)}})),nG.addIconSet("or",{getIconTemplate:e=>{let t=nW[e];return t?nm`
1717
1717
  <svg
1718
1718
  xmlns="http://www.w3.org/2000/svg"
1719
1719
  viewBox="0 0 ${24} ${24}"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openremote/or-scheduler",
3
- "version": "1.32.0",
3
+ "version": "1.32.1",
4
4
  "description": "OpenRemote scheduler UI component",
5
5
  "customElements": "build/custom-elements.json",
6
6
  "main": "build/dist/umd/index.bundle.js",
@@ -23,21 +23,21 @@
23
23
  },
24
24
  "author": "OpenRemote",
25
25
  "license": "AGPL-3.0-or-later",
26
- "repository": "https://github.com/openremote/openremote",
26
+ "repository": "https://github.com/openremote/core",
27
27
  "dependencies": {
28
- "@openremote/core": "1.32.0",
29
- "@openremote/model": "1.32.0",
30
- "@openremote/or-element": "1.32.0",
31
- "@openremote/or-icon": "1.32.0",
32
- "@openremote/or-translate": "1.32.0",
33
- "@openremote/or-vaadin-components": "1.32.0",
34
- "@openremote/theme": "1.32.0",
28
+ "@openremote/core": "1.32.1",
29
+ "@openremote/model": "1.32.1",
30
+ "@openremote/or-element": "1.32.1",
31
+ "@openremote/or-icon": "1.32.1",
32
+ "@openremote/or-translate": "1.32.1",
33
+ "@openremote/or-vaadin-components": "1.32.1",
34
+ "@openremote/theme": "1.32.1",
35
35
  "lit": "^3.3.1",
36
36
  "moment": "^2.31.0",
37
37
  "rrule": "^2.6.4"
38
38
  },
39
39
  "devDependencies": {
40
- "@openremote/util": "1.32.0"
40
+ "@openremote/util": "1.32.1"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public"