Files
supervisor/hassio/api/panel/chunk.6ff2deda34a647d6051c.js
2019-03-19 19:01:52 +01:00

1 line
178 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{1:function(e,t,n){"use strict";n.r(t);n(69);var o=n(4),r=n(7),a=(n(32),n(91),n(22)),i=(n(25),function(e,t,n,o){o=o||{},n=null==n?{}:n;var r=new Event(t,{bubbles:void 0===o.bubbles||o.bubbles,cancelable:Boolean(o.cancelable),composed:void 0===o.composed||o.composed});return r.detail=n,e.dispatchEvent(r),r});function s(e){return(s="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 c(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n <paper-icon-button\n .icon=","\n @click=","\n ></paper-icon-button>\n "]);return c=function(){return e},e}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e){var t,n=m(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 o={kind:"field"===e.kind?"field":"method",key:n,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(o.decorators=e.decorators),"field"===e.kind&&(o.initializer=e.value),o}function f(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function h(e){return e.decorators&&e.decorators.length}function b(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function y(e,t){var n=e[t];if(void 0!==n&&"function"!=typeof n)throw new TypeError("Expected '"+t+"' to be a function");return n}function m(e){var t=function(e,t){if("object"!==s(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!==s(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===s(t)?t:String(t)}!function(e,t,n,o){var r=function(){var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach(function(n){t.forEach(function(t){t.kind===n&&"own"===t.placement&&this.defineClassElement(e,t)},this)},this)},initializeClassElements:function(e,t){var n=e.prototype;["method","field"].forEach(function(o){t.forEach(function(t){var r=t.placement;if(t.kind===o&&("static"===r||"prototype"===r)){var a="static"===r?e:n;this.defineClassElement(a,t)}},this)},this)},defineClassElement:function(e,t){var n=t.descriptor;if("field"===t.kind){var o=t.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===o?void 0:o.call(e)}}Object.defineProperty(e,t.key,n)},decorateClass:function(e,t){var n=[],o=[],r={static:[],prototype:[],own:[]};if(e.forEach(function(e){this.addElementPlacement(e,r)},this),e.forEach(function(e){if(!h(e))return n.push(e);var t=this.decorateElement(e,r);n.push(t.element),n.push.apply(n,t.extras),o.push.apply(o,t.finishers)},this),!t)return{elements:n,finishers:o};var a=this.decorateConstructor(n,t);return o.push.apply(o,a.finishers),a.finishers=o,a},addElementPlacement:function(e,t,n){var o=t[e.placement];if(!n&&-1!==o.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");o.push(e.key)},decorateElement:function(e,t){for(var n=[],o=[],r=e.decorators,a=r.length-1;a>=0;a--){var i=t[e.placement];i.splice(i.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,r[a])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&o.push(c.finisher);var l=c.extras;if(l){for(var u=0;u<l.length;u++)this.addElementPlacement(l[u],t);n.push.apply(n,l)}}return{element:e,finishers:o,extras:n}},decorateConstructor:function(e,t){for(var n=[],o=t.length-1;o>=0;o--){var r=this.fromClassDescriptor(e),a=this.toClassDescriptor((0,t[o])(r)||r);if(void 0!==a.finisher&&n.push(a.finisher),void 0!==a.elements){e=a.elements;for(var i=0;i<e.length-1;i++)for(var s=i+1;s<e.length;s++)if(e[i].key===e[s].key&&e[i].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[i].key+")")}}return{elements:e,finishers:n}},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(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()).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 n=m(e.key),o=String(e.placement);if("static"!==o&&"prototype"!==o&&"own"!==o)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 "'+o+'"');var r=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var a={kind:t,key:n,placement:o,descriptor:Object.assign({},r)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(r,"get","The property descriptor of a field descriptor"),this.disallowProperty(r,"set","The property descriptor of a field descriptor"),this.disallowProperty(r,"value","The property descriptor of a field descriptor"),a.initializer=e.initializer),a},toElementFinisherExtras:function(e){var t=this.toElementDescriptor(e),n=y(e,"finisher"),o=this.toElementDescriptors(e.extras);return{element:t,finisher:n,extras:o}},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 n=y(e,"finisher"),o=this.toElementDescriptors(e.elements);return{elements:o,finisher:n}},runClassFinishers:function(e,t){for(var n=0;n<t.length;n++){var o=(0,t[n])(e);if(void 0!==o){if("function"!=typeof o)throw new TypeError("Finishers must return a constructor.");e=o}}return e},disallowProperty:function(e,t,n){if(void 0!==e[t])throw new TypeError(n+" can't have a ."+t+" property.")}};return e}();if(o)for(var a=0;a<o.length;a++)r=o[a](r);var i=t(function(e){r.initializeInstanceElements(e,s.elements)},n),s=r.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===a.key&&e.placement===a.placement},o=0;o<e.length;o++){var r,a=e[o];if("method"===a.kind&&(r=t.find(n)))if(b(a.descriptor)||b(r.descriptor)){if(h(a)||h(r))throw new ReferenceError("Duplicated methods ("+a.key+") can't be decorated.");r.descriptor=a.descriptor}else{if(h(a)){if(h(r))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+a.key+").");r.decorators=a.decorators}f(a,r)}else t.push(a)}return t}(i.d.map(d)),e);r.initializeClassElements(i.F,s.elements),r.runClassFinishers(i.F,s.finishers)}([Object(a.c)("ha-menu-button")],function(e,t){return{F:function(n){function o(){var t,n,r,a;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);for(var i=arguments.length,c=new Array(i),u=0;u<i;u++)c[u]=arguments[u];return r=this,n=!(a=(t=l(o)).call.apply(t,[this].concat(c)))||"object"!==s(a)&&"function"!=typeof a?p(r):a,e(p(p(n))),n}return 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&&u(e,t)}(o,t),o}(),d:[{kind:"field",decorators:[Object(a.e)({type:Boolean})],key:"hassio",value:function(){return!1}},{kind:"method",key:"render",value:function(){return Object(a.d)(c(),this.hassio?"hassio:menu":"hass:menu",this._toggleMenu)}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"_toggleMenu",value:function(){i(this,"hass-toggle-menu")}}]}},a.a);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})(e)}function g(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function w(e,t){return!t||"object"!==v(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function k(e,t,n){return(k="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=O(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}function O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function j(e,t){return(j=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var _=customElements.get("paper-icon-button"),S=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),w(this,O(t).apply(this,arguments))}var n,o,r;return 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)}(t,_),n=t,(o=[{key:"connectedCallback",value:function(){this.icon="ltr"===window.getComputedStyle(this).direction?"hass:arrow-left":"hass:arrow-right",k(O(t.prototype),"connectedCallback",this).call(this)}}])&&g(n.prototype,o),r&&g(n,r),t}();function P(){var e=E(["\n /* prevent clipping of positioned elements */\n paper-dialog-scrollable {\n --paper-dialog-scrollable: {\n -webkit-overflow-scrolling: auto;\n }\n }\n\n /* force smooth scrolling for iOS 10 */\n paper-dialog-scrollable.can-scroll {\n --paper-dialog-scrollable: {\n -webkit-overflow-scrolling: touch;\n }\n }\n\n .paper-dialog-buttons {\n align-items: flex-end;\n padding: 8px;\n }\n\n .paper-dialog-buttons .warning {\n --mdc-theme-primary: var(--google-red-500);\n }\n\n @media all and (max-width: 450px), all and (max-height: 500px) {\n paper-dialog {\n margin: 0;\n width: 100% !important;\n max-height: calc(100% - 64px);\n\n position: fixed !important;\n bottom: 0px;\n left: 0px;\n right: 0px;\n overflow: scroll;\n border-bottom-left-radius: 0px;\n border-bottom-right-radius: 0px;\n }\n }\n"]);return P=function(){return e},e}function x(){var e=E(["\n :host {\n @apply --paper-font-body1;\n }\n\n app-header-layout,\n ha-app-layout {\n background-color: var(--primary-background-color);\n }\n\n app-header,\n app-toolbar {\n background-color: var(--primary-color);\n font-weight: 400;\n color: var(--text-primary-color, white);\n }\n\n app-toolbar ha-menu-button + [main-title],\n app-toolbar ha-paper-icon-button-arrow-prev + [main-title],\n app-toolbar paper-icon-button + [main-title] {\n margin-left: 24px;\n }\n\n h1 {\n @apply --paper-font-title;\n }\n\n button.link {\n background: none;\n color: inherit;\n border: none;\n padding: 0;\n font: inherit;\n text-align: left;\n text-decoration: underline;\n cursor: pointer;\n }\n\n .card-actions a {\n text-decoration: none;\n }\n\n .card-actions .warning {\n --mdc-theme-primary: var(--google-red-500);\n }\n"]);return x=function(){return e},e}function E(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}customElements.define("ha-paper-icon-button-arrow-prev",S);var C=Object(a.b)(x()),T=Object(a.b)(P());function A(e){return(A="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 R(){var e=H(["\n .content {\n height: calc(100% - 64px);\n display: flex;\n align-items: center;\n justify-content: center;\n }\n "]);return R=function(){return e},e}function D(){var e=H(["\n <ha-paper-icon-button-arrow-prev\n @click=","\n ></ha-paper-icon-button-arrow-prev>\n "]);return D=function(){return e},e}function z(){var e=H(["\n <ha-menu-button></ha-menu-button>\n "]);return z=function(){return e},e}function I(){var e=H(["\n <app-toolbar>\n ",'\n </app-toolbar>\n <div class="content">\n <paper-spinner-lite active></paper-spinner-lite>\n </div>\n ']);return I=function(){return e},e}function H(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function L(e){return(L=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function B(e,t){return(B=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function M(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function N(e){var t,n=W(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 o={kind:"field"===e.kind?"field":"method",key:n,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(o.decorators=e.decorators),"field"===e.kind&&(o.initializer=e.value),o}function U(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function F(e){return e.decorators&&e.decorators.length}function q(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function $(e,t){var n=e[t];if(void 0!==n&&"function"!=typeof n)throw new TypeError("Expected '"+t+"' to be a function");return n}function W(e){var t=function(e,t){if("object"!==A(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!==A(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===A(t)?t:String(t)}(function(e,t,n,o){var r=function(){var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach(function(n){t.forEach(function(t){t.kind===n&&"own"===t.placement&&this.defineClassElement(e,t)},this)},this)},initializeClassElements:function(e,t){var n=e.prototype;["method","field"].forEach(function(o){t.forEach(function(t){var r=t.placement;if(t.kind===o&&("static"===r||"prototype"===r)){var a="static"===r?e:n;this.defineClassElement(a,t)}},this)},this)},defineClassElement:function(e,t){var n=t.descriptor;if("field"===t.kind){var o=t.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===o?void 0:o.call(e)}}Object.defineProperty(e,t.key,n)},decorateClass:function(e,t){var n=[],o=[],r={static:[],prototype:[],own:[]};if(e.forEach(function(e){this.addElementPlacement(e,r)},this),e.forEach(function(e){if(!F(e))return n.push(e);var t=this.decorateElement(e,r);n.push(t.element),n.push.apply(n,t.extras),o.push.apply(o,t.finishers)},this),!t)return{elements:n,finishers:o};var a=this.decorateConstructor(n,t);return o.push.apply(o,a.finishers),a.finishers=o,a},addElementPlacement:function(e,t,n){var o=t[e.placement];if(!n&&-1!==o.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");o.push(e.key)},decorateElement:function(e,t){for(var n=[],o=[],r=e.decorators,a=r.length-1;a>=0;a--){var i=t[e.placement];i.splice(i.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,r[a])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&o.push(c.finisher);var l=c.extras;if(l){for(var u=0;u<l.length;u++)this.addElementPlacement(l[u],t);n.push.apply(n,l)}}return{element:e,finishers:o,extras:n}},decorateConstructor:function(e,t){for(var n=[],o=t.length-1;o>=0;o--){var r=this.fromClassDescriptor(e),a=this.toClassDescriptor((0,t[o])(r)||r);if(void 0!==a.finisher&&n.push(a.finisher),void 0!==a.elements){e=a.elements;for(var i=0;i<e.length-1;i++)for(var s=i+1;s<e.length;s++)if(e[i].key===e[s].key&&e[i].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[i].key+")")}}return{elements:e,finishers:n}},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(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()).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 n=W(e.key),o=String(e.placement);if("static"!==o&&"prototype"!==o&&"own"!==o)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 "'+o+'"');var r=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var a={kind:t,key:n,placement:o,descriptor:Object.assign({},r)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(r,"get","The property descriptor of a field descriptor"),this.disallowProperty(r,"set","The property descriptor of a field descriptor"),this.disallowProperty(r,"value","The property descriptor of a field descriptor"),a.initializer=e.initializer),a},toElementFinisherExtras:function(e){var t=this.toElementDescriptor(e),n=$(e,"finisher"),o=this.toElementDescriptors(e.extras);return{element:t,finisher:n,extras:o}},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 n=$(e,"finisher"),o=this.toElementDescriptors(e.elements);return{elements:o,finisher:n}},runClassFinishers:function(e,t){for(var n=0;n<t.length;n++){var o=(0,t[n])(e);if(void 0!==o){if("function"!=typeof o)throw new TypeError("Finishers must return a constructor.");e=o}}return e},disallowProperty:function(e,t,n){if(void 0!==e[t])throw new TypeError(n+" can't have a ."+t+" property.")}};return e}();if(o)for(var a=0;a<o.length;a++)r=o[a](r);var i=t(function(e){r.initializeInstanceElements(e,s.elements)},n),s=r.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===a.key&&e.placement===a.placement},o=0;o<e.length;o++){var r,a=e[o];if("method"===a.kind&&(r=t.find(n)))if(q(a.descriptor)||q(r.descriptor)){if(F(a)||F(r))throw new ReferenceError("Duplicated methods ("+a.key+") can't be decorated.");r.descriptor=a.descriptor}else{if(F(a)){if(F(r))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+a.key+").");r.decorators=a.decorators}U(a,r)}else t.push(a)}return t}(i.d.map(N)),e);r.initializeClassElements(i.F,s.elements),r.runClassFinishers(i.F,s.finishers)})([Object(a.c)("hass-loading-screen")],function(e,t){return{F:function(n){function o(){var t,n,r,a;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);for(var i=arguments.length,s=new Array(i),c=0;c<i;c++)s[c]=arguments[c];return r=this,n=!(a=(t=L(o)).call.apply(t,[this].concat(s)))||"object"!==A(a)&&"function"!=typeof a?M(r):a,e(M(M(n))),n}return 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&&B(e,t)}(o,t),o}(),d:[{kind:"field",decorators:[Object(a.e)({type:Boolean})],key:"rootnav",value:function(){return!1}},{kind:"method",key:"render",value:function(){return Object(a.d)(I(),this.rootnav?Object(a.d)(z()):Object(a.d)(D(),this._handleBack))}},{kind:"method",key:"_handleBack",value:function(){history.back()}},{kind:"get",static:!0,key:"styles",value:function(){return[C,Object(a.b)(R())]}}]}},a.a),n(73),n(87),n(92),n(3);var J=document.createElement("template");J.setAttribute("style","display: none;"),J.innerHTML='<custom-style>\n <style>\n /*\n Home Assistant default styles.\n\n In Polymer 2.0, default styles should to be set on the html selector.\n (Setting all default styles only on body breaks shadyCSS polyfill.)\n See: https://github.com/home-assistant/home-assistant-polymer/pull/901\n */\n html {\n font-size: 14px;\n height: 100vh;\n\n /* text */\n --primary-text-color: #212121;\n --secondary-text-color: #727272;\n --text-primary-color: #ffffff;\n --disabled-text-color: #bdbdbd;\n\n /* main interface colors */\n --primary-color: #03a9f4;\n --dark-primary-color: #0288d1;\n --light-primary-color: #b3e5fC;\n --accent-color: #ff9800;\n --divider-color: rgba(0, 0, 0, .12);\n\n /* states and badges */\n --state-icon-color: #44739e;\n --state-icon-active-color: #FDD835;\n --state-icon-unavailable-color: var(--disabled-text-color);\n\n /* background and sidebar */\n --card-background-color: #ffffff;\n --primary-background-color: #fafafa;\n --secondary-background-color: #e5e5e5; /* behind the cards on state */\n\n /* sidebar menu */\n --sidebar-text-color: var(--primary-text-color);\n --sidebar-background-color: var(--paper-listbox-background-color); /* backward compatible with existing themes */\n --sidebar-icon-color: rgba(0, 0, 0, 0.5);\n --sidebar-selected-text-color: var(--primary-color);\n --sidebar-selected-icon-color: var(--primary-color);\n\n /* controls */\n --toggle-button-color: var(--primary-color);\n /* --toggle-button-unchecked-color: var(--accent-color); */\n --slider-color: var(--primary-color);\n --slider-secondary-color: var(--light-primary-color);\n --slider-bar-color: var(--disabled-text-color);\n\n /* for label-badge */\n --label-badge-background-color: white;\n --label-badge-text-color: rgb(76, 76, 76);\n --label-badge-red: #DF4C1E;\n --label-badge-blue: #039be5;\n --label-badge-green: #0DA035;\n --label-badge-yellow: #f4b400;\n --label-badge-grey: var(--paper-grey-500);\n\n /*\n Paper-styles color.html depency is stripped on build.\n When a default paper-style color is used, it needs to be copied\n from paper-styles/color.html to here.\n */\n\n --paper-grey-50: #fafafa; /* default for: --paper-toggle-button-unchecked-button-color */\n --paper-grey-200: #eeeeee; /* for ha-date-picker-style */\n --paper-grey-500: #9e9e9e; /* --label-badge-grey */\n\n /* for paper-spinner */\n --google-red-500: #db4437;\n --google-blue-500: #4285f4;\n --google-green-500: #0f9d58;\n --google-yellow-500: #f4b400;\n --paper-spinner-color: var(--primary-color);\n\n /* for paper-slider */\n --paper-green-400: #66bb6a;\n --paper-blue-400: #42a5f5;\n --paper-orange-400: #ffa726;\n\n /* opacity for dark text on a light background */\n --dark-divider-opacity: 0.12;\n --dark-disabled-opacity: 0.38; /* or hint text or icon */\n --dark-secondary-opacity: 0.54;\n --dark-primary-opacity: 0.87;\n\n /* opacity for light text on a dark background */\n --light-divider-opacity: 0.12;\n --light-disabled-opacity: 0.3; /* or hint text or icon */\n --light-secondary-opacity: 0.7;\n --light-primary-opacity: 1.0;\n\n /* derived colors, to keep existing themes mostly working */\n --paper-card-background-color: var(--card-background-color);\n --paper-listbox-background-color: var(--card-background-color);\n --paper-item-icon-color: var(--state-icon-color);\n --paper-item-icon-active-color: var(--state-icon-active-color);\n --table-row-background-color: var(--primary-background-color);\n --table-row-alternative-background-color: var(--secondary-background-color);\n\n /* set our toggle style */\n --paper-toggle-button-checked-ink-color: var(--toggle-button-color);\n --paper-toggle-button-checked-button-color: var(--toggle-button-color);\n --paper-toggle-button-checked-bar-color: var(--toggle-button-color);\n --paper-toggle-button-unchecked-button-color: var(--toggle-button-unchecked-color, var(--paper-grey-50));\n --paper-toggle-button-unchecked-bar-color: var(--toggle-button-unchecked-color, #000000);\n /* set our slider style */\n --paper-slider-knob-color: var(--slider-color);\n --paper-slider-knob-start-color: var(--slider-color);\n --paper-slider-pin-color: var(--slider-color);\n --paper-slider-active-color: var(--slider-color);\n --paper-slider-secondary-color: var(--slider-secondary-color);\n --paper-slider-container-color: var(--slider-bar-color);\n --ha-paper-slider-pin-font-size: 15px;\n\n /* mwc */\n --mdc-theme-primary: var(--primary-color);\n }\n </style>\n\n <style shady-unscoped="">\n /*\n prevent clipping of positioned elements in a small scrollable\n force smooth scrolling if can scroll\n use non-shady selectors so this only targets iOS 9\n conditional mixin set in ha-style-dialog does not work with shadyCSS\n */\n paper-dialog-scrollable:not(.can-scroll) &gt; .scrollable {\n -webkit-overflow-scrolling: auto !important;\n }\n\n paper-dialog-scrollable.can-scroll &gt; .scrollable {\n -webkit-overflow-scrolling: touch !important;\n }\n </style>\n</custom-style><dom-module id="ha-style">\n <template>\n <style>\n '.concat(C.cssText,'\n </style>\n </template>\n</dom-module><dom-module id="ha-style-dialog">\n <template>\n <style>\n ').concat(T.cssText,"\n </style>\n </template>\n</dom-module>"),document.head.appendChild(J.content);n(75),n(89);var Y=n(10);function G(e){return(G="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 X(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function V(e,t){return!t||"object"!==G(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function K(e){return(K=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Q(e,t){return(Q=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Z=Object(Y.a)(function(e){return function(t){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),V(this,K(n).apply(this,arguments))}var o,r,a;return 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&&Q(e,t)}(n,e),o=n,(r=[{key:"fire",value:function(e,t,n){return i((n=n||{}).node||this,e,t,n)}}])&&X(o.prototype,r),a&&X(o,a),n}()});function ee(e){return(ee="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 te(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function ne(e,t){return!t||"object"!==ee(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function oe(e,t,n){return(oe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=re(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}function re(e){return(re=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ae(e,t){return(ae=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ie=null,se=["svg","path"],ce=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ne(this,re(t).apply(this,arguments))}var o,a,i;return 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&&ae(e,t)}(t,Z(r["a"])),o=t,i=[{key:"properties",get:function(){return{content:{type:String,observer:"_render"},allowSvg:{type:Boolean,value:!1}}}}],(a=[{key:"connectedCallback",value:function(){var e=this;oe(re(t.prototype),"connectedCallback",this).call(this),this._scriptLoaded=0,this._renderScheduled=!1,this._resize=function(){return e.fire("iron-resize")},ie||(ie=Promise.all([n.e(7),n.e(4)]).then(n.bind(null,110))),ie.then(function(t){var n=t.marked,o=t.filterXSS;e.marked=n,e.filterXSS=o,e._scriptLoaded=1},function(){e._scriptLoaded=2}).then(function(){return e._render()})}},{key:"_render",value:function(){var e=this;0===this._scriptLoaded||this._renderScheduled||(this._renderScheduled=!0,Promise.resolve().then(function(){if(e._renderScheduled=!1,1===e._scriptLoaded){e.innerHTML=e.filterXSS(e.marked(e.content,{gfm:!0,tables:!0,breaks:!0}),{onIgnoreTag:e.allowSvg?function(e,t){return se.indexOf(e)>=0?t:null}:null}),e._resize();for(var t=document.createTreeWalker(e,1,null,!1);t.nextNode();){var n=t.currentNode;"A"===n.tagName&&n.host!==document.location.host?n.target="_blank":"IMG"===n.tagName&&n.addEventListener("load",e._resize)}}else 2===e._scriptLoaded&&(e.innerText=e.content)}))}}])&&te(o.prototype,a),i&&te(o,i),t}();function le(e){return(le="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 ue(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <style include="ha-style-dialog">\n paper-dialog {\n min-width: 350px;\n font-size: 14px;\n border-radius: 2px;\n }\n app-toolbar {\n margin: 0;\n padding: 0 16px;\n color: var(--primary-text-color);\n background-color: var(--secondary-background-color);\n }\n app-toolbar [main-title] {\n margin-left: 16px;\n }\n paper-checkbox {\n display: block;\n margin: 4px;\n }\n @media all and (max-width: 450px), all and (max-height: 500px) {\n paper-dialog {\n max-height: 100%;\n }\n paper-dialog::before {\n content: "";\n position: fixed;\n z-index: -1;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n background-color: inherit;\n }\n app-toolbar {\n color: var(--text-primary-color);\n background-color: var(--primary-color);\n }\n }\n </style>\n <paper-dialog id="dialog" with-backdrop="">\n <app-toolbar>\n <paper-icon-button\n icon="hassio:close"\n dialog-dismiss=""\n ></paper-icon-button>\n <div main-title="">[[title]]</div>\n </app-toolbar>\n <paper-dialog-scrollable>\n <ha-markdown content="[[content]]"></ha-markdown>\n </paper-dialog-scrollable>\n </paper-dialog>\n ']);return ue=function(){return e},e}function pe(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function de(e,t){return!t||"object"!==le(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function fe(e){return(fe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function he(e,t){return(he=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}customElements.define("ha-markdown",ce);var be=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),de(this,fe(t).apply(this,arguments))}var n,a,i;return 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&&he(e,t)}(t,r["a"]),n=t,i=[{key:"template",get:function(){return Object(o.a)(ue())}},{key:"properties",get:function(){return{title:String,content:String}}}],(a=[{key:"openDialog",value:function(){this.$.dialog.open()}}])&&pe(n.prototype,a),i&&pe(n,i),t}();customElements.define("hassio-markdown-dialog",be);n(93),n(15),n(12),n(107),n(108),n(95);function ye(e){return(ye="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 me(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <style include="ha-style">\n :host,\n paper-card,\n paper-dropdown-menu {\n display: block;\n }\n .errors {\n color: var(--google-red-500);\n margin-bottom: 16px;\n }\n paper-item {\n width: 450px;\n }\n .card-actions {\n text-align: right;\n }\n </style>\n <paper-card heading="Audio">\n <div class="card-content">\n <template is="dom-if" if="[[error]]">\n <div class="errors">[[error]]</div>\n </template>\n\n <paper-dropdown-menu label="Input">\n <paper-listbox\n slot="dropdown-content"\n attr-for-selected="device"\n selected="{{selectedInput}}"\n >\n <template is="dom-repeat" items="[[inputDevices]]">\n <paper-item device$="[[item.device]]"\n >[[item.name]]</paper-item\n >\n </template>\n </paper-listbox>\n </paper-dropdown-menu>\n <paper-dropdown-menu label="Output">\n <paper-listbox\n slot="dropdown-content"\n attr-for-selected="device"\n selected="{{selectedOutput}}"\n >\n <template is="dom-repeat" items="[[outputDevices]]">\n <paper-item device$="[[item.device]]"\n >[[item.name]]</paper-item\n >\n </template>\n </paper-listbox>\n </paper-dropdown-menu>\n </div>\n <div class="card-actions">\n <mwc-button on-click="_saveSettings">Save</mwc-button>\n </div>\n </paper-card>\n '],['\n <style include="ha-style">\n :host,\n paper-card,\n paper-dropdown-menu {\n display: block;\n }\n .errors {\n color: var(--google-red-500);\n margin-bottom: 16px;\n }\n paper-item {\n width: 450px;\n }\n .card-actions {\n text-align: right;\n }\n </style>\n <paper-card heading="Audio">\n <div class="card-content">\n <template is="dom-if" if="[[error]]">\n <div class="errors">[[error]]</div>\n </template>\n\n <paper-dropdown-menu label="Input">\n <paper-listbox\n slot="dropdown-content"\n attr-for-selected="device"\n selected="{{selectedInput}}"\n >\n <template is="dom-repeat" items="[[inputDevices]]">\n <paper-item device\\$="[[item.device]]"\n >[[item.name]]</paper-item\n >\n </template>\n </paper-listbox>\n </paper-dropdown-menu>\n <paper-dropdown-menu label="Output">\n <paper-listbox\n slot="dropdown-content"\n attr-for-selected="device"\n selected="{{selectedOutput}}"\n >\n <template is="dom-repeat" items="[[outputDevices]]">\n <paper-item device\\$="[[item.device]]"\n >[[item.name]]</paper-item\n >\n </template>\n </paper-listbox>\n </paper-dropdown-menu>\n </div>\n <div class="card-actions">\n <mwc-button on-click="_saveSettings">Save</mwc-button>\n </div>\n </paper-card>\n ']);return me=function(){return e},e}function ve(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function ge(e,t){return!t||"object"!==ye(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function we(e){return(we=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ke(e,t){return(ke=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Oe=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ge(this,we(t).apply(this,arguments))}var n,a,i;return 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&&ke(e,t)}(t,Z(r["a"])),n=t,i=[{key:"template",get:function(){return Object(o.a)(me())}},{key:"properties",get:function(){return{hass:Object,addon:{type:Object,observer:"addonChanged"},inputDevices:Array,outputDevices:Array,selectedInput:String,selectedOutput:String,error:String}}}],(a=[{key:"addonChanged",value:function(e){var t=this;if(this.setProperties({selectedInput:e.audio_input||"null",selectedOutput:e.audio_output||"null"}),!this.outputDevices){var n=[{device:"null",name:"-"}];this.hass.callApi("get","hassio/hardware/audio").then(function(e){var o=e.data.audio,r=Object.keys(o.input).map(function(e){return{device:e,name:o.input[e]}}),a=Object.keys(o.output).map(function(e){return{device:e,name:o.output[e]}});t.setProperties({inputDevices:n.concat(r),outputDevices:n.concat(a)})},function(){t.setProperties({inputDevices:n,outputDevices:n})})}}},{key:"_saveSettings",value:function(){var e=this;this.error=null;var t="hassio/addons/".concat(this.addon.slug,"/options");this.hass.callApi("post",t,{audio_input:"null"===this.selectedInput?null:this.selectedInput,audio_output:"null"===this.selectedOutput?null:this.selectedOutput}).then(function(){e.fire("hass-api-called",{success:!0,path:t})},function(t){e.error=t.body.message})}}])&&ve(n.prototype,a),i&&ve(n,i),t}();customElements.define("hassio-addon-audio",Oe);n(96),n(97);function je(e){return(je="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 _e(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <style>\n .container {\n position: relative;\n display: inline-block;\n }\n\n mwc-button {\n transition: all 1s;\n }\n\n .success mwc-button {\n --mdc-theme-primary: white;\n background-color: var(--google-green-500);\n transition: none;\n }\n\n .error mwc-button {\n --mdc-theme-primary: white;\n background-color: var(--google-red-500);\n transition: none;\n }\n\n .progress {\n @apply --layout;\n @apply --layout-center-center;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n </style>\n <div class="container" id="container">\n <mwc-button\n id="button"\n disabled="[[computeDisabled(disabled, progress)]]"\n on-click="buttonTapped"\n >\n <slot></slot>\n </mwc-button>\n <template is="dom-if" if="[[progress]]">\n <div class="progress"><paper-spinner active=""></paper-spinner></div>\n </template>\n </div>\n ']);return _e=function(){return e},e}function Se(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Pe(e,t){return!t||"object"!==je(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function xe(e,t,n){return(xe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Ee(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}function Ee(e){return(Ee=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ce(e,t){return(Ce=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Te=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Pe(this,Ee(t).apply(this,arguments))}var n,a,i;return 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&&Ce(e,t)}(t,r["a"]),n=t,i=[{key:"template",get:function(){return Object(o.a)(_e())}},{key:"properties",get:function(){return{hass:{type:Object},progress:{type:Boolean,value:!1},disabled:{type:Boolean,value:!1}}}}],(a=[{key:"tempClass",value:function(e){var t=this.$.container.classList;t.add(e),setTimeout(function(){t.remove(e)},1e3)}},{key:"ready",value:function(){var e=this;xe(Ee(t.prototype),"ready",this).call(this),this.addEventListener("click",function(t){return e.buttonTapped(t)})}},{key:"buttonTapped",value:function(e){this.progress&&e.stopPropagation()}},{key:"actionSuccess",value:function(){this.tempClass("success")}},{key:"actionError",value:function(){this.tempClass("error")}},{key:"computeDisabled",value:function(e,t){return e||t}}])&&Se(n.prototype,a),i&&Se(n,i),t}();function Ae(e){return(Ae="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 Re(e,t,n,o,r,a,i){try{var s=e[a](i),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(o,r)}function De(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <ha-progress-button\n .progress="','"\n @click="','"\n ?disabled="','"\n ><slot></slot\n ></ha-progress-button>\n ']);return De=function(){return e},e}function ze(e,t){return!t||"object"!==Ae(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ie(e){return(Ie=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function He(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Le(e,t,n){return t&&He(e.prototype,t),n&&He(e,n),e}function Be(e,t){return(Be=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}customElements.define("ha-progress-button",Te);var Me=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=ze(this,Ie(t).call(this))).method="POST",e.data={},e.disabled=!1,e.progress=!1,e}return 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&&Be(e,t)}(t,a["a"]),Le(t,[{key:"render",value:function(){return Object(a.d)(De(),this.progress,this._buttonTapped,this.disabled)}}]),Le(t,[{key:"_buttonTapped",value:function(){var e,t=(e=regeneratorRuntime.mark(function e(){var t,n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.progress=!0,t={method:this.method,path:this.path,data:this.data},e.prev=2,e.next=5,this.hass.callApi(this.method,this.path,this.data);case 5:n=e.sent,this.progress=!1,this.progressButton.actionSuccess(),t.success=!0,t.response=n,e.next=18;break;case 12:e.prev=12,e.t0=e.catch(2),this.progress=!1,this.progressButton.actionError(),t.success=!1,t.response=e.t0;case 18:i(this,"hass-api-called",t);case 19:case"end":return e.stop()}},e,this,[[2,12]])}),function(){var t=this,n=arguments;return new Promise(function(o,r){var a=e.apply(t,n);function i(e){Re(a,o,r,i,s,"next",e)}function s(e){Re(a,o,r,i,s,"throw",e)}i(void 0)})});return function(){return t.apply(this,arguments)}}()},{key:"progressButton",get:function(){return this.renderRoot.querySelector("ha-progress-button")}}],[{key:"properties",get:function(){return{hass:{},progress:Boolean,path:String,method:String,data:{},disabled:Boolean}}}]),t}();function Ne(e){return(Ne="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 Ue(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <style include="ha-style">\n :host {\n display: block;\n }\n paper-card {\n display: block;\n }\n .card-actions {\n @apply --layout;\n @apply --layout-justified;\n }\n .errors {\n color: var(--google-red-500);\n margin-bottom: 16px;\n }\n iron-autogrow-textarea {\n width: 100%;\n font-family: monospace;\n }\n .syntaxerror {\n color: var(--google-red-500);\n }\n </style>\n <paper-card heading="Config">\n <div class="card-content">\n <template is="dom-if" if="[[error]]">\n <div class="errors">[[error]]</div>\n </template>\n <iron-autogrow-textarea\n id="config"\n value="{{config}}"\n ></iron-autogrow-textarea>\n </div>\n <div class="card-actions">\n <ha-call-api-button\n class="warning"\n hass="[[hass]]"\n path="hassio/addons/[[addonSlug]]/options"\n data="[[resetData]]"\n >Reset to defaults</ha-call-api-button\n >\n <mwc-button on-click="saveTapped" disabled="[[!configParsed]]"\n >Save</mwc-button\n >\n </div>\n </paper-card>\n ']);return Ue=function(){return e},e}function Fe(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function qe(e,t){return!t||"object"!==Ne(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function $e(e){return($e=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function We(e,t){return(We=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}customElements.define("ha-call-api-button",Me);var Je=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),qe(this,$e(t).apply(this,arguments))}var n,a,i;return 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&&We(e,t)}(t,r["a"]),n=t,i=[{key:"template",get:function(){return Object(o.a)(Ue())}},{key:"properties",get:function(){return{hass:Object,addon:{type:Object,observer:"addonChanged"},addonSlug:String,config:{type:String,observer:"configChanged"},configParsed:Object,error:String,resetData:{type:Object,value:{options:null}}}}}],(a=[{key:"addonChanged",value:function(e){this.config=e?JSON.stringify(e.options,null,2):""}},{key:"configChanged",value:function(e){try{this.$.config.classList.remove("syntaxerror"),this.configParsed=JSON.parse(e)}catch(e){this.$.config.classList.add("syntaxerror"),this.configParsed=null}}},{key:"saveTapped",value:function(){var e=this;this.error=null,this.hass.callApi("post","hassio/addons/".concat(this.addonSlug,"/options"),{options:this.configParsed}).catch(function(t){e.error=t.body.message})}}])&&Fe(n.prototype,a),i&&Fe(n,i),t}();customElements.define("hassio-addon-config",Je);n(26),n(98);var Ye=n(56);function Ge(e){return(Ge="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 Xe(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Ve(e,t){return!t||"object"!==Ge(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ke(e,t,n){return(Ke="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Qe(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}function Qe(e){return(Qe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ze(e,t){return(Ze=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var et=customElements.get("iron-icon"),tt=!1,nt=function(e){function t(){var e,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a];return(n=Ve(this,(e=Qe(t)).call.apply(e,[this].concat(r))))._iconsetName=void 0,n}var o,r,a;return 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&&Ze(e,t)}(t,et),o=t,(r=[{key:"listen",value:function(e,o,r){Ke(Qe(t.prototype),"listen",this).call(this,e,o,r),tt||"mdi"!==this._iconsetName||(tt=!0,n.e(5).then(n.bind(null,111)))}}])&&Xe(o.prototype,r),a&&Xe(o,a),t}();function ot(e){return(ot="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 rt(){var e=ut(["\n .badge-container {\n display: inline-block;\n text-align: center;\n vertical-align: top;\n }\n .label-badge {\n position: relative;\n display: block;\n margin: 0 auto;\n width: var(--ha-label-badge-size, 2.5em);\n text-align: center;\n height: var(--ha-label-badge-size, 2.5em);\n line-height: var(--ha-label-badge-size, 2.5em);\n font-size: var(--ha-label-badge-font-size, 1.5em);\n border-radius: 50%;\n border: 0.1em solid var(--ha-label-badge-color, var(--primary-color));\n color: var(--label-badge-text-color, rgb(76, 76, 76));\n\n white-space: nowrap;\n background-color: var(--label-badge-background-color, white);\n background-size: cover;\n transition: border 0.3s ease-in-out;\n }\n .label-badge .value {\n font-size: 90%;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n .label-badge .value.big {\n font-size: 70%;\n }\n .label-badge .label {\n position: absolute;\n bottom: -1em;\n /* Make the label as wide as container+border. (parent_borderwidth / font-size) */\n left: -0.2em;\n right: -0.2em;\n line-height: 1em;\n font-size: 0.5em;\n }\n .label-badge .label span {\n box-sizing: border-box;\n max-width: 100%;\n display: inline-block;\n background-color: var(--ha-label-badge-color, var(--primary-color));\n color: var(--ha-label-badge-label-color, white);\n border-radius: 1em;\n padding: 9% 16% 8% 16%; /* mostly apitalized text, not much descenders => bit more top margin */\n font-weight: 500;\n overflow: hidden;\n text-transform: uppercase;\n text-overflow: ellipsis;\n transition: background-color 0.3s ease-in-out;\n text-transform: var(--ha-label-badge-label-text-transform, uppercase);\n }\n .label-badge .label.big span {\n font-size: 90%;\n padding: 10% 12% 7% 12%; /* push smaller text a bit down to center vertically */\n }\n .badge-container .title {\n margin-top: 1em;\n font-size: var(--ha-label-badge-title-font-size, 0.9em);\n width: var(--ha-label-badge-title-width, 5em);\n font-weight: var(--ha-label-badge-title-font-weight, 400);\n overflow: hidden;\n text-overflow: ellipsis;\n line-height: normal;\n }\n "]);return rt=function(){return e},e}function at(){var e=ut(['\n <div class="title">',"</div>\n "]);return at=function(){return e},e}function it(){var e=ut(['\n <div\n class="','"\n >\n <span>',"</span>\n </div>\n "]);return it=function(){return e},e}function st(){var e=ut(["\n <span>","</span>\n "]);return st=function(){return e},e}function ct(){var e=ut(['\n <ha-icon .icon="','"></ha-icon>\n ']);return ct=function(){return e},e}function lt(){var e=ut(['\n <div class="badge-container">\n <div class="label-badge" id="badge">\n <div\n class="','"\n >\n ',"\n ","\n </div>\n ","\n </div>\n ","\n </div>\n "]);return lt=function(){return e},e}function ut(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function pt(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function dt(e,t){return!t||"object"!==ot(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ft(e,t,n){return(ft="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=ht(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}function ht(e){return(ht=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function bt(e,t){return(bt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}customElements.define("ha-icon",nt);var yt=function(e){function t(){var e,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a];return(n=dt(this,(e=ht(t)).call.apply(e,[this].concat(r)))).value=void 0,n.icon=void 0,n.label=void 0,n.description=void 0,n.image=void 0,n}var n,o,r;return 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&&bt(e,t)}(t,a["a"]),n=t,r=[{key:"properties",get:function(){return{value:{},icon:{},label:{},description:{},image:{}}}},{key:"styles",get:function(){return[Object(a.b)(rt())]}}],(o=[{key:"render",value:function(){return Object(a.d)(lt(),Object(Ye.a)({value:!0,big:Boolean(this.value&&this.value.length>4)}),!this.icon||this.value||this.image?"":Object(a.d)(ct(),this.icon),this.value&&!this.image?Object(a.d)(st(),this.value):"",this.label?Object(a.d)(it(),Object(Ye.a)({label:!0,big:this.label.length>5}),this.label):"",this.description?Object(a.d)(at(),this.description):"")}},{key:"updated",value:function(e){ft(ht(t.prototype),"updated",this).call(this,e),e.has("image")&&(this.shadowRoot.getElementById("badge").style.backgroundImage=this.image?"url(".concat(this.image,")"):"")}}])&&pt(n.prototype,o),r&&pt(n,r),t}();customElements.define("ha-label-badge",yt);var mt=n(6),vt=[60,60,24,7],gt=["second","minute","hour","day"];function wt(e){return(wt="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 kt(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Ot(e,t){return!t||"object"!==wt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function jt(e){return(jt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _t(e,t){return(_t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var St=Object(Y.a)(function(e){return function(t){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),Ot(this,jt(n).apply(this,arguments))}var o,r,a;return 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&&_t(e,t)}(n,e),o=n,a=[{key:"properties",get:function(){return{hass:Object,localize:{type:Function,computed:"__computeLocalize(hass.localize)"}}}}],(r=[{key:"__computeLocalize",value:function(e){return e}}])&&kt(o.prototype,r),a&&kt(o,a),n}()});function Pt(e){return(Pt="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 xt(e,t,n){return(xt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Et(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}function Et(e){return(Et=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ct(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Tt(e,t,n){return t&&Ct(e.prototype,t),n&&Ct(e,n),e}function At(e,t){return(At=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Rt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Dt=function(e){function t(){var e,n,o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=this,(e=!(o=Et(t).call(this))||"object"!==Pt(o)&&"function"!=typeof o?Rt(n):o).updateRelative=e.updateRelative.bind(Rt(Rt(e))),e}return 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&&At(e,t)}(t,St(r["a"])),Tt(t,null,[{key:"properties",get:function(){return{hass:Object,datetime:{type:String,observer:"datetimeChanged"},datetimeObj:{type:Object,observer:"datetimeObjChanged"},parsedDateTime:Object}}}]),Tt(t,[{key:"connectedCallback",value:function(){xt(Et(t.prototype),"connectedCallback",this).call(this),this.updateInterval=setInterval(this.updateRelative,6e4)}},{key:"disconnectedCallback",value:function(){xt(Et(t.prototype),"disconnectedCallback",this).call(this),clearInterval(this.updateInterval)}},{key:"datetimeChanged",value:function(e){this.parsedDateTime=e?new Date(e):null,this.updateRelative()}},{key:"datetimeObjChanged",value:function(e){this.parsedDateTime=e,this.updateRelative()}},{key:"updateRelative",value:function(){var e=Object(mt.a)(this);this.parsedDateTime?e.innerHTML=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(){var o,r=((n.compareTime||new Date).getTime()-e.getTime())/1e3,a=r>=0?"past":"future";r=Math.abs(r);for(var i=0;i<vt.length;i++){if(r<vt[i]){r=Math.floor(r),o=t("ui.components.relative_time.duration.".concat(gt[i]),"count",r);break}r/=vt[i]}return void 0===o&&(r=Math.floor(r),o=t("ui.components.relative_time.duration.week","count",r)),!1===n.includeTense?o:t("ui.components.relative_time.".concat(a),"time",o)}()}(this.parsedDateTime,this.localize):e.innerHTML=this.localize("ui.components.relative_time.never")}}]),t}();function zt(e){return(zt="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 It(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <style>\n iron-icon {\n margin-right: 16px;\n margin-top: 16px;\n float: left;\n color: var(--secondary-text-color);\n }\n iron-icon.update {\n color: var(--paper-orange-400);\n }\n iron-icon.running,\n iron-icon.installed {\n color: var(--paper-green-400);\n }\n iron-icon.hassupdate,\n iron-icon.snapshot {\n color: var(--paper-item-icon-color);\n }\n iron-icon.not_available {\n color: var(--google-red-500);\n }\n .title {\n color: var(--primary-text-color);\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n .addition {\n color: var(--secondary-text-color);\n overflow: hidden;\n position: relative;\n height: 2.4em;\n line-height: 1.2em;\n }\n ha-relative-time {\n display: block;\n }\n </style>\n <iron-icon\n icon="[[icon]]"\n class$="[[iconClass]]"\n title="[[iconTitle]]"\n ></iron-icon>\n <div>\n <div class="title">[[title]]</div>\n <div class="addition">\n <template is="dom-if" if="[[description]]">\n [[description]]\n </template>\n <template is="dom-if" if="[[!available]]">\n (Not available)\n </template>\n <template is="dom-if" if="[[datetime]]">\n <ha-relative-time\n hass="[[hass]]"\n class="addition"\n datetime="[[datetime]]"\n ></ha-relative-time>\n </template>\n </div>\n </div>\n '],['\n <style>\n iron-icon {\n margin-right: 16px;\n margin-top: 16px;\n float: left;\n color: var(--secondary-text-color);\n }\n iron-icon.update {\n color: var(--paper-orange-400);\n }\n iron-icon.running,\n iron-icon.installed {\n color: var(--paper-green-400);\n }\n iron-icon.hassupdate,\n iron-icon.snapshot {\n color: var(--paper-item-icon-color);\n }\n iron-icon.not_available {\n color: var(--google-red-500);\n }\n .title {\n color: var(--primary-text-color);\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n .addition {\n color: var(--secondary-text-color);\n overflow: hidden;\n position: relative;\n height: 2.4em;\n line-height: 1.2em;\n }\n ha-relative-time {\n display: block;\n }\n </style>\n <iron-icon\n icon="[[icon]]"\n class\\$="[[iconClass]]"\n title="[[iconTitle]]"\n ></iron-icon>\n <div>\n <div class="title">[[title]]</div>\n <div class="addition">\n <template is="dom-if" if="[[description]]">\n [[description]]\n </template>\n <template is="dom-if" if="[[!available]]">\n (Not available)\n </template>\n <template is="dom-if" if="[[datetime]]">\n <ha-relative-time\n hass="[[hass]]"\n class="addition"\n datetime="[[datetime]]"\n ></ha-relative-time>\n </template>\n </div>\n </div>\n ']);return It=function(){return e},e}function Ht(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Lt(e,t){return!t||"object"!==zt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Bt(e){return(Bt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Mt(e,t){return(Mt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}customElements.define("ha-relative-time",Dt);var Nt=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Lt(this,Bt(t).apply(this,arguments))}var n,a,i;return 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&&Mt(e,t)}(t,r["a"]),n=t,i=[{key:"template",get:function(){return Object(o.a)(It())}},{key:"properties",get:function(){return{hass:Object,title:String,description:String,available:Boolean,datetime:String,icon:{type:String,value:"hass:help-circle"},iconTitle:String,iconClass:String}}}],(a=null)&&Ht(n.prototype,a),i&&Ht(n,i),t}();function Ut(e){return(Ut="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 Ft(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <style include="ha-style">\n :host {\n display: block;\n }\n paper-card {\n display: block;\n margin-bottom: 16px;\n }\n paper-card.warning {\n background-color: var(--google-red-500);\n color: white;\n --paper-card-header-color: white;\n }\n paper-card.warning mwc-button {\n color: white !important;\n }\n .warning {\n color: var(--google-red-500);\n }\n .addon-header {\n @apply --paper-font-headline;\n }\n .light-color {\n color: var(--secondary-text-color);\n }\n .addon-version {\n float: right;\n font-size: 15px;\n vertical-align: middle;\n }\n .description {\n margin-bottom: 16px;\n }\n .logo img {\n max-height: 60px;\n margin: 16px 0;\n display: block;\n }\n .state div {\n width: 150px;\n display: inline-block;\n }\n paper-toggle-button {\n display: inline;\n }\n iron-icon.running {\n color: var(--paper-green-400);\n }\n iron-icon.stopped {\n color: var(--google-red-300);\n }\n ha-call-api-button {\n font-weight: 500;\n color: var(--primary-color);\n }\n .right {\n float: right;\n }\n ha-markdown img {\n max-width: 100%;\n }\n .red {\n --ha-label-badge-color: var(--label-badge-red, #df4c1e);\n }\n .blue {\n --ha-label-badge-color: var(--label-badge-blue, #039be5);\n }\n .green {\n --ha-label-badge-color: var(--label-badge-green, #0da035);\n }\n .yellow {\n --ha-label-badge-color: var(--label-badge-yellow, #f4b400);\n }\n .security {\n margin-bottom: 16px;\n }\n .security h3 {\n margin-bottom: 8px;\n font-weight: normal;\n }\n .security ha-label-badge {\n cursor: pointer;\n margin-right: 4px;\n --iron-icon-height: 45px;\n }\n </style>\n\n <template is="dom-if" if="[[computeUpdateAvailable(addon)]]">\n <paper-card heading="Update available! 🎉">\n <div class="card-content">\n <hassio-card-content\n hass="[[hass]]"\n title="[[addon.name]] [[addon.last_version]] is available"\n description="You are currently running version [[addon.version]]"\n icon="hassio:arrow-up-bold-circle"\n icon-class="update"\n ></hassio-card-content>\n </div>\n <div class="card-actions">\n <ha-call-api-button\n hass="[[hass]]"\n path="hassio/addons/[[addonSlug]]/update"\n >Update</ha-call-api-button\n >\n <template is="dom-if" if="[[addon.changelog]]">\n <mwc-button on-click="openChangelog">Changelog</mwc-button>\n </template>\n </div>\n </paper-card>\n </template>\n\n <paper-card>\n <div class="card-content">\n <div class="addon-header">\n [[addon.name]]\n <div class="addon-version light-color">\n <template is="dom-if" if="[[addon.version]]">\n [[addon.version]]\n <template is="dom-if" if="[[isRunning]]">\n <iron-icon\n title="Add-on is running"\n class="running"\n icon="hassio:circle"\n ></iron-icon>\n </template>\n <template is="dom-if" if="[[!isRunning]]">\n <iron-icon\n title="Add-on is stopped"\n class="stopped"\n icon="hassio:circle"\n ></iron-icon>\n </template>\n </template>\n <template is="dom-if" if="[[!addon.version]]">\n [[addon.last_version]]\n </template>\n </div>\n </div>\n <div class="description light-color">\n [[addon.description]].<br />\n Visit\n <a href="[[addon.url]]" target="_blank">[[addon.name]] page</a> for\n details.\n </div>\n <template is="dom-if" if="[[addon.logo]]">\n <a href="[[addon.url]]" target="_blank" class="logo">\n <img src="/api/hassio/addons/[[addonSlug]]/logo" />\n </a>\n </template>\n <template is="dom-if" if="[[!addon.protected]]">\n <paper-card heading="Warning: Protection mode is disabled!" class="warning">\n <div class="card-content">\n Protection mode on this addon is disabled! This gives the add-on full access to the entire system, which adds security risks, and could damage your system when used incorrectly. Only disable the protection mode if you know, need AND trust the source of this addon.\n </div>\n <div class="card-actions">\n <mwc-button on-click="protectionToggled">Enable Protection mode</mwc-button>\n </div>\n </div>\n </paper-card>\n </template>\n <div class="security">\n <h3>Addon Security Rating</h3>\n <div class="description light-color">\n Hass.io provides a security rating to each of the add-ons, which indicates the risks involved when using this add-on. The more access an addon requires on your system, the lower the score, thus raising the possible security risks.\n </div>\n <ha-label-badge\n class$="[[computeSecurityClassName(addon.rating)]]"\n on-click="showMoreInfo"\n id="rating"\n value="[[addon.rating]]"\n label="rating"\n description=""\n ></ha-label-badge>\n <template is="dom-if" if="[[addon.host_network]]">\n <ha-label-badge\n on-click="showMoreInfo"\n id="host_network"\n icon="hassio:network"\n label="host"\n description=""\n ></ha-label-badge>\n </template>\n <template is="dom-if" if="[[addon.full_access]]">\n <ha-label-badge\n on-click="showMoreInfo"\n id="full_access"\n icon="hassio:chip"\n label="hardware"\n description=""\n ></ha-label-badge>\n </template>\n <template is="dom-if" if="[[addon.homeassistant_api]]">\n <ha-label-badge\n on-click="showMoreInfo"\n id="homeassistant_api"\n icon="hassio:home-assistant"\n label="hass"\n description=""\n ></ha-label-badge>\n </template>\n <template is="dom-if" if="[[computeHassioApi(addon)]]">\n <ha-label-badge\n on-click="showMoreInfo"\n id="hassio_api"\n icon="hassio:home-assistant"\n label="hassio"\n description="[[addon.hassio_role]]"\n ></ha-label-badge>\n </template>\n <template is="dom-if" if="[[addon.docker_api]]">\n <ha-label-badge\n on-click="showMoreInfo"\n id="docker_api"\n icon="hassio:docker"\n label="docker"\n description=""\n ></ha-label-badge>\n </template>\n <template is="dom-if" if="[[addon.host_pid]]">\n <ha-label-badge\n on-click="showMoreInfo"\n id="host_pid"\n icon="hassio:pound"\n label="host pid"\n description=""\n ></ha-label-badge>\n </template>\n <template is="dom-if" if="[[addon.apparmor]]">\n <ha-label-badge\n on-click="showMoreInfo"\n class$="[[computeApparmorClassName(addon.apparmor)]]"\n id="apparmor"\n icon="hassio:shield"\n label="apparmor"\n description="[[addon.apparmor]]"\n ></ha-label-badge>\n </template>\n <template is="dom-if" if="[[addon.auth_api]]">\n <ha-label-badge\n on-click="showMoreInfo"\n id="auth_api"\n icon="hassio:key"\n label="auth"\n description=""\n ></ha-label-badge>\n </template>\n </div>\n <template is="dom-if" if="[[addon.version]]">\n <div class="state">\n <div>Start on boot</div>\n <paper-toggle-button\n on-change="startOnBootToggled"\n checked="[[computeStartOnBoot(addon.boot)]]"\n ></paper-toggle-button>\n </div>\n <div class="state">\n <div>Auto update</div>\n <paper-toggle-button\n on-change="autoUpdateToggled"\n checked="[[addon.auto_update]]"\n ></paper-toggle-button>\n </div>\n <div class="state">\n <div>Protection mode</div>\n <paper-toggle-button\n on-change="protectionToggled"\n checked="[[addon.protected]]"\n ></paper-toggle-button>\n </div>\n </template>\n </div>\n <div class="card-actions">\n <template is="dom-if" if="[[addon.version]]">\n <mwc-button class="warning" on-click="_unistallClicked"\n >Uninstall</mwc-button\n >\n <template is="dom-if" if="[[addon.build]]">\n <ha-call-api-button\n class="warning"\n hass="[[hass]]"\n path="hassio/addons/[[addonSlug]]/rebuild"\n >Rebuild</ha-call-api-button\n >\n </template>\n <template is="dom-if" if="[[isRunning]]">\n <ha-call-api-button\n class="warning"\n hass="[[hass]]"\n path="hassio/addons/[[addonSlug]]/restart"\n >Restart</ha-call-api-button\n >\n <ha-call-api-button\n class="warning"\n hass="[[hass]]"\n path="hassio/addons/[[addonSlug]]/stop"\n >Stop</ha-call-api-button\n >\n </template>\n <template is="dom-if" if="[[!isRunning]]">\n <ha-call-api-button\n hass="[[hass]]"\n path="hassio/addons/[[addonSlug]]/start"\n >Start</ha-call-api-button\n >\n </template>\n <template\n is="dom-if"\n if="[[computeShowWebUI(addon.webui, isRunning)]]"\n >\n <a\n href="[[pathWebui(addon.webui)]]"\n tabindex="-1"\n target="_blank"\n class="right"\n ><mwc-button>Open web UI</mwc-button></a\n >\n </template>\n </template>\n <template is="dom-if" if="[[!addon.version]]">\n <template is="dom-if" if="[[!addon.available]]">\n <p class="warning">This addon is not available on your system.</p>\n </template>\n <ha-call-api-button\n disabled="[[!addon.available]]"\n hass="[[hass]]"\n path="hassio/addons/[[addonSlug]]/install"\n >Install</ha-call-api-button\n >\n </template>\n </div>\n </paper-card>\n <template is="dom-if" if="[[addon.long_description]]">\n <paper-card>\n <div class="card-content">\n <ha-markdown content="[[addon.long_description]]"></ha-markdown>\n </div>\n </paper-card>\n </template>\n ']);return Ft=function(){return e},e}function qt(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function $t(e,t){return!t||"object"!==Ut(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Wt(e){return(Wt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Jt(e,t){return(Jt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}customElements.define("hassio-card-content",Nt);var Yt={rating:{title:"Addon Security Rating",description:"Hass.io provides a security rating to each of the add-ons, which indicates the risks involved when using this add-on. The more access an addon requires on your system, the lower the score, thus raising the possible security risks.\n\nA score is on a scale from 1 to 6. Where 1 is the lowest score (considered the most insecure and highest risk) and a score of 6 is the highest score (considered the most secure and lowest risk)."},host_network:{title:"Host Network",description:"Add-ons usually run in their own isolated network layer, which prevents them from accessing the network of the host operating system. In some cases, this network isolation can limit add-ons in providing their services and therefore, the isolation can be lifted by the add-on author, giving the addon full access to the network capabilities of the host machine. This gives the addon more networking capabilities but lowers the security, hence, the security rating of the add-on will be lowered when this option is used by the addon."},homeassistant_api:{title:"Home Assistant API Access",description:"This add-on is allowed to access your running Home Assistant instance directly via the Home Assistant API. This mode handles authentication for the addon as well, which enables an addon to interact with Home Assistant without the need for additional authentication tokens."},full_access:{title:"Full Hardware Access",description:"This addon is given full access to the hardware of your system, by request of the addon author. Access is comparable to the privileged mode in Docker. Since this opens up possible security risks, this feature impacts the addon security score negatively.\n\nThis level of access is not granted automatically and needs to be confirmed by you. To do this, you need to disable the protection mode on the addon manually. Only disable the protection mode if you know, need AND trust the source of this addon."},hassio_api:{title:"Hass.io API Access",description:"The addon was given access to the Hass.io API, by request of the addon author. By default, the addon can access general version information of your system. When the addon requests 'manager' or 'admin' level access to the API, it will gain access to control multiple parts of your Hass.io system. This permission is indicated by this badge and will impact the security score of the addon negatively."},docker_api:{title:"Full Docker Access",description:"The addon author has requested the addon to have management access to the Docker instance running on your system. This mode gives the addon full access and control to your entire Hass.io system, which adds security risks, and could damage your system when misused. Therefore, this feature impacts the addon security score negatively.\n\nThis level of access is not granted automatically and needs to be confirmed by you. To do this, you need to disable the protection mode on the addon manually. Only disable the protection mode if you know, need AND trust the source of this addon."},host_pid:{title:"Host Processes Namespace",description:"Usually, the processes the addon runs, are isolated from all other system processes. The addon author has requested the addon to have access to the system processes running on the host system instance, and allow the addon to spawn processes on the host system as well. This mode gives the addon full access and control to your entire Hass.io system, which adds security risks, and could damage your system when misused. Therefore, this feature impacts the addon security score negatively.\n\nThis level of access is not granted automatically and needs to be confirmed by you. To do this, you need to disable the protection mode on the addon manually. Only disable the protection mode if you know, need AND trust the source of this addon."},apparmor:{title:"AppArmor",description:"AppArmor ('Application Armor') is a Linux kernel security module that restricts addons capabilities like network access, raw socket access, and permission to read, write, or execute specific files.\n\nAddon authors can provide their security profiles, optimized for the addon, or request it to be disabled. If AppArmor is disabled, it will raise security risks and therefore, has a negative impact on the security score of the addon."},auth_api:{title:"Home Assistant Authentication",description:"An addon can authenticate users against Home Assistant, allowing add-ons to give users the possibility to log into applications running inside add-ons, using their Home Assistant username/password. This badge indicates if the add-on author requests this capability."}},Gt=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),$t(this,Wt(t).apply(this,arguments))}var n,a,i;return 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&&Jt(e,t)}(t,Z(r["a"])),n=t,i=[{key:"template",get:function(){return Object(o.a)(Ft())}},{key:"properties",get:function(){return{hass:Object,addon:Object,addonSlug:String,isRunning:{type:Boolean,computed:"computeIsRunning(addon)"}}}}],(a=[{key:"computeIsRunning",value:function(e){return e&&"started"===e.state}},{key:"computeUpdateAvailable",value:function(e){return e&&!e.detached&&e.version&&e.version!==e.last_version}},{key:"computeHassioApi",value:function(e){return e.hassio_api&&("manager"===e.hassio_role||"admin"===e.hassio_role)}},{key:"computeApparmorClassName",value:function(e){return"profile"===e?"green":"disable"===e?"red":""}},{key:"pathWebui",value:function(e){return e&&e.replace("[HOST]",document.location.hostname)}},{key:"computeShowWebUI",value:function(e,t){return e&&t}},{key:"computeStartOnBoot",value:function(e){return"auto"===e}},{key:"computeSecurityClassName",value:function(e){return e>4?"green":e>2?"yellow":"red"}},{key:"startOnBootToggled",value:function(){var e={boot:"auto"===this.addon.boot?"manual":"auto"};this.hass.callApi("POST","hassio/addons/".concat(this.addonSlug,"/options"),e)}},{key:"autoUpdateToggled",value:function(){var e={auto_update:!this.addon.auto_update};this.hass.callApi("POST","hassio/addons/".concat(this.addonSlug,"/options"),e)}},{key:"protectionToggled",value:function(){var e={protected:!this.addon.protected};this.hass.callApi("POST","hassio/addons/".concat(this.addonSlug,"/security"),e),this.set("addon.protected",!this.addon.protected)}},{key:"showMoreInfo",value:function(e){var t=e.target.getAttribute("id");this.fire("hassio-markdown-dialog",{title:Yt[t].title,content:Yt[t].description})}},{key:"openChangelog",value:function(){var e=this;this.hass.callApi("get","hassio/addons/".concat(this.addonSlug,"/changelog")).then(function(e){return e},function(){return"Error getting changelog"}).then(function(t){e.fire("hassio-markdown-dialog",{title:"Changelog",content:t})})}},{key:"_unistallClicked",value:function(){var e=this;if(confirm("Are you sure you want to uninstall this add-on?")){var t="hassio/addons/".concat(this.addonSlug,"/uninstall"),n={path:t};this.hass.callApi("post",t).then(function(e){n.success=!0,n.response=e},function(e){n.success=!1,n.response=e}).then(function(){e.fire("hass-api-called",n)})}}}])&&qt(n.prototype,a),i&&qt(n,i),t}();function Xt(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n <style>\n .bold {\n font-weight: bold;\n }\n .italic {\n font-style: italic;\n }\n .underline {\n text-decoration: underline;\n }\n .strikethrough {\n text-decoration: line-through;\n }\n .underline.strikethrough {\n text-decoration: underline line-through;\n }\n .fg-red {\n color: rgb(222, 56, 43);\n }\n .fg-green {\n color: rgb(57, 181, 74);\n }\n .fg-yellow {\n color: rgb(255, 199, 6);\n }\n .fg-blue {\n color: rgb(0, 111, 184);\n }\n .fg-magenta {\n color: rgb(118, 38, 113);\n }\n .fg-cyan {\n color: rgb(44, 181, 233);\n }\n .fg-white {\n color: rgb(204, 204, 204);\n }\n .bg-black {\n background-color: rgb(0, 0, 0);\n }\n .bg-red {\n background-color: rgb(222, 56, 43);\n }\n .bg-green {\n background-color: rgb(57, 181, 74);\n }\n .bg-yellow {\n background-color: rgb(255, 199, 6);\n }\n .bg-blue {\n background-color: rgb(0, 111, 184);\n }\n .bg-magenta {\n background-color: rgb(118, 38, 113);\n }\n .bg-cyan {\n background-color: rgb(44, 181, 233);\n }\n .bg-white {\n background-color: rgb(204, 204, 204);\n }\n </style>\n"]);return Xt=function(){return e},e}customElements.define("hassio-addon-info",Gt);var Vt=Object(o.a)(Xt());function Kt(e){for(var t,n=document.createElement("pre"),o=/\033(?:\[(.*?)[@-~]|\].*?(?:\007|\033\\))/g,r=0,a={bold:!1,italic:!1,underline:!1,strikethrough:!1,foregroundColor:null,backgroundColor:null},i=function(e){var t=document.createElement("span");a.bold&&t.classList.add("bold"),a.italic&&t.classList.add("italic"),a.underline&&t.classList.add("underline"),a.strikethrough&&t.classList.add("strikethrough"),null!==a.foregroundColor&&t.classList.add("fg-".concat(a.foregroundColor)),null!==a.backgroundColor&&t.classList.add("bg-".concat(a.backgroundColor)),t.appendChild(document.createTextNode(e)),n.appendChild(t)};null!==(t=o.exec(e));){var s=t.index;if(i(e.substring(r,s)),r=s+t[0].length,void 0!==t[1]){var c=!0,l=!1,u=void 0;try{for(var p,d=t[1].split(";")[Symbol.iterator]();!(c=(p=d.next()).done);c=!0){var f=p.value;switch(parseInt(f)){case 0:a.bold=!1,a.italic=!1,a.underline=!1,a.strikethrough=!1,a.foregroundColor=null,a.backgroundColor=null;break;case 1:a.bold=!0;break;case 3:a.italic=!0;break;case 4:a.underline=!0;break;case 9:a.strikethrough=!0;break;case 22:a.bold=!1;break;case 23:a.italic=!1;break;case 24:a.underline=!1;break;case 29:a.strikethrough=!1;break;case 30:a.foregroundColor=null;break;case 31:a.foregroundColor="red";break;case 32:a.foregroundColor="green";break;case 33:a.foregroundColor="yellow";break;case 34:a.foregroundColor="blue";break;case 35:a.foregroundColor="magenta";break;case 36:a.foregroundColor="cyan";break;case 37:a.foregroundColor="white";break;case 39:a.foregroundColor=null;break;case 40:a.backgroundColor="black";break;case 41:a.backgroundColor="red";break;case 42:a.backgroundColor="green";break;case 43:a.backgroundColor="yellow";break;case 44:a.backgroundColor="blue";break;case 45:a.backgroundColor="magenta";break;case 46:a.backgroundColor="cyan";break;case 47:a.backgroundColor="white";break;case 49:a.backgroundColor=null}}}catch(e){l=!0,u=e}finally{try{c||null==d.return||d.return()}finally{if(l)throw u}}}}return i(e.substring(r)),n}function Qt(e){return(Qt="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 Zt(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <style include="ha-style">\n :host,\n paper-card {\n display: block;\n }\n pre {\n overflow-x: auto;\n white-space: pre-wrap;\n overflow-wrap: break-word;\n }\n </style>\n ','\n <paper-card heading="Log">\n <div class="card-content" id="content"></div>\n <div class="card-actions">\n <mwc-button on-click="refresh">Refresh</mwc-button>\n </div>\n </paper-card>\n ']);return Zt=function(){return e},e}function en(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function tn(e,t){return!t||"object"!==Qt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function nn(e){return(nn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function on(e,t){return(on=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var rn=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),tn(this,nn(t).apply(this,arguments))}var n,a,i;return 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&&on(e,t)}(t,r["a"]),n=t,i=[{key:"template",get:function(){return Object(o.a)(Zt(),Vt)}},{key:"properties",get:function(){return{hass:Object,addonSlug:{type:String,observer:"addonSlugChanged"}}}}],(a=[{key:"addonSlugChanged",value:function(e){var t=this;this.hass?this.refresh():setTimeout(function(){t.addonChanged(e)},0)}},{key:"refresh",value:function(){var e=this;this.hass.callApi("get","hassio/addons/".concat(this.addonSlug,"/logs")).then(function(t){for(;e.$.content.lastChild;)e.$.content.removeChild(e.$.content.lastChild);e.$.content.appendChild(Kt(t))})}}])&&en(n.prototype,a),i&&en(n,i),t}();customElements.define("hassio-addon-logs",rn);n(36);function an(e){return(an="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 sn(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <style include="ha-style">\n :host {\n display: block;\n }\n paper-card {\n display: block;\n }\n .errors {\n color: var(--google-red-500);\n margin-bottom: 16px;\n }\n .card-actions {\n @apply --layout;\n @apply --layout-justified;\n }\n </style>\n <paper-card heading="Network">\n <div class="card-content">\n <template is="dom-if" if="[[error]]">\n <div class="errors">[[error]]</div>\n </template>\n\n <table>\n <tbody>\n <tr>\n <th>Container</th>\n <th>Host</th>\n </tr>\n <template is="dom-repeat" items="[[config]]">\n <tr>\n <td>[[item.container]]</td>\n <td>\n <paper-input\n value="{{item.host}}"\n no-label-float=""\n ></paper-input>\n </td>\n </tr>\n </template>\n </tbody>\n </table>\n </div>\n <div class="card-actions">\n <ha-call-api-button\n class="warning"\n hass="[[hass]]"\n path="hassio/addons/[[addonSlug]]/options"\n data="[[resetData]]"\n >Reset to defaults</ha-call-api-button\n >\n <mwc-button on-click="saveTapped">Save</mwc-button>\n </div>\n </paper-card>\n ']);return sn=function(){return e},e}function cn(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function ln(e,t){return!t||"object"!==an(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function un(e){return(un=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function pn(e,t){return(pn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var dn=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ln(this,un(t).apply(this,arguments))}var n,a,i;return 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&&pn(e,t)}(t,Z(r["a"])),n=t,i=[{key:"template",get:function(){return Object(o.a)(sn())}},{key:"properties",get:function(){return{hass:Object,addonSlug:String,config:Object,addon:{type:Object,observer:"addonChanged"},error:String,resetData:{type:Object,value:{network:null}}}}}],(a=[{key:"addonChanged",value:function(e){if(e){var t=e.network||{},n=Object.keys(t).map(function(e){return{container:e,host:t[e]}});this.config=n.sort(function(e,t){return e.host-t.host})}}},{key:"saveTapped",value:function(){var e=this;this.error=null;var t={};this.config.forEach(function(e){t[e.container]=parseInt(e.host)});var n="hassio/addons/".concat(this.addonSlug,"/options");this.hass.callApi("post",n,{network:t}).then(function(){e.fire("hass-api-called",{success:!0,path:n})},function(t){e.error=t.body.message})}}])&&cn(n.prototype,a),i&&cn(n,i),t}();function fn(e){return(fn="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 hn(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <style include="iron-flex ha-style">\n :host {\n color: var(--primary-text-color);\n --paper-card-header-color: var(--primary-text-color);\n }\n .content {\n padding: 24px 0 32px;\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n hassio-addon-info,\n hassio-addon-network,\n hassio-addon-audio,\n hassio-addon-config {\n margin-bottom: 24px;\n width: 600px;\n }\n hassio-addon-logs {\n max-width: calc(100% - 8px);\n min-width: 600px;\n }\n @media only screen and (max-width: 600px) {\n hassio-addon-info,\n hassio-addon-network,\n hassio-addon-audio,\n hassio-addon-config,\n hassio-addon-logs {\n max-width: 100%;\n min-width: 100%;\n }\n }\n </style>\n <app-route\n route="[[route]]"\n pattern="/addon/:slug"\n data="{{routeData}}"\n active="{{routeMatches}}"\n ></app-route>\n <app-header-layout has-scrolling-region="">\n <app-header fixed="" slot="header">\n <app-toolbar>\n <ha-menu-button hassio></ha-menu-button>\n <paper-icon-button\n icon="hassio:arrow-left"\n on-click="backTapped"\n ></paper-icon-button>\n <div main-title="">Hass.io: add-on details</div>\n </app-toolbar>\n </app-header>\n <div class="content">\n <hassio-addon-info\n hass="[[hass]]"\n addon="[[addon]]"\n addon-slug="[[routeData.slug]]"\n ></hassio-addon-info>\n\n <template is="dom-if" if="[[addon.version]]">\n <hassio-addon-config\n hass="[[hass]]"\n addon="[[addon]]"\n addon-slug="[[routeData.slug]]"\n ></hassio-addon-config>\n\n <template is="dom-if" if="[[addon.audio]]">\n <hassio-addon-audio\n hass="[[hass]]"\n addon="[[addon]]"\n ></hassio-addon-audio>\n </template>\n\n <template is="dom-if" if="[[addon.network]]">\n <hassio-addon-network\n hass="[[hass]]"\n addon="[[addon]]"\n addon-slug="[[routeData.slug]]"\n ></hassio-addon-network>\n </template>\n\n <hassio-addon-logs\n hass="[[hass]]"\n addon-slug="[[routeData.slug]]"\n ></hassio-addon-logs>\n </template>\n </div>\n </app-header-layout>\n\n <hassio-markdown-dialog\n title="[[markdownTitle]]"\n content="[[markdownContent]]"\n ></hassio-markdown-dialog>\n ']);return hn=function(){return e},e}function bn(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function yn(e,t){return!t||"object"!==fn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function mn(e,t,n){return(mn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=vn(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}function vn(e){return(vn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function gn(e,t){return(gn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}customElements.define("hassio-addon-network",dn);var wn=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),yn(this,vn(t).apply(this,arguments))}var n,a,i;return 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&&gn(e,t)}(t,r["a"]),n=t,i=[{key:"template",get:function(){return Object(o.a)(hn())}},{key:"properties",get:function(){return{hass:Object,route:Object,routeData:{type:Object,observer:"routeDataChanged"},routeMatches:Boolean,addon:Object,markdownTitle:String,markdownContent:{type:String,value:""}}}}],(a=[{key:"ready",value:function(){var e=this;mn(vn(t.prototype),"ready",this).call(this),this.addEventListener("hass-api-called",function(t){return e.apiCalled(t)}),this.addEventListener("hassio-markdown-dialog",function(t){return e.openMarkdown(t)})}},{key:"apiCalled",value:function(e){var t=e.detail.path;t&&("uninstall"===t.substr(t.lastIndexOf("/")+1)?this.backTapped():this.routeDataChanged(this.routeData))}},{key:"routeDataChanged",value:function(e){var t=this;this.routeMatches&&e&&e.slug&&this.hass.callApi("get","hassio/addons/".concat(e.slug,"/info")).then(function(e){t.addon=e.data},function(){t.addon=null})}},{key:"backTapped",value:function(){history.back()}},{key:"openMarkdown",value:function(e){this.setProperties({markdownTitle:e.detail.title,markdownContent:e.detail.content}),this.shadowRoot.querySelector("hassio-markdown-dialog").openDialog()}}])&&bn(n.prototype,a),i&&bn(n,i),t}();function kn(e){return(kn="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 On(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function jn(e,t){return!t||"object"!==kn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function _n(e,t,n){return(_n="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Sn(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}function Sn(e){return(Sn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Pn(e,t){return(Pn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}customElements.define("hassio-addon-view",wn);var xn=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),jn(this,Sn(t).apply(this,arguments))}var n,o,a;return 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&&Pn(e,t)}(t,r["a"]),n=t,a=[{key:"properties",get:function(){return{hass:Object,supervisor:{type:Object,notify:!0},host:{type:Object,notify:!0},homeassistant:{type:Object,notify:!0}}}}],(o=[{key:"connectedCallback",value:function(){_n(Sn(t.prototype),"connectedCallback",this).call(this),this.refresh()}},{key:"refresh",value:function(){return Promise.all([this.fetchSupervisorInfo(),this.fetchHostInfo(),this.fetchHassInfo()])}},{key:"fetchSupervisorInfo",value:function(){var e=this;return this.hass.callApi("get","hassio/supervisor/info").then(function(t){e.supervisor=t.data})}},{key:"fetchHostInfo",value:function(){var e=this;return this.hass.callApi("get","hassio/host/info").then(function(t){e.host=t.data})}},{key:"fetchHassInfo",value:function(){var e=this;return this.hass.callApi("get","hassio/homeassistant/info").then(function(t){e.homeassistant=t.data})}}])&&On(n.prototype,o),a&&On(n,a),t}();customElements.define("hassio-data",xn);n(77),n(109),n(35);function En(e){return(En="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 Cn(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Tn(e,t){return!t||"object"!==En(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function An(e){return(An=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Rn(e,t){return(Rn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Dn=Object(Y.a)(function(e){return function(t){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),Tn(this,An(n).apply(this,arguments))}var o,r,a;return 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&&Rn(e,t)}(n,e),o=n,(r=[{key:"navigate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];n?history.replaceState(null,"",t):history.pushState(null,"",t),i(window,"location-changed",{replace:n})}).apply(void 0,[this].concat(t))}}])&&Cn(o.prototype,r),a&&Cn(o,a),n}()});function zn(e){return(zn="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 In(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <style include="iron-flex ha-style hassio-style">\n paper-card {\n cursor: pointer;\n }\n .not_available {\n opacity: 0.6;\n }\n a.repo {\n display: block;\n color: var(--primary-text-color);\n }\n </style>\n <template is="dom-if" if="[[addons.length]]">\n <div class="card-group">\n <div class="title">\n [[repo.name]]\n <div class="description">\n Maintained by [[repo.maintainer]]\n <a class="repo" href="[[repo.url]]" target="_blank"\n >[[repo.url]]</a\n >\n </div>\n </div>\n <template\n is="dom-repeat"\n items="[[addons]]"\n as="addon"\n sort="sortAddons"\n >\n <paper-card class$="[[computeClass(addon)]]" on-click="addonTapped">\n <div class="card-content">\n <hassio-card-content\n hass="[[hass]]"\n title="[[addon.name]]"\n description="[[addon.description]]"\n available="[[addon.available]]"\n icon="[[computeIcon(addon)]]"\n icon-title="[[computeIconTitle(addon)]]"\n icon-class="[[computeIconClass(addon)]]"\n ></hassio-card-content>\n </div>\n </paper-card>\n </template>\n </div>\n </template>\n ']);return In=function(){return e},e}function Hn(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Ln(e,t){return!t||"object"!==zn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Bn(e){return(Bn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Mn(e,t){return(Mn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Nn=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Ln(this,Bn(t).apply(this,arguments))}var n,a,i;return 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&&Mn(e,t)}(t,Dn(r["a"])),n=t,i=[{key:"template",get:function(){return Object(o.a)(In())}},{key:"properties",get:function(){return{hass:Object,repo:Object,addons:Array}}}],(a=[{key:"sortAddons",value:function(e,t){return e.name.toUpperCase()<t.name.toUpperCase()?-1:1}},{key:"computeIcon",value:function(e){return e.installed&&e.installed!==e.version?"hassio:arrow-up-bold-circle":"hassio:puzzle"}},{key:"computeIconTitle",value:function(e){return e.installed?e.installed!==e.version?"New version available":"Add-on is installed":e.available?"Add-on is not installed":"Add-on is not available on your system"}},{key:"computeIconClass",value:function(e){return e.installed?e.installed!==e.version?"update":"installed":e.available?"":"not_available"}},{key:"computeClass",value:function(e){return e.available?"":"not_available"}},{key:"addonTapped",value:function(e){this.navigate("/hassio/addon/".concat(e.model.addon.slug))}}])&&Hn(n.prototype,a),i&&Hn(n,i),t}();function Un(e){return(Un="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 Fn(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <style include="ha-style hassio-style">\n .add {\n padding: 12px 16px;\n }\n iron-icon {\n color: var(--secondary-text-color);\n margin-right: 16px;\n display: inline-block;\n }\n paper-input {\n width: calc(100% - 49px);\n display: inline-block;\n }\n </style>\n <div class="card-group">\n <div class="title">\n Repositories\n <div class="description">\n Configure which add-on repositories to fetch data from:\n </div>\n </div>\n <template\n id="list"\n is="dom-repeat"\n items="[[repoList]]"\n as="repo"\n sort="sortRepos"\n >\n <paper-card>\n <div class="card-content">\n <hassio-card-content\n hass="[[hass]]"\n title="[[repo.name]]"\n description="[[repo.url]]"\n icon="hassio:github-circle"\n ></hassio-card-content>\n </div>\n <div class="card-actions">\n <ha-call-api-button\n hass="[[hass]]"\n path="hassio/supervisor/options"\n data="[[computeRemoveRepoData(repoList, repo.url)]]"\n class="warning"\n >Remove</ha-call-api-button\n >\n </div>\n </paper-card>\n </template>\n <paper-card>\n <div class="card-content add">\n <iron-icon icon="hassio:github-circle"></iron-icon>\n <paper-input\n label="Add new repository by URL"\n value="{{repoUrl}}"\n ></paper-input>\n </div>\n <div class="card-actions">\n <ha-call-api-button\n hass="[[hass]]"\n path="hassio/supervisor/options"\n data="[[computeAddRepoData(repoList, repoUrl)]]"\n >Add</ha-call-api-button\n >\n </div>\n </paper-card>\n </div>\n ']);return Fn=function(){return e},e}function qn(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function $n(e,t){return!t||"object"!==Un(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Wn(e){return(Wn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Jn(e,t){return(Jn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}customElements.define("hassio-addon-repository",Nn);var Yn=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),$n(this,Wn(t).apply(this,arguments))}var n,a,i;return 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&&Jn(e,t)}(t,r["a"]),n=t,i=[{key:"template",get:function(){return Object(o.a)(Fn())}},{key:"properties",get:function(){return{hass:Object,repos:{type:Array,observer:"reposChanged"},repoList:Array,repoUrl:String}}}],(a=[{key:"reposChanged",value:function(e){this.repoList=e.filter(function(e){return"core"!==e.slug&&"local"!==e.slug}),this.repoUrl=""}},{key:"sortRepos",value:function(e,t){return e.name<t.name?-1:1}},{key:"computeRemoveRepoData",value:function(e,t){return{addons_repositories:e.filter(function(e){return e.url!==t}).map(function(e){return e.source})}}},{key:"computeAddRepoData",value:function(e,t){var n=e?e.map(function(e){return e.source}):[];return n.push(t),{addons_repositories:n}}}])&&qn(n.prototype,a),i&&qn(n,i),t}();function Gn(e){return(Gn="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 Xn(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <style include="iron-flex ha-style">\n hassio-addon-repository {\n margin-top: 24px;\n }\n </style>\n <hassio-repositories-editor\n hass="[[hass]]"\n repos="[[repos]]"\n ></hassio-repositories-editor>\n\n <template is="dom-repeat" items="[[repos]]" as="repo" sort="sortRepos">\n <hassio-addon-repository\n hass="[[hass]]"\n repo="[[repo]]"\n addons="[[computeAddons(repo.slug)]]"\n ></hassio-addon-repository>\n </template>\n ']);return Xn=function(){return e},e}function Vn(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Kn(e,t){return!t||"object"!==Gn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Qn(e,t,n){return(Qn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Zn(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}function Zn(e){return(Zn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eo(e,t){return(eo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}customElements.define("hassio-repositories-editor",Yn);var to=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Kn(this,Zn(t).apply(this,arguments))}var n,a,i;return 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&&eo(e,t)}(t,r["a"]),n=t,i=[{key:"template",get:function(){return Object(o.a)(Xn())}},{key:"properties",get:function(){return{hass:Object,addons:Array,repos:Array}}}],(a=[{key:"ready",value:function(){var e=this;Qn(Zn(t.prototype),"ready",this).call(this),this.addEventListener("hass-api-called",function(t){return e.apiCalled(t)}),this.loadData()}},{key:"apiCalled",value:function(e){e.detail.success&&this.loadData()}},{key:"sortRepos",value:function(e,t){return"local"===e.slug?-1:"local"===t.slug?1:"core"===e.slug?-1:"core"===t.slug?1:e.name.toUpperCase()<t.name.toUpperCase()?-1:1}},{key:"computeAddons",value:function(e){return this.addons.filter(function(t){return t.repository===e})}},{key:"loadData",value:function(){var e=this;this.hass.callApi("get","hassio/addons").then(function(t){e.addons=t.data.addons,e.repos=t.data.repositories},function(){e.addons=[],e.repos=[]})}},{key:"refreshData",value:function(){var e=this;this.hass.callApi("post","hassio/addons/reload").then(function(){e.loadData()})}}])&&Vn(n.prototype,a),i&&Vn(n,i),t}();function no(e){return(no="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 oo(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <style include="ha-style hassio-style">\n paper-card {\n cursor: pointer;\n }\n </style>\n <div class="content card-group">\n <div class="title">Add-ons</div>\n <template is="dom-if" if="[[!addons.length]]">\n <paper-card>\n <div class="card-content">\n You don\'t have any add-ons installed yet. Head over to\n <a href="#" on-click="openStore">the add-on store</a> to get\n started!\n </div>\n </paper-card>\n </template>\n <template\n is="dom-repeat"\n items="[[addons]]"\n as="addon"\n sort="sortAddons"\n >\n <paper-card on-click="addonTapped">\n <div class="card-content">\n <hassio-card-content\n hass="[[hass]]"\n title="[[addon.name]]"\n description="[[addon.description]]"\n available="[[addon.available]]"\n icon="[[computeIcon(addon)]]"\n icon-title="[[computeIconTitle(addon)]]"\n icon-class="[[computeIconClass(addon)]]"\n ></hassio-card-content>\n </div>\n </paper-card>\n </template>\n </div>\n ']);return oo=function(){return e},e}function ro(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function ao(e,t){return!t||"object"!==no(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function io(e){return(io=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function so(e,t){return(so=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}customElements.define("hassio-addon-store",to);var co=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ao(this,io(t).apply(this,arguments))}var n,a,i;return 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&&so(e,t)}(t,Dn(r["a"])),n=t,i=[{key:"template",get:function(){return Object(o.a)(oo())}},{key:"properties",get:function(){return{hass:Object,addons:Array}}}],(a=[{key:"sortAddons",value:function(e,t){return e.name<t.name?-1:1}},{key:"computeIcon",value:function(e){return e.installed!==e.version?"hassio:arrow-up-bold-circle":"hassio:puzzle"}},{key:"computeIconTitle",value:function(e){return e.installed!==e.version?"New version available":"started"===e.state?"Add-on is running":"Add-on is stopped"}},{key:"computeIconClass",value:function(e){return e.installed!==e.version?"update":"started"===e.state?"running":""}},{key:"addonTapped",value:function(e){this.navigate("/hassio/addon/"+e.model.addon.slug),e.target.blur()}},{key:"openStore",value:function(e){this.navigate("/hassio/store"),e.target.blur()}}])&&ro(n.prototype,a),i&&ro(n,i),t}();function lo(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <style include="ha-style hassio-style">\n paper-card {\n display: block;\n margin-bottom: 32px;\n }\n .errors {\n color: var(--google-red-500);\n margin-top: 16px;\n }\n a {\n color: var(--primary-color);\n }\n </style>\n <template is="dom-if" if="[[computeUpdateAvailable(hassInfo)]]">\n <div class="content">\n <div class="card-group">\n <div class="title">Update available! 🎉</div>\n <paper-card>\n <div class="card-content">\n <hassio-card-content\n hass="[[hass]]"\n title="Home Assistant [[hassInfo.last_version]] is available"\n description="You are currently running version [[hassInfo.version]]"\n icon="hassio:home-assistant"\n icon-class="hassupdate"\n ></hassio-card-content>\n <template is="dom-if" if="[[error]]">\n <div class="error">Error: [[error]]</div>\n </template>\n <p>\n <a\n href="https://www.home-assistant.io/latest-release-notes/"\n target="_blank"\n >Read the release notes</a\n >\n </p>\n </div>\n <div class="card-actions">\n <ha-call-api-button\n hass="[[hass]]"\n path="hassio/homeassistant/update"\n >Update</ha-call-api-button\n >\n <a\n href="https://github.com/home-assistant/home-assistant/releases"\n target="_blank"\n ><mwc-button>Release notes</mwc-button></a\n >\n </div>\n </paper-card>\n </div>\n </div>\n </template>\n ']);return lo=function(){return e},e}function uo(e){return(uo="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 po(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function fo(e,t){return!t||"object"!==uo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ho(e,t,n){return(ho="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=bo(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}function bo(e){return(bo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function yo(e,t){return(yo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}customElements.define("hassio-addons",co);var mo=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),fo(this,bo(t).apply(this,arguments))}var n,a,i;return 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&&yo(e,t)}(t,r["a"]),n=t,i=[{key:"template",get:function(){return Object(o.a)(lo())}},{key:"properties",get:function(){return{hass:Object,hassInfo:Object,error:String}}}],(a=[{key:"ready",value:function(){var e=this;ho(bo(t.prototype),"ready",this).call(this),this.addEventListener("hass-api-called",function(t){return e.apiCalled(t)})}},{key:"apiCalled",value:function(e){if(e.detail.success)this.errors=null;else{var t=e.detail.response;"object"===uo(t.body)?this.errors=t.body.message||"Unknown error":this.errors=t.body}}},{key:"computeUpdateAvailable",value:function(e){return e.version!==e.last_version}}])&&po(n.prototype,a),i&&po(n,i),t}();function vo(e){return(vo="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 go(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <style include="iron-flex ha-style">\n .content {\n margin: 0 auto;\n }\n </style>\n <div class="content">\n <hassio-hass-update\n hass="[[hass]]"\n hass-info="[[hassInfo]]"\n ></hassio-hass-update>\n <hassio-addons\n hass="[[hass]]"\n addons="[[supervisorInfo.addons]]"\n ></hassio-addons>\n </div>\n ']);return go=function(){return e},e}function wo(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function ko(e,t){return!t||"object"!==vo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Oo(e){return(Oo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function jo(e,t){return(jo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}customElements.define("hassio-hass-update",mo);var _o=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ko(this,Oo(t).apply(this,arguments))}var n,a,i;return 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&&jo(e,t)}(t,Z(r["a"])),n=t,i=[{key:"template",get:function(){return Object(o.a)(go())}},{key:"properties",get:function(){return{hass:Object,supervisorInfo:Object,hassInfo:Object}}}],(a=null)&&wo(n.prototype,a),i&&wo(n,i),t}();customElements.define("hassio-dashboard",_o);n(79);function So(e){return(So="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 Po(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <style include="ha-style-dialog">\n paper-dialog {\n min-width: 350px;\n font-size: 14px;\n border-radius: 2px;\n }\n app-toolbar {\n margin: 0;\n padding: 0 16px;\n color: var(--primary-text-color);\n background-color: var(--secondary-background-color);\n }\n app-toolbar [main-title] {\n margin-left: 16px;\n }\n paper-dialog-scrollable {\n margin: 0;\n }\n paper-checkbox {\n display: block;\n margin: 4px;\n }\n @media all and (max-width: 450px), all and (max-height: 500px) {\n paper-dialog {\n max-height: 100%;\n height: 100%;\n }\n app-toolbar {\n color: var(--text-primary-color);\n background-color: var(--primary-color);\n }\n }\n .details {\n color: var(--secondary-text-color);\n }\n .download {\n color: var(--primary-color);\n }\n .warning,\n .error {\n color: var(--google-red-500);\n }\n </style>\n <paper-dialog\n id="dialog"\n with-backdrop=""\n on-iron-overlay-closed="_dialogClosed"\n >\n <app-toolbar>\n <paper-icon-button\n icon="hassio:close"\n dialog-dismiss=""\n ></paper-icon-button>\n <div main-title="">[[_computeName(snapshot)]]</div>\n </app-toolbar>\n <div class="details">\n [[_computeType(snapshot.type)]] ([[_computeSize(snapshot.size)]])<br />\n [[_formatDatetime(snapshot.date)]]\n </div>\n <div>Home Assistant:</div>\n <paper-checkbox checked="{{restoreHass}}">\n Home Assistant [[snapshot.homeassistant]]\n </paper-checkbox>\n <template is="dom-if" if="[[snapshot.addons.length]]">\n <div>Folders:</div>\n <template is="dom-repeat" items="[[snapshot.folders]]">\n <paper-checkbox checked="{{item.checked}}">\n [[item.name]]\n </paper-checkbox>\n </template>\n </template>\n <template is="dom-if" if="[[snapshot.addons.length]]">\n <div>Add-ons:</div>\n <paper-dialog-scrollable>\n <template\n is="dom-repeat"\n items="[[snapshot.addons]]"\n sort="_sortAddons"\n >\n <paper-checkbox checked="{{item.checked}}">\n [[item.name]] <span class="details">([[item.version]])</span>\n </paper-checkbox>\n </template>\n </paper-dialog-scrollable>\n </template>\n <template is="dom-if" if="[[snapshot.protected]]">\n <paper-input\n autofocus=""\n label="Password"\n type="password"\n value="{{snapshotPassword}}"\n ></paper-input>\n </template>\n <template is="dom-if" if="[[error]]">\n <p class="error">Error: [[error]]</p>\n </template>\n <div class="buttons">\n <paper-icon-button\n icon="hassio:delete"\n on-click="_deleteClicked"\n class="warning"\n title="Delete snapshot"\n ></paper-icon-button>\n <paper-icon-button\n on-click="_downloadClicked"\n icon="hassio:download"\n class="download"\n title="Download snapshot"\n ></paper-icon-button>\n <mwc-button on-click="_partialRestoreClicked"\n >Restore selected</mwc-button\n >\n <template is="dom-if" if="[[_isFullSnapshot(snapshot.type)]]">\n <mwc-button on-click="_fullRestoreClicked"\n >Wipe &amp; restore</mwc-button\n >\n </template>\n </div>\n </paper-dialog>\n ']);return Po=function(){return e},e}function xo(e,t,n,o,r,a,i){try{var s=e[a](i),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(o,r)}function Eo(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Co(e,t){return!t||"object"!==So(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function To(e){return(To=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ao(e,t){return(Ao=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ro=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Co(this,To(t).apply(this,arguments))}var n,a,i;return 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&&Ao(e,t)}(t,r["a"]),n=t,a=[{key:"_snapshotSlugChanged",value:function(e){var t=this;e&&"update"!==e&&this.hass.callApi("get","hassio/snapshots/".concat(e,"/info")).then(function(e){e.data.folders=t._computeFolders(e.data.folders),e.data.addons=t._computeAddons(e.data.addons),t.snapshot=e.data,t.$.dialog.open()},function(){t.snapshot=null})}},{key:"_computeFolders",value:function(e){var t=[];return e.includes("homeassistant")&&t.push({slug:"homeassistant",name:"Home Assistant configuration",checked:!0}),e.includes("ssl")&&t.push({slug:"ssl",name:"SSL",checked:!0}),e.includes("share")&&t.push({slug:"share",name:"Share",checked:!0}),e.includes("addons/local")&&t.push({slug:"addons/local",name:"Local add-ons",checked:!0}),t}},{key:"_computeAddons",value:function(e){return e.map(function(e){return{slug:e.slug,name:e.name,version:e.version,checked:!0}})}},{key:"_isFullSnapshot",value:function(e){return"full"===e}},{key:"_partialRestoreClicked",value:function(){var e=this;if(confirm("Are you sure you want to restore this snapshot?")){var t=this.snapshot.addons.filter(function(e){return e.checked}).map(function(e){return e.slug}),n=this.snapshot.folders.filter(function(e){return e.checked}).map(function(e){return e.slug}),o={homeassistant:this.restoreHass,addons:t,folders:n};this.snapshot.protected&&(o.password=this.snapshotPassword),this.hass.callApi("post","hassio/snapshots/".concat(this.snapshotSlug,"/restore/partial"),o).then(function(){alert("Snapshot restored!"),e.$.dialog.close()},function(t){e.error=t.body.message})}}},{key:"_fullRestoreClicked",value:function(){var e=this;if(confirm("Are you sure you want to restore this snapshot?")){var t=this.snapshot.protected?{password:this.snapshotPassword}:null;this.hass.callApi("post","hassio/snapshots/".concat(this.snapshotSlug,"/restore/full"),t).then(function(){alert("Snapshot restored!"),e.$.dialog.close()},function(t){e.error=t.body.message})}}},{key:"_deleteClicked",value:function(){var e=this;confirm("Are you sure you want to delete this snapshot?")&&this.hass.callApi("post","hassio/snapshots/".concat(this.snapshotSlug,"/remove")).then(function(){e.$.dialog.close(),e.snapshotDeleted=!0},function(t){e.error=t.body.message})}},{key:"_downloadClicked",value:function(){var e,t=(e=regeneratorRuntime.mark(function e(){var t,n,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r=this.hass,a="/api/hassio/snapshots/".concat(this.snapshotSlug,"/download"),r.callWS({type:"auth/sign_path",path:a});case 3:t=e.sent,e.next=10;break;case 6:return e.prev=6,e.t0=e.catch(0),alert("Error: ".concat(e.t0.message)),e.abrupt("return");case 10:n=this._computeName(this.snapshot).replace(/[^a-z0-9]+/gi,"_"),(o=document.createElement("A")).href=t.path,o.download="Hass_io_".concat(n,".tar"),this.$.dialog.appendChild(o),o.click(),this.$.dialog.removeChild(o);case 17:case"end":return e.stop()}var r,a},e,this,[[0,6]])}),function(){var t=this,n=arguments;return new Promise(function(o,r){var a=e.apply(t,n);function i(e){xo(a,o,r,i,s,"next",e)}function s(e){xo(a,o,r,i,s,"throw",e)}i(void 0)})});return function(){return t.apply(this,arguments)}}()},{key:"_computeName",value:function(e){return e.name||e.slug}},{key:"_computeType",value:function(e){return"full"===e?"Full snapshot":"Partial snapshot"}},{key:"_computeSize",value:function(e){return Math.ceil(10*e)/10+" MB"}},{key:"_sortAddons",value:function(e,t){return e.name<t.name?-1:1}},{key:"_formatDatetime",value:function(e){return new Date(e).toLocaleDateString(navigator.language,{weekday:"long",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}},{key:"_dialogClosed",value:function(){this.snapshotSlug=null}}],i=[{key:"template",get:function(){return Object(o.a)(Po())}},{key:"properties",get:function(){return{hass:Object,snapshotSlug:{type:String,notify:!0,observer:"_snapshotSlugChanged"},snapshotDeleted:{type:Boolean,notify:!0},snapshot:Object,restoreHass:{type:Boolean,value:!0},snapshotPassword:String,error:String}}}],a&&Eo(n.prototype,a),i&&Eo(n,i),t}();customElements.define("hassio-snapshot",Ro);n(80),n(99);function Do(e){return(Do="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 zo(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <style include="ha-style hassio-style">\n paper-radio-group {\n display: block;\n }\n paper-radio-button {\n padding: 0 0 2px 2px;\n }\n paper-radio-button,\n paper-checkbox,\n paper-input[type="password"] {\n display: block;\n margin: 4px 0 4px 48px;\n }\n .pointer {\n cursor: pointer;\n }\n </style>\n <div class="content">\n <div class="card-group">\n <div class="title">\n Create snapshot\n <div class="description">\n Snapshots allow you to easily backup and restore all data of your\n Hass.io instance.\n </div>\n </div>\n <paper-card>\n <div class="card-content">\n <paper-input\n autofocus=""\n label="Name"\n value="{{snapshotName}}"\n ></paper-input>\n Type:\n <paper-radio-group selected="{{snapshotType}}">\n <paper-radio-button name="full">\n Full snapshot\n </paper-radio-button>\n <paper-radio-button name="partial">\n Partial snapshot\n </paper-radio-button>\n </paper-radio-group>\n <template is="dom-if" if="[[!_fullSelected(snapshotType)]]">\n Folders:\n <template is="dom-repeat" items="[[folderList]]">\n <paper-checkbox checked="{{item.checked}}">\n [[item.name]]\n </paper-checkbox>\n </template>\n Add-ons:\n <template\n is="dom-repeat"\n items="[[addonList]]"\n sort="_sortAddons"\n >\n <paper-checkbox checked="{{item.checked}}">\n [[item.name]]\n </paper-checkbox>\n </template>\n </template>\n Security:\n <paper-checkbox checked="{{snapshotHasPassword}}"\n >Password protection</paper-checkbox\n >\n <template is="dom-if" if="[[snapshotHasPassword]]">\n <paper-input\n label="Password"\n type="password"\n value="{{snapshotPassword}}"\n ></paper-input>\n </template>\n <template is="dom-if" if="[[error]]">\n <p class="error">[[error]]</p>\n </template>\n </div>\n <div class="card-actions">\n <mwc-button\n disabled="[[creatingSnapshot]]"\n on-click="_createSnapshot"\n >Create</mwc-button\n >\n </div>\n </paper-card>\n </div>\n\n <div class="card-group">\n <div class="title">Available snapshots</div>\n <template is="dom-if" if="[[!snapshots.length]]">\n <paper-card>\n <div class="card-content">You don\'t have any snapshots yet.</div>\n </paper-card>\n </template>\n <template\n is="dom-repeat"\n items="[[snapshots]]"\n as="snapshot"\n sort="_sortSnapshots"\n >\n <paper-card class="pointer" on-click="_snapshotClicked">\n <div class="card-content">\n <hassio-card-content\n hass="[[hass]]"\n title="[[_computeName(snapshot)]]"\n description="[[_computeDetails(snapshot)]]"\n datetime="[[snapshot.date]]"\n icon="[[_computeIcon(snapshot.type)]]"\n icon-class="snapshot"\n ></hassio-card-content>\n </div>\n </paper-card>\n </template>\n </div>\n </div>\n ']);return zo=function(){return e},e}function Io(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Ho(e,t){return!t||"object"!==Do(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Lo(e,t,n){return(Lo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Bo(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}function Bo(e){return(Bo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Mo(e,t){return(Mo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var No=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Ho(this,Bo(t).apply(this,arguments))}var n,a,i;return 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&&Mo(e,t)}(t,Z(r["a"])),n=t,i=[{key:"template",get:function(){return Object(o.a)(zo())}},{key:"properties",get:function(){return{hass:Object,snapshotName:{type:String,value:""},snapshotPassword:{type:String,value:""},snapshotHasPassword:Boolean,snapshotType:{type:String,value:"full"},snapshots:{type:Array,value:[]},installedAddons:{type:Array,observer:"_installedAddonsChanged"},addonList:Array,folderList:{type:Array,value:[{slug:"homeassistant",name:"Home Assistant configuration",checked:!0},{slug:"ssl",name:"SSL",checked:!0},{slug:"share",name:"Share",checked:!0},{slug:"addons/local",name:"Local add-ons",checked:!0}]},snapshotSlug:{type:String,notify:!0},snapshotDeleted:{type:Boolean,notify:!0,observer:"_snapshotDeletedChanged"},creatingSnapshot:Boolean,dialogOpened:Boolean,error:String}}}],(a=[{key:"ready",value:function(){var e=this;Lo(Bo(t.prototype),"ready",this).call(this),this.addEventListener("hass-api-called",function(t){return e._apiCalled(t)}),this._updateSnapshots()}},{key:"_apiCalled",value:function(e){e.detail.success&&this._updateSnapshots()}},{key:"_updateSnapshots",value:function(){var e=this;this.hass.callApi("get","hassio/snapshots").then(function(t){e.snapshots=t.data.snapshots},function(t){e.error=t.message})}},{key:"_createSnapshot",value:function(){var e=this;if(this.error="",!this.snapshotHasPassword||this.snapshotPassword.length){this.creatingSnapshot=!0;var t,n,o=this.snapshotName;if(o.length||(o=(new Date).toLocaleDateString(navigator.language,{weekday:"long",year:"numeric",month:"short",day:"numeric"})),"full"===this.snapshotType)t={name:o},n="hassio/snapshots/new/full";else{var r=this.addonList.filter(function(e){return e.checked}).map(function(e){return e.slug});t={name:o,folders:this.folderList.filter(function(e){return e.checked}).map(function(e){return e.slug}),addons:r},n="hassio/snapshots/new/partial"}this.snapshotHasPassword&&(t.password=this.snapshotPassword),this.hass.callApi("post",n,t).then(function(){e.creatingSnapshot=!1,e.fire("hass-api-called",{success:!0})},function(t){e.creatingSnapshot=!1,e.error=t.message})}else this.error="Please enter a password."}},{key:"_installedAddonsChanged",value:function(e){this.addonList=e.map(function(e){return{slug:e.slug,name:e.name,checked:!0}})}},{key:"_sortAddons",value:function(e,t){return e.name<t.name?-1:1}},{key:"_sortSnapshots",value:function(e,t){return e.date<t.date?1:-1}},{key:"_computeName",value:function(e){return e.name||e.slug}},{key:"_computeDetails",value:function(e){var t="full"===e.type?"Full snapshot":"Partial snapshot";return e.protected?"".concat(t,", password protected"):t}},{key:"_computeIcon",value:function(e){return"full"===e?"hassio:package-variant-closed":"hassio:package-variant"}},{key:"_snapshotClicked",value:function(e){this.snapshotSlug=e.model.snapshot.slug}},{key:"_fullSelected",value:function(e){return"full"===e}},{key:"_snapshotDeletedChanged",value:function(e){e&&(this._updateSnapshots(),this.snapshotDeleted=!1)}},{key:"refreshData",value:function(){var e=this;this.hass.callApi("post","hassio/snapshots/reload").then(function(){e._updateSnapshots()})}}])&&Io(n.prototype,a),i&&Io(n,i),t}();customElements.define("hassio-snapshots",No);n(100);function Uo(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <style include="iron-flex ha-style">\n paper-card {\n display: inline-block;\n width: 400px;\n margin-left: 8px;\n }\n .card-content {\n height: 200px;\n color: var(--primary-text-color);\n }\n @media screen and (max-width: 830px) {\n paper-card {\n margin-top: 8px;\n margin-left: 0;\n width: 100%;\n }\n .card-content {\n height: auto;\n }\n }\n .info {\n width: 100%;\n }\n .info td:nth-child(2) {\n text-align: right;\n }\n .errors {\n color: var(--google-red-500);\n margin-top: 16px;\n }\n mwc-button.info {\n max-width: calc(50% - 12px);\n }\n table.info {\n margin-bottom: 10px;\n }\n </style>\n <paper-card>\n <div class="card-content">\n <h2>Host system</h2>\n <table class="info">\n <tbody>\n <tr>\n <td>Hostname</td>\n <td>[[data.hostname]]</td>\n </tr>\n <tr>\n <td>System</td>\n <td>[[data.operating_system]]</td>\n </tr>\n <template is="dom-if" if="[[data.deployment]]">\n <tr>\n <td>Deployment</td>\n <td>[[data.deployment]]</td>\n </tr>\n </template>\n </tbody>\n </table>\n <mwc-button raised on-click="_showHardware" class="info">\n Hardware\n </mwc-button>\n <template is="dom-if" if="[[_featureAvailable(data, \'hostname\')]]">\n <mwc-button raised on-click="_changeHostnameClicked" class="info">\n Change hostname\n </mwc-button>\n </template>\n <template is="dom-if" if="[[errors]]">\n <div class="errors">Error: [[errors]]</div>\n </template>\n </div>\n <div class="card-actions">\n <template is="dom-if" if="[[_featureAvailable(data, \'reboot\')]]">\n <ha-call-api-button\n class="warning"\n hass="[[hass]]"\n path="hassio/host/reboot"\n >Reboot</ha-call-api-button\n >\n </template>\n <template is="dom-if" if="[[_featureAvailable(data, \'shutdown\')]]">\n <ha-call-api-button\n class="warning"\n hass="[[hass]]"\n path="hassio/host/shutdown"\n >Shutdown</ha-call-api-button\n >\n </template>\n <template is="dom-if" if="[[_featureAvailable(data, \'hassos\')]]">\n <ha-call-api-button\n class="warning"\n hass="[[hass]]"\n path="hassio/hassos/config/sync"\n title="Load HassOS configs or updates from USB"\n >Import from USB</ha-call-api-button\n >\n </template>\n <template is="dom-if" if="[[_computeUpdateAvailable(_hassOs)]]">\n <ha-call-api-button hass="[[hass]]" path="hassio/hassos/update"\n >Update</ha-call-api-button\n >\n </template>\n </div>\n </paper-card>\n ']);return Uo=function(){return e},e}function Fo(e){return(Fo="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 qo(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function $o(e,t){return!t||"object"!==Fo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Wo(e,t,n){return(Wo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Jo(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}function Jo(e){return(Jo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Yo(e,t){return(Yo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Go=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),$o(this,Jo(t).apply(this,arguments))}var n,a,i;return 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&&Yo(e,t)}(t,Z(r["a"])),n=t,i=[{key:"template",get:function(){return Object(o.a)(Uo())}},{key:"properties",get:function(){return{hass:Object,data:{type:Object,observer:"_dataChanged"},errors:String,_hassOs:Object}}}],(a=[{key:"ready",value:function(){var e=this;Wo(Jo(t.prototype),"ready",this).call(this),this.addEventListener("hass-api-called",function(t){return e.apiCalled(t)})}},{key:"apiCalled",value:function(e){if(e.detail.success)this.errors=null;else{var t=e.detail.response;"object"===Fo(t.body)?this.errors=t.body.message||"Unknown error":this.errors=t.body}}},{key:"_dataChanged",value:function(e){var t=this;e.features&&e.features.includes("hassos")?this.hass.callApi("get","hassio/hassos/info").then(function(e){t._hassOs=e.data}):this._hassOs={}}},{key:"_computeUpdateAvailable",value:function(e){return e&&e.version!==e.version_latest}},{key:"_featureAvailable",value:function(e,t){return e&&e.features&&e.features.includes(t)}},{key:"_showHardware",value:function(){var e=this;this.hass.callApi("get","hassio/hardware/info").then(function(t){return e._objectToMarkdown(t.data)},function(){return"Error getting hardware info"}).then(function(t){e.fire("hassio-markdown-dialog",{title:"Hardware",content:t})})}},{key:"_objectToMarkdown",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o="";return Object.keys(e).forEach(function(r){"object"!==Fo(e[r])?o+="".concat(n,"- ").concat(r,": ").concat(e[r],"\n"):(o+="".concat(n,"- ").concat(r,":\n"),Array.isArray(e[r])?e[r].length&&(o+="".concat(n," - ")+e[r].join("\n".concat(n," - "))+"\n"):o+=t._objectToMarkdown(e[r]," ".concat(n)))}),o}},{key:"_changeHostnameClicked",value:function(){var e=this.data.hostname,t=prompt("Please enter a new hostname:",e);t&&t!==e&&this.hass.callApi("post","hassio/host/options",{hostname:t})}}])&&qo(n.prototype,a),i&&qo(n,i),t}();function Xo(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <style include="iron-flex ha-style">\n paper-card {\n display: inline-block;\n width: 400px;\n }\n .card-content {\n height: 200px;\n color: var(--primary-text-color);\n }\n @media screen and (max-width: 830px) {\n paper-card {\n width: 100%;\n }\n .card-content {\n height: auto;\n }\n }\n .info {\n width: 100%;\n }\n .info td:nth-child(2) {\n text-align: right;\n }\n .errors {\n color: var(--google-red-500);\n margin-top: 16px;\n }\n </style>\n <paper-card>\n <div class="card-content">\n <h2>Hass.io supervisor</h2>\n <table class="info">\n <tbody>\n <tr>\n <td>Version</td>\n <td>[[data.version]]</td>\n </tr>\n <tr>\n <td>Latest version</td>\n <td>[[data.last_version]]</td>\n </tr>\n <template is="dom-if" if=\'[[!_equals(data.channel, "stable")]]\'>\n <tr>\n <td>Channel</td>\n <td>[[data.channel]]</td>\n </tr>\n </template>\n </tbody>\n </table>\n <template is="dom-if" if="[[errors]]">\n <div class="errors">Error: [[errors]]</div>\n </template>\n </div>\n <div class="card-actions">\n <ha-call-api-button hass="[[hass]]" path="hassio/supervisor/reload"\n >Reload</ha-call-api-button\n >\n <template is="dom-if" if="[[computeUpdateAvailable(data)]]">\n <ha-call-api-button hass="[[hass]]" path="hassio/supervisor/update"\n >Update</ha-call-api-button\n >\n </template>\n <template is="dom-if" if=\'[[_equals(data.channel, "beta")]]\'>\n <ha-call-api-button\n hass="[[hass]]"\n path="hassio/supervisor/options"\n data="[[leaveBeta]]"\n >Leave beta channel</ha-call-api-button\n >\n </template>\n <template is="dom-if" if=\'[[_equals(data.channel, "stable")]]\'>\n <mwc-button\n on-click="_joinBeta"\n class="warning"\n title="Get beta updates for Home Assistant (RCs), supervisor and host"\n >Join beta channel</mwc-button\n >\n </template>\n </div>\n </paper-card>\n ']);return Xo=function(){return e},e}function Vo(e){return(Vo="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 Ko(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Qo(e,t){return!t||"object"!==Vo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Zo(e,t,n){return(Zo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=er(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}function er(e){return(er=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function tr(e,t){return(tr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}customElements.define("hassio-host-info",Go);var nr=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Qo(this,er(t).apply(this,arguments))}var n,a,i;return 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&&tr(e,t)}(t,Z(r["a"])),n=t,i=[{key:"template",get:function(){return Object(o.a)(Xo())}},{key:"properties",get:function(){return{hass:Object,data:Object,errors:String,leaveBeta:{type:Object,value:{channel:"stable"}}}}}],(a=[{key:"ready",value:function(){var e=this;Zo(er(t.prototype),"ready",this).call(this),this.addEventListener("hass-api-called",function(t){return e.apiCalled(t)})}},{key:"apiCalled",value:function(e){if(e.detail.success)this.errors=null;else{var t=e.detail.response;"object"===Vo(t.body)?this.errors=t.body.message||"Unknown error":this.errors=t.body}}},{key:"computeUpdateAvailable",value:function(e){return e.version!==e.last_version}},{key:"_equals",value:function(e,t){return e===t}},{key:"_joinBeta",value:function(){var e=this;if(confirm("WARNING:\nBeta releases are for testers and early adopters and can contain unstable code changes. Make sure you have backups of your data before you activate this feature.\n\nThis inludes beta releases for:\n- Home Assistant (Release Candidates)\n- Hass.io supervisor\n- Host system")){var t="hassio/supervisor/options",n={channel:"beta"},o={method:"post",path:t,data:n};this.hass.callApi("post",t,n).then(function(e){o.success=!0,o.response=e},function(e){o.success=!1,o.response=e}).then(function(){e.fire("hass-api-called",o)})}}}])&&Ko(n.prototype,a),i&&Ko(n,i),t}();function or(e){return(or="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 rr(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <style include="ha-style">\n paper-card {\n display: block;\n }\n pre {\n overflow-x: auto;\n white-space: pre-wrap;\n overflow-wrap: break-word;\n }\n .fg-green {\n color: var(--primary-text-color) !important;\n }\n </style>\n ','\n <paper-card>\n <div class="card-content" id="content"></div>\n <div class="card-actions">\n <mwc-button on-click="refresh">Refresh</mwc-button>\n </div>\n </paper-card>\n ']);return rr=function(){return e},e}function ar(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function ir(e,t){return!t||"object"!==or(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function sr(e,t,n){return(sr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=cr(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}function cr(e){return(cr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function lr(e,t){return(lr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}customElements.define("hassio-supervisor-info",nr);var ur=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ir(this,cr(t).apply(this,arguments))}var n,a,i;return 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&&lr(e,t)}(t,r["a"]),n=t,i=[{key:"template",get:function(){return Object(o.a)(rr(),Vt)}},{key:"properties",get:function(){return{hass:Object}}}],(a=[{key:"ready",value:function(){sr(cr(t.prototype),"ready",this).call(this),this.loadData()}},{key:"loadData",value:function(){var e=this;this.hass.callApi("get","hassio/supervisor/logs").then(function(t){for(;e.$.content.lastChild;)e.$.content.removeChild(e.$.content.lastChild);e.$.content.appendChild(Kt(t))},function(){e.$.content.innerHTML='<span class="fg-red bold">Error fetching logs</span>'})}},{key:"refresh",value:function(){this.loadData()}}])&&ar(n.prototype,a),i&&ar(n,i),t}();function pr(e){return(pr="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 dr(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <style include="iron-flex ha-style">\n .content {\n margin: 4px;\n color: var(--primary-text-color);\n }\n .title {\n margin-top: 24px;\n color: var(--primary-text-color);\n font-size: 2em;\n padding-left: 8px;\n margin-bottom: 8px;\n }\n </style>\n <div class="content">\n <div class="title">Information</div>\n <hassio-supervisor-info\n hass="[[hass]]"\n data="[[supervisorInfo]]"\n ></hassio-supervisor-info>\n <hassio-host-info\n hass="[[hass]]"\n data="[[hostInfo]]"\n ></hassio-host-info>\n <div class="title">System log</div>\n <hassio-supervisor-log hass="[[hass]]"></hassio-supervisor-log>\n </div>\n ']);return dr=function(){return e},e}function fr(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function hr(e,t){return!t||"object"!==pr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function br(e){return(br=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function yr(e,t){return(yr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}customElements.define("hassio-supervisor-log",ur);var mr=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),hr(this,br(t).apply(this,arguments))}var n,a,i;return 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&&yr(e,t)}(t,r["a"]),n=t,i=[{key:"template",get:function(){return Object(o.a)(dr())}},{key:"properties",get:function(){return{hass:Object,supervisorInfo:Object,hostInfo:Object}}}],(a=null)&&fr(n.prototype,a),i&&fr(n,i),t}();function vr(e){return(vr="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 gr(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <style include="iron-flex iron-positioning ha-style">\n :host {\n color: var(--primary-text-color);\n --paper-card-header-color: var(--primary-text-color);\n }\n paper-tabs {\n margin-left: 12px;\n --paper-tabs-selection-bar-color: #fff;\n text-transform: uppercase;\n }\n </style>\n <app-header-layout id="layout" has-scrolling-region>\n <app-header fixed slot="header">\n <app-toolbar>\n <ha-menu-button hassio></ha-menu-button>\n <div main-title>Hass.io</div>\n <template is="dom-if" if="[[showRefreshButton(page)]]">\n <paper-icon-button\n icon="hassio:refresh"\n on-click="refreshClicked"\n ></paper-icon-button>\n </template>\n </app-toolbar>\n <paper-tabs\n scrollable=""\n selected="[[page]]"\n attr-for-selected="page-name"\n on-iron-activate="handlePageSelected"\n >\n <paper-tab page-name="dashboard">Dashboard</paper-tab>\n <paper-tab page-name="snapshots">Snapshots</paper-tab>\n <paper-tab page-name="store">Add-on store</paper-tab>\n <paper-tab page-name="system">System</paper-tab>\n </paper-tabs>\n </app-header>\n <template is="dom-if" if=\'[[equals(page, "dashboard")]]\'>\n <hassio-dashboard\n hass="[[hass]]"\n supervisor-info="[[supervisorInfo]]"\n hass-info="[[hassInfo]]"\n ></hassio-dashboard>\n </template>\n <template is="dom-if" if=\'[[equals(page, "snapshots")]]\'>\n <hassio-snapshots\n hass="[[hass]]"\n installed-addons="[[supervisorInfo.addons]]"\n snapshot-slug="{{snapshotSlug}}"\n snapshot-deleted="{{snapshotDeleted}}"\n ></hassio-snapshots>\n </template>\n <template is="dom-if" if=\'[[equals(page, "store")]]\'>\n <hassio-addon-store hass="[[hass]]"></hassio-addon-store>\n </template>\n <template is="dom-if" if=\'[[equals(page, "system")]]\'>\n <hassio-system\n hass="[[hass]]"\n supervisor-info="[[supervisorInfo]]"\n host-info="[[hostInfo]]"\n ></hassio-system>\n </template>\n </app-header-layout>\n\n <hassio-markdown-dialog\n title="[[markdownTitle]]"\n content="[[markdownContent]]"\n ></hassio-markdown-dialog>\n\n <template is="dom-if" if=\'[[equals(page, "snapshots")]]\'>\n <hassio-snapshot\n hass="[[hass]]"\n snapshot-slug="{{snapshotSlug}}"\n snapshot-deleted="{{snapshotDeleted}}"\n ></hassio-snapshot>\n </template>\n ']);return gr=function(){return e},e}function wr(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function kr(e,t){return!t||"object"!==vr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Or(e,t,n){return(Or="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=jr(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}function jr(e){return(jr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _r(e,t){return(_r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}customElements.define("hassio-system",mr);var Sr=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),kr(this,jr(t).apply(this,arguments))}var n,a,i;return 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&&_r(e,t)}(t,Dn(r["a"])),n=t,i=[{key:"template",get:function(){return Object(o.a)(gr())}},{key:"properties",get:function(){return{hass:Object,page:String,supervisorInfo:Object,hostInfo:Object,hassInfo:Object,snapshotSlug:String,snapshotDeleted:Boolean,markdownTitle:String,markdownContent:{type:String,value:""}}}}],(a=[{key:"ready",value:function(){var e=this;Or(jr(t.prototype),"ready",this).call(this),this.addEventListener("hassio-markdown-dialog",function(t){return e.openMarkdown(t)})}},{key:"handlePageSelected",value:function(e){var t,n,o,r,a,i,s,c=e.detail.item.getAttribute("page-name");c!==this.page&&this.navigate("/hassio/".concat(c)),t=this,n=this.$.layout.header.scrollTarget,o=n,r=Math.random(),a=Date.now(),i=o.scrollTop,s=0-i,t._currentAnimationId=r,function e(){var n,c=Date.now()-a;c>200?o.scrollTop=0:t._currentAnimationId===r&&(o.scrollTop=(n=c,-s*(n/=200)*(n-2)+i),requestAnimationFrame(e.bind(t)))}.call(t)}},{key:"equals",value:function(e,t){return e===t}},{key:"showRefreshButton",value:function(e){return"store"===e||"snapshots"===e}},{key:"refreshClicked",value:function(){"snapshots"===this.page?this.shadowRoot.querySelector("hassio-snapshots").refreshData():this.shadowRoot.querySelector("hassio-addon-store").refreshData()}},{key:"openMarkdown",value:function(e){this.setProperties({markdownTitle:e.detail.title,markdownContent:e.detail.content}),this.shadowRoot.querySelector("hassio-markdown-dialog").openDialog()}}])&&wr(n.prototype,a),i&&wr(n,i),t}();function Pr(e){return(Pr="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 xr(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <app-route\n route="[[route]]"\n pattern="/:page"\n data="{{routeData}}"\n ></app-route>\n <hassio-data\n id="data"\n hass="[[hass]]"\n supervisor="{{supervisorInfo}}"\n homeassistant="{{hassInfo}}"\n host="{{hostInfo}}"\n ></hassio-data>\n\n <template is="dom-if" if="[[!loaded]]">\n <hass-loading-screen></hass-loading-screen>\n </template>\n\n <template is="dom-if" if="[[loaded]]">\n <template is="dom-if" if="[[!equalsAddon(routeData.page)]]">\n <hassio-pages-with-tabs\n hass="[[hass]]"\n page="[[routeData.page]]"\n supervisor-info="[[supervisorInfo]]"\n hass-info="[[hassInfo]]"\n host-info="[[hostInfo]]"\n ></hassio-pages-with-tabs>\n </template>\n <template is="dom-if" if="[[equalsAddon(routeData.page)]]">\n <hassio-addon-view\n hass="[[hass]]"\n route="[[route]]"\n ></hassio-addon-view>\n </template>\n </template>\n ']);return xr=function(){return e},e}function Er(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Cr(e,t){return!t||"object"!==Pr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Tr(e,t,n){return(Tr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Ar(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}function Ar(e){return(Ar=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Rr(e,t){return(Rr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}customElements.define("hassio-pages-with-tabs",Sr);var Dr=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Cr(this,Ar(t).apply(this,arguments))}var n,a,s;return 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&&Rr(e,t)}(t,Z(Dn(r["a"]))),n=t,s=[{key:"template",get:function(){return Object(o.a)(xr())}},{key:"properties",get:function(){return{hass:Object,route:{type:Object,value:{prefix:"/hassio",path:"/dashboard",__queryParams:{}},observer:"routeChanged"},routeData:Object,supervisorInfo:Object,hostInfo:Object,hassInfo:Object,loaded:{type:Boolean,computed:"computeIsLoaded(supervisorInfo, hostInfo, hassInfo)"}}}}],(a=[{key:"ready",value:function(){var e=this;Tr(Ar(t.prototype),"ready",this).call(this),function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e._themes||(e._themes={});var r=t.default_theme;("default"===n||n&&t.themes[n])&&(r=n);var a=Object.assign({},e._themes);if("default"!==r){var i=t.themes[r];Object.keys(i).forEach(function(t){var n="--"+t;e._themes[n]="",a[n]=i[t]})}if(e.updateStyles?e.updateStyles(a):window.ShadyCSS&&window.ShadyCSS.styleSubtree(e,a),o){var s=document.querySelector("meta[name=theme-color]");if(s){s.hasAttribute("default-content")||s.setAttribute("default-content",s.getAttribute("content"));var c=a["--primary-color"]||s.getAttribute("default-content");s.setAttribute("content",c)}}}(this,this.hass.themes,this.hass.selectedTheme,!0),this.addEventListener("hass-api-called",function(t){return e.apiCalled(t)}),this.addEventListener("hass-toggle-menu",function(){window.parent.customPanel.fire(e.hass.dockedSidebar?"hass-close-menu":"hass-open-menu")}),window.addEventListener("location-changed",function(t){return i(e,t.type,t.detail,{bubbles:!1})})}},{key:"connectedCallback",value:function(){Tr(Ar(t.prototype),"connectedCallback",this).call(this),this.routeChanged(this.route)}},{key:"apiCalled",value:function(e){var t=this;if(e.detail.success){var n=1;!function e(){t.$.data.refresh().catch(function(){n+=1,setTimeout(e,1e3*Math.min(n,5))})}()}}},{key:"computeIsLoaded",value:function(e,t,n){return null!==e&&null!==t&&null!==n}},{key:"routeChanged",value:function(e){""===e.path&&"/hassio"===e.prefix&&this.navigate("/hassio/dashboard",!0),this.fire("iron-resize")}},{key:"equalsAddon",value:function(e){return e&&"addon"===e}}])&&Er(n.prototype,a),s&&Er(n,s),t}();customElements.define("hassio-main",Dr)},35:function(e,t){var n=document.createElement("template");n.setAttribute("style","display: none;"),n.innerHTML='<dom-module id="hassio-style">\n <template>\n <style>\n .card-group {\n margin-top: 24px;\n }\n .card-group .title {\n color: var(--primary-text-color);\n font-size: 2em;\n padding-left: 8px;\n margin-bottom: 8px;\n }\n .card-group .description {\n font-size: 0.5em;\n font-weight: 500;\n margin-top: 4px;\n }\n .card-group paper-card {\n --card-group-columns: 4;\n width: calc((100% - 12px * var(--card-group-columns)) / var(--card-group-columns));\n margin: 4px;\n vertical-align: top;\n }\n @media screen and (max-width: 1200px) and (min-width: 901px) {\n .card-group paper-card {\n --card-group-columns: 3;\n }\n }\n @media screen and (max-width: 900px) and (min-width: 601px) {\n .card-group paper-card {\n --card-group-columns: 2;\n }\n }\n @media screen and (max-width: 600px) and (min-width: 0) {\n .card-group paper-card {\n width: 100%;\n margin: 4px 0;\n }\n .content {\n padding: 0;\n }\n }\n ha-call-api-button {\n font-weight: 500;\n color: var(--primary-color);\n }\n .error {\n color: var(--google-red-500);\n margin-top: 16px;\n }\n </style>\n </template>\n</dom-module>',document.head.appendChild(n.content)}}]);