"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["67973"],{85657:function(t,e,i){i.d(e,{K:function(){return s}});const s=(t,e,i)=>t.callService("text","set_value",{value:i},{entity_id:e})},58212:function(t,e,i){i.a(t,async function(t,s){try{i.r(e);i(16280);var a=i(40445),n=i(96196),h=i(77845),r=(i(75709),i(22675)),o=i(85657),u=i(37642),c=i(784),l=i(79757),g=i(85979),d=t([l,g]);[l,g]=d.then?(await d)():d;let f,y,_,p=t=>t;class v extends n.WF{setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}shouldUpdate(t){return(0,c.LX)(this,t)}render(){if(!this._config||!this.hass)return n.s6;const t=this.hass.states[this._config.entity];if(!t)return(0,n.qy)(f||(f=p` <hui-warning .hass="${0}"> ${0} </hui-warning> `),this.hass,(0,g.j)(this.hass,this._config.entity));const e=(0,u.v)(this.hass,t,this._config.name);return(0,n.qy)(y||(y=p` <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="${0}"></ha-textfield> </hui-generic-entity-row> `),this.hass,this._config,e,t.state===r.Hh,t.state,t.attributes.min,t.attributes.max,t.attributes.pattern,t.attributes.pattern,t.attributes.mode,this._valueChanged,this.hass.localize("ui.card.text.emtpy_value"))}_valueChanged(t){const e=this.hass.states[this._config.entity],i=t.target.value;i&&(0,r.g0)(i)?t.target.value=e.state:(i!==e.state&&(0,o.K)(this.hass,e.entity_id,i),t.target.blur())}}v.styles=(0,n.AH)(_||(_=p`hui-generic-entity-row{display:flex;align-items:center}ha-textfield{width:100%}`)),(0,a.Cg)([(0,h.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,a.Cg)([(0,h.wk)()],v.prototype,"_config",void 0),v=(0,a.Cg)([(0,h.EM)("hui-text-entity-row")],v),s()}catch(f){s(f)}})}}]);
//# sourceMappingURL=67973.1b5838e420396a08.js.map