iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 24.4 kB
JavaScript
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[6684],{81303:function(t,e,n){"use strict";n(8878);function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function a(t,e,n){return(a="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=l(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(t){var e=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(t){return!1}}();return function(){var n,r=l(t);if(e){var i=l(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u(this,n)}}function u(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var d=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(d,t);var e,n,r,u=c(d);function d(){return i(this,d),u.apply(this,arguments)}return e=d,(n=[{key:"ready",value:function(){var t=this;a(l(d.prototype),"ready",this).call(this),setTimeout((function(){"rtl"===window.getComputedStyle(t).direction&&(t.style.textAlign="right")}),100)}}])&&o(e.prototype,n),r&&o(e,r),d}(customElements.get("paper-dropdown-menu"));customElements.define("ha-paper-dropdown-menu",d)},24734:function(t,e,n){"use strict";n.d(e,{B:function(){return i}});var r=n(47181),i=function(t,e){(0,r.B)(t,"show-dialog",{dialogTag:"dialog-media-player-browse",dialogImport:function(){return Promise.all([n.e(5009),n.e(4358),n.e(6755),n.e(1041),n.e(8374),n.e(6372),n.e(9119),n.e(2174),n.e(3238),n.e(8967),n.e(4535),n.e(4821),n.e(3998),n.e(5397),n.e(2509)]).then(n.bind(n,52809))},dialogParams:e})}},69371:function(t,e,n){"use strict";n.d(e,{MU:function(){return i},xh:function(){return o},X6:function(){return a},y:function(){return s},Y3:function(){return c},Bp:function(){return u},rv:function(){return l},VJ:function(){return d},WE:function(){return f},B6:function(){return p},Hy:function(){return h},VH:function(){return m},ep:function(){return y},Dh:function(){return v},pu:function(){return b},ZI:function(){return _},N8:function(){return g},Fn:function(){return w},zz:function(){return k},b:function(){return E},rs:function(){return O},Mj:function(){return S}});var r=n(55317),i=1,o=2,a=4,s=8,c=16,u=32,l=128,d=256,f=512,p=1024,h=2048,m=4096,y=16384,v=65536,b=131072,_=4.5,g="browser",w={album:{icon:r.eBO,layout:"grid"},app:{icon:r.Kpn,layout:"grid"},artist:{icon:r.HwD,layout:"grid",show_list_images:!0},channel:{icon:r.nTs,thumbnail_ratio:"portrait",layout:"grid"},composer:{icon:r.vmK,layout:"grid",show_list_images:!0},contributing_artist:{icon:r.HwD,layout:"grid",show_list_images:!0},directory:{icon:r.in3,layout:"grid",show_list_images:!0},episode:{icon:r.nTs,layout:"grid",thumbnail_ratio:"portrait"},game:{icon:r.qK8,layout:"grid",thumbnail_ratio:"portrait"},genre:{icon:r.vXW,layout:"grid",show_list_images:!0},image:{icon:r.TaT,layout:"grid"},movie:{icon:r.l1p,thumbnail_ratio:"portrait",layout:"grid"},music:{icon:r.MxT},playlist:{icon:r.MxF,layout:"grid",show_list_images:!0},podcast:{icon:r.wu9,layout:"grid"},season:{icon:r.nTs,layout:"grid",thumbnail_ratio:"portrait"},track:{icon:r.ZH0},tv_show:{icon:r.nTs,layout:"grid",thumbnail_ratio:"portrait"},url:{icon:r.m5Y},video:{icon:r.Jhp,layout:"grid"}},k=function(t,e,n,r){return t.callWS({type:"media_player/browse_media",entity_id:e,media_content_id:n,media_content_type:r})},E=function(t,e){return t.callWS({type:"media_source/browse_media",media_content_id:e})},O=function(t){var e=t.attributes.media_position;return"playing"!==t.state?e:e+=(Date.now()-new Date(t.attributes.media_position_updated_at).getTime())/1e3},S=function(t){var e;switch(t.attributes.media_content_type){case"music":e=t.attributes.media_artist;break;case"playlist":e=t.attributes.media_playlist;break;case"tvshow":e=t.attributes.media_series_title,t.attributes.media_season&&(e+=" S"+t.attributes.media_season,t.attributes.media_episode&&(e+="E"+t.attributes.media_episode));break;default:e=t.attributes.app_name||""}return e}},46684:function(t,e,n){"use strict";n.r(e);n(53918),n(25230);var r=n(55317),i=(n(30879),n(53973),n(51095),n(15652)),o=n(7323),a=n(40095),s=n(87744),c=(n(16509),n(10983),n(81303),n(46998),n(52039),n(24734)),u=n(56007),l=n(69371);function d(t){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(){var t=C(['\n ha-icon-button[action="turn_off"],\n ha-icon-button[action="turn_on"],\n ha-slider,\n #ttsInput {\n flex-grow: 1;\n }\n\n .controls {\n display: flex;\n align-items: center;\n }\n\n .basic-controls {\n flex-grow: 1;\n }\n\n .volume,\n .source-input,\n .sound-input,\n .tts {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n .source-input ha-icon,\n .sound-input ha-icon {\n padding: 7px;\n margin-top: 24px;\n }\n\n .source-input ha-paper-dropdown-menu,\n .sound-input ha-paper-dropdown-menu {\n margin-left: 10px;\n flex-grow: 1;\n }\n\n paper-item {\n cursor: pointer;\n }\n ']);return f=function(){return t},t}function p(){var t=C(['\n <div class="tts">\n <paper-input\n id="ttsInput"\n .disabled=',"\n .label=","\n @keydown=",'\n ></paper-input>\n <ha-icon-button\n icon="hass:send"\n .disabled=',"\n @click=","\n ></ha-icon-button>\n </div>\n </div>\n "]);return p=function(){return t},t}function h(){var t=C(["\n <paper-item .itemName=",">","</paper-item>\n "]);return h=function(){return t},t}function m(){var t=C(['\n <div class="sound-input">\n <ha-icon icon="hass:music-note"></ha-icon>\n <ha-paper-dropdown-menu\n dynamic-align\n label-float\n .label=','\n >\n <paper-listbox\n slot="dropdown-content"\n attr-for-selected="item-name"\n .selected=',"\n @iron-select=","\n >\n ","\n </paper-listbox>\n </ha-paper-dropdown-menu>\n </div>\n "]);return m=function(){return t},t}function y(){var t=C(["\n <paper-item .itemName=",">","</paper-item>\n "]);return y=function(){return t},t}function v(){var t=C(['\n <div class="source-input">\n <ha-icon class="source-input" icon="hass:login-variant"></ha-icon>\n <ha-paper-dropdown-menu\n .label=','\n >\n <paper-listbox\n slot="dropdown-content"\n attr-for-selected="item-name"\n .selected=',"\n @iron-select=","\n >\n ","\n </paper-listbox>\n </ha-paper-dropdown-menu>\n </div>\n "]);return v=function(){return t},t}function b(){var t=C(['\n <ha-slider\n id="input"\n pin\n ignore-bar-touch\n .dir=',"\n .value=","\n @change=","\n ></ha-slider>\n "]);return b=function(){return t},t}function _(){var t=C(['\n <ha-icon-button\n action="volume_down"\n icon="hass:volume-minus"\n @click=','\n ></ha-icon-button>\n <ha-icon-button\n action="volume_up"\n icon="hass:volume-plus"\n @click=',"\n ></ha-icon-button>\n "]);return _=function(){return t},t}function g(){var t=C(["\n <ha-icon-button\n .icon=","\n @click=","\n ></ha-icon-button>\n "]);return g=function(){return t},t}function w(){var t=C(['\n <div class="volume">\n ',"\n ","\n ","\n </div>\n "]);return w=function(){return t},t}function k(){var t=C(["\n <mwc-icon-button\n .title=","\n @click=","\n ><ha-svg-icon .path=","></ha-svg-icon\n ></mwc-icon-button>\n "]);return k=function(){return t},t}function E(){var t=C(["\n <ha-icon-button\n action=","\n .icon=","\n @click=","\n ></ha-icon-button>\n "]);return E=function(){return t},t}function O(){var t=C(['\n <div class="controls">\n <div class="basic-controls">\n ',"\n </div>\n ","\n </div>\n "]);return O=function(){return t},t}function S(){var t=C(["\n ","\n ","\n ","\n ","\n ","\n "]);return S=function(){return t},t}function j(){var t=C([""]);return j=function(){return t},t}function C(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function P(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function T(t,e){return(T=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function x(t){var e=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(t){return!1}}();return function(){var n,r=z(t);if(e){var i=z(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return D(this,n)}}function D(t,e){return!e||"object"!==d(e)&&"function"!=typeof e?A(t):e}function A(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function z(t){return(z=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function R(){R=function(){return t};var t={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(t,e){["method","field"].forEach((function(n){e.forEach((function(e){e.kind===n&&"own"===e.placement&&this.defineClassElement(t,e)}),this)}),this)},initializeClassElements:function(t,e){var n=t.prototype;["method","field"].forEach((function(r){e.forEach((function(e){var i=e.placement;if(e.kind===r&&("static"===i||"prototype"===i)){var o="static"===i?t:n;this.defineClassElement(o,e)}}),this)}),this)},defineClassElement:function(t,e){var n=e.descriptor;if("field"===e.kind){var r=e.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===r?void 0:r.call(t)}}Object.defineProperty(t,e.key,n)},decorateClass:function(t,e){var n=[],r=[],i={static:[],prototype:[],own:[]};if(t.forEach((function(t){this.addElementPlacement(t,i)}),this),t.forEach((function(t){if(!B(t))return n.push(t);var e=this.decorateElement(t,i);n.push(e.element),n.push.apply(n,e.extras),r.push.apply(r,e.finishers)}),this),!e)return{elements:n,finishers:r};var o=this.decorateConstructor(n,e);return r.push.apply(r,o.finishers),o.finishers=r,o},addElementPlacement:function(t,e,n){var r=e[t.placement];if(!n&&-1!==r.indexOf(t.key))throw new TypeError("Duplicated element ("+t.key+")");r.push(t.key)},decorateElement:function(t,e){for(var n=[],r=[],i=t.decorators,o=i.length-1;o>=0;o--){var a=e[t.placement];a.splice(a.indexOf(t.key),1);var s=this.fromElementDescriptor(t),c=this.toElementFinisherExtras((0,i[o])(s)||s);t=c.element,this.addElementPlacement(t,e),c.finisher&&r.push(c.finisher);var u=c.extras;if(u){for(var l=0;l<u.length;l++)this.addElementPlacement(u[l],e);n.push.apply(n,u)}}return{element:t,finishers:r,extras:n}},decorateConstructor:function(t,e){for(var n=[],r=e.length-1;r>=0;r--){var i=this.fromClassDescriptor(t),o=this.toClassDescriptor((0,e[r])(i)||i);if(void 0!==o.finisher&&n.push(o.finisher),void 0!==o.elements){t=o.elements;for(var a=0;a<t.length-1;a++)for(var s=a+1;s<t.length;s++)if(t[a].key===t[s].key&&t[a].placement===t[s].placement)throw new TypeError("Duplicated element ("+t[a].key+")")}}return{elements:t,finishers:n}},fromElementDescriptor:function(t){var e={kind:t.kind,key:t.key,placement:t.placement,descriptor:t.descriptor};return Object.defineProperty(e,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===t.kind&&(e.initializer=t.initializer),e},toElementDescriptors:function(t){var e;if(void 0!==t)return(e=t,function(t){if(Array.isArray(t))return t}(e)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(e)||function(t,e){if(t){if("string"==typeof t)return H(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?H(t,e):void 0}}(e)||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(t){var e=this.toElementDescriptor(t);return this.disallowProperty(t,"finisher","An element descriptor"),this.disallowProperty(t,"extras","An element descriptor"),e}),this)},toElementDescriptor:function(t){var e=String(t.kind);if("method"!==e&&"field"!==e)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+e+'"');var n=N(t.key),r=String(t.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=t.descriptor;this.disallowProperty(t,"elements","An element descriptor");var o={kind:e,key:n,placement:r,descriptor:Object.assign({},i)};return"field"!==e?this.disallowProperty(t,"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=t.initializer),o},toElementFinisherExtras:function(t){return{element:this.toElementDescriptor(t),finisher:V(t,"finisher"),extras:this.toElementDescriptors(t.extras)}},fromClassDescriptor:function(t){var e={kind:"class",elements:t.map(this.fromElementDescriptor,this)};return Object.defineProperty(e,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),e},toClassDescriptor:function(t){var e=String(t.kind);if("class"!==e)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+e+'"');this.disallowProperty(t,"key","A class descriptor"),this.disallowProperty(t,"placement","A class descriptor"),this.disallowProperty(t,"descriptor","A class descriptor"),this.disallowProperty(t,"initializer","A class descriptor"),this.disallowProperty(t,"extras","A class descriptor");var n=V(t,"finisher");return{elements:this.toElementDescriptors(t.elements),finisher:n}},runClassFinishers:function(t,e){for(var n=0;n<e.length;n++){var r=(0,e[n])(t);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");t=r}}return t},disallowProperty:function(t,e,n){if(void 0!==t[e])throw new TypeError(n+" can't have a ."+e+" property.")}};return t}function M(t){var e,n=N(t.key);"method"===t.kind?e={value:t.value,writable:!0,configurable:!0,enumerable:!1}:"get"===t.kind?e={get:t.value,configurable:!0,enumerable:!1}:"set"===t.kind?e={set:t.value,configurable:!0,enumerable:!1}:"field"===t.kind&&(e={configurable:!0,writable:!0,enumerable:!0});var r={kind:"field"===t.kind?"field":"method",key:n,placement:t.static?"static":"field"===t.kind?"own":"prototype",descriptor:e};return t.decorators&&(r.decorators=t.decorators),"field"===t.kind&&(r.initializer=t.value),r}function I(t,e){void 0!==t.descriptor.get?e.descriptor.get=t.descriptor.get:e.descriptor.set=t.descriptor.set}function B(t){return t.decorators&&t.decorators.length}function F(t){return void 0!==t&&!(void 0===t.value&&void 0===t.writable)}function V(t,e){var n=t[e];if(void 0!==n&&"function"!=typeof n)throw new TypeError("Expected '"+e+"' to be a function");return n}function N(t){var e=function(t,e){if("object"!==d(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==d(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===d(e)?e:String(e)}function H(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}!function(t,e,n,r){var i=R();if(r)for(var o=0;o<r.length;o++)i=r[o](i);var a=e((function(t){i.initializeInstanceElements(t,s.elements)}),n),s=i.decorateClass(function(t){for(var e=[],n=function(t){return"method"===t.kind&&t.key===o.key&&t.placement===o.placement},r=0;r<t.length;r++){var i,o=t[r];if("method"===o.kind&&(i=e.find(n)))if(F(o.descriptor)||F(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}I(o,i)}else e.push(o)}return e}(a.d.map(M)),t);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,i.Mo)("more-info-media_player")],(function(t,e){return{F:function(e){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&T(t,e)}(r,e);var n=x(r);function r(){var e;P(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return e=n.call.apply(n,[this].concat(o)),t(A(e)),e}return r}(e),d:[{kind:"field",decorators:[(0,i.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,i.Cb)({attribute:!1})],key:"stateObj",value:void 0},{kind:"field",decorators:[(0,i.IO)("#ttsInput")],key:"_ttsInput",value:void 0},{kind:"method",key:"render",value:function(){var t,e,n=this;if(!this.stateObj)return(0,i.dy)(j());var c=this._getControls(),d=this.stateObj;return(0,i.dy)(S(),c?(0,i.dy)(O(),c.map((function(t){return(0,i.dy)(E(),t.action,t.icon,n._handleClick)})),(0,a.e)(d,l.pu)?(0,i.dy)(k(),this.hass.localize("ui.card.media_player.browse_media"),this._showBrowseMedia,r.hBf):""):"",!(0,a.e)(d,l.X6)&&!(0,a.e)(d,l.B6)||[u.nZ,u.lz,"off"].includes(d.state)?"":(0,i.dy)(w(),(0,a.e)(d,l.y)?(0,i.dy)(g(),d.attributes.is_volume_muted?"hass:volume-off":"hass:volume-high",this._toggleMute):"",(0,a.e)(d,l.B6)?(0,i.dy)(_(),this._handleClick,this._handleClick):"",(0,a.e)(d,l.X6)?(0,i.dy)(b(),(0,s.Zu)(this.hass),100*Number(d.attributes.volume_level),this._selectedValueChanged):""),![u.nZ,u.lz,"off"].includes(d.state)&&(0,a.e)(d,l.Hy)&&(null===(t=d.attributes.source_list)||void 0===t?void 0:t.length)?(0,i.dy)(v(),this.hass.localize("ui.card.media_player.source"),d.attributes.source,this._handleSourceChanged,d.attributes.source_list.map((function(t){return(0,i.dy)(y(),t,t)}))):"",(0,a.e)(d,l.Dh)&&(null===(e=d.attributes.sound_mode_list)||void 0===e?void 0:e.length)?(0,i.dy)(m(),this.hass.localize("ui.card.media_player.sound_mode"),d.attributes.sound_mode,this._handleSoundModeChanged,d.attributes.sound_mode_list.map((function(t){return(0,i.dy)(h(),t,t)}))):"",(0,o.p)(this.hass,"tts")&&(0,a.e)(d,l.WE)?(0,i.dy)(p(),u.V_.includes(d.state),this.hass.localize("ui.card.media_player.text_to_speak"),this._ttsCheckForEnter,u.V_.includes(d.state),this._sendTTS):"")}},{kind:"get",static:!0,key:"styles",value:function(){return(0,i.iv)(f())}},{kind:"method",key:"_getControls",value:function(){var t=this.stateObj;if(t){var e=t.state;if(!u.V_.includes(e)){if("off"===e)return(0,a.e)(t,l.rv)?[{icon:"hass:power",action:"turn_on"}]:void 0;if("idle"===e)return(0,a.e)(t,l.ep)?[{icon:"hass:play",action:"media_play"}]:void 0;var n=[];return(0,a.e)(t,l.VJ)&&n.push({icon:"hass:power",action:"turn_off"}),(0,a.e)(t,l.Y3)&&n.push({icon:"hass:skip-previous",action:"media_previous_track"}),("playing"===e&&((0,a.e)(t,l.MU)||(0,a.e)(t,l.VH))||"paused"===e&&(0,a.e)(t,l.ep))&&n.push({icon:"playing"!==e?"hass:play":(0,a.e)(t,l.MU)?"hass:pause":"hass:stop",action:"media_play_pause"}),(0,a.e)(t,l.Bp)&&n.push({icon:"hass:skip-next",action:"media_next_track"}),n.length>0?n:void 0}}}},{kind:"method",key:"_handleClick",value:function(t){this.hass.callService("media_player",t.currentTarget.getAttribute("action"),{entity_id:this.stateObj.entity_id})}},{kind:"method",key:"_toggleMute",value:function(){this.hass.callService("media_player","volume_mute",{entity_id:this.stateObj.entity_id,is_volume_muted:!this.stateObj.attributes.is_volume_muted})}},{kind:"method",key:"_selectedValueChanged",value:function(t){this.hass.callService("media_player","volume_set",{entity_id:this.stateObj.entity_id,volume_level:Number(t.currentTarget.getAttribute("value"))/100})}},{kind:"method",key:"_handleSourceChanged",value:function(t){var e=t.detail.item.itemName;e&&this.stateObj.attributes.source!==e&&this.hass.callService("media_player","select_source",{entity_id:this.stateObj.entity_id,source:e})}},{kind:"method",key:"_handleSoundModeChanged",value:function(t){var e,n=t.detail.item.itemName;n&&(null===(e=this.stateObj)||void 0===e?void 0:e.attributes.sound_mode)!==n&&this.hass.callService("media_player","select_sound_mode",{entity_id:this.stateObj.entity_id,sound_mode:n})}},{kind:"method",key:"_ttsCheckForEnter",value:function(t){13===t.keyCode&&this._sendTTS()}},{kind:"method",key:"_sendTTS",value:function(){var t=this._ttsInput;if(t){var e=this.hass.services.tts,n=Object.keys(e).sort().find((function(t){return-1!==t.indexOf("_say")}));n&&(this.hass.callService("tts",n,{entity_id:this.stateObj.entity_id,message:t.value}),t.value="")}}},{kind:"method",key:"_showBrowseMedia",value:function(){var t=this;(0,c.B)(this,{action:"play",entityId:this.stateObj.entity_id,mediaPickedCallback:function(e){return t._playMedia(e.item.media_content_id,e.item.media_content_type)}})}},{kind:"method",key:"_playMedia",value:function(t,e){this.hass.callService("media_player","play_media",{entity_id:this.stateObj.entity_id,media_content_id:t,media_content_type:e})}}]}}),i.oi)}}]);
//# sourceMappingURL=chunk.a26fca286d59f16d647e.js.map