UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

2 lines 51.7 kB
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[5397],{81545:function(e,n,t){"use strict";t(53918),t(83238);var r=t(15652);t(10983);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(){var e=s(["\n      :host {\n        display: inline-block;\n        position: relative;\n      }\n      ::slotted([disabled]) {\n        color: var(--disabled-text-color);\n      }\n    "]);return o=function(){return e},e}function a(){var e=s(["\n      <div @click=",'>\n        <slot name="trigger"></slot>\n      </div>\n      <mwc-menu\n        .corner=',"\n        .multi=","\n        .activatable=","\n      >\n        <slot></slot>\n      </mwc-menu>\n    "]);return a=function(){return e},e}function s(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}function c(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function l(e,n){return(l=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}function d(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,r=p(e);if(n){var i=p(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return u(this,t)}}function u(e,n){return!n||"object"!==i(n)&&"function"!=typeof n?f(e):n}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(){h=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,n){["method","field"].forEach((function(t){n.forEach((function(n){n.kind===t&&"own"===n.placement&&this.defineClassElement(e,n)}),this)}),this)},initializeClassElements:function(e,n){var t=e.prototype;["method","field"].forEach((function(r){n.forEach((function(n){var i=n.placement;if(n.kind===r&&("static"===i||"prototype"===i)){var o="static"===i?e:t;this.defineClassElement(o,n)}}),this)}),this)},defineClassElement:function(e,n){var t=n.descriptor;if("field"===n.kind){var r=n.initializer;t={enumerable:t.enumerable,writable:t.writable,configurable:t.configurable,value:void 0===r?void 0:r.call(e)}}Object.defineProperty(e,n.key,t)},decorateClass:function(e,n){var t=[],r=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!v(e))return t.push(e);var n=this.decorateElement(e,i);t.push(n.element),t.push.apply(t,n.extras),r.push.apply(r,n.finishers)}),this),!n)return{elements:t,finishers:r};var o=this.decorateConstructor(t,n);return r.push.apply(r,o.finishers),o.finishers=r,o},addElementPlacement:function(e,n,t){var r=n[e.placement];if(!t&&-1!==r.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");r.push(e.key)},decorateElement:function(e,n){for(var t=[],r=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=n[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,n),c.finisher&&r.push(c.finisher);var l=c.extras;if(l){for(var d=0;d<l.length;d++)this.addElementPlacement(l[d],n);t.push.apply(t,l)}}return{element:e,finishers:r,extras:t}},decorateConstructor:function(e,n){for(var t=[],r=n.length-1;r>=0;r--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,n[r])(i)||i);if(void 0!==o.finisher&&t.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:t}},fromElementDescriptor:function(e){var n={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(n,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(n.initializer=e.initializer),n},toElementDescriptors:function(e){var n;if(void 0!==e)return(n=e,function(e){if(Array.isArray(e))return e}(n)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(n)||function(e,n){if(e){if("string"==typeof e)return k(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?k(e,n):void 0}}(n)||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 n=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),n}),this)},toElementDescriptor:function(e){var n=String(e.kind);if("method"!==n&&"field"!==n)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+n+'"');var t=w(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:n,key:t,placement:r,descriptor:Object.assign({},i)};return"field"!==n?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:g(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var n={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(n,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),n},toClassDescriptor:function(e){var n=String(e.kind);if("class"!==n)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+n+'"');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 t=g(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:t}},runClassFinishers:function(e,n){for(var t=0;t<n.length;t++){var r=(0,n[t])(e);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");e=r}}return e},disallowProperty:function(e,n,t){if(void 0!==e[n])throw new TypeError(t+" can't have a ."+n+" property.")}};return e}function m(e){var n,t=w(e.key);"method"===e.kind?n={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?n={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?n={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(n={configurable:!0,writable:!0,enumerable:!0});var r={kind:"field"===e.kind?"field":"method",key:t,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:n};return e.decorators&&(r.decorators=e.decorators),"field"===e.kind&&(r.initializer=e.value),r}function y(e,n){void 0!==e.descriptor.get?n.descriptor.get=e.descriptor.get:n.descriptor.set=e.descriptor.set}function v(e){return e.decorators&&e.decorators.length}function b(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function g(e,n){var t=e[n];if(void 0!==t&&"function"!=typeof t)throw new TypeError("Expected '"+n+"' to be a function");return t}function w(e){var n=function(e,n){if("object"!==i(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!==i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===i(n)?n:String(n)}function k(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}!function(e,n,t,r){var i=h();if(r)for(var o=0;o<r.length;o++)i=r[o](i);var a=n((function(e){i.initializeInstanceElements(e,s.elements)}),t),s=i.decorateClass(function(e){for(var n=[],t=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=n.find(t)))if(b(o.descriptor)||b(i.descriptor)){if(v(o)||v(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(v(o)){if(v(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}y(o,i)}else n.push(o)}return n}(a.d.map(m)),e);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,r.Mo)("ha-button-menu")],(function(e,n){return{F:function(n){!function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&l(e,n)}(r,n);var t=d(r);function r(){var n;c(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=t.call.apply(t,[this].concat(o)),e(f(n)),n}return r}(n),d:[{kind:"field",decorators:[(0,r.Cb)()],key:"corner",value:function(){return"TOP_START"}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"multi",value:function(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"activatable",value:function(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"disabled",value:function(){return!1}},{kind:"field",decorators:[(0,r.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,r.dy)(a(),this._handleClick,this.corner,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,r.iv)(o())}}]}}),r.oi)},81303:function(e,n,t){"use strict";t(8878);function r(e){return(r="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 i(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function o(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,n,t){return(a="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,n,t){var r=function(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&null!==(e=d(e)););return e}(e,n);if(r){var i=Object.getOwnPropertyDescriptor(r,n);return i.get?i.get.call(t):i.value}})(e,n,t||e)}function s(e,n){return(s=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}function c(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,r=d(e);if(n){var i=d(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return l(this,t)}}function l(e,n){return!n||"object"!==r(n)&&"function"!=typeof n?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):n}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var u=function(e){!function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&s(e,n)}(u,e);var n,t,r,l=c(u);function u(){return i(this,u),l.apply(this,arguments)}return n=u,(t=[{key:"ready",value:function(){var e=this;a(d(u.prototype),"ready",this).call(this),setTimeout((function(){"rtl"===window.getComputedStyle(e).direction&&(e.style.textAlign="right")}),100)}}])&&o(n.prototype,t),r&&o(n,r),u}(customElements.get("paper-dropdown-menu"));customElements.define("ha-paper-dropdown-menu",u)},95397:function(e,n,t){"use strict";t(53918),t(29119),t(54567),t(81689);var r=t(55317),i=(t(53973),t(51095),t(54444),t(15652)),o=t(81471),a=t(49629),s=t(79865),c=t(47181),l=t(87744),d=t(38346),u=t(69371),f=t(26765),p=t(54845),h=t(11654),m=t(27322);t(74535),t(81545),t(22098),t(31206),t(81303),t(52039);function y(e){return(y="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 v(){var e=V(['\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          padding-bottom: 8px;\n          color: var(--secondary-text-color);\n          overflow: hidden;\n          text-overflow: ellipsis;\n          cursor: pointer;\n          --mdc-icon-size: 14px;\n        }\n\n        .breadcrumb .subtitle {\n          font-size: 16px;\n          overflow: hidden;\n          text-overflow: ellipsis;\n          margin-bottom: 0;\n          transition: height 0.5s, margin 0.5s;\n        }\n\n        /* ============= CHILDREN ============= */\n\n        mwc-list {\n          --mdc-list-vertical-padding: 0;\n          --mdc-list-item-graphic-margin: 0;\n          --mdc-theme-text-icon-on-background: var(--secondary-text-color);\n          margin-top: 10px;\n        }\n\n        mwc-list li:last-child {\n          display: none;\n        }\n\n        mwc-list li[divider] {\n          border-bottom-color: var(--divider-color);\n        }\n\n        .children {\n          display: grid;\n          grid-template-columns: repeat(\n            auto-fit,\n            minmax(var(--media-browse-item-size, 175px), 0.1fr)\n          );\n          grid-gap: 16px;\n          padding: 0px 24px;\n          margin: 8px 0px;\n        }\n\n        :host([dialog]) .children {\n          grid-template-columns: repeat(\n            auto-fit,\n            minmax(var(--media-browse-item-size, 175px), 0.33fr)\n          );\n        }\n\n        .child {\n          display: flex;\n          flex-direction: column;\n          cursor: pointer;\n        }\n\n        .ha-card-parent {\n          position: relative;\n          width: 100%;\n        }\n\n        .children ha-card {\n          width: 100%;\n          padding-bottom: 100%;\n          position: relative;\n          box-sizing: border-box;\n          background-size: cover;\n          background-repeat: no-repeat;\n          background-position: center;\n          transition: padding-bottom 0.1s ease-out;\n        }\n\n        .portrait.children ha-card {\n          padding-bottom: 150%;\n        }\n\n        .child .folder,\n        .child .play {\n          position: absolute;\n        }\n\n        .child .folder {\n          color: var(--secondary-text-color);\n          top: calc(50% - (var(--mdc-icon-size) / 2));\n          left: calc(50% - (var(--mdc-icon-size) / 2));\n          --mdc-icon-size: calc(var(--media-browse-item-size, 175px) * 0.4);\n        }\n\n        .child .play {\n          transition: color 0.5s;\n          border-radius: 50%;\n          bottom: calc(50% - 35px);\n          right: calc(50% - 35px);\n          opacity: 0;\n          transition: opacity 0.1s ease-out;\n        }\n\n        .child .play:not(.can_expand) {\n          --mdc-icon-button-size: 70px;\n          --mdc-icon-size: 48px;\n        }\n\n        .ha-card-parent:hover .play:not(.can_expand) {\n          opacity: 1;\n          color: var(--primary-color);\n        }\n\n        .child .play.can_expand {\n          opacity: 1;\n          background-color: rgba(var(--rgb-card-background-color), 0.5);\n          bottom: 4px;\n          right: 4px;\n        }\n\n        .child .play:hover {\n          color: var(--primary-color);\n        }\n\n        .ha-card-parent:hover ha-card {\n          opacity: 0.5;\n        }\n\n        .child .title {\n          font-size: 16px;\n          padding-top: 8px;\n          padding-left: 2px;\n          overflow: hidden;\n          display: -webkit-box;\n          -webkit-box-orient: vertical;\n          -webkit-line-clamp: 2;\n          text-overflow: ellipsis;\n        }\n\n        .child .type {\n          font-size: 12px;\n          color: var(--secondary-text-color);\n          padding-left: 2px;\n        }\n\n        mwc-list-item .graphic {\n          background-size: cover;\n        }\n\n        mwc-list-item .graphic .play {\n          opacity: 0;\n          transition: all 0.5s;\n          background-color: rgba(var(--rgb-card-background-color), 0.5);\n          border-radius: 50%;\n          --mdc-icon-button-size: 40px;\n        }\n\n        mwc-list-item:hover .graphic .play {\n          opacity: 1;\n          color: var(--primary-color);\n        }\n\n        mwc-list-item .graphic .play.show {\n          opacity: 1;\n          background-color: transparent;\n        }\n\n        mwc-list-item .title {\n          margin-left: 16px;\n        }\n        mwc-list-item[dir="rtl"] .title {\n          margin-right: 16px;\n          margin-left: 0;\n        }\n\n        /* ============= Narrow ============= */\n\n        :host([narrow]) {\n          padding: 0;\n        }\n\n        :host([narrow]) .breadcrumb .title {\n          font-size: 24px;\n        }\n\n        :host([narrow]) .header {\n          padding: 0;\n        }\n\n        :host([narrow]) .header.no-dialog {\n          display: block;\n        }\n\n        :host([narrow]) .header_button {\n          position: absolute;\n          top: 14px;\n          right: 8px;\n        }\n\n        :host([narrow]) .header-content {\n          flex-direction: column;\n          flex-wrap: nowrap;\n        }\n\n        :host([narrow]) .header-content .img {\n          height: auto;\n          width: 100%;\n          margin-right: 0;\n          padding-bottom: 50%;\n          margin-bottom: 8px;\n          position: relative;\n          background-position: center;\n          border-radius: 0;\n          transition: width 0.4s, height 0.4s, padding-bottom 0.4s;\n        }\n\n        mwc-fab {\n          position: absolute;\n          --mdc-theme-secondary: var(--primary-color);\n          bottom: -20px;\n          right: 20px;\n        }\n\n        :host([narrow]) .header-info mwc-button {\n          margin-top: 16px;\n          margin-bottom: 8px;\n        }\n\n        :host([narrow]) .header-info {\n          padding: 20px 24px 10px;\n        }\n\n        :host([narrow]) .media-source {\n          padding: 0 24px;\n        }\n\n        :host([narrow]) .children {\n          grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;\n        }\n\n        /* ============= Scroll ============= */\n\n        :host([scroll]) .breadcrumb .subtitle {\n          height: 0;\n          margin: 0;\n        }\n\n        :host([scroll]) .breadcrumb .title {\n          -webkit-line-clamp: 1;\n        }\n\n        :host(:not([narrow])[scroll]) .header:not(.no-img) mwc-icon-button {\n          align-self: center;\n        }\n\n        :host([scroll]) .header-info mwc-button,\n        .no-img .header-info mwc-button {\n          padding-right: 4px;\n        }\n\n        :host([scroll][narrow]) .no-img .header-info mwc-button {\n          padding-right: 16px;\n        }\n\n        :host([scroll]) .header-info {\n          flex-direction: row;\n        }\n\n        :host([scroll]) .header-info mwc-button {\n          align-self: center;\n          margin-top: 0;\n          margin-bottom: 0;\n        }\n\n        :host([scroll][narrow]) .no-img .header-info {\n          flex-direction: row-reverse;\n        }\n\n        :host([scroll][narrow]) .header-info {\n          padding: 20px 24px 10px 24px;\n          align-items: center;\n        }\n\n        :host([scroll]) .header-content {\n          align-items: flex-end;\n          flex-direction: row;\n        }\n\n        :host([scroll]) .header-content .img {\n          height: 75px;\n          width: 75px;\n        }\n\n        :host([scroll][narrow]) .header-content .img {\n          height: 100px;\n          width: 100px;\n          padding-bottom: initial;\n          margin-bottom: 0;\n        }\n\n        :host([scroll]) mwc-fab {\n          bottom: 4px;\n          right: 4px;\n          --mdc-fab-box-shadow: none;\n          --mdc-theme-secondary: rgba(var(--rgb-primary-color), 0.5);\n        }\n      ']);return v=function(){return e},e}function b(){var e=V(['<span class="error">',"</span>"]);return b=function(){return e},e}function g(){var e=V(['<a\n              href="','"\n              target="_blank"\n              rel="noreferrer"\n              >',"</a\n            >"]);return g=function(){return e},e}function w(){var e=V(["\n        <h2>\n          ","\n        </h2>\n        <p>\n          ","\n          <br />\n          ","\n          <br />\n          ","\n        </p>\n      "]);return w=function(){return e},e}function k(e){return function(e){if(Array.isArray(e))return oe(e)}(e)||ae(e)||ie(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 _(e,n,t,r,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void t(l)}s.done?n(c):Promise.resolve(c).then(r,i)}function x(e){return function(){var n=this,t=arguments;return new Promise((function(r,i){var o=e.apply(n,t);function a(e){_(o,r,i,a,s,"next",e)}function s(e){_(o,r,i,a,s,"throw",e)}a(void 0)}))}}function E(){var e=V(['<a\n                          href="','"\n                          target="_blank"\n                          rel="noreferrer"\n                          >',"</a\n                        >"]);return E=function(){return e},e}function P(){var e=V(["<br />","\n                      <br />\n                      ",""]);return P=function(){return e},e}function O(){var e=V(['\n              <div class="container">\n                ',"\n                <br />\n                ","\n              </div>\n            "]);return O=function(){return e},e}function z(){var e=V(["\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                    ']);return z=function(){return e},e}function C(){var e=V(["\n                <mwc-list>\n                  ","\n                </mwc-list>\n              "]);return C=function(){return e},e}function D(){var e=V(['\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                              "]);return D=function(){return e},e}function S(){var e=V(['\n                                  <ha-svg-icon\n                                    class="folder"\n                                    .path=',"\n                                  ></ha-svg-icon>\n                                "]);return S=function(){return e},e}function j(){var e=V(['\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                    "]);return j=function(){return e},e}function A(){var e=V(['\n                <div\n                  class="children ','"\n                >\n                  ',"\n                </div>\n              "]);return A=function(){return e},e}function T(){var e=V(['\n              <div class="container">\n                ',"\n              </div>\n            "]);return T=function(){return e},e}function R(){var e=V(["\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            "]);return R=function(){return e},e}function I(){var e=V(["\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                "]);return I=function(){return e},e}function F(){var e=V(['\n                    <h2 class="subtitle">\n                      ',"\n                    </h2>\n                  "]);return F=function(){return e},e}function H(){var e=V(['\n                    <div class="previous-title" @click=',">\n                      <ha-svg-icon .path=","></ha-svg-icon>\n                      ","\n                    </div>\n                  "]);return H=function(){return e},e}function B(){var e=V([""]);return B=function(){return e},e}function M(){var e=V(["\n                        <mwc-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                        </mwc-fab>\n                      "]);return M=function(){return e},e}function q(){var e=V(['\n                <div\n                  class="img"\n                  style=',"\n                >\n                  ","\n                </div>\n              "]);return q=function(){return e},e}function $(){var e=V(['\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    "]);return $=function(){return e},e}function N(){var e=V([""]);return N=function(){return e},e}function X(){var e=V(['\n          <div class="container">\n            ',"\n          </div>\n        "]);return X=function(){return e},e}function U(){var e=V(["<ha-circular-progress active></ha-circular-progress>"]);return U=function(){return e},e}function V(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}function W(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function Y(e,n){return(Y=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}function Z(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,r=ce(e);if(n){var i=ce(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return J(this,t)}}function J(e,n){return!n||"object"!==y(n)&&"function"!=typeof n?L(e):n}function L(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Q(){Q=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,n){["method","field"].forEach((function(t){n.forEach((function(n){n.kind===t&&"own"===n.placement&&this.defineClassElement(e,n)}),this)}),this)},initializeClassElements:function(e,n){var t=e.prototype;["method","field"].forEach((function(r){n.forEach((function(n){var i=n.placement;if(n.kind===r&&("static"===i||"prototype"===i)){var o="static"===i?e:t;this.defineClassElement(o,n)}}),this)}),this)},defineClassElement:function(e,n){var t=n.descriptor;if("field"===n.kind){var r=n.initializer;t={enumerable:t.enumerable,writable:t.writable,configurable:t.configurable,value:void 0===r?void 0:r.call(e)}}Object.defineProperty(e,n.key,t)},decorateClass:function(e,n){var t=[],r=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!ee(e))return t.push(e);var n=this.decorateElement(e,i);t.push(n.element),t.push.apply(t,n.extras),r.push.apply(r,n.finishers)}),this),!n)return{elements:t,finishers:r};var o=this.decorateConstructor(t,n);return r.push.apply(r,o.finishers),o.finishers=r,o},addElementPlacement:function(e,n,t){var r=n[e.placement];if(!t&&-1!==r.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");r.push(e.key)},decorateElement:function(e,n){for(var t=[],r=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=n[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,n),c.finisher&&r.push(c.finisher);var l=c.extras;if(l){for(var d=0;d<l.length;d++)this.addElementPlacement(l[d],n);t.push.apply(t,l)}}return{element:e,finishers:r,extras:t}},decorateConstructor:function(e,n){for(var t=[],r=n.length-1;r>=0;r--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,n[r])(i)||i);if(void 0!==o.finisher&&t.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:t}},fromElementDescriptor:function(e){var n={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(n,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(n.initializer=e.initializer),n},toElementDescriptors:function(e){var n;if(void 0!==e)return(n=e,function(e){if(Array.isArray(e))return e}(n)||ae(n)||ie(n)||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 n=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),n}),this)},toElementDescriptor:function(e){var n=String(e.kind);if("method"!==n&&"field"!==n)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+n+'"');var t=re(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:n,key:t,placement:r,descriptor:Object.assign({},i)};return"field"!==n?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:te(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var n={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(n,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),n},toClassDescriptor:function(e){var n=String(e.kind);if("class"!==n)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+n+'"');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 t=te(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:t}},runClassFinishers:function(e,n){for(var t=0;t<n.length;t++){var r=(0,n[t])(e);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");e=r}}return e},disallowProperty:function(e,n,t){if(void 0!==e[n])throw new TypeError(t+" can't have a ."+n+" property.")}};return e}function G(e){var n,t=re(e.key);"method"===e.kind?n={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?n={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?n={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(n={configurable:!0,writable:!0,enumerable:!0});var r={kind:"field"===e.kind?"field":"method",key:t,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:n};return e.decorators&&(r.decorators=e.decorators),"field"===e.kind&&(r.initializer=e.value),r}function K(e,n){void 0!==e.descriptor.get?n.descriptor.get=e.descriptor.get:n.descriptor.set=e.descriptor.set}function ee(e){return e.decorators&&e.decorators.length}function ne(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function te(e,n){var t=e[n];if(void 0!==t&&"function"!=typeof t)throw new TypeError("Expected '"+n+"' to be a function");return t}function re(e){var n=function(e,n){if("object"!==y(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!==y(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===y(n)?n:String(n)}function ie(e,n){if(e){if("string"==typeof e)return oe(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?oe(e,n):void 0}}function oe(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function ae(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function se(e,n,t){return(se="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,n,t){var r=function(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&null!==(e=ce(e)););return e}(e,n);if(r){var i=Object.getOwnPropertyDescriptor(r,n);return i.get?i.get.call(t):i.value}})(e,n,t||e)}function ce(e){return(ce=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e,n,t,r){var i=Q();if(r)for(var o=0;o<r.length;o++)i=r[o](i);var a=n((function(e){i.initializeInstanceElements(e,s.elements)}),t),s=i.decorateClass(function(e){for(var n=[],t=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=n.find(t)))if(ne(o.descriptor)||ne(i.descriptor)){if(ee(o)||ee(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(ee(o)){if(ee(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}K(o,i)}else n.push(o)}return n}(a.d.map(G)),e);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,i.Mo)("ha-media-player-browse")],(function(e,n){var t,y,_,V,J,Q=function(n){!function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&Y(e,n)}(r,n);var t=Z(r);function r(){var n;W(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=t.call.apply(t,[this].concat(o)),e(L(n)),n}return r}(n);return{F:Q,d:[{kind:"field",decorators:[(0,i.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,i.Cb)()],key:"entityId",value:void 0},{kind:"field",decorators:[(0,i.Cb)()],key:"mediaContentId",value:void 0},{kind:"field",decorators:[(0,i.Cb)()],key:"mediaContentType",value:void 0},{kind:"field",decorators:[(0,i.Cb)()],key:"action",value:function(){return"play"}},{kind:"field",decorators:[(0,i.Cb)({type:Boolean})],key:"dialog",value:function(){return!1}},{kind:"field",decorators:[(0,i.Cb)({type:Boolean,attribute:"narrow",reflect:!0})],key:"_narrow",value:function(){return!1}},{kind:"field",decorators:[(0,i.Cb)({type:Boolean,attribute:"scroll",reflect:!0})],key:"_scrolled",value:function(){return!1}},{kind:"field",decorators:[(0,i.sz)()],key:"_loading",value:function(){return!1}},{kind:"field",decorators:[(0,i.sz)()],key:"_error",value:void 0},{kind:"field",decorators:[(0,i.sz)()],key:"_mediaPlayerItems",value:function(){return[]}},{kind:"field",decorators:[(0,i.IO)(".header")],key:"_header",value:void 0},{kind:"field",decorators:[(0,i.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;se(ce(Q.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,n=this;if(this._loading)return(0,i.dy)(U());if(this._error&&!this._mediaPlayerItems.length){if(!this.dialog)return(0,i.dy)(X(),this._renderError(this._error));this._closeDialogAction(),(0,f.Ys)(this,{title:this.hass.localize("ui.components.media-browser.media_browsing_error"),text:this._renderError(this._error)})}if(!this._mediaPlayerItems.length)return(0,i.dy)(N());var t=this._mediaPlayerItems[this._mediaPlayerItems.length-1],c=this._mediaPlayerItems.length>1?this._mediaPlayerItems[this._mediaPlayerItems.length-2]:void 0,d=this.hass.localize("ui.components.media-browser.class.".concat(t.media_class)),p=u.Fn[t.media_class],h=u.Fn[t.children_media_class];return(0,i.dy)($(),(0,o.$)({"no-img":!t.thumbnail,"no-dialog":!this.dialog}),this._setHeaderHeight,t.thumbnail?(0,i.dy)(q(),(0,s.V)({backgroundImage:t.thumbnail?"url(".concat(t.thumbnail,")"):"none"}),this._narrow&&(null==t?void 0:t.can_play)?(0,i.dy)(M(),t,this._actionClicked,this.hass.localize("ui.components.media-browser.".concat(this.action,"-media")),"play"===this.action?r._86:r.qX5,this.hass.localize("ui.components.media-browser.".concat(this.action))):""):(0,i.dy)(B()),c?(0,i.dy)(H(),this.navigateBack,r.J3k,c.title):"",t.title,d?(0,i.dy)(F(),d):"",!t.can_play||t.thumbnail&&this._narrow?"":(0,i.dy)(I(),t,this._actionClicked,this.hass.localize("ui.components.media-browser.".concat(this.action,"-media")),"play"===this.action?r._86:r.qX5,this.hass.localize("ui.components.media-browser.".concat(this.action))),this.dialog?(0,i.dy)(R(),this.hass.localize("ui.dialogs.generic.close"),this._closeDialogAction,(0,l.Zu)(this.hass),r.r5M):"",this._scroll,this._scroll,this._error?(0,i.dy)(T(),this._renderError(this._error)):(null===(e=t.children)||void 0===e?void 0:e.length)?"grid"===h.layout?(0,i.dy)(A(),(0,o.$)({portrait:"portrait"===h.thumbnail_ratio}),t.children.map((function(e){return(0,i.dy)(j(),e,n._childClicked,(0,s.V)({backgroundImage:e.thumbnail?"url(".concat(e.thumbnail,")"):"none"}),e.thumbnail?"":(0,i.dy)(S(),u.Fn["directory"===e.media_class&&e.children_media_class||e.media_class].icon),e.can_play?(0,i.dy)(D(),(0,o.$)({can_expand:e.can_expand}),e,n.hass.localize("ui.components.media-browser.".concat(n.action,"-media")),n._actionClicked,"play"===n.action?r._86:r.qX5):"",e.title,e.title,n.hass.localize("ui.components.media-browser.content-type.".concat(e.media_content_type)))}))):(0,i.dy)(C(),t.children.map((function(e){return(0,i.dy)(z(),n._childClicked,e,(0,l.Zu)(n.hass),(0,a.o)(p.show_list_images&&e.thumbnail?"background-image: url(".concat(e.thumbnail,")"):void 0),(0,o.$)({show:!p.show_list_images||!e.thumbnail}),e,n.hass.localize("ui.components.media-browser.".concat(n.action,"-media")),n._actionClicked,"play"===n.action?r._86:r.qX5,e.title)}))):(0,i.dy)(O(),this.hass.localize("ui.components.media-browser.no_items"),"media-source://media_source/local/."===t.media_content_id?(0,i.dy)(P(),this.hass.localize("ui.components.media-browser.learn_adding_local_media","documentation",(0,i.dy)(E(),(0,m.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 n=this;se(ce(Q.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&&(n._mediaPlayerItems=[e])})).catch((function(e){n._error=e})))}},{kind:"method",key:"_setHeaderHeight",value:(J=x(regeneratorRuntime.mark((function e(){var n,t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.updateComplete;case 2:if(n=this._header,t=this._content,n&&t){e.next=6;break}return e.abrupt("return");case 6:this._headerOffsetHeight=n.offsetHeight,t.style.marginTop="".concat(this._headerOffsetHeight,"px"),t.style.maxHeight="calc(var(--media-browser-max-height, 100%) - ".concat(this._headerOffsetHeight,"px)");case 9:case"end":return e.stop()}}),e,this)}))),function(){return J.apply(this,arguments)})},{kind:"method",key:"_animateHeaderHeight",value:function(){var e,n=this;requestAnimationFrame((function t(r){void 0===e&&(e=r);var i=r-e;n._setHeaderHeight(),i<400&&requestAnimationFrame(t)}))}},{kind:"method",key:"_actionClicked",value:function(e){e.stopPropagation();var n=e.currentTarget.item;this._runAction(n)}},{kind:"method",key:"_runAction",value:function(e){(0,c.B)(this,"media-picked",{item:e})}},{kind:"method",key:"_childClicked",value:(V=x(regeneratorRuntime.mark((function e(n){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.currentTarget,r=t.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 V.apply(this,arguments)})},{kind:"method",key:"_navigate",value:(_=x(regeneratorRuntime.mark((function e(n){var t,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(n.media_content_id,n.media_content_type);case 4:r=e.sent,e.next=11;break;case 7:return e.prev=7,e.t0=e.catch(1),(0,f.Ys)(this,{title:this.hass.localize("ui.components.media-browser.media_browsing_error"),text:this._renderError(e.t0)}),e.abrupt("return");case 11:null===(t=this._content)||void 0===t||t.scrollTo(0,0),this._scrolled=!1,this._mediaPlayerItems=[].concat(k(this._mediaPlayerItems),[r]);case 14:case"end":return e.stop()}}),e,this,[[1,7]])}))),function(e){return _.apply(this,arguments)})},{kind:"method",key:"_fetchData",value:(y=x(regeneratorRuntime.mark((function e(n,t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._loading=!0,this.entityId===u.N8){e.next=7;break}return e.next=4,(0,u.zz)(this.hass,this.entityId,n,t);case 4:e.t0=e.sent,e.next=10;break;case 7:return e.next=9,(0,u.b)(this.hass,n);case 9:e.t0=e.sent;case 10:return r=e.t0,this._loading=!1,e.abrupt("return",r);case 13:case"end":return e.stop()}}),e,this)}))),function(e,n){return y.apply(this,arguments)})},{kind:"method",key:"_measureCard",value:function(){this._narrow=(this.dialog?window.innerWidth:this.offsetWidth)<450}},{kind:"method",decorators:[(0,i.hO)({passive:!0})],key:"_scroll",value:function(e){var n=e.currentTarget;!this._scrolled&&n.scrollTop>this._headerOffsetHeight?this._scrolled=!0:this._scrolled&&n.scrollTop<this._headerOffsetHeight&&(this._scrolled=!1)}},{kind:"method",key:"_attachObserver",value:(t=x(regeneratorRuntime.mark((function e(){var n=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,p.P)();case 3:this._resizeObserver=new ResizeObserver((0,d.D)((function(){return n._measureCard()}),250,!1));case 4:this._resizeObserver.observe(this);case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{kind:"method",key:"_closeDialogAction",value:function(){(0,c.B)(this,"close-dialog")}},{kind:"method",key:"_renderError",value:function(e){return"Media directory does not exist."===e.message?(0,i.dy)(w(),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,i.dy)(g(),(0,m.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,i.dy)(b(),e.message)}},{kind:"get",static:!0,key:"styles",value:function(){return[h.Qx,(0,i.iv)(v())]}}]}}),i.oi)},27322:function(e,n,t){"use strict";t.d(n,{R:function(){return r}});var r=function(e,n){return"https://www.iobroker.net/#".concat(e.language&&e.language.split("-")[0]||"en","/adapters/adapterref/iobroker.lovelace/README.md")}}}]);
//# sourceMappingURL=chunk.4d1231f9a82738e73b89.js.map