@openremote/or-scheduler 1.30.0-snapshot.20260902114525 → 1.30.0
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.
|
@@ -2108,7 +2108,7 @@ var ORScheduler;(()=>{var e={3260(e){"use strict";let t=(async function(){}).con
|
|
|
2108
2108
|
<slot name="footer" slot="footer"></slot>
|
|
2109
2109
|
<slot></slot>
|
|
2110
2110
|
</vaadin-dialog-overlay>
|
|
2111
|
-
`}updated(e){super.updated(e),e.has("headerTitle")&&(this.ariaLabel=this.headerTitle)}}nJ(sY),o(4532);var sW=o(4867),sG=o.n(sW);o(3472);class sK{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 sJ(e,t,o=!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(o){if(Array.isArray(e))return e.every((e,o)=>sJ(e,t[o]));let o=Object.keys(e);return Object.keys(t).every(e=>-1!==o.indexOf(e))&&o.every(o=>sJ(e[o],t[o]))}return!1}class sX{constructor(e){e&&Object.assign(this,e)}matches(e){var t,o,n,i,r,a,s;if((null==(t=this.ids)?void 0:t.length)&&(!e.id||!this.ids.includes(e.id))||(null==(o=this.types)?void 0:o.length)&&(!e.type||!this.types.includes(e.type))||(null==(n=this.realm)?void 0:n.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 o;return(null!=(o=e.path)?o:[]).every((e,o)=>t[o]===e)}))return!1}return(null==(s=this.names)||!s.length||!!this.names.every(t=>sX._evalValuePredicate(e.name,t)))&&(!this.attributes||sX._evalGroup(e,this.attributes))}static getUnsupportedFields(e){return Object.keys(e).filter(e=>!sX._SUPPORTED_FIELDS.has(e))}collectAttributeNames(){return this.attributes?sX._collectNames(this.attributes):[]}static _evalValuePredicate(e,t){var o;switch(t.predicateType){case"string":{let n;if(null==e)return!1;let i=!1!==t.caseSensitive?String(e):String(e).toLowerCase(),r=!1!==t.caseSensitive?t.value:null==(o=t.value)?void 0:o.toLowerCase();switch(t.match){case"BEGIN":n=i.startsWith(r);break;case"END":n=i.endsWith(r);break;case"CONTAINS":n=i.includes(r);break;default:n=i===r}return t.negate?!n:n}case"boolean":return e===t.value;case"number":{let o;if("number"!=typeof e)return!1;switch(t.operator){case"GREATER_THAN":o=e>t.value;break;case"GREATER_EQUALS":o=e>=t.value;break;case"LESS_THAN":o=e<t.value;break;case"LESS_EQUALS":o=e<=t.value;break;case"BETWEEN":o=e>=t.value&&e<=t.rangeValue;break;default:o=e===t.value}return t.negate?!o:o}}return!1}static _evalPredicate(e,t){var o,n;let i=null==(o=t.name)?void 0:o.value;if(!i)return!0;let r=null==(n=e.attributes)?void 0:n[i];if(!r)return!!t.negated;let a=!t.value||sX._evalValuePredicate(r.value,t.value);return t.negated?!a:a}static _evalGroup(e,t){var o,n,i;let r=null!=(o=t.operator)?o:"AND",a=[...(null!=(n=t.items)?n:[]).map(t=>sX._evalPredicate(e,t)),...(null!=(i=t.groups)?i:[]).map(t=>sX._evalGroup(e,t))];return!a.length||("OR"===r?a.some(Boolean):a.every(Boolean))}static _collectNames(e){var t,o;return[...(null!=(t=e.items)?t:[]).map(e=>{var t;return null==(t=e.name)?void 0:t.value}).filter(e=>!!e),...(null!=(o=e.groups)?o:[]).flatMap(e=>sX._collectNames(e))]}}sX._SUPPORTED_FIELDS=new Set(["ids","types","names","parents","paths","realm","attributes"]);var sQ=function(e,t,o,n){return new(o||(o=Promise))(function(i,r){function a(e){try{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(a,s)}l((n=n.apply(e,t||[])).next())})};let sZ=o(4461);class s0{constructor(e,t,o){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=o,window.OpenRemoteConsole=this;let n=new URLSearchParams(window.location.search),i=n.get("consoleName"),r=n.get("consoleVersion"),a=n.get("consolePlatform"),s=n.get("consoleProviders"),l=n.get("consoleAutoEnable"),c=s&&s.length>0?s.split(" "):["push"];this._pendingProviderEnables=c;let d=s0._createConsoleRegistration(),u=window.localStorage.getItem(this._storageKey);if(u)try{let e=JSON.parse(u);e.id&&(d.id=e.id),e.name&&(d.name=e.name),e.providers&&(d.providers=e.providers),e.apps&&(d.apps=e.apps)}catch(e){console.error("Failed to deserialise console registration")}let f=d.providers;for(let e of(d.providers={},c)){let t=f&&f.hasOwnProperty(e)?f[e]:{enabled:!1,disabled:!1};d.providers[e]=t}let h=ul.getAppName();h.length>0&&0>d.apps.indexOf(h)&&d.apps.push(h),this._registration=d,i&&(d.name=i),r&&(d.version=r),a&&(d.platform=a),l&&(this._autoEnable="TRUE"===l||"true"===l)}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 sQ(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 sQ(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 sQ(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 o={provider:e,action:"PROVIDER_ENABLE",consoleId:this._registration.id,data:t},n=yield this.sendProviderMessage(o,!0);this._registration.providers[e].hasPermission=n.hasPermission,this._registration.providers[e].success=n.success,this._registration.providers[e].enabled=n.success,this._registration.providers[e].data=n.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())),n})}disableProvider(e){return sQ(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 sQ(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 o=e.provider+e.action;if(this._pendingProviderPromises[o])throw Error("Message already pending for provider '"+e.provider+"' with action '"+e.action+"'");let n=new sK,i=()=>{delete this._pendingProviderPromises[o],n.reject("No response from provider")};return this._pendingProviderPromises[o]=[n,window.setTimeout(i,5e3)],this._doSendProviderMessage(e),n.promise})}sendRegistration(){return this._registrationTimer&&(window.clearTimeout(this._registrationTimer),this._registrationTimer=null),new Promise((e,t)=>{this._registrationTimer=window.setTimeout(()=>sQ(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 sQ(this,void 0,void 0,function*(){this._normaliseRegistration();let t=!!this._registration.id;try{let e=yield ul.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(o){if(e&&t&&s0._isStaleRegistrationResponse(o)){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 o}})}_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 sQ(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 o={type:e,data:t};this.isMobile?this._postNativeShellMessage(o):console.warn("Failed to send generic message to console.",o)}_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 o=window.localStorage.getItem(t);if(null!==o)try{o=JSON.parse(o)}catch(e){}this._handleProviderResponse(JSON.stringify({action:"RETRIEVE",provider:"storage",key:t,value:o}))}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),o=t.provider,n=t.action,i=this._pendingProviderPromises[o+n];i&&(window.clearTimeout(i[1]),delete this._pendingProviderPromises[o+n],i[0].resolve(t));let r=this._providerMessageListeners[o+n];r&&r(t)}_callCompletedCallback(){let e=this._enableCompleteCallback;this._enableCompleteCallback=null,e&&window.setTimeout(()=>{e()},0)}static _createConsoleRegistration(){return{name:sZ.name,version:sZ.version,platform:sZ.os.toString(),apps:[],model:((sZ.manufacturer?sZ.manufacturer+" ":"")+(sZ.product?sZ.product:"")).trim()}}_initialiseProvider(e){return sQ(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 s1(e,t){return function(){return e.apply(t,arguments)}}let{toString:s2}=Object.prototype,{getPrototypeOf:s3}=Object,{iterator:s5,toStringTag:s4}=Symbol,s6=(({hasOwnProperty:e})=>(t,o)=>e.call(t,o))(Object.prototype),s8=(e,t)=>{let o=e,n=[];for(;null!=o&&o!==Object.prototype&&-1===n.indexOf(o);){if(n.push(o),s6(o,t))return!0;o=s3(o)}return!1},s9=(r=Object.create(null),e=>{let t=s2.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())}),s7=e=>(e=e.toLowerCase(),t=>s9(t)===e),le=e=>t=>typeof t===e,{isArray:lt}=Array,lo=le("undefined");function ln(e){return null!==e&&!lo(e)&&null!==e.constructor&&!lo(e.constructor)&&la(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}let li=s7("ArrayBuffer"),lr=le("string"),la=le("function"),ls=le("number"),ll=e=>null!==e&&"object"==typeof e,lc=e=>{if(!ll(e))return!1;let t=s3(e);return(null===t||t===Object.prototype||null===s3(t))&&!s8(e,s4)&&!s8(e,s5)},ld=s7("Date"),lu=s7("File"),lf=s7("Blob"),lh=s7("FileList"),lm="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},lb=void 0!==lm.FormData?lm.FormData:void 0,lp=s7("URLSearchParams"),[lF,lg,lv,l_]=["ReadableStream","Request","Response","Headers"].map(s7);function ly(e,t,{allOwnKeys:o=!1}={}){let n,i;if(null!=e)if("object"!=typeof e&&(e=[e]),lt(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{let i;if(ln(e))return;let r=o?Object.getOwnPropertyNames(e):Object.keys(e),a=r.length;for(n=0;n<a;n++)i=r[n],t.call(null,e[i],i,e)}}function lw(e,t){let o;if(ln(e))return null;t=t.toLowerCase();let n=Object.keys(e),i=n.length;for(;i-- >0;)if(t===(o=n[i]).toLowerCase())return o;return null}let lE="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,lC=e=>!lo(e)&&e!==lE,lk=(a="u">typeof Uint8Array&&s3(Uint8Array),e=>a&&e instanceof a),lA=s7("HTMLFormElement"),{propertyIsEnumerable:lx}=Object.prototype,lD=s7("RegExp"),lS=(e,t)=>{let o=Object.getOwnPropertyDescriptors(e),n={};ly(o,(o,i)=>{let r;!1!==(r=t(o,i,e))&&(n[i]=r||o)}),Object.defineProperties(e,n)},lT=s7("AsyncFunction"),lO=(c="function"==typeof setImmediate,d=la(lE.postMessage),c?setImmediate:d?(u=`axios@${Math.random()}`,f=[],lE.addEventListener("message",({source:e,data:t})=>{e===lE&&t===u&&f.length&&f.shift()()},!1),e=>{f.push(e),lE.postMessage(u,"*")}):e=>setTimeout(e)),lI="u">typeof queueMicrotask?queueMicrotask.bind(lE):"u">typeof process&&process.nextTick||lO,lB=e=>null!=e&&la(e[s5]),lR={isArray:lt,isArrayBuffer:li,isBuffer:ln,isFormData:e=>{if(!e)return!1;if(lb&&e instanceof lb)return!0;let t=s3(e);if(!t||t===Object.prototype||!la(e.append))return!1;let o=s9(e);return"formdata"===o||"object"===o&&la(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&li(e.buffer)},isString:lr,isNumber:ls,isBoolean:e=>!0===e||!1===e,isObject:ll,isPlainObject:lc,isEmptyObject:e=>{if(!ll(e)||ln(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:lF,isRequest:lg,isResponse:lv,isHeaders:l_,isUndefined:lo,isDate:ld,isFile:lu,isReactNativeBlob:e=>!!(e&&void 0!==e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:lf,isRegExp:lD,isFunction:la,isStream:e=>ll(e)&&la(e.pipe),isURLSearchParams:lp,isTypedArray:lk,isFileList:lh,forEach:ly,merge:function e(...t){let{caseless:o,skipUndefined:n}=lC(this)&&this||{},i={},r=(t,r)=>{if("__proto__"===r||"constructor"===r||"prototype"===r)return;let a=o&&"string"==typeof r&&lw(i,r)||r,s=s6(i,a)?i[a]:void 0;lc(s)&&lc(t)?i[a]=e(s,t):lc(t)?i[a]=e({},t):lt(t)?i[a]=t.slice():n&&lo(t)||(i[a]=t)};for(let e=0,o=t.length;e<o;e++){let o=t[e];if(!o||ln(o)||(ly(o,r),"object"!=typeof o||lt(o)))continue;let n=Object.getOwnPropertySymbols(o);for(let e=0;e<n.length;e++){let t=n[e];lx.call(o,t)&&r(o[t],t)}}return i},extend:(e,t,o,{allOwnKeys:n}={})=>(ly(t,(t,n)=>{o&&la(t)?Object.defineProperty(e,n,{__proto__:null,value:s1(t,o),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,n,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),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,o,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),o&&Object.assign(e.prototype,o)},toFlatObject:(e,t,o,n)=>{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],(!n||n(a,e,t))&&!s[a]&&(t[a]=e[a],s[a]=!0);e=!1!==o&&s3(e)}while(e&&(!o||o(e,t))&&e!==Object.prototype);return t},kindOf:s9,kindOfTest:s7,endsWith:(e,t,o)=>{e=String(e),(void 0===o||o>e.length)&&(o=e.length),o-=t.length;let n=e.indexOf(t,o);return -1!==n&&n===o},toArray:e=>{if(!e)return null;if(lt(e))return e;let t=e.length;if(!ls(t))return null;let o=Array(t);for(;t-- >0;)o[t]=e[t];return o},forEachEntry:(e,t)=>{let o,n=(e&&e[s5]).call(e);for(;(o=n.next())&&!o.done;){let n=o.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let o,n=[];for(;null!==(o=e.exec(t));)n.push(o);return n},isHTMLForm:lA,hasOwnProperty:s6,hasOwnProp:s6,hasOwnInPrototypeChain:s8,getSafeProp:(e,t)=>null!=e&&s8(e,t)?e[t]:void 0,reduceDescriptors:lS,freezeMethods:e=>{lS(e,(t,o)=>{if(la(e)&&["arguments","caller","callee"].includes(o))return!1;if(la(e[o])){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")})}})},toObjectSet:(e,t)=>{let o={};return(lt(e)?e:String(e).split(t)).forEach(e=>{o[e]=!0}),o},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,o){return t.toUpperCase()+o}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e*=1)?e:t,findKey:lw,global:lE,isContextDefined:lC,isSpecCompliantForm:function(e){return!!(e&&la(e.append)&&"FormData"===e[s4]&&e[s5])},toJSONObject:e=>{let t=new WeakSet,o=e=>{if(ll(e)){if(t.has(e))return;if(ln(e))return e;if(!("toJSON"in e)){t.add(e);let n=lt(e)?[]:{};return ly(e,(e,t)=>{let i=o(e);lo(i)||(n[t]=i)}),t.delete(e),n}}return e};return o(e)},isAsyncFn:lT,isThenable:e=>e&&(ll(e)||la(e))&&la(e.then)&&la(e.catch),setImmediate:lO,asap:lI,isIterable:lB,isSafeIterable:e=>null!=e&&s8(e,s5)&&lB(e)},lP=lR.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"]),lN=RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),lL=RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function lM(e,t){return lR.isArray(e)?e.map(e=>lM(e,t)):function(e){let t=0,o=e.length;for(;t<o;){let o=e.charCodeAt(t);if(9!==o&&32!==o)break;t+=1}for(;o>t;){let t=e.charCodeAt(o-1);if(9!==t&&32!==t)break;o-=1}return 0===t&&o===e.length?e:e.slice(t,o)}(String(e).replace(t,""))}function lU(e){let t=Object.create(null);return lR.forEach(e.toJSON(),(e,o)=>{t[o]=lM(e,lL)}),t}let lj=Symbol("internals");function l$(e){return e&&String(e).trim().toLowerCase()}function lV(e){return!1===e||null==e?e:lR.isArray(e)?e.map(lV):lM(String(e),lN)}function lz(e,t,o,n,i){if(lR.isFunction(n))return n.call(this,t,o);if(i&&(t=o),lR.isString(t)){if(lR.isString(n))return -1!==t.indexOf(n);if(lR.isRegExp(n))return n.test(t)}}class lq{constructor(e){e&&this.set(e)}set(e,t,o){let n=this;function i(e,t,o){let i=l$(t);if(!i)return;let r=lR.findKey(n,i);r&&void 0!==n[r]&&!0!==o&&(void 0!==o||!1===n[r])||(n[r||t]=lV(e))}let r=(e,t)=>lR.forEach(e,(e,o)=>i(e,o,t));if(lR.isPlainObject(e)||e instanceof this.constructor)r(e,t);else{let n;if(lR.isString(e)&&(e=e.trim())&&(n=e,!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim()))){var a;let o,n,i,s;r((s={},(a=e)&&a.split("\n").forEach(function(e){i=e.indexOf(":"),o=e.substring(0,i).trim().toLowerCase(),n=e.substring(i+1).trim(),!o||s[o]&&lP[o]||("set-cookie"===o?s[o]?s[o].push(n):s[o]=[n]:s[o]=s[o]?s[o]+", "+n:n)}),s),t)}else if(lR.isObject(e)&&lR.isSafeIterable(e)){let o=Object.create(null),n,i;for(let t of e){if(!lR.isArray(t))throw TypeError("Object iterator must return a key-value pair");i=t[0],lR.hasOwnProp(o,i)?(n=o[i],o[i]=lR.isArray(n)?[...n,t[1]]:[n,t[1]]):o[i]=t[1]}r(o,t)}else null!=e&&i(t,e,o)}return this}get(e,t){if(e=l$(e)){let o=lR.findKey(this,e);if(o){let e=this[o];if(!t)return e;if(!0===t){let t,o=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;t=n.exec(e);)o[t[1]]=t[2];return o}if(lR.isFunction(t))return t.call(this,e,o);if(lR.isRegExp(t))return t.exec(e);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=l$(e)){let o=lR.findKey(this,e);return!!(o&&void 0!==this[o]&&(!t||lz(this,this[o],o,t)))}return!1}delete(e,t){let o=this,n=!1;function i(e){if(e=l$(e)){let i=lR.findKey(o,e);i&&(!t||lz(o,o[i],i,t))&&(delete o[i],n=!0)}}return lR.isArray(e)?e.forEach(i):i(e),n}clear(e){let t=Object.keys(this),o=t.length,n=!1;for(;o--;){let i=t[o];(!e||lz(this,this[i],i,e,!0))&&(delete this[i],n=!0)}return n}normalize(e){let t=this,o={};return lR.forEach(this,(n,i)=>{let r=lR.findKey(o,i);if(r){t[r]=lV(n),delete t[i];return}let a=e?i.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,o)=>t.toUpperCase()+o):String(i).trim();a!==i&&delete t[i],t[a]=lV(n),o[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return lR.forEach(this,(o,n)=>{null!=o&&!1!==o&&(t[n]=e&&lR.isArray(o)?o.join(", "):o)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let o=new this(e);return t.forEach(e=>o.set(e)),o}static accessor(e){let t=(this[lj]=this[lj]={accessors:{}}).accessors,o=this.prototype;function n(e){let n=l$(e);if(!t[n]){let i;i=lR.toCamelCase(" "+e),["get","set","has"].forEach(t=>{Object.defineProperty(o,t+i,{__proto__:null,value:function(o,n,i){return this[t].call(this,e,o,n,i)},configurable:!0})}),t[n]=!0}}return lR.isArray(e)?e.forEach(n):n(e),this}}lq.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),lR.reduceDescriptors(lq.prototype,({value:e},t)=>{let o=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[o]=e}}}),lR.freezeMethods(lq);class lH extends Error{static from(e,t,o,n,i,r){let a=new lH(e.message,t||e.code,o,n,i);return Object.defineProperty(a,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),a.name=e.name,null!=e.status&&null==a.status&&(a.status=e.status),r&&Object.assign(a,r),a}constructor(e,t,o,n,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),o&&(this.config=o),n&&(this.request=n),i&&(this.response=i,this.status=i.status)}toJSON(){let e,t,o,n=this.config,i=n&&lR.hasOwnProp(n,"redact")?n.redact:void 0,r=lR.isArray(i)&&i.length>0?(e=new Set(i.map(e=>String(e).toLowerCase())),t=[],(o=n=>{let i;if(null===n||"object"!=typeof n||lR.isBuffer(n))return n;if(-1===t.indexOf(n)){if(n instanceof lq&&(n=n.toJSON()),t.push(n),lR.isArray(n))i=[],n.forEach((e,t)=>{let n=o(e);lR.isUndefined(n)||(i[t]=n)});else{if(!lR.isPlainObject(n)&&function(e){if(lR.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(lR.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(n))return t.pop(),n;for(let[t,r]of(i=Object.create(null),Object.entries(n))){let n=e.has(t.toLowerCase())?"[REDACTED ****]":o(r);lR.isUndefined(n)||(i[t]=n)}}return t.pop(),i}})(n)):lR.toJSONObject(n);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}}}lH.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",lH.ERR_BAD_OPTION="ERR_BAD_OPTION",lH.ECONNABORTED="ECONNABORTED",lH.ETIMEDOUT="ETIMEDOUT",lH.ECONNREFUSED="ECONNREFUSED",lH.ERR_NETWORK="ERR_NETWORK",lH.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",lH.ERR_DEPRECATED="ERR_DEPRECATED",lH.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",lH.ERR_BAD_REQUEST="ERR_BAD_REQUEST",lH.ERR_CANCELED="ERR_CANCELED",lH.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",lH.ERR_INVALID_URL="ERR_INVALID_URL",lH.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";let lY=lH;function lW(e){return lR.isPlainObject(e)||lR.isArray(e)}function lG(e){return lR.endsWith(e,"[]")?e.slice(0,-2):e}function lK(e,t,o){return e?e.concat(t).map(function(e,t){return e=lG(e),!o&&t?"["+e+"]":e}).join(o?".":""):t}let lJ=lR.toFlatObject(lR,{},null,function(e){return/^is[A-Z]/.test(e)}),lX=function(e,t,o){if(!lR.isObject(e))throw TypeError("target must be an object");t=t||new FormData;let n=(o=lR.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!lR.isUndefined(t[e])})).metaTokens,i=o.visitor||h,r=o.dots,a=o.indexes,s=o.Blob||"u">typeof Blob&&Blob,l=void 0===o.maxDepth?100:o.maxDepth,c=s&&lR.isSpecCompliantForm(t),d=[];if(!lR.isFunction(i))throw TypeError("visitor must be a function");function u(e){if(null===e)return"";if(lR.isDate(e))return e.toISOString();if(lR.isBoolean(e))return e.toString();if(!c&&lR.isBlob(e))throw new lY("Blob is not supported. Use a Buffer instead.");if(lR.isArrayBuffer(e)||lR.isTypedArray(e)){if(c&&"function"==typeof s)return new s([e]);if("u">typeof Buffer)return Buffer.from(e);throw new lY("Blob is not supported. Use a Buffer instead.",lY.ERR_NOT_SUPPORT)}return e}function f(e){if(e>l)throw new lY("Object is too deeply nested ("+e+" levels). Max depth: "+l,lY.ERR_FORM_DATA_DEPTH_EXCEEDED)}function h(e,o,i){let s=e;if(lR.isReactNative(t)&&lR.isReactNativeBlob(e))return t.append(lK(i,o,r),u(e)),!1;if(e&&!i&&"object"==typeof e)if(lR.endsWith(o,"{}"))o=n?o:o.slice(0,-2),e=function(e){if(1/0===l)return JSON.stringify(e);let t=[];return JSON.stringify(e,function(e,o){if(!lR.isObject(o))return o;for(;t.length&&t[t.length-1]!==this;)t.pop();return t.push(o),f(1+t.length-1),o})}(e);else{var c;if(lR.isArray(e)&&(c=e,lR.isArray(c)&&!c.some(lW))||(lR.isFileList(e)||lR.endsWith(o,"[]"))&&(s=lR.toArray(e)))return o=lG(o),s.forEach(function(e,n){lR.isUndefined(e)||null===e||t.append(!0===a?lK([o],n,r):null===a?o:o+"[]",u(e))}),!1}return!!lW(e)||(t.append(lK(i,o,r),u(e)),!1)}let m=Object.assign(lJ,{defaultVisitor:h,convertValue:u,isVisitable:lW});if(!lR.isObject(e))throw TypeError("data must be an object");return!function e(o,n,r=0){if(!lR.isUndefined(o)){if(f(r),-1!==d.indexOf(o))throw Error("Circular reference detected in "+n.join("."));d.push(o),lR.forEach(o,function(o,a){!0===(!(lR.isUndefined(o)||null===o)&&i.call(t,o,lR.isString(a)?a.trim():a,n,m))&&e(o,n?n.concat(a):[a],r+1)}),d.pop()}}(e),t};function lQ(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function lZ(e,t){this._pairs=[],e&&lX(e,this,t)}let l0=lZ.prototype;function l1(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function l2(e,t,o){let n;if(!t)return e;e=e||"";let i=lR.isFunction(o)?{serialize:o}:o,r=lR.getSafeProp(i,"encode")||l1,a=lR.getSafeProp(i,"serialize");if(n=a?a(t,i):lR.isURLSearchParams(t)?t.toString():new lZ(t,i).toString(r)){let t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e}l0.append=function(e,t){this._pairs.push([e,t])},l0.toString=function(e){let t=e?t=>e.call(this,t,lQ):lQ;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};let l3=class{constructor(){this.handlers=[]}use(e,t,o){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!o&&o.synchronous,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){lR.forEach(this.handlers,function(t){null!==t&&e(t)})}},l5={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},l4="u">typeof URLSearchParams?URLSearchParams:lZ,l6="u">typeof FormData?FormData:null,l8="u">typeof Blob?Blob:null,l9="u">typeof window&&"u">typeof document,l7="object"==typeof navigator&&navigator||void 0,ce=l9&&(!l7||0>["ReactNative","NativeScript","NS"].indexOf(l7.product)),ct="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,co=l9&&window.location.href||"http://localhost",cn={...tI,isBrowser:!0,classes:{URLSearchParams:l4,FormData:l6,Blob:l8},protocols:["http","https","file","blob","url","data"]};function ci(e){if(e>100)throw new lY("FormData field is too deeply nested ("+e+" levels). Max depth: 100",lY.ERR_FORM_DATA_DEPTH_EXCEEDED)}let cr=function(e){if(lR.isFormData(e)&&lR.isFunction(e.entries)){let t={};return lR.forEachEntry(e,(e,o)=>{!function e(t,o,n,i){ci(i);let r=t[i++];if("__proto__"===r)return!0;let a=Number.isFinite(+r),s=i>=t.length;return(r=!r&&lR.isArray(n)?n.length:r,s)?lR.hasOwnProp(n,r)?n[r]=lR.isArray(n[r])?n[r].concat(o):[n[r],o]:n[r]=o:(lR.hasOwnProp(n,r)&&lR.isObject(n[r])||(n[r]=[]),e(t,o,n[r],i)&&lR.isArray(n[r])&&(n[r]=function(e){let t,o,n={},i=Object.keys(e),r=i.length;for(t=0;t<r;t++)n[o=i[t]]=e[o];return n}(n[r]))),!a}(function(e){let t,o=[],n=/\w+|\[(\w*)]/g;for(;null!==(t=n.exec(e));)ci(o.length),o.push("[]"===t[0]?"":t[1]||t[0]);return o}(e),o,t,0)}),t}return null},ca=(e,t)=>null!=e&&lR.hasOwnProp(e,t)?e[t]:void 0,cs={transitional:l5,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let o,n=t.getContentType()||"",i=n.indexOf("application/json")>-1,r=lR.isObject(e);if(r&&lR.isHTMLForm(e)&&(e=new FormData(e)),lR.isFormData(e))return i?JSON.stringify(cr(e)):e;if(lR.isArrayBuffer(e)||lR.isBuffer(e)||lR.isStream(e)||lR.isFile(e)||lR.isBlob(e)||lR.isReadableStream(e))return e;if(lR.isArrayBufferView(e))return e.buffer;if(lR.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(r){let t=ca(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return lX(e,new cn.classes.URLSearchParams,{visitor:function(e,t,o,n){return cn.isNode&&lR.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t}).toString();if((o=lR.isFileList(e))||n.indexOf("multipart/form-data")>-1){let n=ca(this,"env"),i=n&&n.FormData;return lX(o?{"files[]":e}:e,i&&new i,t)}}if(r||i){t.setContentType("application/json",!1);var a=e;if(lR.isString(a))try{return(0,JSON.parse)(a),lR.trim(a)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(a)}return e}],transformResponse:[function(e){let t=ca(this,"transitional")||cs.transitional,o=t&&t.forcedJSONParsing,n=ca(this,"responseType"),i="json"===n;if(lR.isResponse(e)||lR.isReadableStream(e))return e;if(e&&lR.isString(e)&&(o&&!n||i)){let o=t&&t.silentJSONParsing;try{return JSON.parse(e,ca(this,"parseReviver"))}catch(e){if(!o&&i){if("SyntaxError"===e.name)throw lY.from(e,lY.ERR_BAD_RESPONSE,this,null,ca(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:cn.classes.FormData,Blob:cn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function cl(e,t){let o=this||cs,n=t||o,i=lq.from(n.headers),r=n.data;return lR.forEach(e,function(e){r=e.call(o,r,i.normalize(),t?t.status:void 0)}),i.normalize(),r}function cc(e){return!!(e&&e.__CANCEL__)}lR.forEach(["delete","get","head","post","put","patch","query"],e=>{cs.headers[e]={}});let cd=class extends lY{constructor(e,t,o){super(null==e?"canceled":e,lY.ERR_CANCELED,t,o),this.name="CanceledError",this.__CANCEL__=!0}};function cu(e,t,o){let n=o.config.validateStatus;!o.status||!n||n(o.status)?e(o):t(new lY("Request failed with status code "+o.status,o.status>=400&&o.status<500?lY.ERR_BAD_REQUEST:lY.ERR_BAD_RESPONSE,o.config,o.request,o))}let cf=function(e,t){let o,n=Array(e=e||10),i=Array(e),r=0,a=0;return t=void 0!==t?t:1e3,function(s){let l=Date.now(),c=i[a];o||(o=l),n[r]=s,i[r]=l;let d=a,u=0;for(;d!==r;)u+=n[d++],d%=e;if((r=(r+1)%e)===a&&(a=(a+1)%e),l-o<t)return;let f=c&&l-c;return f?Math.round(1e3*u/f):void 0}},ch=function(e,t){let o,n,i=0,r=1e3/t,a=(t,r=Date.now())=>{i=r,o=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-i;s>=r?a(e,t):(o=e,n||(n=setTimeout(()=>{n=null,a(o)},r-s)))},()=>o&&a(o)]},cm=(e,t,o=3)=>{let n=0,i=cf(50,250);return ch(o=>{if(!o||"number"!=typeof o.loaded)return;let r=o.loaded,a=o.lengthComputable?o.total:void 0,s=null!=a?Math.min(r,a):r,l=Math.max(0,s-n),c=i(l);n=Math.max(n,s),e({loaded:s,total:a,progress:a?s/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a?(a-s)/c:void 0,event:o,lengthComputable:null!=a,[t?"download":"upload"]:!0})},o)},cb=(e,t)=>{let o=null!=e;return[n=>t[0]({lengthComputable:o,total:e,loaded:n}),t[1]]},cp=e=>(...t)=>lR.asap(()=>e(...t)),cF=cn.hasStandardBrowserEnv?(s=new URL(cn.origin),l=cn.navigator&&/(msie|trident)/i.test(cn.navigator.userAgent),e=>(e=new URL(e,cn.origin),s.protocol===e.protocol&&s.host===e.host&&(l||s.port===e.port))):()=>!0,cg=cn.hasStandardBrowserEnv?{write(e,t,o,n,i,r,a){if("u"<typeof document)return;let s=[`${e}=${encodeURIComponent(t)}`];lR.isNumber(o)&&s.push(`expires=${new Date(o).toUTCString()}`),lR.isString(n)&&s.push(`path=${n}`),lR.isString(i)&&s.push(`domain=${i}`),!0===r&&s.push("secure"),lR.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 o=0;o<t.length;o++){let n=t[o].replace(/^\s+/,""),i=n.indexOf("=");if(-1!==i&&n.slice(0,i)===e)try{return decodeURIComponent(n.slice(i+1))}catch(e){return n.slice(i+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}},cv=/^https?:(?!\/\/)/i,c_=/[\t\n\r]/g;function cy(e,t){if("string"==typeof e&&cv.test((function(e){let t=0;for(;t<e.length&&32>=e.charCodeAt(t);)t++;return e.slice(t)})(e).replace(c_,"")))throw new lY('Invalid URL: missing "//" after protocol',lY.ERR_INVALID_URL,t)}function cw(e,t,o,n){cy(t,n);let i=!("string"==typeof t&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t));return e&&(i||!1===o)?(cy(e,n),t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e):t}let cE=e=>e instanceof lq?{...e}:e;function cC(e,t){e=e||{},t=t||{};let o=Object.create(null);function n(e,t,o,n){return lR.isPlainObject(e)&&lR.isPlainObject(t)?lR.merge.call({caseless:n},e,t):lR.isPlainObject(t)?lR.merge({},t):lR.isArray(t)?t.slice():t}function i(e,t,o,i){return lR.isUndefined(t)?lR.isUndefined(e)?void 0:n(void 0,e,o,i):n(e,t,o,i)}function r(e,t){if(!lR.isUndefined(t))return n(void 0,t)}function a(e,t){return lR.isUndefined(t)?lR.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(o,i,r){return lR.hasOwnProp(t,r)?n(o,i):lR.hasOwnProp(e,r)?n(void 0,o):void 0}Object.defineProperty(o,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});let l={url:r,method:r,data:r,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,allowedSocketPaths:a,responseEncoding:a,validateStatus:s,headers:(e,t,o)=>i(cE(e),cE(t),o,!0)};return lR.forEach(Object.keys({...e,...t}),function(n){if("__proto__"===n||"constructor"===n||"prototype"===n)return;let r=lR.hasOwnProp(l,n)?l[n]:i,a=r(lR.hasOwnProp(e,n)?e[n]:void 0,lR.hasOwnProp(t,n)?t[n]:void 0,n);lR.isUndefined(a)&&r!==s||(o[n]=a)}),lR.hasOwnProp(t,"validateStatus")&&lR.isUndefined(t.validateStatus)&&!1===function(o){let n=lR.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!lR.isUndefined(n)){if(!lR.isPlainObject(n))return;else if(lR.hasOwnProp(n,o))return n[o]}let i=lR.hasOwnProp(e,"transitional")?e.transitional:void 0;if(lR.isPlainObject(i)&&lR.hasOwnProp(i,o))return i[o]}("validateStatusUndefinedResolves")&&(lR.hasOwnProp(e,"validateStatus")?o.validateStatus=n(void 0,e.validateStatus):delete o.validateStatus),o}let ck=["content-type","content-length"],cA=function(e){let t=cC({},e),o=e=>lR.hasOwnProp(t,e)?t[e]:void 0,n=o("data"),i=o("withXSRFToken"),r=o("xsrfHeaderName"),a=o("xsrfCookieName"),s=o("headers"),l=o("auth"),c=o("baseURL"),d=o("allowAbsoluteUrls"),u=o("url");if(t.headers=s=lq.from(s),t.url=l2(cw(c,u,d,t),o("params"),o("paramsSerializer")),l){let t=lR.getSafeProp(l,"username")||"",o=lR.getSafeProp(l,"password")||"";try{s.set("Authorization","Basic "+btoa(t+":"+(o?encodeURIComponent(o).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))):"")))}catch(t){throw lY.from(t,lY.ERR_BAD_OPTION_VALUE,e)}}if(lR.isFormData(n))if(cn.hasStandardBrowserEnv||cn.hasStandardBrowserWebWorkerEnv||lR.isReactNative(n))s.setContentType(void 0);else{var f,h;lR.isFunction(n.getHeaders)&&(f=s,h=n.getHeaders(),"content-only"!==o("formDataHeaderPolicy")?f.set(h):Object.entries(h||{}).forEach(([e,t])=>{ck.includes(e.toLowerCase())&&f.set(e,t)}))}if(cn.hasStandardBrowserEnv&&(lR.isFunction(i)&&(i=i(t)),!0===i||null==i&&cF(t.url))){let e=r&&a&&cg.read(a);e&&s.set(r,e)}return t},cx="u">typeof XMLHttpRequest&&function(e){return new Promise(function(t,o){var n;let i,r,a,s,l,c,d=cA(e),u=d.data,f=lq.from(d.headers).normalize(),{responseType:h,onUploadProgress:m,onDownloadProgress:b}=d;function p(){s&&s(),l&&l(),d.cancelToken&&d.cancelToken.unsubscribe(i),d.signal&&d.signal.removeEventListener("abort",i)}let F=new XMLHttpRequest;function g(){if(!F)return;let n=lq.from("getAllResponseHeaders"in F&&F.getAllResponseHeaders());cu(function(e){t(e),p()},function(e){o(e),p()},{data:h&&"text"!==h&&"json"!==h?F.response:F.responseText,status:F.status,statusText:F.statusText,headers:n,config:e,request:F}),F=null}F.open(d.method.toUpperCase(),d.url,!0),F.timeout=d.timeout,"onloadend"in F?F.onloadend=g:F.onreadystatechange=function(){!F||4!==F.readyState||(0!==F.status||F.responseURL&&F.responseURL.startsWith("file:"))&&setTimeout(g)},F.onabort=function(){F&&(o(new lY("Request aborted",lY.ECONNABORTED,e,F)),p(),F=null)},F.onerror=function(t){let n=new lY(t&&t.message?t.message:"Network Error",lY.ERR_NETWORK,e,F);n.event=t||null,o(n),p(),F=null},F.ontimeout=function(){let t=d.timeout?"timeout of "+d.timeout+"ms exceeded":"timeout exceeded",n=d.transitional||l5;d.timeoutErrorMessage&&(t=d.timeoutErrorMessage),o(new lY(t,n.clarifyTimeoutError?lY.ETIMEDOUT:lY.ECONNABORTED,e,F)),p(),F=null},void 0===u&&f.setContentType(null),"setRequestHeader"in F&&lR.forEach(lU(f),function(e,t){F.setRequestHeader(t,e)}),lR.isUndefined(d.withCredentials)||(F.withCredentials=!!d.withCredentials),h&&"json"!==h&&(F.responseType=d.responseType),b&&([a,l]=cm(b,!0),F.addEventListener("progress",a)),m&&F.upload&&([r,s]=cm(m),F.upload.addEventListener("progress",r),F.upload.addEventListener("loadend",s)),(d.cancelToken||d.signal)&&(i=t=>{F&&(o(!t||t.type?new cd(null,e,F):t),F.abort(),p(),F=null)},d.cancelToken&&d.cancelToken.subscribe(i),d.signal&&(d.signal.aborted?i():d.signal.addEventListener("abort",i)));let v=(n=d.url,(c=/^([-+\w]{1,25}):(?:\/\/)?/.exec(n))&&c[1]||"");if(v&&!cn.protocols.includes(v)){o(new lY("Unsupported protocol "+v+":",lY.ERR_BAD_REQUEST,e)),p();return}F.send(u||null)})},cD=function*(e,t){let o,n=e.byteLength;if(!t||n<t)return void(yield e);let i=0;for(;i<n;)o=i+t,yield e.slice(i,o),i=o},cS=async function*(e,t){for await(let o of cT(e))yield*cD(o,t)},cT=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);let t=e.getReader();try{for(;;){let{done:e,value:o}=await t.read();if(e)break;yield o}}finally{await t.cancel()}},cO=(e,t,o,n)=>{let i,r=cS(e,t),a=0,s=e=>{!i&&(i=!0,n&&n(e))};return new ReadableStream({async pull(e){try{let{done:t,value:n}=await r.next();if(t){s(),e.close();return}let i=n.byteLength;if(o){let e=a+=i;o(e)}e.enqueue(new Uint8Array(n))}catch(e){throw s(e),e}},cancel:e=>(s(e),r.return())},{highWaterMark:2})},cI=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,cB=(e,t,o)=>t+2<o&&cI(e.charCodeAt(t+1))&&cI(e.charCodeAt(t+2)),{isFunction:cR}=lR,cP=e=>{if(!lR.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},cN=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},cL=e=>{let t,o=void 0!==lR.global&&null!==lR.global?lR.global:globalThis,{ReadableStream:n,TextEncoder:i}=o,{fetch:r,Request:a,Response:s}=e=lR.merge.call({skipUndefined:!0},{Request:o.Request,Response:o.Response},e),l=r?cR(r):"function"==typeof fetch,c=cR(a),d=cR(s);if(!l)return!1;let u=l&&cR(n),f=l&&("function"==typeof i?(t=new i,e=>t.encode(e)):async e=>new Uint8Array(await new a(e).arrayBuffer())),h=c&&u&&cN(()=>{let e=!1,t=new a(cn.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),o=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!o}),m=d&&u&&cN(()=>lR.isReadableStream(new s("").body)),b={stream:m&&(e=>e.body)};l&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{b[e]||(b[e]=(t,o)=>{let n=t&&t[e];if(n)return n.call(t);throw new lY(`Response type '${e}' is not supported`,lY.ERR_NOT_SUPPORT,o)})});let p=async e=>{if(null==e)return 0;if(lR.isBlob(e))return e.size;if(lR.isSpecCompliantForm(e)){let t=new a(cn.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return lR.isArrayBufferView(e)||lR.isArrayBuffer(e)?e.byteLength:(lR.isURLSearchParams(e)&&(e+=""),lR.isString(e))?(await f(e)).byteLength:void 0},F=async(e,t)=>{let o=lR.toFiniteNumber(e.getContentLength());return null==o?p(t):o};return async e=>{let t,{url:o,method:n,data:l,signal:d,cancelToken:f,timeout:g,onDownloadProgress:v,onUploadProgress:_,responseType:y,headers:w,withCredentials:E="same-origin",fetchOptions:C,maxContentLength:k,maxBodyLength:A}=cA(e),x=lR.isNumber(k)&&k>-1,D=lR.isNumber(A)&&A>-1,S=r||fetch;y=y?(y+"").toLowerCase():"text";let T=((e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;let o=new AbortController,n=!1,i=function(e){if(!n){n=!0,a();let t=e instanceof Error?e:this.reason;o.abort(t instanceof lY?t:new cd(t instanceof Error?t.message:t))}},r=t&&setTimeout(()=>{r=null,i(new lY(`timeout of ${t}ms exceeded`,lY.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=>e.addEventListener("abort",i,{once:!0}));let{signal:s}=o;return s.unsubscribe=()=>lR.asap(a),s})([d,f&&f.toAbortSignal()],g),O=null,I=T&&T.unsubscribe&&(()=>{T.unsubscribe()}),B=null,R=()=>new lY("Request body larger than maxBodyLength limit",lY.ERR_BAD_REQUEST,e,O);try{var P;let r,d,f,g,N=(d="auth",lR.hasOwnProp(e,d)?e[d]:void 0);if(N){let e=lR.getSafeProp(N,"username")||"",t=lR.getSafeProp(N,"password")||"";r={username:e,password:t}}if(f=(P=o).indexOf("://"),g=P,-1!==f&&(g=g.slice(f+3)),g.includes("@")||g.includes(":")){let e=new URL(o,cn.origin);if(!r&&(e.username||e.password)){let t=cP(e.username),o=cP(e.password);r={username:t,password:o}}(e.username||e.password)&&(e.username="",e.password="",o=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(x&&"string"==typeof o&&o.startsWith("data:")&&function(e){if(!e||"string"!=typeof e||!e.startsWith("data:"))return 0;let t=e.indexOf(",");if(t<0)return 0;let o=e.slice(5,t),n=e.slice(t+1);if(/;base64/i.test(o)){let e=n.length,t=n.length;for(let o=0;o<t;o++)if(37===n.charCodeAt(o)&&o+2<t){let t=n.charCodeAt(o+1),i=n.charCodeAt(o+2);cI(t)&&cI(i)&&(e-=2,o+=2)}let o=0,i=t-1,r=e=>e>=2&&37===n.charCodeAt(e-2)&&51===n.charCodeAt(e-1)&&(68===n.charCodeAt(e)||100===n.charCodeAt(e));i>=0&&(61===n.charCodeAt(i)?(o++,i--):r(i)&&(o++,i-=3)),1===o&&i>=0&&(61===n.charCodeAt(i)?o++:r(i)&&o++);let a=3*Math.floor(e/4)-(o||0);return a>0?a:0}let i=0;for(let e=0,t=n.length;e<t;e++){let o=n.charCodeAt(e);if(37===o&&cB(n,e,t))i+=1,e+=2;else if(o<128)i+=1;else if(o<2048)i+=2;else if(o>=55296&&o<=56319&&e+1<t){let t=n.charCodeAt(e+1);t>=56320&&t<=57343?(i+=4,e++):i+=3}else i+=3}return i}(o)>k)throw new lY("maxContentLength size of "+k+" exceeded",lY.ERR_BAD_RESPONSE,e,O);if(D&&"get"!==n&&"head"!==n){let e=await p(l);if("number"==typeof e&&isFinite(e)&&(t=e,e>A))throw R()}let L=D&&(lR.isReadableStream(l)||lR.isStream(l)),M=(e,t,o)=>cO(e,65536,e=>{if(D&&e>A)throw B=R();t&&t(e)},o);if(h&&"get"!==n&&"head"!==n&&(_||L)){if(t=null==t?await F(w,l):t,0!==t||L){let e,n=new a(o,{method:"POST",body:l,duplex:"half"});if(lR.isFormData(l)&&(e=n.headers.get("content-type"))&&w.setContentType(e),n.body){let[e,o]=_&&cb(t,cm(cp(_)))||[];l=M(n.body,e,o)}}}else if(L&&!c&&u&&"get"!==n&&"head"!==n)l=M(l);else if(L&&c&&!h&&"get"!==n&&"head"!==n)throw new lY("Stream request bodies are not supported by the current fetch implementation",lY.ERR_NOT_SUPPORT,e,O);lR.isString(E)||(E=E?"include":"omit");let U=c&&"credentials"in a.prototype;if(lR.isFormData(l)){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.18.1",!1);let j={...C,signal:T,method:n.toUpperCase(),headers:lU(w.normalize()),body:l,duplex:"half",credentials:U?E:void 0};O=c&&new a(o,j);let $=await (c?S(O,C):S(o,j)),V=lq.from($.headers);if(x){let t=lR.toFiniteNumber(V.getContentLength());if(null!=t&&t>k)throw new lY("maxContentLength size of "+k+" exceeded",lY.ERR_BAD_RESPONSE,e,O)}let z=m&&("stream"===y||"response"===y);if(m&&$.body&&(v||x||z&&I)){let t={};["status","statusText","headers"].forEach(e=>{t[e]=$[e]});let o=lR.toFiniteNumber(V.getContentLength()),[n,i]=v&&cb(o,cm(cp(v),!0))||[];$=new s(cO($.body,65536,t=>{if(x&&t>k)throw new lY("maxContentLength size of "+k+" exceeded",lY.ERR_BAD_RESPONSE,e,O);n&&n(t)},()=>{i&&i(),I&&I()}),t)}y=y||"text";let q=await b[lR.findKey(b,y)||"text"]($,e);if(x&&!m&&!z){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>k)throw new lY("maxContentLength size of "+k+" exceeded",lY.ERR_BAD_RESPONSE,e,O)}return!z&&I&&I(),await new Promise((t,o)=>{cu(t,o,{data:q,headers:lq.from($.headers),status:$.status,statusText:$.statusText,config:e,request:O})})}catch(t){if(I&&I(),T&&T.aborted&&T.reason instanceof lY){let o=T.reason;throw o.config=e,O&&(o.request=O),t!==o&&Object.defineProperty(o,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),o}if(B)throw O&&!B.request&&(B.request=O),B;if(t instanceof lY)throw O&&!t.request&&(t.request=O),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){let o=new lY("Network Error",lY.ERR_NETWORK,e,O,t&&t.response);throw Object.defineProperty(o,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),o}throw lY.from(t,t&&t.code,e,O,t&&t.response)}}},cM=new Map,cU=e=>{let t=e&&e.env||{},{fetch:o,Request:n,Response:i}=t,r=[n,i,o],a=r.length,s,l,c=cM;for(;a--;)s=r[a],void 0===(l=c.get(s))&&c.set(s,l=a?new Map:cL(t)),c=l;return l};cU();let cj={http:null,xhr:cx,fetch:{get:cU}};lR.forEach(cj,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});let c$=e=>`- ${e}`,cV=e=>lR.isFunction(e)||null===e||!1===e,cz=function(e,t){let o,n,{length:i}=e=lR.isArray(e)?e:[e],r={};for(let a=0;a<i;a++){let i;if(n=o=e[a],!cV(o)&&void 0===(n=cj[(i=String(o)).toLowerCase()]))throw new lY(`Unknown adapter '${i}'`);if(n&&(lR.isFunction(n)||(n=n.get(t))))break;r[i||"#"+a]=n}if(!n){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 lY("There is no suitable adapter to dispatch the request "+(i?e.length>1?"since :\n"+e.map(c$).join("\n"):" "+c$(e[0]):"as no adapter specified"),lY.ERR_NOT_SUPPORT)}return n};function cq(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new cd(null,e)}function cH(e){return cq(e),e.headers=lq.from(e.headers),e.data=cl.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),cz(e.adapter||cs.adapter,e)(e).then(function(t){cq(e),e.response=t;try{t.data=cl.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=lq.from(t.headers),t},function(t){if(!cc(t)&&(cq(e),t&&t.response)){e.response=t.response;try{t.response.data=cl.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=lq.from(t.response.headers)}return Promise.reject(t)})}let cY={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{cY[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}});let cW={};cY.transitional=function(e,t,o){function n(e,t){return"[Axios v1.18.1] Transitional option '"+e+"'"+t+(o?". "+o:"")}return(o,i,r)=>{if(!1===e)throw new lY(n(i," has been removed"+(t?" in "+t:"")),lY.ERR_DEPRECATED);return t&&!cW[i]&&(cW[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(o,i,r)}},cY.spelling=function(e){return(t,o)=>(console.warn(`${o} is likely a misspelling of ${e}`),!0)};let cG=function(e,t,o){if("object"!=typeof e||null===e)throw new lY("options must be an object",lY.ERR_BAD_OPTION_VALUE);let n=Object.keys(e),i=n.length;for(;i-- >0;){let r=n[i],a=Object.prototype.hasOwnProperty.call(t,r)?t[r]:void 0;if(a){let t=e[r],o=void 0===t||a(t,r,e);if(!0!==o)throw new lY("option "+r+" must be "+o,lY.ERR_BAD_OPTION_VALUE);continue}if(!0!==o)throw new lY("Unknown option "+r,lY.ERR_BAD_OPTION)}};class cK{constructor(e){this.defaults=e||{},this.interceptors={request:new l3,response:new l3}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let o=(()=>{if(!t.stack)return"";let e=t.stack.indexOf("\n");return -1===e?"":t.stack.slice(e+1)})();try{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 o,n;"string"==typeof e?(t=t||{}).url=e:t=e||{};let{transitional:i,paramsSerializer:r,headers:a}=t=cC(this.defaults,t);void 0!==i&&cG(i,{silentJSONParsing:cY.transitional(cY.boolean),forcedJSONParsing:cY.transitional(cY.boolean),clarifyTimeoutError:cY.transitional(cY.boolean),legacyInterceptorReqResOrdering:cY.transitional(cY.boolean),advertiseZstdAcceptEncoding:cY.transitional(cY.boolean),validateStatusUndefinedResolves:cY.transitional(cY.boolean)},!1),null!=r&&(lR.isFunction(r)?t.paramsSerializer={serialize:r}:cG(r,{encode:cY.function,serialize:cY.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),cG(t,{baseUrl:cY.spelling("baseURL"),withXsrfToken:cY.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=a&&lR.merge(a.common,a[t.method]);a&&lR.forEach(["delete","get","head","post","put","patch","query","common"],e=>{delete a[e]}),t.headers=lq.concat(s,a);let l=[],c=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;c=c&&e.synchronous;let o=t.transitional||l5;o&&o.legacyInterceptorReqResOrdering?l.unshift(e.fulfilled,e.rejected):l.push(e.fulfilled,e.rejected)});let d=[];this.interceptors.response.forEach(function(e){d.push(e.fulfilled,e.rejected)});let u=0;if(!c){let e=[cH.bind(this),void 0];for(e.unshift(...l),e.push(...d),n=e.length,o=Promise.resolve(t);u<n;)o=o.then(e[u++],e[u++]);return o}n=l.length;let f=t;for(;u<n;){let e=l[u++],t=l[u++];try{f=e(f)}catch(e){t.call(this,e);break}}try{o=cH.call(this,f)}catch(e){return Promise.reject(e)}for(u=0,n=d.length;u<n;)o=o.then(d[u++],d[u++]);return o}getUri(e){return l2(cw((e=cC(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}lR.forEach(["delete","get","head","options"],function(e){cK.prototype[e]=function(t,o){return this.request(cC(o||{},{method:e,url:t,data:o&&lR.hasOwnProp(o,"data")?o.data:void 0}))}}),lR.forEach(["post","put","patch","query"],function(e){function t(t){return function(o,n,i){return this.request(cC(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:o,data:n}))}}cK.prototype[e]=t(),"query"!==e&&(cK.prototype[e+"Form"]=t(!0))});let cJ=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 o=this;this.promise.then(e=>{if(!o._listeners)return;let t=o._listeners.length;for(;t-- >0;)o._listeners[t](e);o._listeners=null}),this.promise.then=e=>{let t,n=new Promise(e=>{o.subscribe(e),t=e}).then(e);return n.cancel=function(){o.unsubscribe(t)},n},e(function(e,n,i){o.reason||(o.reason=new cd(e,n,i),t(o.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}}},cX={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,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity: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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(cX).forEach(([e,t])=>{cX[t]=e});let cQ=function e(t){let o=new cK(t),n=s1(cK.prototype.request,o);return lR.extend(n,cK.prototype,o,{allOwnKeys:!0}),lR.extend(n,o,null,{allOwnKeys:!0}),n.create=function(o){return e(cC(t,o))},n}(cs);cQ.Axios=cK,cQ.CanceledError=cd,cQ.CancelToken=cJ,cQ.isCancel=cc,cQ.VERSION="1.18.1",cQ.toFormData=lX,cQ.AxiosError=lY,cQ.Cancel=cQ.CanceledError,cQ.all=function(e){return Promise.all(e)},cQ.spread=function(e){return function(t){return e.apply(null,t)}},cQ.isAxiosError=function(e){return lR.isObject(e)&&!0===e.isAxiosError},cQ.mergeConfig=cC,cQ.AxiosHeaders=lq,cQ.formToJSON=e=>cr(lR.isHTMLForm(e)?new FormData(e):e),cQ.getAdapter=cz,cQ.HttpStatusCode=cX,cQ.default=cQ;class cZ{constructor(e){this.httpClient=e}deleteConnections(e,t){return this.httpClient.request({method:"DELETE",url:df`gateway/connection`,queryParams:e,options:t})}getConnections(e){return this.httpClient.request({method:"GET",url:df`gateway/connection`,options:e})}deleteConnection(e,t){return this.httpClient.request({method:"DELETE",url:df`gateway/connection/${e}`,options:t})}getConnection(e,t){return this.httpClient.request({method:"GET",url:df`gateway/connection/${e}`,options:t})}setConnection(e,t,o){return this.httpClient.request({method:"PUT",url:df`gateway/connection/${e}`,data:t,options:o})}getConnectionStatus(e,t){return this.httpClient.request({method:"GET",url:df`gateway/status/${e}`,options:t})}}class c0{constructor(e){this.httpClient=e}register(e,t){return this.httpClient.request({method:"POST",url:df`console/register`,data:e,options:t})}}class c1{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:df`realm`,data:e,options:t})}getAll(e){return this.httpClient.request({method:"GET",url:df`realm`,options:e})}getAccessible(e){return this.httpClient.request({method:"GET",url:df`realm/accessible`,options:e})}delete(e,t){return this.httpClient.request({method:"DELETE",url:df`realm/${e}`,options:t})}get(e,t){return this.httpClient.request({method:"GET",url:df`realm/${e}`,options:t})}update(e,t,o){return this.httpClient.request({method:"PUT",url:df`realm/${e}`,data:t,options:o})}}class c2{constructor(e){this.httpClient=e}createGlobalRuleset(e,t){return this.httpClient.request({method:"POST",url:df`rules`,data:e,options:t})}getGlobalRulesets(e,t){return this.httpClient.request({method:"GET",url:df`rules`,queryParams:e,options:t})}createAssetRuleset(e,t){return this.httpClient.request({method:"POST",url:df`rules/asset`,data:e,options:t})}getAssetRulesets(e,t,o){return this.httpClient.request({method:"GET",url:df`rules/asset/for/${e}`,queryParams:t,options:o})}deleteAssetRuleset(e,t){return this.httpClient.request({method:"DELETE",url:df`rules/asset/${e}`,options:t})}getAssetRuleset(e,t){return this.httpClient.request({method:"GET",url:df`rules/asset/${e}`,options:t})}updateAssetRuleset(e,t,o){return this.httpClient.request({method:"PUT",url:df`rules/asset/${e}`,data:t,options:o})}getAssetGeofences(e,t){return this.httpClient.request({method:"GET",url:df`rules/geofences/${e}`,options:t})}getAssetEngineInfo(e,t){return this.httpClient.request({method:"GET",url:df`rules/info/asset/${e}`,options:t})}getGlobalEngineInfo(e){return this.httpClient.request({method:"GET",url:df`rules/info/global`,options:e})}getRealmEngineInfo(e,t){return this.httpClient.request({method:"GET",url:df`rules/info/realm/${e}`,options:t})}createRealmRuleset(e,t){return this.httpClient.request({method:"POST",url:df`rules/realm`,data:e,options:t})}getRealmRulesets(e,t,o){return this.httpClient.request({method:"GET",url:df`rules/realm/for/${e}`,queryParams:t,options:o})}deleteRealmRuleset(e,t){return this.httpClient.request({method:"DELETE",url:df`rules/realm/${e}`,options:t})}getRealmRuleset(e,t){return this.httpClient.request({method:"GET",url:df`rules/realm/${e}`,options:t})}updateRealmRuleset(e,t,o){return this.httpClient.request({method:"PUT",url:df`rules/realm/${e}`,data:t,options:o})}deleteGlobalRuleset(e,t){return this.httpClient.request({method:"DELETE",url:df`rules/${e}`,options:t})}getGlobalRuleset(e,t){return this.httpClient.request({method:"GET",url:df`rules/${e}`,options:t})}updateGlobalRuleset(e,t,o){return this.httpClient.request({method:"PUT",url:df`rules/${e}`,data:t,options:o})}}class c3{constructor(e){this.httpClient=e}getAllNodeDefinitions(e){return this.httpClient.request({method:"GET",url:df`flow`,options:e})}getNodeDefinition(e,t){return this.httpClient.request({method:"GET",url:df`flow/${e}`,options:t})}getAllNodeDefinitionsByType(e,t){return this.httpClient.request({method:"GET",url:df`flow/${e}`,options:t})}}class c5{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:df`dashboard`,data:e,options:t})}update(e,t){return this.httpClient.request({method:"PUT",url:df`dashboard`,data:e,options:t})}getAllRealmDashboards(e,t){return this.httpClient.request({method:"GET",url:df`dashboard/all/${e}`,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:df`dashboard/query`,data:e,options:t})}delete(e,t,o){return this.httpClient.request({method:"DELETE",url:df`dashboard/${e}/${t}`,options:o})}get(e,t,o){return this.httpClient.request({method:"GET",url:df`dashboard/${e}/${t}`,options:o})}}class c4{constructor(e){this.httpClient=e}doProtocolAssetDiscovery(e,t,o){return this.httpClient.request({method:"GET",url:df`agent/assetDiscovery/${e}`,queryParams:t,options:o})}doProtocolAssetImport(e,t,o,n){return this.httpClient.request({method:"POST",url:df`agent/assetImport/${e}`,queryParams:o,data:t,options:n})}doProtocolInstanceDiscovery(e,t,o){return this.httpClient.request({method:"GET",url:df`agent/instanceDiscovery/${e}`,queryParams:t,options:o})}}class c6{constructor(e){this.httpClient=e}getConfig(e){return this.httpClient.request({method:"GET",url:df`syslog/config`,options:e})}updateConfig(e,t){return this.httpClient.request({method:"PUT",url:df`syslog/config`,data:e,options:t})}clearEvents(e){return this.httpClient.request({method:"DELETE",url:df`syslog/event`,options:e})}getEvents(e,t){return this.httpClient.request({method:"GET",url:df`syslog/event`,queryParams:e,options:t})}}class c8{constructor(e){this.httpClient=e}getApps(e){return this.httpClient.request({method:"GET",url:df`apps`,options:e})}getConsoleConfig(e){return this.httpClient.request({method:"GET",url:df`apps/consoleConfig`,options:e})}getAppInfos(e){return this.httpClient.request({method:"GET",url:df`apps/info`,options:e})}}class c9{constructor(e){this.httpClient=e}getDatapointExport(e,t){return this.httpClient.request({method:"GET",url:df`asset/datapoint/export`,queryParams:e,options:t})}getDatapointPeriod(e,t){return this.httpClient.request({method:"GET",url:df`asset/datapoint/periods`,queryParams:e,options:t})}getDatapoints(e,t,o,n){return this.httpClient.request({method:"POST",url:df`asset/datapoint/${e}/${t}`,data:o,options:n})}}class c7{constructor(e){this.httpClient=e}getSettings(e){return this.httpClient.request({method:"GET",url:df`map`,options:e})}saveSettings(e,t){return this.httpClient.request({method:"PUT",url:df`map`,data:e,options:t})}deleteMap(e){return this.httpClient.request({method:"DELETE",url:df`map/deleteMap`,options:e})}getCustomMapInfo(e){return this.httpClient.request({method:"GET",url:df`map/getCustomMapInfo`,options:e})}getTile(e,t,o,n){return this.httpClient.request({method:"GET",url:df`map/tile/${e}/${t}/${o}`,options:n})}uploadMap(e,t){return this.httpClient.request({method:"POST",url:df`map/upload`,queryParams:e,options:t})}}class de{constructor(e){this.httpClient=e}getNotifications(e,t){return this.httpClient.request({method:"GET",url:df`notification`,queryParams:e,options:t})}removeNotifications(e,t){return this.httpClient.request({method:"DELETE",url:df`notification`,queryParams:e,options:t})}sendNotification(e,t){return this.httpClient.request({method:"POST",url:df`notification/alert`,data:e,options:t})}getNotificationsCount(e,t){return this.httpClient.request({method:"GET",url:df`notification/count`,queryParams:e,options:t})}removeNotification(e,t){return this.httpClient.request({method:"DELETE",url:df`notification/${e}`,options:t})}notificationAcknowledged(e,t,o,n){return this.httpClient.request({method:"PUT",url:df`notification/${e}/acknowledged`,queryParams:o,data:t,options:n})}notificationDelivered(e,t,o){return this.httpClient.request({method:"PUT",url:df`notification/${e}/delivered`,queryParams:t,options:o})}}class dt{constructor(e){this.httpClient=e}updateCurrentUserLocale(e,t){return this.httpClient.request({method:"PUT",url:df`user/locale`,data:e,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:df`user/query`,data:e,options:t})}requestPasswordResetCurrent(e){return this.httpClient.request({method:"PUT",url:df`user/request-password-reset`,options:e})}updatePasswordCurrent(e,t){return this.httpClient.request({method:"PUT",url:df`user/reset-password`,data:e,options:t})}updateCurrent(e,t){return this.httpClient.request({method:"PUT",url:df`user/update`,data:e,options:t})}getCurrent(e){return this.httpClient.request({method:"GET",url:df`user/user`,options:e})}getCurrentUserRealmRoles(e){return this.httpClient.request({method:"GET",url:df`user/userRealmRoles`,options:e})}getCurrentUserClientRoles(e,t){return this.httpClient.request({method:"GET",url:df`user/userRoles/${e}`,options:t})}disconnectUserSession(e,t,o){return this.httpClient.request({method:"GET",url:df`user/${e}/disconnect/${t}`,options:o})}requestPasswordReset(e,t,o){return this.httpClient.request({method:"PUT",url:df`user/${e}/request-password-reset/${t}`,options:o})}updatePassword(e,t,o,n){return this.httpClient.request({method:"PUT",url:df`user/${e}/reset-password/${t}`,data:o,options:n})}resetSecret(e,t,o){return this.httpClient.request({method:"GET",url:df`user/${e}/reset-secret/${t}`,options:o})}updateRoles(e,t,o){return this.httpClient.request({method:"PUT",url:df`user/${e}/roles`,data:t,options:o})}getUserRealmRoles(e,t,o){return this.httpClient.request({method:"GET",url:df`user/${e}/userRealmRoles/${t}`,options:o})}updateUserRealmRoles(e,t,o,n){return this.httpClient.request({method:"PUT",url:df`user/${e}/userRealmRoles/${t}`,data:o,options:n})}getUserClientRoles(e,t,o,n){return this.httpClient.request({method:"GET",url:df`user/${e}/userRoles/${t}/${o}`,options:n})}updateUserClientRoles(e,t,o,n,i){return this.httpClient.request({method:"PUT",url:df`user/${e}/userRoles/${t}/${o}`,data:n,options:i})}getUserSessions(e,t,o){return this.httpClient.request({method:"GET",url:df`user/${e}/userSessions/${t}`,options:o})}create(e,t,o){return this.httpClient.request({method:"POST",url:df`user/${e}/users`,data:t,options:o})}update(e,t,o){return this.httpClient.request({method:"PUT",url:df`user/${e}/users`,data:t,options:o})}delete(e,t,o){return this.httpClient.request({method:"DELETE",url:df`user/${e}/users/${t}`,options:o})}getClientRoles(e,t,o){return this.httpClient.request({method:"GET",url:df`user/${e}/${t}/roles`,options:o})}updateClientRoles(e,t,o,n){return this.httpClient.request({method:"PUT",url:df`user/${e}/${t}/roles`,data:o,options:n})}get(e,t,o){return this.httpClient.request({method:"GET",url:df`user/${e}/${t}`,options:o})}}class dn{constructor(e){this.httpClient=e}getPredictedDatapoints(e,t,o,n){return this.httpClient.request({method:"POST",url:df`asset/predicted/${e}/${t}`,data:o,options:n})}writePredictedDatapoints(e,t,o,n){return this.httpClient.request({method:"PUT",url:df`asset/predicted/${e}/${t}`,data:o,options:n})}}class di{constructor(e){this.httpClient=e}startTunnel(e,t){return this.httpClient.request({method:"POST",url:df`gateway/tunnel`,data:e,options:t})}stopTunnel(e,t){return this.httpClient.request({method:"DELETE",url:df`gateway/tunnel`,data:e,options:t})}getAllActiveTunnelInfos(e,t){return this.httpClient.request({method:"GET",url:df`gateway/tunnel/${e}`,options:t})}getGatewayActiveTunnelInfos(e,t,o){return this.httpClient.request({method:"GET",url:df`gateway/tunnel/${e}/${t}`,options:o})}getActiveTunnelInfo(e,t,o,n,i){return this.httpClient.request({method:"GET",url:df`gateway/tunnel/${e}/${t}/${o}/${n}`,options:i})}}class dr{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:df`asset`,data:e,options:t})}delete(e,t){return this.httpClient.request({method:"DELETE",url:df`asset`,queryParams:e,options:t})}writeAttributeValues(e,t){return this.httpClient.request({method:"PUT",url:df`asset/attributes`,data:e,options:t})}writeAttributeEvents(e,t){return this.httpClient.request({method:"PUT",url:df`asset/attributes/timestamp`,data:e,options:t})}queryCount(e,t){return this.httpClient.request({method:"POST",url:df`asset/count`,data:e,options:t})}updateNoneParent(e,t){return this.httpClient.request({method:"DELETE",url:df`asset/parent`,queryParams:e,options:t})}getPartial(e,t){return this.httpClient.request({method:"GET",url:df`asset/partial/${e}`,options:t})}queryAssets(e,t){return this.httpClient.request({method:"POST",url:df`asset/query`,data:e,options:t})}queryAssetTree(e,t){return this.httpClient.request({method:"POST",url:df`asset/tree`,data:e,options:t})}getCurrentUserAssets(e){return this.httpClient.request({method:"GET",url:df`asset/user/current`,options:e})}createUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:df`asset/user/link`,data:e,options:t})}getUserAssetLinks(e,t){return this.httpClient.request({method:"GET",url:df`asset/user/link`,queryParams:e,options:t})}deleteUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:df`asset/user/link/delete`,data:e,options:t})}deleteAllUserAssetLinks(e,t,o){return this.httpClient.request({method:"DELETE",url:df`asset/user/link/${e}/${t}`,options:o})}deleteUserAssetLink(e,t,o,n){return this.httpClient.request({method:"DELETE",url:df`asset/user/link/${e}/${t}/${o}`,options:n})}get(e,t){return this.httpClient.request({method:"GET",url:df`asset/${e}`,options:t})}update(e,t,o){return this.httpClient.request({method:"PUT",url:df`asset/${e}`,data:t,options:o})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName(e,t,o,n){return this.httpClient.request({method:"PUT",url:df`asset/${e}/attribute/${t}`,data:o,options:n})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName_timestamp(e,t,o,n,i){return this.httpClient.request({method:"PUT",url:df`asset/${e}/attribute/${t}/${o}`,data:n,options:i})}updateParent(e,t,o){return this.httpClient.request({method:"PUT",url:df`asset/${e}/child`,queryParams:t,options:o})}}class da{constructor(e){this.httpClient=e}getAssetDescriptors(e,t){return this.httpClient.request({method:"GET",url:df`model/assetDescriptors`,queryParams:e,options:t})}getAssetInfo(e,t,o){return this.httpClient.request({method:"GET",url:df`model/assetInfo/${e}`,queryParams:t,options:o})}getAssetInfos(e,t){return this.httpClient.request({method:"GET",url:df`model/assetInfos`,queryParams:e,options:t})}getValueDescriptorSchema(e,t){return this.httpClient.request({method:"GET",url:df`model/getValueDescriptorSchema`,queryParams:e,options:t})}getMetaItemDescriptors(e,t){return this.httpClient.request({method:"GET",url:df`model/metaItemDescriptors`,queryParams:e,options:t})}getValueDescriptors(e,t){return this.httpClient.request({method:"GET",url:df`model/valueDescriptors`,queryParams:e,options:t})}}class ds{constructor(e){this.httpClient=e}getServices(e,t){return this.httpClient.request({method:"GET",url:df`service`,queryParams:e,options:t})}registerService(e,t){return this.httpClient.request({method:"POST",url:df`service`,data:e,options:t})}getGlobalServices(e){return this.httpClient.request({method:"GET",url:df`service/global`,options:e})}registerGlobalService(e,t){return this.httpClient.request({method:"POST",url:df`service/global`,data:e,options:t})}deregisterService(e,t,o){return this.httpClient.request({method:"DELETE",url:df`service/${e}/${t}`,options:o})}getService(e,t,o){return this.httpClient.request({method:"GET",url:df`service/${e}/${t}`,options:o})}heartbeat(e,t,o){return this.httpClient.request({method:"PUT",url:df`service/${e}/${t}`,options:o})}}class dl{constructor(e){this.httpClient=e}createProvisioningConfig(e,t){return this.httpClient.request({method:"POST",url:df`provisioning`,data:e,options:t})}getProvisioningConfigs(e){return this.httpClient.request({method:"GET",url:df`provisioning`,options:e})}deleteProvisioningConfig(e,t){return this.httpClient.request({method:"DELETE",url:df`provisioning/${e}`,options:t})}updateProvisioningConfig(e,t,o){return this.httpClient.request({method:"PUT",url:df`provisioning/${e}`,data:t,options:o})}}class dc{constructor(e){this.httpClient=e}getManagerConfig(e){return this.httpClient.request({method:"GET",url:df`configuration/manager`,options:e})}update(e,t){return this.httpClient.request({method:"PUT",url:df`configuration/manager`,data:e,options:t})}fileUpload(e,t,o){return this.httpClient.request({method:"POST",url:df`configuration/manager/file`,queryParams:t,data:e,options:o})}getManagerConfigImage(e,t){return this.httpClient.request({method:"GET",url:df`configuration/manager/image/${e}`,options:t})}}class dd{constructor(e){this.httpClient=e}createAlarm(e,t,o){return this.httpClient.request({method:"POST",url:df`alarm`,queryParams:t,data:e,options:o})}getAlarms(e,t){return this.httpClient.request({method:"GET",url:df`alarm`,queryParams:e,options:t})}removeAlarms(e,t){return this.httpClient.request({method:"DELETE",url:df`alarm`,data:e,options:t})}setAssetLinks(e,t){return this.httpClient.request({method:"PUT",url:df`alarm/assets`,data:e,options:t})}getAlarm(e,t){return this.httpClient.request({method:"GET",url:df`alarm/${e}`,options:t})}removeAlarm(e,t){return this.httpClient.request({method:"DELETE",url:df`alarm/${e}`,options:t})}updateAlarm(e,t,o){return this.httpClient.request({method:"PUT",url:df`alarm/${e}`,data:t,options:o})}getAssetLinks(e,t,o){return this.httpClient.request({method:"GET",url:df`alarm/${e}/assets`,queryParams:t,options:o})}}class du{constructor(e){this.httpClient=e}getHealthStatus(e){return this.httpClient.request({method:"GET",url:df`health`,options:e})}getInfo(e){return this.httpClient.request({method:"GET",url:df`info`,options:e})}}function df(e,...t){let o="";for(let n=0;n<t.length;n++)o+=e[n],o+=encodeURIComponent(t[n]);return o+e[e.length-1]}class dh{constructor(e,t=cQ.create()){this._gatewayClientResource=new db(e,t),this._consoleResource=new dp(e,t),this._realmResource=new dF(e,t),this._rulesResource=new dg(e,t),this._flowResource=new dv(e,t),this._dashboardResource=new d_(e,t),this._agentResource=new dy(e,t),this._syslogResource=new dw(e,t),this._appResource=new dE(e,t),this._assetDatapointResource=new dC(e,t),this._mapResource=new dk(e,t),this._notificationResource=new dA(e,t),this._userResource=new dx(e,t),this._assetPredictedDatapointResource=new dD(e,t),this._gatewayServiceResource=new dS(e,t),this._assetResource=new dT(e,t),this._assetModelResource=new dO(e,t),this._externalServiceResource=new dI(e,t),this._provisioningResource=new dB(e,t),this._configurationResource=new dR(e,t),this._alarmResource=new dP(e,t),this._statusResource=new dN(e,t),this._assetResource=new dT(e,t)}get GatewayClientResource(){return this._gatewayClientResource}get ConsoleResource(){return this._consoleResource}get RealmResource(){return this._realmResource}get RulesResource(){return this._rulesResource}get FlowResource(){return this._flowResource}get DashboardResource(){return this._dashboardResource}get AgentResource(){return this._agentResource}get SyslogResource(){return this._syslogResource}get AppResource(){return this._appResource}get AssetDatapointResource(){return this._assetDatapointResource}get MapResource(){return this._mapResource}get NotificationResource(){return this._notificationResource}get UserResource(){return this._userResource}get AssetPredictedDatapointResource(){return this._assetPredictedDatapointResource}get GatewayServiceResource(){return this._gatewayServiceResource}get AssetResource(){return this._assetResource}get AssetModelResource(){return this._assetModelResource}get ExternalServiceResource(){return this._externalServiceResource}get ProvisioningResource(){return this._provisioningResource}get ConfigurationResource(){return this._configurationResource}get AlarmResource(){return this._alarmResource}get StatusResource(){return this._statusResource}}class dm{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 o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}(t,e.options);let o=e.copyFn;return this.axios.request(t).then(e=>(o&&e.data&&(e.originalData=e.data,e.data=o(e.data)),e))}}class db extends cZ{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dp extends c0{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dF extends c1{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dg extends c2{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dv extends c3{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class d_ extends c5{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dy extends c4{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dw extends c6{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dE extends c8{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dC extends c9{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dk extends c7{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dA extends de{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dx extends dt{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dD extends dn{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dS extends di{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dT extends dr{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dO extends da{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dI extends ds{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dB extends dl{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dR extends dc{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dP extends dd{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dN extends du{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}var dL=o(8183),dM=o.n(dL);cQ.isAxiosError;let dU=new class{get api(){return this._client}constructor(){this._axiosInstance=cQ.create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use(e=>(e.paramsSerializer=e=>dM().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 dh(e,this._axiosInstance)}};var dj=function(e,t,o,n){return new(o||(o=Promise))(function(i,r){function a(e){try{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(a,s)}l((n=n.apply(e,t||[])).next())})};(ey=tA||(tA={})).DISCONNECTED="DISCONNECTED",ey.CONNECTED="CONNECTED",ey.CONNECTING="CONNECTING";let d$="SUBSCRIBED:",dV="UNAUTHORIZED:",dz="TRIGGERED:",dq="EVENT:";class dH{constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=dY.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=tA.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 o=e.indexOf(t);o>=0&&e.splice(o,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===tA.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(tA.CONNECTING),this._connectingDeferred=new sK,this._doConnect().then(e=>{if(this._connectingDeferred){let t=this._connectingDeferred;e?(console.debug("Connected to event service: "+this.endpointUrl),this._reconnectDelayMillis=dY.MIN_RECONNECT_DELAY,this._onStatusChanged(tA.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!==tA.DISCONNECTED&&this._doDisconnect())}subscribe(e,t){let o={eventSubscription:e,callback:t,deferred:new sK};return null!=this._pendingSubscription||this._status!==tA.CONNECTED?(this._queuedSubscriptions.push(o),o.deferred.promise):(this._pendingSubscription=o,this._doSubscribe(e).then(e=>{if(this._pendingSubscription){let t=this._pendingSubscription;this._pendingSubscription=null,this._subscriptionMap.set(e,t),this._processNextSubscription();let o=t.deferred;t.deferred=null,o&&o.resolve(e)}},e=>{if(console.error(e),this._pendingSubscription){let t=this._pendingSubscription;this._pendingSubscription=null,this._processNextSubscription();let o=t.deferred;t.deferred=null,o&&o.reject(e)}}),this._pendingSubscription.deferred.promise)}unsubscribe(e){return dj(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===tA.CONNECTED&&this._doSend(e)}sendEventWithReply(e){return this._status!==tA.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(e)}subscribeAssetEvents(e,t,o){return dj(this,void 0,void 0,function*(){let n=e&&"string"!=typeof e[0]?e.map(e=>e.id):e,i="AssetEvent"+dH._subscriptionCounter++;if(!this._assetEventPromise){let e;ul.authenticated||(e={filterType:"asset",realm:ul.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;n?n.find(e=>t===e)&&o(e):e.asset.realm===ul.displayRealm&&o(e)}),this._assetEventPromise.then(()=>{try{if(n&&t){let e={messageID:"read-assets:"+n.join(",")+":"+i,eventType:"read-assets",assetQuery:{ids:n}};this.sendEventWithReply(e).then(e=>{e.assets&&this._assetEventCallbackMap.has(i)&&e.assets.forEach(e=>{o({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,o){return dj(this,void 0,void 0,function*(){let n=e&&"string"!=typeof e[0],i=n?e.map(e=>e.id):e,r=n?e:void 0,a="AttributeEvent"+dH._subscriptionCounter++;if(!this._attributeEventPromise){let e;ul.authenticated||(e={filterType:"asset",realm:ul.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;n?e.forEach(e=>{r.id===e.id&&r.name===e.name&&o(t)}):i?i.find(e=>r.id===e)&&o(t):t.realm===ul.displayRealm&&o(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,o])=>{(!r||r.find(o=>o.id===e.id&&o.name===t))&&s({eventType:"attribute",timestamp:o.timestamp,value:o.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===tA.CONNECTED&&0!==this._queuedSubscriptions.length&&setTimeout(()=>{let e=this._queuedSubscriptions.shift();e&&this.subscribe(e.eventSubscription,e.callback).then(t=>{let o=e.deferred;e.deferred=null,o&&o.resolve(t)},t=>{let o=e.deferred;e.deferred=null,o&&o.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 o=this._subscriptionMap.get(e);o&&o.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===tA.CONNECTED&&this._onStatusChanged(tA.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._onStatusChanged(tA.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<dY.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(dY.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}dH.MIN_RECONNECT_DELAY=0,dH.MAX_RECONNECT_DELAY=3e4,dH._subscriptionCounter=0;class dY extends dH{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="+ul.config.realm;return this._connectDeferred=new sK,(ul.authenticated?ul.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(d$)){let e=JSON.parse(t.substring(d$.length)),o=this._subscribeDeferred;this._subscribeDeferred=null,o&&o.resolve(e.subscriptionId)}else if(t.startsWith(dV)){let e=JSON.parse(t.substring(dV.length)),o=this._subscribeDeferred;this._subscribeDeferred=null,o&&(console.warn("Unauthorized event subscription: "+JSON.stringify(e,null,2)),o.reject("Unauthorized"))}else if(t.startsWith(dz)){let e=JSON.parse(t.substring(dz.length));e.events&&e.events.forEach(t=>{this._onMessageReceived(e.subscriptionId,t)})}else if(t.startsWith(dq)){let e=JSON.parse(t.substring(dq.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 sK,e.subscriptionId||(e.subscriptionId=dY._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=dq+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 sK;return this._repliesDeferred.set(e.messageID,t),this._webSocket.send(dq+JSON.stringify(e)),t.promise}}dY._subscriptionCounter=1;let dW=["__proto__","constructor","prototype"];function dG(e){return!("string"!=typeof e||0===e.length||e.length>128||dW.indexOf(e)>-1||e.indexOf("..")>-1||e.indexOf("\\")>-1||/[?#%\s@]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function dK(e){return!(!dG(e)||e.indexOf("/")>-1)}let dJ={lng:dK,ns:function(e){return dG(e)}};function dX(e){return"string"!=typeof e?e:e.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function dQ(){return"function"==typeof XMLHttpRequest||"object"==typeof XMLHttpRequest}let dZ=/\{\{(.+?)\}\}/g;function d0(e,t){let o=!1,n=e.replace(dZ,(e,n)=>{let i=n.trim();if(dW.indexOf(i)>-1)return e;let r=t[i];if(null==r)return e;let a=dJ[i]||dK,s=String(r).split("+");for(let t of s)if(!a(t))return o=!0,e;return s.join("+")});return o?null:n}let d1="u">typeof globalThis?globalThis:"u">typeof global?global:"u">typeof window?window:void 0;"function"==typeof fetch?i=fetch:d1&&"function"==typeof d1.fetch&&(i=d1.fetch);let d2=dQ()&&d1?d1.XMLHttpRequest:void 0,d3="function"==typeof ActiveXObject&&d1?d1.ActiveXObject:void 0,d5=["__proto__","constructor","prototype"],d4=(e,t)=>{if(t&&"object"==typeof t){let o="";for(let e of Object.keys(t))d5.indexOf(e)>-1||(o+="&"+encodeURIComponent(e)+"="+encodeURIComponent(t[e]));if(!o)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+o.slice(1)}return e},d6=(e,t,o,n)=>{let r=e=>{if(!e.ok)return o(e.statusText||"Error",{status:e.status});e.text().then(t=>{o(null,{status:e.status,data:t})}).catch(o)};if(n){let i=n(e,t);if(i instanceof Promise)return void i.then(r).catch(o)}"function"==typeof fetch?fetch(e,t).then(r).catch(o):i(e,t).then(r).catch(o)},d8=(e,t,o,n)=>{if("function"==typeof o&&(n=o,o=void 0),n=n||(()=>{}),i&&0!==t.indexOf("file:")){var r=t,a=o,s=n;e.queryStringParams&&(r=d4(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 l="function"==typeof e.requestOptions?e.requestOptions(a):e.requestOptions,c={method:a?"POST":"GET",body:a?e.stringify(a):void 0,headers:i,...e._omitFetchOptions?{}:l},d="function"==typeof e.alternateFetch&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{d6(r,c,s,d)}catch(t){if(!l||0===Object.keys(l).length||!t.message||0>t.message.indexOf("not implemented"))return s(t);try{Object.keys(l).forEach(e=>{delete c[e]}),d6(r,c,s,d),e._omitFetchOptions=!0}catch(e){s(e)}}return}if(dQ()||"function"==typeof ActiveXObject){var l=t,c=o,d=n;c&&"object"==typeof c&&(c=d4("",c).slice(1)),e.queryStringParams&&(l=d4(l,e.queryStringParams));try{let t=d2?new d2:new d3("MSXML2.XMLHTTP.3.0");t.open(c?"POST":"GET",l,1),e.crossDomain||t.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.withCredentials=!!e.withCredentials,c&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),t.overrideMimeType&&t.overrideMimeType("application/json");let o=e.customHeaders;if(o="function"==typeof o?o():o)for(let e of Object.keys(o))d5.indexOf(e)>-1||t.setRequestHeader(e,o[e]);t.onreadystatechange=()=>{t.readyState>3&&d(t.status>=400?t.statusText:null,{status:t.status,data:t.responseText})},t.send(c)}catch(e){console&&console.log(e)}return}n(Error("No fetch and no xhr implementation found!"))};var d9=class{constructor(e,t={},o={}){this.services=e,this.options=t,this.allOptions=o,this.type="backend",this.init(e,t,o)}init(e,t={},o={}){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,o)=>({[t]:o||""}),parseLoadPayload:(e,t)=>void 0,request:d8,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=o,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,o){this._readAny(e,e,t,t,o)}read(e,t,o){this._readAny([e],e,[t],t,o)}_readAny(e,t,o,n,i){var r,a;let s=this.options.loadPath;"function"==typeof this.options.loadPath&&(s=this.options.loadPath(e,o)),(s=(a=r=s)&&"function"==typeof a.then?r:Promise.resolve(r)).then(r=>{if(!r)return i(null,{});let a=d0(r,{lng:e.join("+"),ns:o.join("+")});if(null==a)return i(Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+e.map(dX).join(", ")+"] namespaces=["+o.map(dX).join(", ")+"]"),!1);this.loadUrl(a,i,t,n)})}loadUrl(e,t,o,n){let i=this.options.parseLoadPayload("string"==typeof o?[o]:o,"string"==typeof n?[n]:n),r=dX(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 o=e.message.toLowerCase();if(["failed","fetch","network","load"].find(e=>o.indexOf(e)>-1))return t("failed loading "+r+": "+dX(e.message),!0)}if(e)return t(e,!1);try{a="string"==typeof i.data?this.options.parse(i.data,o,n):i.data}catch(e){s="failed parsing "+r+" to json"}if(s)return t(s,!1);t(null,a)})}create(e,t,o,n,i){if(!this.options.addPath)return;"string"==typeof e&&(e=[e]);let r=this.options.parsePayload(t,o,n),a=0,s=[],l=[];e.forEach(o=>{let n=this.options.addPath;"function"==typeof this.options.addPath&&(n=this.options.addPath(o,t));let c=d0(n,{lng:o,ns:t});if(null==c){a+=1,i&&a===e.length&&i(s,l);return}this.options.request(this.options,c,r,(t,o)=>{a+=1,s.push(t),l.push(o),a===e.length&&"function"==typeof i&&i(s,l)})})}reload(){let{backendConnector:e,languageUtils:t,logger:o}=this.services,n=e.language;if(n&&"cimode"===n.toLowerCase())return;let i=[],r=e=>{t.toResolveHierarchy(e).forEach(e=>{0>i.indexOf(e)&&i.push(e)})};r(n),this.allOptions.preload&&this.allOptions.preload.forEach(e=>r(e)),i.forEach(t=>{this.allOptions.ns.forEach(n=>{e.read(t,n,"read",null,null,(i,r)=>{i&&o.warn(`loading namespace ${n} for language ${t} failed`,i),!i&&r&&o.log(`loaded namespace ${n} for language ${t}`,r),e.loaded(`${t}|${n}`,i,r)})})})}};d9.type="backend";var d7=o(4954);class ue extends Error{}function ut(e,t){let o;if("string"!=typeof e)throw new ue("Invalid token specified: must be a string");t||(t={});let n=+(!0!==t.header),i=e.split(".")[n];if("string"!=typeof i)throw new ue(`Invalid token specified: missing part #${n+1}`);try{o=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 o;return o=t,decodeURIComponent(atob(o).replace(/(.)/g,(e,t)=>{let o=t.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}catch(e){return atob(t)}}(i)}catch(e){throw new ue(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(o)}catch(e){throw new ue(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}if(ue.prototype.name="InvalidTokenError","u"<typeof Promise)throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function uo(e){if(!(this instanceof uo))throw Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var t,o,n=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=")&&(n.iframeVersion=a[s].src.substring(a[s].src.indexOf("version=")+8).split("&")[0]);var l=!0,c=x(console.info),d=x(console.warn);function u(e,t){for(var o=function(e){var t=null,o=window.crypto||window.msCrypto;if(o&&o.getRandomValues&&window.Uint8Array)return t=new Uint8Array(e),o.getRandomValues(t),t;t=Array(e);for(var n=0;n<t.length;n++)t[n]=Math.floor(256*Math.random());return t}(e),n=Array(e),i=0;i<e;i++)n[i]=t.charCodeAt(o[i]%t.length);return String.fromCharCode.apply(null,n)}function f(){return void 0===n.authServerUrl?void 0:"/"==n.authServerUrl.charAt(n.authServerUrl.length-1)?n.authServerUrl+"realms/"+encodeURIComponent(n.realm):n.authServerUrl+"/realms/"+encodeURIComponent(n.realm)}function h(e,t){var o=e.code,i=e.error,r=e.prompt,a=new Date().getTime();if(e.kc_action_status&&n.onActionUpdate&&n.onActionUpdate(e.kc_action_status),i){if("none"!=r)if(e.error_description&&"authentication_expired"===e.error_description)n.login(e.loginOptions);else{var s={error:i,error_description:e.error_description};n.onAuthError&&n.onAuthError(s),t&&t.setError(s)}else t&&t.setSuccess();return}if("standard"!=n.flow&&(e.access_token||e.id_token)&&h(e.access_token,null,e.id_token,!0),"implicit"!=n.flow&&o){var d="code="+o+"&grant_type=authorization_code",u=n.endpoints.token(),f=new XMLHttpRequest;f.open("POST",u,!0),f.setRequestHeader("Content-type","application/x-www-form-urlencoded"),d+="&client_id="+encodeURIComponent(n.clientId)+"&redirect_uri="+e.redirectUri,e.pkceCodeVerifier&&(d+="&code_verifier="+e.pkceCodeVerifier),f.withCredentials=!0,f.onreadystatechange=function(){if(4==f.readyState)if(200==f.status){var e=JSON.parse(f.responseText);h(e.access_token,e.refresh_token,e.id_token,"standard"===n.flow),y()}else n.onAuthError&&n.onAuthError(),t&&t.setError()},f.send(d)}function h(o,i,r,s){b(o,i,r,a=(a+new Date().getTime())/2),l&&n.idTokenParsed&&n.idTokenParsed.nonce!=e.storedNonce?(c("[KEYCLOAK] Invalid nonce, clearing token"),n.clearToken(),t&&t.setError()):s&&(n.onAuthSuccess&&n.onAuthSuccess(),t&&t.setSuccess())}}function m(e){return 0==e.status&&e.responseText&&e.responseURL.startsWith("file:")}function b(e,t,o,i){if(n.tokenTimeoutHandle&&(clearTimeout(n.tokenTimeoutHandle),n.tokenTimeoutHandle=null),t?(n.refreshToken=t,n.refreshTokenParsed=ut(t)):(delete n.refreshToken,delete n.refreshTokenParsed),o?(n.idToken=o,n.idTokenParsed=ut(o)):(delete n.idToken,delete n.idTokenParsed),e){if(n.token=e,n.tokenParsed=ut(e),n.sessionId=n.tokenParsed.sid,n.authenticated=!0,n.subject=n.tokenParsed.sub,n.realmAccess=n.tokenParsed.realm_access,n.resourceAccess=n.tokenParsed.resource_access,i&&(n.timeSkew=Math.floor(i/1e3)-n.tokenParsed.iat),null!=n.timeSkew&&(c("[KEYCLOAK] Estimated time difference between browser and server is "+n.timeSkew+" seconds"),n.onTokenExpired)){var r=(n.tokenParsed.exp-new Date().getTime()/1e3+n.timeSkew)*1e3;c("[KEYCLOAK] Token expires in "+Math.round(r/1e3)+" s"),r<=0?n.onTokenExpired():n.tokenTimeoutHandle=setTimeout(n.onTokenExpired,r)}}else delete n.token,delete n.tokenParsed,delete n.subject,delete n.realmAccess,delete n.resourceAccess,n.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 F(e){var t=function(e){switch(n.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,o,i,r=e.indexOf("?"),a=e.indexOf("#");if("query"===n.responseMode&&-1!==r?(o=e.substring(0,r),""!==(i=g(e.substring(r+1,-1!==a?a:e.length),t)).paramsString&&(o+="?"+i.paramsString),-1!==a&&(o+=e.substring(a))):"fragment"===n.responseMode&&-1!==a&&(o=e.substring(0,a),""!==(i=g(e.substring(a+1),t)).paramsString&&(o+="#"+i.paramsString)),i&&i.oauthParams){if("standard"===n.flow||"hybrid"===n.flow){if((i.oauthParams.code||i.oauthParams.error)&&i.oauthParams.state)return i.oauthParams.newUrl=o,i.oauthParams}else if("implicit"===n.flow&&(i.oauthParams.access_token||i.oauthParams.error)&&i.oauthParams.state)return i.oauthParams.newUrl=o,i.oauthParams}}(e);if(t){var i=o.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 o=e.split("&"),n={paramsString:"",oauthParams:{}},i=0;i<o.length;i++){var r=o[i].indexOf("="),a=o[i].slice(0,r);-1!==t.indexOf(a)?n.oauthParams[a]=o[i].slice(r+1):(""!==n.paramsString&&(n.paramsString+="&"),n.paramsString+=o[i])}return n}function v(){var e={setSuccess:function(t){e.resolve(t)},setError:function(t){e.reject(t)}};return e.promise=new Promise(function(t,o){e.resolve=t,e.reject=o}),e}function _(){var e=v();if(!r.enable||r.iframe)return e.setSuccess(),e.promise;var t=document.createElement("iframe");r.iframe=t,t.onload=function(){var t=n.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 o=n.endpoints.checkSessionIframe();return t.setAttribute("src",o),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&&n.clearToken();for(var t=r.callbackList.splice(0,r.callbackList.length),o=t.length-1;o>=0;--o){var i=t[o];"error"==e.data?i.setError():i.setSuccess("unchanged"==e.data)}}},!1),e.promise}function y(){r.enable&&n.token&&setTimeout(function(){w().then(function(e){e&&y()})},1e3*r.interval)}function w(){var e=v();if(r.iframe&&r.iframeOrigin){var t=n.clientId+" "+(n.sessionId?n.sessionId:"");r.callbackList.push(e);var o=r.iframeOrigin;1==r.callbackList.length&&r.iframe.contentWindow.postMessage(t,o)}else e.setSuccess();return e.promise}function E(){var e,t,o,i=v();if(r.enable||n.silentCheckSsoRedirectUri){var a=document.createElement("iframe");a.setAttribute("src",n.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&&(d("[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,n.silentCheckSsoFallback&&(n.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=n.messageReceiveTimeout,o=null,Promise.race([e,new Promise(function(e,n){o=setTimeout(function(){n({error:"Timeout when waiting for 3rd party check iframe message."})},t)})]).finally(function(){clearTimeout(o)})}function C(e){if(!e||"default"==e)return{login:function(e){return window.location.assign(n.createLoginUrl(e)),v().promise},logout:async function(e){if("GET"===(e?.logoutMethod??n.logoutMethod))return void window.location.replace(n.createLogoutUrl(e));let o=n.createLogoutUrl(e),i=await fetch(o,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({id_token_hint:n.idToken,client_id:n.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(n.createRegisterUrl(e)),v().promise},accountManagement:function(){var e=n.createAccountUrl();if(void 0!==e)window.location.href=e;else throw"Not supported by the OIDC server";return v().promise},redirectUri:function(e,t){return e&&e.redirectUri?e.redirectUri:n.redirectUri?n.redirectUri:location.href}};if("cordova"==e){r.enable=!1;var o=function(e,t,o){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(e,t,o):window.open(e,t,o)},i=function(e){var t=e&&e.cordovaOptions?Object.keys(e.cordovaOptions).reduce(function(t,o){return t[o]=e.cordovaOptions[o],t},{}):{};return t.location="no",e&&"none"==e.prompt&&(t.hidden="yes"),Object.keys(t).reduce(function(e,o){return e.push(o+"="+t[o]),e},[]).join(",")},a=function(){return n.redirectUri||"http://localhost"};return{login:function(e){var t=v(),r=i(e),s=o(n.createLoginUrl(e),"_blank",r),l=!1,c=!1,d=function(){c=!0,s.close()};return s.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&(h(F(e.url),t),d(),l=!0)}),s.addEventListener("loaderror",function(e){l||(0==e.url.indexOf(a())?(h(F(e.url),t),d(),l=!0):(t.setError(),d()))}),s.addEventListener("exit",function(e){c||t.setError({reason:"closed_by_user"})}),t.promise},logout:function(e){var t,i=v(),r=o(n.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():(n.clearToken(),i.setSuccess())}),i.promise},register:function(e){var t=v(),r=o(n.createRegisterUrl(),"_blank",i(e));return r.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&(r.close(),h(F(e.url),t))}),t.promise},accountManagement:function(){var e=n.createAccountUrl();if(void 0!==e){var t=o(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=v(),o=n.createLoginUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),h(F(e.url),t)}),window.cordova.plugins.browsertab.openUrl(o),t.promise},logout:function(e){var t=v(),o=n.createLogoutUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),n.clearToken(),t.setSuccess()}),window.cordova.plugins.browsertab.openUrl(o),t.promise},register:function(e){var t=v(),o=n.createRegisterUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),h(F(e.url),t)}),window.cordova.plugins.browsertab.openUrl(o),t.promise},accountManagement:function(){var e=n.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:n.redirectUri?n.redirectUri:"http://localhost"}};throw"invalid adapter type: "+e}n.init=function(i){if(n.didInitialize)throw Error("A 'Keycloak' instance can only be initialized once.");if(n.didInitialize=!0,n.authenticated=!1,o=function(){try{return new k}catch(e){}return new A}(),t=i&&["default","cordova","cordova-native"].indexOf(i.adapter)>-1?C(i.adapter):i&&"object"==typeof i.adapter?i.adapter:window.Cordova||window.cordova?C("cordova"):C(),i){if(void 0!==i.useNonce&&(l=i.useNonce),void 0!==i.checkLoginIframe&&(r.enable=i.checkLoginIframe),i.checkLoginIframeInterval&&(r.interval=i.checkLoginIframeInterval),"login-required"===i.onLoad&&(n.loginRequired=!0),i.responseMode)if("query"===i.responseMode||"fragment"===i.responseMode)n.responseMode=i.responseMode;else throw"Invalid value for responseMode";if(i.flow){switch(i.flow){case"standard":n.responseType="code";break;case"implicit":n.responseType="id_token token";break;case"hybrid":n.responseType="code id_token token";break;default:throw"Invalid value for flow"}n.flow=i.flow}if(null!=i.timeSkew&&(n.timeSkew=i.timeSkew),i.redirectUri&&(n.redirectUri=i.redirectUri),i.silentCheckSsoRedirectUri&&(n.silentCheckSsoRedirectUri=i.silentCheckSsoRedirectUri),"boolean"==typeof i.silentCheckSsoFallback?n.silentCheckSsoFallback=i.silentCheckSsoFallback:n.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}.`);n.pkceMethod=i.pkceMethod}else n.pkceMethod="S256";"boolean"==typeof i.enableLogging?n.enableLogging=i.enableLogging:n.enableLogging=!1,"POST"===i.logoutMethod?n.logoutMethod="POST":n.logoutMethod="GET","string"==typeof i.scope&&(n.scope=i.scope),"string"==typeof i.acrValues&&(n.acrValues=i.acrValues),"number"==typeof i.messageReceiveTimeout&&i.messageReceiveTimeout>0?n.messageReceiveTimeout=i.messageReceiveTimeout:n.messageReceiveTimeout=1e4}n.responseMode||(n.responseMode="fragment"),n.responseType||(n.responseType="code",n.flow="standard");var a=v(),s=v();s.promise.then(function(){n.onReady&&n.onReady(n.authenticated),a.setSuccess(n.authenticated)}).catch(function(e){a.setError(e)});var c=function(){var t=v();function o(e){e?n.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}}:n.endpoints={authorize:function(){return f()+"/protocol/openid-connect/auth"},token:function(){return f()+"/protocol/openid-connect/token"},logout:function(){return f()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var e=f()+"/protocol/openid-connect/login-status-iframe.html";return n.iframeVersion&&(e=e+"?version="+n.iframeVersion),e},thirdPartyCookiesIframe:function(){var e=f()+"/protocol/openid-connect/3p-cookies/step1.html";return n.iframeVersion&&(e=e+"?version="+n.iframeVersion),e},register:function(){return f()+"/protocol/openid-connect/registrations"},userinfo:function(){return f()+"/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||m(i)){var e=JSON.parse(i.responseText);n.authServerUrl=e["auth-server-url"],n.realm=e.realm,n.clientId=e.resource,o(null),t.setSuccess()}else t.setError()},i.send()}else{if(!e.clientId)throw"clientId missing";n.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||m(i)?(o(JSON.parse(i.responseText)),t.setSuccess()):t.setError())},i.send()}else o(r),t.setSuccess();else{if(!e.url){for(var l=document.getElementsByTagName("script"),c=0;c<l.length;c++)if(l[c].src.match(/.*keycloak\.js/)){e.url=l[c].src.substr(0,l[c].src.indexOf("/js/keycloak.js"));break}}if(!e.realm)throw"realm missing";n.authServerUrl=e.url,n.realm=e.realm,o(null),t.setSuccess()}}return t.promise}();function d(){var e=function(e){e||(o.prompt="none"),i&&i.locale&&(o.locale=i.locale),n.login(o).then(function(){s.setSuccess()}).catch(function(e){s.setError(e)})},t=function(){var e=document.createElement("iframe"),t=n.createLoginUrl({prompt:"none",redirectUri:n.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 o=function(t){t.origin===window.location.origin&&e.contentWindow===t.source&&(h(F(t.data),s),document.body.removeChild(e),window.removeEventListener("message",o))};window.addEventListener("message",o)},o={};switch(i.onLoad){case"check-sso":r.enable?_().then(function(){w().then(function(o){o?s.setSuccess():n.silentCheckSsoRedirectUri?t():e(!1)}).catch(function(e){s.setError(e)})}):n.silentCheckSsoRedirectUri?t():e(!1);break;case"login-required":e(!0);break;default:throw"Invalid value for onLoad"}}function u(){var e=F(window.location.href);if(e&&window.history.replaceState(window.history.state,null,e.newUrl),e&&e.valid)return _().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?_().then(function(){w().then(function(e){e?(n.onAuthSuccess&&n.onAuthSuccess(),s.setSuccess(),y()):s.setSuccess()}).catch(function(e){s.setError(e)})}):n.updateToken(-1).then(function(){n.onAuthSuccess&&n.onAuthSuccess(),s.setSuccess()}).catch(function(e){n.onAuthError&&n.onAuthError(),i.onLoad?d():s.setError(e)})):i.onLoad?d():s.setSuccess():s.setSuccess()}return c.then(function(){var e,t;(e=v(),t=function(){("interactive"===document.readyState||"complete"===document.readyState)&&(document.removeEventListener("readystatechange",t),e.setSuccess())},document.addEventListener("readystatechange",t),t(),e.promise).then(E).then(u).catch(function(e){a.setError(e)})}),c.catch(function(e){a.setError(e)}),a.promise},n.login=function(e){return t.login(e)},n.createLoginUrl=function(e){var i,r=p(),a=p(),s=t.redirectUri(e),c={state:r,nonce:a,redirectUri:encodeURIComponent(s),loginOptions:e};e&&e.prompt&&(c.prompt=e.prompt),i=e&&"register"==e.action?n.endpoints.register():n.endpoints.authorize();var d=e&&e.scope||n.scope;d?-1===d.indexOf("openid")&&(d="openid "+d):d="openid";var f=i+"?client_id="+encodeURIComponent(n.clientId)+"&redirect_uri="+encodeURIComponent(s)+"&state="+encodeURIComponent(r)+"&response_mode="+encodeURIComponent(n.responseMode)+"&response_type="+encodeURIComponent(n.responseType)+"&scope="+encodeURIComponent(d);if(l&&(f=f+"&nonce="+encodeURIComponent(a)),e&&e.prompt&&(f+="&prompt="+encodeURIComponent(e.prompt)),e&&e.maxAge&&(f+="&max_age="+encodeURIComponent(e.maxAge)),e&&e.loginHint&&(f+="&login_hint="+encodeURIComponent(e.loginHint)),e&&e.idpHint&&(f+="&kc_idp_hint="+encodeURIComponent(e.idpHint)),e&&e.action&&"register"!=e.action&&(f+="&kc_action="+encodeURIComponent(e.action)),e&&e.locale&&(f+="&ui_locales="+encodeURIComponent(e.locale)),e&&e.acr&&(f+="&claims="+encodeURIComponent(JSON.stringify({id_token:{acr:e.acr}}))),(e&&e.acrValues||n.acrValues)&&(f+="&acr_values="+encodeURIComponent(e.acrValues||n.acrValues)),n.pkceMethod){var h=u(96,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");c.pkceCodeVerifier=h,f+="&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(d7.arrayBuffer(t)))).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}(n.pkceMethod,h)+"&code_challenge_method="+n.pkceMethod}return o.add(c),f},n.logout=function(e){return t.logout(e)},n.createLogoutUrl=function(e){if("POST"===(e?.logoutMethod??n.logoutMethod))return n.endpoints.logout();var o=n.endpoints.logout()+"?client_id="+encodeURIComponent(n.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(t.redirectUri(e,!1));return n.idToken&&(o+="&id_token_hint="+encodeURIComponent(n.idToken)),o},n.register=function(e){return t.register(e)},n.createRegisterUrl=function(e){return e||(e={}),e.action="register",n.createLoginUrl(e)},n.createAccountUrl=function(e){var o=f(),i=void 0;return void 0!==o&&(i=o+"/account?referrer="+encodeURIComponent(n.clientId)+"&referrer_uri="+encodeURIComponent(t.redirectUri(e))),i},n.accountManagement=function(){return t.accountManagement()},n.hasRealmRole=function(e){var t=n.realmAccess;return!!t&&t.roles.indexOf(e)>=0},n.hasResourceRole=function(e,t){if(!n.resourceAccess)return!1;var o=n.resourceAccess[t||n.clientId];return!!o&&o.roles.indexOf(e)>=0},n.loadUserProfile=function(){var e=f()+"/account",t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+n.token);var o=v();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(n.profile=JSON.parse(t.responseText),o.setSuccess(n.profile)):o.setError())},t.send(),o.promise},n.loadUserInfo=function(){var e=n.endpoints.userinfo(),t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+n.token);var o=v();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(n.userInfo=JSON.parse(t.responseText),o.setSuccess(n.userInfo)):o.setError())},t.send(),o.promise},n.isTokenExpired=function(e){if(!n.tokenParsed||!n.refreshToken&&"implicit"!=n.flow)throw"Not authenticated";if(null==n.timeSkew)return c("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var t=n.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+n.timeSkew;if(e){if(isNaN(e))throw"Invalid minValidity";t-=e}return t<0},n.updateToken=function(e){var t=v();if(!n.refreshToken)return t.setError(),t.promise;e=e||5;var o=function(){var o=!1;if(-1==e?(o=!0,c("[KEYCLOAK] Refreshing token: forced refresh")):(!n.tokenParsed||n.isTokenExpired(e))&&(o=!0,c("[KEYCLOAK] Refreshing token: token expired")),o){var r="grant_type=refresh_token&refresh_token="+n.refreshToken,a=n.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(n.clientId);var l=new Date().getTime();s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status){c("[KEYCLOAK] Token refreshed"),l=(l+new Date().getTime())/2;var e=JSON.parse(s.responseText);b(e.access_token,e.refresh_token,e.id_token,l),n.onAuthRefreshSuccess&&n.onAuthRefreshSuccess();for(var t=i.pop();null!=t;t=i.pop())t.setSuccess(!0)}else{d("[KEYCLOAK] Failed to refresh token"),400==s.status&&n.clearToken(),n.onAuthRefreshError&&n.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(){o()}).catch(function(e){t.setError(e)}):o(),t.promise},n.clearToken=function(){n.token&&(b(null,null,null),n.onAuthLogout&&n.onAuthLogout(),n.loginRequired&&n.login())};var k=function(){if(!(this instanceof k))return new k;function e(){for(var e=new Date().getTime(),t=0;t<localStorage.length;t++){var o=localStorage.key(t);if(o&&0==o.indexOf("kc-callback-")){var n=localStorage.getItem(o);if(n)try{var i=JSON.parse(n).expires;(!i||i<e)&&localStorage.removeItem(o)}catch(e){localStorage.removeItem(o)}}}}localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test"),this.get=function(t){if(t){var o="kc-callback-"+t,n=localStorage.getItem(o);return n&&(localStorage.removeItem(o),n=JSON.parse(n)),e(),n}},this.add=function(t){e();var o="kc-callback-"+t.state;t.expires=new Date().getTime()+36e5,localStorage.setItem(o,JSON.stringify(t))}},A=function(){if(!(this instanceof A))return new A;this.get=function(n){if(n){var i=t("kc-callback-"+n);if(o("kc-callback-"+n,"",e(-100)),i)return JSON.parse(i)}},this.add=function(t){o("kc-callback-"+t.state,JSON.stringify(t),e(60))},this.removeItem=function(t){o(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+"=",o=document.cookie.split(";"),n=0;n<o.length;n++){for(var i=o[n];" "==i.charAt(0);)i=i.substring(1);if(0==i.indexOf(t))return i.substring(t.length,i.length)}return""},o=function(e,t,o){var n=e+"="+t+"; expires="+o.toUTCString()+"; ";document.cookie=n}};function x(e){return function(){n.enableLogging&&e.apply(console,Array.prototype.slice.call(arguments))}}}var un=function(e,t,o,n){return new(o||(o=Promise))(function(i,r){function a(e){try{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(a,s)}l((n=n.apply(e,t||[])).next())})};let ui="openremote";(ew=tx||(tx={})).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",(eE=tD||(tD={})).ERROR="ERROR",eE.READY="READY",eE.ONLINE="ONLINE",eE.OFFLINE="OFFLINE",eE.CONNECTING="CONNECTING",eE.CONSOLE_INIT="CONSOLE_INIT",eE.CONSOLE_READY="CONSOLE_READY",eE.TRANSLATE_INIT="TRANSLATE_INIT",eE.TRANSLATE_LANGUAGE_CHANGED="TRANSLATE_LANGUAGE_CHANGED",eE.DISPLAY_REALM_CHANGED="DISPLAY_REALM_CHANGED",eE.LOGIN="LOGIN";let ur={cn:"zh-cn"};class ua{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,o])=>{let n=o.roles;e.set(t,n)}),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 dU}get language(){return nY.language}set language(e){console.debug(`Changing language to ${e}.`),e&&(nY.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(tD.DISPLAY_REALM_CHANGED))}get clientId(){return this._config.clientId||ui}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 un(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=ui),t);let o=yield this.loadManagerInfo(),n=new s0(this._config.realm,this._config.consoleAutoEnable,()=>{this._emitEvent(tD.CONSOLE_READY)});if(this._console=n,"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);try{e=new URL(this._authServerUrl)}catch(o){(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(/\/+$/,""),o=yield this.doAuthInit()}return!!o&&(o&&(o=this.doRestApiInit()),(yield this.doConsoleInit())&&this._clearWebHistory(),(o=(yield this.doTranslateInit())&&o)&&(o=yield this.doDescriptorsInit(),o=yield this.getConsoleAppConfig()),this.doIconInit(),o?(o=yield this.doEventsSubscriptionInit(),this._ready=!0,this._emitEvent(tD.READY)):(this._config=void 0,console.warn("Failed to initialise the manager")),this.displayRealm=e.realm||"master",o)})}loadManagerInfo(){return un(this,void 0,void 0,function*(){try{let e=yield new Promise((e,t)=>{let o=new XMLHttpRequest;o.addEventListener("load",()=>{e(JSON.parse(o.responseText))}),o.addEventListener("error",()=>{t(Error("Failed to contact the manager"))}),o.open("GET",this._config.managerUrl+"/api/master/info"),o.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(tx.MANAGER_FAILED_TO_LOAD),!1}})}doTranslateInit(){return un(this,void 0,void 0,function*(){if(nY.isInitialized)return!0;nY.on("initialized",e=>{this._emitEvent(tD.TRANSLATE_INIT)}),nY.on("languageChanged",e=>{var t;sG().locale(null!=(t=ur[e])?t:e),this._emitEvent(tD.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,interpolation:{format:(e,t,o)=>"uppercase"===t?e.toUpperCase():e instanceof Date?sG()(e).format(t):e},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 nY.use(d9).init(e)}catch(e){return console.error(e),this._setError(tx.TRANSLATION_ERROR),!1}return!0})}doDescriptorsInit(){return un(this,void 0,void 0,function*(){if(!this.config.loadDescriptors)return!0;try{let e=yield dU.api.AssetModelResource.getAssetInfos(),t=yield dU.api.AssetModelResource.getMetaItemDescriptors(),o=yield dU.api.AssetModelResource.getValueDescriptors();oq._assetTypeInfos=e.data,oq._metaItemDescriptors=Object.values(t.data),oq._valueDescriptors=Object.values(o.data)}catch(e){return console.error(e),!1}return!0})}doAuthInit(){return un(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(tx.AUTH_TYPE_UNSUPPORTED),!1}return!!e&&(dU.addRequestInterceptor(e=>{if(!e.headers.Authorization){let t=this.getAuthorizationHeader();t&&(e.headers.Authorization=t)}return e}),e)})}doRestApiInit(){return dU.setTimeout(2e4),dU.initialise(this.getApiBaseUrl()),!0}doEventsSubscriptionInit(){return un(this,void 0,void 0,function*(){let e=!1;return"WEBSOCKET"===this._config.eventProviderType&&(this._events=new dY(this._config.managerUrl),this._events.subscribeStatusChange(e=>this._onEventProviderStatusChanged(e)),e=yield this._events.connect()),e||this._setError(tx.EVENTS_CONNECTION_ERROR),e})}_connectEvents(){var e;(null==(e=this.events)?void 0:e.status)===tA.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 tA.DISCONNECTED:this._onDisconnect();break;case tA.CONNECTED:break;case tA.CONNECTING:this._emitEvent(tD.CONNECTING)}}doConsoleInit(){return un(this,void 0,void 0,function*(){try{return yield this.console.initialise(),this._emitEvent(tD.CONSOLE_INIT),!0}catch(e){return this._setError(tx.CONSOLE_ERROR),!1}})}doIconInit(){var e;this._config.loadIcons&&(oG.addIconSet("mdi",(e=us.managerUrl,{getIconTemplate:e=>of`<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.eot");\n src: url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.eot") format("embedded-opentype"), url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.woff2") format("woff2"), url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.woff") format("woff"), url("'+e+'/shared/fonts/Material Design Icons//fonts/materialdesignicons-webfont.ttf") format("truetype");\n font-weight: normal;\n font-style: normal;\n}',document.head.appendChild(t)}})),oG.addIconSet("or",{getIconTemplate:e=>{let t=oH[e];return t?of`
|
|
2111
|
+
`}updated(e){super.updated(e),e.has("headerTitle")&&(this.ariaLabel=this.headerTitle)}}nJ(sY),o(4532);var sW=o(4867),sG=o.n(sW);o(3472);class sK{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 sJ(e,t,o=!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(o){if(Array.isArray(e))return e.every((e,o)=>sJ(e,t[o]));let o=Object.keys(e);return Object.keys(t).every(e=>-1!==o.indexOf(e))&&o.every(o=>sJ(e[o],t[o]))}return!1}class sX{constructor(e){e&&Object.assign(this,e)}matches(e){var t,o,n,i,r,a,s;if((null==(t=this.ids)?void 0:t.length)&&(!e.id||!this.ids.includes(e.id))||(null==(o=this.types)?void 0:o.length)&&(!e.type||!this.types.includes(e.type))||(null==(n=this.realm)?void 0:n.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 o;return(null!=(o=e.path)?o:[]).every((e,o)=>t[o]===e)}))return!1}return(null==(s=this.names)||!s.length||!!this.names.every(t=>sX._evalValuePredicate(e.name,t)))&&(!this.attributes||sX._evalGroup(e,this.attributes))}static getUnsupportedFields(e){return Object.keys(e).filter(e=>!sX._SUPPORTED_FIELDS.has(e))}collectAttributeNames(){return this.attributes?sX._collectNames(this.attributes):[]}static _evalValuePredicate(e,t){var o;switch(t.predicateType){case"string":{let n;if(null==e)return!1;let i=!1!==t.caseSensitive?String(e):String(e).toLowerCase(),r=!1!==t.caseSensitive?t.value:null==(o=t.value)?void 0:o.toLowerCase();switch(t.match){case"BEGIN":n=i.startsWith(r);break;case"END":n=i.endsWith(r);break;case"CONTAINS":n=i.includes(r);break;default:n=i===r}return t.negate?!n:n}case"boolean":return e===t.value;case"number":{let o;if("number"!=typeof e)return!1;switch(t.operator){case"GREATER_THAN":o=e>t.value;break;case"GREATER_EQUALS":o=e>=t.value;break;case"LESS_THAN":o=e<t.value;break;case"LESS_EQUALS":o=e<=t.value;break;case"BETWEEN":o=e>=t.value&&e<=t.rangeValue;break;default:o=e===t.value}return t.negate?!o:o}}return!1}static _evalPredicate(e,t){var o,n;let i=null==(o=t.name)?void 0:o.value;if(!i)return!0;let r=null==(n=e.attributes)?void 0:n[i];if(!r)return!!t.negated;let a=!t.value||sX._evalValuePredicate(r.value,t.value);return t.negated?!a:a}static _evalGroup(e,t){var o,n,i;let r=null!=(o=t.operator)?o:"AND",a=[...(null!=(n=t.items)?n:[]).map(t=>sX._evalPredicate(e,t)),...(null!=(i=t.groups)?i:[]).map(t=>sX._evalGroup(e,t))];return!a.length||("OR"===r?a.some(Boolean):a.every(Boolean))}static _collectNames(e){var t,o;return[...(null!=(t=e.items)?t:[]).map(e=>{var t;return null==(t=e.name)?void 0:t.value}).filter(e=>!!e),...(null!=(o=e.groups)?o:[]).flatMap(e=>sX._collectNames(e))]}}sX._SUPPORTED_FIELDS=new Set(["ids","types","names","parents","paths","realm","attributes"]);var sQ=function(e,t,o,n){return new(o||(o=Promise))(function(i,r){function a(e){try{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(a,s)}l((n=n.apply(e,t||[])).next())})};let sZ=o(4461);class s0{constructor(e,t,o){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=o,window.OpenRemoteConsole=this;let n=new URLSearchParams(window.location.search),i=n.get("consoleName"),r=n.get("consoleVersion"),a=n.get("consolePlatform"),s=n.get("consoleProviders"),l=n.get("consoleAutoEnable"),c=s&&s.length>0?s.split(" "):["push"];this._pendingProviderEnables=c;let d=s0._createConsoleRegistration(),u=window.localStorage.getItem(this._storageKey);if(u)try{let e=JSON.parse(u);e.id&&(d.id=e.id),e.name&&(d.name=e.name),e.providers&&(d.providers=e.providers),e.apps&&(d.apps=e.apps)}catch(e){console.error("Failed to deserialise console registration")}let f=d.providers;for(let e of(d.providers={},c)){let t=f&&f.hasOwnProperty(e)?f[e]:{enabled:!1,disabled:!1};d.providers[e]=t}let h=ul.getAppName();h.length>0&&0>d.apps.indexOf(h)&&d.apps.push(h),this._registration=d,i&&(d.name=i),r&&(d.version=r),a&&(d.platform=a),l&&(this._autoEnable="TRUE"===l||"true"===l)}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 sQ(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 sQ(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 sQ(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 o={provider:e,action:"PROVIDER_ENABLE",consoleId:this._registration.id,data:t},n=yield this.sendProviderMessage(o,!0);this._registration.providers[e].hasPermission=n.hasPermission,this._registration.providers[e].success=n.success,this._registration.providers[e].enabled=n.success,this._registration.providers[e].data=n.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())),n})}disableProvider(e){return sQ(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 sQ(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 o=e.provider+e.action;if(this._pendingProviderPromises[o])throw Error("Message already pending for provider '"+e.provider+"' with action '"+e.action+"'");let n=new sK,i=()=>{delete this._pendingProviderPromises[o],n.reject("No response from provider")};return this._pendingProviderPromises[o]=[n,window.setTimeout(i,5e3)],this._doSendProviderMessage(e),n.promise})}sendRegistration(){return this._registrationTimer&&(window.clearTimeout(this._registrationTimer),this._registrationTimer=null),new Promise((e,t)=>{this._registrationTimer=window.setTimeout(()=>sQ(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 sQ(this,void 0,void 0,function*(){this._normaliseRegistration();let t=!!this._registration.id;try{let e=yield ul.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(o){if(e&&t&&s0._isStaleRegistrationResponse(o)){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 o}})}_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 sQ(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 o={type:e,data:t};this.isMobile?this._postNativeShellMessage(o):console.warn("Failed to send generic message to console.",o)}_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 o=window.localStorage.getItem(t);if(null!==o)try{o=JSON.parse(o)}catch(e){}this._handleProviderResponse(JSON.stringify({action:"RETRIEVE",provider:"storage",key:t,value:o}))}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),o=t.provider,n=t.action,i=this._pendingProviderPromises[o+n];i&&(window.clearTimeout(i[1]),delete this._pendingProviderPromises[o+n],i[0].resolve(t));let r=this._providerMessageListeners[o+n];r&&r(t)}_callCompletedCallback(){let e=this._enableCompleteCallback;this._enableCompleteCallback=null,e&&window.setTimeout(()=>{e()},0)}static _createConsoleRegistration(){return{name:sZ.name,version:sZ.version,platform:sZ.os.toString(),apps:[],model:((sZ.manufacturer?sZ.manufacturer+" ":"")+(sZ.product?sZ.product:"")).trim()}}_initialiseProvider(e){return sQ(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 s1(e,t){return function(){return e.apply(t,arguments)}}let{toString:s2}=Object.prototype,{getPrototypeOf:s3}=Object,{iterator:s5,toStringTag:s4}=Symbol,s6=(({hasOwnProperty:e})=>(t,o)=>e.call(t,o))(Object.prototype),s8=(e,t)=>{let o=e,n=[];for(;null!=o&&o!==Object.prototype&&-1===n.indexOf(o);){if(n.push(o),s6(o,t))return!0;o=s3(o)}return!1},s9=(r=Object.create(null),e=>{let t=s2.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())}),s7=e=>(e=e.toLowerCase(),t=>s9(t)===e),le=e=>t=>typeof t===e,{isArray:lt}=Array,lo=le("undefined");function ln(e){return null!==e&&!lo(e)&&null!==e.constructor&&!lo(e.constructor)&&la(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}let li=s7("ArrayBuffer"),lr=le("string"),la=le("function"),ls=le("number"),ll=e=>null!==e&&"object"==typeof e,lc=e=>{if(!ll(e))return!1;let t=s3(e);return(null===t||t===Object.prototype||null===s3(t))&&!s8(e,s4)&&!s8(e,s5)},ld=s7("Date"),lu=s7("File"),lf=s7("Blob"),lh=s7("FileList"),lm="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},lb=void 0!==lm.FormData?lm.FormData:void 0,lp=s7("URLSearchParams"),[lF,lg,lv,l_]=["ReadableStream","Request","Response","Headers"].map(s7);function ly(e,t,{allOwnKeys:o=!1}={}){let n,i;if(null!=e)if("object"!=typeof e&&(e=[e]),lt(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{let i;if(ln(e))return;let r=o?Object.getOwnPropertyNames(e):Object.keys(e),a=r.length;for(n=0;n<a;n++)i=r[n],t.call(null,e[i],i,e)}}function lw(e,t){let o;if(ln(e))return null;t=t.toLowerCase();let n=Object.keys(e),i=n.length;for(;i-- >0;)if(t===(o=n[i]).toLowerCase())return o;return null}let lE="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,lC=e=>!lo(e)&&e!==lE,lk=(a="u">typeof Uint8Array&&s3(Uint8Array),e=>a&&e instanceof a),lA=s7("HTMLFormElement"),{propertyIsEnumerable:lx}=Object.prototype,lD=s7("RegExp"),lS=(e,t)=>{let o=Object.getOwnPropertyDescriptors(e),n={};ly(o,(o,i)=>{let r;!1!==(r=t(o,i,e))&&(n[i]=r||o)}),Object.defineProperties(e,n)},lT=s7("AsyncFunction"),lO=(c="function"==typeof setImmediate,d=la(lE.postMessage),c?setImmediate:d?(u=`axios@${Math.random()}`,f=[],lE.addEventListener("message",({source:e,data:t})=>{e===lE&&t===u&&f.length&&f.shift()()},!1),e=>{f.push(e),lE.postMessage(u,"*")}):e=>setTimeout(e)),lI="u">typeof queueMicrotask?queueMicrotask.bind(lE):"u">typeof process&&process.nextTick||lO,lB=e=>null!=e&&la(e[s5]),lR={isArray:lt,isArrayBuffer:li,isBuffer:ln,isFormData:e=>{if(!e)return!1;if(lb&&e instanceof lb)return!0;let t=s3(e);if(!t||t===Object.prototype||!la(e.append))return!1;let o=s9(e);return"formdata"===o||"object"===o&&la(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&li(e.buffer)},isString:lr,isNumber:ls,isBoolean:e=>!0===e||!1===e,isObject:ll,isPlainObject:lc,isEmptyObject:e=>{if(!ll(e)||ln(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:lF,isRequest:lg,isResponse:lv,isHeaders:l_,isUndefined:lo,isDate:ld,isFile:lu,isReactNativeBlob:e=>!!(e&&void 0!==e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:lf,isRegExp:lD,isFunction:la,isStream:e=>ll(e)&&la(e.pipe),isURLSearchParams:lp,isTypedArray:lk,isFileList:lh,forEach:ly,merge:function e(...t){let{caseless:o,skipUndefined:n}=lC(this)&&this||{},i={},r=(t,r)=>{if("__proto__"===r||"constructor"===r||"prototype"===r)return;let a=o&&"string"==typeof r&&lw(i,r)||r,s=s6(i,a)?i[a]:void 0;lc(s)&&lc(t)?i[a]=e(s,t):lc(t)?i[a]=e({},t):lt(t)?i[a]=t.slice():n&&lo(t)||(i[a]=t)};for(let e=0,o=t.length;e<o;e++){let o=t[e];if(!o||ln(o)||(ly(o,r),"object"!=typeof o||lt(o)))continue;let n=Object.getOwnPropertySymbols(o);for(let e=0;e<n.length;e++){let t=n[e];lx.call(o,t)&&r(o[t],t)}}return i},extend:(e,t,o,{allOwnKeys:n}={})=>(ly(t,(t,n)=>{o&&la(t)?Object.defineProperty(e,n,{__proto__:null,value:s1(t,o),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,n,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),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,o,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),o&&Object.assign(e.prototype,o)},toFlatObject:(e,t,o,n)=>{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],(!n||n(a,e,t))&&!s[a]&&(t[a]=e[a],s[a]=!0);e=!1!==o&&s3(e)}while(e&&(!o||o(e,t))&&e!==Object.prototype);return t},kindOf:s9,kindOfTest:s7,endsWith:(e,t,o)=>{e=String(e),(void 0===o||o>e.length)&&(o=e.length),o-=t.length;let n=e.indexOf(t,o);return -1!==n&&n===o},toArray:e=>{if(!e)return null;if(lt(e))return e;let t=e.length;if(!ls(t))return null;let o=Array(t);for(;t-- >0;)o[t]=e[t];return o},forEachEntry:(e,t)=>{let o,n=(e&&e[s5]).call(e);for(;(o=n.next())&&!o.done;){let n=o.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let o,n=[];for(;null!==(o=e.exec(t));)n.push(o);return n},isHTMLForm:lA,hasOwnProperty:s6,hasOwnProp:s6,hasOwnInPrototypeChain:s8,getSafeProp:(e,t)=>null!=e&&s8(e,t)?e[t]:void 0,reduceDescriptors:lS,freezeMethods:e=>{lS(e,(t,o)=>{if(la(e)&&["arguments","caller","callee"].includes(o))return!1;if(la(e[o])){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")})}})},toObjectSet:(e,t)=>{let o={};return(lt(e)?e:String(e).split(t)).forEach(e=>{o[e]=!0}),o},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,o){return t.toUpperCase()+o}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e*=1)?e:t,findKey:lw,global:lE,isContextDefined:lC,isSpecCompliantForm:function(e){return!!(e&&la(e.append)&&"FormData"===e[s4]&&e[s5])},toJSONObject:e=>{let t=new WeakSet,o=e=>{if(ll(e)){if(t.has(e))return;if(ln(e))return e;if(!("toJSON"in e)){t.add(e);let n=lt(e)?[]:{};return ly(e,(e,t)=>{let i=o(e);lo(i)||(n[t]=i)}),t.delete(e),n}}return e};return o(e)},isAsyncFn:lT,isThenable:e=>e&&(ll(e)||la(e))&&la(e.then)&&la(e.catch),setImmediate:lO,asap:lI,isIterable:lB,isSafeIterable:e=>null!=e&&s8(e,s5)&&lB(e)},lP=lR.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"]),lN=RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),lL=RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function lM(e,t){return lR.isArray(e)?e.map(e=>lM(e,t)):function(e){let t=0,o=e.length;for(;t<o;){let o=e.charCodeAt(t);if(9!==o&&32!==o)break;t+=1}for(;o>t;){let t=e.charCodeAt(o-1);if(9!==t&&32!==t)break;o-=1}return 0===t&&o===e.length?e:e.slice(t,o)}(String(e).replace(t,""))}function lU(e){let t=Object.create(null);return lR.forEach(e.toJSON(),(e,o)=>{t[o]=lM(e,lL)}),t}let lj=Symbol("internals");function l$(e){return e&&String(e).trim().toLowerCase()}function lV(e){return!1===e||null==e?e:lR.isArray(e)?e.map(lV):lM(String(e),lN)}function lz(e,t,o,n,i){if(lR.isFunction(n))return n.call(this,t,o);if(i&&(t=o),lR.isString(t)){if(lR.isString(n))return -1!==t.indexOf(n);if(lR.isRegExp(n))return n.test(t)}}class lq{constructor(e){e&&this.set(e)}set(e,t,o){let n=this;function i(e,t,o){let i=l$(t);if(!i)return;let r=lR.findKey(n,i);r&&void 0!==n[r]&&!0!==o&&(void 0!==o||!1===n[r])||(n[r||t]=lV(e))}let r=(e,t)=>lR.forEach(e,(e,o)=>i(e,o,t));if(lR.isPlainObject(e)||e instanceof this.constructor)r(e,t);else{let n;if(lR.isString(e)&&(e=e.trim())&&(n=e,!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim()))){var a;let o,n,i,s;r((s={},(a=e)&&a.split("\n").forEach(function(e){i=e.indexOf(":"),o=e.substring(0,i).trim().toLowerCase(),n=e.substring(i+1).trim(),!o||s[o]&&lP[o]||("set-cookie"===o?s[o]?s[o].push(n):s[o]=[n]:s[o]=s[o]?s[o]+", "+n:n)}),s),t)}else if(lR.isObject(e)&&lR.isSafeIterable(e)){let o=Object.create(null),n,i;for(let t of e){if(!lR.isArray(t))throw TypeError("Object iterator must return a key-value pair");i=t[0],lR.hasOwnProp(o,i)?(n=o[i],o[i]=lR.isArray(n)?[...n,t[1]]:[n,t[1]]):o[i]=t[1]}r(o,t)}else null!=e&&i(t,e,o)}return this}get(e,t){if(e=l$(e)){let o=lR.findKey(this,e);if(o){let e=this[o];if(!t)return e;if(!0===t){let t,o=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;t=n.exec(e);)o[t[1]]=t[2];return o}if(lR.isFunction(t))return t.call(this,e,o);if(lR.isRegExp(t))return t.exec(e);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=l$(e)){let o=lR.findKey(this,e);return!!(o&&void 0!==this[o]&&(!t||lz(this,this[o],o,t)))}return!1}delete(e,t){let o=this,n=!1;function i(e){if(e=l$(e)){let i=lR.findKey(o,e);i&&(!t||lz(o,o[i],i,t))&&(delete o[i],n=!0)}}return lR.isArray(e)?e.forEach(i):i(e),n}clear(e){let t=Object.keys(this),o=t.length,n=!1;for(;o--;){let i=t[o];(!e||lz(this,this[i],i,e,!0))&&(delete this[i],n=!0)}return n}normalize(e){let t=this,o={};return lR.forEach(this,(n,i)=>{let r=lR.findKey(o,i);if(r){t[r]=lV(n),delete t[i];return}let a=e?i.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,o)=>t.toUpperCase()+o):String(i).trim();a!==i&&delete t[i],t[a]=lV(n),o[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return lR.forEach(this,(o,n)=>{null!=o&&!1!==o&&(t[n]=e&&lR.isArray(o)?o.join(", "):o)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let o=new this(e);return t.forEach(e=>o.set(e)),o}static accessor(e){let t=(this[lj]=this[lj]={accessors:{}}).accessors,o=this.prototype;function n(e){let n=l$(e);if(!t[n]){let i;i=lR.toCamelCase(" "+e),["get","set","has"].forEach(t=>{Object.defineProperty(o,t+i,{__proto__:null,value:function(o,n,i){return this[t].call(this,e,o,n,i)},configurable:!0})}),t[n]=!0}}return lR.isArray(e)?e.forEach(n):n(e),this}}lq.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),lR.reduceDescriptors(lq.prototype,({value:e},t)=>{let o=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[o]=e}}}),lR.freezeMethods(lq);class lH extends Error{static from(e,t,o,n,i,r){let a=new lH(e.message,t||e.code,o,n,i);return Object.defineProperty(a,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),a.name=e.name,null!=e.status&&null==a.status&&(a.status=e.status),r&&Object.assign(a,r),a}constructor(e,t,o,n,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),o&&(this.config=o),n&&(this.request=n),i&&(this.response=i,this.status=i.status)}toJSON(){let e,t,o,n=this.config,i=n&&lR.hasOwnProp(n,"redact")?n.redact:void 0,r=lR.isArray(i)&&i.length>0?(e=new Set(i.map(e=>String(e).toLowerCase())),t=[],(o=n=>{let i;if(null===n||"object"!=typeof n||lR.isBuffer(n))return n;if(-1===t.indexOf(n)){if(n instanceof lq&&(n=n.toJSON()),t.push(n),lR.isArray(n))i=[],n.forEach((e,t)=>{let n=o(e);lR.isUndefined(n)||(i[t]=n)});else{if(!lR.isPlainObject(n)&&function(e){if(lR.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(lR.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(n))return t.pop(),n;for(let[t,r]of(i=Object.create(null),Object.entries(n))){let n=e.has(t.toLowerCase())?"[REDACTED ****]":o(r);lR.isUndefined(n)||(i[t]=n)}}return t.pop(),i}})(n)):lR.toJSONObject(n);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}}}lH.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",lH.ERR_BAD_OPTION="ERR_BAD_OPTION",lH.ECONNABORTED="ECONNABORTED",lH.ETIMEDOUT="ETIMEDOUT",lH.ECONNREFUSED="ECONNREFUSED",lH.ERR_NETWORK="ERR_NETWORK",lH.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",lH.ERR_DEPRECATED="ERR_DEPRECATED",lH.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",lH.ERR_BAD_REQUEST="ERR_BAD_REQUEST",lH.ERR_CANCELED="ERR_CANCELED",lH.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",lH.ERR_INVALID_URL="ERR_INVALID_URL",lH.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";let lY=lH;function lW(e){return lR.isPlainObject(e)||lR.isArray(e)}function lG(e){return lR.endsWith(e,"[]")?e.slice(0,-2):e}function lK(e,t,o){return e?e.concat(t).map(function(e,t){return e=lG(e),!o&&t?"["+e+"]":e}).join(o?".":""):t}let lJ=lR.toFlatObject(lR,{},null,function(e){return/^is[A-Z]/.test(e)}),lX=function(e,t,o){if(!lR.isObject(e))throw TypeError("target must be an object");t=t||new FormData;let n=(o=lR.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!lR.isUndefined(t[e])})).metaTokens,i=o.visitor||h,r=o.dots,a=o.indexes,s=o.Blob||"u">typeof Blob&&Blob,l=void 0===o.maxDepth?100:o.maxDepth,c=s&&lR.isSpecCompliantForm(t),d=[];if(!lR.isFunction(i))throw TypeError("visitor must be a function");function u(e){if(null===e)return"";if(lR.isDate(e))return e.toISOString();if(lR.isBoolean(e))return e.toString();if(!c&&lR.isBlob(e))throw new lY("Blob is not supported. Use a Buffer instead.");if(lR.isArrayBuffer(e)||lR.isTypedArray(e)){if(c&&"function"==typeof s)return new s([e]);if("u">typeof Buffer)return Buffer.from(e);throw new lY("Blob is not supported. Use a Buffer instead.",lY.ERR_NOT_SUPPORT)}return e}function f(e){if(e>l)throw new lY("Object is too deeply nested ("+e+" levels). Max depth: "+l,lY.ERR_FORM_DATA_DEPTH_EXCEEDED)}function h(e,o,i){let s=e;if(lR.isReactNative(t)&&lR.isReactNativeBlob(e))return t.append(lK(i,o,r),u(e)),!1;if(e&&!i&&"object"==typeof e)if(lR.endsWith(o,"{}"))o=n?o:o.slice(0,-2),e=function(e){if(1/0===l)return JSON.stringify(e);let t=[];return JSON.stringify(e,function(e,o){if(!lR.isObject(o))return o;for(;t.length&&t[t.length-1]!==this;)t.pop();return t.push(o),f(1+t.length-1),o})}(e);else{var c;if(lR.isArray(e)&&(c=e,lR.isArray(c)&&!c.some(lW))||(lR.isFileList(e)||lR.endsWith(o,"[]"))&&(s=lR.toArray(e)))return o=lG(o),s.forEach(function(e,n){lR.isUndefined(e)||null===e||t.append(!0===a?lK([o],n,r):null===a?o:o+"[]",u(e))}),!1}return!!lW(e)||(t.append(lK(i,o,r),u(e)),!1)}let m=Object.assign(lJ,{defaultVisitor:h,convertValue:u,isVisitable:lW});if(!lR.isObject(e))throw TypeError("data must be an object");return!function e(o,n,r=0){if(!lR.isUndefined(o)){if(f(r),-1!==d.indexOf(o))throw Error("Circular reference detected in "+n.join("."));d.push(o),lR.forEach(o,function(o,a){!0===(!(lR.isUndefined(o)||null===o)&&i.call(t,o,lR.isString(a)?a.trim():a,n,m))&&e(o,n?n.concat(a):[a],r+1)}),d.pop()}}(e),t};function lQ(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function lZ(e,t){this._pairs=[],e&&lX(e,this,t)}let l0=lZ.prototype;function l1(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function l2(e,t,o){let n;if(!t)return e;e=e||"";let i=lR.isFunction(o)?{serialize:o}:o,r=lR.getSafeProp(i,"encode")||l1,a=lR.getSafeProp(i,"serialize");if(n=a?a(t,i):lR.isURLSearchParams(t)?t.toString():new lZ(t,i).toString(r)){let t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e}l0.append=function(e,t){this._pairs.push([e,t])},l0.toString=function(e){let t=e?t=>e.call(this,t,lQ):lQ;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};let l3=class{constructor(){this.handlers=[]}use(e,t,o){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!o&&o.synchronous,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){lR.forEach(this.handlers,function(t){null!==t&&e(t)})}},l5={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},l4="u">typeof URLSearchParams?URLSearchParams:lZ,l6="u">typeof FormData?FormData:null,l8="u">typeof Blob?Blob:null,l9="u">typeof window&&"u">typeof document,l7="object"==typeof navigator&&navigator||void 0,ce=l9&&(!l7||0>["ReactNative","NativeScript","NS"].indexOf(l7.product)),ct="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,co=l9&&window.location.href||"http://localhost",cn={...tI,isBrowser:!0,classes:{URLSearchParams:l4,FormData:l6,Blob:l8},protocols:["http","https","file","blob","url","data"]};function ci(e){if(e>100)throw new lY("FormData field is too deeply nested ("+e+" levels). Max depth: 100",lY.ERR_FORM_DATA_DEPTH_EXCEEDED)}let cr=function(e){if(lR.isFormData(e)&&lR.isFunction(e.entries)){let t={};return lR.forEachEntry(e,(e,o)=>{!function e(t,o,n,i){ci(i);let r=t[i++];if("__proto__"===r)return!0;let a=Number.isFinite(+r),s=i>=t.length;return(r=!r&&lR.isArray(n)?n.length:r,s)?lR.hasOwnProp(n,r)?n[r]=lR.isArray(n[r])?n[r].concat(o):[n[r],o]:n[r]=o:(lR.hasOwnProp(n,r)&&lR.isObject(n[r])||(n[r]=[]),e(t,o,n[r],i)&&lR.isArray(n[r])&&(n[r]=function(e){let t,o,n={},i=Object.keys(e),r=i.length;for(t=0;t<r;t++)n[o=i[t]]=e[o];return n}(n[r]))),!a}(function(e){let t,o=[],n=/\w+|\[(\w*)]/g;for(;null!==(t=n.exec(e));)ci(o.length),o.push("[]"===t[0]?"":t[1]||t[0]);return o}(e),o,t,0)}),t}return null},ca=(e,t)=>null!=e&&lR.hasOwnProp(e,t)?e[t]:void 0,cs={transitional:l5,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let o,n=t.getContentType()||"",i=n.indexOf("application/json")>-1,r=lR.isObject(e);if(r&&lR.isHTMLForm(e)&&(e=new FormData(e)),lR.isFormData(e))return i?JSON.stringify(cr(e)):e;if(lR.isArrayBuffer(e)||lR.isBuffer(e)||lR.isStream(e)||lR.isFile(e)||lR.isBlob(e)||lR.isReadableStream(e))return e;if(lR.isArrayBufferView(e))return e.buffer;if(lR.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(r){let t=ca(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return lX(e,new cn.classes.URLSearchParams,{visitor:function(e,t,o,n){return cn.isNode&&lR.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t}).toString();if((o=lR.isFileList(e))||n.indexOf("multipart/form-data")>-1){let n=ca(this,"env"),i=n&&n.FormData;return lX(o?{"files[]":e}:e,i&&new i,t)}}if(r||i){t.setContentType("application/json",!1);var a=e;if(lR.isString(a))try{return(0,JSON.parse)(a),lR.trim(a)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(a)}return e}],transformResponse:[function(e){let t=ca(this,"transitional")||cs.transitional,o=t&&t.forcedJSONParsing,n=ca(this,"responseType"),i="json"===n;if(lR.isResponse(e)||lR.isReadableStream(e))return e;if(e&&lR.isString(e)&&(o&&!n||i)){let o=t&&t.silentJSONParsing;try{return JSON.parse(e,ca(this,"parseReviver"))}catch(e){if(!o&&i){if("SyntaxError"===e.name)throw lY.from(e,lY.ERR_BAD_RESPONSE,this,null,ca(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:cn.classes.FormData,Blob:cn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function cl(e,t){let o=this||cs,n=t||o,i=lq.from(n.headers),r=n.data;return lR.forEach(e,function(e){r=e.call(o,r,i.normalize(),t?t.status:void 0)}),i.normalize(),r}function cc(e){return!!(e&&e.__CANCEL__)}lR.forEach(["delete","get","head","post","put","patch","query"],e=>{cs.headers[e]={}});let cd=class extends lY{constructor(e,t,o){super(null==e?"canceled":e,lY.ERR_CANCELED,t,o),this.name="CanceledError",this.__CANCEL__=!0}};function cu(e,t,o){let n=o.config.validateStatus;!o.status||!n||n(o.status)?e(o):t(new lY("Request failed with status code "+o.status,o.status>=400&&o.status<500?lY.ERR_BAD_REQUEST:lY.ERR_BAD_RESPONSE,o.config,o.request,o))}let cf=function(e,t){let o,n=Array(e=e||10),i=Array(e),r=0,a=0;return t=void 0!==t?t:1e3,function(s){let l=Date.now(),c=i[a];o||(o=l),n[r]=s,i[r]=l;let d=a,u=0;for(;d!==r;)u+=n[d++],d%=e;if((r=(r+1)%e)===a&&(a=(a+1)%e),l-o<t)return;let f=c&&l-c;return f?Math.round(1e3*u/f):void 0}},ch=function(e,t){let o,n,i=0,r=1e3/t,a=(t,r=Date.now())=>{i=r,o=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-i;s>=r?a(e,t):(o=e,n||(n=setTimeout(()=>{n=null,a(o)},r-s)))},()=>o&&a(o)]},cm=(e,t,o=3)=>{let n=0,i=cf(50,250);return ch(o=>{if(!o||"number"!=typeof o.loaded)return;let r=o.loaded,a=o.lengthComputable?o.total:void 0,s=null!=a?Math.min(r,a):r,l=Math.max(0,s-n),c=i(l);n=Math.max(n,s),e({loaded:s,total:a,progress:a?s/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a?(a-s)/c:void 0,event:o,lengthComputable:null!=a,[t?"download":"upload"]:!0})},o)},cb=(e,t)=>{let o=null!=e;return[n=>t[0]({lengthComputable:o,total:e,loaded:n}),t[1]]},cp=e=>(...t)=>lR.asap(()=>e(...t)),cF=cn.hasStandardBrowserEnv?(s=new URL(cn.origin),l=cn.navigator&&/(msie|trident)/i.test(cn.navigator.userAgent),e=>(e=new URL(e,cn.origin),s.protocol===e.protocol&&s.host===e.host&&(l||s.port===e.port))):()=>!0,cg=cn.hasStandardBrowserEnv?{write(e,t,o,n,i,r,a){if("u"<typeof document)return;let s=[`${e}=${encodeURIComponent(t)}`];lR.isNumber(o)&&s.push(`expires=${new Date(o).toUTCString()}`),lR.isString(n)&&s.push(`path=${n}`),lR.isString(i)&&s.push(`domain=${i}`),!0===r&&s.push("secure"),lR.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 o=0;o<t.length;o++){let n=t[o].replace(/^\s+/,""),i=n.indexOf("=");if(-1!==i&&n.slice(0,i)===e)try{return decodeURIComponent(n.slice(i+1))}catch(e){return n.slice(i+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}},cv=/^https?:(?!\/\/)/i,c_=/[\t\n\r]/g;function cy(e,t){if("string"==typeof e&&cv.test((function(e){let t=0;for(;t<e.length&&32>=e.charCodeAt(t);)t++;return e.slice(t)})(e).replace(c_,"")))throw new lY('Invalid URL: missing "//" after protocol',lY.ERR_INVALID_URL,t)}function cw(e,t,o,n){cy(t,n);let i=!("string"==typeof t&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t));return e&&(i||!1===o)?(cy(e,n),t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e):t}let cE=e=>e instanceof lq?{...e}:e;function cC(e,t){e=e||{},t=t||{};let o=Object.create(null);function n(e,t,o,n){return lR.isPlainObject(e)&&lR.isPlainObject(t)?lR.merge.call({caseless:n},e,t):lR.isPlainObject(t)?lR.merge({},t):lR.isArray(t)?t.slice():t}function i(e,t,o,i){return lR.isUndefined(t)?lR.isUndefined(e)?void 0:n(void 0,e,o,i):n(e,t,o,i)}function r(e,t){if(!lR.isUndefined(t))return n(void 0,t)}function a(e,t){return lR.isUndefined(t)?lR.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(o,i,r){return lR.hasOwnProp(t,r)?n(o,i):lR.hasOwnProp(e,r)?n(void 0,o):void 0}Object.defineProperty(o,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});let l={url:r,method:r,data:r,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,allowedSocketPaths:a,responseEncoding:a,validateStatus:s,headers:(e,t,o)=>i(cE(e),cE(t),o,!0)};return lR.forEach(Object.keys({...e,...t}),function(n){if("__proto__"===n||"constructor"===n||"prototype"===n)return;let r=lR.hasOwnProp(l,n)?l[n]:i,a=r(lR.hasOwnProp(e,n)?e[n]:void 0,lR.hasOwnProp(t,n)?t[n]:void 0,n);lR.isUndefined(a)&&r!==s||(o[n]=a)}),lR.hasOwnProp(t,"validateStatus")&&lR.isUndefined(t.validateStatus)&&!1===function(o){let n=lR.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!lR.isUndefined(n)){if(!lR.isPlainObject(n))return;else if(lR.hasOwnProp(n,o))return n[o]}let i=lR.hasOwnProp(e,"transitional")?e.transitional:void 0;if(lR.isPlainObject(i)&&lR.hasOwnProp(i,o))return i[o]}("validateStatusUndefinedResolves")&&(lR.hasOwnProp(e,"validateStatus")?o.validateStatus=n(void 0,e.validateStatus):delete o.validateStatus),o}let ck=["content-type","content-length"],cA=function(e){let t=cC({},e),o=e=>lR.hasOwnProp(t,e)?t[e]:void 0,n=o("data"),i=o("withXSRFToken"),r=o("xsrfHeaderName"),a=o("xsrfCookieName"),s=o("headers"),l=o("auth"),c=o("baseURL"),d=o("allowAbsoluteUrls"),u=o("url");if(t.headers=s=lq.from(s),t.url=l2(cw(c,u,d,t),o("params"),o("paramsSerializer")),l){let t=lR.getSafeProp(l,"username")||"",o=lR.getSafeProp(l,"password")||"";try{s.set("Authorization","Basic "+btoa(t+":"+(o?encodeURIComponent(o).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))):"")))}catch(t){throw lY.from(t,lY.ERR_BAD_OPTION_VALUE,e)}}if(lR.isFormData(n))if(cn.hasStandardBrowserEnv||cn.hasStandardBrowserWebWorkerEnv||lR.isReactNative(n))s.setContentType(void 0);else{var f,h;lR.isFunction(n.getHeaders)&&(f=s,h=n.getHeaders(),"content-only"!==o("formDataHeaderPolicy")?f.set(h):Object.entries(h||{}).forEach(([e,t])=>{ck.includes(e.toLowerCase())&&f.set(e,t)}))}if(cn.hasStandardBrowserEnv&&(lR.isFunction(i)&&(i=i(t)),!0===i||null==i&&cF(t.url))){let e=r&&a&&cg.read(a);e&&s.set(r,e)}return t},cx="u">typeof XMLHttpRequest&&function(e){return new Promise(function(t,o){var n;let i,r,a,s,l,c,d=cA(e),u=d.data,f=lq.from(d.headers).normalize(),{responseType:h,onUploadProgress:m,onDownloadProgress:b}=d;function p(){s&&s(),l&&l(),d.cancelToken&&d.cancelToken.unsubscribe(i),d.signal&&d.signal.removeEventListener("abort",i)}let F=new XMLHttpRequest;function g(){if(!F)return;let n=lq.from("getAllResponseHeaders"in F&&F.getAllResponseHeaders());cu(function(e){t(e),p()},function(e){o(e),p()},{data:h&&"text"!==h&&"json"!==h?F.response:F.responseText,status:F.status,statusText:F.statusText,headers:n,config:e,request:F}),F=null}F.open(d.method.toUpperCase(),d.url,!0),F.timeout=d.timeout,"onloadend"in F?F.onloadend=g:F.onreadystatechange=function(){!F||4!==F.readyState||(0!==F.status||F.responseURL&&F.responseURL.startsWith("file:"))&&setTimeout(g)},F.onabort=function(){F&&(o(new lY("Request aborted",lY.ECONNABORTED,e,F)),p(),F=null)},F.onerror=function(t){let n=new lY(t&&t.message?t.message:"Network Error",lY.ERR_NETWORK,e,F);n.event=t||null,o(n),p(),F=null},F.ontimeout=function(){let t=d.timeout?"timeout of "+d.timeout+"ms exceeded":"timeout exceeded",n=d.transitional||l5;d.timeoutErrorMessage&&(t=d.timeoutErrorMessage),o(new lY(t,n.clarifyTimeoutError?lY.ETIMEDOUT:lY.ECONNABORTED,e,F)),p(),F=null},void 0===u&&f.setContentType(null),"setRequestHeader"in F&&lR.forEach(lU(f),function(e,t){F.setRequestHeader(t,e)}),lR.isUndefined(d.withCredentials)||(F.withCredentials=!!d.withCredentials),h&&"json"!==h&&(F.responseType=d.responseType),b&&([a,l]=cm(b,!0),F.addEventListener("progress",a)),m&&F.upload&&([r,s]=cm(m),F.upload.addEventListener("progress",r),F.upload.addEventListener("loadend",s)),(d.cancelToken||d.signal)&&(i=t=>{F&&(o(!t||t.type?new cd(null,e,F):t),F.abort(),p(),F=null)},d.cancelToken&&d.cancelToken.subscribe(i),d.signal&&(d.signal.aborted?i():d.signal.addEventListener("abort",i)));let v=(n=d.url,(c=/^([-+\w]{1,25}):(?:\/\/)?/.exec(n))&&c[1]||"");if(v&&!cn.protocols.includes(v)){o(new lY("Unsupported protocol "+v+":",lY.ERR_BAD_REQUEST,e)),p();return}F.send(u||null)})},cD=function*(e,t){let o,n=e.byteLength;if(!t||n<t)return void(yield e);let i=0;for(;i<n;)o=i+t,yield e.slice(i,o),i=o},cS=async function*(e,t){for await(let o of cT(e))yield*cD(o,t)},cT=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);let t=e.getReader();try{for(;;){let{done:e,value:o}=await t.read();if(e)break;yield o}}finally{await t.cancel()}},cO=(e,t,o,n)=>{let i,r=cS(e,t),a=0,s=e=>{!i&&(i=!0,n&&n(e))};return new ReadableStream({async pull(e){try{let{done:t,value:n}=await r.next();if(t){s(),e.close();return}let i=n.byteLength;if(o){let e=a+=i;o(e)}e.enqueue(new Uint8Array(n))}catch(e){throw s(e),e}},cancel:e=>(s(e),r.return())},{highWaterMark:2})},cI=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,cB=(e,t,o)=>t+2<o&&cI(e.charCodeAt(t+1))&&cI(e.charCodeAt(t+2)),{isFunction:cR}=lR,cP=e=>{if(!lR.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},cN=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},cL=e=>{let t,o=void 0!==lR.global&&null!==lR.global?lR.global:globalThis,{ReadableStream:n,TextEncoder:i}=o,{fetch:r,Request:a,Response:s}=e=lR.merge.call({skipUndefined:!0},{Request:o.Request,Response:o.Response},e),l=r?cR(r):"function"==typeof fetch,c=cR(a),d=cR(s);if(!l)return!1;let u=l&&cR(n),f=l&&("function"==typeof i?(t=new i,e=>t.encode(e)):async e=>new Uint8Array(await new a(e).arrayBuffer())),h=c&&u&&cN(()=>{let e=!1,t=new a(cn.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),o=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!o}),m=d&&u&&cN(()=>lR.isReadableStream(new s("").body)),b={stream:m&&(e=>e.body)};l&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{b[e]||(b[e]=(t,o)=>{let n=t&&t[e];if(n)return n.call(t);throw new lY(`Response type '${e}' is not supported`,lY.ERR_NOT_SUPPORT,o)})});let p=async e=>{if(null==e)return 0;if(lR.isBlob(e))return e.size;if(lR.isSpecCompliantForm(e)){let t=new a(cn.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return lR.isArrayBufferView(e)||lR.isArrayBuffer(e)?e.byteLength:(lR.isURLSearchParams(e)&&(e+=""),lR.isString(e))?(await f(e)).byteLength:void 0},F=async(e,t)=>{let o=lR.toFiniteNumber(e.getContentLength());return null==o?p(t):o};return async e=>{let t,{url:o,method:n,data:l,signal:d,cancelToken:f,timeout:g,onDownloadProgress:v,onUploadProgress:_,responseType:y,headers:w,withCredentials:E="same-origin",fetchOptions:C,maxContentLength:k,maxBodyLength:A}=cA(e),x=lR.isNumber(k)&&k>-1,D=lR.isNumber(A)&&A>-1,S=r||fetch;y=y?(y+"").toLowerCase():"text";let T=((e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;let o=new AbortController,n=!1,i=function(e){if(!n){n=!0,a();let t=e instanceof Error?e:this.reason;o.abort(t instanceof lY?t:new cd(t instanceof Error?t.message:t))}},r=t&&setTimeout(()=>{r=null,i(new lY(`timeout of ${t}ms exceeded`,lY.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=>e.addEventListener("abort",i,{once:!0}));let{signal:s}=o;return s.unsubscribe=()=>lR.asap(a),s})([d,f&&f.toAbortSignal()],g),O=null,I=T&&T.unsubscribe&&(()=>{T.unsubscribe()}),B=null,R=()=>new lY("Request body larger than maxBodyLength limit",lY.ERR_BAD_REQUEST,e,O);try{var P;let r,d,f,g,N=(d="auth",lR.hasOwnProp(e,d)?e[d]:void 0);if(N){let e=lR.getSafeProp(N,"username")||"",t=lR.getSafeProp(N,"password")||"";r={username:e,password:t}}if(f=(P=o).indexOf("://"),g=P,-1!==f&&(g=g.slice(f+3)),g.includes("@")||g.includes(":")){let e=new URL(o,cn.origin);if(!r&&(e.username||e.password)){let t=cP(e.username),o=cP(e.password);r={username:t,password:o}}(e.username||e.password)&&(e.username="",e.password="",o=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(x&&"string"==typeof o&&o.startsWith("data:")&&function(e){if(!e||"string"!=typeof e||!e.startsWith("data:"))return 0;let t=e.indexOf(",");if(t<0)return 0;let o=e.slice(5,t),n=e.slice(t+1);if(/;base64/i.test(o)){let e=n.length,t=n.length;for(let o=0;o<t;o++)if(37===n.charCodeAt(o)&&o+2<t){let t=n.charCodeAt(o+1),i=n.charCodeAt(o+2);cI(t)&&cI(i)&&(e-=2,o+=2)}let o=0,i=t-1,r=e=>e>=2&&37===n.charCodeAt(e-2)&&51===n.charCodeAt(e-1)&&(68===n.charCodeAt(e)||100===n.charCodeAt(e));i>=0&&(61===n.charCodeAt(i)?(o++,i--):r(i)&&(o++,i-=3)),1===o&&i>=0&&(61===n.charCodeAt(i)?o++:r(i)&&o++);let a=3*Math.floor(e/4)-(o||0);return a>0?a:0}let i=0;for(let e=0,t=n.length;e<t;e++){let o=n.charCodeAt(e);if(37===o&&cB(n,e,t))i+=1,e+=2;else if(o<128)i+=1;else if(o<2048)i+=2;else if(o>=55296&&o<=56319&&e+1<t){let t=n.charCodeAt(e+1);t>=56320&&t<=57343?(i+=4,e++):i+=3}else i+=3}return i}(o)>k)throw new lY("maxContentLength size of "+k+" exceeded",lY.ERR_BAD_RESPONSE,e,O);if(D&&"get"!==n&&"head"!==n){let e=await p(l);if("number"==typeof e&&isFinite(e)&&(t=e,e>A))throw R()}let L=D&&(lR.isReadableStream(l)||lR.isStream(l)),M=(e,t,o)=>cO(e,65536,e=>{if(D&&e>A)throw B=R();t&&t(e)},o);if(h&&"get"!==n&&"head"!==n&&(_||L)){if(t=null==t?await F(w,l):t,0!==t||L){let e,n=new a(o,{method:"POST",body:l,duplex:"half"});if(lR.isFormData(l)&&(e=n.headers.get("content-type"))&&w.setContentType(e),n.body){let[e,o]=_&&cb(t,cm(cp(_)))||[];l=M(n.body,e,o)}}}else if(L&&!c&&u&&"get"!==n&&"head"!==n)l=M(l);else if(L&&c&&!h&&"get"!==n&&"head"!==n)throw new lY("Stream request bodies are not supported by the current fetch implementation",lY.ERR_NOT_SUPPORT,e,O);lR.isString(E)||(E=E?"include":"omit");let U=c&&"credentials"in a.prototype;if(lR.isFormData(l)){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.18.1",!1);let j={...C,signal:T,method:n.toUpperCase(),headers:lU(w.normalize()),body:l,duplex:"half",credentials:U?E:void 0};O=c&&new a(o,j);let $=await (c?S(O,C):S(o,j)),V=lq.from($.headers);if(x){let t=lR.toFiniteNumber(V.getContentLength());if(null!=t&&t>k)throw new lY("maxContentLength size of "+k+" exceeded",lY.ERR_BAD_RESPONSE,e,O)}let z=m&&("stream"===y||"response"===y);if(m&&$.body&&(v||x||z&&I)){let t={};["status","statusText","headers"].forEach(e=>{t[e]=$[e]});let o=lR.toFiniteNumber(V.getContentLength()),[n,i]=v&&cb(o,cm(cp(v),!0))||[];$=new s(cO($.body,65536,t=>{if(x&&t>k)throw new lY("maxContentLength size of "+k+" exceeded",lY.ERR_BAD_RESPONSE,e,O);n&&n(t)},()=>{i&&i(),I&&I()}),t)}y=y||"text";let q=await b[lR.findKey(b,y)||"text"]($,e);if(x&&!m&&!z){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>k)throw new lY("maxContentLength size of "+k+" exceeded",lY.ERR_BAD_RESPONSE,e,O)}return!z&&I&&I(),await new Promise((t,o)=>{cu(t,o,{data:q,headers:lq.from($.headers),status:$.status,statusText:$.statusText,config:e,request:O})})}catch(t){if(I&&I(),T&&T.aborted&&T.reason instanceof lY){let o=T.reason;throw o.config=e,O&&(o.request=O),t!==o&&Object.defineProperty(o,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),o}if(B)throw O&&!B.request&&(B.request=O),B;if(t instanceof lY)throw O&&!t.request&&(t.request=O),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){let o=new lY("Network Error",lY.ERR_NETWORK,e,O,t&&t.response);throw Object.defineProperty(o,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),o}throw lY.from(t,t&&t.code,e,O,t&&t.response)}}},cM=new Map,cU=e=>{let t=e&&e.env||{},{fetch:o,Request:n,Response:i}=t,r=[n,i,o],a=r.length,s,l,c=cM;for(;a--;)s=r[a],void 0===(l=c.get(s))&&c.set(s,l=a?new Map:cL(t)),c=l;return l};cU();let cj={http:null,xhr:cx,fetch:{get:cU}};lR.forEach(cj,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});let c$=e=>`- ${e}`,cV=e=>lR.isFunction(e)||null===e||!1===e,cz=function(e,t){let o,n,{length:i}=e=lR.isArray(e)?e:[e],r={};for(let a=0;a<i;a++){let i;if(n=o=e[a],!cV(o)&&void 0===(n=cj[(i=String(o)).toLowerCase()]))throw new lY(`Unknown adapter '${i}'`);if(n&&(lR.isFunction(n)||(n=n.get(t))))break;r[i||"#"+a]=n}if(!n){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 lY("There is no suitable adapter to dispatch the request "+(i?e.length>1?"since :\n"+e.map(c$).join("\n"):" "+c$(e[0]):"as no adapter specified"),lY.ERR_NOT_SUPPORT)}return n};function cq(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new cd(null,e)}function cH(e){return cq(e),e.headers=lq.from(e.headers),e.data=cl.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),cz(e.adapter||cs.adapter,e)(e).then(function(t){cq(e),e.response=t;try{t.data=cl.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=lq.from(t.headers),t},function(t){if(!cc(t)&&(cq(e),t&&t.response)){e.response=t.response;try{t.response.data=cl.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=lq.from(t.response.headers)}return Promise.reject(t)})}let cY={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{cY[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}});let cW={};cY.transitional=function(e,t,o){function n(e,t){return"[Axios v1.18.1] Transitional option '"+e+"'"+t+(o?". "+o:"")}return(o,i,r)=>{if(!1===e)throw new lY(n(i," has been removed"+(t?" in "+t:"")),lY.ERR_DEPRECATED);return t&&!cW[i]&&(cW[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(o,i,r)}},cY.spelling=function(e){return(t,o)=>(console.warn(`${o} is likely a misspelling of ${e}`),!0)};let cG=function(e,t,o){if("object"!=typeof e||null===e)throw new lY("options must be an object",lY.ERR_BAD_OPTION_VALUE);let n=Object.keys(e),i=n.length;for(;i-- >0;){let r=n[i],a=Object.prototype.hasOwnProperty.call(t,r)?t[r]:void 0;if(a){let t=e[r],o=void 0===t||a(t,r,e);if(!0!==o)throw new lY("option "+r+" must be "+o,lY.ERR_BAD_OPTION_VALUE);continue}if(!0!==o)throw new lY("Unknown option "+r,lY.ERR_BAD_OPTION)}};class cK{constructor(e){this.defaults=e||{},this.interceptors={request:new l3,response:new l3}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let o=(()=>{if(!t.stack)return"";let e=t.stack.indexOf("\n");return -1===e?"":t.stack.slice(e+1)})();try{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 o,n;"string"==typeof e?(t=t||{}).url=e:t=e||{};let{transitional:i,paramsSerializer:r,headers:a}=t=cC(this.defaults,t);void 0!==i&&cG(i,{silentJSONParsing:cY.transitional(cY.boolean),forcedJSONParsing:cY.transitional(cY.boolean),clarifyTimeoutError:cY.transitional(cY.boolean),legacyInterceptorReqResOrdering:cY.transitional(cY.boolean),advertiseZstdAcceptEncoding:cY.transitional(cY.boolean),validateStatusUndefinedResolves:cY.transitional(cY.boolean)},!1),null!=r&&(lR.isFunction(r)?t.paramsSerializer={serialize:r}:cG(r,{encode:cY.function,serialize:cY.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),cG(t,{baseUrl:cY.spelling("baseURL"),withXsrfToken:cY.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=a&&lR.merge(a.common,a[t.method]);a&&lR.forEach(["delete","get","head","post","put","patch","query","common"],e=>{delete a[e]}),t.headers=lq.concat(s,a);let l=[],c=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;c=c&&e.synchronous;let o=t.transitional||l5;o&&o.legacyInterceptorReqResOrdering?l.unshift(e.fulfilled,e.rejected):l.push(e.fulfilled,e.rejected)});let d=[];this.interceptors.response.forEach(function(e){d.push(e.fulfilled,e.rejected)});let u=0;if(!c){let e=[cH.bind(this),void 0];for(e.unshift(...l),e.push(...d),n=e.length,o=Promise.resolve(t);u<n;)o=o.then(e[u++],e[u++]);return o}n=l.length;let f=t;for(;u<n;){let e=l[u++],t=l[u++];try{f=e(f)}catch(e){t.call(this,e);break}}try{o=cH.call(this,f)}catch(e){return Promise.reject(e)}for(u=0,n=d.length;u<n;)o=o.then(d[u++],d[u++]);return o}getUri(e){return l2(cw((e=cC(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}lR.forEach(["delete","get","head","options"],function(e){cK.prototype[e]=function(t,o){return this.request(cC(o||{},{method:e,url:t,data:o&&lR.hasOwnProp(o,"data")?o.data:void 0}))}}),lR.forEach(["post","put","patch","query"],function(e){function t(t){return function(o,n,i){return this.request(cC(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:o,data:n}))}}cK.prototype[e]=t(),"query"!==e&&(cK.prototype[e+"Form"]=t(!0))});let cJ=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 o=this;this.promise.then(e=>{if(!o._listeners)return;let t=o._listeners.length;for(;t-- >0;)o._listeners[t](e);o._listeners=null}),this.promise.then=e=>{let t,n=new Promise(e=>{o.subscribe(e),t=e}).then(e);return n.cancel=function(){o.unsubscribe(t)},n},e(function(e,n,i){o.reason||(o.reason=new cd(e,n,i),t(o.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}}},cX={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,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity: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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(cX).forEach(([e,t])=>{cX[t]=e});let cQ=function e(t){let o=new cK(t),n=s1(cK.prototype.request,o);return lR.extend(n,cK.prototype,o,{allOwnKeys:!0}),lR.extend(n,o,null,{allOwnKeys:!0}),n.create=function(o){return e(cC(t,o))},n}(cs);cQ.Axios=cK,cQ.CanceledError=cd,cQ.CancelToken=cJ,cQ.isCancel=cc,cQ.VERSION="1.18.1",cQ.toFormData=lX,cQ.AxiosError=lY,cQ.Cancel=cQ.CanceledError,cQ.all=function(e){return Promise.all(e)},cQ.spread=function(e){return function(t){return e.apply(null,t)}},cQ.isAxiosError=function(e){return lR.isObject(e)&&!0===e.isAxiosError},cQ.mergeConfig=cC,cQ.AxiosHeaders=lq,cQ.formToJSON=e=>cr(lR.isHTMLForm(e)?new FormData(e):e),cQ.getAdapter=cz,cQ.HttpStatusCode=cX,cQ.default=cQ;class cZ{constructor(e){this.httpClient=e}createAlarm(e,t,o){return this.httpClient.request({method:"POST",url:df`alarm`,queryParams:t,data:e,options:o})}getAlarms(e,t){return this.httpClient.request({method:"GET",url:df`alarm`,queryParams:e,options:t})}removeAlarms(e,t){return this.httpClient.request({method:"DELETE",url:df`alarm`,data:e,options:t})}setAssetLinks(e,t){return this.httpClient.request({method:"PUT",url:df`alarm/assets`,data:e,options:t})}getAlarm(e,t){return this.httpClient.request({method:"GET",url:df`alarm/${e}`,options:t})}removeAlarm(e,t){return this.httpClient.request({method:"DELETE",url:df`alarm/${e}`,options:t})}updateAlarm(e,t,o){return this.httpClient.request({method:"PUT",url:df`alarm/${e}`,data:t,options:o})}getAssetLinks(e,t,o){return this.httpClient.request({method:"GET",url:df`alarm/${e}/assets`,queryParams:t,options:o})}}class c0{constructor(e){this.httpClient=e}getApps(e){return this.httpClient.request({method:"GET",url:df`apps`,options:e})}getConsoleConfig(e){return this.httpClient.request({method:"GET",url:df`apps/consoleConfig`,options:e})}getAppInfos(e){return this.httpClient.request({method:"GET",url:df`apps/info`,options:e})}}class c1{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:df`dashboard`,data:e,options:t})}update(e,t){return this.httpClient.request({method:"PUT",url:df`dashboard`,data:e,options:t})}getAllRealmDashboards(e,t){return this.httpClient.request({method:"GET",url:df`dashboard/all/${e}`,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:df`dashboard/query`,data:e,options:t})}delete(e,t,o){return this.httpClient.request({method:"DELETE",url:df`dashboard/${e}/${t}`,options:o})}get(e,t,o){return this.httpClient.request({method:"GET",url:df`dashboard/${e}/${t}`,options:o})}}class c2{constructor(e){this.httpClient=e}getConfig(e){return this.httpClient.request({method:"GET",url:df`syslog/config`,options:e})}updateConfig(e,t){return this.httpClient.request({method:"PUT",url:df`syslog/config`,data:e,options:t})}clearEvents(e){return this.httpClient.request({method:"DELETE",url:df`syslog/event`,options:e})}getEvents(e,t){return this.httpClient.request({method:"GET",url:df`syslog/event`,queryParams:e,options:t})}}class c3{constructor(e){this.httpClient=e}deleteConnections(e,t){return this.httpClient.request({method:"DELETE",url:df`gateway/connection`,queryParams:e,options:t})}getConnections(e){return this.httpClient.request({method:"GET",url:df`gateway/connection`,options:e})}deleteConnection(e,t){return this.httpClient.request({method:"DELETE",url:df`gateway/connection/${e}`,options:t})}getConnection(e,t){return this.httpClient.request({method:"GET",url:df`gateway/connection/${e}`,options:t})}setConnection(e,t,o){return this.httpClient.request({method:"PUT",url:df`gateway/connection/${e}`,data:t,options:o})}getConnectionStatus(e,t){return this.httpClient.request({method:"GET",url:df`gateway/status/${e}`,options:t})}}class c5{constructor(e){this.httpClient=e}updateCurrentUserLocale(e,t){return this.httpClient.request({method:"PUT",url:df`user/locale`,data:e,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:df`user/query`,data:e,options:t})}requestPasswordResetCurrent(e){return this.httpClient.request({method:"PUT",url:df`user/request-password-reset`,options:e})}updatePasswordCurrent(e,t){return this.httpClient.request({method:"PUT",url:df`user/reset-password`,data:e,options:t})}updateCurrent(e,t){return this.httpClient.request({method:"PUT",url:df`user/update`,data:e,options:t})}getCurrent(e){return this.httpClient.request({method:"GET",url:df`user/user`,options:e})}getCurrentUserRealmRoles(e){return this.httpClient.request({method:"GET",url:df`user/userRealmRoles`,options:e})}getCurrentUserClientRoles(e,t){return this.httpClient.request({method:"GET",url:df`user/userRoles/${e}`,options:t})}disconnectUserSession(e,t,o){return this.httpClient.request({method:"GET",url:df`user/${e}/disconnect/${t}`,options:o})}requestPasswordReset(e,t,o){return this.httpClient.request({method:"PUT",url:df`user/${e}/request-password-reset/${t}`,options:o})}updatePassword(e,t,o,n){return this.httpClient.request({method:"PUT",url:df`user/${e}/reset-password/${t}`,data:o,options:n})}resetSecret(e,t,o){return this.httpClient.request({method:"GET",url:df`user/${e}/reset-secret/${t}`,options:o})}updateRoles(e,t,o){return this.httpClient.request({method:"PUT",url:df`user/${e}/roles`,data:t,options:o})}getUserRealmRoles(e,t,o){return this.httpClient.request({method:"GET",url:df`user/${e}/userRealmRoles/${t}`,options:o})}updateUserRealmRoles(e,t,o,n){return this.httpClient.request({method:"PUT",url:df`user/${e}/userRealmRoles/${t}`,data:o,options:n})}getUserClientRoles(e,t,o,n){return this.httpClient.request({method:"GET",url:df`user/${e}/userRoles/${t}/${o}`,options:n})}updateUserClientRoles(e,t,o,n,i){return this.httpClient.request({method:"PUT",url:df`user/${e}/userRoles/${t}/${o}`,data:n,options:i})}getUserSessions(e,t,o){return this.httpClient.request({method:"GET",url:df`user/${e}/userSessions/${t}`,options:o})}create(e,t,o){return this.httpClient.request({method:"POST",url:df`user/${e}/users`,data:t,options:o})}update(e,t,o){return this.httpClient.request({method:"PUT",url:df`user/${e}/users`,data:t,options:o})}delete(e,t,o){return this.httpClient.request({method:"DELETE",url:df`user/${e}/users/${t}`,options:o})}getClientRoles(e,t,o){return this.httpClient.request({method:"GET",url:df`user/${e}/${t}/roles`,options:o})}updateClientRoles(e,t,o,n){return this.httpClient.request({method:"PUT",url:df`user/${e}/${t}/roles`,data:o,options:n})}get(e,t,o){return this.httpClient.request({method:"GET",url:df`user/${e}/${t}`,options:o})}}class c4{constructor(e){this.httpClient=e}doProtocolAssetDiscovery(e,t,o){return this.httpClient.request({method:"GET",url:df`agent/assetDiscovery/${e}`,queryParams:t,options:o})}doProtocolAssetImport(e,t,o,n){return this.httpClient.request({method:"POST",url:df`agent/assetImport/${e}`,queryParams:o,data:t,options:n})}doProtocolInstanceDiscovery(e,t,o){return this.httpClient.request({method:"GET",url:df`agent/instanceDiscovery/${e}`,queryParams:t,options:o})}}class c6{constructor(e){this.httpClient=e}getHealthStatus(e){return this.httpClient.request({method:"GET",url:df`health`,options:e})}getInfo(e){return this.httpClient.request({method:"GET",url:df`info`,options:e})}}class c8{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:df`realm`,data:e,options:t})}getAll(e){return this.httpClient.request({method:"GET",url:df`realm`,options:e})}getAccessible(e){return this.httpClient.request({method:"GET",url:df`realm/accessible`,options:e})}delete(e,t){return this.httpClient.request({method:"DELETE",url:df`realm/${e}`,options:t})}get(e,t){return this.httpClient.request({method:"GET",url:df`realm/${e}`,options:t})}update(e,t,o){return this.httpClient.request({method:"PUT",url:df`realm/${e}`,data:t,options:o})}}class c9{constructor(e){this.httpClient=e}getAllNodeDefinitions(e){return this.httpClient.request({method:"GET",url:df`flow`,options:e})}getNodeDefinition(e,t){return this.httpClient.request({method:"GET",url:df`flow/${e}`,options:t})}getAllNodeDefinitionsByType(e,t){return this.httpClient.request({method:"GET",url:df`flow/${e}`,options:t})}}class c7{constructor(e){this.httpClient=e}createGlobalRuleset(e,t){return this.httpClient.request({method:"POST",url:df`rules`,data:e,options:t})}getGlobalRulesets(e,t){return this.httpClient.request({method:"GET",url:df`rules`,queryParams:e,options:t})}createAssetRuleset(e,t){return this.httpClient.request({method:"POST",url:df`rules/asset`,data:e,options:t})}getAssetRulesets(e,t,o){return this.httpClient.request({method:"GET",url:df`rules/asset/for/${e}`,queryParams:t,options:o})}deleteAssetRuleset(e,t){return this.httpClient.request({method:"DELETE",url:df`rules/asset/${e}`,options:t})}getAssetRuleset(e,t){return this.httpClient.request({method:"GET",url:df`rules/asset/${e}`,options:t})}updateAssetRuleset(e,t,o){return this.httpClient.request({method:"PUT",url:df`rules/asset/${e}`,data:t,options:o})}getAssetGeofences(e,t){return this.httpClient.request({method:"GET",url:df`rules/geofences/${e}`,options:t})}getAssetEngineInfo(e,t){return this.httpClient.request({method:"GET",url:df`rules/info/asset/${e}`,options:t})}getGlobalEngineInfo(e){return this.httpClient.request({method:"GET",url:df`rules/info/global`,options:e})}getRealmEngineInfo(e,t){return this.httpClient.request({method:"GET",url:df`rules/info/realm/${e}`,options:t})}createRealmRuleset(e,t){return this.httpClient.request({method:"POST",url:df`rules/realm`,data:e,options:t})}getRealmRulesets(e,t,o){return this.httpClient.request({method:"GET",url:df`rules/realm/for/${e}`,queryParams:t,options:o})}deleteRealmRuleset(e,t){return this.httpClient.request({method:"DELETE",url:df`rules/realm/${e}`,options:t})}getRealmRuleset(e,t){return this.httpClient.request({method:"GET",url:df`rules/realm/${e}`,options:t})}updateRealmRuleset(e,t,o){return this.httpClient.request({method:"PUT",url:df`rules/realm/${e}`,data:t,options:o})}deleteGlobalRuleset(e,t){return this.httpClient.request({method:"DELETE",url:df`rules/${e}`,options:t})}getGlobalRuleset(e,t){return this.httpClient.request({method:"GET",url:df`rules/${e}`,options:t})}updateGlobalRuleset(e,t,o){return this.httpClient.request({method:"PUT",url:df`rules/${e}`,data:t,options:o})}}class de{constructor(e){this.httpClient=e}register(e,t){return this.httpClient.request({method:"POST",url:df`console/register`,data:e,options:t})}}class dt{constructor(e){this.httpClient=e}createProvisioningConfig(e,t){return this.httpClient.request({method:"POST",url:df`provisioning`,data:e,options:t})}getProvisioningConfigs(e){return this.httpClient.request({method:"GET",url:df`provisioning`,options:e})}deleteProvisioningConfig(e,t){return this.httpClient.request({method:"DELETE",url:df`provisioning/${e}`,options:t})}updateProvisioningConfig(e,t,o){return this.httpClient.request({method:"PUT",url:df`provisioning/${e}`,data:t,options:o})}}class dn{constructor(e){this.httpClient=e}getSettings(e){return this.httpClient.request({method:"GET",url:df`map`,options:e})}saveSettings(e,t){return this.httpClient.request({method:"PUT",url:df`map`,data:e,options:t})}deleteMap(e){return this.httpClient.request({method:"DELETE",url:df`map/deleteMap`,options:e})}getCustomMapInfo(e){return this.httpClient.request({method:"GET",url:df`map/getCustomMapInfo`,options:e})}getTile(e,t,o,n){return this.httpClient.request({method:"GET",url:df`map/tile/${e}/${t}/${o}`,options:n})}uploadMap(e,t){return this.httpClient.request({method:"POST",url:df`map/upload`,queryParams:e,options:t})}}class di{constructor(e){this.httpClient=e}getPredictedDatapoints(e,t,o,n){return this.httpClient.request({method:"POST",url:df`asset/predicted/${e}/${t}`,data:o,options:n})}writePredictedDatapoints(e,t,o,n){return this.httpClient.request({method:"PUT",url:df`asset/predicted/${e}/${t}`,data:o,options:n})}}class dr{constructor(e){this.httpClient=e}getManagerConfig(e){return this.httpClient.request({method:"GET",url:df`configuration/manager`,options:e})}update(e,t){return this.httpClient.request({method:"PUT",url:df`configuration/manager`,data:e,options:t})}fileUpload(e,t,o){return this.httpClient.request({method:"POST",url:df`configuration/manager/file`,queryParams:t,data:e,options:o})}getManagerConfigImage(e,t){return this.httpClient.request({method:"GET",url:df`configuration/manager/image/${e}`,options:t})}}class da{constructor(e){this.httpClient=e}getDatapointExport(e,t){return this.httpClient.request({method:"GET",url:df`asset/datapoint/export`,queryParams:e,options:t})}getDatapointPeriod(e,t){return this.httpClient.request({method:"GET",url:df`asset/datapoint/periods`,queryParams:e,options:t})}getDatapoints(e,t,o,n){return this.httpClient.request({method:"POST",url:df`asset/datapoint/${e}/${t}`,data:o,options:n})}}class ds{constructor(e){this.httpClient=e}getNotifications(e,t){return this.httpClient.request({method:"GET",url:df`notification`,queryParams:e,options:t})}removeNotifications(e,t){return this.httpClient.request({method:"DELETE",url:df`notification`,queryParams:e,options:t})}sendNotification(e,t){return this.httpClient.request({method:"POST",url:df`notification/alert`,data:e,options:t})}getNotificationsCount(e,t){return this.httpClient.request({method:"GET",url:df`notification/count`,queryParams:e,options:t})}removeNotification(e,t){return this.httpClient.request({method:"DELETE",url:df`notification/${e}`,options:t})}notificationAcknowledged(e,t,o,n){return this.httpClient.request({method:"PUT",url:df`notification/${e}/acknowledged`,queryParams:o,data:t,options:n})}notificationDelivered(e,t,o){return this.httpClient.request({method:"PUT",url:df`notification/${e}/delivered`,queryParams:t,options:o})}}class dl{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:df`asset`,data:e,options:t})}delete(e,t){return this.httpClient.request({method:"DELETE",url:df`asset`,queryParams:e,options:t})}writeAttributeValues(e,t){return this.httpClient.request({method:"PUT",url:df`asset/attributes`,data:e,options:t})}writeAttributeEvents(e,t){return this.httpClient.request({method:"PUT",url:df`asset/attributes/timestamp`,data:e,options:t})}queryCount(e,t){return this.httpClient.request({method:"POST",url:df`asset/count`,data:e,options:t})}updateNoneParent(e,t){return this.httpClient.request({method:"DELETE",url:df`asset/parent`,queryParams:e,options:t})}getPartial(e,t){return this.httpClient.request({method:"GET",url:df`asset/partial/${e}`,options:t})}queryAssets(e,t){return this.httpClient.request({method:"POST",url:df`asset/query`,data:e,options:t})}queryAssetTree(e,t){return this.httpClient.request({method:"POST",url:df`asset/tree`,data:e,options:t})}getCurrentUserAssets(e){return this.httpClient.request({method:"GET",url:df`asset/user/current`,options:e})}createUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:df`asset/user/link`,data:e,options:t})}getUserAssetLinks(e,t){return this.httpClient.request({method:"GET",url:df`asset/user/link`,queryParams:e,options:t})}deleteUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:df`asset/user/link/delete`,data:e,options:t})}deleteAllUserAssetLinks(e,t,o){return this.httpClient.request({method:"DELETE",url:df`asset/user/link/${e}/${t}`,options:o})}deleteUserAssetLink(e,t,o,n){return this.httpClient.request({method:"DELETE",url:df`asset/user/link/${e}/${t}/${o}`,options:n})}get(e,t){return this.httpClient.request({method:"GET",url:df`asset/${e}`,options:t})}update(e,t,o){return this.httpClient.request({method:"PUT",url:df`asset/${e}`,data:t,options:o})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName(e,t,o,n){return this.httpClient.request({method:"PUT",url:df`asset/${e}/attribute/${t}`,data:o,options:n})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName_timestamp(e,t,o,n,i){return this.httpClient.request({method:"PUT",url:df`asset/${e}/attribute/${t}/${o}`,data:n,options:i})}updateParent(e,t,o){return this.httpClient.request({method:"PUT",url:df`asset/${e}/child`,queryParams:t,options:o})}}class dc{constructor(e){this.httpClient=e}getServices(e,t){return this.httpClient.request({method:"GET",url:df`service`,queryParams:e,options:t})}registerService(e,t){return this.httpClient.request({method:"POST",url:df`service`,data:e,options:t})}getGlobalServices(e){return this.httpClient.request({method:"GET",url:df`service/global`,options:e})}registerGlobalService(e,t){return this.httpClient.request({method:"POST",url:df`service/global`,data:e,options:t})}deregisterService(e,t,o){return this.httpClient.request({method:"DELETE",url:df`service/${e}/${t}`,options:o})}getService(e,t,o){return this.httpClient.request({method:"GET",url:df`service/${e}/${t}`,options:o})}heartbeat(e,t,o){return this.httpClient.request({method:"PUT",url:df`service/${e}/${t}`,options:o})}}class dd{constructor(e){this.httpClient=e}startTunnel(e,t){return this.httpClient.request({method:"POST",url:df`gateway/tunnel`,data:e,options:t})}stopTunnel(e,t){return this.httpClient.request({method:"DELETE",url:df`gateway/tunnel`,data:e,options:t})}getAllActiveTunnelInfos(e,t){return this.httpClient.request({method:"GET",url:df`gateway/tunnel/${e}`,options:t})}getGatewayActiveTunnelInfos(e,t,o){return this.httpClient.request({method:"GET",url:df`gateway/tunnel/${e}/${t}`,options:o})}getActiveTunnelInfo(e,t,o,n,i){return this.httpClient.request({method:"GET",url:df`gateway/tunnel/${e}/${t}/${o}/${n}`,options:i})}}class du{constructor(e){this.httpClient=e}getAssetDescriptors(e,t){return this.httpClient.request({method:"GET",url:df`model/assetDescriptors`,queryParams:e,options:t})}getAssetInfo(e,t,o){return this.httpClient.request({method:"GET",url:df`model/assetInfo/${e}`,queryParams:t,options:o})}getAssetInfos(e,t){return this.httpClient.request({method:"GET",url:df`model/assetInfos`,queryParams:e,options:t})}getValueDescriptorSchema(e,t){return this.httpClient.request({method:"GET",url:df`model/getValueDescriptorSchema`,queryParams:e,options:t})}getMetaItemDescriptors(e,t){return this.httpClient.request({method:"GET",url:df`model/metaItemDescriptors`,queryParams:e,options:t})}getValueDescriptors(e,t){return this.httpClient.request({method:"GET",url:df`model/valueDescriptors`,queryParams:e,options:t})}}function df(e,...t){let o="";for(let n=0;n<t.length;n++)o+=e[n],o+=encodeURIComponent(t[n]);return o+e[e.length-1]}class dh{constructor(e,t=cQ.create()){this._alarmResource=new db(e,t),this._appResource=new dp(e,t),this._dashboardResource=new dF(e,t),this._syslogResource=new dg(e,t),this._gatewayClientResource=new dv(e,t),this._userResource=new d_(e,t),this._agentResource=new dy(e,t),this._statusResource=new dw(e,t),this._realmResource=new dE(e,t),this._flowResource=new dC(e,t),this._rulesResource=new dk(e,t),this._consoleResource=new dA(e,t),this._provisioningResource=new dx(e,t),this._mapResource=new dD(e,t),this._assetPredictedDatapointResource=new dS(e,t),this._configurationResource=new dT(e,t),this._assetDatapointResource=new dO(e,t),this._notificationResource=new dI(e,t),this._assetResource=new dB(e,t),this._externalServiceResource=new dR(e,t),this._gatewayServiceResource=new dP(e,t),this._assetModelResource=new dN(e,t),this._assetResource=new dB(e,t)}get AlarmResource(){return this._alarmResource}get AppResource(){return this._appResource}get DashboardResource(){return this._dashboardResource}get SyslogResource(){return this._syslogResource}get GatewayClientResource(){return this._gatewayClientResource}get UserResource(){return this._userResource}get AgentResource(){return this._agentResource}get StatusResource(){return this._statusResource}get RealmResource(){return this._realmResource}get FlowResource(){return this._flowResource}get RulesResource(){return this._rulesResource}get ConsoleResource(){return this._consoleResource}get ProvisioningResource(){return this._provisioningResource}get MapResource(){return this._mapResource}get AssetPredictedDatapointResource(){return this._assetPredictedDatapointResource}get ConfigurationResource(){return this._configurationResource}get AssetDatapointResource(){return this._assetDatapointResource}get NotificationResource(){return this._notificationResource}get AssetResource(){return this._assetResource}get ExternalServiceResource(){return this._externalServiceResource}get GatewayServiceResource(){return this._gatewayServiceResource}get AssetModelResource(){return this._assetModelResource}}class dm{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 o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}(t,e.options);let o=e.copyFn;return this.axios.request(t).then(e=>(o&&e.data&&(e.originalData=e.data,e.data=o(e.data)),e))}}class db extends cZ{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dp extends c0{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dF extends c1{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dg extends c2{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dv extends c3{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class d_ extends c5{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dy extends c4{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dw extends c6{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dE extends c8{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dC extends c9{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dk extends c7{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dA extends de{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dx extends dt{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dD extends dn{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dS extends di{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dT extends dr{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dO extends da{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dI extends ds{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dB extends dl{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dR extends dc{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dP extends dd{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}class dN extends du{constructor(e,t=cQ.create()){t.defaults.baseURL=e,super(new dm(t))}}var dL=o(8183),dM=o.n(dL);cQ.isAxiosError;let dU=new class{get api(){return this._client}constructor(){this._axiosInstance=cQ.create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use(e=>(e.paramsSerializer=e=>dM().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 dh(e,this._axiosInstance)}};var dj=function(e,t,o,n){return new(o||(o=Promise))(function(i,r){function a(e){try{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(a,s)}l((n=n.apply(e,t||[])).next())})};(ey=tA||(tA={})).DISCONNECTED="DISCONNECTED",ey.CONNECTED="CONNECTED",ey.CONNECTING="CONNECTING";let d$="SUBSCRIBED:",dV="UNAUTHORIZED:",dz="TRIGGERED:",dq="EVENT:";class dH{constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=dY.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=tA.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 o=e.indexOf(t);o>=0&&e.splice(o,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===tA.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(tA.CONNECTING),this._connectingDeferred=new sK,this._doConnect().then(e=>{if(this._connectingDeferred){let t=this._connectingDeferred;e?(console.debug("Connected to event service: "+this.endpointUrl),this._reconnectDelayMillis=dY.MIN_RECONNECT_DELAY,this._onStatusChanged(tA.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!==tA.DISCONNECTED&&this._doDisconnect())}subscribe(e,t){let o={eventSubscription:e,callback:t,deferred:new sK};return null!=this._pendingSubscription||this._status!==tA.CONNECTED?(this._queuedSubscriptions.push(o),o.deferred.promise):(this._pendingSubscription=o,this._doSubscribe(e).then(e=>{if(this._pendingSubscription){let t=this._pendingSubscription;this._pendingSubscription=null,this._subscriptionMap.set(e,t),this._processNextSubscription();let o=t.deferred;t.deferred=null,o&&o.resolve(e)}},e=>{if(console.error(e),this._pendingSubscription){let t=this._pendingSubscription;this._pendingSubscription=null,this._processNextSubscription();let o=t.deferred;t.deferred=null,o&&o.reject(e)}}),this._pendingSubscription.deferred.promise)}unsubscribe(e){return dj(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===tA.CONNECTED&&this._doSend(e)}sendEventWithReply(e){return this._status!==tA.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(e)}subscribeAssetEvents(e,t,o){return dj(this,void 0,void 0,function*(){let n=e&&"string"!=typeof e[0]?e.map(e=>e.id):e,i="AssetEvent"+dH._subscriptionCounter++;if(!this._assetEventPromise){let e;ul.authenticated||(e={filterType:"asset",realm:ul.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;n?n.find(e=>t===e)&&o(e):e.asset.realm===ul.displayRealm&&o(e)}),this._assetEventPromise.then(()=>{try{if(n&&t){let e={messageID:"read-assets:"+n.join(",")+":"+i,eventType:"read-assets",assetQuery:{ids:n}};this.sendEventWithReply(e).then(e=>{e.assets&&this._assetEventCallbackMap.has(i)&&e.assets.forEach(e=>{o({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,o){return dj(this,void 0,void 0,function*(){let n=e&&"string"!=typeof e[0],i=n?e.map(e=>e.id):e,r=n?e:void 0,a="AttributeEvent"+dH._subscriptionCounter++;if(!this._attributeEventPromise){let e;ul.authenticated||(e={filterType:"asset",realm:ul.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;n?e.forEach(e=>{r.id===e.id&&r.name===e.name&&o(t)}):i?i.find(e=>r.id===e)&&o(t):t.realm===ul.displayRealm&&o(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,o])=>{(!r||r.find(o=>o.id===e.id&&o.name===t))&&s({eventType:"attribute",timestamp:o.timestamp,value:o.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===tA.CONNECTED&&0!==this._queuedSubscriptions.length&&setTimeout(()=>{let e=this._queuedSubscriptions.shift();e&&this.subscribe(e.eventSubscription,e.callback).then(t=>{let o=e.deferred;e.deferred=null,o&&o.resolve(t)},t=>{let o=e.deferred;e.deferred=null,o&&o.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 o=this._subscriptionMap.get(e);o&&o.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===tA.CONNECTED&&this._onStatusChanged(tA.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._onStatusChanged(tA.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<dY.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(dY.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}dH.MIN_RECONNECT_DELAY=0,dH.MAX_RECONNECT_DELAY=3e4,dH._subscriptionCounter=0;class dY extends dH{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="+ul.config.realm;return this._connectDeferred=new sK,(ul.authenticated?ul.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(d$)){let e=JSON.parse(t.substring(d$.length)),o=this._subscribeDeferred;this._subscribeDeferred=null,o&&o.resolve(e.subscriptionId)}else if(t.startsWith(dV)){let e=JSON.parse(t.substring(dV.length)),o=this._subscribeDeferred;this._subscribeDeferred=null,o&&(console.warn("Unauthorized event subscription: "+JSON.stringify(e,null,2)),o.reject("Unauthorized"))}else if(t.startsWith(dz)){let e=JSON.parse(t.substring(dz.length));e.events&&e.events.forEach(t=>{this._onMessageReceived(e.subscriptionId,t)})}else if(t.startsWith(dq)){let e=JSON.parse(t.substring(dq.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 sK,e.subscriptionId||(e.subscriptionId=dY._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=dq+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 sK;return this._repliesDeferred.set(e.messageID,t),this._webSocket.send(dq+JSON.stringify(e)),t.promise}}dY._subscriptionCounter=1;let dW=["__proto__","constructor","prototype"];function dG(e){return!("string"!=typeof e||0===e.length||e.length>128||dW.indexOf(e)>-1||e.indexOf("..")>-1||e.indexOf("\\")>-1||/[?#%\s@]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function dK(e){return!(!dG(e)||e.indexOf("/")>-1)}let dJ={lng:dK,ns:function(e){return dG(e)}};function dX(e){return"string"!=typeof e?e:e.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function dQ(){return"function"==typeof XMLHttpRequest||"object"==typeof XMLHttpRequest}let dZ=/\{\{(.+?)\}\}/g;function d0(e,t){let o=!1,n=e.replace(dZ,(e,n)=>{let i=n.trim();if(dW.indexOf(i)>-1)return e;let r=t[i];if(null==r)return e;let a=dJ[i]||dK,s=String(r).split("+");for(let t of s)if(!a(t))return o=!0,e;return s.join("+")});return o?null:n}let d1="u">typeof globalThis?globalThis:"u">typeof global?global:"u">typeof window?window:void 0;"function"==typeof fetch?i=fetch:d1&&"function"==typeof d1.fetch&&(i=d1.fetch);let d2=dQ()&&d1?d1.XMLHttpRequest:void 0,d3="function"==typeof ActiveXObject&&d1?d1.ActiveXObject:void 0,d5=["__proto__","constructor","prototype"],d4=(e,t)=>{if(t&&"object"==typeof t){let o="";for(let e of Object.keys(t))d5.indexOf(e)>-1||(o+="&"+encodeURIComponent(e)+"="+encodeURIComponent(t[e]));if(!o)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+o.slice(1)}return e},d6=(e,t,o,n)=>{let r=e=>{if(!e.ok)return o(e.statusText||"Error",{status:e.status});e.text().then(t=>{o(null,{status:e.status,data:t})}).catch(o)};if(n){let i=n(e,t);if(i instanceof Promise)return void i.then(r).catch(o)}"function"==typeof fetch?fetch(e,t).then(r).catch(o):i(e,t).then(r).catch(o)},d8=(e,t,o,n)=>{if("function"==typeof o&&(n=o,o=void 0),n=n||(()=>{}),i&&0!==t.indexOf("file:")){var r=t,a=o,s=n;e.queryStringParams&&(r=d4(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 l="function"==typeof e.requestOptions?e.requestOptions(a):e.requestOptions,c={method:a?"POST":"GET",body:a?e.stringify(a):void 0,headers:i,...e._omitFetchOptions?{}:l},d="function"==typeof e.alternateFetch&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{d6(r,c,s,d)}catch(t){if(!l||0===Object.keys(l).length||!t.message||0>t.message.indexOf("not implemented"))return s(t);try{Object.keys(l).forEach(e=>{delete c[e]}),d6(r,c,s,d),e._omitFetchOptions=!0}catch(e){s(e)}}return}if(dQ()||"function"==typeof ActiveXObject){var l=t,c=o,d=n;c&&"object"==typeof c&&(c=d4("",c).slice(1)),e.queryStringParams&&(l=d4(l,e.queryStringParams));try{let t=d2?new d2:new d3("MSXML2.XMLHTTP.3.0");t.open(c?"POST":"GET",l,1),e.crossDomain||t.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.withCredentials=!!e.withCredentials,c&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),t.overrideMimeType&&t.overrideMimeType("application/json");let o=e.customHeaders;if(o="function"==typeof o?o():o)for(let e of Object.keys(o))d5.indexOf(e)>-1||t.setRequestHeader(e,o[e]);t.onreadystatechange=()=>{t.readyState>3&&d(t.status>=400?t.statusText:null,{status:t.status,data:t.responseText})},t.send(c)}catch(e){console&&console.log(e)}return}n(Error("No fetch and no xhr implementation found!"))};var d9=class{constructor(e,t={},o={}){this.services=e,this.options=t,this.allOptions=o,this.type="backend",this.init(e,t,o)}init(e,t={},o={}){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,o)=>({[t]:o||""}),parseLoadPayload:(e,t)=>void 0,request:d8,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=o,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,o){this._readAny(e,e,t,t,o)}read(e,t,o){this._readAny([e],e,[t],t,o)}_readAny(e,t,o,n,i){var r,a;let s=this.options.loadPath;"function"==typeof this.options.loadPath&&(s=this.options.loadPath(e,o)),(s=(a=r=s)&&"function"==typeof a.then?r:Promise.resolve(r)).then(r=>{if(!r)return i(null,{});let a=d0(r,{lng:e.join("+"),ns:o.join("+")});if(null==a)return i(Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+e.map(dX).join(", ")+"] namespaces=["+o.map(dX).join(", ")+"]"),!1);this.loadUrl(a,i,t,n)})}loadUrl(e,t,o,n){let i=this.options.parseLoadPayload("string"==typeof o?[o]:o,"string"==typeof n?[n]:n),r=dX(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 o=e.message.toLowerCase();if(["failed","fetch","network","load"].find(e=>o.indexOf(e)>-1))return t("failed loading "+r+": "+dX(e.message),!0)}if(e)return t(e,!1);try{a="string"==typeof i.data?this.options.parse(i.data,o,n):i.data}catch(e){s="failed parsing "+r+" to json"}if(s)return t(s,!1);t(null,a)})}create(e,t,o,n,i){if(!this.options.addPath)return;"string"==typeof e&&(e=[e]);let r=this.options.parsePayload(t,o,n),a=0,s=[],l=[];e.forEach(o=>{let n=this.options.addPath;"function"==typeof this.options.addPath&&(n=this.options.addPath(o,t));let c=d0(n,{lng:o,ns:t});if(null==c){a+=1,i&&a===e.length&&i(s,l);return}this.options.request(this.options,c,r,(t,o)=>{a+=1,s.push(t),l.push(o),a===e.length&&"function"==typeof i&&i(s,l)})})}reload(){let{backendConnector:e,languageUtils:t,logger:o}=this.services,n=e.language;if(n&&"cimode"===n.toLowerCase())return;let i=[],r=e=>{t.toResolveHierarchy(e).forEach(e=>{0>i.indexOf(e)&&i.push(e)})};r(n),this.allOptions.preload&&this.allOptions.preload.forEach(e=>r(e)),i.forEach(t=>{this.allOptions.ns.forEach(n=>{e.read(t,n,"read",null,null,(i,r)=>{i&&o.warn(`loading namespace ${n} for language ${t} failed`,i),!i&&r&&o.log(`loaded namespace ${n} for language ${t}`,r),e.loaded(`${t}|${n}`,i,r)})})})}};d9.type="backend";var d7=o(4954);class ue extends Error{}function ut(e,t){let o;if("string"!=typeof e)throw new ue("Invalid token specified: must be a string");t||(t={});let n=+(!0!==t.header),i=e.split(".")[n];if("string"!=typeof i)throw new ue(`Invalid token specified: missing part #${n+1}`);try{o=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 o;return o=t,decodeURIComponent(atob(o).replace(/(.)/g,(e,t)=>{let o=t.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}catch(e){return atob(t)}}(i)}catch(e){throw new ue(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(o)}catch(e){throw new ue(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}if(ue.prototype.name="InvalidTokenError","u"<typeof Promise)throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function uo(e){if(!(this instanceof uo))throw Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var t,o,n=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=")&&(n.iframeVersion=a[s].src.substring(a[s].src.indexOf("version=")+8).split("&")[0]);var l=!0,c=x(console.info),d=x(console.warn);function u(e,t){for(var o=function(e){var t=null,o=window.crypto||window.msCrypto;if(o&&o.getRandomValues&&window.Uint8Array)return t=new Uint8Array(e),o.getRandomValues(t),t;t=Array(e);for(var n=0;n<t.length;n++)t[n]=Math.floor(256*Math.random());return t}(e),n=Array(e),i=0;i<e;i++)n[i]=t.charCodeAt(o[i]%t.length);return String.fromCharCode.apply(null,n)}function f(){return void 0===n.authServerUrl?void 0:"/"==n.authServerUrl.charAt(n.authServerUrl.length-1)?n.authServerUrl+"realms/"+encodeURIComponent(n.realm):n.authServerUrl+"/realms/"+encodeURIComponent(n.realm)}function h(e,t){var o=e.code,i=e.error,r=e.prompt,a=new Date().getTime();if(e.kc_action_status&&n.onActionUpdate&&n.onActionUpdate(e.kc_action_status),i){if("none"!=r)if(e.error_description&&"authentication_expired"===e.error_description)n.login(e.loginOptions);else{var s={error:i,error_description:e.error_description};n.onAuthError&&n.onAuthError(s),t&&t.setError(s)}else t&&t.setSuccess();return}if("standard"!=n.flow&&(e.access_token||e.id_token)&&h(e.access_token,null,e.id_token,!0),"implicit"!=n.flow&&o){var d="code="+o+"&grant_type=authorization_code",u=n.endpoints.token(),f=new XMLHttpRequest;f.open("POST",u,!0),f.setRequestHeader("Content-type","application/x-www-form-urlencoded"),d+="&client_id="+encodeURIComponent(n.clientId)+"&redirect_uri="+e.redirectUri,e.pkceCodeVerifier&&(d+="&code_verifier="+e.pkceCodeVerifier),f.withCredentials=!0,f.onreadystatechange=function(){if(4==f.readyState)if(200==f.status){var e=JSON.parse(f.responseText);h(e.access_token,e.refresh_token,e.id_token,"standard"===n.flow),y()}else n.onAuthError&&n.onAuthError(),t&&t.setError()},f.send(d)}function h(o,i,r,s){b(o,i,r,a=(a+new Date().getTime())/2),l&&n.idTokenParsed&&n.idTokenParsed.nonce!=e.storedNonce?(c("[KEYCLOAK] Invalid nonce, clearing token"),n.clearToken(),t&&t.setError()):s&&(n.onAuthSuccess&&n.onAuthSuccess(),t&&t.setSuccess())}}function m(e){return 0==e.status&&e.responseText&&e.responseURL.startsWith("file:")}function b(e,t,o,i){if(n.tokenTimeoutHandle&&(clearTimeout(n.tokenTimeoutHandle),n.tokenTimeoutHandle=null),t?(n.refreshToken=t,n.refreshTokenParsed=ut(t)):(delete n.refreshToken,delete n.refreshTokenParsed),o?(n.idToken=o,n.idTokenParsed=ut(o)):(delete n.idToken,delete n.idTokenParsed),e){if(n.token=e,n.tokenParsed=ut(e),n.sessionId=n.tokenParsed.sid,n.authenticated=!0,n.subject=n.tokenParsed.sub,n.realmAccess=n.tokenParsed.realm_access,n.resourceAccess=n.tokenParsed.resource_access,i&&(n.timeSkew=Math.floor(i/1e3)-n.tokenParsed.iat),null!=n.timeSkew&&(c("[KEYCLOAK] Estimated time difference between browser and server is "+n.timeSkew+" seconds"),n.onTokenExpired)){var r=(n.tokenParsed.exp-new Date().getTime()/1e3+n.timeSkew)*1e3;c("[KEYCLOAK] Token expires in "+Math.round(r/1e3)+" s"),r<=0?n.onTokenExpired():n.tokenTimeoutHandle=setTimeout(n.onTokenExpired,r)}}else delete n.token,delete n.tokenParsed,delete n.subject,delete n.realmAccess,delete n.resourceAccess,n.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 F(e){var t=function(e){switch(n.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,o,i,r=e.indexOf("?"),a=e.indexOf("#");if("query"===n.responseMode&&-1!==r?(o=e.substring(0,r),""!==(i=g(e.substring(r+1,-1!==a?a:e.length),t)).paramsString&&(o+="?"+i.paramsString),-1!==a&&(o+=e.substring(a))):"fragment"===n.responseMode&&-1!==a&&(o=e.substring(0,a),""!==(i=g(e.substring(a+1),t)).paramsString&&(o+="#"+i.paramsString)),i&&i.oauthParams){if("standard"===n.flow||"hybrid"===n.flow){if((i.oauthParams.code||i.oauthParams.error)&&i.oauthParams.state)return i.oauthParams.newUrl=o,i.oauthParams}else if("implicit"===n.flow&&(i.oauthParams.access_token||i.oauthParams.error)&&i.oauthParams.state)return i.oauthParams.newUrl=o,i.oauthParams}}(e);if(t){var i=o.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 o=e.split("&"),n={paramsString:"",oauthParams:{}},i=0;i<o.length;i++){var r=o[i].indexOf("="),a=o[i].slice(0,r);-1!==t.indexOf(a)?n.oauthParams[a]=o[i].slice(r+1):(""!==n.paramsString&&(n.paramsString+="&"),n.paramsString+=o[i])}return n}function v(){var e={setSuccess:function(t){e.resolve(t)},setError:function(t){e.reject(t)}};return e.promise=new Promise(function(t,o){e.resolve=t,e.reject=o}),e}function _(){var e=v();if(!r.enable||r.iframe)return e.setSuccess(),e.promise;var t=document.createElement("iframe");r.iframe=t,t.onload=function(){var t=n.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 o=n.endpoints.checkSessionIframe();return t.setAttribute("src",o),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&&n.clearToken();for(var t=r.callbackList.splice(0,r.callbackList.length),o=t.length-1;o>=0;--o){var i=t[o];"error"==e.data?i.setError():i.setSuccess("unchanged"==e.data)}}},!1),e.promise}function y(){r.enable&&n.token&&setTimeout(function(){w().then(function(e){e&&y()})},1e3*r.interval)}function w(){var e=v();if(r.iframe&&r.iframeOrigin){var t=n.clientId+" "+(n.sessionId?n.sessionId:"");r.callbackList.push(e);var o=r.iframeOrigin;1==r.callbackList.length&&r.iframe.contentWindow.postMessage(t,o)}else e.setSuccess();return e.promise}function E(){var e,t,o,i=v();if(r.enable||n.silentCheckSsoRedirectUri){var a=document.createElement("iframe");a.setAttribute("src",n.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&&(d("[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,n.silentCheckSsoFallback&&(n.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=n.messageReceiveTimeout,o=null,Promise.race([e,new Promise(function(e,n){o=setTimeout(function(){n({error:"Timeout when waiting for 3rd party check iframe message."})},t)})]).finally(function(){clearTimeout(o)})}function C(e){if(!e||"default"==e)return{login:function(e){return window.location.assign(n.createLoginUrl(e)),v().promise},logout:async function(e){if("GET"===(e?.logoutMethod??n.logoutMethod))return void window.location.replace(n.createLogoutUrl(e));let o=n.createLogoutUrl(e),i=await fetch(o,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({id_token_hint:n.idToken,client_id:n.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(n.createRegisterUrl(e)),v().promise},accountManagement:function(){var e=n.createAccountUrl();if(void 0!==e)window.location.href=e;else throw"Not supported by the OIDC server";return v().promise},redirectUri:function(e,t){return e&&e.redirectUri?e.redirectUri:n.redirectUri?n.redirectUri:location.href}};if("cordova"==e){r.enable=!1;var o=function(e,t,o){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(e,t,o):window.open(e,t,o)},i=function(e){var t=e&&e.cordovaOptions?Object.keys(e.cordovaOptions).reduce(function(t,o){return t[o]=e.cordovaOptions[o],t},{}):{};return t.location="no",e&&"none"==e.prompt&&(t.hidden="yes"),Object.keys(t).reduce(function(e,o){return e.push(o+"="+t[o]),e},[]).join(",")},a=function(){return n.redirectUri||"http://localhost"};return{login:function(e){var t=v(),r=i(e),s=o(n.createLoginUrl(e),"_blank",r),l=!1,c=!1,d=function(){c=!0,s.close()};return s.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&(h(F(e.url),t),d(),l=!0)}),s.addEventListener("loaderror",function(e){l||(0==e.url.indexOf(a())?(h(F(e.url),t),d(),l=!0):(t.setError(),d()))}),s.addEventListener("exit",function(e){c||t.setError({reason:"closed_by_user"})}),t.promise},logout:function(e){var t,i=v(),r=o(n.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():(n.clearToken(),i.setSuccess())}),i.promise},register:function(e){var t=v(),r=o(n.createRegisterUrl(),"_blank",i(e));return r.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&(r.close(),h(F(e.url),t))}),t.promise},accountManagement:function(){var e=n.createAccountUrl();if(void 0!==e){var t=o(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=v(),o=n.createLoginUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),h(F(e.url),t)}),window.cordova.plugins.browsertab.openUrl(o),t.promise},logout:function(e){var t=v(),o=n.createLogoutUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),n.clearToken(),t.setSuccess()}),window.cordova.plugins.browsertab.openUrl(o),t.promise},register:function(e){var t=v(),o=n.createRegisterUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),h(F(e.url),t)}),window.cordova.plugins.browsertab.openUrl(o),t.promise},accountManagement:function(){var e=n.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:n.redirectUri?n.redirectUri:"http://localhost"}};throw"invalid adapter type: "+e}n.init=function(i){if(n.didInitialize)throw Error("A 'Keycloak' instance can only be initialized once.");if(n.didInitialize=!0,n.authenticated=!1,o=function(){try{return new k}catch(e){}return new A}(),t=i&&["default","cordova","cordova-native"].indexOf(i.adapter)>-1?C(i.adapter):i&&"object"==typeof i.adapter?i.adapter:window.Cordova||window.cordova?C("cordova"):C(),i){if(void 0!==i.useNonce&&(l=i.useNonce),void 0!==i.checkLoginIframe&&(r.enable=i.checkLoginIframe),i.checkLoginIframeInterval&&(r.interval=i.checkLoginIframeInterval),"login-required"===i.onLoad&&(n.loginRequired=!0),i.responseMode)if("query"===i.responseMode||"fragment"===i.responseMode)n.responseMode=i.responseMode;else throw"Invalid value for responseMode";if(i.flow){switch(i.flow){case"standard":n.responseType="code";break;case"implicit":n.responseType="id_token token";break;case"hybrid":n.responseType="code id_token token";break;default:throw"Invalid value for flow"}n.flow=i.flow}if(null!=i.timeSkew&&(n.timeSkew=i.timeSkew),i.redirectUri&&(n.redirectUri=i.redirectUri),i.silentCheckSsoRedirectUri&&(n.silentCheckSsoRedirectUri=i.silentCheckSsoRedirectUri),"boolean"==typeof i.silentCheckSsoFallback?n.silentCheckSsoFallback=i.silentCheckSsoFallback:n.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}.`);n.pkceMethod=i.pkceMethod}else n.pkceMethod="S256";"boolean"==typeof i.enableLogging?n.enableLogging=i.enableLogging:n.enableLogging=!1,"POST"===i.logoutMethod?n.logoutMethod="POST":n.logoutMethod="GET","string"==typeof i.scope&&(n.scope=i.scope),"string"==typeof i.acrValues&&(n.acrValues=i.acrValues),"number"==typeof i.messageReceiveTimeout&&i.messageReceiveTimeout>0?n.messageReceiveTimeout=i.messageReceiveTimeout:n.messageReceiveTimeout=1e4}n.responseMode||(n.responseMode="fragment"),n.responseType||(n.responseType="code",n.flow="standard");var a=v(),s=v();s.promise.then(function(){n.onReady&&n.onReady(n.authenticated),a.setSuccess(n.authenticated)}).catch(function(e){a.setError(e)});var c=function(){var t=v();function o(e){e?n.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}}:n.endpoints={authorize:function(){return f()+"/protocol/openid-connect/auth"},token:function(){return f()+"/protocol/openid-connect/token"},logout:function(){return f()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var e=f()+"/protocol/openid-connect/login-status-iframe.html";return n.iframeVersion&&(e=e+"?version="+n.iframeVersion),e},thirdPartyCookiesIframe:function(){var e=f()+"/protocol/openid-connect/3p-cookies/step1.html";return n.iframeVersion&&(e=e+"?version="+n.iframeVersion),e},register:function(){return f()+"/protocol/openid-connect/registrations"},userinfo:function(){return f()+"/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||m(i)){var e=JSON.parse(i.responseText);n.authServerUrl=e["auth-server-url"],n.realm=e.realm,n.clientId=e.resource,o(null),t.setSuccess()}else t.setError()},i.send()}else{if(!e.clientId)throw"clientId missing";n.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||m(i)?(o(JSON.parse(i.responseText)),t.setSuccess()):t.setError())},i.send()}else o(r),t.setSuccess();else{if(!e.url){for(var l=document.getElementsByTagName("script"),c=0;c<l.length;c++)if(l[c].src.match(/.*keycloak\.js/)){e.url=l[c].src.substr(0,l[c].src.indexOf("/js/keycloak.js"));break}}if(!e.realm)throw"realm missing";n.authServerUrl=e.url,n.realm=e.realm,o(null),t.setSuccess()}}return t.promise}();function d(){var e=function(e){e||(o.prompt="none"),i&&i.locale&&(o.locale=i.locale),n.login(o).then(function(){s.setSuccess()}).catch(function(e){s.setError(e)})},t=function(){var e=document.createElement("iframe"),t=n.createLoginUrl({prompt:"none",redirectUri:n.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 o=function(t){t.origin===window.location.origin&&e.contentWindow===t.source&&(h(F(t.data),s),document.body.removeChild(e),window.removeEventListener("message",o))};window.addEventListener("message",o)},o={};switch(i.onLoad){case"check-sso":r.enable?_().then(function(){w().then(function(o){o?s.setSuccess():n.silentCheckSsoRedirectUri?t():e(!1)}).catch(function(e){s.setError(e)})}):n.silentCheckSsoRedirectUri?t():e(!1);break;case"login-required":e(!0);break;default:throw"Invalid value for onLoad"}}function u(){var e=F(window.location.href);if(e&&window.history.replaceState(window.history.state,null,e.newUrl),e&&e.valid)return _().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?_().then(function(){w().then(function(e){e?(n.onAuthSuccess&&n.onAuthSuccess(),s.setSuccess(),y()):s.setSuccess()}).catch(function(e){s.setError(e)})}):n.updateToken(-1).then(function(){n.onAuthSuccess&&n.onAuthSuccess(),s.setSuccess()}).catch(function(e){n.onAuthError&&n.onAuthError(),i.onLoad?d():s.setError(e)})):i.onLoad?d():s.setSuccess():s.setSuccess()}return c.then(function(){var e,t;(e=v(),t=function(){("interactive"===document.readyState||"complete"===document.readyState)&&(document.removeEventListener("readystatechange",t),e.setSuccess())},document.addEventListener("readystatechange",t),t(),e.promise).then(E).then(u).catch(function(e){a.setError(e)})}),c.catch(function(e){a.setError(e)}),a.promise},n.login=function(e){return t.login(e)},n.createLoginUrl=function(e){var i,r=p(),a=p(),s=t.redirectUri(e),c={state:r,nonce:a,redirectUri:encodeURIComponent(s),loginOptions:e};e&&e.prompt&&(c.prompt=e.prompt),i=e&&"register"==e.action?n.endpoints.register():n.endpoints.authorize();var d=e&&e.scope||n.scope;d?-1===d.indexOf("openid")&&(d="openid "+d):d="openid";var f=i+"?client_id="+encodeURIComponent(n.clientId)+"&redirect_uri="+encodeURIComponent(s)+"&state="+encodeURIComponent(r)+"&response_mode="+encodeURIComponent(n.responseMode)+"&response_type="+encodeURIComponent(n.responseType)+"&scope="+encodeURIComponent(d);if(l&&(f=f+"&nonce="+encodeURIComponent(a)),e&&e.prompt&&(f+="&prompt="+encodeURIComponent(e.prompt)),e&&e.maxAge&&(f+="&max_age="+encodeURIComponent(e.maxAge)),e&&e.loginHint&&(f+="&login_hint="+encodeURIComponent(e.loginHint)),e&&e.idpHint&&(f+="&kc_idp_hint="+encodeURIComponent(e.idpHint)),e&&e.action&&"register"!=e.action&&(f+="&kc_action="+encodeURIComponent(e.action)),e&&e.locale&&(f+="&ui_locales="+encodeURIComponent(e.locale)),e&&e.acr&&(f+="&claims="+encodeURIComponent(JSON.stringify({id_token:{acr:e.acr}}))),(e&&e.acrValues||n.acrValues)&&(f+="&acr_values="+encodeURIComponent(e.acrValues||n.acrValues)),n.pkceMethod){var h=u(96,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");c.pkceCodeVerifier=h,f+="&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(d7.arrayBuffer(t)))).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}(n.pkceMethod,h)+"&code_challenge_method="+n.pkceMethod}return o.add(c),f},n.logout=function(e){return t.logout(e)},n.createLogoutUrl=function(e){if("POST"===(e?.logoutMethod??n.logoutMethod))return n.endpoints.logout();var o=n.endpoints.logout()+"?client_id="+encodeURIComponent(n.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(t.redirectUri(e,!1));return n.idToken&&(o+="&id_token_hint="+encodeURIComponent(n.idToken)),o},n.register=function(e){return t.register(e)},n.createRegisterUrl=function(e){return e||(e={}),e.action="register",n.createLoginUrl(e)},n.createAccountUrl=function(e){var o=f(),i=void 0;return void 0!==o&&(i=o+"/account?referrer="+encodeURIComponent(n.clientId)+"&referrer_uri="+encodeURIComponent(t.redirectUri(e))),i},n.accountManagement=function(){return t.accountManagement()},n.hasRealmRole=function(e){var t=n.realmAccess;return!!t&&t.roles.indexOf(e)>=0},n.hasResourceRole=function(e,t){if(!n.resourceAccess)return!1;var o=n.resourceAccess[t||n.clientId];return!!o&&o.roles.indexOf(e)>=0},n.loadUserProfile=function(){var e=f()+"/account",t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+n.token);var o=v();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(n.profile=JSON.parse(t.responseText),o.setSuccess(n.profile)):o.setError())},t.send(),o.promise},n.loadUserInfo=function(){var e=n.endpoints.userinfo(),t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+n.token);var o=v();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(n.userInfo=JSON.parse(t.responseText),o.setSuccess(n.userInfo)):o.setError())},t.send(),o.promise},n.isTokenExpired=function(e){if(!n.tokenParsed||!n.refreshToken&&"implicit"!=n.flow)throw"Not authenticated";if(null==n.timeSkew)return c("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var t=n.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+n.timeSkew;if(e){if(isNaN(e))throw"Invalid minValidity";t-=e}return t<0},n.updateToken=function(e){var t=v();if(!n.refreshToken)return t.setError(),t.promise;e=e||5;var o=function(){var o=!1;if(-1==e?(o=!0,c("[KEYCLOAK] Refreshing token: forced refresh")):(!n.tokenParsed||n.isTokenExpired(e))&&(o=!0,c("[KEYCLOAK] Refreshing token: token expired")),o){var r="grant_type=refresh_token&refresh_token="+n.refreshToken,a=n.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(n.clientId);var l=new Date().getTime();s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status){c("[KEYCLOAK] Token refreshed"),l=(l+new Date().getTime())/2;var e=JSON.parse(s.responseText);b(e.access_token,e.refresh_token,e.id_token,l),n.onAuthRefreshSuccess&&n.onAuthRefreshSuccess();for(var t=i.pop();null!=t;t=i.pop())t.setSuccess(!0)}else{d("[KEYCLOAK] Failed to refresh token"),400==s.status&&n.clearToken(),n.onAuthRefreshError&&n.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(){o()}).catch(function(e){t.setError(e)}):o(),t.promise},n.clearToken=function(){n.token&&(b(null,null,null),n.onAuthLogout&&n.onAuthLogout(),n.loginRequired&&n.login())};var k=function(){if(!(this instanceof k))return new k;function e(){for(var e=new Date().getTime(),t=0;t<localStorage.length;t++){var o=localStorage.key(t);if(o&&0==o.indexOf("kc-callback-")){var n=localStorage.getItem(o);if(n)try{var i=JSON.parse(n).expires;(!i||i<e)&&localStorage.removeItem(o)}catch(e){localStorage.removeItem(o)}}}}localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test"),this.get=function(t){if(t){var o="kc-callback-"+t,n=localStorage.getItem(o);return n&&(localStorage.removeItem(o),n=JSON.parse(n)),e(),n}},this.add=function(t){e();var o="kc-callback-"+t.state;t.expires=new Date().getTime()+36e5,localStorage.setItem(o,JSON.stringify(t))}},A=function(){if(!(this instanceof A))return new A;this.get=function(n){if(n){var i=t("kc-callback-"+n);if(o("kc-callback-"+n,"",e(-100)),i)return JSON.parse(i)}},this.add=function(t){o("kc-callback-"+t.state,JSON.stringify(t),e(60))},this.removeItem=function(t){o(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+"=",o=document.cookie.split(";"),n=0;n<o.length;n++){for(var i=o[n];" "==i.charAt(0);)i=i.substring(1);if(0==i.indexOf(t))return i.substring(t.length,i.length)}return""},o=function(e,t,o){var n=e+"="+t+"; expires="+o.toUTCString()+"; ";document.cookie=n}};function x(e){return function(){n.enableLogging&&e.apply(console,Array.prototype.slice.call(arguments))}}}var un=function(e,t,o,n){return new(o||(o=Promise))(function(i,r){function a(e){try{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(a,s)}l((n=n.apply(e,t||[])).next())})};let ui="openremote";(ew=tx||(tx={})).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",(eE=tD||(tD={})).ERROR="ERROR",eE.READY="READY",eE.ONLINE="ONLINE",eE.OFFLINE="OFFLINE",eE.CONNECTING="CONNECTING",eE.CONSOLE_INIT="CONSOLE_INIT",eE.CONSOLE_READY="CONSOLE_READY",eE.TRANSLATE_INIT="TRANSLATE_INIT",eE.TRANSLATE_LANGUAGE_CHANGED="TRANSLATE_LANGUAGE_CHANGED",eE.DISPLAY_REALM_CHANGED="DISPLAY_REALM_CHANGED",eE.LOGIN="LOGIN";let ur={cn:"zh-cn"};class ua{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,o])=>{let n=o.roles;e.set(t,n)}),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 dU}get language(){return nY.language}set language(e){console.debug(`Changing language to ${e}.`),e&&(nY.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(tD.DISPLAY_REALM_CHANGED))}get clientId(){return this._config.clientId||ui}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 un(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=ui),t);let o=yield this.loadManagerInfo(),n=new s0(this._config.realm,this._config.consoleAutoEnable,()=>{this._emitEvent(tD.CONSOLE_READY)});if(this._console=n,"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(/\/+$/,""),o=yield this.doAuthInit()}return!!o&&(o&&(o=this.doRestApiInit()),(yield this.doConsoleInit())&&this._clearWebHistory(),(o=(yield this.doTranslateInit())&&o)&&(o=yield this.doDescriptorsInit(),o=yield this.getConsoleAppConfig()),this.doIconInit(),o?(o=yield this.doEventsSubscriptionInit(),this._ready=!0,this._emitEvent(tD.READY)):(this._config=void 0,console.warn("Failed to initialise the manager")),this.displayRealm=e.realm||"master",o)})}loadManagerInfo(){return un(this,void 0,void 0,function*(){try{let e=yield new Promise((e,t)=>{let o=new XMLHttpRequest;o.addEventListener("load",()=>{e(JSON.parse(o.responseText))}),o.addEventListener("error",()=>{t(Error("Failed to contact the manager"))}),o.open("GET",this._config.managerUrl+"/api/master/info"),o.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(tx.MANAGER_FAILED_TO_LOAD),!1}})}doTranslateInit(){return un(this,void 0,void 0,function*(){if(nY.isInitialized)return!0;nY.on("initialized",e=>{this._emitEvent(tD.TRANSLATE_INIT)}),nY.on("languageChanged",e=>{var t;sG().locale(null!=(t=ur[e])?t:e),this._emitEvent(tD.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,interpolation:{format:(e,t,o)=>"uppercase"===t?e.toUpperCase():e instanceof Date?sG()(e).format(t):e},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 nY.use(d9).init(e)}catch(e){return console.error(e),this._setError(tx.TRANSLATION_ERROR),!1}return!0})}doDescriptorsInit(){return un(this,void 0,void 0,function*(){if(!this.config.loadDescriptors)return!0;try{let e=yield dU.api.AssetModelResource.getAssetInfos(),t=yield dU.api.AssetModelResource.getMetaItemDescriptors(),o=yield dU.api.AssetModelResource.getValueDescriptors();oq._assetTypeInfos=e.data,oq._metaItemDescriptors=Object.values(t.data),oq._valueDescriptors=Object.values(o.data)}catch(e){return console.error(e),!1}return!0})}doAuthInit(){return un(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(tx.AUTH_TYPE_UNSUPPORTED),!1}return!!e&&(dU.addRequestInterceptor(e=>{if(!e.headers.Authorization){let t=this.getAuthorizationHeader();t&&(e.headers.Authorization=t)}return e}),e)})}doRestApiInit(){return dU.setTimeout(2e4),dU.initialise(this.getApiBaseUrl()),!0}doEventsSubscriptionInit(){return un(this,void 0,void 0,function*(){let e=!1;return"WEBSOCKET"===this._config.eventProviderType&&(this._events=new dY(this._config.managerUrl),this._events.subscribeStatusChange(e=>this._onEventProviderStatusChanged(e)),e=yield this._events.connect()),e||this._setError(tx.EVENTS_CONNECTION_ERROR),e})}_connectEvents(){var e;(null==(e=this.events)?void 0:e.status)===tA.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 tA.DISCONNECTED:this._onDisconnect();break;case tA.CONNECTED:break;case tA.CONNECTING:this._emitEvent(tD.CONNECTING)}}doConsoleInit(){return un(this,void 0,void 0,function*(){try{return yield this.console.initialise(),this._emitEvent(tD.CONSOLE_INIT),!0}catch(e){return this._setError(tx.CONSOLE_ERROR),!1}})}doIconInit(){var e;this._config.loadIcons&&(oG.addIconSet("mdi",(e=us.managerUrl,{getIconTemplate:e=>of`<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.eot");\n src: url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.eot") format("embedded-opentype"), url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.woff2") format("woff2"), url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.woff") format("woff"), url("'+e+'/shared/fonts/Material Design Icons//fonts/materialdesignicons-webfont.ttf") format("truetype");\n font-weight: normal;\n font-style: normal;\n}',document.head.appendChild(t)}})),oG.addIconSet("or",{getIconTemplate:e=>{let t=oH[e];return t?of`
|
|
2112
2112
|
<svg
|
|
2113
2113
|
xmlns="http://www.w3.org/2000/svg"
|
|
2114
2114
|
viewBox="0 0 ${24} ${24}"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openremote/or-scheduler",
|
|
3
|
-
"version": "1.30.0
|
|
3
|
+
"version": "1.30.0",
|
|
4
4
|
"description": "OpenRemote scheduler UI component",
|
|
5
5
|
"customElements": "custom-elements.json",
|
|
6
6
|
"main": "dist/umd/index.bundle.js",
|
|
@@ -20,19 +20,19 @@
|
|
|
20
20
|
"license": "AGPL-3.0-or-later",
|
|
21
21
|
"repository": "https://github.com/openremote/openremote",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@openremote/core": "1.30.0
|
|
24
|
-
"@openremote/model": "1.30.0
|
|
25
|
-
"@openremote/or-element": "1.30.0
|
|
26
|
-
"@openremote/or-icon": "1.30.0
|
|
27
|
-
"@openremote/or-translate": "1.30.0
|
|
28
|
-
"@openremote/or-vaadin-components": "1.30.0
|
|
29
|
-
"@openremote/theme": "1.30.0
|
|
23
|
+
"@openremote/core": "1.30.0",
|
|
24
|
+
"@openremote/model": "1.30.0",
|
|
25
|
+
"@openremote/or-element": "1.30.0",
|
|
26
|
+
"@openremote/or-icon": "1.30.0",
|
|
27
|
+
"@openremote/or-translate": "1.30.0",
|
|
28
|
+
"@openremote/or-vaadin-components": "1.30.0",
|
|
29
|
+
"@openremote/theme": "1.30.0",
|
|
30
30
|
"lit": "^3.3.1",
|
|
31
31
|
"moment": "^2.29.4",
|
|
32
32
|
"rrule": "^2.6.4"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@openremote/util": "1.30.0
|
|
35
|
+
"@openremote/util": "1.30.0"
|
|
36
36
|
},
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|