@openremote/or-survey-results 1.3.0 → 1.3.2
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.
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
|
|
178
178
|
|
|
179
179
|
</style>
|
|
180
|
-
`;function be(e){return be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},be(e)}function he(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pe(e){var t=function(e,t){if("object"!=be(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!=be(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==be(t)?t:String(t)}function Fe(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,pe(o.key),o)}}function _e(e,t,n){return t&&Fe(e.prototype,t),n&&Fe(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ge(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ye(e,t){return ye=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ye(e,t)}function ve(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ye(e,t)}function ke(e,t){if(t&&("object"===be(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ge(e)}function we(e){return we=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},we(e)}function Me(e,t,n){return(t=pe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Le(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function De(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Ee(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?De(Object(n),!0).forEach((function(t){Me(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):De(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}r(2960);var Ae={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},Te=new(function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};he(this,e),this.init(t,n)}return _e(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||Ae,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,o){return o&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,Ee(Ee({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}},{key:"clone",value:function(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)}}]),e}()),Ye=function(){function e(){he(this,e),this.observers={}}return _e(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];this.observers[e]&&[].concat(this.observers[e]).forEach((function(e){e.apply(void 0,n)})),this.observers["*"]&&[].concat(this.observers["*"]).forEach((function(t){t.apply(t,[e].concat(n))}))}}]),e}();function Ce(){var e,t,n=new Promise((function(n,o){e=n,t=o}));return n.resolve=e,n.reject=t,n}function Se(e){return null==e?"":""+e}function xe(e,t,n){function o(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function r(){return!e||"string"==typeof e}for(var i="string"!=typeof t?[].concat(t):t.split(".");i.length>1;){if(r())return{};var a=o(i.shift());!e[a]&&n&&(e[a]=new n),e=Object.prototype.hasOwnProperty.call(e,a)?e[a]:{}}return r()?{}:{obj:e,k:o(i.shift())}}function Oe(e,t,n){var o=xe(e,t,Object);o.obj[o.k]=n}function Be(e,t){var n=xe(e,t),o=n.obj,r=n.k;if(o)return o[r]}function Re(e,t,n){var o=Be(e,n);return void 0!==o?o:Be(t,n)}function Pe(e,t,n){for(var o in t)"__proto__"!==o&&"constructor"!==o&&(o in e?"string"==typeof e[o]||e[o]instanceof String||"string"==typeof t[o]||t[o]instanceof String?n&&(e[o]=t[o]):Pe(e[o],t[o],n):e[o]=t[o]);return e}function je(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Ie={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function Ne(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return Ie[e]})):e}var He="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Ue=[" ",",","?","!",";"];function We(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function ze(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?We(Object(n),!0).forEach((function(t){Me(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):We(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ge(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var o=t.split(n),r=e,i=0;i<o.length;++i){if(!r)return;if("string"==typeof r[o[i]]&&i+1<o.length)return;if(void 0===r[o[i]]){for(var a=2,s=o.slice(i,i+a).join(n),c=r[s];void 0===c&&o.length>i+a;)a++,c=r[s=o.slice(i,i+a).join(n)];if(void 0===c)return;if(null===c)return null;if(t.endsWith(s)){if("string"==typeof c)return c;if(s&&"string"==typeof c[s])return c[s]}var d=o.slice(i+a).join(n);return d?Ge(c,d,n):void 0}r=r[o[i]]}return r}}var qe=function(e){ve(r,e);var t,n,o=(t=r,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,o=we(t);if(n){var r=we(this).constructor;e=Reflect.construct(o,arguments,r)}else e=o.apply(this,arguments);return ke(this,e)});function r(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return he(this,r),t=o.call(this),He&&Ye.call(ge(t)),t.data=e||{},t.options=n,void 0===t.options.keySeparator&&(t.options.keySeparator="."),void 0===t.options.ignoreJSONStructure&&(t.options.ignoreJSONStructure=!0),t}return _e(r,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,i=void 0!==o.ignoreJSONStructure?o.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[e,t];n&&"string"!=typeof n&&(a=a.concat(n)),n&&"string"==typeof n&&(a=a.concat(r?n.split(r):n)),e.indexOf(".")>-1&&(a=e.split("."));var s=Be(this.data,a);return s||!i||"string"!=typeof n?s:Ge(this.data&&this.data[e]&&this.data[e][t],n,r)}},{key:"addResource",value:function(e,t,n,o){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=this.options.keySeparator;void 0===i&&(i=".");var a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(o=t,t=(a=e.split("."))[1]),this.addNamespaces(t),Oe(this.data,a,o),r.silent||this.emit("added",e,t,n,o)}},{key:"addResources",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var r in n)"string"!=typeof n[r]&&"[object Array]"!==Object.prototype.toString.apply(n[r])||this.addResource(e,t,r,n[r],{silent:!0});o.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,o,r){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(o=n,n=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var s=Be(this.data,a)||{};o?Pe(s,n,r):s=ze(ze({},s),n),Oe(this.data,a,s),i.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?ze(ze({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),r}(Ye),$e={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,o,r){var i=this;return e.forEach((function(e){i.processors[e]&&(t=i.processors[e].process(t,n,o,r))})),t}};function Ve(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Je(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ve(Object(n),!0).forEach((function(t){Me(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ve(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ke={},Xe=function(e){ve(r,e);var t,n,o=(t=r,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,o=we(t);if(n){var r=we(this).constructor;e=Reflect.construct(o,arguments,r)}else e=o.apply(this,arguments);return ke(this,e)});function r(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return he(this,r),t=o.call(this),He&&Ye.call(ge(t)),function(e,t,n){["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach((function(e){t[e]&&(n[e]=t[e])}))}(0,e,ge(t)),t.options=n,void 0===t.options.keySeparator&&(t.options.keySeparator="."),t.logger=Te.create("translator"),t}return _e(r,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,r=t.ns||this.options.defaultNS||[],i=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";var o=Ue.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===o.length)return!0;var r=new RegExp("(".concat(o.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),i=!r.test(e);if(!i){var a=e.indexOf(n);a>0&&!r.test(e.substring(0,a))&&(i=!0)}return i}(e,n,o));if(i&&!a){var s=e.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:e,namespaces:r};var c=e.split(n);(n!==o||n===o&&this.options.ns.indexOf(c[0])>-1)&&(r=c.shift()),e=c.join(o)}return"string"==typeof r&&(r=[r]),{key:e,namespaces:r}}},{key:"translate",value:function(e,t,n){var o=this;if("object"!==be(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var i=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,a=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,s=this.extractFromKey(e[e.length-1],t),c=s.key,d=s.namespaces,l=d[d.length-1],u=t.lng||this.language,m=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&"cimode"===u.toLowerCase()){if(m){var f=t.nsSeparator||this.options.nsSeparator;return i?(b.res="".concat(l).concat(f).concat(c),b):"".concat(l).concat(f).concat(c)}return i?(b.res=c,b):c}var b=this.resolve(e,t),h=b&&b.res,p=b&&b.usedKey||c,F=b&&b.exactUsedKey||c,_=Object.prototype.toString.apply(h),g=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject;if(y&&h&&"string"!=typeof h&&"boolean"!=typeof h&&"number"!=typeof h&&["[object Number]","[object Function]","[object RegExp]"].indexOf(_)<0&&("string"!=typeof g||"[object Array]"!==_)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var v=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,h,Je(Je({},t),{},{ns:d})):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");return i?(b.res=v,b):v}if(a){var k="[object Array]"===_,w=k?[]:{},M=k?F:p;for(var L in h)if(Object.prototype.hasOwnProperty.call(h,L)){var D="".concat(M).concat(a).concat(L);w[L]=this.translate(D,Je(Je({},t),{joinArrays:!1,ns:d})),w[L]===D&&(w[L]=h[L])}h=w}}else if(y&&"string"==typeof g&&"[object Array]"===_)(h=h.join(g))&&(h=this.extendTranslation(h,e,t,n));else{var E=!1,A=!1,T=void 0!==t.count&&"string"!=typeof t.count,Y=r.hasDefaultValue(t),C=T?this.pluralResolver.getSuffix(u,t.count,t):"",S=t["defaultValue".concat(C)]||t.defaultValue;!this.isValidLookup(h)&&Y&&(E=!0,h=S),this.isValidLookup(h)||(A=!0,h=c);var x=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&A?void 0:h,O=Y&&S!==h&&this.options.updateMissing;if(A||E||O){if(this.logger.log(O?"updateKey":"missingKey",u,l,c,O?S:h),a){var B=this.resolve(c,Je(Je({},t),{},{keySeparator:!1}));B&&B.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var R=[],P=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&P&&P[0])for(var j=0;j<P.length;j++)R.push(P[j]);else"all"===this.options.saveMissingTo?R=this.languageUtils.toResolveHierarchy(t.lng||this.language):R.push(t.lng||this.language);var I=function(e,n,r){var i=Y&&r!==h?r:x;o.options.missingKeyHandler?o.options.missingKeyHandler(e,l,n,i,O,t):o.backendConnector&&o.backendConnector.saveMissing&&o.backendConnector.saveMissing(e,l,n,i,O,t),o.emit("missingKey",e,l,n,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&T?R.forEach((function(e){o.pluralResolver.getSuffixes(e,t).forEach((function(n){I([e],c+n,t["defaultValue".concat(n)]||S)}))})):I(R,c,S))}h=this.extendTranslation(h,e,t,b,n),A&&h===c&&this.options.appendNamespaceToMissingKey&&(h="".concat(l,":").concat(c)),(A||E)&&this.options.parseMissingKeyHandler&&(h="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(l,":").concat(c):c,E?h:void 0):this.options.parseMissingKeyHandler(h))}return i?(b.res=h,b):h}},{key:"extendTranslation",value:function(e,t,n,o,r){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,Je(Je({},this.options.interpolation.defaultVariables),n),o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(Je(Je({},n),{interpolation:Je(Je({},this.options.interpolation),n.interpolation)}));var a,s="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(s){var c=e.match(this.interpolator.nestingRegexp);a=c&&c.length}var d=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(d=Je(Je({},this.options.interpolation.defaultVariables),d)),e=this.interpolator.interpolate(e,d,n.lng||this.language,n),s){var l=e.match(this.interpolator.nestingRegexp);a<(l&&l.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,o=new Array(e),a=0;a<e;a++)o[a]=arguments[a];return r&&r[0]===o[0]&&!n.context?(i.logger.warn("It seems you are nesting recursively key: ".concat(o[0]," in key: ").concat(t[0])),null):i.translate.apply(i,o.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var u=n.postProcess||this.options.postProcess,m="string"==typeof u?[u]:u;return null!=e&&m&&m.length&&!1!==n.applyPostProcessor&&(e=$e.handle(m,e,t,this.options&&this.options.postProcessPassResolved?Je({i18nResolved:o},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,o,r,i,a=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!a.isValidLookup(t)){var c=a.extractFromKey(e,s),d=c.key;n=d;var l=c.namespaces;a.options.fallbackNS&&(l=l.concat(a.options.fallbackNS));var u=void 0!==s.count&&"string"!=typeof s.count,m=u&&!s.ordinal&&0===s.count&&a.pluralResolver.shouldUseIntlApi(),f=void 0!==s.context&&("string"==typeof s.context||"number"==typeof s.context)&&""!==s.context,b=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);l.forEach((function(e){a.isValidLookup(t)||(i=e,!Ke["".concat(b[0],"-").concat(e)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(i)&&(Ke["".concat(b[0],"-").concat(e)]=!0,a.logger.warn('key "'.concat(n,'" for languages "').concat(b.join(", "),'" won\'t get resolved as namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),b.forEach((function(n){if(!a.isValidLookup(t)){r=n;var i,c=[d];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(c,d,n,e,s);else{var l;u&&(l=a.pluralResolver.getSuffix(n,s.count,s));var b="".concat(a.options.pluralSeparator,"zero");if(u&&(c.push(d+l),m&&c.push(d+b)),f){var h="".concat(d).concat(a.options.contextSeparator).concat(s.context);c.push(h),u&&(c.push(h+l),m&&c.push(h+b))}}for(;i=c.pop();)a.isValidLookup(t)||(o=i,t=a.getResource(n,e,i,s))}})))}))}})),{res:t,usedKey:n,exactUsedKey:o,usedLng:r,usedNS:i}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,o):this.resourceStore.getResource(e,t,n,o)}}],[{key:"hasDefaultValue",value:function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"defaultValue"===t.substring(0,12)&&void 0!==e[t])return!0;return!1}}]),r}(Ye);function Ze(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Qe=function(){function e(t){he(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Te.create("languageUtils")}return _e(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Ze(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Ze(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=Ze(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var o=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(o)||(t=o)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var o=n.getLanguagePartFromCode(e);if(n.isSupportedCode(o))return t=o;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(o))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,o=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],i=function(e){e&&(n.isSupportedCode(e)?r.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):"string"==typeof e&&i(this.formatLanguageCode(e)),o.forEach((function(e){r.indexOf(e)<0&&i(n.formatLanguageCode(e))})),r}}]),e}(),et=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],tt={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},nt=["v1","v2","v3"],ot={zero:0,one:1,two:2,few:3,many:4,other:5},rt=function(){function e(t){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};he(this,e),this.languageUtils=t,this.options=o,this.logger=Te.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(n={},et.forEach((function(e){e.lngs.forEach((function(t){n[t]={numbers:e.nr,plurals:tt[e.fc]}}))})),n)}return _e(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.getRule(e,n);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort((function(e,t){return ot[e]-ot[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):o.numbers.map((function(o){return t.getSuffix(e,o,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=this.getRule(e,n);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(t)):this.getSuffixRetroCompatible(o,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,o=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),r=e.numbers[o];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===r?r="plural":1===r&&(r=""));var i=function(){return n.options.prepend&&r.toString()?n.options.prepend+r.toString():r.toString()};return"v1"===this.options.compatibilityJSON?1===r?"":"number"==typeof r?"_plural_".concat(r.toString()):i():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?i():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!nt.includes(this.options.compatibilityJSON)}}]),e}();function it(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function at(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?it(Object(n),!0).forEach((function(t){Me(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):it(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var st=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};he(this,e),this.logger=Te.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return _e(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:Ne,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?je(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?je(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?je(t.nestingPrefix):t.nestingPrefixEscaped||je("$t("),this.nestingSuffix=t.nestingSuffix?je(t.nestingSuffix):t.nestingSuffixEscaped||je(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,o){var r,i,a,s=this,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function d(e){return e.replace(/\$/g,"$$$$")}var l=function(e){if(e.indexOf(s.formatSeparator)<0){var r=Re(t,c,e);return s.alwaysFormat?s.format(r,void 0,n,at(at(at({},o),t),{},{interpolationkey:e})):r}var i=e.split(s.formatSeparator),a=i.shift().trim(),d=i.join(s.formatSeparator).trim();return s.format(Re(t,c,a),d,n,at(at(at({},o),t),{},{interpolationkey:a}))};this.resetRegExp();var u=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,m=o&&o.interpolation&&void 0!==o.interpolation.skipOnVariables?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return d(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?d(s.escape(e)):d(e)}}].forEach((function(t){for(a=0;r=t.regex.exec(e);){var n=r[1].trim();if(void 0===(i=l(n)))if("function"==typeof u){var c=u(e,r,o);i="string"==typeof c?c:""}else if(o&&o.hasOwnProperty(n))i="";else{if(m){i=r[0];continue}s.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),i=""}else"string"==typeof i||s.useRawValueToEscape||(i=Se(i));var d=t.safeValue(i);if(e=e.replace(r[0],d),m?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=r[0].length):t.regex.lastIndex=0,++a>=s.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,o,r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=at({},i);function s(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var o=e.split(new RegExp("".concat(n,"[ ]*{"))),r="{".concat(o[1]);e=o[0];var i=(r=this.interpolate(r,a)).match(/'/g),s=r.match(/"/g);(i&&i.length%2==0&&!s||s.length%2!=0)&&(r=r.replace(/'/g,'"'));try{a=JSON.parse(r),t&&(a=at(at({},t),a))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(r)}return delete a.defaultValue,e}for(a.applyPostProcessor=!1,delete a.defaultValue;n=this.nestingRegexp.exec(e);){var c=[],d=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var l=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=l.shift(),c=l,d=!0}if((o=t(s.call(this,n[1].trim(),a),a))&&n[0]===e&&"string"!=typeof o)return o;"string"!=typeof o&&(o=Se(o)),o||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),o=""),d&&(o=c.reduce((function(e,t){return r.format(e,t,i.lng,at(at({},i),{},{interpolationkey:n[1].trim()}))}),o.trim())),e=e.replace(n[0],o),this.regexp.lastIndex=0}return e}}]),e}();function ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function dt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ct(Object(n),!0).forEach((function(t){Me(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ct(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function lt(e){var t={};return function(n,o,r){var i=o+JSON.stringify(r),a=t[i];return a||(a=e(o,r),t[i]=a),a(n)}}var ut=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};he(this,e),this.logger=Te.create("formatter"),this.options=t,this.formats={number:lt((function(e,t){var n=new Intl.NumberFormat(e,t);return function(e){return n.format(e)}})),currency:lt((function(e,t){var n=new Intl.NumberFormat(e,dt(dt({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:lt((function(e,t){var n=new Intl.DateTimeFormat(e,dt({},t));return function(e){return n.format(e)}})),relativetime:lt((function(e,t){var n=new Intl.RelativeTimeFormat(e,dt({},t));return function(e){return n.format(e,t.range||"day")}})),list:lt((function(e,t){var n=new Intl.ListFormat(e,dt({},t));return function(e){return n.format(e)}}))},this.init(t)}return _e(e,[{key:"init",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=lt(t)}},{key:"format",value:function(e,t,n,o){var r=this,i=t.split(this.formatSeparator).reduce((function(e,t){var i=function(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var o=e.split("(");t=o[0].toLowerCase().trim();var r=o[1].substring(0,o[1].length-1);"currency"===t&&r.indexOf(":")<0?n.currency||(n.currency=r.trim()):"relativetime"===t&&r.indexOf(":")<0?n.range||(n.range=r.trim()):r.split(";").forEach((function(e){if(e){var t=function(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Le(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Le(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e.split(":")),o=t[0],r=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[o.trim()]||(n[o.trim()]=r),"false"===r&&(n[o.trim()]=!1),"true"===r&&(n[o.trim()]=!0),isNaN(r)||(n[o.trim()]=parseInt(r,10))}}))}return{formatName:t,formatOptions:n}}(t),a=i.formatName,s=i.formatOptions;if(r.formats[a]){var c=e;try{var d=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},l=d.locale||d.lng||o.locale||o.lng||n;c=r.formats[a](e,l,dt(dt(dt({},s),o),d))}catch(e){r.logger.warn(e)}return c}return r.logger.warn("there was no format function for ".concat(a)),e}),e);return i}}]),e}();function mt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function ft(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mt(Object(n),!0).forEach((function(t){Me(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var bt=function(e){ve(r,e);var t,n,o=(t=r,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,o=we(t);if(n){var r=we(this).constructor;e=Reflect.construct(o,arguments,r)}else e=o.apply(this,arguments);return ke(this,e)});function r(e,t,n){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return he(this,r),i=o.call(this),He&&Ye.call(ge(i)),i.backend=e,i.store=t,i.services=n,i.languageUtils=n.languageUtils,i.options=a,i.logger=Te.create("backendConnector"),i.waitingReads=[],i.maxParallelReads=a.maxParallelReads||10,i.readingCalls=0,i.maxRetries=a.maxRetries>=0?a.maxRetries:5,i.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(n,a.backend,a),i}return _e(r,[{key:"queueLoad",value:function(e,t,n,o){var r=this,i={},a={},s={},c={};return e.forEach((function(e){var o=!0;t.forEach((function(t){var s="".concat(e,"|").concat(t);!n.reload&&r.store.hasResourceBundle(e,t)?r.state[s]=2:r.state[s]<0||(1===r.state[s]?void 0===a[s]&&(a[s]=!0):(r.state[s]=1,o=!1,void 0===a[s]&&(a[s]=!0),void 0===i[s]&&(i[s]=!0),void 0===c[t]&&(c[t]=!0)))})),o||(s[e]=!0)})),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(c)}}},{key:"loaded",value:function(e,t,n){var o=e.split("|"),r=o[0],i=o[1];t&&this.emit("failedLoading",r,i,t),n&&this.store.addResourceBundle(r,i,n),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(n){!function(e,t,n,o){var r=xe(e,t,Object),i=r.obj,a=r.k;i[a]=i[a]||[],i[a].push(n)}(n.loaded,[r],i),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(e){a[e]||(a[e]={});var t=n.loaded[e];t.length&&t.forEach((function(t){void 0===a[e][t]&&(a[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var o=this,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;return e.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a}):(this.readingCalls++,this.backend[n](e,t,(function(s,c){if(o.readingCalls--,o.waitingReads.length>0){var d=o.waitingReads.shift();o.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}s&&c&&r<o.maxRetries?setTimeout((function(){o.read.call(o,e,t,n,r+1,2*i,a)}),i):a(s,c)}))):a(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var i=this.queueLoad(e,t,o,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=e.split("|"),r=o[0],i=o[1];this.read(r,i,"read",void 0,void 0,(function(o,a){o&&t.logger.warn("".concat(n,"loading namespace ").concat(i," for language ").concat(r," failed"),o),!o&&a&&t.logger.log("".concat(n,"loaded namespace ").concat(i," for language ").concat(r),a),t.loaded(e,o,a)}))}},{key:"saveMissing",value:function(e,t,n,o,r){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,o,null,ft(ft({},i),{},{isUpdate:r})),e&&e[0]&&this.store.addResource(e[0],t,n,o))}}]),r}(Ye);function ht(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function pt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Ft(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pt(Object(n),!0).forEach((function(t){Me(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _t(){}var gt=function(e){ve(r,e);var t,n,o=(t=r,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,o=we(t);if(n){var r=we(this).constructor;e=Reflect.construct(o,arguments,r)}else e=o.apply(this,arguments);return ke(this,e)});function r(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(he(this,r),e=o.call(this),He&&Ye.call(ge(e)),e.options=ht(n),e.services={},e.logger=Te,e.modules={external:[]},t=ge(e),Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach((function(e){"function"==typeof t[e]&&(t[e]=t[e].bind(t))})),i&&!e.isInitialized&&!n.isClone){if(!e.options.initImmediate)return e.init(n,i),ke(e,ge(e));setTimeout((function(){e.init(n,i)}),0)}return e}return _e(r,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var o={debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===be(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===be(e[2])||"object"===be(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,o){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}};function r(e){return e?"function"==typeof e?new e:e:null}if(this.options=Ft(Ft(Ft({},o),this.options),ht(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=Ft(Ft({},o.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var i;this.modules.logger?Te.init(r(this.modules.logger),this.options):Te.init(null,this.options),this.modules.formatter?i=this.modules.formatter:"undefined"!=typeof Intl&&(i=ut);var a=new Qe(this.options);this.store=new qe(this.options.resources,this.options);var s=this.services;s.logger=Te,s.resourceStore=this.store,s.languageUtils=a,s.pluralResolver=new rt(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!i||this.options.interpolation.format&&this.options.interpolation.format!==o.interpolation.format||(s.formatter=r(i),s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new st(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new bt(r(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];e.emit.apply(e,[t].concat(o))})),this.modules.languageDetector&&(s.languageDetector=r(this.modules.languageDetector),s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=r(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new Xe(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];e.emit.apply(e,[t].concat(o))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.format=this.options.interpolation.format,n||(n=_t),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&"dev"!==c[0]&&(this.options.lng=c[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var d=Ce(),l=function(){var t=function(t,o){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),d.resolve(o),n(t,o)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?l():setTimeout(l,0),d}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_t,o="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(o&&"cimode"===o.toLowerCase())return n();var r=[],i=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){r.indexOf(e)<0&&r.push(e)}))};o?i(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((function(e){return i(e)})),this.options.preload&&this.options.preload.forEach((function(e){return i(e)})),this.services.backendConnector.load(r,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),n(e)}))}else n(null)}},{key:"reloadResources",value:function(e,t,n){var o=Ce();return e||(e=this.languages),t||(t=this.options.ns),n||(n=_t),this.services.backendConnector.reload(e,t,(function(e){o.resolve(),n(e)})),o}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&$e.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var o=Ce();this.emit("languageChanging",e);var r=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},i=function(i){e||i||!n.services.languageDetector||(i=[]);var a="string"==typeof i?i:n.services.languageUtils.getBestMatchFromCodes(i);a&&(n.language||r(a),n.translator.language||n.translator.changeLanguage(a),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(a)),n.loadResources(a,(function(e){!function(e,i){i?(r(i),n.translator.changeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languageChanged",i),n.logger.log("languageChanged",i)):n.isLanguageChangingTo=void 0,o.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,a)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),o}},{key:"getFixedT",value:function(e,t,n){var o=this,r=function e(t,r){var i;if("object"!==be(r)){for(var a=arguments.length,s=new Array(a>2?a-2:0),c=2;c<a;c++)s[c-2]=arguments[c];i=o.options.overloadTranslationOptionHandler([t,r].concat(s))}else i=Ft({},r);i.lng=i.lng||e.lng,i.lngs=i.lngs||e.lngs,i.ns=i.ns||e.ns,i.keyPrefix=i.keyPrefix||n||e.keyPrefix;var d=o.options.keySeparator||".",l=i.keyPrefix?"".concat(i.keyPrefix).concat(d).concat(t):t;return o.t(l,i)};return"string"==typeof e?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var o=this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===o.toLowerCase())return!0;var a=function(e,n){var o=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===o||2===o};if(n.precheck){var s=n.precheck(this,a);if(void 0!==s)return s}return!(!this.hasResourceBundle(o,e)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!a(o,e)||r&&!a(i,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,o=Ce();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){o.resolve(),t&&t(e)})),o):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=Ce();"string"==typeof e&&(e=[e]);var o=this.options.preload||[],r=e.filter((function(e){return o.indexOf(e)<0}));return r.length?(this.options.preload=o.concat(r),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){return e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),e?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr":"rtl"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_t,o=Ft(Ft(Ft({},this.options),t),{isClone:!0}),i=new r(o);return void 0===t.debug&&void 0===t.prefix||(i.logger=i.logger.clone(t)),["store","services","language"].forEach((function(t){i[t]=e[t]})),i.services=Ft({},this.services),i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i.translator=new Xe(i.services,i.options),i.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];i.emit.apply(i,[e].concat(n))})),i.init(o,n),i.translator.options=i.options,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),r}(Ye);Me(gt,"createInstance",(function(){return new gt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}));var yt=gt.createInstance();yt.createInstance=gt.createInstance,yt.createInstance,yt.init,yt.loadResources,yt.reloadResources,yt.use,yt.changeLanguage,yt.getFixedT,yt.t,yt.exists,yt.setDefaultNamespace,yt.hasLoadedNamespace,yt.loadNamespaces,yt.loadLanguages;const vt=yt;var kt,wt,Mt,Lt,Dt,Et,At,Tt,Yt,Ct,St,xt,Ot,Bt,Rt,Pt,jt,It,Nt,Ht,Ut,Wt,zt,Gt,qt,$t,Vt,Jt,Kt,Xt,Zt,Qt,en,tn,nn,on,rn,an,sn,cn,dn,ln,un,mn,fn,bn,hn,pn,Fn,_n,gn,yn,vn,kn,wn,Mn,Ln,Dn,En,An,Tn,Yn,Cn,Sn=r(6960),xn=r.n(Sn);!function(e){e.CREATE="CREATE",e.UPDATE="UPDATE",e.DELETE="DELETE"}(kt||(kt={})),function(e){e.LOW="LOW",e.MEDIUM="MEDIUM",e.HIGH="HIGH"}(wt||(wt={})),function(e){e.MANUAL="MANUAL",e.CLIENT="CLIENT",e.GLOBAL_RULESET="GLOBAL_RULESET",e.REALM_RULESET="REALM_RULESET",e.ASSET_RULESET="ASSET_RULESET",e.AGENT="AGENT"}(Mt||(Mt={})),function(e){e.OPEN="OPEN",e.ACKNOWLEDGED="ACKNOWLEDGED",e.IN_PROGRESS="IN_PROGRESS",e.RESOLVED="RESOLVED",e.CLOSED="CLOSED"}(Lt||(Lt={})),function(e){e.BOTTOM_LEFT="BOTTOM_LEFT",e.BOTTOM_RIGHT="BOTTOM_RIGHT",e.TOP_LEFT="TOP_LEFT",e.TOP_RIGHT="TOP_RIGHT"}(Dt||(Dt={})),function(e){e.CREATE="CREATE",e.READ="READ",e.UPDATE="UPDATE",e.DELETE="DELETE"}(Et||(Et={})),function(e){e.NONE="NONE",e.FORECAST="FORECAST",e.SETPOINT="SETPOINT"}(At||(At={})),function(e){e.DISCONNECTED="DISCONNECTED",e.CONNECTING="CONNECTING",e.DISCONNECTING="DISCONNECTING",e.CONNECTED="CONNECTED",e.DISABLED="DISABLED",e.WAITING="WAITING",e.ERROR="ERROR",e.STOPPED="STOPPED"}(Tt||(Tt={})),function(e){e.EV="EV",e.PHEV="PHEV"}(Yt||(Yt={})),function(e){e.YAZAKI="YAZAKI",e.MENNEKES="MENNEKES",e.LE_GRAND="LE_GRAND",e.CHADEMO="CHADEMO",e.COMBO="COMBO",e.SCHUKO="SCHUKO",e.ENERGYLOCK="ENERGYLOCK"}(Ct||(Ct={})),function(e){e.SOUTH="SOUTH",e.EAST_WEST="EAST_WEST"}(St||(St={})),function(e){e.REQUEST_START="REQUEST_START",e.REQUEST_REPEATING="REQUEST_REPEATING",e.REQUEST_CANCEL="REQUEST_CANCEL",e.READY="READY",e.COMPLETED="COMPLETED",e.RUNNING="RUNNING",e.CANCELLED="CANCELLED"}(xt||(xt={})),function(e){e.TOGGLE="TOGGLE",e.INCREMENT="INCREMENT",e.DECREMENT="DECREMENT",e.NEGATE="NEGATE"}(Ot||(Ot={})),function(e){e.ASSET_NOT_FOUND="ASSET_NOT_FOUND",e.ATTRIBUTE_NOT_FOUND="ATTRIBUTE_NOT_FOUND",e.INSUFFICIENT_ACCESS="INSUFFICIENT_ACCESS",e.INVALID_VALUE="INVALID_VALUE",e.INTERCEPTOR_FAILURE="INTERCEPTOR_FAILURE",e.STATE_STORAGE_FAILED="STATE_STORAGE_FAILED",e.CANNOT_PROCESS="CANNOT_PROCESS",e.QUEUE_FULL="QUEUE_FULL",e.UNKNOWN="UNKNOWN",e.ASSET_ID_MISSING="ASSET_ID_MISSING",e.ATTRIBUTE_NAME_MISSING="ATTRIBUTE_NAME_MISSING"}(Bt||(Bt={})),function(e){e.PUBLIC="PUBLIC",e.SHARED="SHARED",e.PRIVATE="PRIVATE"}(Rt||(Rt={})),function(e){e.OFF="OFF",e.ONE_MIN="ONE_MIN",e.FIVE_MIN="FIVE_MIN",e.QUARTER="QUARTER",e.ONE_HOUR="ONE_HOUR"}(Pt||(Pt={})),function(e){e.WRAP_TO_SINGLE_COLUMN="WRAP_TO_SINGLE_COLUMN",e.KEEP_LAYOUT="KEEP_LAYOUT",e.REDIRECT="REDIRECT",e.BLOCK_DEVICE="BLOCK_DEVICE"}(jt||(jt={})),function(e){e.MINUTE="MINUTE",e.HOUR="HOUR",e.DAY="DAY",e.WEEK="WEEK",e.MONTH="MONTH",e.YEAR="YEAR"}(It||(It={})),function(e){e.MIN="MIN",e.AVG="AVG",e.MAX="MAX"}(Nt||(Nt={})),function(e){e.TERMINATING="TERMINATING",e.DISABLED="DISABLED",e.ALREADY_CONNECTED="ALREADY_CONNECTED",e.UNRECOGNISED="UNRECOGNISED",e.PERMANENT_ERROR="PERMANENT_ERROR",e.SYNC_ERROR="SYNC_ERROR"}(Ht||(Ht={})),function(e){e.HTTPS="HTTPS",e.HTTP="HTTP",e.TCP="TCP"}(Ut||(Ut={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.OPTIONS="OPTIONS",e.PATCH="PATCH"}(Wt||(Wt={})),function(e){e.KEYCLOAK="KEYCLOAK",e.BASIC="BASIC",e.NONE="NONE"}(zt||(zt={})),function(e){e.WEBSOCKET="WEBSOCKET",e.POLLING="POLLING"}(Gt||(Gt={})),function(e){e.VECTOR="VECTOR",e.RASTER="RASTER"}(qt||(qt={})),function(e){e.INTERNAL="INTERNAL",e.CLIENT="CLIENT",e.GLOBAL_RULESET="GLOBAL_RULESET",e.REALM_RULESET="REALM_RULESET",e.ASSET_RULESET="ASSET_RULESET"}($t||($t={})),function(e){e.REALM="REALM",e.USER="USER",e.ASSET="ASSET",e.CUSTOM="CUSTOM"}(Vt||(Vt={})),function(e){e.NORMAL="NORMAL",e.HIGH="HIGH"}(Jt||(Jt={})),function(e){e.DEVICE="DEVICE",e.TOPIC="TOPIC",e.CONDITION="CONDITION"}(Kt||(Kt={})),function(e){e.ALWAYS="ALWAYS",e.ONCE="ONCE",e.HOURLY="HOURLY",e.DAILY="DAILY",e.WEEKLY="WEEKLY",e.MONTHLY="MONTHLY",e.ANNUALLY="ANNUALLY"}(Xt||(Xt={})),function(e){e.MESSAGE_INVALID="MESSAGE_INVALID",e.CERTIFICATE_INVALID="CERTIFICATE_INVALID",e.UNAUTHORIZED="UNAUTHORIZED",e.FORBIDDEN="FORBIDDEN",e.UNIQUE_ID_MISMATCH="UNIQUE_ID_MISMATCH",e.CONFIG_DISABLED="CONFIG_DISABLED",e.USER_DISABLED="USER_DISABLED",e.SERVER_ERROR="SERVER_ERROR",e.ASSET_ERROR="ASSET_ERROR",e.SERVER_BUSY="SERVER_BUSY"}(Zt||(Zt={})),function(e){e.PRIVATE="PRIVATE",e.PROTECTED="PROTECTED",e.PUBLIC="PUBLIC"}(Qt||(Qt={})),function(e){e.EXACT="EXACT",e.BEGIN="BEGIN",e.END="END",e.CONTAINS="CONTAINS"}(en||(en={})),function(e){e.EQUALS="EQUALS",e.GREATER_THAN="GREATER_THAN",e.GREATER_EQUALS="GREATER_EQUALS",e.LESS_THAN="LESS_THAN",e.LESS_EQUALS="LESS_EQUALS",e.BETWEEN="BETWEEN"}(tn||(tn={})),function(e){e.CREATED_ON="CREATED_ON",e.NAME="NAME",e.ASSET_TYPE="ASSET_TYPE",e.PARENT_ID="PARENT_ID",e.REALM="REALM"}(nn||(nn={})),function(e){e.RESTRICTED="RESTRICTED",e.LINKED="LINKED",e.REALM="REALM"}(on||(on={})),function(e){e.AT_LEAST_ONE="AT_LEAST_ONE",e.ALL="ALL",e.NONE="NONE"}(rn||(rn={})),function(e){e.AND="AND",e.OR="OR"}(an||(an={})),function(e){e.CREATED_ON="CREATED_ON",e.FIRST_NAME="FIRST_NAME",e.LAST_NAME="LAST_NAME",e.USERNAME="USERNAME",e.EMAIL="EMAIL"}(sn||(sn={})),function(e){e.STOPPED="STOPPED",e.RUNNING="RUNNING",e.ERROR="ERROR"}(cn||(cn={})),function(e){e.JAVASCRIPT="JAVASCRIPT",e.GROOVY="GROOVY",e.JSON="JSON",e.FLOW="FLOW"}(dn||(dn={})),function(e){e.READY="READY",e.DEPLOYED="DEPLOYED",e.COMPILATION_ERROR="COMPILATION_ERROR",e.VALIDITY_PERIOD_ERROR="VALIDITY_PERIOD_ERROR",e.EXECUTION_ERROR="EXECUTION_ERROR",e.LOOP_ERROR="LOOP_ERROR",e.DISABLED="DISABLED",e.PAUSED="PAUSED",e.EXPIRED="EXPIRED",e.REMOVED="REMOVED",e.EMPTY="EMPTY"}(ln||(ln={})),function(e){e.SUNRISE="SUNRISE",e.SUNSET="SUNSET",e.TWILIGHT_MORNING_VISUAL="TWILIGHT_MORNING_VISUAL",e.TWILIGHT_MORNING_VISUAL_LOWER="TWILIGHT_MORNING_VISUAL_LOWER",e.TWILIGHT_MORNING_HORIZON="TWILIGHT_MORNING_HORIZON",e.TWILIGHT_MORNING_CIVIL="TWILIGHT_MORNING_CIVIL",e.TWILIGHT_MORNING_NAUTICAL="TWILIGHT_MORNING_NAUTICAL",e.TWILIGHT_MORNING_ASTRONOMICAL="TWILIGHT_MORNING_ASTRONOMICAL",e.TWILIGHT_MORNING_GOLDEN_HOUR="TWILIGHT_MORNING_GOLDEN_HOUR",e.TWILIGHT_MORNING_BLUE_HOUR="TWILIGHT_MORNING_BLUE_HOUR",e.TWILIGHT_MORNING_NIGHT_HOUR="TWILIGHT_MORNING_NIGHT_HOUR",e.TWILIGHT_EVENING_VISUAL="TWILIGHT_EVENING_VISUAL",e.TWILIGHT_EVENING_VISUAL_LOWER="TWILIGHT_EVENING_VISUAL_LOWER",e.TWILIGHT_EVENING_HORIZON="TWILIGHT_EVENING_HORIZON",e.TWILIGHT_EVENING_CIVIL="TWILIGHT_EVENING_CIVIL",e.TWILIGHT_EVENING_NAUTICAL="TWILIGHT_EVENING_NAUTICAL",e.TWILIGHT_EVENING_ASTRONOMICAL="TWILIGHT_EVENING_ASTRONOMICAL",e.TWILIGHT_EVENING_GOLDEN_HOUR="TWILIGHT_EVENING_GOLDEN_HOUR",e.TWILIGHT_EVENING_BLUE_HOUR="TWILIGHT_EVENING_BLUE_HOUR",e.TWILIGHT_EVENING_NIGHT_HOUR="TWILIGHT_EVENING_NIGHT_HOUR"}(un||(un={})),function(e){e.NUMBER="NUMBER",e.NUMBER_ARRAY="NUMBER_ARRAY",e.STRING="STRING",e.BOOLEAN="BOOLEAN",e.TRIGGER="TRIGGER",e.COLOR="COLOR",e.ANY="ANY"}(mn||(mn={})),function(e){e.NEW_LINE="NEW_LINE",e.SPACER="SPACER"}(fn||(fn={})),function(e){e.INPUT="INPUT",e.PROCESSOR="PROCESSOR",e.OUTPUT="OUTPUT",e.THEN="THEN"}(bn||(bn={})),function(e){e.TEXT="TEXT",e.MULTILINE="MULTILINE",e.NUMBER="NUMBER",e.DROPDOWN="DROPDOWN",e.DOUBLE_DROPDOWN="DOUBLE_DROPDOWN",e.CHECKBOX="CHECKBOX",e.ASSET_ATTRIBUTE="ASSET_ATTRIBUTE",e.COLOR="COLOR",e.DATE="DATE"}(hn||(hn={})),function(e){e.ADD="ADD",e.ADD_OR_REPLACE="ADD_OR_REPLACE",e.REPLACE="REPLACE",e.DELETE="DELETE",e.CLEAR="CLEAR"}(pn||(pn={})),function(e){e.PER_ASSET="PER_ASSET",e.GLOBAL="GLOBAL"}(Fn||(Fn={})),function(e){e.READ_ADMIN="read:admin",e.READ_LOGS="read:logs",e.READ_USERS="read:users",e.READ_MAP="read:map",e.READ_ASSETS="read:assets",e.READ_RULES="read:rules",e.READ_INSIGHTS="read:insights",e.READ_ALARMS="read:alarms",e.WRITE_USER="write:user",e.WRITE_ADMIN="write:admin",e.WRITE_LOGS="write:logs",e.WRITE_ASSETS="write:assets",e.WRITE_ATTRIBUTES="write:attributes",e.WRITE_RULES="write:rules",e.WRITE_INSIGHTS="write:insights",e.WRITE_ALARMS="write:alarms",e.READ="read",e.WRITE="write"}(_n||(_n={})),function(e){e.ASSET="ASSET",e.AGENT="AGENT",e.NOTIFICATION="NOTIFICATION",e.ALARM="ALARM",e.RULES="RULES",e.PROTOCOL="PROTOCOL",e.GATEWAY="GATEWAY",e.MODEL_AND_VALUES="MODEL_AND_VALUES",e.API="API",e.DATA="DATA"}(gn||(gn={})),function(e){e.INFO="INFO",e.WARN="WARN",e.ERROR="ERROR"}(yn||(yn={})),function(e){e.NUMERIC="numeric",e.DIGIT_2="2-digit",e.FULL="full",e.LONG="long",e.MEDIUM="medium",e.SHORT="short",e.NARROW="narrow"}(vn||(vn={})),function(e){e.SECONDLY="SECONDLY",e.MINUTELY="MINUTELY",e.HOURLY="HOURLY",e.DAILY="DAILY",e.WEEKLY="WEEKLY",e.MONTHLY="MONTHLY",e.YEARLY="YEARLY"}(kn||(kn={})),function(e){e.OMIT="OMIT",e.BACKWARD="BACKWARD",e.FORWARD="FORWARD"}(wn||(wn={})),function(e){e.JAPANESE="JAPANESE",e.BUDDHIST="BUDDHIST",e.ROC="ROC",e.ISLAMIC="ISLAMIC",e.ISO8601="ISO8601",e.CHINESE="CHINESE",e.ETHIOPIC="ETHIOPIC",e.HEBREW="HEBREW",e.GREGORIAN="GREGORIAN"}(Mn||(Mn={})),function(e){e.SU="SU",e.MO="MO",e.TU="TU",e.WE="WE",e.TH="TH",e.FR="FR",e.SA="SA"}(Ln||(Ln={})),function(e){e.PEOPLECOUNTERASSET="PeopleCounterAsset",e.MAILAGENT="MailAgent",e.UDPAGENT="UDPAgent",e.STORAGESIMULATORAGENT="StorageSimulatorAgent",e.ROOMASSET="RoomAsset",e.CITYASSET="CityAsset",e.ELECTRICITYCONSUMERASSET="ElectricityConsumerAsset",e.ELECTRICVEHICLEASSET="ElectricVehicleAsset",e.VENTILATIONASSET="VentilationAsset",e.TRADFRILIGHTASSET="TradfriLightAsset",e.CONSOLEASSET="ConsoleAsset",e.PRESENCESENSORASSET="PresenceSensorAsset",e.LIGHTASSET="LightAsset",e.KNXAGENT="KNXAgent",e.PLUGASSET="PlugAsset",e.ELECTRICITYCHARGERASSET="ElectricityChargerAsset",e.WEATHERASSET="WeatherAsset",e.ELECTRICITYBATTERYASSET="ElectricityBatteryAsset",e.ELECTRICITYSUPPLIERASSET="ElectricitySupplierAsset",e.THINGASSET="ThingAsset",e.WEBSOCKETAGENT="WebsocketAgent",e.TCPAGENT="TCPAgent",e.GATEWAYASSET="GatewayAsset",e.SERIALAGENT="SerialAgent",e.BLUETOOTHMESHAGENT="BluetoothMeshAgent",e.PARKINGASSET="ParkingAsset",e.TRADFRIPLUGASSET="TradfriPlugAsset",e.SIMULATORAGENT="SimulatorAgent",e.SNMPAGENT="SNMPAgent",e.GROUPASSET="GroupAsset",e.BUILDINGASSET="BuildingAsset",e.ELECTRICITYPRODUCERWINDASSET="ElectricityProducerWindAsset",e.ENVIRONMENTSENSORASSET="EnvironmentSensorAsset",e.MQTTAGENT="MQTTAgent",e.ELECTRICVEHICLEFLEETGROUPASSET="ElectricVehicleFleetGroupAsset",e.VELBUSTCPAGENT="VelbusTCPAgent",e.ARTNETLIGHTASSET="ArtnetLightAsset",e.VELBUSSERIALAGENT="VelbusSerialAgent",e.GROUNDWATERSENSORASSET="GroundwaterSensorAsset",e.ELECTRICITYPRODUCERSOLARASSET="ElectricityProducerSolarAsset",e.MICROPHONEASSET="MicrophoneAsset",e.ZWAVEAGENT="ZWaveAgent",e.ENERGYOPTIMISATIONASSET="EnergyOptimisationAsset",e.HTTPAGENT="HTTPAgent",e.DOORASSET="DoorAsset",e.THERMOSTATASSET="ThermostatAsset",e.ELECTRICITYPRODUCERASSET="ElectricityProducerAsset",e.SHIPASSET="ShipAsset"}(Dn||(Dn={})),function(e){e.SUPPORTSEXPORT="supportsExport",e.ENERGYSELFCONSUMPTION="energySelfConsumption",e.LASTACCESS="lastAccess",e.CHARGERID="chargerID",e.POSITION="position",e.CARBONSAVING="carbonSaving",e.ROUTINGMODE="routingMode",e.LASTWILLRETAIN="lastWillRetain",e.LASTWILLTOPIC="lastWillTopic",e.SERIALBAUDRATE="serialBaudrate",e.BASEURL="baseURL",e.REQUIREDVALUES="requiredValues",e.FINANCIALSAVING="financialSaving",e.FLEETCATEGORY="fleetCategory",e.GATEWAYSTATUS="gatewayStatus",e.NO2LEVEL="NO2Level",e.TAGS="tags",e.MILEAGEMIN="mileageMin",e.UNLOCK="unlock",e.CHECKINTERVALSECONDS="checkIntervalSeconds",e.LOCATION="location",e.CLIENTSECRET="clientSecret",e.WINDDIRECTION="windDirection",e.WINDSPEED="windSpeed",e.PARTICLESPM10="particlesPM10",e.APPLICATIONKEY="applicationKey",e.POWEREXPORTMAX="powerExportMax",e.SETWINDACTUALVALUEWITHFORECAST="setWindActualValueWithForecast",e.WATERLEVEL="waterLevel",e.CONNECTHEADERS="connectHeaders",e.CONSOLENAME="consoleName",e.WEBSOCKETQUERY="websocketQuery",e.PREFERHTML="preferHTML",e.COOLING="cooling",e.POLLINGMILLIS="pollingMillis",e.SOILTEMPERATURE="soilTemperature",e.SUNIRRADIANCE="sunIrradiance",e.ODOMETER="odometer",e.SUPPORTSIMPORT="supportsImport",e.MESSAGEMAXLENGTH="messageMaxLength",e.ENERGYLEVELPERCENTAGEMIN="energyLevelPercentageMin",e.LIGHTID="lightId",e.POWER="power",e.STREET="street",e.DELETEPROCESSEDMAIL="deleteProcessedMail",e.WINDSPEEDMIN="windSpeedMin",e.POWERSETPOINT="powerSetpoint",e.PRESENCE="presence",e.SPACESOCCUPIED="spacesOccupied",e.STARTTLS="startTLS",e.AGENTSTATUS="agentStatus",e.MESSAGECHARSET="messageCharset",e.CERTIFICATEALIAS="certificateAlias",e.PANELPITCH="panelPitch",e.EMAIL="email",e.BINDPORT="bindPort",e.PARTICLESPM1="particlesPM1",e.SPEED="speed",e.ENERGYLEVELPERCENTAGEMAX="energyLevelPercentageMax",e.MESSAGESTRIPDELIMITER="messageStripDelimiter",e.AREA="area",e.COUNTRY="country",e.SHIPTYPE="shipType",e.CONNECTSUBSCRIPTIONS="connectSubscriptions",e.RELATIVEHUMIDITY="relativeHumidity",e.SOURCEADDRESS="sourceAddress",e.INCLUDEFORECASTWINDSERVICE="includeForecastWindService",e.RAINFALL="rainfall",e.ENERGYIMPORTTOTAL="energyImportTotal",e.OAUTHGRANT="oAuthGrant",e.OZONELEVEL="ozoneLevel",e.COUNTINMINUTE="countInMinute",e.PORT="port",e.TUNNELINGSUPPORTED="tunnelingSupported",e.ENINUMBER="ENINumber",e.AGENTDISABLED="agentDisabled",e.DISABLED="disabled",e.FORCECHARGE="forceCharge",e.TIMEINJECTIONINTERVAL="timeInjectionInterval",e.FINANCIALWEIGHTING="financialWeighting",e.ENERGYLEVELPERCENTAGE="energyLevelPercentage",e.SPACESBUFFER="spacesBuffer",e.VEHICLECATEGORY="vehicleCategory",e.FANSPEED="fanSpeed",e.FINANCIALCOST="financialCost",e.NOTES="notes",e.MAILFOLDERNAME="mailFolderName",e.TEMPERATURE="temperature",e.AVAILABLECHARGINGSPACES="availableChargingSpaces",e.ENERGYCAPACITY="energyCapacity",e.POWERIMPORTMIN="powerImportMin",e.INTERVALSIZE="intervalSize",e.SNMPVERSIONVALUE="SNMPVersionValue",e.SOUNDLEVEL="soundLevel",e.CONNECTURL="connectURL",e.CLIENTID="clientId",e.VEHICLEID="vehicleID",e.SUNAZIMUTH="sunAzimuth",e.AVAILABLEDISCHARGINGSPACES="availableDischargingSpaces",e.WEBSOCKETMODE="websocketMode",e.COLOURTEMPERATURE="colourTemperature",e.VEHICLECONNECTED="vehicleConnected",e.MILEAGEMINIMUM="mileageMinimum",e.COLOURRGB="colourRGB",e.CARBONIMPORT="carbonImport",e.PRICEHOURLY="priceHourly",e.WINDSPEEDMAX="windSpeedMax",e.PINGDISABLED="pingDisabled",e.FLOW="flow",e.CHILDASSETTYPE="childAssetType",e.NETWORKKEY="networkKey",e.UNIVERSE="universe",e.MSSINUMBER="MSSINumber",e.LEDCOUNT="lEDCount",e.LOCKED="locked",e.PROTOCOL="protocol",e.TARIFFIMPORT="tariffImport",e.ENERGYRENEWABLESHARE="energyRenewableShare",e.REGION="region",e.CONSOLEPLATFORM="consolePlatform",e.POWEREXPORTMIN="powerExportMin",e.EFFICIENCYEXPORT="efficiencyExport",e.CHARGECYCLES="chargeCycles",e.SERIALPORT="serialPort",e.PANELORIENTATION="panelOrientation",e.LENGTH="length",e.USERNAMEPASSWORD="usernamePassword",e.POWERFORECAST="powerForecast",e.SETACTUALSOLARVALUEWITHFORECAST="setActualSolarValueWithForecast",e.PROXYADDRESS="proxyAddress",e.REQUESTQUERYPARAMETERS="requestQueryParameters",e.ENERGYLOCAL="energyLocal",e.ENERGYAUTARKY="energyAutarky",e.MODEL="model",e.MANUFACTURER="manufacturer",e.ONOFF="onOff",e.RESUMESESSION="resumeSession",e.TARIFFEXPORT="tariffExport",e.CITY="city",e.CONNECTORTYPE="connectorType",e.ENERGYEXPORTTOTAL="energyExportTotal",e.CARBONEXPORT="carbonExport",e.REQUESTTIMEOUTMILLIS="requestTimeoutMillis",e.ENERGYLEVEL="energyLevel",e.OPTIMISATIONDISABLED="optimisationDisabled",e.WEBSOCKETPATH="websocketPath",e.WINDSPEEDREFERENCE="windSpeedReference",e.PRICEDAILY="priceDaily",e.COUNTGROWTHMINUTE="countGrowthMinute",e.IMONUMBER="IMONumber",e.INCLUDEFORECASTSOLARSERVICE="includeForecastSolarService",e.REQUESTHEADERS="requestHeaders",e.COUNTOUTMINUTE="countOutMinute",e.HOST="host",e.ENERGYTYPE="energyType",e.CONSOLEVERSION="consoleVersion",e.MTU="mtu",e.PANELAZIMUTH="panelAzimuth",e.SEQUENCENUMBER="sequenceNumber",e.SUNALTITUDE="sunAltitude",e.COUNTOUT="countOut",e.CHARGERCONNECTED="chargerConnected",e.ROOMNUMBER="roomNumber",e.PARTICLESPM2_5="particlesPM2_5",e.COUNTIN="countIn",e.MESSAGESOURCEADDRESS="messageSourceAddress",e.MILEAGECHARGED="mileageCharged",e.TEMPERATURESETPOINT="temperatureSetpoint",e.CONSOLEPROVIDERS="consoleProviders",e.POWERIMPORTMAX="powerImportMax",e.COUNTTOTAL="countTotal",e.SPACESTOTAL="spacesTotal",e.BINDHOST="bindHost",e.MESSAGECONVERTBINARY="messageConvertBinary",e.MESSAGEDELIMITERS="messageDelimiters",e.EFFICIENCYIMPORT="efficiencyImport",e.SUNZENITH="sunZenith",e.BRIGHTNESS="brightness",e.POSTALCODE="postalCode",e.SPACESOPEN="spacesOpen",e.HUMIDITY="humidity",e.MILEAGECAPACITY="mileageCapacity",e.SECUREMODE="secureMode",e.DIRECTION="direction",e.ENERGYLEVELSCHEDULE="energyLevelSchedule",e.UVINDEX="uVIndex",e.NATMODE="NATMode",e.UPDATEONWRITE="updateOnWrite",e.GROUPID="groupId",e.LASTWILLPAYLOAD="lastWillPayload",e.FOLLOWREDIRECTS="followRedirects",e.CARBONCOST="carbonCost",e.MESSAGECONVERTHEX="messageConvertHex"}(En||(En={})),function(e){e.FORMAT="format",e.RULESTATE="ruleState",e.HASPREDICTEDDATAPOINTS="hasPredictedDataPoints",e.STOREDATAPOINTS="storeDataPoints",e.LABEL="label",e.CONSTRAINTS="constraints",e.SHOWONDASHBOARD="showOnDashboard",e.READONLY="readOnly",e.MULTILINE="multiline",e.ACCESSPUBLICWRITE="accessPublicWrite",e.MOMENTARY="momentary",e.AGENTLINK="agentLink",e.ACCESSRESTRICTEDREAD="accessRestrictedRead",e.DATAPOINTSMAXAGEDAYS="dataPointsMaxAgeDays",e.ACCESSRESTRICTEDWRITE="accessRestrictedWrite",e.SECRET="secret",e.ATTRIBUTELINKS="attributeLinks",e.RULERESETIMMEDIATE="ruleResetImmediate",e.FORECAST="forecast",e.UNITS="units",e.USERCONNECTED="userConnected",e.ACCESSPUBLICREAD="accessPublicRead"}(An||(An={})),function(e){e.WSURL="WS_URL",e.POSITIVENUMBER="positiveNumber",e.VALUEDESCRIPTOR="valueDescriptor",e.LONG="long",e.BOOLEANMAP="booleanMap",e.GEOJSONPOINT="GEO_JSONPoint",e.SNMPVERSION="SNMPVersion",e.ASSETTYPE="assetType",e.JSONOBJECT="JSONObject",e.BIGNUMBER="bigNumber",e.IPADDRESS="IPAddress",e.EMAIL="email",e.KNXMESSAGESOURCEADDRESS="kNXMessageSourceAddress",e.ATTRIBUTEREFERENCE="attributeReference",e.INTEGER="integer",e.OAUTHGRANT="oAuthGrant",e.NUMBER="number",e.TEXTMAP="textMap",e.WEBSOCKETSUBSCRIPTION="websocketSubscription",e.BOOLEAN="boolean",e.TIMEANDPERIODDURATIONISO8601="timeAndPeriodDurationISO8601",e.TIMESTAMPISO8601="timestampISO8601",e.MULTIVALUEDTEXTMAP="multivaluedTextMap",e.JSON="JSON",e.INTEGERBYTE="integerByte",e.AGENTLINK="agentLink",e.CALENDAREVENT="calendarEvent",e.CONNECTIONSTATUS="connectionStatus",e.VALUECONSTRAINT="valueConstraint",e.ASSETQUERY="assetQuery",e.COLOURRGB="colourRGB",e.VALUEFORMAT="valueFormat",e.TEXT="text",e.BYTE="byte",e.USERNAMEANDPASSWORD="usernameAndPassword",e.HTTPURL="HTTP_URL",e.ATTRIBUTELINK="attributeLink",e.ASSETID="assetID",e.NUMBERMAP="numberMap",e.HTTPMETHOD="HTTPMethod",e.PANELORIENTATION="panelOrientation",e.ATTRIBUTESTATE="attributeState",e.POSITIVEINTEGER="positiveInteger",e.EXECUTIONSTATUS="executionStatus",e.BIGINTEGER="bigInteger",e.PERIODDURATIONISO8601="periodDurationISO8601",e.DATEANDTIME="dateAndTime",e.CONNECTORTYPE="connectorType",e.NEGATIVEINTEGER="negativeInteger",e.TCPIPPORTNUMBER="TCP_IPPortNumber",e.INTEGERMAP="integerMap",e.ENERGYTYPE="energyType",e.TIMESTAMP="timestamp",e.UUID="UUID",e.FORECASTCONFIGURATION="forecastConfiguration",e.TIMEDURATIONISO8601="timeDurationISO8601",e.CONSOLEPROVIDERS="consoleProviders",e.NEGATIVENUMBER="negativeNumber",e.CRONEXPRESSION="CRONExpression",e.DIRECTION="direction",e.HOSTORIPADDRESS="hostOrIPAddress"}(Tn||(Tn={})),function(e){e.MONTH="month",e.MILE_SCANDINAVIAN="mile_scandinavian",e.YEAR="year",e.VOLT="volt",e.HERTZ="hertz",e.MILE="mile",e.BTU="btu",e.FOOT="foot",e.MEGA="mega",e.INCH="inch",e.IN_HG="inch_mercury",e.CENTI="centi",e.GRAM="gram",e.KNOT="knot",e.METRE="metre",e.LITRE="litre",e.FLUID_OUNCE="fluid_ounce",e.CELSIUS="celsius",e.DECIBEL="decibel",e.FAHRENHEIT="fahrenheit",e.WATT="watt",e.PEAK="peak",e.MICRO="micro",e.PER="per",e.STONE="stone",e.VAR="var",e.OUNCE="ounce",e.HECTARE="hectare",e.YARD="yard",e.JOULE="joule",e.DEGREE="degree",e.KILO="kilo",e.KELVIN="kelvin",e.CARBON="carbon",e.DECIBEL_ATTENUATED="decibel_attenuated",e.SQUARED="squared",e.PERCENTAGE="percentage",e.CUBED="cubed",e.DAY="day",e.RADIAN="radian",e.OHM="ohm",e.MINUTE="minute",e.PART_PER_MILLION="ppm",e.AMP="amp",e.MASS_POUND="pound",e.HOUR="hour",e.ACRE="acre",e.RPM="rpm",e.PASCAL="pascal",e.LUMEN="lumen",e.WEEK="week",e.GALLON="gallon",e.LUX="lux",e.MILLI="milli",e.BAR="bar",e.HECTO="hecto",e.SECOND="second"}(Yn||(Yn={})),Cn||(Cn={});class On{static getAssetDescriptors(){return On._assetTypeInfos.map((e=>e.assetDescriptor))}static getMetaItemDescriptors(){return[...this._metaItemDescriptors]}static getValueDescriptors(){return[...this._valueDescriptors]}static getAssetTypeInfos(){return[...this._assetTypeInfos]}static getAssetTypeInfo(e){if(e)return e.assetDescriptor?e:("string"!=typeof e&&(e=e.name),this._assetTypeInfos.find((t=>t.assetDescriptor.name===e)))}static getAssetDescriptor(e){if(!e)return;if(e.assetDescriptor)return e.assetDescriptor;if("string"!=typeof e)return e;const t=this._assetTypeInfos.find((t=>t.assetDescriptor.name===e));return t?t.assetDescriptor:void 0}static getAttributeDescriptor(e,t){if(!e)return;const n=this.getAssetTypeInfo(t||"ThingAsset");return n&&n.attributeDescriptors?n.attributeDescriptors.find((t=>t.name===e)):void 0}static getValueDescriptor(e){if(!e)return;let t;if(e.endsWith("[]"))for(t=0;e.endsWith("[]");)e=e.substring(0,e.length-2),t++;let n=this._valueDescriptors.find((t=>t.name===e));return n&&t&&(n=Object.assign(Object.assign({},n),{arrayDimensions:t})),n}static resolveValueDescriptor(e,t){let n;return t&&("string"==typeof t&&(n=On.getValueDescriptor(t)),n=t.jsonType?t:On.getValueDescriptor(t.type)),!n&&e&&(n=On.getValueDescriptor("JSON")),n}static resolveValueTypeFromValue(e){if(null!=e){if("number"==typeof e)return"number";if("string"==typeof e)return"text";if("boolean"==typeof e)return"boolean";if(Array.isArray(e)){let t=1,n=e.find((e=>null!=e));for(;Array.isArray(n);)n=n.find((e=>null!=e)),t++;let o=this.resolveValueTypeFromValue(n);if(!o)return;for(;t>0;)o+="[]",t--;return o}return e instanceof Date?"dateAndTime":void 0}}static getAttributeAndValueDescriptors(e,t,n){let o,r;if(t&&"string"!=typeof t)o=t;else{const r=this.getAssetTypeInfo(e||"ThingAsset");if(!r)return[void 0,void 0];"string"==typeof t&&(o=this.getAttributeDescriptor(t,r)),!o&&n&&(o={type:n.type,name:n.name,meta:n.meta})}return o&&(r=this.getValueDescriptor(o.type)),[o,r]}static getMetaItemDescriptor(e){if(e)return this._metaItemDescriptors.find((t=>t.name===e))}static getAssetDescriptorColour(e,t){const n=this.getAssetDescriptor(e);return n&&n.colour?n.colour:t}static getAssetDescriptorIcon(e,t){const n=this.getAssetDescriptor(e);return n&&n.icon?n.icon:t}}On._assetTypeInfos=[],On._metaItemDescriptors=[],On._valueDescriptors=[];var Bn=r(6104),Rn=r.n(Bn);r(5564);class Pn{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)}}let jn=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>{jn=!0}}))}catch(jo){}document.createElement("div");var In=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))};let Nn=r(6900);class Hn{constructor(e,t,n){this._autoEnable=!1,this._initialised=!1,this._initialiseInProgress=!1,this._pendingProviderPromises={},this._providerMessageListeners={},this._pendingProviderEnables=[],this._registrationTimer=null,this._realm=e,this._autoEnable=t,this._enableCompleteCallback=n,window.OpenRemoteConsole=this;let o=new URLSearchParams(window.location.search),r=o.get("consoleName"),i=o.get("consoleVersion"),a=o.get("consolePlatform"),s=o.get("consoleProviders"),c=o.get("consoleAutoEnable"),d=s&&s.length>0?s.split(" "):["push"];this._pendingProviderEnables=d;let l=Hn._createConsoleRegistration(),u=window.localStorage.getItem("OpenRemoteConsole:"+e);if(u)try{let e=JSON.parse(u);e.id&&(l.id=e.id),e.name&&(l.name=e.name),e.providers&&(l.providers=e.providers),e.apps&&(l.apps=e.apps)}catch(e){console.error("Failed to deserialise console registration")}let m=l.providers;l.providers={};for(let e of d){let t=m&&m.hasOwnProperty(e)?m[e]:{enabled:!1,disabled:!1};l.providers[e]=t}let f=Ar.getAppName();f.length>0&&l.apps.indexOf(f)<0&&l.apps.push(f),this._registration=l,r&&(l.name=r),i&&(l.version=i),a&&(l.platform=a),c&&(this._autoEnable="TRUE"===c||"true"===c)}get registration(){return this._registration}get autoEnable(){return this._autoEnable}get pendingProviderEnables(){return this._pendingProviderEnables.slice(0)}get shellApple(){const 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 In(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(0)),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 In(this,void 0,void 0,(function*(){if(!this._initialised)throw new 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 In(this,void 0,void 0,(function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),new Error("Console must be initialised before enabling providers");if(!this._registration.providers.hasOwnProperty(e))throw console.debug("Invalid console provider '"+e+"'"),new Error("Invalid console provider '"+e+"'");console.debug("Console: enabling provider '"+e+"'");let n={provider:e,action:"PROVIDER_ENABLE",consoleId:this._registration.id,data:t},o=yield this.sendProviderMessage(n,!0);this._registration.providers[e].hasPermission=o.hasPermission,this._registration.providers[e].success=o.success,this._registration.providers[e].enabled=o.success,this._registration.providers[e].data=o.data;let r=this._pendingProviderEnables.indexOf(e);return r>=0&&(this._pendingProviderEnables.splice(r,1),0===this._pendingProviderEnables.length&&(this.sendRegistration(),this._callCompletedCallback())),o}))}disableProvider(e){return In(this,void 0,void 0,(function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),new Error("Console must be initialised before disabling providers");if(!this._registration.providers.hasOwnProperty(e))throw console.debug("Invalid console provider '"+e+"'"),new 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 In(this,void 0,void 0,(function*(){if("storage"!==e.provider&&!this._registration.providers.hasOwnProperty(e.provider))throw console.debug("Invalid console provider '"+e.provider+"'"),new Error("Invalid console provider '"+e.provider+"'");if(!t)return void this._doSendProviderMessage(e);let n=e.provider+e.action;if(this._pendingProviderPromises[n])throw new Error("Message already pending for provider '"+e.provider+"' with action '"+e.action+"'");const o=new Pn;return this._pendingProviderPromises[n]=[o,window.setTimeout((()=>{delete this._pendingProviderPromises[n],o.reject("No response from provider")}),5e3)],this._doSendProviderMessage(e),o.promise}))}sendRegistration(e){return this._registrationTimer&&(window.clearTimeout(this._registrationTimer),this._registrationTimer=null),e=void 0!==e?e:2e3,console.debug("Sending registration in: "+e+"ms"),new Promise(((e,t)=>{this._registrationTimer=window.setTimeout((()=>{this._registrationTimer=null,console.debug("Console: updating registration");try{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={}),Ar.rest.api.ConsoleResource.register(this._registration).then((t=>{if(200!==t.status)throw new Error("Failed to register console");this._registration=t.data,console.debug("Console: registration successful"),console.debug("Console: updating locally stored registration"),window.localStorage.setItem("OpenRemoteConsole:"+this._realm,JSON.stringify(this._registration)),e()}))}catch(e){console.error("Failed to register console"),t("Failed to register console")}}))}))}storeData(e,t){this.sendProviderMessage({provider:"storage",action:"STORE",key:e,value:t},!1)}retrieveData(e){return In(this,void 0,void 0,(function*(){let t=this.sendProviderMessage({provider:"storage",action:"RETRIEVE",key:e},!0);try{const e=yield Promise.race([t,new Promise(((e,t)=>setTimeout(t,2e3)))]);if(e&&e.value){const 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){const n={type:e,data:t};this.isMobile?this._postNativeShellMessage(n):console.warn("Failed to send generic message to console.",n)}_doSendProviderMessage(e){if(this.isMobile)this._postNativeShellMessage({type:"provider",data:e});else{if(!e.provider||!e.action)return;switch(e.provider.trim().toUpperCase()){case"PUSH":switch(e.action.trim().toUpperCase()){case"PROVIDER_INIT":let t={action:"PROVIDER_INIT",provider:"push",version:"web",enabled:!0,disabled:!1,hasPermission:!0,requiresPermission:!1,success:!0};this._handleProviderResponse(JSON.stringify(t));break;case"PROVIDER_ENABLE":let n={action:"PROVIDER_ENABLE",provider:"push",hasPermission:!0,success:!0};this._handleProviderResponse(JSON.stringify(n));break;default:throw new Error("Unsupported provider '"+e.provider+"' and action '"+e.action+"'")}break;case"STORAGE":switch(e.action){case"PROVIDER_INIT":let t={action:"PROVIDER_INIT",provider:"storage",version:"1.0.0",disabled:!1,enabled:!0,hasPermission:!0,requiresPermission:!1,success:!0};this._handleProviderResponse(JSON.stringify(t));break;case"PROVIDER_ENABLE":let n={action:"PROVIDER_ENABLE",provider:"storage",hasPermission:!0,success:!0};this._handleProviderResponse(JSON.stringify(n));break;case"STORE":{let t=e.key?e.key.trim():null;if(!t||0===t.length)throw new 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 new Error("Storage provider 'retrieve' action requires a `key`");let n=window.localStorage.getItem(t);if(null!==n)try{n=JSON.parse(n)}catch(e){}this._handleProviderResponse(JSON.stringify({action:"RETRIEVE",provider:"storage",key:t,value:n}))}break;default:throw new Error("Unsupported provider '"+e.provider+"' and action '"+e.action+"'")}break;default:console.error("Unsupported provider: "+e.provider)}}}_handleProviderResponse(e){if(!e)return;let t=JSON.parse(e),n=t.provider,o=t.action,r=this._pendingProviderPromises[n+o];r&&(window.clearTimeout(r[1]),delete this._pendingProviderPromises[n+o],r[0].resolve(t));let i=this._providerMessageListeners[n+o];i&&i(t)}_callCompletedCallback(){let e=this._enableCompleteCallback;this._enableCompleteCallback=null,e&&window.setTimeout((()=>{e()}),0)}static _createConsoleRegistration(){return{name:Nn.name,version:Nn.version,platform:Nn.os.toString(),apps:[],model:((Nn.manufacturer?Nn.manufacturer+" ":"")+(Nn.product?Nn.product:"")).trim()}}_initialiseProvider(e){return In(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)}}))}}var Un=r(9048),Wn=r.n(Un);class zn{constructor(e){this.httpClient=e}getHealthStatus(e){return this.httpClient.request({method:"GET",url:mo`health`,options:e})}getInfo(e){return this.httpClient.request({method:"GET",url:mo`info`,options:e})}}class Gn{constructor(e){this.httpClient=e}updateCurrentUserLocale(e,t){return this.httpClient.request({method:"PUT",url:mo`user/locale`,data:e,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:mo`user/query`,data:e,options:t})}getCurrent(e){return this.httpClient.request({method:"GET",url:mo`user/user`,options:e})}getCurrentUserRealmRoles(e){return this.httpClient.request({method:"GET",url:mo`user/userRealmRoles`,options:e})}getCurrentUserRoles(e){return this.httpClient.request({method:"GET",url:mo`user/userRoles`,options:e})}getCurrentUserClientRoles(e,t){return this.httpClient.request({method:"GET",url:mo`user/userRoles/${e}`,options:t})}disconnectUserSession(e,t,n){return this.httpClient.request({method:"GET",url:mo`user/${e}/disconnect/${t}`,options:n})}resetPassword(e,t,n,o){return this.httpClient.request({method:"PUT",url:mo`user/${e}/reset-password/${t}`,data:n,options:o})}resetSecret(e,t,n){return this.httpClient.request({method:"GET",url:mo`user/${e}/reset-secret/${t}`,options:n})}getRoles(e,t){return this.httpClient.request({method:"GET",url:mo`user/${e}/roles`,options:t})}updateRoles(e,t,n){return this.httpClient.request({method:"PUT",url:mo`user/${e}/roles`,data:t,options:n})}getUserRealmRoles(e,t,n){return this.httpClient.request({method:"GET",url:mo`user/${e}/userRealmRoles/${t}`,options:n})}updateUserRealmRoles(e,t,n,o){return this.httpClient.request({method:"PUT",url:mo`user/${e}/userRealmRoles/${t}`,data:n,options:o})}getUserRoles(e,t,n){return this.httpClient.request({method:"GET",url:mo`user/${e}/userRoles/${t}`,options:n})}updateUserRoles(e,t,n,o){return this.httpClient.request({method:"PUT",url:mo`user/${e}/userRoles/${t}`,data:n,options:o})}getUserClientRoles(e,t,n,o){return this.httpClient.request({method:"GET",url:mo`user/${e}/userRoles/${t}/${n}`,options:o})}updateUserClientRoles(e,t,n,o,r){return this.httpClient.request({method:"PUT",url:mo`user/${e}/userRoles/${t}/${n}`,data:o,options:r})}getUserSessions(e,t,n){return this.httpClient.request({method:"GET",url:mo`user/${e}/userSessions/${t}`,options:n})}create(e,t,n){return this.httpClient.request({method:"POST",url:mo`user/${e}/users`,data:t,options:n})}update(e,t,n){return this.httpClient.request({method:"PUT",url:mo`user/${e}/users`,data:t,options:n})}delete(e,t,n){return this.httpClient.request({method:"DELETE",url:mo`user/${e}/users/${t}`,options:n})}getClientRoles(e,t,n){return this.httpClient.request({method:"GET",url:mo`user/${e}/${t}/roles`,options:n})}updateClientRoles(e,t,n,o){return this.httpClient.request({method:"PUT",url:mo`user/${e}/${t}/roles`,data:n,options:o})}get(e,t,n){return this.httpClient.request({method:"GET",url:mo`user/${e}/${t}`,options:n})}}class qn{constructor(e){this.httpClient=e}doProtocolAssetDiscovery(e,t,n){return this.httpClient.request({method:"GET",url:mo`agent/assetDiscovery/${e}`,queryParams:t,options:n})}doProtocolAssetImport(e,t,n,o){return this.httpClient.request({method:"POST",url:mo`agent/assetImport/${e}`,queryParams:n,data:t,options:o})}doProtocolInstanceDiscovery(e,t,n){return this.httpClient.request({method:"GET",url:mo`agent/instanceDiscovery/${e}`,queryParams:t,options:n})}}class $n{constructor(e){this.httpClient=e}getManagerConfig(e){return this.httpClient.request({method:"GET",url:mo`configuration/manager`,options:e})}update(e,t){return this.httpClient.request({method:"PUT",url:mo`configuration/manager`,data:e,options:t})}fileUpload(e,t,n){return this.httpClient.request({method:"POST",url:mo`configuration/manager/file`,queryParams:t,data:e,options:n})}getManagerConfigImage(e,t){return this.httpClient.request({method:"GET",url:mo`configuration/manager/image/${e}`,options:t})}}class Vn{constructor(e){this.httpClient=e}createGlobalRuleset(e,t){return this.httpClient.request({method:"POST",url:mo`rules`,data:e,options:t})}getGlobalRulesets(e,t){return this.httpClient.request({method:"GET",url:mo`rules`,queryParams:e,options:t})}createAssetRuleset(e,t){return this.httpClient.request({method:"POST",url:mo`rules/asset`,data:e,options:t})}getAssetRulesets(e,t,n){return this.httpClient.request({method:"GET",url:mo`rules/asset/for/${e}`,queryParams:t,options:n})}deleteAssetRuleset(e,t){return this.httpClient.request({method:"DELETE",url:mo`rules/asset/${e}`,options:t})}getAssetRuleset(e,t){return this.httpClient.request({method:"GET",url:mo`rules/asset/${e}`,options:t})}updateAssetRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:mo`rules/asset/${e}`,data:t,options:n})}getAssetGeofences(e,t){return this.httpClient.request({method:"GET",url:mo`rules/geofences/${e}`,options:t})}getAssetEngineInfo(e,t){return this.httpClient.request({method:"GET",url:mo`rules/info/asset/${e}`,options:t})}getGlobalEngineInfo(e){return this.httpClient.request({method:"GET",url:mo`rules/info/global`,options:e})}getRealmEngineInfo(e,t){return this.httpClient.request({method:"GET",url:mo`rules/info/realm/${e}`,options:t})}createRealmRuleset(e,t){return this.httpClient.request({method:"POST",url:mo`rules/realm`,data:e,options:t})}getRealmRulesets(e,t,n){return this.httpClient.request({method:"GET",url:mo`rules/realm/for/${e}`,queryParams:t,options:n})}deleteRealmRuleset(e,t){return this.httpClient.request({method:"DELETE",url:mo`rules/realm/${e}`,options:t})}getRealmRuleset(e,t){return this.httpClient.request({method:"GET",url:mo`rules/realm/${e}`,options:t})}updateRealmRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:mo`rules/realm/${e}`,data:t,options:n})}deleteGlobalRuleset(e,t){return this.httpClient.request({method:"DELETE",url:mo`rules/${e}`,options:t})}getGlobalRuleset(e,t){return this.httpClient.request({method:"GET",url:mo`rules/${e}`,options:t})}updateGlobalRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:mo`rules/${e}`,data:t,options:n})}}class Jn{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:mo`dashboard`,data:e,options:t})}update(e,t){return this.httpClient.request({method:"PUT",url:mo`dashboard`,data:e,options:t})}getAllRealmDashboards(e,t){return this.httpClient.request({method:"GET",url:mo`dashboard/all/${e}`,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:mo`dashboard/query`,data:e,options:t})}delete(e,t,n){return this.httpClient.request({method:"DELETE",url:mo`dashboard/${e}/${t}`,options:n})}get(e,t,n){return this.httpClient.request({method:"GET",url:mo`dashboard/${e}/${t}`,options:n})}}class Kn{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:mo`asset`,data:e,options:t})}delete(e,t){return this.httpClient.request({method:"DELETE",url:mo`asset`,queryParams:e,options:t})}writeAttributeValues(e,t){return this.httpClient.request({method:"PUT",url:mo`asset/attributes`,data:e,options:t})}writeAttributeEvents(e,t){return this.httpClient.request({method:"PUT",url:mo`asset/attributes/timestamp`,data:e,options:t})}updateNoneParent(e,t){return this.httpClient.request({method:"DELETE",url:mo`asset/parent`,queryParams:e,options:t})}getPartial(e,t){return this.httpClient.request({method:"GET",url:mo`asset/partial/${e}`,options:t})}queryAssets(e,t){return this.httpClient.request({method:"POST",url:mo`asset/query`,data:e,options:t})}getCurrentUserAssets(e){return this.httpClient.request({method:"GET",url:mo`asset/user/current`,options:e})}createUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:mo`asset/user/link`,data:e,options:t})}getUserAssetLinks(e,t){return this.httpClient.request({method:"GET",url:mo`asset/user/link`,queryParams:e,options:t})}deleteUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:mo`asset/user/link/delete`,data:e,options:t})}deleteAllUserAssetLinks(e,t,n){return this.httpClient.request({method:"DELETE",url:mo`asset/user/link/${e}/${t}`,options:n})}deleteUserAssetLink(e,t,n,o){return this.httpClient.request({method:"DELETE",url:mo`asset/user/link/${e}/${t}/${n}`,options:o})}get(e,t){return this.httpClient.request({method:"GET",url:mo`asset/${e}`,options:t})}update(e,t,n){return this.httpClient.request({method:"PUT",url:mo`asset/${e}`,data:t,options:n})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName(e,t,n,o){return this.httpClient.request({method:"PUT",url:mo`asset/${e}/attribute/${t}`,data:n,options:o})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName_timestamp(e,t,n,o,r){return this.httpClient.request({method:"PUT",url:mo`asset/${e}/attribute/${t}/${n}`,data:o,options:r})}updateParent(e,t,n){return this.httpClient.request({method:"PUT",url:mo`asset/${e}/child`,queryParams:t,options:n})}}class Xn{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:mo`realm`,data:e,options:t})}getAll(e){return this.httpClient.request({method:"GET",url:mo`realm`,options:e})}getAccessible(e){return this.httpClient.request({method:"GET",url:mo`realm/accessible`,options:e})}delete(e,t){return this.httpClient.request({method:"DELETE",url:mo`realm/${e}`,options:t})}get(e,t){return this.httpClient.request({method:"GET",url:mo`realm/${e}`,options:t})}update(e,t,n){return this.httpClient.request({method:"PUT",url:mo`realm/${e}`,data:t,options:n})}}class Zn{constructor(e){this.httpClient=e}getPredictedDatapoints(e,t,n,o){return this.httpClient.request({method:"POST",url:mo`asset/predicted/${e}/${t}`,data:n,options:o})}writePredictedDatapoints(e,t,n,o){return this.httpClient.request({method:"PUT",url:mo`asset/predicted/${e}/${t}`,data:n,options:o})}}class Qn{constructor(e){this.httpClient=e}createAlarm(e,t,n){return this.httpClient.request({method:"POST",url:mo`alarm`,queryParams:t,data:e,options:n})}getAlarms(e,t){return this.httpClient.request({method:"GET",url:mo`alarm`,queryParams:e,options:t})}removeAlarms(e,t){return this.httpClient.request({method:"DELETE",url:mo`alarm`,data:e,options:t})}setAssetLinks(e,t){return this.httpClient.request({method:"PUT",url:mo`alarm/assets`,data:e,options:t})}getAlarm(e,t){return this.httpClient.request({method:"GET",url:mo`alarm/${e}`,options:t})}removeAlarm(e,t){return this.httpClient.request({method:"DELETE",url:mo`alarm/${e}`,options:t})}updateAlarm(e,t,n){return this.httpClient.request({method:"PUT",url:mo`alarm/${e}`,data:t,options:n})}getAssetLinks(e,t,n){return this.httpClient.request({method:"GET",url:mo`alarm/${e}/assets`,queryParams:t,options:n})}}class eo{constructor(e){this.httpClient=e}createProvisioningConfig(e,t){return this.httpClient.request({method:"POST",url:mo`provisioning`,data:e,options:t})}getProvisioningConfigs(e){return this.httpClient.request({method:"GET",url:mo`provisioning`,options:e})}deleteProvisioningConfig(e,t){return this.httpClient.request({method:"DELETE",url:mo`provisioning/${e}`,options:t})}updateProvisioningConfig(e,t,n){return this.httpClient.request({method:"PUT",url:mo`provisioning/${e}`,data:t,options:n})}}class to{constructor(e){this.httpClient=e}getNotifications(e,t){return this.httpClient.request({method:"GET",url:mo`notification`,queryParams:e,options:t})}removeNotifications(e,t){return this.httpClient.request({method:"DELETE",url:mo`notification`,queryParams:e,options:t})}sendNotification(e,t){return this.httpClient.request({method:"POST",url:mo`notification/alert`,data:e,options:t})}removeNotification(e,t){return this.httpClient.request({method:"DELETE",url:mo`notification/${e}`,options:t})}notificationAcknowledged(e,t,n,o){return this.httpClient.request({method:"PUT",url:mo`notification/${e}/acknowledged`,queryParams:n,data:t,options:o})}notificationDelivered(e,t,n){return this.httpClient.request({method:"PUT",url:mo`notification/${e}/delivered`,queryParams:t,options:n})}}class no{constructor(e){this.httpClient=e}register(e,t){return this.httpClient.request({method:"POST",url:mo`console/register`,data:e,options:t})}}class oo{constructor(e){this.httpClient=e}getApps(e){return this.httpClient.request({method:"GET",url:mo`apps`,options:e})}getConsoleConfig(e){return this.httpClient.request({method:"GET",url:mo`apps/consoleConfig`,options:e})}getAppInfos(e){return this.httpClient.request({method:"GET",url:mo`apps/info`,options:e})}}class ro{constructor(e){this.httpClient=e}getConfig(e){return this.httpClient.request({method:"GET",url:mo`syslog/config`,options:e})}updateConfig(e,t){return this.httpClient.request({method:"PUT",url:mo`syslog/config`,data:e,options:t})}clearEvents(e){return this.httpClient.request({method:"DELETE",url:mo`syslog/event`,options:e})}getEvents(e,t){return this.httpClient.request({method:"GET",url:mo`syslog/event`,queryParams:e,options:t})}}class io{constructor(e){this.httpClient=e}getSettings(e){return this.httpClient.request({method:"GET",url:mo`map`,options:e})}saveSettings(e,t){return this.httpClient.request({method:"PUT",url:mo`map`,data:e,options:t})}getSettingsJs(e){return this.httpClient.request({method:"GET",url:mo`map/js`,options:e})}getTile(e,t,n,o){return this.httpClient.request({method:"GET",url:mo`map/tile/${e}/${t}/${n}`,options:o})}}class ao{constructor(e){this.httpClient=e}startTunnel(e,t){return this.httpClient.request({method:"POST",url:mo`gateway/tunnel`,data:e,options:t})}stopTunnel(e,t){return this.httpClient.request({method:"DELETE",url:mo`gateway/tunnel`,data:e,options:t})}getAllActiveTunnelInfos(e,t){return this.httpClient.request({method:"GET",url:mo`gateway/tunnel/${e}`,options:t})}getGatewayActiveTunnelInfos(e,t,n){return this.httpClient.request({method:"GET",url:mo`gateway/tunnel/${e}/${t}`,options:n})}getActiveTunnelInfo(e,t,n,o,r){return this.httpClient.request({method:"GET",url:mo`gateway/tunnel/${e}/${t}/${n}/${o}`,options:r})}}class so{constructor(e){this.httpClient=e}getAllNodeDefinitions(e){return this.httpClient.request({method:"GET",url:mo`flow`,options:e})}getNodeDefinition(e,t){return this.httpClient.request({method:"GET",url:mo`flow/${e}`,options:t})}getAllNodeDefinitionsByType(e,t){return this.httpClient.request({method:"GET",url:mo`flow/${e}`,options:t})}}class co{constructor(e){this.httpClient=e}deleteConnections(e,t){return this.httpClient.request({method:"DELETE",url:mo`gateway/connection`,queryParams:e,options:t})}getConnections(e){return this.httpClient.request({method:"GET",url:mo`gateway/connection`,options:e})}deleteConnection(e,t){return this.httpClient.request({method:"DELETE",url:mo`gateway/connection/${e}`,options:t})}getConnection(e,t){return this.httpClient.request({method:"GET",url:mo`gateway/connection/${e}`,options:t})}setConnection(e,t,n){return this.httpClient.request({method:"PUT",url:mo`gateway/connection/${e}`,data:t,options:n})}getConnectionStatus(e,t){return this.httpClient.request({method:"GET",url:mo`gateway/status/${e}`,options:t})}}class lo{constructor(e){this.httpClient=e}getDatapointExport(e,t){return this.httpClient.request({method:"GET",url:mo`asset/datapoint/export`,queryParams:e,options:t})}getDatapointPeriod(e,t){return this.httpClient.request({method:"GET",url:mo`asset/datapoint/periods`,queryParams:e,options:t})}getDatapoints(e,t,n,o){return this.httpClient.request({method:"POST",url:mo`asset/datapoint/${e}/${t}`,data:n,options:o})}}class uo{constructor(e){this.httpClient=e}getAssetDescriptors(e,t){return this.httpClient.request({method:"GET",url:mo`model/assetDescriptors`,queryParams:e,options:t})}getAssetInfo(e,t,n){return this.httpClient.request({method:"GET",url:mo`model/assetInfo/${e}`,queryParams:t,options:n})}getAssetInfos(e,t){return this.httpClient.request({method:"GET",url:mo`model/assetInfos`,queryParams:e,options:t})}getMetaItemDescriptors(e,t){return this.httpClient.request({method:"GET",url:mo`model/metaItemDescriptors`,queryParams:e,options:t})}getValueDescriptors(e,t){return this.httpClient.request({method:"GET",url:mo`model/valueDescriptors`,queryParams:e,options:t})}}function mo(e,...t){let n="";for(let o=0;o<t.length;o++)n+=e[o],n+=encodeURIComponent(t[o]);return n+=e[e.length-1],n}class fo{constructor(e,t=Wn().create()){this._statusResource=new ho(e,t),this._userResource=new po(e,t),this._agentResource=new Fo(e,t),this._configurationResource=new _o(e,t),this._rulesResource=new go(e,t),this._dashboardResource=new yo(e,t),this._assetResource=new vo(e,t),this._realmResource=new ko(e,t),this._assetPredictedDatapointResource=new wo(e,t),this._alarmResource=new Mo(e,t),this._provisioningResource=new Lo(e,t),this._notificationResource=new Do(e,t),this._consoleResource=new Eo(e,t),this._appResource=new Ao(e,t),this._syslogResource=new To(e,t),this._mapResource=new Yo(e,t),this._gatewayServiceResource=new Co(e,t),this._flowResource=new So(e,t),this._gatewayClientResource=new xo(e,t),this._assetDatapointResource=new Oo(e,t),this._assetModelResource=new Bo(e,t),this._assetResource=new vo(e,t)}get StatusResource(){return this._statusResource}get UserResource(){return this._userResource}get AgentResource(){return this._agentResource}get ConfigurationResource(){return this._configurationResource}get RulesResource(){return this._rulesResource}get DashboardResource(){return this._dashboardResource}get AssetResource(){return this._assetResource}get RealmResource(){return this._realmResource}get AssetPredictedDatapointResource(){return this._assetPredictedDatapointResource}get AlarmResource(){return this._alarmResource}get ProvisioningResource(){return this._provisioningResource}get NotificationResource(){return this._notificationResource}get ConsoleResource(){return this._consoleResource}get AppResource(){return this._appResource}get SyslogResource(){return this._syslogResource}get MapResource(){return this._mapResource}get GatewayServiceResource(){return this._gatewayServiceResource}get FlowResource(){return this._flowResource}get GatewayClientResource(){return this._gatewayClientResource}get AssetDatapointResource(){return this._assetDatapointResource}get AssetModelResource(){return this._assetModelResource}}class bo{constructor(e){this.axios=e}request(e){const t={};t.method=e.method,t.url=e.url,t.params=e.queryParams,t.data=e.data,function(e,t){if(null!=t)for(const n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}(t,e.options);const n=e.copyFn;return this.axios.request(t).then((e=>(n&&e.data&&(e.originalData=e.data,e.data=n(e.data)),e)))}}class ho extends zn{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class po extends Gn{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class Fo extends qn{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class _o extends $n{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class go extends Vn{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class yo extends Jn{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class vo extends Kn{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class ko extends Xn{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class wo extends Zn{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class Mo extends Qn{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class Lo extends eo{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class Do extends to{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class Eo extends no{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class Ao extends oo{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class To extends ro{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class Yo extends io{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class Co extends ao{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class So extends so{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class xo extends co{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class Oo extends lo{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class Bo extends uo{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}Wn().isAxiosError;const Ro=new class{get api(){return this._client}constructor(){this._axiosInstance=Wn().create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use((e=>(e.paramsSerializer=e=>xn().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 fo(e,this._axiosInstance)}};var Po,jo,Io=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))};(jo=Po||(Po={})).DISCONNECTED="DISCONNECTED",jo.CONNECTED="CONNECTED",jo.CONNECTING="CONNECTING";class No{constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=Ho.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=Po.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;const n=e.indexOf(t);n>=0&&e.splice(n,1)}(this._statusCallbacks,e)}connect(){return this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this._status===Po.CONNECTED?Promise.resolve(!0):(this._disconnectRequested=!1,this._connectingDeferred||(this._onStatusChanged(Po.CONNECTING),this._connectingDeferred=new Pn,this._doConnect().then((e=>{if(this._connectingDeferred){const t=this._connectingDeferred;this._connectingDeferred=null,e?(console.debug("Connected to event service: "+this.endpointUrl),this._reconnectDelayMillis=Ho.MIN_RECONNECT_DELAY,this._onStatusChanged(Po.CONNECTED),window.setTimeout((()=>{this._onConnect()}),0)):(console.debug("Failed to connect to event service: "+this.endpointUrl),this._scheduleReconnect()),t.resolve(e)}}))),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!==Po.DISCONNECTED&&this._doDisconnect())}subscribe(e,t){const n={eventSubscription:e,callback:t,deferred:new Pn};return null!=this._pendingSubscription||this._status!==Po.CONNECTED?(this._queuedSubscriptions.push(n),n.deferred.promise):(this._pendingSubscription=n,this._doSubscribe(e).then((e=>{if(this._pendingSubscription){const t=this._pendingSubscription;this._pendingSubscription=null,this._subscriptionMap.set(e,t),this._processNextSubscription();const n=t.deferred;t.deferred=null,n&&n.resolve(e)}}),(e=>{if(this._pendingSubscription){const t=this._pendingSubscription;this._pendingSubscription=null,this._processNextSubscription();const n=t.deferred;t.deferred=null,n&&n.reject(e)}})),this._pendingSubscription.deferred.promise)}unsubscribe(e){return Io(this,void 0,void 0,(function*(){if(this._subscriptionMap.delete(e))this._doUnsubscribe(e);else if(this._assetEventCallbackMap.delete(e)){if(this._assetEventPromise&&0===this._assetEventCallbackMap.size){const e=yield this._assetEventPromise;this._assetEventPromise=void 0,this.unsubscribe(e)}}else if(this._attributeEventCallbackMap.delete(e)&&this._attributeEventPromise&&0===this._attributeEventCallbackMap.size){const e=yield this._attributeEventPromise;this._attributeEventPromise=void 0,this.unsubscribe(e)}}))}sendEvent(e){this._status===Po.CONNECTED&&this._doSend(e)}sendEventWithReply(e){return this._status!==Po.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(e)}subscribeAssetEvents(e,t,n){return Io(this,void 0,void 0,(function*(){const o=e&&"string"!=typeof e[0]?e.map((e=>e.id)):e,r="AssetEvent"+No._subscriptionCounter++;if(!this._assetEventPromise){let e;Ar.authenticated||(e={filterType:"asset",realm:Ar.displayRealm});const t={eventType:"asset",filter:e};this._assetEventPromise=this.subscribe(t,(e=>{this._assetEventCallbackMap.forEach((t=>t(e)))}))}return this._assetEventCallbackMap.set(r,(e=>{const t=e.asset.id;o?o.find((e=>t===e))&&n(e):e.asset.realm===Ar.displayRealm&&n(e)})),this._assetEventPromise.then((()=>{try{if(o&&t){const e={messageID:"read-assets:"+o.join(",")+":"+r,eventType:"read-assets",assetQuery:{ids:o}};this.sendEventWithReply(e).then((e=>{const t=e;t.assets&&this._assetEventCallbackMap.has(r)&&t.assets.forEach((e=>{n({eventType:"asset",asset:e,cause:"READ"})}))}))}}catch(t){throw console.error("Failed to subscribe to asset events for assets: "+e),r&&this.unsubscribe(r),t}return r}))}))}subscribeAttributeEvents(e,t,n){return Io(this,void 0,void 0,(function*(){const o=e&&"string"!=typeof e[0],r=o?e.map((e=>e.id)):e,i=o?e:void 0,a="AttributeEvent"+No._subscriptionCounter++;if(!this._attributeEventPromise){let e;Ar.authenticated||(e={filterType:"asset",realm:Ar.displayRealm});const t={eventType:"attribute",filter:e};this._attributeEventPromise=this.subscribe(t,(e=>{this._attributeEventCallbackMap.forEach((t=>t(e)))}))}const s=t=>{const i=t.ref;o?e.forEach((e=>{i.id===e.id&&i.name===e.name&&n(t)})):r?r.find((e=>i.id===e))&&n(t):t.realm===Ar.displayRealm&&n(t)};return this._attributeEventCallbackMap.set(a,s),this._attributeEventPromise.then((()=>{try{if(t&&r){const e={messageID:"read-assets:"+r.join(",")+":"+a,eventType:"read-assets",assetQuery:{ids:r}};this.sendEventWithReply(e).then((e=>{const t=e;t.assets&&this._attributeEventCallbackMap.has(a)&&t.assets.forEach((e=>{e.attributes&&Object.entries(e.attributes).forEach((([t,n])=>{i&&!i.find((n=>n.id===e.id&&n.name===t))||s({eventType:"attribute",timestamp:n.timestamp,value:n.value,ref:{id:e.id,name:t}})}))}))}))}}catch(t){throw console.error("Failed to subscribe to asset events for assets: "+e),a&&this.unsubscribe(a),t}return a}))}))}_processNextSubscription(){this._status===Po.CONNECTED&&0!==this._queuedSubscriptions.length&&setTimeout((()=>{const e=this._queuedSubscriptions.shift();e&&this.subscribe(e.eventSubscription,e.callback).then((t=>{const n=e.deferred;e.deferred=null,n&&n.resolve(t)}),(t=>{const n=e.deferred;e.deferred=null,n&&n.reject(t)}))}),0)}_onStatusChanged(e){e!==this._status&&(console.debug("Event provider status changed: "+e),this._status=e,this._unloading||window.setTimeout((()=>{this._statusCallbacks.forEach((t=>t(e)))}),0))}_onMessageReceived(e,t){const n=this._subscriptionMap.get(e);n&&n.callback(t)}_onConnect(){if(Object.keys(this._subscriptionMap).length>0){for(const e in this._subscriptionMap)this._subscriptionMap.has(e)&&this._queuedSubscriptions.unshift(this._subscriptionMap.get(e));this._subscriptionMap.clear()}this._processNextSubscription()}_onDisconnect(){this._status===Po.CONNECTED&&this._onStatusChanged(Po.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._onStatusChanged(Po.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<Ho.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(Ho.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}No.MIN_RECONNECT_DELAY=0,No.MAX_RECONNECT_DELAY=3e4,No._subscriptionCounter=0;class Ho extends No{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="+Ar.config.realm;return Ar.authenticated&&(e+="&Authorization="+Ar.getAuthorizationHeader()),this._webSocket=new WebSocket(e),this._connectDeferred=new Pn,this._webSocket.onopen=()=>{if(this._connectDeferred){const e=this._connectDeferred;this._connectDeferred=null,e.resolve(!0)}},this._webSocket.onerror=e=>{if(this._connectDeferred){const e=this._connectDeferred;this._connectDeferred=null,e.resolve(!1)}else console.debug("Event provider error"),this._beforeDisconnect()},this._webSocket.onclose=()=>{if(this._webSocket=void 0,this._connectDeferred){const e=this._connectDeferred;this._connectDeferred=null,e.resolve(!1)}else this._beforeDisconnect()},this._webSocket.onmessage=e=>{const t=e.data;if(t&&t.startsWith("SUBSCRIBED:")){const e=t.substring(11),n=JSON.parse(e),o=this._subscribeDeferred;this._subscribeDeferred=null,o&&o.resolve(n.subscriptionId)}else if(t.startsWith("UNAUTHORIZED:")){const e=t.substring(13),n=JSON.parse(e),o=this._subscribeDeferred;this._subscribeDeferred=null,o&&(console.warn("Unauthorized event subscription: "+JSON.stringify(n,null,2)),o.reject("Unauthorized"))}else if(t.startsWith("TRIGGERED:")){const e=t.substring(10),n=JSON.parse(e);n.events&&n.events.forEach((e=>{this._onMessageReceived(n.subscriptionId,e)}))}else if(t.startsWith("EVENT:")){const e=t.substring(6),n=JSON.parse(e);if(n.messageID){const e=this._repliesDeferred.get(n.messageID);this._repliesDeferred.delete(n.messageID),e&&e.resolve(n)}}},this._connectDeferred.promise}_beforeDisconnect(){this._onDisconnect()}_doDisconnect(){var e;null===(e=this._webSocket)||void 0===e||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 Pn,e.subscriptionId||(e.subscriptionId=Ho._subscriptionCounter+++""),this._webSocket.send("SUBSCRIBE:"+JSON.stringify(e)),this._subscribeDeferred.promise):Promise.reject("Not connected")}_doUnsubscribe(e){if(!this._webSocket)return;const t={subscriptionId:e};this._webSocket.send("UNSUBSCRIBE:"+JSON.stringify(t))}_doSend(e){const t="EVENT:"+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");const t=new Pn;return this._repliesDeferred.set(e.messageID,t),this._webSocket.send("EVENT:"+JSON.stringify(e)),t.promise}}function Uo(e){return Uo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Uo(e)}Ho._subscriptionCounter=1;var Wo=[],zo=Wo.forEach,Go=Wo.slice;function qo(e){return zo.call(Go.call(arguments,1),(function(t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n])})),e}function $o(){return"function"==typeof XMLHttpRequest||"object"===("undefined"==typeof XMLHttpRequest?"undefined":Uo(XMLHttpRequest))}var Vo,Jo,Ko,Xo=r(6624),Zo=r.t(Xo,2);function Qo(e){return Qo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qo(e)}"function"==typeof fetch&&(Vo="undefined"!=typeof global&&global.fetch?global.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),$o()&&("undefined"!=typeof global&&global.XMLHttpRequest?Jo=global.XMLHttpRequest:"undefined"!=typeof window&&window.XMLHttpRequest&&(Jo=window.XMLHttpRequest)),"function"==typeof ActiveXObject&&("undefined"!=typeof global&&global.ActiveXObject?Ko=global.ActiveXObject:"undefined"!=typeof window&&window.ActiveXObject&&(Ko=window.ActiveXObject)),Vo||!Zo||Jo||Ko||(Vo=Xo||Zo),"function"!=typeof Vo&&(Vo=void 0);var er=function(e,t){if(t&&"object"===Qo(t)){var n="";for(var o in t)n+="&"+encodeURIComponent(o)+"="+encodeURIComponent(t[o]);if(!n)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+n.slice(1)}return e},tr=function(e,t,n){Vo(e,t).then((function(e){if(!e.ok)return n(e.statusText||"Error",{status:e.status});e.text().then((function(t){n(null,{status:e.status,data:t})})).catch(n)})).catch(n)},nr=!1;const or=function(e,t,n,o){return"function"==typeof n&&(o=n,n=void 0),o=o||function(){},Vo?function(e,t,n,o){e.queryStringParams&&(t=er(t,e.queryStringParams));var r=qo({},"function"==typeof e.customHeaders?e.customHeaders():e.customHeaders);n&&(r["Content-Type"]="application/json");var i="function"==typeof e.requestOptions?e.requestOptions(n):e.requestOptions,a=qo({method:n?"POST":"GET",body:n?e.stringify(n):void 0,headers:r},nr?{}:i);try{tr(t,a,o)}catch(e){if(!i||0===Object.keys(i).length||!e.message||e.message.indexOf("not implemented")<0)return o(e);try{Object.keys(i).forEach((function(e){delete a[e]})),tr(t,a,o),nr=!0}catch(e){o(e)}}}(e,t,n,o):$o()||"function"==typeof ActiveXObject?function(e,t,n,o){n&&"object"===Qo(n)&&(n=er("",n).slice(1)),e.queryStringParams&&(t=er(t,e.queryStringParams));try{var r;(r=Jo?new Jo:new Ko("MSXML2.XMLHTTP.3.0")).open(n?"POST":"GET",t,1),e.crossDomain||r.setRequestHeader("X-Requested-With","XMLHttpRequest"),r.withCredentials=!!e.withCredentials,n&&r.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),r.overrideMimeType&&r.overrideMimeType("application/json");var i=e.customHeaders;if(i="function"==typeof i?i():i)for(var a in i)r.setRequestHeader(a,i[a]);r.onreadystatechange=function(){r.readyState>3&&o(r.status>=400?r.statusText:null,{status:r.status,data:r.responseText})},r.send(n)}catch(e){console&&console.log(e)}}(e,t,n,o):void o(new Error("No fetch and no xhr implementation found!"))};function rr(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var ir=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.services=t,this.options=n,this.allOptions=o,this.type="backend",this.init(t,n,o)}var t,n;return t=e,n=[{key:"init",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=qo(n,this.options||{},{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:function(e){return JSON.parse(e)},stringify:JSON.stringify,parsePayload:function(e,t,n){return function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},t,n||"")},request:or,reloadInterval:"undefined"==typeof window&&36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}),this.allOptions=o,this.services&&this.options.reloadInterval&&setInterval((function(){return t.reload()}),this.options.reloadInterval)}},{key:"readMulti",value:function(e,t,n){this._readAny(e,e,t,t,n)}},{key:"read",value:function(e,t,n){this._readAny([e],e,[t],t,n)}},{key:"_readAny",value:function(e,t,n,o,r){var i,a=this,s=this.options.loadPath;"function"==typeof this.options.loadPath&&(s=this.options.loadPath(e,n)),(s=function(e){return!!e&&"function"==typeof e.then}(i=s)?i:Promise.resolve(i)).then((function(i){if(!i)return r(null,{});var s=a.services.interpolator.interpolate(i,{lng:e.join("+"),ns:n.join("+")});a.loadUrl(s,r,t,o)}))}},{key:"loadUrl",value:function(e,t,n,o){var r=this;this.options.request(this.options,e,void 0,(function(i,a){if(a&&(a.status>=500&&a.status<600||!a.status))return t("failed loading "+e+"; status code: "+a.status,!0);if(a&&a.status>=400&&a.status<500)return t("failed loading "+e+"; status code: "+a.status,!1);if(!a&&i&&i.message&&i.message.indexOf("Failed to fetch")>-1)return t("failed loading "+e+": "+i.message,!0);if(i)return t(i,!1);var s,c;try{s="string"==typeof a.data?r.options.parse(a.data,n,o):a.data}catch(t){c="failed parsing "+e+" to json"}if(c)return t(c,!1);t(null,s)}))}},{key:"create",value:function(e,t,n,o,r){var i=this;if(this.options.addPath){"string"==typeof e&&(e=[e]);var a=this.options.parsePayload(t,n,o),s=0,c=[],d=[];e.forEach((function(n){var o=i.options.addPath;"function"==typeof i.options.addPath&&(o=i.options.addPath(n,t));var l=i.services.interpolator.interpolate(o,{lng:n,ns:t});i.options.request(i.options,l,a,(function(t,n){s+=1,c.push(t),d.push(n),s===e.length&&r&&r(c,d)}))}))}}},{key:"reload",value:function(){var e=this,t=this.services,n=t.backendConnector,o=t.languageUtils,r=t.logger,i=n.language;if(!i||"cimode"!==i.toLowerCase()){var a=[],s=function(e){o.toResolveHierarchy(e).forEach((function(e){a.indexOf(e)<0&&a.push(e)}))};s(i),this.allOptions.preload&&this.allOptions.preload.forEach((function(e){return s(e)})),a.forEach((function(t){e.allOptions.ns.forEach((function(e){n.read(t,e,"read",null,null,(function(o,i){o&&r.warn("loading namespace ".concat(e," for language ").concat(t," failed"),o),!o&&i&&r.log("loaded namespace ".concat(e," for language ").concat(t),i),n.loaded("".concat(t,"|").concat(e),o,i)}))}))}))}}}],n&&rr(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();ir.type="backend";const ar=ir,sr=e=>(...t)=>({_$litDirective$:e,values:t});class cr{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}class dr extends cr{constructor(e){if(super(e),this.et=W,2!==e.type)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===W||null==e)return this.ft=void 0,this.et=e;if(e===U)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.et)return this.ft;this.et=e;const t=[e];return t.raw=t,this.ft={_$litType$:this.constructor.resultType,strings:t,values:[]}}}dr.directiveName="unsafeHTML",dr.resultType=1,sr(dr);class lr extends dr{}lr.directiveName="unsafeSVG",lr.resultType=2;const ur=sr(lr),mr=24,fr={logo:'<path style=\'pointer-events: var(--or-icon-pointer-events, none);\' fill="#C4D600" d="m11.96125,23.85096c-6.56773,0 -11.90971,-5.34202 -11.90971,-11.90862l2.49411,0c0,5.19176 4.22389,9.41568 9.41561,9.41568c5.19053,0 9.41561,-4.22392 9.41561,-9.41568c0,-5.19176 -4.22389,-9.41568 -9.41561,-9.41568l0,-2.49413c6.56655,0 11.90971,5.34439 11.90971,11.9098c0,6.5666 -5.34316,11.90862 -11.90971,11.90862l0,0z" /><path fill="#4E9D2D" d="m10.25094,20.38647c-2.26848,-0.47231 -4.21822,-1.80199 -5.48741,-3.74009s-1.70892,-4.25777 -1.23545,-6.52625c0.47347,-2.26965 1.80315,-4.21822 3.74242,-5.48857c1.93926,-1.27035 4.25661,-1.70892 6.52625,-1.23545c4.68471,0.97719 7.70121,5.5828 6.72286,10.26635l-2.39994,-0.49907c0.70149,-3.36085 -1.4623,-6.66585 -4.82431,-7.36734c-1.62866,-0.33969 -3.29105,-0.02559 -4.68238,0.88645c-1.39134,0.91088 -2.34526,2.3092 -2.68495,3.93786c-0.33853,1.62633 -0.02443,3.28988 0.88645,4.68122c0.91088,1.39134 2.3092,2.34526 3.93786,2.68379l-0.50139,2.4011l0,0z"/><path fill="#1D5632"d="m12.03064,17.49616c-0.09524,0 -0.19048,-0.00116 -0.28457,-0.00465c-1.49833,-0.0755 -2.87818,-0.72942 -3.88636,-1.84097c-1.00818,-1.11271 -1.52156,-2.54948 -1.44722,-4.05013l2.44378,0.12196c-0.04181,0.84557 0.24856,1.65745 0.81769,2.28466c0.56681,0.62721 1.34733,0.99656 2.1929,1.03838c0.84208,0.03833 1.65629,-0.2474 2.2835,-0.81653c0.62837,-0.56797 0.99656,-1.34617 1.03954,-2.19174c0.08711,-1.74573 -1.26371,-3.23708 -3.00943,-3.3242l0.12196,-2.44378c3.09422,0.15332 5.4869,2.79455 5.33358,5.88877c-0.07434,1.49949 -0.72942,2.87818 -1.84097,3.8852c-1.04186,0.94313 -2.36945,1.45303 -3.7644,1.45303l0,0z"/>',"logo-plain":"m11.9925,23.91349c-6.58498,0 -11.94099,-5.35605 -11.94099,-11.9399l2.50066,0c0,5.20539 4.23498,9.44041 9.44033,9.44041c5.20416,0 9.44033,-4.23502 9.44033,-9.44041c0,-5.20539 -4.23498,-9.44041 -9.44033,-9.44041l0,-2.50068c6.5838,0 11.94099,5.35842 11.94099,11.94108c0,6.58385 -5.35719,11.9399 -11.94099,11.9399l0,0zm-1.80787,-3.27769c-2.31323,-0.48163 -4.30141,-1.83755 -5.59563,-3.81389s-1.74263,-4.34178 -1.25982,-6.65502c0.48281,-2.31443 1.83872,-4.30145 3.81623,-5.59686c1.97751,-1.29542 4.34056,-1.74264 6.65497,-1.25983c4.77711,0.99647 7.8531,5.69295 6.85545,10.46891l-2.44727,-0.50891c0.71532,-3.42716 -1.49114,-6.79738 -4.91946,-7.5127c-1.66078,-0.34639 -3.35596,-0.0261 -4.77474,0.90394c-1.41878,0.92886 -2.39152,2.35476 -2.73791,4.01555c-0.3452,1.65842 -0.02491,3.3548 0.90394,4.77359c0.92885,1.41879 2.35475,2.39154 4.01552,2.73675l-0.51128,2.44848l0,0zm1.81499,-2.92536c-0.09727,0 -0.19455,-0.00119 -0.29064,-0.00475c-1.53029,-0.07711 -2.93958,-0.74498 -3.96926,-1.88025c-1.02968,-1.13646 -1.55401,-2.60388 -1.47809,-4.13655l2.49591,0.12456c-0.04271,0.86361 0.25386,1.69282 0.83513,2.33341c0.5789,0.64059 1.37607,1.01783 2.23968,1.06053c0.86005,0.03915 1.69162,-0.25268 2.33221,-0.83395c0.64177,-0.58009 1.01782,-1.3749 1.06171,-2.23851c0.08897,-1.78298 -1.29066,-3.30616 -3.07362,-3.39513l0.12456,-2.49593c3.16022,0.15659 5.60394,2.85419 5.44735,6.01443c-0.07592,1.53149 -0.74498,2.9396 -1.88024,3.9681c-1.06408,0.96326 -2.41999,1.48403 -3.8447,1.48403l0,0z",marker:'<ellipse fill="#000" opacity="0.2" ry="1.5" rx="4" cy="22.5" cx="12" /><path style=\'pointer-events: var(--or-icon-pointer-events, none);\' d="m11.999999,0a8.437501,8.344057 0 0 1 8.437501,8.344057c0,6.500779 -5.798864,6.280799 -8.437501,14.412461c-2.638637,-8.131662 -8.437501,-7.911683 -8.437501,-14.412461a8.437501,8.344057 0 0 1 8.437501,-8.344057z" />'};var br=function(e,t,n,o){var r,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a};const hr=r(180);class pr extends CustomEvent{constructor(){super(pr.NAME,{bubbles:!0,composed:!0})}}pr.NAME="or-iconset-added";const Fr=new class{constructor(){this._icons={}}addIconSet(e,t){this._icons[e]=t,this._defaultIconSet||(this._defaultIconSet=t),t.onAdd&&t.onAdd(),window.dispatchEvent(new pr)}getIconSet(e){return this._icons[e]}getIconTemplate(e){if(!e)return H``;const t=(e||"").split(":"),n=t.pop(),o=t.pop();let r=this._defaultIconSet;return o&&(r=this.getIconSet(o)),n&&r?r.getIconTemplate(n):H``}};let _r=class extends se{constructor(){super(...arguments),this._handler=e=>{this._updateIcon()}}static get styles(){return[c`
|
|
180
|
+
`;function be(e){return be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},be(e)}function he(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pe(e){var t=function(e,t){if("object"!=be(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!=be(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==be(t)?t:String(t)}function Fe(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,pe(o.key),o)}}function _e(e,t,n){return t&&Fe(e.prototype,t),n&&Fe(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ge(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ye(e,t){return ye=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ye(e,t)}function ve(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ye(e,t)}function ke(e,t){if(t&&("object"===be(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ge(e)}function we(e){return we=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},we(e)}function Me(e,t,n){return(t=pe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Le(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function De(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Ee(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?De(Object(n),!0).forEach((function(t){Me(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):De(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}r(2960);var Ae={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},Te=new(function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};he(this,e),this.init(t,n)}return _e(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||Ae,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,o){return o&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,Ee(Ee({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}},{key:"clone",value:function(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)}}]),e}()),Ye=function(){function e(){he(this,e),this.observers={}}return _e(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];this.observers[e]&&[].concat(this.observers[e]).forEach((function(e){e.apply(void 0,n)})),this.observers["*"]&&[].concat(this.observers["*"]).forEach((function(t){t.apply(t,[e].concat(n))}))}}]),e}();function Ce(){var e,t,n=new Promise((function(n,o){e=n,t=o}));return n.resolve=e,n.reject=t,n}function Se(e){return null==e?"":""+e}function xe(e,t,n){function o(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function r(){return!e||"string"==typeof e}for(var i="string"!=typeof t?[].concat(t):t.split(".");i.length>1;){if(r())return{};var a=o(i.shift());!e[a]&&n&&(e[a]=new n),e=Object.prototype.hasOwnProperty.call(e,a)?e[a]:{}}return r()?{}:{obj:e,k:o(i.shift())}}function Oe(e,t,n){var o=xe(e,t,Object);o.obj[o.k]=n}function Be(e,t){var n=xe(e,t),o=n.obj,r=n.k;if(o)return o[r]}function Re(e,t,n){var o=Be(e,n);return void 0!==o?o:Be(t,n)}function Pe(e,t,n){for(var o in t)"__proto__"!==o&&"constructor"!==o&&(o in e?"string"==typeof e[o]||e[o]instanceof String||"string"==typeof t[o]||t[o]instanceof String?n&&(e[o]=t[o]):Pe(e[o],t[o],n):e[o]=t[o]);return e}function je(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Ie={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function Ne(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return Ie[e]})):e}var He="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Ue=[" ",",","?","!",";"];function We(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function ze(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?We(Object(n),!0).forEach((function(t){Me(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):We(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ge(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var o=t.split(n),r=e,i=0;i<o.length;++i){if(!r)return;if("string"==typeof r[o[i]]&&i+1<o.length)return;if(void 0===r[o[i]]){for(var a=2,s=o.slice(i,i+a).join(n),c=r[s];void 0===c&&o.length>i+a;)a++,c=r[s=o.slice(i,i+a).join(n)];if(void 0===c)return;if(null===c)return null;if(t.endsWith(s)){if("string"==typeof c)return c;if(s&&"string"==typeof c[s])return c[s]}var d=o.slice(i+a).join(n);return d?Ge(c,d,n):void 0}r=r[o[i]]}return r}}var qe=function(e){ve(r,e);var t,n,o=(t=r,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,o=we(t);if(n){var r=we(this).constructor;e=Reflect.construct(o,arguments,r)}else e=o.apply(this,arguments);return ke(this,e)});function r(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return he(this,r),t=o.call(this),He&&Ye.call(ge(t)),t.data=e||{},t.options=n,void 0===t.options.keySeparator&&(t.options.keySeparator="."),void 0===t.options.ignoreJSONStructure&&(t.options.ignoreJSONStructure=!0),t}return _e(r,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,i=void 0!==o.ignoreJSONStructure?o.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[e,t];n&&"string"!=typeof n&&(a=a.concat(n)),n&&"string"==typeof n&&(a=a.concat(r?n.split(r):n)),e.indexOf(".")>-1&&(a=e.split("."));var s=Be(this.data,a);return s||!i||"string"!=typeof n?s:Ge(this.data&&this.data[e]&&this.data[e][t],n,r)}},{key:"addResource",value:function(e,t,n,o){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=this.options.keySeparator;void 0===i&&(i=".");var a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(o=t,t=(a=e.split("."))[1]),this.addNamespaces(t),Oe(this.data,a,o),r.silent||this.emit("added",e,t,n,o)}},{key:"addResources",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var r in n)"string"!=typeof n[r]&&"[object Array]"!==Object.prototype.toString.apply(n[r])||this.addResource(e,t,r,n[r],{silent:!0});o.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,o,r){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(o=n,n=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var s=Be(this.data,a)||{};o?Pe(s,n,r):s=ze(ze({},s),n),Oe(this.data,a,s),i.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?ze(ze({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),r}(Ye),$e={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,o,r){var i=this;return e.forEach((function(e){i.processors[e]&&(t=i.processors[e].process(t,n,o,r))})),t}};function Ve(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Je(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ve(Object(n),!0).forEach((function(t){Me(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ve(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ke={},Xe=function(e){ve(r,e);var t,n,o=(t=r,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,o=we(t);if(n){var r=we(this).constructor;e=Reflect.construct(o,arguments,r)}else e=o.apply(this,arguments);return ke(this,e)});function r(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return he(this,r),t=o.call(this),He&&Ye.call(ge(t)),function(e,t,n){["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach((function(e){t[e]&&(n[e]=t[e])}))}(0,e,ge(t)),t.options=n,void 0===t.options.keySeparator&&(t.options.keySeparator="."),t.logger=Te.create("translator"),t}return _e(r,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,r=t.ns||this.options.defaultNS||[],i=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";var o=Ue.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===o.length)return!0;var r=new RegExp("(".concat(o.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),i=!r.test(e);if(!i){var a=e.indexOf(n);a>0&&!r.test(e.substring(0,a))&&(i=!0)}return i}(e,n,o));if(i&&!a){var s=e.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:e,namespaces:r};var c=e.split(n);(n!==o||n===o&&this.options.ns.indexOf(c[0])>-1)&&(r=c.shift()),e=c.join(o)}return"string"==typeof r&&(r=[r]),{key:e,namespaces:r}}},{key:"translate",value:function(e,t,n){var o=this;if("object"!==be(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var i=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,a=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,s=this.extractFromKey(e[e.length-1],t),c=s.key,d=s.namespaces,l=d[d.length-1],u=t.lng||this.language,m=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&"cimode"===u.toLowerCase()){if(m){var f=t.nsSeparator||this.options.nsSeparator;return i?(b.res="".concat(l).concat(f).concat(c),b):"".concat(l).concat(f).concat(c)}return i?(b.res=c,b):c}var b=this.resolve(e,t),h=b&&b.res,p=b&&b.usedKey||c,F=b&&b.exactUsedKey||c,_=Object.prototype.toString.apply(h),g=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject;if(y&&h&&"string"!=typeof h&&"boolean"!=typeof h&&"number"!=typeof h&&["[object Number]","[object Function]","[object RegExp]"].indexOf(_)<0&&("string"!=typeof g||"[object Array]"!==_)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var v=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,h,Je(Je({},t),{},{ns:d})):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");return i?(b.res=v,b):v}if(a){var k="[object Array]"===_,w=k?[]:{},M=k?F:p;for(var L in h)if(Object.prototype.hasOwnProperty.call(h,L)){var D="".concat(M).concat(a).concat(L);w[L]=this.translate(D,Je(Je({},t),{joinArrays:!1,ns:d})),w[L]===D&&(w[L]=h[L])}h=w}}else if(y&&"string"==typeof g&&"[object Array]"===_)(h=h.join(g))&&(h=this.extendTranslation(h,e,t,n));else{var E=!1,A=!1,T=void 0!==t.count&&"string"!=typeof t.count,Y=r.hasDefaultValue(t),C=T?this.pluralResolver.getSuffix(u,t.count,t):"",S=t["defaultValue".concat(C)]||t.defaultValue;!this.isValidLookup(h)&&Y&&(E=!0,h=S),this.isValidLookup(h)||(A=!0,h=c);var x=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&A?void 0:h,O=Y&&S!==h&&this.options.updateMissing;if(A||E||O){if(this.logger.log(O?"updateKey":"missingKey",u,l,c,O?S:h),a){var B=this.resolve(c,Je(Je({},t),{},{keySeparator:!1}));B&&B.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var R=[],P=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&P&&P[0])for(var j=0;j<P.length;j++)R.push(P[j]);else"all"===this.options.saveMissingTo?R=this.languageUtils.toResolveHierarchy(t.lng||this.language):R.push(t.lng||this.language);var I=function(e,n,r){var i=Y&&r!==h?r:x;o.options.missingKeyHandler?o.options.missingKeyHandler(e,l,n,i,O,t):o.backendConnector&&o.backendConnector.saveMissing&&o.backendConnector.saveMissing(e,l,n,i,O,t),o.emit("missingKey",e,l,n,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&T?R.forEach((function(e){o.pluralResolver.getSuffixes(e,t).forEach((function(n){I([e],c+n,t["defaultValue".concat(n)]||S)}))})):I(R,c,S))}h=this.extendTranslation(h,e,t,b,n),A&&h===c&&this.options.appendNamespaceToMissingKey&&(h="".concat(l,":").concat(c)),(A||E)&&this.options.parseMissingKeyHandler&&(h="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(l,":").concat(c):c,E?h:void 0):this.options.parseMissingKeyHandler(h))}return i?(b.res=h,b):h}},{key:"extendTranslation",value:function(e,t,n,o,r){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,Je(Je({},this.options.interpolation.defaultVariables),n),o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(Je(Je({},n),{interpolation:Je(Je({},this.options.interpolation),n.interpolation)}));var a,s="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(s){var c=e.match(this.interpolator.nestingRegexp);a=c&&c.length}var d=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(d=Je(Je({},this.options.interpolation.defaultVariables),d)),e=this.interpolator.interpolate(e,d,n.lng||this.language,n),s){var l=e.match(this.interpolator.nestingRegexp);a<(l&&l.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,o=new Array(e),a=0;a<e;a++)o[a]=arguments[a];return r&&r[0]===o[0]&&!n.context?(i.logger.warn("It seems you are nesting recursively key: ".concat(o[0]," in key: ").concat(t[0])),null):i.translate.apply(i,o.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var u=n.postProcess||this.options.postProcess,m="string"==typeof u?[u]:u;return null!=e&&m&&m.length&&!1!==n.applyPostProcessor&&(e=$e.handle(m,e,t,this.options&&this.options.postProcessPassResolved?Je({i18nResolved:o},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,o,r,i,a=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!a.isValidLookup(t)){var c=a.extractFromKey(e,s),d=c.key;n=d;var l=c.namespaces;a.options.fallbackNS&&(l=l.concat(a.options.fallbackNS));var u=void 0!==s.count&&"string"!=typeof s.count,m=u&&!s.ordinal&&0===s.count&&a.pluralResolver.shouldUseIntlApi(),f=void 0!==s.context&&("string"==typeof s.context||"number"==typeof s.context)&&""!==s.context,b=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);l.forEach((function(e){a.isValidLookup(t)||(i=e,!Ke["".concat(b[0],"-").concat(e)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(i)&&(Ke["".concat(b[0],"-").concat(e)]=!0,a.logger.warn('key "'.concat(n,'" for languages "').concat(b.join(", "),'" won\'t get resolved as namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),b.forEach((function(n){if(!a.isValidLookup(t)){r=n;var i,c=[d];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(c,d,n,e,s);else{var l;u&&(l=a.pluralResolver.getSuffix(n,s.count,s));var b="".concat(a.options.pluralSeparator,"zero");if(u&&(c.push(d+l),m&&c.push(d+b)),f){var h="".concat(d).concat(a.options.contextSeparator).concat(s.context);c.push(h),u&&(c.push(h+l),m&&c.push(h+b))}}for(;i=c.pop();)a.isValidLookup(t)||(o=i,t=a.getResource(n,e,i,s))}})))}))}})),{res:t,usedKey:n,exactUsedKey:o,usedLng:r,usedNS:i}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,o):this.resourceStore.getResource(e,t,n,o)}}],[{key:"hasDefaultValue",value:function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"defaultValue"===t.substring(0,12)&&void 0!==e[t])return!0;return!1}}]),r}(Ye);function Ze(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Qe=function(){function e(t){he(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Te.create("languageUtils")}return _e(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Ze(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Ze(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=Ze(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var o=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(o)||(t=o)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var o=n.getLanguagePartFromCode(e);if(n.isSupportedCode(o))return t=o;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(o))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,o=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],i=function(e){e&&(n.isSupportedCode(e)?r.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):"string"==typeof e&&i(this.formatLanguageCode(e)),o.forEach((function(e){r.indexOf(e)<0&&i(n.formatLanguageCode(e))})),r}}]),e}(),et=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],tt={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},nt=["v1","v2","v3"],ot={zero:0,one:1,two:2,few:3,many:4,other:5},rt=function(){function e(t){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};he(this,e),this.languageUtils=t,this.options=o,this.logger=Te.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(n={},et.forEach((function(e){e.lngs.forEach((function(t){n[t]={numbers:e.nr,plurals:tt[e.fc]}}))})),n)}return _e(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.getRule(e,n);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort((function(e,t){return ot[e]-ot[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):o.numbers.map((function(o){return t.getSuffix(e,o,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=this.getRule(e,n);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(t)):this.getSuffixRetroCompatible(o,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,o=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),r=e.numbers[o];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===r?r="plural":1===r&&(r=""));var i=function(){return n.options.prepend&&r.toString()?n.options.prepend+r.toString():r.toString()};return"v1"===this.options.compatibilityJSON?1===r?"":"number"==typeof r?"_plural_".concat(r.toString()):i():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?i():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!nt.includes(this.options.compatibilityJSON)}}]),e}();function it(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function at(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?it(Object(n),!0).forEach((function(t){Me(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):it(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var st=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};he(this,e),this.logger=Te.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return _e(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:Ne,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?je(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?je(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?je(t.nestingPrefix):t.nestingPrefixEscaped||je("$t("),this.nestingSuffix=t.nestingSuffix?je(t.nestingSuffix):t.nestingSuffixEscaped||je(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,o){var r,i,a,s=this,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function d(e){return e.replace(/\$/g,"$$$$")}var l=function(e){if(e.indexOf(s.formatSeparator)<0){var r=Re(t,c,e);return s.alwaysFormat?s.format(r,void 0,n,at(at(at({},o),t),{},{interpolationkey:e})):r}var i=e.split(s.formatSeparator),a=i.shift().trim(),d=i.join(s.formatSeparator).trim();return s.format(Re(t,c,a),d,n,at(at(at({},o),t),{},{interpolationkey:a}))};this.resetRegExp();var u=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,m=o&&o.interpolation&&void 0!==o.interpolation.skipOnVariables?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return d(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?d(s.escape(e)):d(e)}}].forEach((function(t){for(a=0;r=t.regex.exec(e);){var n=r[1].trim();if(void 0===(i=l(n)))if("function"==typeof u){var c=u(e,r,o);i="string"==typeof c?c:""}else if(o&&o.hasOwnProperty(n))i="";else{if(m){i=r[0];continue}s.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),i=""}else"string"==typeof i||s.useRawValueToEscape||(i=Se(i));var d=t.safeValue(i);if(e=e.replace(r[0],d),m?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=r[0].length):t.regex.lastIndex=0,++a>=s.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,o,r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=at({},i);function s(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var o=e.split(new RegExp("".concat(n,"[ ]*{"))),r="{".concat(o[1]);e=o[0];var i=(r=this.interpolate(r,a)).match(/'/g),s=r.match(/"/g);(i&&i.length%2==0&&!s||s.length%2!=0)&&(r=r.replace(/'/g,'"'));try{a=JSON.parse(r),t&&(a=at(at({},t),a))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(r)}return delete a.defaultValue,e}for(a.applyPostProcessor=!1,delete a.defaultValue;n=this.nestingRegexp.exec(e);){var c=[],d=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var l=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=l.shift(),c=l,d=!0}if((o=t(s.call(this,n[1].trim(),a),a))&&n[0]===e&&"string"!=typeof o)return o;"string"!=typeof o&&(o=Se(o)),o||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),o=""),d&&(o=c.reduce((function(e,t){return r.format(e,t,i.lng,at(at({},i),{},{interpolationkey:n[1].trim()}))}),o.trim())),e=e.replace(n[0],o),this.regexp.lastIndex=0}return e}}]),e}();function ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function dt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ct(Object(n),!0).forEach((function(t){Me(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ct(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function lt(e){var t={};return function(n,o,r){var i=o+JSON.stringify(r),a=t[i];return a||(a=e(o,r),t[i]=a),a(n)}}var ut=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};he(this,e),this.logger=Te.create("formatter"),this.options=t,this.formats={number:lt((function(e,t){var n=new Intl.NumberFormat(e,t);return function(e){return n.format(e)}})),currency:lt((function(e,t){var n=new Intl.NumberFormat(e,dt(dt({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:lt((function(e,t){var n=new Intl.DateTimeFormat(e,dt({},t));return function(e){return n.format(e)}})),relativetime:lt((function(e,t){var n=new Intl.RelativeTimeFormat(e,dt({},t));return function(e){return n.format(e,t.range||"day")}})),list:lt((function(e,t){var n=new Intl.ListFormat(e,dt({},t));return function(e){return n.format(e)}}))},this.init(t)}return _e(e,[{key:"init",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=lt(t)}},{key:"format",value:function(e,t,n,o){var r=this,i=t.split(this.formatSeparator).reduce((function(e,t){var i=function(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var o=e.split("(");t=o[0].toLowerCase().trim();var r=o[1].substring(0,o[1].length-1);"currency"===t&&r.indexOf(":")<0?n.currency||(n.currency=r.trim()):"relativetime"===t&&r.indexOf(":")<0?n.range||(n.range=r.trim()):r.split(";").forEach((function(e){if(e){var t=function(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Le(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Le(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e.split(":")),o=t[0],r=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[o.trim()]||(n[o.trim()]=r),"false"===r&&(n[o.trim()]=!1),"true"===r&&(n[o.trim()]=!0),isNaN(r)||(n[o.trim()]=parseInt(r,10))}}))}return{formatName:t,formatOptions:n}}(t),a=i.formatName,s=i.formatOptions;if(r.formats[a]){var c=e;try{var d=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},l=d.locale||d.lng||o.locale||o.lng||n;c=r.formats[a](e,l,dt(dt(dt({},s),o),d))}catch(e){r.logger.warn(e)}return c}return r.logger.warn("there was no format function for ".concat(a)),e}),e);return i}}]),e}();function mt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function ft(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mt(Object(n),!0).forEach((function(t){Me(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var bt=function(e){ve(r,e);var t,n,o=(t=r,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,o=we(t);if(n){var r=we(this).constructor;e=Reflect.construct(o,arguments,r)}else e=o.apply(this,arguments);return ke(this,e)});function r(e,t,n){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return he(this,r),i=o.call(this),He&&Ye.call(ge(i)),i.backend=e,i.store=t,i.services=n,i.languageUtils=n.languageUtils,i.options=a,i.logger=Te.create("backendConnector"),i.waitingReads=[],i.maxParallelReads=a.maxParallelReads||10,i.readingCalls=0,i.maxRetries=a.maxRetries>=0?a.maxRetries:5,i.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(n,a.backend,a),i}return _e(r,[{key:"queueLoad",value:function(e,t,n,o){var r=this,i={},a={},s={},c={};return e.forEach((function(e){var o=!0;t.forEach((function(t){var s="".concat(e,"|").concat(t);!n.reload&&r.store.hasResourceBundle(e,t)?r.state[s]=2:r.state[s]<0||(1===r.state[s]?void 0===a[s]&&(a[s]=!0):(r.state[s]=1,o=!1,void 0===a[s]&&(a[s]=!0),void 0===i[s]&&(i[s]=!0),void 0===c[t]&&(c[t]=!0)))})),o||(s[e]=!0)})),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(c)}}},{key:"loaded",value:function(e,t,n){var o=e.split("|"),r=o[0],i=o[1];t&&this.emit("failedLoading",r,i,t),n&&this.store.addResourceBundle(r,i,n),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(n){!function(e,t,n,o){var r=xe(e,t,Object),i=r.obj,a=r.k;i[a]=i[a]||[],i[a].push(n)}(n.loaded,[r],i),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(e){a[e]||(a[e]={});var t=n.loaded[e];t.length&&t.forEach((function(t){void 0===a[e][t]&&(a[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var o=this,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;return e.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a}):(this.readingCalls++,this.backend[n](e,t,(function(s,c){if(o.readingCalls--,o.waitingReads.length>0){var d=o.waitingReads.shift();o.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}s&&c&&r<o.maxRetries?setTimeout((function(){o.read.call(o,e,t,n,r+1,2*i,a)}),i):a(s,c)}))):a(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var i=this.queueLoad(e,t,o,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=e.split("|"),r=o[0],i=o[1];this.read(r,i,"read",void 0,void 0,(function(o,a){o&&t.logger.warn("".concat(n,"loading namespace ").concat(i," for language ").concat(r," failed"),o),!o&&a&&t.logger.log("".concat(n,"loaded namespace ").concat(i," for language ").concat(r),a),t.loaded(e,o,a)}))}},{key:"saveMissing",value:function(e,t,n,o,r){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,o,null,ft(ft({},i),{},{isUpdate:r})),e&&e[0]&&this.store.addResource(e[0],t,n,o))}}]),r}(Ye);function ht(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function pt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Ft(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pt(Object(n),!0).forEach((function(t){Me(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _t(){}var gt=function(e){ve(r,e);var t,n,o=(t=r,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,o=we(t);if(n){var r=we(this).constructor;e=Reflect.construct(o,arguments,r)}else e=o.apply(this,arguments);return ke(this,e)});function r(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(he(this,r),e=o.call(this),He&&Ye.call(ge(e)),e.options=ht(n),e.services={},e.logger=Te,e.modules={external:[]},t=ge(e),Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach((function(e){"function"==typeof t[e]&&(t[e]=t[e].bind(t))})),i&&!e.isInitialized&&!n.isClone){if(!e.options.initImmediate)return e.init(n,i),ke(e,ge(e));setTimeout((function(){e.init(n,i)}),0)}return e}return _e(r,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var o={debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===be(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===be(e[2])||"object"===be(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,o){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}};function r(e){return e?"function"==typeof e?new e:e:null}if(this.options=Ft(Ft(Ft({},o),this.options),ht(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=Ft(Ft({},o.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var i;this.modules.logger?Te.init(r(this.modules.logger),this.options):Te.init(null,this.options),this.modules.formatter?i=this.modules.formatter:"undefined"!=typeof Intl&&(i=ut);var a=new Qe(this.options);this.store=new qe(this.options.resources,this.options);var s=this.services;s.logger=Te,s.resourceStore=this.store,s.languageUtils=a,s.pluralResolver=new rt(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!i||this.options.interpolation.format&&this.options.interpolation.format!==o.interpolation.format||(s.formatter=r(i),s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new st(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new bt(r(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];e.emit.apply(e,[t].concat(o))})),this.modules.languageDetector&&(s.languageDetector=r(this.modules.languageDetector),s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=r(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new Xe(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];e.emit.apply(e,[t].concat(o))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.format=this.options.interpolation.format,n||(n=_t),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&"dev"!==c[0]&&(this.options.lng=c[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var d=Ce(),l=function(){var t=function(t,o){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),d.resolve(o),n(t,o)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?l():setTimeout(l,0),d}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_t,o="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(o&&"cimode"===o.toLowerCase())return n();var r=[],i=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){r.indexOf(e)<0&&r.push(e)}))};o?i(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((function(e){return i(e)})),this.options.preload&&this.options.preload.forEach((function(e){return i(e)})),this.services.backendConnector.load(r,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),n(e)}))}else n(null)}},{key:"reloadResources",value:function(e,t,n){var o=Ce();return e||(e=this.languages),t||(t=this.options.ns),n||(n=_t),this.services.backendConnector.reload(e,t,(function(e){o.resolve(),n(e)})),o}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&$e.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var o=Ce();this.emit("languageChanging",e);var r=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},i=function(i){e||i||!n.services.languageDetector||(i=[]);var a="string"==typeof i?i:n.services.languageUtils.getBestMatchFromCodes(i);a&&(n.language||r(a),n.translator.language||n.translator.changeLanguage(a),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(a)),n.loadResources(a,(function(e){!function(e,i){i?(r(i),n.translator.changeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languageChanged",i),n.logger.log("languageChanged",i)):n.isLanguageChangingTo=void 0,o.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,a)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),o}},{key:"getFixedT",value:function(e,t,n){var o=this,r=function e(t,r){var i;if("object"!==be(r)){for(var a=arguments.length,s=new Array(a>2?a-2:0),c=2;c<a;c++)s[c-2]=arguments[c];i=o.options.overloadTranslationOptionHandler([t,r].concat(s))}else i=Ft({},r);i.lng=i.lng||e.lng,i.lngs=i.lngs||e.lngs,i.ns=i.ns||e.ns,i.keyPrefix=i.keyPrefix||n||e.keyPrefix;var d=o.options.keySeparator||".",l=i.keyPrefix?"".concat(i.keyPrefix).concat(d).concat(t):t;return o.t(l,i)};return"string"==typeof e?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var o=this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===o.toLowerCase())return!0;var a=function(e,n){var o=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===o||2===o};if(n.precheck){var s=n.precheck(this,a);if(void 0!==s)return s}return!(!this.hasResourceBundle(o,e)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!a(o,e)||r&&!a(i,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,o=Ce();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){o.resolve(),t&&t(e)})),o):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=Ce();"string"==typeof e&&(e=[e]);var o=this.options.preload||[],r=e.filter((function(e){return o.indexOf(e)<0}));return r.length?(this.options.preload=o.concat(r),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){return e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),e?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr":"rtl"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_t,o=Ft(Ft(Ft({},this.options),t),{isClone:!0}),i=new r(o);return void 0===t.debug&&void 0===t.prefix||(i.logger=i.logger.clone(t)),["store","services","language"].forEach((function(t){i[t]=e[t]})),i.services=Ft({},this.services),i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i.translator=new Xe(i.services,i.options),i.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];i.emit.apply(i,[e].concat(n))})),i.init(o,n),i.translator.options=i.options,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),r}(Ye);Me(gt,"createInstance",(function(){return new gt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}));var yt=gt.createInstance();yt.createInstance=gt.createInstance,yt.createInstance,yt.init,yt.loadResources,yt.reloadResources,yt.use,yt.changeLanguage,yt.getFixedT,yt.t,yt.exists,yt.setDefaultNamespace,yt.hasLoadedNamespace,yt.loadNamespaces,yt.loadLanguages;const vt=yt;var kt,wt,Mt,Lt,Dt,Et,At,Tt,Yt,Ct,St,xt,Ot,Bt,Rt,Pt,jt,It,Nt,Ht,Ut,Wt,zt,Gt,qt,$t,Vt,Jt,Kt,Xt,Zt,Qt,en,tn,nn,on,rn,an,sn,cn,dn,ln,un,mn,fn,bn,hn,pn,Fn,_n,gn,yn,vn,kn,wn,Mn,Ln,Dn,En,An,Tn,Yn,Cn,Sn=r(6960),xn=r.n(Sn);!function(e){e.CREATE="CREATE",e.UPDATE="UPDATE",e.DELETE="DELETE"}(kt||(kt={})),function(e){e.LOW="LOW",e.MEDIUM="MEDIUM",e.HIGH="HIGH"}(wt||(wt={})),function(e){e.MANUAL="MANUAL",e.CLIENT="CLIENT",e.GLOBAL_RULESET="GLOBAL_RULESET",e.REALM_RULESET="REALM_RULESET",e.ASSET_RULESET="ASSET_RULESET",e.AGENT="AGENT"}(Mt||(Mt={})),function(e){e.OPEN="OPEN",e.ACKNOWLEDGED="ACKNOWLEDGED",e.IN_PROGRESS="IN_PROGRESS",e.RESOLVED="RESOLVED",e.CLOSED="CLOSED"}(Lt||(Lt={})),function(e){e.BOTTOM_LEFT="BOTTOM_LEFT",e.BOTTOM_RIGHT="BOTTOM_RIGHT",e.TOP_LEFT="TOP_LEFT",e.TOP_RIGHT="TOP_RIGHT"}(Dt||(Dt={})),function(e){e.CREATE="CREATE",e.READ="READ",e.UPDATE="UPDATE",e.DELETE="DELETE"}(Et||(Et={})),function(e){e.NONE="NONE",e.FORECAST="FORECAST",e.SETPOINT="SETPOINT"}(At||(At={})),function(e){e.DISCONNECTED="DISCONNECTED",e.CONNECTING="CONNECTING",e.DISCONNECTING="DISCONNECTING",e.CONNECTED="CONNECTED",e.DISABLED="DISABLED",e.WAITING="WAITING",e.ERROR="ERROR",e.STOPPED="STOPPED"}(Tt||(Tt={})),function(e){e.EV="EV",e.PHEV="PHEV"}(Yt||(Yt={})),function(e){e.YAZAKI="YAZAKI",e.MENNEKES="MENNEKES",e.LE_GRAND="LE_GRAND",e.CHADEMO="CHADEMO",e.COMBO="COMBO",e.SCHUKO="SCHUKO",e.ENERGYLOCK="ENERGYLOCK"}(Ct||(Ct={})),function(e){e.SOUTH="SOUTH",e.EAST_WEST="EAST_WEST"}(St||(St={})),function(e){e.REQUEST_START="REQUEST_START",e.REQUEST_REPEATING="REQUEST_REPEATING",e.REQUEST_CANCEL="REQUEST_CANCEL",e.READY="READY",e.COMPLETED="COMPLETED",e.RUNNING="RUNNING",e.CANCELLED="CANCELLED"}(xt||(xt={})),function(e){e.TOGGLE="TOGGLE",e.INCREMENT="INCREMENT",e.DECREMENT="DECREMENT",e.NEGATE="NEGATE"}(Ot||(Ot={})),function(e){e.ASSET_NOT_FOUND="ASSET_NOT_FOUND",e.ATTRIBUTE_NOT_FOUND="ATTRIBUTE_NOT_FOUND",e.INSUFFICIENT_ACCESS="INSUFFICIENT_ACCESS",e.INVALID_VALUE="INVALID_VALUE",e.INTERCEPTOR_FAILURE="INTERCEPTOR_FAILURE",e.STATE_STORAGE_FAILED="STATE_STORAGE_FAILED",e.CANNOT_PROCESS="CANNOT_PROCESS",e.QUEUE_FULL="QUEUE_FULL",e.UNKNOWN="UNKNOWN",e.ASSET_ID_MISSING="ASSET_ID_MISSING",e.ATTRIBUTE_NAME_MISSING="ATTRIBUTE_NAME_MISSING"}(Bt||(Bt={})),function(e){e.PUBLIC="PUBLIC",e.SHARED="SHARED",e.PRIVATE="PRIVATE"}(Rt||(Rt={})),function(e){e.OFF="OFF",e.ONE_MIN="ONE_MIN",e.FIVE_MIN="FIVE_MIN",e.QUARTER="QUARTER",e.ONE_HOUR="ONE_HOUR"}(Pt||(Pt={})),function(e){e.WRAP_TO_SINGLE_COLUMN="WRAP_TO_SINGLE_COLUMN",e.KEEP_LAYOUT="KEEP_LAYOUT",e.REDIRECT="REDIRECT",e.BLOCK_DEVICE="BLOCK_DEVICE"}(jt||(jt={})),function(e){e.MINUTE="MINUTE",e.HOUR="HOUR",e.DAY="DAY",e.WEEK="WEEK",e.MONTH="MONTH",e.YEAR="YEAR"}(It||(It={})),function(e){e.MIN="MIN",e.AVG="AVG",e.MAX="MAX"}(Nt||(Nt={})),function(e){e.TERMINATING="TERMINATING",e.DISABLED="DISABLED",e.ALREADY_CONNECTED="ALREADY_CONNECTED",e.UNRECOGNISED="UNRECOGNISED",e.PERMANENT_ERROR="PERMANENT_ERROR",e.SYNC_ERROR="SYNC_ERROR"}(Ht||(Ht={})),function(e){e.HTTPS="HTTPS",e.HTTP="HTTP",e.TCP="TCP"}(Ut||(Ut={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.OPTIONS="OPTIONS",e.PATCH="PATCH"}(Wt||(Wt={})),function(e){e.KEYCLOAK="KEYCLOAK",e.BASIC="BASIC",e.NONE="NONE"}(zt||(zt={})),function(e){e.WEBSOCKET="WEBSOCKET",e.POLLING="POLLING"}(Gt||(Gt={})),function(e){e.VECTOR="VECTOR",e.RASTER="RASTER"}(qt||(qt={})),function(e){e.INTERNAL="INTERNAL",e.CLIENT="CLIENT",e.GLOBAL_RULESET="GLOBAL_RULESET",e.REALM_RULESET="REALM_RULESET",e.ASSET_RULESET="ASSET_RULESET"}($t||($t={})),function(e){e.REALM="REALM",e.USER="USER",e.ASSET="ASSET",e.CUSTOM="CUSTOM"}(Vt||(Vt={})),function(e){e.NORMAL="NORMAL",e.HIGH="HIGH"}(Jt||(Jt={})),function(e){e.DEVICE="DEVICE",e.TOPIC="TOPIC",e.CONDITION="CONDITION"}(Kt||(Kt={})),function(e){e.ALWAYS="ALWAYS",e.ONCE="ONCE",e.HOURLY="HOURLY",e.DAILY="DAILY",e.WEEKLY="WEEKLY",e.MONTHLY="MONTHLY",e.ANNUALLY="ANNUALLY"}(Xt||(Xt={})),function(e){e.MESSAGE_INVALID="MESSAGE_INVALID",e.CERTIFICATE_INVALID="CERTIFICATE_INVALID",e.UNAUTHORIZED="UNAUTHORIZED",e.FORBIDDEN="FORBIDDEN",e.UNIQUE_ID_MISMATCH="UNIQUE_ID_MISMATCH",e.CONFIG_DISABLED="CONFIG_DISABLED",e.USER_DISABLED="USER_DISABLED",e.SERVER_ERROR="SERVER_ERROR",e.ASSET_ERROR="ASSET_ERROR",e.SERVER_BUSY="SERVER_BUSY"}(Zt||(Zt={})),function(e){e.PRIVATE="PRIVATE",e.PROTECTED="PROTECTED",e.PUBLIC="PUBLIC"}(Qt||(Qt={})),function(e){e.EXACT="EXACT",e.BEGIN="BEGIN",e.END="END",e.CONTAINS="CONTAINS"}(en||(en={})),function(e){e.EQUALS="EQUALS",e.GREATER_THAN="GREATER_THAN",e.GREATER_EQUALS="GREATER_EQUALS",e.LESS_THAN="LESS_THAN",e.LESS_EQUALS="LESS_EQUALS",e.BETWEEN="BETWEEN"}(tn||(tn={})),function(e){e.CREATED_ON="CREATED_ON",e.NAME="NAME",e.ASSET_TYPE="ASSET_TYPE",e.PARENT_ID="PARENT_ID",e.REALM="REALM"}(nn||(nn={})),function(e){e.RESTRICTED="RESTRICTED",e.LINKED="LINKED",e.REALM="REALM"}(on||(on={})),function(e){e.AT_LEAST_ONE="AT_LEAST_ONE",e.ALL="ALL",e.NONE="NONE"}(rn||(rn={})),function(e){e.AND="AND",e.OR="OR"}(an||(an={})),function(e){e.CREATED_ON="CREATED_ON",e.FIRST_NAME="FIRST_NAME",e.LAST_NAME="LAST_NAME",e.USERNAME="USERNAME",e.EMAIL="EMAIL"}(sn||(sn={})),function(e){e.STOPPED="STOPPED",e.RUNNING="RUNNING",e.ERROR="ERROR"}(cn||(cn={})),function(e){e.JAVASCRIPT="JAVASCRIPT",e.GROOVY="GROOVY",e.JSON="JSON",e.FLOW="FLOW"}(dn||(dn={})),function(e){e.READY="READY",e.DEPLOYED="DEPLOYED",e.COMPILATION_ERROR="COMPILATION_ERROR",e.VALIDITY_PERIOD_ERROR="VALIDITY_PERIOD_ERROR",e.EXECUTION_ERROR="EXECUTION_ERROR",e.LOOP_ERROR="LOOP_ERROR",e.DISABLED="DISABLED",e.PAUSED="PAUSED",e.EXPIRED="EXPIRED",e.REMOVED="REMOVED",e.EMPTY="EMPTY"}(ln||(ln={})),function(e){e.SUNRISE="SUNRISE",e.SUNSET="SUNSET",e.TWILIGHT_MORNING_VISUAL="TWILIGHT_MORNING_VISUAL",e.TWILIGHT_MORNING_VISUAL_LOWER="TWILIGHT_MORNING_VISUAL_LOWER",e.TWILIGHT_MORNING_HORIZON="TWILIGHT_MORNING_HORIZON",e.TWILIGHT_MORNING_CIVIL="TWILIGHT_MORNING_CIVIL",e.TWILIGHT_MORNING_NAUTICAL="TWILIGHT_MORNING_NAUTICAL",e.TWILIGHT_MORNING_ASTRONOMICAL="TWILIGHT_MORNING_ASTRONOMICAL",e.TWILIGHT_MORNING_GOLDEN_HOUR="TWILIGHT_MORNING_GOLDEN_HOUR",e.TWILIGHT_MORNING_BLUE_HOUR="TWILIGHT_MORNING_BLUE_HOUR",e.TWILIGHT_MORNING_NIGHT_HOUR="TWILIGHT_MORNING_NIGHT_HOUR",e.TWILIGHT_EVENING_VISUAL="TWILIGHT_EVENING_VISUAL",e.TWILIGHT_EVENING_VISUAL_LOWER="TWILIGHT_EVENING_VISUAL_LOWER",e.TWILIGHT_EVENING_HORIZON="TWILIGHT_EVENING_HORIZON",e.TWILIGHT_EVENING_CIVIL="TWILIGHT_EVENING_CIVIL",e.TWILIGHT_EVENING_NAUTICAL="TWILIGHT_EVENING_NAUTICAL",e.TWILIGHT_EVENING_ASTRONOMICAL="TWILIGHT_EVENING_ASTRONOMICAL",e.TWILIGHT_EVENING_GOLDEN_HOUR="TWILIGHT_EVENING_GOLDEN_HOUR",e.TWILIGHT_EVENING_BLUE_HOUR="TWILIGHT_EVENING_BLUE_HOUR",e.TWILIGHT_EVENING_NIGHT_HOUR="TWILIGHT_EVENING_NIGHT_HOUR"}(un||(un={})),function(e){e.NUMBER="NUMBER",e.NUMBER_ARRAY="NUMBER_ARRAY",e.STRING="STRING",e.BOOLEAN="BOOLEAN",e.TRIGGER="TRIGGER",e.COLOR="COLOR",e.ANY="ANY"}(mn||(mn={})),function(e){e.NEW_LINE="NEW_LINE",e.SPACER="SPACER"}(fn||(fn={})),function(e){e.INPUT="INPUT",e.PROCESSOR="PROCESSOR",e.OUTPUT="OUTPUT",e.THEN="THEN"}(bn||(bn={})),function(e){e.TEXT="TEXT",e.MULTILINE="MULTILINE",e.NUMBER="NUMBER",e.DROPDOWN="DROPDOWN",e.DOUBLE_DROPDOWN="DOUBLE_DROPDOWN",e.CHECKBOX="CHECKBOX",e.ASSET_ATTRIBUTE="ASSET_ATTRIBUTE",e.COLOR="COLOR",e.DATE="DATE"}(hn||(hn={})),function(e){e.ADD="ADD",e.ADD_OR_REPLACE="ADD_OR_REPLACE",e.REPLACE="REPLACE",e.DELETE="DELETE",e.CLEAR="CLEAR"}(pn||(pn={})),function(e){e.PER_ASSET="PER_ASSET",e.GLOBAL="GLOBAL"}(Fn||(Fn={})),function(e){e.READ_ADMIN="read:admin",e.READ_LOGS="read:logs",e.READ_USERS="read:users",e.READ_MAP="read:map",e.READ_ASSETS="read:assets",e.READ_RULES="read:rules",e.READ_INSIGHTS="read:insights",e.READ_ALARMS="read:alarms",e.WRITE_USER="write:user",e.WRITE_ADMIN="write:admin",e.WRITE_LOGS="write:logs",e.WRITE_ASSETS="write:assets",e.WRITE_ATTRIBUTES="write:attributes",e.WRITE_RULES="write:rules",e.WRITE_INSIGHTS="write:insights",e.WRITE_ALARMS="write:alarms",e.READ="read",e.WRITE="write"}(_n||(_n={})),function(e){e.ASSET="ASSET",e.AGENT="AGENT",e.NOTIFICATION="NOTIFICATION",e.ALARM="ALARM",e.RULES="RULES",e.PROTOCOL="PROTOCOL",e.GATEWAY="GATEWAY",e.MODEL_AND_VALUES="MODEL_AND_VALUES",e.API="API",e.DATA="DATA"}(gn||(gn={})),function(e){e.INFO="INFO",e.WARN="WARN",e.ERROR="ERROR"}(yn||(yn={})),function(e){e.NUMERIC="numeric",e.DIGIT_2="2-digit",e.FULL="full",e.LONG="long",e.MEDIUM="medium",e.SHORT="short",e.NARROW="narrow"}(vn||(vn={})),function(e){e.SECONDLY="SECONDLY",e.MINUTELY="MINUTELY",e.HOURLY="HOURLY",e.DAILY="DAILY",e.WEEKLY="WEEKLY",e.MONTHLY="MONTHLY",e.YEARLY="YEARLY"}(kn||(kn={})),function(e){e.OMIT="OMIT",e.BACKWARD="BACKWARD",e.FORWARD="FORWARD"}(wn||(wn={})),function(e){e.JAPANESE="JAPANESE",e.BUDDHIST="BUDDHIST",e.ROC="ROC",e.ISLAMIC="ISLAMIC",e.ISO8601="ISO8601",e.CHINESE="CHINESE",e.ETHIOPIC="ETHIOPIC",e.HEBREW="HEBREW",e.GREGORIAN="GREGORIAN"}(Mn||(Mn={})),function(e){e.SU="SU",e.MO="MO",e.TU="TU",e.WE="WE",e.TH="TH",e.FR="FR",e.SA="SA"}(Ln||(Ln={})),function(e){e.PEOPLECOUNTERASSET="PeopleCounterAsset",e.MAILAGENT="MailAgent",e.UDPAGENT="UDPAgent",e.STORAGESIMULATORAGENT="StorageSimulatorAgent",e.ROOMASSET="RoomAsset",e.CITYASSET="CityAsset",e.ELECTRICITYCONSUMERASSET="ElectricityConsumerAsset",e.ELECTRICVEHICLEASSET="ElectricVehicleAsset",e.VENTILATIONASSET="VentilationAsset",e.TRADFRILIGHTASSET="TradfriLightAsset",e.CONSOLEASSET="ConsoleAsset",e.PRESENCESENSORASSET="PresenceSensorAsset",e.LIGHTASSET="LightAsset",e.KNXAGENT="KNXAgent",e.PLUGASSET="PlugAsset",e.ELECTRICITYCHARGERASSET="ElectricityChargerAsset",e.WEATHERASSET="WeatherAsset",e.ELECTRICITYBATTERYASSET="ElectricityBatteryAsset",e.ELECTRICITYSUPPLIERASSET="ElectricitySupplierAsset",e.THINGASSET="ThingAsset",e.WEBSOCKETAGENT="WebsocketAgent",e.TCPAGENT="TCPAgent",e.GATEWAYASSET="GatewayAsset",e.SERIALAGENT="SerialAgent",e.BLUETOOTHMESHAGENT="BluetoothMeshAgent",e.PARKINGASSET="ParkingAsset",e.TRADFRIPLUGASSET="TradfriPlugAsset",e.SIMULATORAGENT="SimulatorAgent",e.SNMPAGENT="SNMPAgent",e.GROUPASSET="GroupAsset",e.BUILDINGASSET="BuildingAsset",e.ELECTRICITYPRODUCERWINDASSET="ElectricityProducerWindAsset",e.ENVIRONMENTSENSORASSET="EnvironmentSensorAsset",e.MQTTAGENT="MQTTAgent",e.ELECTRICVEHICLEFLEETGROUPASSET="ElectricVehicleFleetGroupAsset",e.VELBUSTCPAGENT="VelbusTCPAgent",e.ARTNETLIGHTASSET="ArtnetLightAsset",e.VELBUSSERIALAGENT="VelbusSerialAgent",e.GROUNDWATERSENSORASSET="GroundwaterSensorAsset",e.ELECTRICITYPRODUCERSOLARASSET="ElectricityProducerSolarAsset",e.MICROPHONEASSET="MicrophoneAsset",e.ZWAVEAGENT="ZWaveAgent",e.ENERGYOPTIMISATIONASSET="EnergyOptimisationAsset",e.HTTPAGENT="HTTPAgent",e.DOORASSET="DoorAsset",e.THERMOSTATASSET="ThermostatAsset",e.ELECTRICITYPRODUCERASSET="ElectricityProducerAsset",e.SHIPASSET="ShipAsset"}(Dn||(Dn={})),function(e){e.SUPPORTSEXPORT="supportsExport",e.ENERGYSELFCONSUMPTION="energySelfConsumption",e.LASTACCESS="lastAccess",e.CHARGERID="chargerID",e.POSITION="position",e.CARBONSAVING="carbonSaving",e.ROUTINGMODE="routingMode",e.LASTWILLRETAIN="lastWillRetain",e.LASTWILLTOPIC="lastWillTopic",e.SERIALBAUDRATE="serialBaudrate",e.BASEURL="baseURL",e.REQUIREDVALUES="requiredValues",e.FINANCIALSAVING="financialSaving",e.FLEETCATEGORY="fleetCategory",e.GATEWAYSTATUS="gatewayStatus",e.NO2LEVEL="NO2Level",e.TAGS="tags",e.MILEAGEMIN="mileageMin",e.UNLOCK="unlock",e.CHECKINTERVALSECONDS="checkIntervalSeconds",e.LOCATION="location",e.CLIENTSECRET="clientSecret",e.WINDDIRECTION="windDirection",e.WINDSPEED="windSpeed",e.PARTICLESPM10="particlesPM10",e.APPLICATIONKEY="applicationKey",e.POWEREXPORTMAX="powerExportMax",e.SETWINDACTUALVALUEWITHFORECAST="setWindActualValueWithForecast",e.WATERLEVEL="waterLevel",e.CONNECTHEADERS="connectHeaders",e.CONSOLENAME="consoleName",e.WEBSOCKETQUERY="websocketQuery",e.PREFERHTML="preferHTML",e.COOLING="cooling",e.POLLINGMILLIS="pollingMillis",e.SOILTEMPERATURE="soilTemperature",e.SUNIRRADIANCE="sunIrradiance",e.ODOMETER="odometer",e.SUPPORTSIMPORT="supportsImport",e.MESSAGEMAXLENGTH="messageMaxLength",e.ENERGYLEVELPERCENTAGEMIN="energyLevelPercentageMin",e.LIGHTID="lightId",e.POWER="power",e.STREET="street",e.DELETEPROCESSEDMAIL="deleteProcessedMail",e.WINDSPEEDMIN="windSpeedMin",e.POWERSETPOINT="powerSetpoint",e.PRESENCE="presence",e.SPACESOCCUPIED="spacesOccupied",e.STARTTLS="startTLS",e.AGENTSTATUS="agentStatus",e.MESSAGECHARSET="messageCharset",e.CERTIFICATEALIAS="certificateAlias",e.PANELPITCH="panelPitch",e.EMAIL="email",e.BINDPORT="bindPort",e.PARTICLESPM1="particlesPM1",e.SPEED="speed",e.ENERGYLEVELPERCENTAGEMAX="energyLevelPercentageMax",e.MESSAGESTRIPDELIMITER="messageStripDelimiter",e.AREA="area",e.COUNTRY="country",e.SHIPTYPE="shipType",e.CONNECTSUBSCRIPTIONS="connectSubscriptions",e.RELATIVEHUMIDITY="relativeHumidity",e.SOURCEADDRESS="sourceAddress",e.INCLUDEFORECASTWINDSERVICE="includeForecastWindService",e.RAINFALL="rainfall",e.ENERGYIMPORTTOTAL="energyImportTotal",e.OAUTHGRANT="oAuthGrant",e.OZONELEVEL="ozoneLevel",e.COUNTINMINUTE="countInMinute",e.PORT="port",e.TUNNELINGSUPPORTED="tunnelingSupported",e.ENINUMBER="ENINumber",e.AGENTDISABLED="agentDisabled",e.DISABLED="disabled",e.FORCECHARGE="forceCharge",e.TIMEINJECTIONINTERVAL="timeInjectionInterval",e.FINANCIALWEIGHTING="financialWeighting",e.ENERGYLEVELPERCENTAGE="energyLevelPercentage",e.SPACESBUFFER="spacesBuffer",e.VEHICLECATEGORY="vehicleCategory",e.FANSPEED="fanSpeed",e.FINANCIALCOST="financialCost",e.NOTES="notes",e.MAILFOLDERNAME="mailFolderName",e.TEMPERATURE="temperature",e.AVAILABLECHARGINGSPACES="availableChargingSpaces",e.ENERGYCAPACITY="energyCapacity",e.POWERIMPORTMIN="powerImportMin",e.INTERVALSIZE="intervalSize",e.SNMPVERSIONVALUE="SNMPVersionValue",e.SOUNDLEVEL="soundLevel",e.CONNECTURL="connectURL",e.CLIENTID="clientId",e.VEHICLEID="vehicleID",e.SUNAZIMUTH="sunAzimuth",e.AVAILABLEDISCHARGINGSPACES="availableDischargingSpaces",e.WEBSOCKETMODE="websocketMode",e.COLOURTEMPERATURE="colourTemperature",e.VEHICLECONNECTED="vehicleConnected",e.MILEAGEMINIMUM="mileageMinimum",e.COLOURRGB="colourRGB",e.CARBONIMPORT="carbonImport",e.PRICEHOURLY="priceHourly",e.WINDSPEEDMAX="windSpeedMax",e.PINGDISABLED="pingDisabled",e.FLOW="flow",e.CHILDASSETTYPE="childAssetType",e.NETWORKKEY="networkKey",e.UNIVERSE="universe",e.MSSINUMBER="MSSINumber",e.LEDCOUNT="lEDCount",e.LOCKED="locked",e.PROTOCOL="protocol",e.TARIFFIMPORT="tariffImport",e.ENERGYRENEWABLESHARE="energyRenewableShare",e.REGION="region",e.CONSOLEPLATFORM="consolePlatform",e.POWEREXPORTMIN="powerExportMin",e.EFFICIENCYEXPORT="efficiencyExport",e.CHARGECYCLES="chargeCycles",e.SERIALPORT="serialPort",e.PANELORIENTATION="panelOrientation",e.LENGTH="length",e.USERNAMEPASSWORD="usernamePassword",e.POWERFORECAST="powerForecast",e.SETACTUALSOLARVALUEWITHFORECAST="setActualSolarValueWithForecast",e.PROXYADDRESS="proxyAddress",e.REQUESTQUERYPARAMETERS="requestQueryParameters",e.ENERGYLOCAL="energyLocal",e.ENERGYAUTARKY="energyAutarky",e.MODEL="model",e.MANUFACTURER="manufacturer",e.ONOFF="onOff",e.RESUMESESSION="resumeSession",e.TARIFFEXPORT="tariffExport",e.CITY="city",e.CONNECTORTYPE="connectorType",e.ENERGYEXPORTTOTAL="energyExportTotal",e.CARBONEXPORT="carbonExport",e.REQUESTTIMEOUTMILLIS="requestTimeoutMillis",e.ENERGYLEVEL="energyLevel",e.OPTIMISATIONDISABLED="optimisationDisabled",e.WEBSOCKETPATH="websocketPath",e.WINDSPEEDREFERENCE="windSpeedReference",e.PRICEDAILY="priceDaily",e.COUNTGROWTHMINUTE="countGrowthMinute",e.IMONUMBER="IMONumber",e.INCLUDEFORECASTSOLARSERVICE="includeForecastSolarService",e.REQUESTHEADERS="requestHeaders",e.COUNTOUTMINUTE="countOutMinute",e.HOST="host",e.ENERGYTYPE="energyType",e.CONSOLEVERSION="consoleVersion",e.MTU="mtu",e.PANELAZIMUTH="panelAzimuth",e.SEQUENCENUMBER="sequenceNumber",e.SUNALTITUDE="sunAltitude",e.COUNTOUT="countOut",e.CHARGERCONNECTED="chargerConnected",e.ROOMNUMBER="roomNumber",e.PARTICLESPM2_5="particlesPM2_5",e.COUNTIN="countIn",e.MESSAGESOURCEADDRESS="messageSourceAddress",e.MILEAGECHARGED="mileageCharged",e.TEMPERATURESETPOINT="temperatureSetpoint",e.CONSOLEPROVIDERS="consoleProviders",e.POWERIMPORTMAX="powerImportMax",e.COUNTTOTAL="countTotal",e.SPACESTOTAL="spacesTotal",e.BINDHOST="bindHost",e.MESSAGECONVERTBINARY="messageConvertBinary",e.MESSAGEDELIMITERS="messageDelimiters",e.EFFICIENCYIMPORT="efficiencyImport",e.SUNZENITH="sunZenith",e.BRIGHTNESS="brightness",e.POSTALCODE="postalCode",e.SPACESOPEN="spacesOpen",e.HUMIDITY="humidity",e.MILEAGECAPACITY="mileageCapacity",e.SECUREMODE="secureMode",e.DIRECTION="direction",e.ENERGYLEVELSCHEDULE="energyLevelSchedule",e.UVINDEX="uVIndex",e.NATMODE="NATMode",e.UPDATEONWRITE="updateOnWrite",e.GROUPID="groupId",e.LASTWILLPAYLOAD="lastWillPayload",e.FOLLOWREDIRECTS="followRedirects",e.CARBONCOST="carbonCost",e.MESSAGECONVERTHEX="messageConvertHex"}(En||(En={})),function(e){e.FORMAT="format",e.RULESTATE="ruleState",e.HASPREDICTEDDATAPOINTS="hasPredictedDataPoints",e.STOREDATAPOINTS="storeDataPoints",e.LABEL="label",e.CONSTRAINTS="constraints",e.SHOWONDASHBOARD="showOnDashboard",e.READONLY="readOnly",e.MULTILINE="multiline",e.ACCESSPUBLICWRITE="accessPublicWrite",e.MOMENTARY="momentary",e.AGENTLINK="agentLink",e.ACCESSRESTRICTEDREAD="accessRestrictedRead",e.DATAPOINTSMAXAGEDAYS="dataPointsMaxAgeDays",e.ACCESSRESTRICTEDWRITE="accessRestrictedWrite",e.SECRET="secret",e.ATTRIBUTELINKS="attributeLinks",e.RULERESETIMMEDIATE="ruleResetImmediate",e.FORECAST="forecast",e.UNITS="units",e.USERCONNECTED="userConnected",e.ACCESSPUBLICREAD="accessPublicRead"}(An||(An={})),function(e){e.WSURL="WS_URL",e.POSITIVENUMBER="positiveNumber",e.VALUEDESCRIPTOR="valueDescriptor",e.LONG="long",e.BOOLEANMAP="booleanMap",e.GEOJSONPOINT="GEO_JSONPoint",e.SNMPVERSION="SNMPVersion",e.ASSETTYPE="assetType",e.JSONOBJECT="JSONObject",e.BIGNUMBER="bigNumber",e.IPADDRESS="IPAddress",e.EMAIL="email",e.KNXMESSAGESOURCEADDRESS="kNXMessageSourceAddress",e.ATTRIBUTEREFERENCE="attributeReference",e.INTEGER="integer",e.OAUTHGRANT="oAuthGrant",e.NUMBER="number",e.TEXTMAP="textMap",e.WEBSOCKETSUBSCRIPTION="websocketSubscription",e.BOOLEAN="boolean",e.TIMEANDPERIODDURATIONISO8601="timeAndPeriodDurationISO8601",e.TIMESTAMPISO8601="timestampISO8601",e.MULTIVALUEDTEXTMAP="multivaluedTextMap",e.JSON="JSON",e.INTEGERBYTE="integerByte",e.AGENTLINK="agentLink",e.CALENDAREVENT="calendarEvent",e.CONNECTIONSTATUS="connectionStatus",e.VALUECONSTRAINT="valueConstraint",e.ASSETQUERY="assetQuery",e.COLOURRGB="colourRGB",e.VALUEFORMAT="valueFormat",e.TEXT="text",e.BYTE="byte",e.USERNAMEANDPASSWORD="usernameAndPassword",e.HTTPURL="HTTP_URL",e.ATTRIBUTELINK="attributeLink",e.ASSETID="assetID",e.NUMBERMAP="numberMap",e.HTTPMETHOD="HTTPMethod",e.PANELORIENTATION="panelOrientation",e.ATTRIBUTESTATE="attributeState",e.POSITIVEINTEGER="positiveInteger",e.EXECUTIONSTATUS="executionStatus",e.BIGINTEGER="bigInteger",e.PERIODDURATIONISO8601="periodDurationISO8601",e.DATEANDTIME="dateAndTime",e.CONNECTORTYPE="connectorType",e.NEGATIVEINTEGER="negativeInteger",e.TCPIPPORTNUMBER="TCP_IPPortNumber",e.INTEGERMAP="integerMap",e.ENERGYTYPE="energyType",e.TIMESTAMP="timestamp",e.UUID="UUID",e.FORECASTCONFIGURATION="forecastConfiguration",e.TIMEDURATIONISO8601="timeDurationISO8601",e.CONSOLEPROVIDERS="consoleProviders",e.NEGATIVENUMBER="negativeNumber",e.CRONEXPRESSION="CRONExpression",e.DIRECTION="direction",e.HOSTORIPADDRESS="hostOrIPAddress"}(Tn||(Tn={})),function(e){e.MONTH="month",e.MILE_SCANDINAVIAN="mile_scandinavian",e.YEAR="year",e.VOLT="volt",e.HERTZ="hertz",e.MILE="mile",e.BTU="btu",e.FOOT="foot",e.MEGA="mega",e.INCH="inch",e.IN_HG="inch_mercury",e.CENTI="centi",e.GRAM="gram",e.KNOT="knot",e.METRE="metre",e.LITRE="litre",e.FLUID_OUNCE="fluid_ounce",e.CELSIUS="celsius",e.DECIBEL="decibel",e.FAHRENHEIT="fahrenheit",e.WATT="watt",e.PEAK="peak",e.MICRO="micro",e.PER="per",e.STONE="stone",e.VAR="var",e.OUNCE="ounce",e.HECTARE="hectare",e.YARD="yard",e.JOULE="joule",e.DEGREE="degree",e.KILO="kilo",e.KELVIN="kelvin",e.CARBON="carbon",e.DECIBEL_ATTENUATED="decibel_attenuated",e.SQUARED="squared",e.PERCENTAGE="percentage",e.CUBED="cubed",e.DAY="day",e.RADIAN="radian",e.OHM="ohm",e.MINUTE="minute",e.PART_PER_MILLION="ppm",e.AMP="amp",e.MASS_POUND="pound",e.HOUR="hour",e.ACRE="acre",e.RPM="rpm",e.PASCAL="pascal",e.LUMEN="lumen",e.WEEK="week",e.GALLON="gallon",e.LUX="lux",e.MILLI="milli",e.BAR="bar",e.HECTO="hecto",e.SECOND="second"}(Yn||(Yn={})),Cn||(Cn={});class On{static getAssetDescriptors(){return On._assetTypeInfos.map((e=>e.assetDescriptor))}static getMetaItemDescriptors(){return[...this._metaItemDescriptors]}static getValueDescriptors(){return[...this._valueDescriptors]}static getAssetTypeInfos(){return[...this._assetTypeInfos]}static getAssetTypeInfo(e){if(e)return e.assetDescriptor?e:("string"!=typeof e&&(e=e.name),this._assetTypeInfos.find((t=>t.assetDescriptor.name===e)))}static getAssetDescriptor(e){if(!e)return;if(e.assetDescriptor)return e.assetDescriptor;if("string"!=typeof e)return e;const t=this._assetTypeInfos.find((t=>t.assetDescriptor.name===e));return t?t.assetDescriptor:void 0}static getAttributeDescriptor(e,t){if(!e)return;const n=this.getAssetTypeInfo(t||"ThingAsset");return n&&n.attributeDescriptors?n.attributeDescriptors.find((t=>t.name===e)):void 0}static getValueDescriptor(e){if(!e)return;let t;if(e.endsWith("[]"))for(t=0;e.endsWith("[]");)e=e.substring(0,e.length-2),t++;let n=this._valueDescriptors.find((t=>t.name===e));return n&&t&&(n=Object.assign(Object.assign({},n),{arrayDimensions:t})),n}static resolveValueDescriptor(e,t){let n;return t&&("string"==typeof t&&(n=On.getValueDescriptor(t)),n=t.jsonType?t:On.getValueDescriptor(t.type)),!n&&e&&(n=On.getValueDescriptor("JSON")),n}static resolveValueTypeFromValue(e){if(null!=e){if("number"==typeof e)return"number";if("string"==typeof e)return"text";if("boolean"==typeof e)return"boolean";if(Array.isArray(e)){let t=1,n=e.find((e=>null!=e));for(;Array.isArray(n);)n=n.find((e=>null!=e)),t++;let o=this.resolveValueTypeFromValue(n);if(!o)return;for(;t>0;)o+="[]",t--;return o}return e instanceof Date?"dateAndTime":void 0}}static getAttributeAndValueDescriptors(e,t,n){let o,r;if(t&&"string"!=typeof t)o=t;else{const r=this.getAssetTypeInfo(e||"ThingAsset");if(!r)return[void 0,void 0];"string"==typeof t&&(o=this.getAttributeDescriptor(t,r)),!o&&n&&(o={type:n.type,name:n.name,meta:n.meta})}return o&&(r=this.getValueDescriptor(o.type)),[o,r]}static getMetaItemDescriptor(e){if(e)return this._metaItemDescriptors.find((t=>t.name===e))}static getAssetDescriptorColour(e,t){const n=this.getAssetDescriptor(e);return n&&n.colour?n.colour:t}static getAssetDescriptorIcon(e,t){const n=this.getAssetDescriptor(e);return n&&n.icon?n.icon:t}}On._assetTypeInfos=[],On._metaItemDescriptors=[],On._valueDescriptors=[];var Bn=r(6104),Rn=r.n(Bn);r(5564);class Pn{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)}}let jn=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>{jn=!0}}))}catch(jo){}document.createElement("div");var In=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))};let Nn=r(6900);class Hn{constructor(e,t,n){this._autoEnable=!1,this._initialised=!1,this._initialiseInProgress=!1,this._pendingProviderPromises={},this._providerMessageListeners={},this._pendingProviderEnables=[],this._registrationTimer=null,this._realm=e,this._autoEnable=t,this._enableCompleteCallback=n,window.OpenRemoteConsole=this;let o=new URLSearchParams(window.location.search),r=o.get("consoleName"),i=o.get("consoleVersion"),a=o.get("consolePlatform"),s=o.get("consoleProviders"),c=o.get("consoleAutoEnable"),d=s&&s.length>0?s.split(" "):["push"];this._pendingProviderEnables=d;let l=Hn._createConsoleRegistration(),u=window.localStorage.getItem("OpenRemoteConsole:"+e);if(u)try{let e=JSON.parse(u);e.id&&(l.id=e.id),e.name&&(l.name=e.name),e.providers&&(l.providers=e.providers),e.apps&&(l.apps=e.apps)}catch(e){console.error("Failed to deserialise console registration")}let m=l.providers;l.providers={};for(let e of d){let t=m&&m.hasOwnProperty(e)?m[e]:{enabled:!1,disabled:!1};l.providers[e]=t}let f=Ar.getAppName();f.length>0&&l.apps.indexOf(f)<0&&l.apps.push(f),this._registration=l,r&&(l.name=r),i&&(l.version=i),a&&(l.platform=a),c&&(this._autoEnable="TRUE"===c||"true"===c)}get registration(){return this._registration}get autoEnable(){return this._autoEnable}get pendingProviderEnables(){return this._pendingProviderEnables.slice(0)}get shellApple(){const 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 In(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(0)),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 In(this,void 0,void 0,(function*(){if(!this._initialised)throw new 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 In(this,void 0,void 0,(function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),new Error("Console must be initialised before enabling providers");if(!this._registration.providers.hasOwnProperty(e))throw console.debug("Invalid console provider '"+e+"'"),new Error("Invalid console provider '"+e+"'");console.debug("Console: enabling provider '"+e+"'");let n={provider:e,action:"PROVIDER_ENABLE",consoleId:this._registration.id,data:t},o=yield this.sendProviderMessage(n,!0);this._registration.providers[e].hasPermission=o.hasPermission,this._registration.providers[e].success=o.success,this._registration.providers[e].enabled=o.success,this._registration.providers[e].data=o.data;let r=this._pendingProviderEnables.indexOf(e);return r>=0&&(this._pendingProviderEnables.splice(r,1),0===this._pendingProviderEnables.length&&(this.sendRegistration(),this._callCompletedCallback())),o}))}disableProvider(e){return In(this,void 0,void 0,(function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),new Error("Console must be initialised before disabling providers");if(!this._registration.providers.hasOwnProperty(e))throw console.debug("Invalid console provider '"+e+"'"),new 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 In(this,void 0,void 0,(function*(){if("storage"!==e.provider&&!this._registration.providers.hasOwnProperty(e.provider))throw console.debug("Invalid console provider '"+e.provider+"'"),new Error("Invalid console provider '"+e.provider+"'");if(!t)return void this._doSendProviderMessage(e);let n=e.provider+e.action;if(this._pendingProviderPromises[n])throw new Error("Message already pending for provider '"+e.provider+"' with action '"+e.action+"'");const o=new Pn;return this._pendingProviderPromises[n]=[o,window.setTimeout((()=>{delete this._pendingProviderPromises[n],o.reject("No response from provider")}),5e3)],this._doSendProviderMessage(e),o.promise}))}sendRegistration(e){return this._registrationTimer&&(window.clearTimeout(this._registrationTimer),this._registrationTimer=null),e=void 0!==e?e:2e3,console.debug("Sending registration in: "+e+"ms"),new Promise(((e,t)=>{this._registrationTimer=window.setTimeout((()=>{this._registrationTimer=null,console.debug("Console: updating registration");try{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={}),Ar.rest.api.ConsoleResource.register(this._registration).then((t=>{if(200!==t.status)throw new Error("Failed to register console");this._registration=t.data,console.debug("Console: registration successful"),console.debug("Console: updating locally stored registration"),window.localStorage.setItem("OpenRemoteConsole:"+this._realm,JSON.stringify(this._registration)),e()}))}catch(e){console.error("Failed to register console"),t("Failed to register console")}}))}))}storeData(e,t){this.sendProviderMessage({provider:"storage",action:"STORE",key:e,value:t},!1)}retrieveData(e){return In(this,void 0,void 0,(function*(){let t=this.sendProviderMessage({provider:"storage",action:"RETRIEVE",key:e},!0);try{const e=yield Promise.race([t,new Promise(((e,t)=>setTimeout(t,2e3)))]);if(e&&e.value){const 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){const n={type:e,data:t};this.isMobile?this._postNativeShellMessage(n):console.warn("Failed to send generic message to console.",n)}_doSendProviderMessage(e){if(this.isMobile)this._postNativeShellMessage({type:"provider",data:e});else{if(!e.provider||!e.action)return;switch(e.provider.trim().toUpperCase()){case"PUSH":switch(e.action.trim().toUpperCase()){case"PROVIDER_INIT":let t={action:"PROVIDER_INIT",provider:"push",version:"web",enabled:!0,disabled:!1,hasPermission:!0,requiresPermission:!1,success:!0};this._handleProviderResponse(JSON.stringify(t));break;case"PROVIDER_ENABLE":let n={action:"PROVIDER_ENABLE",provider:"push",hasPermission:!0,success:!0};this._handleProviderResponse(JSON.stringify(n));break;default:throw new Error("Unsupported provider '"+e.provider+"' and action '"+e.action+"'")}break;case"STORAGE":switch(e.action){case"PROVIDER_INIT":let t={action:"PROVIDER_INIT",provider:"storage",version:"1.0.0",disabled:!1,enabled:!0,hasPermission:!0,requiresPermission:!1,success:!0};this._handleProviderResponse(JSON.stringify(t));break;case"PROVIDER_ENABLE":let n={action:"PROVIDER_ENABLE",provider:"storage",hasPermission:!0,success:!0};this._handleProviderResponse(JSON.stringify(n));break;case"STORE":{let t=e.key?e.key.trim():null;if(!t||0===t.length)throw new 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 new Error("Storage provider 'retrieve' action requires a `key`");let n=window.localStorage.getItem(t);if(null!==n)try{n=JSON.parse(n)}catch(e){}this._handleProviderResponse(JSON.stringify({action:"RETRIEVE",provider:"storage",key:t,value:n}))}break;default:throw new Error("Unsupported provider '"+e.provider+"' and action '"+e.action+"'")}break;default:console.error("Unsupported provider: "+e.provider)}}}_handleProviderResponse(e){if(!e)return;let t=JSON.parse(e),n=t.provider,o=t.action,r=this._pendingProviderPromises[n+o];r&&(window.clearTimeout(r[1]),delete this._pendingProviderPromises[n+o],r[0].resolve(t));let i=this._providerMessageListeners[n+o];i&&i(t)}_callCompletedCallback(){let e=this._enableCompleteCallback;this._enableCompleteCallback=null,e&&window.setTimeout((()=>{e()}),0)}static _createConsoleRegistration(){return{name:Nn.name,version:Nn.version,platform:Nn.os.toString(),apps:[],model:((Nn.manufacturer?Nn.manufacturer+" ":"")+(Nn.product?Nn.product:"")).trim()}}_initialiseProvider(e){return In(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)}}))}}var Un=r(9048),Wn=r.n(Un);class zn{constructor(e){this.httpClient=e}getPredictedDatapoints(e,t,n,o){return this.httpClient.request({method:"POST",url:mo`asset/predicted/${e}/${t}`,data:n,options:o})}writePredictedDatapoints(e,t,n,o){return this.httpClient.request({method:"PUT",url:mo`asset/predicted/${e}/${t}`,data:n,options:o})}}class Gn{constructor(e){this.httpClient=e}deleteConnections(e,t){return this.httpClient.request({method:"DELETE",url:mo`gateway/connection`,queryParams:e,options:t})}getConnections(e){return this.httpClient.request({method:"GET",url:mo`gateway/connection`,options:e})}deleteConnection(e,t){return this.httpClient.request({method:"DELETE",url:mo`gateway/connection/${e}`,options:t})}getConnection(e,t){return this.httpClient.request({method:"GET",url:mo`gateway/connection/${e}`,options:t})}setConnection(e,t,n){return this.httpClient.request({method:"PUT",url:mo`gateway/connection/${e}`,data:t,options:n})}getConnectionStatus(e,t){return this.httpClient.request({method:"GET",url:mo`gateway/status/${e}`,options:t})}}class qn{constructor(e){this.httpClient=e}register(e,t){return this.httpClient.request({method:"POST",url:mo`console/register`,data:e,options:t})}}class $n{constructor(e){this.httpClient=e}getSettings(e){return this.httpClient.request({method:"GET",url:mo`map`,options:e})}saveSettings(e,t){return this.httpClient.request({method:"PUT",url:mo`map`,data:e,options:t})}getSettingsJs(e){return this.httpClient.request({method:"GET",url:mo`map/js`,options:e})}getTile(e,t,n,o){return this.httpClient.request({method:"GET",url:mo`map/tile/${e}/${t}/${n}`,options:o})}}class Vn{constructor(e){this.httpClient=e}createGlobalRuleset(e,t){return this.httpClient.request({method:"POST",url:mo`rules`,data:e,options:t})}getGlobalRulesets(e,t){return this.httpClient.request({method:"GET",url:mo`rules`,queryParams:e,options:t})}createAssetRuleset(e,t){return this.httpClient.request({method:"POST",url:mo`rules/asset`,data:e,options:t})}getAssetRulesets(e,t,n){return this.httpClient.request({method:"GET",url:mo`rules/asset/for/${e}`,queryParams:t,options:n})}deleteAssetRuleset(e,t){return this.httpClient.request({method:"DELETE",url:mo`rules/asset/${e}`,options:t})}getAssetRuleset(e,t){return this.httpClient.request({method:"GET",url:mo`rules/asset/${e}`,options:t})}updateAssetRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:mo`rules/asset/${e}`,data:t,options:n})}getAssetGeofences(e,t){return this.httpClient.request({method:"GET",url:mo`rules/geofences/${e}`,options:t})}getAssetEngineInfo(e,t){return this.httpClient.request({method:"GET",url:mo`rules/info/asset/${e}`,options:t})}getGlobalEngineInfo(e){return this.httpClient.request({method:"GET",url:mo`rules/info/global`,options:e})}getRealmEngineInfo(e,t){return this.httpClient.request({method:"GET",url:mo`rules/info/realm/${e}`,options:t})}createRealmRuleset(e,t){return this.httpClient.request({method:"POST",url:mo`rules/realm`,data:e,options:t})}getRealmRulesets(e,t,n){return this.httpClient.request({method:"GET",url:mo`rules/realm/for/${e}`,queryParams:t,options:n})}deleteRealmRuleset(e,t){return this.httpClient.request({method:"DELETE",url:mo`rules/realm/${e}`,options:t})}getRealmRuleset(e,t){return this.httpClient.request({method:"GET",url:mo`rules/realm/${e}`,options:t})}updateRealmRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:mo`rules/realm/${e}`,data:t,options:n})}deleteGlobalRuleset(e,t){return this.httpClient.request({method:"DELETE",url:mo`rules/${e}`,options:t})}getGlobalRuleset(e,t){return this.httpClient.request({method:"GET",url:mo`rules/${e}`,options:t})}updateGlobalRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:mo`rules/${e}`,data:t,options:n})}}class Jn{constructor(e){this.httpClient=e}getAssetDescriptors(e,t){return this.httpClient.request({method:"GET",url:mo`model/assetDescriptors`,queryParams:e,options:t})}getAssetInfo(e,t,n){return this.httpClient.request({method:"GET",url:mo`model/assetInfo/${e}`,queryParams:t,options:n})}getAssetInfos(e,t){return this.httpClient.request({method:"GET",url:mo`model/assetInfos`,queryParams:e,options:t})}getMetaItemDescriptors(e,t){return this.httpClient.request({method:"GET",url:mo`model/metaItemDescriptors`,queryParams:e,options:t})}getValueDescriptors(e,t){return this.httpClient.request({method:"GET",url:mo`model/valueDescriptors`,queryParams:e,options:t})}}class Kn{constructor(e){this.httpClient=e}getApps(e){return this.httpClient.request({method:"GET",url:mo`apps`,options:e})}getConsoleConfig(e){return this.httpClient.request({method:"GET",url:mo`apps/consoleConfig`,options:e})}getAppInfos(e){return this.httpClient.request({method:"GET",url:mo`apps/info`,options:e})}}class Xn{constructor(e){this.httpClient=e}startTunnel(e,t){return this.httpClient.request({method:"POST",url:mo`gateway/tunnel`,data:e,options:t})}stopTunnel(e,t){return this.httpClient.request({method:"DELETE",url:mo`gateway/tunnel`,data:e,options:t})}getAllActiveTunnelInfos(e,t){return this.httpClient.request({method:"GET",url:mo`gateway/tunnel/${e}`,options:t})}getGatewayActiveTunnelInfos(e,t,n){return this.httpClient.request({method:"GET",url:mo`gateway/tunnel/${e}/${t}`,options:n})}getActiveTunnelInfo(e,t,n,o,r){return this.httpClient.request({method:"GET",url:mo`gateway/tunnel/${e}/${t}/${n}/${o}`,options:r})}}class Zn{constructor(e){this.httpClient=e}updateCurrentUserLocale(e,t){return this.httpClient.request({method:"PUT",url:mo`user/locale`,data:e,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:mo`user/query`,data:e,options:t})}getCurrent(e){return this.httpClient.request({method:"GET",url:mo`user/user`,options:e})}getCurrentUserRealmRoles(e){return this.httpClient.request({method:"GET",url:mo`user/userRealmRoles`,options:e})}getCurrentUserRoles(e){return this.httpClient.request({method:"GET",url:mo`user/userRoles`,options:e})}getCurrentUserClientRoles(e,t){return this.httpClient.request({method:"GET",url:mo`user/userRoles/${e}`,options:t})}disconnectUserSession(e,t,n){return this.httpClient.request({method:"GET",url:mo`user/${e}/disconnect/${t}`,options:n})}resetPassword(e,t,n,o){return this.httpClient.request({method:"PUT",url:mo`user/${e}/reset-password/${t}`,data:n,options:o})}resetSecret(e,t,n){return this.httpClient.request({method:"GET",url:mo`user/${e}/reset-secret/${t}`,options:n})}getRoles(e,t){return this.httpClient.request({method:"GET",url:mo`user/${e}/roles`,options:t})}updateRoles(e,t,n){return this.httpClient.request({method:"PUT",url:mo`user/${e}/roles`,data:t,options:n})}getUserRealmRoles(e,t,n){return this.httpClient.request({method:"GET",url:mo`user/${e}/userRealmRoles/${t}`,options:n})}updateUserRealmRoles(e,t,n,o){return this.httpClient.request({method:"PUT",url:mo`user/${e}/userRealmRoles/${t}`,data:n,options:o})}getUserRoles(e,t,n){return this.httpClient.request({method:"GET",url:mo`user/${e}/userRoles/${t}`,options:n})}updateUserRoles(e,t,n,o){return this.httpClient.request({method:"PUT",url:mo`user/${e}/userRoles/${t}`,data:n,options:o})}getUserClientRoles(e,t,n,o){return this.httpClient.request({method:"GET",url:mo`user/${e}/userRoles/${t}/${n}`,options:o})}updateUserClientRoles(e,t,n,o,r){return this.httpClient.request({method:"PUT",url:mo`user/${e}/userRoles/${t}/${n}`,data:o,options:r})}getUserSessions(e,t,n){return this.httpClient.request({method:"GET",url:mo`user/${e}/userSessions/${t}`,options:n})}create(e,t,n){return this.httpClient.request({method:"POST",url:mo`user/${e}/users`,data:t,options:n})}update(e,t,n){return this.httpClient.request({method:"PUT",url:mo`user/${e}/users`,data:t,options:n})}delete(e,t,n){return this.httpClient.request({method:"DELETE",url:mo`user/${e}/users/${t}`,options:n})}getClientRoles(e,t,n){return this.httpClient.request({method:"GET",url:mo`user/${e}/${t}/roles`,options:n})}updateClientRoles(e,t,n,o){return this.httpClient.request({method:"PUT",url:mo`user/${e}/${t}/roles`,data:n,options:o})}get(e,t,n){return this.httpClient.request({method:"GET",url:mo`user/${e}/${t}`,options:n})}}class Qn{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:mo`asset`,data:e,options:t})}delete(e,t){return this.httpClient.request({method:"DELETE",url:mo`asset`,queryParams:e,options:t})}writeAttributeValues(e,t){return this.httpClient.request({method:"PUT",url:mo`asset/attributes`,data:e,options:t})}writeAttributeEvents(e,t){return this.httpClient.request({method:"PUT",url:mo`asset/attributes/timestamp`,data:e,options:t})}updateNoneParent(e,t){return this.httpClient.request({method:"DELETE",url:mo`asset/parent`,queryParams:e,options:t})}getPartial(e,t){return this.httpClient.request({method:"GET",url:mo`asset/partial/${e}`,options:t})}queryAssets(e,t){return this.httpClient.request({method:"POST",url:mo`asset/query`,data:e,options:t})}getCurrentUserAssets(e){return this.httpClient.request({method:"GET",url:mo`asset/user/current`,options:e})}createUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:mo`asset/user/link`,data:e,options:t})}getUserAssetLinks(e,t){return this.httpClient.request({method:"GET",url:mo`asset/user/link`,queryParams:e,options:t})}deleteUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:mo`asset/user/link/delete`,data:e,options:t})}deleteAllUserAssetLinks(e,t,n){return this.httpClient.request({method:"DELETE",url:mo`asset/user/link/${e}/${t}`,options:n})}deleteUserAssetLink(e,t,n,o){return this.httpClient.request({method:"DELETE",url:mo`asset/user/link/${e}/${t}/${n}`,options:o})}get(e,t){return this.httpClient.request({method:"GET",url:mo`asset/${e}`,options:t})}update(e,t,n){return this.httpClient.request({method:"PUT",url:mo`asset/${e}`,data:t,options:n})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName(e,t,n,o){return this.httpClient.request({method:"PUT",url:mo`asset/${e}/attribute/${t}`,data:n,options:o})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName_timestamp(e,t,n,o,r){return this.httpClient.request({method:"PUT",url:mo`asset/${e}/attribute/${t}/${n}`,data:o,options:r})}updateParent(e,t,n){return this.httpClient.request({method:"PUT",url:mo`asset/${e}/child`,queryParams:t,options:n})}}class eo{constructor(e){this.httpClient=e}doProtocolAssetDiscovery(e,t,n){return this.httpClient.request({method:"GET",url:mo`agent/assetDiscovery/${e}`,queryParams:t,options:n})}doProtocolAssetImport(e,t,n,o){return this.httpClient.request({method:"POST",url:mo`agent/assetImport/${e}`,queryParams:n,data:t,options:o})}doProtocolInstanceDiscovery(e,t,n){return this.httpClient.request({method:"GET",url:mo`agent/instanceDiscovery/${e}`,queryParams:t,options:n})}}class to{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:mo`dashboard`,data:e,options:t})}update(e,t){return this.httpClient.request({method:"PUT",url:mo`dashboard`,data:e,options:t})}getAllRealmDashboards(e,t){return this.httpClient.request({method:"GET",url:mo`dashboard/all/${e}`,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:mo`dashboard/query`,data:e,options:t})}delete(e,t,n){return this.httpClient.request({method:"DELETE",url:mo`dashboard/${e}/${t}`,options:n})}get(e,t,n){return this.httpClient.request({method:"GET",url:mo`dashboard/${e}/${t}`,options:n})}}class no{constructor(e){this.httpClient=e}createProvisioningConfig(e,t){return this.httpClient.request({method:"POST",url:mo`provisioning`,data:e,options:t})}getProvisioningConfigs(e){return this.httpClient.request({method:"GET",url:mo`provisioning`,options:e})}deleteProvisioningConfig(e,t){return this.httpClient.request({method:"DELETE",url:mo`provisioning/${e}`,options:t})}updateProvisioningConfig(e,t,n){return this.httpClient.request({method:"PUT",url:mo`provisioning/${e}`,data:t,options:n})}}class oo{constructor(e){this.httpClient=e}getDatapointExport(e,t){return this.httpClient.request({method:"GET",url:mo`asset/datapoint/export`,queryParams:e,options:t})}getDatapointPeriod(e,t){return this.httpClient.request({method:"GET",url:mo`asset/datapoint/periods`,queryParams:e,options:t})}getDatapoints(e,t,n,o){return this.httpClient.request({method:"POST",url:mo`asset/datapoint/${e}/${t}`,data:n,options:o})}}class ro{constructor(e){this.httpClient=e}getAllNodeDefinitions(e){return this.httpClient.request({method:"GET",url:mo`flow`,options:e})}getNodeDefinition(e,t){return this.httpClient.request({method:"GET",url:mo`flow/${e}`,options:t})}getAllNodeDefinitionsByType(e,t){return this.httpClient.request({method:"GET",url:mo`flow/${e}`,options:t})}}class io{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:mo`realm`,data:e,options:t})}getAll(e){return this.httpClient.request({method:"GET",url:mo`realm`,options:e})}getAccessible(e){return this.httpClient.request({method:"GET",url:mo`realm/accessible`,options:e})}delete(e,t){return this.httpClient.request({method:"DELETE",url:mo`realm/${e}`,options:t})}get(e,t){return this.httpClient.request({method:"GET",url:mo`realm/${e}`,options:t})}update(e,t,n){return this.httpClient.request({method:"PUT",url:mo`realm/${e}`,data:t,options:n})}}class ao{constructor(e){this.httpClient=e}createAlarm(e,t,n){return this.httpClient.request({method:"POST",url:mo`alarm`,queryParams:t,data:e,options:n})}getAlarms(e,t){return this.httpClient.request({method:"GET",url:mo`alarm`,queryParams:e,options:t})}removeAlarms(e,t){return this.httpClient.request({method:"DELETE",url:mo`alarm`,data:e,options:t})}setAssetLinks(e,t){return this.httpClient.request({method:"PUT",url:mo`alarm/assets`,data:e,options:t})}getAlarm(e,t){return this.httpClient.request({method:"GET",url:mo`alarm/${e}`,options:t})}removeAlarm(e,t){return this.httpClient.request({method:"DELETE",url:mo`alarm/${e}`,options:t})}updateAlarm(e,t,n){return this.httpClient.request({method:"PUT",url:mo`alarm/${e}`,data:t,options:n})}getAssetLinks(e,t,n){return this.httpClient.request({method:"GET",url:mo`alarm/${e}/assets`,queryParams:t,options:n})}}class so{constructor(e){this.httpClient=e}getConfig(e){return this.httpClient.request({method:"GET",url:mo`syslog/config`,options:e})}updateConfig(e,t){return this.httpClient.request({method:"PUT",url:mo`syslog/config`,data:e,options:t})}clearEvents(e){return this.httpClient.request({method:"DELETE",url:mo`syslog/event`,options:e})}getEvents(e,t){return this.httpClient.request({method:"GET",url:mo`syslog/event`,queryParams:e,options:t})}}class co{constructor(e){this.httpClient=e}getHealthStatus(e){return this.httpClient.request({method:"GET",url:mo`health`,options:e})}getInfo(e){return this.httpClient.request({method:"GET",url:mo`info`,options:e})}}class lo{constructor(e){this.httpClient=e}getNotifications(e,t){return this.httpClient.request({method:"GET",url:mo`notification`,queryParams:e,options:t})}removeNotifications(e,t){return this.httpClient.request({method:"DELETE",url:mo`notification`,queryParams:e,options:t})}sendNotification(e,t){return this.httpClient.request({method:"POST",url:mo`notification/alert`,data:e,options:t})}removeNotification(e,t){return this.httpClient.request({method:"DELETE",url:mo`notification/${e}`,options:t})}notificationAcknowledged(e,t,n,o){return this.httpClient.request({method:"PUT",url:mo`notification/${e}/acknowledged`,queryParams:n,data:t,options:o})}notificationDelivered(e,t,n){return this.httpClient.request({method:"PUT",url:mo`notification/${e}/delivered`,queryParams:t,options:n})}}class uo{constructor(e){this.httpClient=e}getManagerConfig(e){return this.httpClient.request({method:"GET",url:mo`configuration/manager`,options:e})}update(e,t){return this.httpClient.request({method:"PUT",url:mo`configuration/manager`,data:e,options:t})}fileUpload(e,t,n){return this.httpClient.request({method:"POST",url:mo`configuration/manager/file`,queryParams:t,data:e,options:n})}getManagerConfigImage(e,t){return this.httpClient.request({method:"GET",url:mo`configuration/manager/image/${e}`,options:t})}}function mo(e,...t){let n="";for(let o=0;o<t.length;o++)n+=e[o],n+=encodeURIComponent(t[o]);return n+=e[e.length-1],n}class fo{constructor(e,t=Wn().create()){this._assetPredictedDatapointResource=new ho(e,t),this._gatewayClientResource=new po(e,t),this._consoleResource=new Fo(e,t),this._mapResource=new _o(e,t),this._rulesResource=new go(e,t),this._assetModelResource=new yo(e,t),this._appResource=new vo(e,t),this._gatewayServiceResource=new ko(e,t),this._userResource=new wo(e,t),this._assetResource=new Mo(e,t),this._agentResource=new Lo(e,t),this._dashboardResource=new Do(e,t),this._provisioningResource=new Eo(e,t),this._assetDatapointResource=new Ao(e,t),this._flowResource=new To(e,t),this._realmResource=new Yo(e,t),this._alarmResource=new Co(e,t),this._syslogResource=new So(e,t),this._statusResource=new xo(e,t),this._notificationResource=new Oo(e,t),this._configurationResource=new Bo(e,t),this._assetResource=new Mo(e,t)}get AssetPredictedDatapointResource(){return this._assetPredictedDatapointResource}get GatewayClientResource(){return this._gatewayClientResource}get ConsoleResource(){return this._consoleResource}get MapResource(){return this._mapResource}get RulesResource(){return this._rulesResource}get AssetModelResource(){return this._assetModelResource}get AppResource(){return this._appResource}get GatewayServiceResource(){return this._gatewayServiceResource}get UserResource(){return this._userResource}get AssetResource(){return this._assetResource}get AgentResource(){return this._agentResource}get DashboardResource(){return this._dashboardResource}get ProvisioningResource(){return this._provisioningResource}get AssetDatapointResource(){return this._assetDatapointResource}get FlowResource(){return this._flowResource}get RealmResource(){return this._realmResource}get AlarmResource(){return this._alarmResource}get SyslogResource(){return this._syslogResource}get StatusResource(){return this._statusResource}get NotificationResource(){return this._notificationResource}get ConfigurationResource(){return this._configurationResource}}class bo{constructor(e){this.axios=e}request(e){const t={};t.method=e.method,t.url=e.url,t.params=e.queryParams,t.data=e.data,function(e,t){if(null!=t)for(const n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}(t,e.options);const n=e.copyFn;return this.axios.request(t).then((e=>(n&&e.data&&(e.originalData=e.data,e.data=n(e.data)),e)))}}class ho extends zn{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class po extends Gn{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class Fo extends qn{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class _o extends $n{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class go extends Vn{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class yo extends Jn{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class vo extends Kn{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class ko extends Xn{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class wo extends Zn{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class Mo extends Qn{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class Lo extends eo{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class Do extends to{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class Eo extends no{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class Ao extends oo{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class To extends ro{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class Yo extends io{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class Co extends ao{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class So extends so{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class xo extends co{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class Oo extends lo{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}class Bo extends uo{constructor(e,t=Wn().create()){t.defaults.baseURL=e,super(new bo(t))}}Wn().isAxiosError;const Ro=new class{get api(){return this._client}constructor(){this._axiosInstance=Wn().create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use((e=>(e.paramsSerializer=e=>xn().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 fo(e,this._axiosInstance)}};var Po,jo,Io=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))};(jo=Po||(Po={})).DISCONNECTED="DISCONNECTED",jo.CONNECTED="CONNECTED",jo.CONNECTING="CONNECTING";class No{constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=Ho.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=Po.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;const n=e.indexOf(t);n>=0&&e.splice(n,1)}(this._statusCallbacks,e)}connect(){return this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this._status===Po.CONNECTED?Promise.resolve(!0):(this._disconnectRequested=!1,this._connectingDeferred||(this._onStatusChanged(Po.CONNECTING),this._connectingDeferred=new Pn,this._doConnect().then((e=>{if(this._connectingDeferred){const t=this._connectingDeferred;this._connectingDeferred=null,e?(console.debug("Connected to event service: "+this.endpointUrl),this._reconnectDelayMillis=Ho.MIN_RECONNECT_DELAY,this._onStatusChanged(Po.CONNECTED),window.setTimeout((()=>{this._onConnect()}),0)):(console.debug("Failed to connect to event service: "+this.endpointUrl),this._scheduleReconnect()),t.resolve(e)}}))),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!==Po.DISCONNECTED&&this._doDisconnect())}subscribe(e,t){const n={eventSubscription:e,callback:t,deferred:new Pn};return null!=this._pendingSubscription||this._status!==Po.CONNECTED?(this._queuedSubscriptions.push(n),n.deferred.promise):(this._pendingSubscription=n,this._doSubscribe(e).then((e=>{if(this._pendingSubscription){const t=this._pendingSubscription;this._pendingSubscription=null,this._subscriptionMap.set(e,t),this._processNextSubscription();const n=t.deferred;t.deferred=null,n&&n.resolve(e)}}),(e=>{if(this._pendingSubscription){const t=this._pendingSubscription;this._pendingSubscription=null,this._processNextSubscription();const n=t.deferred;t.deferred=null,n&&n.reject(e)}})),this._pendingSubscription.deferred.promise)}unsubscribe(e){return Io(this,void 0,void 0,(function*(){if(this._subscriptionMap.delete(e))this._doUnsubscribe(e);else if(this._assetEventCallbackMap.delete(e)){if(this._assetEventPromise&&0===this._assetEventCallbackMap.size){const e=yield this._assetEventPromise;this._assetEventPromise=void 0,this.unsubscribe(e)}}else if(this._attributeEventCallbackMap.delete(e)&&this._attributeEventPromise&&0===this._attributeEventCallbackMap.size){const e=yield this._attributeEventPromise;this._attributeEventPromise=void 0,this.unsubscribe(e)}}))}sendEvent(e){this._status===Po.CONNECTED&&this._doSend(e)}sendEventWithReply(e){return this._status!==Po.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(e)}subscribeAssetEvents(e,t,n){return Io(this,void 0,void 0,(function*(){const o=e&&"string"!=typeof e[0]?e.map((e=>e.id)):e,r="AssetEvent"+No._subscriptionCounter++;if(!this._assetEventPromise){let e;Ar.authenticated||(e={filterType:"asset",realm:Ar.displayRealm});const t={eventType:"asset",filter:e};this._assetEventPromise=this.subscribe(t,(e=>{this._assetEventCallbackMap.forEach((t=>t(e)))}))}return this._assetEventCallbackMap.set(r,(e=>{const t=e.asset.id;o?o.find((e=>t===e))&&n(e):e.asset.realm===Ar.displayRealm&&n(e)})),this._assetEventPromise.then((()=>{try{if(o&&t){const e={messageID:"read-assets:"+o.join(",")+":"+r,eventType:"read-assets",assetQuery:{ids:o}};this.sendEventWithReply(e).then((e=>{const t=e;t.assets&&this._assetEventCallbackMap.has(r)&&t.assets.forEach((e=>{n({eventType:"asset",asset:e,cause:"READ"})}))}))}}catch(t){throw console.error("Failed to subscribe to asset events for assets: "+e),r&&this.unsubscribe(r),t}return r}))}))}subscribeAttributeEvents(e,t,n){return Io(this,void 0,void 0,(function*(){const o=e&&"string"!=typeof e[0],r=o?e.map((e=>e.id)):e,i=o?e:void 0,a="AttributeEvent"+No._subscriptionCounter++;if(!this._attributeEventPromise){let e;Ar.authenticated||(e={filterType:"asset",realm:Ar.displayRealm});const t={eventType:"attribute",filter:e};this._attributeEventPromise=this.subscribe(t,(e=>{this._attributeEventCallbackMap.forEach((t=>t(e)))}))}const s=t=>{const i=t.ref;o?e.forEach((e=>{i.id===e.id&&i.name===e.name&&n(t)})):r?r.find((e=>i.id===e))&&n(t):t.realm===Ar.displayRealm&&n(t)};return this._attributeEventCallbackMap.set(a,s),this._attributeEventPromise.then((()=>{try{if(t&&r){const e={messageID:"read-assets:"+r.join(",")+":"+a,eventType:"read-assets",assetQuery:{ids:r}};this.sendEventWithReply(e).then((e=>{const t=e;t.assets&&this._attributeEventCallbackMap.has(a)&&t.assets.forEach((e=>{e.attributes&&Object.entries(e.attributes).forEach((([t,n])=>{i&&!i.find((n=>n.id===e.id&&n.name===t))||s({eventType:"attribute",timestamp:n.timestamp,value:n.value,ref:{id:e.id,name:t}})}))}))}))}}catch(t){throw console.error("Failed to subscribe to asset events for assets: "+e),a&&this.unsubscribe(a),t}return a}))}))}_processNextSubscription(){this._status===Po.CONNECTED&&0!==this._queuedSubscriptions.length&&setTimeout((()=>{const e=this._queuedSubscriptions.shift();e&&this.subscribe(e.eventSubscription,e.callback).then((t=>{const n=e.deferred;e.deferred=null,n&&n.resolve(t)}),(t=>{const n=e.deferred;e.deferred=null,n&&n.reject(t)}))}),0)}_onStatusChanged(e){e!==this._status&&(console.debug("Event provider status changed: "+e),this._status=e,this._unloading||window.setTimeout((()=>{this._statusCallbacks.forEach((t=>t(e)))}),0))}_onMessageReceived(e,t){const n=this._subscriptionMap.get(e);n&&n.callback(t)}_onConnect(){if(Object.keys(this._subscriptionMap).length>0){for(const e in this._subscriptionMap)this._subscriptionMap.has(e)&&this._queuedSubscriptions.unshift(this._subscriptionMap.get(e));this._subscriptionMap.clear()}this._processNextSubscription()}_onDisconnect(){this._status===Po.CONNECTED&&this._onStatusChanged(Po.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._onStatusChanged(Po.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<Ho.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(Ho.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}No.MIN_RECONNECT_DELAY=0,No.MAX_RECONNECT_DELAY=3e4,No._subscriptionCounter=0;class Ho extends No{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="+Ar.config.realm;return Ar.authenticated&&(e+="&Authorization="+Ar.getAuthorizationHeader()),this._webSocket=new WebSocket(e),this._connectDeferred=new Pn,this._webSocket.onopen=()=>{if(this._connectDeferred){const e=this._connectDeferred;this._connectDeferred=null,e.resolve(!0)}},this._webSocket.onerror=e=>{if(this._connectDeferred){const e=this._connectDeferred;this._connectDeferred=null,e.resolve(!1)}else console.debug("Event provider error"),this._beforeDisconnect()},this._webSocket.onclose=()=>{if(this._webSocket=void 0,this._connectDeferred){const e=this._connectDeferred;this._connectDeferred=null,e.resolve(!1)}else this._beforeDisconnect()},this._webSocket.onmessage=e=>{const t=e.data;if(t&&t.startsWith("SUBSCRIBED:")){const e=t.substring(11),n=JSON.parse(e),o=this._subscribeDeferred;this._subscribeDeferred=null,o&&o.resolve(n.subscriptionId)}else if(t.startsWith("UNAUTHORIZED:")){const e=t.substring(13),n=JSON.parse(e),o=this._subscribeDeferred;this._subscribeDeferred=null,o&&(console.warn("Unauthorized event subscription: "+JSON.stringify(n,null,2)),o.reject("Unauthorized"))}else if(t.startsWith("TRIGGERED:")){const e=t.substring(10),n=JSON.parse(e);n.events&&n.events.forEach((e=>{this._onMessageReceived(n.subscriptionId,e)}))}else if(t.startsWith("EVENT:")){const e=t.substring(6),n=JSON.parse(e);if(n.messageID){const e=this._repliesDeferred.get(n.messageID);this._repliesDeferred.delete(n.messageID),e&&e.resolve(n)}}},this._connectDeferred.promise}_beforeDisconnect(){this._onDisconnect()}_doDisconnect(){var e;null===(e=this._webSocket)||void 0===e||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 Pn,e.subscriptionId||(e.subscriptionId=Ho._subscriptionCounter+++""),this._webSocket.send("SUBSCRIBE:"+JSON.stringify(e)),this._subscribeDeferred.promise):Promise.reject("Not connected")}_doUnsubscribe(e){if(!this._webSocket)return;const t={subscriptionId:e};this._webSocket.send("UNSUBSCRIBE:"+JSON.stringify(t))}_doSend(e){const t="EVENT:"+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");const t=new Pn;return this._repliesDeferred.set(e.messageID,t),this._webSocket.send("EVENT:"+JSON.stringify(e)),t.promise}}function Uo(e){return Uo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Uo(e)}Ho._subscriptionCounter=1;var Wo=[],zo=Wo.forEach,Go=Wo.slice;function qo(e){return zo.call(Go.call(arguments,1),(function(t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n])})),e}function $o(){return"function"==typeof XMLHttpRequest||"object"===("undefined"==typeof XMLHttpRequest?"undefined":Uo(XMLHttpRequest))}var Vo,Jo,Ko,Xo=r(6624),Zo=r.t(Xo,2);function Qo(e){return Qo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qo(e)}"function"==typeof fetch&&(Vo="undefined"!=typeof global&&global.fetch?global.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),$o()&&("undefined"!=typeof global&&global.XMLHttpRequest?Jo=global.XMLHttpRequest:"undefined"!=typeof window&&window.XMLHttpRequest&&(Jo=window.XMLHttpRequest)),"function"==typeof ActiveXObject&&("undefined"!=typeof global&&global.ActiveXObject?Ko=global.ActiveXObject:"undefined"!=typeof window&&window.ActiveXObject&&(Ko=window.ActiveXObject)),Vo||!Zo||Jo||Ko||(Vo=Xo||Zo),"function"!=typeof Vo&&(Vo=void 0);var er=function(e,t){if(t&&"object"===Qo(t)){var n="";for(var o in t)n+="&"+encodeURIComponent(o)+"="+encodeURIComponent(t[o]);if(!n)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+n.slice(1)}return e},tr=function(e,t,n){Vo(e,t).then((function(e){if(!e.ok)return n(e.statusText||"Error",{status:e.status});e.text().then((function(t){n(null,{status:e.status,data:t})})).catch(n)})).catch(n)},nr=!1;const or=function(e,t,n,o){return"function"==typeof n&&(o=n,n=void 0),o=o||function(){},Vo?function(e,t,n,o){e.queryStringParams&&(t=er(t,e.queryStringParams));var r=qo({},"function"==typeof e.customHeaders?e.customHeaders():e.customHeaders);n&&(r["Content-Type"]="application/json");var i="function"==typeof e.requestOptions?e.requestOptions(n):e.requestOptions,a=qo({method:n?"POST":"GET",body:n?e.stringify(n):void 0,headers:r},nr?{}:i);try{tr(t,a,o)}catch(e){if(!i||0===Object.keys(i).length||!e.message||e.message.indexOf("not implemented")<0)return o(e);try{Object.keys(i).forEach((function(e){delete a[e]})),tr(t,a,o),nr=!0}catch(e){o(e)}}}(e,t,n,o):$o()||"function"==typeof ActiveXObject?function(e,t,n,o){n&&"object"===Qo(n)&&(n=er("",n).slice(1)),e.queryStringParams&&(t=er(t,e.queryStringParams));try{var r;(r=Jo?new Jo:new Ko("MSXML2.XMLHTTP.3.0")).open(n?"POST":"GET",t,1),e.crossDomain||r.setRequestHeader("X-Requested-With","XMLHttpRequest"),r.withCredentials=!!e.withCredentials,n&&r.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),r.overrideMimeType&&r.overrideMimeType("application/json");var i=e.customHeaders;if(i="function"==typeof i?i():i)for(var a in i)r.setRequestHeader(a,i[a]);r.onreadystatechange=function(){r.readyState>3&&o(r.status>=400?r.statusText:null,{status:r.status,data:r.responseText})},r.send(n)}catch(e){console&&console.log(e)}}(e,t,n,o):void o(new Error("No fetch and no xhr implementation found!"))};function rr(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var ir=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.services=t,this.options=n,this.allOptions=o,this.type="backend",this.init(t,n,o)}var t,n;return t=e,n=[{key:"init",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=qo(n,this.options||{},{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:function(e){return JSON.parse(e)},stringify:JSON.stringify,parsePayload:function(e,t,n){return function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},t,n||"")},request:or,reloadInterval:"undefined"==typeof window&&36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}),this.allOptions=o,this.services&&this.options.reloadInterval&&setInterval((function(){return t.reload()}),this.options.reloadInterval)}},{key:"readMulti",value:function(e,t,n){this._readAny(e,e,t,t,n)}},{key:"read",value:function(e,t,n){this._readAny([e],e,[t],t,n)}},{key:"_readAny",value:function(e,t,n,o,r){var i,a=this,s=this.options.loadPath;"function"==typeof this.options.loadPath&&(s=this.options.loadPath(e,n)),(s=function(e){return!!e&&"function"==typeof e.then}(i=s)?i:Promise.resolve(i)).then((function(i){if(!i)return r(null,{});var s=a.services.interpolator.interpolate(i,{lng:e.join("+"),ns:n.join("+")});a.loadUrl(s,r,t,o)}))}},{key:"loadUrl",value:function(e,t,n,o){var r=this;this.options.request(this.options,e,void 0,(function(i,a){if(a&&(a.status>=500&&a.status<600||!a.status))return t("failed loading "+e+"; status code: "+a.status,!0);if(a&&a.status>=400&&a.status<500)return t("failed loading "+e+"; status code: "+a.status,!1);if(!a&&i&&i.message&&i.message.indexOf("Failed to fetch")>-1)return t("failed loading "+e+": "+i.message,!0);if(i)return t(i,!1);var s,c;try{s="string"==typeof a.data?r.options.parse(a.data,n,o):a.data}catch(t){c="failed parsing "+e+" to json"}if(c)return t(c,!1);t(null,s)}))}},{key:"create",value:function(e,t,n,o,r){var i=this;if(this.options.addPath){"string"==typeof e&&(e=[e]);var a=this.options.parsePayload(t,n,o),s=0,c=[],d=[];e.forEach((function(n){var o=i.options.addPath;"function"==typeof i.options.addPath&&(o=i.options.addPath(n,t));var l=i.services.interpolator.interpolate(o,{lng:n,ns:t});i.options.request(i.options,l,a,(function(t,n){s+=1,c.push(t),d.push(n),s===e.length&&r&&r(c,d)}))}))}}},{key:"reload",value:function(){var e=this,t=this.services,n=t.backendConnector,o=t.languageUtils,r=t.logger,i=n.language;if(!i||"cimode"!==i.toLowerCase()){var a=[],s=function(e){o.toResolveHierarchy(e).forEach((function(e){a.indexOf(e)<0&&a.push(e)}))};s(i),this.allOptions.preload&&this.allOptions.preload.forEach((function(e){return s(e)})),a.forEach((function(t){e.allOptions.ns.forEach((function(e){n.read(t,e,"read",null,null,(function(o,i){o&&r.warn("loading namespace ".concat(e," for language ").concat(t," failed"),o),!o&&i&&r.log("loaded namespace ".concat(e," for language ").concat(t),i),n.loaded("".concat(t,"|").concat(e),o,i)}))}))}))}}}],n&&rr(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();ir.type="backend";const ar=ir,sr=e=>(...t)=>({_$litDirective$:e,values:t});class cr{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}class dr extends cr{constructor(e){if(super(e),this.et=W,2!==e.type)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===W||null==e)return this.ft=void 0,this.et=e;if(e===U)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.et)return this.ft;this.et=e;const t=[e];return t.raw=t,this.ft={_$litType$:this.constructor.resultType,strings:t,values:[]}}}dr.directiveName="unsafeHTML",dr.resultType=1,sr(dr);class lr extends dr{}lr.directiveName="unsafeSVG",lr.resultType=2;const ur=sr(lr),mr=24,fr={logo:'<path style=\'pointer-events: var(--or-icon-pointer-events, none);\' fill="#C4D600" d="m11.96125,23.85096c-6.56773,0 -11.90971,-5.34202 -11.90971,-11.90862l2.49411,0c0,5.19176 4.22389,9.41568 9.41561,9.41568c5.19053,0 9.41561,-4.22392 9.41561,-9.41568c0,-5.19176 -4.22389,-9.41568 -9.41561,-9.41568l0,-2.49413c6.56655,0 11.90971,5.34439 11.90971,11.9098c0,6.5666 -5.34316,11.90862 -11.90971,11.90862l0,0z" /><path fill="#4E9D2D" d="m10.25094,20.38647c-2.26848,-0.47231 -4.21822,-1.80199 -5.48741,-3.74009s-1.70892,-4.25777 -1.23545,-6.52625c0.47347,-2.26965 1.80315,-4.21822 3.74242,-5.48857c1.93926,-1.27035 4.25661,-1.70892 6.52625,-1.23545c4.68471,0.97719 7.70121,5.5828 6.72286,10.26635l-2.39994,-0.49907c0.70149,-3.36085 -1.4623,-6.66585 -4.82431,-7.36734c-1.62866,-0.33969 -3.29105,-0.02559 -4.68238,0.88645c-1.39134,0.91088 -2.34526,2.3092 -2.68495,3.93786c-0.33853,1.62633 -0.02443,3.28988 0.88645,4.68122c0.91088,1.39134 2.3092,2.34526 3.93786,2.68379l-0.50139,2.4011l0,0z"/><path fill="#1D5632"d="m12.03064,17.49616c-0.09524,0 -0.19048,-0.00116 -0.28457,-0.00465c-1.49833,-0.0755 -2.87818,-0.72942 -3.88636,-1.84097c-1.00818,-1.11271 -1.52156,-2.54948 -1.44722,-4.05013l2.44378,0.12196c-0.04181,0.84557 0.24856,1.65745 0.81769,2.28466c0.56681,0.62721 1.34733,0.99656 2.1929,1.03838c0.84208,0.03833 1.65629,-0.2474 2.2835,-0.81653c0.62837,-0.56797 0.99656,-1.34617 1.03954,-2.19174c0.08711,-1.74573 -1.26371,-3.23708 -3.00943,-3.3242l0.12196,-2.44378c3.09422,0.15332 5.4869,2.79455 5.33358,5.88877c-0.07434,1.49949 -0.72942,2.87818 -1.84097,3.8852c-1.04186,0.94313 -2.36945,1.45303 -3.7644,1.45303l0,0z"/>',"logo-plain":"m11.9925,23.91349c-6.58498,0 -11.94099,-5.35605 -11.94099,-11.9399l2.50066,0c0,5.20539 4.23498,9.44041 9.44033,9.44041c5.20416,0 9.44033,-4.23502 9.44033,-9.44041c0,-5.20539 -4.23498,-9.44041 -9.44033,-9.44041l0,-2.50068c6.5838,0 11.94099,5.35842 11.94099,11.94108c0,6.58385 -5.35719,11.9399 -11.94099,11.9399l0,0zm-1.80787,-3.27769c-2.31323,-0.48163 -4.30141,-1.83755 -5.59563,-3.81389s-1.74263,-4.34178 -1.25982,-6.65502c0.48281,-2.31443 1.83872,-4.30145 3.81623,-5.59686c1.97751,-1.29542 4.34056,-1.74264 6.65497,-1.25983c4.77711,0.99647 7.8531,5.69295 6.85545,10.46891l-2.44727,-0.50891c0.71532,-3.42716 -1.49114,-6.79738 -4.91946,-7.5127c-1.66078,-0.34639 -3.35596,-0.0261 -4.77474,0.90394c-1.41878,0.92886 -2.39152,2.35476 -2.73791,4.01555c-0.3452,1.65842 -0.02491,3.3548 0.90394,4.77359c0.92885,1.41879 2.35475,2.39154 4.01552,2.73675l-0.51128,2.44848l0,0zm1.81499,-2.92536c-0.09727,0 -0.19455,-0.00119 -0.29064,-0.00475c-1.53029,-0.07711 -2.93958,-0.74498 -3.96926,-1.88025c-1.02968,-1.13646 -1.55401,-2.60388 -1.47809,-4.13655l2.49591,0.12456c-0.04271,0.86361 0.25386,1.69282 0.83513,2.33341c0.5789,0.64059 1.37607,1.01783 2.23968,1.06053c0.86005,0.03915 1.69162,-0.25268 2.33221,-0.83395c0.64177,-0.58009 1.01782,-1.3749 1.06171,-2.23851c0.08897,-1.78298 -1.29066,-3.30616 -3.07362,-3.39513l0.12456,-2.49593c3.16022,0.15659 5.60394,2.85419 5.44735,6.01443c-0.07592,1.53149 -0.74498,2.9396 -1.88024,3.9681c-1.06408,0.96326 -2.41999,1.48403 -3.8447,1.48403l0,0z",marker:'<ellipse fill="#000" opacity="0.2" ry="1.5" rx="4" cy="22.5" cx="12" /><path style=\'pointer-events: var(--or-icon-pointer-events, none);\' d="m11.999999,0a8.437501,8.344057 0 0 1 8.437501,8.344057c0,6.500779 -5.798864,6.280799 -8.437501,14.412461c-2.638637,-8.131662 -8.437501,-7.911683 -8.437501,-14.412461a8.437501,8.344057 0 0 1 8.437501,-8.344057z" />'};var br=function(e,t,n,o){var r,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a};const hr=r(180);class pr extends CustomEvent{constructor(){super(pr.NAME,{bubbles:!0,composed:!0})}}pr.NAME="or-iconset-added";const Fr=new class{constructor(){this._icons={}}addIconSet(e,t){this._icons[e]=t,this._defaultIconSet||(this._defaultIconSet=t),t.onAdd&&t.onAdd(),window.dispatchEvent(new pr)}getIconSet(e){return this._icons[e]}getIconTemplate(e){if(!e)return H``;const t=(e||"").split(":"),n=t.pop(),o=t.pop();let r=this._defaultIconSet;return o&&(r=this.getIconSet(o)),n&&r?r.getIconTemplate(n):H``}};let _r=class extends se{constructor(){super(...arguments),this._handler=e=>{this._updateIcon()}}static get styles(){return[c`
|
|
181
181
|
:host {
|
|
182
182
|
--internal-or-icon-width: var(--or-icon-width, 24px);
|
|
183
183
|
--internal-or-icon-height: var(--or-icon-height, 24px);
|
|
@@ -220,7 +220,7 @@
|
|
|
220
220
|
width: var(--internal-or-icon-width);
|
|
221
221
|
height: var(--internal-or-icon-height);
|
|
222
222
|
}
|
|
223
|
-
`,c`${s(hr)}`]}render(){return this._iconTemplate||H``}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener(pr.NAME,this._handler)}shouldUpdate(e){return e.has("icon")&&this._updateIcon(),!0}_updateIcon(){this._iconTemplate=void 0,window.removeEventListener(pr.NAME,this._handler),this._iconTemplate=Fr.getIconTemplate(this.icon),this.icon&&!this._iconTemplate&&window.addEventListener(pr.NAME,this._handler)}};br([ue({type:String,reflect:!0})],_r.prototype,"icon",void 0),br([ue({state:!0})],_r.prototype,"_iconTemplate",void 0),_r=br([de("or-icon")],_r);var gr=r(5964);class yr extends Error{}function vr(e,t){if("string"!=typeof e)throw new yr("Invalid token specified: must be a string");t||(t={});const n=!0===t.header?0:1,o=e.split(".")[n];if("string"!=typeof o)throw new yr(`Invalid token specified: missing part #${n+1}`);let r;try{r=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 new Error("base64 string is not of the correct length")}try{return function(e){return decodeURIComponent(atob(e).replace(/(.)/g,((e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return atob(t)}}(o)}catch(e){throw new yr(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(r)}catch(e){throw new yr(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}if(yr.prototype.name="InvalidTokenError","undefined"==typeof Promise)throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function kr(e){if(!(this instanceof kr))throw new Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var t,n,o=this,r=[],i={enable:!0,callbackList:[],interval:5},a=document.getElementsByTagName("script"),s=0;s<a.length;s++)-1===a[s].src.indexOf("keycloak.js")&&-1===a[s].src.indexOf("keycloak.min.js")||-1===a[s].src.indexOf("version=")||(o.iframeVersion=a[s].src.substring(a[s].src.indexOf("version=")+8).split("&")[0]);var c=!0,d=E(console.info),l=E(console.warn);function u(e,t){for(var n=function(e){var t=null,n=window.crypto||window.msCrypto;if(n&&n.getRandomValues&&window.Uint8Array)return t=new Uint8Array(e),n.getRandomValues(t),t;t=new Array(e);for(var o=0;o<t.length;o++)t[o]=Math.floor(256*Math.random());return t}(e),o=new Array(e),r=0;r<e;r++)o[r]=t.charCodeAt(n[r]%t.length);return String.fromCharCode.apply(null,o)}function m(){return void 0!==o.authServerUrl?"/"==o.authServerUrl.charAt(o.authServerUrl.length-1)?o.authServerUrl+"realms/"+encodeURIComponent(o.realm):o.authServerUrl+"/realms/"+encodeURIComponent(o.realm):void 0}function f(e,t){var n=e.code,r=e.error,i=e.prompt,a=(new Date).getTime();if(e.kc_action_status&&o.onActionUpdate&&o.onActionUpdate(e.kc_action_status),r)if("none"!=i)if(e.error_description&&"authentication_expired"===e.error_description)o.login(e.loginOptions);else{var s={error:r,error_description:e.error_description};o.onAuthError&&o.onAuthError(s),t&&t.setError(s)}else t&&t.setSuccess();else if("standard"!=o.flow&&(e.access_token||e.id_token)&&f(e.access_token,null,e.id_token,!0),"implicit"!=o.flow&&n){var l="code="+n+"&grant_type=authorization_code",u=o.endpoints.token(),m=new XMLHttpRequest;m.open("POST",u,!0),m.setRequestHeader("Content-type","application/x-www-form-urlencoded"),l+="&client_id="+encodeURIComponent(o.clientId),l+="&redirect_uri="+e.redirectUri,e.pkceCodeVerifier&&(l+="&code_verifier="+e.pkceCodeVerifier),m.withCredentials=!0,m.onreadystatechange=function(){if(4==m.readyState)if(200==m.status){var e=JSON.parse(m.responseText);f(e.access_token,e.refresh_token,e.id_token,"standard"===o.flow),v()}else o.onAuthError&&o.onAuthError(),t&&t.setError()},m.send(l)}function f(n,r,i,s){h(n,r,i,a=(a+(new Date).getTime())/2),c&&o.idTokenParsed&&o.idTokenParsed.nonce!=e.storedNonce?(d("[KEYCLOAK] Invalid nonce, clearing token"),o.clearToken(),t&&t.setError()):s&&(o.onAuthSuccess&&o.onAuthSuccess(),t&&t.setSuccess())}}function b(e){return 0==e.status&&e.responseText&&e.responseURL.startsWith("file:")}function h(e,t,n,r){if(o.tokenTimeoutHandle&&(clearTimeout(o.tokenTimeoutHandle),o.tokenTimeoutHandle=null),t?(o.refreshToken=t,o.refreshTokenParsed=vr(t)):(delete o.refreshToken,delete o.refreshTokenParsed),n?(o.idToken=n,o.idTokenParsed=vr(n)):(delete o.idToken,delete o.idTokenParsed),e){if(o.token=e,o.tokenParsed=vr(e),o.sessionId=o.tokenParsed.sid,o.authenticated=!0,o.subject=o.tokenParsed.sub,o.realmAccess=o.tokenParsed.realm_access,o.resourceAccess=o.tokenParsed.resource_access,r&&(o.timeSkew=Math.floor(r/1e3)-o.tokenParsed.iat),null!=o.timeSkew&&(d("[KEYCLOAK] Estimated time difference between browser and server is "+o.timeSkew+" seconds"),o.onTokenExpired)){var i=1e3*(o.tokenParsed.exp-(new Date).getTime()/1e3+o.timeSkew);d("[KEYCLOAK] Token expires in "+Math.round(i/1e3)+" s"),i<=0?o.onTokenExpired():o.tokenTimeoutHandle=setTimeout(o.onTokenExpired,i)}}else delete o.token,delete o.tokenParsed,delete o.subject,delete o.realmAccess,delete o.resourceAccess,o.authenticated=!1}function p(){var e="0123456789abcdef",t=u(36,e).split("");return t[14]="4",t[19]=e.substr(3&t[19]|8,1),t[8]=t[13]=t[18]=t[23]="-",t.join("")}function F(e){var t=function(e){var t;switch(o.flow){case"standard":t=["code","state","session_state","kc_action_status","iss"];break;case"implicit":t=["access_token","token_type","id_token","state","session_state","expires_in","kc_action_status","iss"];break;case"hybrid":t=["access_token","token_type","id_token","code","state","session_state","expires_in","kc_action_status","iss"]}t.push("error"),t.push("error_description"),t.push("error_uri");var n,r,i=e.indexOf("?"),a=e.indexOf("#");if("query"===o.responseMode&&-1!==i?(n=e.substring(0,i),""!==(r=_(e.substring(i+1,-1!==a?a:e.length),t)).paramsString&&(n+="?"+r.paramsString),-1!==a&&(n+=e.substring(a))):"fragment"===o.responseMode&&-1!==a&&(n=e.substring(0,a),""!==(r=_(e.substring(a+1),t)).paramsString&&(n+="#"+r.paramsString)),r&&r.oauthParams)if("standard"===o.flow||"hybrid"===o.flow){if((r.oauthParams.code||r.oauthParams.error)&&r.oauthParams.state)return r.oauthParams.newUrl=n,r.oauthParams}else if("implicit"===o.flow&&(r.oauthParams.access_token||r.oauthParams.error)&&r.oauthParams.state)return r.oauthParams.newUrl=n,r.oauthParams}(e);if(t){var r=n.get(t.state);return r&&(t.valid=!0,t.redirectUri=r.redirectUri,t.storedNonce=r.nonce,t.prompt=r.prompt,t.pkceCodeVerifier=r.pkceCodeVerifier,t.loginOptions=r.loginOptions),t}}function _(e,t){for(var n=e.split("&"),o={paramsString:"",oauthParams:{}},r=0;r<n.length;r++){var i=n[r].indexOf("="),a=n[r].slice(0,i);-1!==t.indexOf(a)?o.oauthParams[a]=n[r].slice(i+1):(""!==o.paramsString&&(o.paramsString+="&"),o.paramsString+=n[r])}return o}function g(){var e={setSuccess:function(t){e.resolve(t)},setError:function(t){e.reject(t)}};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e}function y(){var e=g();if(!i.enable)return e.setSuccess(),e.promise;if(i.iframe)return e.setSuccess(),e.promise;var t=document.createElement("iframe");i.iframe=t,t.onload=function(){var t=o.endpoints.authorize();"/"===t.charAt(0)?i.iframeOrigin=window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""):i.iframeOrigin=t.substring(0,t.indexOf("/",8)),e.setSuccess()};var n=o.endpoints.checkSessionIframe();return t.setAttribute("src",n),t.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),t.setAttribute("title","keycloak-session-iframe"),t.style.display="none",document.body.appendChild(t),window.addEventListener("message",(function(e){if(e.origin===i.iframeOrigin&&i.iframe.contentWindow===e.source&&("unchanged"==e.data||"changed"==e.data||"error"==e.data)){"unchanged"!=e.data&&o.clearToken();for(var t=i.callbackList.splice(0,i.callbackList.length),n=t.length-1;n>=0;--n){var r=t[n];"error"==e.data?r.setError():r.setSuccess("unchanged"==e.data)}}}),!1),e.promise}function v(){i.enable&&o.token&&setTimeout((function(){k().then((function(e){e&&v()}))}),1e3*i.interval)}function k(){var e=g();if(i.iframe&&i.iframeOrigin){var t=o.clientId+" "+(o.sessionId?o.sessionId:"");i.callbackList.push(e);var n=i.iframeOrigin;1==i.callbackList.length&&i.iframe.contentWindow.postMessage(t,n)}else e.setSuccess();return e.promise}function w(){var e=g();if(i.enable||o.silentCheckSsoRedirectUri){var t=document.createElement("iframe");t.setAttribute("src",o.endpoints.thirdPartyCookiesIframe()),t.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),t.setAttribute("title","keycloak-3p-check-iframe"),t.style.display="none",document.body.appendChild(t);var n=function(r){t.contentWindow===r.source&&("supported"!==r.data&&"unsupported"!==r.data||("unsupported"===r.data&&(l("[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"),i.enable=!1,o.silentCheckSsoFallback&&(o.silentCheckSsoRedirectUri=!1)),document.body.removeChild(t),window.removeEventListener("message",n),e.setSuccess()))};window.addEventListener("message",n,!1)}else e.setSuccess();return function(e,t,n){var o=null,r=new Promise((function(e,n){o=setTimeout((function(){n({error:"Timeout when waiting for 3rd party check iframe message."})}),t)}));return Promise.race([e,r]).finally((function(){clearTimeout(o)}))}(e.promise,o.messageReceiveTimeout)}function M(e){if(!e||"default"==e)return{login:function(e){return window.location.assign(o.createLoginUrl(e)),g().promise},logout:async function(e){if("GET"===(e?.logoutMethod??o.logoutMethod))return void window.location.replace(o.createLogoutUrl(e));const n=o.createLogoutUrl(e),r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({id_token_hint:o.idToken,client_id:o.clientId,post_logout_redirect_uri:t.redirectUri(e,!1)})});if(r.redirected)window.location.href=r.url;else{if(!r.ok)throw new Error("Logout failed, request returned an error code.");window.location.reload()}},register:function(e){return window.location.assign(o.createRegisterUrl(e)),g().promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0===e)throw"Not supported by the OIDC server";return window.location.href=e,g().promise},redirectUri:function(e,t){return e&&e.redirectUri?e.redirectUri:o.redirectUri?o.redirectUri:location.href}};if("cordova"==e){i.enable=!1;var n=function(e,t,n){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(e,t,n):window.open(e,t,n)},r=function(e){var t=function(e){return e&&e.cordovaOptions?Object.keys(e.cordovaOptions).reduce((function(t,n){return t[n]=e.cordovaOptions[n],t}),{}):{}}(e);return t.location="no",e&&"none"==e.prompt&&(t.hidden="yes"),function(e){return Object.keys(e).reduce((function(t,n){return t.push(n+"="+e[n]),t}),[]).join(",")}(t)},a=function(){return o.redirectUri||"http://localhost"};return{login:function(e){var t=g(),i=r(e),s=o.createLoginUrl(e),c=n(s,"_blank",i),d=!1,l=!1,u=function(){l=!0,c.close()};return c.addEventListener("loadstart",(function(e){0==e.url.indexOf(a())&&(f(F(e.url),t),u(),d=!0)})),c.addEventListener("loaderror",(function(e){d||(0==e.url.indexOf(a())?(f(F(e.url),t),u(),d=!0):(t.setError(),u()))})),c.addEventListener("exit",(function(e){l||t.setError({reason:"closed_by_user"})})),t.promise},logout:function(e){var t,r=g(),i=o.createLogoutUrl(e),s=n(i,"_blank","location=no,hidden=yes,clearcache=yes");return s.addEventListener("loadstart",(function(e){0==e.url.indexOf(a())&&s.close()})),s.addEventListener("loaderror",(function(e){0==e.url.indexOf(a())||(t=!0),s.close()})),s.addEventListener("exit",(function(e){t?r.setError():(o.clearToken(),r.setSuccess())})),r.promise},register:function(e){var t=g(),i=o.createRegisterUrl(),s=r(e),c=n(i,"_blank",s);return c.addEventListener("loadstart",(function(e){0==e.url.indexOf(a())&&(c.close(),f(F(e.url),t))})),t.promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0===e)throw"Not supported by the OIDC server";var t=n(e,"_blank","location=no");t.addEventListener("loadstart",(function(e){0==e.url.indexOf(a())&&t.close()}))},redirectUri:function(e){return a()}}}if("cordova-native"==e)return i.enable=!1,{login:function(e){var t=g(),n=o.createLoginUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),f(F(e.url),t)})),window.cordova.plugins.browsertab.openUrl(n),t.promise},logout:function(e){var t=g(),n=o.createLogoutUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),o.clearToken(),t.setSuccess()})),window.cordova.plugins.browsertab.openUrl(n),t.promise},register:function(e){var t=g(),n=o.createRegisterUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),f(F(e.url),t)})),window.cordova.plugins.browsertab.openUrl(n),t.promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0===e)throw"Not supported by the OIDC server";window.cordova.plugins.browsertab.openUrl(e)},redirectUri:function(e){return e&&e.redirectUri?e.redirectUri:o.redirectUri?o.redirectUri:"http://localhost"}};throw"invalid adapter type: "+e}o.init=function(r){if(o.didInitialize)throw new Error("A 'Keycloak' instance can only be initialized once.");if(o.didInitialize=!0,o.authenticated=!1,n=function(){try{return new L}catch(e){}return new D}(),t=r&&["default","cordova","cordova-native"].indexOf(r.adapter)>-1?M(r.adapter):r&&"object"==typeof r.adapter?r.adapter:window.Cordova||window.cordova?M("cordova"):M(),r){if(void 0!==r.useNonce&&(c=r.useNonce),void 0!==r.checkLoginIframe&&(i.enable=r.checkLoginIframe),r.checkLoginIframeInterval&&(i.interval=r.checkLoginIframeInterval),"login-required"===r.onLoad&&(o.loginRequired=!0),r.responseMode){if("query"!==r.responseMode&&"fragment"!==r.responseMode)throw"Invalid value for responseMode";o.responseMode=r.responseMode}if(r.flow){switch(r.flow){case"standard":o.responseType="code";break;case"implicit":o.responseType="id_token token";break;case"hybrid":o.responseType="code id_token token";break;default:throw"Invalid value for flow"}o.flow=r.flow}if(null!=r.timeSkew&&(o.timeSkew=r.timeSkew),r.redirectUri&&(o.redirectUri=r.redirectUri),r.silentCheckSsoRedirectUri&&(o.silentCheckSsoRedirectUri=r.silentCheckSsoRedirectUri),"boolean"==typeof r.silentCheckSsoFallback?o.silentCheckSsoFallback=r.silentCheckSsoFallback:o.silentCheckSsoFallback=!0,void 0!==r.pkceMethod){if("S256"!==r.pkceMethod&&!1!==r.pkceMethod)throw new TypeError(`Invalid value for pkceMethod', expected 'S256' or false but got ${r.pkceMethod}.`);o.pkceMethod=r.pkceMethod}else o.pkceMethod="S256";"boolean"==typeof r.enableLogging?o.enableLogging=r.enableLogging:o.enableLogging=!1,"POST"===r.logoutMethod?o.logoutMethod="POST":o.logoutMethod="GET","string"==typeof r.scope&&(o.scope=r.scope),"string"==typeof r.acrValues&&(o.acrValues=r.acrValues),"number"==typeof r.messageReceiveTimeout&&r.messageReceiveTimeout>0?o.messageReceiveTimeout=r.messageReceiveTimeout:o.messageReceiveTimeout=1e4}o.responseMode||(o.responseMode="fragment"),o.responseType||(o.responseType="code",o.flow="standard");var a=g(),s=g();s.promise.then((function(){o.onReady&&o.onReady(o.authenticated),a.setSuccess(o.authenticated)})).catch((function(e){a.setError(e)}));var d=function(t){var n,r=g();function i(e){o.endpoints=e?{authorize:function(){return e.authorization_endpoint},token:function(){return e.token_endpoint},logout:function(){if(!e.end_session_endpoint)throw"Not supported by the OIDC server";return e.end_session_endpoint},checkSessionIframe:function(){if(!e.check_session_iframe)throw"Not supported by the OIDC server";return e.check_session_iframe},register:function(){throw'Redirection to "Register user" page not supported in standard OIDC mode'},userinfo:function(){if(!e.userinfo_endpoint)throw"Not supported by the OIDC server";return e.userinfo_endpoint}}:{authorize:function(){return m()+"/protocol/openid-connect/auth"},token:function(){return m()+"/protocol/openid-connect/token"},logout:function(){return m()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var e=m()+"/protocol/openid-connect/login-status-iframe.html";return o.iframeVersion&&(e=e+"?version="+o.iframeVersion),e},thirdPartyCookiesIframe:function(){var e=m()+"/protocol/openid-connect/3p-cookies/step1.html";return o.iframeVersion&&(e=e+"?version="+o.iframeVersion),e},register:function(){return m()+"/protocol/openid-connect/registrations"},userinfo:function(){return m()+"/protocol/openid-connect/userinfo"}}}if(e?"string"==typeof e&&(n=e):n="keycloak.json",n)(c=new XMLHttpRequest).open("GET",n,!0),c.setRequestHeader("Accept","application/json"),c.onreadystatechange=function(){if(4==c.readyState)if(200==c.status||b(c)){var e=JSON.parse(c.responseText);o.authServerUrl=e["auth-server-url"],o.realm=e.realm,o.clientId=e.resource,i(null),r.setSuccess()}else r.setError()},c.send();else{if(!e.clientId)throw"clientId missing";o.clientId=e.clientId;var a=e.oidcProvider;if(a){var s,c;"string"==typeof a?(s="/"==a.charAt(a.length-1)?a+".well-known/openid-configuration":a+"/.well-known/openid-configuration",(c=new XMLHttpRequest).open("GET",s,!0),c.setRequestHeader("Accept","application/json"),c.onreadystatechange=function(){4==c.readyState&&(200==c.status||b(c)?(i(JSON.parse(c.responseText)),r.setSuccess()):r.setError())},c.send()):(i(a),r.setSuccess())}else{if(!e.url)for(var d=document.getElementsByTagName("script"),l=0;l<d.length;l++)if(d[l].src.match(/.*keycloak\.js/)){e.url=d[l].src.substr(0,d[l].src.indexOf("/js/keycloak.js"));break}if(!e.realm)throw"realm missing";o.authServerUrl=e.url,o.realm=e.realm,i(null),r.setSuccess()}}return r.promise}();function l(){var e=function(e){e||(n.prompt="none"),r&&r.locale&&(n.locale=r.locale),o.login(n).then((function(){s.setSuccess()})).catch((function(e){s.setError(e)}))},t=function(){var e=document.createElement("iframe"),t=o.createLoginUrl({prompt:"none",redirectUri:o.silentCheckSsoRedirectUri});e.setAttribute("src",t),e.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),e.setAttribute("title","keycloak-silent-check-sso"),e.style.display="none",document.body.appendChild(e);var n=function(t){t.origin===window.location.origin&&e.contentWindow===t.source&&(f(F(t.data),s),document.body.removeChild(e),window.removeEventListener("message",n))};window.addEventListener("message",n)},n={};switch(r.onLoad){case"check-sso":i.enable?y().then((function(){k().then((function(n){n?s.setSuccess():o.silentCheckSsoRedirectUri?t():e(!1)})).catch((function(e){s.setError(e)}))})):o.silentCheckSsoRedirectUri?t():e(!1);break;case"login-required":e(!0);break;default:throw"Invalid value for onLoad"}}function u(){var e=F(window.location.href);if(e&&window.history.replaceState(window.history.state,null,e.newUrl),e&&e.valid)return y().then((function(){f(e,s)})).catch((function(e){s.setError(e)}));r?r.token&&r.refreshToken?(h(r.token,r.refreshToken,r.idToken),i.enable?y().then((function(){k().then((function(e){e?(o.onAuthSuccess&&o.onAuthSuccess(),s.setSuccess(),v()):s.setSuccess()})).catch((function(e){s.setError(e)}))})):o.updateToken(-1).then((function(){o.onAuthSuccess&&o.onAuthSuccess(),s.setSuccess()})).catch((function(e){o.onAuthError&&o.onAuthError(),r.onLoad?l():s.setError(e)}))):r.onLoad?l():s.setSuccess():s.setSuccess()}return d.then((function(){(function(){var e=g(),t=function(){"interactive"!==document.readyState&&"complete"!==document.readyState||(document.removeEventListener("readystatechange",t),e.setSuccess())};return document.addEventListener("readystatechange",t),t(),e.promise})().then(w).then(u).catch((function(e){a.setError(e)}))})),d.catch((function(e){a.setError(e)})),a.promise},o.login=function(e){return t.login(e)},o.createLoginUrl=function(e){var r,i=p(),a=p(),s=t.redirectUri(e),d={state:i,nonce:a,redirectUri:encodeURIComponent(s),loginOptions:e};e&&e.prompt&&(d.prompt=e.prompt),r=e&&"register"==e.action?o.endpoints.register():o.endpoints.authorize();var l=e&&e.scope||o.scope;l?-1===l.indexOf("openid")&&(l="openid "+l):l="openid";var m,f=r+"?client_id="+encodeURIComponent(o.clientId)+"&redirect_uri="+encodeURIComponent(s)+"&state="+encodeURIComponent(i)+"&response_mode="+encodeURIComponent(o.responseMode)+"&response_type="+encodeURIComponent(o.responseType)+"&scope="+encodeURIComponent(l);if(c&&(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){var b=(m={id_token:{acr:e.acr}},JSON.stringify(m));f+="&claims="+encodeURIComponent(b)}if((e&&e.acrValues||o.acrValues)&&(f+="&acr_values="+encodeURIComponent(e.acrValues||o.acrValues)),o.pkceMethod){var h=u(96,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");d.pkceCodeVerifier=h,f+="&code_challenge="+function(e,t){if("S256"!==e)throw new TypeError(`Invalid value for 'pkceMethod', expected 'S256' but got '${e}'.`);return function(e){const t=String.fromCodePoint(...e);return btoa(t)}(new Uint8Array(gr.arrayBuffer(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}(o.pkceMethod,h),f+="&code_challenge_method="+o.pkceMethod}return n.add(d),f},o.logout=function(e){return t.logout(e)},o.createLogoutUrl=function(e){if("POST"===(e?.logoutMethod??o.logoutMethod))return o.endpoints.logout();var n=o.endpoints.logout()+"?client_id="+encodeURIComponent(o.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(t.redirectUri(e,!1));return o.idToken&&(n+="&id_token_hint="+encodeURIComponent(o.idToken)),n},o.register=function(e){return t.register(e)},o.createRegisterUrl=function(e){return e||(e={}),e.action="register",o.createLoginUrl(e)},o.createAccountUrl=function(e){var n=m(),r=void 0;return void 0!==n&&(r=n+"/account?referrer="+encodeURIComponent(o.clientId)+"&referrer_uri="+encodeURIComponent(t.redirectUri(e))),r},o.accountManagement=function(){return t.accountManagement()},o.hasRealmRole=function(e){var t=o.realmAccess;return!!t&&t.roles.indexOf(e)>=0},o.hasResourceRole=function(e,t){if(!o.resourceAccess)return!1;var n=o.resourceAccess[t||o.clientId];return!!n&&n.roles.indexOf(e)>=0},o.loadUserProfile=function(){var e=m()+"/account",t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+o.token);var n=g();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(o.profile=JSON.parse(t.responseText),n.setSuccess(o.profile)):n.setError())},t.send(),n.promise},o.loadUserInfo=function(){var e=o.endpoints.userinfo(),t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+o.token);var n=g();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(o.userInfo=JSON.parse(t.responseText),n.setSuccess(o.userInfo)):n.setError())},t.send(),n.promise},o.isTokenExpired=function(e){if(!o.tokenParsed||!o.refreshToken&&"implicit"!=o.flow)throw"Not authenticated";if(null==o.timeSkew)return d("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var t=o.tokenParsed.exp-Math.ceil((new Date).getTime()/1e3)+o.timeSkew;if(e){if(isNaN(e))throw"Invalid minValidity";t-=e}return t<0},o.updateToken=function(e){var t=g();if(!o.refreshToken)return t.setError(),t.promise;e=e||5;var n=function(){var n=!1;if(-1==e?(n=!0,d("[KEYCLOAK] Refreshing token: forced refresh")):o.tokenParsed&&!o.isTokenExpired(e)||(n=!0,d("[KEYCLOAK] Refreshing token: token expired")),n){var i="grant_type=refresh_token&refresh_token="+o.refreshToken,a=o.endpoints.token();if(r.push(t),1==r.length){var s=new XMLHttpRequest;s.open("POST",a,!0),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),s.withCredentials=!0,i+="&client_id="+encodeURIComponent(o.clientId);var c=(new Date).getTime();s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status){d("[KEYCLOAK] Token refreshed"),c=(c+(new Date).getTime())/2;var e=JSON.parse(s.responseText);h(e.access_token,e.refresh_token,e.id_token,c),o.onAuthRefreshSuccess&&o.onAuthRefreshSuccess();for(var t=r.pop();null!=t;t=r.pop())t.setSuccess(!0)}else for(l("[KEYCLOAK] Failed to refresh token"),400==s.status&&o.clearToken(),o.onAuthRefreshError&&o.onAuthRefreshError(),t=r.pop();null!=t;t=r.pop())t.setError(!0)},s.send(i)}}else t.setSuccess(!1)};return i.enable?k().then((function(){n()})).catch((function(e){t.setError(e)})):n(),t.promise},o.clearToken=function(){o.token&&(h(null,null,null),o.onAuthLogout&&o.onAuthLogout(),o.loginRequired&&o.login())};var L=function(){if(!(this instanceof L))return new L;function e(){for(var e=(new Date).getTime(),t=0;t<localStorage.length;t++){var n=localStorage.key(t);if(n&&0==n.indexOf("kc-callback-")){var o=localStorage.getItem(n);if(o)try{var r=JSON.parse(o).expires;(!r||r<e)&&localStorage.removeItem(n)}catch(e){localStorage.removeItem(n)}}}}localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test"),this.get=function(t){if(t){var n="kc-callback-"+t,o=localStorage.getItem(n);return o&&(localStorage.removeItem(n),o=JSON.parse(o)),e(),o}},this.add=function(t){e();var n="kc-callback-"+t.state;t.expires=(new Date).getTime()+36e5,localStorage.setItem(n,JSON.stringify(t))}},D=function(){if(!(this instanceof D))return new D;var e=this;e.get=function(e){if(e){var r=n("kc-callback-"+e);return o("kc-callback-"+e,"",t(-100)),r?JSON.parse(r):void 0}},e.add=function(e){o("kc-callback-"+e.state,JSON.stringify(e),t(60))},e.removeItem=function(e){o(e,"",t(-100))};var t=function(e){var t=new Date;return t.setTime(t.getTime()+60*e*1e3),t},n=function(e){for(var t=e+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){for(var r=n[o];" "==r.charAt(0);)r=r.substring(1);if(0==r.indexOf(t))return r.substring(t.length,r.length)}return""},o=function(e,t,n){var o=e+"="+t+"; expires="+n.toUTCString()+"; ";document.cookie=o}};function E(e){return function(){o.enableLogging&&e.apply(console,Array.prototype.slice.call(arguments))}}}var wr,Mr,Lr=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))};!function(e){e.MANAGER_FAILED_TO_LOAD="MANAGER_FAILED_TO_LOAD",e.AUTH_FAILED="AUTH_FAILED",e.AUTH_TYPE_UNSUPPORTED="AUTH_TYPE_UNSUPPORTED",e.CONSOLE_ERROR="CONSOLE_INIT_ERROR",e.EVENTS_CONNECTION_ERROR="EVENTS_CONNECTION_ERROR",e.TRANSLATION_ERROR="TRANSLATION_ERROR"}(wr||(wr={})),function(e){e.ERROR="ERROR",e.READY="READY",e.ONLINE="ONLINE",e.OFFLINE="OFFLINE",e.CONNECTING="CONNECTING",e.CONSOLE_INIT="CONSOLE_INIT",e.CONSOLE_READY="CONSOLE_READY",e.TRANSLATE_INIT="TRANSLATE_INIT",e.TRANSLATE_LANGUAGE_CHANGED="TRANSLATE_LANGUAGE_CHANGED",e.DISPLAY_REALM_CHANGED="DISPLAY_REALM_CHANGED"}(Mr||(Mr={}));class Dr{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(){const e=new Map;return this._keycloak?this._keycloak.resourceAccess&&this._config.clientId&&this._keycloak.resourceAccess&&Object.entries(this._keycloak.resourceAccess).forEach((([t,n])=>{const o=n.roles;e.set(t,o)})):this._basicIdentity&&this._basicIdentity.roles&&e.set(this._config.clientId,this._basicIdentity.roles.map((e=>e.name))),e}get managerVersion(){return this._managerVersion}get isManagerAvailable(){return this._managerVersion&&""!==this._managerVersion}get managerUrl(){return this._config.managerUrl}get keycloakUrl(){return this._config.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 Ro}get language(){return vt.language}set language(e){console.debug(`Changing language to ${e}.`),e&&(vt.changeLanguage(e),this.console.storeData("LANGUAGE",e),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(Mr.DISPLAY_REALM_CHANGED))}getEventProvider(){return this.events}get mapType(){return this._config.mapType||"VECTOR"}isManagerSameOrigin(){if(!this.ready)return!1;const e=new URL(this._config.managerUrl),t=window.location;return e.protocol===t.protocol&&e.hostname===t.hostname&&e.port===t.port}addListener(e){this._listeners.indexOf(e)<0&&this._listeners.push(e)}removeListener(e){const t=this._listeners.indexOf(e);t>=0&&this._listeners.splice(t,1)}init(e){return Lr(this,void 0,void 0,(function*(){this._config&&console.debug("Already initialised"),this._config=function(e){const t=e?Object.assign({},e):{};return t.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(/\/manager\/\S*/g,""),t.keycloakUrl&&""!==t.keycloakUrl||(t.keycloakUrl=t.managerUrl+"/auth"),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="openremote"),t}(e);let t=yield this.loadManagerInfo();const n=new Hn(this._config.realm,this._config.consoleAutoEnable,(()=>{this._emitEvent(Mr.CONSOLE_READY)}));if(this._console=n,"BASIC"===this._config.auth)t=(yield this.doTranslateInit())&&t,t=yield this.doAuthInit();else if("KEYCLOAK"===this._config.auth){if(!this._config.keycloakUrl&&this._authServerUrl){const e=new URL(this._config.managerUrl);let t;this._authServerUrl.startsWith("//")&&(this._authServerUrl=e.protocol+this._authServerUrl);try{t=new URL(this._authServerUrl)}catch(n){t=new URL(e),t.pathname=this._authServerUrl}t.protocol||(t.protocol=e.protocol),t.hostname||(t.hostname=e.hostname),t.port||(t.port=e.port),this._config.keycloakUrl=t.toString()}this._config.keycloakUrl||(this._config.keycloakUrl=this._config.managerUrl+"/auth"),this._config.keycloakUrl=this._config.keycloakUrl.replace(/\/+$/,""),t=yield this.doAuthInit(),t||this._config.skipFallbackToBasicAuth||(console.debug("Falling back to basic auth"),this._config.auth="BASIC",t=yield this.doAuthInit())}return!!t&&(t&&(t=this.doRestApiInit()),(yield this.doConsoleInit())&&this._clearWebHistory(),t=(yield this.doTranslateInit())&&t,t&&(t=yield this.doDescriptorsInit(),t=yield this.getConsoleAppConfig()),this.doIconInit(),t?(this._readyCallback&&(yield this._readyCallback()),this._ready=!0,this._emitEvent(Mr.READY)):(this._config=void 0,console.warn("Failed to initialise the manager")),this.displayRealm=e.realm||"master",t)}))}loadManagerInfo(){return Lr(this,void 0,void 0,(function*(){try{const e=yield new Promise(((e,t)=>{const n=new XMLHttpRequest;n.addEventListener("load",(()=>{e(JSON.parse(n.responseText))})),n.addEventListener("error",(()=>{t(new Error("Failed to contact the manager"))})),n.open("GET",this._config.managerUrl+"/api/master/info"),n.send()}));return this._managerVersion=e&&e.version?e.version:"",this._authServerUrl=e&&e.authServerUrl?e.authServerUrl:"",!0}catch(e){return console.error("Failed to contact the manager",e),this._setError(wr.MANAGER_FAILED_TO_LOAD),!1}}))}doTranslateInit(){return Lr(this,void 0,void 0,(function*(){if(vt.isInitialized)return!0;vt.on("initialized",(e=>{this._emitEvent(Mr.TRANSLATE_INIT)})),vt.on("languageChanged",(e=>{Rn().locale(e),this._emitEvent(Mr.TRANSLATE_LANGUAGE_CHANGED)}));const 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,n)=>"uppercase"===t?e.toUpperCase():e instanceof Date?Rn()(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 vt.use(ar).init(e)}catch(e){return console.error(e),this._setError(wr.TRANSLATION_ERROR),!1}return!0}))}doDescriptorsInit(){return Lr(this,void 0,void 0,(function*(){if(!this.config.loadDescriptors)return!0;try{const e=yield Ro.api.AssetModelResource.getAssetInfos(),t=yield Ro.api.AssetModelResource.getMetaItemDescriptors(),n=yield Ro.api.AssetModelResource.getValueDescriptors();On._assetTypeInfos=e.data,On._metaItemDescriptors=Object.values(t.data),On._valueDescriptors=Object.values(n.data)}catch(e){return console.error(e),!1}return!0}))}doAuthInit(){return Lr(this,void 0,void 0,(function*(){let e=!0;switch(this._config.auth){case"BASIC":e=yield this.initialiseBasicAuth();break;case"KEYCLOAK":e=yield this.loadAndInitialiseKeycloak();break;case"NONE":return!0;default:return this._setError(wr.AUTH_TYPE_UNSUPPORTED),!1}return!!e&&(Ro.addRequestInterceptor((e=>{if(!e.headers.Authorization){const t=this.getAuthorizationHeader();t&&(e.headers.Authorization=t)}return e})),e)}))}doRestApiInit(){return Ro.setTimeout(2e4),Ro.initialise(this.getApiBaseUrl()),!0}doEventsSubscriptionInit(){return Lr(this,void 0,void 0,(function*(){let e=!1;return"WEBSOCKET"===this._config.eventProviderType&&(this._events=new Ho(this._config.managerUrl),this._events.subscribeStatusChange((e=>this._onEventProviderStatusChanged(e))),e=yield this._events.connect()),e||this._setError(wr.EVENTS_CONNECTION_ERROR),e}))}_connectEvents(){var e;(null===(e=this.events)||void 0===e?void 0:e.status)===Po.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 Po.DISCONNECTED:this._onDisconnect();break;case Po.CONNECTED:break;case Po.CONNECTING:this._emitEvent(Mr.CONNECTING)}}doConsoleInit(){return Lr(this,void 0,void 0,(function*(){try{return yield this.console.initialise(),this._emitEvent(Mr.CONSOLE_INIT),!0}catch(e){return this._setError(wr.CONSOLE_ERROR),!1}}))}doIconInit(){var e;this._config.loadIcons&&(Fr.addIconSet("mdi",(e=Er.config.managerUrl,{getIconTemplate:e=>H`<span style="font-family: 'Material Design Icons';" class="mdi-${e}"></span>`,onAdd(){const 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)}})),Fr.addIconSet("or",function(e,t){return{getIconTemplate:n=>{const o=t[n];return o?H`
|
|
223
|
+
`,c`${s(hr)}`]}render(){return this._iconTemplate||H``}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener(pr.NAME,this._handler)}shouldUpdate(e){return e.has("icon")&&this._updateIcon(),!0}_updateIcon(){this._iconTemplate=void 0,window.removeEventListener(pr.NAME,this._handler),this._iconTemplate=Fr.getIconTemplate(this.icon),this.icon&&!this._iconTemplate&&window.addEventListener(pr.NAME,this._handler)}};br([ue({type:String,reflect:!0})],_r.prototype,"icon",void 0),br([ue({state:!0})],_r.prototype,"_iconTemplate",void 0),_r=br([de("or-icon")],_r);var gr=r(5964);class yr extends Error{}function vr(e,t){if("string"!=typeof e)throw new yr("Invalid token specified: must be a string");t||(t={});const n=!0===t.header?0:1,o=e.split(".")[n];if("string"!=typeof o)throw new yr(`Invalid token specified: missing part #${n+1}`);let r;try{r=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 new Error("base64 string is not of the correct length")}try{return function(e){return decodeURIComponent(atob(e).replace(/(.)/g,((e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return atob(t)}}(o)}catch(e){throw new yr(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(r)}catch(e){throw new yr(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}if(yr.prototype.name="InvalidTokenError","undefined"==typeof Promise)throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function kr(e){if(!(this instanceof kr))throw new Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var t,n,o=this,r=[],i={enable:!0,callbackList:[],interval:5},a=document.getElementsByTagName("script"),s=0;s<a.length;s++)-1===a[s].src.indexOf("keycloak.js")&&-1===a[s].src.indexOf("keycloak.min.js")||-1===a[s].src.indexOf("version=")||(o.iframeVersion=a[s].src.substring(a[s].src.indexOf("version=")+8).split("&")[0]);var c=!0,d=E(console.info),l=E(console.warn);function u(e,t){for(var n=function(e){var t=null,n=window.crypto||window.msCrypto;if(n&&n.getRandomValues&&window.Uint8Array)return t=new Uint8Array(e),n.getRandomValues(t),t;t=new Array(e);for(var o=0;o<t.length;o++)t[o]=Math.floor(256*Math.random());return t}(e),o=new Array(e),r=0;r<e;r++)o[r]=t.charCodeAt(n[r]%t.length);return String.fromCharCode.apply(null,o)}function m(){return void 0!==o.authServerUrl?"/"==o.authServerUrl.charAt(o.authServerUrl.length-1)?o.authServerUrl+"realms/"+encodeURIComponent(o.realm):o.authServerUrl+"/realms/"+encodeURIComponent(o.realm):void 0}function f(e,t){var n=e.code,r=e.error,i=e.prompt,a=(new Date).getTime();if(e.kc_action_status&&o.onActionUpdate&&o.onActionUpdate(e.kc_action_status),r)if("none"!=i)if(e.error_description&&"authentication_expired"===e.error_description)o.login(e.loginOptions);else{var s={error:r,error_description:e.error_description};o.onAuthError&&o.onAuthError(s),t&&t.setError(s)}else t&&t.setSuccess();else if("standard"!=o.flow&&(e.access_token||e.id_token)&&f(e.access_token,null,e.id_token,!0),"implicit"!=o.flow&&n){var l="code="+n+"&grant_type=authorization_code",u=o.endpoints.token(),m=new XMLHttpRequest;m.open("POST",u,!0),m.setRequestHeader("Content-type","application/x-www-form-urlencoded"),l+="&client_id="+encodeURIComponent(o.clientId),l+="&redirect_uri="+e.redirectUri,e.pkceCodeVerifier&&(l+="&code_verifier="+e.pkceCodeVerifier),m.withCredentials=!0,m.onreadystatechange=function(){if(4==m.readyState)if(200==m.status){var e=JSON.parse(m.responseText);f(e.access_token,e.refresh_token,e.id_token,"standard"===o.flow),v()}else o.onAuthError&&o.onAuthError(),t&&t.setError()},m.send(l)}function f(n,r,i,s){h(n,r,i,a=(a+(new Date).getTime())/2),c&&o.idTokenParsed&&o.idTokenParsed.nonce!=e.storedNonce?(d("[KEYCLOAK] Invalid nonce, clearing token"),o.clearToken(),t&&t.setError()):s&&(o.onAuthSuccess&&o.onAuthSuccess(),t&&t.setSuccess())}}function b(e){return 0==e.status&&e.responseText&&e.responseURL.startsWith("file:")}function h(e,t,n,r){if(o.tokenTimeoutHandle&&(clearTimeout(o.tokenTimeoutHandle),o.tokenTimeoutHandle=null),t?(o.refreshToken=t,o.refreshTokenParsed=vr(t)):(delete o.refreshToken,delete o.refreshTokenParsed),n?(o.idToken=n,o.idTokenParsed=vr(n)):(delete o.idToken,delete o.idTokenParsed),e){if(o.token=e,o.tokenParsed=vr(e),o.sessionId=o.tokenParsed.sid,o.authenticated=!0,o.subject=o.tokenParsed.sub,o.realmAccess=o.tokenParsed.realm_access,o.resourceAccess=o.tokenParsed.resource_access,r&&(o.timeSkew=Math.floor(r/1e3)-o.tokenParsed.iat),null!=o.timeSkew&&(d("[KEYCLOAK] Estimated time difference between browser and server is "+o.timeSkew+" seconds"),o.onTokenExpired)){var i=1e3*(o.tokenParsed.exp-(new Date).getTime()/1e3+o.timeSkew);d("[KEYCLOAK] Token expires in "+Math.round(i/1e3)+" s"),i<=0?o.onTokenExpired():o.tokenTimeoutHandle=setTimeout(o.onTokenExpired,i)}}else delete o.token,delete o.tokenParsed,delete o.subject,delete o.realmAccess,delete o.resourceAccess,o.authenticated=!1}function p(){var e="0123456789abcdef",t=u(36,e).split("");return t[14]="4",t[19]=e.substr(3&t[19]|8,1),t[8]=t[13]=t[18]=t[23]="-",t.join("")}function F(e){var t=function(e){var t;switch(o.flow){case"standard":t=["code","state","session_state","kc_action_status","iss"];break;case"implicit":t=["access_token","token_type","id_token","state","session_state","expires_in","kc_action_status","iss"];break;case"hybrid":t=["access_token","token_type","id_token","code","state","session_state","expires_in","kc_action_status","iss"]}t.push("error"),t.push("error_description"),t.push("error_uri");var n,r,i=e.indexOf("?"),a=e.indexOf("#");if("query"===o.responseMode&&-1!==i?(n=e.substring(0,i),""!==(r=_(e.substring(i+1,-1!==a?a:e.length),t)).paramsString&&(n+="?"+r.paramsString),-1!==a&&(n+=e.substring(a))):"fragment"===o.responseMode&&-1!==a&&(n=e.substring(0,a),""!==(r=_(e.substring(a+1),t)).paramsString&&(n+="#"+r.paramsString)),r&&r.oauthParams)if("standard"===o.flow||"hybrid"===o.flow){if((r.oauthParams.code||r.oauthParams.error)&&r.oauthParams.state)return r.oauthParams.newUrl=n,r.oauthParams}else if("implicit"===o.flow&&(r.oauthParams.access_token||r.oauthParams.error)&&r.oauthParams.state)return r.oauthParams.newUrl=n,r.oauthParams}(e);if(t){var r=n.get(t.state);return r&&(t.valid=!0,t.redirectUri=r.redirectUri,t.storedNonce=r.nonce,t.prompt=r.prompt,t.pkceCodeVerifier=r.pkceCodeVerifier,t.loginOptions=r.loginOptions),t}}function _(e,t){for(var n=e.split("&"),o={paramsString:"",oauthParams:{}},r=0;r<n.length;r++){var i=n[r].indexOf("="),a=n[r].slice(0,i);-1!==t.indexOf(a)?o.oauthParams[a]=n[r].slice(i+1):(""!==o.paramsString&&(o.paramsString+="&"),o.paramsString+=n[r])}return o}function g(){var e={setSuccess:function(t){e.resolve(t)},setError:function(t){e.reject(t)}};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e}function y(){var e=g();if(!i.enable)return e.setSuccess(),e.promise;if(i.iframe)return e.setSuccess(),e.promise;var t=document.createElement("iframe");i.iframe=t,t.onload=function(){var t=o.endpoints.authorize();"/"===t.charAt(0)?i.iframeOrigin=window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""):i.iframeOrigin=t.substring(0,t.indexOf("/",8)),e.setSuccess()};var n=o.endpoints.checkSessionIframe();return t.setAttribute("src",n),t.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),t.setAttribute("title","keycloak-session-iframe"),t.style.display="none",document.body.appendChild(t),window.addEventListener("message",(function(e){if(e.origin===i.iframeOrigin&&i.iframe.contentWindow===e.source&&("unchanged"==e.data||"changed"==e.data||"error"==e.data)){"unchanged"!=e.data&&o.clearToken();for(var t=i.callbackList.splice(0,i.callbackList.length),n=t.length-1;n>=0;--n){var r=t[n];"error"==e.data?r.setError():r.setSuccess("unchanged"==e.data)}}}),!1),e.promise}function v(){i.enable&&o.token&&setTimeout((function(){k().then((function(e){e&&v()}))}),1e3*i.interval)}function k(){var e=g();if(i.iframe&&i.iframeOrigin){var t=o.clientId+" "+(o.sessionId?o.sessionId:"");i.callbackList.push(e);var n=i.iframeOrigin;1==i.callbackList.length&&i.iframe.contentWindow.postMessage(t,n)}else e.setSuccess();return e.promise}function w(){var e=g();if(i.enable||o.silentCheckSsoRedirectUri){var t=document.createElement("iframe");t.setAttribute("src",o.endpoints.thirdPartyCookiesIframe()),t.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),t.setAttribute("title","keycloak-3p-check-iframe"),t.style.display="none",document.body.appendChild(t);var n=function(r){t.contentWindow===r.source&&("supported"!==r.data&&"unsupported"!==r.data||("unsupported"===r.data&&(l("[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"),i.enable=!1,o.silentCheckSsoFallback&&(o.silentCheckSsoRedirectUri=!1)),document.body.removeChild(t),window.removeEventListener("message",n),e.setSuccess()))};window.addEventListener("message",n,!1)}else e.setSuccess();return function(e,t,n){var o=null,r=new Promise((function(e,n){o=setTimeout((function(){n({error:"Timeout when waiting for 3rd party check iframe message."})}),t)}));return Promise.race([e,r]).finally((function(){clearTimeout(o)}))}(e.promise,o.messageReceiveTimeout)}function M(e){if(!e||"default"==e)return{login:function(e){return window.location.assign(o.createLoginUrl(e)),g().promise},logout:async function(e){if("GET"===(e?.logoutMethod??o.logoutMethod))return void window.location.replace(o.createLogoutUrl(e));const n=o.createLogoutUrl(e),r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({id_token_hint:o.idToken,client_id:o.clientId,post_logout_redirect_uri:t.redirectUri(e,!1)})});if(r.redirected)window.location.href=r.url;else{if(!r.ok)throw new Error("Logout failed, request returned an error code.");window.location.reload()}},register:function(e){return window.location.assign(o.createRegisterUrl(e)),g().promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0===e)throw"Not supported by the OIDC server";return window.location.href=e,g().promise},redirectUri:function(e,t){return e&&e.redirectUri?e.redirectUri:o.redirectUri?o.redirectUri:location.href}};if("cordova"==e){i.enable=!1;var n=function(e,t,n){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(e,t,n):window.open(e,t,n)},r=function(e){var t=function(e){return e&&e.cordovaOptions?Object.keys(e.cordovaOptions).reduce((function(t,n){return t[n]=e.cordovaOptions[n],t}),{}):{}}(e);return t.location="no",e&&"none"==e.prompt&&(t.hidden="yes"),function(e){return Object.keys(e).reduce((function(t,n){return t.push(n+"="+e[n]),t}),[]).join(",")}(t)},a=function(){return o.redirectUri||"http://localhost"};return{login:function(e){var t=g(),i=r(e),s=o.createLoginUrl(e),c=n(s,"_blank",i),d=!1,l=!1,u=function(){l=!0,c.close()};return c.addEventListener("loadstart",(function(e){0==e.url.indexOf(a())&&(f(F(e.url),t),u(),d=!0)})),c.addEventListener("loaderror",(function(e){d||(0==e.url.indexOf(a())?(f(F(e.url),t),u(),d=!0):(t.setError(),u()))})),c.addEventListener("exit",(function(e){l||t.setError({reason:"closed_by_user"})})),t.promise},logout:function(e){var t,r=g(),i=o.createLogoutUrl(e),s=n(i,"_blank","location=no,hidden=yes,clearcache=yes");return s.addEventListener("loadstart",(function(e){0==e.url.indexOf(a())&&s.close()})),s.addEventListener("loaderror",(function(e){0==e.url.indexOf(a())||(t=!0),s.close()})),s.addEventListener("exit",(function(e){t?r.setError():(o.clearToken(),r.setSuccess())})),r.promise},register:function(e){var t=g(),i=o.createRegisterUrl(),s=r(e),c=n(i,"_blank",s);return c.addEventListener("loadstart",(function(e){0==e.url.indexOf(a())&&(c.close(),f(F(e.url),t))})),t.promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0===e)throw"Not supported by the OIDC server";var t=n(e,"_blank","location=no");t.addEventListener("loadstart",(function(e){0==e.url.indexOf(a())&&t.close()}))},redirectUri:function(e){return a()}}}if("cordova-native"==e)return i.enable=!1,{login:function(e){var t=g(),n=o.createLoginUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),f(F(e.url),t)})),window.cordova.plugins.browsertab.openUrl(n),t.promise},logout:function(e){var t=g(),n=o.createLogoutUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),o.clearToken(),t.setSuccess()})),window.cordova.plugins.browsertab.openUrl(n),t.promise},register:function(e){var t=g(),n=o.createRegisterUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),f(F(e.url),t)})),window.cordova.plugins.browsertab.openUrl(n),t.promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0===e)throw"Not supported by the OIDC server";window.cordova.plugins.browsertab.openUrl(e)},redirectUri:function(e){return e&&e.redirectUri?e.redirectUri:o.redirectUri?o.redirectUri:"http://localhost"}};throw"invalid adapter type: "+e}o.init=function(r){if(o.didInitialize)throw new Error("A 'Keycloak' instance can only be initialized once.");if(o.didInitialize=!0,o.authenticated=!1,n=function(){try{return new L}catch(e){}return new D}(),t=r&&["default","cordova","cordova-native"].indexOf(r.adapter)>-1?M(r.adapter):r&&"object"==typeof r.adapter?r.adapter:window.Cordova||window.cordova?M("cordova"):M(),r){if(void 0!==r.useNonce&&(c=r.useNonce),void 0!==r.checkLoginIframe&&(i.enable=r.checkLoginIframe),r.checkLoginIframeInterval&&(i.interval=r.checkLoginIframeInterval),"login-required"===r.onLoad&&(o.loginRequired=!0),r.responseMode){if("query"!==r.responseMode&&"fragment"!==r.responseMode)throw"Invalid value for responseMode";o.responseMode=r.responseMode}if(r.flow){switch(r.flow){case"standard":o.responseType="code";break;case"implicit":o.responseType="id_token token";break;case"hybrid":o.responseType="code id_token token";break;default:throw"Invalid value for flow"}o.flow=r.flow}if(null!=r.timeSkew&&(o.timeSkew=r.timeSkew),r.redirectUri&&(o.redirectUri=r.redirectUri),r.silentCheckSsoRedirectUri&&(o.silentCheckSsoRedirectUri=r.silentCheckSsoRedirectUri),"boolean"==typeof r.silentCheckSsoFallback?o.silentCheckSsoFallback=r.silentCheckSsoFallback:o.silentCheckSsoFallback=!0,void 0!==r.pkceMethod){if("S256"!==r.pkceMethod&&!1!==r.pkceMethod)throw new TypeError(`Invalid value for pkceMethod', expected 'S256' or false but got ${r.pkceMethod}.`);o.pkceMethod=r.pkceMethod}else o.pkceMethod="S256";"boolean"==typeof r.enableLogging?o.enableLogging=r.enableLogging:o.enableLogging=!1,"POST"===r.logoutMethod?o.logoutMethod="POST":o.logoutMethod="GET","string"==typeof r.scope&&(o.scope=r.scope),"string"==typeof r.acrValues&&(o.acrValues=r.acrValues),"number"==typeof r.messageReceiveTimeout&&r.messageReceiveTimeout>0?o.messageReceiveTimeout=r.messageReceiveTimeout:o.messageReceiveTimeout=1e4}o.responseMode||(o.responseMode="fragment"),o.responseType||(o.responseType="code",o.flow="standard");var a=g(),s=g();s.promise.then((function(){o.onReady&&o.onReady(o.authenticated),a.setSuccess(o.authenticated)})).catch((function(e){a.setError(e)}));var d=function(t){var n,r=g();function i(e){o.endpoints=e?{authorize:function(){return e.authorization_endpoint},token:function(){return e.token_endpoint},logout:function(){if(!e.end_session_endpoint)throw"Not supported by the OIDC server";return e.end_session_endpoint},checkSessionIframe:function(){if(!e.check_session_iframe)throw"Not supported by the OIDC server";return e.check_session_iframe},register:function(){throw'Redirection to "Register user" page not supported in standard OIDC mode'},userinfo:function(){if(!e.userinfo_endpoint)throw"Not supported by the OIDC server";return e.userinfo_endpoint}}:{authorize:function(){return m()+"/protocol/openid-connect/auth"},token:function(){return m()+"/protocol/openid-connect/token"},logout:function(){return m()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var e=m()+"/protocol/openid-connect/login-status-iframe.html";return o.iframeVersion&&(e=e+"?version="+o.iframeVersion),e},thirdPartyCookiesIframe:function(){var e=m()+"/protocol/openid-connect/3p-cookies/step1.html";return o.iframeVersion&&(e=e+"?version="+o.iframeVersion),e},register:function(){return m()+"/protocol/openid-connect/registrations"},userinfo:function(){return m()+"/protocol/openid-connect/userinfo"}}}if(e?"string"==typeof e&&(n=e):n="keycloak.json",n)(c=new XMLHttpRequest).open("GET",n,!0),c.setRequestHeader("Accept","application/json"),c.onreadystatechange=function(){if(4==c.readyState)if(200==c.status||b(c)){var e=JSON.parse(c.responseText);o.authServerUrl=e["auth-server-url"],o.realm=e.realm,o.clientId=e.resource,i(null),r.setSuccess()}else r.setError()},c.send();else{if(!e.clientId)throw"clientId missing";o.clientId=e.clientId;var a=e.oidcProvider;if(a){var s,c;"string"==typeof a?(s="/"==a.charAt(a.length-1)?a+".well-known/openid-configuration":a+"/.well-known/openid-configuration",(c=new XMLHttpRequest).open("GET",s,!0),c.setRequestHeader("Accept","application/json"),c.onreadystatechange=function(){4==c.readyState&&(200==c.status||b(c)?(i(JSON.parse(c.responseText)),r.setSuccess()):r.setError())},c.send()):(i(a),r.setSuccess())}else{if(!e.url)for(var d=document.getElementsByTagName("script"),l=0;l<d.length;l++)if(d[l].src.match(/.*keycloak\.js/)){e.url=d[l].src.substr(0,d[l].src.indexOf("/js/keycloak.js"));break}if(!e.realm)throw"realm missing";o.authServerUrl=e.url,o.realm=e.realm,i(null),r.setSuccess()}}return r.promise}();function l(){var e=function(e){e||(n.prompt="none"),r&&r.locale&&(n.locale=r.locale),o.login(n).then((function(){s.setSuccess()})).catch((function(e){s.setError(e)}))},t=function(){var e=document.createElement("iframe"),t=o.createLoginUrl({prompt:"none",redirectUri:o.silentCheckSsoRedirectUri});e.setAttribute("src",t),e.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),e.setAttribute("title","keycloak-silent-check-sso"),e.style.display="none",document.body.appendChild(e);var n=function(t){t.origin===window.location.origin&&e.contentWindow===t.source&&(f(F(t.data),s),document.body.removeChild(e),window.removeEventListener("message",n))};window.addEventListener("message",n)},n={};switch(r.onLoad){case"check-sso":i.enable?y().then((function(){k().then((function(n){n?s.setSuccess():o.silentCheckSsoRedirectUri?t():e(!1)})).catch((function(e){s.setError(e)}))})):o.silentCheckSsoRedirectUri?t():e(!1);break;case"login-required":e(!0);break;default:throw"Invalid value for onLoad"}}function u(){var e=F(window.location.href);if(e&&window.history.replaceState(window.history.state,null,e.newUrl),e&&e.valid)return y().then((function(){f(e,s)})).catch((function(e){s.setError(e)}));r?r.token&&r.refreshToken?(h(r.token,r.refreshToken,r.idToken),i.enable?y().then((function(){k().then((function(e){e?(o.onAuthSuccess&&o.onAuthSuccess(),s.setSuccess(),v()):s.setSuccess()})).catch((function(e){s.setError(e)}))})):o.updateToken(-1).then((function(){o.onAuthSuccess&&o.onAuthSuccess(),s.setSuccess()})).catch((function(e){o.onAuthError&&o.onAuthError(),r.onLoad?l():s.setError(e)}))):r.onLoad?l():s.setSuccess():s.setSuccess()}return d.then((function(){(function(){var e=g(),t=function(){"interactive"!==document.readyState&&"complete"!==document.readyState||(document.removeEventListener("readystatechange",t),e.setSuccess())};return document.addEventListener("readystatechange",t),t(),e.promise})().then(w).then(u).catch((function(e){a.setError(e)}))})),d.catch((function(e){a.setError(e)})),a.promise},o.login=function(e){return t.login(e)},o.createLoginUrl=function(e){var r,i=p(),a=p(),s=t.redirectUri(e),d={state:i,nonce:a,redirectUri:encodeURIComponent(s),loginOptions:e};e&&e.prompt&&(d.prompt=e.prompt),r=e&&"register"==e.action?o.endpoints.register():o.endpoints.authorize();var l=e&&e.scope||o.scope;l?-1===l.indexOf("openid")&&(l="openid "+l):l="openid";var m,f=r+"?client_id="+encodeURIComponent(o.clientId)+"&redirect_uri="+encodeURIComponent(s)+"&state="+encodeURIComponent(i)+"&response_mode="+encodeURIComponent(o.responseMode)+"&response_type="+encodeURIComponent(o.responseType)+"&scope="+encodeURIComponent(l);if(c&&(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){var b=(m={id_token:{acr:e.acr}},JSON.stringify(m));f+="&claims="+encodeURIComponent(b)}if((e&&e.acrValues||o.acrValues)&&(f+="&acr_values="+encodeURIComponent(e.acrValues||o.acrValues)),o.pkceMethod){var h=u(96,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");d.pkceCodeVerifier=h,f+="&code_challenge="+function(e,t){if("S256"!==e)throw new TypeError(`Invalid value for 'pkceMethod', expected 'S256' but got '${e}'.`);return function(e){const t=String.fromCodePoint(...e);return btoa(t)}(new Uint8Array(gr.arrayBuffer(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}(o.pkceMethod,h),f+="&code_challenge_method="+o.pkceMethod}return n.add(d),f},o.logout=function(e){return t.logout(e)},o.createLogoutUrl=function(e){if("POST"===(e?.logoutMethod??o.logoutMethod))return o.endpoints.logout();var n=o.endpoints.logout()+"?client_id="+encodeURIComponent(o.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(t.redirectUri(e,!1));return o.idToken&&(n+="&id_token_hint="+encodeURIComponent(o.idToken)),n},o.register=function(e){return t.register(e)},o.createRegisterUrl=function(e){return e||(e={}),e.action="register",o.createLoginUrl(e)},o.createAccountUrl=function(e){var n=m(),r=void 0;return void 0!==n&&(r=n+"/account?referrer="+encodeURIComponent(o.clientId)+"&referrer_uri="+encodeURIComponent(t.redirectUri(e))),r},o.accountManagement=function(){return t.accountManagement()},o.hasRealmRole=function(e){var t=o.realmAccess;return!!t&&t.roles.indexOf(e)>=0},o.hasResourceRole=function(e,t){if(!o.resourceAccess)return!1;var n=o.resourceAccess[t||o.clientId];return!!n&&n.roles.indexOf(e)>=0},o.loadUserProfile=function(){var e=m()+"/account",t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+o.token);var n=g();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(o.profile=JSON.parse(t.responseText),n.setSuccess(o.profile)):n.setError())},t.send(),n.promise},o.loadUserInfo=function(){var e=o.endpoints.userinfo(),t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+o.token);var n=g();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(o.userInfo=JSON.parse(t.responseText),n.setSuccess(o.userInfo)):n.setError())},t.send(),n.promise},o.isTokenExpired=function(e){if(!o.tokenParsed||!o.refreshToken&&"implicit"!=o.flow)throw"Not authenticated";if(null==o.timeSkew)return d("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var t=o.tokenParsed.exp-Math.ceil((new Date).getTime()/1e3)+o.timeSkew;if(e){if(isNaN(e))throw"Invalid minValidity";t-=e}return t<0},o.updateToken=function(e){var t=g();if(!o.refreshToken)return t.setError(),t.promise;e=e||5;var n=function(){var n=!1;if(-1==e?(n=!0,d("[KEYCLOAK] Refreshing token: forced refresh")):o.tokenParsed&&!o.isTokenExpired(e)||(n=!0,d("[KEYCLOAK] Refreshing token: token expired")),n){var i="grant_type=refresh_token&refresh_token="+o.refreshToken,a=o.endpoints.token();if(r.push(t),1==r.length){var s=new XMLHttpRequest;s.open("POST",a,!0),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),s.withCredentials=!0,i+="&client_id="+encodeURIComponent(o.clientId);var c=(new Date).getTime();s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status){d("[KEYCLOAK] Token refreshed"),c=(c+(new Date).getTime())/2;var e=JSON.parse(s.responseText);h(e.access_token,e.refresh_token,e.id_token,c),o.onAuthRefreshSuccess&&o.onAuthRefreshSuccess();for(var t=r.pop();null!=t;t=r.pop())t.setSuccess(!0)}else for(l("[KEYCLOAK] Failed to refresh token"),400==s.status&&o.clearToken(),o.onAuthRefreshError&&o.onAuthRefreshError(),t=r.pop();null!=t;t=r.pop())t.setError(!0)},s.send(i)}}else t.setSuccess(!1)};return i.enable?k().then((function(){n()})).catch((function(e){t.setError(e)})):n(),t.promise},o.clearToken=function(){o.token&&(h(null,null,null),o.onAuthLogout&&o.onAuthLogout(),o.loginRequired&&o.login())};var L=function(){if(!(this instanceof L))return new L;function e(){for(var e=(new Date).getTime(),t=0;t<localStorage.length;t++){var n=localStorage.key(t);if(n&&0==n.indexOf("kc-callback-")){var o=localStorage.getItem(n);if(o)try{var r=JSON.parse(o).expires;(!r||r<e)&&localStorage.removeItem(n)}catch(e){localStorage.removeItem(n)}}}}localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test"),this.get=function(t){if(t){var n="kc-callback-"+t,o=localStorage.getItem(n);return o&&(localStorage.removeItem(n),o=JSON.parse(o)),e(),o}},this.add=function(t){e();var n="kc-callback-"+t.state;t.expires=(new Date).getTime()+36e5,localStorage.setItem(n,JSON.stringify(t))}},D=function(){if(!(this instanceof D))return new D;var e=this;e.get=function(e){if(e){var r=n("kc-callback-"+e);return o("kc-callback-"+e,"",t(-100)),r?JSON.parse(r):void 0}},e.add=function(e){o("kc-callback-"+e.state,JSON.stringify(e),t(60))},e.removeItem=function(e){o(e,"",t(-100))};var t=function(e){var t=new Date;return t.setTime(t.getTime()+60*e*1e3),t},n=function(e){for(var t=e+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){for(var r=n[o];" "==r.charAt(0);)r=r.substring(1);if(0==r.indexOf(t))return r.substring(t.length,r.length)}return""},o=function(e,t,n){var o=e+"="+t+"; expires="+n.toUTCString()+"; ";document.cookie=o}};function E(e){return function(){o.enableLogging&&e.apply(console,Array.prototype.slice.call(arguments))}}}var wr,Mr,Lr=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))};!function(e){e.MANAGER_FAILED_TO_LOAD="MANAGER_FAILED_TO_LOAD",e.AUTH_FAILED="AUTH_FAILED",e.AUTH_TYPE_UNSUPPORTED="AUTH_TYPE_UNSUPPORTED",e.CONSOLE_ERROR="CONSOLE_INIT_ERROR",e.EVENTS_CONNECTION_ERROR="EVENTS_CONNECTION_ERROR",e.TRANSLATION_ERROR="TRANSLATION_ERROR"}(wr||(wr={})),function(e){e.ERROR="ERROR",e.READY="READY",e.ONLINE="ONLINE",e.OFFLINE="OFFLINE",e.CONNECTING="CONNECTING",e.CONSOLE_INIT="CONSOLE_INIT",e.CONSOLE_READY="CONSOLE_READY",e.TRANSLATE_INIT="TRANSLATE_INIT",e.TRANSLATE_LANGUAGE_CHANGED="TRANSLATE_LANGUAGE_CHANGED",e.DISPLAY_REALM_CHANGED="DISPLAY_REALM_CHANGED"}(Mr||(Mr={}));class Dr{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(){const e=new Map;return this._keycloak?this._keycloak.resourceAccess&&this._config.clientId&&this._keycloak.resourceAccess&&Object.entries(this._keycloak.resourceAccess).forEach((([t,n])=>{const o=n.roles;e.set(t,o)})):this._basicIdentity&&this._basicIdentity.roles&&e.set(this._config.clientId,this._basicIdentity.roles.map((e=>e.name))),e}get managerVersion(){return this._managerVersion}get isManagerAvailable(){return this._managerVersion&&""!==this._managerVersion}get managerUrl(){return this._config.managerUrl}get keycloakUrl(){return this._config.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 Ro}get language(){return vt.language}set language(e){console.debug(`Changing language to ${e}.`),e&&(vt.changeLanguage(e),this.console.storeData("LANGUAGE",e),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(Mr.DISPLAY_REALM_CHANGED))}getEventProvider(){return this.events}get mapType(){return this._config.mapType||"VECTOR"}isManagerSameOrigin(){if(!this.ready)return!1;const e=new URL(this._config.managerUrl),t=window.location;return e.protocol===t.protocol&&e.hostname===t.hostname&&e.port===t.port}addListener(e){this._listeners.indexOf(e)<0&&this._listeners.push(e)}removeListener(e){const t=this._listeners.indexOf(e);t>=0&&this._listeners.splice(t,1)}init(e){return Lr(this,void 0,void 0,(function*(){this._config&&console.debug("Already initialised"),this._config=function(e){const t=e?Object.assign({},e):{};return t.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.keycloakUrl&&""!==t.keycloakUrl||(t.keycloakUrl=t.managerUrl+"/auth"),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="openremote"),t}(e);let t=yield this.loadManagerInfo();const n=new Hn(this._config.realm,this._config.consoleAutoEnable,(()=>{this._emitEvent(Mr.CONSOLE_READY)}));if(this._console=n,"BASIC"===this._config.auth)t=(yield this.doTranslateInit())&&t,t=yield this.doAuthInit();else if("KEYCLOAK"===this._config.auth){if(!this._config.keycloakUrl&&this._authServerUrl){const e=new URL(this._config.managerUrl);let t;this._authServerUrl.startsWith("//")&&(this._authServerUrl=e.protocol+this._authServerUrl);try{t=new URL(this._authServerUrl)}catch(n){t=new URL(e),t.pathname=this._authServerUrl}t.protocol||(t.protocol=e.protocol),t.hostname||(t.hostname=e.hostname),t.port||(t.port=e.port),this._config.keycloakUrl=t.toString()}this._config.keycloakUrl||(this._config.keycloakUrl=this._config.managerUrl+"/auth"),this._config.keycloakUrl=this._config.keycloakUrl.replace(/\/+$/,""),t=yield this.doAuthInit(),t||this._config.skipFallbackToBasicAuth||(console.debug("Falling back to basic auth"),this._config.auth="BASIC",t=yield this.doAuthInit())}return!!t&&(t&&(t=this.doRestApiInit()),(yield this.doConsoleInit())&&this._clearWebHistory(),t=(yield this.doTranslateInit())&&t,t&&(t=yield this.doDescriptorsInit(),t=yield this.getConsoleAppConfig()),this.doIconInit(),t?(this._readyCallback&&(yield this._readyCallback()),this._ready=!0,this._emitEvent(Mr.READY)):(this._config=void 0,console.warn("Failed to initialise the manager")),this.displayRealm=e.realm||"master",t)}))}loadManagerInfo(){return Lr(this,void 0,void 0,(function*(){try{const e=yield new Promise(((e,t)=>{const n=new XMLHttpRequest;n.addEventListener("load",(()=>{e(JSON.parse(n.responseText))})),n.addEventListener("error",(()=>{t(new Error("Failed to contact the manager"))})),n.open("GET",this._config.managerUrl+"/api/master/info"),n.send()}));return this._managerVersion=e&&e.version?e.version:"",this._authServerUrl=e&&e.authServerUrl?e.authServerUrl:"",!0}catch(e){return console.error("Failed to contact the manager",e),this._setError(wr.MANAGER_FAILED_TO_LOAD),!1}}))}doTranslateInit(){return Lr(this,void 0,void 0,(function*(){if(vt.isInitialized)return!0;vt.on("initialized",(e=>{this._emitEvent(Mr.TRANSLATE_INIT)})),vt.on("languageChanged",(e=>{Rn().locale(e),this._emitEvent(Mr.TRANSLATE_LANGUAGE_CHANGED)}));const 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,n)=>"uppercase"===t?e.toUpperCase():e instanceof Date?Rn()(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 vt.use(ar).init(e)}catch(e){return console.error(e),this._setError(wr.TRANSLATION_ERROR),!1}return!0}))}doDescriptorsInit(){return Lr(this,void 0,void 0,(function*(){if(!this.config.loadDescriptors)return!0;try{const e=yield Ro.api.AssetModelResource.getAssetInfos(),t=yield Ro.api.AssetModelResource.getMetaItemDescriptors(),n=yield Ro.api.AssetModelResource.getValueDescriptors();On._assetTypeInfos=e.data,On._metaItemDescriptors=Object.values(t.data),On._valueDescriptors=Object.values(n.data)}catch(e){return console.error(e),!1}return!0}))}doAuthInit(){return Lr(this,void 0,void 0,(function*(){let e=!0;switch(this._config.auth){case"BASIC":e=yield this.initialiseBasicAuth();break;case"KEYCLOAK":e=yield this.loadAndInitialiseKeycloak();break;case"NONE":return!0;default:return this._setError(wr.AUTH_TYPE_UNSUPPORTED),!1}return!!e&&(Ro.addRequestInterceptor((e=>{if(!e.headers.Authorization){const t=this.getAuthorizationHeader();t&&(e.headers.Authorization=t)}return e})),e)}))}doRestApiInit(){return Ro.setTimeout(2e4),Ro.initialise(this.getApiBaseUrl()),!0}doEventsSubscriptionInit(){return Lr(this,void 0,void 0,(function*(){let e=!1;return"WEBSOCKET"===this._config.eventProviderType&&(this._events=new Ho(this._config.managerUrl),this._events.subscribeStatusChange((e=>this._onEventProviderStatusChanged(e))),e=yield this._events.connect()),e||this._setError(wr.EVENTS_CONNECTION_ERROR),e}))}_connectEvents(){var e;(null===(e=this.events)||void 0===e?void 0:e.status)===Po.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 Po.DISCONNECTED:this._onDisconnect();break;case Po.CONNECTED:break;case Po.CONNECTING:this._emitEvent(Mr.CONNECTING)}}doConsoleInit(){return Lr(this,void 0,void 0,(function*(){try{return yield this.console.initialise(),this._emitEvent(Mr.CONSOLE_INIT),!0}catch(e){return this._setError(wr.CONSOLE_ERROR),!1}}))}doIconInit(){var e;this._config.loadIcons&&(Fr.addIconSet("mdi",(e=Er.config.managerUrl,{getIconTemplate:e=>H`<span style="font-family: 'Material Design Icons';" class="mdi-${e}"></span>`,onAdd(){const 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)}})),Fr.addIconSet("or",function(e,t){return{getIconTemplate:n=>{const o=t[n];return o?H`
|
|
224
224
|
<svg xmlns="http://www.w3.org/2000/svg"
|
|
225
225
|
viewBox="0 0 ${e} ${e}" preserveAspectRatio="xMidYMid meet" focusable="false">
|
|
226
226
|
${ur(o.startsWith("<")?o:'<path xmlns="http://www.w3.org/2000/svg" d="'+o+'" />')}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openremote/or-survey-results",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "Displays survey results",
|
|
5
5
|
"main": "dist/umd/index.bundle.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
"author": "OpenRemote",
|
|
17
17
|
"license": "AGPL-3.0-or-later",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@openremote/core": "1.3.
|
|
20
|
-
"@openremote/model": "1.3.
|
|
19
|
+
"@openremote/core": "1.3.2",
|
|
20
|
+
"@openremote/model": "1.3.2",
|
|
21
21
|
"lit": "^2.0.2"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@openremote/util": "1.3.
|
|
24
|
+
"@openremote/util": "1.3.2"
|
|
25
25
|
},
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public"
|