iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 58 kB
JavaScript
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[5397],{81545:function(e,t,n){"use strict";n(6294);var r,i,o=n(50424),a=n(55358);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(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var i=h(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return p(this,n)}}function p(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?f(e):t}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(){m=function(){return e};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(r){t.forEach((function(t){var i=t.placement;if(t.kind===r&&("static"===i||"prototype"===i)){var o="static"===i?e:n;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var n=t.descriptor;if("field"===t.kind){var r=t.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===r?void 0:r.call(e)}}Object.defineProperty(e,t.key,n)},decorateClass:function(e,t){var n=[],r=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!b(e))return n.push(e);var t=this.decorateElement(e,i);n.push(t.element),n.push.apply(n,t.extras),r.push.apply(r,t.finishers)}),this),!t)return{elements:n,finishers:r};var o=this.decorateConstructor(n,t);return r.push.apply(r,o.finishers),o.finishers=r,o},addElementPlacement:function(e,t,n){var r=t[e.placement];if(!n&&-1!==r.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");r.push(e.key)},decorateElement:function(e,t){for(var n=[],r=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&r.push(c.finisher);var l=c.extras;if(l){for(var d=0;d<l.length;d++)this.addElementPlacement(l[d],t);n.push.apply(n,l)}}return{element:e,finishers:r,extras:n}},decorateConstructor:function(e,t){for(var n=[],r=t.length-1;r>=0;r--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[r])(i)||i);if(void 0!==o.finisher&&n.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers: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("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var n=k(e.key),r=String(e.placement);if("static"!==r&&"prototype"!==r&&"own"!==r)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 "'+r+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:n,placement:r,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:w(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var n=w(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:n}},runClassFinishers:function(e,t){for(var n=0;n<t.length;n++){var r=(0,t[n])(e);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");e=r}}return e},disallowProperty:function(e,t,n){if(void 0!==e[t])throw new TypeError(n+" can't have a ."+t+" property.")}};return e}function y(e){var t,n=k(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 r={kind:"field"===e.kind?"field":"method",key:n,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(r.decorators=e.decorators),"field"===e.kind&&(r.initializer=e.value),r}function v(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function b(e){return e.decorators&&e.decorators.length}function g(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function w(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 k(e){var t=function(e,t){if("object"!==s(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==s(r))return r;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){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}!function(e,t,n,r){var i=m();if(r)for(var o=0;o<r.length;o++)i=r[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),n),s=i.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},r=0;r<e.length;r++){var i,o=e[r];if("method"===o.kind&&(i=t.find(n)))if(g(o.descriptor)||g(i.descriptor)){if(b(o)||b(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(b(o)){if(b(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}v(o,i)}else t.push(o)}return t}(a.d.map(y)),e);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,a.Mo)("ha-button-menu")],(function(e,t){return{F:function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(r,t);var n=u(r);function r(){var t;l(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=n.call.apply(n,[this].concat(o)),e(f(t)),t}return r}(t),d:[{kind:"field",decorators:[(0,a.Cb)()],key:"corner",value:function(){return"TOP_START"}},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"multi",value:function(){return!1}},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"activatable",value:function(){return!1}},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"disabled",value:function(){return!1}},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"fixed",value:function(){return!1}},{kind:"field",decorators:[(0,a.IO)("mwc-menu",!0)],key:"_menu",value:void 0},{kind:"get",key:"items",value:function(){var e;return null===(e=this._menu)||void 0===e?void 0:e.items}},{kind:"get",key:"selected",value:function(){var e;return null===(e=this._menu)||void 0===e?void 0:e.selected}},{kind:"method",key:"render",value:function(){return(0,o.dy)(r||(r=c(["\n <div @click=",'>\n <slot name="trigger"></slot>\n </div>\n <mwc-menu\n .corner=',"\n .fixed=","\n .multi=","\n .activatable=","\n >\n <slot></slot>\n </mwc-menu>\n "])),this._handleClick,this.corner,this.fixed,this.multi,this.activatable)}},{kind:"method",key:"_handleClick",value:function(){this.disabled||(this._menu.anchor=this,this._menu.show())}},{kind:"get",static:!0,key:"styles",value:function(){return(0,o.iv)(i||(i=c(["\n :host {\n display: inline-block;\n position: relative;\n }\n ::slotted([disabled]) {\n color: var(--disabled-text-color);\n }\n "])))}}]}}),o.oi)},36125:function(e,t,n){"use strict";var r=n(20839);function i(e){return(i="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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=g(e);if(t){var i=g(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return c(this,n)}}function c(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?l(e):t}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(){d=function(){return e};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(r){t.forEach((function(t){var i=t.placement;if(t.kind===r&&("static"===i||"prototype"===i)){var o="static"===i?e:n;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var n=t.descriptor;if("field"===t.kind){var r=t.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===r?void 0:r.call(e)}}Object.defineProperty(e,t.key,n)},decorateClass:function(e,t){var n=[],r=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!f(e))return n.push(e);var t=this.decorateElement(e,i);n.push(t.element),n.push.apply(n,t.extras),r.push.apply(r,t.finishers)}),this),!t)return{elements:n,finishers:r};var o=this.decorateConstructor(n,t);return r.push.apply(r,o.finishers),o.finishers=r,o},addElementPlacement:function(e,t,n){var r=t[e.placement];if(!n&&-1!==r.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");r.push(e.key)},decorateElement:function(e,t){for(var n=[],r=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&r.push(c.finisher);var l=c.extras;if(l){for(var d=0;d<l.length;d++)this.addElementPlacement(l[d],t);n.push.apply(n,l)}}return{element:e,finishers:r,extras:n}},decorateConstructor:function(e,t){for(var n=[],r=t.length-1;r>=0;r--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[r])(i)||i);if(void 0!==o.finisher&&n.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers: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("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var n=y(e.key),r=String(e.placement);if("static"!==r&&"prototype"!==r&&"own"!==r)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 "'+r+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:n,placement:r,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:m(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var n=m(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:n}},runClassFinishers:function(e,t){for(var n=0;n<t.length;n++){var r=(0,t[n])(e);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");e=r}}return e},disallowProperty:function(e,t,n){if(void 0!==e[t])throw new TypeError(n+" can't have a ."+t+" property.")}};return e}function u(e){var t,n=y(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 r={kind:"field"===e.kind?"field":"method",key:n,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(r.decorators=e.decorators),"field"===e.kind&&(r.initializer=e.value),r}function p(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 h(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function m(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 y(e){var t=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===i(t)?t:String(t)}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b(e,t,n){return(b="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=g(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e,t,n,r){var i=d();if(r)for(var o=0;o<r.length;o++)i=r[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),n),s=i.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},r=0;r<e.length;r++){var i,o=e[r];if("method"===o.kind&&(i=t.find(n)))if(h(o.descriptor)||h(i.descriptor)){if(f(o)||f(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(f(o)){if(f(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}p(o,i)}else t.push(o)}return t}(a.d.map(u)),e);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,n(55358).Mo)("ha-fab")],(function(e,t){var n=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(r,t);var n=s(r);function r(){var t;o(this,r);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return t=n.call.apply(n,[this].concat(a)),e(l(t)),t}return r}(t);return{F:n,d:[{kind:"method",key:"firstUpdated",value:function(e){b(g(n.prototype),"firstUpdated",this).call(this,e),this.style.setProperty("--mdc-theme-secondary","var(--primary-color)")}}]}}),r.L)},95397:function(e,t,n){"use strict";n(53918),n(62613),n(87724);var r,i,o,a,s,c,l,d,u,p,f,h,m,y,v,b,g,w,k,_,x,E,P,O,z,C=n(68546),A=(n(53973),n(51095),n(54444),n(50424)),D=n(55358),S=n(76666),T=n(82816),j=n(92483),I=n(47181),R=n(87744),F=n(38346),B=n(69371),H=n(26765),M=n(54845),$=n(11654),q=n(27322);n(74535),n(81545),n(22098),n(31206),n(36125),n(52039);function N(e){return(N="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 U(e){return function(e){if(Array.isArray(e))return ae(e)}(e)||se(e)||oe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function X(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,i)}function V(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){X(o,r,i,a,s,"next",e)}function s(e){X(o,r,i,a,s,"throw",e)}a(void 0)}))}}function L(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function W(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Y(e,t){return(Y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Z(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=le(e);if(t){var i=le(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return J(this,n)}}function J(e,t){return!t||"object"!==N(t)&&"function"!=typeof t?Q(e):t}function Q(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function G(){G=function(){return e};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(r){t.forEach((function(t){var i=t.placement;if(t.kind===r&&("static"===i||"prototype"===i)){var o="static"===i?e:n;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var n=t.descriptor;if("field"===t.kind){var r=t.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===r?void 0:r.call(e)}}Object.defineProperty(e,t.key,n)},decorateClass:function(e,t){var n=[],r=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!te(e))return n.push(e);var t=this.decorateElement(e,i);n.push(t.element),n.push.apply(n,t.extras),r.push.apply(r,t.finishers)}),this),!t)return{elements:n,finishers:r};var o=this.decorateConstructor(n,t);return r.push.apply(r,o.finishers),o.finishers=r,o},addElementPlacement:function(e,t,n){var r=t[e.placement];if(!n&&-1!==r.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");r.push(e.key)},decorateElement:function(e,t){for(var n=[],r=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&r.push(c.finisher);var l=c.extras;if(l){for(var d=0;d<l.length;d++)this.addElementPlacement(l[d],t);n.push.apply(n,l)}}return{element:e,finishers:r,extras:n}},decorateConstructor:function(e,t){for(var n=[],r=t.length-1;r>=0;r--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[r])(i)||i);if(void 0!==o.finisher&&n.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers: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)||se(t)||oe(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var n=ie(e.key),r=String(e.placement);if("static"!==r&&"prototype"!==r&&"own"!==r)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 "'+r+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:n,placement:r,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:re(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var n=re(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:n}},runClassFinishers:function(e,t){for(var n=0;n<t.length;n++){var r=(0,t[n])(e);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");e=r}}return e},disallowProperty:function(e,t,n){if(void 0!==e[t])throw new TypeError(n+" can't have a ."+t+" property.")}};return e}function K(e){var t,n=ie(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 r={kind:"field"===e.kind?"field":"method",key:n,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(r.decorators=e.decorators),"field"===e.kind&&(r.initializer=e.value),r}function ee(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function te(e){return e.decorators&&e.decorators.length}function ne(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function re(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 ie(e){var t=function(e,t){if("object"!==N(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==N(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===N(t)?t:String(t)}function oe(e,t){if(e){if("string"==typeof e)return ae(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ae(e,t):void 0}}function ae(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function se(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function ce(e,t,n){return(ce="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=le(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function le(e){return(le=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e,t,n,r){var i=G();if(r)for(var o=0;o<r.length;o++)i=r[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),n),s=i.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},r=0;r<e.length;r++){var i,o=e[r];if("method"===o.kind&&(i=t.find(n)))if(ne(o.descriptor)||ne(i.descriptor)){if(te(o)||te(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(te(o)){if(te(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}ee(o,i)}else t.push(o)}return t}(a.d.map(K)),e);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,D.Mo)("ha-media-player-browse")],(function(e,t){var n,N,X,J,G,K=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Y(e,t)}(r,t);var n=Z(r);function r(){var t;W(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=n.call.apply(n,[this].concat(o)),e(Q(t)),t}return r}(t);return{F:K,d:[{kind:"field",decorators:[(0,D.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,D.Cb)()],key:"entityId",value:void 0},{kind:"field",decorators:[(0,D.Cb)()],key:"mediaContentId",value:void 0},{kind:"field",decorators:[(0,D.Cb)()],key:"mediaContentType",value:void 0},{kind:"field",decorators:[(0,D.Cb)()],key:"action",value:function(){return"play"}},{kind:"field",decorators:[(0,D.Cb)({type:Boolean})],key:"dialog",value:function(){return!1}},{kind:"field",decorators:[(0,D.Cb)({type:Boolean,attribute:"narrow",reflect:!0})],key:"_narrow",value:function(){return!1}},{kind:"field",decorators:[(0,D.Cb)({type:Boolean,attribute:"scroll",reflect:!0})],key:"_scrolled",value:function(){return!1}},{kind:"field",decorators:[(0,D.SB)()],key:"_loading",value:function(){return!1}},{kind:"field",decorators:[(0,D.SB)()],key:"_error",value:void 0},{kind:"field",decorators:[(0,D.SB)()],key:"_mediaPlayerItems",value:function(){return[]}},{kind:"field",decorators:[(0,D.IO)(".header")],key:"_header",value:void 0},{kind:"field",decorators:[(0,D.IO)(".content")],key:"_content",value:void 0},{kind:"field",key:"_headerOffsetHeight",value:function(){return 0}},{kind:"field",key:"_resizeObserver",value:void 0},{kind:"method",key:"connectedCallback",value:function(){var e=this;ce(le(K.prototype),"connectedCallback",this).call(this),this.updateComplete.then((function(){return e._attachObserver()}))}},{kind:"method",key:"disconnectedCallback",value:function(){this._resizeObserver&&this._resizeObserver.disconnect()}},{kind:"method",key:"navigateBack",value:function(){this._mediaPlayerItems.pop();var e=this._mediaPlayerItems.pop();e&&this._navigate(e)}},{kind:"method",key:"render",value:function(){var e,t=this;if(this._loading)return(0,A.dy)(r||(r=L(["<ha-circular-progress active></ha-circular-progress>"])));if(this._error&&!this._mediaPlayerItems.length){if(!this.dialog)return(0,A.dy)(i||(i=L(['\n <div class="container">',"</div>\n "])),this._renderError(this._error));this._closeDialogAction(),(0,H.Ys)(this,{title:this.hass.localize("ui.components.media-browser.media_browsing_error"),text:this._renderError(this._error)})}if(!this._mediaPlayerItems.length)return(0,A.dy)(o||(o=L([""])));var n=this._mediaPlayerItems[this._mediaPlayerItems.length-1],E=this._mediaPlayerItems.length>1?this._mediaPlayerItems[this._mediaPlayerItems.length-2]:void 0,P=this.hass.localize("ui.components.media-browser.class.".concat(n.media_class)),O=B.Fn[n.media_class],z=B.Fn[n.children_media_class];return(0,A.dy)(a||(a=L(['\n <div\n class="header ','"\n @transitionend=','\n >\n <div class="header-content">\n ','\n <div class="header-info">\n <div class="breadcrumb">\n ','\n <h1 class="title">',"</h1>\n ","\n </div>\n ","\n </div>\n </div>\n ",'\n </div>\n <div class="content" @scroll='," @touchmove=",">\n ","\n </div>\n "])),(0,S.$)({"no-img":!n.thumbnail,"no-dialog":!this.dialog}),this._setHeaderHeight,n.thumbnail?(0,A.dy)(s||(s=L(['\n <div\n class="img"\n style=',"\n >\n ","\n </div>\n "])),(0,j.V)({backgroundImage:n.thumbnail?"url(".concat(n.thumbnail,")"):"none"}),this._narrow&&null!=n&&n.can_play?(0,A.dy)(c||(c=L(["\n <ha-fab\n mini\n .item=","\n @click=",'\n >\n <ha-svg-icon\n slot="icon"\n .label=',"\n .path=","\n ></ha-svg-icon>\n ","\n </ha-fab>\n "])),n,this._actionClicked,this.hass.localize("ui.components.media-browser.".concat(this.action,"-media")),"play"===this.action?C._86:C.qX5,this.hass.localize("ui.components.media-browser.".concat(this.action))):""):(0,A.dy)(l||(l=L([""]))),E?(0,A.dy)(d||(d=L(['\n <div class="previous-title" @click=',">\n <ha-svg-icon .path=","></ha-svg-icon>\n ","\n </div>\n "])),this.navigateBack,C.J3k,E.title):"",n.title,P?(0,A.dy)(u||(u=L([' <h2 class="subtitle">',"</h2> "])),P):"",!n.can_play||n.thumbnail&&this._narrow?"":(0,A.dy)(p||(p=L(["\n <mwc-button\n raised\n .item=","\n @click=","\n >\n <ha-svg-icon\n .label=","\n .path=","\n ></ha-svg-icon>\n ","\n </mwc-button>\n "])),n,this._actionClicked,this.hass.localize("ui.components.media-browser.".concat(this.action,"-media")),"play"===this.action?C._86:C.qX5,this.hass.localize("ui.components.media-browser.".concat(this.action))),this.dialog?(0,A.dy)(f||(f=L(["\n <mwc-icon-button\n aria-label=","\n @click=",'\n class="header_button"\n dir=',"\n >\n <ha-svg-icon .path=","></ha-svg-icon>\n </mwc-icon-button>\n "])),this.hass.localize("ui.dialogs.generic.close"),this._closeDialogAction,(0,R.Zu)(this.hass),C.r5M):"",this._scroll,this._scroll,this._error?(0,A.dy)(h||(h=L(['\n <div class="container">',"</div>\n "])),this._renderError(this._error)):null!==(e=n.children)&&void 0!==e&&e.length?"grid"===z.layout?(0,A.dy)(m||(m=L(['\n <div\n class="children ','"\n >\n ',"\n </div>\n "])),(0,S.$)({portrait:"portrait"===z.thumbnail_ratio}),n.children.map((function(e){return(0,A.dy)(y||(y=L(['\n <div\n class="child"\n .item=',"\n @click=",'\n >\n <div class="ha-card-parent">\n <ha-card\n outlined\n style=',"\n >\n ","\n </ha-card>\n ",'\n </div>\n <div class="title">\n ','\n <paper-tooltip\n fitToVisibleBounds\n position="top"\n offset="4"\n >','</paper-tooltip\n >\n </div>\n <div class="type">\n ',"\n </div>\n </div>\n "])),e,t._childClicked,(0,j.V)({backgroundImage:e.thumbnail?"url(".concat(e.thumbnail,")"):"none"}),e.thumbnail?"":(0,A.dy)(v||(v=L(['\n <ha-svg-icon\n class="folder"\n .path=',"\n ></ha-svg-icon>\n "])),B.Fn["directory"===e.media_class&&e.children_media_class||e.media_class].icon),e.can_play?(0,A.dy)(b||(b=L(['\n <mwc-icon-button\n class="play ','"\n .item=',"\n .label=","\n @click=","\n >\n <ha-svg-icon\n .path=","\n ></ha-svg-icon>\n </mwc-icon-button>\n "])),(0,S.$)({can_expand:e.can_expand}),e,t.hass.localize("ui.components.media-browser.".concat(t.action,"-media")),t._actionClicked,"play"===t.action?C._86:C.qX5):"",e.title,e.title,t.hass.localize("ui.components.media-browser.content-type.".concat(e.media_content_type)))}))):(0,A.dy)(g||(g=L(["\n <mwc-list>\n ","\n </mwc-list>\n "])),n.children.map((function(e){return(0,A.dy)(w||(w=L(["\n <mwc-list-item\n @click=","\n .item=",'\n graphic="avatar"\n hasMeta\n dir=','\n >\n <div\n class="graphic"\n style=','\n slot="graphic"\n >\n <mwc-icon-button\n class="play ','"\n .item=',"\n .label=","\n @click=","\n >\n <ha-svg-icon\n .path=",'\n ></ha-svg-icon>\n </mwc-icon-button>\n </div>\n <span class="title">','</span>\n </mwc-list-item>\n <li divider role="separator"></li>\n '])),t._childClicked,e,(0,R.Zu)(t.hass),(0,T.o)(O.show_list_images&&e.thumbnail?"background-image: url(".concat(e.thumbnail,")"):void 0),(0,S.$)({show:!O.show_list_images||!e.thumbnail}),e,t.hass.localize("ui.components.media-browser.".concat(t.action,"-media")),t._actionClicked,"play"===t.action?C._86:C.qX5,e.title)}))):(0,A.dy)(k||(k=L(['\n <div class="container">\n ',"\n <br />\n ","\n </div>\n "])),this.hass.localize("ui.components.media-browser.no_items"),"media-source://media_source/local/."===n.media_content_id?(0,A.dy)(_||(_=L(["<br />","\n <br />\n ",""])),this.hass.localize("ui.components.media-browser.learn_adding_local_media","documentation",(0,A.dy)(x||(x=L(['<a\n href="','"\n target="_blank"\n rel="noreferrer"\n >',"</a\n >"])),(0,q.R)(this.hass,"/more-info/local-media/add-media"),this.hass.localize("ui.components.media-browser.documentation"))),this.hass.localize("ui.components.media-browser.local_media_files")):""))}},{kind:"method",key:"firstUpdated",value:function(){this._measureCard(),this._attachObserver()}},{kind:"method",key:"updated",value:function(e){var t=this;ce(le(K.prototype),"updated",this).call(this,e),e.has("_mediaPlayerItems")&&this._mediaPlayerItems.length&&this._setHeaderHeight(),void 0!==e.get("_scrolled")&&this._mediaPlayerItems.length&&this._animateHeaderHeight(),(e.has("entityId")||e.has("mediaContentId")||e.has("mediaContentType")||e.has("action"))&&(e.has("entityId")&&(this._error=void 0,this._mediaPlayerItems=[]),this._fetchData(this.mediaContentId,this.mediaContentType).then((function(e){e&&(t._mediaPlayerItems=[e])})).catch((function(e){t._error=e})))}},{kind:"method",key:"_setHeaderHeight",value:(G=V(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.updateComplete;case 2:if(t=this._header,n=this._content,t&&n){e.next=6;break}return e.abrupt("return");case 6:this._headerOffsetHeight=t.offsetHeight,n.style.marginTop="".concat(this._headerOffsetHeight,"px"),n.style.maxHeight="calc(var(--media-browser-max-height, 100%) - ".concat(this._headerOffsetHeight,"px)");case 9:case"end":return e.stop()}}),e,this)}))),function(){return G.apply(this,arguments)})},{kind:"method",key:"_animateHeaderHeight",value:function(){var e,t=this;requestAnimationFrame((function n(r){void 0===e&&(e=r);var i=r-e;t._setHeaderHeight(),i<400&&requestAnimationFrame(n)}))}},{kind:"method",key:"_actionClicked",value:function(e){e.stopPropagation();var t=e.currentTarget.item;this._runAction(t)}},{kind:"method",key:"_runAction",value:function(e){(0,I.B)(this,"media-picked",{item:e})}},{kind:"method",key:"_childClicked",value:(J=V(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.currentTarget,r=n.item){e.next=4;break}return e.abrupt("return");case 4:if(r.can_expand){e.next=7;break}return this._runAction(r),e.abrupt("return");case 7:this._navigate(r);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return J.apply(this,arguments)})},{kind:"method",key:"_navigate",value:(X=V(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._error=void 0,e.prev=1,e.next=4,this._fetchData(t.media_content_id,t.media_content_type);case 4:r=e.sent,e.next=11;break;case 7:return e.prev=7,e.t0=e.catch(1),(0,H.Ys)(this,{title:this.hass.localize("ui.components.media-browser.media_browsing_error"),text:this._renderError(e.t0)}),e.abrupt("return");case 11:null===(n=this._content)||void 0===n||n.scrollTo(0,0),this._scrolled=!1,this._mediaPlayerItems=[].concat(U(this._mediaPlayerItems),[r]);case 14:case"end":return e.stop()}}),e,this,[[1,7]])}))),function(e){return X.apply(this,arguments)})},{kind:"method",key:"_fetchData",value:(N=V(regeneratorRuntime.mark((function e(t,n){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._loading=!0,e.prev=1,this.entityId===B.N8){e.next=8;break}return e.next=5,(0,B.zz)(this.hass,this.entityId,t,n);case 5:e.t0=e.sent,e.next=11;break;case 8:return e.next=10,(0,B.b)(this.hass,t);case 10:e.t0=e.sent;case 11:r=e.t0;case 12:return e.prev=12,this._loading=!1,e.finish(12);case 15:return e.abrupt("return",r);case 16:case"end":return e.stop()}}),e,this,[[1,,12,15]])}))),function(e,t){return N.apply(this,arguments)})},{kind:"method",key:"_measureCard",value:function(){this._narrow=(this.dialog?window.innerWidth:this.offsetWidth)<450}},{kind:"method",decorators:[(0,D.hO)({passive:!0})],key:"_scroll",value:function(e){var t=e.currentTarget;!this._scrolled&&t.scrollTop>this._headerOffsetHeight?this._scrolled=!0:this._scrolled&&t.scrollTop<this._headerOffsetHeight&&(this._scrolled=!1)}},{kind:"method",key:"_attachObserver",value:(n=V(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._resizeObserver){e.next=4;break}return e.next=3,(0,M.P)();case 3:this._resizeObserver=new ResizeObserver((0,F.D)((function(){return t._measureCard()}),250,!1));case 4:this._resizeObserver.observe(this);case 5:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{kind:"method",key:"_closeDialogAction",value:function(){(0,I.B)(this,"close-dialog")}},{kind:"method",key:"_renderError",value:function(e){return"Media directory does not exist."===e.message?(0,A.dy)(E||(E=L(["\n <h2>\n ","\n </h2>\n <p>\n ","\n <br />\n ","\n <br />\n ","\n </p>\n "])),this.hass.localize("ui.components.media-browser.no_local_media_found"),this.hass.localize("ui.components.media-browser.no_media_folder"),this.hass.localize("ui.components.media-browser.setup_local_help","documentation",(0,A.dy)(P||(P=L(['<a\n href="','"\n target="_blank"\n rel="noreferrer"\n >',"</a\n >"])),(0,q.R)(this.hass,"/more-info/local-media/setup-media"),this.hass.localize("ui.components.media-browser.documentation"))),this.hass.localize("ui.components.media-browser.local_media_files")):(0,A.dy)(O||(O=L(['<span class="error">',"</span>"])),e.message)}},{kind:"get",static:!0,key:"styles",value:function(){return[$.Qx,(0,A.iv)(z||(z=L(['\n :host {\n display: flex;\n flex-direction: column;\n position: relative;\n }\n\n ha-circular-progress {\n --mdc-theme-primary: var(--primary-color);\n display: flex;\n justify-content: center;\n margin: 40px;\n }\n\n .container {\n padding: 16px;\n }\n\n .content {\n overflow-y: auto;\n padding-bottom: 20px;\n box-sizing: border-box;\n }\n\n .header {\n display: flex;\n justify-content: space-between;\n border-bottom: 1px solid var(--divider-color);\n background-color: var(--card-background-color);\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n z-index: 5;\n padding: 20px 24px 10px;\n }\n\n .header_button {\n position: relative;\n right: -8px;\n }\n\n .header-content {\n display: flex;\n flex-wrap: wrap;\n flex-grow: 1;\n align-items: flex-start;\n }\n\n .header-content .img {\n height: 200px;\n width: 200px;\n margin-right: 16px;\n background-size: cover;\n border-radius: 4px;\n transition: width 0.4s, height 0.4s;\n }\n\n .header-info {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-self: stretch;\n min-width: 0;\n flex: 1;\n }\n\n .header-info mwc-button {\n display: block;\n --mdc-theme-primary: var(--primary-color);\n }\n\n .breadcrumb {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n flex-grow: 1;\n }\n\n .breadcrumb .title {\n font-size: 32px;\n line-height: 1.2;\n font-weight: bold;\n margin: 0;\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n padding-right: 8px;\n }\n\n .breadcrumb .previous-title {\n font-size: 14px;\n padd