UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

1 lines 7.71 kB
export const __rspack_esm_id=3668;export const __rspack_esm_ids=[3668];export const __webpack_modules__={9375(e,t,r){r.r(t);r(44114),r(18111),r(22489),r(61701),r(33110),r(17642),r(58004),r(33853),r(45876),r(32475),r(15024),r(31698),r(88454),r(29452);var n,a=r(32838);function o(e){if("symbol"==typeof e)throw TypeError("Cannot convert a Symbol value to a string");return String(e)}function i(e){return Intl.getCanonicalLocales(e)}function l(e){if(null==e)throw new TypeError("undefined/null cannot be converted to object");return Object(e)}function s(e,t,r,n,a){if("object"!=typeof e)throw new TypeError("Options must be an object");let i=e[t];if(void 0!==i){if("boolean"!==r&&"string"!==r)throw new TypeError("invalid type");if("boolean"===r&&(i=Boolean(i)),"string"===r&&(i=o(i)),void 0!==n&&!n.filter(e=>e==i).length)throw new RangeError(`${i} is not within ${n.join(", ")}`);return i}return a}function c(e,t){const r=t&&t.cache?t.cache:m,n=t&&t.serializer?t.serializer:y;return(t&&t.strategy?t.strategy:d)(e,{cache:r,serializer:n})}function u(e,t,r,n){const a=null==(o=n)||"number"==typeof o||"boolean"==typeof o?n:r(n);var o;let i=t.get(a);return void 0===i&&(i=e.call(this,n),t.set(a,i)),i}function f(e,t,r){const n=Array.prototype.slice.call(arguments,3),a=r(n);let o=t.get(a);return void 0===o&&(o=e.apply(this,n),t.set(a,o)),o}function b(e,t,r,n,a){return r.bind(t,e,n,a)}function d(e,t){return b(e,this,1===e.length?u:f,t.cache.create(),t.serializer)}const y=function(){return JSON.stringify(arguments)};var p=class{get(e){return this.cache[e]}set(e,t){this.cache[e]=t}constructor(){this.cache=Object.create(null)}};const m={create:function(){return new p}},h={variadic:function(e,t){return b(e,this,f,t.cache.create(),t.serializer)},monadic:function(e,t){return b(e,this,u,t.cache.create(),t.serializer)}};function v(e,t,r=Error){if(!e)throw new r(t)}const g=c((...e)=>new Intl.NumberFormat(...e),{strategy:h.variadic}),w=c((...e)=>new Intl.PluralRules(...e),{strategy:h.variadic});c((...e)=>new Intl.Locale(...e),{strategy:h.variadic}),c((...e)=>new Intl.ListFormat(...e),{strategy:h.variadic});const T=/^[a-z0-9]{3,8}(-[a-z0-9]{3,8})*$/i;function _(e,t,r,{getInternalSlots:n,availableLocales:o,relevantExtensionKeys:c,localeData:u,getDefaultLocale:f}){const b=n(e);b.initializedRelativeTimeFormat=!0;const d=i(t),y=Object.create(null),p=function(e){return void 0===e?Object.create(null):l(e)}(r);y.localeMatcher=s(p,"localeMatcher","string",["best fit","lookup"],"best fit");const m=s(p,"numberingSystem","string",void 0,void 0);if(void 0!==m&&!T.test(m))throw new RangeError(`Invalid numbering system ${m}`);y.nu=m;const h=(0,a.Bg)(o,d,y,c,u,f),{locale:_,nu:E}=h;b.locale=_,b.style=s(p,"style","string",["long","narrow","short"],"long"),b.numeric=s(p,"numeric","string",["always","auto"],"always");const L=u[h.dataLocale];return v(!!L,`Missing locale data for ${h.dataLocale}`),b.fields=L,b.numberFormat=g(t),b.pluralRules=w(t),b.numberingSystem=E,e}function E(e){return null===e?"Null":void 0===e?"Undefined":"function"==typeof e||"object"==typeof e?"Object":"number"==typeof e?"Number":"boolean"==typeof e?"Boolean":"string"==typeof e?"String":"symbol"==typeof e?"Symbol":"bigint"==typeof e?"BigInt":void 0}function L(e,t,r){const n=function(e){const t=[];let r=e.indexOf("{"),n=0,a=0;const o=e.length;for(;r<e.length&&r>-1;)n=e.indexOf("}",r),v(n>r,`Invalid pattern ${e}`),r>a&&t.push({type:"literal",value:e.substring(a,r)}),t.push({type:e.substring(r+1,n),value:void 0}),a=n+1,r=e.indexOf("{",a);return a<o&&t.push({type:"literal",value:e.substring(a,o)}),t}(e),a=[];for(const o of n)if("literal"===o.type)a.push({type:"literal",value:o.value});else{v("0"===o.type,`Malformed pattern ${e}`);for(const e of r)a.push({type:e.type,value:e.value,unit:t})}return a}function O(e,t,r,{getInternalSlots:n}){if(v("Number"===E(t),"value must be number, instead got "+typeof t,TypeError),v("String"===E(r),"unit must be number, instead got "+typeof t,TypeError),isNaN(t)||!isFinite(t))throw new RangeError(`Invalid value ${t}`);const a=function(e){if(v("String"===E(e),"unit must be a string"),"seconds"===e)return"second";if("minutes"===e)return"minute";if("hours"===e)return"hour";if("days"===e)return"day";if("weeks"===e)return"week";if("months"===e)return"month";if("quarters"===e)return"quarter";if("years"===e)return"year";if("second"!==e&&"minute"!==e&&"hour"!==e&&"day"!==e&&"week"!==e&&"month"!==e&&"quarter"!==e&&"year"!==e)throw new RangeError("invalid unit");return e}(r),{fields:i,style:l,numeric:s,pluralRules:c,numberFormat:u}=n(e);let f=a;"short"===l?f=`${a}-short`:"narrow"===l&&(f=`${a}-narrow`),f in i||(f=a);const b=i[f];if("auto"===s&&o(t)in b)return[{type:"literal",value:b[o(t)]}];let d="future";var y,p;y=t,p=-0,((Object.is?Object.is(y,p):y===p?0!==y||1/y==1/p:y!=y&&p!=p)||t<0)&&(d="past");const m=b[d],h="function"==typeof u.formatToParts?u.formatToParts(Math.abs(t)):[{type:"literal",value:u.format(Math.abs(t)),unit:r}];return L(m[c.select(t)],a,h)}const j=new WeakMap;function I(e){let t=j.get(e);return t||(t=Object.create(null),j.set(e,t)),t}var S=(n=class e{format(e,t){if("object"!=typeof this)throw new TypeError("format was called on a non-object");if(!I(this).initializedRelativeTimeFormat)throw new TypeError("format was called on a invalid context");return O(this,Number(e),o(t),{getInternalSlots:I}).map(e=>e.value).join("")}formatToParts(e,t){if("object"!=typeof this)throw new TypeError("formatToParts was called on a non-object");if(!I(this).initializedRelativeTimeFormat)throw new TypeError("formatToParts was called on a invalid context");return O(this,Number(e),o(t),{getInternalSlots:I})}resolvedOptions(){if("object"!=typeof this)throw new TypeError("resolvedOptions was called on a non-object");const e=I(this);if(!e.initializedRelativeTimeFormat)throw new TypeError("resolvedOptions was called on a invalid context");return{locale:e.locale,style:e.style,numeric:e.numeric,numberingSystem:e.numberingSystem}}static supportedLocalesOf(t,r){return function(e,t,r){let n="best fit";return void 0!==r&&(n=s(r=l(r),"localeMatcher","string",["lookup","best fit"],"best fit")),(0,a.s8)(Array.from(e),t)}(e.availableLocales,i(t),r)}static __addLocaleData(...t){for(const{data:r,locale:n}of t){const t=new Intl.Locale(n).minimize().toString();e.localeData[n]=e.localeData[t]=r,e.availableLocales.add(t),e.availableLocales.add(n),e.__defaultLocale||(e.__defaultLocale=t)}}static getDefaultLocale(){return e.__defaultLocale}constructor(t,r){if(!(this&&this instanceof e?this.constructor:void 0))throw new TypeError("Intl.RelativeTimeFormat must be called with 'new'");return _(this,t,r,{getInternalSlots:I,availableLocales:e.availableLocales,relevantExtensionKeys:e.relevantExtensionKeys,localeData:e.localeData,getDefaultLocale:e.getDefaultLocale})}},n.localeData={},n.availableLocales=new Set,n.__defaultLocale="",n.relevantExtensionKeys=["nu"],n.polyfilled=!0,n);try{"undefined"!=typeof Symbol&&Object.defineProperty(S.prototype,Symbol.toStringTag,{value:"Intl.RelativeTimeFormat",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype.constructor,"length",{value:0,writable:!1,enumerable:!1,configurable:!0}),Object.defineProperty(S.supportedLocalesOf,"length",{value:1,writable:!1,enumerable:!1,configurable:!0})}catch{}!function(e,t,{value:r}){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:!0,value:r})}(("undefined"==typeof Intl&&Object.defineProperty(globalThis,"Intl",{configurable:!0,enumerable:!1,writable:!0,value:{}}),Intl),"RelativeTimeFormat",{value:S});const R=globalThis.__FORMATJS_RELATIVETIMEFORMAT_DATA__;if(R){for(const e of R)S.__addLocaleData(e);delete globalThis.__FORMATJS_RELATIVETIMEFORMAT_DATA__}}};