iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 32 kB
JavaScript
/*! For license information please see 54547.499d1bac00d52a46.js.LICENSE.txt */
export const __rspack_esm_id=54547;export const __rspack_esm_ids=[54547];export const __webpack_modules__={29079(a,e,i){a.exports=i(81267)},16629(a,e,i){i.d(e,{E7:()=>M,Mn:()=>n,P9:()=>m,lf:()=>u});i(18111),i(61701);var t=i(63004);const n=a=>{const e=a/100;return[Math.round(o(e)),Math.round(r(e)),Math.round(c(e))]},o=a=>{if(a<=66)return 255;const e=329.698727446*(a-60)**-.1332047592;return(0,t.q)(e,0,255)},r=a=>{let e;return e=a<=66?99.4708025861*Math.log(a)-161.1195681661:288.1221695283*(a-60)**-.0755148492,(0,t.q)(e,0,255)},c=a=>{if(a>=66)return 255;if(a<=19)return 0;const e=138.5177312231*Math.log(a-10)-305.0447927307;return(0,t.q)(e,0,255)},s=(a,e)=>{const i=Math.max(...a),t=Math.max(...e);let n;return n=0===t?0:i/t,e.map(a=>Math.round(a*n))},m=a=>0===a?1e6:Math.floor(1e6/a),l=a=>0===a?1e6:Math.floor(1e6/a),u=(a,e,i)=>{const[t,o,r,c,u]=a,M=l(e??2700),T=l(i??6500),d=M-T;let h;try{h=u/(c+u)}catch(a){h=.5}const G=T+h*d,A=G?m(G):0,[g,f,p]=n(A),y=Math.max(c,u)/255;return s([t,o,r,c,u],[t+g*y,o+f*y,r+p*y])},M=a=>{const[e,i,t,n]=a;return s([e,i,t,n],[e+n,i+n,t+n])}},80785(a,e,i){function t(a){return!!a&&(a instanceof Date&&!isNaN(a.valueOf()))}i.d(e,{A:()=>t})},72487(a,e,i){i.a(a,async function(a,t){try{i.d(e,{CA:()=>v,Mi:()=>b,Pm:()=>C,Wq:()=>f,Yq:()=>m,bl:()=>S,c2:()=>y,fr:()=>A,gu:()=>E,kz:()=>u,m9:()=>I,sl:()=>h,ur:()=>z,zB:()=>T});i(18111),i(20116);var n=i(74487),o=i(22786),r=i(46927),c=i(8480),s=a([n,c]);[n,c]=s.then?(await s)():s;(0,o.A)((a,e)=>new Intl.DateTimeFormat(a.language,{weekday:"long",month:"long",day:"numeric",timeZone:(0,c.wj)(a.time_zone,e)}));const m=(a,e,i)=>l(e,i.time_zone).format(a),l=(0,o.A)((a,e)=>new Intl.DateTimeFormat(a.language,{year:"numeric",month:"long",day:"numeric",timeZone:(0,c.wj)(a.time_zone,e)})),u=(a,e,i)=>M(e,i.time_zone).format(a),M=(0,o.A)((a,e)=>new Intl.DateTimeFormat(a.language,{year:"numeric",month:"short",day:"numeric",timeZone:(0,c.wj)(a.time_zone,e)})),T=(a,e,i)=>{const t=d(e,i.time_zone);if(e.date_format===r.ow.language||e.date_format===r.ow.system)return t.format(a);const n=t.formatToParts(a),o=n.find(a=>"literal"===a.type)?.value,c=n.find(a=>"day"===a.type)?.value,s=n.find(a=>"month"===a.type)?.value,m=n.find(a=>"year"===a.type)?.value,l=n[n.length-1];let u="literal"===l?.type?l?.value:"";"bg"===e.language&&e.date_format===r.ow.YMD&&(u="");return{[r.ow.DMY]:`${c}${o}${s}${o}${m}${u}`,[r.ow.MDY]:`${s}${o}${c}${o}${m}${u}`,[r.ow.YMD]:`${m}${o}${s}${o}${c}${u}`}[e.date_format]},d=(0,o.A)((a,e)=>{const i=a.date_format===r.ow.system?void 0:a.language;return a.date_format===r.ow.language||(a.date_format,r.ow.system),new Intl.DateTimeFormat(i,{year:"numeric",month:"numeric",day:"numeric",timeZone:(0,c.wj)(a.time_zone,e)})}),h=(a,e,i)=>G(e,i.time_zone).format(a),G=(0,o.A)((a,e)=>new Intl.DateTimeFormat(a.language,{day:"numeric",month:"short",timeZone:(0,c.wj)(a.time_zone,e)})),A=(a,e,i)=>g(e,i.time_zone).format(a),g=(0,o.A)((a,e)=>new Intl.DateTimeFormat(a.language,{month:"long",year:"numeric",timeZone:(0,c.wj)(a.time_zone,e)})),f=(a,e,i)=>p(e,i.time_zone).format(a),p=(0,o.A)((a,e)=>new Intl.DateTimeFormat(a.language,{month:"long",timeZone:(0,c.wj)(a.time_zone,e)})),y=(a,e,i)=>_(e,i.time_zone).format(a),_=(0,o.A)((a,e)=>new Intl.DateTimeFormat(a.language,{month:"short",timeZone:(0,c.wj)(a.time_zone,e)})),C=(a,e,i)=>L(e,i.time_zone).format(a),L=(0,o.A)((a,e)=>new Intl.DateTimeFormat(a.language,{year:"numeric",timeZone:(0,c.wj)(a.time_zone,e)})),v=(a,e,i)=>w(e,i.time_zone).format(a),w=(0,o.A)((a,e)=>new Intl.DateTimeFormat(a.language,{weekday:"long",timeZone:(0,c.wj)(a.time_zone,e)})),E=(a,e,i)=>k(e,i.time_zone).format(a),k=(0,o.A)((a,e)=>new Intl.DateTimeFormat(a.language,{weekday:"short",timeZone:(0,c.wj)(a.time_zone,e)})),b=(a,e,i)=>P(e,i.time_zone).format(a),P=(0,o.A)((a,e)=>new Intl.DateTimeFormat(a.language,{weekday:"short",month:"short",day:"numeric",timeZone:(0,c.wj)(a.time_zone,e)})),z=(a,e,i)=>D(e,i.time_zone).format(a),D=(0,o.A)((a,e)=>new Intl.DateTimeFormat(a.language,{weekday:"short",month:"short",day:"numeric",year:"numeric",timeZone:(0,c.wj)(a.time_zone,e)})),S=(a,e,i)=>{const t=(0,c.wj)(e.time_zone,i.time_zone);return new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit",timeZone:t}).format(a)},I=(a,e,i,t)=>`${S(a,i,t)}/${S(e,i,t)}`;t()}catch(a){t(a)}})},95747(a,e,i){i.a(a,async function(a,t){try{i.d(e,{CL:()=>f,GH:()=>_,Rl:()=>T,ZS:()=>A,aQ:()=>h,r6:()=>u,yg:()=>p});var n=i(74487),o=i(22786),r=i(72487),c=i(30162),s=i(8480),m=i(69543),l=a([n,s,r,c]);[n,s,r,c]=l.then?(await l)():l;const u=(a,e,i)=>M(e,i.time_zone).format(a),M=(0,o.A)((a,e)=>new Intl.DateTimeFormat(a.language,{year:"numeric",month:"long",day:"numeric",hour:(0,m.J)(a)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,m.J)(a)?"h12":"h23",timeZone:(0,s.wj)(a.time_zone,e)})),T=a=>d().format(a),d=(0,o.A)(()=>new Intl.DateTimeFormat(void 0,{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})),h=(a,e,i)=>G(e,i.time_zone).format(a),G=(0,o.A)((a,e)=>new Intl.DateTimeFormat(a.language,{year:"numeric",month:"short",day:"numeric",hour:(0,m.J)(a)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,m.J)(a)?"h12":"h23",timeZone:(0,s.wj)(a.time_zone,e)})),A=(a,e,i)=>g(e,i.time_zone).format(a),g=(0,o.A)((a,e)=>new Intl.DateTimeFormat(a.language,{month:"short",day:"numeric",hour:(0,m.J)(a)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,m.J)(a)?"h12":"h23",timeZone:(0,s.wj)(a.time_zone,e)})),f=(a,e,i)=>(new Date).getFullYear()===a.getFullYear()?A(a,e,i):h(a,e,i),p=(a,e,i)=>y(e,i.time_zone).format(a),y=(0,o.A)((a,e)=>new Intl.DateTimeFormat(a.language,{year:"numeric",month:"long",day:"numeric",hour:(0,m.J)(a)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,m.J)(a)?"h12":"h23",timeZone:(0,s.wj)(a.time_zone,e)})),_=(a,e,i)=>`${(0,r.zB)(a,e,i)}, ${(0,c.fU)(a,e,i)}`;t()}catch(a){t(a)}})},30162(a,e,i){i.a(a,async function(a,t){try{i.d(e,{LW:()=>h,Xs:()=>T,fU:()=>m,ie:()=>u});var n=i(74487),o=i(22786),r=i(8480),c=i(69543),s=a([n,r]);[n,r]=s.then?(await s)():s;const m=(a,e,i)=>l(e,i.time_zone).format(a),l=(0,o.A)((a,e)=>new Intl.DateTimeFormat(a.language,{hour:"numeric",minute:"2-digit",hourCycle:(0,c.J)(a)?"h12":"h23",timeZone:(0,r.wj)(a.time_zone,e)})),u=(a,e,i)=>M(e,i.time_zone).format(a),M=(0,o.A)((a,e)=>new Intl.DateTimeFormat(a.language,{hour:(0,c.J)(a)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,c.J)(a)?"h12":"h23",timeZone:(0,r.wj)(a.time_zone,e)})),T=(a,e,i)=>d(e,i.time_zone).format(a),d=(0,o.A)((a,e)=>new Intl.DateTimeFormat(a.language,{weekday:"long",hour:(0,c.J)(a)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,c.J)(a)?"h12":"h23",timeZone:(0,r.wj)(a.time_zone,e)})),h=(a,e,i)=>G(e,i.time_zone).format(a),G=(0,o.A)((a,e)=>new Intl.DateTimeFormat("en-GB",{hour:"numeric",minute:"2-digit",hour12:!1,timeZone:(0,r.wj)(a.time_zone,e)}));t()}catch(a){t(a)}})},8480(a,e,i){i.a(a,async function(a,t){try{i.d(e,{fL:()=>l,n2:()=>u,wj:()=>M});var n=i(74487),o=i(29079),r=i(46927),c=a([n]);n=(c.then?(await c)():c)[0];const s=Intl.DateTimeFormat?.().resolvedOptions?.().timeZone,m=s&&("UTC"===s||"Etc/UTC"===s||s in o)?s:void 0,l=14881==i.j?void 0!==m:null,u=m??"UTC",M=(a,e)=>a===r.Wj.local&&m?u:e;t()}catch(a){t(a)}})},69543(a,e,i){i.d(e,{J:()=>o});i(74423);var t=i(22786),n=i(46927);const o=(0,t.A)(a=>{if(a.time_format===n.Hg.language||a.time_format===n.Hg.system){const e=a.time_format===n.Hg.language?a.language:void 0;return new Date("January 1, 2023 22:00:00").toLocaleString(e).includes("10")}return a.time_format===n.Hg.am_pm})},69093(a,e,i){i.d(e,{t:()=>n});var t=i(71727);const n=a=>(0,t.m)(a.entity_id)},4423(a,e,i){i.d(e,{B:()=>s,r:()=>c});i(44114),i(18111),i(13579),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var t=i(44537),n=i(71727),o=i(28455);const r=a=>{if(void 0!==a)return null===a?new Set([null]):new Set((0,t.e)(a))},c=(a,e)=>{const i=e.domain?new Set((0,t.e)(e.domain)):void 0,c=e.hidden_domains?new Set((0,t.e)(e.hidden_domains)):void 0,s=e.device_class?new Set((0,t.e)(e.device_class)):void 0,m=r(e.floor),l=r(e.area),u=r(e.device),M=e.entity_category?new Set((0,t.e)(e.entity_category)):void 0,T=e.label?new Set((0,t.e)(e.label)):void 0,d=e.hidden_platform?new Set((0,t.e)(e.hidden_platform)):void 0;return e=>{const t=a.states[e];if(!t)return!1;if(i||c){const a=(0,n.m)(e);if(i&&!i.has(a))return!1;if(c&&c.has(a))return!1}if(s){const a=t.attributes.device_class||"none";if(!s.has(a))return!1}const{area:r,floor:h,device:G,entity:A}=(0,o.ln)(t,a.entities,a.devices,a.areas,a.floors);if(A&&A.hidden)return!1;if(m){const a=h?.floor_id??null;if(!m.has(a))return!1}if(l){const a=r?.area_id??null;if(!l.has(a))return!1}if(u){const a=G?.id??null;if(!u.has(a))return!1}if(T){if(!A)return!1;if(!A.labels.some(a=>T.has(a)))return!1}if(M){const a=A?.entity_category||"none";if(!M.has(a))return!1}if(d){if(!A)return!1;if(A.platform&&d.has(A.platform))return!1}return!0}},s=(a,e)=>{const i=new Set,t=[];for(const n of e)for(const e of a)n(e)&&!i.has(e)&&(i.add(e),t.push(e));return t}},82286(a,e,i){i.d(e,{$:()=>t});const t=(a,e)=>n(a.attributes,e),n=(a,e)=>0!==(a.supported_features&e)},52943(a,e,i){i.d(e,{Z:()=>t});const t=a=>a.charAt(0).toUpperCase()+a.slice(1)},22682(a,e,i){i.d(e,{$:()=>r});const t="^\\d{4}-(0[1-9]|1[0-2])-([12]\\d|0[1-9]|3[01])",n=new RegExp(t+"$"),o=new RegExp(t),r=(a,e=!1)=>e?o.test(a):n.test(a)},38279(a,e,i){i.d(e,{$2:()=>t,VV:()=>o,on:()=>s,sx:()=>r});var t=function(a){return a[a.TARGET_TEMPERATURE=1]="TARGET_TEMPERATURE",a[a.TARGET_TEMPERATURE_RANGE=2]="TARGET_TEMPERATURE_RANGE",a[a.TARGET_HUMIDITY=4]="TARGET_HUMIDITY",a[a.FAN_MODE=8]="FAN_MODE",a[a.PRESET_MODE=16]="PRESET_MODE",a[a.SWING_MODE=32]="SWING_MODE",a[a.AUX_HEAT=64]="AUX_HEAT",a[a.TURN_OFF=128]="TURN_OFF",a[a.TURN_ON=256]="TURN_ON",a[a.SWING_HORIZONTAL_MODE=512]="SWING_HORIZONTAL_MODE",a}({});const n=["auto","heat_cool","heat","cool","dry","fan_only","off"].reduce((a,e,i)=>(a[e]=i,a),{}),o=(a,e)=>n[a]-n[e],r={cooling:"cool",defrosting:"heat",drying:"dry",fan:"fan_only",heating:"heat",idle:"off",off:"off",preheating:"heat"},c={cool:"M20.79,13.95L18.46,14.57L16.46,13.44V10.56L18.46,9.43L20.79,10.05L21.31,8.12L19.54,7.65L20,5.88L18.07,5.36L17.45,7.69L15.45,8.82L13,7.38V5.12L14.71,3.41L13.29,2L12,3.29L10.71,2L9.29,3.41L11,5.12V7.38L8.5,8.82L6.5,7.69L5.92,5.36L4,5.88L4.47,7.65L2.7,8.12L3.22,10.05L5.55,9.43L7.55,10.56V13.45L5.55,14.58L3.22,13.96L2.7,15.89L4.47,16.36L4,18.12L5.93,18.64L6.55,16.31L8.55,15.18L11,16.62V18.88L9.29,20.59L10.71,22L12,20.71L13.29,22L14.7,20.59L13,18.88V16.62L15.5,15.17L17.5,16.3L18.12,18.63L20,18.12L19.53,16.35L21.3,15.88L20.79,13.95M9.5,10.56L12,9.11L14.5,10.56V13.44L12,14.89L9.5,13.44V10.56Z",dry:"M12,3.25C12,3.25 6,10 6,14C6,17.32 8.69,20 12,20A6,6 0 0,0 18,14C18,10 12,3.25 12,3.25M14.47,9.97L15.53,11.03L9.53,17.03L8.47,15.97M9.75,10A1.25,1.25 0 0,1 11,11.25A1.25,1.25 0 0,1 9.75,12.5A1.25,1.25 0 0,1 8.5,11.25A1.25,1.25 0 0,1 9.75,10M14.25,14.5A1.25,1.25 0 0,1 15.5,15.75A1.25,1.25 0 0,1 14.25,17A1.25,1.25 0 0,1 13,15.75A1.25,1.25 0 0,1 14.25,14.5Z",fan_only:"M12,11A1,1 0 0,0 11,12A1,1 0 0,0 12,13A1,1 0 0,0 13,12A1,1 0 0,0 12,11M12.5,2C17,2 17.11,5.57 14.75,6.75C13.76,7.24 13.32,8.29 13.13,9.22C13.61,9.42 14.03,9.73 14.35,10.13C18.05,8.13 22.03,8.92 22.03,12.5C22.03,17 18.46,17.1 17.28,14.73C16.78,13.74 15.72,13.3 14.79,13.11C14.59,13.59 14.28,14 13.88,14.34C15.87,18.03 15.08,22 11.5,22C7,22 6.91,18.42 9.27,17.24C10.25,16.75 10.69,15.71 10.89,14.79C10.4,14.59 9.97,14.27 9.65,13.87C5.96,15.85 2,15.07 2,11.5C2,7 5.56,6.89 6.74,9.26C7.24,10.25 8.29,10.68 9.22,10.87C9.41,10.39 9.73,9.97 10.14,9.65C8.15,5.96 8.94,2 12.5,2Z",auto:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22C12.4 22 12.7 22 13.1 21.9L15.4 15.3L14.8 14.7C15.5 14 16 13 16 11.9C16 11.2 15.8 10.5 15.4 9.9L17.6 7.7C18.5 9 19 10.4 19 12H20C20.3 12 20.6 12.1 20.8 12.2C20.8 12.2 20.9 12.2 20.9 12.3C21.3 12.5 21.7 12.9 21.9 13.4C22 12.9 22 12.5 22 12C22 6.5 17.5 2 12 2M14 8.6C13.4 8.2 12.7 8 12 8C9.8 8 8 9.8 8 12C8 13.1 8.4 14.1 9.2 14.8L7.1 16.9C5.8 15.7 5 13.9 5 12C5 8.1 8.1 5 12 5C13.6 5 15 5.5 16.2 6.4L14 8.6M20 14H18L14.8 23H16.7L17.4 21H20.6L21.3 23H23.2L20 14M17.8 19.7L19 16L20.2 19.7H17.8Z",heat:"M17.66 11.2C17.43 10.9 17.15 10.64 16.89 10.38C16.22 9.78 15.46 9.35 14.82 8.72C13.33 7.26 13 4.85 13.95 3C13 3.23 12.17 3.75 11.46 4.32C8.87 6.4 7.85 10.07 9.07 13.22C9.11 13.32 9.15 13.42 9.15 13.55C9.15 13.77 9 13.97 8.8 14.05C8.57 14.15 8.33 14.09 8.14 13.93C8.08 13.88 8.04 13.83 8 13.76C6.87 12.33 6.69 10.28 7.45 8.64C5.78 10 4.87 12.3 5 14.47C5.06 14.97 5.12 15.47 5.29 15.97C5.43 16.57 5.7 17.17 6 17.7C7.08 19.43 8.95 20.67 10.96 20.92C13.1 21.19 15.39 20.8 17.03 19.32C18.86 17.66 19.5 15 18.56 12.72L18.43 12.46C18.22 12 17.66 11.2 17.66 11.2M14.5 17.5C14.22 17.74 13.76 18 13.4 18.1C12.28 18.5 11.16 17.94 10.5 17.28C11.69 17 12.4 16.12 12.61 15.23C12.78 14.43 12.46 13.77 12.33 13C12.21 12.26 12.23 11.63 12.5 10.94C12.69 11.32 12.89 11.7 13.13 12C13.9 13 15.11 13.44 15.37 14.8C15.41 14.94 15.43 15.08 15.43 15.23C15.46 16.05 15.1 16.95 14.5 17.5H14.5Z",off:"M16.56,5.44L15.11,6.89C16.84,7.94 18,9.83 18,12A6,6 0 0,1 12,18A6,6 0 0,1 6,12C6,9.83 7.16,7.94 8.88,6.88L7.44,5.44C5.36,6.88 4,9.28 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12C20,9.28 18.64,6.88 16.56,5.44M13,3H11V13H13",heat_cool:"M12.92 1.58L11.18 2.58L12.39 4.67L11.8 6.85L9 7.6L7.38 6L7.42 3.59L5.43 3.59L5.43 5.42L3.59 5.42L3.6 7.42L6 7.42L7.65 9.03L6.9 11.82L4.68 12.4L2.59 11.2L1.59 12.93L3.17 13.84L2.26 15.42L4 16.42L5.19 14.33L7.42 13.75L7.92 14.26L9.32 12.86L8.78 12.32L9.53 9.54L12.32 8.78L12.85 9.32L14.26 7.91L13.73 7.37L14.32 5.19L16.41 4L15.41 2.25L13.83 3.16L12.92 1.58M20.72 4L4 20.72L5.27 22L10.16 17.11C10.63 17.43 11.15 17.68 11.71 17.83C14.38 18.55 17.12 16.96 17.83 14.29C18.22 12.86 17.93 11.36 17.11 10.16L22 5.27L20.72 4M18.74 9C19.18 9.63 19.53 10.38 19.75 11.19C19.97 12 20.03 12.81 19.96 13.61L22.65 10.41L18.74 9M19.32 15.95C19 16.67 18.5 17.35 17.93 17.94C17.34 18.53 16.66 19 15.96 19.34L20.05 20.06L19.32 15.95M9 18.71L10.41 22.66L13.59 19.95C12.81 20 12 19.97 11.19 19.76C10.36 19.54 9.62 19.17 9 18.71Z"},s=a=>c[a]||"M16.95,16.95L14.83,14.83C15.55,14.1 16,13.1 16,12C16,11.26 15.79,10.57 15.43,10L17.6,7.81C18.5,9 19,10.43 19,12C19,13.93 18.22,15.68 16.95,16.95M12,5C13.57,5 15,5.5 16.19,6.4L14,8.56C13.43,8.21 12.74,8 12,8A4,4 0 0,0 8,12C8,13.1 8.45,14.1 9.17,14.83L7.05,16.95C5.78,15.68 5,13.93 5,12A7,7 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"},47302(a,e,i){i.a(a,async function(a,t){try{i.r(e),i.d(e,{HomeAreaViewStrategy:()=>d});i(74423),i(44114),i(18111),i(22489),i(61701),i(18237);var n=i(62826),o=i(5124),r=i(22441),c=i(37981),s=i(28455),m=i(4423),l=i(63004),u=i(39985),M=i(8537),T=a([u,M]);[u,M]=T.then?(await T)():T;class d extends o.mN{static async generate(a,e){if(!a.area)throw new Error("Area not provided");const i=e.areas[a.area];if(!i)throw new Error("Unknown area");const t=[],n=[];i.temperature_entity_id&&n.push({entity:i.temperature_entity_id,type:"entity",color:"red"}),i.humidity_entity_id&&n.push({entity:i.humidity_entity_id,type:"entity",color:"indigo"});const o=(0,u.L8)(e,i.name,!0),r=(0,m.r)(e,{area:a.area}),T=Object.keys(e.states).filter(r),d=M.lS.reduce((a,i)=>{const t=M.vV[i].map(a=>(0,m.r)(e,a));return a[i]=(0,m.B)(T,t),a},{}),{light:h,climate:G,security:A,media_players:g}=d;if(h.length>0){const i={condition:"or",conditions:h.map(a=>({condition:"state",entity:a,state:"on"}))};t.push({type:"grid",cards:[{type:"heading",heading:(0,M.rh)(e.localize,"light"),icon:M.It.light,tap_action:e.panels.light?{action:"navigate",navigation_path:"/light?historyBack=1"}:void 0,badges:[{type:"button",icon:"mdi:power",text:e.localize("ui.panel.lovelace.strategy.light.off"),tap_action:{action:"perform-action",perform_action:"light.turn_on",target:{area_id:a.area}},visibility:[{condition:"not",conditions:[i]}]},{type:"button",icon:"mdi:power",color:"orange",text:e.localize("ui.panel.lovelace.strategy.light.on"),tap_action:{action:"perform-action",perform_action:"light.turn_off",target:{area_id:a.area}},visibility:[i]}]},...h.map(o)]})}G.length>0&&t.push({type:"grid",cards:[{type:"heading",heading:(0,M.rh)(e.localize,"climate"),icon:M.It.climate,tap_action:e.panels.climate?{action:"navigate",navigation_path:"/climate?historyBack=1"}:void 0},...G.map(o)]}),A.length>0&&t.push({type:"grid",cards:[{type:"heading",heading:(0,M.rh)(e.localize,"security"),icon:M.It.security,tap_action:e.panels.security?{action:"navigate",navigation_path:"/security?historyBack=1"}:void 0},...A.map(o)]}),g.length>0&&t.push({type:"grid",cards:[{type:"heading",heading:(0,M.rh)(e.localize,"media_players"),icon:M.It.media_players,tap_action:{action:"navigate",navigation_path:"media-players?historyBack=1"}},...g.map(o)]});const f=[],{maintenance:p,...y}=d,_=Object.values(y).flat(),C=(0,m.r)(e,{domain:"scene",entity_category:"none"}),L=T.filter(C);L.length>0&&t.push({type:"grid",cards:[{type:"heading",heading:e.localize("ui.panel.lovelace.strategy.home.scenes"),icon:"mdi:palette",tap_action:e.user?.is_admin?{action:"navigate",navigation_path:"/config/scene/dashboard"}:void 0},...L.map(o)]});const v=(0,m.r)(e,{domain:"automation",entity_category:"none"}),w=T.filter(v),E=T.filter(a=>!_.includes(a)&&!L.includes(a)&&!w.includes(a)),k={},b=[];for(const a of E){const i=e.states[a];if(!i)continue;const{device:t}=(0,s.ln)(i,e.entities,e.devices,e.areas,e.floors);t?(t.id in k||(k[t.id]=[]),k[t.id].push(a)):b.push(a)}const P=Object.entries(k).map(([a,e])=>({device_id:a,entities:e}));b.length>0&&P.push({device_id:"unassigned",entities:b});const z=(0,m.r)(e,{domain:"sensor",device_class:"battery"}),D=(0,m.r)(e,{entity_category:"none"});for(const a of P){if(0===a.entities.length)continue;const i=a.entities.filter(a=>z(a)),t=a.entities.filter(a=>!z(a)&&D(a));if(0===t.length)continue;const n=a.device_id,r=e.devices[n];let s;s=r?(0,c.xn)(r)||e.localize("ui.panel.lovelace.strategy.home.unnamed_device"):e.localize("ui.panel.lovelace.strategy.home.others"),f.push({type:"grid",cards:[{type:"heading",heading:s,tap_action:e.user?.is_admin&&r?{action:"navigate",navigation_path:`/config/devices/device/${r.id}`}:void 0,badges:[...i.slice(0,1).map(a=>({entity:a,type:"entity",tap_action:{action:"more-info"}}))]},...t.map(a=>({...o(a),name:{type:"entity"}}))]})}if(f.length>0&&(t.push({type:"grid",column_span:3,cards:[{type:"heading",heading_style:"subtitle",heading:""}]}),t.push(...f)),w.length>0&&t.push({type:"grid",cards:[{type:"heading",heading:e.localize("ui.panel.lovelace.strategy.home.automations"),icon:"mdi:robot",tap_action:e.user?.is_admin?{action:"navigate",navigation_path:"/config/automation/dashboard"}:void 0},...w.map(o)]}),0===t.length)return{type:"panel",cards:[{type:"empty-state",icon:i.icon||"mdi:shape-square-rounded-plus",icon_color:"primary",content_only:!0,title:e.localize("ui.panel.lovelace.strategy.home-area.no_devices_title"),content:e.localize("ui.panel.lovelace.strategy.home-area.no_devices_content"),...a.home_panel&&e.user?.is_admin?{buttons:[{icon:"mdi:plus",text:e.localize("ui.panel.lovelace.strategy.home-area.no_devices_add_device"),appearance:"plain",variant:"brand",tap_action:{action:"fire-dom-event",home_panel:{type:"add_integration"}}},{icon:"mdi:home-plus",text:e.localize("ui.panel.lovelace.strategy.home-area.no_devices_assign_device"),appearance:"plain",variant:"brand",tap_action:{action:"navigate",navigation_path:"/home/other-devices"}}]}:{}}]};const S=(0,l.q)(t.length,2,3);return 1===t.length&&(t[0].column_span=2),{type:"sections",header:{badges_position:"bottom"},max_columns:S,sections:t,badges:n}}}d=(0,n.Cg)([(0,r.EM)("home-area-view-strategy")],d),t()}catch(a){t(a)}})},75751(a,e,i){i.d(e,{u:()=>c});i(45367),i(92731);var t=i(5055),n=i(42017),o=i(63937);const r=(a,e,i)=>{const t=new Map;for(let n=e;n<=i;n++)t.set(a[n],n);return t},c=(0,n.u$)(class extends n.WL{dt(a,e,i){let t;void 0===i?i=e:void 0!==e&&(t=e);const n=[],o=[];let r=0;for(const e of a)n[r]=t?t(e,r):r,o[r]=i(e,r),r++;return{values:o,keys:n}}render(a,e,i){return this.dt(a,e,i).values}update(a,[e,i,n]){const c=(0,o.cN)(a),{values:s,keys:m}=this.dt(e,i,n);if(!Array.isArray(c))return this.ut=m,s;const l=this.ut??=[],u=[];let M,T,d=0,h=c.length-1,G=0,A=s.length-1;for(;d<=h&&G<=A;)if(null===c[d])d++;else if(null===c[h])h--;else if(l[d]===m[G])u[G]=(0,o.lx)(c[d],s[G]),d++,G++;else if(l[h]===m[A])u[A]=(0,o.lx)(c[h],s[A]),h--,A--;else if(l[d]===m[A])u[A]=(0,o.lx)(c[d],s[A]),(0,o.Dx)(a,u[A+1],c[d]),d++,A--;else if(l[h]===m[G])u[G]=(0,o.lx)(c[h],s[G]),(0,o.Dx)(a,c[d],c[h]),h--,G++;else if(void 0===M&&(M=r(m,G,A),T=r(l,d,h)),M.has(l[d]))if(M.has(l[h])){const e=T.get(m[G]),i=void 0!==e?c[e]:null;if(null===i){const e=(0,o.Dx)(a,c[d]);(0,o.lx)(e,s[G]),u[G]=e}else u[G]=(0,o.lx)(i,s[G]),(0,o.Dx)(a,c[d],i),c[e]=null;G++}else(0,o.KO)(c[h]),h--;else(0,o.KO)(c[d]),d++;for(;G<=A;){const e=(0,o.Dx)(a,u[A+1]);(0,o.lx)(e,s[G]),u[G++]=e}for(;d<=h;){const a=c[d++];null!==a&&(0,o.KO)(a)}return this.ut=m,(0,o.mY)(a,u),t.c0}constructor(a){if(super(a),a.type!==n.OA.CHILD)throw Error("repeat() can only be used in text expressions")}})},81267(a){a.exports=JSON.parse('{"Pacific/Niue":"(GMT-11:00) Niue","Pacific/Pago_Pago":"(GMT-11:00) Pago Pago","Pacific/Honolulu":"(GMT-10:00) Hawaii Time","Pacific/Rarotonga":"(GMT-10:00) Rarotonga","Pacific/Tahiti":"(GMT-10:00) Tahiti","Pacific/Marquesas":"(GMT-09:30) Marquesas","America/Anchorage":"(GMT-09:00) Alaska Time","Pacific/Gambier":"(GMT-09:00) Gambier","America/Los_Angeles":"(GMT-08:00) Pacific Time","America/Tijuana":"(GMT-08:00) Pacific Time - Tijuana","America/Vancouver":"(GMT-08:00) Pacific Time - Vancouver","America/Whitehorse":"(GMT-08:00) Pacific Time - Whitehorse","Pacific/Pitcairn":"(GMT-08:00) Pitcairn","America/Dawson_Creek":"(GMT-07:00) Mountain Time - Dawson Creek","America/Denver":"(GMT-07:00) Mountain Time","America/Edmonton":"(GMT-07:00) Mountain Time - Edmonton","America/Hermosillo":"(GMT-07:00) Mountain Time - Hermosillo","America/Mazatlan":"(GMT-07:00) Mountain Time - Chihuahua, Mazatlan","America/Phoenix":"(GMT-07:00) Mountain Time - Arizona","America/Yellowknife":"(GMT-07:00) Mountain Time - Yellowknife","America/Belize":"(GMT-06:00) Belize","America/Chicago":"(GMT-06:00) Central Time","America/Costa_Rica":"(GMT-06:00) Costa Rica","America/El_Salvador":"(GMT-06:00) El Salvador","America/Guatemala":"(GMT-06:00) Guatemala","America/Managua":"(GMT-06:00) Managua","America/Mexico_City":"(GMT-06:00) Central Time - Mexico City","America/Regina":"(GMT-06:00) Central Time - Regina","America/Tegucigalpa":"(GMT-06:00) Central Time - Tegucigalpa","America/Winnipeg":"(GMT-06:00) Central Time - Winnipeg","Pacific/Galapagos":"(GMT-06:00) Galapagos","America/Bogota":"(GMT-05:00) Bogota","America/Cancun":"(GMT-05:00) America Cancun","America/Cayman":"(GMT-05:00) Cayman","America/Guayaquil":"(GMT-05:00) Guayaquil","America/Havana":"(GMT-05:00) Havana","America/Iqaluit":"(GMT-05:00) Eastern Time - Iqaluit","America/Jamaica":"(GMT-05:00) Jamaica","America/Lima":"(GMT-05:00) Lima","America/Nassau":"(GMT-05:00) Nassau","America/New_York":"(GMT-05:00) Eastern Time","America/Panama":"(GMT-05:00) Panama","America/Port-au-Prince":"(GMT-05:00) Port-au-Prince","America/Rio_Branco":"(GMT-05:00) Rio Branco","America/Toronto":"(GMT-05:00) Eastern Time - Toronto","Pacific/Easter":"(GMT-05:00) Easter Island","America/Caracas":"(GMT-04:00) Caracas","America/Asuncion":"(GMT-03:00) Asuncion","America/Barbados":"(GMT-04:00) Barbados","America/Boa_Vista":"(GMT-04:00) Boa Vista","America/Campo_Grande":"(GMT-03:00) Campo Grande","America/Cuiaba":"(GMT-03:00) Cuiaba","America/Curacao":"(GMT-04:00) Curacao","America/Grand_Turk":"(GMT-04:00) Grand Turk","America/Guyana":"(GMT-04:00) Guyana","America/Halifax":"(GMT-04:00) Atlantic Time - Halifax","America/La_Paz":"(GMT-04:00) La Paz","America/Manaus":"(GMT-04:00) Manaus","America/Martinique":"(GMT-04:00) Martinique","America/Port_of_Spain":"(GMT-04:00) Port of Spain","America/Porto_Velho":"(GMT-04:00) Porto Velho","America/Puerto_Rico":"(GMT-04:00) Puerto Rico","America/Santo_Domingo":"(GMT-04:00) Santo Domingo","America/Thule":"(GMT-04:00) Thule","Atlantic/Bermuda":"(GMT-04:00) Bermuda","America/St_Johns":"(GMT-03:30) Newfoundland Time - St. Johns","America/Araguaina":"(GMT-03:00) Araguaina","America/Argentina/Buenos_Aires":"(GMT-03:00) Buenos Aires","America/Bahia":"(GMT-03:00) Salvador","America/Belem":"(GMT-03:00) Belem","America/Cayenne":"(GMT-03:00) Cayenne","America/Fortaleza":"(GMT-03:00) Fortaleza","America/Godthab":"(GMT-03:00) Godthab","America/Maceio":"(GMT-03:00) Maceio","America/Miquelon":"(GMT-03:00) Miquelon","America/Montevideo":"(GMT-03:00) Montevideo","America/Paramaribo":"(GMT-03:00) Paramaribo","America/Recife":"(GMT-03:00) Recife","America/Santiago":"(GMT-03:00) Santiago","America/Sao_Paulo":"(GMT-03:00) Sao Paulo","Antarctica/Palmer":"(GMT-03:00) Palmer","Antarctica/Rothera":"(GMT-03:00) Rothera","Atlantic/Stanley":"(GMT-03:00) Stanley","America/Noronha":"(GMT-02:00) Noronha","Atlantic/South_Georgia":"(GMT-02:00) South Georgia","America/Scoresbysund":"(GMT-01:00) Scoresbysund","Atlantic/Azores":"(GMT-01:00) Azores","Atlantic/Cape_Verde":"(GMT-01:00) Cape Verde","Africa/Abidjan":"(GMT+00:00) Abidjan","Africa/Accra":"(GMT+00:00) Accra","Africa/Bissau":"(GMT+00:00) Bissau","Africa/Casablanca":"(GMT+00:00) Casablanca","Africa/El_Aaiun":"(GMT+00:00) El Aaiun","Africa/Monrovia":"(GMT+00:00) Monrovia","America/Danmarkshavn":"(GMT+00:00) Danmarkshavn","Atlantic/Canary":"(GMT+00:00) Canary Islands","Atlantic/Faroe":"(GMT+00:00) Faeroe","Atlantic/Reykjavik":"(GMT+00:00) Reykjavik","Etc/GMT":"(GMT+00:00) GMT (no daylight saving)","Europe/Dublin":"(GMT+00:00) Dublin","Europe/Lisbon":"(GMT+00:00) Lisbon","Europe/London":"(GMT+00:00) London","Africa/Algiers":"(GMT+01:00) Algiers","Africa/Ceuta":"(GMT+01:00) Ceuta","Africa/Lagos":"(GMT+01:00) Lagos","Africa/Ndjamena":"(GMT+01:00) Ndjamena","Africa/Tunis":"(GMT+01:00) Tunis","Africa/Windhoek":"(GMT+02:00) Windhoek","Europe/Amsterdam":"(GMT+01:00) Amsterdam","Europe/Andorra":"(GMT+01:00) Andorra","Europe/Belgrade":"(GMT+01:00) Central European Time - Belgrade","Europe/Berlin":"(GMT+01:00) Berlin","Europe/Brussels":"(GMT+01:00) Brussels","Europe/Budapest":"(GMT+01:00) Budapest","Europe/Copenhagen":"(GMT+01:00) Copenhagen","Europe/Gibraltar":"(GMT+01:00) Gibraltar","Europe/Luxembourg":"(GMT+01:00) Luxembourg","Europe/Madrid":"(GMT+01:00) Madrid","Europe/Malta":"(GMT+01:00) Malta","Europe/Monaco":"(GMT+01:00) Monaco","Europe/Oslo":"(GMT+01:00) Oslo","Europe/Paris":"(GMT+01:00) Paris","Europe/Prague":"(GMT+01:00) Central European Time - Prague","Europe/Rome":"(GMT+01:00) Rome","Europe/Stockholm":"(GMT+01:00) Stockholm","Europe/Tirane":"(GMT+01:00) Tirane","Europe/Vienna":"(GMT+01:00) Vienna","Europe/Warsaw":"(GMT+01:00) Warsaw","Europe/Zurich":"(GMT+01:00) Zurich","Africa/Cairo":"(GMT+02:00) Cairo","Africa/Johannesburg":"(GMT+02:00) Johannesburg","Africa/Maputo":"(GMT+02:00) Maputo","Africa/Tripoli":"(GMT+02:00) Tripoli","Asia/Amman":"(GMT+02:00) Amman","Asia/Beirut":"(GMT+02:00) Beirut","Asia/Damascus":"(GMT+02:00) Damascus","Asia/Gaza":"(GMT+02:00) Gaza","Asia/Jerusalem":"(GMT+02:00) Jerusalem","Asia/Nicosia":"(GMT+02:00) Nicosia","Europe/Athens":"(GMT+02:00) Athens","Europe/Bucharest":"(GMT+02:00) Bucharest","Europe/Chisinau":"(GMT+02:00) Chisinau","Europe/Helsinki":"(GMT+02:00) Helsinki","Europe/Istanbul":"(GMT+03:00) Istanbul","Europe/Kaliningrad":"(GMT+02:00) Moscow-01 - Kaliningrad","Europe/Kyiv":"(GMT+02:00) Kyiv","Europe/Riga":"(GMT+02:00) Riga","Europe/Sofia":"(GMT+02:00) Sofia","Europe/Tallinn":"(GMT+02:00) Tallinn","Europe/Vilnius":"(GMT+02:00) Vilnius","Africa/Khartoum":"(GMT+03:00) Khartoum","Africa/Nairobi":"(GMT+03:00) Nairobi","Antarctica/Syowa":"(GMT+03:00) Syowa","Asia/Baghdad":"(GMT+03:00) Baghdad","Asia/Qatar":"(GMT+03:00) Qatar","Asia/Riyadh":"(GMT+03:00) Riyadh","Europe/Minsk":"(GMT+03:00) Minsk","Europe/Moscow":"(GMT+03:00) Moscow+00 - Moscow","Asia/Tehran":"(GMT+03:30) Tehran","Asia/Baku":"(GMT+04:00) Baku","Asia/Dubai":"(GMT+04:00) Dubai","Asia/Tbilisi":"(GMT+04:00) Tbilisi","Asia/Yerevan":"(GMT+04:00) Yerevan","Europe/Samara":"(GMT+04:00) Moscow+01 - Samara","Indian/Mahe":"(GMT+04:00) Mahe","Indian/Mauritius":"(GMT+04:00) Mauritius","Indian/Reunion":"(GMT+04:00) Reunion","Asia/Kabul":"(GMT+04:30) Kabul","Antarctica/Mawson":"(GMT+05:00) Mawson","Asia/Aqtau":"(GMT+05:00) Aqtau","Asia/Aqtobe":"(GMT+05:00) Aqtobe","Asia/Ashgabat":"(GMT+05:00) Ashgabat","Asia/Dushanbe":"(GMT+05:00) Dushanbe","Asia/Karachi":"(GMT+05:00) Karachi","Asia/Tashkent":"(GMT+05:00) Tashkent","Asia/Yekaterinburg":"(GMT+05:00) Moscow+02 - Yekaterinburg","Indian/Kerguelen":"(GMT+05:00) Kerguelen","Indian/Maldives":"(GMT+05:00) Maldives","Asia/Calcutta":"(GMT+05:30) India Standard Time","Asia/Colombo":"(GMT+05:30) Colombo","Asia/Katmandu":"(GMT+05:45) Katmandu","Antarctica/Vostok":"(GMT+06:00) Vostok","Asia/Almaty":"(GMT+06:00) Almaty","Asia/Bishkek":"(GMT+06:00) Bishkek","Asia/Dhaka":"(GMT+06:00) Dhaka","Asia/Omsk":"(GMT+06:00) Moscow+03 - Omsk, Novosibirsk","Asia/Thimphu":"(GMT+06:00) Thimphu","Indian/Chagos":"(GMT+06:00) Chagos","Asia/Rangoon":"(GMT+06:30) Rangoon","Indian/Cocos":"(GMT+06:30) Cocos","Antarctica/Davis":"(GMT+07:00) Davis","Asia/Bangkok":"(GMT+07:00) Bangkok","Asia/Hovd":"(GMT+07:00) Hovd","Asia/Jakarta":"(GMT+07:00) Jakarta","Asia/Krasnoyarsk":"(GMT+07:00) Moscow+04 - Krasnoyarsk","Asia/Saigon":"(GMT+07:00) Hanoi","Asia/Ho_Chi_Minh":"(GMT+07:00) Ho Chi Minh","Indian/Christmas":"(GMT+07:00) Christmas","Antarctica/Casey":"(GMT+08:00) Casey","Asia/Brunei":"(GMT+08:00) Brunei","Asia/Choibalsan":"(GMT+08:00) Choibalsan","Asia/Hong_Kong":"(GMT+08:00) Hong Kong","Asia/Irkutsk":"(GMT+08:00) Moscow+05 - Irkutsk","Asia/Kuala_Lumpur":"(GMT+08:00) Kuala Lumpur","Asia/Macau":"(GMT+08:00) Macau","Asia/Makassar":"(GMT+08:00) Makassar","Asia/Manila":"(GMT+08:00) Manila","Asia/Shanghai":"(GMT+08:00) China Time - Beijing","Asia/Singapore":"(GMT+08:00) Singapore","Asia/Taipei":"(GMT+08:00) Taipei","Asia/Ulaanbaatar":"(GMT+08:00) Ulaanbaatar","Australia/Perth":"(GMT+08:00) Western Time - Perth","Asia/Pyongyang":"(GMT+08:30) Pyongyang","Asia/Dili":"(GMT+09:00) Dili","Asia/Jayapura":"(GMT+09:00) Jayapura","Asia/Seoul":"(GMT+09:00) Seoul","Asia/Tokyo":"(GMT+09:00) Tokyo","Asia/Yakutsk":"(GMT+09:00) Moscow+06 - Yakutsk","Pacific/Palau":"(GMT+09:00) Palau","Australia/Adelaide":"(GMT+10:30) Central Time - Adelaide","Australia/Darwin":"(GMT+09:30) Central Time - Darwin","Antarctica/DumontDUrville":"(GMT+10:00) Dumont D\'Urville","Asia/Magadan":"(GMT+10:00) Moscow+07 - Magadan","Asia/Vladivostok":"(GMT+10:00) Moscow+07 - Vladivostok","Australia/Brisbane":"(GMT+10:00) Eastern Time - Brisbane","Asia/Yuzhno-Sakhalinsk":"(GMT+11:00) Moscow+08 - Yuzhno-Sakhalinsk","Australia/Hobart":"(GMT+11:00) Eastern Time - Hobart","Australia/Sydney":"(GMT+11:00) Eastern Time - Melbourne, Sydney","Pacific/Chuuk":"(GMT+10:00) Truk","Pacific/Guam":"(GMT+10:00) Guam","Pacific/Port_Moresby":"(GMT+10:00) Port Moresby","Pacific/Efate":"(GMT+11:00) Efate","Pacific/Guadalcanal":"(GMT+11:00) Guadalcanal","Pacific/Kosrae":"(GMT+11:00) Kosrae","Pacific/Norfolk":"(GMT+11:00) Norfolk","Pacific/Noumea":"(GMT+11:00) Noumea","Pacific/Pohnpei":"(GMT+11:00) Ponape","Asia/Kamchatka":"(GMT+12:00) Moscow+09 - Petropavlovsk-Kamchatskiy","Pacific/Auckland":"(GMT+13:00) Auckland","Pacific/Fiji":"(GMT+13:00) Fiji","Pacific/Funafuti":"(GMT+12:00) Funafuti","Pacific/Kwajalein":"(GMT+12:00) Kwajalein","Pacific/Majuro":"(GMT+12:00) Majuro","Pacific/Nauru":"(GMT+12:00) Nauru","Pacific/Tarawa":"(GMT+12:00) Tarawa","Pacific/Wake":"(GMT+12:00) Wake","Pacific/Wallis":"(GMT+12:00) Wallis","Pacific/Apia":"(GMT+14:00) Apia","Pacific/Enderbury":"(GMT+13:00) Enderbury","Pacific/Fakaofo":"(GMT+13:00) Fakaofo","Pacific/Tongatapu":"(GMT+13:00) Tongatapu","Pacific/Kiritimati":"(GMT+14:00) Kiritimati"}')}};