iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 75.7 kB
JavaScript
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[283],{20543:function(t,i,e){e.a(t,async function(t,i){try{e(3362),e(62953);var o=e(40445),n=e(5124),s=e(67576),a=e(9899),d=e(88249),l=e(34127),c=(e(78486),t([l]));l=(c.then?(await c)():c)[0];let r,h,u,p=t=>t;class g extends n.WF{connectedCallback(){super.connectedCallback(),this._subscribeCondition()}updated(t){super.updated(t),t.has("condition")&&void 0!==t.get("condition")&&(this._resetSubscription(),this._debounceSubscribeCondition())}disconnectedCallback(){super.disconnectedCallback(),this._debounceSubscribeCondition.cancel(),this._resetSubscription()}render(){return(0,n.qy)(r||(r=p` <div id="indicator"> <slot></slot> <ha-automation-row-live-test .state="${0}" .label="${0}"></ha-automation-row-live-test> </div> ${0} `),this._liveTestResult.state,this.hass.localize(`ui.panel.config.automation.editor.conditions.live_test_state.${this._liveTestResult.state}`),this._liveTestResult.message?(0,n.qy)(h||(h=p`<ha-tooltip for="indicator">${0}</ha-tooltip>`),this._liveTestResult.message):n.s6)}_resetSubscription(){this._liveTestResult={state:"unknown",message:this.hass.localize("ui.panel.config.automation.editor.conditions.live_test_state.unknown")},this._conditionUnsub&&(this._conditionUnsub.then(t=>t()),this._conditionUnsub=void 0)}async _subscribeCondition(){if(this._resetSubscription(),!this.condition)return;const t=(0,d.sF)(this.hass.connection,t=>{t.error?this._handleLiveTestError(t.error):this._liveTestResult={state:t.result?"pass":"fail",message:this.hass.localize("ui.panel.config.automation.editor.conditions.testing_"+(t.result?"pass":"error"))}},this.condition);t.catch(i=>{this._handleLiveTestError(i),this._conditionUnsub===t&&(this._conditionUnsub=void 0)}),this._conditionUnsub=t}_handleLiveTestError(t){const i="string"!=typeof t&&"invalid_format"===t.code;this._liveTestResult={state:i?"invalid":"unknown",message:this.hass.localize("ui.panel.config.automation.editor.conditions."+(i?"invalid_condition":"live_test_state.unknown"))}}constructor(...t){super(...t),this._liveTestResult={state:"unknown"},this._debounceSubscribeCondition=(0,a.s)(()=>this._subscribeCondition(),500)}}g.styles=(0,n.AH)(u||(u=p`:host{display:inline-flex;position:relative}#indicator{display:inline-flex;position:relative}`)),(0,o.Cg)([(0,s.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],g.prototype,"condition",void 0),(0,o.Cg)([(0,s.wk)()],g.prototype,"_liveTestResult",void 0),g=(0,o.Cg)([(0,s.EM)("ha-automation-condition-live-test")],g),i()}catch(r){i(r)}})},78486:function(t,i,e){e(62953);var o=e(40445),n=e(5124),s=e(67576);let a,d,l=t=>t;class c extends n.WF{render(){return(0,n.qy)(a||(a=l` <div id="indicator" role="status" tabindex="0" aria-label="${0}"></div> `),this.label)}constructor(...t){super(...t),this.state="unknown",this.label=""}}c.styles=(0,n.AH)(d||(d=l`:host{position:absolute;top:-5px;inset-inline-end:-6px;display:inline-block}#indicator{width:10px;height:10px;border-radius:var(--ha-border-radius-circle);border:var(--ha-border-width-md) solid;box-sizing:border-box;background-color:var(--card-background-color);box-shadow:0 0 0 2px var(--card-background-color);transition:all var(--ha-animation-duration-normal) ease-in-out}:host([state=pass]) #indicator{background-color:var(--ha-color-green-60);border-color:var(--ha-color-green-60)}:host([state=fail]) #indicator{border-color:var(--ha-color-orange-60)}:host([state=invalid]) #indicator{border-color:var(--ha-color-red-60)}:host([state=unknown]) #indicator{border-color:var(--ha-color-neutral-60)}`)),(0,o.Cg)([(0,s.MZ)({reflect:!0})],c.prototype,"state",void 0),(0,o.Cg)([(0,s.MZ)()],c.prototype,"label",void 0),c=(0,o.Cg)([(0,s.EM)("ha-automation-row-live-test")],c)},87682:function(t,i,e){e.a(t,async function(t,i){try{var o=e(40445),n=e(67576),s=e(10139),a=e(17062),d=t([a]);a=(d.then?(await d)():d)[0];class l extends a.V{get NO_AUTOMATION_TEXT(){return this.hass.localize("ui.panel.config.devices.automation.conditions.no_conditions")}get UNKNOWN_AUTOMATION_TEXT(){return this.hass.localize("ui.panel.config.devices.automation.conditions.unknown_condition")}constructor(){super(s.I3,s.ng,t=>({device_id:t||"",condition:"device",domain:"",entity_id:""}))}}l=(0,o.Cg)([(0,n.EM)("ha-device-condition-picker")],l),i()}catch(l){i(l)}})},76623:function(t,i,e){e.a(t,async function(t,o){try{e.d(i,{D:function(){return b}});var n=e(40445),s=e(5124),a=e(67576),d=e(91450),l=e(71727),c=e(85694),r=(e(47680),e(67094),t([c]));c=(r.then?(await r)():r)[0];let h,u,p,g,v=t=>t;const b={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"};class m extends s.WF{render(){if(this.icon)return(0,s.qy)(h||(h=v`<ha-icon .icon="${0}"></ha-icon>`),this.icon);if(!this.condition)return s.s6;if(!this.hass)return this._renderFallback();const t=(0,c.r)(this.hass.connection,this.hass.config,this.condition).then(t=>t?(0,s.qy)(u||(u=v`<ha-icon .icon="${0}"></ha-icon>`),t):this._renderFallback());return(0,s.qy)(p||(p=v`${0}`),(0,d.T)(t))}_renderFallback(){const t=(0,l.m)(this.condition);return(0,s.qy)(g||(g=v` <ha-svg-icon .path="${0}"></ha-svg-icon> `),b[this.condition]||c.l[t])}}(0,n.Cg)([(0,a.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,n.Cg)([(0,a.MZ)()],m.prototype,"condition",void 0),(0,n.Cg)([(0,a.MZ)()],m.prototype,"icon",void 0),m=(0,n.Cg)([(0,a.EM)("ha-condition-icon")],m),o()}catch(h){o(h)}})},49313:function(t,i,e){e.a(t,async function(t,i){try{e(89463),e(62953);var o=e(40445),n=e(5124),s=e(67576),a=e(6412),d=e(22786),l=e(69558),c=e(1087),r=e(10763),h=e(88249),u=e(87225),p=e(15702),g=e(57116),v=(e(35913),t([r,p]));[r,p]=v.then?(await v)():v;let b,m,_,y,C,f,$=t=>t;class w extends n.WF{render(){const t=this._processedCondition(this.condition),i=this.yamlMode||!this.uiSupported;return(0,n.qy)(b||(b=$` <div class="${0}"> ${0} </div> `),(0,a.H)({"card-content":!0,disabled:!this.indent&&(this.disabled||!1===this.condition.enabled&&!this.yamlMode),yaml:i,indent:this.indent,card:!this.inSidebar}),i?(0,n.qy)(m||(m=$` ${0} <ha-yaml-editor .defaultValue="${0}" @value-changed="${0}" .readOnly="${0}"></ha-yaml-editor> `),this.uiSupported?n.s6:(0,n.qy)(_||(_=$` <ha-automation-editor-warning .alertTitle="${0}" .localize="${0}"></ha-automation-editor-warning> `),this.hass.localize("ui.panel.config.automation.editor.conditions.unsupported_condition",{condition:t.condition}),this.hass.localize),this.condition,this._onYamlChange,this.disabled):(0,n.qy)(y||(y=$` <div @value-changed="${0}"> ${0} </div> `),this._onUiChanged,this.description?(0,n.qy)(C||(C=$`<ha-automation-condition-platform .hass="${0}" .condition="${0}" .description="${0}" .disabled="${0}"></ha-automation-condition-platform>`),this.hass,this.condition,this.description,this.disabled):(0,l._)(`ha-automation-condition-${t.condition}`,{hass:this.hass,condition:t,disabled:this.disabled,optionsInSidebar:this.indent,narrow:this.narrow})))}_onYamlChange(t){t.stopPropagation(),t.detail.isValid&&(0,c.r)(this,this.inSidebar?"yaml-changed":"value-changed",{value:t.detail.value})}_onUiChanged(t){t.stopPropagation();const i=Object.assign(Object.assign(Object.assign({},this.condition.alias?{alias:this.condition.alias}:{}),this.condition.note?{note:this.condition.note}:{}),t.detail.value);(0,c.r)(this,"value-changed",{value:i})}expandAll(){var t,i;null===(t=this._collapsibleElement)||void 0===t||null===(i=t.expandAll)||void 0===i||i.call(t)}collapseAll(){var t,i;null===(t=this._collapsibleElement)||void 0===t||null===(i=t.collapseAll)||void 0===i||i.call(t)}constructor(...t){super(...t),this.disabled=!1,this.yamlMode=!1,this.indent=!1,this.narrow=!1,this.inSidebar=!1,this.selected=!1,this.uiSupported=!1,this._processedCondition=(0,d.A)(t=>(0,h.XF)(t))}}w.styles=[g.yj,g.aM,(0,n.AH)(f||(f=$`:host([action]) .card-content{padding:0}:host([action]) .card-content.indent{margin-left:0;margin-right:0;padding:0;border-left:none;border-bottom:none}`))],(0,o.Cg)([(0,s.MZ)({attribute:!1})],w.prototype,"hass",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],w.prototype,"condition",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],w.prototype,"disabled",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],w.prototype,"yamlMode",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],w.prototype,"indent",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],w.prototype,"narrow",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,attribute:"sidebar"})],w.prototype,"inSidebar",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],w.prototype,"selected",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,attribute:"supported"})],w.prototype,"uiSupported",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],w.prototype,"description",void 0),(0,o.Cg)([(0,s.P)("ha-yaml-editor")],w.prototype,"yamlEditor",void 0),(0,o.Cg)([(0,s.P)(u.fg.join(", "))],w.prototype,"_collapsibleElement",void 0),w=(0,o.Cg)([(0,s.EM)("ha-automation-condition-editor")],w),i()}catch(b){i(b)}})},53354:function(t,i,e){e.a(t,async function(t,i){try{e(74423),e(18111),e(13579),e(3362),e(42762),e(62953);var o=e(40445),n=(e(68825),e(35211)),s=e(34271),a=e(53289),d=e(5124),l=e(67576),c=e(6412),r=e(22786),h=e(44537),u=e(93905),p=e(1087),g=e(99124),v=e(57237),b=e(52943),m=e(53516),_=e(78978),y=e(63130),C=e(56214),f=e(20543),$=e(7822),w=e(38962),M=(e(76776),e(76623)),A=e(29823),k=(e(70947),e(11382),e(26300)),V=e(34127),H=e(88249),L=e(79800),x=e(87225),z=e(12596),S=e(22792),Z=e(65063),q=e(41570),I=e(49053),E=e(15702),O=e(57116),j=e(62711),T=e(49313),D=e(80081),B=e(30356),F=e(4601),R=e(97681),P=e(4519),U=e(93977),N=e(40998),W=e(60092),Y=e(23484),K=e(52128),Q=e(56860),G=t([C,f,$,w,M,A,k,V,E,j,T,D,B,F,R,P,U,N,W,Y,K,Q,L]);[C,f,$,w,M,A,k,V,E,j,T,D,B,F,R,P,U,N,W,Y,K,Q,L]=G.then?(await G)():G;let X,J,tt,it,et,ot,nt,st,at,dt,lt,ct,rt,ht,ut,pt,gt,vt,bt,mt,_t,yt,Ct,ft,$t=t=>t;const wt="M6,2A4,4 0 0,1 10,6V8H14V6A4,4 0 0,1 18,2A4,4 0 0,1 22,6A4,4 0 0,1 18,10H16V14H18A4,4 0 0,1 22,18A4,4 0 0,1 18,22A4,4 0 0,1 14,18V16H10V18A4,4 0 0,1 6,22A4,4 0 0,1 2,18A4,4 0 0,1 6,14H8V10H6A4,4 0 0,1 2,6A4,4 0 0,1 6,2M16,18A2,2 0 0,0 18,20A2,2 0 0,0 20,18A2,2 0 0,0 18,16H16V18M14,10H10V14H14V10M6,16A2,2 0 0,0 4,18A2,2 0 0,0 6,20A2,2 0 0,0 8,18V16H6M8,6A2,2 0 0,0 6,4A2,2 0 0,0 4,6A2,2 0 0,0 6,8H8V6M18,8A2,2 0 0,0 20,6A2,2 0 0,0 18,4A2,2 0 0,0 16,6V8H18Z",Mt="M11,4H13V16L18.5,10.5L19.92,11.92L12,19.84L4.08,11.92L5.5,10.5L11,16V4Z",At="M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z",kt="M9 22C8.45 22 8 21.55 8 21V18H4C2.9 18 2 17.11 2 16V4C2 2.89 2.9 2 4 2H20C21.11 2 22 2.9 22 4V16C22 17.11 21.11 18 20 18H13.9L10.2 21.71C10 21.9 9.75 22 9.5 22H9M10 16V19.08L13.08 16H20V4H4V16H10M15.84 8.2L14.83 9.21L12.76 7.18L13.77 6.16C13.97 5.95 14.31 5.94 14.55 6.16L15.84 7.41C16.05 7.62 16.06 7.96 15.84 8.2M8 11.91L12.17 7.72L14.24 9.8L10.08 14H8V11.91Z",Vt="M9,22A1,1 0 0,1 8,21V18H4A2,2 0 0,1 2,16V4C2,2.89 2.9,2 4,2H20A2,2 0 0,1 22,4V16A2,2 0 0,1 20,18H13.9L10.2,21.71C10,21.9 9.75,22 9.5,22V22H9M10,16V19.08L13.08,16H20V4H4V16H10M6,7H18V9H6V7M6,11H15V13H6V11Z",Ht="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",Lt="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",xt="M19,20H5V4H7V7H17V4H19M12,2A1,1 0 0,1 13,3A1,1 0 0,1 12,4A1,1 0 0,1 11,3A1,1 0 0,1 12,2M19,2H14.82C14.4,0.84 13.3,0 12,0C10.7,0 9.6,0.84 9.18,2H5A2,2 0 0,0 3,4V20A2,2 0 0,0 5,22H19A2,2 0 0,0 21,20V4A2,2 0 0,0 19,2Z",zt="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",St="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",Zt="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",qt="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",It="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",Et="M16,8H14V11H11V13H14V16H16V13H19V11H16M2,12C2,9.21 3.64,6.8 6,5.68V3.5C2.5,4.76 0,8.09 0,12C0,15.91 2.5,19.24 6,20.5V18.32C3.64,17.2 2,14.79 2,12M15,3C10.04,3 6,7.04 6,12C6,16.96 10.04,21 15,21C19.96,21 24,16.96 24,12C24,7.04 19.96,3 15,3M15,19C11.14,19 8,15.86 8,12C8,8.14 11.14,5 15,5C18.86,5 22,8.14 22,12C22,15.86 18.86,19 15,19Z",Ot="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",jt="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";class Tt extends d.WF{get selected(){return this._selected}_renderOverflowLabel(t,i){return(0,d.qy)(X||(X=$t` <div class="overflow-label"> ${0} ${0} </div> `),t,this.optionsInSidebar&&!this.narrow?i||(0,d.qy)(J||(J=$t`<span class="shortcut-placeholder ${0}"></span>`),q.c?"mac":""):d.s6)}_renderRow(){var t,i,e;const o="target"in(this.conditionDescriptions[this.condition.condition]||{}),n=o?this.condition.target:"device_id"in this.condition&&this.condition.device_id?{device_id:[this.condition.device_id]}:void 0,s=null===(t=this.conditionDescriptions[this.condition.condition])||void 0===t?void 0:t.target,a=(0,m.C)((null===(i=this.condition.note)||void 0===i?void 0:i.trim())||"",250);return(0,d.qy)(tt||(tt=$t` ${0} <h3 slot="header"> ${0} ${0} ${0} </h3> <ha-automation-row-event-chip .show="${0}" .variant="${0}" slot="event" class="event-chip" aria-live="polite"> ${0} </ha-automation-row-event-chip> <slot name="icons" slot="icons"></slot> <ha-dropdown slot="icons" @click="${0}" @keydown="${0}" @wa-select="${0}" placement="bottom-end"> <ha-icon-button slot="trigger" .label="${0}" .path="${0}"> </ha-icon-button> <ha-dropdown-item value="test"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> ${0} </ha-dropdown-item> <ha-dropdown-item value="rename" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> ${0} </ha-dropdown-item> <ha-dropdown-item value="edit_note"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> ${0} </ha-dropdown-item> <wa-divider></wa-divider> <ha-dropdown-item value="duplicate" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> ${0} </ha-dropdown-item> <ha-dropdown-item value="copy" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon>${0} </ha-dropdown-item> <ha-dropdown-item value="cut" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon>${0} </ha-dropdown-item> ${0} ${0} <ha-dropdown-item value="toggle_yaml_mode"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> ${0} </ha-dropdown-item> <wa-divider></wa-divider> <ha-dropdown-item value="disable" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> ${0} </ha-dropdown-item> <ha-dropdown-item variant="danger" value="delete" .disabled="${0}"> <ha-svg-icon class="warning" slot="icon" .path="${0}"></ha-svg-icon> ${0} </ha-dropdown-item> </ha-dropdown> ${0} `),this.optionsInSidebar&&"trigger"!==this.condition.condition?(0,d.qy)(it||(it=$t`<ha-automation-condition-live-test id="condition-icon" slot="leading-icon" .hass="${0}" .condition="${0}"> <ha-condition-icon .hass="${0}" .condition="${0}"></ha-condition-icon> </ha-automation-condition-live-test>`),this.hass,this.condition,this.hass,this.condition.condition):(0,d.qy)(et||(et=$t`<div id="condition-icon" class="icon-badge-wrapper" slot="leading-icon"> <ha-condition-icon .hass="${0}" .condition="${0}"></ha-condition-icon> </div>`),this.hass,this.condition.condition),(0,b.Z)((0,L.p)(this.condition,this.hass,this._entityReg)),void 0!==n||o&&!this._isNew?this._renderTargets(n,o&&!this._isNew,s,"device"!==this.condition.condition):d.s6,null!==(e=this.condition.note)&&void 0!==e&&e.trim()?(0,d.qy)(ot||(ot=$t` <ha-svg-icon id="note-icon" tabindex="0" .path="${0}" .label="${0}" class="note-indicator"></ha-svg-icon> <ha-tooltip for="note-icon"><p>${0}</p></ha-tooltip> `),Vt,this.hass.localize("ui.panel.config.automation.editor.note.label"),a):d.s6,this._testing,this._testingResult?"success":"warning",this.hass.localize("ui.panel.config.automation.editor.conditions.testing_"+(this._testingResult?"pass":"error")),g.C,v.d,this._handleDropdownSelect,this.hass.localize("ui.common.menu"),St,Zt,this._renderOverflowLabel(this.hass.localize("ui.panel.config.automation.editor.conditions.test")),this.disabled,Ot,this._renderOverflowLabel(this.hass.localize("ui.panel.config.automation.editor.conditions.rename")),kt,this._renderOverflowLabel(this.hass.localize("ui.panel.config.automation.editor.note."+(this.condition.note?"edit":"add"))),this.disabled,Et,this._renderOverflowLabel(this.hass.localize("ui.panel.config.automation.editor.actions.duplicate")),this.disabled,Ht,this._renderOverflowLabel(this.hass.localize("ui.panel.config.automation.editor.triggers.copy"),(0,d.qy)(nt||(nt=$t`<span class="shortcut"> <span>${0}</span> <span>+</span> <span>C</span> </span>`),q.c?(0,d.qy)(st||(st=$t`<ha-svg-icon .path="${0}"></ha-svg-icon>`),wt):this.hass.localize("ui.panel.config.automation.editor.ctrl"))),this.disabled,Lt,this._renderOverflowLabel(this.hass.localize("ui.panel.config.automation.editor.triggers.cut"),(0,d.qy)(at||(at=$t`<span class="shortcut"> <span>${0}</span> <span>+</span> <span>X</span> </span>`),q.c?(0,d.qy)(dt||(dt=$t`<ha-svg-icon .path="${0}"></ha-svg-icon>`),wt):this.hass.localize("ui.panel.config.automation.editor.ctrl"))),this._pasteAvailable()?(0,d.qy)(lt||(lt=$t` <ha-dropdown-item value="paste"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> ${0} </ha-dropdown-item> `),xt,this._renderOverflowLabel(this.hass.localize("ui.panel.config.automation.editor.actions.paste"),(0,d.qy)(ct||(ct=$t`<span class="shortcut"> <span>${0}</span> <span>+</span> <span>V</span> </span>`),q.c?(0,d.qy)(rt||(rt=$t`<ha-svg-icon .path="${0}"></ha-svg-icon>`),wt):this.hass.localize("ui.panel.config.automation.editor.ctrl")))):d.s6,this.optionsInSidebar?d.s6:(0,d.qy)(ht||(ht=$t` <ha-dropdown-item value="move_up" .disabled="${0}"> ${0} <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon></ha-dropdown-item> <ha-dropdown-item value="move_down" .disabled="${0}"> ${0} <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon></ha-dropdown-item> `),this.disabled||!!this.first,this.hass.localize("ui.panel.config.automation.editor.move_up"),At,this.disabled||!!this.last,this.hass.localize("ui.panel.config.automation.editor.move_down"),Mt),It,this._renderOverflowLabel(this.hass.localize("ui.panel.config.automation.editor.edit_"+(this._yamlMode?"ui":"yaml"))),this.disabled,!1===this.condition.enabled?qt:jt,this._renderOverflowLabel(this.hass.localize("ui.panel.config.automation.editor.actions."+(!1===this.condition.enabled?"enable":"disable"))),this.disabled,zt,this._renderOverflowLabel(this.hass.localize("ui.panel.config.automation.editor.actions.delete"),(0,d.qy)(ut||(ut=$t`<span class="shortcut"> <span>${0}</span> <span>+</span> <span>${0}</span> </span>`),q.c?(0,d.qy)(pt||(pt=$t`<ha-svg-icon .path="${0}"></ha-svg-icon>`),wt):this.hass.localize("ui.panel.config.automation.editor.ctrl"),this.hass.localize("ui.panel.config.automation.editor.del"))),this.optionsInSidebar?d.s6:(0,d.qy)(gt||(gt=$t`${0} <ha-automation-condition-editor .hass="${0}" .condition="${0}" .description="${0}" .disabled="${0}" .yamlMode="${0}" .uiSupported="${0}" .narrow="${0}" @ui-mode-not-available="${0}"></ha-automation-condition-editor>`),this._warnings?(0,d.qy)(vt||(vt=$t`<ha-automation-editor-warning .localize="${0}" .warnings="${0}"> </ha-automation-editor-warning>`),this.hass.localize,this._warnings):d.s6,this.hass,this.condition,this.conditionDescriptions[this.condition.condition],this.disabled,this._yamlMode,this._uiSupported(this._getType(this.condition,this.conditionDescriptions)),this.narrow,this._handleUiModeNotAvailable))}render(){return this.condition?(0,d.qy)(bt||(bt=$t` <ha-card outlined class="${0}"> ${0} ${0} </ha-card> ${0} `),(0,c.H)({selected:this._selected,"building-block":this.optionsInSidebar&&x.I8.includes(this.condition.condition)&&!this._collapsed}),!1===this.condition.enabled?(0,d.qy)(mt||(mt=$t` <div class="disabled-bar"> ${0} </div> `),this.hass.localize("ui.panel.config.automation.editor.actions.disabled")):d.s6,this.optionsInSidebar?(0,d.qy)(_t||(_t=$t`<ha-automation-row .disabled="${0}" .leftChevron="${0}" .collapsed="${0}" .selected="${0}" .highlight="${0}" .buildingBlock="${0}" .sortSelected="${0}" .dim="${0}" @click="${0}" @toggle-collapsed="${0}">${0} </ha-automation-row>`),!1===this.condition.enabled,x.I8.includes(this.condition.condition),this._collapsed,this._selected,this.highlight,x.I8.includes(this.condition.condition),this.sortSelected,this._testing,this._toggleSidebar,this._toggleCollapse,this._renderRow()):(0,d.qy)(yt||(yt=$t` <ha-expansion-panel left-chevron @expanded-changed="${0}"> ${0} </ha-expansion-panel> `),this._expansionPanelChanged,this._renderRow()),this.optionsInSidebar&&x.I8.includes(this.condition.condition)?(0,d.qy)(Ct||(Ct=$t`<ha-automation-condition-editor class="${0}" .hass="${0}" .condition="${0}" .disabled="${0}" .uiSupported="${0}" indent .selected="${0}" .narrow="${0}" @value-changed="${0}"></ha-automation-condition-editor>`),this._collapsed?"hidden":"",this.hass,this.condition,this.disabled,this._uiSupported(this._getType(this.condition,this.conditionDescriptions)),this._selected,this.narrow,this._onValueChange):d.s6):d.s6}firstUpdated(t){super.firstUpdated(t),this.root&&(this._collapsed=!1)}willUpdate(t){t.has("yamlMode")&&(this._warnings=void 0)}disconnectedCallback(){super.disconnectedCallback(),void 0!==this._testingTimeout&&clearTimeout(this._testingTimeout)}_onValueChange(t){this._selected&&this.optionsInSidebar&&this.openSidebar(t.detail.value)}_setClipboard(){this._clipboard=Object.assign(Object.assign({},this._clipboard),{},{condition:(0,s.A)(this.condition)}),(0,y.l)((0,a.dump)(this.condition))}_switchUiMode(){this._yamlMode=!1}_switchYamlMode(){this._yamlMode=!0}expand(){this.optionsInSidebar?this._collapsed=!1:this.updateComplete.then(()=>{this.shadowRoot.querySelector("ha-expansion-panel").expanded=!0})}collapse(){this._collapsed=!0}expandAll(){var t;this.expand(),null===(t=this.conditionEditor)||void 0===t||t.expandAll()}collapseAll(){var t;this.collapse(),null===(t=this.conditionEditor)||void 0===t||t.collapseAll()}_handleUiModeNotAvailable(t){this._warnings=(0,_._)(this.hass,t.detail).warnings,this._yamlMode||(this._yamlMode=!0)}_toggleSidebar(t){null==t||t.stopPropagation(),this._selected?(0,p.r)(this,"request-close-sidebar"):this.openSidebar()}markAsNew(){this._isNew=!0}_expansionPanelChanged(t){t.detail.expanded||(this._isNew=!1)}openSidebar(t){const i=t||this.condition;(0,p.r)(this,"open-sidebar",{save:t=>{(0,p.r)(this,"value-changed",{value:t})},close:t=>{this._selected=!1,this._isNew=!1,(0,p.r)(this,"close-sidebar"),t&&this.focus()},rename:()=>{this._renameCondition()},editNote:this._editNoteCondition,toggleYamlMode:()=>{this._toggleYamlMode(),this.openSidebar()},disable:this._onDisable,delete:this._onDelete,duplicate:this._duplicateCondition,insertAfter:this._insertAfter,copy:this._copyCondition,cut:this._cutCondition,paste:this._pasteCondition,pasteAvailable:this._pasteAvailable,test:this._testCondition,config:i,uiSupported:this._uiSupported(this._getType(i,this.conditionDescriptions)),description:this.conditionDescriptions[i.condition],yamlMode:this._yamlMode}),this._selected=!0,this._collapsed=!1,this.narrow&&window.setTimeout(()=>{this.scrollIntoView({block:"start",behavior:"smooth"})},180)}_toggleCollapse(){this._collapsed=!this._collapsed}focus(){var t;null===(t=this._automationRowElement)||void 0===t||t.focus()}_handleDropdownSelect(t){var i;t.stopPropagation();const e=null===(i=t.detail)||void 0===i||null===(i=i.item)||void 0===i?void 0:i.value;if(e)switch(e){case"test":this._testCondition();break;case"rename":this._renameCondition();break;case"edit_note":this._editNoteCondition();break;case"duplicate":this._duplicateCondition();break;case"copy":this._copyCondition();break;case"cut":this._cutCondition();break;case"paste":this._pasteCondition();break;case"move_up":this._moveUp();break;case"move_down":this._moveDown();break;case"toggle_yaml_mode":this._toggleYamlMode(t.target);break;case"disable":this._onDisable();break;case"delete":this._onDelete()}}static get styles(){return[O.bH,O.Lt]}constructor(...t){super(...t),this.disabled=!1,this.root=!1,this.narrow=!1,this.sortSelected=!1,this._collapsed=!0,this._isNew=!1,this.conditionDescriptions={},this.optionsInSidebar=!1,this._yamlMode=!1,this._testing=!1,this._selected=!1,this._entityReg=[],this._renderTargets=(0,r.A)((t,i=!1,e,o=!1)=>(0,d.qy)(ft||(ft=$t`<ha-automation-row-targets .target="${0}" .targetRequired="${0}" .selector="${0}" .interactive="${0}"></ha-automation-row-targets>`),t,i,e?{target:e}:void 0,o)),this._onDisable=()=>{var t;const i=!(null===(t=this.condition.enabled)||void 0===t||t),e=Object.assign(Object.assign({},this.condition),{},{enabled:i});var o;((0,p.r)(this,"value-changed",{value:e}),this._selected&&this.optionsInSidebar&&this.openSidebar(e),this._yamlMode&&!this.optionsInSidebar)&&(null===(o=this.conditionEditor)||void 0===o||null===(o=o.yamlEditor)||void 0===o||o.setValue(e))},this._onDelete=()=>{(0,p.r)(this,"value-changed",{value:null}),this._selected&&(0,p.r)(this,"close-sidebar"),(0,I.c)(this,{message:this.hass.localize("ui.common.successfully_deleted"),duration:4e3,action:{text:this.hass.localize("ui.common.undo"),action:()=>{(0,p.r)(window,"undo-change")}}})},this._testCondition=async()=>{if(this._testing&&void 0===this._testingTimeout)return;void 0!==this._testingTimeout&&clearTimeout(this._testingTimeout);const t=this.condition;let i,e;requestAnimationFrame(()=>{this.scrollIntoViewIfNeeded?this.scrollIntoViewIfNeeded():this.scrollIntoView()});try{i=await(0,z.$)(this.hass,{conditions:t})}catch(o){return(0,Z.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.automation.editor.conditions.validation_failed")}),void console.error("Error validating condition",o)}if(this.condition===t)if(i.conditions.valid){try{e=await(0,H.S9)(this.hass,t)}catch(o){if(this.condition!==t)return;return void(0,Z.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.automation.editor.conditions.test_failed"),text:o.message})}this._testingResult=e.result,this._testing=!0,this._testingTimeout=window.setTimeout(()=>{this._testing=!1},2500)}else(0,Z.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.automation.editor.conditions.invalid_condition"),text:i.conditions.error})},this._renameCondition=async()=>{const t=await(0,Z.an)(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,b.Z)((0,L.p)(this.condition,this.hass,this._entityReg,!0)),defaultValue:this.condition.alias,confirmText:this.hass.localize("ui.common.submit")});if(null!==t){const e=Object.assign({},this.condition);if(""===t?delete e.alias:e.alias=t,(0,p.r)(this,"value-changed",{value:e}),this._selected&&this.optionsInSidebar)this.openSidebar(e);else if(this._yamlMode){var i;null===(i=this.conditionEditor)||void 0===i||null===(i=i.yamlEditor)||void 0===i||i.setValue(e)}}},this._editNoteCondition=async()=>{const t=await(0,Z.an)(this,{title:this.hass.localize("ui.panel.config.automation.editor.note."+(this.condition.note?"edit":"add")),inputLabel:this.hass.localize("ui.panel.config.automation.editor.note.label"),inputType:"string",defaultValue:this.condition.note,confirmText:this.hass.localize("ui.common.submit"),multiline:!0});if(null!==t){const e=Object.assign({},this.condition);if(""===t?delete e.note:e.note=t,(0,p.r)(this,"value-changed",{value:e}),this._selected&&this.optionsInSidebar)this.openSidebar(e);else if(this._yamlMode){var i;null===(i=this.conditionEditor)||void 0===i||null===(i=i.yamlEditor)||void 0===i||i.setValue(e)}}},this._duplicateCondition=()=>{(0,p.r)(this,"duplicate")},this._insertAfter=t=>!(0,h.e)(t).some(t=>!(0,H.G3)(t))&&((0,p.r)(this,"insert-after",{value:t}),!0),this._copyCondition=()=>{this._setClipboard(),this._selected&&this.optionsInSidebar&&this.openSidebar(),(0,I.c)(this,{message:this.hass.localize("ui.panel.config.automation.editor.conditions.copied_to_clipboard"),duration:2e3})},this._cutCondition=()=>{this._setClipboard(),(0,p.r)(this,"value-changed",{value:null}),this._selected&&(0,p.r)(this,"close-sidebar"),(0,I.c)(this,{message:this.hass.localize("ui.panel.config.automation.editor.conditions.cut_to_clipboard"),duration:2e3})},this._pasteCondition=()=>{var t;const i=null===(t=this._clipboard)||void 0===t?void 0:t.condition;i&&(0,p.r)(this,"paste",{item:i})},this._pasteAvailable=()=>{var t;return!(null===(t=this._clipboard)||void 0===t||!t.condition)},this._moveUp=()=>{(0,p.r)(this,"move-up")},this._moveDown=()=>{(0,p.r)(this,"move-down")},this._toggleYamlMode=t=>{this._yamlMode?this._switchUiMode():this._switchYamlMode(),this.optionsInSidebar?t&&this.openSidebar():this.expand()},this._getType=(0,r.A)((t,i)=>t.condition in i?"platform":t.condition),this._uiSupported=(0,r.A)(t=>void 0!==customElements.get(`ha-automation-condition-${t}`))}}(0,o.Cg)([(0,l.MZ)({attribute:!1})],Tt.prototype,"hass",void 0),(0,o.Cg)([(0,l.MZ)({attribute:!1})],Tt.prototype,"condition",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean})],Tt.prototype,"disabled",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean})],Tt.prototype,"root",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean})],Tt.prototype,"first",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean})],Tt.prototype,"last",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean})],Tt.prototype,"narrow",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean})],Tt.prototype,"highlight",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean,attribute:"sort-selected"})],Tt.prototype,"sortSelected",void 0),(0,o.Cg)([(0,l.wk)()],Tt.prototype,"_collapsed",void 0),(0,o.Cg)([(0,l.wk)()],Tt.prototype,"_isNew",void 0),(0,o.Cg)([(0,l.wk)()],Tt.prototype,"_warnings",void 0),(0,o.Cg)([(0,l.MZ)({attribute:!1})],Tt.prototype,"conditionDescriptions",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean,attribute:"sidebar"})],Tt.prototype,"optionsInSidebar",void 0),(0,o.Cg)([(0,u.I)({key:"automationClipboard",state:!1,subscribe:!0,storage:"sessionStorage"})],Tt.prototype,"_clipboard",void 0),(0,o.Cg)([(0,l.wk)()],Tt.prototype,"_yamlMode",void 0),(0,o.Cg)([(0,l.wk)()],Tt.prototype,"_testing",void 0),(0,o.Cg)([(0,l.wk)()],Tt.prototype,"_testingResult",void 0),(0,o.Cg)([(0,l.wk)()],Tt.prototype,"_selected",void 0),(0,o.Cg)([(0,l.wk)(),(0,n.Fg)({context:S.ih,subscribe:!0})],Tt.prototype,"_entityReg",void 0),(0,o.Cg)([(0,l.P)("ha-automation-condition-editor")],Tt.prototype,"conditionEditor",void 0),(0,o.Cg)([(0,l.P)("ha-automation-row")],Tt.prototype,"_automationRowElement",void 0),Tt=(0,o.Cg)([(0,l.EM)("ha-automation-condition-row")],Tt),i()}catch(X){i(X)}})},40219:function(t,i,e){e.a(t,async function(t,i){try{e(74423),e(18111),e(22489),e(7588),e(62953),e(122);var o=e(40445),n=e(34271),s=e(5124),a=e(67576),d=e(75751),l=e(1087),c=e(57237),r=e(18350),h=(e(85938),e(67094),e(88249)),u=e(87225),p=e(93758),g=e(54706),v=(e(49053),e(82405)),b=e(41175),m=e(57116),_=e(53354),y=t([r,_]);[r,_]=y.then?(await y)():y;let C,f,$,w=t=>t;const M="M21 11H3V9H21V11M21 13H3V15H21V13Z",A="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z";class k extends((0,b.j)((0,g.E)(s.WF))){get items(){return this.conditions}set items(t){this.conditions=t}setHighlightedItems(t){this.highlightedConditions=t}disconnectedCallback(){super.disconnectedCallback(),this._unsubscribe()}hassSubscribe(){return[(0,p.CO)(this.hass.connection,"automation","new_triggers_conditions",t=>{this._newTriggersAndConditions=t.enabled})]}_subscribeDescriptions(){this._unsubscribe(),this._conditionDescriptions={},this._unsub=(0,u.bn)(this.hass,t=>{this._conditionDescriptions=Object.assign(Object.assign({},this._conditionDescriptions),t)})}_unsubscribe(){this._unsub&&(this._unsub.then(t=>t()),this._unsub=void 0)}willUpdate(t){super.willUpdate(t),t.has("_newTriggersAndConditions")&&this._subscribeDescriptions()}firstUpdated(t){super.firstUpdated(t),this.hass.loadBackendTranslation("conditions")}updated(t){if(!this.hass)return;const i=(0,v.II)(this.hass.states,this.hass.devices,this.hass.areas,"condition");if(t.has("conditions")&&i&&(this._openedAddDialogFromQuery=!1),!this._openedAddDialogFromQuery&&this.root&&!this.disabled&&0===this.conditions.length&&i?(this._openedAddDialogFromQuery=!0,queueMicrotask(()=>this._addConditionDialog())):this._openedAddDialogFromQuery&&!i&&(this._openedAddDialogFromQuery=!1),!t.has("conditions"))return;let e;if(Array.isArray(this.conditions)||(e=[this.conditions]),(e||this.conditions).forEach((t,i)=>{"string"==typeof t&&(e=e||[...this.conditions],e[i]={condition:"template",value_template:t})}),e)(0,l.r)(this,"value-changed",{value:e});else if(this.focusLastItemOnChange||void 0!==this.focusItemIndexOnChange){const t=this.focusLastItemOnChange?"new":"moved",i=this.shadowRoot.querySelector("ha-automation-condition-row:"+("new"===t?"last-of-type":`nth-of-type(${this.focusItemIndexOnChange+1})`));this.focusLastItemOnChange=!1,this.focusItemIndexOnChange=void 0,i.updateComplete.then(()=>{!this.optionsInSidebar||u.I8.includes(i.condition.condition)&&"moved"!==t||(i.openSidebar(),this.narrow&&i.scrollIntoView({block:"start",behavior:"smooth"})),"new"===t&&(i.expand(),i.markAsNew()),this.optionsInSidebar||i.focus()})}}expandAll(){var t;null===(t=this._conditionRowElements)||void 0===t||t.forEach(t=>{t.expandAll()})}collapseAll(){var t;null===(t=this._conditionRowElements)||void 0===t||t.forEach(t=>{t.collapseAll()})}render(){return Array.isArray(this.conditions)?(0,s.qy)(C||(C=w` <ha-sortable handle-selector=".handle" draggable-selector="ha-automation-condition-row" .disabled="${0}" group="conditions" invert-swap @item-moved="${0}" @item-added="${0}" @item-removed="${0}"> <div class="rows ${0}"> ${0} <div class="buttons"> <ha-button .disabled="${0}" @click="${0}" .appearance="${0}" .size="${0}"> <ha-svg-icon .path="${0}" slot="start"></ha-svg-icon> ${0} </ha-button> </div> </div> </ha-sortable> `),this.disabled,this.itemMoved,this.itemAdded,this.itemRemoved,this.optionsInSidebar?"":"no-sidebar",(0,d.u)(this.conditions.filter(t=>"object"==typeof t),t=>this.getKey(t),(t,i)=>{var e;return(0,s.qy)(f||(f=w` <ha-automation-condition-row .root="${0}" .sortableData="${0}" .index="${0}" .first="${0}" .last="${0}" .totalConditions="${0}" .condition="${0}" .conditionDescriptions="${0}" .disabled="${0}" .narrow="${0}" @duplicate="${0}" @paste="${0}" @insert-after="${0}" @move-down="${0}" @move-up="${0}" @value-changed="${0}" .hass="${0}" .highlight="${0}" .optionsInSidebar="${0}" .sortSelected="${0}" @stop-sort-selection="${0}"> ${0} </ha-automation-condition-row> `),this.root,t,i,0===i,i===this.conditions.length-1,this.conditions.length,t,this._conditionDescriptions,this.disabled,this.narrow,this.duplicateItem,this.pasteItem,this.insertAfter,this.moveDown,this.moveUp,this.itemChanged,this.hass,null===(e=this.highlightedConditions)||void 0===e?void 0:e.includes(t),this.optionsInSidebar,this.rowSortSelected===i,this.stopSortSelection,this.disabled?s.s6:(0,s.qy)($||($=w` <div tabindex="0" class="handle ${0}" slot="icons" @keydown="${0}" @click="${0}" .index="${0}"> <ha-svg-icon .path="${0}"></ha-svg-icon> </div> `),this.rowSortSelected===i?"active":"",this.handleDragKeydown,c.d,i,M))}),this.disabled,this._addConditionDialog,this.root?"accent":"filled",this.root?"medium":"small",A,this.hass.localize("ui.panel.config.automation.editor.conditions.add")):s.s6}_addConditionDialog(){var t;this.narrow&&(0,l.r)(this,"request-close-sidebar"),(0,v.gZ)(this,{type:"condition",add:this._addCondition,clipboardItem:null===(t=this._clipboard)||void 0===t||null===(t=t.condition)||void 0===t?void 0:t.condition,clipboardPasteToastBottomOffset:this.editorDirty?60:void 0})}constructor(...t){super(...t),this.root=!1,this.editorDirty=!1,this._conditionDescriptions={},this._newTriggersAndConditions=!1,this._openedAddDialogFromQuery=!1,this._addCondition=(t,i)=>{let e;if(t===v.uV)e=this.conditions.concat((0,n.A)(this._clipboard.condition));else if((0,h.Q)(t))e=this.conditions.concat({condition:(0,h.Dt)(t),target:i});else{const o=t,n=customElements.get(`ha-automation-condition-${o}`);e=this.conditions.concat(Object.assign(Object.assign({},n.defaultConfig),null!=i&&i.entity_id?{entity_id:i.entity_id}:{}))}this.focusLastItemOnChange=!0,(0,l.r)(this,"value-changed",{value:e})}}}k.styles=m.Ju,(0,o.Cg)([(0,a.MZ)({attribute:!1})],k.prototype,"conditions",void 0),(0,o.Cg)([(0,a.MZ)({attribute:!1})],k.prototype,"highlightedConditions",void 0),(0,o.Cg)([(0,a.MZ)({type:Boolean})],k.prototype,"root",void 0),(0,o.Cg)([(0,a.MZ)({type:Boolean,attribute:!1})],k.prototype,"editorDirty",void 0),(0,o.Cg)([(0,a.wk)()],k.prototype,"_conditionDescriptions",void 0),(0,o.Cg)([(0,a.YG)("ha-automation-condition-row")],k.prototype,"_conditionRowElements",void 0),(0,o.Cg)([(0,a.wk)()],k.prototype,"_newTriggersAndConditions",void 0),k=(0,o.Cg)([(0,a.EM)("ha-automation-condition")],k),i()}catch(C){i(C)}})},80081:function(t,i,e){e.a(t,async function(t,i){try{var o=e(40445),n=e(67576),s=e(56847),a=t([s]);s=(a.then?(await a)():a)[0];class d extends s.m{static get defaultConfig(){return{condition:"and",conditions:[]}}}d=(0,o.Cg)([(0,n.EM)("ha-automation-condition-and")],d),i()}catch(d){i(d)}})},30356:function(t,i,e){e.a(t,async function(t,i){try{e(16280),e(18111),e(7588),e(3362),e(62953);var o=e(40445),n=e(35211),s=e(5124),a=e(67576),d=e(22786),l=e(1087),c=e(87682),r=e(1798),h=e(52763),u=e(22792),p=e(10139),g=t([c,r,h]);[c,r,h]=g.then?(await g)():g;let v,b,m,_=t=>t;class y extends s.WF{static get defaultConfig(){return{condition:"device",device_id:"",domain:"",entity_id:""}}shouldUpdate(t){return!t.has("condition")||(!this.condition.device_id||this.condition.device_id in this.hass.devices||((0,l.r)(this,"ui-mode-not-available",Error(this.hass.localize("ui.panel.config.automation.editor.edit_unknown_device"))),!1))}render(){var t;const i=this._deviceId||this.condition.device_id;return(0,s.qy)(v||(v=_` <ha-device-picker .value="${0}" @value-changed="${0}" .hass="${0}" .disabled="${0}" .label="${0}"></ha-device-picker> <ha-device-condition-picker .value="${0}" .deviceId="${0}" @value-changed="${0}" .hass="${0}" .disabled="${0}" .label="${0}"></ha-device-condition-picker> ${0} `),i,this._devicePicked,this.hass,this.disabled,this.hass.localize("ui.panel.config.automation.editor.conditions.type.device.label"),this.condition,i,this._deviceConditionPicked,this.hass,this.disabled,this.hass.localize("ui.panel.config.automation.editor.conditions.type.device.condition"),null!==(t=this._capabilities)&&void 0!==t&&t.extra_fields?(0,s.qy)(b||(b=_` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .disabled="${0}" .computeLabel="${0}" .computeHelper="${0}" @value-changed="${0}"></ha-form> `),this.hass,this._extraFieldsData(this.condition,this._capabilities),this._capabilities.extra_fields,this.disabled,(0,p.T_)(this.hass.localize,this.condition),(0,p.TH)(this.hass.localize,this.condition),this._extraFieldsChanged):"")}firstUpdated(){this.hass.loadBackendTranslation("device_automation"),this._capabilities||this._getCapabilities(),this.condition&&(this._origCondition=this.condition)}updated(t){const i=t.get("condition");i&&!(0,p.Po)(this._entityReg,i,this.condition)&&this._getCapabilities()}async _getCapabilities(){const t=this.condition;this._capabilities=t.domain?await(0,p.I$)(this.hass.callWS,t):void 0}_devicePicked(t){t.stopPropagation(),this._deviceId=t.target.value,void 0===this._deviceId&&(0,l.r)(this,"value-changed",{value:Object.assign(Object.assign({},y.defaultConfig),{},{condition:"device"})})}_deviceConditionPicked(t){t.stopPropagation();let i=t.detail.value;this._origCondition&&(0,p.Po)(this._entityReg,this._origCondition,i)&&(i=this._origCondition),(0,l.r)(this,"value-changed",{value:i})}_extraFieldsChanged(t){t.stopPropagation(),(0,l.r)(this,"value-changed",{value:Object.assign(Object.assign({},this.condition),t.detail.value)})}constructor(...t){super(...t),this.disabled=!1,this._entityReg=[],this._extraFieldsData=(0,d.A)((t,i)=>{const e={};return i.extra_fields.forEach(i=>{void 0!==t[i.name]&&(e[i.name]=t[i.name])}),e})}}y.styles=(0,s.AH)(m||(m=_`:host{display:block;margin-bottom:var(--ha-space-3)}ha-device-picker{display:block;margin-bottom:24px}ha-form{display:block;margin-top:24px}`)),(0,o.Cg)([(0,a.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,o.Cg)([(0,a.MZ)({type:Object})],y.prototype,"condition",void 0),(0,o.Cg)([(0,a.MZ)({type:Boolean})],y.prototype,"disabled",void 0),(0,o.Cg)([(0,a.wk)()],y.prototype,"_deviceId",void 0),(0,o.Cg)([(0,a.wk)()],y.prototype,"_capabilities",void 0),(0,o.Cg)([(0,a.wk)(),(0,n.Fg)({context:u.ih,subscribe:!0})],y.prototype,"_entityReg",void 0),y=(0,o.Cg)([(0,a.EM)("ha-automation-condition-device")],y),i()}catch(v){i(v)}})},56847:function(t,i,e){e.a(t,async function(t,o){try{e.d(i,{m:function(){return u}});e(62953);var n=e(40445),s=e(5124),a=e(67576),d=e(1087),l=e(40219),c=t([l]);l=(c.then?(await c)():c)[0];let r,h=t=>t;class u extends s.WF{render(){return(0,s.qy)(r||(r=h` <ha-automation-condition .conditions="${0}" @value-changed="${0}" .hass="${0}" .disabled="${0}" .optionsInSidebar="${0}" .narrow="${0}"></ha-automation-condition> `),this.condition.conditions||[],this._valueChanged,this.hass,this.disabled,this.optionsInSidebar,this.narrow)}expandAll(){var t,i;null===(t=this._conditionElement)||void 0===t||null===(i=t.expandAll)||void 0===i||i.call(t)}collapseAll(){var t,i;null===(t=this._conditionElement)||void 0===t||null===(i=t.collapseAll)||void 0===i||i.call(t)}_valueChanged(t){t.stopPropagation(),(0,d.r)(this,"value-changed",{value:Object.assign(Object.assign({},this.condition),{},{conditions:t.detail.value})})}constructor(...t){super(...t),this.disabled=!1,this.narrow=!1,this.optionsInSidebar=!1}}(0,n.Cg)([(0,a.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,n.Cg)([(0,a.MZ)({attribute:!1})],u.prototype,"condition",void 0),(0,n.Cg)([(0,a.MZ)({type:Boolean})],u.prototype,"disabled",void 0),(0,n.Cg)([(0,a.MZ)({type:Boolean})],u.prototype,"narrow",void 0),(0,n.Cg)([(0,a.MZ)({type:Boolean,attribute:"sidebar"})],u.prototype,"optionsInSidebar",void 0),(0,n.Cg)([(0,a.P)("ha-automation-condition")],u.prototype,"_conditionElement",void 0),u=(0,n.Cg)([(0,a.EM)("ha-automation-condition-logical")],u),o()}catch(r){o(r)}})},4601:function(t,i,e){e.a(t,async function(t,i){try{var o=e(40445),n=e(67576),s=e(56847),a=t([s]);s=(a.then?(await a)():a)[0];class d extends s.m{static get defaultConfig(){return{condition:"not",conditions:[]}}}d=(0,o.Cg)([(0,n.EM)("ha-automation-condition-not")],d),i()}catch(d){i(d)}})},97681:function(t,i,e){e.a(t,async function(t,i){try{e(62953);var o=e(40445),n=e(5124),s=e(67576),a=e(22786),d=e(63533),l=e(1087),c=e(52763),r=e(88827),h=t([c,r]);[c,r]=h.then?(await h)():h;let u,p,g=t=>t;const v=(0,d.Ik)({alias:(0,d.lq)((0,d.Yj)()),note:(0,d.lq)((0,d.Yj)()),condition:(0,d.eu)("numeric_state"),entity_id:(0,d.lq)((0,d.Yj)()),attribute:(0,d.lq)((0,d.Yj)()),above:(0,d.lq)((0,d.KC)([(0,d.ai)(),(0,d.Yj)()])),below:(0,d.lq)((0,d.KC)([(0,d.ai)(),(0,d.Yj)()])),value_template:(0,d.lq)((0,d.Yj)()),enabled:(0,d.lq)((0,d.zM)())});class b extends n.WF{static get defaultConfig(){return{condition:"numeric_state",entity_id:""}}shouldUpdate(t){if(t.has("condition"))try{(0,d.vA)(this.condition,v)}catch(i){return(0,l.r)(this,"ui-mode-not-available",i),!1}return!0}willUpdate(){var t,i;this._inputAboveIsEntity=null!==(t=this._inputAboveIsEntity)&&void 0!==t?t:"string"==typeof this.condition.above&&(this.condition.above.startsWith("input_number.")||this.condition.above.startsWith("number.")||this.condition.above.startsWith("sensor.")),this._inputBelowIsEntity=null!==(i=this._inputBelowIsEntity)&&void 0!==i?i:"string"==typeof this.condition.below&&(this.condition.below.startsWith("input_number.")||this.condition.below.startsWith("number.")||this.condition.below.startsWith("sensor."))}render(){const t=this._schema(this.hass.localize,this._inputAboveIsEntity,this._inputBelowIsEntity),i=this._data(this._inputAboveIsEntity,this._inputBelowIsEntity,this.condition);return(0,n.qy)(u||(u=g` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .disabled="${0}" @value-changed="${0}" .computeLabel="${0}"></ha-form> `),this.hass,i,t,this.disabled,this._valueChanged,this._computeLabelCallback)}_valueChanged(t){t.stopPropagation();const i=Object.assign({},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.r)(this,"value-changed",{value:i})}constructor(...t){super(...t),this.disabled=!1,this._data=(0,a.A)((t,i,e)=>Object.assign({lower_limit:t?"input":"value",upper_limit:i?"input":"value"},e)),this._schema=(0,a.A)((t,i,e)=>[{name:"entity_id",required:!0,selector:{entity:{}}},{name:"attribute",selector:{attribute:{hide_attributes:r.We}},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:{}}}]),this._computeLabelCallback=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}`)}}}}b.styles=(0,n.AH)(p||(p=g`:host{display:block;margin-bottom:var(--ha-space-3)}`)),(0,o.Cg)([(0,s.MZ)({attribute:!1})],b.prototype,"hass",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],b.prototype,"condition",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],b.prototype,"disabled",void 0),(0,o.Cg)([(0,s.wk)()],b.prototype,"_inputAboveIsEntity",void 0),(0,o.Cg)([(0,s.wk)()],b.prototype,"_inputBelowIsEntity",void 0),b=(0,o.Cg)([(0,s.EM)("ha-automation-condition-numeric_state")],b),i()}catch(u){i(u)}})},4519:function(t,i,e){e.a(t,async function(t,i){try{var o=e(40445),n=e(67576),s=e(56847),a=t([s]);s=(a.then?(await a)():a)[0];class d extends s.m{static get defaultConfig(){return{condition:"or",conditions:[]}}}d=(0,o.Cg)([(0,n.EM)("ha-automation-condition-or")],d),i()}catch(d){i(d)}})},35913:function(t,i,e){e(89463),e(18111),e(20116),e(7588),e(61701),e(13579),e(3362),e(17642),e(58004),e(33853),e(45876),e(32475),e(15024),e(31698),e(62953);var o=e(40445),n=e(5124),s=e(67576),a=e(22786),d=e(1087),l=(e(9503),e(11399),e(8034),e(87225)),c=e(95350),r=e(88555),h=e(36918);let u,p,g,v,b,m,_,y,C,f,$=t=>t;const w=t=>t.selector&&!t.required&&!("boolean"in t.selector&&t.default);class M extends n.WF{static get defaultConfig(){return{condition:""}}willUpdate(t){var i,e,o;if(super.willUpdate(t),this.hasUpdated||(this.hass.loadBackendTranslation("conditions"),this.hass.loadBackendTranslation("selector")),!t.has("condition"))return;const n=t.get("condition");if(null!==(i=this.condition)&&void 0!==i&&i.condition){const t=(0,l.ob)(this.condition.condition);t!==(0,l.ob)((null==n?void 0:n.condition)||"")&&this._fetchManifest(t)}else this._manifest=void 0;if(this.condition&&(null==n?void 0:n.condition)!==this.condition.condition&&null!==(e=this.description)&&void 0!==e&&e.fields){const t="options"in this.condition,i=this.condition.options?Object.assign({},this.condition.options):{},e=!t;let o=!1;Object.entries(this.description.fields).forEach(([t,n])=>{var s,a;n.selector&&n.required&&void 0===n.default&&"boolean"in n.selector&&void 0===i[t]?(o=!0,i[t]=!1):e&&n.selector&&void 0!==n.default&&void 0===i[t]&&(!(n.selector&&"automation_behavior"in n.selector&&null!==(s=this.description)&&void 0!==s&&s.target)||null!==(a=this.condition)&&void 0!==a&&a.target)&&(o=!0,i[t]=n.default)}),t&&!o||(0,d.r)(this,"value-changed",{value:Object.assign(Object.assign({},this.condition),{},{options:i})})}var s;(null==n?void 0:n.target)!==(null===(o=this.condition)||void 0===o?void 0:o.target)&&this._updateResolvedTargetEntityCount(null===(s=this.condition)||void 0===s?void 0:s.target)}render(){var t,i;const e=(0,l.ob)(this.condition.condition),o=(0,l.YQ)(this.condition.condition),s=this.hass.localize(`component.${e}.conditions.${o}.description`),a=this.description,d=!(null!=a&&a.fields),c=Boolean((null==a?void 0:a.fields)&&Object.values(a.fields).some(t=>w(t)));return(0,n.qy)(u||(u=$` <div class="description"> ${0} ${0} </div> ${0} ${0} `),s?(0,n.qy)(p||(p=$`<p>${0}</p>`),s):n.s6,this._manifest?(0,n.qy)(g||(g=$`<a href="${0}" title="${0}" target="_blank" rel="noreferrer"> <ha-icon-button .path="${0}" class="help-icon"></ha-icon-button> </a>`),this._manifest.is_built_in?(0,h.o)(this.hass,`/integrations/${this._manifest.domain}`):this._manifest.documentation,this.hass.localize("ui.components.service-control.integration_doc"),"M11,18H13V16H11V18M12,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,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,6A4,4 0 0,0 8,10H10A2,2 0 0,1 12,8A2,2 0 0,1 14,10C14,12 11,11.75 11,15H13C13,12.75 16,12.5 16,10A4,4 0 0,0 12,6Z"):n.s6,a&&"target"in a?(0,n.qy)(v||(v=$`<ha-settings-row narrow> <span slot="heading">${0}</span> <ha-selector .hass="${0}" .selector="${0}" .disabled="${0}" @value-changed="${0}" .value="${0}"></ha-selector></ha-settings-row>`),this.hass.localize("ui.components.service-control.target"),this.hass,this._targetSelector(a.target),this.disabled,this._targetChanged,null===(t=this.condition)||void 0===t?void 0:t.target):n.s6,d?(0,n.qy)(b||(b=$`<ha-yaml-editor .label="${0}" .name="${0}" .readOnly="${0}" .defaultValue="${0}" @value-changed="${0}"></ha-yaml-editor>`),this.hass.localize("ui.components.service-control.action_data"),"data",this.disabled,null===(i=this.condition)||void 0===i?void 0:i.options,this._dataChanged):Object.entries(a.fields).map(([t,i])=>this._renderField(t,i,c,e,o)))}_generateContext(t){if(!t.context)return;const i={};for(const[n,s]of Object.entries(t.context)){var e,o;"target"===s&&null!==(e=this.description)&&void 0!==e&&e.target&&(i.target_selector=this._targetSelector(this.description.target)),i[n]="target"===s?this.condition.target:null===(o=this.condition.options)||void 0===o?void 0:o[s]}return i}_dataChanged(t){var i,e,o;if(t.stopPropagation(),!1===t.detail.isValid)return;const n=t.currentTarget.key,s=t.detail.value;if(!((null===(i=this.condition)||void 0===i||null===(i=i.options)||void 0===i?void 0:i[n])!==s&&(null!==(e=this.condition)&&void 0!==e&&e.options&&n in this.condition.options||""!==s&&void 0!==s)))return;const a=Object.assign(Object.assign({},null===(o=this.condition)||void 0===o?void 0:o.options),{},{[n]:s});(""===s||void 0===s||"object"==typeof s&&!Object.keys(s).length)&&delete a[n],(0,d.r)(this,"value-changed",{value:Object.assign(Object.assign({},this.condition),{},{options:a})})}_targetChanged(t){t.stopPropagation(),(0,d.r)(this,"value-changed",{value:Object.assign(Object.assign({},this.condition),{},{target:t.detail.value})})}_toggleCheckbox(t){var i;const e=null===(i=t.currentTarget)||void 0===i||null===(i=i.parentElement)||void 0===i?void 0:i.querySelector("ha-checkbox");null==e||e.click()}_checkboxChanged(t){const i=t.currentTarget.checked,e=t.currentTarget.key;let o;if(i){var n;this._checkedKeys.add(e);const t=this.description&&(null===(n=Object.entries(this.description).find(([t,i])=>t===e))||void 0===n?void 0:n[1]);let i=null==t?void 0:t.default;var s,a;if(null==i&&null!=t&&t.selector&&"constant"in t.selector)i=null===(s=t.selector.constant)||void 0===s?void 0:s.value;if(null==i&&null!=t&&t.selector&&"boolean"in t.selector&&(i=!1),null!=i)o=Object.assign(Object.assign({},null===(a=this.condition)||void 0===a?void 0:a.options),{},{[e]:i})}else{var l;this._checkedKeys.delete(e),o=Object.assign({},null===(l=this.condition)||void 0===l?void 0:l.options),delete o[e]}o&&(0,d.r)(this,"value-changed",{value:Object.assign(Object.assign({},this.condition),{},{options:o})}),this.requestUpdate("_checkedKeys")}async _fetchManifest(t){this._manifest=void 0;try{this._manifest=await(0,c.QC)(this.hass,t)}catch(i){console.log(`Unable to fetch integration manifest for ${t}`)}}_updateResolvedTargetEntityCount(t){var i,e,o;this._resolvedTargetEntityCount=(0,r.aW)(t);const n=Object.entries(null!==(i=null===(e=this.description)||void 0===e?void 0:e.fields)&&void 0!==i?i:{}).find(([,t])=>t.selector&&"automation_behavior"in t.selector);if(!n)return;const[s,a]=n;if(t&&this._resolvedTargetEntityCount>1&&void 0===(null===(o=this.condition.options)||void 0===o?void 0:o[s])){const t=a.default;void 0!==t&&(0,d.r)(this,"value-changed",{value:Object.assign(Object.assign({},this.condition),{},{options:Object.assign(Object.assign({},this.condition.options),{},{[s]:t})})})}}constructor(...t){super(...t),this.disabled=!1,this._checkedKeys=new Set,this._targetSelector=(0,a.A)(t=>t?{target:Object.assign({},t)}:{target:{}}),this._renderField=(t,i,e,o,s)=>{var a,d,l,c,r,h;const u=null!==(a=null==i?void 0:i.selector)&&void 0!==a?a:{text:null},p=w(i);if(!i.selector)return n.s6;if("automation_behavior"in u&&null!==(d=this.description)&&void 0!==d&&d.target&&(null===(l=this.condition)||void 0===l||!l.target||void 0!==this._resolvedTargetEntityCount&&this._resolvedTargetEntityCount<=1))return n.s6;const g=this.hass.localize(`component.${o}.conditions.${s}.fields.${t}.description`);return(0,n.qy)(m||(m=$`<ha-settings-row narrow> ${0} <span slot="heading" class="${0}" @click="${0}">${0}</span> ${0} <ha-selector .disabled="${0}" .hass="${0}" .selector="${0}" .context="${0}" .key="${0}" @value-changed="${0}" .value="${0}" .placeholder="${0}" .localizeValue="${0}" .required="${0}"></ha-selector> </ha-settings-row>`),p?(0,n.qy)(y||(y=$`<ha-checkbox .key="${0}" .checked="${0}" .disabled="${0}" @change="${0}" slot="prefix"></ha-checkbox>`),t,this._checkedKeys.has(t)||!(null===(c=this.condition)||void 0===c||!c.options)&&void 0!==this.condition.options[t],this.disabled,this._checkboxChanged):e?(0,n.qy)(_||(_=$`<div slot="prefix" class="checkbox-spacer"></div>`)):n.s6,p?"clickable":"",p?this._toggleCheckbox:void 0,this.hass.localize(`component.${o}.conditions.${s}.fields.${t}.name`)||t,g?(0,n.qy)(C||(C=$`<span class="${0}" @click="${0}" slot="description">${0}</span>`),p?"clickable":"",p?this._toggleCheckbox:void 0,g):n.s6,this.disabled||p&&!this._checkedKeys.has(t)&&(!(null!==(r=this.condition)&&void 0!==r&&r.options)||void 0===this.condition.options[t]),this.hass,u,this._generateContext(i),t,this._dataChanged,null!==(h=this.condition)&&void 0!==h&&h.options?this.condition.options[t]:void 0,i.default,this._localizeValueCallback,i.required)},this._localizeValueCallback=t=>{var i;return null!==(i=this.condition)&&void 0!==i&&i.condition?this.hass.localize(`component.${(0,l.ob)(this.condition.condition)}.selector.${t}`):""}}}M.styles=(0,n.AH)(f||(f=$`:host{display:block;margin:0px calc(-1 * var(--ha-space-4))}ha-settings-row{padding:0 var(--ha-space-4)}ha-settings-row[narrow]{padding-bottom:var(--ha-space-2)}ha-settings-row{--settings-row-content-width:100%;--settings-row-prefix-display:contents;border-top:var(--service-control-items-border-top,1px solid var(--divider-color))}ha-entity-picker,ha-service-picker,ha-yaml-editor{display:block;margin:0 var(--ha-space-4)}ha-yaml-editor{padding:var(--ha-space-4) 0}p{margin:0 var(--ha-space-4);padding:var(--ha-space-4) 0}:host([hide-picker]) p{padding-top:0}.checkbox-spacer{width:32px}.help-icon{color:var(--secondary-text-color)}.description{justify-content:space-between;display:flex;align-items:center;padding-right:2px;padding-inline-end:2px;padding-inline-start:initial}.description p{direction:ltr}.clickable{cursor:pointer}`)),(0,o.Cg)([(0,s.MZ)({attribute:!1})],M.prototype,"hass",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],M.prototype,"condition",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],M.prototype,"description",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],M.prototype,"disabled",void 0),(0,o.Cg)([(0,s.wk)()],M.prototype,"_checkedKeys",void 0),(0,o.Cg)([(0,s.wk)()],M.prototype,"_manifest",void 0),(0,o.Cg)([(0,s.wk)()],M.prototype,"_resolvedTargetEntityCount",void 0),M=(0,o.Cg)([(0,s.EM)("ha-automation-condition-platform")],M)},93977:function(t,i,e){e.a(t,async function(t,i){try{e(18111),e(7588),e(62953);var o=e(40445),n=e(5124),s=e(67576),a=e(63533),d=e(44537),l=e(57673),c=e(1087),r=e(52763),h=e(88827),u=e(67442),p=t([r,h]);[r,h]=p.then?(await p)():p;let g,v,b=t=>t;const m=(0,a.Ik)({alias:(0,a.lq)((0,a.Yj)()),note:(0,a.lq)((0,a.Yj)()),condition:(0,a.eu)("state"),entity_id:(0,a.lq)((0,a.Yj)()),attribute:(0,a.lq)((0,a.Yj)()),state:(0,a.lq)((0,a.KC)([(0,a.Yj)(),(0,a.YO)((0,a.Yj)())])),for:(0,a.lq)((0,a.KC)([(0,a.ai)(),(0,a.Yj)(),u.b])),enabled:(0,a.lq)((0,a.zM)())}),_=[{name:"entity_id",required:!0,selector:{entity:{}}},{name:"attribute",selector:{attribute:{hide_attributes:h.B9}},context:{filter_entity:"entity_id"}},{name:"state",required:!0,selector:{state:{multiple:!0}},context:{filter_entity:"entity_id",filter_attribute:"attribute"}},{name:"for",selector:{duration:{}}}];class y extends n.WF{static get defaultConfig(){return{condition:"state",entity_id:"",state:[]}}shouldUpdate(t){if(t.has("condition"))try{(0,a.vA)(this.condition,m)}catch(i){return(0,c.r)(this,"ui-mode-not-available",i),!1}return!0}render(){const t=(0,l.z)(this.condition.for),i=Object.assign(Object.assign({},this.condition),{},{state:(0,d.e)(this.condition.state)||[],for:t});return(0,n.qy)(g||(g=b` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .disabled="${0}" @value-changed="${0}" .computeLabel="${0}"></ha-form> `),this.hass,i,_,this.disabled,this._valueChanged,this._computeLabelCallback)}_valueChanged(t){t.stopPropagation();const i=t.detail.value;Object.keys(i).forEach(t=>void 0===i[t]||""===i[t]?delete i[t]:{}),void 0!==i.state&&""!==i.state||(i.state=[]),(0,c.r)(this,"value-changed",{value:i})}constructor(...t){super(...t),this.disabled=!1,this._computeLabelCallback=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}`)}}}}y.styles=(0,n.AH)(v||(v=b`:host{display:block;margin-bottom:var(--ha-space-3)}`)),(0,o.Cg)([(0,s.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],y.prototype,"condition",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],y.prototype,"disabled",void 0),y=(0,o.Cg)([(0,s.EM)("ha-automation-condition-state")],y),i()}catch(g){i(g)}})},40998:function(t,i,e){e.a(t,async function(t,i){try{e(74423),e(62953);var o=e(40445),n=e(5124),s=e(67576),a=e(22786),d=e(1087),l=e(52763),c=t([l]);l=(c.then?(await c)():c)[0];let r,h,u=t=>t;const p="sunrise",g="sunset";class v extends n.WF{connectedCallback(){super.connectedCallback(),this.condition.before&&this.condition.after?this._formType="between":this.condition.after&&(this._formType="after")}static get defaultConfig(){return{condition:"sun",before:p}}render(){const t=this._schema(this.hass.localize,this._formType);return(0,n.qy)(r||(r=u` <ha-select .label="${0}" .value="${0}" @selected="${0}" .options="${0}"> </ha-select> <ha-form .schema="${0}" .data="${0}" .hass="${0}" .disabled="${0}" .computeLabel="${0}" @value-changed="${0}"></ha-form> `),this.hass.localize("ui.panel.config.automation.editor.conditions.type_select"),this._formType,this._typeSelected,[{value:"before",label:this.hass.localize("ui.panel.config.automation.editor.conditions.type.sun.before")},{value:"after",label:this.hass.localize("ui.panel.config.automation.editor.conditions.type.sun.after")},{value:"between",label:this.hass.localize("ui.panel.config.automation.editor.conditions.type.sun.between")}],t,this.condition,this.hass,this.disabled,this._computeLabelCallback,this._valueChanged)}_valueChanged(t){t.stopPropagation(),(0,d.r)(this,"value-changed",{value:t.detail.value})}_typeSelected(t){const i=t.detail.value;this._formType=i,"after"===i?(delete this.condition.before,delete this.condition.before_offset):this.condition.before||(this.condition.before=p),"before"===i?(delete this.condition.after,delete this.condition.after_offset):this.condition.after||(this.condition.after=g),(0,d.r)(this,"value-changed",{value:Object.assign({},this.condition)})}constructor(...t){super(...t),this.disabled=!1,this._formType="before",this._schema=(0,a.A)((t,i)=>[...["between","after"].includes(i)?[{name:"after",type:"select",default:g,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:{duration:{allow_negative:!0}}}]:[],...["between","before"].includes(i)?[{name:"before",type:"select",default:p,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:{duration:{allow_negative:!0}}}]:[]]),this._computeLabelCallback=t=>this.hass.localize(`ui.panel.config.automation.editor.conditions.type.sun.${t.name}`)}}v.styles=(0,n.AH)(h||(h=u`ha-select{display:block;margin-bottom:var(--ha-space-4)}`)),(0,o.Cg)([(0,s.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],v.prototype,"condition",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],v.prototype,"disabled",void 0),(0,o.Cg)([(0,s.wk)()],v.prototype,"_formType",void 0),v=(0,o.Cg)([(0,s.EM)("ha-automation-condition-sun")],v),i()}catch(r){i(r)}})},60092:function(t,i,e){e.a(t,async function(t,i){try{e(62953);var o=e(40445),n=e(5124),s=e(67576),a=e(52763),d=e(1087),l=t([a]);a=(l.then?(await l)():l)[0];let c,r=t=>t;const h=[{name:"value_template",required:!0,selector:{template:{}}}];class u extends n.WF{static get defaultConfig(){return{condition:"template",value_template:""}}render(){return(0,n.qy)(c||(c=r` <ha-form .hass="${0}" .data="${0}" .schema="${0}" @value-changed="${0}" .computeLabel="${0}" .disabled="${0}"></ha-form> `),this.hass,this.condition,h,this._valueChanged,this._computeLabelCallback,this.disabled)}_valueChanged(t){t.stopPropagation();const i=t.detail.value;(0,d.r)(this,"value-changed",{value:i})}constructor(...t){super(...t),this.disabled=!1,this._computeLabelCallback=t=>this.hass.localize(`ui.panel.config.automation.editor.conditions.type.template.${t.name}`)}}(0,o.Cg)([(0,s.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],u.prototype,"condition",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],u.prototype,"disabled",void 0),u=(0,o.Cg)([(0,s.EM)("ha-automation-condition-template")],u),i()}catch(c){i(c)}})},23484:function(t,i,e){e.a(t,async function(t,i){try{e(18111),e(7588),e(61701),e(62953);var o=e(40445),n=e(5124),s=e(67576),a=e(22786),d=e(380),l=e(1087),c=e(52763),r=t([c,d]);[c,d]=r.then?(await r)():r;let h,u=t=>t;const p=["sun","mon","tue","wed","thu","fri","sat"];class g extends n.WF{static get defaultConfig(){return{condition:"time"}}render(){var t,i,e,o,s,a,d,l;const c=null!==(t=this._inputModeBefore)&&void 0!==t?t:(null===(i=this.condition.before)||void 0===i?void 0:i.startsWith("input_datetime."))||(null===(e=this.condition.before)||void 0===e?void 0:e.startsWith("time."))||(null===(o=this.condition.before)||void 0===o?void 0:o.startsWith("sensor.")),r=null!==(s=this._inputModeAfter)&&void 0!==s?s:(null===(a=this.condition.after)||void 0===a?void 0:a.startsWith("input_datetime."))||(null===(d=this.condition.after)||void 0===d?void 0:d.startsWith("time."))||(null===(l=this.condition.after)||void 0===l?void 0:l.startsWith("sensor.")),p=this._schema(this.hass.localize,this.hass.locale,r,c),g=Object.assign({mode_before:c?"input":"value",mode_after:r?"input":"value"},this.condition);return(0,n.qy)(h||(h=u` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .disabled="${0}" @value-changed="${0}" .computeLabel="${0}"></ha-form> `),this.hass,g,p,this.disabled,this._valueChanged,this._computeLabelCallback)}_valueChanged(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.r)(this,"value-changed",{value:i})}constructor(...t){super(...t),this.disabled=!1,this._schema=(0,a.A)((t,i,e,o)=>{const n=(0,d.P)(i),s=p.slice(n,p.length).concat(p.slice(0,n));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:o?{entity:{filter:[{domain:"input_datetime"},{domain:"time"},{domain:"sensor",device_class:"timestamp"}]}}:{time:{}}},{type:"multi_select",name:"weekday",options:s.map(i=>[i,t(`ui.panel.config.automation.editor.conditions.type.time.weekdays.${i}`)])}]}),this._computeLabelCallback=t=>this.hass.localize(`ui.panel.config.automation.editor.conditions.type.time.${t.name}`)}}(0,o.Cg)([(0,s.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],g.prototype,"condition",void 0),(0,o.Cg)([(0,s.wk)()],g.prototype,"_inputModeBefore",void 0),(0,o.Cg)([(0,s.wk)()],g.prototype,"_inputModeAfter",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],g.prototype,"disabled",void 0),g=(0,o.Cg)([(0,s.EM)("ha-automation-condition-time")],g),i()}catch(h){i(h)}})},52128:function(t,i,e){e.a(t,async function(t,i){try{e(18111),e(22489),e(61701),e(13579),e(17642),e(58004),e(33853),e(45876),e(32475),e(15024),e(31698),e(62953);var o=e(40445),n=e(5124),s=e(67576),a=e(22786),d=e(44537),l=e(1087),c=e(52763),r=e(606),h=e(88249),u=t([c,r]);[c,r]=u.then?(await u)():u;let p,g=t=>t;const v=t=>{const i=(0,h.aI)(t).map(t=>"id"in t?t.id:void 0).filter(Boolean);return Array.from(new Set(i))};class b extends n.WF{static get defaultConfig(){return{condition:"trigger",id:""}}connectedCallback(){super.connectedCallback();const t={callback:t=>this._automationUpdated(t)};(0,l.r)(this,"subscribe-automation-config",t),this._unsub=t.unsub}disconnectedCallback(){super.disconnectedCallback(),this._unsub&&this._unsub()}render(){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(0,n.qy)(p||(p=g` <ha-form .schema="${0}" .data="${0}" .hass="${0}" .disabled="${0}" .computeLabel="${0}" @value-changed="${0}"></ha-form> `),t,this.condition,this.hass,this.disabled,this._computeLabelCallback,this._valueChanged)}_automationUpdated(t){this._triggerIds=null!=t&&t.triggers?v((0,d.e)(t.triggers)):[]}_valueChanged(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.length||(i.id="")),(0,l.r)(this,"value-changed",{value:i})}constructor(...t){super(...t),this.disabled=!1,this._triggerIds=[],this._schema=(0,a.A)(t=>[{name:"id",selector:{select:{multiple:!0,options:t}},required:!0}]),this._computeLabelCallback=t=>this.hass.localize(`ui.panel.config.automation.editor.conditions.type.trigger.${t.name}`)}}(0,o.Cg)([(0,s.MZ)({attribute:!1})],b.prototype,"hass",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],b.prototype,"condition",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],b.prototype,"disabled",void 0),(0,o.Cg)([(0,s.wk)()],b.prototype,"_triggerIds",void 0),b=(0,o.Cg)([(0,s.EM)("ha-automation-condition-trigger")],b),i()}catch(p){i(p)}})},56860:function(t,i,e){e.a(t,async function(t,i){try{e(62953);var o=e(40445),n=e(5124),s=e(67576),a=e(1087),d=e(69093),l=e(3471),c=e(82474),r=t([c]);c=(r.then?(await r)():r)[0];let u,p,g=t=>t;function v(t){return(0,l.e)(t)&&"zone"!==(0,d.t)(t)}const b=["zone"];class m extends n.WF{static get defaultConfig(){return{condition:"zone",entity_id:"",zone:""}}render(){const{entity_id:t,zone:i}=this.condition;return(0,n.qy)(u||(u=g` <ha-entity-picker .label="${0}" .value="${0}" @value-changed="${0}" .hass="${0}" .disabled="${0}" .entityFilter="${0}"></ha-entity-picker> <ha-entity-picker .label="${0}" .value="${0}" @value-changed="${0}" .hass="${0}" .disabled="${0}" .includeDomains="${0}"></ha-entity-picker> `),this.hass.localize("ui.panel.config.automation.editor.conditions.type.zone.entity"),t,this._entityPicked,this.hass,this.disabled,v,this.hass.localize("ui.panel.config.automation.editor.conditions.type.zone.zone"),i,this._zonePicked,this.hass,this.disabled,b)}_entityPicked(t){t.stopPropagation(),(0,a.r)(this,"value-changed",{value:Object.assign(Object.assign({},this.condition),{},{entity_id:t.detail.value})})}_zonePicked(t){t.stopPropagation(),(0,a.r)(this,"value-changed",{value:Object.assign(Object.assign({},this.condition),{},{zone:t.detail.value})})}constructor(...t){super(...t),this.disabled=!1}}m.styles=(0,n.AH)(p||(p=g`ha-entity-picker:first-child{display:block;margin-bottom:24px}`)),(0,o.Cg)([(0,s.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],m.prototype,"condition",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],m.prototype,"disabled",void 0),m=(0,o.Cg)([(0,s.EM)("ha-automation-condition-zone")],m),i()}catch(h){i(h)}})}}]);