"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["8086"],{12284:function(t,e,i){i.d(e,{BJ:function(){return r},KY:function(){return n},MG:function(){return s},d_:function(){return h},m4:function(){return a}});const n=(t,e,i)=>t.callService(e.split(".",1)[0],"set_value",{value:i,entity_id:e}),s=t=>t.callWS({type:"input_text/list"}),a=(t,e)=>t.callWS(Object.assign({type:"input_text/create"},e)),r=(t,e,i)=>t.callWS(Object.assign({type:"input_text/update",input_text_id:e},i)),h=(t,e)=>t.callWS({type:"input_text/delete",input_text_id:e})},51765:function(t,e,i){i.a(t,async function(t,n){try{i.r(e);i(16280);var s=i(40445),a=i(96196),r=i(77845),h=(i(75709),i(22675)),u=i(12284),c=i(37642),l=i(784),o=i(79757),d=i(85979),g=t([o,d]);[o,d]=g.then?(await g)():g;let f,p,_,y=t=>t;class x extends a.WF{setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}shouldUpdate(t){return(0,l.LX)(this,t)}render(){if(!this._config||!this.hass)return a.s6;const t=this.hass.states[this._config.entity];if(!t)return(0,a.qy)(f||(f=y` <hui-warning .hass="${0}"> ${0} </hui-warning> `),this.hass,(0,d.j)(this.hass,this._config.entity));const e=(0,c.v)(this.hass,t,this._config.name);return(0,a.qy)(p||(p=y` <hui-generic-entity-row .hass="${0}" .config="${0}" hide-name> <ha-textfield .label="${0}" .disabled="${0}" .value="${0}" .minlength="${0}" .maxlength="${0}" .autoValidate="${0}" .pattern="${0}" .type="${0}" @change="${0}" placeholder="(empty value)"></ha-textfield> </hui-generic-entity-row> `),this.hass,this._config,e,t.state===h.Hh,t.state,t.attributes.min,t.attributes.max,t.attributes.pattern,t.attributes.pattern,t.attributes.mode,this._selectedValueChanged)}_selectedValueChanged(t){const e=this.hass.states[this._config.entity],i=t.target.value;i&&(0,h.g0)(i)?t.target.value=e.state:(i!==e.state&&(0,u.KY)(this.hass,e.entity_id,i),t.target.blur())}}x.styles=(0,a.AH)(_||(_=y`hui-generic-entity-row{display:flex;align-items:center}ha-textfield{width:100%}`)),(0,s.Cg)([(0,r.MZ)({attribute:!1})],x.prototype,"hass",void 0),(0,s.Cg)([(0,r.wk)()],x.prototype,"_config",void 0),x=(0,s.Cg)([(0,r.EM)("hui-input-text-entity-row")],x),n()}catch(f){n(f)}})}}]);
//# sourceMappingURL=8086.4ccae853bbcb185a.js.map