Files
haos_config/www/community/kiosk-mode/kiosk-mode.js
2026-01-30 23:31:00 -06:00

2 lines
64 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
!function(){"use strict";var e=function(){return e=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},e.apply(this,arguments)};function t(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{_(o.next(e))}catch(e){i(e)}}function s(e){try{_(o.throw(e))}catch(e){i(e)}}function _(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}_((o=o.apply(e,t||[])).next())}))}function n(e,t){var n,o,r,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(_){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,o=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){i.label=s[1];break}if(6===s[0]&&i.label<r[1]){i.label=r[1],r=s;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(s);break}r[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,_])}}}"function"==typeof SuppressedError&&SuppressedError;var o=function(e,t,n){var o;void 0===n&&(n={});var r=n.retries,i=void 0===r?10:r,a=n.delay,s=void 0===a?10:a,_=n.shouldReject,c=void 0===_||_,l=null!==(o=n.rejectMessage)&&void 0!==o?o:"Could not get the result after {{ retries }} retries";return new Promise((function(n,o){var r=0,a=function(){var _=e();t(_)?n(_):++r<i?setTimeout(a,s):c?o(new Error(l.replace(/\{\{\s*retries\s*\}\}/g,"".concat(i)))):n(_)};a()}))},r=function(){return r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},r.apply(this,arguments)};function i(e,t,n,o){return new(n||(n=Promise))((function(t,r){function i(e){try{s(o.next(e))}catch(e){r(e)}}function a(e){try{s(o.throw(e))}catch(e){r(e)}}function s(e){var o;e.done?t(e.value):(o=e.value,o instanceof n?o:new n((function(e){e(o)}))).then(i,a)}s((o=o.apply(e,[])).next())}))}function a(e,t){var n,o,r,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(_){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,o=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!((r=(r=i.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){i.label=s[1];break}if(6===s[0]&&i.label<r[1]){i.label=r[1],r=s;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(s);break}r[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,_])}}}"function"==typeof SuppressedError&&SuppressedError;var s="$",_=":host",c="invalid selector",l=10,u=10,E=function(e){var t,n=e[0],o=e[1];return(t=n)&&(t instanceof Document||t instanceof Element||t instanceof ShadowRoot)&&"string"==typeof o};function O(e,t){return function(e){return e.split(",").map((function(e){return e.trim()}))}(e).map((function(e){var n=function(e){return e.split(s).map((function(e){return e.trim()}))}(e);return t(n)}))}function I(e,t){var n=t?" If you want to select a shadowRoot, use ".concat(t," instead."):"";return"".concat(e," cannot be used with a selector ending in a shadowRoot (").concat(s,").").concat(n)}function A(e){return e instanceof Promise?e:Promise.resolve(e)}function d(){return"You can not select a shadowRoot (".concat(s,") of the document.")}function h(){return"You can not select a shadowRoot (".concat(s,") of a shadowRoot.")}function T(e,t){for(var n,o,r=null,i=e.length,a=0;a<i;a++){if(0===a)if(e[a].length)r=t.querySelector(e[a]);else{if(t instanceof Document)throw new SyntaxError(d());if(t instanceof ShadowRoot)throw new SyntaxError(h());r=(null===(n=t.shadowRoot)||void 0===n?void 0:n.querySelector(e[++a]))||null}else r=(null===(o=r.shadowRoot)||void 0===o?void 0:o.querySelector("".concat(_," ").concat(e[a])))||null;if(null===r)return null}return r}function D(e,t){var n,o=function(e,t){for(var n,o=0,r=t.length;o<r;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return[].concat(n||Array.prototype.slice.call(t))}(0,e),r=o.pop();if(!o.length)return t.querySelectorAll(r);var i=T(o,t);return(null===(n=null==i?void 0:i.shadowRoot)||void 0===n?void 0:n.querySelectorAll("".concat(_," ").concat(r)))||null}function f(e,t){if(1===e.length&&!e[0].length){if(t instanceof Document)throw new SyntaxError(d());if(t instanceof ShadowRoot)throw new SyntaxError(h());return t.shadowRoot}var n=T(e,t);return(null==n?void 0:n.shadowRoot)||null}function L(e,t,n,r){return i(this,0,void 0,(function(){return a(this,(function(i){return[2,o((function(){return function(e,t,n,o){for(var r=O(e,(function(e){if(!e[e.length-1].length)throw new SyntaxError(I(n,o));return e})),i=r.length,a=0;a<i;a++){var s=T(r[a],t);if(s)return s}return null}(e,t,"asyncQuerySelector","asyncShadowRootQuerySelector")}),(function(e){return!!e}),{retries:n,delay:r,shouldReject:!1})]}))}))}function p(e,t,n,r){return i(this,0,void 0,(function(){return a(this,(function(i){return[2,o((function(){return function(e,t,n){for(var o=O(e,(function(e){if(!e[e.length-1].length)throw new SyntaxError(I(n));return e})),r=o.length,i=0;i<r;i++){var a=D(o[i],t);if(null==a?void 0:a.length)return a}return document.querySelectorAll(c)}(e,t,"asyncQuerySelectorAll")}),(function(e){return!!e.length}),{retries:n,delay:r,shouldReject:!1})]}))}))}function S(e,t,n,r){return i(this,0,void 0,(function(){return a(this,(function(i){return[2,o((function(){return function(e,t,n,o){for(var r=O(e,(function(e){if(e.pop().length)throw new SyntaxError(function(e,t){return"".concat(e," must be used with a selector ending in a shadowRoot (").concat(s,"). If you don't want to select a shadowRoot, use ").concat(t," instead.")}(n,o));return e})),i=r.length,a=0;a<i;a++){var _=f(r[a],t);if(_)return _}return null}(e,t,"asyncShadowRootQuerySelector","asyncQuerySelector")}),(function(e){return!!e}),{retries:n,delay:r,shouldReject:!1})]}))}))}var R=function(e,t){var n=e.querySelectorAll(t);if(n.length)return n;if(e instanceof Element&&e.shadowRoot){var o=R(e.shadowRoot,t);if(o.length)return o}for(var r=0,i=Array.from(e.querySelectorAll("*"));r<i.length;r++){var a=i[r],s=R(a,t);if(s.length)return s}return document.querySelectorAll(c)},H=function(e,t,n,r){return o((function(){return R(e,t)}),(function(e){return!!e.length}),{retries:n,delay:r,shouldReject:!1})};function N(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i(this,0,void 0,(function(){var t,n,o,r,i;return a(this,(function(a){switch(a.label){case 0:return E(e)?(t=e[0],n=e[1],o=e[2],[4,L(n,t,(null==o?void 0:o.retries)||l,(null==o?void 0:o.delay)||u)]):[3,2];case 1:case 3:return[2,a.sent()];case 2:return r=e[0],i=e[1],[4,L(r,document,(null==i?void 0:i.retries)||l,(null==i?void 0:i.delay)||u)]}}))}))}function v(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i(this,0,void 0,(function(){var t,n,o,r,i;return a(this,(function(a){switch(a.label){case 0:return E(e)?(t=e[0],n=e[1],o=e[2],[4,p(n,t,(null==o?void 0:o.retries)||l,(null==o?void 0:o.delay)||u)]):[3,2];case 1:return[2,a.sent()];case 2:return r=e[0],i=e[1],[2,p(r,document,(null==i?void 0:i.retries)||l,(null==i?void 0:i.delay)||u)]}}))}))}function m(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i(this,0,void 0,(function(){var t,n,o,r,i;return a(this,(function(a){switch(a.label){case 0:return E(e)?(t=e[0],n=e[1],o=e[2],[4,S(n,t,(null==o?void 0:o.retries)||l,(null==o?void 0:o.delay)||u)]):[3,2];case 1:return[2,a.sent()];case 2:return r=e[0],i=e[1],[2,S(r,document,(null==i?void 0:i.retries)||l,(null==i?void 0:i.delay)||u)]}}))}))}var G=function(){function e(e,t){e instanceof Node||e instanceof Promise?(this._element=e,this._asyncParams=r({retries:l,delay:u},t||{})):(this._element=document,this._asyncParams=r({retries:l,delay:u},e||{}))}return Object.defineProperty(e.prototype,"element",{get:function(){return A(this._element).then((function(e){return e instanceof NodeList?e[0]||null:e}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"$",{get:function(){var t=this;return new e(A(this._element).then((function(e){return e instanceof Document||e instanceof ShadowRoot||null===e||e instanceof NodeList&&0===e.length?null:e instanceof NodeList?m(e[0],s,t._asyncParams):m(e,s,t._asyncParams)})),this._asyncParams)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"all",{get:function(){return A(this._element).then((function(e){return e instanceof NodeList?e:document.querySelectorAll(c)}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"asyncParams",{get:function(){return this._asyncParams},enumerable:!1,configurable:!0}),e.prototype.eq=function(e){return i(this,0,void 0,(function(){return a(this,(function(t){return[2,A(this._element).then((function(t){return t instanceof NodeList&&t[e]||null}))]}))}))},e.prototype.query=function(t){var n=this;return new e(A(this._element).then((function(e){return null===e||e instanceof NodeList&&0===e.length?null:e instanceof NodeList?v(e[0],t,n._asyncParams):v(e,t,n._asyncParams)})),this._asyncParams)},e.prototype.deepQuery=function(t){var n=this;return new e(A(this._element).then((function(e){return null===e||e instanceof NodeList&&0===e.length?null:e instanceof NodeList?Promise.race(Array.from(e).map((function(e){return H(e,t,n._asyncParams.retries,n._asyncParams.delay)}))):H(e,t,n._asyncParams.retries,n._asyncParams.delay)})),this._asyncParams)},e}(),y=function(e,t){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},y(e,t)},C=function(){return C=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},C.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var g,M,b,w,U,B,P,F,x,V,j,k,W,K,Y,q,$="$",z={retries:100,delay:50,eventThreshold:450};!function(e){e.HOME_ASSISTANT="HOME_ASSISTANT",e.HOME_ASSISTANT_MAIN="HOME_ASSISTANT_MAIN",e.HA_DRAWER="HA_DRAWER",e.HA_SIDEBAR="HA_SIDEBAR",e.PARTIAL_PANEL_RESOLVER="PARTIAL_PANEL_RESOLVER"}(g||(g={})),function(e){e.HA_PANEL_LOVELACE="HA_PANEL_LOVELACE",e.HUI_ROOT="HUI_ROOT",e.HEADER="HEADER",e.HUI_VIEW="HUI_VIEW"}(M||(M={})),function(e){e.HA_MORE_INFO_DIALOG="HA_MORE_INFO_DIALOG",e.HA_DIALOG="HA_DIALOG",e.HA_DIALOG_CONTENT="HA_DIALOG_CONTENT",e.HA_MORE_INFO_DIALOG_INFO="HA_MORE_INFO_DIALOG_INFO",e.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK="HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK",e.HA_DIALOG_MORE_INFO_SETTINGS="HA_DIALOG_MORE_INFO_SETTINGS"}(b||(b={})),function(e){e.ON_LISTEN="onListen",e.ON_PANEL_LOAD="onPanelLoad",e.ON_LOVELACE_PANEL_LOAD="onLovelacePanelLoad",e.ON_MORE_INFO_DIALOG_OPEN="onMoreInfoDialogOpen",e.ON_HISTORY_AND_LOGBOOK_DIALOG_OPEN="onHistoryAndLogBookDialogOpen",e.ON_SETTINGS_DIALOG_OPEN="onSettingsDialogOpen"}(w||(w={})),function(e){e.HOME_ASSISTANT="home-assistant",e.HOME_ASSISTANT_MAIN="home-assistant-main",e.HA_DRAWER="ha-drawer",e.HA_SIDEBAR="ha-sidebar",e.PARTIAL_PANEL_RESOLVER="partial-panel-resolver",e.HA_PANEL_LOVELACE="ha-panel-lovelace",e.HUI_ROOT="hui-root",e.HEADER=".header",e.HUI_VIEW="hui-view",e.HA_MORE_INFO_DIALOG="ha-more-info-dialog",e.HA_DIALOG="ha-dialog",e.HA_DIALOG_CONTENT=".content",e.HA_MORE_INFO_DIALOG_INFO="ha-more-info-info",e.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK="ha-more-info-history-and-logbook",e.HA_DIALOG_MORE_INFO_SETTINGS="ha-more-info-settings"}(q||(q={}));var J=((U={})[g.HOME_ASSISTANT]={selector:q.HOME_ASSISTANT,children:{shadowRoot:{selector:$,children:(B={},B[g.HOME_ASSISTANT_MAIN]={selector:q.HOME_ASSISTANT_MAIN,children:{shadowRoot:{selector:$,children:(P={},P[g.HA_DRAWER]={selector:q.HA_DRAWER,children:(F={},F[g.HA_SIDEBAR]={selector:q.HA_SIDEBAR,children:{shadowRoot:{selector:$}}},F[g.PARTIAL_PANEL_RESOLVER]={selector:q.PARTIAL_PANEL_RESOLVER},F)},P)}}},B)}}},U),Q=((x={})[M.HA_PANEL_LOVELACE]={selector:q.HA_PANEL_LOVELACE,children:{shadowRoot:{selector:$,children:(V={},V[M.HUI_ROOT]={selector:q.HUI_ROOT,children:{shadowRoot:{selector:$,children:(j={},j[M.HEADER]={selector:q.HEADER},j[M.HUI_VIEW]={selector:q.HUI_VIEW},j)}}},V)}}},x),X={shadowRoot:{selector:$,children:(k={},k[b.HA_MORE_INFO_DIALOG]={selector:q.HA_MORE_INFO_DIALOG,children:{shadowRoot:{selector:$,children:(W={},W[b.HA_DIALOG]={selector:q.HA_DIALOG,children:(K={},K[b.HA_DIALOG_CONTENT]={selector:q.HA_DIALOG_CONTENT,children:(Y={},Y[b.HA_MORE_INFO_DIALOG_INFO]={selector:q.HA_MORE_INFO_DIALOG_INFO},Y[b.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK]={selector:q.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK},Y[b.HA_DIALOG_MORE_INFO_SETTINGS]={selector:q.HA_DIALOG_MORE_INFO_SETTINGS},Y)},K)},W)}}},k)}},Z=function(e,t,n,o){return void 0===n&&(n=null),void 0===o&&(o=!1),Object.entries(t||{}).reduce((function(t,r){var i=r[0],a=r[1];if(a.selector===$&&n)return a.children?C(C({},t),Z(e,a.children,n,!0)):t;var s=n?n.then((function(t){return t?N(t,(n=a.selector,o?"$ "+n:n),e):null;var n})):N(a.selector,e);return t[i]={element:s,children:Z(e,a.children,s),selector:new G(s,e)},t}),{})},ee=function(e,t){for(var n=0,o=Object.entries(t);n<o.length;n++){var r=o[n];if(r[0]===e)return r[1];var i=ee(e,r[1].children);if(i)return i}},te=function(e,t){return Object.keys(e).reduce((function(e,n){var o=ee(n,t);o.children;var r=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}(o,["children"]);return e[n]=C({},r),e}),{})},ne=function(){function e(){this.delegate=document.createDocumentFragment()}return e.prototype.addEventListener=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];(e=this.delegate).addEventListener.apply(e,t)},e.prototype.dispatchEvent=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return(e=this.delegate).dispatchEvent.apply(e,t)},e.prototype.removeEventListener=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return(e=this.delegate).removeEventListener.apply(e,t)},e}(),oe=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n._config=C(C({},z),t),n._timestaps={},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}y(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype._dispatchEvent=function(e,t){var n=Date.now();n-this._timestaps[e]<this._config.eventThreshold||(this._timestaps[e]=n,this.dispatchEvent(new CustomEvent(e,{detail:t})))},t.prototype._updateDialogElements=function(e){var t,n=this;void 0===e&&(e=b.HA_MORE_INFO_DIALOG_INFO),this._dialogTree=Z(this._config,X,this._haRootElements.HOME_ASSISTANT.element);var o=te(b,this._dialogTree);o.HA_DIALOG_CONTENT.element.then((function(e){n._dialogsContentObserver.disconnect(),n._dialogsContentObserver.observe(e,{childList:!0})})),this._haDialogElements=function(e,t){return[b.HA_MORE_INFO_DIALOG,b.HA_DIALOG,b.HA_DIALOG_CONTENT,t].reduce((function(t,n){return t[n]=e[n],t}),{})}(o,e);var r=((t={})[b.HA_MORE_INFO_DIALOG_INFO]=w.ON_MORE_INFO_DIALOG_OPEN,t[b.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK]=w.ON_HISTORY_AND_LOGBOOK_DIALOG_OPEN,t[b.HA_DIALOG_MORE_INFO_SETTINGS]=w.ON_SETTINGS_DIALOG_OPEN,t);this._dispatchEvent(r[e],this._haDialogElements)},t.prototype._updateRootElements=function(){var e=this;this._homeAssistantRootTree=Z(this._config,J),this._haRootElements=te(g,this._homeAssistantRootTree),this._haRootElements[g.HOME_ASSISTANT].selector.$.element.then((function(t){e._dialogsObserver.disconnect(),e._dialogsObserver.observe(t,{childList:!0})})),this._haRootElements[g.PARTIAL_PANEL_RESOLVER].element.then((function(t){e._panelResolverObserver.disconnect(),t&&e._panelResolverObserver.observe(t,{subtree:!0,childList:!0})})),this._dispatchEvent(w.ON_LISTEN,this._haRootElements),this._dispatchEvent(w.ON_PANEL_LOAD,this._haRootElements)},t.prototype._updateLovelaceElements=function(){var e=this;this._homeAssistantResolverTree=Z(this._config,Q,this._haRootElements[g.HA_DRAWER].element),this._haResolverElements=te(M,this._homeAssistantResolverTree),this._haResolverElements[M.HA_PANEL_LOVELACE].element.then((function(t){e._lovelaceObserver.disconnect(),t&&(e._lovelaceObserver.observe(t.shadowRoot,{childList:!0}),e._dispatchEvent(w.ON_LOVELACE_PANEL_LOAD,C(C({},e._haRootElements),e._haResolverElements)))}))},t.prototype._watchDialogs=function(e){var t=this;e.forEach((function(e){e.addedNodes.forEach((function(e){e.localName===q.HA_MORE_INFO_DIALOG&&t._updateDialogElements()}))}))},t.prototype._watchDialogsContent=function(e){var t=this;e.forEach((function(e){e.addedNodes.forEach((function(e){var n,o=((n={})[q.HA_MORE_INFO_DIALOG_INFO]=b.HA_MORE_INFO_DIALOG_INFO,n[q.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK]=b.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK,n[q.HA_DIALOG_MORE_INFO_SETTINGS]=b.HA_DIALOG_MORE_INFO_SETTINGS,n);if(e.localName&&e.localName in o){var r=e.localName;t._updateDialogElements(o[r])}}))}))},t.prototype._watchDashboards=function(e){var t=this;e.forEach((function(e){e.addedNodes.forEach((function(e){t._dispatchEvent(w.ON_PANEL_LOAD,t._haRootElements),e.localName===q.HA_PANEL_LOVELACE&&t._updateLovelaceElements()}))}))},t.prototype._watchLovelace=function(e){var t=this;e.forEach((function(e){e.addedNodes.forEach((function(e){e.localName===q.HUI_ROOT&&t._updateLovelaceElements()}))}))},t.prototype.listen=function(){this._watchDialogsBinded=this._watchDialogs.bind(this),this._watchDialogsContentBinded=this._watchDialogsContent.bind(this),this._watchDashboardsBinded=this._watchDashboards.bind(this),this._watchLovelaceBinded=this._watchLovelace.bind(this),this._dialogsObserver=new MutationObserver(this._watchDialogsBinded),this._dialogsContentObserver=new MutationObserver(this._watchDialogsContentBinded),this._panelResolverObserver=new MutationObserver(this._watchDashboardsBinded),this._lovelaceObserver=new MutationObserver(this._watchLovelaceBinded),this._updateRootElements(),this._updateLovelaceElements()},t.prototype.addEventListener=function(t,n,o){e.prototype.addEventListener.call(this,t,n,o)},t}(ne),re=/([A-Z])([a-z0-9_-]+)/g,ie=function(e){return Object.entries(e).map((function(e){var t=e[0],n=e[1];return"".concat(function(e){return e.replace(re,(function(e,t,n,o){var r=t.toLocaleLowerCase();return o?"-".concat(r).concat(n):"--".concat(r).concat(n)}))}(t),":").concat(n)})).join(";")+";"},ae=function(e){return(Array.isArray(e)?e:[e]).map((function(e){return"string"==typeof e?e:Object.entries(e).map((function(e){var t=e[0],n=e[1];return!1===n?"".concat(t,"{display: none !important}"):"".concat(t,"{").concat(ie(n),"}")})).join("")})).join("")},se=function(e,t){return"".concat(t,"_").concat(e)},_e=function(e){return e instanceof ShadowRoot?e.host.localName:e.localName},ce=function(e,t){var n=se(_e(e),t);return e.querySelector("#".concat(n))},le=function(){function e(e){var t,n,o;void 0===e&&(e={}),this._prefix=null!==(t=e.prefix)&&void 0!==t?t:"ha-styles-manager",this._namespace=null!==(n=e.namespace)&&void 0!==n?n:"home-assistant-styles-manager",this._throwWarnings=null===(o=e.throwWarnings)||void 0===o||o}return e.prototype.getStyleElement=function(e){return ce(e,this._prefix)},e.prototype.addStyle=function(e,t){!function(e,t,n,o,r){if(t){var i=ce(t,n);if(!i){var a=se(_e(t),n);(i=document.createElement("style")).setAttribute("id",a),t.appendChild(i)}i.innerHTML="string"==typeof e?e:ae(e)}else r&&console.warn("".concat(o,': no element has been provided calling "addStyle"'))}(e,t,this._prefix,this._namespace,this._throwWarnings)},e.prototype.removeStyle=function(e){!function(e,t,n,o){if(e){var r=ce(e,t);r?r.remove():o&&console.warn("".concat(n,': no style to remove calling "removeStyle"'))}else o&&console.warn("".concat(n,': no element has been provided calling "removeStyle"'))}(e,this._prefix,this._namespace,this._throwWarnings)},e}(),ue=function(){return ue=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},ue.apply(this,arguments)};function Ee(e,t,n){if(2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var Oe,Ie,Ae,de,he="[home-assistant-javascript-templates]",Te=/^([a-z_]+)\.(\w+)$/;!function(e){e.UNKNOWN="unknown",e.UNAVAILABLE="unavailable"}(Oe||(Oe={})),function(e){e.AREA_ID="area_id",e.NAME="name"}(Ie||(Ie={})),function(e){e.PANEL_URL="panel_url",e.LANG="lang"}(Ae||(Ae={})),function(e){e.LOCATION_CHANGED="location-changed",e.TRANSLATIONS_UPDATED="translations-updated",e.POPSTATE="popstate",e.SUBSCRIBE_EVENTS="subscribe_events",e.STATE_CHANGE_EVENT="state_changed"}(de||(de={}));var De=function(e){return e.reduce((function(e,t){var n=t[0],o=t[1];return e[n.replace(Te,"$2")]=o,e}),{})},fe=function(e){return e.includes(".")};function Le(e,t,n){var o=function(){return Object.entries(e.hass.areas)},r=function(){return Object.entries(e.hass.devices)},i=function(){return Object.entries(e.hass.entities)},a=new Set,s=new Map,_="ref",c="value",l="toJSON",u=function(e){return"".concat(_,".").concat(e)},E=function(e,t){n&&console.warn("".concat(e," ").concat(t," used in a JavaScript template doesn't exist"))},O=function(e){return E("Entity",e)},I=function(e){return E("Domain",e)},A=function(e){var o=new SyntaxError(e);if(t)throw o;n&&console.warn(o)},d=function(t){e.hass.states[t]?a.add(t):O(t)},h=function(e){a.add(e)},T=function(t,n){var o=n.with_unit,r=void 0!==o&&o,i=n.rounded,a=void 0!==i&&i;if(t){var s=t.state,_=t.attributes.unit_of_measurement,c=Number(a),l=!1===a||isNaN(Number(s))?s:new Intl.NumberFormat(e.hass.language,{minimumFractionDigits:c,maximumFractionDigits:c}).format(Number(s));return r&&_?"".concat(l," ").concat(_):l}},D=function(e){return new Proxy(e,{get:function(e,t){return"state_with_unit"===t?T(e,{rounded:!0,with_unit:!0}):e[t]}})};return{get hass(){return e.hass},states:new Proxy((function(t,n){if(void 0===n&&(n={}),fe(t))return d(t),T(e.hass.states[t],n);throw SyntaxError("".concat(he,": states method cannot be used with a domain, use it as an object instead."))}),{get:function(t,n){if(fe(n))return d(n),D(e.hass.states[n]);var o=Object.entries(e.hass.states).filter((function(e){return e[0].startsWith(n)}));return o.length||I(n),new Proxy(De(o),{get:function(e,t){return d("".concat(n,".").concat(t)),D(e[t])}})}}),state_translated:function(t){if(d(t),e.hass.states[t])return e.hass.formatEntityState(e.hass.states[t])},is_state:function(t,n){var o;return d(t),Array.isArray(n)?n.some((function(n){var o;return(null===(o=e.hass.states[t])||void 0===o?void 0:o.state)===n})):(null===(o=e.hass.states[t])||void 0===o?void 0:o.state)===n},state_attr:function(t,n){var o,r;return d(t),null===(r=null===(o=e.hass.states[t])||void 0===o?void 0:o.attributes)||void 0===r?void 0:r[n]},is_state_attr:function(e,t,n){return this.state_attr(e,t)===n},has_value:function(e){return this.states(e)?!(this.is_state(e,Oe.UNKNOWN)||this.is_state(e,Oe.UNAVAILABLE)):(O(e),!1)},entities:new Proxy((function(t){if(void 0===t)return e.hass.entities;if(fe(t))return d(t),e.hass.entities[t];var n=i().filter((function(e){return e[0].startsWith(t)}));return n.length||I(t),new Proxy(De(n),{get:function(e,n){return d("".concat(t,".").concat(n)),e[n]}})}),{get:function(e,t){return e(t)}}),entity_prop:function(t,n){var o;return d(t),null===(o=e.hass.entities[t])||void 0===o?void 0:o[n]},is_entity_prop:function(e,t,n){return this.entity_prop(e,t)===n},devices:new Proxy((function(t){if(void 0===t)return e.hass.devices;if(fe(t))throw SyntaxError("".concat(he,": devices method cannot be used with an entity id, you should use a device id instead."));return e.hass.devices[t]}),{get:function(t,n){if(fe(n))throw SyntaxError("".concat(he,": devices cannot be accesed using an entity id, you should use a device id instead."));return e.hass.devices[n]}}),device_attr:function(t,n){var o,r,i;if(fe(t)){d(t);var a=null===(o=e.hass.entities[t])||void 0===o?void 0:o.device_id;return null===(r=e.hass.devices[a])||void 0===r?void 0:r[n]}return null===(i=e.hass.devices[t])||void 0===i?void 0:i[n]},is_device_attr:function(e,t,n){return this.device_attr(e,t)===n},device_id:function(t){var n;if(fe(t))return d(t),null===(n=e.hass.entities[t])||void 0===n?void 0:n.device_id;var o=r().find((function(e){return e[1].name===t}));return null==o?void 0:o[0]},device_name:function(t){var n,o,r;if(fe(t)){d(t);var i=null===(n=e.hass.entities[t])||void 0===n?void 0:n.device_id;return null===(o=e.hass.devices[i])||void 0===o?void 0:o.name}return null===(r=e.hass.devices[t])||void 0===r?void 0:r.name},areas:function(){return o().map((function(e){return e[1].area_id}))},area_id:function(t){var n,r;if(t in e.hass.devices)return this.device_attr(t,Ie.AREA_ID);var i=null===(n=e.hass.entities[t])||void 0===n?void 0:n.device_id;if(i)return this.device_attr(i,Ie.AREA_ID);var a=o().find((function(e){return e[1].name===t}));return null===(r=null==a?void 0:a[1])||void 0===r?void 0:r.area_id},area_name:function(t){var n,r,i;t in e.hass.devices&&(i=this.device_attr(t,Ie.AREA_ID));var a=null===(n=e.hass.entities[t])||void 0===n?void 0:n.device_id;a&&(i=this.device_attr(a,Ie.AREA_ID));var s=o().find((function(e){var n=e[1];return n.area_id===t||n.area_id===i}));return null===(r=null==s?void 0:s[1])||void 0===r?void 0:r.name},area_entities:function(e){var t=o().find((function(t){var n=t[1];return n.area_id===e||n.name===e}));return t?i().filter((function(e){return e[1].area_id===t[1].area_id})).map((function(e){return e[0]})):[]},area_devices:function(e){var t=o().find((function(t){var n=t[1];return n.area_id===e||n.name===e}));return t?r().filter((function(e){return e[1].area_id===t[1].area_id})).map((function(e){return e[1].id})):[]},get user_name(){return e.hass.user.name},get user_is_admin(){return e.hass.user.is_admin},get user_is_owner(){return e.hass.user.is_owner},get user_agent(){return window.navigator.userAgent},get tracked(){return a},cleanTracked:function(){a.clear()},ref:function(e,t){var n,o=u(t);if(s.has(t))return s.get(t);var r=new Proxy(((n={})[c]=void 0,n[l]=function(){return this[c]},n),{get:function(e,t,n){if(t===c||t===l)return h(o),Reflect.get(e,t,n);A("".concat(t," is not a valid ").concat(_," property. A ").concat(_,' only exposes a "').concat(c,'" property'))},set:function(t,n,r){if(n===c){var i=t[c];return t[c]=r,e({event_type:de.STATE_CHANGE_EVENT,data:{entity_id:o,old_state:{state:JSON.stringify(i)},new_state:{state:JSON.stringify(r)}}}),!0}return A('property "'.concat(n,'" cannot be set in a ').concat(_)),!1}});return s.set(t,r),r},unref:function(e,t){var n=u(t);s.has(t)?(s.delete(t),e(n)):A("".concat(t," is not a ref or it has been unrefed already"))},clientSideProxy:new Proxy({},{get:function(t,o){switch(Object.values(Ae).includes(o)&&h(o),o){case Ae.PANEL_URL:return location.pathname;case Ae.LANG:return e.hass.language}n&&console.warn("clientSideProxy should only be used to access these variables: ".concat(Object.values(Ae).join(", ")))}})}}var pe,Se,Re,He,Ne,ve=function(){function e(e,t){var n=t.throwErrors,o=void 0!==n&&n,r=t.throwWarnings,i=void 0===r||r,a=t.variables,s=void 0===a?{}:a,_=t.autoReturn,c=void 0===_||_;this._throwErrors=o,this._throwWarnings=i,this._variables=s,this._autoReturn=c,this._subscriptions=new Map,this._clientSideEntitiesRegExp=new RegExp("(^|[ \\?(+:\\{\\[><,])(".concat(Object.values(Ae).join("|"),")($|[ \\?)+:\\}\\]><.,])"),"gm"),this._scopped=Le(e,o,i),this._watchForPanelUrlChange(),this._watchForEntitiesChange(),this._watchForLanguageChange()}return e.prototype._executeRenderingFunctions=function(e){var t=this;this._subscriptions.get(e).forEach((function(e,n){e.forEach((function(e,o){t.trackTemplate(n,o,e)}))}))},e.prototype._watchForPanelUrlChange=function(){var e=this;window.addEventListener(de.LOCATION_CHANGED,(function(){e._panelUrlWatchCallback()})),window.addEventListener(de.POPSTATE,(function(){e._panelUrlWatchCallback()}))},e.prototype._panelUrlWatchCallback=function(){this._subscriptions.has(Ae.PANEL_URL)&&this._executeRenderingFunctions(Ae.PANEL_URL)},e.prototype._watchForEntitiesChange=function(){var e=this;window.hassConnection.then((function(t){t.conn.subscribeMessage((function(t){return e._entityWatchCallback(t)}),{type:de.SUBSCRIBE_EVENTS,event_type:de.STATE_CHANGE_EVENT})}))},e.prototype._watchForLanguageChange=function(){var e=this;window.addEventListener(de.TRANSLATIONS_UPDATED,(function(){e._subscriptions.has(Ae.LANG)&&e._executeRenderingFunctions(Ae.LANG)}))},e.prototype._entityWatchCallback=function(e){if(this._subscriptions.size){var t=e.data.entity_id;this._subscriptions.has(t)&&this._executeRenderingFunctions(t)}},e.prototype._storeTracked=function(e,t,n){var o=this;this._scopped.tracked.forEach((function(r){var i=[t,n];if(o._subscriptions.has(r)){var a=o._subscriptions.get(r);if(a.has(e)){var s=a.get(e);s.has(t)||s.set.apply(s,i)}else a.set(e,new Map([i]))}else o._subscriptions.set(r,new Map([[e,new Map([i])]]))}))},e.prototype._untrackTemplate=function(e,t){var n=this;this._subscriptions.forEach((function(o,r){if(o.has(e)){var i=o.get(e);i.delete(t),0===i.size&&(o.delete(e),0===o.size&&n._subscriptions.delete(r))}}))},e.prototype.renderTemplate=function(e,t){void 0===t&&(t={});try{var n=new Map(Object.entries(ue(ue({},this._variables),t))),o=e.trim().replace(this._clientSideEntitiesRegExp,"$1clientSide.$2$3"),r=o.includes("return")||!this._autoReturn?o:"return ".concat(o);return(new(Function.bind.apply(Function,Ee(Ee([void 0,"hass","states","state_translated","is_state","state_attr","is_state_attr","has_value","entities","entity_prop","is_entity_prop","devices","device_attr","is_device_attr","device_id","device_name","areas","area_id","area_name","area_entities","area_devices","user_name","user_is_admin","user_is_owner","user_agent","clientSide","ref","unref"],Array.from(n.keys()),!1),["".concat('"use strict";'," ").concat(r)],!1)))).apply(void 0,Ee([this._scopped.hass,this._scopped.states,this._scopped.state_translated.bind(this._scopped),this._scopped.is_state.bind(this._scopped),this._scopped.state_attr.bind(this._scopped),this._scopped.is_state_attr.bind(this._scopped),this._scopped.has_value.bind(this._scopped),this._scopped.entities,this._scopped.entity_prop,this._scopped.is_entity_prop.bind(this._scopped),this._scopped.devices,this._scopped.device_attr.bind(this._scopped),this._scopped.is_device_attr.bind(this._scopped),this._scopped.device_id.bind(this._scopped),this._scopped.device_name.bind(this._scopped),this._scopped.areas.bind(this._scopped),this._scopped.area_id.bind(this._scopped),this._scopped.area_name.bind(this._scopped),this._scopped.area_entities.bind(this._scopped),this._scopped.area_devices.bind(this._scopped),this._scopped.user_name,this._scopped.user_is_admin,this._scopped.user_is_owner,this._scopped.user_agent,this._scopped.clientSideProxy,this._scopped.ref.bind(this._scopped,this._entityWatchCallback.bind(this)),this._scopped.unref.bind(this._scopped,this.cleanTracked.bind(this))],Array.from(n.values()),!1))}catch(e){if(this._throwErrors)throw e;return void(this._throwWarnings&&console.warn(e))}},e.prototype.trackTemplate=function(e,t,n){var o=this;void 0===n&&(n={}),this._scopped.cleanTracked();var r=this.renderTemplate(e,n);return this._storeTracked(e,t,n),t(r),function(){return o._untrackTemplate(e,t)}},e.prototype.cleanTracked=function(e){e?this._subscriptions.has(e)&&this._subscriptions.delete(e):this._subscriptions.clear()},Object.defineProperty(e.prototype,"variables",{get:function(){return this._variables},set:function(e){this._variables=e},enumerable:!1,configurable:!0}),e}(),me=function(){function e(e,t){void 0===t&&(t={}),this._renderer=o((function(){return e.hass}),(function(e){return!!(e&&e.areas&&e.devices&&e.entities&&e.states&&e.user)}),{retries:100,delay:50,rejectMessage:"The provided element doesn't contain a proper or initialised hass object"}).then((function(){return new ve(e,t)}))}return e.prototype.getRenderer=function(){return this._renderer},e}(),Ge="kiosk-mode";!function(e){e.KIOSK="kiosk",e.HIDE_SIDEBAR="hide_sidebar",e.HIDE_HEADER="hide_header",e.HIDE_ADD_TO_HOME_ASSISTANT="hide_add_to_home_assistant",e.HIDE_OVERFLOW="hide_overflow",e.HIDE_MENU_BUTTON="hide_menubutton",e.HIDE_ACCOUNT="hide_account",e.HIDE_NOTIFICATIONS="hide_notifications",e.HIDE_SEARCH="hide_search",e.HIDE_ASSISTANT="hide_assistant",e.HIDE_REFRESH="hide_refresh",e.HIDE_UNUSED_ENTITIES="hide_unused_entities",e.HIDE_RELOAD_RESOURCES="hide_reload_resources",e.HIDE_EDIT_DASHBOARD="hide_edit_dashboard",e.HIDE_DIALOG_HEADER_BREADCRUMB_NAVIGATION="hide_dialog_header_breadcrumb_navigation",e.HIDE_DIALOG_HEADER_ACTION_ITEMS="hide_dialog_header_action_items",e.HIDE_DIALOG_HEADER_HISTORY="hide_dialog_header_history",e.HIDE_DIALOG_HEADER_SETTINGS="hide_dialog_header_settings",e.HIDE_DIALOG_HEADER_OVERFLOW="hide_dialog_header_overflow",e.HIDE_DIALOG_HISTORY="hide_dialog_history",e.HIDE_DIALOG_LOGBOOK="hide_dialog_logbook",e.HIDE_DIALOG_ATTRIBUTES="hide_dialog_attributes",e.HIDE_DIALOG_MEDIA_ACTIONS="hide_dialog_media_actions",e.HIDE_DIALOG_UPDATE_ACTIONS="hide_dialog_update_actions",e.HIDE_DIALOG_CAMERA_ACTIONS="hide_dialog_camera_actions",e.HIDE_DIALOG_CLIMATE_ACTIONS="hide_dialog_climate_actions",e.HIDE_DIALOG_CLIMATE_TEMPERATURE_ACTIONS="hide_dialog_climate_temperature_actions",e.HIDE_DIALOG_CLIMATE_SETTINGS_ACTIONS="hide_dialog_climate_settings_actions",e.HIDE_DIALOG_TIMER_ACTIONS="hide_dialog_timer_actions",e.HIDE_DIALOG_LIGHT_ACTIONS="hide_dialog_light_actions",e.HIDE_DIALOG_LIGHT_CONTROL_ACTIONS="hide_dialog_light_control_actions",e.HIDE_DIALOG_LIGHT_COLOR_ACTIONS="hide_dialog_light_color_actions",e.HIDE_DIALOG_LIGHT_SETTINGS_ACTIONS="hide_dialog_light_settings_actions",e.HIDE_DIALOG_HISTORY_SHOW_MORE="hide_dialog_history_show_more",e.HIDE_DIALOG_LOGBOOK_SHOW_MORE="hide_dialog_logbook_show_more",e.BLOCK_OVERFLOW="block_overflow",e.BLOCK_MOUSE="block_mouse",e.BLOCK_CONTEXT_MENU="block_context_menu"}(Se||(Se={})),function(e){e.IGNORE_MOBILE_SETTINGS="ignore_mobile_settings",e.IGNORE_DISABLE_KM="ignore_disable_km"}(Re||(Re={})),function(e){e.DEBUG="debug",e.DEBUG_TEMPLATE="debug_template"}(He||(He={})),function(e){e.CACHE="cache",e.CLEAR_CACHE="clear_km_cache",e.DISABLE_KIOSK_MODE="disable_km"}(Ne||(Ne={}));var ye,Ce="ui",ge="".concat(Ce,".common"),Me="".concat(Ce,".panel"),be="".concat(Me,".lovelace"),we="".concat(be,".menu"),Ue="".concat(be,".editor"),Be="".concat(Ue,".menu"),Pe="".concat(Ce,".dialogs.more_info_control");!function(e){e.ADD="ADD",e.OVERFLOW="OVERFLOW",e.SEARCH="SEARCH",e.ASSIST="ASSIST",e.REFRESH="REFRESH",e.UNUSED_ENTITIES="UNUSED_ENTITIES",e.RELOAD_RESOURCES="RELOAD_RESOURCES",e.EDIT_DASHBOARD="EDIT_DASHBOARD",e.DIALOG_DISMISS="DIALOG_DISMISS",e.DIALOG_HISTORY="DIALOG_HISTORY",e.DIALOG_SETTINGS="DIALOG_SETTINGS"}(ye||(ye={}));var Fe,xe=Object.freeze(((pe={})[ye.ADD]="".concat(we,".add"),pe[ye.OVERFLOW]="".concat(Be,".open"),pe[ye.SEARCH]="".concat(we,".search_entities"),pe[ye.ASSIST]="".concat(we,".assist_tooltip"),pe[ye.REFRESH]="".concat(ge,".refresh"),pe[ye.UNUSED_ENTITIES]="".concat(be,".unused_entities.title"),pe[ye.RELOAD_RESOURCES]="".concat(we,".reload_resources"),pe[ye.EDIT_DASHBOARD]="".concat(we,".configure_ui"),pe[ye.DIALOG_HISTORY]="".concat(Pe,".history"),pe[ye.DIALOG_SETTINGS]="".concat(Pe,".settings"),pe[ye.DIALOG_DISMISS]="".concat(ge,".close"),pe));!function(e){e.HOME_ASSISTANT="home-assistant",e.HA_PANEL_LOVELACE="ha-panel-lovelace",e.HUI_VIEW="hui-view",e.MENU_ITEM="ha-icon-button",e.MENU_ITEM_ICON="mwc-icon-button",e.BUTTON_MENU="ha-button-menu",e.OVERLAY_MENU_ITEM="ha-list-item",e.TOOLBAR=".toolbar",e.ACTION_ITEMS=".action-items",e.HA_MORE_INFO_DIALOG="ha-more-info-dialog",e.HA_DIALOG="ha-dialog",e.HA_DIALOG_HEADER="ha-dialog-header",e.HA_DIALOG_MORE_INFO="ha-more-info-info",e.HA_DIALOG_HISTORY="ha-more-info-history",e.HA_DIALOG_LOGBOOK="ha-more-info-logbook",e.HA_DIALOG_MORE_INFO_CONTENT="more-info-content",e.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK="ha-more-info-history-and-logbook",e.HA_DIALOG_DEFAULT="more-info-default",e.HA_DIALOG_TIMER="more-info-timer",e.HA_DIALOG_VACUUM="more-info-vacuum",e.HA_DIALOG_CAMERA="more-info-camera",e.HA_DIALOG_SIREN="more-info-siren",e.HA_DIALOG_PERSON="more-info-person",e.HA_DIALOG_MEDIA_PLAYER="more-info-media_player",e.HA_DIALOG_LIGHT="more-info-light",e.HA_DIALOG_UPDATE="more-info-update",e.HA_DIALOG_LOCK="more-info-lock",e.HA_DIALOG_CLIMATE="more-info-climate",e.HA_DIALOG_CLIMATE_CONTROL_SELECT="ha-more-info-control-select-container",e.HA_STATE_CONTROL_CLIMATE_TEMPERATURE="ha-state-control-climate-temperature",e.HA_DIALOG_CLIMATE_TEMPERATURE_BUTTONS=".buttons",e.HA_DIALOG_CLIMATE_CIRCULAR_SLIDER="ha-control-circular-slider",e.HA_DIALOG_CLIMATE_CIRCULAR_SLIDER_INTERACTION="#interaction",e.HA_DIALOG_CLIMATE_CIRCULAR_SLIDER_INTERACTION_SLIDER='path[role="slider"]',e.HA_DIALOG_CLIMATE_CIRCULAR_SLIDER_INTERACTION_TARGET=".target",e.HA_DIALOG_CLIMATE_CIRCULAR_SLIDER_INTERACTION_TARGET_BORDER=".target-border",e.HA_DIALOG_LIGHT_BRIGHTNESS="ha-state-control-light-brightness",e.HA_DIALOG_LIGHT_CONTROLS="ha-icon-button-group",e.HA_DIALOG_LIGHT_COLORS="ha-more-info-light-favorite-colors",e.HA_DIALOG_LIGHT_SETTINGS="ha-more-info-control-select-container",e.HA_DIALOG_ATTRIBUTES="ha-attributes"}(Fe||(Fe={}));var Ve,je=/^(.*?)( \([A-Z]\))?$/,ke="true",We=/^\s*\[\[\[([\s\S]+)\]\]\]\s*$/,Ke=/\{\{[\s\S]*\}\}|\{%[\s\S]*%\}/,Ye="hass-toggle-menu",qe="MDCDrawer:closed",$e="resize",ze=function(e){var t=e.replace(/(?:^|_)([a-z])/g,(function(e,t){return t.toUpperCase()}));return"km".concat(t)},Je=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=new URLSearchParams(window.location.search);return e.some((function(e){return n.has(e)}))},Qe=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];t.forEach((function(t){return window.localStorage.setItem(ze(t),e)}))},Xe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.some((function(e){return window.localStorage.getItem(ze(e))===ke}))},Ze=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Object.fromEntries(e.map((function(e){return[e,!1]})))},et=function(e){return e.trim().replace(je,"$1").trim()},tt={HEADER:{"#view":{minHeight:"100vh !important",KioskHeaderHeight:"0px",paddingTop:"calc(var(--kiosk-header-height) + env(safe-area-inset-top)) !important"},".header":!1},ACCOUNT:Ze("ha-md-list-item.user"),NOTIFICATIONS:Ze("ha-md-list-item.notifications"),DIVIDER:Ze(".divider"),SIDEBAR_ITEMS_CONTAINER:function(e,t,n){var o=132,r=132;return n&&t?(o=0,r=0):n?(o-=50,r-=50):t&&(o-=48,r-=48),e&&(o-=56),{":host([expanded]) .title":{marginLeft:e?"19px":"3px"},":host(:not([expanded])) ha-md-list.ha-scrollbar":{height:"calc(100% - var(--header-height) - ".concat(o,"px - env(safe-area-inset-bottom)) !important")},":host([expanded]) ha-md-list.ha-scrollbar":{height:"calc(100% - var(--header-height) - ".concat(r,"px - env(safe-area-inset-bottom)) !important")}}},MENU_BUTTON:Ze(":host(:not([expanded])) .menu",":host([expanded]) .menu ha-icon-button"),MENU_BUTTON_BURGER:Ze("ha-menu-button"),MOUSE:{"body::after":{bottom:0,content:'""',cursor:"none",display:"block",left:0,position:"fixed",right:0,top:0,zIndex:999999}},SIDEBAR:{":host":{MdcDrawerWidth:"0px !important",KioskSidebarWidth:"0px"},"partial-panel-resolver":{MdcTopAppBarWidth:"100% !important"},"ha-drawer > ha-sidebar":!1,".header":{width:"100% !important"}},ASIDE:Ze(".mdc-drawer"),OVERFLOW_MENU:Ze("".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.BUTTON_MENU," > ").concat(Fe.MENU_ITEM,'[data-selector="').concat(ye.OVERFLOW,'"]')),BLOCK_OVERFLOW:(Ve={},Ve["".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.BUTTON_MENU)]={"pointer-events":"none !important"},Ve),ADD_TO_HOME_ASSISTANT:Ze("".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.BUTTON_MENU," > ").concat(Fe.MENU_ITEM,'[data-selector="').concat(ye.ADD,'"]'),"".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.BUTTON_MENU," > ").concat(Fe.OVERLAY_MENU_ITEM,'[data-selector="').concat(ye.ADD,'"]')),SEARCH:Ze("".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.MENU_ITEM,'[data-selector="').concat(ye.SEARCH,'"]'),"".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.BUTTON_MENU," > ").concat(Fe.OVERLAY_MENU_ITEM,'[data-selector="').concat(ye.SEARCH,'"]')),ASSISTANT:Ze("".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.MENU_ITEM,'[data-selector="').concat(ye.ASSIST,'"]'),"".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.BUTTON_MENU," > ").concat(Fe.OVERLAY_MENU_ITEM,'[data-selector="').concat(ye.ASSIST,'"]')),REFRESH:Ze("".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.BUTTON_MENU," > ").concat(Fe.OVERLAY_MENU_ITEM,'[data-selector="').concat(ye.REFRESH,'"]')),UNUSED_ENTITIES:Ze("".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.BUTTON_MENU," > ").concat(Fe.OVERLAY_MENU_ITEM,'[data-selector="').concat(ye.UNUSED_ENTITIES,'"]')),RELOAD_RESOURCES:Ze("".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.BUTTON_MENU," > ").concat(Fe.OVERLAY_MENU_ITEM,'[data-selector="').concat(ye.RELOAD_RESOURCES,'"]')),EDIT_DASHBOARD:Ze("".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.MENU_ITEM,'[data-selector="').concat(ye.EDIT_DASHBOARD,'"]'),"".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.BUTTON_MENU," > ").concat(Fe.OVERLAY_MENU_ITEM,'[data-selector="').concat(ye.EDIT_DASHBOARD,'"]')),DIALOG_HEADER_BREADCRUMB_NAVIGATION:Ze("".concat(Fe.HA_DIALOG_HEADER," > .title > .breadcrumb")),DIALOG_HEADER_HISTORY:Ze("".concat(Fe.HA_DIALOG_HEADER," > ").concat(Fe.MENU_ITEM,'[data-selector="').concat(ye.DIALOG_HISTORY,'"]')),DIALOG_HEADER_SETTINGS:Ze("".concat(Fe.HA_DIALOG_HEADER," > ").concat(Fe.MENU_ITEM,'[data-selector="').concat(ye.DIALOG_SETTINGS,'"]')),DIALOG_HEADER_OVERFLOW:Ze("".concat(Fe.HA_DIALOG_HEADER," > ").concat(Fe.BUTTON_MENU)),DIALOG_HISTORY:Ze(Fe.HA_DIALOG_HISTORY),DIALOG_LOGBOOK:Ze(Fe.HA_DIALOG_LOGBOOK),DIALOG_ATTRIBUTES:Ze(Fe.HA_DIALOG_ATTRIBUTES),DIALOG_MEDIA_ACTIONS:Ze(".bottom-controls > :is(.main-controls, .controls-row)"),DIALOG_TIMER_ACTIONS:Ze(".actions"),DIALOG_UPDATE_ACTIONS:Ze(".actions","ha-md-list:has(+ .actions)","hr:has(+ .actions)"),DIALOG_CAMERA_ACTIONS:Ze(".actions"),DIALOG_CLIMATE_CONTROL_SELECT:Ze(Fe.HA_DIALOG_CLIMATE_CONTROL_SELECT),DIALOG_CLIMATE_TEMPERATURE_BUTTONS:Ze(Fe.HA_DIALOG_CLIMATE_TEMPERATURE_BUTTONS),DIALOG_CLIMATE_CIRCULAR_SLIDER_INTERACTION:Ze(Fe.HA_DIALOG_CLIMATE_CIRCULAR_SLIDER_INTERACTION,Fe.HA_DIALOG_CLIMATE_CIRCULAR_SLIDER_INTERACTION_SLIDER,Fe.HA_DIALOG_CLIMATE_CIRCULAR_SLIDER_INTERACTION_TARGET_BORDER,Fe.HA_DIALOG_CLIMATE_CIRCULAR_SLIDER_INTERACTION_TARGET),DIALOG_LIGHT_CONTROL_ACTIONS:Ze(".controls > ".concat(Fe.HA_DIALOG_LIGHT_BRIGHTNESS," + ").concat(Fe.HA_DIALOG_LIGHT_CONTROLS)),DIALOG_LIGHT_COLOR_ACTIONS:Ze(".controls > ".concat(Fe.HA_DIALOG_LIGHT_COLORS)),DIALOG_LIGHT_SETTINGS_ACTIONS:Ze(".controls:has(> ".concat(Fe.HA_DIALOG_LIGHT_BRIGHTNESS,") + div > ").concat(Fe.HA_DIALOG_LIGHT_SETTINGS)),DIALOG_SHOW_MORE:Ze(".header a")},nt=[{content:"%c≡ kiosk-mode",color:"white",background:"#03a9f4"},{content:"%cversion ".concat("9.0.2")}],ot="font-weight: normal; color: inherit;",rt="font-weight: bold; color: blue;",it="font-weight: bold; color: red;",at="font-weight: bold; color: green;",st="color: #666",_t="text-decoration: underline",ct=Object.values(Re),lt=function(){function t(){}return t.logInfo=function(){var t=[],n=[],o=nt.length-1,r={"border-color":"#424242","border-style":"solid",display:"inline-block","font-family":"monospace","font-size":"12px"};nt.forEach((function(i,a){t.push(i.content.padEnd(27)),t.push("%c⋮"),a!==o&&t.push("%c\n");var s="0 0 0 1px",_="0 1px 0 1px";0===a?(s="1px 0 0 1px",_="1px 1px 0 0"):a===o&&(s="0 0 1px 1px",_="0 1px 1px 0"),n.push(ie(e(e({},r),{background:i.background||"white",color:i.color||"#424242",padding:0===a?"1px 0px 1px 5px":"1px 0px 1px 10px","border-width":s}))),n.push(ie(e(e({},r),{background:i.background||"white",color:i.color||"white",padding:0===a?"1px 5px":"1px 5px 1px 0px","border-width":_}))),a!==o&&n.push("")})),console.info.apply(console,function(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}([t.join("")],n,!1))},t.debugRawConfig=function(e,t){console.groupCollapsed("".concat(Ge," raw config for ").concat(t," panel")),console.table(e),console.groupEnd()},t.debugFinalConfig=function(e,t){var n=Object.entries(e).filter((function(e){return!(e[0]in ct)}));console.groupCollapsed("".concat(Ge," final config for ").concat(t," panel")),console.table(Object.fromEntries(n)),console.groupEnd()},t.debug=function(e,t,n){console.groupCollapsed("".concat(Ge," debug")),console.info("Template rendering triggered for option %c".concat(e,"%c with the next template:"),rt,ot),console.info("%c".concat(t),st),console.info("The evaluation of this template is: %c".concat(n),"boolean"==typeof n?at:it),"boolean"!=typeof n&&console.warn("%c⚠ As this template didn't return a boolean, this option has been set to false",_t),console.groupEnd()},t.debugTemplate=function(e,t){console.group("".concat(Ge," template debug")),console.info("The template debug has been triggered with the next template:"),console.info("%c".concat(e),st),console.info("The evaluation of this template is: %c".concat(t),"boolean"==typeof t?at:it),"boolean"!=typeof t&&console.warn("%c⚠ This template doesn't return a boolean. It cannot be used as a kiosk-mode option.",_t),console.groupEnd()},t}(),ut=function(){function r(){var e=this;Je(Ne.CLEAR_CACHE)&&Object.values(Se).forEach((function(e){window.localStorage.removeItem(ze(e))})),this.panelOptions=new Map,this.styleManager=new le({prefix:"kiosk_mode",throwWarnings:!1});var r=new oe;r.addEventListener(w.ON_LOVELACE_PANEL_LOAD,(function(r){return t(e,void 0,void 0,(function(){var e,t,i,a,s,_,c,l,u,E,O,I,A,d,h,T,D,f=this;return n(this,(function(n){switch(n.label){case 0:return this.HAElements=r.detail,e=this.HAElements,t=e.HOME_ASSISTANT,i=e.HOME_ASSISTANT_MAIN,a=e.HUI_ROOT,s=e.HA_DRAWER,_=e.HEADER,c=e.HA_SIDEBAR,l=this,[4,t.element];case 1:return l.ha=n.sent(),u=this,[4,i.selector.$.element];case 2:return u.main=n.sent(),E=this,[4,a.selector.$.element];case 3:return E.huiRoot=n.sent(),O=this,[4,s.element];case 4:return O.drawerLayout=n.sent(),I=this,[4,_.selector.query(Fe.TOOLBAR).element];case 5:return I.appToolbar=n.sent(),A=this,[4,c.selector.$.element];case 6:return A.sideBarRoot=n.sent(),d=this,[4,o((function(){var e,t;return null===(t=null===(e=f.ha)||void 0===e?void 0:e.hass)||void 0===t?void 0:t.user}),(function(e){return!!e}),{retries:500,delay:50,rejectMessage:"".concat(Ge,": Cannot select ").concat(Fe.HOME_ASSISTANT," > hass > user after {{ retries }} attempts. Giving up!")})];case 7:return d.user=n.sent(),h=this,[4,new me(this.ha).getRenderer()];case 8:return h._renderer=n.sent(),this.version=function(e){var t=e?e.match(/^(\d+)\.(\d+)\.(\w+)(?:\.(\w+))?$/):null;return t?[+t[1],+t[2],t[3]]:null}(null===(D=null===(T=this.ha.hass)||void 0===T?void 0:T.config)||void 0===D?void 0:D.version),this.run(),[2]}}))}))})),r.addEventListener(w.ON_MORE_INFO_DIALOG_OPEN,(function(t){e.HAMoreInfoDialogElements=t.detail,e.insertMoreInfoDialogStyles()})),r.addEventListener(w.ON_HISTORY_AND_LOGBOOK_DIALOG_OPEN,(function(t){e.HAMoreInfoDialogElements=t.detail,e.insertMoreInfoDialogStyles()})),r.listen(),this.resizeWindowBinded=this.resizeWindow.bind(this)}return r.prototype._getPanelUrl=function(){return this.ha.hass.panelUrl},r.prototype._hasStoredOptions=function(){var e=this._getPanelUrl();return this.panelOptions.has(e)},r.prototype._getOptions=function(){var e=this._getPanelUrl();return this.panelOptions.get(e)},r.prototype._storeOptions=function(e){var t=this._getPanelUrl();this.panelOptions.set(t,e)},r.prototype._isDebug=function(e){return"boolean"==typeof e&&e},r.prototype._isKioskModeDisabled=function(e){return!(e&&(!Je(Ne.DISABLE_KIOSK_MODE)||e[Re.IGNORE_DISABLE_KM]))},r.prototype.runThrottle=function(){var e=this;window.clearTimeout(this._runTimeout),this._runTimeout=window.setTimeout((function(){e.run(),e.runDialogs()}),50)},r.prototype.run=function(){return t(this,void 0,void 0,(function(){var e,t=this;return n(this,(function(n){return(e=this.main.querySelector(Fe.HA_PANEL_LOVELACE))?this._hasStoredOptions()?(this.insertStyles(),[2]):[2,o((function(){var t;return null===(t=null==e?void 0:e.lovelace)||void 0===t?void 0:t.config}),(function(e){return!!e}),{retries:500,delay:50,rejectMessage:"".concat(Ge,": Cannot select Lovelace config after {{ retries }} attempts. Giving up!")}).then((function(e){return t.processConfig(e.kiosk_mode||{})}))]:[2]}))}))},r.prototype.runDialogs=function(){var e,t,n=null===(t=null===(e=this.ha)||void 0===e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector(Fe.HA_MORE_INFO_DIALOG),o=null==n?void 0:n.shadowRoot.querySelector(Fe.HA_DIALOG);o&&o.open&&this.insertMoreInfoDialogStyles()},r.prototype.processConfig=function(r){return t(this,void 0,void 0,(function(){var i,a,s,_,c,l,u=this;return n(this,(function(E){return this._isDebug(r.debug)&&lt.debugRawConfig(r,this._getPanelUrl()),i={},a={},Object.values(Se).forEach((function(e){i[e]=!1,a[e]=!1})),Object.values(Re).forEach((function(e){i[e]=!1,a[e]=!1})),Object.values(He).forEach((function(e){i[e]=!1,a[e]=!1})),function(e,r){return t(void 0,void 0,void 0,(function(){var t,i,a,s;return n(this,(function(n){switch(n.label){case 0:return t=Object.entries(xe),i=r[0]<2025||2025===r[0]&&r[1]<9,a=i?t.filter((function(e){var t=e[1];return xe[ye.ADD]!==t})):t,[4,o((function(){return a.map((function(t){var n=t[0],o=t[1];return[e.hass.localize(o),n]}))}),(function(e){return!e.find((function(e){return!e[0]}))}),{retries:500,delay:50})];case 1:return s=n.sent(),[2,Object.fromEntries(s)]}}))}))}(this.ha,this.version).then((function(e){u.menuTranslations=e,u.updateMenuItemsLabels()})).catch((function(){console.warn("".concat(Ge,": ").concat("[ Non critial warning ]"," Cannot get resources translations"))})),Xe.apply(void 0,Object.values(Se))||Je.apply(void 0,Object.values(Se))?Object.values(Se).forEach((function(e){i[e]=Xe(e)||Je(e)})):i=e(e({},i),r),(s=this.user.is_admin?r.admin_settings:r.non_admin_settings)&&(i=e(e({},i),s)),r.user_settings&&r.user_settings.forEach((function(t){t.users.some((function(e){return e.toLowerCase()===u.user.name.toLowerCase()}))&&(i=e(e({},i),t))})),(_=i[Re.IGNORE_MOBILE_SETTINGS]?null:r.mobile_settings)&&(c=_.custom_width?_.custom_width:812,window.innerWidth<=c&&(i=e(e({},i),_))),this._isDebug(i.debug)&&(i.admin_settings,i.non_admin_settings,i.user_settings,i.mobile_settings,l=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}(i,["admin_settings","non_admin_settings","user_settings","mobile_settings"]),lt.debugFinalConfig(l,this._getPanelUrl())),this.setOptions(a,i),this._storeOptions(a),this.insertStyles(),[2]}))}))},r.prototype.insertStyles=function(){var e,t,n,o=this,r=this._getOptions();if(!this._isKioskModeDisabled(r)){if(r[Se.KIOSK]||r[Se.HIDE_HEADER]?(this.styleManager.addStyle(tt.HEADER,this.huiRoot),Je(Ne.CACHE)&&Qe(ke,Se.HIDE_HEADER)):this.styleManager.removeStyle(this.huiRoot),null===(t=null===(e=this.main)||void 0===e?void 0:e.host)||void 0===t||t.removeEventListener(Ye,this.blockEventHandler,!0),r[Se.KIOSK]||r[Se.HIDE_SIDEBAR]){var i=function(){var e,t;null===(t=null===(e=o.main)||void 0===e?void 0:e.host)||void 0===t||t.addEventListener(Ye,o.blockEventHandler,!0),o.styleManager.addStyle(tt.SIDEBAR,o.drawerLayout),o.styleManager.addStyle(tt.ASIDE,o.drawerLayout.shadowRoot),Je(Ne.CACHE)&&Qe(ke,Se.HIDE_SIDEBAR),o.drawerLayout.removeEventListener(qe,i)};"modal"===this.drawerLayout.type&&(null===(n=this.drawerLayout.appContent)||void 0===n?void 0:n.inert)?this.drawerLayout.addEventListener(qe,i):i()}else this.styleManager.removeStyle(this.drawerLayout),this.styleManager.removeStyle(this.drawerLayout.shadowRoot);if(r[Se.HIDE_ACCOUNT]||r[Se.HIDE_NOTIFICATIONS]||r[Se.HIDE_MENU_BUTTON]){var a=[r[Se.HIDE_ACCOUNT]&&tt.ACCOUNT,r[Se.HIDE_NOTIFICATIONS]&&tt.NOTIFICATIONS,r[Se.HIDE_ACCOUNT]&&r[Se.HIDE_NOTIFICATIONS]&&tt.DIVIDER,(r[Se.HIDE_MENU_BUTTON]||r[Se.HIDE_NOTIFICATIONS]||r[Se.HIDE_ACCOUNT])&&tt.SIDEBAR_ITEMS_CONTAINER(r[Se.HIDE_MENU_BUTTON],r[Se.HIDE_NOTIFICATIONS],r[Se.HIDE_ACCOUNT]),r[Se.HIDE_MENU_BUTTON]&&tt.MENU_BUTTON];this.styleManager.addStyle(a,this.sideBarRoot),Je(Ne.CACHE)&&(r[Se.HIDE_ACCOUNT]&&Qe(ke,Se.HIDE_ACCOUNT),r[Se.HIDE_NOTIFICATIONS]&&Qe(ke,Se.HIDE_NOTIFICATIONS))}else this.styleManager.removeStyle(this.sideBarRoot);if(r[Se.HIDE_ADD_TO_HOME_ASSISTANT]||r[Se.HIDE_OVERFLOW]||r[Se.HIDE_SEARCH]||r[Se.HIDE_ASSISTANT]||r[Se.HIDE_REFRESH]||r[Se.HIDE_UNUSED_ENTITIES]||r[Se.HIDE_RELOAD_RESOURCES]||r[Se.HIDE_EDIT_DASHBOARD]||r[Se.BLOCK_OVERFLOW]||r[Se.HIDE_SIDEBAR]||r[Se.HIDE_MENU_BUTTON]){a=[r[Se.HIDE_ADD_TO_HOME_ASSISTANT]&&tt.ADD_TO_HOME_ASSISTANT,r[Se.HIDE_OVERFLOW]&&tt.OVERFLOW_MENU,r[Se.HIDE_SEARCH]&&tt.SEARCH,r[Se.HIDE_ASSISTANT]&&tt.ASSISTANT,r[Se.HIDE_REFRESH]&&tt.REFRESH,r[Se.HIDE_UNUSED_ENTITIES]&&tt.UNUSED_ENTITIES,r[Se.HIDE_RELOAD_RESOURCES]&&tt.RELOAD_RESOURCES,r[Se.HIDE_EDIT_DASHBOARD]&&tt.EDIT_DASHBOARD,r[Se.BLOCK_OVERFLOW]&&tt.BLOCK_OVERFLOW,(r[Se.HIDE_MENU_BUTTON]||r[Se.HIDE_SIDEBAR])&&tt.MENU_BUTTON_BURGER];this.styleManager.addStyle(a,this.appToolbar),Je(Ne.CACHE)&&(r[Se.HIDE_ADD_TO_HOME_ASSISTANT]&&Qe(ke,Se.HIDE_ADD_TO_HOME_ASSISTANT),r[Se.HIDE_OVERFLOW]&&Qe(ke,Se.HIDE_OVERFLOW),r[Se.HIDE_SEARCH]&&Qe(ke,Se.HIDE_SEARCH),r[Se.HIDE_ASSISTANT]&&Qe(ke,Se.HIDE_ASSISTANT),r[Se.HIDE_REFRESH]&&Qe(ke,Se.HIDE_REFRESH),r[Se.HIDE_UNUSED_ENTITIES]&&Qe(ke,Se.HIDE_UNUSED_ENTITIES),r[Se.HIDE_RELOAD_RESOURCES]&&Qe(ke,Se.HIDE_RELOAD_RESOURCES),r[Se.HIDE_EDIT_DASHBOARD]&&Qe(ke,Se.HIDE_EDIT_DASHBOARD),r[Se.BLOCK_OVERFLOW]&&Qe(ke,Se.BLOCK_OVERFLOW),r[Se.HIDE_MENU_BUTTON]&&Qe(ke,Se.HIDE_MENU_BUTTON))}else this.styleManager.removeStyle(this.appToolbar);r[Se.BLOCK_MOUSE]?(this.styleManager.addStyle(tt.MOUSE,document.body),Je(Ne.CACHE)&&Qe(ke,Se.BLOCK_MOUSE)):this.styleManager.removeStyle(document.body),window.removeEventListener("contextmenu",this.blockEventHandler,!0),r[Se.BLOCK_CONTEXT_MENU]&&(window.addEventListener("contextmenu",this.blockEventHandler,!0),Je(Ne.CACHE)&&Qe(ke,Se.BLOCK_CONTEXT_MENU)),window.removeEventListener($e,this.resizeWindowBinded),window.addEventListener($e,this.resizeWindowBinded),window.dispatchEvent(new Event($e))}},r.prototype.insertMoreInfoDialogStyles=function(){return t(this,void 0,void 0,(function(){var e,t,o,r,i,a,s,_,c,l=this;return n(this,(function(n){switch(n.label){case 0:return e=this._getOptions(),this._isKioskModeDisabled(e)?[2]:(this.HAMoreInfoDialogElements.HA_DIALOG.selector.query("".concat(Fe.HA_DIALOG_HEADER," > ").concat(Fe.MENU_ITEM)).all.then((function(e){!function(e,t){e.forEach((function(e){if(e&&e.dataset&&!e.dataset.selector){var n=e.shadowRoot.querySelector(Fe.MENU_ITEM_ICON);e.dataset.selector=t[n.title.trim()]}}))}(e,l.menuTranslations)})),[4,this.HAMoreInfoDialogElements.HA_DIALOG.element]);case 1:return t=n.sent(),o=this.HAMoreInfoDialogElements.HA_DIALOG_CONTENT,[4,(r=o.selector.query("".concat(Fe.HA_DIALOG_MORE_INFO,", ").concat(Fe.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK)).$).element];case 2:return i=n.sent(),e[Se.HIDE_DIALOG_HEADER_BREADCRUMB_NAVIGATION]||e[Se.HIDE_DIALOG_HEADER_ACTION_ITEMS]||e[Se.HIDE_DIALOG_HEADER_HISTORY]||e[Se.HIDE_DIALOG_HEADER_SETTINGS]||e[Se.HIDE_DIALOG_HEADER_OVERFLOW]?(c=[e[Se.HIDE_DIALOG_HEADER_BREADCRUMB_NAVIGATION]&&tt.DIALOG_HEADER_BREADCRUMB_NAVIGATION,(e[Se.HIDE_DIALOG_HEADER_ACTION_ITEMS]||e[Se.HIDE_DIALOG_HEADER_HISTORY])&&tt.DIALOG_HEADER_HISTORY,(e[Se.HIDE_DIALOG_HEADER_ACTION_ITEMS]||e[Se.HIDE_DIALOG_HEADER_SETTINGS])&&tt.DIALOG_HEADER_SETTINGS,(e[Se.HIDE_DIALOG_HEADER_ACTION_ITEMS]||e[Se.HIDE_DIALOG_HEADER_OVERFLOW])&&tt.DIALOG_HEADER_OVERFLOW],this.styleManager.addStyle(c,t),Je(Ne.CACHE)&&(e[Se.HIDE_DIALOG_HEADER_BREADCRUMB_NAVIGATION]&&Qe(ke,Se.HIDE_DIALOG_HEADER_BREADCRUMB_NAVIGATION),e[Se.HIDE_DIALOG_HEADER_ACTION_ITEMS]&&Qe(ke,Se.HIDE_DIALOG_HEADER_ACTION_ITEMS),e[Se.HIDE_DIALOG_HEADER_HISTORY]&&Qe(ke,Se.HIDE_DIALOG_HEADER_HISTORY),e[Se.HIDE_DIALOG_HEADER_SETTINGS]&&Qe(ke,Se.HIDE_DIALOG_HEADER_SETTINGS),e[Se.HIDE_DIALOG_HEADER_OVERFLOW]&&Qe(ke,Se.HIDE_DIALOG_HEADER_OVERFLOW))):this.styleManager.removeStyle(t),a=r.query(Fe.HA_DIALOG_MORE_INFO_CONTENT).$.query(Fe.HA_DIALOG_CLIMATE).$,s=a.query(Fe.HA_STATE_CONTROL_CLIMATE_TEMPERATURE).$,_=s.query(Fe.HA_DIALOG_CLIMATE_CIRCULAR_SLIDER).$,a.element.then((function(t){e[Se.HIDE_DIALOG_CLIMATE_ACTIONS]||e[Se.HIDE_DIALOG_CLIMATE_SETTINGS_ACTIONS]?(l.styleManager.addStyle(tt.DIALOG_CLIMATE_CONTROL_SELECT,t),Je(Ne.CACHE)&&(e[Se.HIDE_DIALOG_CLIMATE_ACTIONS]&&Qe(ke,Se.HIDE_DIALOG_CLIMATE_ACTIONS),e[Se.HIDE_DIALOG_CLIMATE_SETTINGS_ACTIONS]&&Qe(ke,Se.HIDE_DIALOG_CLIMATE_SETTINGS_ACTIONS))):l.styleManager.removeStyle(t)})),s.element.then((function(t){e[Se.HIDE_DIALOG_CLIMATE_ACTIONS]||e[Se.HIDE_DIALOG_CLIMATE_TEMPERATURE_ACTIONS]?(l.styleManager.addStyle(tt.DIALOG_CLIMATE_TEMPERATURE_BUTTONS,t),Je(Ne.CACHE)&&e[Se.HIDE_DIALOG_CLIMATE_TEMPERATURE_ACTIONS]&&Qe(ke,Se.HIDE_DIALOG_CLIMATE_TEMPERATURE_ACTIONS)):l.styleManager.removeStyle(t)})),_.element.then((function(t){e[Se.HIDE_DIALOG_CLIMATE_ACTIONS]||e[Se.HIDE_DIALOG_CLIMATE_TEMPERATURE_ACTIONS]?l.styleManager.addStyle(tt.DIALOG_CLIMATE_CIRCULAR_SLIDER_INTERACTION,t):l.styleManager.removeStyle(t)})),r.query(Fe.HA_DIALOG_MORE_INFO_CONTENT).$.query([Fe.HA_DIALOG_DEFAULT,Fe.HA_DIALOG_LIGHT,Fe.HA_DIALOG_LOCK,Fe.HA_DIALOG_MEDIA_PLAYER,Fe.HA_DIALOG_PERSON,Fe.HA_DIALOG_SIREN,Fe.HA_DIALOG_TIMER,Fe.HA_DIALOG_UPDATE,Fe.HA_DIALOG_VACUUM,Fe.HA_DIALOG_CAMERA].join(",")).$.element.then((function(t){if(e[Se.HIDE_DIALOG_ATTRIBUTES]||e[Se.HIDE_DIALOG_TIMER_ACTIONS]||e[Se.HIDE_DIALOG_MEDIA_ACTIONS]||e[Se.HIDE_DIALOG_UPDATE_ACTIONS]||e[Se.HIDE_DIALOG_CAMERA_ACTIONS]||e[Se.HIDE_DIALOG_LIGHT_ACTIONS]||e[Se.HIDE_DIALOG_LIGHT_CONTROL_ACTIONS]||e[Se.HIDE_DIALOG_LIGHT_COLOR_ACTIONS]||e[Se.HIDE_DIALOG_LIGHT_SETTINGS_ACTIONS]){var n=[e[Se.HIDE_DIALOG_ATTRIBUTES]&&tt.DIALOG_ATTRIBUTES,e[Se.HIDE_DIALOG_TIMER_ACTIONS]&&t.host.localName===Fe.HA_DIALOG_TIMER&&tt.DIALOG_TIMER_ACTIONS,e[Se.HIDE_DIALOG_MEDIA_ACTIONS]&&t.host.localName===Fe.HA_DIALOG_MEDIA_PLAYER&&tt.DIALOG_MEDIA_ACTIONS,e[Se.HIDE_DIALOG_UPDATE_ACTIONS]&&t.host.localName===Fe.HA_DIALOG_UPDATE&&tt.DIALOG_UPDATE_ACTIONS,t.host.localName===Fe.HA_DIALOG_CAMERA&&tt.DIALOG_CAMERA_ACTIONS,(e[Se.HIDE_DIALOG_LIGHT_ACTIONS]||e[Se.HIDE_DIALOG_LIGHT_CONTROL_ACTIONS])&&tt.DIALOG_LIGHT_CONTROL_ACTIONS,(e[Se.HIDE_DIALOG_LIGHT_ACTIONS]||e[Se.HIDE_DIALOG_LIGHT_COLOR_ACTIONS])&&tt.DIALOG_LIGHT_COLOR_ACTIONS,(e[Se.HIDE_DIALOG_LIGHT_ACTIONS]||e[Se.HIDE_DIALOG_LIGHT_SETTINGS_ACTIONS])&&tt.DIALOG_LIGHT_SETTINGS_ACTIONS];l.styleManager.addStyle(n,t),Je(Ne.CACHE)&&(e[Se.HIDE_DIALOG_ATTRIBUTES]&&Qe(ke,Se.HIDE_DIALOG_ATTRIBUTES),e[Se.HIDE_DIALOG_TIMER_ACTIONS]&&Qe(ke,Se.HIDE_DIALOG_TIMER_ACTIONS),e[Se.HIDE_DIALOG_MEDIA_ACTIONS]&&Qe(ke,Se.HIDE_DIALOG_MEDIA_ACTIONS),e[Se.HIDE_DIALOG_UPDATE_ACTIONS]&&Qe(ke,Se.HIDE_DIALOG_UPDATE_ACTIONS),e[Se.HIDE_DIALOG_CAMERA_ACTIONS]&&Qe(ke,Se.HIDE_DIALOG_CAMERA_ACTIONS),e[Se.HIDE_DIALOG_LIGHT_ACTIONS]&&Qe(ke,Se.HIDE_DIALOG_LIGHT_ACTIONS),e[Se.HIDE_DIALOG_LIGHT_CONTROL_ACTIONS]&&Qe(ke,Se.HIDE_DIALOG_LIGHT_CONTROL_ACTIONS),e[Se.HIDE_DIALOG_LIGHT_COLOR_ACTIONS]&&Qe(ke,Se.HIDE_DIALOG_LIGHT_COLOR_ACTIONS),e[Se.HIDE_DIALOG_LIGHT_SETTINGS_ACTIONS]&&Qe(ke,Se.HIDE_DIALOG_LIGHT_SETTINGS_ACTIONS))}else l.styleManager.removeStyle(t)})),e[Se.HIDE_DIALOG_HISTORY]||e[Se.HIDE_DIALOG_LOGBOOK]?(c=[e[Se.HIDE_DIALOG_HISTORY]&&tt.DIALOG_HISTORY,e[Se.HIDE_DIALOG_LOGBOOK]&&tt.DIALOG_LOGBOOK],this.styleManager.addStyle(c,i),Je(Ne.CACHE)&&(e[Se.HIDE_DIALOG_HISTORY]&&Qe(ke,Se.HIDE_DIALOG_HISTORY),e[Se.HIDE_DIALOG_LOGBOOK]&&Qe(ke,Se.HIDE_DIALOG_LOGBOOK))):this.styleManager.removeStyle(i),r.query(Fe.HA_DIALOG_HISTORY).$.element.then((function(t){e[Se.HIDE_DIALOG_HISTORY_SHOW_MORE]?(l.styleManager.addStyle(tt.DIALOG_SHOW_MORE,t),Je(Ne.CACHE)&&Qe(ke,Se.HIDE_DIALOG_HISTORY_SHOW_MORE)):l.styleManager.removeStyle(t)})),r.query(Fe.HA_DIALOG_LOGBOOK).$.element.then((function(t){e[Se.HIDE_DIALOG_LOGBOOK_SHOW_MORE]?(l.styleManager.addStyle(tt.DIALOG_SHOW_MORE,t),Je(Ne.CACHE)&&Qe(ke,Se.HIDE_DIALOG_LOGBOOK_SHOW_MORE)):l.styleManager.removeStyle(t)})),[2]}}))}))},r.prototype.resizeWindow=function(){var e=this;window.clearTimeout(this.resizeDelay),this.resizeDelay=window.setTimeout((function(){e.updateMenuItemsLabels()}),250)},r.prototype.updateMenuItemsLabels=function(){var e=this;this.menuTranslations&&(this.HAElements.HEADER.selector.query("".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.MENU_ITEM)).all.then((function(t){!function(e,t){e.forEach((function(e){if(e&&e.dataset&&!e.dataset.selector){var n=e.getAttribute("aria-labelledby");if(!n)return;var o=e.parentElement.querySelector("#".concat(n.trim()));if(!o)return;var r=et(o.textContent);e.dataset.selector=t[r]}}))}(t,e.menuTranslations)})),this.HAElements.HEADER.selector.query("".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.BUTTON_MENU)).all.then((function(t){!function(e,t){e.forEach((function(e){var n=e.querySelector(Fe.MENU_ITEM);if(n&&n.dataset&&!n.dataset.selector){var o=n.getAttribute("aria-labelledby");if(o){var r=e.parentElement.querySelector("#".concat(o.trim()));if(!r)return;var i=et(r.textContent);n.dataset.selector=t[i]}else{var a=n.shadowRoot.querySelector(Fe.MENU_ITEM_ICON);if(a.title)n.dataset.selector=t[a.title.trim()];else{var s=a.shadowRoot.querySelector("button");n.dataset.selector=t[s.getAttribute("aria-label").trim()]}}}}))}(t,e.menuTranslations)})),this.HAElements.HEADER.selector.query("".concat(Fe.TOOLBAR," ").concat(Fe.OVERLAY_MENU_ITEM)).all.then((function(t){!function(e,t){e.forEach((function(e){if(e&&e.dataset&&!e.dataset.selector){var n=et(e.textContent);e.dataset.selector=t[n]}}))}(t,e.menuTranslations)})))},r.prototype.blockEventHandler=function(e){e.preventDefault(),e.stopImmediatePropagation()},r.prototype.setOptions=function(t,n){var o=this;Object.values(e(e({},He),Se)).forEach((function(e){e in n&&o.setOptionsOrSubscribeToSetOptions(t,n,e)})),Re.IGNORE_DISABLE_KM in n&&this.setOptionsOrSubscribeToSetOptions(t,n,Re.IGNORE_DISABLE_KM)},r.prototype.setOptionsOrSubscribeToSetOptions=function(e,t,n){var o=this,r=this._getPanelUrl(),i=t[n],a=function(t,i){o._getPanelUrl()===r&&(n===He.DEBUG_TEMPLATE?lt.debugTemplate(t,i):(o._isDebug(e.debug)&&lt.debug(n,t,i),o.runThrottle()))};if("boolean"==typeof i)e[n]=i;else if(We.test(i)){this._renderer.trackTemplate(i.replace(We,"$1"),(function(t){e[n]="boolean"==typeof t&&t,a(i,t)}))}else{if(!Ke.test(i))throw SyntaxError("".concat(Ge,': the value "').concat(i,'" of the option "').concat(n,'" is not a well formed JavaScript or Jinja template'));window.hassConnection.then((function(t){t.conn.subscribeMessage((function(t){var o=t.result;e[n]="boolean"==typeof o&&o,a(i,o)}),{type:"render_template",template:i,variables:{user_name:o.ha.hass.user.name,user_is_admin:o.ha.hass.user.is_admin,user_is_owner:o.ha.hass.user.is_owner,user_agent:window.navigator.userAgent}})}))}},r}();lt.logInfo(),Promise.resolve(customElements.whenDefined(Fe.HUI_VIEW)).then((function(){window.KioskMode=new ut}))}();