UNPKG

iobroker.lovelace

Version:

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

40 lines 89.3 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[57296],{93421:function(t,e,i){i.d(e,{IW:function(){return c},dH:function(){return l},fI:function(){return d}});i(44114),i(62953);var a=i(35211),o=i(22792),r=i(32172);const s=(t,e)=>{let i=t;for(const a of e){if(null==i)return;i=i[a]}return i},n=(t,e,i)=>{const o=(0,r.p)({transformer:function(t){return i.call(this,t)},watch:e?[e]:[]}),s=(0,a.Fg)({context:t,subscribe:!0});return(t,e)=>{o(t,e),s(t,e)}},d=t=>n(o.iN,t.entityIdPath[0],function(e){const i=s(this,t.entityIdPath);return"string"==typeof i?null==e?void 0:e[i]:void 0}),l=t=>n(o.X1,t.entityIdPath[0],function(e){const i=s(this,t.entityIdPath);return"string"==typeof i?null==e?void 0:e[i]:void 0}),c=()=>n(o.D5,void 0,({localize:t})=>t)},32172:function(t,e,i){i.d(e,{p:function(){return a}});i(16280),i(18111),i(7588),i(45367),i(92731),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);function a(t){return(e,i)=>{if("object"==typeof i)throw new Error("This decorator does not support this compilation type.");const a=String(i),o=e;if(o._transformers){if(!o.hasOwnProperty("_transformers")){const t=o._transformers;o._transformers=new Map,t.forEach((t,e)=>o._transformers.set(e,t))}}else{o._transformers=new Map,o._watching=new Map;const t=o.willUpdate;o.willUpdate=function(e){t.call(this,e);const i=new Set;e.forEach((t,e)=>{const a=this._watching.get(e);void 0!==a&&a.forEach(t=>i.add(t))}),i.forEach(t=>{this[t]=this[`__original_${String(t)}`]})}}o._transformers.set(i,t.transformer),t.watch&&t.watch.forEach(t=>{let e=o._watching.get(t);e||(e=new Set,o._watching.set(t,e)),e.add(i)});const r=Object.getOwnPropertyDescriptor(e,i);let s;if(void 0===r)s={get(){return this[`__transform_${a}`]},set(t){const e=this[`__transform_${a}`],i=this._transformers.get(a);this[`__transform_${a}`]=i?i.call(this,t):t,this[`__original_${a}`]=t,this.requestUpdate(a,e)},configurable:!0,enumerable:!0};else{const t=r.set;s=Object.assign(Object.assign({},r),{},{set(e){const i=this[`__transform_${a}`],o=this._transformers.get(a);this[`__transform_${a}`]=o?o.call(this,e):e,this[`__original_${a}`]=e,this.requestUpdate(a,i),null==t||t.call(this,e)}})}Object.defineProperty(e,i,s)}}},86198:function(t,e,i){i.a(t,async function(t,a){try{i.d(e,{T:function(){return n}});var o=i(74487),r=i(22786),s=t([o]);o=(s.then?(await s)():s)[0];const n=(t,e)=>{try{var i,a;return null!==(i=null===(a=d(e))||void 0===a?void 0:a.of(t))&&void 0!==i?i:t}catch(o){return t}},d=(0,r.A)(t=>new Intl.DisplayNames(t.language,{type:"language",fallback:"code"}));a()}catch(n){a(n)}})},34470:function(t,e,i){i.d(e,{E:function(){return o}});let a;const o=(0,i(5124).AH)(a||(a=(t=>t)`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)}`))},63130:function(t,e,i){i.d(e,{l:function(){return o}});i(3362);var a=i(50248);const o=async(t,e)=>{var i;if(navigator.clipboard)try{return void(await navigator.clipboard.writeText(t))}catch(s){}const o=e||(null===(i=(0,a.n)())||void 0===i?void 0:i.getRootNode())||document.body,r=document.createElement("textarea");r.value=t,r.setAttribute("readonly",""),r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.opacity="0",o.appendChild(r),r.select(),document.execCommand("copy"),o.removeChild(r)}},3931:function(t,e,i){i.d(e,{U:function(){return a}});i(3362),i(62953);const a=async(t,e,i,a,o,...r)=>{let s=a[t];s||(s=a[t]={});const n=s[o];if(n)return n;const d=i(a,o,...r);return s[o]=d,d.then(()=>setTimeout(()=>{s[o]=void 0},e),()=>{s[o]=void 0}),d}},82474:function(t,e,i){i.a(t,async function(t,e){try{i(13609),i(18111),i(20116),i(61701),i(3362),i(62953);var a=i(40445),o=i(5124),r=i(67576),s=i(22786),n=i(1087),d=i(74705),l=i(78649),c=i(53756),h=i(95350),p=i(24367),u=i(19711),m=(i(75064),i(38508)),v=(i(47680),i(67094),i(74281)),g=t([m,v]);[m,v]=g.then?(await g)():g;let b,y,_,f,w,x,$,C,k,M,H,z,I,E,q,L=t=>t;const A="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",Z="M11,13.5V21.5H3V13.5H11M12,2L17.5,11H6.5L12,2M17.5,13C20,13 22,15 22,17.5C22,20 20,22 17.5,22C15,22 13,20 13,17.5C13,15 15,13 17.5,13Z",O="___create-new-entity___";class V extends o.WF{willUpdate(t){var e;this._pendingEntityId&&t.has("hass")&&this.hass.states!==(null===(e=t.get("hass"))||void 0===e?void 0:e.states)&&this.hass.states[this._pendingEntityId]&&(this._setValue(this._pendingEntityId),this._pendingEntityId=void 0)}firstUpdated(t){super.firstUpdated(t),this.hass.loadBackendTranslation("title")}_findExtraOption(t){var e;return t?null===(e=this.extraOptions)||void 0===e?void 0:e.find(e=>e.id===t):void 0}_renderExtraOptionStart(t){const e=t.entity_id?this.hass.states[t.entity_id]:void 0;return e?(0,o.qy)(b||(b=L` <state-badge slot="start" .stateObj="${0}" .hass="${0}"></state-badge> `),e,this.hass):t.icon_path?(0,o.qy)(y||(y=L` <ha-svg-icon slot="start" .path="${0}" style="margin:0 4px"></ha-svg-icon> `),t.icon_path):t.icon?(0,o.qy)(_||(_=L`<ha-icon slot="start" .icon="${0}"></ha-icon>`),t.icon):o.s6}get _showEntityId(){var t;return this.showEntityId||(null===(t=this.hass.userData)||void 0===t?void 0:t.showEntityIdPicker)}_shouldHideClearIcon(){var t;return!(null===(t=this._findExtraOption(this.value))||void 0===t||!t.hide_clear)}render(){var t,e;const i=null!==(t=this.placeholder)&&void 0!==t?t:this.hass.localize("ui.components.entity.entity-picker.placeholder");return(0,o.qy)(f||(f=L` <ha-generic-picker .hass="${0}" .disabled="${0}" .autofocus="${0}" .allowCustomValue="${0}" .required="${0}" .label="${0}" .placeholder="${0}" .helper="${0}" .value="${0}" .searchLabel="${0}" .notFoundLabel="${0}" .rowRenderer="${0}" .getItems="${0}" .getAdditionalItems="${0}" .hideClearIcon="${0}" .searchFn="${0}" .valueRenderer="${0}" .searchKeys="${0}" use-top-label .addButtonLabel="${0}" .unknownItemText="${0}" @value-changed="${0}"> </ha-generic-picker> `),this.hass,this.disabled,this.autofocus,this.allowCustomEntity,this.required,this.label,i,this.helper,this.addButton?void 0:this.value,this.searchLabel,this._notFoundLabel,this._rowRenderer,this._getItems,this._getAdditionalItems,this.hideClearIcon||this._shouldHideClearIcon(),this._searchFn,this._valueRenderer,c.t,this.addButton?null!==(e=this.addButtonLabel)&&void 0!==e?e:this.hass.localize("ui.components.entity.entity-picker.add"):void 0,this.hass.localize("ui.components.entity.entity-picker.unknown"),this._valueChanged)}async open(){var t;await this.updateComplete,await(null===(t=this._picker)||void 0===t?void 0:t.open())}_valueChanged(t){t.stopPropagation();const e=t.detail.value;if(e){if(e.startsWith(O)){const t=e.substring(O.length);return void(0,u.$)(this,{domain:t,dialogClosedCallback:t=>{t.entityId&&(this.hass.states[t.entityId]?this._setValue(t.entityId):this._pendingEntityId=t.entityId)}})}((0,l.n)(e)||this._findExtraOption(e))&&this._setValue(e)}else this._setValue(void 0)}_setValue(t){this.value=t,(0,n.r)(this,"value-changed",{value:t}),(0,n.r)(this,"change")}constructor(...t){super(...t),this.autofocus=!1,this.disabled=!1,this.required=!1,this.showEntityId=!1,this.hideClearIcon=!1,this.addButton=!1,this._valueRenderer=t=>{const e=t||"",i=this._findExtraOption(e);if(i)return(0,o.qy)(w||(w=L` ${0} <span slot="headline">${0}</span> ${0} `),this._renderExtraOptionStart(i),i.primary,i.secondary?(0,o.qy)(x||(x=L`<span slot="supporting-text">${0}</span>`),i.secondary):o.s6);const a=this.hass.states[e];if(!a)return(0,o.qy)($||($=L` <ha-svg-icon slot="start" .path="${0}" style="margin:0 4px"></ha-svg-icon> <span slot="headline">${0}</span> `),Z,e);const{primary:r,secondary:s}=(0,d.Bj)(this.hass,a);return(0,o.qy)(C||(C=L` <state-badge .hass="${0}" .stateObj="${0}" slot="start"></state-badge> <span slot="headline">${0}</span> <span slot="supporting-text">${0}</span> `),this.hass,a,r,s)},this._rowRenderer=(t,e)=>{const i=this._showEntityId;return(0,o.qy)(k||(k=L` <ha-combo-box-item type="button" compact="compact" .borderTop="${0}"> ${0} <span slot="headline">${0}</span> ${0} ${0} ${0} </ha-combo-box-item> `),0!==e,t.icon_path?(0,o.qy)(M||(M=L` <ha-svg-icon slot="start" style="margin:0 4px" .path="${0}"></ha-svg-icon> `),t.icon_path):(0,o.qy)(H||(H=L` <state-badge slot="start" .stateObj="${0}" .hass="${0}"></state-badge> `),t.stateObj,this.hass),t.primary,t.secondary?(0,o.qy)(z||(z=L`<span slot="supporting-text">${0}</span>`),t.secondary):o.s6,t.stateObj&&i?(0,o.qy)(I||(I=L` <span slot="supporting-text" class="code"> ${0} </span> `),t.stateObj.entity_id):o.s6,t.domain_name&&!i?(0,o.qy)(E||(E=L` <div slot="trailing-supporting-text" class="domain"> ${0} </div> `),t.domain_name):o.s6)},this._getAdditionalItems=()=>this._getCreateItems(this.hass.localize,this.createDomains),this._getCreateItems=(0,s.A)((t,e)=>null!=e&&e.length?(this.hass.loadFragmentTranslation("config"),e.map(e=>{const i=t("ui.components.entity.entity-picker.create_helper",{domain:(0,p.z)(e)?t(`ui.panel.config.helpers.types.${e}`)||e:(0,h.p$)(t,e)});return{id:O+e,primary:i,secondary:t("ui.components.entity.entity-picker.new_entity"),icon_path:A}})):[]),this._getEntitiesMemoized=(0,s.A)(c.w),this._getItems=()=>{var t;const e=this._getEntitiesMemoized(this.hass,this.includeDomains,this.excludeDomains,this.entityFilter,this.includeDeviceClasses,this.includeUnitOfMeasurement,this.includeEntities,this.excludeEntities,this.value);if(null!==(t=this.extraOptions)&&void 0!==t&&t.length){return[...this.extraOptions.map(t=>Object.assign(Object.assign({},t),{},{stateObj:t.entity_id?this.hass.states[t.entity_id]:void 0})),...e]}return e},this._searchFn=(t,e)=>{const i=e.findIndex(e=>{var i;return(null===(i=e.stateObj)||void 0===i?void 0:i.entity_id)===t});if(-1===i)return e;const[a]=e.splice(i,1);return e.unshift(a),e},this._notFoundLabel=t=>this.hass.localize("ui.components.entity.entity-picker.no_match",{term:(0,o.qy)(q||(q=L`<b>‘${0}’</b>`),t)})}}(0,a.Cg)([(0,r.MZ)({attribute:!1})],V.prototype,"hass",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],V.prototype,"autofocus",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],V.prototype,"disabled",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],V.prototype,"required",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,attribute:"allow-custom-entity"})],V.prototype,"allowCustomEntity",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,attribute:"show-entity-id"})],V.prototype,"showEntityId",void 0),(0,a.Cg)([(0,r.MZ)()],V.prototype,"label",void 0),(0,a.Cg)([(0,r.MZ)()],V.prototype,"value",void 0),(0,a.Cg)([(0,r.MZ)()],V.prototype,"helper",void 0),(0,a.Cg)([(0,r.MZ)()],V.prototype,"placeholder",void 0),(0,a.Cg)([(0,r.MZ)({type:String,attribute:"search-label"})],V.prototype,"searchLabel",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],V.prototype,"createDomains",void 0),(0,a.Cg)([(0,r.MZ)({type:Array,attribute:"include-domains"})],V.prototype,"includeDomains",void 0),(0,a.Cg)([(0,r.MZ)({type:Array,attribute:"exclude-domains"})],V.prototype,"excludeDomains",void 0),(0,a.Cg)([(0,r.MZ)({type:Array,attribute:"include-device-classes"})],V.prototype,"includeDeviceClasses",void 0),(0,a.Cg)([(0,r.MZ)({type:Array,attribute:"include-unit-of-measurement"})],V.prototype,"includeUnitOfMeasurement",void 0),(0,a.Cg)([(0,r.MZ)({type:Array,attribute:"include-entities"})],V.prototype,"includeEntities",void 0),(0,a.Cg)([(0,r.MZ)({type:Array,attribute:"exclude-entities"})],V.prototype,"excludeEntities",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],V.prototype,"entityFilter",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],V.prototype,"extraOptions",void 0),(0,a.Cg)([(0,r.MZ)({attribute:"hide-clear-icon",type:Boolean})],V.prototype,"hideClearIcon",void 0),(0,a.Cg)([(0,r.MZ)({attribute:"add-button",type:Boolean})],V.prototype,"addButton",void 0),(0,a.Cg)([(0,r.MZ)({attribute:"add-button-label"})],V.prototype,"addButtonLabel",void 0),(0,a.Cg)([(0,r.P)("ha-generic-picker")],V.prototype,"_picker",void 0),(0,a.Cg)([(0,r.wk)()],V.prototype,"_pendingEntityId",void 0),V=(0,a.Cg)([(0,r.EM)("ha-entity-picker")],V),e()}catch(b){e(b)}})},74281:function(t,e,i){i.a(t,async function(t,e){try{i(18111),i(7588),i(45367),i(92731),i(62953);var a=i(40445),o=i(5124),r=i(67576),s=i(63672),n=i(89784),d=i(71727),l=i(69093),c=i(52658),h=i(34470),p=i(10897),u=i(38279),m=i(93367),v=t([m]);m=(v.then?(await v)():v)[0];let g,b,y,_=t=>t;const f="M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z";class w extends o.WF{connectedCallback(){var t,e;super.connectedCallback(),this.hasUpdated&&void 0===this.overrideImage&&(null!==(t=this.stateObj)&&void 0!==t&&t.attributes.entity_picture||null!==(e=this.stateObj)&&void 0!==e&&e.attributes.entity_picture_local)&&this.requestUpdate("stateObj")}disconnectedCallback(){var t,e;super.disconnectedCallback(),void 0===this.overrideImage&&(null!==(t=this.stateObj)&&void 0!==t&&t.attributes.entity_picture||null!==(e=this.stateObj)&&void 0!==e&&e.attributes.entity_picture_local)&&(this.style.backgroundImage="")}get _stateColor(){var t;const e=this.stateObj?(0,l.t)(this.stateObj):void 0;return null!==(t=this.stateColor)&&void 0!==t?t:"light"===e}render(){const t=this.stateObj;if(!t&&!this.overrideIcon&&!this.overrideImage)return(0,o.qy)(g||(g=_`<div class="missing"> <ha-svg-icon .path="${0}"></ha-svg-icon> </div>`),f);const e=this.getClass();if(e&&e.forEach((t,e)=>{t?this.classList.add(e):this.classList.remove(e)}),!this.icon)return o.s6;const i=t?(0,l.t)(t):void 0;return(0,o.qy)(b||(b=_`<ha-state-icon style="${0}" data-domain="${0}" data-state="${0}" .icon="${0}" .stateObj="${0}"></ha-state-icon>`),(0,n.W)(this._iconStyle),(0,s.J)(i),(0,s.J)(null==t?void 0:t.state),this.overrideIcon,t)}willUpdate(t){if(super.willUpdate(t),!(t.has("stateObj")||t.has("overrideImage")||t.has("overrideIcon")||t.has("stateColor")||t.has("color")))return;const e=this.stateObj,i={};let a="";if(this.icon=!0,e){const t=(0,d.m)(e.entity_id);if(void 0===this.overrideImage)if(!e.attributes.entity_picture_local&&!e.attributes.entity_picture||this.overrideIcon){if(this.color)i.color=this.color;else if(this._stateColor){const t=(0,c.Se)(e);if(t&&(i.color=t),e.attributes.rgb_color&&(i.color=`rgb(${e.attributes.rgb_color.join(",")})`),e.attributes.brightness){const t=e.attributes.brightness;if("number"!=typeof t){const i=`Type error: state-badge expected number, but type of ${e.entity_id}.attributes.brightness is ${typeof t} (${t})`;console.warn(i)}i.filter=(0,c.mT)(e)}if(e.attributes.hvac_action){const t=e.attributes.hvac_action;t in u.sx?i.color=(0,c.Se)(e,u.sx[t]):delete i.color}}}else{let i=e.attributes.entity_picture_local||e.attributes.entity_picture;this.hass&&(i=this.hass.hassUrl(i)),"camera"===t&&(i=(0,p.su)(i,80,80)),a=`url(${i})`,this.icon=!1}else if(this.overrideImage){let t=this.overrideImage;this.hass&&(t=this.hass.hassUrl(t)),a=`url(${t})`,this.icon=!1}}this._iconStyle=i,this.style.backgroundImage=a}getClass(){const t=new Map(["has-no-radius","has-media-image","has-image"].map(t=>[t,!1]));if(this.stateObj){const e=(0,d.m)(this.stateObj.entity_id);"update"===e?t.set("has-no-radius",!0):"media_player"===e||"camera"===e?t.set("has-media-image",!0):""!==this.style.backgroundImage&&t.set("has-image",!0)}return t}static get styles(){return[h.E,(0,o.AH)(y||(y=_`: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(...t){super(...t),this.icon=!0,this._iconStyle={}}}(0,a.Cg)([(0,r.MZ)({attribute:!1})],w.prototype,"stateObj",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],w.prototype,"overrideIcon",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],w.prototype,"overrideImage",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],w.prototype,"stateColor",void 0),(0,a.Cg)([(0,r.MZ)()],w.prototype,"color",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],w.prototype,"icon",void 0),(0,a.Cg)([(0,r.wk)()],w.prototype,"_iconStyle",void 0),w=(0,a.Cg)([(0,r.EM)("state-badge")],w),e()}catch(g){e(g)}})},38962:function(t,e,i){i.a(t,async function(t,a){try{i.r(e);i(62953);var o=i(40445),r=i(5124),s=i(67576),n=i(6412),d=i(93421),l=i(1087),c=i(26300),h=(i(67094),t([c]));c=(h.then?(await h)():h)[0];let p,u,m,v,g=t=>t;const b="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",y={info:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",success:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"};class _ extends r.WF{render(){var t;return(0,r.qy)(p||(p=g` <div class="issue-type ${0}" role="alert"> <div class="icon ${0}"> <slot name="icon"> <ha-svg-icon .path="${0}"></ha-svg-icon> </slot> </div> <div class="${0}"> <div class="main-content"> ${0} <slot></slot> </div> <div class="action"> <slot name="action"> ${0} </slot> </div> </div> </div> `),(0,n.H)({[this.alertType]:!0}),this.title?"":"no-title",y[this.alertType],(0,n.H)({content:!0,narrow:this.narrow}),this.title?(0,r.qy)(u||(u=g`<div class="title">${0}</div>`),this.title):r.s6,this.dismissable?(0,r.qy)(m||(m=g`<ha-icon-button @click="${0}" .label="${0}" .path="${0}"></ha-icon-button>`),this._dismissClicked,null===(t=this._localize)||void 0===t?void 0:t.call(this,"ui.common.dismiss_alert"),b):r.s6)}_dismissClicked(){(0,l.r)(this,"alert-dismissed-clicked")}constructor(...t){super(...t),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}_.styles=(0,r.AH)(v||(v=g`.issue-type{position:relative;padding:8px;display:flex}.icon{height:var(--ha-alert-icon-size,24px);width:var(--ha-alert-icon-size,24px)}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:var(--ha-border-radius-sm)}.icon.no-title{align-self:center}.content{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:var(--float-start)}.content.narrow{flex-direction:column;align-items:flex-end}.action{z-index:1;width:min-content;--mdc-theme-primary:var(--primary-text-color)}.main-content{overflow-wrap:anywhere;word-break:break-word;line-height:normal;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:8px}.title{margin-top:2px;font-weight:var(--ha-font-weight-bold)}.action ha-icon-button{--mdc-theme-primary:var(--primary-text-color);--ha-icon-button-size:36px}.issue-type.info>.icon{color:var(--info-color)}.issue-type.info::after{background-color:var(--info-color)}.issue-type.warning>.icon{color:var(--warning-color)}.issue-type.warning::after{background-color:var(--warning-color)}.issue-type.error>.icon{color:var(--error-color)}.issue-type.error::after{background-color:var(--error-color)}.issue-type.success>.icon{color:var(--success-color)}.issue-type.success::after{background-color:var(--success-color)}:host ::slotted(ul){margin:0;padding-inline-start:20px}`)),(0,o.Cg)([(0,s.MZ)()],_.prototype,"title",void 0),(0,o.Cg)([(0,s.MZ)({attribute:"alert-type"})],_.prototype,"alertType",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],_.prototype,"dismissable",void 0),(0,o.Cg)([(0,s.wk)(),(0,d.IW)()],_.prototype,"_localize",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],_.prototype,"narrow",void 0),_=(0,o.Cg)([(0,s.EM)("ha-alert")],_),a()}catch(p){a(p)}})},99611:function(t,e,i){i.a(t,async function(t,e){try{i(18111),i(13579),i(3362),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);var a=i(40445),o=i(1126),r=i(35211),s=i(5124),n=i(67576),d=i(1087),l=i(60353),c=i(22792),h=i(59992),p=i(14503),u=i(22348),m=t([o,h]);[o,h]=m.then?(await m)():m;let v,g,b=t=>t;const y=300,_=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"]),f=new Set(["volume-slider-container","forecast"]);class w 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(t){super.updated(t),t.has("open")&&(this._drawerOpen=this.open)}render(){return(0,s.qy)(v||(v=b` <wa-drawer id="drawer" placement="bottom" .open="${0}" .lightDismiss="${0}" .ariaLabelledby="${0}" .ariaDescribedby="${0}" @keydown="${0}" @wa-show="${0}" @wa-after-show="${0}" @wa-hide="${0}" @wa-after-hide="${0}" @click="${0}" without-header @touchstart="${0}"> <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> ${0} </div> <slot name="footer"></slot> </wa-drawer> `),this._drawerOpen,!this.preventScrimClose,this.ariaLabelledBy,this.ariaDescribedBy,this._handleKeyDown,this._handleShow,this._handleAfterShow,this._handleHide,this._handleAfterHide,this._handleCloseAction,this._handleTouchStart,this.renderScrollableFades())}_startResizing(t){document.addEventListener("touchmove",this._handleTouchMove,{passive:!1}),document.addEventListener("touchend",this._handleTouchEnd),document.addEventListener("touchcancel",this._handleTouchEnd),this._gestureRecognizer.start(t)}_animateSnapBack(){this.style.setProperty("--dialog-transition",`transform ${y}ms ease-out`),this.style.removeProperty("--dialog-transform"),setTimeout(()=>{this.style.removeProperty("--dialog-transition")},y)}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,p.dp,(0,s.AH)(g||(g=b`wa-drawer{--wa-color-surface-raised:transparent;--spacing:0;--size:var(--ha-bottom-sheet-height, auto);--show-duration:${0}ms;--hide-duration:${0}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}`),y,y)]}constructor(...t){super(...t),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,d.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{var t;const e=this._autofocusElement;null!==(t=this._hassConfig)&&void 0!==t&&t.auth.external&&(0,u.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}})):null==e||e.focus()})},this._handleAfterShow=()=>{(0,d.r)(this,"after-show")},this._handleSliderInteractionStart=()=>{this._sliderInteractionActive=!0},this._handleSliderInteractionStop=()=>{this._sliderInteractionActive=!1},this._handleAfterHide=t=>{if(this._sliderInteractionActive)return this._drawerOpen=!0,void(this.open=!0);t.eventPhase===Event.AT_TARGET&&(this.open=!1,this._drawerOpen=!1,(0,d.r)(this,"closed"))},this._handleHide=t=>{if(t.eventPhase!==Event.AT_TARGET)return;const e=t.detail.source===t.target.drawer;if(this._sliderInteractionActive)return t.preventDefault(),this._drawerOpen=!0,this.open=!0,void(this._escapePressed=!1);this.preventScrimClose&&this._escapePressed&&e&&t.preventDefault(),this._escapePressed=!1},this._handleKeyDown=t=>{"Escape"===t.key&&(this._escapePressed=!0,this.preventScrimClose&&t.preventDefault(),t.stopPropagation(),t.currentTarget.open=!1)},this._handleCloseAction=t=>{t.composedPath().some(t=>t instanceof HTMLElement&&("close"===t.getAttribute("data-dialog")||"close"===t.getAttribute("data-drawer")))&&(this._drawerOpen=!1)},this._handleTouchStart=t=>{if(this.preventScrimClose)return;const e=t.composedPath();for(const i of e){if(i===this._drawer)break;if(i instanceof HTMLElement&&(i.scrollTop>0||_.has(i.localName)||Array.from(i.classList).some(t=>f.has(t))))return}t.stopPropagation(),this._startResizing(t.touches[0].clientY)},this._handleTouchMove=t=>{const e=t.touches[0].clientY,i=this._gestureRecognizer.move(e);i<0&&(t.preventDefault(),this._isDragging=!0,requestAnimationFrame(()=>{this._isDragging&&this.style.setProperty("--dialog-transform",`translateY(${-1*i}px)`)}))},this._handleTouchEnd=()=>{var t;this._unregisterResizeHandlers(),this._isDragging=!1;const e=this._gestureRecognizer.end();if(e.isSwipe)return void(e.isDownwardSwipe?this._drawerOpen=!1:this._animateSnapBack());const i=null===(t=this._drawer.shadowRoot)||void 0===t?void 0:t.querySelector('[part="body"]'),a=(null==i?void 0:i.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,a.Cg)([(0,n.MZ)({attribute:"aria-labelledby"})],w.prototype,"ariaLabelledBy",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"aria-describedby"})],w.prototype,"ariaDescribedBy",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],w.prototype,"open",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],w.prototype,"flexContent",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],w.prototype,"preventScrimClose",void 0),(0,a.Cg)([(0,n.wk)()],w.prototype,"_drawerOpen",void 0),(0,a.Cg)([(0,n.wk)()],w.prototype,"_sliderInteractionActive",void 0),(0,a.Cg)([(0,n.wk)(),(0,r.Fg)({context:c.WF,subscribe:!0})],w.prototype,"_hassConfig",void 0),(0,a.Cg)([(0,n.P)("#drawer")],w.prototype,"_drawer",void 0),(0,a.Cg)([(0,n.P)("#body")],w.prototype,"_bodyElement",void 0),(0,a.Cg)([(0,n.P)("[autofocus]")],w.prototype,"_autofocusElement",void 0),w=(0,a.Cg)([(0,n.EM)("ha-bottom-sheet")],w),e()}catch(v){e(v)}})},76776:function(t,e,i){i(62953);var a=i(40445),o=i(5124),r=i(67576);let s,n,d,l=t=>t;class c extends o.WF{render(){return(0,o.qy)(s||(s=l` ${0} <slot></slot> `),this.header?(0,o.qy)(n||(n=l`<h1 class="card-header">${0}</h1>`),this.header):o.s6)}constructor(...t){super(...t),this.raised=!1}}c.styles=(0,o.AH)(d||(d=l`:host{background:var(--ha-card-background,var(--card-background-color,#fff));-webkit-backdrop-filter:var(--ha-card-backdrop-filter,none);backdrop-filter:var(--ha-card-backdrop-filter,none);box-shadow:var(--ha-card-box-shadow,none);box-sizing:border-box;border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-width:var(--ha-card-border-width,1px);border-style:solid;border-color:var(--ha-card-border-color,var(--divider-color,#e0e0e0));color:var(--primary-text-color);display:block;transition:all .3s ease-out;position:relative}:host([raised]){border:none;box-shadow:var(--ha-card-box-shadow,0px 2px 1px -1px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 1px 3px 0px rgba(0,0,0,.12))}.card-header,:host ::slotted(.card-header){color:var(--ha-card-header-color,var(--primary-text-color));font-family:var(--ha-card-header-font-family, inherit);font-size:var(--ha-card-header-font-size, var(--ha-font-size-2xl));letter-spacing:-.012em;line-height:var(--ha-line-height-expanded);padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4);display:block;margin-block-start:0;margin-block-end:0;font-weight:var(--ha-font-weight-normal)}
    :host
      ::slotted(
        .card-content:not(:nth-child(1 of .card-content, .card-header))
      ),
    slot:not(:first-child)::slotted(.card-content) {
      padding-top: 0;
      margin-top: calc(var(--ha-space-2) * -1);
    }
    :host ::slotted(.card-content){padding:var(--ha-space-4)}:host ::slotted(.card-actions){border-top:1px solid var(--divider-color,#e8e8e8);padding:var(--ha-space-2)}`)),(0,a.Cg)([(0,r.MZ)()],c.prototype,"header",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],c.prototype,"raised",void 0),c=(0,a.Cg)([(0,r.EM)("ha-card")],c)},70947:function(t,e,i){i(62953);var a=i(40445),o=i(50759),r=(i(38625),i(5124)),s=i(67576);i(67094);let n,d,l=t=>t;class c extends o.A{renderCheckboxIcon(){return(0,r.qy)(n||(n=l` <ha-svg-icon id="check" part="checkmark" .path="${0}"></ha-svg-icon> `),this.checked?"M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z":"M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z")}static get styles(){return[o.A.styles,(0,r.AH)(d||(d=l`:host{min-height:var(--ha-space-10)}#check{visibility:visible;flex-shrink:0}#icon ::slotted(*){color:var(--ha-color-on-neutral-normal)}:host([variant=danger]) #icon ::slotted(*){color:var(--ha-color-on-danger-quiet)}:host([selected]){font-weight:var(--ha-font-weight-medium);color:var(--primary-color);background-color:var(--ha-color-fill-primary-quiet-resting);--icon-primary-color:var(--primary-color)}:host([selected]:hover){background-color:var(--ha-color-fill-primary-quiet-hover)}`))]}constructor(...t){super(...t),this.selected=!1}}(0,a.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],c.prototype,"selected",void 0),c=(0,a.Cg)([(0,s.EM)("ha-dropdown-item")],c)},29823:function(t,e,i){i.a(t,async function(t,e){try{i(3362),i(62953);var a=i(40445),o=i(52254),r=i(5124),s=i(67576),n=t([o]);o=(n.then?(await n)():n)[0];let d,l=t=>t;class c extends o.A{get anchorElement(){var t;return null===(t=this.popup)||void 0===t?void 0:t.anchor}set anchorElement(t){this.popup&&(this.popup.anchor&&"ha-icon-button"===this.popup.anchor.localName&&(this.popup.anchor.selected=!1),this.popup.anchor=t)}getTrigger(){return this.anchorElement?this.anchorElement:super.getTrigger()}async showMenu(){await super.showMenu();const t=this.getTrigger();t&&"ha-icon-button"===t.localName&&(t.selected=!0)}async hideMenu(){const t=this.getTrigger();t&&"ha-icon-button"===t.localName&&(t.selected=!1),await super.hideMenu()}static get styles(){return[o.A.styles,(0,r.AH)(d||(d=l`:host{font-size:var(--ha-dropdown-font-size, var(--ha-font-size-m));--wa-color-surface-raised:var(
            --card-background-color,
            var(--ha-dialog-surface-background, var(--mdc-theme-surface, #fff)),
          )}#menu{padding:var(--ha-space-1)}wa-popup::part(popup){z-index:200}`))]}constructor(...t){super(...t),this.dropdownTag="ha-dropdown",this.dropdownItemTag="ha-dropdown-item"}}(0,a.Cg)([(0,s.MZ)({attribute:!1})],c.prototype,"dropdownTag",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],c.prototype,"dropdownItemTag",void 0),c=(0,a.Cg)([(0,s.EM)("ha-dropdown")],c),e()}catch(d){e(d)}})},90248:function(t,e,i){i.a(t,async function(t,a){try{i.r(e),i.d(e,{HaIconButtonArrowPrev:function(){return m}});i(62953);var o=i(40445),r=i(5124),s=i(67576),n=i(63091),d=i(26300),l=t([d]);d=(l.then?(await l)():l)[0];let c,h=t=>t;const p="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",u="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z";class m extends r.WF{render(){var t;return(0,r.qy)(c||(c=h` <ha-icon-button .disabled="${0}" .label="${0}" .path="${0}" .href="${0}" .target="${0}" .rel="${0}" .download="${0}"></ha-icon-button> `),this.disabled,this.label||(null===(t=this.hass)||void 0===t?void 0:t.localize("ui.common.back"))||"Back",this._icon,this.href,this.target,this.rel,this.download)}constructor(...t){super(...t),this.disabled=!1,this._icon="rtl"===n.G.document.dir?u:p}}(0,o.Cg)([(0,s.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],m.prototype,"disabled",void 0),(0,o.Cg)([(0,s.MZ)()],m.prototype,"label",void 0),(0,o.Cg)([(0,s.MZ)()],m.prototype,"href",void 0),(0,o.Cg)([(0,s.MZ)()],m.prototype,"target",void 0),(0,o.Cg)([(0,s.MZ)()],m.prototype,"rel",void 0),(0,o.Cg)([(0,s.MZ)()],m.prototype,"download",void 0),(0,o.Cg)([(0,s.wk)()],m.prototype,"_icon",void 0),m=(0,o.Cg)([(0,s.EM)("ha-icon-button-arrow-prev")],m),a()}catch(c){a(c)}})},28732:function(t,e,i){var a=i(40445),o=i(27686),r=i(7731),s=i(5124),n=i(67576);let d,l,c,h=t=>t;class p extends o.J{renderRipple(){return this.noninteractive?"":super.renderRipple()}static get styles(){return[r.R,(0,s.AH)(d||(d=h`:host{padding-left:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-inline-start:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-right:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px));padding-inline-end:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px))}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:48px}span.material-icons:first-of-type{margin-inline-start:0px!important;margin-inline-end:var(--mdc-list-item-graphic-margin,16px)!important;direction:var(--direction)!important}span.material-icons:last-of-type{margin-inline-start:auto!important;margin-inline-end:0px!important;direction:var(--direction)!important}.mdc-deprecated-list-item__meta{display:var(--mdc-list-item-meta-display);align-items:center;flex-shrink:0}:host([graphic=icon]:not([twoline])) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,20px)!important}:host([multiline-secondary]){height:auto}:host([multiline-secondary]) .mdc-deprecated-list-item__text{padding:8px 0}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text{text-overflow:initial;white-space:normal;overflow:auto;display:inline-block;margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text{margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text::before{display:none}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text::before{display:none}:host([disabled]){color:var(--disabled-text-color)}:host([noninteractive]){pointer-events:unset}`)),"rtl"===document.dir?(0,s.AH)(l||(l=h`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`)):(0,s.AH)(c||(c=h``))]}}p=(0,a.Cg)([(0,n.EM)("ha-list-item")],p)},8630:function(t,e,i){var a=i(40445),o=i(68618),r=i(11081),s=i(67576);class n extends o.iY{}n.styles=r.R,n=(0,a.Cg)([(0,s.EM)("ha-list")],n)},54276:function(t,e,i){i(62953);var a=i(40445),o=i(76482),r=i(91382),s=i(96245),n=i(5124),d=i(67576);let l;class c extends r.n{attach(t){super.attach(t),this.attachableTouchController.attach(t)}disconnectedCallback(){super.disconnectedCallback(),this.hovered=!1,this.pressed=!1}detach(){super.detach(),this.attachableTouchController.detach()}_onTouchControlChange(t,e){null==t||t.removeEventListener("touchend",this._handleTouchEnd),null==e||e.addEventListener("touchend",this._handleTouchEnd)}constructor(...t){super(...t),this.attachableTouchController=new o.i(this,this._onTouchControlChange.bind(this)),this._handleTouchEnd=()=>{this.disabled||super.endPressAnimation()}}}c.styles=[s.R,(0,n.AH)(l||(l=(t=>t)`:host{--md-ripple-hover-opacity:var(--ha-ripple-hover-opacity, 0.08);--md-ripple-pressed-opacity:var(--ha-ripple-pressed-opacity, 0.12);--md-ripple-hover-color:var(
          --ha-ripple-hover-color,
          var(--ha-ripple-color, var(--secondary-text-color))
        );--md-ripple-pressed-color:var(
          --ha-ripple-pressed-color,
          var(--ha-ripple-color, var(--secondary-text-color))
        )}`))],c=(0,a.Cg)([(0,d.EM)("ha-ripple")],c)},606:function(t,e,i){i.a(t,async function(t,e){try{i(74423),i(18111),i(61701),i(62953);var a=i(40445),o=i(5124),r=i(67576),s=i(63672),n=i(22786),d=i(1087),l=i(29823),c=(i(70947),i(3449),i(88285)),h=(i(67094),t([l,c]));[l,c]=h.then?(await h)():h;let p,u,m,v,g,b,y,_,f,w=t=>t;class x extends o.WF{render(){return this.disabled?(0,o.qy)(p||(p=w`${0}${0}`),this._renderField(),this._renderHelper()):(0,o.qy)(u||(u=w` <ha-dropdown placement="bottom" @wa-select="${0}" @wa-show="${0}" @wa-hide="${0}"> ${0} ${0} </ha-dropdown> ${0} `),this._handleSelect,this._handleShow,this._handleHide,this._renderField(),this.options?this.options.map(t=>{var e;const i=["string","number"].includes(typeof t);return(0,o.qy)(m||(m=w` <ha-dropdown-item .value="${0}" .disabled="${0}" .selected="${0}"> ${0} <div class="content"> ${0} ${0} </div> </ha-dropdown-item> `),i?t:t.value,!i&&(null!==(e=t.disabled)&&void 0!==e&&e),this.value===(i?t:t.value),t.iconPath?(0,o.qy)(v||(v=w`<ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon>`),t.iconPath):o.s6,i?t:t.label||t.value,t.secondary?(0,o.qy)(g||(g=w`<div class="secondary">${0}</div>`),t.secondary):o.s6)}):(0,o.qy)(b||(b=w`<slot></slot>`)),this._renderHelper())}_renderField(){const t=this._getValueLabel(this.options,this.value);return(0,o.qy)(y||(y=w` <ha-picker-field slot="trigger" type="button" class="${0}" compact="compact" aria-label="${0}" @clear="${0}" .label="${0}" .value="${0}" .required="${0}" .disabled="${0}" .hideClearIcon="${0}"> </ha-picker-field> `),this._opened?"opened":"",(0,s.J)(this.label),this._clearValue,this.label,t,this.required,this.disabled,!this.clearable||this.required||this.disabled||!String(this.value))}_renderHelper(){return this.helper?(0,o.qy)(_||(_=w`<ha-input-helper-text .disabled="${0}">${0}</ha-input-helper-text>`),this.disabled,this.helper):o.s6}_handleSelect(t){t.stopPropagation();const e=t.detail.item.value;e!==this.value&&(0,d.r)(this,"selected",{value:e})}_clearValue(){!this.disabled&&this.value&&(0,d.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(...t){super(...t),this.clearable=!1,this.required=!1,this.disabled=!1,this._opened=!1,this._getValueLabel=(0,n.A)((t,e)=>{const i=void 0!==e?String(e):void 0;if(!t||!i)return i;for(const a of t){const t=["string","number"].includes(typeof a);if(t&&a===i||!t&&String(a.value)===i)return t?a:a.label||a.value}return i})}}x.styles=(0,o.AH)(f||(f=w`: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,a.Cg)([(0,r.MZ)({type:Boolean})],x.prototype,"clearable",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],x.prototype,"options",void 0),(0,a.Cg)([(0,r.MZ)()],x.prototype,"label",void 0),(0,a.Cg)([(0,r.MZ)()],x.prototype,"helper",void 0),(0,a.Cg)([(0,r.MZ)()],x.prototype,"value",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],x.prototype,"required",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],x.prototype,"disabled",void 0),(0,a.Cg)([(0,r.wk)()],x.prototype,"_opened",void 0),(0,a.Cg)([(0,r.P)("ha-picker-field")],x.prototype,"_triggerField",void 0),x=(0,a.Cg)([(0,r.EM)("ha-select")],x),e()}catch(p){e(p)}})},56304:function(t,e,i){i.a(t,async function(t,e){try{i(3362),i(27495),i(62953),i(49255);var a=i(40445),o=i(99324),r=i(92070),s=i(5124),n=i(67576),d=i(6412),l=i(63672),c=i(57237),h=i(53305),p=t([o]);o=(p.then?(await p)():p)[0];let u,m,v,g,b=t=>t;class y extends((0,h.w)(s.WF)){get _formControl(){return this._textarea}setFocused(t){t?this.toggleAttribute("focused",!0):this.removeAttribute("focused")}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",c.d)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",c.d)}async firstUpdated(t){var e,i;(super.firstUpdated(t),this.autofocus)&&(await(null===(e=this._textarea)||void 0===e?void 0:e.updateComplete),null===(i=this._textarea)||void 0===i||i.focus())}focus(t){var e;null===(e=this._textarea)||void 0===e||e.focus(t)}render(){var t,e,i;const a=!this.label&&this._hasSlotController.test("label"),o=!this.hint&&this._hasSlotController.test("hint");return(0,s.qy)(u||(u=b` <wa-textarea .value="${0}" .placeholder="${0}" .readonly="${0}" .required="${0}" .rows="${0}" .resize="${0}" .disabled="${0}" name="${0}" autocapitalize="${0}" autocomplete="${0}" .autofocus="${0}" .spellcheck="${0}" inputmode="${0}" enterkeyhint="${0}" minlength="${0}" maxlength="${0}" class="${0}" @input="${0}" @change="${0}" @blur="${0}" @wa-invalid="${0}" exportparts="base:wa-base, hint:wa-hint, textarea:wa-textarea"> ${0} <div slot="hint" class="${0}" role="${0}" aria-live="polite"> ${0} </div> </wa-textarea> `),null!==(t=this.value)&&void 0!==t?t:null,this.placeholder,this.readonly,this.required,null!==(e=this.rows)&&void 0!==e?e:4,this.resize,this.disabled,(0,l.J)(this.name),(0,l.J)(this.autocapitalize||void 0),(0,l.J)(this.autocomplete),this.autofocus,this.spellcheck,(0,l.J)(this.inputmode||void 0),(0,l.J)(this.enterkeyhint||void 0),(0,l.J)(this.minlength),(0,l.J)(this.maxlength),(0,d.H)({input:!0,invalid:this.invalid||this._invalid,"label-raised":void 0!==this.value&&""!==this.value||this.label&&this.placeholder,"no-label":!this.label,"hint-hidden":!(this.hint||o||this.required||this._invalid||this.invalid)}),this._handleInput,this._handleChange,this._handleBlur,this._handleInvalid,this.label||a?(0,s.qy)(m||(m=b`<slot name="label" slot="label">${0}</slot>`),this.label?this._renderLabel(this.label,this.required):s.s6):s.s6,(0,d.H)({error:this.invalid||this._invalid}),(0,l.J)(this.invalid||this._invalid?"alert":void 0),this._invalid||this.invalid?this.validationMessage||(null===(i=this._textarea)||void 0===i?void 0:i.validationMessage):this.hint||(o?(0,s.qy)(v||(v=b`<slot name="hint"></slot>`)):s.s6))}constructor(...t){super(...t),this.resize="none",this._hasSlotController=new r.X(this,"label","hint"),this._requiredMarkerCSSVar="--ha-textarea-required-marker"}}y.styles=[h.N,(0,s.AH)(g||(g=b`:host{display:flex;align-items:flex-start;padding-bottom:var(--ha-textarea-padding-bottom)}wa-textarea::part(label){width:calc(100% - var(--ha-space-2));background-color:var(--ha-color-form-background);transition:all var(--wa-transition-normal) ease-in-out,background-color var(--wa-transition-normal) ease-in-out;padding-inline-start:var(--ha-space-3);padding-inline-end:var(--ha-space-3);margin:var(--ha-space-1) var(--ha-space-1) 0;padding-top:var(--ha-space-4);white-space:nowrap;overflow:hidden}:host(:focus-within) wa-textarea::part(label),:host([focused]) wa-textarea::part(label){color:var(--primary-color)}:host(:focus-within) wa-textarea::part(label),:host([focused]) wa-textarea::part(label),wa-textarea.label-raised::part(label){padding-top:var(--ha-space-2);font-size:var(--ha-font-size-xs)}wa-textarea.no-label::part(label){height:0;padding:0}wa-textarea::part(base){min-height:56px;padding-top:var(--ha-space-6);padding-bottom:var(--ha-space-2)}wa-textarea.no-label::part(base){padding-top:var(--ha-space-3)}wa-textarea::part(base)::after{content:"";position:absolute;bottom:0;left:0;right:0;height:1px;background-color:var(--ha-color-border-neutral-loud);transition:height var(--wa-transition-normal) ease-in-out,background-color var(--wa-transition-normal) ease-in-out}:host(:focus-within) wa-textarea::part(base)::after,:host([focused]) wa-textarea::part(base)::after{height:2px;background-color:var(--primary-color)}:host(:focus-within) wa-textarea.invalid::part(base)::after,wa-textarea.invalid:not([disabled])::part(base)::after{background-color:var(--ha-color-border-danger-normal)}wa-textarea::part(textarea){padding:0 var(--ha-space-4);font-family:var(--ha-font-family-body);font-size:var(--ha-font-size-m)}:host([resize=auto]) wa-textarea::part(textarea){max-height:var(--ha-textarea-max-height,200px);overflow-y:auto}wa-textarea:hover::part(base),wa-textarea:hover::part(label){background-color:var(--ha-color-form-background-hover)}wa-textarea[disabled]::part(textarea){cursor:not-allowed}wa-textarea[disabled]::part(base),wa-textarea[disabled]::part(label){background-color:var(--ha-color-form-background-disabled)}`))],(0,a.Cg)([(0,n.MZ)({type:Number})],y.prototype,"rows",void 0),(0,a.Cg)([(0,n.MZ)()],y.prototype,"resize",void 0),(0,a.Cg)([(0,n.P)("wa-textarea")],y.prototype,"_textarea",void 0),y=(0,a.Cg)([(0,n.EM)("ha-textarea")],y),e()}catch(u){e(u)}})},34127:function(t,e,i){i.a(t,async function(t,e){try{i(62953);var a=i(40445),o=i(52630),r=i(5124),s=i(67576),n=t([o]);o=(n.then?(await n)():n)[0];let d,l=t=>t;class c extends o.A{static get styles(){return[o.A.styles,(0,r.AH)(d||(d=l`:host{--wa-tooltip-background-color:var(
            --ha-tooltip-background-color,
            var(--ha-color-surface-default)
          );--wa-tooltip-content-color:var(
            --ha-tooltip-text-color,
            var(--primary-text-color)
          );--wa-tooltip-font-family:var(
            --ha-tooltip-font-family,
            var(--ha-font-family-body)
          );--wa-tooltip-font-size:var(
            --ha-tooltip-font-size,
            var(--ha-font-size-m)
          );--wa-tooltip-font-weight:var(
            --ha-tooltip-font-weight,
            var(--ha-font-weight-medium)
          );--wa-tooltip-line-height:var(
            --ha-tooltip-line-height,
            var(--ha-line-height-condensed)
          );--wa-tooltip-padding:var(--ha-tooltip-padding, var(--ha-space-2));--wa-tooltip-border-radius:var(
            --ha-tooltip-border-radius,
            var(--ha-border-radius-md)
          );--wa-tooltip-arrow-size:var(--ha-tooltip-arrow-size, 0px);--wa-tooltip-border-width:0px;--wa-z-index-tooltip:1000}.tooltip::part(popup){animation-duration:var(--ha-tooltip-animation-duration, 0)}.body{box-shadow:var(--ha-tooltip-box-shadow,var(--ha-box-shadow-m))}`))]}constructor(...t){super(...t),this.showDelay=350,this.hideDelay=150}}(0,a.Cg)([(0,s.MZ)({attribute:"show-delay",type:Number})],c.prototype,"showDelay",void 0),(0,a.Cg)([(0,s.MZ)({attribute:"hide-delay",type:Number})],c.prototype,"hideDelay",void 0),c=(0,a.Cg)([(0,s.EM)("ha-tooltip")],c),e()}catch(d){e(d)}})},58933:function(t,e,i){i.a(t,async function(t,e){try{i(13609),i(18111),i(61701),i(13579),i(3362),i(62953);var a=i(40445),o=i(5124),r=i(67576),s=i(1087),n=i(9899),d=i(52069),l=i(606),c=t([l]);l=(c.then?(await c)():c)[0];let h,p,u=t=>t;const m="__NONE_OPTION__";class v extends o.WF{render(){var t,e;if(!this._voices)return o.s6;const i=null!==(t=this.value)&&void 0!==t?t:this.required?null===(e=this._voices[0])||void 0===e?void 0:e.voice_id:m,a=(this._voices||[]).map(t=>({value:t.voice_id,label:t.name}));return this.required&&this.value||a.unshift({value:m,label:this.hass.localize("ui.components.tts-voice-picker.none")}),(0,o.qy)(h||(h=u` <ha-select .label="${0}" .value="${0}" .required="${0}" .disabled="${0}" @selected="${0}" .options="${0}"> </ha-select> `),this.label||this.hass.localize("ui.components.tts-voice-picker.voice"),i,this.required,this.disabled,this._changed,a)}willUpdate(t){super.willUpdate(t),this.hasUpdated?(t.has("language")||t.has("engineId"))&&this._debouncedUpdateVoices():this._updateVoices()}async _updateVoices(){var t,e;if(!this.engineId||!this.language)return void(this._voices=void 0);this._voices=(await(0,d.z3)(this.hass,this.engineId,this.language)).voices;if(this.value&&(null===(t=this._voices)||void 0===t?void 0:t.some(t=>t.voice_id===this.value)))return;const i=this.required&&null!==(e=this._voices)&&void 0!==e&&e.length?this._voices[0].voice_id:void 0;i!==this.value&&(this.value=i,(0,s.r)(this,"value-changed",{value:this.value}))}_changed(t){const e=t.detail.value;!this.hass||""===e||e===this.value||void 0===this.value&&e===m||(this.value=e===m?void 0:e,(0,s.r)(this,"value-changed",{value:this.value}))}constructor(...t){super(...t),this.disabled=!1,this.required=!1,this._debouncedUpdateVoices=(0,n.s)(()=>this._updateVoices(),500)}}v.styles=(0,o.AH)(p||(p=u`ha-select{width:100%;text-align:start;display:block}`)),(0,a.Cg)([(0,r.MZ)()],v.prototype,"value",void 0),(0,a.Cg)([(0,r.MZ)()],v.prototype,"label",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],v.prototype,"engineId",void 0),(0,a.Cg)([(0,r.MZ)()],v.prototype,"language",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],v.prototype,"disabled",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],v.prototype,"required",void 0),(0,a.Cg)([(0,r.wk)()],v.prototype,"_voices",void 0),v=(0,a.Cg)([(0,r.EM)("ha-tts-voice-picker")],v),e()}catch(h){e(h)}})},26169:function(t,e,i){i.a(t,async function(t,e){try{i(62953);var a=i(40445),o=i(5124),r=i(67576),s=i(22786),n=i(1087),d=i(18350),l=(i(76776),i(52763)),c=t([d,l]);[d,l]=c.then?(await c)():c;let h,p,u=t=>t;class m extends o.WF{render(){return(0,o.qy)(h||(h=u` <ha-card> <div class="card-content"> <ha-form .hass="${0}" .schema="${0}" .data="${0}" .computeLabel="${0}" .computeHelper="${0}" @value-changed="${0}"></ha-form> </div> <div class="card-actions"> <ha-button @click="${0}"> ${0} </ha-button> </div> </ha-card> `),this.hass,this._schema(this.hideContentType),this.item,this._computeLabel,this._computeHelper,this._valueChanged,this._mediaPicked,this.hass.localize("ui.common.submit"))}_valueChanged(t){const e=Object.assign({},t.detail.value);this.item=e}_mediaPicked(){(0,n.r)(this,"manual-media-picked",{item:{media_content_id:this.item.media_content_id||"",media_content_type:this.item.media_content_type||""}})}constructor(...t){super(...t),this.hideContentType=!1,this._schema=(0,s.A)(t=>[{name:"media_content_id",required:!0,selector:{text:{}}},...t?[]:[{name:"media_content_type",required:!1,selector:{text:{}}}]]),this._computeLabel=t=>{switch(t.name){case"media_content_id":case"media_content_type":return this.hass.localize(`ui.components.selectors.media.${t.name}`)}return t.name},this._computeHelper=t=>{switch(t.name){case"media_content_id":return this.contentIdHelper||this.hass.localize(`ui.components.selectors.media.${t.name}_detail`);case"media_content_type":return this.hass.localize(`ui.components.selectors.media.${t.name}_detail`)}return""}}}m.styles=(0,o.AH)(p||(p=u`:host{margin:16px auto;padding:0 8px;display:flex;flex-direction:column;max-width:448px}.card-actions{display:flex;justify-content:flex-end}`)),(0,a.Cg)([(0,r.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],m.prototype,"item",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],m.prototype,"hideContentType",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],m.prototype,"contentIdHelper",void 0),m=(0,a.Cg)([(0,r.EM)("ha-browse-media-manual")],m),e()}catch(h){e(h)}})},3030:function(t,e,i){i.a(t,async function(t,e){try{i(18111),i(20116),i(3362),i(62953),i(48408),i(14603),i(47566),i(98721);var a=i(40445),o=i(5124),r=i(67576),s=i(93905),n=i(1087),d=i(63130),l=i(71117),c=i(52069),h=i(14503),p=i(81619),u=i(18350),m=(i(76776),i(14927)),v=i(56304),g=i(58933),b=t([u,m,v,g]);[u,m,v,g]=b.then?(await b)():b;let y,_,f,w,x=t=>t;const $="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z";class C extends o.WF{render(){var t,e;return(0,o.qy)(y||(y=x` <ha-card> <div class="card-content"> <ha-textarea resize="auto" .label="${0}" .value="${0}"> </ha-textarea> ${0} </div> <div class="card-actions"> <ha-button appearance="plain" @click="${0}"> ${0} </ha-button> </div> </ha-card> ${0} `),this.hass.localize("ui.components.media-browser.tts.message"),this._message||this.hass.localize("ui.components.media-browser.tts.example_message",{name:(null===(t=this.hass.user)||void 0===t?void 0:t.name)||"Alice"}),null!==(e=this._provider)&&void 0!==e&&null!==(e=e.supported_languages)&&void 0!==e&&e.length?(0,o.qy)(_||(_=x` <div class="options"> <ha-language-picker .hass="${0}" .languages="${0}" .value="${0}" required @value-changed="${0}"></ha-language-picker> <ha-tts-voice-picker .hass="${0}" .value="${0}" .engineId="${0}" .language="${0}" required @value-changed="${0}"></ha-tts-voice-picker> </div>`),this.hass,this._provider.supported_languages,this._language,this._languageChanged,this.hass,this._voice,this._provider.engine_id,this._language,this._voiceChanged):o.s6,this._ttsClicked,this.hass.localize(`ui.components.media-browser.tts.action_${this.action}`),this._voice?(0,o.qy)(f||(f=x` <div class="footer"> ${0} <code>${0}</code> <ha-icon-button .path="${0}" @click="${0}" title="${0}"></ha-icon-button> </div> `),this.hass.localize("ui.components.media-browser.tts.selected_voice_id"),this._voice||"-",$,this._copyVoiceId,this.hass.localize("ui.components.media-browser.tts.copy_voice_id")):o.s6)}willUpdate(t){var e;if(super.willUpdate(t),t.has("item")&&this.item.media_content_id){var i;const t=new URLSearchParams(this.item.media_content_id.split("?")[1]),e=t.get("message"),a=t.get("language"),o=t.get("voice");e&&(this._message=e),a&&(this._language=a),o&&(this._voice=o);const r=(0,c.EF)(this.item.media_content_id);r!==(null===(i=this._provider)||void 0===i?void 0:i.engine_id)&&(this._provider=void 0,(0,c.u1)(this.hass,r).then(t=>{var e;if(this._provider=t.provider,!this._language&&null!==(e=t.provider.supported_languages)&&void 0!==e&&e.length){var i;const e=`${this.hass.config.language}-${this.hass.config.country}`.toLowerCase(),a=t.provider.supported_languages.find(t=>t.toLowerCase()===e);if(a)return void(this._language=a);this._language=null===(i=t.provider.supported_languages)||void 0===i?void 0:i.find(t=>t.substring(0,2)===this.hass.config.language.substring(0,2))}}),"cloud"===r&&(0,l.eN)(this.hass).then(t=>{t.logged_in&&(this._language=t.prefs.tts_default_voice[0])}))}if(t.has("_message"))return;const a=null===(e=this.shadowRoot.querySelector("ha-textarea"))||void 0===e?void 0:e.value;void 0!==a&&a!==this._message&&(this._message=a)}_languageChanged(t){this._language=t.detail.value}_voiceChanged(t){this._voice=t.detail.value}async _ttsClicked(){var t;const e=null!==(t=this.shadowRoot.querySelector("ha-textarea").value)&&void 0!==t?t:"";this._message=e;const i=Object.assign({},this.item),a=new URLSearchParams;a.append("message",e),this._language&&a.append("language",this._language),this._voice&&a.append("voice",this._voice),i.media_content_id=`${i.media_content_id.split("?")[0]}?${a.toString()}`,i.media_content_type="audio/mp3",i.can_play=!0,i.title=e,(0,n.r)(this,"tts-picked",{item:i})}async _copyVoiceId(t){t.preventDefault(),await(0,d.l)(this._voice),(0,p.P)(this,{message:this.hass.localize("ui.common.copied_clipboard")})}}C.styles=[h.og,(0,o.AH)(w||(w=x`:host{margin:16px auto;padding:0 8px;display:flex;flex-direction:column;max-width:448px}.options{margin-top:16px;display:flex;justify-content:space-between;gap:var(--ha-space-2)}ha-language-picker{width:100%}ha-textarea{width:100%}button.link{color:var(--primary-color)}.footer{font-size:var(--ha-font-size-s);color:var(--secondary-text-color);margin:16px 0;text-align:center}.footer code{font-weight:var(--ha-font-weight-bold)}.footer{--mdc-icon-size:14px;--ha-icon-button-size:24px;display:flex;justify-content:center;align-items:center;gap:6px}`))],(0,a.Cg)([(0,r.MZ)({attribute:!1})],C.prototype,"hass",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],C.prototype,"item",void 0),(0,a.Cg)([(0,r.MZ)()],C.prototype,"action",void 0),(0,a.Cg)([(0,r.wk)()],C.prototype,"_language",void 0),(0,a.Cg)([(0,r.wk)()],C.prototype,"_voice",void 0),(0,a.Cg)([(0,r.wk)()],C.prototype,"_provider",void 0),(0,a.Cg)([(0,r.wk)(),(0,s.I)({key:"TtsMessage",state:!0,subscribe:!1})],C.prototype,"_message",void 0),C=(0,a.Cg)([(0,r.EM)("ha-browse-media-tts")],C),e()}catch(y){e(y)}})},19262:function(t,e,i){i.a(t,async function(t,e){try{i(62953);var a=i(40445),o=i(5124),r=i(67576),s=i(1087),n=i(17022),d=(i(67094),i(18350)),l=i(5908),c=t([d]);d=(c.then?(await c)():c)[0];let h,p=t=>t;const u="M19.39 10.74L11 19.13V20H4C2.9 20 2 19.11 2 18V6C2 4.89 2.89 4 4 4H10L12 6H20C21.1 6 22 6.89 22 8V10.15C21.74 10.06 21.46 10 21.17 10C20.5 10 19.87 10.26 19.39 10.74M13 19.96V22H15.04L21.17 15.88L19.13 13.83L13 19.96M22.85 13.47L21.53 12.15C21.33 11.95 21 11.95 20.81 12.15L19.83 13.13L21.87 15.17L22.85 14.19C23.05 14 23.05 13.67 22.85 13.47Z";class m extends o.WF{render(){var t;return this.currentItem&&((0,n.Jz)(this.currentItem.media_content_id||"")||null!==(t=this.hass.user)&&void 0!==t&&t.is_admin&&(0,n.iY)(this.currentItem.media_content_id))?(0,o.qy)(h||(h=p` <ha-button appearance="filled" size="small" @click="${0}"> <ha-svg-icon .path="${0}" slot="start"></ha-svg-icon> ${0} </ha-button> `),this._manage,u,this.hass.localize("ui.components.media-browser.file_management.manage")):o.s6}_manage(){(0,l.l)(this,{currentItem:this.currentItem,onClose:()=>(0,s.r)(this,"media-refresh")})}constructor(...t){super(...t),this._uploading=0}}(0,a.Cg)([(0,r.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],m.prototype,"currentItem",void 0),(0,a.Cg)([(0,r.wk)()],m.prototype,"_uploading",void 0),m=(0,a.Cg)([(0,r.EM)("ha-media-manage-button")],m),e()}catch(h){e(h)}})},45098:function(t,e,i){i.a(t,async function(t,e){try{var a=i(69235),o=(i(74423),i(44114),i(18111),i(81148),i(22489),i(13579),i(3362),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953),i(40445)),r=i(17568),s=i(5124),n=i(67576),d=i(6412),l=i(89784),c=i(1087),h=i(80880),p=i(9899),u=i(22675),m=i(53072),v=i(17022),g=i(52069),b=i(65063),y=i(14503),_=i(85614),f=i(36918),w=i(82474),x=i(38962),$=i(18350),C=(i(76776),i(26300)),k=(i(8630),i(28732),i(18997),i(65829)),M=(i(67094),i(34127)),H=i(26169),z=i(3030),I=t([a,w,x,$,C,k,M,H,z]);[a,w,x,$,C,k,M,H,z]=I.then?(await I)():I;let E,q,L,A,Z,O,V,S,T,P,j,B,D,F,U,W,R,N,J,Y,G,K,X,Q,tt,et,it,at,ot,rt,st=t=>t;const nt="M21.5 9.5L20.09 10.92L17 7.83V13.5C17 17.09 14.09 20 10.5 20H4V18H10.5C13 18 15 16 15 13.5V7.83L11.91 10.91L10.5 9.5L16 4L21.5 9.5Z",dt="M19,10H17V8H19M19,13H17V11H19M16,10H14V8H16M16,13H14V11H16M16,17H8V15H16M7,10H5V8H7M7,13H5V11H7M8,11H10V13H8M8,8H10V10H8M11,11H13V13H11M11,8H13V10H11M20,5H4C2.89,5 2,5.89 2,7V17A2,2 0 0,0 4,19H20A2,2 0 0,0 22,17V7C22,5.89 21.1,5 20,5Z",lt="M8,5.14V19.14L19,12.14L8,5.14Z",ct="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",ht={can_expand:!0,can_play:!1,can_search:!1,children_media_class:"",media_class:"app",media_content_id:v.xw,media_content_type:"",iconPath:dt,title:"Manual entry"};class pt extends s.WF{connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>this._attachResizeObserver())}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver&&this._resizeObserver.disconnect()}async refresh(){const t=this.navigateIds[this.navigateIds.length-1];try{this._currentItem=await this._fetchData(this.entityId,t.media_content_id,t.media_content_type),(0,c.r)(this,"media-browsed",{ids:this.navigateIds,current:this._currentItem})}catch(e){this._setError(e)}}play(){var t;null!==(t=this._currentItem)&&void 0!==t&&t.can_play&&this._runAction(this._currentItem)}willUpdate(t){var e;if(super.willUpdate(t),this.hasUpdated||(0,_.i)(),t.has("entityId"))this._setError(void 0);else if(!t.has("navigateIds"))return;this._setError(void 0);const i=t.get("navigateIds"),a=this.navigateIds;null===(e=this._content)||void 0===e||e.scrollTo(0,0),this.scrolled=!1;const o=this._currentItem,r=this._parentItem;this._currentItem=void 0,this._parentItem=void 0;const s=a[a.length-1],n=a.length>1?a[a.length-2]:void 0;let d,l;t.has("entityId")||(i&&a.length===i.length+1&&i.every((t,e)=>{const i=a[e];return i.media_content_id===t.media_content_id&&i.media_content_type===t.media_content_type})?l=Promise.resolve(o):i&&a.length===i.length-1&&a.every((t,e)=>{const a=i[e];return t.media_content_id===a.media_content_id&&t.media_content_type===a.media_content_type})&&(d=Promise.resolve(r))),s.media_content_id&&(0,v.CY)(s.media_content_id)?(this._currentItem=ht,(0,c.r)(this,"media-browsed",{ids:a,current:this._currentItem})):(d||(d=this._fetchData(this.entityId,s.media_content_id,s.media_content_type)),d.then(t=>{this._currentItem=t,(0,c.r)(this,"media-browsed",{ids:a,current:t})},e=>{var o;i&&t.has("entityId")&&a.length===i.length&&i.every((t,e)=>a[e].media_content_id===t.media_content_id&&a[e].media_content_type===t.media_content_type)?(0,c.r)(this,"media-browsed",{ids:[{media_content_id:void 0,media_content_type:void 0}],replace:!0}):"entity_not_found"===e.code&&this.entityId&&(null===(o=this.hass.states[this.entityId])||void 0===o?void 0:o.state)===u.Hh?this._setError({message:this.hass.localize("ui.components.media-browser.media_player_unavailable"),code:"entity_not_found"}):this._setError(e)})),l||void 0===n||(l=this._fetchData(this.entityId,n.media_content_id,n.media_content_type)),l&&l.then(t=>{this._parentItem=t})}shouldUpdate(t){if(t.size>1||!t.has("hass"))return!0;const e=t.get("hass");return void 0===e||e.localize!==this.hass.localize}firstUpdated(){this._measureCard(),this._attachResizeObserver()}updated(t){if(super.updated(t),t.has("_scrolled"))this._animateHeaderHeight();else if(t.has("_currentItem")){var e;if(this._setHeaderHeight(),this._observed)return;const t=null===(e=this._virtualizer)||void 0===e?void 0:e._virtualizer;t&&(this._observed=!0,setTimeout(()=>t._observeMutations(),0))}}render(){if(this._error)return(0,s.qy)(E||(E=st` <div class="container"> <ha-alert alert-type="error"> ${0} </ha-alert> </div> `),this._renderError(this._error));if(!this._currentItem)return(0,s.qy)(q||(q=st`<ha-spinner></ha-spinner>`));const t=this._currentItem,e=this.hass.localize(`ui.components.media-browser.class.${t.media_class}`);let i=t.children||[];const a=new Set;if(this.accept&&i.length>0){let t=[];for(const e of this.accept)if(e.endsWith("/*")){const i=e.slice(0,-1);t.push(t=>t.startsWith(i))}else{if("*"===e){t=[()=>!0];break}t.push(t=>t===e)}i=i.filter(e=>{const i=e.media_content_type.toLowerCase(),o=e.media_content_type&&t.some(t=>t(i));return o&&a.add(e.media_content_id),!e.media_content_type||e.can_expand||o})}const o=m.EC[t.media_class],n=t.children_media_class?m.EC[t.children_media_class]:m.EC.directory;return(0,s.qy)(L||(L=st` ${0} <div class="content" @scroll="${0}" @touchmove="${0}"> ${0} </div> `),t.can_play?(0,s.qy)(A||(A=st` <div class="header ${0}" @transitionend="${0}"> <div class="header-content"> ${0} <div class="header-info"> <div class="breadcrumb"> <h1 class="title">${0}</h1> ${0} </div> ${0} </div> </div> </div> `),(0,d.H)({"no-img":!t.thumbnail,"no-dialog":!this.dialog}),this._setHeaderHeight,t.thumbnail?(0,s.qy)(Z||(Z=st` <div class="img"> <ha-media-browser-thumbnail .hass="${0}" .url="${0}"></ha-media-browser-thumbnail> ${0} </div> `),this.hass,t.thumbnail,this.narrow&&null!=t&&t.can_play&&(!this.accept||a.has(t.media_content_id))?(0,s.qy)(O||(O=st` <ha-button class="fab" .item="${0}" @click="${0}" .title="${0}"> <ha-svg-icon .path="${0}"></ha-svg-icon> </ha-button> `),t,this._actionClicked,this.hass.localize(`ui.components.media-browser.${this.action}`),"play"===this.action?lt:ct):""):s.s6,t.title,e?(0,s.qy)(V||(V=st` <h2 class="subtitle">${0}</h2> `),e):"",!t.can_play||t.thumbnail&&this.narrow?"":(0,s.qy)(S||(S=st` <ha-button .item="${0}" @click="${0}"> <ha-svg-icon .label="${0}" .path="${0}" slot="start"></ha-svg-icon> ${0} </ha-button> `),t,this._actionClicked,this.hass.localize(`ui.components.media-browser.${this.action}-media`),"play"===this.action?lt:ct,this.hass.localize(`ui.components.media-browser.${this.action}`))):"",this._scroll,this._scroll,this._error?(0,s.qy)(T||(T=st` <div class="container"> <ha-alert alert-type="error"> ${0} </ha-alert> </div> `),this._renderError(this._error)):(0,v.CY)(t.media_content_id)?(0,s.qy)(P||(P=st`<ha-browse-media-manual .item="${0}" .hass="${0}" .hideContentType="${0}" .contentIdHelper="${0}" @manual-media-picked="${0}"></ha-browse-media-manual>`),{media_content_id:this.defaultId||"",media_content_type:this.defaultType||""},this.hass,this.hideContentType,this.contentIdHelper,this._manualPicked):(0,g.ni)(t.media_content_id)?(0,s.qy)(j||(j=st` <ha-browse-media-tts .item="${0}" .hass="${0}" .action="${0}" @tts-picked="${0}"></ha-browse-media-tts> `),t,this.hass,this.action,this._ttsPicked):i.length||t.not_shown?"grid"===this.preferredLayout||"auto"===this.preferredLayout&&"grid"===n.layout?(0,s.qy)(F||(F=st` <lit-virtualizer scroller .layout="${0}" .items="${0}" .renderItem="${0}" class="children ha-scrollbar ${0}"></lit-virtualizer> ${0} `),(0,r.V)({itemSize:{width:"175px",height:"portrait"===n.thumbnail_ratio?"312px":"225px"},gap:"16px",flex:{preserve:"aspect-ratio"},justify:"space-evenly",direction:"vertical"}),i,this._renderGridItem,(0,d.H)({portrait:"portrait"===n.thumbnail_ratio,not_shown:!!t.not_shown}),t.not_shown?(0,s.qy)(U||(U=st` <div class="grid not-shown"> <div class="title"> ${0} </div> </div> `),this.hass.localize("ui.components.media-browser.not_shown",{count:t.not_shown})):""):(0,s.qy)(W||(W=st` <ha-list> <lit-virtualizer scroller .items="${0}" style="${0}" class="ha-scrollbar" .renderItem="${0}"></lit-virtualizer> ${0} </ha-list> `),i,(0,l.W)({height:72*i.length+26+"px"}),this._renderListItem,t.not_shown?(0,s.qy)(R||(R=st` <ha-list-item noninteractive class="not-shown" .graphic="${0}"> <span class="title"> ${0} </span> </ha-list-item> `),o.show_list_images?"medium":"avatar",this.hass.localize("ui.components.media-browser.not_shown",{count:t.not_shown})):""):(0,s.qy)(B||(B=st` <div class="container no-items"> ${0} </div> `),"media-source://media_source/local/."===t.media_content_id?(0,s.qy)(D||(D=st` <div class="highlight-add-button"> <span> <ha-svg-icon .path="${0}"></ha-svg-icon> </span> <span> ${0} </span> </div> `),nt,this.hass.localize("ui.components.media-browser.file_management.highlight_button")):this.hass.localize("ui.components.media-browser.no_items")))}_runAction(t){(0,c.r)(this,"media-picked",{item:t,navigateIds:this.navigateIds})}_ttsPicked(t){t.stopPropagation();const e=this.navigateIds.slice(0,-1);e.push(t.detail.item),(0,c.r)(this,"media-picked",Object.assign(Object.assign({},t.detail),{},{navigateIds:e}))}_manualPicked(t){t.stopPropagation(),(0,c.r)(this,"media-picked",{item:t.detail.item,navigateIds:this.navigateIds})}async _fetchData(t,e,i){return(t&&t!==m.H1?(0,m.ET)(this.hass,t,e,i):(0,v.Fn)(this.hass,e)).then(t=>(e||"pick"!==this.action||(t.children=t.children||[],t.children.push(ht)),t))}_measureCard(){this.narrow=(this.dialog?window.innerWidth:this.offsetWidth)<450}async _attachResizeObserver(){this._resizeObserver||(this._resizeObserver=new ResizeObserver((0,p.s)(()=>this._measureCard(),250,!1))),this._resizeObserver.observe(this)}_closeDialogAction(){(0,c.r)(this,"close-dialog")}_setError(t){this.dialog?t&&(this._closeDialogAction(),(0,b.showAlertDialog)(this,{title:this.hass.localize("ui.components.media-browser.media_browsing_error"),text:this._renderError(t)})):this._error=t}_renderError(t){return"Media directory does not exist."===t.message?(0,s.qy)(N||(N=st` <h2> ${0} </h2> <p> ${0} <br> ${0} <br> ${0} </p> `),this.hass.localize("ui.components.media-browser.no_local_media_found"),this.hass.localize("ui.components.media-browser.no_media_folder"),this.hass.localize("ui.components.media-browser.setup_local_help",{documentation:(0,s.qy)(J||(J=st`<a href="${0}" target="_blank" rel="noreferrer">${0}</a>`),(0,f.o)(this.hass,"/more-info/local-media/setup-media"),this.hass.localize("ui.components.media-browser.documentation"))}),this.hass.localize("ui.components.media-browser.local_media_files")):(0,s.qy)(Y||(Y=st`<span class="error">${0}</span>`),t.message)}async _setHeaderHeight(){await this.updateComplete;const t=this._header,e=this._content;t&&e&&(this._headerOffsetHeight=t.offsetHeight,e.style.marginTop=`${this._headerOffsetHeight}px`,e.style.maxHeight=`calc(var(--media-browser-max-height, 100%) - ${this._headerOffsetHeight}px)`)}_animateHeaderHeight(){let t;const e=i=>{void 0===t&&(t=i);const a=i-t;this._setHeaderHeight(),a<400&&requestAnimationFrame(e)};requestAnimationFrame(e)}_scroll(t){const e=t.currentTarget;!this.scrolled&&e.scrollTop>this._headerOffsetHeight?this.scrolled=!0:this.scrolled&&e.scrollTop<this._headerOffsetHeight&&(this.scrolled=!1)}static get styles(){return[y.RF,y.dp,(0,s.AH)(G||(G=st`:host{display:flex;flex-direction:column;position:relative;direction:ltr}ha-spinner{margin:40px auto}.container{padding:16px}.no-items{padding-left:32px}.highlight-add-button{display:flex;flex-direction:row-reverse;margin-right:48px;margin-inline-end:48px;margin-inline-start:initial;direction:var(--direction)}.highlight-add-button ha-svg-icon{position:relative;top:-.5em;margin-left:8px;margin-inline-start:8px;margin-inline-end:initial;transform:scaleX(var(--scale-direction))}.content{overflow-y:auto;box-sizing:border-box;height:100%}.header{display:flex;justify-content:space-between;border-bottom:1px solid var(--divider-color);background-color:var(--card-background-color);position:absolute;top:0;right:0;left:0;z-index:3;padding:16px}.header_button{position:relative;right:-8px}.header-content{display:flex;flex-wrap:wrap;flex-grow:1;align-items:flex-start}.header-content .img{position:relative;height:175px;width:175px;margin-right:16px;border-radius:2px;overflow:hidden;transition:width .4s,height .4s;--ha-media-browser-thumbnail-fit:cover}.header-content .img ha-media-browser-thumbnail{position:absolute;inset:0}.header-info{display:flex;flex-direction:column;justify-content:space-between;align-self:stretch;min-width:0;flex:1}.header-info ha-button{display:block;padding-bottom:16px}.breadcrumb{display:flex;flex-direction:column;overflow:hidden;flex-grow:1;padding-top:16px}.breadcrumb .title{font-size:var(--ha-font-size-4xl);line-height:var(--ha-line-height-condensed);font-weight:var(--ha-font-weight-bold);margin:0;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;padding-right:8px}.breadcrumb .previous-title{font-size:var(--ha-font-size-m);padding-bottom:8px;color:var(--secondary-text-color);overflow:hidden;text-overflow:ellipsis;cursor:pointer;--mdc-icon-size:14px}.breadcrumb .subtitle{font-size:var(--ha-font-size-l);overflow:hidden;text-overflow:ellipsis;margin-bottom:0;transition:height .5s,margin .5s}.not-shown{font-style:italic;color:var(--secondary-text-color);padding:8px 16px 8px}.grid.not-shown{display:flex;align-items:center;text-align:center}ha-list{--mdc-list-vertical-padding:0;--mdc-list-item-graphic-margin:0;--mdc-theme-text-icon-on-background:var(--secondary-text-color);margin-top:10px}ha-list li:last-child{display:none}ha-list li[divider]{border-bottom-color:var(--divider-color)}ha-list-item{width:100%}div.children{display:grid;grid-template-columns:repeat(auto-fit,minmax(var(--media-browse-item-size,175px),0.1fr));grid-gap:var(--ha-space-4);padding:16px}:host([dialog]) .children{grid-template-columns:repeat(auto-fit,minmax(var(--media-browse-item-size,175px),0.33fr))}.child{display:flex;flex-direction:column;cursor:pointer}ha-card{position:relative;width:100%;box-sizing:border-box}.children ha-card .thumbnail{width:100%;position:relative;box-sizing:border-box;transition:padding-bottom .1s ease-out;padding-bottom:100%}.portrait ha-card .thumbnail{padding-bottom:150%}ha-card .image{border-radius:var(--ha-border-radius-sm) var(--ha-border-radius-sm) var(--ha-border-radius-square) var(--ha-border-radius-square)}.image{position:absolute;top:0;right:0;left:0;bottom:0;--ha-media-browser-thumbnail-fit:cover}.centered-image{margin:0 8px;--ha-media-browser-thumbnail-fit:contain}.children ha-card .icon-holder{display:flex;justify-content:center;align-items:center}.child .folder{color:var(--secondary-text-color);--mdc-icon-size:calc(var(--media-browse-item-size, 175px) * 0.4)}.child .icon{color:#00a9f7;--mdc-icon-size:calc(var(--media-browse-item-size, 175px) * 0.4)}.child .play{position:absolute;transition:color .5s;border-radius:var(--ha-border-radius-circle);top:calc(50% - 40px);right:calc(50% - 35px);opacity:0;transition:opacity .1s ease-out}.child .play:not(.can_expand){--ha-icon-button-size:70px;--mdc-icon-size:48px;background-color:var(--primary-color);color:var(--text-primary-color)}ha-card:hover .image{filter:brightness(70%);transition:filter .5s}ha-card:hover .play{opacity:1}ha-card:hover .play.can_expand{bottom:8px}.child .play.can_expand{background-color:rgba(var(--rgb-card-background-color),.5);top:auto;bottom:0px;right:8px;transition:bottom .1s ease-out,opacity .1s ease-out}.child .title{font-size:var(--ha-font-size-l);padding-top:16px;padding-left:2px;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;text-overflow:ellipsis}.child ha-card .title{margin-bottom:16px;padding-left:16px}ha-list-item .graphic{position:relative;border-radius:var(--ha-border-radius-sm);overflow:hidden;line-height:initial}ha-list-item .graphic ha-media-browser-thumbnail{position:absolute;inset:0}ha-list-item .graphic .play{position:absolute;inset:0;margin:auto;opacity:0;transition:all .5s;background-color:rgba(var(--rgb-card-background-color),.5);border-radius:var(--ha-border-radius-circle);--ha-icon-button-size:40px}ha-list-item:hover .graphic .play{opacity:1;color:var(--primary-text-color)}ha-list-item .graphic .play.show{opacity:1;background-color:transparent}ha-list-item .title{margin-left:16px;margin-inline-start:16px;margin-inline-end:initial}:host([narrow]){padding:0}:host([narrow]) .media-source{padding:0 24px}:host([narrow]) div.children{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important}:host([narrow]) .breadcrumb .title{font-size:var(--ha-font-size-2xl)}:host([narrow]) .header{padding:0}:host([narrow]) .header.no-dialog{display:block}:host([narrow]) .header_button{position:absolute;top:14px;right:8px}:host([narrow]) .header-content{flex-direction:column;flex-wrap:nowrap}:host([narrow]) .header-content .img{height:auto;width:100%;margin-right:0;padding-bottom:50%;margin-bottom:8px;position:relative;background-position:center;border-radius:var(--ha-border-radius-square);transition:width .4s,height .4s,padding-bottom .4s}.fab{position:absolute;bottom:calc(var(--ha-space-5) * -1);right:var(--ha-space-5);--ha-button-box-shadow:var(--ha-box-shadow-l)}:host([narrow]) .header-info ha-button{margin-top:16px;margin-bottom:8px}:host([narrow]) .header-info{padding:0 16px 8px}:host([scrolled]) .breadcrumb .subtitle{height:0;margin:0}:host([scrolled]) .breadcrumb .title{-webkit-line-clamp:1}:host(:not([narrow])[scrolled]) .header:not(.no-img) ha-icon-button{align-self:center}.no-img .header-info ha-button,:host([scrolled]) .header-info ha-button{padding-right:4px}:host([scrolled][narrow]) .no-img .header-info ha-button{padding-right:16px}:host([scrolled]) .header-info{flex-direction:row}:host([scrolled]) .header-info ha-button{align-self:center;margin-top:0;margin-bottom:0;padding-bottom:0}:host([scrolled][narrow]) .no-img .header-info{flex-direction:row-reverse}:host([scrolled][narrow]) .header-info{padding:20px 24px 10px 24px;align-items:center}:host([scrolled]) .header-content{align-items:flex-end;flex-direction:row}:host([scrolled]) .header-content .img{height:75px;width:75px}:host([scrolled]) .breadcrumb{padding-top:0;align-self:center}:host([scrolled][narrow]) .header-content .img{height:100px;width:100px;padding-bottom:initial;margin-bottom:0}:host([scrolled]) .fab{bottom:0;right:calc(var(--ha-space-6) * -1);--ha-button-box-shadow:none}lit-virtualizer{height:100%;overflow:overlay!important;contain:size layout!important}lit-virtualizer.not_shown{height:calc(100% - 36px)}ha-browse-media-tts{direction:var(--direction)}`))]}constructor(...t){super(...t),this.action="play",this.preferredLayout="auto",this.dialog=!1,this.navigateIds=[],this.hideContentType=!1,this.narrow=!1,this.scrolled=!1,this._observed=!1,this._headerOffsetHeight=0,this._renderGridItem=t=>(0,s.qy)(K||(K=st` <div class="child" .item="${0}" @click="${0}"> <ha-card outlined> <div class="thumbnail"> ${0} ${0} </div> <ha-tooltip .for="grid-${0}" distance="-4"> ${0} </ha-tooltip> <div .id="grid-${0}" class="title"> ${0} </div> </ha-card> </div> `),t,this._childClicked,t.thumbnail?(0,s.qy)(X||(X=st` <div class="${0} image"> <ha-media-browser-thumbnail .hass="${0}" .url="${0}"></ha-media-browser-thumbnail> </div> `),(0,d.H)({"centered-image":["app","directory"].includes(t.media_class)}),this.hass,t.thumbnail):(0,s.qy)(Q||(Q=st` <div class="icon-holder image"> <ha-svg-icon class="${0}" .path="${0}"></ha-svg-icon> </div> `),t.iconPath?"icon":"folder",t.iconPath||m.EC["directory"===t.media_class&&t.children_media_class||t.media_class].icon),t.can_play?(0,s.qy)(tt||(tt=st` <ha-icon-button class="play ${0}" .item="${0}" .label="${0}" .path="${0}" @click="${0}"></ha-icon-button> `),(0,d.H)({can_expand:t.can_expand}),t,this.hass.localize(`ui.components.media-browser.${this.action}-media`),"play"===this.action?lt:ct,this._actionClicked):"",(0,h.Y)(t.title),t.title,(0,h.Y)(t.title),t.title),this._renderListItem=t=>{const e=this._currentItem,i=m.EC[e.media_class],a=i.show_list_images&&!!t.thumbnail;return(0,s.qy)(et||(et=st` <ha-list-item @click="${0}" .item="${0}" .graphic="${0}"> ${0} <span class="title">${0}</span> </ha-list-item> `),this._childClicked,t,i.show_list_images?"medium":"avatar",a||t.can_play?(0,s.qy)(at||(at=st`<div class="${0}" slot="graphic"> ${0} ${0} </div>`),(0,d.H)({graphic:!0,thumbnail:!0===i.show_list_images}),a?(0,s.qy)(ot||(ot=st`<ha-media-browser-thumbnail .hass="${0}" .url="${0}"></ha-media-browser-thumbnail>`),this.hass,t.thumbnail):s.s6,t.can_play?(0,s.qy)(rt||(rt=st`<ha-icon-button class="play ${0}" .item="${0}" .label="${0}" .path="${0}" @click="${0}"></ha-icon-button>`),(0,d.H)({show:!i.show_list_images||!t.thumbnail}),t,this.hass.localize(`ui.components.media-browser.${this.action}-media`),"play"===this.action?lt:ct,this._actionClicked):s.s6):(0,s.qy)(it||(it=st`<ha-svg-icon .path="${0}" slot="graphic"></ha-svg-icon>`),m.EC["directory"===t.media_class&&t.children_media_class||t.media_class].icon),t.title)},this._actionClicked=t=>{t.stopPropagation();const e=t.currentTarget.item;this._runAction(e)},this._childClicked=async t=>{const e=t.currentTarget.item;e&&(e.can_expand?(0,c.r)(this,"media-browsed",{ids:[...this.navigateIds,e]}):this._runAction(e))}}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],pt.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],pt.prototype,"entityId",void 0),(0,o.Cg)([(0,n.MZ)()],pt.prototype,"action",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],pt.prototype,"preferredLayout",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],pt.prototype,"dialog",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],pt.prototype,"navigateIds",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],pt.prototype,"accept",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],pt.prototype,"defaultId",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],pt.prototype,"defaultType",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],pt.prototype,"hideContentType",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],pt.prototype,"contentIdHelper",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],pt.prototype,"narrow",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],pt.prototype,"scrolled",void 0),(0,o.Cg)([(0,n.wk)()],pt.prototype,"_error",void 0),(0,o.Cg)([(0,n.wk)()],pt.prototype,"_parentItem",void 0),(0,o.Cg)([(0,n.wk)()],pt.prototype,"_currentItem",void 0),(0,o.Cg)([(0,n.P)(".header")],pt.prototype,"_header",void 0),(0,o.Cg)([(0,n.P)(".content")],pt.prototype,"_content",void 0),(0,o.Cg)([(0,n.P)("lit-virtualizer")],pt.prototype,"_virtualizer",void 0),(0,o.Cg)([(0,n.Ls)({passive:!0})],pt.prototype,"_scroll",null),pt=(0,o.Cg)([(0,n.EM)("ha-media-player-browse")],pt),e()}catch(E){e(E)}})},5908:function(t,e,i){i.d(e,{l:function(){return o}});i(3362),i(62953);var a=i(1087);const o=(t,e)=>{(0,a.r)(t,"show-dialog",{dialogTag:"dialog-media-manage",dialogImport:()=>Promise.all([i.e(58303),i.e(13390),i.e(80957)]).then(i.bind(i,71084)),dialogParams:e})}},10897:function(t,e,i){i.d(e,{C4:function(){return l},CK:function(){return d},FX:function(){return v},UC:function(){return u},_Z:function(){return _},bT:function(){return f},j4:function(){return b},sd:function(){return r},su:function(){return n},vc:function(){return y},w8:function(){return p},wv:function(){return h},y3:function(){return m},zS:function(){return s}});i(3362);var a=i(3931),o=i(82e3);const r=[1,2,3,4,6,8],s="web_rtc",n=(t,e,i)=>`${t}&width=${e}&height=${i}`,d=t=>t.attributes.access_token?`/api/camera_proxy_stream/${t.entity_id}?token=${t.attributes.access_token}`:void 0,l=async(t,e,i,o)=>{const r=await(0,a.U)("_cameraTmbUrl",9e3,c,t,e);return n(r,i,o)},c=async(t,e)=>{const i=await(0,o.e0)(t,`/api/camera_proxy/${e}`);return t.hassUrl(i.path)},h=async(t,e,i)=>{const a={type:"camera/stream",entity_id:e};i&&(a.format=i);const o=await t.callWS(a);return o.url=t.hassUrl(o.url),o},p=(t,e,i,a)=>t.connection.subscribeMessage(a,{type:"camera/webrtc/offer",entity_id:e,offer:i}),u=(t,e,i,a)=>t.callWS({type:"camera/webrtc/candidate",entity_id:e,session_id:i,candidate:a}),m=(t,e)=>t.callWS({type:"camera/get_prefs",entity_id:e}),v=(t,e,i)=>t.callWS(Object.assign({type:"camera/update_prefs",entity_id:e},i)),g="media-source://camera/",b=t=>t.startsWith(g),y=t=>t.substring(22),_=async(t,e)=>t.callWS({type:"camera/capabilities",entity_id:e}),f=async(t,e)=>t.callWS({type:"camera/webrtc/get_client_config",entity_id:e})},53756:function(t,e,i){i.d(e,{t:function(){return d},w:function(){return l}});i(74423),i(18111),i(22489),i(61701),i(62953);var a=i(71727),o=i(74705),r=i(28978),s=i(15638),n=i(95350);const d=[{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=(t,e,i,d,l,c,h,p,u,m="")=>{let v,g=Object.keys(t.states);return h&&(g=g.filter(t=>h.includes(t))),p&&(g=g.filter(t=>!p.includes(t))),e&&(g=g.filter(t=>e.includes((0,a.m)(t)))),i&&(g=g.filter(t=>!i.includes((0,a.m)(t)))),v=g.map(e=>{const i=t.states[e],d=(0,r.u)(i),[l,c,h]=(0,o.Cf)(i,[{type:"entity"},{type:"device"},{type:"area"}],t.entities,t.devices,t.areas,t.floors),p=(0,n.p$)(t.localize,(0,a.m)(e)),u=(0,s.qC)(t.language,t.translationMetadata.translations),v=l||c||e,g=[h,l?c:void 0].filter(Boolean).join(u?" ◂ ":" ▸ ");return{id:`${m}${e}`,primary:v,secondary:g,domain_name:p,sorting_label:[v,g].filter(Boolean).join("_"),search_labels:{entityName:l||null,deviceName:c||null,areaName:h||null,domainName:p||null,friendlyName:d||null,entityId:e},stateObj:i}}),l&&(v=v.filter(t=>{var e;return t.id===u||(null===(e=t.stateObj)||void 0===e?void 0:e.attributes.device_class)&&l.includes(t.stateObj.attributes.device_class)})),c&&(v=v.filter(t=>{var e;return t.id===u||(null===(e=t.stateObj)||void 0===e?void 0:e.attributes.unit_of_measurement)&&c.includes(t.stateObj.attributes.unit_of_measurement)})),d&&(v=v.filter(t=>t.id===u||t.stateObj&&d(t.stateObj))),v}},17022:function(t,e,i){i.d(e,{A1:function(){return a},CY:function(){return s},Fn:function(){return o},Jz:function(){return d},St:function(){return n},VA:function(){return c},WI:function(){return h},iY:function(){return l},xw:function(){return r}});i(16280),i(3362);const a=(t,e)=>t.callWS({type:"media_source/resolve_media",media_content_id:e}),o=(t,e)=>t.callWS({type:"media_source/browse_media",media_content_id:e}),r="__MANUAL_ENTRY__",s=t=>t.startsWith(r),n=t=>t.startsWith("media-source://"),d=t=>t.startsWith("media-source://media_source"),l=t=>t.startsWith("media-source://image_upload"),c=async(t,e,i)=>{const a=new FormData;a.append("media_content_id",e),a.append("file",i);const o=await t.fetchWithAuth("/api/media_source/local_source/upload",{method:"POST",body:a});if(413===o.status)throw new Error(`Uploaded file is too large (${i.name})`);if(200!==o.status)throw new Error("Unknown error");return o.json()},h=async(t,e)=>t.callWS({type:"media_source/local_source/remove",media_content_id:e})},19711:function(t,e,i){i.d(e,{$:function(){return r}});i(3362),i(62953);var a=i(1087);const o=()=>Promise.all([i.e(80131),i.e(70183),i.e(47677)]).then(i.bind(i,79029)),r=(t,e)=>{(0,a.r)(t,"show-dialog",{dialogTag:"dialog-helper-detail",dialogImport:o,dialogParams:e})}},53580:function(t,e,i){i.d(e,{mdiHomeAssistant:function(){return a}});const a="m12.151 1.5882c-.3262 0-.6523.1291-.8996.3867l-8.3848 8.7354c-.0619.0644-.1223.1368-.1807.2154-.0588.0789-.1151.1638-.1688.2534-.2593.4325-.4552.9749-.5232 1.4555-.0026.018-.0076.0369-.0094.0548-.0121.0987-.0184.1944-.0184.2857v8.0124a1.2731 1.2731 0 001.2731 1.2731h7.8313l-3.4484-3.593a1.7399 1.7399 0 111.0803-1.125l2.6847 2.7972v-10.248a1.7399 1.7399 0 111.5276-0v7.187l2.6702-2.782a1.7399 1.7399 0 111.0566 1.1505l-3.7269 3.8831v2.7299h8.174a1.2471 1.2471 0 001.2471-1.2471v-8.0375c0-.0912-.0059-.1868-.0184-.2855-.0603-.4935-.2636-1.0617-.5326-1.5105-.0537-.0896-.1101-.1745-.1684-.253-.0588-.079-.1191-.1513-.181-.2158l-8.3848-8.7363c-.2473-.2577-.5735-.3866-.8995-.3864"},69235:function(t,e,i){i.a(t,async function(t,e){try{i(3362),i(62953);"function"!=typeof window.ResizeObserver&&(window.ResizeObserver=(await i.e(71055).then(i.bind(i,52370))).default),e()}catch(a){e(a)}},1)},36918:function(t,e,i){i.d(e,{o:function(){return a}});const a=(t,e)=>`https://www.iobroker.net/#${t.language&&t.language.split("-")[0]||"en"}/adapters/adapterref/iobroker.lovelace/README.md#`}}]);