iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 5.81 kB
JavaScript
export const __rspack_esm_id=67218;export const __rspack_esm_ids=[67218];export const __webpack_modules__={38744(){Symbol.for("constructDateFrom")},88775(t,e,n){n.a(t,async function(t,o){try{n.d(e,{B:()=>s});var i=n(5806),r=n(49232),a=t([r,i]);[r,i]=a.then?(await a)():a;class s extends r.q{static tz(t,...e){return e.length?new s(...e,t):new s(Date.now(),t)}toISOString(){const[t,e,n]=this.tzComponents(),o=`${t}${e}:${n}`;return this.internal.toISOString().slice(0,-1)+o}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,e,n,o]=this.internal.toUTCString().split(" ");return`${t?.slice(0,-1)} ${n} ${e} ${o}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[e,n,o]=this.tzComponents();return`${t} GMT${e}${n}${o} (${(0,i.K)(this.timeZone,this)})`}toLocaleString(t,e){return Date.prototype.toLocaleString.call(this,t,{...e,timeZone:e?.timeZone||this.timeZone})}toLocaleDateString(t,e){return Date.prototype.toLocaleDateString.call(this,t,{...e,timeZone:e?.timeZone||this.timeZone})}toLocaleTimeString(t,e){return Date.prototype.toLocaleTimeString.call(this,t,{...e,timeZone:e?.timeZone||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset();return[t>0?"-":"+",String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),String(Math.abs(t)%60).padStart(2,"0")]}withTimeZone(t){return new s(+this,t)}[Symbol.for("constructDateFrom")](t){return new s(+new Date(t),this.timeZone)}}o()}catch(t){o(t)}})},49232(t,e,n){n.a(t,async function(t,o){try{n.d(e,{q:()=>a});n(18111),n(7588);var i=n(53834),r=t([i]);i=(r.then?(await r)():r)[0];class a extends Date{static tz(t,...e){return e.length?new a(...e,t):new a(Date.now(),t)}withTimeZone(t){return new a(+this,t)}getTimezoneOffset(){const t=-(0,i.Y)(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),c(this),+this}[Symbol.for("constructDateFrom")](t){return new a(+new Date(t),this.timeZone)}constructor(...t){super(),t.length>1&&"string"==typeof t[t.length-1]&&(this.timeZone=t.pop()),this.internal=new Date,isNaN((0,i.Y)(this.timeZone,this))?this.setTime(NaN):t.length?"number"==typeof t[0]&&(1===t.length||2===t.length&&"number"!=typeof t[1])?this.setTime(t[0]):"string"==typeof t[0]?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),h(this,t)):this.setTime(Date.now())}}const s=/^(get|set)(?!UTC)/;function c(t){t.internal.setTime(+t),t.internal.setUTCSeconds(t.internal.getUTCSeconds()-Math.round(60*-(0,i.Y)(t.timeZone,t)))}function l(t){Date.prototype.setFullYear.call(t,t.internal.getUTCFullYear(),t.internal.getUTCMonth(),t.internal.getUTCDate()),Date.prototype.setHours.call(t,t.internal.getUTCHours(),t.internal.getUTCMinutes(),t.internal.getUTCSeconds(),t.internal.getUTCMilliseconds()),h(t)}function h(t,e){const n=Array.isArray(e)?(o=e,Date.UTC(o[0],o.length>1?o[1]:0,o.length>2?o[2]:1,...o.slice(3))):+t.internal;var o;const r=(0,i.Y)(t.timeZone,t),a=r>0?Math.floor(r):Math.ceil(r),s=new Date(+t);s.setUTCHours(s.getUTCHours()-1);const l=-new Date(+t).getTimezoneOffset(),h=-new Date(+s).getTimezoneOffset();let m=l;if(l-h&&l!==a){if(Date.prototype.getHours.apply(t)!==(Array.isArray(e)?e[3]||0:t.internal.getUTCHours())){const e=new Date(+t),n=l-a;n&&e.setUTCMinutes(e.getUTCMinutes()+n);const o=(0,i.Y)(t.timeZone,e);(o>0?Math.floor(o):Math.ceil(o))===a&&(m=h)}}const u=m-a;u&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+u);const g=new Date(+t);g.setUTCSeconds(0);const T=l>0?g.getSeconds():(g.getSeconds()-60)%60,y=Math.round(-60*(0,i.Y)(t.timeZone,t))%60;(y||T)&&Date.prototype.setUTCSeconds.call(t,Date.prototype.getUTCSeconds.call(t)+y+T);const f=(0,i.Y)(t.timeZone,t),D=f>0?Math.floor(f):Math.ceil(f),S=D!==a,w=-new Date(+t).getTimezoneOffset()-D-u,C=D-a,U=n-60*D*1e3,M=C>0&&p(t)-n===60*C*1e3&&p(t,U)!==n;if(S&&w&&!M){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+w);const e=(0,i.Y)(t.timeZone,t),n=D-(e>0?Math.floor(e):Math.ceil(e));n&&w<0&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+n)}c(t);const d=(e?n:n+1e3*y)-+t.internal;d&&Math.abs(d)<18e5&&(Date.prototype.setTime.call(t,+t+d),c(t))}function p(t,e){const n=new Date(e??+t);return n.setUTCSeconds(n.getUTCSeconds()-Math.round(60*-(0,i.Y)(t.timeZone,n))),+n}Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!s.test(t))return;const e=t.replace(s,"$1UTC");a.prototype[e]&&(t.startsWith("get")?a.prototype[t]=function(){return this.internal[e]()}:(a.prototype[t]=function(){return Date.prototype[e].apply(this.internal,arguments),l(this),+this},a.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),c(this),+this}))}),o()}catch(m){o(m)}})},78713(t,e,n){n.a(t,async function(t,e){try{var o=n(88775),i=t([o]);o=(i.then?(await i)():i)[0];e()}catch(t){e(t)}})},5806(t,e,n){n.a(t,async function(t,o){try{n.d(e,{K:()=>a});var i=n(74487),r=t([i]);function a(t,e,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:t,timeZoneName:n}).format(e).split(/\s/g).slice(2).join(" ")}i=(r.then?(await r)():r)[0],o()}catch(s){o(s)}})},53834(t,e,n){n.a(t,async function(t,o){try{n.d(e,{Y:()=>c});var i=n(74487),r=t([i]);i=(r.then?(await r)():r)[0];const a={},s={};function c(t,e){try{const n=(a[t]||=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"longOffset"}).format)(e).split("GMT")[1];return n in s?s[n]:h(n,n.split(":"))}catch{if(t in s)return s[t];const e=t?.match(l);return e?h(t,e.slice(1)):NaN}}const l=/([+-]\d\d):?(\d\d)?/;function h(t,e){const n=+(e[0]||0),o=+(e[1]||0),i=+(e[2]||0)/60;return s[t]=60*n+o>0?60*n+o+i:60*n-o-i}o()}catch(p){o(p)}})},35204(t,e,n){n.a(t,async function(t,e){try{n(44114);var o=n(53834),i=t([o]);o=(i.then?(await i)():i)[0],e()}catch(t){e(t)}})}};