iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 28.3 kB
JavaScript
;(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["73856"],{5839:function(e,t,a){a.d(t,{v:()=>o});a(19083);var i=a(96194),n=a(73850);function o(e,t){const a=(0,n.M)(e.entity_id),o=void 0!==t?t:null==e?void 0:e.state;if(["button","event","input_button","scene"].includes(a))return o!==i.nZ;if((0,i.rk)(o))return!1;if(o===i.PX&&"alert"!==a)return!1;switch(a){case"alarm_control_panel":return"disarmed"!==o;case"alert":return"idle"!==o;case"cover":case"valve":return"closed"!==o;case"device_tracker":case"person":return"not_home"!==o;case"lawn_mower":return["mowing","error"].includes(o);case"lock":return"locked"!==o;case"media_player":return"standby"!==o;case"vacuum":return!["idle","docked","paused"].includes(o);case"plant":return"problem"===o;case"group":return["on","home","open","locked","problem"].includes(o);case"timer":return"active"===o;case"camera":return"streaming"===o}return!0}},29073:function(e,t,a){a.d(t,{u:()=>f});var i=a(61701),n=a(72621),o=(a(71695),a(9359),a(31526),a(70104),a(19423),a(40251),a(47021),a(57243)),s=a(50778),r=a(29567),l=a(36522);a(99426),a(66671);let d,c,u,h,m,p,_,v,b,g=e=>e;const y={boolean:()=>Promise.all([a.e("29570"),a.e("79350")]).then(a.bind(a,8353)),constant:()=>a.e("69654").then(a.bind(a,5606)),float:()=>Promise.all([a.e("46379"),a.e("66031"),a.e("62022")]).then(a.bind(a,53203)),grid:()=>a.e("45036").then(a.bind(a,20018)),expandable:()=>a.e("42653").then(a.bind(a,91624)),integer:()=>Promise.all([a.e("46379"),a.e("66031"),a.e("42950"),a.e("29570"),a.e("65505"),a.e("92139"),a.e("17375"),a.e("42849")]).then(a.bind(a,96116)),multi_select:()=>Promise.all([a.e("46379"),a.e("66031"),a.e("91552"),a.e("78456"),a.e("56898"),a.e("42950"),a.e("29570"),a.e("65505"),a.e("5080"),a.e("50408"),a.e("13204"),a.e("99562")]).then(a.bind(a,84545)),positive_time_period_dict:()=>Promise.all([a.e("46379"),a.e("66031"),a.e("91552"),a.e("78456"),a.e("41258"),a.e("56898"),a.e("35671"),a.e("3688"),a.e("38336"),a.e("63016")]).then(a.bind(a,15063)),select:()=>Promise.all([a.e("46379"),a.e("66031"),a.e("91552"),a.e("78456"),a.e("24199"),a.e("41258"),a.e("56898"),a.e("78943"),a.e("35671"),a.e("42950"),a.e("29570"),a.e("65505"),a.e("7010"),a.e("62524"),a.e("34561"),a.e("47818"),a.e("22542")]).then(a.bind(a,62706)),string:()=>Promise.all([a.e("46379"),a.e("66031"),a.e("36620")]).then(a.bind(a,8327)),optional_actions:()=>a.e("85230").then(a.bind(a,26709))},C=(e,t)=>e?!t.name||t.flatten?e:e[t.name]:null;let f=(0,i.Z)([(0,s.Mo)("ha-form")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"data",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"schema",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"error",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"warning",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"computeError",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"computeWarning",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"computeLabel",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"computeHelper",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"localizeValue",value:void 0},{kind:"method",key:"getFormProperties",value:function(){return{}}},{kind:"method",key:"focus",value:async function(){await this.updateComplete;const e=this.renderRoot.querySelector(".root");if(e)for(const t of e.children)if("HA-ALERT"!==t.tagName){t instanceof o.fl&&await t.updateComplete,t.focus();break}}},{kind:"method",key:"willUpdate",value:function(e){e.has("schema")&&this.schema&&this.schema.forEach((e=>{var t;"selector"in e||null===(t=y[e.type])||void 0===t||t.call(y)}))}},{kind:"method",key:"render",value:function(){return(0,o.dy)(d||(d=g` <div class="root" part="root"> ${0} ${0} </div> `),this.error&&this.error.base?(0,o.dy)(c||(c=g` <ha-alert alert-type="error"> ${0} </ha-alert> `),this._computeError(this.error.base,this.schema)):"",this.schema.map((e=>{var t;const a=((e,t)=>e&&t.name?e[t.name]:null)(this.error,e),i=((e,t)=>e&&t.name?e[t.name]:null)(this.warning,e);return(0,o.dy)(u||(u=g` ${0} ${0} `),a?(0,o.dy)(h||(h=g` <ha-alert own-margin alert-type="error"> ${0} </ha-alert> `),this._computeError(a,e)):i?(0,o.dy)(m||(m=g` <ha-alert own-margin alert-type="warning"> ${0} </ha-alert> `),this._computeWarning(i,e)):"","selector"in e?(0,o.dy)(p||(p=g`<ha-selector .schema="${0}" .hass="${0}" .name="${0}" .selector="${0}" .value="${0}" .label="${0}" .disabled="${0}" .placeholder="${0}" .helper="${0}" .localizeValue="${0}" .required="${0}" .context="${0}"></ha-selector>`),e,this.hass,e.name,e.selector,C(this.data,e),this._computeLabel(e,this.data),e.disabled||this.disabled||!1,e.required?"":e.default,this._computeHelper(e),this.localizeValue,e.required||!1,this._generateContext(e)):(0,r.h)(this.fieldElementName(e.type),Object.assign({schema:e,data:C(this.data,e),label:this._computeLabel(e,this.data),helper:this._computeHelper(e),disabled:this.disabled||e.disabled||!1,hass:this.hass,localize:null===(t=this.hass)||void 0===t?void 0:t.localize,computeLabel:this.computeLabel,computeHelper:this.computeHelper,localizeValue:this.localizeValue,context:this._generateContext(e)},this.getFormProperties())))})))}},{kind:"method",key:"fieldElementName",value:function(e){return`ha-form-${e}`}},{kind:"method",key:"_generateContext",value:function(e){if(!e.context)return;const t={};for(const[a,i]of Object.entries(e.context))t[a]=this.data[i];return t}},{kind:"method",key:"createRenderRoot",value:function(){const e=(0,n.Z)(a,"createRenderRoot",this,3)([]);return this.addValueChangedListener(e),e}},{kind:"method",key:"addValueChangedListener",value:function(e){e.addEventListener("value-changed",(e=>{e.stopPropagation();const t=e.target.schema;if(e.target===this)return;const a=!t.name||"flatten"in t&&t.flatten?e.detail.value:{[t.name]:e.detail.value};this.data=Object.assign(Object.assign({},this.data),a),(0,l.B)(this,"value-changed",{value:this.data})}))}},{kind:"method",key:"_computeLabel",value:function(e,t){return this.computeLabel?this.computeLabel(e,t):e?e.name:""}},{kind:"method",key:"_computeHelper",value:function(e){return this.computeHelper?this.computeHelper(e):""}},{kind:"method",key:"_computeError",value:function(e,t){return Array.isArray(e)?(0,o.dy)(_||(_=g`<ul> ${0} </ul>`),e.map((e=>(0,o.dy)(v||(v=g`<li> ${0} </li>`),this.computeError?this.computeError(e,t):e)))):this.computeError?this.computeError(e,t):e}},{kind:"method",key:"_computeWarning",value:function(e,t){return this.computeWarning?this.computeWarning(e,t):e}},{kind:"field",static:!0,key:"styles",value(){return(0,o.iv)(b||(b=g`.root>*{display:block}.root>:not([own-margin]):not(:last-child){margin-bottom:24px}ha-alert[own-margin]{margin-bottom:4px}`))}}]}}),o.oi)},19326:function(e,t,a){a.r(t),a.d(t,{HaMediaSelector:()=>f});var i=a(61701),n=(a(19083),a(71695),a(9359),a(70104),a(19423),a(88044),a(47021),a(57243)),o=a(50778),s=a(35359),r=a(36522),l=a(75278),d=a(43546),c=a(89890),u=a(88238),h=(a(99426),a(29073),a(40944));let m,p,_,v,b,g,y=e=>e;const C=[{name:"media_content_id",required:!1,selector:{text:{}}},{name:"media_content_type",required:!1,selector:{text:{}}}];let f=(0,i.Z)([(0,o.Mo)("ha-selector-media")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"selector",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"value",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,reflect:!0})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,reflect:!0})],key:"required",value(){return!0}},{kind:"field",decorators:[(0,o.SB)()],key:"_thumbnailUrl",value:void 0},{kind:"method",key:"willUpdate",value:function(e){if(e.has("value")){var t,a;const n=null===(t=this.value)||void 0===t||null===(t=t.metadata)||void 0===t?void 0:t.thumbnail;if(n===(null===(a=e.get("value"))||void 0===a||null===(a=a.metadata)||void 0===a?void 0:a.thumbnail))return;if(n&&n.startsWith("/"))this._thumbnailUrl=void 0,(0,d.iI)(this.hass,n).then((e=>{this._thumbnailUrl=e.path}));else if(n&&n.startsWith("https://brands.home-assistant.io")){var i;this._thumbnailUrl=(0,u.X1)({domain:(0,u.u4)(n),type:"icon",useFallback:!0,darkOptimized:null===(i=this.hass.themes)||void 0===i?void 0:i.darkMode})}else this._thumbnailUrl=n}}},{kind:"method",key:"render",value:function(){var e,t,a,i,o,r,d,u,h,g;const f=null!==(e=this.value)&&void 0!==e&&e.entity_id?this.hass.states[this.value.entity_id]:void 0,L=!(null!==(t=this.value)&&void 0!==t&&t.entity_id)||f&&(0,l.e)(f,c.yZ.BROWSE_MEDIA);return(0,n.dy)(m||(m=y`<ha-entity-picker .hass="${0}" .value="${0}" .label="${0}" .disabled="${0}" .helper="${0}" .required="${0}" include-domains='["media_player"]' allow-custom-entity @value-changed="${0}"></ha-entity-picker> ${0}`),this.hass,null===(a=this.value)||void 0===a?void 0:a.entity_id,this.label||this.hass.localize("ui.components.selectors.media.pick_media_player"),this.disabled,this.helper,this.required,this._entityChanged,L?(0,n.dy)(_||(_=y`<ha-card outlined @click="${0}" class="${0}"> <div class="thumbnail ${0}"> ${0} </div> <div class="title"> ${0} </div> </ha-card>`),this._pickMedia,this.disabled||null===(i=this.value)||void 0===i||!i.entity_id?"disabled":"",(0,s.$)({portrait:!(null===(o=this.value)||void 0===o||null===(o=o.metadata)||void 0===o||!o.media_class)&&"portrait"===c.Fn[this.value.metadata.children_media_class||this.value.metadata.media_class].thumbnail_ratio}),null!==(r=this.value)&&void 0!==r&&null!==(r=r.metadata)&&void 0!==r&&r.thumbnail?(0,n.dy)(v||(v=y` <div class="${0} image" style="${0}"></div> `),(0,s.$)({"centered-image":!!this.value.metadata.media_class&&["app","directory"].includes(this.value.metadata.media_class)}),this._thumbnailUrl?`background-image: url(${this._thumbnailUrl});`:""):(0,n.dy)(b||(b=y` <div class="icon-holder image"> <ha-svg-icon class="folder" .path="${0}"></ha-svg-icon> </div> `),null!==(d=this.value)&&void 0!==d&&d.media_content_id?null!==(u=this.value)&&void 0!==u&&null!==(u=u.metadata)&&void 0!==u&&u.media_class?c.Fn["directory"===this.value.metadata.media_class&&this.value.metadata.children_media_class||this.value.metadata.media_class].icon:"M19 3H5C3.89 3 3 3.89 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.89 20.1 3 19 3M10 16V8L15 12":"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"),null!==(h=this.value)&&void 0!==h&&h.media_content_id?(null===(g=this.value.metadata)||void 0===g?void 0:g.title)||this.value.media_content_id:this.hass.localize("ui.components.selectors.media.pick_media")):(0,n.dy)(p||(p=y`<ha-alert> ${0} </ha-alert> <ha-form .hass="${0}" .data="${0}" .schema="${0}" .computeLabel="${0}"></ha-form>`),this.hass.localize("ui.components.selectors.media.browse_not_supported"),this.hass,this.value,C,this._computeLabelCallback))}},{kind:"field",key:"_computeLabelCallback",value(){return e=>this.hass.localize(`ui.components.selectors.media.${e.name}`)}},{kind:"method",key:"_entityChanged",value:function(e){e.stopPropagation(),(0,r.B)(this,"value-changed",{value:{entity_id:e.detail.value,media_content_id:"",media_content_type:""}})}},{kind:"method",key:"_pickMedia",value:function(){var e;(0,h.B)(this,{action:"pick",entityId:this.value.entity_id,navigateIds:null===(e=this.value.metadata)||void 0===e?void 0:e.navigateIds,mediaPickedCallback:e=>{var t;(0,r.B)(this,"value-changed",{value:Object.assign(Object.assign({},this.value),{},{media_content_id:e.item.media_content_id,media_content_type:e.item.media_content_type,metadata:{title:e.item.title,thumbnail:e.item.thumbnail,media_class:e.item.media_class,children_media_class:e.item.children_media_class,navigateIds:null===(t=e.navigateIds)||void 0===t?void 0:t.map((e=>({media_content_type:e.media_content_type,media_content_id:e.media_content_id})))}})})}})}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(g||(g=y`ha-entity-picker{display:block;margin-bottom:16px}mwc-button{margin-top:8px}ha-alert{display:block;margin-bottom:16px}ha-card{position:relative;width:200px;box-sizing:border-box;cursor:pointer}ha-card.disabled{pointer-events:none;color:var(--disabled-text-color)}ha-card .thumbnail{width:100%;position:relative;box-sizing:border-box;transition:padding-bottom .1s ease-out;padding-bottom:100%}ha-card .thumbnail.portrait{padding-bottom:150%}ha-card .image{border-radius:3px 3px 0 0}.folder{--mdc-icon-size:calc(var(--media-browse-item-size, 175px) * 0.4)}.title{font-size:16px;padding-top:16px;overflow:hidden;text-overflow:ellipsis;margin-bottom:16px;padding-left:16px;padding-right:4px;padding-inline-start:16px;padding-inline-end:4px;white-space:nowrap}.image{position:absolute;top:0;right:0;left:0;bottom:0;background-size:cover;background-repeat:no-repeat;background-position:center}.centered-image{margin:0 8px;background-size:contain}.icon-holder{display:flex;justify-content:center;align-items:center}`))}}]}}),n.oi)},40944:function(e,t,a){a.d(t,{B:()=>n});a(71695),a(40251),a(47021);var i=a(36522);const n=(e,t)=>{(0,i.B)(e,"show-dialog",{dialogTag:"dialog-media-player-browse",dialogImport:()=>Promise.all([a.e("46379"),a.e("66031"),a.e("72206"),a.e("91552"),a.e("97983"),a.e("78456"),a.e("24199"),a.e("41258"),a.e("56898"),a.e("78943"),a.e("35671"),a.e("99287"),a.e("41103"),a.e("58640"),a.e("13914"),a.e("18865"),a.e("27090"),a.e("44959"),a.e("3049"),a.e("4277"),a.e("93350")]).then(a.bind(a,84961)),dialogParams:t})}},43546:function(e,t,a){a.d(t,{Cp:()=>h,GX:()=>d,PC:()=>r,TZ:()=>m,W2:()=>u,WD:()=>s,YY:()=>_,et:()=>l,iI:()=>o,j2:()=>p,lU:()=>c,oT:()=>n,uw:()=>i});a(19083),a(9359),a(70104),a(77439),a(19423),a(40251),a(97499),a(61006);const i=28639==a.j?`${location.protocol}//${location.host}`:null,n=e=>e.map((e=>{if("string"!==e.type)return e;switch(e.name){case"username":return Object.assign(Object.assign({},e),{},{autocomplete:"username",autofocus:!0});case"password":return Object.assign(Object.assign({},e),{},{autocomplete:"current-password"});case"code":return Object.assign(Object.assign({},e),{},{autocomplete:"one-time-code",autofocus:!0});default:return e}})),o=(e,t)=>e.callWS({type:"auth/sign_path",path:t}),s=()=>fetch("/auth/providers",{credentials:"same-origin"}),r=(e,t,a)=>fetch("/auth/login_flow",{method:"POST",credentials:"same-origin",body:JSON.stringify({client_id:e,handler:a,redirect_uri:t})}),l=(e,t)=>fetch(`/auth/login_flow/${e}`,{method:"POST",credentials:"same-origin",body:JSON.stringify(t)}),d=e=>fetch(`/auth/login_flow/${e}`,{method:"DELETE",credentials:"same-origin"}),c=(e,t,a,i)=>{e.includes("?")?e.endsWith("&")||(e+="&"):e+="?",e+=`code=${encodeURIComponent(t)}`,a&&(e+=`&state=${encodeURIComponent(a)}`),i&&(e+="&storeToken=true"),document.location.assign(e)},u=async(e,t,a,i)=>e.callWS({type:"config/auth_provider/homeassistant/create",user_id:t,username:a,password:i}),h=(e,t,a)=>e.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:t,new_password:a}),m=(e,t,a)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:t,password:a}),p=(e,t,a)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:t,username:a}),_=(e,t,a)=>e.callWS({type:"auth/delete_all_refresh_tokens",token_type:t,delete_current_token:a})},96194:function(e,t,a){a.d(t,{ON:()=>s,PX:()=>r,V_:()=>l,lz:()=>o,nZ:()=>n,rk:()=>c});var i=a(92636);const n="unavailable",o="unknown",s="on",r="off",l=[n,o],d=[n,o,r],c=(0,i.z)(l);(0,i.z)(d)},89890:function(e,t,a){a.d(t,{DQ:()=>C,Fn:()=>_,Mj:()=>g,N8:()=>p,WL:()=>f,fI:()=>L,kr:()=>V,qV:()=>k,rs:()=>b,xt:()=>y,yZ:()=>m,zz:()=>v});a(92745),a(19423),a(19134),a(97003),a(88044);if(66977!=a.j)var i=a(75278);var n=a(5839),o=a(96194),s=a(58968);const r="M11,14C12,14 13.05,14.16 14.2,14.44C13.39,15.31 13,16.33 13,17.5C13,18.39 13.25,19.23 13.78,20H3V18C3,16.81 3.91,15.85 5.74,15.12C7.57,14.38 9.33,14 11,14M11,12C9.92,12 9,11.61 8.18,10.83C7.38,10.05 7,9.11 7,8C7,6.92 7.38,6 8.18,5.18C9,4.38 9.92,4 11,4C12.11,4 13.05,4.38 13.83,5.18C14.61,6 15,6.92 15,8C15,9.11 14.61,10.05 13.83,10.83C13.05,11.61 12.11,12 11,12M18.5,10H20L22,10V12H20V17.5A2.5,2.5 0 0,1 17.5,20A2.5,2.5 0 0,1 15,17.5A2.5,2.5 0 0,1 17.5,15C17.86,15 18.19,15.07 18.5,15.21V10Z",l="M14,19H18V5H14M6,19H10V5H6V19Z",d="M8,5.14V19.14L19,12.14L8,5.14Z",c="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",u="M18,18H6V6H18V18Z",h="M8.16,3L6.75,4.41L9.34,7H4C2.89,7 2,7.89 2,9V19C2,20.11 2.89,21 4,21H20C21.11,21 22,20.11 22,19V9C22,7.89 21.11,7 20,7H14.66L17.25,4.41L15.84,3L12,6.84L8.16,3M4,9H17V19H4V9M19.5,9A1,1 0 0,1 20.5,10A1,1 0 0,1 19.5,11A1,1 0 0,1 18.5,10A1,1 0 0,1 19.5,9M19.5,12A1,1 0 0,1 20.5,13A1,1 0 0,1 19.5,14A1,1 0 0,1 18.5,13A1,1 0 0,1 19.5,12Z";let m=function(e){return e[e.PAUSE=1]="PAUSE",e[e.SEEK=2]="SEEK",e[e.VOLUME_SET=4]="VOLUME_SET",e[e.VOLUME_MUTE=8]="VOLUME_MUTE",e[e.PREVIOUS_TRACK=16]="PREVIOUS_TRACK",e[e.NEXT_TRACK=32]="NEXT_TRACK",e[e.TURN_ON=128]="TURN_ON",e[e.TURN_OFF=256]="TURN_OFF",e[e.PLAY_MEDIA=512]="PLAY_MEDIA",e[e.VOLUME_STEP=1024]="VOLUME_STEP",e[e.SELECT_SOURCE=2048]="SELECT_SOURCE",e[e.STOP=4096]="STOP",e[e.CLEAR_PLAYLIST=8192]="CLEAR_PLAYLIST",e[e.PLAY=16384]="PLAY",e[e.SHUFFLE_SET=32768]="SHUFFLE_SET",e[e.SELECT_SOUND_MODE=65536]="SELECT_SOUND_MODE",e[e.BROWSE_MEDIA=131072]="BROWSE_MEDIA",e[e.REPEAT_SET=262144]="REPEAT_SET",e[e.GROUPING=524288]="GROUPING",e}({});const p="browser",_={album:{icon:"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,16.5C9.5,16.5 7.5,14.5 7.5,12C7.5,9.5 9.5,7.5 12,7.5C14.5,7.5 16.5,9.5 16.5,12C16.5,14.5 14.5,16.5 12,16.5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",layout:"grid"},app:{icon:"M21 2H3C1.9 2 1 2.9 1 4V20C1 21.1 1.9 22 3 22H21C22.1 22 23 21.1 23 20V4C23 2.9 22.1 2 21 2M21 7H3V4H21V7Z",layout:"grid",show_list_images:!0},artist:{icon:r,layout:"grid",show_list_images:!0},channel:{icon:h,thumbnail_ratio:"portrait",layout:"grid",show_list_images:!0},composer:{icon:"M11,4A4,4 0 0,1 15,8A4,4 0 0,1 11,12A4,4 0 0,1 7,8A4,4 0 0,1 11,4M11,6A2,2 0 0,0 9,8A2,2 0 0,0 11,10A2,2 0 0,0 13,8A2,2 0 0,0 11,6M11,13C12.1,13 13.66,13.23 15.11,13.69C14.5,14.07 14,14.6 13.61,15.23C12.79,15.03 11.89,14.9 11,14.9C8.03,14.9 4.9,16.36 4.9,17V18.1H13.04C13.13,18.8 13.38,19.44 13.76,20H3V17C3,14.34 8.33,13 11,13M18.5,10H20L22,10V12H20V17.5A2.5,2.5 0 0,1 17.5,20A2.5,2.5 0 0,1 15,17.5A2.5,2.5 0 0,1 17.5,15C17.86,15 18.19,15.07 18.5,15.21V10Z",layout:"grid",show_list_images:!0},contributing_artist:{icon:r,layout:"grid",show_list_images:!0},directory:{icon:"M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z",layout:"grid",show_list_images:!0},episode:{icon:h,layout:"grid",thumbnail_ratio:"portrait",show_list_images:!0},game:{icon:"M7,6H17A6,6 0 0,1 23,12A6,6 0 0,1 17,18C15.22,18 13.63,17.23 12.53,16H11.47C10.37,17.23 8.78,18 7,18A6,6 0 0,1 1,12A6,6 0 0,1 7,6M6,9V11H4V13H6V15H8V13H10V11H8V9H6M15.5,12A1.5,1.5 0 0,0 14,13.5A1.5,1.5 0 0,0 15.5,15A1.5,1.5 0 0,0 17,13.5A1.5,1.5 0 0,0 15.5,12M18.5,9A1.5,1.5 0 0,0 17,10.5A1.5,1.5 0 0,0 18.5,12A1.5,1.5 0 0,0 20,10.5A1.5,1.5 0 0,0 18.5,9Z",layout:"grid",thumbnail_ratio:"portrait"},genre:{icon:"M8.11,19.45C5.94,18.65 4.22,16.78 3.71,14.35L2.05,6.54C1.81,5.46 2.5,4.4 3.58,4.17L13.35,2.1L13.38,2.09C14.45,1.88 15.5,2.57 15.72,3.63L16.07,5.3L20.42,6.23H20.45C21.5,6.47 22.18,7.53 21.96,8.59L20.3,16.41C19.5,20.18 15.78,22.6 12,21.79C10.42,21.46 9.08,20.61 8.11,19.45V19.45M20,8.18L10.23,6.1L8.57,13.92V13.95C8,16.63 9.73,19.27 12.42,19.84C15.11,20.41 17.77,18.69 18.34,16L20,8.18M16,16.5C15.37,17.57 14.11,18.16 12.83,17.89C11.56,17.62 10.65,16.57 10.5,15.34L16,16.5M8.47,5.17L4,6.13L5.66,13.94L5.67,13.97C5.82,14.68 6.12,15.32 6.53,15.87C6.43,15.1 6.45,14.3 6.62,13.5L7.05,11.5C6.6,11.42 6.21,11.17 6,10.81C6.06,10.2 6.56,9.66 7.25,9.5C7.33,9.5 7.4,9.5 7.5,9.5L8.28,5.69C8.32,5.5 8.38,5.33 8.47,5.17M15.03,12.23C15.35,11.7 16.03,11.42 16.72,11.57C17.41,11.71 17.91,12.24 18,12.86C17.67,13.38 17,13.66 16.3,13.5C15.61,13.37 15.11,12.84 15.03,12.23M10.15,11.19C10.47,10.66 11.14,10.38 11.83,10.53C12.5,10.67 13.03,11.21 13.11,11.82C12.78,12.34 12.11,12.63 11.42,12.5C10.73,12.33 10.23,11.8 10.15,11.19M11.97,4.43L13.93,4.85L13.77,4.05L11.97,4.43Z",layout:"grid",show_list_images:!0},image:{icon:"M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z",layout:"grid",show_list_images:!0},movie:{icon:"M18,4L20,8H17L15,4H13L15,8H12L10,4H8L10,8H7L5,4H4A2,2 0 0,0 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V4H18Z",thumbnail_ratio:"portrait",layout:"grid",show_list_images:!0},music:{icon:"M21,3V15.5A3.5,3.5 0 0,1 17.5,19A3.5,3.5 0 0,1 14,15.5A3.5,3.5 0 0,1 17.5,12C18.04,12 18.55,12.12 19,12.34V6.47L9,8.6V17.5A3.5,3.5 0 0,1 5.5,21A3.5,3.5 0 0,1 2,17.5A3.5,3.5 0 0,1 5.5,14C6.04,14 6.55,14.12 7,14.34V6L21,3Z",show_list_images:!0},playlist:{icon:"M15,6H3V8H15V6M15,10H3V12H15V10M3,16H11V14H3V16M17,6V14.18C16.69,14.07 16.35,14 16,14A3,3 0 0,0 13,17A3,3 0 0,0 16,20A3,3 0 0,0 19,17V8H22V6H17Z",layout:"grid",show_list_images:!0},podcast:{icon:"M17,18.25V21.5H7V18.25C7,16.87 9.24,15.75 12,15.75C14.76,15.75 17,16.87 17,18.25M12,5.5A6.5,6.5 0 0,1 18.5,12C18.5,13.25 18.15,14.42 17.54,15.41L16,14.04C16.32,13.43 16.5,12.73 16.5,12C16.5,9.5 14.5,7.5 12,7.5C9.5,7.5 7.5,9.5 7.5,12C7.5,12.73 7.68,13.43 8,14.04L6.46,15.41C5.85,14.42 5.5,13.25 5.5,12A6.5,6.5 0 0,1 12,5.5M12,1.5A10.5,10.5 0 0,1 22.5,12C22.5,14.28 21.77,16.39 20.54,18.11L19.04,16.76C19.96,15.4 20.5,13.76 20.5,12A8.5,8.5 0 0,0 12,3.5A8.5,8.5 0 0,0 3.5,12C3.5,13.76 4.04,15.4 4.96,16.76L3.46,18.11C2.23,16.39 1.5,14.28 1.5,12A10.5,10.5 0 0,1 12,1.5M12,9.5A2.5,2.5 0 0,1 14.5,12A2.5,2.5 0 0,1 12,14.5A2.5,2.5 0 0,1 9.5,12A2.5,2.5 0 0,1 12,9.5Z",layout:"grid"},season:{icon:h,layout:"grid",thumbnail_ratio:"portrait",show_list_images:!0},track:{icon:"M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M13,13H11V18A2,2 0 0,1 9,20A2,2 0 0,1 7,18A2,2 0 0,1 9,16C9.4,16 9.7,16.1 10,16.3V11H13V13M13,9V3.5L18.5,9H13Z"},tv_show:{icon:h,layout:"grid",thumbnail_ratio:"portrait"},url:{icon:"M16.36,14C16.44,13.34 16.5,12.68 16.5,12C16.5,11.32 16.44,10.66 16.36,10H19.74C19.9,10.64 20,11.31 20,12C20,12.69 19.9,13.36 19.74,14M14.59,19.56C15.19,18.45 15.65,17.25 15.97,16H18.92C17.96,17.65 16.43,18.93 14.59,19.56M14.34,14H9.66C9.56,13.34 9.5,12.68 9.5,12C9.5,11.32 9.56,10.65 9.66,10H14.34C14.43,10.65 14.5,11.32 14.5,12C14.5,12.68 14.43,13.34 14.34,14M12,19.96C11.17,18.76 10.5,17.43 10.09,16H13.91C13.5,17.43 12.83,18.76 12,19.96M8,8H5.08C6.03,6.34 7.57,5.06 9.4,4.44C8.8,5.55 8.35,6.75 8,8M5.08,16H8C8.35,17.25 8.8,18.45 9.4,19.56C7.57,18.93 6.03,17.65 5.08,16M4.26,14C4.1,13.36 4,12.69 4,12C4,11.31 4.1,10.64 4.26,10H7.64C7.56,10.66 7.5,11.32 7.5,12C7.5,12.68 7.56,13.34 7.64,14M12,4.03C12.83,5.23 13.5,6.57 13.91,8H10.09C10.5,6.57 11.17,5.23 12,4.03M18.92,8H15.97C15.65,6.75 15.19,5.55 14.59,4.44C16.43,5.07 17.96,6.34 18.92,8M12,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,2Z"},video:{icon:"M17,10.5V7A1,1 0 0,0 16,6H4A1,1 0 0,0 3,7V17A1,1 0 0,0 4,18H16A1,1 0 0,0 17,17V13.5L21,17.5V6.5L17,10.5Z",layout:"grid",show_list_images:!0}},v=(e,t,a,i)=>e.callWS({type:"media_player/browse_media",entity_id:t,media_content_id:a,media_content_type:i}),b=e=>{let t=e.attributes.media_position;return"playing"!==e.state?t:(t+=(Date.now()-new Date(e.attributes.media_position_updated_at).getTime())/1e3,t<0?0:t)},g=e=>{let t;switch(e.attributes.media_content_type){case"music":case"image":t=e.attributes.media_artist;break;case"playlist":t=e.attributes.media_playlist||e.attributes.media_artist;break;case"tvshow":t=e.attributes.media_series_title,e.attributes.media_season&&(t+=" S"+e.attributes.media_season,e.attributes.media_episode&&(t+="E"+e.attributes.media_episode));break;case"channel":t=e.attributes.media_channel;break;default:t=e.attributes.app_name||""}return t},y=(e,t=!1)=>{if(!e)return;const a=e.state;if((0,o.rk)(a))return;if(!(0,n.v)(e))return(0,i.e)(e,m.TURN_ON)?[{icon:c,action:"turn_on"}]:void 0;const s=[];(0,i.e)(e,m.TURN_OFF)&&s.push({icon:c,action:"turn_off"});const r=!0===e.attributes.assumed_state,h=e.attributes;return("playing"===a||"paused"===a||r)&&(0,i.e)(e,m.SHUFFLE_SET)&&t&&s.push({icon:!0===h.shuffle?"M14.83,13.41L13.42,14.82L16.55,17.95L14.5,20H20V14.5L17.96,16.54L14.83,13.41M14.5,4L16.54,6.04L4,18.59L5.41,20L17.96,7.46L20,9.5V4M10.59,9.17L5.41,4L4,5.41L9.17,10.58L10.59,9.17Z":"M16,4.5V7H5V9H16V11.5L19.5,8M16,12.5V15H5V17H16V19.5L19.5,16",action:"shuffle_set"}),("playing"===a||"paused"===a||r)&&(0,i.e)(e,m.PREVIOUS_TRACK)&&s.push({icon:"M6,18V6H8V18H6M9.5,12L18,6V18L9.5,12Z",action:"media_previous_track"}),!r&&("playing"===a&&((0,i.e)(e,m.PAUSE)||(0,i.e)(e,m.STOP))||("paused"===a||"idle"===a)&&(0,i.e)(e,m.PLAY)||"on"===a&&((0,i.e)(e,m.PLAY)||(0,i.e)(e,m.PAUSE)))&&s.push({icon:"on"===a?"M3,5V19L11,12M13,19H16V5H13M18,5V19H21V5":"playing"!==a?d:(0,i.e)(e,m.PAUSE)?l:u,action:"playing"!==a?"media_play":(0,i.e)(e,m.PAUSE)?"media_pause":"media_stop"}),r&&(0,i.e)(e,m.PLAY)&&s.push({icon:d,action:"media_play"}),r&&(0,i.e)(e,m.PAUSE)&&s.push({icon:l,action:"media_pause"}),r&&(0,i.e)(e,m.STOP)&&s.push({icon:u,action:"media_stop"}),("playing"===a||"paused"===a||r)&&(0,i.e)(e,m.NEXT_TRACK)&&s.push({icon:"M16,18H18V6H16M6,18L14.5,12L6,6V18Z",action:"media_next_track"}),("playing"===a||"paused"===a||r)&&(0,i.e)(e,m.REPEAT_SET)&&t&&s.push({icon:"all"===h.repeat?"M17,17H7V14L3,18L7,22V19H19V13H17M7,7H17V10L21,6L17,2V5H5V11H7V7Z":"one"===h.repeat?"M13,15V9H12L10,10V11H11.5V15M17,17H7V14L3,18L7,22V19H19V13H17M7,7H17V10L21,6L17,2V5H5V11H7V7Z":"M2,5.27L3.28,4L20,20.72L18.73,22L15.73,19H7V22L3,18L7,14V17H13.73L7,10.27V11H5V8.27L2,5.27M17,13H19V17.18L17,15.18V13M17,5V2L21,6L17,10V7H8.82L6.82,5H17Z",action:"repeat_set"}),s.length>0?s:void 0},C=e=>{if(void 0===e||e===1/0)return"";let t=new Date(1e3*e).toISOString();return t=e>3600?t.substring(11,16):t.substring(14,19),t.replace(/^0+/,"").padStart(4,"0")},f=e=>{if(!e)return;const t=e.indexOf("?authSig=");let a=t>0?e.slice(0,t):e;return a.startsWith("http")&&(a=decodeURIComponent(a.split("/").pop())),a},L=(e,t,a)=>e.callService("media_player","volume_set",{entity_id:t,volume_level:a}),V=(e,t,a)=>e.callService("media_player",a,"shuffle_set"===a?{entity_id:t.entity_id,shuffle:!t.attributes.shuffle}:"repeat_set"===a?{entity_id:t.entity_id,repeat:"all"===t.attributes.repeat?"one":"off"===t.attributes.repeat?"all":"off"}:{entity_id:t.entity_id}),k=(e,t,a,i,n={})=>(!n.enqueue&&void 0===n.announce&&(0,s.b_)(a)&&(n.announce=!0),e.callService("media_player","play_media",Object.assign({entity_id:t,media_content_id:a,media_content_type:i},n)))},58968:function(e,t,a){a.d(t,{MV:()=>d,Wg:()=>r,Xk:()=>s,aT:()=>i,b_:()=>o,yP:()=>l});a(88044);const i=(e,t)=>e.callApi("POST","tts_get_url",t),n="media-source://tts/",o=e=>e.startsWith(n),s=e=>e.substring(19),r=(e,t,a)=>e.callWS({type:"tts/engine/list",language:t,country:a}),l=(e,t)=>e.callWS({type:"tts/engine/get",engine_id:t}),d=(e,t,a)=>e.callWS({type:"tts/engine/voices",engine_id:t,language:a})},88238:function(e,t,a){a.d(t,{RU:()=>n,X1:()=>i,u4:()=>o,zC:()=>s});a(88044);const i=e=>`https://brands.home-assistant.io/${e.brand?"brands/":""}${e.useFallback?"_/":""}${e.domain}/${e.darkOptimized?"dark_":""}${e.type}.png`,n=e=>`https://brands.home-assistant.io/hardware/${e.category}/${e.darkOptimized?"dark_":""}${e.manufacturer}${e.model?`_${e.model}`:""}.png`,o=e=>e.split("/")[4],s=e=>e.startsWith("https://brands.home-assistant.io/")}}]);
//# sourceMappingURL=73856.380d933b9817cfff.js.map