iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
18 lines • 50.9 kB
JavaScript
/*! For license information please see 52874.bbe63465d5d57ecf.js.LICENSE.txt */
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["52874"],{30509:function(e,t,i){var o=i(61701),n=(i(71695),i(47021),i(57243)),a=i(50778);let s,r,l=e=>e;(0,o.Z)([(0,a.Mo)("ha-settings-row")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,a.Cb)({type:Boolean,reflect:!0})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,a.Cb)({type:Boolean,reflect:!0})],key:"slim",value(){return!1}},{kind:"field",decorators:[(0,a.Cb)({type:Boolean,attribute:"three-line"})],key:"threeLine",value(){return!1}},{kind:"field",decorators:[(0,a.Cb)({type:Boolean,attribute:"wrap-heading",reflect:!0})],key:"wrapHeading",value(){return!1}},{kind:"method",key:"render",value:function(){return(0,n.dy)(s||(s=l` <div class="prefix-wrap"> <slot name="prefix"></slot> <div class="body" ?two-line="${0}" ?three-line="${0}"> <slot name="heading"></slot> <div class="secondary"><slot name="description"></slot></div> </div> </div> <div class="content"><slot></slot></div> `),!this.threeLine,this.threeLine)}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(r||(r=l`:host{display:flex;padding:0 16px;align-content:normal;align-self:auto;align-items:center}.body{padding-top:8px;padding-bottom:8px;padding-left:0;padding-inline-start:0;padding-right:16px;padding-inline-end:16px;overflow:hidden;display:var(--layout-vertical_-_display,flex);flex-direction:var(--layout-vertical_-_flex-direction,column);justify-content:var(--layout-center-justified_-_justify-content,center);flex:var(--layout-flex_-_flex,1);flex-basis:var(--layout-flex_-_flex-basis,0.000000001px)}.body[three-line]{min-height:var(--paper-item-body-three-line-min-height,88px)}:host(:not([wrap-heading])) body>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.body>.secondary{display:block;padding-top:4px;font-family:var(
--mdc-typography-body2-font-family,
var(--mdc-typography-font-family, Roboto, sans-serif)
);-webkit-font-smoothing:antialiased;font-size:var(--mdc-typography-body2-font-size, .875rem);font-weight:var(--mdc-typography-body2-font-weight,400);line-height:normal;color:var(--secondary-text-color)}.body[two-line]{min-height:calc(var(--paper-item-body-two-line-min-height,72px) - 16px);flex:1}.content{display:contents}:host(:not([narrow])) .content{display:var(--settings-row-content-display,flex);justify-content:flex-end;flex:1;padding:16px 0}.content ::slotted(*){width:var(--settings-row-content-width)}:host([narrow]){align-items:normal;flex-direction:column;border-top:1px solid var(--divider-color);padding-bottom:8px}::slotted(ha-switch){padding:16px 0}.secondary{white-space:normal}.prefix-wrap{display:var(--settings-row-prefix-display)}:host([narrow]) .prefix-wrap{display:flex;align-items:center}:host([slim]),:host([slim]) .content,:host([slim]) ::slotted(ha-switch){padding:0}:host([slim]) .body{min-height:0}`))}}]}}),n.oi)},17170:function(e,t,i){i.a(e,(async function(e,o){try{i.r(t),i.d(t,{HaSpinner:()=>p});var n=i(61701),a=i(72621),s=(i(71695),i(47021),i(97677)),r=i(43580),l=i(57243),d=i(50778),c=e([s]);s=(c.then?(await c)():c)[0];let h,u=e=>e,p=(0,n.Z)([(0,d.Mo)("ha-spinner")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)()],key:"size",value:void 0},{kind:"method",key:"updated",value:function(e){if((0,a.Z)(i,"updated",this,3)([e]),e.has("size"))switch(this.size){case"tiny":this.style.setProperty("--ha-spinner-size","16px");break;case"small":this.style.setProperty("--ha-spinner-size","28px");break;case"medium":this.style.setProperty("--ha-spinner-size","48px");break;case"large":this.style.setProperty("--ha-spinner-size","68px");break;case void 0:this.style.removeProperty("--ha-progress-ring-size")}}},{kind:"field",static:!0,key:"styles",value(){return[r.Z,(0,l.iv)(h||(h=u`:host{--indicator-color:var(
--ha-spinner-indicator-color,
var(--primary-color)
);--track-color:var(--ha-spinner-divider-color, var(--divider-color));--track-width:4px;--speed:3.5s;font-size:var(--ha-spinner-size, 48px)}`))]}}]}}),s.Z);o()}catch(h){o(h)}}))},91728:function(e,t,i){i.a(e,(async function(e,t){try{var o=i(61701),n=i(72621),a=(i(71695),i(92745),i(40251),i(47021),i(56820),i(99619),i(57243)),s=i(50778),r=i(62037),l=i(6973),d=(i(78999),i(52043),e([r,l]));[r,l]=d.then?(await d)():d;let c,h,u,p,v,m,g=e=>e;const f=["config","visibility","layout"];(0,o.Z)([(0,s.Mo)("hui-card-element-editor")],(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,attribute:"show-visibility-tab"})],key:"showVisibilityTab",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"sectionConfig",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_currTab",value(){return f[0]}},{kind:"method",key:"getConfigElement",value:async function(){const e=await(0,r.Do)(this.configElementType);if(e&&e.getConfigElement)return e.getConfigElement()}},{kind:"method",key:"getConfigForm",value:async function(){const e=await(0,r.Do)(this.configElementType);if(e&&e.getConfigForm)return e.getConfigForm()}},{kind:"method",key:"_configChanged",value:function(e){e.stopPropagation(),this.value=e.detail.value}},{kind:"get",key:"_showLayoutTab",value:function(){return!!this.sectionConfig&&(void 0===this.sectionConfig.type||"grid"===this.sectionConfig.type)}},{kind:"method",key:"renderConfigElement",value:function(){const e=["config"];if(this.showVisibilityTab&&e.push("visibility"),this._showLayoutTab&&e.push("layout"),1===e.length)return(0,n.Z)(i,"renderConfigElement",this,3)([]);let t=a.Ld;switch(this._currTab){case"config":t=(0,a.dy)(c||(c=g`${0}`),(0,n.Z)(i,"renderConfigElement",this,3)([]));break;case"visibility":t=(0,a.dy)(h||(h=g` <hui-card-visibility-editor .hass="${0}" .config="${0}" @value-changed="${0}"></hui-card-visibility-editor> `),this.hass,this.value,this._configChanged);break;case"layout":t=(0,a.dy)(u||(u=g` <hui-card-layout-editor .hass="${0}" .config="${0}" .sectionConfig="${0}" @value-changed="${0}"> </hui-card-layout-editor> `),this.hass,this.value,this.sectionConfig,this._configChanged)}return(0,a.dy)(p||(p=g` <mwc-tab-bar .activeIndex="${0}" @MDCTabBar:activated="${0}"> ${0} </mwc-tab-bar> ${0} `),f.indexOf(this._currTab),this._handleTabChanged,e.map((e=>(0,a.dy)(v||(v=g` <mwc-tab .label="${0}"> </mwc-tab> `),this.hass.localize(`ui.panel.lovelace.editor.edit_card.tab_${e}`)))),t)}},{kind:"method",key:"_handleTabChanged",value:function(e){const t=f[e.detail.index];t!==this._currTab&&(this._currTab=t)}},{kind:"field",static:!0,key:"styles",value(){return[(0,a.iv)(m||(m=g`mwc-tab-bar{text-transform:uppercase;margin-bottom:16px;border-bottom:1px solid var(--divider-color)}`))]}}]}}),l.k);t()}catch(c){t(c)}}))},78999:function(e,t,i){var o=i(61701),n=i(72621),a=(i(71695),i(19423),i(40251),i(47021),i(57243)),s=i(50778),r=i(69634),l=i(27486),d=i(36522),c=i(88128),h=i(49976),u=(i(59826),i(34273),i(9359),i(70104),i(11740),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(54380)),p=i(35359);let v,m,g,f,y,k=e=>e;const _=new Set(["ArrowRight","ArrowUp","ArrowLeft","ArrowDown","PageUp","PageDown","Home","End"]);(0,o.Z)([(0,s.Mo)("ha-grid-layout-slider")],(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,reflect:!0})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,reflect:!0})],key:"vertical",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({attribute:"touch-action"})],key:"touchAction",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:"tooltip-mode"})],key:"tooltipMode",value(){return"interaction"}},{kind:"field",decorators:[(0,s.Cb)({type:Number})],key:"value",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Number})],key:"step",value(){return 1}},{kind:"field",decorators:[(0,s.Cb)({type:Number})],key:"min",value(){return 1}},{kind:"field",decorators:[(0,s.Cb)({type:Number})],key:"max",value(){return 4}},{kind:"field",decorators:[(0,s.Cb)({type:Number})],key:"range",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"pressed",value(){return!1}},{kind:"field",decorators:[(0,s.SB)()],key:"tooltipVisible",value(){return!1}},{kind:"field",key:"_mc",value:void 0},{kind:"get",key:"_range",value:function(){var e;return null!==(e=this.range)&&void 0!==e?e:this.max}},{kind:"method",key:"_valueToPercentage",value:function(e){return this._boundedValue(e)/this._range}},{kind:"method",key:"_percentageToValue",value:function(e){return this._range*e}},{kind:"method",key:"_steppedValue",value:function(e){return Math.round(e/this.step)*this.step}},{kind:"method",key:"_boundedValue",value:function(e){return Math.min(Math.max(e,this.min),this.max)}},{kind:"method",key:"firstUpdated",value:function(e){(0,n.Z)(i,"firstUpdated",this,3)([e]),this.setupListeners(),this.setAttribute("role","slider"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0")}},{kind:"method",key:"updated",value:function(e){if((0,n.Z)(i,"updated",this,3)([e]),e.has("value")){var t;const e=this._steppedValue(null!==(t=this.value)&&void 0!==t?t:0);this.setAttribute("aria-valuenow",e.toString()),this.setAttribute("aria-valuetext",e.toString())}if(e.has("min")&&this.setAttribute("aria-valuemin",this.min.toString()),e.has("max")&&this.setAttribute("aria-valuemax",this.max.toString()),e.has("vertical")){const e=this.vertical?"vertical":"horizontal";this.setAttribute("aria-orientation",e)}}},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(i,"connectedCallback",this,3)([]),this.setupListeners()}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(i,"disconnectedCallback",this,3)([]),this.destroyListeners()}},{kind:"field",decorators:[(0,s.IO)("#slider")],key:"slider",value:void 0},{kind:"method",key:"setupListeners",value:function(){if(this.slider&&!this._mc){var e;let t;this._mc=new u.dK(this.slider,{touchAction:null!==(e=this.touchAction)&&void 0!==e?e:this.vertical?"pan-x":"pan-y"}),this._mc.add(new u.Ce({threshold:10,direction:u.oM,enable:!0})),this._mc.add(new u.Uw({event:"singletap"})),this._mc.on("panstart",(()=>{this.disabled||(this.pressed=!0,this._showTooltip(),t=this.value)})),this._mc.on("pancancel",(()=>{this.disabled||(this.pressed=!1,this._hideTooltip(),this.value=t)})),this._mc.on("panmove",(e=>{if(this.disabled)return;const t=this._getPercentageFromEvent(e);this.value=this._percentageToValue(t);const i=this._steppedValue(this._boundedValue(this.value));(0,d.B)(this,"slider-moved",{value:i})})),this._mc.on("panend",(e=>{if(this.disabled)return;this.pressed=!1,this._hideTooltip();const t=this._getPercentageFromEvent(e),i=this._percentageToValue(t);this.value=this._steppedValue(this._boundedValue(i)),(0,d.B)(this,"slider-moved",{value:void 0}),(0,d.B)(this,"value-changed",{value:this.value})})),this._mc.on("singletap",(e=>{if(this.disabled)return;const t=this._getPercentageFromEvent(e),i=this._percentageToValue(t);this.value=this._steppedValue(this._boundedValue(i)),(0,d.B)(this,"value-changed",{value:this.value})})),this.addEventListener("keydown",this._handleKeyDown),this.addEventListener("keyup",this._handleKeyUp)}}},{kind:"method",key:"destroyListeners",value:function(){this._mc&&(this._mc.destroy(),this._mc=void 0),this.removeEventListener("keydown",this._handleKeyDown),this.removeEventListener("keyup",this._handleKeyUp)}},{kind:"get",key:"_tenPercentStep",value:function(){return Math.max(this.step,(this.max-this.min)/10)}},{kind:"method",key:"_handleKeyDown",value:function(e){var t,i,o,n;if(_.has(e.code)){switch(e.preventDefault(),e.code){case"ArrowRight":case"ArrowUp":this.value=this._boundedValue((null!==(t=this.value)&&void 0!==t?t:0)+this.step);break;case"ArrowLeft":case"ArrowDown":this.value=this._boundedValue((null!==(i=this.value)&&void 0!==i?i:0)-this.step);break;case"PageUp":this.value=this._steppedValue(this._boundedValue((null!==(o=this.value)&&void 0!==o?o:0)+this._tenPercentStep));break;case"PageDown":this.value=this._steppedValue(this._boundedValue((null!==(n=this.value)&&void 0!==n?n:0)-this._tenPercentStep));break;case"Home":this.value=this.min;break;case"End":this.value=this.max}(0,d.B)(this,"slider-moved",{value:this.value})}}},{kind:"method",key:"_handleKeyUp",value:function(e){_.has(e.code)&&(e.preventDefault(),(0,d.B)(this,"value-changed",{value:this.value}))}},{kind:"field",key:"_tooltipTimeout",value:void 0},{kind:"method",key:"_showTooltip",value:function(){null!=this._tooltipTimeout&&window.clearTimeout(this._tooltipTimeout),this.tooltipVisible=!0}},{kind:"method",key:"_hideTooltip",value:function(e){e?this._tooltipTimeout=window.setTimeout((()=>{this.tooltipVisible=!1}),e):this.tooltipVisible=!1}},{kind:"field",key:"_getPercentageFromEvent",value(){return e=>{if(this.vertical){const t=e.center.y,i=e.target.getBoundingClientRect().top,o=e.target.clientHeight;return Math.max(Math.min(1,(t-i)/o),0)}const t=e.center.x,i=e.target.getBoundingClientRect().left,o=e.target.clientWidth;return Math.max(Math.min(1,(t-i)/o),0)}}},{kind:"method",key:"_renderTooltip",value:function(){var e;if("never"===this.tooltipMode)return a.Ld;const t=this.vertical?"left":"top",i="always"===this.tooltipMode||this.tooltipVisible&&"interaction"===this.tooltipMode,o=this._boundedValue(this._steppedValue(null!==(e=this.value)&&void 0!==e?e:0));return(0,a.dy)(v||(v=k` <span aria-hidden="true" class="tooltip ${0}"> ${0} </span> `),(0,p.$)({visible:i,[t]:!0}),o)}},{kind:"method",key:"render",value:function(){var e;return(0,a.dy)(m||(m=k` <div class="container${0}" style="${0}"> <div id="slider" class="slider"> <div class="track"> <div class="background"></div> <div class="active" style="${0}"></div> </div> ${0} ${0} ${0} </div> </div> `),(0,p.$)({pressed:this.pressed}),(0,r.V)({"--value":`${this._valueToPercentage(null!==(e=this.value)&&void 0!==e?e:0)}`}),(0,r.V)({"--min":""+this.min/this._range,"--max":""+(1-this.max/this._range)}),Array(this._range/this.step).fill(0).map(((e,t)=>{const i=t/(this._range/this.step);return this.min>=t*this.step||t*this.step>this.max?a.Ld:(0,a.dy)(g||(g=k` <div class="dot" style="${0}"></div> `),(0,r.V)({"--value":`${i}`}))})),void 0!==this.value?(0,a.dy)(f||(f=k`<div class="handle"></div>`)):a.Ld,this._renderTooltip())}},{kind:"field",static:!0,key:"styles",value(){return(0,a.iv)(y||(y=k`:host{display:block;--grid-layout-slider:36px;height:var(--grid-layout-slider);width:100%;outline:0;transition:box-shadow 180ms ease-in-out}:host(:focus-visible){box-shadow:0 0 0 2px var(--primary-color)}:host([vertical]){width:var(--grid-layout-slider);height:100%}.container{position:relative;height:100%;width:100%}.slider{position:relative;height:100%;width:100%;transform:translateZ(0);overflow:visible;cursor:pointer}.slider *{pointer-events:none;user-select:none}.track{position:absolute;inset:0;margin:auto;height:16px;width:100%;border-radius:8px;overflow:hidden}:host([vertical]) .track{width:16px;height:100%}.background{position:absolute;inset:0;background:var(--disabled-color);opacity:.4}.active{position:absolute;background:var(--primary-color);top:0;right:calc(var(--max) * 100%);bottom:0;left:calc(var(--min) * 100%)}:host([vertical]) .active{top:calc(var(--min) * 100%);right:0;bottom:calc(var(--max) * 100%);left:0}.handle{position:absolute;top:0;height:100%;width:16px;transform:translate(-50%,0);background:var(--card-background-color);left:calc(var(--value,0%) * 100%);transition:left 180ms ease-in-out,top 180ms ease-in-out}:host([vertical]) .handle{transform:translate(0,-50%);left:0;top:calc(var(--value,0%) * 100%);height:16px;width:100%}.dot{position:absolute;top:0;bottom:0;opacity:.6;margin:auto;width:4px;height:4px;flex-shrink:0;transform:translate(-50%,0);background:var(--card-background-color);left:calc(var(--value,0%) * 100%);border-radius:2px}:host([vertical]) .dot{transform:translate(0,-50%);left:0;right:0;bottom:inherit;top:calc(var(--value,0%) * 100%)}.handle::after{position:absolute;inset:0;width:4px;border-radius:2px;height:100%;margin:auto;background:var(--primary-color);content:""}:host([vertical]) .handle::after{height:4px;width:100%}:host(:disabled) .slider{cursor:not-allowed}:host(:disabled) .handle:after{background:var(--disabled-color)}:host(:disabled) .active{background:var(--disabled-color)}.tooltip{position:absolute;background-color:var(--clear-background-color);color:var(--primary-text-color);font-size:var(--control-slider-tooltip-font-size);border-radius:.8em;padding:.2em .4em;opacity:0;white-space:nowrap;box-shadow:0 2px 5px rgba(0,0,0,.2);transition:opacity 180ms ease-in-out,left 180ms ease-in-out,bottom 180ms ease-in-out;--handle-spacing:calc(2 * var(--handle-margin) + var(--handle-size));--slider-tooltip-margin:0px;--slider-tooltip-range:100%;--slider-tooltip-offset:0px;--slider-tooltip-position:calc(
min(
max(
var(--value) * var(--slider-tooltip-range) +
var(--slider-tooltip-offset),
0%
),
100%
)
)}.tooltip.start{--slider-tooltip-offset:calc(-0.5 * (var(--handle-spacing)))}.tooltip.end{--slider-tooltip-offset:calc(0.5 * (var(--handle-spacing)))}.tooltip.cursor{--slider-tooltip-range:calc(100% - var(--handle-spacing));--slider-tooltip-offset:calc(0.5 * (var(--handle-spacing)))}.tooltip.show-handle{--slider-tooltip-range:calc(100% - var(--handle-spacing));--slider-tooltip-offset:calc(0.5 * (var(--handle-spacing)))}.tooltip.visible{opacity:1}.tooltip.top{transform:translate3d(-50%,-100%,0);top:var(--slider-tooltip-margin);left:50%}.tooltip.bottom{transform:translate3d(-50%,100%,0);bottom:var(--slider-tooltip-margin);left:50%}.tooltip.left{transform:translate3d(-100%,-50%,0);top:50%;left:var(--slider-tooltip-margin)}.tooltip.right{transform:translate3d(100%,-50%,0);top:50%;right:var(--slider-tooltip-margin)}:host(:not([vertical])) .tooltip.bottom,:host(:not([vertical])) .tooltip.top{left:var(--slider-tooltip-position)}:host([vertical]) .tooltip.left,:host([vertical]) .tooltip.right{top:var(--slider-tooltip-position)}.pressed .handle{transition:none}.pressed .tooltip{transition:opacity 180ms ease-in-out}`))}}]}}),a.oi);i(23334);var b=i(34593),w=i(14858);let x,C,E,$,M,O=e=>e;(0,o.Z)([(0,s.Mo)("ha-grid-size-picker")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"value",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"rows",value(){return 8}},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"columns",value(){return 12}},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"rowMin",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"rowMax",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"columnMin",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"columnMax",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"isDefault",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"step",value(){return 1}},{kind:"field",decorators:[(0,s.SB)()],key:"_localValue",value(){return{rows:1,columns:1}}},{kind:"method",key:"willUpdate",value:function(e){e.has("value")&&(this._localValue=this.value)}},{kind:"method",key:"render",value:function(){var e,t,i,o,n,s,l,d,c,h;const u=void 0!==this.columnMin&&this.columnMin===this.columnMax,p=void 0!==this.rowMin&&this.rowMin===this.rowMax,v="auto"===(null===(e=this._localValue)||void 0===e?void 0:e.rows),m="full"===(null===(t=this._localValue)||void 0===t?void 0:t.columns),g=null!==(i=this.rowMin)&&void 0!==i?i:1,f=null!==(o=this.rowMax)&&void 0!==o?o:this.rows,y=Math.ceil((null!==(n=this.columnMin)&&void 0!==n?n:1)/this.step)*this.step,k=Math.ceil((null!==(s=this.columnMax)&&void 0!==s?s:this.columns)/this.step)*this.step,_=v?g:null===(l=this._localValue)||void 0===l?void 0:l.rows,b=null===(d=this._localValue)||void 0===d?void 0:d.columns;return(0,a.dy)(x||(x=O` <div class="grid"> <ha-grid-layout-slider aria-label="${0}" id="columns" .min="${0}" .max="${0}" .range="${0}" .value="${0}" .step="${0}" @value-changed="${0}" @slider-moved="${0}" .disabled="${0}" tooltip-mode="always"></ha-grid-layout-slider> <ha-grid-layout-slider aria-label="${0}" id="rows" .min="${0}" .max="${0}" .range="${0}" vertical .value="${0}" @value-changed="${0}" @slider-moved="${0}" .disabled="${0}" tooltip-mode="always"></ha-grid-layout-slider> ${0} <div class="preview"> <table> ${0} </table> <div class="preview-card" style="${0}"></div> </div> </div> `),this.hass.localize("ui.components.grid-size-picker.columns"),y,k,this.columns,m?this.columns:null===(c=this.value)||void 0===c?void 0:c.columns,this.step,this._valueChanged,this._sliderMoved,u,this.hass.localize("ui.components.grid-size-picker.rows"),g,f,this.rows,v?g:null===(h=this.value)||void 0===h?void 0:h.rows,this._valueChanged,this._sliderMoved,p,this.isDefault?a.Ld:(0,a.dy)(C||(C=O` <ha-icon-button @click="${0}" class="reset" .path="${0}" label="${0}" title="${0}"> </ha-icon-button> `),this._reset,"M13,3A9,9 0 0,0 4,12H1L4.89,15.89L4.96,16.03L9,12H6A7,7 0 0,1 13,5A7,7 0 0,1 20,12A7,7 0 0,1 13,19C11.07,19 9.32,18.21 8.06,16.94L6.64,18.36C8.27,20 10.5,21 13,21A9,9 0 0,0 22,12A9,9 0 0,0 13,3Z",this.hass.localize("ui.components.grid-size-picker.reset_default"),this.hass.localize("ui.components.grid-size-picker.reset_default")),Array(this.rows).fill(0).map(((e,t)=>{const i=t+1;return(0,a.dy)(E||(E=O` <tr> ${0} </tr> `),Array(this.columns).fill(0).map(((e,t)=>{const o=t+1;return o%this.step!=0||this.columns>24&&o%3!=0?a.Ld:(0,a.dy)($||($=O` <td data-row="${0}" data-column="${0}" @click="${0}"></td> `),i,o,this._cellClick)})))})),(0,r.V)({"--rows":_,"--columns":m?this.columns:b,"--total-columns":this.columns}))}},{kind:"method",key:"_cellClick",value:function(e){var t;const i=e.currentTarget,o=Number(i.getAttribute("data-row")),n=Number(i.getAttribute("data-column")),a=(0,b.Y)(o,this.rowMin,this.rowMax);let s=(0,b.Y)(n,this.columnMin,this.columnMax);"full"===(null!==(t=this.value)&&void 0!==t?t:w.D9).columns&&s===this.columns&&(s="full"),(0,d.B)(this,"value-changed",{value:{rows:a,columns:s}})}},{kind:"method",key:"_valueChanged",value:function(e){var t;e.stopPropagation();const i=e.currentTarget.id,o=null!==(t=this.value)&&void 0!==t?t:w.D9;let n=e.detail.value;"columns"===i&&"full"===o.columns&&n===this.columns&&(n="full");const a=Object.assign(Object.assign({},o),{},{[i]:n});(0,d.B)(this,"value-changed",{value:a})}},{kind:"method",key:"_reset",value:function(e){e.stopPropagation(),(0,d.B)(this,"value-changed",{value:{rows:void 0,columns:void 0}})}},{kind:"method",key:"_sliderMoved",value:function(e){var t;e.stopPropagation();const i=e.currentTarget.id,o=null!==(t=this.value)&&void 0!==t?t:w.D9;void 0!==e.detail.value&&(this._localValue=Object.assign(Object.assign({},o),{},{[i]:e.detail.value}))}},{kind:"field",static:!0,key:"styles",value(){return[(0,a.iv)(M||(M=O`.grid{display:grid;grid-template-areas:"reset column-slider" "row-slider preview";grid-template-rows:auto auto;grid-template-columns:auto 1fr;gap:8px}#columns{grid-area:column-slider}#rows{grid-area:row-slider}.reset{grid-area:reset;--mdc-icon-button-size:36px}.preview{position:relative;grid-area:preview}.preview table,.preview td,.preview tr{border:2px dotted var(--divider-color);border-collapse:collapse}.preview table{width:100%}.preview tr{height:30px}.preview td{cursor:pointer}.preview-card{position:absolute;top:0;left:0;background-color:var(--primary-color);opacity:.3;border-radius:8px;height:calc(var(--rows,1) * 30px);width:calc(var(--columns,1) * 100% / var(--total-columns,12));pointer-events:none;transition:width ease-in-out 180ms,height ease-in-out 180ms}`))]}}]}}),a.oi);i(7285),i(30509),i(74421),i(37583),i(1888),i(64889);var S=i(28008);let T,V,z,P,A=e=>e;(0,o.Z)([(0,s.Mo)("hui-card-layout-editor")],(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:"config",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"sectionConfig",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_defaultGridOptions",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_yamlMode",value(){return!1}},{kind:"field",decorators:[(0,s.SB)()],key:"_uiAvailable",value(){return!0}},{kind:"field",decorators:[(0,s.SB)()],key:"_preciseMode",value(){return!1}},{kind:"field",key:"_cardElement",value:void 0},{kind:"field",key:"_mergedOptions",value(){return(0,l.Z)(((e,t)=>Object.assign(Object.assign({},t),e)))}},{kind:"field",key:"_computeCardGridSize",value(){return(0,l.Z)(w.DM)}},{kind:"field",key:"_isDefault",value(){return(0,l.Z)((e=>void 0===(null==e?void 0:e.columns)&&void 0===(null==e?void 0:e.rows)))}},{kind:"field",key:"_configGridOptions",value(){return e=>e.grid_options?e.grid_options:e.layout_options?(0,w.v)(e.layout_options):{}}},{kind:"method",key:"render",value:function(){var e,t;const i=this._configGridOptions(this.config),o=this._mergedOptions(i,this._defaultGridOptions),n=o,s=this._computeCardGridSize(n),l=12*(null!==(e=this.sectionConfig.column_span)&&void 0!==e?e:1);return(0,a.dy)(T||(T=A` <div class="header"> <p class="intro"> ${0} </p> <ha-button-menu slot="icons" @action="${0}" @click="${0}" @closed="${0}" fixed .corner="${0}" menu-corner="END"> <ha-icon-button slot="trigger" .label="${0}" .path="${0}"> </ha-icon-button> <ha-list-item graphic="icon" .disabled="${0}"> ${0} <ha-svg-icon slot="graphic" .path="${0}"></ha-svg-icon> </ha-list-item> </ha-button-menu> </div> ${0} `),this.hass.localize("ui.panel.lovelace.editor.edit_card.layout.explanation"),this._handleAction,c.P,h.U,"BOTTOM_END",this.hass.localize("ui.common.menu"),"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",!this._uiAvailable,this.hass.localize("ui.panel.lovelace.editor.edit_view.edit_"+(this._yamlMode?"ui":"yaml")),"M3 6V8H14V6H3M3 10V12H14V10H3M20 10.1C19.9 10.1 19.7 10.2 19.6 10.3L18.6 11.3L20.7 13.4L21.7 12.4C21.9 12.2 21.9 11.8 21.7 11.6L20.4 10.3C20.3 10.2 20.2 10.1 20 10.1M18.1 11.9L12 17.9V20H14.1L20.2 13.9L18.1 11.9M3 14V16H10V14H3Z",this._yamlMode?(0,a.dy)(V||(V=A` <ha-yaml-editor .hass="${0}" .defaultValue="${0}" @value-changed="${0}"></ha-yaml-editor> `),this.hass,i,this._yamlChanged):(0,a.dy)(z||(z=A` <ha-grid-size-picker style="${0}" .columns="${0}" .hass="${0}" .value="${0}" .isDefault="${0}" @value-changed="${0}" .rowMin="${0}" .rowMax="${0}" .columnMin="${0}" .columnMax="${0}" .step="${0}"></ha-grid-size-picker> <ha-settings-row> <span slot="heading" data-for="full-width"> ${0} </span> <span slot="description" data-for="full-width"> ${0} </span> <ha-switch @change="${0}" .checked="${0}" name="full-width"> </ha-switch> </ha-settings-row> <ha-settings-row> <span slot="heading" data-for="precise-mode"> ${0} </span> <span slot="description" data-for="precise-mode"> ${0} </span> <ha-switch @change="${0}" .checked="${0}" name="precise-mode"> </ha-switch> </ha-settings-row> `),(0,r.V)({"max-width":250*(null!==(t=this.sectionConfig.column_span)&&void 0!==t?t:1)+40+"px"}),l,this.hass,s,this._isDefault(i),this._gridSizeChanged,n.min_rows,n.max_rows,n.min_columns,n.max_columns,this._preciseMode?1:w.sy,this.hass.localize("ui.panel.lovelace.editor.edit_card.layout.full_width"),this.hass.localize("ui.panel.lovelace.editor.edit_card.layout.full_width_helper"),this._fullWidthChanged,"full"===o.columns,this.hass.localize("ui.panel.lovelace.editor.edit_card.layout.precise_mode"),this.hass.localize("ui.panel.lovelace.editor.edit_card.layout.precise_mode_helper"),this._preciseModeChanged,this._preciseMode))}},{kind:"method",key:"firstUpdated",value:function(e){(0,n.Z)(i,"firstUpdated",this,3)([e]);try{this._cardElement=document.createElement("hui-card"),this._cardElement.hass=this.hass,this._cardElement.preview=!0,this._cardElement.config=this.config,this._cardElement.addEventListener("card-updated",(e=>{e.stopPropagation(),this._updateDefaultGridOptions()})),this._cardElement.load(),this._updateDefaultGridOptions()}catch(t){console.error(t)}}},{kind:"method",key:"_updateDefaultGridOptions",value:function(){this._cardElement?this._defaultGridOptions=this._cardElement.getElementGridOptions():this._defaultGridOptions=void 0}},{kind:"method",key:"updated",value:function(e){(0,n.Z)(i,"updated",this,3)([e]),this._cardElement&&(e.has("hass")&&(this._cardElement.hass=this.hass),e.has("config")&&(this._cardElement.config=this.config))}},{kind:"method",key:"willUpdate",value:function(e){if((0,n.Z)(i,"willUpdate",this,3)([e]),e.has("config")){const e=this.config.grid_options;if(!e)return void(this._preciseMode=!!this._defaultGridOptions&&(0,w.ui)(this._defaultGridOptions));const t=(0,w.ui)(e);!this._preciseMode&&t&&(this._preciseMode=t)}}},{kind:"method",key:"_handleAction",value:async function(e){if(0===e.detail.index)this._yamlMode=!this._yamlMode}},{kind:"method",key:"_gridSizeChanged",value:function(e){e.stopPropagation();const t=e.detail.value;this._updateGridOptions(Object.assign(Object.assign({},this.config.grid_options),{},{columns:t.columns,rows:t.rows}))}},{kind:"method",key:"_yamlChanged",value:function(e){e.stopPropagation();const t=e.detail.value;this._updateGridOptions(t)}},{kind:"method",key:"_fullWidthChanged",value:function(e){e.stopPropagation();const t=e.target.checked;this._updateGridOptions(Object.assign(Object.assign({},this.config.grid_options),{},{columns:t?"full":void 0}))}},{kind:"method",key:"_preciseModeChanged",value:function(e){var t;if(e.stopPropagation(),this._preciseMode=e.target.checked,this._preciseMode)return;const i=null===(t=this.config.grid_options)||void 0===t?void 0:t.columns;if("number"==typeof i&&i%w.sy!=0){const e=Math.ceil(i/w.sy)*w.sy;this._updateGridOptions(Object.assign(Object.assign({},this.config.grid_options),{},{columns:e}))}}},{kind:"method",key:"_updateGridOptions",value:function(e){const t=Object.assign(Object.assign({},this.config),{},{grid_options:Object.assign({},e)});if(t.grid_options){for(const[e,i]of Object.entries(t.grid_options))void 0===i&&delete t.grid_options[e];0===Object.keys(t.grid_options).length&&delete t.grid_options}t.layout_options&&delete t.layout_options,(0,d.B)(this,"value-changed",{value:t})}},{kind:"field",static:!0,key:"styles",value(){return[S.Qx,(0,a.iv)(P||(P=A`.header{display:flex;flex-direction:row;align-items:flex-start}.header .intro{flex:1;margin:0;color:var(--secondary-text-color)}.header ha-button-menu{--mdc-theme-text-primary-on-background:var(--primary-text-color);margin-top:-8px}.disabled{opacity:.5;pointer-events:none}ha-grid-size-picker{display:block;margin:16px auto;direction:ltr}ha-yaml-editor{display:block;margin:16px 0}`))]}}]}}),a.oi)},52043:function(e,t,i){var o=i(61701),n=(i(71695),i(19423),i(47021),i(57243)),a=i(50778),s=i(36522);i(99426),i(32145);let r,l,d=e=>e;(0,o.Z)([(0,a.Mo)("hui-card-visibility-editor")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"config",value:void 0},{kind:"method",key:"render",value:function(){var e;const t=null!==(e=this.config.visibility)&&void 0!==e?e:[];return(0,n.dy)(r||(r=d` <p class="intro"> ${0} </p> <ha-card-conditions-editor .hass="${0}" .conditions="${0}" @value-changed="${0}"> </ha-card-conditions-editor> `),this.hass.localize("ui.panel.lovelace.editor.edit_card.visibility.explanation"),this.hass,t,this._valueChanged)}},{kind:"method",key:"_valueChanged",value:function(e){var t;e.stopPropagation();const i=e.detail.value,o=Object.assign(Object.assign({},this.config),{},{visibility:i});0===(null===(t=o.visibility)||void 0===t?void 0:t.length)&&delete o.visibility,(0,s.B)(this,"value-changed",{value:o})}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(l||(l=d`.intro{margin:0;color:var(--secondary-text-color);margin-bottom:8px}`))}}]}}),n.oi)},32012:function(e,t,i){i.d(t,{e:()=>o});i(52247);class o extends Error{constructor(e,t,i){super(e),this.warnings=void 0,this.errors=void 0,this.name="GUISupportError",this.warnings=t,this.errors=i}}},43299:function(e,t,i){i.a(e,(async function(e,o){try{i.d(t,{O:()=>S});var n=i(61701),a=i(72621),s=(i(71695),i(9359),i(31526),i(70104),i(19423),i(40251),i(47021),i(57243)),r=i(50778),l=i(67064),d=i(36522),c=i(22381),h=i(41680),u=i(48045),p=(i(99426),i(17170)),v=(i(64889),i(32012)),m=e([p]);p=(m.then?(await m)():m)[0];let g,f,y,k,_,b,w,x,C,E,$,M,O=e=>e,S=(0,n.Z)(null,(function(e,t){class o extends t{constructor(...t){super(...t),e(this)}}return{F:o,d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"lovelace",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"context",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_config",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_configElement",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_subElementEditorConfig",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_guiMode",value(){return!0}},{kind:"field",decorators:[(0,r.SB)()],key:"_errors",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_pendingYamlError",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_yamlError",value(){return!1}},{kind:"field",decorators:[(0,r.SB)()],key:"_warnings",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_guiSupported",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_loading",value(){return!1}},{kind:"field",decorators:[(0,r.IO)("ha-yaml-editor")],key:"_yamlEditor",value:void 0},{kind:"get",key:"value",value:function(){return this._config}},{kind:"set",key:"value",value:function(e){this._config&&(0,u.v)(e,this._config)||(this._config=e,this._errors=void 0,this._setConfig())}},{kind:"method",key:"_setConfig",value:function(){if(!this._errors)try{this._updateConfigElement()}catch(e){this._errors=[e.message]}this.updateComplete.then((()=>{var e;(0,d.B)(this,"config-changed",{config:this.value,error:null===(e=this._errors)||void 0===e?void 0:e.join(", "),guiModeAvailable:!(this.hasWarning||this.hasError||!1===this._guiSupported)})}))}},{kind:"get",key:"hasWarning",value:function(){return void 0!==this._warnings&&this._warnings.length>0}},{kind:"get",key:"hasError",value:function(){return void 0!==this._errors&&this._errors.length>0}},{kind:"get",key:"GUImode",value:function(){return this._guiMode}},{kind:"set",key:"GUImode",value:function(e){this._guiMode=e,this.updateComplete.then((()=>{(0,d.B)(this,"GUImode-changed",{guiMode:e,guiModeAvailable:!(this.hasWarning||this.hasError||!1===this._guiSupported)})}))}},{kind:"method",key:"toggleMode",value:function(){this.GUImode=!this.GUImode}},{kind:"method",key:"focusYamlEditor",value:function(){var e;null!==(e=this._configElement)&&void 0!==e&&e.focusYamlEditor&&this._configElement.focusYamlEditor(),this._yamlEditor&&this._yamlEditor.focus()}},{kind:"method",key:"getConfigElement",value:async function(){}},{kind:"method",key:"getConfigForm",value:async function(){}},{kind:"method",key:"renderConfigElement",value:function(){return(0,s.dy)(g||(g=O`${0}`),this._configElement)}},{kind:"method",key:"_renderSubElement",value:function(){return(0,s.dy)(f||(f=O` <hui-sub-element-editor .hass="${0}" .config="${0}" @go-back="${0}" @config-changed="${0}"> </hui-sub-element-editor> `),this.hass,this._subElementEditorConfig,this._goBack,this._subElementChanged)}},{kind:"method",key:"_subElementChanged",value:function(e){var t,i;e.stopPropagation();const o=e.detail.config;this._subElementEditorConfig=Object.assign(Object.assign({},this._subElementEditorConfig),{},{elementConfig:o}),null===(t=(i=this._subElementEditorConfig).saveElementConfig)||void 0===t||t.call(i,o)}},{kind:"method",key:"_goBack",value:function(e){e.stopPropagation(),this._subElementEditorConfig=void 0}},{kind:"method",key:"_editSubElement",value:async function(e){e.stopPropagation(),await Promise.all([i.e("91552"),i.e("78456"),i.e("56898"),i.e("35671"),i.e("92139"),i.e("32146"),i.e("47399"),i.e("51717"),i.e("18865"),i.e("44959"),i.e("79931"),i.e("44251"),i.e("65005"),i.e("60487"),i.e("3371"),i.e("38326"),i.e("10745"),i.e("80809"),i.e("92368"),i.e("37457"),i.e("95444"),i.e("29477"),i.e("8136")]).then(i.bind(i,50357)),this._subElementEditorConfig={type:e.detail.type,elementConfig:e.detail.config,context:e.detail.context,saveElementConfig:e.detail.saveConfig}}},{kind:"method",key:"render",value:function(){return(0,s.dy)(y||(y=O` <div class="wrapper"> ${0} ${0} ${0} ${0} </div> `),this.GUImode?(0,s.dy)(k||(k=O` <div class="gui-editor" @edit-sub-element="${0}"> ${0} </div> `),this._editSubElement,this._loading?(0,s.dy)(_||(_=O` <ha-spinner class="center margin-bot"></ha-spinner> `)):(0,l.F)(this._subElementEditorConfig?this._renderSubElement():this.renderConfigElement())):(0,s.dy)(b||(b=O` <div class="yaml-editor"> <ha-yaml-editor .defaultValue="${0}" autofocus .hass="${0}" @value-changed="${0}" @blur="${0}" @keydown="${0}" dir="ltr"></ha-yaml-editor> </div> `),this._config,this.hass,this._handleYAMLChanged,this._onBlurYaml,this._ignoreKeydown),!1===this._guiSupported&&!1===this._loading?(0,s.dy)(w||(w=O` <ha-alert alert-type="info" .title="${0}"> ${0} <br> ${0} </ha-alert> `),this.hass.localize("ui.errors.config.visual_editor_not_supported"),this.hass.localize("ui.errors.config.visual_editor_not_supported_reason_type"),this.hass.localize("ui.errors.config.edit_in_yaml_supported")):s.Ld,this.hasError?(0,s.dy)(x||(x=O` <ha-alert alert-type="error" .title="${0}"> <ul> ${0} </ul> </ha-alert> `),this.hass.localize("ui.errors.config.configuration_error"),this._errors.map((e=>(0,s.dy)(C||(C=O`<li>${0}</li>`),e)))):s.Ld,this.hasWarning?(0,s.dy)(E||(E=O` <ha-alert alert-type="warning" .title="${0}"> <ul> ${0} </ul> ${0} </ha-alert> `),this.hass.localize("ui.errors.config.visual_editor_not_supported"),this._warnings.map((e=>(0,s.dy)($||($=O`<li>${0}</li>`),e))),this.hass.localize("ui.errors.config.edit_in_yaml_supported")):s.Ld)}},{kind:"method",key:"updated",value:function(e){(0,a.Z)(o,"updated",this,3)([e]),this._configElement&&e.has("hass")&&(this._configElement.hass=this.hass),this._configElement&&"lovelace"in this._configElement&&e.has("lovelace")&&(this._configElement.lovelace=this.lovelace),this._configElement&&e.has("context")&&(this._configElement.context=this.context)}},{kind:"method",key:"_handleUIConfigChanged",value:function(e){if(e.stopPropagation(),!this.GUImode)return;const t=e.detail.config;Object.keys(t).forEach((e=>{void 0===t[e]&&delete t[e]})),this.value=t}},{kind:"method",key:"_handleYAMLChanged",value:function(e){e.stopPropagation();const t=e.detail.value;e.detail.isValid?(this._config=t,this._errors=void 0,this._pendingYamlError=void 0,this._yamlError=!1,this._debounceYamlError.cancel(),this._setConfig()):this._yamlError?this._errors=[e.detail.errorMsg]:(this._pendingYamlError=e.detail.errorMsg,this._debounceYamlError())}},{kind:"field",key:"_debounceYamlError",value(){return(0,c.D)((()=>{this._pendingYamlError&&(this._yamlError=!0,this._errors=[this._pendingYamlError],this._pendingYamlError=void 0,this._setConfig())}),2e3)}},{kind:"method",key:"_onBlurYaml",value:function(){this._debounceYamlError.cancel(),this._pendingYamlError&&(this._yamlError=!0,this._errors=[this._pendingYamlError],this._pendingYamlError=void 0,this._setConfig())}},{kind:"method",key:"unloadConfigElement",value:async function(){this._configElement=void 0,this._guiSupported=void 0}},{kind:"method",key:"loadConfigElement",value:async function(){if(this._configElement)return;let e=await this.getConfigElement();if(!e){const t=await this.getConfigForm();if(t){await i.e("10106").then(i.bind(i,66374)),e=document.createElement("hui-form-editor");const{schema:o,assertConfig:n,computeLabel:a,computeHelper:s}=t;e.schema=o,a&&(e.computeLabel=a),s&&(e.computeHelper=s),n&&(e.assertConfig=n)}}e?(e.hass=this.hass,"lovelace"in e&&(e.lovelace=this.lovelace),e.context=this.context,e.addEventListener("config-changed",(e=>this._handleUIConfigChanged(e))),this._guiSupported=!0):this._guiSupported=!1,this._configElement=e}},{kind:"method",key:"_updateConfigElement",value:async function(){if(this.value)try{if(this._errors=void 0,this._warnings=void 0,await this.loadConfigElement(),this._configElement)try{this._configElement.setConfig(this.value)}catch(t){const e=(0,h.p)(this.hass,t);throw new v.e("Config is not supported",e.warnings,e.errors)}else this._guiSupported=!1,this.GUImode=!1}catch(t){var e;if(t instanceof v.e)this._warnings=null!==(e=t.warnings)&&void 0!==e?e:[t.message],this._errors=t.errors||void 0;else this._errors=[t.message];this.GUImode=!1}finally{this._loading=!1}}},{kind:"method",key:"_ignoreKeydown",value:function(e){e.stopPropagation()}},{kind:"field",static:!0,key:"styles",value(){return(0,s.iv)(M||(M=O`:host{display:flex}.wrapper{width:100%}.gui-editor,.yaml-editor{padding:8px 0px}ha-code-editor{--code-mirror-max-height:calc(100vh - 245px)}ha-spinner{display:block;margin:auto}`))}}]}}),s.oi);o()}catch(g){o(g)}}))},6973:function(e,t,i){i.a(e,(async function(e,o){try{i.d(t,{k:()=>d});var n=i(61701),a=i(72621),s=(i(52247),i(71695),i(40251),i(47021),i(50778)),r=i(43299),l=e([r]);r=(l.then?(await l)():l)[0];let d=(0,n.Z)(null,(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,s.SB)()],key:"_configElementType",value:void 0},{kind:"get",key:"configElementType",value:function(){return this.value?this.value.type:void 0}},{kind:"method",key:"loadConfigElement",value:async function(){if(this._configElementType!==this.configElementType){if(this.unloadConfigElement(),!this.configElementType)throw new Error(this.hass.localize("ui.errors.config.no_type_provided"));this._configElementType=this.configElementType}return(0,a.Z)(i,"loadConfigElement",this,3)([])}}]}}),r.O);o()}catch(d){o(d)}}))},48734:function(e,t,i){i.a(e,(async function(e,o){try{i.d(t,{P5:()=>p,Ve:()=>m});var n=i(16485),a=(i(71695),i(9359),i(70104),i(19423),i(19134),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(97003),i(47021),e([n]));n=(a.then?(await a)():a)[0];const r=new Set,l=new Map;let d,c="ltr",h="en";const u="undefined"!=typeof MutationObserver&&"undefined"!=typeof document&&void 0!==document.documentElement;if(u){const g=new MutationObserver(v);c=document.documentElement.dir||"ltr",h=document.documentElement.lang||navigator.language,g.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]})}function p(...e){e.map((e=>{const t=e.$code.toLowerCase();l.has(t)?l.set(t,Object.assign(Object.assign({},l.get(t)),e)):l.set(t,e),d||(d=e)})),v()}function v(){u&&(c=document.documentElement.dir||"ltr",h=document.documentElement.lang||navigator.language),[...r.keys()].map((e=>{"function"==typeof e.requestUpdate&&e.requestUpdate()}))}class m{constructor(e){this.host=e,this.host.addController(this)}hostConnected(){r.add(this.host)}hostDisconnected(){r.delete(this.host)}dir(){return`${this.host.dir||c}`.toLowerCase()}lang(){return`${this.host.lang||h}`.toLowerCase()}getTranslationData(e){var t,i;const o=new Intl.Locale(e.replace(/_/g,"-")),n=null==o?void 0:o.language.toLowerCase(),a=null!==(i=null===(t=null==o?void 0:o.region)||void 0===t?void 0:t.toLowerCase())&&void 0!==i?i:"";return{locale:o,language:n,region:a,primary:l.get(`${n}-${a}`),secondary:l.get(n)}}exists(e,t){var i;const{primary:o,secondary:n}=this.getTranslationData(null!==(i=t.lang)&&void 0!==i?i:this.lang());return t=Object.assign({includeFallback:!1},t),!!(o&&o[e]||n&&n[e]||t.includeFallback&&d&&d[e])}term(e,...t){const{primary:i,secondary:o}=this.getTranslationData(this.lang());let n;if(i&&i[e])n=i[e];else if(o&&o[e])n=o[e];else{if(!d||!d[e])return console.error(`No translation found for: ${String(e)}`),String(e);n=d[e]}return"function"==typeof n?n(...t):n}date(e,t){return e=new Date(e),new Intl.DateTimeFormat(this.lang(),t).format(e)}number(e,t){return e=Number(e),isNaN(e)?"":new Intl.NumberFormat(this.lang(),t).format(e)}relativeTime(e,t,i){return new Intl.RelativeTimeFormat(this.lang(),i).format(e,t)}}o()}catch(s){o(s)}}))},68783:function(e,t,i){i.a(e,(async function(e,o){try{i.d(t,{A:()=>c});i(71695),i(47021);var n=i(64699),a=i(15073),s=i(81048),r=i(31027),l=i(57243),d=e([a]);a=(d.then?(await d)():d)[0];let h,u=e=>e;var c=class extends r.P{constructor(){super(...arguments),this.localize=new a.V(this)}render(){return(0,l.dy)(h||(h=u` <svg part="base" class="spinner" role="progressbar" aria-label="${0}"> <circle class="spinner__track"></circle> <circle class="spinner__indicator"></circle> </svg> `),this.localize.term("loading"))}};c.styles=[s.N,n.D],o()}catch(h){o(h)}}))},31027:function(e,t,i){i.d(t,{P:()=>r});i(71695),i(9359),i(31526),i(46692),i(47021);var o,n=i(52812),a=i(57243),s=i(50778),r=class extends a.oi{constructor(){super(),(0,n.Ko)(this,o,!1),this.initialReflectedProperties=new Map,Object.entries(this.constructor.dependencies).forEach((([e,t])=>{this.constructor.define(e,t)}))}emit(e,t){const i=new CustomEvent(e,(0,n.ih)({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(i),i}static define(e,t=this,i={}){const o=customElements.get(e);if(!o){try{customElements.define(e,t,i)}catch(s){customElements.define(e,class extends t{},i)}return}let n=" (unknown version)",a=n;"version"in t&&t.version&&(n=" v"+t.version),"version"in o&&o.version&&(a=" v"+o.version),n&&a&&n===a||console.warn(`Attempted to register <${e}>${n}, but <${e}>${a} has already been registered.`)}attributeChangedCallback(e,t,i){(0,n.ac)(this,o)||(this.constructor.elementProperties.forEach(((e,t)=>{e.reflect&&null!=this[t]&&this.initialReflectedProperties.set(t,this[t])})),(0,n.qx)(this,o,!0)),super.attributeChangedCallback(e,t,i)}willUpdate(e){super.willUpdate(e),this.initialReflectedProperties.forEach(((t,i)=>{e.has(i)&&null==this[i]&&(this[i]=t)}))}};o=new WeakMap,r.version="2.20.1",r.dependencies={},(0,n.u2)([(0,s.Cb)()],r.prototype,"dir",2),(0,n.u2)([(0,s.Cb)()],r.prototype,"lang",2)},15073:function(e,t,i){i.a(e,(async function(e,o){try{i.d(t,{V:()=>r});var n=i(21262),a=i(48734),s=e([a,n]);[a,n]=s.then?(await s)():s;var r=class extends a.Ve{};(0,a.P5)(n.K),o()}catch(l){o(l)}}))},21262:function(e,t,i){i.a(e,(async function(e,o){try{i.d(t,{K:()=>r});var n=i(48734),a=e([n]);n=(a.then?(await a)():a)[0];var s={$code:"en",$name:"English",$dir:"ltr",carousel:"Carousel",clearEntry:"Clear entry",close:"Close",copied:"Copied",copy:"Copy",currentValue:"Current value",error:"Error",goToSlide:(e,t)=>`Go to slide ${e} of ${t}`,hidePassword:"Hide password",loading:"Loading",nextSlide:"Next slide",numOptionsSelected:e=>0===e?"No options selected":1===e?"1 option selected":`${e} options selected`,previousSlide:"Previous slide",progress:"Progress",remove:"Remove",resize:"Resize",scrollToEnd:"Scroll to end",scrollToStart:"Scroll to start",selectAColorFromTheScreen:"Select a color from the screen",showPassword:"Show password",slideNum:e=>`Slide ${e}`,toggleColorFormat:"Toggle color format"};(0,n.P5)(s);var r=s;o()}catch(l){o(l)}}))},64699:function(e,t,i){i.d(t,{D:()=>n});let o;var n=(0,i(57243).iv)(o||(o=(e=>e)`:host{--track-width:2px;--track-color:rgb(128 128 128 / 25%);--indicator-color:var(--sl-color-primary-600);--speed:2s;display:inline-flex;width:1em;height:1em;flex:none}.spinner{flex:1 1 auto;height:100%;width:100%}.spinner__indicator,.spinner__track{fill:none;stroke-width:var(--track-width);r:calc(0.5em - var(--track-width)/ 2);cx:0.5em;cy:0.5em;transform-origin:50% 50%}.spinner__track{stroke:var(--track-color);transform-origin:0% 0%}.spinner__indicator{stroke:var(--indicator-color);stroke-linecap:round;stroke-dasharray:150% 75%;animation:spin var(--speed) linear infinite}@keyframes spin{0%{transform:rotate(0deg);stroke-dasharray:0.05em,3em}50%{transform:rotate(450deg);stroke-dasharray:1.375em,1.375em}100%{transform:rotate(1080deg);stroke-dasharray:0.05em,3em}}`))},52812:function(e,t,i){i.d(t,{EZ:()=>p,Ko:()=>f,ac:()=>g,ih:()=>u,qx:()=>y,u2:()=>v});i(63721),i(52247),i(71695),i(40251),i(47021);var o=Object.defineProperty,n=Object.defineProperties,a=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,c=e=>{throw TypeError(e)},h=(e,t,i)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,u=(e,t)=>{for(var i in t||(t={}))l.call(t,i)&&h(e,i,t[i]);if(r)for(var i of r(t))d.call(t,i)&&h(e,i,t[i]);return e},p=(e,t)=>n(e,s(t)),v=(e,t,i,n)=>{for(var s,r=n>1?void 0:n?a(t,i):t,l=e.length-1;l>=0;l--)(s=e[l])&&(r=(n?s(t,i,r):s(r))||r);return n&&r&&o(t,i,r),r},m=(e,t,i)=>t.has(e)||c("Cannot "+i),g=(e,t,i)=>(m(e,t,"read from private field"),i?i.call(e):t.get(e)),f=(e,t,i)=>t.has(e)?c("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),y=(e,t,i,o)=>(m(e,t,"write to private field"),o?o.call(e,i):t.set(e,i),i)},81048:function(e,t,i){i.d(t,{N:()=>n});let o;var n=(0,i(57243).iv)(o||(o=(e=>e)`:host{box-sizing:border-box}:host *,:host ::after,:host ::before{box-sizing:inherit}[hidden]{display:none!important}`))},97677:function(e,t,i){i.a(e,(async function(e,o){try{i.d(t,{Z:()=>n.A});var n=i(68783),a=(i(64699),i(15073)),s=i(21262),r=(i(81048),i(31027),i(52812),e([a,s,n]));[a,s,n]=r.then?(await r)():r,o()}catch(l){o(l)}}))},43580:function(e,t,i){i.d(t,{Z:()=>o.D});var o=i(64699);i(52812)},67064:function(e,t,i){i.d(t,{F:()=>r});i(71695),i(46692),i(47021);var o=i(2841),n=i(45779),a=i(53232);const s=e=>(0,a.dZ)(e)?e._$litType$.h:e.strings,r=(0,n.XM)(class extends n.Xe{constructor(e){super(e),this.tt=new WeakMap}render(e){return[e]}update(e,[t]){const i=(0,a.hN)(this.et)?s(this.et):null,n=(0,a.hN)(t)?s(t):null;if(null!==i&&(null===n||i!==n)){const t=(0,a.i9)(e).pop();let n=this.tt.get(i);if(void 0===n){const e=document.createDocumentFragment();n=(0,o.sY)(o.Ld,e),n.setConnected(!1),this.tt.set(i,n)}(0,a.hl)(n,[t]),(0,a._Y)(n,void 0,t)}if(null!==n){if(null===i||i!==n){const t=this.tt.get(n);if(void 0!==t){const i=(0,a.i9)(t).pop();(0,a.E_)(e),(0,a._Y)(e,void 0,i),(0,a.hl)(e,[i])}}this.et=t}else this.et=void 0;return this.render(t)}})}}]);
//# sourceMappingURL=52874.bbe63465d5d57ecf.js.map