UNPKG

iobroker.lovelace

Version:

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

1 lines 52 kB
export const __webpack_ids__=["61628"];export const __webpack_modules__={19631:function(t,i,e){e.d(i,{Bt:()=>s,T8:()=>d});var n=e(88977),o=e(20382);const a=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],s=t=>t.first_weekday===o.FS.language?"weekInfo"in Intl.Locale.prototype?new Intl.Locale(t.language).weekInfo.firstDay%7:(0,n.L)(t.language)%7:a.includes(t.first_weekday)?a.indexOf(t.first_weekday):1,d=t=>{const i=s(t);return a[i]}},24815:function(t,i,e){e.d(i,{L:()=>n,p:()=>o});const n={device:"M3 6H21V4H3C1.9 4 1 4.9 1 6V18C1 19.1 1.9 20 3 20H7V18H3V6M13 12H9V13.78C8.39 14.33 8 15.11 8 16C8 16.89 8.39 17.67 9 18.22V20H13V18.22C13.61 17.67 14 16.88 14 16S13.61 14.33 13 13.78V12M11 17.5C10.17 17.5 9.5 16.83 9.5 16S10.17 14.5 11 14.5 12.5 15.17 12.5 16 11.83 17.5 11 17.5M22 8H16C15.5 8 15 8.5 15 9V19C15 19.5 15.5 20 16 20H22C22.5 20 23 19.5 23 19V9C23 8.5 22.5 8 22 8M21 18H17V10H21V18Z",and:"M4.4,16.5C4.4,15.6 4.7,14.7 5.2,13.9C5.7,13.1 6.7,12.2 8.2,11.2C7.3,10.1 6.8,9.3 6.5,8.7C6.1,8 6,7.4 6,6.7C6,5.2 6.4,4.1 7.3,3.2C8.2,2.3 9.4,2 10.9,2C12.2,2 13.3,2.4 14.2,3.2C15.1,4 15.5,5 15.5,6.1C15.5,6.9 15.3,7.6 14.9,8.3C14.5,9 13.8,9.7 12.8,10.4L11.4,11.5L15.7,16.7C16.3,15.5 16.6,14.3 16.6,12.8H18.8C18.8,15.1 18.3,17 17.2,18.5L20,21.8H17L15.7,20.3C15,20.9 14.3,21.3 13.4,21.6C12.5,21.9 11.6,22.1 10.7,22.1C8.8,22.1 7.3,21.6 6.1,20.6C5,19.5 4.4,18.2 4.4,16.5M10.7,20C12,20 13.2,19.5 14.3,18.5L9.6,12.8L9.2,13.1C7.7,14.2 7,15.3 7,16.5C7,17.6 7.3,18.4 8,19C8.7,19.6 9.5,20 10.7,20M8.5,6.7C8.5,7.6 9,8.6 10.1,9.9L11.7,8.8C12.3,8.4 12.7,8 12.9,7.6C13.1,7.2 13.2,6.7 13.2,6.2C13.2,5.6 13,5.1 12.5,4.7C12.1,4.3 11.5,4.1 10.8,4.1C10.1,4.1 9.5,4.3 9.1,4.8C8.7,5.3 8.5,5.9 8.5,6.7Z",or:"M2,4C5,10 5,14 2,20H8C13,20 19,16 22,12C19,8 13,4 8,4H2M5,6H8C11.5,6 16.3,9 19.3,12C16.3,15 11.5,18 8,18H5C6.4,13.9 6.4,10.1 5,6Z",not:"M14.08,4.61L15.92,5.4L14.8,8H19V10H13.95L12.23,14H19V16H11.38L9.92,19.4L8.08,18.61L9.2,16H5V14H10.06L11.77,10H5V8H12.63L14.08,4.61Z",state:"M6.27 17.05C6.72 17.58 7 18.25 7 19C7 20.66 5.66 22 4 22S1 20.66 1 19 2.34 16 4 16C4.18 16 4.36 16 4.53 16.05L7.6 10.69L5.86 9.7L9.95 8.58L11.07 12.67L9.33 11.68L6.27 17.05M20 16C18.7 16 17.6 16.84 17.18 18H11V16L8 19L11 22V20H17.18C17.6 21.16 18.7 22 20 22C21.66 22 23 20.66 23 19S21.66 16 20 16M12 8C12.18 8 12.36 8 12.53 7.95L15.6 13.31L13.86 14.3L17.95 15.42L19.07 11.33L17.33 12.32L14.27 6.95C14.72 6.42 15 5.75 15 5C15 3.34 13.66 2 12 2S9 3.34 9 5 10.34 8 12 8Z",numeric_state:"M4,17V9H2V7H6V17H4M22,15C22,16.11 21.1,17 20,17H16V15H20V13H18V11H20V9H16V7H20A2,2 0 0,1 22,9V10.5A1.5,1.5 0 0,1 20.5,12A1.5,1.5 0 0,1 22,13.5V15M14,15V17H8V13C8,11.89 8.9,11 10,11H12V9H8V7H12A2,2 0 0,1 14,9V11C14,12.11 13.1,13 12,13H10V15H14Z",sun:"M12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,2L14.39,5.42C13.65,5.15 12.84,5 12,5C11.16,5 10.35,5.15 9.61,5.42L12,2M3.34,7L7.5,6.65C6.9,7.16 6.36,7.78 5.94,8.5C5.5,9.24 5.25,10 5.11,10.79L3.34,7M3.36,17L5.12,13.23C5.26,14 5.53,14.78 5.95,15.5C6.37,16.24 6.91,16.86 7.5,17.37L3.36,17M20.65,7L18.88,10.79C18.74,10 18.47,9.23 18.05,8.5C17.63,7.78 17.1,7.15 16.5,6.64L20.65,7M20.64,17L16.5,17.36C17.09,16.85 17.62,16.22 18.04,15.5C18.46,14.77 18.73,14 18.87,13.21L20.64,17M12,22L9.59,18.56C10.33,18.83 11.14,19 12,19C12.82,19 13.63,18.83 14.37,18.56L12,22Z",template:"M8,3A2,2 0 0,0 6,5V9A2,2 0 0,1 4,11H3V13H4A2,2 0 0,1 6,15V19A2,2 0 0,0 8,21H10V19H8V14A2,2 0 0,0 6,12A2,2 0 0,0 8,10V5H10V3M16,3A2,2 0 0,1 18,5V9A2,2 0 0,0 20,11H21V13H20A2,2 0 0,0 18,15V19A2,2 0 0,1 16,21H14V19H16V14A2,2 0 0,1 18,12A2,2 0 0,1 16,10V5H14V3H16Z",time:"M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22C6.47,22 2,17.5 2,12A10,10 0 0,1 12,2M12.5,7V12.25L17,14.92L16.25,16.15L11,13V7H12.5Z",trigger:"M10 7V9H9V15H10V17H6V15H7V9H6V7H10M16 7C17.11 7 18 7.9 18 9V15C18 16.11 17.11 17 16 17H12V7M16 9H14V15H16V9Z",zone:"M12,2C15.31,2 18,4.66 18,7.95C18,12.41 12,19 12,19C12,19 6,12.41 6,7.95C6,4.66 8.69,2 12,2M12,6A2,2 0 0,0 10,8A2,2 0 0,0 12,10A2,2 0 0,0 14,8A2,2 0 0,0 12,6M20,19C20,21.21 16.42,23 12,23C7.58,23 4,21.21 4,19C4,17.71 5.22,16.56 7.11,15.83L7.75,16.74C6.67,17.19 6,17.81 6,18.5C6,19.88 8.69,21 12,21C15.31,21 18,19.88 18,18.5C18,17.81 17.33,17.19 16.25,16.74L16.89,15.83C18.78,16.56 20,17.71 20,19Z"},o={device:{},entity:{icon:"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",members:{state:{},numeric_state:{}}},time_location:{icon:"M15,12H16.5V16.25L19.36,17.94L18.61,19.16L15,17V12M23,16A7,7 0 0,1 16,23C13,23 10.4,21.08 9.42,18.4L8,17.9L2.66,19.97L2.5,20A0.5,0.5 0 0,1 2,19.5V4.38C2,4.15 2.15,3.97 2.36,3.9L8,2L14,4.1L19.34,2H19.5A0.5,0.5 0 0,1 20,2.5V10.25C21.81,11.5 23,13.62 23,16M9,16C9,12.83 11.11,10.15 14,9.29V6.11L8,4V15.89L9,16.24C9,16.16 9,16.08 9,16M16,11A5,5 0 0,0 11,16A5,5 0 0,0 16,21A5,5 0 0,0 21,16A5,5 0 0,0 16,11Z",members:{sun:{},time:{},zone:{}}},building_blocks:{icon:"M18.5 18.5C19.04 18.5 19.5 18.96 19.5 19.5S19.04 20.5 18.5 20.5H6.5C5.96 20.5 5.5 20.04 5.5 19.5S5.96 18.5 6.5 18.5H18.5M18.5 17H6.5C5.13 17 4 18.13 4 19.5S5.13 22 6.5 22H18.5C19.88 22 21 20.88 21 19.5S19.88 17 18.5 17M21 11H18V7H13L10 11V16H22L21 11M11.54 11L13.5 8.5H16V11H11.54M9.76 3.41L4.76 2L2 11.83C1.66 13.11 2.41 14.44 3.7 14.8L4.86 15.12L8.15 12.29L4.27 11.21L6.15 4.46L8.94 5.24C9.5 5.53 10.71 6.34 11.47 7.37L12.5 6H12.94C11.68 4.41 9.85 3.46 9.76 3.41Z",members:{and:{},or:{},not:{}}},other:{icon:"M16,12A2,2 0 0,1 18,10A2,2 0 0,1 20,12A2,2 0 0,1 18,14A2,2 0 0,1 16,12M10,12A2,2 0 0,1 12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12M4,12A2,2 0 0,1 6,10A2,2 0 0,1 8,12A2,2 0 0,1 6,14A2,2 0 0,1 4,12Z",members:{template:{},trigger:{}}}}},19694:function(t,i,e){e.a(t,(async function(t,i){try{var n=e(44249),o=e(57243),a=e(15093),s=e(27486),d=e(29567),l=e(36522),c=(e(64889),e(14473)),r=e(28008),u=e(45973),h=(e(21754),e(23436)),m=(e(89962),e(60750)),v=(e(65169),e(87371),e(37860)),p=(e(76535),e(31563),e(62266)),_=t([u,h,m,v,p]);[u,h,m,v,p]=_.then?(await _)():_;(0,n.Z)([(0,a.Mo)("ha-automation-condition-editor")],(function(t,i){return{F:class extends i{constructor(...i){super(...i),t(this)}},d:[{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"condition",value:void 0},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"yamlMode",value:()=>!1},{kind:"field",key:"_processedCondition",value:()=>(0,s.Z)((t=>(0,c.Gd)(t)))},{kind:"method",key:"render",value:function(){const t=this._processedCondition(this.condition),i=void 0!==customElements.get(`ha-automation-condition-${t.condition}`),e=this.yamlMode||!i;return o.dy` ${e?o.dy` ${i?"":o.dy` ${this.hass.localize("ui.panel.config.automation.editor.conditions.unsupported_condition",{condition:t.condition})} `} <ha-yaml-editor .hass="${this.hass}" .defaultValue="${this.condition}" @value-changed="${this._onYamlChange}" .readOnly="${this.disabled}"></ha-yaml-editor> `:o.dy` <div @value-changed="${this._onUiChanged}"> ${(0,d.h)(`ha-automation-condition-${t.condition}`,{hass:this.hass,condition:t,disabled:this.disabled})} </div> `} `}},{kind:"method",key:"_onYamlChange",value:function(t){t.stopPropagation(),t.detail.isValid&&(0,l.B)(this,"value-changed",{value:t.detail.value,yaml:!0})}},{kind:"method",key:"_onUiChanged",value:function(t){t.stopPropagation();const i={...this.condition.alias?{alias:this.condition.alias}:{},...t.detail.value};(0,l.B)(this,"value-changed",{value:i})}},{kind:"field",static:!0,key:"styles",value:()=>r.Qx}]}}),o.oi);i()}catch(t){i(t)}}))},71081:function(t,i,e){e.a(t,(async function(t,n){try{e.d(i,{a:()=>P});var o=e(44249),a=(e(9359),e(70104),e(60738)),s=e(12582),d=e(57243),l=e(15093),c=e(35359),r=e(68958),u=e(36522),h=e(49976),m=e(87733),v=e(41680),p=(e(64780),e(7843),e(51868),e(54977),e(41307),e(23334),e(14473)),_=e(17551),f=e(24815),y=e(47805),k=e(30635),g=e(76131),b=e(28008),C=e(19694),$=t([C,_]);[C,_]=$.then?(await $)():$;const A="M11,4H13V16L18.5,10.5L19.92,11.92L12,19.84L4.08,11.92L5.5,10.5L11,16V4Z",M="M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z",H="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",V="M19,3L13,9L15,11L22,4V3M12,12.5A0.5,0.5 0 0,1 11.5,12A0.5,0.5 0 0,1 12,11.5A0.5,0.5 0 0,1 12.5,12A0.5,0.5 0 0,1 12,12.5M6,20A2,2 0 0,1 4,18C4,16.89 4.9,16 6,16A2,2 0 0,1 8,18C8,19.11 7.1,20 6,20M6,8A2,2 0 0,1 4,6C4,4.89 4.9,4 6,4A2,2 0 0,1 8,6C8,7.11 7.1,8 6,8M9.64,7.64C9.87,7.14 10,6.59 10,6A4,4 0 0,0 6,2A4,4 0 0,0 2,6A4,4 0 0,0 6,10C6.59,10 7.14,9.87 7.64,9.64L10,12L7.64,14.36C7.14,14.13 6.59,14 6,14A4,4 0 0,0 2,18A4,4 0 0,0 6,22A4,4 0 0,0 10,18C10,17.41 9.87,16.86 9.64,16.36L12,14L19,21H22V20L9.64,7.64Z",L="M11,17H4A2,2 0 0,1 2,15V3A2,2 0 0,1 4,1H16V3H4V15H11V13L15,16L11,19V17M19,21V7H8V13H6V7A2,2 0 0,1 8,5H19A2,2 0 0,1 21,7V21A2,2 0 0,1 19,23H8A2,2 0 0,1 6,21V19H8V21H19Z",w="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",x="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",B="M6,22A3,3 0 0,1 3,19C3,18.4 3.18,17.84 3.5,17.37L9,7.81V6A1,1 0 0,1 8,5V4A2,2 0 0,1 10,2H14A2,2 0 0,1 16,4V5A1,1 0 0,1 15,6V7.81L20.5,17.37C20.82,17.84 21,18.4 21,19A3,3 0 0,1 18,22H6M5,19A1,1 0 0,0 6,20H18A1,1 0 0,0 19,19C19,18.79 18.93,18.59 18.82,18.43L16.53,14.47L14,17L8.93,11.93L5.18,18.43C5.07,18.59 5,18.79 5,19M13,10A1,1 0 0,0 12,11A1,1 0 0,0 13,12A1,1 0 0,0 14,11A1,1 0 0,0 13,10Z",Z="M12,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,2M10,16.5L16,12L10,7.5V16.5Z",z="M3 6V8H14V6H3M3 10V12H14V10H3M20 10.1C19.9 10.1 19.7 10.2 19.6 10.3L18.6 11.3L20.7 13.4L21.7 12.4C21.9 12.2 21.9 11.8 21.7 11.6L20.4 10.3C20.3 10.2 20.2 10.1 20 10.1M18.1 11.9L12 17.9V20H14.1L20.2 13.9L18.1 11.9M3 14V16H10V14H3Z",I="M18,17H10.5L12.5,15H18M6,17V14.5L13.88,6.65C14.07,6.45 14.39,6.45 14.59,6.65L16.35,8.41C16.55,8.61 16.55,8.92 16.35,9.12L8.47,17M19,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",E="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4M9,9V15H15V9",S=t=>t.preventDefault(),P=(t,i)=>{i.stopPropagation();const e=i.currentTarget?.name;if(!e)return;const n=i.detail?.value||i.currentTarget?.value;if((t.condition[e]||"")===n)return;let o;n?o={...t.condition,[e]:n}:(o={...t.condition},delete o[e]),(0,u.B)(t,"value-changed",{value:o})};(0,o.Z)([(0,l.Mo)("ha-automation-condition-row")],(function(t,i){return{F:class extends i{constructor(...i){super(...i),t(this)}},d:[{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"condition",value:void 0},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"first",value:void 0},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"last",value:void 0},{kind:"field",decorators:[(0,r.t)({key:"automationClipboard",state:!1,subscribe:!0,storage:"sessionStorage"})],key:"_clipboard",value:void 0},{kind:"field",decorators:[(0,l.SB)()],key:"_yamlMode",value:()=>!1},{kind:"field",decorators:[(0,l.SB)()],key:"_warnings",value:void 0},{kind:"field",decorators:[(0,l.SB)()],key:"_testing",value:()=>!1},{kind:"field",decorators:[(0,l.SB)()],key:"_testingResult",value:void 0},{kind:"field",decorators:[(0,l.SB)(),(0,a.F_)({context:k.we,subscribe:!0})],key:"_entityReg",value:void 0},{kind:"method",key:"render",value:function(){return this.condition?d.dy` <ha-card outlined> ${!1===this.condition.enabled?d.dy` <div class="disabled-bar"> ${this.hass.localize("ui.panel.config.automation.editor.actions.disabled")} </div> `:""} <ha-expansion-panel left-chevron> <ha-svg-icon slot="leading-icon" class="condition-icon" .path="${f.L[this.condition.condition]}"></ha-svg-icon> <h3 slot="header"> ${(0,m.f)((0,_.m)(this.condition,this.hass,this._entityReg))} </h3> <slot name="icons" slot="icons"></slot> <ha-md-button-menu slot="icons" @click="${S}" @keydown="${h.U}" @closed="${h.U}" positioning="fixed"> <ha-icon-button slot="trigger" .label="${this.hass.localize("ui.common.menu")}" .path="${x}"> </ha-icon-button> <ha-md-menu-item .clickAction="${this._testCondition}"> ${this.hass.localize("ui.panel.config.automation.editor.conditions.test")} <ha-svg-icon slot="start" .path="${B}"></ha-svg-icon> </ha-md-menu-item> <ha-md-menu-item .clickAction="${this._renameCondition}" .disabled="${this.disabled}"> ${this.hass.localize("ui.panel.config.automation.editor.conditions.rename")} <ha-svg-icon slot="start" .path="${I}"></ha-svg-icon> </ha-md-menu-item> <ha-md-divider role="separator" tabindex="-1"></ha-md-divider> <ha-md-menu-item .clickAction="${this._duplicateCondition}" .disabled="${this.disabled}"> ${this.hass.localize("ui.panel.config.automation.editor.actions.duplicate")} <ha-svg-icon slot="start" .path="${L}"></ha-svg-icon> </ha-md-menu-item> <ha-md-menu-item .clickAction="${this._copyCondition}" .disabled="${this.disabled}"> ${this.hass.localize("ui.panel.config.automation.editor.triggers.copy")} <ha-svg-icon slot="start" .path="${H}"></ha-svg-icon> </ha-md-menu-item> <ha-md-menu-item .clickAction="${this._cutCondition}" .disabled="${this.disabled}"> ${this.hass.localize("ui.panel.config.automation.editor.triggers.cut")} <ha-svg-icon slot="start" .path="${V}"></ha-svg-icon> </ha-md-menu-item> <ha-md-menu-item .clickAction="${this._moveUp}" .disabled="${this.disabled||this.first}"> ${this.hass.localize("ui.panel.config.automation.editor.move_up")} <ha-svg-icon slot="start" .path="${M}"></ha-svg-icon></ha-md-menu-item> <ha-md-menu-item .clickAction="${this._moveDown}" .disabled="${this.disabled||this.last}"> ${this.hass.localize("ui.panel.config.automation.editor.move_down")} <ha-svg-icon slot="start" .path="${A}"></ha-svg-icon></ha-md-menu-item> <ha-md-menu-item .clickAction="${this._toggleYamlMode}" .disabled="${this._warnings}"> ${this.hass.localize("ui.panel.config.automation.editor.edit_"+(this._yamlMode?"ui":"yaml"))} <ha-svg-icon slot="start" .path="${z}"></ha-svg-icon> </ha-md-menu-item> <ha-md-divider role="separator" tabindex="-1"></ha-md-divider> <ha-md-menu-item .clickAction="${this._onDisable}" .disabled="${this.disabled}"> ${!1===this.condition.enabled?this.hass.localize("ui.panel.config.automation.editor.actions.enable"):this.hass.localize("ui.panel.config.automation.editor.actions.disable")} <ha-svg-icon slot="start" .path="${!1===this.condition.enabled?Z:E}"></ha-svg-icon> </ha-md-menu-item> <ha-md-menu-item class="warning" .clickAction="${this._onDelete}" .disabled="${this.disabled}"> ${this.hass.localize("ui.panel.config.automation.editor.actions.delete")} <ha-svg-icon class="warning" slot="start" .path="${w}"></ha-svg-icon> </ha-md-menu-item> </ha-md-button-menu> <div class="${(0,c.$)({"card-content":!0,disabled:!1===this.condition.enabled})}"> ${this._warnings?d.dy`<ha-alert alert-type="warning" .title="${this.hass.localize("ui.errors.config.editor_not_supported")}"> ${this._warnings.length>0&&void 0!==this._warnings[0]?d.dy` <ul> ${this._warnings.map((t=>d.dy`<li>${t}</li>`))} </ul>`:""} ${this.hass.localize("ui.errors.config.edit_in_yaml_supported")} </ha-alert>`:""} <ha-automation-condition-editor @ui-mode-not-available="${this._handleUiModeNotAvailable}" @value-changed="${this._handleChangeEvent}" .yamlMode="${this._yamlMode}" .disabled="${this.disabled}" .hass="${this.hass}" .condition="${this.condition}"></ha-automation-condition-editor> </div> </ha-expansion-panel> <div class="testing ${(0,c.$)({active:this._testing,pass:!0===this._testingResult,error:!1===this._testingResult})}"> ${this._testingResult?this.hass.localize("ui.panel.config.automation.editor.conditions.testing_pass"):this.hass.localize("ui.panel.config.automation.editor.conditions.testing_error")} </div> </ha-card> `:d.Ld}},{kind:"method",key:"_handleUiModeNotAvailable",value:function(t){t.stopPropagation(),this._warnings=(0,v.p)(this.hass,t.detail).warnings,this._yamlMode||(this._yamlMode=!0)}},{kind:"method",key:"_handleChangeEvent",value:function(t){t.detail.yaml&&(this._warnings=void 0)}},{kind:"method",key:"_setClipboard",value:function(){this._clipboard={...this._clipboard,condition:(0,s.Z)(this.condition)}}},{kind:"field",key:"_onDisable",value(){return()=>{const t=!(this.condition.enabled??1),i={...this.condition,enabled:t};(0,u.B)(this,"value-changed",{value:i})}}},{kind:"field",key:"_onDelete",value(){return()=>{(0,g.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.automation.editor.conditions.delete_confirm_title"),text:this.hass.localize("ui.panel.config.automation.editor.conditions.delete_confirm_text"),dismissText:this.hass.localize("ui.common.cancel"),confirmText:this.hass.localize("ui.common.delete"),destructive:!0,confirm:()=>{(0,u.B)(this,"value-changed",{value:null})}})}}},{kind:"method",key:"_switchUiMode",value:function(){this._warnings=void 0,this._yamlMode=!1}},{kind:"method",key:"_switchYamlMode",value:function(){this._warnings=void 0,this._yamlMode=!0}},{kind:"field",key:"_testCondition",value(){return async()=>{if(this._testing)return;this._testingResult=void 0,this._testing=!0;const t=this.condition;try{const i=await(0,y.w)(this.hass,{conditions:t});if(this.condition!==t)return void(this._testing=!1);if(!i.conditions.valid)return(0,g.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.automation.editor.conditions.invalid_condition"),text:i.conditions.error}),void(this._testing=!1);let e;try{e=await(0,p.J8)(this.hass,t)}catch(i){return this.condition!==t||(0,g.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.automation.editor.conditions.test_failed"),text:i.message}),void(this._testing=!1)}this._testingResult=e.result}finally{setTimeout((()=>{this._testing=!1}),2500)}}}},{kind:"field",key:"_renameCondition",value(){return async()=>{const t=await(0,g.showPromptDialog)(this,{title:this.hass.localize("ui.panel.config.automation.editor.conditions.change_alias"),inputLabel:this.hass.localize("ui.panel.config.automation.editor.conditions.alias"),inputType:"string",placeholder:(0,m.f)((0,_.m)(this.condition,this.hass,this._entityReg,!0)),defaultValue:this.condition.alias,confirmText:this.hass.localize("ui.common.submit")});if(null!==t){const i={...this.condition};""===t?delete i.alias:i.alias=t,(0,u.B)(this,"value-changed",{value:i})}}}},{kind:"field",key:"_duplicateCondition",value(){return()=>{(0,u.B)(this,"duplicate")}}},{kind:"field",key:"_copyCondition",value(){return()=>{this._setClipboard()}}},{kind:"field",key:"_cutCondition",value(){return()=>{this._setClipboard(),(0,u.B)(this,"value-changed",{value:null})}}},{kind:"field",key:"_moveUp",value(){return()=>{(0,u.B)(this,"move-up")}}},{kind:"field",key:"_moveDown",value(){return()=>{(0,u.B)(this,"move-down")}}},{kind:"field",key:"_toggleYamlMode",value(){return()=>{this._yamlMode?this._switchUiMode():this._switchYamlMode(),this.expand()}}},{kind:"method",key:"expand",value:function(){this.updateComplete.then((()=>{this.shadowRoot.querySelector("ha-expansion-panel").expanded=!0}))}},{kind:"get",static:!0,key:"styles",value:function(){return[b.Qx,d.iv`.disabled{opacity:.5;pointer-events:none}ha-expansion-panel{--expansion-panel-summary-padding:0 0 0 8px;--expansion-panel-content-padding:0}h3{margin:0;font-size:inherit;font-weight:inherit}.condition-icon{display:none}@media (min-width:870px){.condition-icon{display:inline-block;color:var(--secondary-text-color);opacity:.9}}.card-content{padding:16px}.disabled-bar{background:var(--divider-color,#e0e0e0);text-align:center;border-top-right-radius:var(--ha-card-border-radius,12px);border-top-left-radius:var(--ha-card-border-radius,12px)}.testing{position:absolute;top:0px;right:0px;left:0px;text-transform:uppercase;font-weight:700;font-size:14px;background-color:var(--divider-color,#e0e0e0);color:var(--text-primary-color);max-height:0px;overflow:hidden;transition:max-height .3s;text-align:center;border-top-right-radius:var(--ha-card-border-radius,12px);border-top-left-radius:var(--ha-card-border-radius,12px)}.testing.active{max-height:100px}.testing.error{background-color:var(--accent-color)}.testing.pass{background-color:var(--success-color)}ha-md-menu-item>ha-svg-icon{--mdc-icon-size:24px}`]}}]}}),d.oi);n()}catch(t){n(t)}}))},93831:function(t,i,e){e.a(t,(async function(t,i){try{var n=e(44249),o=e(72621),a=(e(9359),e(56475),e(31526),e(12582)),s=e(57243),d=e(15093),l=e(91583),c=e(68958),r=e(36522),u=e(62201),h=e(76320),m=(e(59826),e(34273),e(62801),e(37583),e(40159)),v=e(71081),p=t([v]);v=(p.then?(await p)():p)[0];const _="M7,19V17H9V19H7M11,19V17H13V19H11M15,19V17H17V19H15M7,15V13H9V15H7M11,15V13H13V15H11M15,15V13H17V15H15M7,11V9H9V11H7M11,11V9H13V11H11M15,11V9H17V11H15M7,7V5H9V7H7M11,7V5H13V7H11M15,7V5H17V7H15Z",f="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z";(0,n.Z)([(0,d.Mo)("ha-automation-condition")],(function(t,i){class e extends i{constructor(...i){super(...i),t(this)}}return{F:e,d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"conditions",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,d.SB)()],key:"_showReorder",value:()=>!1},{kind:"field",decorators:[(0,c.t)({key:"automationClipboard",state:!0,subscribe:!0,storage:"sessionStorage"})],key:"_clipboard",value:void 0},{kind:"field",key:"_focusLastConditionOnChange",value:()=>!1},{kind:"field",key:"_conditionKeys",value:()=>new WeakMap},{kind:"field",key:"_unsubMql",value:void 0},{kind:"method",key:"connectedCallback",value:function(){(0,o.Z)(e,"connectedCallback",this,3)([]),this._unsubMql=(0,u.K)("(min-width: 600px)",(t=>{this._showReorder=t}))}},{kind:"method",key:"disconnectedCallback",value:function(){(0,o.Z)(e,"disconnectedCallback",this,3)([]),this._unsubMql?.(),this._unsubMql=void 0}},{kind:"method",key:"updated",value:function(t){if(!t.has("conditions"))return;let i;if(Array.isArray(this.conditions)||(i=[this.conditions]),(i||this.conditions).forEach(((t,e)=>{"string"==typeof t&&(i=i||[...this.conditions],i[e]={condition:"template",value_template:t})})),i)(0,r.B)(this,"value-changed",{value:i});else if(this._focusLastConditionOnChange){this._focusLastConditionOnChange=!1;const t=this.shadowRoot.querySelector("ha-automation-condition-row:last-of-type");t.updateComplete.then((()=>{t.expand(),t.scrollIntoView(),t.focus()}))}}},{kind:"method",key:"expandAll",value:function(){this.shadowRoot.querySelectorAll("ha-automation-condition-row").forEach((t=>{t.expand()}))}},{kind:"method",key:"render",value:function(){return Array.isArray(this.conditions)?s.dy` <ha-sortable handle-selector=".handle" draggable-selector="ha-automation-condition-row" .disabled="${!this._showReorder||this.disabled}" group="conditions" invert-swap @item-moved="${this._conditionMoved}" @item-added="${this._conditionAdded}" @item-removed="${this._conditionRemoved}"> <div class="conditions"> ${(0,l.r)(this.conditions.filter((t=>"object"==typeof t)),(t=>this._getKey(t)),((t,i)=>s.dy` <ha-automation-condition-row .sortableData="${t}" .index="${i}" .first="${0===i}" .last="${i===this.conditions.length-1}" .totalConditions="${this.conditions.length}" .condition="${t}" .disabled="${this.disabled}" @duplicate="${this._duplicateCondition}" @move-down="${this._moveDown}" @move-up="${this._moveUp}" @value-changed="${this._conditionChanged}" .hass="${this.hass}"> ${this._showReorder&&!this.disabled?s.dy` <div class="handle" slot="icons"> <ha-svg-icon .path="${_}"></ha-svg-icon> </div> `:s.Ld} </ha-automation-condition-row> `))} <div class="buttons"> <ha-button outlined .disabled="${this.disabled}" .label="${this.hass.localize("ui.panel.config.automation.editor.conditions.add")}" @click="${this._addConditionDialog}"> <ha-svg-icon .path="${f}" slot="icon"></ha-svg-icon> </ha-button> <ha-button .disabled="${this.disabled}" .label="${this.hass.localize("ui.panel.config.automation.editor.conditions.add_building_block")}" @click="${this._addConditionBuildingBlockDialog}"> <ha-svg-icon .path="${f}" slot="icon"></ha-svg-icon> </ha-button> </div> </div> </ha-sortable> `:s.Ld}},{kind:"method",key:"_addConditionDialog",value:function(){(0,m._)(this,{type:"condition",add:this._addCondition,clipboardItem:this._clipboard?.condition?.condition})}},{kind:"method",key:"_addConditionBuildingBlockDialog",value:function(){(0,m._)(this,{type:"condition",add:this._addCondition,clipboardItem:this._clipboard?.condition?.condition,group:"building_blocks"})}},{kind:"field",key:"_addCondition",value(){return t=>{let i;if(t===m.I)i=this.conditions.concat((0,a.Z)(this._clipboard.condition));else{const e=t,n=customElements.get(`ha-automation-condition-${e}`);i=this.conditions.concat({...n.defaultConfig})}this._focusLastConditionOnChange=!0,(0,r.B)(this,"value-changed",{value:i})}}},{kind:"method",key:"_getKey",value:function(t){return this._conditionKeys.has(t)||this._conditionKeys.set(t,Math.random().toString()),this._conditionKeys.get(t)}},{kind:"method",key:"_moveUp",value:function(t){t.stopPropagation();const i=t.target.index,e=i-1;this._move(i,e)}},{kind:"method",key:"_moveDown",value:function(t){t.stopPropagation();const i=t.target.index,e=i+1;this._move(i,e)}},{kind:"method",key:"_move",value:function(t,i){const e=this.conditions.concat(),n=e.splice(t,1)[0];e.splice(i,0,n),this.conditions=e,(0,r.B)(this,"value-changed",{value:e})}},{kind:"method",key:"_conditionMoved",value:function(t){t.stopPropagation();const{oldIndex:i,newIndex:e}=t.detail;this._move(i,e)}},{kind:"method",key:"_conditionAdded",value:async function(t){t.stopPropagation();const{index:i,data:e}=t.detail,n=[...this.conditions.slice(0,i),e,...this.conditions.slice(i)];this.conditions=n,await(0,h.y)(),(0,r.B)(this,"value-changed",{value:this.conditions})}},{kind:"method",key:"_conditionRemoved",value:async function(t){t.stopPropagation();const{index:i}=t.detail,e=this.conditions[i];this.conditions=this.conditions.filter((t=>t!==e)),await(0,h.y)();const n=this.conditions.filter((t=>t!==e));(0,r.B)(this,"value-changed",{value:n})}},{kind:"method",key:"_conditionChanged",value:function(t){t.stopPropagation();const i=[...this.conditions],e=t.detail.value,n=t.target.index;if(null===e)i.splice(n,1);else{const t=this._getKey(i[n]);this._conditionKeys.set(e,t),i[n]=e}this.conditions=i,(0,r.B)(this,"value-changed",{value:i})}},{kind:"method",key:"_duplicateCondition",value:function(t){t.stopPropagation();const i=t.target.index;(0,r.B)(this,"value-changed",{value:this.conditions.concat((0,a.Z)(this.conditions[i]))})}},{kind:"field",static:!0,key:"styles",value:()=>s.iv`.conditions{padding:16px;margin:-16px;display:flex;flex-direction:column;gap:16px}.sortable-ghost{background:0 0;border-radius:var(--ha-card-border-radius,12px)}.sortable-drag{background:0 0}ha-automation-condition-row{display:block;scroll-margin-top:48px}.buttons{order:1}ha-svg-icon{height:20px}.handle{padding:12px;cursor:move;cursor:grab}.handle ha-svg-icon{pointer-events:none;height:24px}.buttons{display:flex;flex-wrap:wrap;gap:8px}`}]}}),s.oi);i()}catch(t){i(t)}}))},45973:function(t,i,e){e.a(t,(async function(t,i){try{var n=e(44249),o=e(15093),a=e(49214),s=t([a]);a=(s.then?(await s)():s)[0];(0,n.Z)([(0,o.Mo)("ha-automation-condition-and")],(function(t,i){return{F:class extends i{constructor(...i){super(...i),t(this)}},d:[{kind:"get",static:!0,key:"defaultConfig",value:function(){return{condition:"and",conditions:[]}}}]}}),a.w);i()}catch(t){i(t)}}))},21754:function(t,i,e){var n=e(44249),o=(e(9359),e(31526),e(60738)),a=e(57243),s=e(15093),d=e(27486),l=e(36522),c=e(5318),r=e(30230);(0,n.Z)([(0,s.Mo)("ha-device-condition-picker")],(function(t,i){return{F:class extends i{constructor(){super(c.b2,c.Gg,(t=>({device_id:t||"",condition:"device",domain:"",entity_id:""}))),t(this)}},d:[{kind:"get",key:"NO_AUTOMATION_TEXT",value:function(){return this.hass.localize("ui.panel.config.devices.automation.conditions.no_conditions")}},{kind:"get",key:"UNKNOWN_AUTOMATION_TEXT",value:function(){return this.hass.localize("ui.panel.config.devices.automation.conditions.unknown_condition")}}]}}),r.g);e(98157),e(29073);var u=e(30635);(0,n.Z)([(0,s.Mo)("ha-automation-condition-device")],(function(t,i){class e extends i{constructor(...i){super(...i),t(this)}}return{F:e,d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Object})],key:"condition",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,s.SB)()],key:"_deviceId",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_capabilities",value:void 0},{kind:"field",decorators:[(0,s.SB)(),(0,o.F_)({context:u.we,subscribe:!0})],key:"_entityReg",value:void 0},{kind:"field",key:"_origCondition",value:void 0},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{condition:"device",device_id:"",domain:"",entity_id:""}}},{kind:"field",key:"_extraFieldsData",value:()=>(0,d.Z)(((t,i)=>{const e={};return i.extra_fields.forEach((i=>{void 0!==t[i.name]&&(e[i.name]=t[i.name])})),e}))},{kind:"method",key:"shouldUpdate",value:function(t){return!t.has("condition")||(!this.condition.device_id||this.condition.device_id in this.hass.devices||((0,l.B)(this,"ui-mode-not-available",Error(this.hass.localize("ui.panel.config.automation.editor.edit_unknown_device"))),!1))}},{kind:"method",key:"render",value:function(){const t=this._deviceId||this.condition.device_id;return a.dy` <ha-device-picker .value="${t}" @value-changed="${this._devicePicked}" .hass="${this.hass}" .disabled="${this.disabled}" .label="${this.hass.localize("ui.panel.config.automation.editor.conditions.type.device.label")}"></ha-device-picker> <ha-device-condition-picker .value="${this.condition}" .deviceId="${t}" @value-changed="${this._deviceConditionPicked}" .hass="${this.hass}" .disabled="${this.disabled}" .label="${this.hass.localize("ui.panel.config.automation.editor.conditions.type.device.condition")}"></ha-device-condition-picker> ${this._capabilities?.extra_fields?a.dy` <ha-form .hass="${this.hass}" .data="${this._extraFieldsData(this.condition,this._capabilities)}" .schema="${this._capabilities.extra_fields}" .disabled="${this.disabled}" .computeLabel="${(0,c.kJ)(this.hass,this.condition)}" .computeHelper="${(0,c.Md)(this.hass,this.condition)}" @value-changed="${this._extraFieldsChanged}"></ha-form> `:""} `}},{kind:"method",key:"firstUpdated",value:function(){this._capabilities||this._getCapabilities(),this.condition&&(this._origCondition=this.condition)}},{kind:"method",key:"updated",value:function(t){const i=t.get("condition");i&&!(0,c.hH)(this._entityReg,i,this.condition)&&this._getCapabilities()}},{kind:"method",key:"_getCapabilities",value:async function(){const t=this.condition;this._capabilities=t.domain?await(0,c.dA)(this.hass,t):void 0}},{kind:"method",key:"_devicePicked",value:function(t){t.stopPropagation(),this._deviceId=t.target.value,void 0===this._deviceId&&(0,l.B)(this,"value-changed",{value:{...e.defaultConfig,condition:"device"}})}},{kind:"method",key:"_deviceConditionPicked",value:function(t){t.stopPropagation();let i=t.detail.value;this._origCondition&&(0,c.hH)(this._entityReg,this._origCondition,i)&&(i=this._origCondition),(0,l.B)(this,"value-changed",{value:i})}},{kind:"method",key:"_extraFieldsChanged",value:function(t){t.stopPropagation(),(0,l.B)(this,"value-changed",{value:{...this.condition,...t.detail.value}})}},{kind:"field",static:!0,key:"styles",value:()=>a.iv`ha-device-picker{display:block;margin-bottom:24px}ha-form{display:block;margin-top:24px}`}]}}),a.oi)},49214:function(t,i,e){e.a(t,(async function(t,n){try{e.d(i,{w:()=>r});var o=e(44249),a=e(57243),s=e(15093),d=e(36522),l=e(93831),c=t([l]);l=(c.then?(await c)():c)[0];let r=(0,o.Z)([(0,s.Mo)("ha-automation-condition-logical")],(function(t,i){return{F:class extends i{constructor(...i){super(...i),t(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"condition",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"method",key:"render",value:function(){return a.dy` <ha-automation-condition .conditions="${this.condition.conditions||[]}" @value-changed="${this._valueChanged}" .hass="${this.hass}" .disabled="${this.disabled}"></ha-automation-condition> `}},{kind:"method",key:"_valueChanged",value:function(t){t.stopPropagation(),(0,d.B)(this,"value-changed",{value:{...this.condition,conditions:t.detail.value}})}}]}}),a.oi);n()}catch(t){n(t)}}))},23436:function(t,i,e){e.a(t,(async function(t,i){try{var n=e(44249),o=e(15093),a=e(49214),s=t([a]);a=(s.then?(await s)():s)[0];(0,n.Z)([(0,o.Mo)("ha-automation-condition-not")],(function(t,i){return{F:class extends i{constructor(...i){super(...i),t(this)}},d:[{kind:"get",static:!0,key:"defaultConfig",value:function(){return{condition:"not",conditions:[]}}}]}}),a.w);i()}catch(t){i(t)}}))},89962:function(t,i,e){var n=e(44249),o=e(57243),a=e(15093),s=e(62900),d=e(27486),l=e(36522);e(29073);const c=(0,s.Ry)({alias:(0,s.jt)((0,s.Z_)()),condition:(0,s.i0)("numeric_state"),entity_id:(0,s.jt)((0,s.Z_)()),attribute:(0,s.jt)((0,s.Z_)()),above:(0,s.jt)((0,s.G0)([(0,s.Rx)(),(0,s.Z_)()])),below:(0,s.jt)((0,s.G0)([(0,s.Rx)(),(0,s.Z_)()])),value_template:(0,s.jt)((0,s.Z_)()),enabled:(0,s.jt)((0,s.O7)())});(0,n.Z)([(0,a.Mo)("ha-automation-condition-numeric_state")],(function(t,i){return{F:class extends i{constructor(...i){super(...i),t(this)}},d:[{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"condition",value:void 0},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,a.SB)()],key:"_inputAboveIsEntity",value:void 0},{kind:"field",decorators:[(0,a.SB)()],key:"_inputBelowIsEntity",value:void 0},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{condition:"numeric_state",entity_id:""}}},{kind:"method",key:"shouldUpdate",value:function(t){if(t.has("condition"))try{(0,s.hu)(this.condition,c)}catch(t){return(0,l.B)(this,"ui-mode-not-available",t),!1}return!0}},{kind:"field",key:"_data",value:()=>(0,d.Z)(((t,i,e)=>({lower_limit:t?"input":"value",upper_limit:i?"input":"value",...e})))},{kind:"field",key:"_schema",value:()=>(0,d.Z)(((t,i,e)=>[{name:"entity_id",required:!0,selector:{entity:{}}},{name:"attribute",selector:{attribute:{hide_attributes:["access_token","auto_update","available_modes","away_mode","changed_by","code_format","color_modes","current_activity","device_class","editable","effect_list","effect","entity_picture","event_type","event_types","fan_mode","fan_modes","fan_speed_list","forecast","friendly_name","frontend_stream_type","has_date","has_time","hs_color","hvac_mode","hvac_modes","icon","media_album_name","media_artist","media_content_type","media_position_updated_at","media_title","next_dawn","next_dusk","next_midnight","next_noon","next_rising","next_setting","operation_list","operation_mode","options","preset_mode","preset_modes","release_notes","release_summary","release_url","restored","rgb_color","rgbw_color","shuffle","sound_mode_list","sound_mode","source_list","source_type","source","state_class","supported_features","swing_mode","swing_mode","swing_modes","title","token","unit_of_measurement","xy_color"]}},context:{filter_entity:"entity_id"}},{name:"lower_limit",type:"select",required:!0,options:[["value",t("ui.panel.config.automation.editor.conditions.type.numeric_state.type_value")],["input",t("ui.panel.config.automation.editor.conditions.type.numeric_state.type_input")]]},...i?[{name:"above",selector:{entity:{domain:["input_number","number","sensor"]}}}]:[{name:"above",selector:{number:{mode:"box",min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,step:.1}}}],{name:"upper_limit",type:"select",required:!0,options:[["value",t("ui.panel.config.automation.editor.conditions.type.numeric_state.type_value")],["input",t("ui.panel.config.automation.editor.conditions.type.numeric_state.type_input")]]},...e?[{name:"below",selector:{entity:{domain:["input_number","number","sensor"]}}}]:[{name:"below",selector:{number:{mode:"box",min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,step:.1}}}],{name:"value_template",selector:{template:{}}}]))},{kind:"method",key:"willUpdate",value:function(){this._inputAboveIsEntity=this._inputAboveIsEntity??("string"==typeof this.condition.above&&(this.condition.above.startsWith("input_number.")||this.condition.above.startsWith("number.")||this.condition.above.startsWith("sensor."))),this._inputBelowIsEntity=this._inputBelowIsEntity??("string"==typeof this.condition.below&&(this.condition.below.startsWith("input_number.")||this.condition.below.startsWith("number.")||this.condition.below.startsWith("sensor.")))}},{kind:"method",key:"render",value:function(){const t=this._schema(this.hass.localize,this._inputAboveIsEntity,this._inputBelowIsEntity),i=this._data(this._inputAboveIsEntity,this._inputBelowIsEntity,this.condition);return o.dy` <ha-form .hass="${this.hass}" .data="${i}" .schema="${t}" .disabled="${this.disabled}" @value-changed="${this._valueChanged}" .computeLabel="${this._computeLabelCallback}"></ha-form> `}},{kind:"method",key:"_valueChanged",value:function(t){t.stopPropagation();const i={...t.detail.value};this._inputAboveIsEntity="input"===i.lower_limit,this._inputBelowIsEntity="input"===i.upper_limit,delete i.lower_limit,delete i.upper_limit,""===i.value_template&&delete i.value_template,(0,l.B)(this,"value-changed",{value:i})}},{kind:"field",key:"_computeLabelCallback",value(){return t=>{switch(t.name){case"entity_id":return this.hass.localize("ui.components.entity.entity-picker.entity");case"attribute":return this.hass.localize("ui.components.entity.entity-attribute-picker.attribute");default:return this.hass.localize(`ui.panel.config.automation.editor.triggers.type.numeric_state.${t.name}`)}}}}]}}),o.oi)},60750:function(t,i,e){e.a(t,(async function(t,i){try{var n=e(44249),o=e(15093),a=e(49214),s=t([a]);a=(s.then?(await s)():s)[0];(0,n.Z)([(0,o.Mo)("ha-automation-condition-or")],(function(t,i){return{F:class extends i{constructor(...i){super(...i),t(this)}},d:[{kind:"get",static:!0,key:"defaultConfig",value:function(){return{condition:"or",conditions:[]}}}]}}),a.w);i()}catch(t){i(t)}}))},65169:function(t,i,e){var n=e(44249),o=(e(9359),e(31526),e(57243)),a=e(15093),s=e(62900),d=e(35392),l=e(36522),c=(e(29073),e(34007));const r=(0,s.Ry)({alias:(0,s.jt)((0,s.Z_)()),condition:(0,s.i0)("state"),entity_id:(0,s.jt)((0,s.Z_)()),attribute:(0,s.jt)((0,s.Z_)()),state:(0,s.jt)((0,s.Z_)()),for:(0,s.jt)((0,s.G0)([(0,s.Rx)(),(0,s.Z_)(),c.H])),enabled:(0,s.jt)((0,s.O7)())}),u=[{name:"entity_id",required:!0,selector:{entity:{}}},{name:"attribute",selector:{attribute:{hide_attributes:["access_token","available_modes","color_modes","editable","effect_list","entity_picture","event_types","fan_modes","fan_speed_list","forecast","friendly_name","hvac_modes","icon","operation_list","options","preset_modes","sound_mode_list","source_list","state_class","swing_modes","token"]}},context:{filter_entity:"entity_id"}},{name:"state",required:!0,selector:{state:{}},context:{filter_entity:"entity_id",filter_attribute:"attribute"}},{name:"for",selector:{duration:{}}}];(0,n.Z)([(0,a.Mo)("ha-automation-condition-state")],(function(t,i){return{F:class extends i{constructor(...i){super(...i),t(this)}},d:[{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"condition",value:void 0},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{condition:"state",entity_id:"",state:""}}},{kind:"method",key:"shouldUpdate",value:function(t){if(t.has("condition"))try{(0,s.hu)(this.condition,r)}catch(t){return(0,l.B)(this,"ui-mode-not-available",t),!1}return!0}},{kind:"method",key:"render",value:function(){const t=(0,d.c)(this.condition.for),i={...this.condition,for:t};return o.dy` <ha-form .hass="${this.hass}" .data="${i}" .schema="${u}" .disabled="${this.disabled}" @value-changed="${this._valueChanged}" .computeLabel="${this._computeLabelCallback}"></ha-form> `}},{kind:"method",key:"_valueChanged",value:function(t){t.stopPropagation();const i=t.detail.value;Object.keys(i).forEach((t=>void 0===i[t]||""===i[t]?delete i[t]:{})),i.state||(i.state=""),(0,l.B)(this,"value-changed",{value:i})}},{kind:"field",key:"_computeLabelCallback",value(){return t=>{switch(t.name){case"entity_id":return this.hass.localize("ui.components.entity.entity-picker.entity");case"attribute":return this.hass.localize("ui.components.entity.entity-attribute-picker.attribute");case"for":return this.hass.localize("ui.panel.config.automation.editor.triggers.type.state.for");default:return this.hass.localize(`ui.panel.config.automation.editor.conditions.type.state.${t.name}`)}}}}]}}),o.oi)},87371:function(t,i,e){var n=e(44249),o=e(57243),a=e(15093),s=e(27486),d=e(36522);e(29073);(0,n.Z)([(0,a.Mo)("ha-automation-condition-sun")],(function(t,i){return{F:class extends i{constructor(...i){super(...i),t(this)}},d:[{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"condition",value:void 0},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{condition:"sun"}}},{kind:"field",key:"_schema",value:()=>(0,s.Z)((t=>[{name:"before",type:"select",required:!0,options:[["sunrise",t("ui.panel.config.automation.editor.conditions.type.sun.sunrise")],["sunset",t("ui.panel.config.automation.editor.conditions.type.sun.sunset")]]},{name:"before_offset",selector:{text:{}}},{name:"after",type:"select",required:!0,options:[["sunrise",t("ui.panel.config.automation.editor.conditions.type.sun.sunrise")],["sunset",t("ui.panel.config.automation.editor.conditions.type.sun.sunset")]]},{name:"after_offset",selector:{text:{}}}]))},{kind:"method",key:"render",value:function(){const t=this._schema(this.hass.localize);return o.dy` <ha-form .schema="${t}" .data="${this.condition}" .hass="${this.hass}" .disabled="${this.disabled}" .computeLabel="${this._computeLabelCallback}" @value-changed="${this._valueChanged}"></ha-form> `}},{kind:"method",key:"_valueChanged",value:function(t){t.stopPropagation();const i=t.detail.value;(0,d.B)(this,"value-changed",{value:i})}},{kind:"field",key:"_computeLabelCallback",value(){return t=>this.hass.localize(`ui.panel.config.automation.editor.conditions.type.sun.${t.name}`)}}]}}),o.oi)},37860:function(t,i,e){e.a(t,(async function(t,i){try{var n=e(44249),o=e(57243),a=e(15093),s=(e(40917),e(71081)),d=t([s]);s=(d.then?(await d)():d)[0];(0,n.Z)([(0,a.Mo)("ha-automation-condition-template")],(function(t,i){return{F:class extends i{constructor(...i){super(...i),t(this)}},d:[{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"condition",value:void 0},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{condition:"template",value_template:""}}},{kind:"method",key:"render",value:function(){const{value_template:t}=this.condition;return o.dy` <p> ${this.hass.localize("ui.panel.config.automation.editor.conditions.type.template.value_template")} * </p> <ha-code-editor .name="${"value_template"}" mode="jinja2" .hass="${this.hass}" .value="${t}" .readOnly="${this.disabled}" autocomplete-entities @value-changed="${this._valueChanged}" dir="ltr"></ha-code-editor> `}},{kind:"method",key:"_valueChanged",value:function(t){(0,s.a)(this,t)}},{kind:"field",static:!0,key:"styles",value:()=>o.iv`p{margin-top:0}`}]}}),o.oi);i()}catch(t){i(t)}}))},76535:function(t,i,e){var n=e(44249),o=(e(9359),e(31526),e(70104),e(57243)),a=e(15093),s=e(27486),d=e(19631),l=e(36522);e(29073);const c=["sun","mon","tue","wed","thu","fri","sat"];(0,n.Z)([(0,a.Mo)("ha-automation-condition-time")],(function(t,i){return{F:class extends i{constructor(...i){super(...i),t(this)}},d:[{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"condition",value:void 0},{kind:"field",decorators:[(0,a.SB)()],key:"_inputModeBefore",value:void 0},{kind:"field",decorators:[(0,a.SB)()],key:"_inputModeAfter",value:void 0},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{condition:"time"}}},{kind:"field",key:"_schema",value:()=>(0,s.Z)(((t,i,e,n)=>{const o=(0,d.Bt)(i),a=c.slice(o,c.length).concat(c.slice(0,o));return[{name:"mode_after",type:"select",required:!0,options:[["value",t("ui.panel.config.automation.editor.conditions.type.time.type_value")],["input",t("ui.panel.config.automation.editor.conditions.type.time.type_input")]]},{name:"after",selector:e?{entity:{filter:[{domain:"input_datetime"},{domain:"time"},{domain:"sensor",device_class:"timestamp"}]}}:{time:{}}},{name:"mode_before",type:"select",required:!0,options:[["value",t("ui.panel.config.automation.editor.conditions.type.time.type_value")],["input",t("ui.panel.config.automation.editor.conditions.type.time.type_input")]]},{name:"before",selector:n?{entity:{filter:[{domain:"input_datetime"},{domain:"time"},{domain:"sensor",device_class:"timestamp"}]}}:{time:{}}},{type:"multi_select",name:"weekday",options:a.map((i=>[i,t(`ui.panel.config.automation.editor.conditions.type.time.weekdays.${i}`)]))}]}))},{kind:"method",key:"render",value:function(){const t=this._inputModeBefore??(this.condition.before?.startsWith("input_datetime.")||this.condition.before?.startsWith("time.")||this.condition.before?.startsWith("sensor.")),i=this._inputModeAfter??(this.condition.after?.startsWith("input_datetime.")||this.condition.after?.startsWith("time.")||this.condition.after?.startsWith("sensor.")),e=this._schema(this.hass.localize,this.hass.locale,i,t),n={mode_before:t?"input":"value",mode_after:i?"input":"value",...this.condition};return o.dy` <ha-form .hass="${this.hass}" .data="${n}" .schema="${e}" .disabled="${this.disabled}" @value-changed="${this._valueChanged}" .computeLabel="${this._computeLabelCallback}"></ha-form> `}},{kind:"method",key:"_valueChanged",value:function(t){t.stopPropagation();const i=t.detail.value;this._inputModeAfter="input"===i.mode_after,this._inputModeBefore="input"===i.mode_before,delete i.mode_after,delete i.mode_before,Object.keys(i).forEach((t=>void 0===i[t]||""===i[t]||Array.isArray(i[t])&&0===i[t].length?delete i[t]:{})),(0,l.B)(this,"value-changed",{value:i})}},{kind:"field",key:"_computeLabelCallback",value(){return t=>this.hass.localize(`ui.panel.config.automation.editor.conditions.type.time.${t.name}`)}}]}}),o.oi)},31563:function(t,i,e){var n=e(44249),o=e(72621),a=(e(9359),e(56475),e(70104),e(52924),e(92519),e(42179),e(89256),e(24931),e(88463),e(57449),e(19814),e(87319),e(57243)),s=e(15093),d=e(27486),l=e(95262),c=e(36522),r=(e(29073),e(92824),e(14473));(0,n.Z)([(0,s.Mo)("ha-automation-condition-trigger")],(function(t,i){class e extends i{constructor(...i){super(...i),t(this)}}return{F:e,d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"condition",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,s.SB)()],key:"_triggerIds",value:()=>[]},{kind:"field",key:"_unsub",value:void 0},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{condition:"trigger",id:""}}},{kind:"field",key:"_schema",value:()=>(0,d.Z)((t=>[{name:"id",selector:{select:{multiple:!0,options:t}},required:!0}]))},{kind:"method",key:"connectedCallback",value:function(){(0,o.Z)(e,"connectedCallback",this,3)([]);const t={callback:t=>this._automationUpdated(t)};(0,c.B)(this,"subscribe-automation-config",t),this._unsub=t.unsub}},{kind:"method",key:"disconnectedCallback",value:function(){(0,o.Z)(e,"disconnectedCallback",this,3)([]),this._unsub&&this._unsub()}},{kind:"method",key:"render",value:function(){if(!this._triggerIds.length)return this.hass.localize("ui.panel.config.automation.editor.conditions.type.trigger.no_triggers");const t=this._schema(this._triggerIds);return a.dy` <ha-form .schema="${t}" .data="${this.condition}" .hass="${this.hass}" .disabled="${this.disabled}" .computeLabel="${this._computeLabelCallback}" @value-changed="${this._valueChanged}"></ha-form> `}},{kind:"field",key:"_computeLabelCallback",value(){return t=>this.hass.localize(`ui.panel.config.automation.editor.conditions.type.trigger.${t.name}`)}},{kind:"method",key:"_automationUpdated",value:function(t){this._triggerIds=t?.triggers?(t=>{const i=(0,r.Kc)(t).map((t=>"id"in t?t.id:void 0)).filter(Boolean);return Array.from(new Set(i))})((0,l.r)(t.triggers)):[]}},{kind:"method",key:"_valueChanged",value:function(t){t.stopPropagation();const i=t.detail.value;"string"==typeof i.id?this._triggerIds.some((t=>t===i.id))||(i.id=""):Array.isArray(i.id)&&(i.id=i.id.filter((t=>this._triggerIds.some((i=>i===t)))),i.id