ha-supervisor/supervisor/api/panel/frontend_es5/f25a18df.js

1 line
34 KiB
JavaScript

"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[552],{4552:function(e,t,r){var n=r(37500),i=r(26767),o=r(5701),a=r(63864),s=r(14516);r(29607);(0,s.Z)((function(e){return new Intl.DateTimeFormat(e.language,{weekday:"long",month:"long",day:"numeric"})}));var l=(0,s.Z)((function(e){return new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric"})})),c=((0,s.Z)((function(e){return new Intl.DateTimeFormat(e.language,{year:"numeric",month:"numeric",day:"numeric"})})),(0,s.Z)((function(e){return new Intl.DateTimeFormat(e.language,{day:"numeric",month:"short"})})),(0,s.Z)((function(e){return new Intl.DateTimeFormat(e.language,{month:"long",year:"numeric"})})),(0,s.Z)((function(e){return new Intl.DateTimeFormat(e.language,{month:"long"})})),(0,s.Z)((function(e){return new Intl.DateTimeFormat(e.language,{year:"numeric"})})),r(66477)),u=(0,s.Z)((function(e){if(e.time_format===c.zt.language||e.time_format===c.zt.system){var t=e.time_format===c.zt.language?e.language:void 0,r=(new Date).toLocaleString(t);return r.includes("AM")||r.includes("PM")}return e.time_format===c.zt.am_pm}));var d,f,p,h,m,y=(0,s.Z)((function(e){return new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:u(e)?"numeric":"2-digit",minute:"2-digit",hour12:u(e)})}));(0,s.Z)((function(e){return new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:u(e)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hour12:u(e)})})),(0,s.Z)((function(e){return new Intl.DateTimeFormat(e.language,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit",hour12:u(e)})})),r(12497),r(83927),r(14678),r(52039);function v(e){return v="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},v(e)}function b(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function k(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){return g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},g(e,t)}function w(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=C(e);if(t){var i=C(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return E(this,r)}}function E(e,t){if(t&&("object"===v(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return P(e)}function P(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function C(e){return C=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},C(e)}function A(){A=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(!_(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),l=this.toElementFinisherExtras((0,i[o])(s)||s);e=l.element,this.addElementPlacement(e,t),l.finisher&&n.push(l.finisher);var c=l.extras;if(c){for(var u=0;u<c.length;u++)this.addElementPlacement(c[u],t);r.push.apply(r,c)}}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 O(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)?O(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=z(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:D(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=D(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 T(e){var t,r=z(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 x(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function _(e){return e.decorators&&e.decorators.length}function S(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function D(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 z(e){var t=function(e,t){if("object"!==v(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==v(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===v(t)?t:String(t)}function O(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}var j,H,F,V,R,I,M,L,Z,B,U,N,$,q,G,J,K,Q,W;!function(e,t,r,n){var i=A();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(S(o.descriptor)||S(i.descriptor)){if(_(o)||_(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(_(o)){if(_(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}x(o,i)}else t.push(o)}return t}(a.d.map(T)),e);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,i.M)("supervisor-formfield-label")],(function(e,t){var r=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&&g(e,t)}(n,t);var r=w(n);function n(){var t;k(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(P(t)),t}return n}(t);return{F:r,d:[{kind:"field",decorators:[(0,o.C)({type:String})],key:"label",value:void 0},{kind:"field",decorators:[(0,o.C)({type:String})],key:"imageUrl",value:void 0},{kind:"field",decorators:[(0,o.C)({type:String})],key:"iconPath",value:void 0},{kind:"field",decorators:[(0,o.C)({type:String})],key:"version",value:void 0},{kind:"method",key:"render",value:function(){return(0,n.dy)(d||(d=b(["\n ",'\n <span class="label">',"</span>\n ","\n "])),this.imageUrl?(0,n.dy)(f||(f=b(['<img loading="lazy" .src=',' class="icon" />'])),this.imageUrl):this.iconPath?(0,n.dy)(p||(p=b(["<ha-svg-icon .path=",' class="icon"></ha-svg-icon>'])),this.iconPath):"",this.label,this.version?(0,n.dy)(h||(h=b(['<span class="version">(',")</span>"])),this.version):"")}},{kind:"get",static:!0,key:"styles",value:function(){return(0,n.iv)(m||(m=b(["\n :host {\n display: flex;\n align-items: center;\n }\n .label {\n margin-right: 4px;\n }\n .version {\n color: var(--secondary-text-color);\n }\n .icon {\n max-height: 22px;\n max-width: 22px;\n margin-right: 8px;\n }\n "])))}}]}}),n.oi);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},X(e)}function Y(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function te(e,t){return te=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},te(e,t)}function re(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=he(e);if(t){var i=he(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ne(this,r)}}function ne(e,t){if(t&&("object"===X(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ie(e)}function ie(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oe(){oe=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(!le(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),l=this.toElementFinisherExtras((0,i[o])(s)||s);e=l.element,this.addElementPlacement(e,t),l.finisher&&n.push(l.finisher);var c=l.extras;if(c){for(var u=0;u<c.length;u++)this.addElementPlacement(c[u],t);r.push.apply(r,c)}}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 fe(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)?fe(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=de(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:ue(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=ue(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 ae(e){var t,r=de(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 se(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function le(e){return e.decorators&&e.decorators.length}function ce(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function ue(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 de(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 fe(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 pe(e,t,r){return pe="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=he(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(r):i.value}},pe(e,t,r||e)}function he(e){return he=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},he(e)}var me="M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z",ye="M20.5,11H19V7C19,5.89 18.1,5 17,5H13V3.5A2.5,2.5 0 0,0 10.5,1A2.5,2.5 0 0,0 8,3.5V5H4A2,2 0 0,0 2,7V10.8H3.5C5,10.8 6.2,12 6.2,13.5C6.2,15 5,16.2 3.5,16.2H2V20A2,2 0 0,0 4,22H7.8V20.5C7.8,19 9,17.8 10.5,17.8C12,17.8 13.2,19 13.2,20.5V22H17A2,2 0 0,0 19,20V16H20.5A2.5,2.5 0 0,0 23,13.5A2.5,2.5 0 0,0 20.5,11Z";!function(e,t,r,n){var i=oe();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(ce(o.descriptor)||ce(i.descriptor)){if(le(o)||le(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(le(o)){if(le(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}se(o,i)}else t.push(o)}return t}(a.d.map(ae)),e);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,i.M)("supervisor-backup-content")],(function(e,t){var r=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&&te(e,t)}(n,t);var r=re(n);function n(){var t;ee(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(ie(t)),t}return n}(t);return{F:r,d:[{kind:"field",decorators:[(0,o.C)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.C)()],key:"localize",value:void 0},{kind:"field",decorators:[(0,o.C)({attribute:!1})],key:"supervisor",value:void 0},{kind:"field",decorators:[(0,o.C)({attribute:!1})],key:"backup",value:void 0},{kind:"field",decorators:[(0,o.C)()],key:"backupType",value:function(){return"full"}},{kind:"field",decorators:[(0,o.C)({attribute:!1})],key:"folders",value:void 0},{kind:"field",decorators:[(0,o.C)({attribute:!1})],key:"addons",value:void 0},{kind:"field",decorators:[(0,o.C)({type:Boolean})],key:"homeAssistant",value:function(){return!1}},{kind:"field",decorators:[(0,o.C)({type:Boolean})],key:"backupHasPassword",value:function(){return!1}},{kind:"field",decorators:[(0,o.C)({type:Boolean})],key:"onboarding",value:function(){return!1}},{kind:"field",decorators:[(0,o.C)()],key:"backupName",value:function(){return""}},{kind:"field",decorators:[(0,o.C)()],key:"backupPassword",value:function(){return""}},{kind:"field",decorators:[(0,o.C)()],key:"confirmBackupPassword",value:function(){return""}},{kind:"method",key:"willUpdate",value:function(e){var t,n,i,o,a,s;(pe(he(r.prototype),"willUpdate",this).call(this,e),this.hasUpdated)||(this.folders=(a=this.backup?this.backup.folders:["homeassistant","ssl","share","media","addons/local"],s=[],a.includes("homeassistant")&&s.push({slug:"homeassistant",name:"Home Assistant configuration",checked:!1}),a.includes("ssl")&&s.push({slug:"ssl",name:"SSL",checked:!1}),a.includes("share")&&s.push({slug:"share",name:"Share",checked:!1}),a.includes("media")&&s.push({slug:"media",name:"Media",checked:!1}),a.includes("addons/local")&&s.push({slug:"addons/local",name:"Local add-ons",checked:!1}),s.sort((function(e,t){return e.name>t.name?1:-1}))),this.addons=(this.backup?this.backup.addons:null===(t=this.supervisor)||void 0===t?void 0:t.supervisor.addons).map((function(e){return{slug:e.slug,name:e.name,version:e.version,checked:!1}})).sort((function(e,t){return e.name>t.name?1:-1})),this.backupType=(null===(n=this.backup)||void 0===n?void 0:n.type)||"full",this.backupName=(null===(i=this.backup)||void 0===i?void 0:i.name)||"",this.backupHasPassword=(null===(o=this.backup)||void 0===o?void 0:o.protected)||!1)}},{kind:"field",key:"_localize",value:function(){var e=this;return function(t){var r;return(null===(r=e.supervisor)||void 0===r?void 0:r.localize("backup.".concat(t)))||e.localize("ui.panel.page-onboarding.restore.".concat(t))}}},{kind:"method",key:"render",value:function(){if(!this.onboarding&&!this.supervisor)return(0,n.dy)(j||(j=Y([""])));var e,t,r="partial"===this.backupType?this._getSection("folders"):void 0,i="partial"===this.backupType?this._getSection("addons"):void 0;return(0,n.dy)(H||(H=Y(["\n ","\n ","\n ","\n ","\n ","\n ","\n "])),this.backup?(0,n.dy)(F||(F=Y(['<div class="details">\n ',"\n (",")<br />\n ","\n </div>"])),"full"===this.backup.type?this._localize("full_backup"):this._localize("partial_backup"),Math.ceil(10*this.backup.size)/10+" MB",this.hass?(e=new Date(this.backup.date),t=this.hass.locale,y(t).format(e)):this.backup.date):(0,n.dy)(V||(V=Y(['<paper-input\n name="backupName"\n .label=',"\n .value=","\n @value-changed=","\n >\n </paper-input>"])),this._localize("name"),this.backupName,this._handleTextValueChanged),this.backup&&"full"!==this.backup.type?"":(0,n.dy)(R||(R=Y(['<div class="sub-header">\n ','\n </div>\n <div class="backup-types">\n <ha-formfield .label=',">\n <ha-radio\n @change=",'\n value="full"\n name="backupType"\n .checked=',"\n >\n </ha-radio>\n </ha-formfield>\n <ha-formfield .label=",">\n <ha-radio\n @change=",'\n value="partial"\n name="backupType"\n .checked=',"\n >\n </ha-radio>\n </ha-formfield>\n </div>"])),this.backup?this._localize("select_type"):this._localize("type"),this._localize("full_backup"),this._handleRadioValueChanged,"full"===this.backupType,this._localize("partial_backup"),this._handleRadioValueChanged,"partial"===this.backupType),"partial"===this.backupType?(0,n.dy)(I||(I=Y(['<div class="partial-picker">\n ',"\n ","\n ","\n </div> "])),this.backup&&this.backup.homeassistant?(0,n.dy)(M||(M=Y(["\n <ha-formfield\n .label=","\n >\n <ha-checkbox\n .checked=","\n @click=","\n >\n </ha-checkbox>\n </ha-formfield>\n "])),(0,n.dy)(L||(L=Y(['<supervisor-formfield-label\n label="Home Assistant"\n .iconPath=',"\n .version=","\n >\n </supervisor-formfield-label>"])),"M21.8,13H20V21H13V17.67L15.79,14.88L16.5,15C17.66,15 18.6,14.06 18.6,12.9C18.6,11.74 17.66,10.8 16.5,10.8A2.1,2.1 0 0,0 14.4,12.9L14.5,13.61L13,15.13V9.65C13.66,9.29 14.1,8.6 14.1,7.8A2.1,2.1 0 0,0 12,5.7A2.1,2.1 0 0,0 9.9,7.8C9.9,8.6 10.34,9.29 11,9.65V15.13L9.5,13.61L9.6,12.9A2.1,2.1 0 0,0 7.5,10.8A2.1,2.1 0 0,0 5.4,12.9A2.1,2.1 0 0,0 7.5,15L8.21,14.88L11,17.67V21H4V13H2.25C1.83,13 1.42,13 1.42,12.79C1.43,12.57 1.85,12.15 2.28,11.72L11,3C11.33,2.67 11.67,2.33 12,2.33C12.33,2.33 12.67,2.67 13,3L17,7V6H19V9L21.78,11.78C22.18,12.18 22.59,12.59 22.6,12.8C22.6,13 22.2,13 21.8,13M7.5,12A0.9,0.9 0 0,1 8.4,12.9A0.9,0.9 0 0,1 7.5,13.8A0.9,0.9 0 0,1 6.6,12.9A0.9,0.9 0 0,1 7.5,12M16.5,12C17,12 17.4,12.4 17.4,12.9C17.4,13.4 17,13.8 16.5,13.8A0.9,0.9 0 0,1 15.6,12.9A0.9,0.9 0 0,1 16.5,12M12,6.9C12.5,6.9 12.9,7.3 12.9,7.8C12.9,8.3 12.5,8.7 12,8.7C11.5,8.7 11.1,8.3 11.1,7.8C11.1,7.3 11.5,6.9 12,6.9Z",this.backup.homeassistant),this.homeAssistant,this.toggleHomeAssistant):"",null!=r&&r.templates.length?(0,n.dy)(Z||(Z=Y(["\n <ha-formfield\n .label=","\n >\n <ha-checkbox\n @change=","\n .checked=","\n .indeterminate=","\n .section=",'\n >\n </ha-checkbox>\n </ha-formfield>\n <div class="section-content">',"</div>\n "])),(0,n.dy)(B||(B=Y(["<supervisor-formfield-label\n .label=","\n .iconPath=","\n >\n </supervisor-formfield-label>"])),this._localize("folders"),me),this._toggleSection,r.checked,r.indeterminate,"folders",r.templates):"",null!=i&&i.templates.length?(0,n.dy)(U||(U=Y(["\n <ha-formfield\n .label=","\n >\n <ha-checkbox\n @change=","\n .checked=","\n .indeterminate=","\n .section=",'\n >\n </ha-checkbox>\n </ha-formfield>\n <div class="section-content">',"</div>\n "])),(0,n.dy)(N||(N=Y(["<supervisor-formfield-label\n .label=","\n .iconPath=","\n >\n </supervisor-formfield-label>"])),this._localize("addons"),ye),this._toggleSection,i.checked,i.indeterminate,"addons",i.templates):""):"","partial"!==this.backupType||this.backup&&!this.backupHasPassword?"":(0,n.dy)($||($=Y(["<hr />"]))),this.backup?"":(0,n.dy)(q||(q=Y(['<ha-formfield\n class="password"\n .label=',"\n >\n <ha-checkbox\n .checked=","\n @change=","\n >\n </ha-checkbox>\n </ha-formfield>"])),this._localize("password_protection"),this.backupHasPassword,this._toggleHasPassword),this.backupHasPassword?(0,n.dy)(G||(G=Y(["\n <paper-input\n .label=",'\n type="password"\n name="backupPassword"\n .value=',"\n @value-changed=","\n >\n </paper-input>\n ","\n "])),this._localize("password"),this.backupPassword,this._handleTextValueChanged,this.backup?"":(0,n.dy)(J||(J=Y([" <paper-input\n .label=",'\n type="password"\n name="confirmBackupPassword"\n .value=',"\n @value-changed=","\n >\n </paper-input>"])),this._localize("confirm_password"),this.confirmBackupPassword,this._handleTextValueChanged)):"")}},{kind:"method",key:"toggleHomeAssistant",value:function(){this.homeAssistant=!this.homeAssistant}},{kind:"get",static:!0,key:"styles",value:function(){return(0,n.iv)(K||(K=Y(["\n .partial-picker ha-formfield {\n display: block;\n }\n .partial-picker ha-checkbox {\n --mdc-checkbox-touch-target-size: 32px;\n }\n .partial-picker {\n display: block;\n margin: 0px -6px;\n }\n supervisor-formfield-label {\n display: inline-flex;\n align-items: center;\n }\n hr {\n border-color: var(--divider-color);\n border-bottom: none;\n margin: 16px 0;\n }\n .details {\n color: var(--secondary-text-color);\n }\n .section-content {\n display: flex;\n flex-direction: column;\n margin-left: 30px;\n }\n ha-formfield.password {\n display: block;\n margin: 0 -14px -16px;\n }\n .backup-types {\n display: flex;\n margin-left: -13px;\n }\n .sub-header {\n margin-top: 8px;\n }\n "])))}},{kind:"method",key:"backupDetails",value:function(){var e,t,r,n,i={};if(this.backup||(i.name=this.backupName||(r=new Date,n=this.hass.locale,l(n).format(r))),this.backupHasPassword&&(i.password=this.backupPassword,this.backup||(i.confirm_password=this.confirmBackupPassword)),"full"===this.backupType)return i;var o=null===(e=this.addons)||void 0===e?void 0:e.filter((function(e){return e.checked})).map((function(e){return e.slug})),a=null===(t=this.folders)||void 0===t?void 0:t.filter((function(e){return e.checked})).map((function(e){return e.slug}));return null!=o&&o.length&&(i.addons=o),null!=a&&a.length&&(i.folders=a),i.homeassistant=this.homeAssistant,i}},{kind:"method",key:"_getSection",value:function(e){var t,r=this,i=[],o="addons"===e?new Map(null===(t=this.supervisor)||void 0===t?void 0:t.addon.addons.map((function(e){return[e.slug,e]}))):void 0,s=0;this[e].forEach((function(t){var l;i.push((0,n.dy)(Q||(Q=Y(["<ha-formfield\n .label=","\n >\n <ha-checkbox\n .item=","\n .checked=","\n .section=","\n @change=","\n >\n </ha-checkbox>\n </ha-formfield>"])),(0,n.dy)(W||(W=Y(["<supervisor-formfield-label\n .label=","\n .iconPath=","\n .imageUrl=","\n .version=","\n >\n </supervisor-formfield-label>"])),t.name,"addons"===e?ye:me,"addons"===e&&!r.onboarding&&(0,a.I)(r.hass.config.version,0,105)&&null!=o&&null!==(l=o.get(t.slug))&&void 0!==l&&l.icon?"/api/hassio/addons/".concat(t.slug,"/icon"):void 0,t.version),t,t.checked,e,r._updateSectionEntry)),t.checked&&s++}));var l=s===this[e].length;return{templates:i,checked:l,indeterminate:!l&&0!==s}}},{kind:"method",key:"_handleRadioValueChanged",value:function(e){var t=e.currentTarget;this[t.name]=t.value}},{kind:"method",key:"_handleTextValueChanged",value:function(e){this[e.currentTarget.name]=e.detail.value}},{kind:"method",key:"_toggleHasPassword",value:function(){this.backupHasPassword=!this.backupHasPassword}},{kind:"method",key:"_toggleSection",value:function(e){var t=e.currentTarget.section;this[t]=("addons"===t?this.addons:this.folders).map((function(t){return Object.assign({},t,{checked:e.currentTarget.checked})}))}},{kind:"method",key:"_updateSectionEntry",value:function(e){var t=e.currentTarget.item,r=e.currentTarget.section;this[r]=this[r].map((function(r){return r.slug===t.slug?Object.assign({},r,{checked:e.currentTarget.checked}):r}))}}]}}),n.oi)}}]);