UNPKG

iobroker.lovelace

Version:

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

6 lines 49.9 kB
export const __webpack_ids__=["81394"];export const __webpack_modules__={95262:function(e,t,i){function a(e){return null==e||Array.isArray(e)?e:[e]}i.d(t,{r:()=>a})},19631:function(e,t,i){i.d(t,{Bt:()=>s,T8:()=>d});var a=i(88977),n=i(20382);const o=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],s=e=>e.first_weekday===n.FS.language?"weekInfo"in Intl.Locale.prototype?new Intl.Locale(e.language).weekInfo.firstDay%7:(0,a.L)(e.language)%7:o.includes(e.first_weekday)?o.indexOf(e.first_weekday):1,d=e=>{const t=s(e);return o[t]}},93826:function(e,t,i){i.d(t,{P:()=>a});const a=(e,t,i=!0,a=!0)=>{let n,o=0;const s=(...s)=>{const d=()=>{o=!1===i?0:Date.now(),n=void 0,e(...s)},l=Date.now();o||!1!==i||(o=l);const r=t-(l-o);r<=0||r>t?(n&&(clearTimeout(n),n=void 0),o=l,e(...s)):n||!1===a||(n=window.setTimeout(d,r))};return s.cancel=()=>{clearTimeout(n),n=void 0,o=0},s}},34273:function(e,t,i){var a=i(44249),n=i(72621),o=(i(9359),i(31526),i(22997),i(57243)),s=i(15093),d=i(5111),l=i(76525);(0,a.Z)([(0,s.Mo)("ha-button-menu")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",key:l.gA,value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"corner",value:()=>"BOTTOM_START"},{kind:"field",decorators:[(0,s.Cb)({attribute:"menu-corner"})],key:"menuCorner",value:()=>"START"},{kind:"field",decorators:[(0,s.Cb)({type:Number})],key:"x",value:()=>null},{kind:"field",decorators:[(0,s.Cb)({type:Number})],key:"y",value:()=>null},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"multi",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"activatable",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"fixed",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,attribute:"no-anchor"})],key:"noAnchor",value:()=>!1},{kind:"field",decorators:[(0,s.IO)("mwc-menu",!0)],key:"_menu",value:void 0},{kind:"get",key:"items",value:function(){return this._menu?.items}},{kind:"get",key:"selected",value:function(){return this._menu?.selected}},{kind:"method",key:"focus",value:function(){this._menu?.open?this._menu.focusItemAtIndex(0):this._triggerButton?.focus()}},{kind:"method",key:"render",value:function(){return o.dy` <div @click="${this._handleClick}"> <slot name="trigger" @slotchange="${this._setTriggerAria}"></slot> </div> <mwc-menu .corner="${this.corner}" .menuCorner="${this.menuCorner}" .fixed="${this.fixed}" .multi="${this.multi}" .activatable="${this.activatable}" .y="${this.y}" .x="${this.x}"> <slot></slot> </mwc-menu> `}},{kind:"method",key:"firstUpdated",value:function(e){(0,n.Z)(i,"firstUpdated",this,3)([e]),"rtl"===d.E.document.dir&&this.updateComplete.then((()=>{this.querySelectorAll("mwc-list-item").forEach((e=>{const t=document.createElement("style");t.innerHTML="span.material-icons:first-of-type { margin-left: var(--mdc-list-item-graphic-margin, 32px) !important; margin-right: 0px !important;}",e.shadowRoot.appendChild(t)}))}))}},{kind:"method",key:"_handleClick",value:function(){this.disabled||(this._menu.anchor=this.noAnchor?null:this,this._menu.show())}},{kind:"get",key:"_triggerButton",value:function(){return this.querySelector('ha-icon-button[slot="trigger"], mwc-button[slot="trigger"]')}},{kind:"method",key:"_setTriggerAria",value:function(){this._triggerButton&&(this._triggerButton.ariaHasPopup="menu")}},{kind:"field",static:!0,key:"styles",value:()=>o.iv`:host{display:inline-block;position:relative}::slotted([disabled]){color:var(--disabled-text-color)}`}]}}),o.oi)},23334:function(e,t,i){i.r(t),i.d(t,{HaIconButton:()=>d});var a=i(44249),n=(i(74269),i(57243)),o=i(15093),s=i(20552);i(37583);let d=(0,a.Z)([(0,o.Mo)("ha-icon-button")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({type:String})],key:"path",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:String})],key:"label",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:String,attribute:"aria-haspopup"})],key:"ariaHasPopup",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:"hide-title",type:Boolean})],key:"hideTitle",value:()=>!1},{kind:"field",decorators:[(0,o.IO)("mwc-icon-button",!0)],key:"_button",value:void 0},{kind:"method",key:"focus",value:function(){this._button?.focus()}},{kind:"field",static:!0,key:"shadowRootOptions",value:()=>({mode:"open",delegatesFocus:!0})},{kind:"method",key:"render",value:function(){return n.dy` <mwc-icon-button aria-label="${(0,s.o)(this.label)}" title="${(0,s.o)(this.hideTitle?void 0:this.label)}" aria-haspopup="${(0,s.o)(this.ariaHasPopup)}" .disabled="${this.disabled}"> ${this.path?n.dy`<ha-svg-icon .path="${this.path}"></ha-svg-icon>`:n.dy`<slot></slot>`} </mwc-icon-button> `}},{kind:"field",static:!0,key:"styles",value:()=>n.iv`:host{display:inline-block;outline:0}:host([disabled]){pointer-events:none}mwc-icon-button{--mdc-theme-on-primary:currentColor;--mdc-theme-text-disabled-on-light:var(--disabled-text-color)}`}]}}),n.oi)},7285:function(e,t,i){i.d(t,{M:()=>r});var a=i(44249),n=i(72621),o=i(65703),s=i(46289),d=i(57243),l=i(15093);let r=(0,a.Z)([(0,l.Mo)("ha-list-item")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"method",key:"renderRipple",value:function(){return this.noninteractive?"":(0,n.Z)(i,"renderRipple",this,3)([])}},{kind:"get",static:!0,key:"styles",value:function(){return[s.W,d.iv`:host{padding-left:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-inline-start:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-right:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px));padding-inline-end:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px))}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:48px}span.material-icons:first-of-type{margin-inline-start:0px!important;margin-inline-end:var(--mdc-list-item-graphic-margin,16px)!important;direction:var(--direction)!important}span.material-icons:last-of-type{margin-inline-start:auto!important;margin-inline-end:0px!important;direction:var(--direction)!important}.mdc-deprecated-list-item__meta{display:var(--mdc-list-item-meta-display);align-items:center;flex-shrink:0}:host([graphic=icon]:not([twoline])) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,20px)!important}:host([multiline-secondary]){height:auto}:host([multiline-secondary]) .mdc-deprecated-list-item__text{padding:8px 0}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text{text-overflow:initial;white-space:normal;overflow:auto;display:inline-block;margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text{margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text::before{display:none}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text::before{display:none}:host([disabled]){color:var(--disabled-text-color)}:host([noninteractive]){pointer-events:unset}`,"rtl"===document.dir?d.iv`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`:d.iv``]}}]}}),o.K)},43344:function(e,t,i){var a=i(44249),n=i(72621),o=i(57243),s=i(15093),d=i(36522),l=i(83716);i(23334);(0,a.Z)([(0,s.Mo)("ha-menu-button")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"hassio",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"narrow",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_hasNotifications",value:()=>!1},{kind:"field",decorators:[(0,s.SB)()],key:"_show",value:()=>!1},{kind:"field",key:"_alwaysVisible",value:()=>!1},{kind:"field",key:"_attachNotifOnConnect",value:()=>!1},{kind:"field",key:"_unsubNotifications",value:void 0},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(i,"connectedCallback",this,3)([]),this._attachNotifOnConnect&&(this._attachNotifOnConnect=!1,this._subscribeNotifications())}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(i,"disconnectedCallback",this,3)([]),this._unsubNotifications&&(this._attachNotifOnConnect=!0,this._unsubNotifications(),this._unsubNotifications=void 0)}},{kind:"method",key:"render",value:function(){if(!this._show)return o.Ld;const e=this._hasNotifications&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);return o.dy` <ha-icon-button .label="${this.hass.localize("ui.sidebar.sidebar_toggle")}" .path="${"M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z"}" @click="${this._toggleMenu}"></ha-icon-button> ${e?o.dy`<div class="dot"></div>`:""} `}},{kind:"method",key:"firstUpdated",value:function(e){(0,n.Z)(i,"firstUpdated",this,3)([e]),this.hassio&&(this._alwaysVisible=(Number(window.parent.frontendVersion)||0)<20190710)}},{kind:"method",key:"willUpdate",value:function(e){if((0,n.Z)(i,"willUpdate",this,3)([e]),!e.has("narrow")&&!e.has("hass"))return;const t=e.has("hass")?e.get("hass"):this.hass,a=(e.has("narrow")?e.get("narrow"):this.narrow)||"always_hidden"===t?.dockedSidebar,o=this.narrow||"always_hidden"===this.hass.dockedSidebar;this.hasUpdated&&a===o||(this._show=o||this._alwaysVisible,o?this._subscribeNotifications():this._unsubNotifications&&(this._unsubNotifications(),this._unsubNotifications=void 0))}},{kind:"method",key:"_subscribeNotifications",value:function(){if(this._unsubNotifications)throw new Error("Already subscribed");this._unsubNotifications=(0,l.r)(this.hass.connection,(e=>{this._hasNotifications=e.length>0}))}},{kind:"method",key:"_toggleMenu",value:function(){(0,d.B)(this,"hass-toggle-menu")}},{kind:"field",static:!0,key:"styles",value:()=>o.iv`:host{position:relative}.dot{pointer-events:none;position:absolute;background-color:var(--accent-color);width:12px;height:12px;top:9px;right:7px;inset-inline-end:7px;inset-inline-start:initial;border-radius:50%;border:2px solid var(--app-header-background-color)}`}]}}),o.oi)},37583:function(e,t,i){i.r(t),i.d(t,{HaSvgIcon:()=>s});var a=i(44249),n=i(57243),o=i(15093);let s=(0,a.Z)([(0,o.Mo)("ha-svg-icon")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)()],key:"path",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"secondaryPath",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"viewBox",value:void 0},{kind:"method",key:"render",value:function(){return n.YP` <svg viewBox="${this.viewBox||"0 0 24 24"}" preserveAspectRatio="xMidYMid meet" focusable="false" role="img" aria-hidden="true"> <g> ${this.path?n.YP`<path class="primary-path" d="${this.path}"></path>`:n.Ld} ${this.secondaryPath?n.YP`<path class="secondary-path" d="${this.secondaryPath}"></path>`:n.Ld} </g> </svg>`}},{kind:"field",static:!0,key:"styles",value:()=>n.iv`:host{display:var(--ha-icon-display,inline-flex);align-items:center;justify-content:center;position:relative;vertical-align:middle;fill:var(--icon-primary-color,currentcolor);width:var(--mdc-icon-size,24px);height:var(--mdc-icon-size,24px)}svg{width:100%;height:100%;pointer-events:none;display:block}path.primary-path{opacity:var(--icon-primary-opactity, 1)}path.secondary-path{fill:var(--icon-secondary-color,currentcolor);opacity:var(--icon-secondary-opactity, .5)}`}]}}),n.oi)},48977:function(e,t,i){function a(e){return"strategy"in e}i.d(t,{Oh:()=>o,Q2:()=>n,Tx:()=>a,vj:()=>s});const n=(e,t,i)=>e.sendMessagePromise({type:"lovelace/config",url_path:t,force:i}),o=(e,t,i)=>e.callWS({type:"lovelace/config/save",url_path:t,config:i}),s=(e,t)=>e.callWS({type:"lovelace/config/delete",url_path:t})},83716:function(e,t,i){i.d(t,{r:()=>a});const a=(e,t)=>{const i=new n,a=e.subscribeMessage((e=>t(i.processMessage(e))),{type:"persistent_notification/subscribe"});return()=>{a.then((e=>e?.()))}};class n{constructor(){this.notifications=void 0,this.notifications={}}processMessage(e){if("removed"===e.type)for(const t of Object.keys(e.notifications))delete this.notifications[t];else this.notifications={...this.notifications,...e.notifications};return Object.values(this.notifications)}}},69040:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(44249),n=i(72621),o=(i(9359),i(31526),i(57243)),s=i(15093),d=i(36522),l=(i(37583),i(94264)),r=i(27934),c=i(40249),h=e([r]);r=(h.then?(await h)():h)[0];(0,a.Z)([(0,s.Mo)("hui-badge")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"preview",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"config",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",key:"_elementConfig",value:void 0},{kind:"method",key:"load",value:function(){if(!this.config)throw new Error("Cannot build badge without config");this._loadElement(this.config)}},{kind:"field",key:"_element",value:void 0},{kind:"field",key:"_listeners",value:()=>[]},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(i,"disconnectedCallback",this,3)([]),this._clearMediaQueries()}},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(i,"connectedCallback",this,3)([]),this._listenMediaQueries(),this._updateVisibility()}},{kind:"method",key:"_updateElement",value:function(e){this._element&&(this._element.setConfig(e),this._elementConfig=e,(0,d.B)(this,"badge-updated"))}},{kind:"method",key:"_loadElement",value:function(e){for(this._element=(0,r.JE)(e),this._elementConfig=e,this.hass&&(this._element.hass=this.hass),this._element.addEventListener("ll-upgrade",(e=>{e.stopPropagation(),this.hass&&(this._element.hass=this.hass),(0,d.B)(this,"badge-updated")}),{once:!0}),this._element.addEventListener("ll-rebuild",(t=>{t.stopPropagation(),this._loadElement(e),(0,d.B)(this,"badge-updated")}),{once:!0});this.lastChild;)this.removeChild(this.lastChild);this._updateVisibility()}},{kind:"method",key:"willUpdate",value:function(e){(0,n.Z)(i,"willUpdate",this,3)([e]),this._element||this.load()}},{kind:"method",key:"update",value:function(e){if((0,n.Z)(i,"update",this,3)([e]),this._element){if(e.has("config")){const e=this._elementConfig;if(this.config!==e&&this.config){this.config?.type!==e?.type?this._loadElement(this.config):this._updateElement(this.config)}}if(e.has("hass"))try{this.hass&&(this._element.hass=this.hass)}catch(e){this._loadElement((0,c.Fr)(e.message,null))}}(e.has("hass")||e.has("preview"))&&this._updateVisibility()}},{kind:"method",key:"_clearMediaQueries",value:function(){this._listeners.forEach((e=>e())),this._listeners=[]}},{kind:"method",key:"_listenMediaQueries",value:function(){if(this._clearMediaQueries(),!this.config?.visibility)return;const e=this.config.visibility,t=1===e.length&&"screen"===e[0].condition&&!!e[0].media_query;this._listeners=(0,l.av)(this.config.visibility,(e=>{this._updateVisibility(t&&e)}))}},{kind:"method",key:"_updateVisibility",value:function(e){if(!this._element||!this.hass)return;if(this._element.hidden)return void this._setElementVisibility(!1);const t=e||this.preview||!this.config?.visibility||(0,l.Ec)(this.config.visibility,this.hass);this._setElementVisibility(t)}},{kind:"method",key:"_setElementVisibility",value:function(e){this._element&&(this.hidden!==!e&&(this.style.setProperty("display",e?"":"none"),this.toggleAttribute("hidden",!e),(0,d.B)(this,"badge-visibility-changed",{value:e})),!e&&this._element.parentElement?this.removeChild(this._element):e&&!this._element.parentElement&&this.appendChild(this._element))}}]}}),o.fl);t()}catch(e){t(e)}}))},52293:function(e,t,i){var a=i(44249),n=i(72621),o=(i(9359),i(68107),i(57243)),s=i(15093),d=i(35359),l=i(91583),r=i(36522),c=(i(30043),i(62801),i(37583),i(60074),i(27353));const h={delay:100,delayOnTouchOnly:!0,direction:"horizontal",invertedSwapThreshold:.7};(0,a.Z)([(0,s.Mo)("hui-view-badges")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"lovelace",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"badges",value:()=>[]},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"viewIndex",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,attribute:"show-add-label"})],key:"showAddLabel",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_dragging",value:()=>!1},{kind:"field",key:"_badgeConfigKeys",value:()=>new WeakMap},{kind:"method",key:"_checkAllHidden",value:function(){const e=!this.lovelace.editMode&&this.badges.every((e=>e.hidden));this.toggleAttribute("hidden",e)}},{kind:"field",key:"_badgeVisibilityChanged",value(){return()=>{this._checkAllHidden()}}},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(i,"connectedCallback",this,3)([]),this.addEventListener("badge-visibility-changed",this._badgeVisibilityChanged)}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(i,"disconnectedCallback",this,3)([]),this.removeEventListener("badge-visibility-changed",this._badgeVisibilityChanged)}},{kind:"method",key:"willUpdate",value:function(e){(e.has("badges")||e.has("lovelace"))&&this._checkAllHidden()}},{kind:"method",key:"_getBadgeKey",value:function(e){return this._badgeConfigKeys.has(e)||this._badgeConfigKeys.set(e,Math.random().toString()),this._badgeConfigKeys.get(e)}},{kind:"method",key:"_badgeMoved",value:function(e){e.stopPropagation();const{oldIndex:t,newIndex:i}=e.detail,a=(0,c.BM)(this.lovelace.config,[this.viewIndex,t],[this.viewIndex,i]);this.lovelace.saveConfig(a)}},{kind:"method",key:"_badgeAdded",value:function(e){e.stopPropagation();const{index:t,data:i}=e.detail,a=i,n=[this.viewIndex,t],o=(0,c.BM)(this.lovelace.config,a,n);this.lovelace.saveConfig(o)}},{kind:"method",key:"_badgeRemoved",value:function(e){e.stopPropagation()}},{kind:"method",key:"_dragStart",value:function(){this._dragging=!0}},{kind:"method",key:"_dragEnd",value:function(){this._dragging=!1}},{kind:"method",key:"_addBadge",value:function(){(0,r.B)(this,"ll-create-badge")}},{kind:"method",key:"render",value:function(){if(!this.lovelace)return o.Ld;const e=this.lovelace.editMode,t=this.badges;return o.dy` ${t?.length>0||e?o.dy` <ha-sortable .disabled="${!e}" @item-moved="${this._badgeMoved}" @item-added="${this._badgeAdded}" @item-removed="${this._badgeRemoved}" @drag-start="${this._dragStart}" @drag-end="${this._dragEnd}" group="badge" draggable-selector="[data-sortable]" .rollback="${!1}" .options="${h}" invert-swap> <div class="badges ${(0,d.$)({"edit-mode":e})}"> ${(0,l.r)(t,(e=>this._getBadgeKey(e)),((t,i)=>{const a=[this.viewIndex,i];return o.dy` ${e?o.dy` <hui-badge-edit-mode data-sortable .hass="${this.hass}" .lovelace="${this.lovelace}" .path="${a}" .hiddenOverlay="${this._dragging}" .sortableData="${a}"> ${t} </hui-badge-edit-mode> `:t} `}))} ${e?o.dy` <button class="add" @click="${this._addBadge}" aria-label="${this.hass.localize("ui.panel.lovelace.editor.section.add_badge")}" .title="${this.hass.localize("ui.panel.lovelace.editor.section.add_badge")}"> <ha-ripple></ha-ripple> <ha-svg-icon .path="${"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"}"></ha-svg-icon> ${this.showAddLabel?this.hass.localize("ui.panel.lovelace.editor.section.add_badge"):o.Ld} </button> `:o.Ld} </div> </ha-sortable> `:o.Ld} `}},{kind:"field",static:!0,key:"styles",value:()=>o.iv`:host([hidden]){display:none!important}.badges{display:flex;align-items:flex-start;flex-wrap:var(--badges-wrap,wrap);justify-content:var(--badges-aligmnent,center);gap:8px;margin:0}hui-badge-edit-mode{display:block;position:relative;min-width:36px;min-height:36px}.add{position:relative;display:flex;flex-direction:row;align-items:center;outline:0;gap:8px;height:36px;padding:6px 20px 6px 20px;box-sizing:border-box;width:auto;border-radius:18px;background-color:transparent;border-width:2px;border-style:dashed;border-color:var(--primary-color);--mdc-icon-size:18px;cursor:pointer;font-size:14px;color:var(--primary-text-color);--ha-ripple-color:var(--primary-color);--ha-ripple-hover-opacity:0.04;--ha-ripple-pressed-opacity:0.12}.add:focus{border-style:solid}`}]}}),o.oi)},60074:function(e,t,i){var a=i(44249),n=i(72621),o=i(12582),s=i(57243),d=i(15093),l=i(35359),r=i(68958),c=i(36522),h=(i(34273),i(23334),i(7285),i(37583),i(6671)),u=i(28008),v=i(71152),p=i(2593);const f="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z";(0,a.Z)([(0,d.Mo)("hui-badge-edit-mode")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"lovelace",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Array})],key:"path",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:"hidden-overlay",type:Boolean})],key:"hiddenOverlay",value:()=>!1},{kind:"field",decorators:[(0,d.SB)()],key:"_menuOpened",value:()=>!1},{kind:"field",decorators:[(0,d.SB)()],key:"_hover",value:()=>!1},{kind:"field",decorators:[(0,d.SB)()],key:"_focused",value:()=>!1},{kind:"field",decorators:[(0,r.t)({key:"dashboardBadgeClipboard",state:!1,subscribe:!1,storage:"sessionStorage"})],key:"_clipboard",value:void 0},{kind:"get",key:"_badges",value:function(){const e=(0,p.Kx)(this.path);return(0,p.Cs)("badges",this.lovelace.config,e)}},{kind:"field",key:"_touchStarted",value:()=>!1},{kind:"method",key:"firstUpdated",value:function(){this.addEventListener("focus",(()=>{this._focused=!0})),this.addEventListener("blur",(()=>{this._focused=!1})),this.addEventListener("touchstart",(()=>{this._touchStarted=!0})),this.addEventListener("touchend",(()=>{setTimeout((()=>{this._touchStarted=!1}),10)})),this.addEventListener("mouseenter",(()=>{this._touchStarted||(this._hover=!0)})),this.addEventListener("mouseout",(()=>{this._hover=!1})),this.addEventListener("click",(()=>{this._hover=!0,document.addEventListener("click",this._documentClicked)}))}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(i,"disconnectedCallback",this,3)([]),document.removeEventListener("click",this._documentClicked)}},{kind:"field",key:"_documentClicked",value(){return e=>{this._hover=e.composedPath().includes(this),document.removeEventListener("click",this._documentClicked)}}},{kind:"method",key:"render",value:function(){const e=(this._hover||this._menuOpened||this._focused)&&!this.hiddenOverlay;return s.dy` <div class="badge-wrapper" inert><slot></slot></div> <div class="badge-overlay ${(0,l.$)({visible:e})}"> <div class="edit" @click="${this._handleOverlayClick}" @keydown="${this._handleOverlayClick}" tabindex="0"> <div class="edit-overlay"></div> <ha-svg-icon class="edit" .path="${f}"> </ha-svg-icon> </div> <ha-button-menu class="more" corner="BOTTOM_END" menu-corner="END" .path="${[this.path]}" @action="${this._handleAction}" @opened="${this._handleOpened}" @closed="${this._handleClosed}"> <ha-icon-button slot="trigger" .path="${"M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z"}"> </ha-icon-button> <ha-list-item graphic="icon"> <ha-svg-icon slot="graphic" .path="${f}"></ha-svg-icon> ${this.hass.localize("ui.panel.lovelace.editor.edit_card.edit")} </ha-list-item> <ha-list-item graphic="icon"> <ha-svg-icon slot="graphic" .path="${"M16,8H14V11H11V13H14V16H16V13H19V11H16M2,12C2,9.21 3.64,6.8 6,5.68V3.5C2.5,4.76 0,8.09 0,12C0,15.91 2.5,19.24 6,20.5V18.32C3.64,17.2 2,14.79 2,12M15,3C10.04,3 6,7.04 6,12C6,16.96 10.04,21 15,21C19.96,21 24,16.96 24,12C24,7.04 19.96,3 15,3M15,19C11.14,19 8,15.86 8,12C8,8.14 11.14,5 15,5C18.86,5 22,8.14 22,12C22,15.86 18.86,19 15,19Z"}"></ha-svg-icon> ${this.hass.localize("ui.panel.lovelace.editor.edit_card.duplicate")} </ha-list-item> <ha-list-item graphic="icon"> <ha-svg-icon slot="graphic" .path="${"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"}"></ha-svg-icon> ${this.hass.localize("ui.panel.lovelace.editor.edit_card.copy")} </ha-list-item> <ha-list-item graphic="icon"> <ha-svg-icon slot="graphic" .path="${"M19,3L13,9L15,11L22,4V3M12,12.5A0.5,0.5 0 0,1 11.5,12A0.5,0.5 0 0,1 12,11.5A0.5,0.5 0 0,1 12.5,12A0.5,0.5 0 0,1 12,12.5M6,20A2,2 0 0,1 4,18C4,16.89 4.9,16 6,16A2,2 0 0,1 8,18C8,19.11 7.1,20 6,20M6,8A2,2 0 0,1 4,6C4,4.89 4.9,4 6,4A2,2 0 0,1 8,6C8,7.11 7.1,8 6,8M9.64,7.64C9.87,7.14 10,6.59 10,6A4,4 0 0,0 6,2A4,4 0 0,0 2,6A4,4 0 0,0 6,10C6.59,10 7.14,9.87 7.64,9.64L10,12L7.64,14.36C7.14,14.13 6.59,14 6,14A4,4 0 0,0 2,18A4,4 0 0,0 6,22A4,4 0 0,0 10,18C10,17.41 9.87,16.86 9.64,16.36L12,14L19,21H22V20L9.64,7.64Z"}"></ha-svg-icon> ${this.hass.localize("ui.panel.lovelace.editor.edit_card.cut")} </ha-list-item> <li divider role="separator"></li> <ha-list-item graphic="icon" class="warning"> ${this.hass.localize("ui.panel.lovelace.editor.edit_card.delete")} <ha-svg-icon class="warning" slot="graphic" .path="${"M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z"}"></ha-svg-icon> </ha-list-item> </ha-button-menu> </div> `}},{kind:"method",key:"_handleOpened",value:function(){this._menuOpened=!0}},{kind:"method",key:"_handleClosed",value:function(){this._menuOpened=!1}},{kind:"method",key:"_handleOverlayClick",value:function(e){e.defaultPrevented||"keydown"===e.type&&"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),this._editBadge())}},{kind:"method",key:"_handleAction",value:function(e){switch(e.detail.index){case 0:this._editBadge();break;case 1:this._duplicateBadge();break;case 2:this._copyBadge();break;case 3:this._cutBadge();break;case 4:this._deleteBadge()}}},{kind:"method",key:"_cutBadge",value:function(){this._copyBadge(),(0,c.B)(this,"ll-delete-badge",{path:this.path,silent:!0})}},{kind:"method",key:"_copyBadge",value:function(){const{cardIndex:e}=(0,p.lJ)(this.path),t=this._badges[e];this._clipboard=(0,o.Z)(t)}},{kind:"method",key:"_duplicateBadge",value:function(){const{cardIndex:e}=(0,p.lJ)(this.path),t=(0,p.Kx)(this.path),i=(0,h.d)(this._badges[e]);(0,v.e)(this,{lovelaceConfig:this.lovelace.config,saveConfig:this.lovelace.saveConfig,path:t,badgeConfig:i})}},{kind:"method",key:"_editBadge",value:function(){(0,c.B)(this,"ll-edit-badge",{path:this.path})}},{kind:"method",key:"_deleteBadge",value:function(){(0,c.B)(this,"ll-delete-badge",{path:this.path,silent:!1})}},{kind:"get",static:!0,key:"styles",value:function(){return[u.Qx,s.iv`.badge-overlay{position:absolute;opacity:0;pointer-events:none;inset:0;display:flex;align-items:center;justify-content:center;transition:opacity 180ms ease-in-out}.badge-overlay.visible{opacity:1;pointer-events:auto}.badge-wrapper{position:relative;height:100%;z-index:0}.edit{outline:0!important;cursor:pointer;position:absolute;inset:0;display:flex;align-items:center;justify-content:center;border-radius:var(--ha-card-border-radius,12px);z-index:0}.edit-overlay{position:absolute;inset:0;opacity:.8;background-color:var(--primary-background-color);border-radius:var(--ha-card-border-radius,12px);z-index:0}.edit ha-svg-icon{display:flex;position:relative;color:var(--primary-text-color);border-radius:50%;padding:4px;background:var(--secondary-background-color);--mdc-icon-size:16px}.more{position:absolute;right:-8px;top:-8px;inset-inline-end:-10px;inset-inline-start:initial}.more ha-icon-button{cursor:pointer;border-radius:50%;background:var(--secondary-background-color);--mdc-icon-button-size:24px;--mdc-icon-size:16px}`]}}]}}),s.oi)},3701:function(e,t,i){i.a(e,(async function(e,a){try{i.d(t,{o:()=>r});i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814);var n=i(97728),o=i(40249),s=e([n]);n=(s.then?(await s)():s)[0];const d=new Set(["masonry"]),l={panel:()=>i.e("91773").then(i.bind(i,27447)),sidebar:()=>i.e("24065").then(i.bind(i,64331)),sections:()=>i.e("2682").then(i.bind(i,5081))},r=e=>(0,o.Tw)("view",e,d,l);a()}catch(e){a(e)}}))},66684:function(e,t,i){i.d(t,{z:()=>o});var a=i(36522);const n=()=>Promise.all([i.e("46379"),i.e("97983"),i.e("15722"),i.e("82600"),i.e("7031"),i.e("58529"),i.e("52876"),i.e("10216")]).then(i.bind(i,78254)),o=(e,t)=>{(0,a.B)(e,"show-dialog",{dialogTag:"hui-dialog-create-badge",dialogImport:n,dialogParams:t})}},71152:function(e,t,i){i.d(t,{e:()=>o});var a=i(36522);const n=()=>Promise.all([i.e("97983"),i.e("15722"),i.e("67991")]).then(i.bind(i,71586)),o=(e,t)=>{(0,a.B)(e,"show-dialog",{dialogTag:"hui-dialog-edit-badge",dialogImport:n,dialogParams:t})}},31366:function(e,t,i){i.d(t,{V:()=>n});var a=i(27353);async function n(e,t,i){try{const{path:n,silent:o}=i,s=t.config,d=(0,a.vs)(s,n);if(await t.saveConfig(d),o)return;const l=async()=>{t.saveConfig(s)};t.showToast({message:e.localize("ui.common.successfully_deleted"),duration:8e3,action:{action:l,text:e.localize("ui.common.undo")}})}catch(i){console.error(i),t.showToast({message:e.localize("ui.common.deleting_failed")})}}},29362:function(e,t,i){i.d(t,{j9:()=>s});var a=i(44249),n=i(57243),o=i(15093);i(33101),i(37583);const s=e=>({type:"error",error:e});(0,a.Z)([(0,o.Mo)("hui-error-section")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"isStrategy",value:()=>!1},{kind:"field",decorators:[(0,o.SB)()],key:"_config",value:void 0},{kind:"method",key:"setConfig",value:function(e){this._config=e}},{kind:"method",key:"render",value:function(){return this._config?n.dy` <h1>Error</h1> <p>${this._config.error}</p> `:n.Ld}}]}}),n.oi)},82747:function(e,t,i){i.d(t,{Jh:()=>n,e4:()=>a,rQ:()=>o,zh:()=>s});const a="masonry",n="panel",o="sidebar",s="sections"},18461:function(e,t,i){i.d(t,{W:()=>n});var a=i(82747);const n=e=>e?.type?e.type:e?.panel?a.Jh:e?.sections?a.zh:e?.cards?a.e4:a.zh},97728:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(44249),n=i(72621),o=(i(92745),i(9359),i(31526),i(48136),i(57243)),s=i(15093),d=i(36522),l=i(76320),r=i(78555),c=(i(37583),i(52293),i(81833)),h=e([r]);r=(h.then?(await h)():h)[0];const u="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",v=(e,t)=>{let i=0;for(let t=0;t<e.length;t++){if(e[t]<5){i=t;break}e[t]<e[i]&&(i=t)}return e[i]+=t,i};let p=(0,a.Z)(null,(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"lovelace",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"narrow",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({type:Number})],key:"index",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"isStrategy",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"cards",value:()=>[]},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"badges",value:()=>[]},{kind:"field",decorators:[(0,s.SB)()],key:"_columns",value:void 0},{kind:"field",key:"_createColumnsIteration",value:()=>0},{kind:"field",key:"_mqls",value:void 0},{kind:"field",key:"_mqlListenerRef",value:void 0},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(a,"connectedCallback",this,3)([]),this._initMqls()}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(a,"disconnectedCallback",this,3)([]),this._mqls?.forEach((e=>{e.removeListener(this._mqlListenerRef)})),this._mqlListenerRef=void 0,this._mqls=void 0}},{kind:"method",key:"setConfig",value:function(e){}},{kind:"method",key:"render",value:function(){return o.dy` <hui-view-badges .hass="${this.hass}" .badges="${this.badges}" .lovelace="${this.lovelace}" .viewIndex="${this.index}" show-add-label></hui-view-badges> <div id="columns" class="${this.lovelace?.editMode?"edit-mode":""}"></div> ${this.lovelace?.editMode?o.dy` <ha-fab .label="${this.hass.localize("ui.panel.lovelace.editor.edit_card.add")}" extended @click="${this._addCard}"> <ha-svg-icon slot="icon" .path="${u}"></ha-svg-icon> </ha-fab> `:""} `}},{kind:"method",key:"_initMqls",value:function(){this._mqls=[300,600,900,1200].map((e=>{const t=window.matchMedia(`(min-width: ${e}px)`);return this._mqlListenerRef||(this._mqlListenerRef=this._updateColumns.bind(this)),t.addListener(this._mqlListenerRef),t}))}},{kind:"get",key:"mqls",value:function(){return this._mqls||this._initMqls(),this._mqls}},{kind:"method",key:"willUpdate",value:function(e){if((0,n.Z)(a,"willUpdate",this,3)([e]),this.lovelace?.editMode&&Promise.all([i.e("41103"),i.e("39341")]).then(i.bind(i,70419)),e.has("hass")){const t=e.get("hass");if(this.hass.dockedSidebar!==t?.dockedSidebar)return void this._updateColumns()}if(e.has("narrow"))return void this._updateColumns();const t=e.get("lovelace");(e.has("cards")||e.has("lovelace")&&t&&(t.config!==this.lovelace.config||t.editMode!==this.lovelace.editMode))&&this._createColumns()}},{kind:"method",key:"_addCard",value:function(){(0,d.B)(this,"ll-create-card")}},{kind:"method",key:"_createRootElement",value:function(e){const t=this.shadowRoot.getElementById("columns");for(;t.lastChild;)t.removeChild(t.lastChild);e.forEach((e=>t.appendChild(e)))}},{kind:"method",key:"_createColumns",value:async function(){if(!this._columns)return;this._createColumnsIteration++;const e=this._createColumnsIteration,t=[],i=[];for(let e=0;e<Math.min(this._columns,this.cards.length);e++){const e=document.createElement("div");e.classList.add("column"),t.push(0),i.push(e)}let a,n;this.hasUpdated?this._createRootElement(i):this.updateComplete.then((()=>{this._createRootElement(i)}));for(const[o,s]of this.cards.entries()){let d;void 0===a&&(a=(0,l.y)().then((()=>{a=void 0,n=void 0}))),void 0===n?n=new Date:(new Date).getTime()-n.getTime()>16&&(d=a);const r=(0,c.N)(s),[h]=await Promise.all([r,d]);if(e!==this._createColumnsIteration)return;this._addCardToColumn(i[v(t,h)],o,this.lovelace.editMode)}i.forEach((e=>{e.lastChild||e.parentElement.removeChild(e)}))}},{kind:"method",key:"_addCardToColumn",value:function(e,t,i){const a=this.cards[t];if(!i||this.isStrategy)a.preview=!1,e.appendChild(a);else{const i=document.createElement("hui-card-options");i.hass=this.hass,i.lovelace=this.lovelace,i.path=[this.index,t],a.preview=!0,i.appendChild(a),e.appendChild(i)}}},{kind:"method",key:"_updateColumns",value:function(){const e=this.mqls.reduce(((e,t)=>e+Number(t.matches)),0),t=Math.max(1,e-Number(!this.narrow&&"docked"===this.hass.dockedSidebar));t!==this._columns&&(this._columns=t,this._createColumns())}},{kind:"field",static:!0,key:"styles",value:()=>o.iv`:host{display:block;padding-top:4px}hui-view-badges{display:block;margin:4px 8px 4px 8px;font-size:85%}#columns{display:flex;flex-direction:row;justify-content:center;margin-left:4px;margin-right:4px}#columns.edit-mode{margin-bottom:72px}.column{flex:1 0 0;max-width:500px;min-width:0}.column:has(> *){flex-grow:1}.column:not(:has(> :not([hidden]))){flex-grow:0}.column>:not([hidden]){display:block;margin:var(--masonry-view-card-margin,4px 4px 8px)}ha-fab{position:fixed;right:calc(16px + env(safe-area-inset-right));bottom:calc(16px + env(safe-area-inset-bottom));inset-inline-end:calc(16px + env(safe-area-inset-right));inset-inline-start:initial;z-index:1}@media (max-width:500px){.column>*{margin-left:0;margin-right:0}}@media (max-width:599px){.column{max-width:600px}}`}]}}),o.oi);customElements.define("hui-masonry-view",p),t()}catch(e){t(e)}}))},33679:function(e,t,i){var a=i(44249),n=i(72621),o=i(57243),s=i(15093),d=i(82393),l=i(62201);(0,a.Z)([(0,s.Mo)("hui-view-container")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"background",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"theme",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"themeBackground",value:void 0},{kind:"field",key:"_unsubMediaQuery",value:void 0},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(i,"connectedCallback",this,3)([]),this._setUpMediaQuery(),this._applyTheme()}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(i,"disconnectedCallback",this,3)([]),this._clearmediaQuery()}},{kind:"method",key:"_clearmediaQuery",value:function(){this._unsubMediaQuery&&(this._unsubMediaQuery(),this._unsubMediaQuery=void 0)}},{kind:"method",key:"_setUpMediaQuery",value:function(){this._unsubMediaQuery=(0,l.K)("(prefers-color-scheme: dark)",this._applyTheme.bind(this))}},{kind:"method",key:"willUpdate",value:function(e){if((0,n.Z)(i,"willUpdate",this,3)([e]),e.has("hass")&&this.hass){const t=e.get("hass");if(!t||this.hass.themes!==t.themes||this.hass.selectedTheme!==t.selectedTheme)return void this._applyTheme()}e.has("theme")&&this._applyTheme()}},{kind:"method",key:"render",value:function(){return o.dy`<slot></slot>`}},{kind:"method",key:"_applyTheme",value:function(){this.hass&&(0,d.R)(this,this.hass?.themes,this.theme)}},{kind:"field",static:!0,key:"styles",value:()=>o.iv`:host{display:relative}`}]}}),o.oi)},3166:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(44249),n=i(72621),o=(i(9359),i(31526),i(70104),i(12582)),s=i(57243),d=i(15093),l=i(68958),r=i(78555),c=(i(37583),i(6671)),h=i(10571),u=i(69040),v=i(11734),p=i(3701),f=i(66684),m=i(71152),y=i(41391),g=i(77711),k=i(27353),b=i(31366),_=i(5522),w=i(2593),x=i(29362),C=i(80373),E=i(28421),M=i(18461),$=e([r,u,v,C,p]);[r,u,v,C,p]=$.then?(await $)():$;(0,a.Z)([(0,d.Mo)("hui-view")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"lovelace",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"narrow",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({type:Number})],key:"index",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_cards",value:()=>[]},{kind:"field",decorators:[(0,d.SB)()],key:"_badges",value:()=>[]},{kind:"field",decorators:[(0,d.SB)()],key:"_sections",value:()=>[]},{kind:"field",key:"_layoutElementType",value:void 0},{kind:"field",key:"_layoutElement",value:void 0},{kind:"field",decorators:[(0,l.t)({key:"dashboardCardClipboard",state:!1,subscribe:!1,storage:"sessionStorage"})],key:"_clipboard",value:void 0},{kind:"method",key:"_createCardElement",value:function(e){const t=document.createElement("hui-card");return t.hass=this.hass,t.preview=this.lovelace.editMode,t.config=e,t.addEventListener("card-updated",(e=>{e.stopPropagation(),this._cards=[...this._cards]})),t.load(),t}},{kind:"method",key:"createBadgeElement",value:function(e){const t=document.createElement("hui-badge");return t.hass=this.hass,t.preview=this.lovelace.editMode,t.config=e,t.addEventListener("badge-updated",(e=>{e.stopPropagation(),this._badges=[...this._badges]})),t.load(),t}},{kind:"method",key:"createSectionElement",value:function(e){const t=document.createElement("hui-section");return t.hass=this.hass,t.lovelace=this.lovelace,t.config=e,t.viewIndex=this.index,t.preview=this.lovelace.editMode,t.addEventListener("ll-rebuild",(i=>{this.lovelace.editMode||(i.stopPropagation(),this._rebuildSection(t,e))}),{once:!0}),t}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"willUpdate",value:function(e){(0,n.Z)(i,"willUpdate",this,3)([e]);const t=e.get("lovelace");(e.has("index")||e.has("lovelace")&&(!t||this.lovelace.config.views[this.index]!==t.config.views[this.index]))&&this._initializeConfig()}},{kind:"method",key:"update",value:function(e){(0,n.Z)(i,"update",this,3)([e]),this._layoutElement&&(e.has("hass")&&(this._badges.forEach((e=>{e.hass=this.hass})),this._cards.forEach((e=>{e.hass=this.hass})),this._sections.forEach((e=>{try{e.hass=this.hass}catch(t){this._rebuildSection(e,(0,x.j9)(t.message))}})),this._layoutElement.hass=this.hass),e.has("narrow")&&(this._layoutElement.narrow=this.narrow),e.has("lovelace")&&(this._layoutElement.lovelace=this.lovelace,this._sections.forEach((e=>{try{e.hass=this.hass,e.lovelace=this.lovelace,e.preview=this.lovelace.editMode}catch(t){this._rebuildSection(e,(0,x.j9)(t.message))}})),this._cards.forEach((e=>{e.preview=this.lovelace.editMode})),this._badges.forEach((e=>{e.preview=this.lovelace.editMode}))),e.has("_cards")&&(this._layoutElement.cards=this._cards),e.has("_badges")&&(this._layoutElement.badges=this._badges))}},{kind:"method",key:"_initializeConfig",value:async function(){let e=this.lovelace.config.views[this.index],t=!1;(0,h.s)(e)&&(t=!0,e=await(0,E.ar)(e,this.hass)),e={...e,type:(0,M.W)(e)};let i=!1;if(this._layoutElement&&this._layoutElementType===e.type||(i=!0,this._createLayoutElement(e)),this._createBadges(e),this._createCards(e),this._createSections(e),this._layoutElement.isStrategy=t,this._layoutElement.hass=this.hass,this._layoutElement.narrow=this.narrow,this._layoutElement.lovelace=this.lovelace,this._layoutElement.index=this.index,this._layoutElement.cards=this._cards,this._layoutElement.badges=this._badges,this._layoutElement.sections=this._sections,i){for(;this.lastChild;)this.removeChild(this.lastChild);this.appendChild(this._layoutElement)}}},{kind:"method",key:"_createLayoutElement",value:function(e){this._layoutElement=(0,p.o)(e),this._layoutElementType=e.type,this._layoutElement.addEventListener("ll-create-card",(e=>{(0,y.F)(this,{lovelaceConfig:this.lovelace.config,saveConfig:this.lovelace.saveConfig,path:[this.index],suggestedCards:e.detail?.suggested})})),this._layoutElement.addEventListener("ll-edit-card",(e=>{const{cardIndex:t}=(0,w.lJ)(e.detail.path),i=this.lovelace.config.views[this.index];if((0,h.s)(i))return;const a=i.cards[t];(0,g.x)(this,{lovelaceConfig:this.lovelace.config,saveCardConfig:async e=>{const i=(0,k.LG)(this.lovelace.config,[this.index,t],e);await this.lovelace.saveConfig(i)},cardConfig:a})})),this._layoutElement.addEventListener("ll-delete-card",(e=>{this.lovelace&&(0,_.O)(this.hass,this.lovelace,e.detail)})),this._layoutElement.addEventListener("ll-create-badge",(async()=>{(0,f.z)(this,{lovelaceConfig:this.lovelace.config,saveConfig:this.lovelace.saveConfig,path:[this.index]})})),this._layoutElement.addEventListener("ll-edit-badge",(e=>{const{cardIndex:t}=(0,w.lJ)(e.detail.path);(0,m.e)(this,{lovelaceConfig:this.lovelace.config,saveConfig:this.lovelace.saveConfig,path:[this.index],badgeIndex:t})})),this._layoutElement.addEventListener("ll-delete-badge",(async e=>{this.lovelace&&(0,b.V)(this.hass,this.lovelace,e.detail)})),this._layoutElement.addEventListener("ll-duplicate-card",(e=>{const{cardIndex:t}=(0,w.lJ)(e.detail.path),i=this.lovelace.config.views[this.index];if((0,h.s)(i))return;const a=i.cards[t];(0,g.x)(this,{lovelaceConfig:this.lovelace.config,saveCardConfig:async e=>{const t=(0,k.Z0)(this.lovelace.config,[this.index],e);await this.lovelace.saveConfig(t)},cardConfig:a,isNew:!0})})),this._layoutElement.addEventListener("ll-copy-card",(e=>{if(!this.lovelace)return;const{cardIndex:t}=(0,w.lJ)(e.detail.path),i=this.lovelace.config.views[this.index];if((0,h.s)(i))return;const a=i.cards[t];this._clipboard=(0,o.Z)(a)}))}},{kind:"method",key:"_createBadges",value:function(e){e&&e.badges&&Array.isArray(e.badges)?this._badges=e.badges.map((e=>{const t=(0,c.d)(e);return this.createBadgeElement(t)})):this._badges=[]}},{kind:"method",key:"_createCards",value:function(e){e&&e.cards&&Array.isArray(e.cards)?this._cards=e.cards.map((e=>this._createCardElement(e))):this._cards=[]}},{kind:"method",key:"_createSections",value:function(e){e&&e.sections&&Array.isArray(e.sections)?this._sections=e.sections.map(((e,t)=>{const i=this.createSectionElement(e);return i.index=t,i})):this._sections=[]}},{kind:"method",key:"_rebuildSection",value:function(e,t){const i=this.createSectionElement(t);i.index=e.index,e.parentElement&&e.parentElement.replaceChild(i,e),this._sections=this._sections.map((t=>t===e?i:t))}}]}}),s.fl);t()}catch(e){t(e)}}))},16485:function(e,t,i){i.a(e,(async function(e,t){try{i(92745);var a=i(61449),n=i(40574),o=i(30532),s=i(41674),d=i(49722),l=i(76632),r=i(7884),c=i(35185),h=i(60933),u=i(44180),v=i(49447);const e=async()=>{const e=(0,u.sS)(),t=[];(0,o.shouldPolyfill)()&&await Promise.all([i.e("80210"),i.e("74055")]).then(i.bind(i,98133)),(0,d.shouldPolyfill)()&&await Promise.all([i.e("83895"),i.e("75297"),i.e("80210"),i.e("60251")]).then(i.bind(i,59095)),(0,a.shouldPolyfill)(e)&&t.push(Promise.all([i.e("83895"),i.e("75297"),i.e("68250")]).then(i.bind(i,80561)).then((()=>(0,v.H)()))),(0,h.shouldPolyfill)()&&t.push(Promise.all([i.e("83895"),i.e("75297"),i.e("65578")]).then(i.bind(i,97995))),(0,n.shouldPolyfill)(e)&&t.push(Promise.all([i.e("83895"),i.e("75297"),i.e("59826")]).then(i.bind(i,31514))),(0,s.shouldPolyfill)(e)&&t.push(Promise.all([i.e("83895"),i.e("75297"),i.e("23649")]).then(i.bind(i,93840))),(0,l.shouldPolyfill)(e)&&t.push(Promise.all([i.e("83895"),i.e("75297"),i.e("42831")]).then(i.bind(i,29559))),(0,r.shouldPolyfill)(e)&&t.push(Promise.all([i.e("83895"),i.e("75297"),i.e("57377")]).then(i.bind(i,39030)).then((()=>i.e("61236").then(i.t.bind(i,4121,23))))),(0,c.shouldPolyfill)(e)&&t.push(Promise.all([i.e("83895"),i.e("75297"),i.e("13870")]).then(i.bind(i,74546))),0!==t.length&&await Promise.all(t).then((()=>(0,v.n)(e)))};await e(),t()}catch(e){t(e)}}),1)},28008:function(e,t,i){i.d(t,{$c:()=>d,Qx:()=>o,k1:()=>n,yu:()=>s});var a=i(57243);const n=a.iv`button.link{background:0 0;color:inherit;border:none;padding:0;font:inherit;text-align:left;text-decoration:underline;cursor:pointer;outline:0}`,o=a.iv`:host{font-family:var(--paper-font-body1_-_font-family);-webkit-font-smoothing:var(--paper-font-body1_-_-webkit-font-smoothing);font-size:var(--paper-font-body1_-_font-size);font-weight:var(--paper-font-body1_-_font-weight);line-height:var(--paper-font-body1_-_line-height)}app-header div[sticky]{height:48px}app-toolbar [main-title]{margin-left:20px;margin-inline-start:20px;margin-inline-end:initial}h1{font-family:var(--paper-font-headline_-_font-family);-webkit-font-smoothing:var(--paper-font-headline_-_-webkit-font-smoothing);white-space:var(--paper-font-headline_-_white-space);overflow:var(--paper-font-headline_-_overflow);text-overflow:var(--paper-font-headline_-_text-overflow);font-size:var(--paper-font-headline_-_font-size);font-weight:var(--paper-font-headline_-_font-weight);line-height:var(--paper-font-headline_-_line-height)}h2{font-family:var(--paper-font-title_-_font-family);-webkit-font-smoothing:var(--paper-font-title_-_-webkit-font-smoothing);white-space:var(--paper-font-title_-_white-space);overflow:var(--paper-font-title_-_overflow);text-overflow:var(--paper-font-title_-_text-overflow);font-size:var(--paper-font-title_-_font-size);font-weight:var(--paper-font-title_-_font-weight);line-height:var(--paper-font-title_-_line-height)}h3{font-family:var(--paper-font-subhead_-_font-family);-webkit-font-smoothing:var(--paper-font-subhead_-_-webkit-font-smoothing);white-space:var(--paper-font-subhead_-_white-space);overflow:var(--paper-font-subhead_-_overflow);text-overflow:var(--paper-font-subhead_-_text-overflow);font-size:var(--paper-font-subhead_-_font-size);font-weight:var(--paper-font-subhead_-_font-weight);line-height:var(--paper-font-subhead_-_line-height)}a{color:var(--primary-color)}.secondary{color:var(--secondary-text-color)}.error{color:var(--error-color)}.warning{color:var(--error-color)}ha-button.warning,mwc-button.warning{--mdc-theme-primary:var(--error-color)}${n} .card-actions a{text-decoration:none}.card-actions .warning{--mdc-theme-primary:var(--error-color)}.layout.horizontal,.layout.vertical{display:flex}.layout.inline{display:inline-flex}.layout.horizontal{flex-direction:row}.layout.vertical{flex-direction:column}.layout.wrap{flex-wrap:wrap}.layout.no-wrap{flex-wrap:nowrap}.layout.center,.layout.center-center{align-items:center}.layout.bottom{align-items:flex-end}.layout.center-center,.layout.center-justified{justify-content:center}.flex{flex:1;flex-basis:0.000000001px}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.layout.justified{justify-content:space-between}`,s=a.iv`ha-dialog{--mdc-dialog-min-width:400px;--mdc-dialog-max-width:600px;--mdc-dialog-max-width:min(600px, 95vw);--justify-action-buttons:space-between}ha-dialog .form{color:var(--primary-text-color)}a{color:var(--primary-color)}@media all and (max-width:450px),all and (max-height:500px){ha-dialog{--mdc-dialog-min-width:calc( 100vw - env(safe-area-inset-right) - env(safe-area-inset-left) );--mdc-dialog-max-width:calc( 100vw - env(safe-area-inset-right) - env(safe-area-inset-left) );--mdc-dialog-min-height:100%;--mdc-dialog-max-height:100%;--vertical-align-dialog:flex-end;--ha-dialog-border-radius:0}}ha-button.warning,mwc-button.warning{--mdc-theme-primary:var(--error-color)}.error{color:var(--error-color)}`,d=a.iv`.ha-scrollbar::-webkit-scrollbar{width:.4rem;height:.4rem}.ha-scrollbar::-webkit-scrollbar-thumb{-webkit-border-radius:4px;border-radius:4px;background:var(--scrollbar-thumb-color)}.ha-scrollbar{overflow-y:auto;scrollbar-color:var(--scrollbar-thumb-color) transparent;scrollbar-width:thin}`;a.iv`body{background-color:var(--primary-background-color);color:var(--primary-text-color);height:calc(100vh - 32px);width:100vw}`}}; //# sourceMappingURL=81394.a424ede69d580dda.js.map