iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 34.9 kB
JavaScript
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[5748],{12198:function(e,t,r){"use strict";r.d(t,{p:function(){return s},D:function(){return l}});var n=r(68928),i=r(14516),o=r(43274),a=(0,i.Z)((function(e){return new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric"})})),s=o.Sb?function(e,t){return a(t).format(e)}:function(e){return(0,n.WU)(e,"longDate")},c=(0,i.Z)((function(e){return new Intl.DateTimeFormat(e.language,{weekday:"long",month:"long",day:"numeric"})})),l=o.Sb?function(e,t){return c(t).format(e)}:function(e){return(0,n.WU)(e,"dddd, MMM D")}},44583:function(e,t,r){"use strict";r.d(t,{o:function(){return c},E:function(){return u}});var n=r(68928),i=r(14516),o=r(43274),a=r(65810),s=(0,i.Z)((function(e){return new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit",hour12:(0,a.y)(e)})})),c=o.Op?function(e,t){return s(t).format(e)}:function(e,t){return(0,n.WU)(e,((0,a.y)(t)," A"))},l=(0,i.Z)((function(e){return new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:(0,a.y)(e)})})),u=o.Op?function(e,t){return l(t).format(e)}:function(e,t){return(0,n.WU)(e,((0,a.y)(t)," A"))}},49684:function(e,t,r){"use strict";r.d(t,{mr:function(){return c},Vu:function(){return u},xO:function(){return f}});var n=r(68928),i=r(14516),o=r(43274),a=r(65810),s=(0,i.Z)((function(e){return new Intl.DateTimeFormat(e.language,{hour:"numeric",minute:"2-digit",hour12:(0,a.y)(e)})})),c=o.BF?function(e,t){return s(t).format(e)}:function(e,t){return(0,n.WU)(e,((0,a.y)(t)," A"))},l=(0,i.Z)((function(e){return new Intl.DateTimeFormat(e.language,{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:(0,a.y)(e)})})),u=o.BF?function(e,t){return l(t).format(e)}:function(e,t){return(0,n.WU)(e,((0,a.y)(t)," A"))},d=(0,i.Z)((function(e){return new Intl.DateTimeFormat(e.language,{weekday:"long",hour:"numeric",minute:"2-digit",hour12:(0,a.y)(e)})})),f=o.BF?function(e,t){return d(t).format(e)}:function(e,t){return(0,n.WU)(e,((0,a.y)(t)," A"))}},29171:function(e,t,r){"use strict";r.d(t,{D:function(){return l}});var n=r(56007),i=r(12198),o=r(44583),a=r(49684),s=r(45524),c=r(22311),l=function(e,t,r,l){var u=void 0!==l?l:t.state;if(u===n.lz||u===n.nZ)return e("state.default.".concat(u));if(t.attributes.unit_of_measurement)return"".concat((0,s.u)(u,r)," ").concat(t.attributes.unit_of_measurement);var d=(0,c.N)(t);if("input_datetime"===d){var f;if(!t.attributes.has_time)return f=new Date(t.attributes.year,t.attributes.month-1,t.attributes.day),(0,i.p)(f,r);if(!t.attributes.has_date){var h=new Date;return f=new Date(h.getFullYear(),h.getMonth(),h.getDay(),t.attributes.hour,t.attributes.minute),(0,a.mr)(f,r)}return f=new Date(t.attributes.year,t.attributes.month-1,t.attributes.day,t.attributes.hour,t.attributes.minute),(0,o.o)(f,r)}return"humidifier"===d&&"on"===u&&t.attributes.humidity?"".concat(t.attributes.humidity," %"):"counter"===d||"number"===d||"input_number"===d?(0,s.u)(u,r):t.attributes.device_class&&e("component.".concat(d,".state.").concat(t.attributes.device_class,".").concat(u))||e("component.".concat(d,".state._.").concat(u))||u}},22311:function(e,t,r){"use strict";r.d(t,{N:function(){return i}});var n=r(58831),i=function(e){return(0,n.M)(e.entity_id)}},26955:function(e,t,r){"use strict";r.r(t),r.d(t,{EntityRegistrySettingsHelper:function(){return pe}});var n,i,o,a=r(50424),s=r(55358),c=r(7323),l=r(55642),u=r(47181),d=r(56005),f=r(74186),h=r(43180),p=r(11512),y=r(3300),m=r(74725),v=r(10575),b=r(8326),g=r(26765),k=r(11654),_=(r(13345),r(45122),r(65580),r(88108),r(38707),r(39509),r(48003),r(30879),r(58831)),w=(r(68101),r(43709),r(57292)),E=r(73826);function x(e){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function P(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function D(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,i)}function S(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O(e,t){return(O=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function A(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Z(e);if(t){var i=Z(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return C(this,r)}}function C(e,t){return!t||"object"!==x(t)&&"function"!=typeof t?j(e):t}function j(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function z(){z=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!B(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u<l.length;u++)this.addElementPlacement(l[u],t);r.push.apply(r,l)}}return{element:e,finishers:n,extras:r}},decorateConstructor:function(e,t){for(var r=[],n=t.length-1;n>=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||U(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=L(e.key),n=String(e.placement);if("static"!==n&&"prototype"!==n&&"own"!==n)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+n+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:n,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:F(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=F(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var n=(0,t[r])(e);if(void 0!==n){if("function"!=typeof n)throw new TypeError("Finishers must return a constructor.");e=n}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function I(e){var t,r=L(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var n={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(n.decorators=e.decorators),"field"===e.kind&&(n.initializer=e.value),n}function T(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function B(e){return e.decorators&&e.decorators.length}function R(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function F(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function L(e){var t=function(e,t){if("object"!==x(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==x(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===x(t)?t:String(t)}function U(e,t){if(e){if("string"==typeof e)return M(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?M(e,t):void 0}}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function W(e,t,r){return(W="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Z(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(r):i.value}})(e,t,r||e)}function Z(e){return(Z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var N,Y,H,q,K;!function(e,t,r,n){var i=z();if(n)for(var o=0;o<n.length;o++)i=n[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),r),s=i.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},n=0;n<e.length;n++){var i,o=e[n];if("method"===o.kind&&(i=t.find(r)))if(R(o.descriptor)||R(i.descriptor)){if(B(o)||B(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(B(o)){if(B(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}T(o,i)}else t.push(o)}return t}(a.d.map(I)),e);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,s.Mo)("ha-registry-basic-editor")],(function(e,t){var r,c,l=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&O(e,t)}(n,t);var r=A(n);function n(){var t;S(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=r.call.apply(r,[this].concat(o)),e(j(t)),t}return n}(t);return{F:l,d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"entry",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_origEntityId",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_entityId",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_areaId",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_disabledBy",value:void 0},{kind:"field",key:"_deviceLookup",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_device",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_submitting",value:void 0},{kind:"method",key:"updateEntry",value:(r=regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._submitting=!0,t={new_entity_id:this._entityId.trim(),area_id:this._areaId||null},this.entry.disabled_by===this._disabledBy||null!==this._disabledBy&&"user"!==this._disabledBy||(t.disabled_by=this._disabledBy),e.prev=3,e.next=6,(0,f.Nv)(this.hass,this._origEntityId,t);case 6:(r=e.sent).require_restart&&(0,g.Ys)(this,{text:this.hass.localize("ui.dialogs.entity_registry.editor.enabled_restart_confirm")}),r.reload_delay&&(0,g.Ys)(this,{text:this.hass.localize("ui.dialogs.entity_registry.editor.enabled_delay_confirm","delay",r.reload_delay)});case 9:return e.prev=9,this._submitting=!1,e.finish(9);case 12:case"end":return e.stop()}}),e,this,[[3,,9,12]])})),c=function(){var e=this,t=arguments;return new Promise((function(n,i){var o=r.apply(e,t);function a(e){D(o,n,i,a,s,"next",e)}function s(e){D(o,n,i,a,s,"throw",e)}a(void 0)}))},function(){return c.apply(this,arguments)})},{kind:"method",key:"hassSubscribe",value:function(){var e=this;return[(0,w.q4)(this.hass.connection,(function(t){e._deviceLookup={};var r,n=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=U(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(t);try{for(n.s();!(r=n.n()).done;){var i=r.value;e._deviceLookup[i.id]=i}}catch(o){n.e(o)}finally{n.f()}!e._device&&e.entry.device_id&&(e._device=e._deviceLookup[e.entry.device_id])}))]}},{kind:"method",key:"updated",value:function(e){W(Z(l.prototype),"updated",this).call(this,e),e.has("entry")&&this.entry&&(this._origEntityId=this.entry.entity_id,this._entityId=this.entry.entity_id,this._disabledBy=this.entry.disabled_by,this._areaId=this.entry.area_id,this._device=this.entry.device_id&&this._deviceLookup?this._deviceLookup[this.entry.device_id]:void 0)}},{kind:"method",key:"render",value:function(){var e;if(!this.hass||!this.entry||this.entry.entity_id!==this._origEntityId)return(0,a.dy)(n||(n=P([""])));var t=(0,_.M)(this._entityId.trim())!==(0,_.M)(this.entry.entity_id);return(0,a.dy)(i||(i=P(["\n <paper-input\n .value=","\n @value-changed=","\n .label=",'\n error-message="Domain needs to stay the same"\n .invalid=',"\n .disabled=","\n ></paper-input>\n <ha-area-picker\n .hass=","\n .value=","\n .placeholder=","\n @value-changed=",'\n ></ha-area-picker>\n <div class="row">\n <ha-switch\n .checked=',"\n @change=","\n >\n </ha-switch>\n <div>\n <div>\n ",'\n </div>\n <div class="secondary">\n ',"\n ","\n <br />","\n </div>\n </div>\n </div>\n "])),this._entityId,this._entityIdChanged,this.hass.localize("ui.dialogs.entity_registry.editor.entity_id"),t,this._submitting,this.hass,this._areaId,null===(e=this._device)||void 0===e?void 0:e.area_id,this._areaPicked,!this._disabledBy,this._disabledByChanged,this.hass.localize("ui.dialogs.entity_registry.editor.enabled_label"),this._disabledBy&&"user"!==this._disabledBy?this.hass.localize("ui.dialogs.entity_registry.editor.enabled_cause","cause",this.hass.localize("config_entry.disabled_by.".concat(this._disabledBy))):"",this.hass.localize("ui.dialogs.entity_registry.editor.enabled_description"),this.hass.localize("ui.dialogs.entity_registry.editor.note"))}},{kind:"method",key:"_areaPicked",value:function(e){this._areaId=e.detail.value}},{kind:"method",key:"_entityIdChanged",value:function(e){this._entityId=e.detail.value}},{kind:"method",key:"_disabledByChanged",value:function(e){this._disabledBy=e.target.checked?null:"user"}},{kind:"get",static:!0,key:"styles",value:function(){return(0,a.iv)(o||(o=P(["\n ha-switch {\n margin-right: 16px;\n }\n .row {\n margin-top: 8px;\n color: var(--primary-text-color);\n display: flex;\n align-items: center;\n }\n .secondary {\n color: var(--secondary-text-color);\n }\n "])))}}]}}),(0,E.f)(a.oi));function $(e){return($="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function G(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,i)}function Q(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){G(o,n,i,a,s,"next",e)}function s(e){G(o,n,i,a,s,"throw",e)}a(void 0)}))}}function V(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function X(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J(e,t){return(J=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ee(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=fe(e);if(t){var i=fe(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return te(this,r)}}function te(e,t){return!t||"object"!==$(t)&&"function"!=typeof t?re(e):t}function re(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ne(){ne=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!ae(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u<l.length;u++)this.addElementPlacement(l[u],t);r.push.apply(r,l)}}return{element:e,finishers:n,extras:r}},decorateConstructor:function(e,t){for(var r=[],n=t.length-1;n>=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return ue(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ue(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=le(e.key),n=String(e.placement);if("static"!==n&&"prototype"!==n&&"own"!==n)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+n+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:n,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:ce(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=ce(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var n=(0,t[r])(e);if(void 0!==n){if("function"!=typeof n)throw new TypeError("Finishers must return a constructor.");e=n}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function ie(e){var t,r=le(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var n={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(n.decorators=e.decorators),"field"===e.kind&&(n.initializer=e.value),n}function oe(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function ae(e){return e.decorators&&e.decorators.length}function se(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function ce(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function le(e){var t=function(e,t){if("object"!==$(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==$(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===$(t)?t:String(t)}function ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function de(e,t,r){return(de="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=fe(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(r):i.value}})(e,t,r||e)}function fe(e){return(fe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var he={input_boolean:{fetch:h.Aj,update:h.Xr,delete:h.wO},input_text:{fetch:v.YL,update:v.jt,delete:v.KB},input_number:{fetch:y.K4,update:y.hb,delete:y.fH},input_datetime:{fetch:p.s2,update:p.FF,delete:p.Gi},input_select:{fetch:m.LN,update:m.ON,delete:m.H3},counter:{fetch:d.W2,update:d.Rm,delete:d.YL},timer:{fetch:b.aT,update:b.mZ,delete:b.WH}},pe=function(e,t,r,n){var i=ne();if(n)for(var o=0;o<n.length;o++)i=n[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),r),s=i.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},n=0;n<e.length;n++){var i,o=e[n];if("method"===o.kind&&(i=t.find(r)))if(se(o.descriptor)||se(i.descriptor)){if(ae(o)||ae(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(ae(o)){if(ae(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}oe(o,i)}else t.push(o)}return t}(a.d.map(ie)),e);return i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,s.Mo)("entity-settings-helper-tab")],(function(e,t){var r,n,i,o=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&J(e,t)}(n,t);var r=ee(n);function n(){var t;X(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=r.call.apply(r,[this].concat(o)),e(re(t)),t}return n}(t);return{F:o,d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"entry",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_error",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_item",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_submitting",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_componentLoaded",value:void 0},{kind:"field",decorators:[(0,s.IO)("ha-registry-basic-editor")],key:"_registryEditor",value:void 0},{kind:"method",key:"firstUpdated",value:function(e){de(fe(o.prototype),"firstUpdated",this).call(this,e),this._componentLoaded=(0,c.p)(this.hass,this.entry.platform)}},{kind:"method",key:"updated",value:function(e){de(fe(o.prototype),"updated",this).call(this,e),e.has("entry")&&(this._error=void 0,this._item=void 0,this._getItem())}},{kind:"method",key:"render",value:function(){if(void 0===this._item)return(0,a.dy)(N||(N=V([""])));var e=this.hass.states[this.entry.entity_id];return(0,a.dy)(Y||(Y=V(['\n <div class="form">\n ',"\n ","\n <ha-registry-basic-editor\n .hass=","\n .entry=",'\n ></ha-registry-basic-editor>\n </div>\n <div class="buttons">\n <mwc-button\n class="warning"\n @click=',"\n .disabled=","\n >\n ","\n </mwc-button>\n <mwc-button\n @click=","\n .disabled=","\n >\n ","\n </mwc-button>\n </div>\n "])),this._error?(0,a.dy)(H||(H=V([' <div class="error">',"</div> "])),this._error):"",this._componentLoaded?null===this._item?this.hass.localize("ui.dialogs.helper_settings.yaml_not_editable"):(0,a.dy)(q||(q=V(["\n <span @value-changed=",">\n ","\n </span>\n "])),this._valueChanged,(0,l.h)("ha-".concat(this.entry.platform,"-form"),{hass:this.hass,item:this._item,entry:this.entry})):this.hass.localize("ui.dialogs.helper_settings.platform_not_loaded","platform",this.entry.platform),this.hass,this.entry,this._confirmDeleteItem,this._submitting||!this._item&&!(null!=e&&e.attributes.restored),this.hass.localize("ui.dialogs.entity_registry.editor.delete"),this._updateItem,this._submitting||this._item&&!this._item.name,this.hass.localize("ui.dialogs.entity_registry.editor.update"))}},{kind:"method",key:"_valueChanged",value:function(e){this._error=void 0,this._item=e.detail.value}},{kind:"method",key:"_getItem",value:(i=Q(regeneratorRuntime.mark((function e(){var t,r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,he[this.entry.platform].fetch(this.hass);case 2:t=e.sent,this._item=t.find((function(e){return e.id===r.entry.unique_id}))||null;case 4:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{kind:"method",key:"_updateItem",value:(n=Q(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._submitting=!0,e.prev=1,!this._componentLoaded||!this._item){e.next=5;break}return e.next=5,he[this.entry.platform].update(this.hass,this._item.id,this._item);case 5:return e.next=7,null===(t=this._registryEditor)||void 0===t?void 0:t.updateEntry();case 7:(0,u.B)(this,"close-dialog"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(1),this._error=e.t0.message||"Unknown error";case 13:return e.prev=13,this._submitting=!1,e.finish(13);case 16:case"end":return e.stop()}}),e,this,[[1,10,13,16]])}))),function(){return n.apply(this,arguments)})},{kind:"method",key:"_confirmDeleteItem",value:(r=Q(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,g.g7)(this,{text:this.hass.localize("ui.dialogs.entity_registry.editor.confirm_delete")});case 2:if(e.sent){e.next=4;break}return e.abrupt("return");case 4:if(this._submitting=!0,e.prev=5,!this._componentLoaded||!this._item){e.next=11;break}return e.next=9,he[this.entry.platform].delete(this.hass,this._item.id);case 9:e.next=16;break;case 11:if(null!=(t=this.hass.states[this.entry.entity_id])&&t.attributes.restored){e.next=14;break}return e.abrupt("return");case 14:return e.next=16,(0,f.z3)(this.hass,this.entry.entity_id);case 16:(0,u.B)(this,"close-dialog");case 17:return e.prev=17,this._submitting=!1,e.finish(17);case 20:case"end":return e.stop()}}),e,this,[[5,,17,20]])}))),function(){return r.apply(this,arguments)})},{kind:"get",static:!0,key:"styles",value:function(){return[k.Qx,(0,a.iv)(K||(K=V(["\n :host {\n display: block;\n padding: 0 !important;\n }\n .form {\n padding: 20px 24px;\n margin-bottom: 53px;\n }\n .buttons {\n position: absolute;\n bottom: 0;\n width: 100%;\n box-sizing: border-box;\n border-top: 1px solid\n var(--mdc-dialog-scroll-divider-color, rgba(0, 0, 0, 0.12));\n display: flex;\n justify-content: space-between;\n padding: 8px;\n background-color: var(--mdc-theme-surface, #fff);\n }\n .error {\n color: var(--error-color);\n margin-bottom: 8px;\n }\n .row {\n margin-top: 8px;\n color: var(--primary-text-color);\n }\n .secondary {\n color: var(--secondary-text-color);\n }\n "])))]}}]}}),a.oi)}}]);
//# sourceMappingURL=chunk.f051aec23244c301cd7a.js.map