UNPKG

iobroker.lovelace

Version:

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

4 lines 104 kB
export const __rspack_esm_id=62662;export const __rspack_esm_ids=[62662];export const __webpack_modules__={91069(e,t,a){a.a(e,async function(e,i){try{a.d(t,{EO:()=>w,Yq:()=>$,_U:()=>C,eE:()=>k,fU:()=>x,ol:()=>v,xo:()=>y});var o=a(78016),r=a(31810),s=a(87950),n=a(81977),c=a(36307),l=a(35932),d=a(73983),h=a(6946),u=a(92913),p=a(83339),m=a(77972),g=a(31886),b=a(46927),_=e([g]);g=(_.then?(await _)():_)[0];const f=(e,t,a,i)=>{const o=a(new g.BB(e,t),i);return o instanceof Date?new Date(o.getTime()):o},v=(e,t,a,i,o)=>a.time_zone===b.Wj.server?f(e,i.time_zone,t,o):t(e,o),y=(e,t,a,i,o)=>a.time_zone===b.Wj.server?f(e,i.time_zone,t,o):t(e,o),w=(e,t,a,i,o)=>y(e,a,i,o,i.time_zone===b.Wj.server?new g.BB(t,o.time_zone):t),k=(e,t,a,i,g)=>{let b,_;if(y(e,o.e,i,g)&&y(t,r.c,i,g)){const o=(w(t,e,s.W,i,g)+1)*(a?1:-1);b=v(e,n.P,i,g,o),_=v(v(t,n.P,i,g,o),c.p,i,g)}else if(y(e,e=>(0,l.o)(e).getMilliseconds()===e.getMilliseconds(),i,g)&&y(t,e=>(0,d.D)(e).getMilliseconds()===e.getMilliseconds(),i,g)){const o=(w(t,e,h.c,i,g)+1)*(a?1:-1);b=v(e,u.f,i,g,o),_=v(t,u.f,i,g,o)}else{const o=w(t,e,p.b,i,g)*(a?1:-1);b=v(e,m.A,i,g,o),_=v(t,m.A,i,g,o)}return{start:b,end:_}},C=(e,t)=>{const a=new g.BB(e,t);return new Date(a.getTime())},$=(e,t)=>new g.BB(e,t).toISOString().split("T")[0],x=(e,t)=>new g.BB(e,t).toISOString().split("T")[1].split(".")[0];i()}catch(e){i(e)}})},46223(e,t,a){a.a(e,async function(e,i){try{a.d(t,{b:()=>w});var o=a(35932),r=a(73983),s=a(92913),n=a(52640),c=a(69137),l=a(35660),d=a(36307),h=a(11650),u=a(15797),p=a(33977),m=a(69748),g=a(55144),b=a(21828),_=a(66708),f=a(91069),v=a(380),y=e([f]);f=(y.then?(await y)():y)[0];const w=(e,t,a)=>{const i=new Date,y=(0,v.P)(e);switch(a){case"today":return[(0,f.ol)(i,o.o,e,t,{weekStartsOn:y}),(0,f.ol)(i,r.D,e,t,{weekStartsOn:y})];case"yesterday":return[(0,f.ol)((0,s.f)(i,-1),o.o,e,t,{weekStartsOn:y}),(0,f.ol)((0,s.f)(i,-1),r.D,e,t,{weekStartsOn:y})];case"this_week":return[(0,f.ol)(i,n.k,e,t,{weekStartsOn:y}),(0,f.ol)(i,c.$,e,t,{weekStartsOn:y})];case"this_month":return[(0,f.ol)(i,l.w,e,t),(0,f.ol)(i,d.p,e,t)];case"this_quarter":return[(0,f.ol)(i,h.a,e,t),(0,f.ol)(i,u.j,e,t)];case"this_year":return[(0,f.ol)(i,p.D,e,t),(0,f.ol)(i,m.Q,e,t)];case"now-7d":return[(0,f.ol)(i,g.e,e,t,7),(0,f.ol)(i,g.e,e,t,0)];case"now-30d":return[(0,f.ol)(i,g.e,e,t,30),(0,f.ol)(i,g.e,e,t,0)];case"now-12m":return[(0,f.ol)(i,e=>(0,b.a)((0,l.w)(e),11),e,t),(0,f.ol)(i,d.p,e,t)];case"now-365d":return[(0,f.ol)(i,g.e,e,t,365),(0,f.ol)(i,g.e,e,t,0)];case"now-1h":return[(0,f.ol)(i,_.O,e,t,1),(0,f.ol)(i,_.O,e,t,0)];case"now-12h":return[(0,f.ol)(i,_.O,e,t,12),(0,f.ol)(i,_.O,e,t,0)];case"now-24h":return[(0,f.ol)(i,_.O,e,t,24),(0,f.ol)(i,_.O,e,t,0)]}return[i,i]};i()}catch(e){i(e)}})},72487(e,t,a){a.a(e,async function(e,i){try{a.d(t,{CA:()=>x,Mi:()=>S,Pm:()=>C,Wq:()=>v,Yq:()=>l,bl:()=>Z,c2:()=>w,fr:()=>_,gu:()=>M,kz:()=>h,m9:()=>z,sl:()=>g,ur:()=>I,zB:()=>p});a(18111),a(20116);var o=a(74487),r=a(22786),s=a(46927),n=a(8480),c=e([o,n]);[o,n]=c.then?(await c)():c;(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"long",month:"long",day:"numeric",timeZone:(0,n.wj)(e.time_zone,t)}));const l=(e,t,a)=>d(t,a.time_zone).format(e),d=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",timeZone:(0,n.wj)(e.time_zone,t)})),h=(e,t,a)=>u(t,a.time_zone).format(e),u=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"short",day:"numeric",timeZone:(0,n.wj)(e.time_zone,t)})),p=(e,t,a)=>{const i=m(t,a.time_zone);if(t.date_format===s.ow.language||t.date_format===s.ow.system)return i.format(e);const o=i.formatToParts(e),r=o.find(e=>"literal"===e.type)?.value,n=o.find(e=>"day"===e.type)?.value,c=o.find(e=>"month"===e.type)?.value,l=o.find(e=>"year"===e.type)?.value,d=o[o.length-1];let h="literal"===d?.type?d?.value:"";"bg"===t.language&&t.date_format===s.ow.YMD&&(h="");return{[s.ow.DMY]:`${n}${r}${c}${r}${l}${h}`,[s.ow.MDY]:`${c}${r}${n}${r}${l}${h}`,[s.ow.YMD]:`${l}${r}${c}${r}${n}${h}`}[t.date_format]},m=(0,r.A)((e,t)=>{const a=e.date_format===s.ow.system?void 0:e.language;return e.date_format===s.ow.language||(e.date_format,s.ow.system),new Intl.DateTimeFormat(a,{year:"numeric",month:"numeric",day:"numeric",timeZone:(0,n.wj)(e.time_zone,t)})}),g=(e,t,a)=>b(t,a.time_zone).format(e),b=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{day:"numeric",month:"short",timeZone:(0,n.wj)(e.time_zone,t)})),_=(e,t,a)=>f(t,a.time_zone).format(e),f=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{month:"long",year:"numeric",timeZone:(0,n.wj)(e.time_zone,t)})),v=(e,t,a)=>y(t,a.time_zone).format(e),y=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{month:"long",timeZone:(0,n.wj)(e.time_zone,t)})),w=(e,t,a)=>k(t,a.time_zone).format(e),k=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{month:"short",timeZone:(0,n.wj)(e.time_zone,t)})),C=(e,t,a)=>$(t,a.time_zone).format(e),$=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",timeZone:(0,n.wj)(e.time_zone,t)})),x=(e,t,a)=>L(t,a.time_zone).format(e),L=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"long",timeZone:(0,n.wj)(e.time_zone,t)})),M=(e,t,a)=>E(t,a.time_zone).format(e),E=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"short",timeZone:(0,n.wj)(e.time_zone,t)})),S=(e,t,a)=>A(t,a.time_zone).format(e),A=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"short",month:"short",day:"numeric",timeZone:(0,n.wj)(e.time_zone,t)})),I=(e,t,a)=>T(t,a.time_zone).format(e),T=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"short",month:"short",day:"numeric",year:"numeric",timeZone:(0,n.wj)(e.time_zone,t)})),Z=(e,t,a)=>{const i=(0,n.wj)(t.time_zone,a.time_zone);return new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit",timeZone:i}).format(e)},z=(e,t,a,i)=>`${Z(e,a,i)}/${Z(t,a,i)}`;i()}catch(e){i(e)}})},82591(e,t,a){a.a(e,async function(e,i){try{a.d(t,{E2:()=>p,Z8:()=>m,a3:()=>f,i:()=>h,nR:()=>l});var o=a(74487),r=a(22786),s=a(79791),n=e([o]);o=(n.then?(await n)():n)[0];const c=e=>e<10?`0${e}`:e,l=(e,t)=>{const a=t.days||0,i=t.hours||0,o=t.minutes||0,r=t.seconds||0,s=t.milliseconds||0;return a>0?`${Intl.NumberFormat(e.language,{style:"unit",unit:"day",unitDisplay:"long"}).format(a)} ${i}:${c(o)}:${c(r)}`:i>0?`${i}:${c(o)}:${c(r)}`:o>0?`${o}:${c(r)}`:r>0?Intl.NumberFormat(e.language,{style:"unit",unit:"second",unitDisplay:"long"}).format(r):s>0?Intl.NumberFormat(e.language,{style:"unit",unit:"millisecond",unitDisplay:"long"}).format(s):null},d=(0,r.A)(e=>new Intl.DurationFormat(e.language,{style:"long"})),h=(e,t)=>d(e).format(t),u=(0,r.A)(e=>new Intl.DurationFormat(e.language,{style:"digital",hoursDisplay:"auto"})),p=(e,t)=>u(e).format(t),m=["min","h","d"],g=(0,r.A)(e=>new Intl.DurationFormat(e.language,{style:"narrow",daysDisplay:"always"})),b=(0,r.A)(e=>new Intl.DurationFormat(e.language,{style:"narrow",hoursDisplay:"always"})),_=(0,r.A)(e=>new Intl.DurationFormat(e.language,{style:"narrow",minutesDisplay:"always"})),f=(e,t,a,i)=>{const o=void 0!==i?(0,s.L)(parseFloat(t),i):parseFloat(t);switch(a){case"d":{const t=Math.floor(o),a={days:t,hours:Math.floor(24*(o-t))};return g(e).format(a)}case"h":{const t=Math.floor(o),a={hours:t,minutes:Math.floor(60*(o-t))};return b(e).format(a)}case"min":{const t=Math.floor(o),a={minutes:t,seconds:Math.floor(60*(o-t))};return _(e).format(a)}default:throw new Error("Invalid duration unit")}};i()}catch(e){i(e)}})},30162(e,t,a){a.a(e,async function(e,i){try{a.d(t,{LW:()=>g,Xs:()=>p,fU:()=>l,ie:()=>h});var o=a(74487),r=a(22786),s=a(8480),n=a(69543),c=e([o,s]);[o,s]=c.then?(await c)():c;const l=(e,t,a)=>d(t,a.time_zone).format(e),d=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{hour:"numeric",minute:"2-digit",hourCycle:(0,n.J)(e)?"h12":"h23",timeZone:(0,s.wj)(e.time_zone,t)})),h=(e,t,a)=>u(t,a.time_zone).format(e),u=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{hour:(0,n.J)(e)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,n.J)(e)?"h12":"h23",timeZone:(0,s.wj)(e.time_zone,t)})),p=(e,t,a)=>m(t,a.time_zone).format(e),m=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"long",hour:(0,n.J)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,n.J)(e)?"h12":"h23",timeZone:(0,s.wj)(e.time_zone,t)})),g=(e,t,a)=>b(t,a.time_zone).format(e),b=(0,r.A)((e,t)=>new Intl.DateTimeFormat("en-GB",{hour:"numeric",minute:"2-digit",hour12:!1,timeZone:(0,s.wj)(e.time_zone,t)}));i()}catch(e){i(e)}})},98975(e,t,a){a.a(e,async function(e,i){try{a.d(t,{K:()=>l});var o=a(74487),r=a(22786),s=a(63927),n=e([o,s]);[o,s]=n.then?(await n)():n;const c=(0,r.A)(e=>new Intl.RelativeTimeFormat(e.language,{numeric:"auto"})),l=(e,t,a,i=!0)=>{const o=(0,s.x)(e,a,t);return i?c(t).format(o.value,o.unit):Intl.NumberFormat(t.language,{style:"unit",unit:o.unit,unitDisplay:"long"}).format(Math.abs(o.value))};i()}catch(e){i(e)}})},26218(e,t,a){a.d(t,{a:()=>o});const i=(0,a(77796).n)(e=>{history.replaceState({scrollPosition:e},"")},300);function o(e){return(t,a)=>{if("object"==typeof a)throw new Error("This decorator does not support this compilation type.");const o=t.connectedCallback;t.connectedCallback=function(){o.call(this);const t=this[a];t&&this.updateComplete.then(()=>{const a=this.renderRoot.querySelector(e);a&&setTimeout(()=>{a.scrollTop=t},0)})};const r=Object.getOwnPropertyDescriptor(t,a);let s;if(void 0===r)s={get(){return this[`__${String(a)}`]||history.state?.scrollPosition},set(e){i(e),this[`__${String(a)}`]=e},configurable:!0,enumerable:!0};else{const e=r.set;s={...r,set(t){i(t),this[`__${String(a)}`]=t,e?.call(this,t)}}}Object.defineProperty(t,a,s)}}},15090(e,t,a){a.d(t,{nP:()=>l,vB:()=>n});a(44114),a(18111),a(22489),a(61701),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);var i=a(22675),o=a(52220),r=a(71727),s=a(69093);const n={alarm_control_panel:["armed_away","armed_custom_bypass","armed_home","armed_night","armed_vacation","arming","disarmed","disarming","pending","triggered"],alert:["on","off","idle"],assist_satellite:["idle","listening","responding","processing"],automation:["on","off"],binary_sensor:["on","off"],button:[],calendar:["on","off"],camera:["idle","recording","streaming"],cover:["closed","closing","open","opening"],device_tracker:["home","not_home"],fan:["on","off"],humidifier:["on","off"],infrared:[],input_boolean:["on","off"],input_button:[],lawn_mower:["error","paused","mowing","returning","docked"],light:["on","off"],lock:["jammed","locked","locking","unlocked","unlocking","opening","open"],media_player:["off","on","idle","playing","paused","standby","buffering"],person:["home","not_home"],plant:["ok","problem"],radio_frequency:[],remote:["on","off"],scene:[],schedule:["on","off"],script:["on","off"],siren:["on","off"],sun:["above_horizon","below_horizon"],switch:["on","off"],timer:["active","idle","paused"],update:["on","off"],vacuum:["cleaning","docked","error","idle","paused","returning"],valve:["closed","closing","open","opening"],weather:["clear-night","cloudy","exceptional","fog","hail","lightning-rainy","lightning","partlycloudy","pouring","rainy","snowy-rainy","snowy","sunny","windy-variant","windy"]},c={alarm_control_panel:{code_format:["number","text"]},binary_sensor:{device_class:["battery","battery_charging","co","cold","connectivity","door","garage_door","gas","heat","light","lock","moisture","motion","moving","occupancy","opening","plug","power","presence","problem","running","safety","smoke","sound","tamper","update","vibration","window"]},button:{device_class:["restart","update"]},camera:{frontend_stream_type:["hls","web_rtc"]},climate:{hvac_action:["off","idle","preheating","defrosting","heating","cooling","drying","fan"]},cover:{device_class:["awning","blind","curtain","damper","door","garage","gate","shade","shutter","window"]},device_tracker:{source_type:["bluetooth","bluetooth_le","gps","router"]},fan:{direction:["forward","reverse"]},humidifier:{device_class:["humidifier","dehumidifier"],action:["off","idle","humidifying","drying"]},media_player:{device_class:["tv","speaker","receiver"],media_content_type:["album","app","artist","channel","channels","composer","contributing_artist","episode","game","genre","image","movie","music","playlist","podcast","season","track","tvshow","url","video"],repeat:["off","one","all"]},number:{device_class:["temperature"]},sensor:{device_class:["apparent_power","aqi","battery","carbon_dioxide","carbon_monoxide","current","date","duration","energy","frequency","gas","humidity","illuminance","monetary","nitrogen_dioxide","nitrogen_monoxide","nitrous_oxide","ozone","ph","pm1","pm10","pm25","pm4","power_factor","power","pressure","reactive_power","signal_strength","sulphur_dioxide","temperature","timestamp","uptime","volatile_organic_compounds","volatile_organic_compounds_parts","voltage","volume_flow_rate"],state_class:["measurement","total","total_increasing"]},switch:{device_class:["outlet","switch"]},update:{device_class:["firmware"]},water_heater:{away_mode:["on","off"]}},l=(e,t,a=void 0)=>{const l=(0,s.t)(t),d=[];switch(d.push(...((e,t,a)=>{const s=[];switch(a||s.push(i.Hh,i.HV),!a&&t in n?s.push(...n[t]):a&&t in c&&a in c[t]&&s.push(...c[t][a]),t){case"device_tracker":case"person":a||s.push(...Object.entries(e.states).filter(([e,t])=>"zone"===(0,r.m)(e)&&"zone.home"!==e&&t.attributes.friendly_name).map(([e,t])=>t.attributes.friendly_name).sort((t,a)=>(0,o.xL)(t,a,e.locale.language)))}return s})(e,l,a)),l){case"climate":a?"fan_mode"===a?d.push(...t.attributes.fan_modes):"preset_mode"===a?d.push(...t.attributes.preset_modes):"swing_mode"===a?d.push(...t.attributes.swing_modes):"swing_horizontal_mode"===a&&d.push(...t.attributes.swing_horizontal_modes):d.push(...t.attributes.hvac_modes);break;case"event":"event_type"===a&&d.push(...t.attributes.event_types);break;case"fan":"preset_mode"===a&&d.push(...t.attributes.preset_modes);break;case"humidifier":"mode"===a&&d.push(...t.attributes.available_modes);break;case"input_select":case"select":a||d.push(...t.attributes.options);break;case"light":"effect"===a&&t.attributes.effect_list?d.push(...t.attributes.effect_list):"color_mode"===a&&t.attributes.supported_color_modes&&d.push(...t.attributes.supported_color_modes);break;case"media_player":"sound_mode"===a?d.push(...t.attributes.sound_mode_list):"source"===a&&d.push(...t.attributes.source_list);break;case"remote":"current_activity"===a&&d.push(...t.attributes.activity_list);break;case"sensor":a||"enum"!==t.attributes.device_class||d.push(...t.attributes.options);break;case"vacuum":"fan_speed"===a&&d.push(...t.attributes.fan_speed_list);break;case"water_heater":a&&"operation_mode"!==a||d.push(...t.attributes.operation_list)}return[...new Set(d)]}},47129(e,t,a){a.d(t,{a:()=>r});a(74423);var i=a(22675),o=a(71727);function r(e,t){const a=(0,o.m)(e.entity_id),r=void 0!==t?t:e?.state;if(["button","event","infrared","input_button","radio_frequency","scene"].includes(a))return r!==i.Hh;if(r===i.Hh||r===i.HV)return!1;if("off"===r&&"alert"!==a)return!1;switch(a){case"alarm_control_panel":return"disarmed"!==r;case"alert":return"idle"!==r;case"cover":case"valve":return"closed"!==r;case"device_tracker":case"person":return"not_home"!==r;case"lawn_mower":return!["docked","paused"].includes(r);case"lock":return"locked"!==r;case"media_player":return"standby"!==r;case"vacuum":return!["idle","docked","paused"].includes(r);case"plant":return"problem"===r;case"group":return["on","home","open","locked","problem"].includes(r);case"timer":return"active"===r;case"camera":return"streaming"===r}return!0}},52658(e,t,a){a.d(t,{ZK:()=>u,gf:()=>h,mT:()=>m,Se:()=>d,mg:()=>p});a(44114),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);var i=a(22675),o=a(68287),r=a(86030),s=a(80880);var n=a(71727),c=a(47129);const l=new Set(["alarm_control_panel","alert","automation","binary_sensor","calendar","camera","climate","cover","device_tracker","fan","group","humidifier","input_boolean","lawn_mower","light","lock","media_player","person","plant","remote","schedule","script","siren","sun","switch","timer","update","vacuum","valve","water_heater","weather"]),d=(e,t)=>{if((void 0!==t?t:e?.state)===i.Hh)return"var(--state-unavailable-color)";const a=p(e,t);return a?(0,r.B)(a):void 0},h=(e,t,a)=>{const i=void 0!==a?a:t.state,o=(0,c.a)(t,a);return u(e,t.attributes.device_class,i,o)},u=(e,t,a,i)=>{const o=[],r=(0,s.Y)(a,"_"),n=i?"active":"inactive";return t&&o.push(`--state-${e}-${t}-${r}-color`),o.push(`--state-${e}-${r}-color`,`--state-${e}-${n}-color`,`--state-${n}-color`),o},p=(e,t)=>{const a=void 0!==t?t:e?.state,i=(0,n.m)(e.entity_id),r=e.attributes.device_class;if("sensor"===i&&"battery"===r){const e=(e=>{const t=Number(e);if(!isNaN(t))return t>=70?"--state-sensor-battery-high-color":t>=30?"--state-sensor-battery-medium-color":"--state-sensor-battery-low-color"})(a);if(e)return[e]}if("group"===i){const a=(0,o.z)(e);if(a&&l.has(a))return h(a,e,t)}if(l.has(i))return h(i,e,t)},m=e=>{if(e.attributes.brightness&&"plant"!==(0,n.m)(e.entity_id)){return`brightness(${(e.attributes.brightness+245)/5}%)`}return""}},78649(e,t,a){a.d(t,{n:()=>o});const i=/^(\w+)\.(\w+)$/,o=e=>i.test(e)},79791(e,t,a){a.d(t,{L:()=>i});const i=(e,t=2)=>Math.round(e*10**t)/10**t},80880(e,t,a){a.d(t,{Y:()=>i});const i=(e,t="_")=>{const a="àáâäæãåāăąабçćčđďдèéêëēėęěеёэфğǵгḧхîïíīįìıİийкłлḿмñńǹňнôöòóœøōõőоṕпŕřрßśšşșсťțтûüùúūǘůűųувẃẍÿýыžźżз·",i=`aaaaaaaaaaabcccdddeeeeeeeeeeefggghhiiiiiiiiijkllmmnnnnnoooooooooopprrrsssssstttuuuuuuuuuuvwxyyyzzzz${t}`,o=new RegExp(a.split("").join("|"),"g"),r={ж:"zh",х:"kh",ц:"ts",ч:"ch",ш:"sh",щ:"shch",ю:"iu",я:"ia"};let s;return""===e?s="":(s=e.toString().toLowerCase().replace(o,e=>i.charAt(a.indexOf(e))).replace(/[а-я]/g,e=>r[e]||"").replace(/(\d),(?=\d)/g,"$1").replace(/[^a-z0-9]+/g,t).replace(new RegExp(`(${t})\\1+`,"g"),"$1").replace(new RegExp(`^${t}+`),"").replace(new RegExp(`${t}+$`),""),""===s&&(s="unknown")),s}},34470(e,t,a){a.d(t,{E:()=>i});const i=a(5124).AH`ha-state-icon[data-domain=alarm_control_panel][data-state=arming],ha-state-icon[data-domain=alarm_control_panel][data-state=pending],ha-state-icon[data-domain=alarm_control_panel][data-state=triggered],ha-state-icon[data-domain=lock][data-state=jammed]{animation:pulse 1s infinite}@keyframes pulse{0%{opacity:1}50%{opacity:0}100%{opacity:1}}ha-state-icon[data-state=unavailable]{color:var(--state-unavailable-color)}`},22533(e,t,a){a.d(t,{i:()=>o});var i=a(52943);const o=(e,t)=>(e=>{switch(e){case"de":case"lb":return!0;default:return!1}})(t)?(0,i.Z)(e):e.toLocaleLowerCase(t)},67258(e,t,a){a.d(t,{d:()=>i});const i=e=>{switch(e.language){case"cs":case"de":case"fi":case"fr":case"sk":case"sv":return" ";default:return""}}},8549(e,t,a){a.d(t,{A:()=>o});var i=a(67258);const o=(e,t)=>"°"===e?"":t&&"%"===e?(0,i.d)(t):" "},51758(e,t,a){a.d(t,{Z:()=>i});const i=e=>{const t=window.location.pathname;return e?t+"?"+e:t}},63927(e,t,a){a.a(e,async function(e,i){try{a.d(t,{x:()=>h});var o=a(6946),r=a(52640),s=a(38684),n=a(380);const c=1e3,l=60,d=60*l;function h(e,t=Date.now(),a,i={}){const h={...u,...i||{}},p=(+e-+t)/c;if(Math.abs(p)<h.second)return{value:Math.round(p),unit:"second"};const m=p/l;if(Math.abs(m)<h.minute)return{value:Math.round(m),unit:"minute"};const g=p/d;if(Math.abs(g)<h.hour)return{value:Math.round(g),unit:"hour"};const b=new Date(e),_=new Date(t);b.setHours(0,0,0,0),_.setHours(0,0,0,0);const f=(0,o.c)(b,_);if(0===f)return{value:Math.round(g),unit:"hour"};if(Math.abs(f)<h.day)return{value:f,unit:"day"};const v=(0,n.P)(a),y=(0,r.k)(b,{weekStartsOn:v}),w=(0,r.k)(_,{weekStartsOn:v}),k=(0,s.I)(y,w);if(0===k)return{value:f,unit:"day"};if(Math.abs(k)<h.week)return{value:k,unit:"week"};const C=b.getFullYear()-_.getFullYear(),$=12*C+b.getMonth()-_.getMonth();return 0===$?{value:k,unit:"week"}:Math.abs($)<h.month||0===C?{value:$,unit:"month"}:{value:Math.round(C),unit:"year"}}const u={second:59,minute:59,hour:22,day:5,week:4,month:11};i()}catch(p){i(p)}})},77796(e,t,a){a.d(t,{n:()=>i});const i=(e,t,a=!0,i=!0)=>{let o,r=0;const s=(...s)=>{const n=()=>{r=!1===a?0:Date.now(),o=void 0,e(...s)},c=Date.now();r||!1!==a||(r=c);const l=t-(c-r);l<=0||l>t?(o&&(clearTimeout(o),o=void 0),r=c,e(...s)):o||!1===i||(o=window.setTimeout(n,l))};return s.cancel=()=>{clearTimeout(o),o=void 0,r=0},s}},3931(e,t,a){a.d(t,{U:()=>i});const i=async(e,t,a,i,o,...r)=>{let s=i[e];s||(s=i[e]={});const n=s[o];if(n)return n;const c=a(i,o,...r);return s[o]=c,c.then(()=>setTimeout(()=>{s[o]=void 0},t),()=>{s[o]=void 0}),c}},5745(e,t,a){var i=a(62826),o=a(99731),r=a(22441);class s extends o.Y{}s=(0,i.Cg)([(0,r.EM)("ha-chip-set")],s)},74281(e,t,a){a.a(e,async function(e,t){try{a(18111),a(7588),a(45367),a(92731);var i=a(62826),o=a(5124),r=a(22441),s=a(63672),n=a(89784),c=a(71727),l=a(69093),d=a(52658),h=a(34470),u=a(10897),p=a(38279),m=a(93367),g=e([m]);m=(g.then?(await g)():g)[0];const b="M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z";class _ extends o.WF{connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0===this.overrideImage&&(this.stateObj?.attributes.entity_picture||this.stateObj?.attributes.entity_picture_local)&&this.requestUpdate("stateObj")}disconnectedCallback(){super.disconnectedCallback(),void 0===this.overrideImage&&(this.stateObj?.attributes.entity_picture||this.stateObj?.attributes.entity_picture_local)&&(this.style.backgroundImage="")}get _stateColor(){const e=this.stateObj?(0,l.t)(this.stateObj):void 0;return this.stateColor??"light"===e}render(){const e=this.stateObj;if(!e&&!this.overrideIcon&&!this.overrideImage)return o.qy`<div class="missing"> <ha-svg-icon .path="${b}"></ha-svg-icon> </div>`;const t=this.getClass();if(t&&t.forEach((e,t)=>{e?this.classList.add(t):this.classList.remove(t)}),!this.icon)return o.s6;const a=e?(0,l.t)(e):void 0;return o.qy`<ha-state-icon style="${(0,n.W)(this._iconStyle)}" data-domain="${(0,s.J)(a)}" data-state="${(0,s.J)(e?.state)}" .icon="${this.overrideIcon}" .stateObj="${e}"></ha-state-icon>`}willUpdate(e){if(super.willUpdate(e),!(e.has("stateObj")||e.has("overrideImage")||e.has("overrideIcon")||e.has("stateColor")||e.has("color")))return;const t=this.stateObj,a={};let i="";if(this.icon=!0,t){const e=(0,c.m)(t.entity_id);if(void 0===this.overrideImage)if(!t.attributes.entity_picture_local&&!t.attributes.entity_picture||this.overrideIcon){if(this.color)a.color=this.color;else if(this._stateColor){const e=(0,d.Se)(t);if(e&&(a.color=e),t.attributes.rgb_color&&(a.color=`rgb(${t.attributes.rgb_color.join(",")})`),t.attributes.brightness){const e=t.attributes.brightness;if("number"!=typeof e){const a=`Type error: state-badge expected number, but type of ${t.entity_id}.attributes.brightness is ${typeof e} (${e})`;console.warn(a)}a.filter=(0,d.mT)(t)}if(t.attributes.hvac_action){const e=t.attributes.hvac_action;e in p.sx?a.color=(0,d.Se)(t,p.sx[e]):delete a.color}}}else{let a=t.attributes.entity_picture_local||t.attributes.entity_picture;this.hass&&(a=this.hass.hassUrl(a)),"camera"===e&&(a=(0,u.su)(a,80,80)),i=`url(${a})`,this.icon=!1}else if(this.overrideImage){let e=this.overrideImage;this.hass&&(e=this.hass.hassUrl(e)),i=`url(${e})`,this.icon=!1}}this._iconStyle=a,this.style.backgroundImage=i}getClass(){const e=new Map(["has-no-radius","has-media-image","has-image"].map(e=>[e,!1]));if(this.stateObj){const t=(0,c.m)(this.stateObj.entity_id);"update"===t?e.set("has-no-radius",!0):"media_player"===t||"camera"===t?e.set("has-media-image",!0):""!==this.style.backgroundImage&&e.set("has-image",!0)}return e}static get styles(){return[h.E,o.AH`:host{position:relative;display:inline-flex;width:40px;color:var(--state-icon-color);border-radius:var(--state-badge-border-radius,50%);height:40px;background-size:cover;box-sizing:border-box;--state-inactive-color:initial;align-items:center;justify-content:center}:host(.has-image){border-radius:var(--state-badge-with-image-border-radius,50%)}:host(.has-media-image){border-radius:var(--state-badge-with-media-image-border-radius,8%)}:host(.has-no-radius){border-radius:var(--ha-border-radius-square)}:host(:focus){outline:0}:host(:not([icon]):focus){border:2px solid var(--divider-color)}:host([icon]:focus){background:var(--divider-color)}ha-state-icon{transition:color .3s ease-in-out,filter .3s ease-in-out}.missing{color:#fce588}`]}constructor(...e){super(...e),this.icon=!0,this._iconStyle={}}}(0,i.Cg)([(0,r.MZ)({attribute:!1})],_.prototype,"stateObj",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],_.prototype,"overrideIcon",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],_.prototype,"overrideImage",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],_.prototype,"stateColor",void 0),(0,i.Cg)([(0,r.MZ)()],_.prototype,"color",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],_.prototype,"icon",void 0),(0,i.Cg)([(0,r.wk)()],_.prototype,"_iconStyle",void 0),_=(0,i.Cg)([(0,r.EM)("state-badge")],_),t()}catch(e){t(e)}})},99611(e,t,a){a.a(e,async function(e,t){try{a(18111),a(13579),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);var i=a(62826),o=a(1126),r=a(35211),s=a(5124),n=a(22441),c=a(1087),l=a(60353),d=a(22792),h=a(59992),u=a(14503),p=a(22348),m=e([o]);o=(m.then?(await m)():m)[0];const g=300,b=new Set(["ha-control-slider","ha-slider","ha-control-switch","ha-control-circular-slider","ha-hs-color-picker","ha-map","ha-more-info-control-select-container","ha-filter-chip"]),_=new Set(["volume-slider-container","forecast"]);class f extends((0,h.V)(s.WF)){get scrollableElement(){return this._bodyElement}connectedCallback(){super.connectedCallback(),this.addEventListener("slider-interaction-start",this._handleSliderInteractionStart,{capture:!0}),this.addEventListener("slider-interaction-stop",this._handleSliderInteractionStop,{capture:!0})}updated(e){super.updated(e),e.has("open")&&(this._drawerOpen=this.open)}render(){return s.qy` <wa-drawer id="drawer" placement="bottom" .open="${this._drawerOpen}" .lightDismiss="${!this.preventScrimClose}" .ariaLabelledby="${this.ariaLabelledBy}" .ariaDescribedby="${this.ariaDescribedBy}" @keydown="${this._handleKeyDown}" @wa-show="${this._handleShow}" @wa-after-show="${this._handleAfterShow}" @wa-hide="${this._handleHide}" @wa-after-hide="${this._handleAfterHide}" @click="${this._handleCloseAction}" without-header @touchstart="${this._handleTouchStart}"> <div class="handle-wrapper" aria-hidden="true"> <div class="handle"></div> </div> <slot name="header"></slot> <div class="content-wrapper"> <div id="body" class="body ha-scrollbar"> <slot></slot> </div> ${this.renderScrollableFades()} </div> <slot name="footer"></slot> </wa-drawer> `}_startResizing(e){document.addEventListener("touchmove",this._handleTouchMove,{passive:!1}),document.addEventListener("touchend",this._handleTouchEnd),document.addEventListener("touchcancel",this._handleTouchEnd),this._gestureRecognizer.start(e)}_animateSnapBack(){this.style.setProperty("--dialog-transition",`transform ${g}ms ease-out`),this.style.removeProperty("--dialog-transform"),setTimeout(()=>{this.style.removeProperty("--dialog-transition")},g)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("slider-interaction-start",this._handleSliderInteractionStart,{capture:!0}),this.removeEventListener("slider-interaction-stop",this._handleSliderInteractionStop,{capture:!0}),this._unregisterResizeHandlers(),this._isDragging=!1}static get styles(){return[...super.styles,u.dp,s.AH`wa-drawer{--wa-color-surface-raised:transparent;--spacing:0;--size:var(--ha-bottom-sheet-height, auto);--show-duration:${g}ms;--hide-duration:${g}ms}wa-drawer::part(dialog){max-height:min(var(--ha-bottom-sheet-max-height,90vh),calc(100vh - max(var(--safe-area-inset-top),48px)));max-height:min(var(--ha-bottom-sheet-max-height,90dvh),calc(100dvh - max(var(--safe-area-inset-top),48px)));align-items:center;transform:var(--dialog-transform);transition:var(--dialog-transition)}@media (prefers-reduced-motion:reduce){wa-drawer{--wa-color-surface-raised:transparent;--spacing:0;--size:var(--ha-bottom-sheet-height, auto);--show-duration:1ms;--hide-duration:1ms}wa-drawer::part(dialog){transition:1ms}}wa-drawer::part(dialog)::backdrop{-webkit-backdrop-filter:var(--ha-bottom-sheet-scrim-backdrop-filter,var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none)));backdrop-filter:var(--ha-bottom-sheet-scrim-backdrop-filter,var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none)));background-color:var(--ha-bottom-sheet-scrim-color,var(--mdc-dialog-scrim-color,none))}wa-drawer::part(body){max-width:var(--ha-bottom-sheet-max-width);width:100%;position:relative;border-top-left-radius:var(--ha-bottom-sheet-border-radius,var(--ha-dialog-border-radius,var(--ha-border-radius-2xl)));border-top-right-radius:var(--ha-bottom-sheet-border-radius,var(--ha-dialog-border-radius,var(--ha-border-radius-2xl)));background-color:var(--ha-bottom-sheet-surface-background,var(--ha-dialog-surface-background,var(--card-background-color,var(--ha-color-surface-default))));-webkit-backdrop-filter:var(--ha-bottom-sheet-surface-backdrop-filter,var(--ha-dialog-surface-backdrop-filter,none));backdrop-filter:var(--ha-bottom-sheet-surface-backdrop-filter,var(--ha-dialog-surface-backdrop-filter,none));padding:var(--ha-bottom-sheet-padding,0 var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left))}:host([flexcontent]) wa-drawer::part(body){display:flex;flex-direction:column}:host([prevent-scrim-close]) .handle-wrapper{display:none}.handle-wrapper{position:absolute;top:0;inset-inline-start:0;width:100%;padding-bottom:2px;display:flex;justify-content:center;align-items:center;pointer-events:none;z-index:1}.handle-wrapper .handle{height:16px;width:200px;display:flex;justify-content:center;align-items:center}.handle-wrapper .handle::after{content:"";border-radius:var(--ha-border-radius-md);height:4px;background:var(--ha-bottom-sheet-handle-color,var(--divider-color));width:40px}.content-wrapper{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.body{padding:var(--ha-bottom-sheet-content-padding,0);box-sizing:border-box}:host([flexcontent]) .body{flex:1;max-width:100%;display:flex;flex-direction:column;padding:var(--ha-bottom-sheet-content-padding,var(--ha-bottom-sheet-padding,0 var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left)));box-sizing:border-box}slot[name=footer]{display:block;padding:0}::slotted([slot=footer]){display:flex;padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4) var(--ha-space-4);gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%;box-sizing:border-box}:host([flexcontent]) slot[name=footer]{flex-shrink:0}`]}constructor(...e){super(...e),this.open=!1,this.flexContent=!1,this.preventScrimClose=!1,this._drawerOpen=!1,this._sliderInteractionActive=!1,this._gestureRecognizer=new l.u,this._isDragging=!1,this._escapePressed=!1,this._handleShow=async()=>{this._drawerOpen=!0,this.open=!0,(0,c.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{const e=this._autofocusElement;this._hassConfig?.auth.external&&(0,p.V)(this._hassConfig.auth.external)?e&&(e.id||(e.id="ha-bottom-sheet-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:e.id}})):e?.focus()})},this._handleAfterShow=()=>{(0,c.r)(this,"after-show")},this._handleSliderInteractionStart=()=>{this._sliderInteractionActive=!0},this._handleSliderInteractionStop=()=>{this._sliderInteractionActive=!1},this._handleAfterHide=e=>{if(this._sliderInteractionActive)return this._drawerOpen=!0,void(this.open=!0);e.eventPhase===Event.AT_TARGET&&(this.open=!1,this._drawerOpen=!1,(0,c.r)(this,"closed"))},this._handleHide=e=>{if(e.eventPhase!==Event.AT_TARGET)return;const t=e.detail.source===e.target.drawer;if(this._sliderInteractionActive)return e.preventDefault(),this._drawerOpen=!0,this.open=!0,void(this._escapePressed=!1);this.preventScrimClose&&this._escapePressed&&t&&e.preventDefault(),this._escapePressed=!1},this._handleKeyDown=e=>{"Escape"===e.key&&(this._escapePressed=!0,this.preventScrimClose&&e.preventDefault(),e.stopPropagation(),e.currentTarget.open=!1)},this._handleCloseAction=e=>{e.composedPath().some(e=>e instanceof HTMLElement&&("close"===e.getAttribute("data-dialog")||"close"===e.getAttribute("data-drawer")))&&(this._drawerOpen=!1)},this._handleTouchStart=e=>{if(this.preventScrimClose)return;const t=e.composedPath();for(const e of t){if(e===this._drawer)break;if(e instanceof HTMLElement&&(e.scrollTop>0||b.has(e.localName)||Array.from(e.classList).some(e=>_.has(e))))return}e.stopPropagation(),this._startResizing(e.touches[0].clientY)},this._handleTouchMove=e=>{const t=e.touches[0].clientY,a=this._gestureRecognizer.move(t);a<0&&(e.preventDefault(),this._isDragging=!0,requestAnimationFrame(()=>{this._isDragging&&this.style.setProperty("--dialog-transform",`translateY(${-1*a}px)`)}))},this._handleTouchEnd=()=>{this._unregisterResizeHandlers(),this._isDragging=!1;const e=this._gestureRecognizer.end();if(e.isSwipe)return void(e.isDownwardSwipe?this._drawerOpen=!1:this._animateSnapBack());const t=this._drawer.shadowRoot?.querySelector('[part="body"]'),a=t?.offsetHeight||0;a>0&&e.delta<0&&Math.abs(e.delta)>.5*a?this._drawerOpen=!1:this._animateSnapBack()},this._unregisterResizeHandlers=()=>{document.removeEventListener("touchmove",this._handleTouchMove),document.removeEventListener("touchend",this._handleTouchEnd),document.removeEventListener("touchcancel",this._handleTouchEnd)}}}(0,i.Cg)([(0,n.MZ)({attribute:"aria-labelledby"})],f.prototype,"ariaLabelledBy",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"aria-describedby"})],f.prototype,"ariaDescribedBy",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],f.prototype,"open",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],f.prototype,"flexContent",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],f.prototype,"preventScrimClose",void 0),(0,i.Cg)([(0,n.wk)()],f.prototype,"_drawerOpen",void 0),(0,i.Cg)([(0,n.wk)()],f.prototype,"_sliderInteractionActive",void 0),(0,i.Cg)([(0,n.wk)(),(0,r.Fg)({context:d.WF,subscribe:!0})],f.prototype,"_hassConfig",void 0),(0,i.Cg)([(0,n.P)("#drawer")],f.prototype,"_drawer",void 0),(0,i.Cg)([(0,n.P)("#body")],f.prototype,"_bodyElement",void 0),(0,i.Cg)([(0,n.P)("[autofocus]")],f.prototype,"_autofocusElement",void 0),f=(0,i.Cg)([(0,n.EM)("ha-bottom-sheet")],f),t()}catch(e){t(e)}})},59174(e,t,a){a.a(e,async function(e,t){try{var i=a(62826),o=a(35211),r=a(5124),s=a(22441),n=a(91450),c=a(22792),l=a(85694),d=a(44144),h=(a(47680),e([l]));l=(h.then?(await h)():h)[0];class u extends r.WF{render(){if(this.icon)return r.qy`<ha-icon .icon="${this.icon}"></ha-icon>`;if(!this.domain)return r.s6;if(!this._connection||!this._hassConfig)return this._renderFallback();const e=(0,l._4)(this._connection.connection,this._hassConfig.config,this.domain,this.deviceClass,this.state).then(e=>e?r.qy`<ha-icon .icon="${e}"></ha-icon>`:this._renderFallback());return r.qy`${(0,n.T)(e)}`}_renderFallback(){if(this.domain&&this.domain in l.l)return r.qy` <ha-svg-icon .path="${l.l[this.domain]}"></ha-svg-icon> `;if(this.brandFallback){const e=(0,d.MR)({domain:this.domain,type:"icon",darkOptimized:this._hassUi?.themes.darkMode},this._hassConfig?.auth.data.hassUrl);return r.qy` <img alt="" src="${e}" crossorigin="anonymous" referrerpolicy="no-referrer"> `}return r.qy`<ha-svg-icon .path="${l.lW}"></ha-svg-icon>`}}u.styles=r.AH`img{width:var(--mdc-icon-size,24px)}`,(0,i.Cg)([(0,s.MZ)()],u.prototype,"domain",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],u.prototype,"deviceClass",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],u.prototype,"state",void 0),(0,i.Cg)([(0,s.MZ)()],u.prototype,"icon",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"brand-fallback",type:Boolean})],u.prototype,"brandFallback",void 0),(0,i.Cg)([(0,s.wk)(),(0,o.Fg)({context:c.WF,subscribe:!0})],u.prototype,"_hassConfig",void 0),(0,i.Cg)([(0,s.wk)(),(0,o.Fg)({context:c.Wq,subscribe:!0})],u.prototype,"_connection",void 0),(0,i.Cg)([(0,s.wk)(),(0,o.Fg)({context:c.EK,subscribe:!0})],u.prototype,"_hassUi",void 0),u=(0,i.Cg)([(0,s.EM)("ha-domain-icon")],u),t()}catch(e){t(e)}})},11382(e,t,a){var i=a(62826),o=a(5124),r=a(22441),s=a(6412),n=a(1087),c=a(12587);a(67094);class l extends o.WF{render(){const e=this.noCollapse?o.s6:o.qy` <ha-svg-icon .path="${"M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"}" class="summary-icon ${(0,s.H)({expanded:this.expanded})}"></ha-svg-icon> `;return o.qy` <div class="top ${(0,s.H)({expanded:this.expanded})}"> <div id="summary" class="${(0,s.H)({noCollapse:this.noCollapse})}" @click="${this._toggleContainer}" @keydown="${this._toggleContainer}" @focus="${this._focusChanged}" @blur="${this._focusChanged}" role="button" tabindex="${this.noCollapse?-1:0}" aria-expanded="${this.expanded}" aria-controls="sect1" part="summary"> ${this.leftChevron?e:o.s6} <slot name="leading-icon"></slot> <slot name="header"> <div class="header"> ${this.header} <slot class="secondary" name="secondary">${this.secondary}</slot> </div> </slot> <slot name="event"></slot> ${this.leftChevron?o.s6:e} <slot name="icons"></slot> </div> </div> <div class="container ${(0,s.H)({expanded:this.expanded})}" @transitionend="${this._handleTransitionEnd}" role="region" aria-labelledby="summary" aria-hidden="${!this.expanded}" tabindex="-1"> ${this._showContent?o.qy`<slot></slot>`:""} </div> `}willUpdate(e){super.willUpdate(e),e.has("expanded")&&(this._showContent=this.expanded,setTimeout(()=>{this._container.style.overflow=this.expanded?"initial":"hidden"},300))}_handleTransitionEnd(){this._container.style.removeProperty("height"),this._container.style.overflow=this.expanded?"initial":"hidden",this._showContent=this.expanded}async _toggleContainer(e){if(e.defaultPrevented)return;if("keydown"===e.type&&"Enter"!==e.key&&" "!==e.key)return;if(e.preventDefault(),this.noCollapse)return;const t=!this.expanded;(0,n.r)(this,"expanded-will-change",{expanded:t}),this._container.style.overflow="hidden",t&&(this._showContent=!0,await(0,c.E)());const a=this._container.scrollHeight;this._container.style.height=`${a}px`,t||setTimeout(()=>{this._container.style.height="0px"},0),this.expanded=t,(0,n.r)(this,"expanded-changed",{expanded:this.expanded})}_focusChanged(e){this.noCollapse||this.shadowRoot.querySelector(".top").classList.toggle("focused","focus"===e.type)}constructor(...e){super(...e),this.expanded=!1,this.outlined=!1,this.leftChevron=!1,this.noCollapse=!1,this._showContent=this.expanded}}l.styles=o.AH`:host{display:block}.top{display:flex;align-items:center;border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg))}.top.expanded{border-bottom-left-radius:0px;border-bottom-right-radius:0px}.top.focused{background:var(--input-fill-color)}:host([outlined]){box-shadow:none;border-width:1px;border-style:solid;border-color:var(--outline-color);border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg))}.summary-icon{transition:transform 150ms cubic-bezier(.4, 0, .2, 1);direction:var(--direction);margin-left:8px;margin-inline-start:8px;margin-inline-end:initial;border-radius:var(--ha-border-radius-circle)}#summary:focus-visible ha-svg-icon.summary-icon{background-color:var(--ha-color-fill-neutral-normal-active)}::slotted([slot=leading-icon]),:host([left-chevron]) .summary-icon{margin-left:0;margin-right:8px;margin-inline-start:0;margin-inline-end:8px}#summary{flex:1;display:flex;padding:var(--expansion-panel-summary-padding,0 8px);min-height:48px;align-items:center;cursor:pointer;overflow:hidden;font-weight:var(--ha-font-weight-medium);outline:0}#summary.noCollapse{cursor:default}.summary-icon.expanded{transform:rotate(180deg)}.header,::slotted([slot=header]){flex:1;overflow-wrap:anywhere;color:var(--primary-text-color)}.container{padding:var(--expansion-panel-content-padding,0 8px);overflow:hidden;transition:height .3s cubic-bezier(.4, 0, .2, 1);height:0px}.container.expanded{height:auto}.secondary{display:block;color:var(--secondary-text-color);font-size:var(--ha-font-size-s)}`,(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],l.prototype,"expanded",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],l.prototype,"outlined",void 0),(0,i.Cg)([(0,r.MZ)({attribute:"left-chevron",type:Boolean,reflect:!0})],l.prototype,"leftChevron",void 0),(0,i.Cg)([(0,r.MZ)({attribute:"no-collapse",type:Boolean,reflect:!0})],l.prototype,"noCollapse",void 0),(0,i.Cg)([(0,r.MZ)()],l.prototype,"header",void 0),(0,i.Cg)([(0,r.MZ)()],l.prototype,"secondary",void 0),(0,i.Cg)([(0,r.wk)()],l.prototype,"_showContent",void 0),(0,i.Cg)([(0,r.P)(".container")],l.prototype,"_container",void 0),l=(0,i.Cg)([(0,r.EM)("ha-expansion-panel")],l)},38508(e,t,a){a.a(e,async function(e,t){try{a(18111),a(13579);var i=a(62826),o=a(61366),r=a(35211),s=a(5124),n=a(22441),c=a(63672),l=a(91335),d=a(1087),h=a(22792),u=a(17894),p=a(22348),m=a(99611),g=a(18350),b=(a(75064),a(3449),a(49639)),_=a(88285),f=(a(67094),e([o,m,g,b,_]));[o,m,g,b,_]=f.then?(await f)():f;const v="M3 16H10V14H3M18 14V10H16V14H12V16H16V20H18V16H22V14M14 6H3V8H14M14 10H3V12H14V10Z";class y extends((0,u.c)(s.WF)){willUpdate(e){e.has("value")&&this._setUnknownValue()}setFieldValue(e){this._comboBox?this._comboBox.setFieldValue(e):this._initialFieldValue=e}render(){const e=this.useTopLabel&&this.value?void 0:this.label;return s.qy`<div class="container"> ${this.useTopLabel&&this.label?s.qy`<label ?disabled="${this.disabled}">${this.label}</label>`:s.s6} <div id="picker"> <slot name="field"> ${this.addButtonLabel&&!this.value?s.qy`<ha-button size="small" appearance="filled" @click="${this.open}" .disabled="${this.disabled}"> <ha-svg-icon .path="${v}" slot="start"></ha-svg-icon> ${this.addButtonLabel} </ha-button>`:s.qy`<ha-picker-field type="button" class="${this._opened?"opened":""}" compact="compact" .unknown="${this._unknownValue}" .unknownItemText="${this.unknownItemText}" aria-label="${(0,c.J)(this.label)}" @click="${this.open}" @clear="${this._clear}" .icon="${this.icon}" .image="${this.image}" .label="${e}" .placeholder="${this.placeholder}" .value="${this.value}" .valueRenderer="${this.valueRenderer}" .required="${this.required}" .disabled="${this.disabled}" .invalid="${this.invalid}" .hideClearIcon="${this.hideClearIcon}"> <slot name="start"></slot> </ha-picker-field>`} </slot> </div> ${this._pickerWrapperOpen||this._opened?this._openedNarrow?s.qy` <ha-bottom-sheet flexcontent .open="${this._pickerWrapperOpen}" @wa-after-show="${this._dialogOpened}" @closed="${this._hidePicker}" role="dialog" aria-modal="true" aria-label="${this.label||"Select option"}"> ${this._renderComboBox(!0)} </ha-bottom-sheet> `:s.qy` <wa-popover .open="${this._pickerWrapperOpen}" style="--body-width:${this._popoverWidth}px" without-arrow distance="-4" .placement="${this.popoverPlacement}" .for="${this.popoverAnchor?null:"picker"}" .anchor="${this.popoverAnchor??null}" auto-size="vertical" auto-size-padding="16" @wa-after-show="${this._dialogOpened}" @wa-after-hide="${this._hidePicker}" trap-focus role="dialog" aria-modal="true" aria-label="${this.label||"Select option"}"> ${this._renderComboBox()} </wa-popover> `:s.s6} </div> ${this._renderHelper()}`}_renderComboBox(e=!1){return this._opened?s.qy` <ha-picker-combo-box id="combo-box" .allowCustomValue="${this.allowCustomValue}" .label="${this.searchLabel}" .value="${this._selectedValue??this.value}" @value-changed="${this._valueChanged}" .rowRenderer="${this.rowRenderer}" .notFoundLabel="${this.notFoundLabel}" .emptyLabel="${this.emptyLabel}" .getItems="${this.getItems}" .getAdditionalItems="${this.getAdditionalItems}" .searchFn="${this.searchFn}" .mode="${e?"dialog":"popover"}" .sections="${this.sections}" .sectionTitleFunction="${this.sectionTitleFunction}" .selectedSection="${this.selectedSection}" .searchKeys="${this.searchKeys}" .customValueLabel="${this.customValueLabel}" .noSort="${this.noSort}"></ha-picker-combo-box> `:s.s6}_renderHelper(){const e=this.invalid&&this.errorMessage,t=!e&&this.helper;return e||t?s.qy`<ha-input-helper-text .disabled="${this.disabled}"> ${e?this.errorMessage:this.helper} </ha-input-helper-text>`:s.s6}refreshItems(){this._comboBox?.refreshItems()}_hidePicker(e){e.stopPropagation(),this._newValue&&((0,d.r)(this,"value-changed",{value:this._newValue}),this._newValue=void 0),this._opened=!1,this._pickerWrapperOpen=!1,this._selectedValue=void 0,this._unsubscribeTinyKeys?.(),(0,d.r)(this,"picker-closed")}_valueChanged(e){e.stopPropagation();const t=e.detail.value;t&&(this._pickerWrapperOpen=!1,this._newValue=t)}_clear(e){e.stopPropagation(),this._setValue(void 0)}_setValue(e){this.value=e,(0,d.r)(this,"value-changed",{value:e})}async open(e,t){e?.stopPropagation(),this.disabled||(this._selectedValue=t?.selectedValue,this._openedNarrow=this._narrow,this._popoverWidth=this._containerElement?.offsetWidth||250,this._pickerWrapperOpen=!0,this._unsubscribeTinyKeys=(0,l.Tc)(this,{Escape:this._handleEscClose}))}connectedCallback(){super.connectedCallback(),this._handleResize(),window.addEventListener("resize",this._handleResize)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this._handleResize),this._unsubscribeTinyKeys?.()}static get styles(){return[s.AH`.container{position:relative;display:block;max-width:100%}label[disabled]{color:var(--mdc-text-field-disabled-ink-color,rgba(0,0,0,.6))}label{display:block;margin:0 0 8px}ha-input-helper-text{display:block;margin:var(--ha-space-2) 0 0}:host([invalid]) ha-input-helper-text{color:var(--mdc-theme-error,var(--error-color,#b00020))}wa-popover{--wa-space-l:0}wa-popover::part(dialog)::backdrop{background:0 0}wa-popover::part(body){width:var(--ha-generic-picker-width,max(var(--body-width),250px));max-width:var(--ha-generic-picker-max-width,var(--ha-generic-picker-width,max(var(--body-width),250px)));max-height:500px;height:70vh;overflow:hidden}@media (max-height:1000px){wa-popover::part(body){max-height:400px}}ha-bottom-sheet{--ha-bottom-sheet-height:90vh;--ha-bottom-sheet-height:calc(100dvh - var(--ha-space-12));--ha-bottom-sheet-max-height:var(--ha-bottom-sheet-height);--ha-bottom-sheet-max-width:600px;--ha-bottom-sheet-padding:0;--ha-bottom-sheet-surface-background:var(--card-background-color);--ha-bottom-sheet-border-radius:var(--ha-border-radius-2xl);--ha-bottom-sheet-content-padding:0 var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left)}ha-picker-field.opened{--mdc-text-field-idle-line-color:var(--primary-color)}`]}constructor(...e){super(...e),this.popoverPlacement="bottom",this.useTopLabel=!1,this.noSort=!1,this._opened=!1,this._pickerWrapperOpen=!1,this._popoverWidth=0,this._openedNarrow=!1,this._unknownValue=!1,this._narrow=!1,this.invalid=!1,this._setUnknownValue=()=>{const e=this.getItems();!this.allowCustomValue&&void 0!==this.value&&null!==this.value&&""!==this.value&&e?this._unknownValue=!e.some(e=>"string"!=typeof e&&e.id===this.value):this._unknownValue=!1},this._dialogOpened=()=>{this._opened=!0,(0,d.r)(this,"picker-opened"),requestAnimationFrame(()=>{this._initialFieldValue&&(this._comboBox?.setFieldValue(this._initialFieldValue),this._initialFieldValue=void 0),this._hassConfig?.auth.external&&(0,p.V)(this._hassConfig.auth.external)?this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:"combo-box"}}):this._comboBox?.focus()})},this._handleResize=()=>{this._narrow=window.matchMedia("(max-width: 870px)").matches||window.matchMedia("(max-height: 500px)").matches,!this._openedNarrow&&this._pickerWrapperOpen&&(this._popoverWidth=this._containerElement?.offsetWidth||250)},this._handleEscClose=e=>{e.stopPropagation()}}}y.shadowRootOptions={...s.WF.shadowRootOptions,delegatesFocus:!0},(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"allow-custom-value"})],y.prototype,"allowCustomValue",void 0),(0,i.Cg)([(0,n.MZ)({type:String,attribute:"search-label"})],y.prototype,"searchLabel",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"getItems",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"getAdditionalItems",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"rowRenderer",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"searchFn",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"searchKeys",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"notFoundLabel",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"empty-label"})],y.prototype,"emptyLabel",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"popover-placement"})],y.prototype,"popoverPlacement",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"add-button-label"})],y.prototype,"addButtonLabel",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"sections",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"sectionTitleFunction",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"selected-section"})],y.prototype,"selectedSection",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"popoverAnchor",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"use-top-label"})],y.prototype,"useTopLabel",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"custom-value-label"})],y.prototype,"customValueLabel",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"no-sort"})],y.prototype,"noSort",void 0),(0,i.Cg)([(0,n.P)(".container")],y.prototype,"_containerElement",void 0),(0,i.Cg)([(0,n.P)("ha-picker-combo-box")],y.prototype,"_comboBox",void 0),(0,i.Cg)([(0,n.wk)(),(0,r.Fg)({context:h.WF,subscribe:!0})],y.prototype,"_hassConfig",void 0),(0,i.Cg)([(0,n.wk)()],y.prototype,"_opened",void 0),(0,i.Cg)([(0,n.wk)()],y.prototype,"_pickerWrapperOpen",void 0),(0,i.Cg)([(0,n.wk)()],y.prototype,"_popoverWidth",void 0),(0,i.Cg)([(0,n.wk)()],y.prototype,"_openedNarrow",void 0),(0,i.Cg)([(0,n.wk)()],y.prototype,"_unknownValue",void 0),(0,i.Cg)([(0,n.wk)()],y.prototype,"_selectedValue",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"error-message"})],y.prototype,"errorMessage",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],y.prototype,"invalid",void 0),y=(0,i.Cg)([(0,n.EM)("ha-generic-picker")],y),t()}catch(e){t(e)}})},90248(e,t,a){a.a(e,async function(e,i){try{a.r(t),a.d(t,{HaIconButtonArrowPrev:()=>u});var o=a(62826),r=a(5124),s=a(22441),n=a(63091),c=a(26300),l=e([c]);c=(l.then?(await l)():l)[0];const d="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",h="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z";class u extends r.WF{render(){return r.qy` <ha-icon-button .disabled="${this.disabled}" .label="${this.label||this.hass?.localize("ui.common.back")||"Back"}" .path="${this._icon}" .href="${this.href}" .target="${this.target}" .rel="${this.rel}" .download="${this.download}"></ha-icon-button> `}constructor(...e){super(...e),this.disabled=!1,this._icon="rtl"===n.G.document.dir?h:d}}(0,o.Cg)([(0,s.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],u.prototype,"disabled",void 0),(0,o.Cg)([(0,s.MZ)()],u.prototype,"label",void 0),(0,o.Cg)([(0,s.MZ)()],u.prototype,"href",void 0),(0,o.Cg)([(0,s.MZ)()],u.prototype,"target",void 0),(0,o.Cg)([(0,s.MZ)()],u.prototype,"rel",void 0),(0,o.Cg)([(0,s.MZ)()],u.prototype,"download",void 0),(0,o.Cg)([(0,s.wk)()],u.prototype,"_icon",void 0),u=(0,o.Cg)([(0,s.EM)("ha-icon-button-arrow-prev")],u),i()}catch(e){i(e)}})},43661(e,t,a){a.r(t),a.d(t,{HaIconNext:()=>n});var i=a(62826),o=a(22441),r=a(63091),s=a(67094);class n extends s.HaSvgIcon{constructor(...e){super(...e),this.path="rtl"===r.G.document.dir?"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z":"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"}}(0,i.Cg)([(0,o.MZ)()],n.prototype,"path",void 0),n=(0,i.Cg)([(0,o.EM)("ha-icon-next")],n)},47680(e,t,a){a.r(t),a.d(t,{HaIcon:()=>k});a(74423);var i=a(62826),o=a(5124),r=a(22441),s=a(1087),n=a(9899),c=a(700),l=(a(44114),a(18111),a(7588),a(95192)),d=a(7553);const h=JSON.parse('{"version":"7.4.47","parts":[{"file":"7a7139d465f1f41cb26ab851a17caa21a9331234"},{"start":"account-supervisor-circle-","file":"9561286c4c1021d46b9006596812178190a7cc1c"},{"start":"alpha-r-c","file":"eb466b7087fb2b4d23376ea9bc86693c45c500fa"},{"start":"arrow-decision-o","file":"4b3c01b7e0723b702940c5ac46fb9e555646972b"},{"start":"baby-f","file":"2611401d85450b95ab448ad1d02c1a432b409ed2"},{"start":"battery-hi","file":"89bcd31855b34cd9d31ac693fb073277e74f1f6a"},{"start":"blur-r","file":"373709cd5d7e688c2addc9a6c5d26c2d57c02c48"},{"start":"briefcase-account-","file":"a75956cf812ee90ee4f656274426aafac81e1053"},{"start":"calendar-question-","file":"3253f2529b5ebdd110b411917bacfacb5b7063e6"},{"start":"car-lig","file":"74566af3501ad6ae58ad13a8b6921b3cc2ef879d"},{"start":"cellphone-co","file":"7677f1cfb2dd4f5562a2aa6d3ae43a2e6997b21a"},{"start":"circle-slice-2","file":"70d08c50ec4522dd75d11338db57846588263ee2"},{"start":"cloud-co","file":"141d2bfa55ca4c83f4bae2812a5da59a84fec4ff"},{"start":"cog-s","file":"5a640365f8e47c609005d5e098e0e8104286d120"},{"start":"cookie-l","file":"dd85b8eb8581b176d3acf75d1bd82e61ca1ba2fc"},{"start":"currency-eur-","file":"15362279f4ebfc3620ae55f79d2830ad86d5213e"},{"start":"delete-o","file":"239434ab8df61237277d7599ebe066c55806c274"},{"start":"draw-","file":"5605918a592070803ba2ad05a5aba06263da0d70"},{"start":"emoticon-po","file":"a838cfcec34323946237a9f18e66945f55260f78"},{"start":"fan","file":"effd56103b37a8c7f332e22de8e4d67a69b70db7"},{"start":"file-question-","file":"b2424b50bd465ae192593f1c3d086c5eec893af8"},{"start":"flask-off-","file":"3b76295cde006a18f0301dd98eed8c57e1d5a425"},{"start":"food-s","file":"1c6941474cbeb1755faaaf5771440577f4f1f9c6"},{"start":"gamepad-u","file":"c6efe18db6bc9654ae3540c7dee83218a5450263"},{"start":"google-f","file":"df341afe6ad4437457cf188499cb8d2df8ac7b9e"},{"start":"head-c","file":"282121c9e45ed67f033edcc1eafd279334c00f46"},{"start":"home-pl","file":"27e8e38fc7adcacf2a210802f27d841b49c8c508"},{"start":"inbox-","file":"0f0316ec7b1b7f7ce3eaabce26c9ef619b5a1694"},{"start":"key-v","file":"ea33462be7b953ff1eafc5dac2d166b210685a60"},{"start":"leaf-circle-","file":"33db9bbd66ce48a2db3e987fdbd37fb0482145a4"},{"start":"lock-p","file":"b89e27ed39e9d10c44259362a4b57f3c579d3ec8"},{"start":"message-s","file":"7b5ab5a5cadbe06e3113ec148f044aa701eac53a"},{"start":"moti","file":"01024d78c248d36805b565e343dd98033cc3bcaf"},{"start":"newspaper-variant-o","file":"22a6ec4a4fdd0a7c0acaf805f6127b38723c9189"},{"start":"on","file":"c73d55b412f394e64632e2011a59aa05e5a1f50d"},{"start":"paw-ou","file":"3f669bf26d16752dc4a9ea349492df93a13dcfbf"},{"start":"pigg","file":"0c24edb27eb1c90b6e33fc05f34ef3118fa94256"},{"start":"printer-pos-sy","file":"41a55cda866f90b99a64395c3bb18c14983dcf0a"},{"start":"read","file":"c7ed91552a3a64c9be88c85e807404cf705b7edf"},{"start":"robot-vacuum-variant-o","file":"917d2a35d7268c0ea9ad9ecab2778060e19d90e0"},{"start":"sees","file":"6e82d9861d8fac30102bafa212021b819f303bdb"},{"start":"shoe-f","file":"e2fe7ce02b5472301418cc90a0e631f187b9f238"},{"start":"snowflake-m","file":"a28ba9f5309090c8b49a27ca20ff582a944f6e71"},{"start":"st","file":"7e92d03f095ec27e137b708b879dfd273bd735ab"},{"start":"su","file":"61c74913720f9de59a379bdca37f1d2f0dc1f9db"},{"start":"tag-plus-","file":"8f3184156a4f38549cf4c4fffba73a6a941166ae"},{"start":"timer-a","file":"baab470d11cfb3a3cd3b063ee6503a77d12a80d0"},{"start":"transit-d","file":"8561c0d9b1ac03fab360fd8fe9729c96e8693239"},{"start":"vector-arrange-b","file":"c9a3439257d4bab33d3355f1f2e11842e8171141"},{"start":"water-ou","file":"02dbccfb8ca35f39b99f5a085b095fc1275005a0"},{"start":"webc","file":"57bafd4b97341f4f2ac20a609d023719f23a619c"},{"start":"zip","file":"65ae094e8263236fa50486584a08c03497a38d93"}]}');let u;const p=()=>(u||(u=m().catch(e=>{throw u=void 0,e})),u),m=async()=>{const e=(0,l.y$)("hass-icon-db","mdi-icon-store"),t=await(0,l.Jt)("_version",e);return t?t!==h.version&&(await(0,l.IU)(e),(0,l.hZ)("_version",h.version,e)):(0,l.hZ)("_version",h.version,e),e},g=["mdi","hass","hassio","hademo"];let b=[];a(67094);const _={},f={},v=(0,n.s)(()=>(async e=>{const t=Object.keys(e),a=await Promise.allSettled(Object.values(e));(await p())("readwrite",i=>{a.forEach((a,o)=>{"fulfilled"===a.status&&Object.entries(a.value).forEach(([e,t])=>{i.put(t,e)}),delete e[t[o]]})})})(f),2e3),y={},w={"home-assistant":()=>a.e(58781).then(a.bind(a,53580)).then(e=>e.mdiHomeAssistant),"music-assistant":()=>a.e(56009).then(a.bind(a,10576)).then(e=>e.mdiMusicAssistant),esphome:()=>a.e(88800).then(a.bind(a,45091)).then(e=>e.mdiEsphomeLogo)};class k extends o.WF{willUpdate(e){super.willUpdate(e),e.has("icon")&&(this._path=void 0,this._secondaryPath=void 0,this._viewBox=void 0,this._loadIcon())}render(){return this.icon?this._legacy?o.qy` <iron-icon .icon="${this.icon}"></iron-icon>`:o.qy`<ha-svg-icon .path="${this._path}" .secondaryPath="${this._secondaryPath}" .viewBox="${this._viewBox}"></ha-svg-icon>`:o.s6}async _loadIcon(){if(!this.icon)return;const e=this.icon,[t,a]=this.icon.split(":",2);let i,o=a;if(!t||!o)return;if(!g.includes(t)){const a=c.y[t];return a?void(a&&"function"==typeof a.getIcon&&this._setCustomPath(a.getIcon(o),e)):void(this._legacy=!0)}if(this._legacy=!1,o in _){const e=_[o];let a;e.newName?(a=`Icon ${t}:${o} was renamed to ${t}:${e.newName}, please change your config, it will be removed in version ${e.removeIn}.`,o=e.newName):a=`Icon ${t}:${o} was removed from MDI, please replace this icon with an other icon in your config, it will be removed in version ${e.removeIn}.`,console.warn(a),(0,s.r)(this,"write_log",{level:"warning",message:a})}if(o in y)return void(this._path=y[o]);if(o in w){const t=await w[o]();return this.icon===e&&(this._path=t),void(y[o]=t)}try{i=await(e=>new Promise((t,a)=>{if(b.push([e,t,a]),b.length>1)return;const i=p();(0,d.h)(1e3,(async()=>{(await i)("readonly",e=>{for(const[t,a,i]of b)(0,l.Yd)(e.get(t)).then(e=>a(e)).catch(e=>i(e));b=[]})})()).catch(e=>{for(const[,,t]of b)t(e);b=[]})}))(o)}catch(e){i=void 0}if(i)return this.icon===e&&(this._path=i),void(y[o]=i);const r=(e=>{let t;for(const a of h.parts){if(void 0!==a.start&&e<a.start)break;t=a}return t.file})(o);if(r in f)return void this._setPath(f[r],o,e);const n=fetch(`/static/mdi/${r}.json`).then(e=>e.json());f[r]=n,this._setPath(n,o,e),n.catch(()=>{delete f[r]}),v()}async _setCustomPath(e,t){const a=await e;this.icon===t&&(this._path=a.path,this._secondaryPath=a.secondaryPath,this._viewBox=a.viewBox)}async _setPath(e,t,a){try{const i=await e;this.icon===a&&(this._path=i[t]),y[t]=i[t]}catch(e){}}constructor(...e){super(...e),this._legacy=!1}}k.styles=o.AH`:host{fill:currentcolor}`,(0,i.Cg)([(0,r.MZ)()],k.prototype,"icon",void 0),(0,i.Cg)([(0,r.wk)()],k.prototype,"_path",void 0),(0,i.Cg)([(0,r.wk)()],k.prototype,"_secondaryPath",void 0),(0,i.Cg)([(0,r.wk)()],k.prototype,"_viewBox",void 0),(0,i.Cg)([(0,r.wk)()],k.prototype,"_legacy",void 0),k=(0,i.Cg)([(0,r.EM)("ha-icon")],k)},3449(e,t,a){var i=a(62826),o=a(5124),r=a(22441);class s extends o.WF{render(){return o.qy`<slot></slot>`}constructor(...e){super(...e),this.disabled=!1}}s.styles=o.AH`:host{display:block;color:var(--mdc-text-field-label-ink-color,rgba(0,0,0,.6));font-size:var(--ha-font-size-s);padding-left:16px;padding-right:16px;padding-inline-start:16px;padding-inline-end:16px;letter-spacing:var(
        --mdc-typography-caption-letter-spacing,
        .0333333333em
      );line-height:normal}:host([disabled]){color:var(--mdc-text-field-disabled-ink-color,rgba(0,0,0,.6))}`,(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],s.prototype,"disabled",void 0),s=(0,i.Cg)([(0,r.EM)("ha-input-helper-text")],s)},88285(e,t,a){a.a(e,async function(e,t){try{var i=a(62826),o=a(35211),r=a(5124),s=a(22441),n=a(63672),c=a(1087),l=a(22792),d=a(17894),h=(a(75064),a(47680),a(26300)),u=e([h]);h=(u.then?(await u)():u)[0];const p="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",m="M7,10L12,15L17,10H7Z";class g extends((0,d.c)(r.WF)){async focus(){await this.updateComplete,await(this.item?.focus())}render(){const e=!!this.value,t=!(!this.value||this.required||this.disabled||this.hideClearIcon),a=this.placeholder??this.label,i=this.label&&e?r.qy`<span slot="overline">${this.label}${this.required?" *":""}</span>`:r.s6,o=e?this.valueRenderer?this.valueRenderer(this.value??""):r.qy`<span slot="headline">${this.value}</span>`:a?r.qy`<span slot="headline" class="placeholder"> ${a}${this.required?" *":""} </span>`:r.s6;return r.qy` <ha-combo-box-item aria-label="${(0,n.J)(this.label||this.placeholder)}" .disabled="${this.disabled}" type="button" compact="compact"> ${this.image?r.qy`<img alt="${this.label??""}" slot="start" .src="${this.image}" crossorigin="anonymous" referrerpolicy="no-referrer">`:this.icon?r.qy`<ha-icon slot="start" .icon="${this.icon}"></ha-icon>`:r.qy`<slot name="start"></slot>`} ${i}${o} ${this.unknown?r.qy`<div slot="supporting-text" class="unknown"> ${this.unknownItemText||this._i18n?.localize("ui.components.combo-box.unknown_item")} </div>`:r.s6} ${t?r.qy` <ha-icon-button class="clear" slot="end" @click="${this._clear}" .path="${p}"></ha-icon-button> `:r.s6} <ha-svg-icon class="arrow" slot="end" .path="${m}"></ha-svg-icon> </ha-combo-box-item> `}_clear(e){e.stopPropagation(),(0,c.r)(this,"clear")}static get styles(){return[r.AH`ha-combo-box-item[disabled]{background-color:var(--ha-color-form-background-disabled);--md-list-item-disabled-opacity:0.5;opacity:.5;cursor:not-allowed}ha-combo-box-item{position:relative;background-color:var(--ha-color-form-background);border-radius:var(--ha-border-radius-sm);border-end-end-radius:0;border-end-start-radius:0;--md-list-item-one-line-container-height:56px;--md-list-item-two-line-container-height:56px;--md-list-item-top-space:0px;--md-list-item-bottom-space:0px;--md-list-item-leading-space:var(--ha-space-4);--md-list-item-trailing-space:var(--ha-space-2);--ha-md-list-item-gap:var(--ha-space-2);--md-focus-ring-width:0px;--md-focus-ring-duration:0s}ha-combo-box-item:after{display:block;content:"";position:absolute;pointer-events:none;bottom:0;left:0;right:0;height:1px;width:100%;background-color:var(--ha-color-border-neutral-loud);transform:height 180ms ease-in-out,background-color 180ms ease-in-out}ha-combo-box-item:focus:after{height:2px;background-color:var(--mdc-theme-primary)}:host([unknown]) ha-combo-box-item{background-color:var(--ha-color-fill-warning-quiet-resting)}:host([invalid]) ha-combo-box-item:after{height:2px;background-color:var(--mdc-theme-error,var(--error-color,#b00020))}.clear{margin:0 -8px;--ha-icon-button-size:32px;--ha-icon-button-padding-inline:var(--ha-space-1)}.arrow{--mdc-icon-size:20px;width:32px}.placeholder{color:var(--secondary-text-color)}:host([invalid]) .placeholder{color:var(--mdc-theme-error,var(--error-color,#b00020))}.unknown{color:var(--ha-color-on-warning-normal)}`]}constructor(...e){super(...e),this.invalid=!1}}(0,i.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],g.prototype,"invalid",void 0),(0,i.Cg)([(0,s.P)("ha-combo-box-item",!0)],g.prototype,"item",void 0),(0,i.Cg)([(0,s.wk)(),(0,o.Fg)({context:l.D5,subscribe:!0})],g.prototype,"_i18n",void 0),g=(0,i.Cg)([(0,s.EM)("ha-picker-field")],g),t()}catch(e){t(e)}})},36158(e,t,a){a.a(e,async function(e,t){try{var i=a(62826),o=a(25625),r=a(5124),s=a(22441),n=a(98975),c=a(52943),l=e([n]);n=(l.then?(await l)():l)[0];class d extends r.mN{disconnectedCallback(){super.disconnectedCallback(),this._clearInterval()}connectedCallback(){super.connectedCallback(),this.datetime&&this._startInterval()}createRenderRoot(){return this}firstUpdated(e){super.firstUpdated(e),this._updateRelative()}update(e){super.update(e),this._updateRelative()}_clearInterval(){this._interval&&(window.clearInterval(this._interval),this._interval=void 0)}_startInterval(){this._clearInterval(),this._interval=window.setInterval(()=>this._updateRelative(),6e4)}_updateRelative(){if(this.datetime){const e="string"==typeof this.datetime?(0,o.H)(this.datetime):this.datetime,t=(0,n.K)(e,this.hass.locale);this.innerHTML=this.capitalize?(0,c.Z)(t):t}else this.innerHTML=this.hass.localize("ui.components.relative_time.never")}constructor(...e){super(...e),this.capitalize=!1}}(0,i.Cg)([(0,s.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],d.prototype,"datetime",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],d.prototype,"capitalize",void 0),d=(0,i.Cg)([(0,s.EM)("ha-relative-time")],d),t()}catch(e){t(e)}})},606(e,t,a){a.a(e,async function(e,t){try{a(74423),a(18111),a(61701);var i=a(62826),o=a(5124),r=a(22441),s=a(63672),n=a(22786),c=a(1087),l=a(29823),d=(a(70947),a(3449),a(88285)),h=(a(67094),e([l,d]));[l,d]=h.then?(await h)():h;class u extends o.WF{render(){return this.disabled?o.qy`${this._renderField()}${this._renderHelper()}`:o.qy` <ha-dropdown placement="bottom" @wa-select="${this._handleSelect}" @wa-show="${this._handleShow}" @wa-hide="${this._handleHide}"> ${this._renderField()} ${this.options?this.options.map(e=>{const t=["string","number"].includes(typeof e);return o.qy` <ha-dropdown-item .value="${t?e:e.value}" .disabled="${!t&&(e.disabled??!1)}" .selected="${this.value===(t?e:e.value)}"> ${e.iconPath?o.qy`<ha-svg-icon slot="icon" .path="${e.iconPath}"></ha-svg-icon>`:o.s6} <div class="content"> ${t?e:e.label||e.value} ${e.secondary?o.qy`<div class="secondary">${e.secondary}</div>`:o.s6} </div> </ha-dropdown-item> `}):o.qy`<slot></slot>`} </ha-dropdown> ${this._renderHelper()} `}_renderField(){const e=this._getValueLabel(this.options,this.value);return o.qy` <ha-picker-field slot="trigger" type="button" class="${this._opened?"opened":""}" compact="compact" aria-label="${(0,s.J)(this.label)}" @clear="${this._clearValue}" .label="${this.label}" .value="${e}" .required="${this.required}" .disabled="${this.disabled}" .hideClearIcon="${!this.clearable||this.required||this.disabled||!String(this.value)}"> </ha-picker-field> `}_renderHelper(){return this.helper?o.qy`<ha-input-helper-text .disabled="${this.disabled}">${this.helper}</ha-input-helper-text>`:o.s6}_handleSelect(e){e.stopPropagation();const t=e.detail.item.value;t!==this.value&&(0,c.r)(this,"selected",{value:t})}_clearValue(){!this.disabled&&this.value&&(0,c.r)(this,"selected",{value:void 0})}_handleShow(){this.style.setProperty("--select-menu-width",`${this._triggerField.offsetWidth}px`),this._opened=!0}_handleHide(){this._opened=!1}constructor(...e){super(...e),this.clearable=!1,this.required=!1,this.disabled=!1,this._opened=!1,this._getValueLabel=(0,n.A)((e,t)=>{const a=void 0!==t?String(t):void 0;if(!e||!a)return a;for(const t of e){const e=["string","number"].includes(typeof t);if(e&&t===a||!e&&String(t.value)===a)return e?t:t.label||t.value}return a})}}u.styles=o.AH`:host{position:relative}ha-picker-field.opened{--mdc-text-field-idle-line-color:var(--primary-color)}ha-dropdown-item .content{display:flex;gap:var(--ha-space-1);flex-direction:column}ha-dropdown-item .secondary{font-size:var(--ha-font-size-s);color:var(--ha-color-text-secondary)}ha-dropdown::part(menu){min-width:var(--select-menu-width)}ha-input-helper-text{display:block;margin:var(--ha-space-2) 0 0}`,(0,i.Cg)([(0,r.MZ)({type:Boolean})],u.prototype,"clearable",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],u.prototype,"options",void 0),(0,i.Cg)([(0,r.MZ)()],u.prototype,"label",void 0),(0,i.Cg)([(0,r.MZ)()],u.prototype,"helper",void 0),(0,i.Cg)([(0,r.MZ)()],u.prototype,"value",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],u.prototype,"required",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],u.prototype,"disabled",void 0),(0,i.Cg)([(0,r.wk)()],u.prototype,"_opened",void 0),(0,i.Cg)([(0,r.P)("ha-picker-field")],u.prototype,"_triggerField",void 0),u=(0,i.Cg)([(0,r.EM)("ha-select")],u),t()}catch(e){t(e)}})},36866(e,t,a){a.a(e,async function(e,t){try{var i=a(62826),o=a(5124),r=a(22441),s=a(91485),n=e([s]);s=(n.then?(await n)():n)[0];const c="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z";class l extends s.U{willUpdate(e){super.willUpdate(e),this.label||this.placeholder||this.hasUpdated&&!e.has("_i18n")||(this.placeholder=this.i18n?.localize?.("ui.common.search")||"Search")}renderStartDefault(){return o.qy`<ha-svg-icon slot="start" .path="${c}"></ha-svg-icon>`}constructor(){super(),this.withClear=!0,this.autocomplete=this.autocomplete||"off"}}l.styles=[...s.U.styles,o.AH`:host([appearance=outlined]) wa-input.no-label::part(base){height:40px}`],l=(0,i.Cg)([(0,r.EM)("ha-input-search")],l),t()}catch(e){t(e)}})},10897(e,t,a){a.d(t,{C4:()=>l,CK:()=>c,FX:()=>g,UC:()=>p,_Z:()=>v,bT:()=>y,j4:()=>_,sd:()=>r,su:()=>n,vc:()=>f,w8:()=>u,wv:()=>h,y3:()=>m,zS:()=>s});var i=a(3931),o=a(82e3);const r=[1,2,3,4,6,8],s="web_rtc",n=(e,t,a)=>`${e}&width=${t}&height=${a}`,c=e=>e.attributes.access_token?`/api/camera_proxy_stream/${e.entity_id}?token=${e.attributes.access_token}`:void 0,l=async(e,t,a,o)=>{const r=await(0,i.U)("_cameraTmbUrl",9e3,d,e,t);return n(r,a,o)},d=async(e,t)=>{const a=await(0,o.e0)(e,`/api/camera_proxy/${t}`);return e.hassUrl(a.path)},h=async(e,t,a)=>{const i={type:"camera/stream",entity_id:t};a&&(i.format=a);const o=await e.callWS(i);return o.url=e.hassUrl(o.url),o},u=(e,t,a,i)=>e.connection.subscribeMessage(i,{type:"camera/webrtc/offer",entity_id:t,offer:a}),p=(e,t,a,i)=>e.callWS({type:"camera/webrtc/candidate",entity_id:t,session_id:a,candidate:i}),m=(e,t)=>e.callWS({type:"camera/get_prefs",entity_id:t}),g=(e,t,a)=>e.callWS({type:"camera/update_prefs",entity_id:t,...a}),b="media-source://camera/",_=e=>e.startsWith(b),f=e=>e.substring(22),v=async(e,t)=>e.callWS({type:"camera/capabilities",entity_id:t}),y=async(e,t)=>e.callWS({type:"camera/webrtc/get_client_config",entity_id:t})},38279(e,t,a){a.d(t,{$2:()=>i,VV:()=>r,on:()=>c,sx:()=>s});var i=function(e){return e[e.TARGET_TEMPERATURE=1]="TARGET_TEMPERATURE",e[e.TARGET_TEMPERATURE_RANGE=2]="TARGET_TEMPERATURE_RANGE",e[e.TARGET_HUMIDITY=4]="TARGET_HUMIDITY",e[e.FAN_MODE=8]="FAN_MODE",e[e.PRESET_MODE=16]="PRESET_MODE",e[e.SWING_MODE=32]="SWING_MODE",e[e.AUX_HEAT=64]="AUX_HEAT",e[e.TURN_OFF=128]="TURN_OFF",e[e.TURN_ON=256]="TURN_ON",e[e.SWING_HORIZONTAL_MODE=512]="SWING_HORIZONTAL_MODE",e}({});const o=["auto","heat_cool","heat","cool","dry","fan_only","off"].reduce((e,t,a)=>(e[t]=a,e),{}),r=(e,t)=>o[e]-o[t],s={cooling:"cool",defrosting:"heat",drying:"dry",fan:"fan_only",heating:"heat",idle:"off",off:"off",preheating:"heat"},n={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"},c=e=>n[e]||"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"},700(e,t,a){a.d(t,{y:()=>s});const i=window;"customIconsets"in i||(i.customIconsets={});const o=i.customIconsets,r=window;"customIcons"in r||(r.customIcons={});const s=new Proxy(r.customIcons,{get:(e,t)=>e[t]??(o[t]?{getIcon:o[t]}:void 0)})},53756(e,t,a){a.d(t,{t:()=>c,w:()=>l});a(74423),a(18111),a(22489),a(61701);var i=a(71727),o=a(74705),r=a(28978),s=a(15638),n=a(95350);const c=[{name:"search_labels.entityName",weight:10},{name:"search_labels.friendlyName",weight:8},{name:"search_labels.deviceName",weight:7},{name:"search_labels.areaName",weight:6},{name:"search_labels.domainName",weight:6},{name:"search_labels.entityId",weight:3}],l=(e,t,a,c,l,d,h,u,p,m="")=>{let g,b=Object.keys(e.states);return h&&(b=b.filter(e=>h.includes(e))),u&&(b=b.filter(e=>!u.includes(e))),t&&(b=b.filter(e=>t.includes((0,i.m)(e)))),a&&(b=b.filter(e=>!a.includes((0,i.m)(e)))),g=b.map(t=>{const a=e.states[t],c=(0,r.u)(a),[l,d,h]=(0,o.Cf)(a,[{type:"entity"},{type:"device"},{type:"area"}],e.entities,e.devices,e.areas,e.floors),u=(0,n.p$)(e.localize,(0,i.m)(t)),p=(0,s.qC)(e.language,e.translationMetadata.translations),g=l||d||t,b=[h,l?d:void 0].filter(Boolean).join(p?" ◂ ":" ▸ ");return{id:`${m}${t}`,primary:g,secondary:b,domain_name:u,sorting_label:[g,b].filter(Boolean).join("_"),search_labels:{entityName:l||null,deviceName:d||null,areaName:h||null,domainName:u||null,friendlyName:c||null,entityId:t},stateObj:a}}),l&&(g=g.filter(e=>e.id===p||e.stateObj?.attributes.device_class&&l.includes(e.stateObj.attributes.device_class))),d&&(g=g.filter(e=>e.id===p||e.stateObj?.attributes.unit_of_measurement&&d.includes(e.stateObj.attributes.unit_of_measurement))),c&&(g=g.filter(e=>e.id===p||e.stateObj&&c(e.stateObj))),g}},68287(e,t,a){a.d(t,{z:()=>o});a(18111),a(61701),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);var i=a(71727);const o=e=>{const t=e.attributes.entity_id||[],a=[...new Set(t.map(e=>(0,i.m)(e)))];return 1===a.length?a[0]:void 0}},86531(e,t,a){a.a(e,async function(e,i){try{a.d(t,{$O:()=>f,a$:()=>w,cj:()=>u,dG:()=>_,gM:()=>b,gd:()=>m,k$:()=>y,rc:()=>k});a(74423);var o=a(46190),r=a(71727),s=a(69093),n=a(22533),c=a(22675),l=a(25064),d=e([l]);l=(d.then?(await d)():d)[0];const h="ui.components.logbook.messages",u=["counter","proximity"],p={triggered_by_numeric_state_of:"numeric state of",triggered_by_state_of:"state of",triggered_by_event:"event",triggered_by_time_pattern:"time pattern",triggered_by_time:"time",triggered_by_homeassistant_stopping:"ioBroker stopping",triggered_by_homeassistant_starting:"ioBroker starting"},m=async(e,t,a)=>g(e,t,void 0,void 0,a),g=(e,t,a,i,o,r)=>{if((i||r)&&(!i||0===i.length)&&(!r||0===r.length))return Promise.resolve([]);const s={type:"logbook/get_events",start_time:t};return a&&(s.end_time=a),i?.length&&(s.entity_ids=i),r?.length&&(s.device_ids=r),o&&(s.context_id=o),e.callWS(s)},b=(e,t,a,i,o,r,s)=>{if((r||s)&&(!r||0===r.length)&&(!s||0===s.length))return Promise.reject("No entities or devices");const n={type:"logbook/event_stream",start_time:a,end_time:i};return r?.length&&(n.entity_ids=r),s?.length&&(n.device_ids=s),e.connection.subscribeMessage(e=>t(e,o),n)},_=(e,t)=>({entity_id:e.entity_id,state:t,attributes:{device_class:e?.attributes.device_class,source_type:e?.attributes.source_type,has_date:e?.attributes.has_date,has_time:e?.attributes.has_time,entity_picture_local:o.oL.has((0,r.m)(e.entity_id))?void 0:e?.attributes.entity_picture_local,entity_picture:o.oL.has((0,r.m)(e.entity_id))?void 0:e?.attributes.entity_picture}}),f=(e,t)=>{for(const a of Object.keys(p)){const i=p[a];if(t.startsWith(i))return t.replace(i,`${e(`ui.components.logbook.${a}`)}`)}return t},v={triggered_by_numeric_state_of:"numeric_state_of",triggered_by_state_of:"state_of",triggered_by_event:"event",triggered_by_time_pattern:"time_pattern",triggered_by_time:"time",triggered_by_homeassistant_stopping:"homeassistant_stopping",triggered_by_homeassistant_starting:"homeassistant_starting"},y=(e,t)=>{for(const a of Object.keys(p)){const i=p[a];if(t.startsWith(i)){const o=v[a];return t.replace(i,`${e(`ui.components.logbook.${o}`)}`)}}return t},w=(e,t,a,i,o)=>{switch(o){case"device_tracker":case"person":return"not_home"===a?t(`${h}.was_away`):"home"===a?t(`${h}.was_at_home`):t(`${h}.was_at_state`,{state:a});case"sun":return t("above_horizon"===a?`${h}.rose`:`${h}.set`);case"binary_sensor":{const o="on"===a,r="off"===a,s=i.attributes.device_class;if(s&&(o||r))return t(`${h}.${o?"detected_device_classes":"cleared_device_classes"}.${s}`,{device_class:(0,n.i)(t(`component.binary_sensor.entity_component.${s}.name`)||s,e.language)})||t(`${h}.${o?"detected_device_class":"cleared_device_class"}`,{device_class:(0,n.i)(t(`component.binary_sensor.entity_component.${s}.name`)||s,e.language)});break}case"cover":switch(a){case"open":return t(`${h}.was_opened`);case"opening":return t(`${h}.is_opening`);case"closing":return t(`${h}.is_closing`);case"closed":return t(`${h}.was_closed`)}break;case"event":return t(`${h}.detected_event_no_type`);case"lock":switch(a){case"unlocked":return t(`${h}.was_unlocked`);case"locking":return t(`${h}.is_locking`);case"unlocking":return t(`${h}.is_unlocking`);case"opening":return t(`${h}.is_opening`);case"open":return t(`${h}.is_opened`);case"locked":return t(`${h}.was_locked`);case"jammed":return t(`${h}.is_jammed`)}}return"on"===a?t(`${h}.turned_on`):"off"===a?t(`${h}.turned_off`):a===c.HV?t(`${h}.became_unknown`):a===c.Hh?t(`${h}.became_unavailable`):e.localize(`${h}.changed_to_state`,{state:i?e.formatEntityState(i,a):a})},k=(e,t=[])=>{const a=(0,s.t)(e);return!(u.includes(a)||"sensor"===a&&(0,l.Fp)(a,e,void 0,t))};i()}catch(e){i(e)}})},95311(e,t,a){a.d(t,{DF:()=>p,Lo:()=>v,MH:()=>l,MM:()=>m,Qz:()=>u,Ru:()=>b,UU:()=>_,_7:()=>h,bZ:()=>d,m0:()=>c,tD:()=>f,vX:()=>g,wY:()=>y});a(74423),a(44114),a(18111),a(22489),a(30531),a(7588),a(13579),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);var i=a(44537),o=a(69093),r=a(82286),s=a(24367),n=a(58594);const c=(e,t,a,i,o,r,s)=>{const n=[],c=[],l=[];return Object.values(a).forEach(a=>{a.labels.includes(t)&&u(e,o,i,a.area_id,r,s)&&l.push(a.area_id)}),Object.values(i).forEach(a=>{a.labels.includes(t)&&p(e.states,Object.values(o),a,r,s)&&c.push(a.id)}),Object.values(o).forEach(a=>{a.labels.includes(t)&&m(e.states[a.entity_id],r,s)&&n.push(a.entity_id)}),{areas:l,devices:c,entities:n}},l=(e,t,a,i,o)=>{const r=[];return Object.values(a).forEach(a=>{a.floor_id===t&&u(e,e.entities,e.devices,a.area_id,i,o)&&r.push(a.area_id)}),{areas:r}},d=(e,t,a,i,o,r)=>{const s=[],n=[];return Object.values(a).forEach(a=>{a.area_id===t&&p(e.states,Object.values(i),a,o,r)&&n.push(a.id)}),Object.values(i).forEach(a=>{a.area_id===t&&m(e.states[a.entity_id],o,r)&&s.push(a.entity_id)}),{devices:n,entities:s}},h=(e,t,a,i,o)=>{const r=[];return Object.values(a).forEach(a=>{a.device_id===t&&m(e.states[a.entity_id],i,o)&&r.push(a.entity_id)}),{entities:r}},u=(e,t,a,i,o,r)=>!!Object.values(a).some(a=>!(a.area_id!==i||!p(e.states,Object.values(t),a,o,r)))||Object.values(t).some(t=>!(t.area_id!==i||!m(e.states[t.entity_id],o,r))),p=(e,t,a,o,r)=>{const s=r?(0,n.fk)(r,t):void 0;if(o.target?.device&&!(0,i.e)(o.target.device).some(e=>g(e,a,s)))return!1;if(o.target?.entity){return t.filter(e=>e.device_id===a.id).some(t=>{const a=e[t.entity_id];return m(a,o,r)})}return!0},m=(e,t,a)=>!!e&&(!t.target?.entity||(0,i.e)(t.target.entity).some(t=>b(t,e,a))),g=(e,t,a)=>{const{manufacturer:i,model:o,model_id:r,integration:s}=e;return(!i||t.manufacturer===i)&&((!o||t.model===o)&&((!r||t.model_id===r)&&!(s&&a&&!a?.[t.id]?.has(s))))},b=(e,t,a)=>{const{domain:s,device_class:n,supported_features:c,unit_of_measurement:l,integration:d}=e;if(s){const e=(0,o.t)(t);if(Array.isArray(s)?!s.includes(e):e!==s)return!1}if(n){const e=t.attributes.device_class;if(e&&Array.isArray(n)?!n.includes(e):e!==n)return!1}if(c&&!(0,i.e)(c).some(e=>(0,r.$)(t,e)))return!1;if(l){const e=t.attributes.unit_of_measurement;if(!e||(Array.isArray(l)?!l.includes(e):e!==l))return!1}return!d||a?.[t.entity_id]?.domain===d},_=e=>{if(!e.entity)return{entity:null};if("filter"in e.entity)return e;const{domain:t,integration:a,device_class:i,...o}=e.entity;return t||a||i?{entity:{...o,filter:{domain:t,integration:a,device_class:i}}}:{entity:o}},f=e=>{if(!e.device)return{device:null};if("filter"in e.device)return e;const{integration:t,manufacturer:a,model:i,...o}=e.device;return t||a||i?{device:{...o,filter:{integration:t,manufacturer:a,model:i}}}:{device:o}},v=e=>{let t;if("target"in e)t=(0,i.e)(e.target?.entity);else if("entity"in e){if(e.entity?.include_entities)return;t=(0,i.e)(e.entity?.filter)}if(!t)return;const a=t.flatMap(e=>e.integration||e.device_class||e.supported_features||!e.domain?[]:(0,i.e)(e.domain).filter(e=>(0,s.z)(e)));return[...new Set(a)]},y=(e,t,a,o,r,s={target:{}})=>{if(!t)return[];const n=new Set((0,i.e)(t.entity_id)),u=new Set((0,i.e)(t.device_id)),p=new Set((0,i.e)(t.area_id)),m=new Set((0,i.e)(t.floor_id));return new Set((0,i.e)(t.label_id)).forEach(t=>{const i=c(e,t,r,o,a,s);i.devices.forEach(e=>u.add(e)),i.entities.forEach(e=>n.add(e)),i.areas.forEach(e=>p.add(e))}),m.forEach(t=>{l(e,t,r,s).areas.forEach(e=>p.add(e))}),p.forEach(t=>{const i=d(e,t,o,a,s);i.devices.forEach(e=>u.add(e)),i.entities.forEach(e=>n.add(e))}),u.forEach(t=>{h(e,t,a,s).entities.forEach(e=>n.add(e))}),Array.from(n)}},28669(e,t,a){a.d(t,{TK:()=>n,_2:()=>l,eR:()=>o,hG:()=>c,hU:()=>r,kg:()=>s,wj:()=>i,xg:()=>d});a(44114),a(18111),a(61701);const i="system-admin",o="system-users",r=async e=>e.callWS({type:"config/auth/list"}),s=async(e,t,a,i)=>e.callWS({type:"config/auth/create",name:t,group_ids:a,local_only:i}),n=async(e,t,a)=>e.callWS({...a,type:"config/auth/update",user_id:t}),c=async(e,t)=>e.callWS({type:"config/auth/delete",user_id:t}),l=e=>e?e.trim().split(" ").slice(0,3).map(e=>e.substring(0,1)).join(""):"?",d=(e,t,a)=>{const i=[],o=t=>e.localize(`ui.panel.config.users.${t}`);return t.is_owner&&i.push(["M12 2C6.47 2 2 6.5 2 12C2 17.5 6.5 22 12 22S22 17.5 22 12 17.5 2 12 2M12 20C7.58 20 4 16.42 4 12C4 7.58 7.58 4 12 4S20 7.58 20 12C20 16.42 16.42 20 12 20M8 14L7 8L10 10L12 7L14 10L17 8L16 14H8M8.56 16C8.22 16 8 15.78 8 15.44V15H16V15.44C16 15.78 15.78 16 15.44 16H8.56Z",o("is_owner")]),a&&t.system_generated&&i.push(["M11,7H15V9H11V11H13A2,2 0 0,1 15,13V15A2,2 0 0,1 13,17H9V15H13V13H11A2,2 0 0,1 9,11V9A2,2 0 0,1 11,7M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z",o("is_system")]),t.local_only&&i.push(["M12 20C7.6 20 4 16.4 4 12S7.6 4 12 4 20 7.6 20 12 16.4 20 12 20M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M11 14H13V17H16V12H18L12 7L6 12H8V17H11V14",o("is_local")]),t.is_active||i.push(["M12 2C17.5 2 22 6.5 22 12S17.5 22 12 22 2 17.5 2 12 6.5 2 12 2M12 4C10.1 4 8.4 4.6 7.1 5.7L18.3 16.9C19.3 15.5 20 13.8 20 12C20 7.6 16.4 4 12 4M16.9 18.3L5.7 7.1C4.6 8.4 4 10.1 4 12C4 16.4 7.6 20 12 20C13.9 20 15.6 19.4 16.9 18.3Z",o("is_not_active")]),i}},42269(e,t,a){a.d(t,{p:()=>o});var i=a(1087);const o=(e,t)=>(0,i.r)(e,"hass-more-info",t)},17894(e,t,a){a.d(t,{c:()=>r});var i=a(62826),o=a(22441);const r=e=>{class t extends e{constructor(...e){super(...e),this.disabled=!1,this.required=!1,this.unknown=!1,this.hideClearIcon=!1}}return(0,i.Cg)([(0,o.MZ)({type:Boolean})],t.prototype,"disabled",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],t.prototype,"required",void 0),(0,i.Cg)([(0,o.MZ)()],t.prototype,"icon",void 0),(0,i.Cg)([(0,o.MZ)()],t.prototype,"image",void 0),(0,i.Cg)([(0,o.MZ)()],t.prototype,"label",void 0),(0,i.Cg)([(0,o.MZ)()],t.prototype,"placeholder",void 0),(0,i.Cg)([(0,o.MZ)()],t.prototype,"helper",void 0),(0,i.Cg)([(0,o.MZ)()],t.prototype,"value",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],t.prototype,"unknown",void 0),(0,i.Cg)([(0,o.MZ)({attribute:"unknown-item-text"})],t.prototype,"unknownItemText",void 0),(0,i.Cg)([(0,o.MZ)({attribute:"hide-clear-icon",type:Boolean})],t.prototype,"hideClearIcon",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],t.prototype,"valueRenderer",void 0),t}},59992(e,t,a){a.d(t,{V:()=>c});var i=a(62826),o=a(88696),r=a(5124),s=a(6412),n=a(22441);const c=e=>{class t extends e{get scrollableElement(){return t.DEFAULT_SCROLLABLE_ELEMENT}firstUpdated(e){super.firstUpdated?.(e),this.scrollableElement&&this._updateScrollableState(this.scrollableElement),this._attachScrollableElement()}updated(e){super.updated?.(e),this._attachScrollableElement()}disconnectedCallback(){this._detachScrollableElement(),this._contentScrolled=!1,this._contentScrollable=!1,super.disconnectedCallback()}renderScrollableFades(e=!1){return r.qy` <div class="${(0,s.H)({"fade-top":!0,rounded:e,visible:this._contentScrolled})}"></div> <div class="${(0,s.H)({"fade-bottom":!0,rounded:e,visible:this._contentScrollable})}"></div> `}static get styles(){const e=Object.getPrototypeOf(this);var t;return[...void 0===(t=e?.styles??[])?[]:Array.isArray(t)?t:[t],r.AH`.fade-bottom,.fade-top{position:absolute;left:0;right:0;height:var(--ha-space-2);pointer-events:none;transition:opacity 180ms ease-in-out;border-radius:var(--ha-border-radius-square);opacity:0;background:linear-gradient(to bottom,var(--ha-color-shadow-scrollable-fade),transparent)}.fade-top{top:0}.fade-bottom{bottom:0;transform:rotate(180deg)}.fade-bottom.visible,.fade-top.visible{opacity:1}.fade-bottom.rounded,.fade-top.rounded{border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}.fade-top.rounded{border-top-left-radius:var(--ha-border-radius-square);border-top-right-radius:var(--ha-border-radius-square)}.fade-bottom.rounded{border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}`]}_attachScrollableElement(){const e=this.scrollableElement;e!==this._scrollTarget&&(this._detachScrollableElement(),e&&(this._scrollTarget=e,e.addEventListener("scroll",this._onScroll,{passive:!0}),this._resize.observe(e),this._updateScrollableState(e)))}_detachScrollableElement(){this._scrollTarget&&(this._scrollTarget.removeEventListener("scroll",this._onScroll),this._resize.unobserve?.(this._scrollTarget),this._scrollTarget=void 0)}_updateScrollableState(e){const t=parseFloat(getComputedStyle(e).getPropertyValue("--safe-area-inset-bottom"))||0,{scrollHeight:a=0,clientHeight:i=0,scrollTop:o=0}=e;this._contentScrollable=a-i>o+t+this.scrollFadeSafeAreaPadding}constructor(...e){super(...e),this._contentScrolled=!1,this._contentScrollable=!1,this._onScroll=e=>{const t=e.currentTarget;this._contentScrolled=(t.scrollTop??0)>this.scrollFadeThreshold,this._updateScrollableState(t)},this._resize=new o.P(this,{target:null,callback:e=>{const t=e[0]?.target;t&&this._updateScrollableState(t)}}),this.scrollFadeSafeAreaPadding=4,this.scrollFadeThreshold=4}}return t.DEFAULT_SCROLLABLE_ELEMENT=null,(0,i.Cg)([(0,n.wk)()],t.prototype,"_contentScrolled",void 0),(0,i.Cg)([(0,n.wk)()],t.prototype,"_contentScrollable",void 0),t}},24367(e,t,a){a.d(t,{L:()=>o,z:()=>r});var i=a(23832);const o=["input_boolean","input_button","input_text","input_number","input_datetime","input_select","counter","timer","schedule"],r=(0,i.g)(o)},19711(e,t,a){a.d(t,{$:()=>r});var i=a(1087);const o=()=>Promise.all([a.e(80131),a.e(70183),a.e(47677)]).then(a.bind(a,79029)),r=(e,t)=>{(0,i.r)(e,"show-dialog",{dialogTag:"dialog-helper-detail",dialogImport:o,dialogParams:t})}},89434(e,t,a){a.a(e,async function(e,t){try{a(74423),a(44114),a(18111),a(22489),a(7588),a(13579);var i=a(62826),o=a(5124),r=a(22441),s=a(36312),n=a(69093),c=a(77796),l=a(65829),d=a(86531),h=a(61165),u=a(28669),p=a(11184),m=e([l,p,d]);[l,p,d]=m.then?(await m)():m;const g=(e,t)=>new Date(e.getTime()-1e3*t).getTime()/1e3,b=(e,t)=>(void 0!==e||void 0!==t)&&(!e||!t||e.length!==t.length||e.some(e=>!t.includes(e))||t.some(t=>!e.includes(t)));class _ extends o.WF{render(){return(0,s.x)(this.hass.config,"logbook")?this._error?o.qy`<div class="no-entries"> ${`${this.hass.localize("ui.components.logbook.retrieval_error")}: ${this._error}`} </div>`:void 0===this._logbookEntries?o.qy` <div class="progress-wrapper"> <ha-spinner></ha-spinner> </div> `:0===this._logbookEntries.length?o.qy`<div class="no-entries"> ${this.hass.localize("ui.components.logbook.entries_not_found")} </div>`:o.qy` <ha-logbook-renderer .hass="${this.hass}" .narrow="${this.narrow}" .virtualize="${this.virtualize}" .noIcon="${this.noIcon}" .noName="${this.noName}" .showIndicator="${this.showIndicator}" .relativeTime="${this.relativeTime}" .entries="${this._logbookEntries}" .traceContexts="${this._traceContexts}" .userIdToName="${this._userIdToName}" @hass-logbook-live="${this._handleLogbookLive}"></ha-logbook-renderer> `:o.s6}async refresh(e=!1){(e||!this._unsubLogbook&&void 0!==this._logbookEntries)&&(this._throttleGetLogbookEntries.cancel(),this._updateTraceContexts.cancel(),this._updateUsers.cancel(),this._unsubscribe(!0),this._liveUpdatesEnabled=!0,e?this._getLogBookData():this._throttleGetLogbookEntries())}shouldUpdate(e){if(1!==e.size||!e.has("hass"))return!0;const t=e.get("hass");return!t||t.localize!==this.hass.localize}willUpdate(e){let t=e.has("time");for(const a of["entityIds","deviceIds","stateFilter"]){if(!e.has(a))continue;const i=e.get(a),o=this[a];if(b(i,o)){t=!0;break}}t&&this.refresh(!0)}_handleLogbookLive(e){e.detail.enable&&!this._liveUpdatesEnabled&&(this._pendingStreamMessages.forEach(e=>this._processStreamMessage(e)),this._pendingStreamMessages=[]),this._liveUpdatesEnabled=e.detail.enable}get _filterAlwaysEmptyResults(){const e=this.entityIds,t=this.deviceIds;return Boolean(e||t)&&(!e||0===e.length)&&(!t||0===t.length)}_unsubscribe(e){this._unsubLogbook&&(this._unsubLogbook.then(e=>e()),this._unsubLogbook=void 0,this._logbookEntries=e?void 0:[],this._pendingStreamMessages=[])}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this._subscribeLogbookPeriod(this._calculateLogbookPeriod())}disconnectedCallback(){super.disconnectedCallback(),this._unsubscribe(!0)}_calculateLogbookPeriod(){const e=new Date;if("range"in this.time)return{now:e,startTime:this.time.range[0],endTime:this.time.range[1],purgeBeforePythonTime:void 0};if("recent"in this.time){const t=g(e,this.time.recent);return{now:e,startTime:new Date(1e3*t),endTime:new Date(e.getTime()+31536e6),purgeBeforePythonTime:g(e,this.time.recent)}}throw new Error("Unexpected time specified")}async _subscribeLogbookPeriod(e){if(!this._unsubLogbook)try{this._logbookSubscriptionId++,this._unsubLogbook=(0,d.gM)(this.hass,(e,t)=>{t===this._logbookSubscriptionId&&this._processOrQueueStreamMessage(e)},e.startTime.toISOString(),e.endTime.toISOString(),this._logbookSubscriptionId,this.entityIds,this.deviceIds),await this._unsubLogbook}catch(e){this._unsubLogbook=void 0,this._error=e}}async _getLogBookData(){if(this._error=void 0,this._filterAlwaysEmptyResults)return void this._unsubscribe(!1);const e=this._calculateLogbookPeriod();e.startTime>e.now?this._unsubscribe(!1):(this._updateUsers(),this.hass.user?.is_admin&&this._updateTraceContexts(),this._subscribeLogbookPeriod(e))}static get styles(){return[o.AH`:host{display:block}:host([virtualize]){height:100%}.no-entries{text-align:center;padding:16px;color:var(--secondary-text-color)}.progress-wrapper{display:flex;justify-content:center;height:100%;align-items:center}`]}constructor(...e){super(...e),this.narrow=!1,this.virtualize=!1,this.noIcon=!1,this.noName=!1,this.showIndicator=!1,this.relativeTime=!1,this.showMoreLink=!0,this._traceContexts={},this._userIdToName={},this._liveUpdatesEnabled=!0,this._pendingStreamMessages=[],this._throttleGetLogbookEntries=(0,c.n)(()=>this._getLogBookData(),1e3),this._logbookSubscriptionId=0,this._nonExpiredRecords=e=>this._logbookEntries?e?this._logbookEntries.filter(t=>t.when>e):this._logbookEntries:[],this._processOrQueueStreamMessage=e=>{this._liveUpdatesEnabled?this._processStreamMessage(e):this._pendingStreamMessages.push(e)},this._processStreamMessage=e=>{const t="recent"in this.time?g(new Date,this.time.recent):void 0;let a;a=this.stateFilter&&this.stateFilter.length>0?e.events.filter(e=>e.state&&this.stateFilter?.includes(e.state)):[...e.events];const i=a.reverse();if(!this._logbookEntries||!this._logbookEntries.length)return void(this._logbookEntries=i);if(!i.length)return;const o=this._nonExpiredRecords(t);o.length?i[i.length-1].when>o[0].when?this._logbookEntries=i.concat(o):o[o.length-1].when>i[0].when?this._logbookEntries=o.concat(i):this._logbookEntries=o.concat(i).sort((e,t)=>t.when-e.when):this._logbookEntries=i},this._updateTraceContexts=(0,c.n)(async()=>{this._traceContexts=await(0,h.gq)(this.hass)},6e4),this._updateUsers=(0,c.n)(async()=>{const e={},t=this.hass.user?.is_admin&&(0,u.hU)(this.hass);for(const t of Object.values(this.hass.states))t.attributes.user_id&&"person"===(0,n.t)(t)&&(e[t.attributes.user_id]=t.attributes.friendly_name);if(t){const a=await t;for(const t of a)t.id in e||(e[t.id]=t.name)}this._userIdToName=e},6e4)}}(0,i.Cg)([(0,r.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],_.prototype,"time",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],_.prototype,"entityIds",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],_.prototype,"deviceIds",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],_.prototype,"stateFilter",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],_.prototype,"narrow",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],_.prototype,"virtualize",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"no-icon"})],_.prototype,"noIcon",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"no-name"})],_.prototype,"noName",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"show-indicator"})],_.prototype,"showIndicator",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"relative-time"})],_.prototype,"relativeTime",void 0),(0,i.Cg)([(0,r.MZ)({attribute:"show-more-link",type:Boolean})],_.prototype,"showMoreLink",void 0),(0,i.Cg)([(0,r.wk)()],_.prototype,"_logbookEntries",void 0),(0,i.Cg)([(0,r.wk)()],_.prototype,"_traceContexts",void 0),(0,i.Cg)([(0,r.wk)()],_.prototype,"_userIdToName",void 0),(0,i.Cg)([(0,r.wk)()],_.prototype,"_error",void 0),_=(0,i.Cg)([(0,r.EM)("ha-logbook")],_),t()}catch(e){t(e)}})},76309(e,t,a){a.a(e,async function(e,i){try{a.r(t),a.d(t,{HaPanelLogbook:()=>x});var o=a(62826),r=a(5124),s=a(22441),n=a(22786),c=a(44537),l=a(93905),d=a(91926),h=a(51758),u=a(6030),p=a(58987),m=a(26300),g=a(90248),b=a(2054),_=a(79286),f=(a(27330),a(86531)),v=a(95311),y=a(64808),w=a(14503),k=a(89434),C=e([p,m,g,b,_,k,f]);[p,m,g,b,_,k,f]=C.then?(await C)():C;const $="M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z";class x extends r.WF{_goBack(){(0,d.OE)()}render(){return r.qy` <ha-top-app-bar-fixed .narrow="${this.narrow}"> ${this._showBack?r.qy` <ha-icon-button-arrow-prev slot="navigationIcon" @click="${this._goBack}"></ha-icon-button-arrow-prev> `:r.qy` <ha-menu-button slot="navigationIcon" .hass="${this.hass}" .narrow="${this.narrow}"></ha-menu-button> `} <div slot="title">${this.hass.localize("panel.logbook")}</div> <ha-icon-button slot="actionItems" @click="${this._refreshLogbook}" .path="${$}" .label="${this.hass.localize("ui.common.refresh")}"></ha-icon-button> <div class="content"> <div class="filters"> <ha-date-range-picker .startDate="${this._time.range[0]}" .endDate="${this._time.range[1]}" @value-changed="${this._dateRangeChanged}" time-picker></ha-date-range-picker> <ha-target-picker .hass="${this.hass}" .entityFilter="${this._filterFunc}" .value="${this._targetPickerValue}" add-on-top @value-changed="${this._targetsChanged}" compact="compact"></ha-target-picker> </div> <ha-logbook .hass="${this.hass}" .time="${this._time}" .entityIds="${this._getEntityIds()}" virtualize></ha-logbook> </div> </ha-top-app-bar-fixed> `}willUpdate(e){super.willUpdate(e),this.hasUpdated||this._applyURLParams()}async _loadNumericDeviceClasses(){const e=await(0,y.KL)(this.hass);this._sensorNumericDeviceClasses=e.numeric_device_classes}firstUpdated(e){super.firstUpdated(e),this.hass.loadBackendTranslation("title"),this._loadNumericDeviceClasses();"1"===(0,u.px)().back&&history.length>1&&(this._showBack=!0,(0,d.oo)((0,h.Z)((0,u.s8)("back")),{replace:!0}))}connectedCallback(){super.connectedCallback(),window.addEventListener("location-changed",this._locationChanged)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("location-changed",this._locationChanged)}_getEntityIds(){const e=this.__getEntityIds(this._targetPickerValue,this.hass.entities,this.hass.devices,this.hass.areas);if(0!==e.length)return e}_applyURLParams(){const e=(0,u.px)(),t=e.entity_id,a=e.device_id,i=e.area_id,o=e.floor_id,r=e.label_id;if((t||a||i||o||r)&&(this._targetPickerValue={}),t){const e=t.split(",");this._targetPickerValue.entity_id=e}if(a){const e=a.split(",");this._targetPickerValue.device_id=e}if(i){const e=i.split(",");this._targetPickerValue.area_id=e}if(o){const e=o.split(",");this._targetPickerValue.floor_id=e}if(r){const e=r.split(",");this._targetPickerValue.label_id=e}const s=e.start_date,n=e.end_date;if(s||n){const e=s?new Date(s):this._time.range[0],t=n?new Date(n):this._time.range[1];e.getTime()===this._time.range[0].getTime()&&t.getTime()===this._time.range[1].getTime()||(this._time={range:[s?new Date(s):this._time.range[0],n?new Date(n):this._time.range[1]]})}}_dateRangeChanged(e){const t=e.detail.value.startDate,a=e.detail.value.endDate;this._time={range:[t,a]},this._updatePath()}_targetsChanged(e){this._targetPickerValue=e.detail.value||{},this._updatePath()}_updatePath(){const e={};this._targetPickerValue.entity_id&&(e.entity_id=(0,c.e)(this._targetPickerValue.entity_id).join(",")),this._targetPickerValue.label_id&&(e.label_id=(0,c.e)(this._targetPickerValue.label_id).join(",")),this._targetPickerValue.floor_id&&(e.floor_id=(0,c.e)(this._targetPickerValue.floor_id).join(",")),this._targetPickerValue.area_id&&(e.area_id=(0,c.e)(this._targetPickerValue.area_id).join(",")),this._targetPickerValue.device_id&&(e.device_id=(0,c.e)(this._targetPickerValue.device_id).join(",")),this._time.range[0]&&(e.start_date=this._time.range[0].toISOString()),this._time.range[1]&&(e.end_date=this._time.range[1].toISOString()),(0,d.oo)(`/logbook?${(0,u.KH)(e)}`,{replace:!0})}_refreshLogbook(){this.shadowRoot.querySelector("ha-logbook")?.refresh()}static get styles(){return[w.RF,r.AH`:host{--ha-generic-picker-max-width:400px}.content{display:flex;flex-direction:column;height:calc(100vh - var(--header-height,0px) - var(--safe-area-inset-top,0px) - var(--safe-area-inset-bottom,0px));overflow-x:hidden;padding:0 0 16px}ha-logbook{flex:1;min-height:0}ha-date-range-picker{margin-right:16px;margin-inline-end:16px;margin-inline-start:initial;max-width:100%;direction:var(--direction)}@media all and (max-width:870px){ha-date-range-picker{width:100%}.filters{flex-direction:column}}:host([narrow]) ha-date-range-picker{margin-right:0;margin-inline-end:0;margin-inline-start:initial;direction:var(--direction);margin-bottom:8px}.content{overflow-x:hidden}.filters{display:flex;padding:16px 16px 0}:host([narrow]) .filters{flex-wrap:wrap}ha-target-picker{flex:1;max-width:100%;min-width:0}`]}constructor(){super(),this.narrow=!1,this._targetPickerValue={},this._sensorNumericDeviceClasses=[],this._filterFunc=e=>(0,f.rc)(e,this._sensorNumericDeviceClasses),this._locationChanged=()=>{this._applyURLParams()},this.__getEntityIds=(0,n.A)((e,t,a,i)=>(0,v.wY)(this.hass,e,t,a,i));const e=new Date;e.setHours(e.getHours()-1,0,0,0);const t=new Date;t.setHours(t.getHours()+2,0,0,0),this._time={range:[e,t]}}}(0,o.Cg)([(0,s.MZ)({attribute:!1})],x.prototype,"hass",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],x.prototype,"narrow",void 0),(0,o.Cg)([(0,s.wk)()],x.prototype,"_time",void 0),(0,o.Cg)([(0,s.wk)()],x.prototype,"_entityIds",void 0),(0,o.Cg)([(0,s.wk)()],x.prototype,"_showBack",void 0),(0,o.Cg)([(0,s.wk)(),(0,l.I)({key:"logbookPickedValue",state:!0,subscribe:!1})],x.prototype,"_targetPickerValue",void 0),(0,o.Cg)([(0,s.wk)()],x.prototype,"_sensorNumericDeviceClasses",void 0),x=(0,o.Cg)([(0,s.EM)("ha-panel-logbook")],x),i()}catch(e){i(e)}})},86030(e,t,a){a.d(t,{B:()=>i,a:()=>o});a(18111),a(18237);function i(e){return Array.isArray(e)?e.reverse().reduce((e,t)=>`var(${t}${e?`, ${e}`:""})`,void 0):`var(${e})`}function o(e,t){if(Array.isArray(e))for(const a of e){const e=o(a,t);if(e)return e}else if(e.endsWith("-color"))return t.getPropertyValue(e).trim()||void 0}},85614(e,t,a){a.d(t,{i:()=>i});const i=async()=>{await Promise.all([a.e(69139),a.e(22309)]).then(a.bind(a,46974))}},22348(e,t,a){a.d(t,{V:()=>o});var i=a(37177);const o=e=>!!e&&i.n},37177(e,t,a){a.d(t,{n:()=>i});const i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)},88438(e,t,a){a.d(t,{C:()=>i});const i="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}};