iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 105 kB
JavaScript
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[9769],{26885:function(e,t,r){"use strict";r.r(t);r(87724);var n,i,o,s,a,c=r(68546),l=r(50424),u=r(55358),d=r(47181),f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"_",r="àáäâãåăæąçćčđďèéěėëêęğǵḧìíïîįłḿǹńňñòóöôœøṕŕřßşśšșťțùúüûǘůűūųẃẍÿýźžż·/_,:;",n="aaaaaaaaacccddeeeeeeegghiiiiilmnnnnooooooprrsssssttuuuuuuuuuwxyyzzz".concat(t).concat(t).concat(t).concat(t).concat(t).concat(t),i=new RegExp(r.split("").join("|"),"g");return e.toString().toLowerCase().replace(/\s+/g,t).replace(i,(function(e){return n.charAt(r.indexOf(e))})).replace(/&/g,"".concat(t,"and").concat(t)).replace(/[^\w-]+/g,"").replace(/-/,t).replace(new RegExp("/".concat(t).concat(t,"+/"),"g"),t).replace(new RegExp("/^".concat(t,"+/")),"").replace(new RegExp("/-+$/"),"")},p=(r(98762),r(81545),r(34821)),h=(r(52039),r(22814)),m=r(41682),y=r(77097),v=r(26765),b=r(11654),g=r(63864),w=r(12198),k=r(44583);r(32511),r(83927),r(33220);function E(e){return(E="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 S(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x(e,t){return(x=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function O(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=A(e);if(t){var i=A(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"!==E(t)&&"function"!=typeof t?D(e):t}function D(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function A(e){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function T(){T=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(!z(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 s=t[e.placement];s.splice(s.indexOf(e.key),1);var a=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(a)||a);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 s=0;s<e.length-1;s++)for(var a=s+1;a<e.length;a++)if(e[s].key===e[a].key&&e[s].placement===e[a].placement)throw new TypeError("Duplicated element ("+e[s].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 B(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)?B(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=I(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 _(e){var t,r=I(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 j(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function z(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 I(e){var t=function(e,t){if("object"!==E(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==E(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===E(t)?t:String(t)}function B(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 M,U,N,H,L,$,V,Y,Z,W,J,Q,X,q,G,K,ee,te;!function(e,t,r,n){var i=T();if(n)for(var o=0;o<n.length;o++)i=n[o](i);var s=t((function(e){i.initializeInstanceElements(e,a.elements)}),r),a=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(z(o)||z(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(z(o)){if(z(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}j(o,i)}else t.push(o)}return t}(s.d.map(_)),e);i.initializeClassElements(s.F,a.elements),i.runClassFinishers(s.F,a.finishers)}([(0,u.Mo)("supervisor-formfield-label")],(function(e,t){return{F: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&&x(e,t)}(n,t);var r=O(n);function n(){var t;S(this,n);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return t=r.call.apply(r,[this].concat(o)),e(D(t)),t}return n}(t),d:[{kind:"field",decorators:[(0,u.Cb)({type:String})],key:"label",value:void 0},{kind:"field",decorators:[(0,u.Cb)({type:String})],key:"imageUrl",value:void 0},{kind:"field",decorators:[(0,u.Cb)({type:String})],key:"iconPath",value:void 0},{kind:"field",decorators:[(0,u.Cb)({type:String})],key:"version",value:void 0},{kind:"method",key:"render",value:function(){return(0,l.dy)(n||(n=P(["\n ",'\n <span class="label">',"</span>\n ","\n "])),this.imageUrl?(0,l.dy)(i||(i=P(['<img loading="lazy" .src=',' class="icon" />'])),this.imageUrl):this.iconPath?(0,l.dy)(o||(o=P(["<ha-svg-icon .path=",' class="icon"></ha-svg-icon>'])),this.iconPath):"",this.label,this.version?(0,l.dy)(s||(s=P(['<span class="version">(',")</span>"])),this.version):"")}},{kind:"get",static:!0,key:"styles",value:function(){return(0,l.iv)(a||(a=P(["\n :host {\n cursor: pointer;\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 "])))}}]}}),l.oi);function re(e){return(re="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 ne(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oe(e,t){return(oe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function se(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=be(e);if(t){var i=be(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ae(this,r)}}function ae(e,t){return!t||"object"!==re(t)&&"function"!=typeof t?ce(e):t}function ce(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function le(){le=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(!fe(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 s=t[e.placement];s.splice(s.indexOf(e.key),1);var a=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(a)||a);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 s=0;s<e.length-1;s++)for(var a=s+1;a<e.length;a++)if(e[s].key===e[a].key&&e[s].placement===e[a].placement)throw new TypeError("Duplicated element ("+e[s].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 ye(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)?ye(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=me(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:he(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=he(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 ue(e){var t,r=me(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 de(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function fe(e){return e.decorators&&e.decorators.length}function pe(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function he(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 me(e){var t=function(e,t){if("object"!==re(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==re(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===re(t)?t:String(t)}function ye(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 ve(e,t,r){return(ve="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=be(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 be(e){return(be=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ge,we,ke,Ee,Pe,Se;!function(e,t,r,n){var i=le();if(n)for(var o=0;o<n.length;o++)i=n[o](i);var s=t((function(e){i.initializeInstanceElements(e,a.elements)}),r),a=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(pe(o.descriptor)||pe(i.descriptor)){if(fe(o)||fe(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(fe(o)){if(fe(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}de(o,i)}else t.push(o)}return t}(s.d.map(ue)),e);i.initializeClassElements(s.F,a.elements),i.runClassFinishers(s.F,a.finishers)}([(0,u.Mo)("supervisor-snapshot-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&&oe(e,t)}(n,t);var r=se(n);function n(){var t;ie(this,n);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return t=r.call.apply(r,[this].concat(o)),e(ce(t)),t}return n}(t);return{F:r,d:[{kind:"field",decorators:[(0,u.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,u.Cb)({attribute:!1})],key:"supervisor",value:void 0},{kind:"field",decorators:[(0,u.Cb)({attribute:!1})],key:"snapshot",value:void 0},{kind:"field",decorators:[(0,u.Cb)()],key:"snapshotType",value:function(){return"full"}},{kind:"field",decorators:[(0,u.Cb)({attribute:!1})],key:"folders",value:void 0},{kind:"field",decorators:[(0,u.Cb)({attribute:!1})],key:"addons",value:void 0},{kind:"field",decorators:[(0,u.Cb)({type:Boolean})],key:"homeAssistant",value:function(){return!1}},{kind:"field",decorators:[(0,u.Cb)({type:Boolean})],key:"snapshotHasPassword",value:function(){return!1}},{kind:"field",decorators:[(0,u.Cb)()],key:"snapshotName",value:function(){return""}},{kind:"field",decorators:[(0,u.Cb)()],key:"snapshotPassword",value:function(){return""}},{kind:"method",key:"willUpdate",value:function(e){var t,n,i,o,s,a;(ve(be(r.prototype),"willUpdate",this).call(this,e),this.hasUpdated)||(this.folders=(s=this.snapshot?this.snapshot.folders:["homeassistant","ssl","share","media","addons/local"],a=[],s.includes("homeassistant")&&a.push({slug:"homeassistant",name:"ioBroker configuration",checked:!1}),s.includes("ssl")&&a.push({slug:"ssl",name:"SSL",checked:!1}),s.includes("share")&&a.push({slug:"share",name:"Share",checked:!1}),s.includes("media")&&a.push({slug:"media",name:"Media",checked:!1}),s.includes("addons/local")&&a.push({slug:"addons/local",name:"Local add-ons",checked:!1}),a.sort((function(e,t){return e.name>t.name?1:-1}))),this.addons=(this.snapshot?this.snapshot.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.snapshotType=(null===(n=this.snapshot)||void 0===n?void 0:n.type)||"full",this.snapshotName=(null===(i=this.snapshot)||void 0===i?void 0:i.name)||"",this.snapshotHasPassword=(null===(o=this.snapshot)||void 0===o?void 0:o.protected)||!1)}},{kind:"method",key:"render",value:function(){var e=this;if(!this.supervisor)return(0,l.dy)(M||(M=ne([""])));var t="partial"===this.snapshotType?this._getSection("folders"):void 0,r="partial"===this.snapshotType?this._getSection("addons"):void 0;return(0,l.dy)(U||(U=ne(["\n ","\n ","\n ","\n ","\n ","\n ","\n "])),this.snapshot?(0,l.dy)(N||(N=ne(['<div class="details">\n ',"\n (",")<br />\n ","\n </div>"])),"full"===this.snapshot.type?this.supervisor.localize("snapshot.full_snapshot"):this.supervisor.localize("snapshot.partial_snapshot"),Math.ceil(10*this.snapshot.size)/10+" MB",(0,k.o)(new Date(this.snapshot.date),this.hass.locale)):(0,l.dy)(H||(H=ne(['<paper-input\n name="snapshotName"\n .label=',"\n .value=","\n @value-changed=","\n >\n </paper-input>"])),this.supervisor.localize("snapshot.name"),this.snapshotName,this._handleTextValueChanged),this.snapshot&&"full"!==this.snapshot.type?"":(0,l.dy)(L||(L=ne(['<div class="sub-header">\n ','\n </div>\n <div class="snapshot-types">\n <ha-formfield\n .label=',"\n >\n <ha-radio\n @change=",'\n value="full"\n name="snapshotType"\n .checked=',"\n >\n </ha-radio>\n </ha-formfield>\n <ha-formfield\n .label=","\n >\n <ha-radio\n @change=",'\n value="partial"\n name="snapshotType"\n .checked=',"\n >\n </ha-radio>\n </ha-formfield>\n </div>"])),this.snapshot?this.supervisor.localize("snapshot.select_type"):this.supervisor.localize("snapshot.type"),this.supervisor.localize("snapshot.full_snapshot"),this._handleRadioValueChanged,"full"===this.snapshotType,this.supervisor.localize("snapshot.partial_snapshot"),this._handleRadioValueChanged,"partial"===this.snapshotType),this.snapshot&&"partial"===this.snapshotType?(0,l.dy)($||($=ne(["\n ","\n "])),this.snapshot.homeassistant?(0,l.dy)(V||(V=ne(["\n <ha-formfield\n .label=","\n >\n <ha-checkbox\n .checked=","\n @click=","\n >\n </ha-checkbox>\n </ha-formfield>\n "])),(0,l.dy)(Y||(Y=ne(['<supervisor-formfield-label\n label="ioBroker"\n .iconPath=',"\n .version=","\n >\n </supervisor-formfield-label>"])),c.T__,this.snapshot.homeassistant),this.homeAssistant,(function(){e.homeAssistant=!e.homeAssistant})):""):"","partial"===this.snapshotType?(0,l.dy)(Z||(Z=ne(["\n ","\n ","\n "])),null!=t&&t.templates.length?(0,l.dy)(W||(W=ne(["\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,l.dy)(J||(J=ne(["<supervisor-formfield-label\n .label=","\n .iconPath=","\n >\n </supervisor-formfield-label>"])),this.supervisor.localize("snapshot.folders"),c.in3),this._toggleSection,t.checked,t.indeterminate,"folders",t.templates):"",null!=r&&r.templates.length?(0,l.dy)(Q||(Q=ne(["\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,l.dy)(X||(X=ne(["<supervisor-formfield-label\n .label=","\n .iconPath=","\n >\n </supervisor-formfield-label>"])),this.supervisor.localize("snapshot.addons"),c.$Z0),this._toggleSection,r.checked,r.indeterminate,"addons",r.templates):""):"",this.snapshot?"":(0,l.dy)(q||(q=ne(["<ha-formfield\n .label=","\n >\n <ha-checkbox\n .checked=","\n @change=","\n >\n </ha-checkbox\n ></ha-formfield>"])),this.supervisor.localize("snapshot.password_protection"),this.snapshotHasPassword,this._toggleHasPassword),this.snapshotHasPassword?(0,l.dy)(G||(G=ne(["\n <paper-input\n .label=",'\n type="password"\n name="snapshotPassword"\n .value=',"\n @value-changed=","\n >\n </paper-input>\n "])),this.supervisor.localize("snapshot.password"),this.snapshotPassword,this._handleTextValueChanged):"")}},{kind:"get",static:!0,key:"styles",value:function(){return(0,l.iv)(K||(K=ne(['\n ha-checkbox {\n --mdc-checkbox-touch-target-size: 16px;\n display: block;\n margin: 4px 12px 8px 0;\n }\n ha-formfield {\n display: contents;\n }\n supervisor-formfield-label {\n display: inline-flex;\n align-items: center;\n }\n paper-input[type="password"] {\n display: block;\n margin: 4px 0 4px 16px;\n }\n .details {\n color: var(--secondary-text-color);\n }\n .section-content {\n display: flex;\n flex-direction: column;\n margin-left: 16px;\n }\n .security {\n margin-top: 16px;\n }\n .snapshot-types {\n display: flex;\n }\n .sub-header {\n margin-top: 8px;\n }\n '])))}},{kind:"method",key:"snapshotDetails",value:function(){var e,t,r={};if(this.snapshot||(r.name=this.snapshotName||(0,w.p)(new Date,this.hass.locale)),this.snapshotHasPassword&&(r.password=this.snapshotPassword),"full"===this.snapshotType)return r;var n=null===(e=this.addons)||void 0===e?void 0:e.filter((function(e){return e.checked})).map((function(e){return e.slug})),i=null===(t=this.folders)||void 0===t?void 0:t.filter((function(e){return e.checked})).map((function(e){return e.slug}));return null!=n&&n.length&&(r.addons=n),null!=i&&i.length&&(r.folders=i),this.homeAssistant&&(r.homeassistant=this.homeAssistant),r}},{kind:"method",key:"_getSection",value:function(e){var t=this,r=[],n="addons"===e?new Map(this.supervisor.addon.addons.map((function(e){return[e.slug,e]}))):void 0,i=0;this[e].forEach((function(o){var s;r.push((0,l.dy)(ee||(ee=ne(["<ha-formfield\n .label=","\n >\n <ha-checkbox\n .item=","\n .checked=","\n .section=","\n @change=","\n >\n </ha-checkbox>\n </ha-formfield>"])),(0,l.dy)(te||(te=ne(["<supervisor-formfield-label\n .label=","\n .iconPath=","\n .imageUrl=","\n .version=","\n >\n </supervisor-formfield-label>"])),o.name,"addons"===e?c.$Z0:c.in3,"addons"===e&&(0,g.I)(t.hass.config.version,0,105)&&null!=n&&null!==(s=n.get(o.slug))&&void 0!==s&&s.icon?"/api/hassio/addons/".concat(o.slug,"/icon"):void 0,o.version),o,o.checked,e,t._updateSectionEntry)),o.checked&&i++}));var o=i===this[e].length;return{templates:r,checked:o,indeterminate:!o&&0!==i}}},{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.snapshotHasPassword=!this.snapshotHasPassword}},{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}))}}]}}),l.oi);function xe(e){return(xe="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 Oe(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Ce(e,t,r,n,i,o,s){try{var a=e[o](s),c=a.value}catch(l){return void r(l)}a.done?t(c):Promise.resolve(c).then(n,i)}function De(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function s(e){Ce(o,n,i,s,a,"next",e)}function a(e){Ce(o,n,i,s,a,"throw",e)}s(void 0)}))}}function Ae(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})(e,t)}function _e(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=Re(e);if(t){var i=Re(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return je(this,r)}}function je(e,t){return!t||"object"!==xe(t)&&"function"!=typeof t?ze(e):t}function ze(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Re(e){return(Re=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Fe(){Fe=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(!Me(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 s=t[e.placement];s.splice(s.indexOf(e.key),1);var a=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(a)||a);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 s=0;s<e.length-1;s++)for(var a=s+1;a<e.length;a++)if(e[s].key===e[a].key&&e[s].placement===e[a].placement)throw new TypeError("Duplicated element ("+e[s].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 Le(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)?Le(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=He(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:Ne(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=Ne(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=He(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 Be(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function Me(e){return e.decorators&&e.decorators.length}function Ue(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function Ne(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 He(e){var t=function(e,t){if("object"!==xe(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==xe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===xe(t)?t:String(t)}function Le(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(e,t,r,n){var i=Fe();if(n)for(var o=0;o<n.length;o++)i=n[o](i);var s=t((function(e){i.initializeInstanceElements(e,a.elements)}),r),a=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(Ue(o.descriptor)||Ue(i.descriptor)){if(Me(o)||Me(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(Me(o)){if(Me(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}Be(o,i)}else t.push(o)}return t}(s.d.map(Ie)),e);i.initializeClassElements(s.F,a.elements),i.runClassFinishers(s.F,a.finishers)}([(0,u.Mo)("dialog-hassio-snapshot")],(function(e,t){var r,n,i,o,s,a;return{F: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=_e(n);function n(){var t;Ae(this,n);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return t=r.call.apply(r,[this].concat(o)),e(ze(t)),t}return n}(t),d:[{kind:"field",decorators:[(0,u.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,u.SB)()],key:"_error",value:void 0},{kind:"field",decorators:[(0,u.SB)()],key:"_snapshot",value:void 0},{kind:"field",decorators:[(0,u.SB)()],key:"_dialogParams",value:void 0},{kind:"field",decorators:[(0,u.SB)()],key:"_restoringSnapshot",value:function(){return!1}},{kind:"field",decorators:[(0,u.IO)("supervisor-snapshot-content")],key:"_snapshotContent",value:void 0},{kind:"method",key:"showDialog",value:(a=De(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,y.Ju)(this.hass,t.slug);case 2:this._snapshot=e.sent,this._dialogParams=t,this._restoringSnapshot=!1;case 5:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{kind:"method",key:"closeDialog",value:function(){this._snapshot=void 0,this._dialogParams=void 0,this._restoringSnapshot=!1,this._error=void 0,(0,d.B)(this,"dialog-closed",{dialog:this.localName})}},{kind:"method",key:"render",value:function(){return this._dialogParams&&this._snapshot?(0,l.dy)(we||(we=Oe(["\n <ha-dialog\n open\n scrimClickAction\n @closed=","\n .heading=","\n >\n ","\n ","\n\n <mwc-button\n .disabled=",'\n slot="secondaryAction"\n @click=','\n >\n Restore\n </mwc-button>\n\n <ha-button-menu\n fixed\n slot="primaryAction"\n @action=',"\n @closed=",'\n >\n <mwc-icon-button slot="trigger" alt="menu">\n <ha-svg-icon .path=','></ha-svg-icon>\n </mwc-icon-button>\n <mwc-list-item>Download Snapshot</mwc-list-item>\n <mwc-list-item class="error">Delete Snapshot</mwc-list-item>\n </ha-button-menu>\n </ha-dialog>\n '])),this.closeDialog,(0,p.i)(this.hass,this._computeName),this._restoringSnapshot?(0,l.dy)(ke||(ke=Oe([" <ha-circular-progress active></ha-circular-progress>"]))):(0,l.dy)(Ee||(Ee=Oe(["<supervisor-snapshot-content\n .hass=","\n .supervisor=","\n .snapshot=","\n >\n </supervisor-snapshot-content>"])),this.hass,this._dialogParams.supervisor,this._snapshot),this._error?(0,l.dy)(Pe||(Pe=Oe(['<p class="error">Error: ',"</p>"])),this._error):"",this._restoringSnapshot,this._restoreClicked,this._handleMenuAction,(function(e){return e.stopPropagation()}),c.SXi):(0,l.dy)(ge||(ge=Oe([""])))}},{kind:"get",static:!0,key:"styles",value:function(){return[b.Qx,b.yu,(0,l.iv)(Se||(Se=Oe(["\n ha-svg-icon {\n color: var(--primary-text-color);\n }\n ha-circular-progress {\n display: block;\n text-align: center;\n }\n "])))]}},{kind:"method",key:"_handleMenuAction",value:function(e){switch(e.detail.index){case 0:this._downloadClicked();break;case 1:this._deleteClicked()}}},{kind:"method",key:"_restoreClicked",value:(s=De(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this._snapshotContent.snapshotDetails(),this._restoringSnapshot=!0,"full"!==this._snapshotContent.snapshotType){e.next=7;break}return e.next=5,this._fullRestoreClicked(t);case 5:e.next=9;break;case 7:return e.next=9,this._partialRestoreClicked(t);case 9:this._restoringSnapshot=!1;case 10:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{kind:"method",key:"_partialRestoreClicked",value:(o=De(regeneratorRuntime.mark((function e(t){var r,n,i,o,s=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===(null===(r=this._dialogParams)||void 0===r?void 0:r.supervisor)||"running"===(null===(n=this._dialogParams)||void 0===n?void 0:n.supervisor.info.state)){e.next=4;break}return e.next=3,(0,v.Ys)(this,{title:"Could not restore snapshot",text:"Restoring a snapshot is not possible right now because the system is in ".concat(null===(o=this._dialogParams)||void 0===o?void 0:o.supervisor.info.state," state.")});case 3:return e.abrupt("return");case 4:return e.next=6,(0,v.g7)(this,{title:"Are you sure you want partially to restore this snapshot?",confirmText:"restore",dismissText:"cancel"});case 6:if(e.sent){e.next=8;break}return e.abrupt("return");case 8:null!==(i=this._dialogParams)&&void 0!==i&&i.onboarding?((0,d.B)(this,"restoring"),fetch("/api/hassio/snapshots/".concat(this._snapshot.slug,"/restore/partial"),{method:"POST",body:JSON.stringify(t)}),this.closeDialog()):this.hass.callApi("POST","hassio/snapshots/".concat(this._snapshot.slug,"/restore/partial"),t).then((function(){s.closeDialog()}),(function(e){s._error=e.body.message}));case 9:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{kind:"method",key:"_fullRestoreClicked",value:(i=De(regeneratorRuntime.mark((function e(t){var r,n,i,o,s=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===(null===(r=this._dialogParams)||void 0===r?void 0:r.supervisor)||"running"===(null===(n=this._dialogParams)||void 0===n?void 0:n.supervisor.info.state)){e.next=4;break}return e.next=3,(0,v.Ys)(this,{title:"Could not restore snapshot",text:"Restoring a snapshot is not possible right now because the system is in ".concat(null===(o=this._dialogParams)||void 0===o?void 0:o.supervisor.info.state," state.")});case 3:return e.abrupt("return");case 4:return e.next=6,(0,v.g7)(this,{title:"Are you sure you want to wipe your system and restore this snapshot?",confirmText:"restore",dismissText:"cancel"});case 6:if(e.sent){e.next=8;break}return e.abrupt("return");case 8:null!==(i=this._dialogParams)&&void 0!==i&&i.onboarding?((0,d.B)(this,"restoring"),fetch("/api/hassio/snapshots/".concat(this._snapshot.slug,"/restore/full"),{method:"POST",body:JSON.stringify(t)}),this.closeDialog()):this.hass.callApi("POST","hassio/snapshots/".concat(this._snapshot.slug,"/restore/full"),t).then((function(){s.closeDialog()}),(function(e){s._error=e.body.message}));case 9:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{kind:"method",key:"_deleteClicked",value:(n=De(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,v.g7)(this,{title:"Are you sure you want to delete this snapshot?",confirmText:"delete",dismissText:"cancel"});case 2:if(e.sent){e.next=4;break}return e.abrupt("return");case 4:this.hass.callApi("POST","hassio/snapshots/".concat(this._snapshot.slug,"/remove")).then((function(){t._dialogParams.onDelete&&t._dialogParams.onDelete(),t.closeDialog()}),(function(e){t._error=e.body.message}));case 5:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{kind:"method",key:"_downloadClicked",value:(r=De(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,h.iI)(this.hass,"/api/hassio/snapshots/".concat(this._snapshot.slug,"/download"));case 3:t=e.sent,e.next=11;break;case 6:return e.prev=6,e.t0=e.catch(0),e.next=10,(0,v.Ys)(this,{text:(0,m.js)(e.t0)});case 10:return e.abrupt("return");case 11:if(!window.location.href.includes("ui.nabu.casa")){e.next=17;break}return e.next=14,(0,v.g7)(this,{title:"Potential slow download",text:"Downloading snapshots over the Nabu Casa URL will take some time, it is recomended to use your local URL instead, do you want to continue?",confirmText:"continue",dismissText:"cancel"});case 14:if(e.sent){e.next=17;break}return e.abrupt("return");case 17:(r=document.createElement("a")).href=t.path,r.download="home_assistant_snapshot_".concat(f(this._computeName),".tar"),this.shadowRoot.appendChild(r),r.click(),this.shadowRoot.removeChild(r);case 23:case"end":return e.sto