iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
6 lines • 52.5 kB
JavaScript
/*! For license information please see 81488.385d3f9087e5300b.js.LICENSE.txt */
export const __webpack_ids__=["81488"];export const __webpack_modules__={93344:function(e,t,i){i.d(t,{T:()=>a});var n=i(62900),o=i(17951);const a=()=>(0,n.lF)((0,n.Z_)(),"custom element type",o.IT)},29095:function(e,t,i){i.a(e,(async function(e,t){try{var n=i(44249),o=i(57243),a=i(15093),r=(i(59826),i(17170)),s=(i(37583),e([r]));r=(s.then?(await s)():s)[0];const d="M2.2,16.06L3.88,12L2.2,7.94L6.26,6.26L7.94,2.2L12,3.88L16.06,2.2L17.74,6.26L21.8,7.94L20.12,12L21.8,16.06L17.74,17.74L16.06,21.8L12,20.12L7.94,21.8L6.26,17.74L2.2,16.06M13,17V15H11V17H13M13,13V7H11V13H13Z",l="M9,20.42L2.79,14.21L5.62,11.38L9,14.77L18.88,4.88L21.71,7.71L9,20.42Z";(0,n.Z)([(0,a.Mo)("ha-progress-button")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,a.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"progress",value:()=>!1},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"raised",value:()=>!1},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"unelevated",value:()=>!1},{kind:"field",decorators:[(0,a.SB)()],key:"_result",value:void 0},{kind:"method",key:"render",value:function(){const e=this._result||this.progress;return o.dy` <ha-button .raised="${this.raised}" .label="${this.label}" .unelevated="${this.unelevated}" .disabled="${this.disabled||this.progress}" class="${this._result||""}"> <slot name="icon" slot="icon"></slot> <slot></slot> </ha-button> ${e?o.dy` <div class="progress"> ${"success"===this._result?o.dy`<ha-svg-icon .path="${l}"></ha-svg-icon>`:"error"===this._result?o.dy`<ha-svg-icon .path="${d}"></ha-svg-icon>`:this.progress?o.dy`<ha-spinner size="small"></ha-spinner>`:o.Ld} </div> `:o.Ld} `}},{kind:"method",key:"actionSuccess",value:function(){this._setResult("success")}},{kind:"method",key:"actionError",value:function(){this._setResult("error")}},{kind:"method",key:"_setResult",value:function(e){this._result=e,setTimeout((()=>{this._result=void 0}),2e3)}},{kind:"field",static:!0,key:"styles",value:()=>o.iv`:host{outline:0;display:inline-block;position:relative;pointer-events:none}ha-button{transition:all 1s;pointer-events:initial}ha-button.success{--mdc-theme-primary:white;background-color:var(--success-color);transition:none;border-radius:4px;pointer-events:none}ha-button[raised].success,ha-button[unelevated].success{--mdc-theme-primary:var(--success-color);--mdc-theme-on-primary:white}ha-button.error{--mdc-theme-primary:white;background-color:var(--error-color);transition:none;border-radius:4px;pointer-events:none}ha-button[raised].error,ha-button[unelevated].error{--mdc-theme-primary:var(--error-color);--mdc-theme-on-primary:white}.progress{bottom:4px;position:absolute;text-align:center;top:4px;width:100%}ha-svg-icon{color:#fff}ha-button.error slot,ha-button.success slot{visibility:hidden}:host([destructive]){--mdc-theme-primary:var(--error-color)}`}]}}),o.oi);t()}catch(e){t(e)}}))},92824:function(e,t,i){var n=i(44249),o=i(72621),a=i(60930),r=i(9714),s=i(57243),d=i(15093),l=i(22381),c=i(76320);i(23334);(0,n.Z)([(0,d.Mo)("ha-select")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"icon",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({type:Boolean,reflect:!0})],key:"clearable",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({attribute:"inline-arrow",type:Boolean})],key:"inlineArrow",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)()],key:"options",value:void 0},{kind:"method",key:"render",value:function(){return s.dy` ${(0,o.Z)(i,"render",this,3)([])} ${this.clearable&&!this.required&&!this.disabled&&this.value?s.dy`<ha-icon-button label="clear" @click="${this._clearValue}" .path="${"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"}"></ha-icon-button>`:s.Ld} `}},{kind:"method",key:"renderLeadingIcon",value:function(){return this.icon?s.dy`<span class="mdc-select__icon"><slot name="icon"></slot></span>`:s.Ld}},{kind:"method",key:"connectedCallback",value:function(){(0,o.Z)(i,"connectedCallback",this,3)([]),window.addEventListener("translations-updated",this._translationsUpdated)}},{kind:"method",key:"firstUpdated",value:async function(){(0,o.Z)(i,"firstUpdated",this,3)([]),this.inlineArrow&&this.shadowRoot?.querySelector(".mdc-select__selected-text-container")?.classList.add("inline-arrow")}},{kind:"method",key:"updated",value:function(e){if((0,o.Z)(i,"updated",this,3)([e]),e.has("inlineArrow")){const e=this.shadowRoot?.querySelector(".mdc-select__selected-text-container");this.inlineArrow?e?.classList.add("inline-arrow"):e?.classList.remove("inline-arrow")}e.get("options")&&(this.layoutOptions(),this.selectByValue(this.value))}},{kind:"method",key:"disconnectedCallback",value:function(){(0,o.Z)(i,"disconnectedCallback",this,3)([]),window.removeEventListener("translations-updated",this._translationsUpdated)}},{kind:"method",key:"_clearValue",value:function(){!this.disabled&&this.value&&(this.valueSetDirectly=!0,this.select(-1),this.mdcFoundation.handleChange())}},{kind:"field",key:"_translationsUpdated",value(){return(0,l.D)((async()=>{await(0,c.y)(),this.layoutOptions()}),500)}},{kind:"field",static:!0,key:"styles",value:()=>[r.W,s.iv`:host([clearable]){position:relative}.mdc-select:not(.mdc-select--disabled) .mdc-select__icon{color:var(--secondary-text-color)}.mdc-select__anchor{width:var(--ha-select-min-width,200px)}.mdc-select--filled .mdc-select__anchor{height:var(--ha-select-height,56px)}.mdc-select--filled .mdc-floating-label{inset-inline-start:12px;inset-inline-end:initial;direction:var(--direction)}.mdc-select--filled.mdc-select--with-leading-icon .mdc-floating-label{inset-inline-start:48px;inset-inline-end:initial;direction:var(--direction)}.mdc-select .mdc-select__anchor{padding-inline-start:12px;padding-inline-end:0px;direction:var(--direction)}.mdc-select__anchor .mdc-floating-label--float-above{transform-origin:var(--float-start)}.mdc-select__selected-text-container{padding-inline-end:var(--select-selected-text-padding-end,0px)}:host([clearable]) .mdc-select__selected-text-container{padding-inline-end:var(--select-selected-text-padding-end,12px)}ha-icon-button{position:absolute;top:10px;right:28px;--mdc-icon-button-size:36px;--mdc-icon-size:20px;color:var(--secondary-text-color);inset-inline-start:initial;inset-inline-end:28px;direction:var(--direction)}.inline-arrow{flex-grow:0}`]}]}}),a.K)},62801:function(e,t,i){var n=i(44249),o=i(72621),a=(i(9359),i(56475),i(22139),i(57243)),r=i(15093),s=i(36522);(0,n.Z)([(0,r.Mo)("ha-sortable")],(function(e,t){class n extends t{constructor(...t){super(...t),e(this)}}return{F:n,d:[{kind:"field",key:"_sortable",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)({type:Boolean,attribute:"no-style"})],key:"noStyle",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)({type:String,attribute:"draggable-selector"})],key:"draggableSelector",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:String,attribute:"handle-selector"})],key:"handleSelector",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:String,attribute:"filter"})],key:"filter",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:String})],key:"group",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean,attribute:"invert-swap"})],key:"invertSwap",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"options",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"rollback",value:()=>!0},{kind:"method",key:"updated",value:function(e){e.has("disabled")&&(this.disabled?this._destroySortable():this._createSortable())}},{kind:"field",key:"_shouldBeDestroy",value:()=>!1},{kind:"method",key:"disconnectedCallback",value:function(){(0,o.Z)(n,"disconnectedCallback",this,3)([]),this._shouldBeDestroy=!0,setTimeout((()=>{this._shouldBeDestroy&&(this._destroySortable(),this._shouldBeDestroy=!1)}),1)}},{kind:"method",key:"connectedCallback",value:function(){(0,o.Z)(n,"connectedCallback",this,3)([]),this._shouldBeDestroy=!1,this.hasUpdated&&!this.disabled&&this._createSortable()}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"render",value:function(){return this.noStyle?a.Ld:a.dy` <style>.sortable-fallback{display:none!important}.sortable-ghost{box-shadow:0 0 0 2px var(--primary-color);background:rgba(var(--rgb-primary-color),.25);border-radius:4px;opacity:.4}.sortable-drag{border-radius:4px;opacity:1;background:var(--card-background-color);box-shadow:0px 4px 8px 3px #00000026;cursor:grabbing}</style> `}},{kind:"method",key:"_createSortable",value:async function(){if(this._sortable)return;const e=this.children[0];if(!e)return;const t=(await Promise.all([i.e("34153"),i.e("467")]).then(i.bind(i,59807))).default,n={scroll:!0,forceAutoScrollFallback:!0,scrollSpeed:20,animation:150,...this.options,onChoose:this._handleChoose,onStart:this._handleStart,onEnd:this._handleEnd,onUpdate:this._handleUpdate,onAdd:this._handleAdd,onRemove:this._handleRemove};this.draggableSelector&&(n.draggable=this.draggableSelector),this.handleSelector&&(n.handle=this.handleSelector),void 0!==this.invertSwap&&(n.invertSwap=this.invertSwap),this.group&&(n.group=this.group),this.filter&&(n.filter=this.filter),this._sortable=new t(e,n)}},{kind:"field",key:"_handleUpdate",value(){return e=>{(0,s.B)(this,"item-moved",{newIndex:e.newIndex,oldIndex:e.oldIndex})}}},{kind:"field",key:"_handleAdd",value(){return e=>{(0,s.B)(this,"item-added",{index:e.newIndex,data:e.item.sortableData})}}},{kind:"field",key:"_handleRemove",value(){return e=>{(0,s.B)(this,"item-removed",{index:e.oldIndex})}}},{kind:"field",key:"_handleEnd",value(){return async e=>{(0,s.B)(this,"drag-end"),this.rollback&&e.item.placeholder&&(e.item.placeholder.replaceWith(e.item),delete e.item.placeholder)}}},{kind:"field",key:"_handleStart",value(){return()=>{(0,s.B)(this,"drag-start")}}},{kind:"field",key:"_handleChoose",value(){return e=>{this.rollback&&(e.item.placeholder=document.createComment("sort-placeholder"),e.item.after(e.item.placeholder))}}},{kind:"method",key:"_destroySortable",value:function(){this._sortable&&(this._sortable.destroy(),this._sortable=void 0)}}]}}),a.oi)},17170:function(e,t,i){i.a(e,(async function(e,n){try{i.r(t),i.d(t,{HaSpinner:()=>h});var o=i(44249),a=i(72621),r=i(97677),s=i(43580),d=i(57243),l=i(15093),c=e([r]);r=(c.then?(await c)():c)[0];let h=(0,o.Z)([(0,l.Mo)("ha-spinner")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,l.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:()=>[s.Z,d.iv`: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)}`]}]}}),r.Z);n()}catch(e){n(e)}}))},83166:function(e,t,i){var n=i(44249),o=i(72621),a=i(1105),r=i(33990),s=i(57243),d=i(15093),l=i(5111);(0,n.Z)([(0,d.Mo)("ha-textfield")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"invalid",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"icon",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"iconTrailing",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)()],key:"autocomplete",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"autocorrect",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:"input-spellcheck"})],key:"inputSpellcheck",value:void 0},{kind:"field",decorators:[(0,d.IO)("input")],key:"formElement",value:void 0},{kind:"method",key:"updated",value:function(e){(0,o.Z)(i,"updated",this,3)([e]),(e.has("invalid")||e.has("errorMessage"))&&(this.setCustomValidity(this.invalid?this.errorMessage||this.validationMessage||"Invalid":""),(this.invalid||this.validateOnInitialRender||e.has("invalid")&&void 0!==e.get("invalid"))&&this.reportValidity()),e.has("autocomplete")&&(this.autocomplete?this.formElement.setAttribute("autocomplete",this.autocomplete):this.formElement.removeAttribute("autocomplete")),e.has("autocorrect")&&(this.autocorrect?this.formElement.setAttribute("autocorrect",this.autocorrect):this.formElement.removeAttribute("autocorrect")),e.has("inputSpellcheck")&&(this.inputSpellcheck?this.formElement.setAttribute("spellcheck",this.inputSpellcheck):this.formElement.removeAttribute("spellcheck"))}},{kind:"method",key:"renderIcon",value:function(e,t=!1){const i=t?"trailing":"leading";return s.dy` <span class="mdc-text-field__icon mdc-text-field__icon--${i}" tabindex="${t?1:-1}"> <slot name="${i}Icon"></slot> </span> `}},{kind:"field",static:!0,key:"styles",value:()=>[r.W,s.iv`.mdc-text-field__input{width:var(--ha-textfield-input-width,100%)}.mdc-text-field:not(.mdc-text-field--with-leading-icon){padding:var(--text-field-padding,0px 16px)}.mdc-text-field__affix--suffix{padding-left:var(--text-field-suffix-padding-left,12px);padding-right:var(--text-field-suffix-padding-right,0px);padding-inline-start:var(--text-field-suffix-padding-left,12px);padding-inline-end:var(--text-field-suffix-padding-right,0px);direction:ltr}.mdc-text-field--with-leading-icon{padding-inline-start:var(--text-field-suffix-padding-left,0px);padding-inline-end:var(--text-field-suffix-padding-right,16px);direction:var(--direction)}.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon{padding-left:var(--text-field-suffix-padding-left,0px);padding-right:var(--text-field-suffix-padding-right,0px);padding-inline-start:var(--text-field-suffix-padding-left,0px);padding-inline-end:var(--text-field-suffix-padding-right,0px)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--suffix{color:var(--secondary-text-color)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__icon{color:var(--secondary-text-color)}.mdc-text-field__icon--leading{margin-inline-start:16px;margin-inline-end:8px;direction:var(--direction)}.mdc-text-field__icon--trailing{padding:var(--textfield-icon-trailing-padding,12px)}.mdc-floating-label:not(.mdc-floating-label--float-above){text-overflow:ellipsis;width:inherit;padding-right:30px;padding-inline-end:30px;padding-inline-start:initial;box-sizing:border-box;direction:var(--direction)}input{text-align:var(--text-field-text-align,start)}input[type=color]{height:20px}::-ms-reveal{display:none}:host([no-spinner]) input::-webkit-inner-spin-button,:host([no-spinner]) input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=color]::-webkit-color-swatch-wrapper{padding:0}:host([no-spinner]) input[type=number]{-moz-appearance:textfield}.mdc-text-field__ripple{overflow:hidden}.mdc-text-field{overflow:var(--text-field-overflow)}.mdc-floating-label{inset-inline-start:16px!important;inset-inline-end:initial!important;transform-origin:var(--float-start);direction:var(--direction);text-align:var(--float-start)}.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label{max-width:calc(100% - 48px - var(--text-field-suffix-padding-left,0px));inset-inline-start:calc(48px + var(--text-field-suffix-padding-left,0px))!important;inset-inline-end:initial!important;direction:var(--direction)}.mdc-text-field__input[type=number]{direction:var(--direction)}.mdc-text-field__affix--prefix{padding-right:var(--text-field-prefix-padding-right,2px);padding-inline-end:var(--text-field-prefix-padding-right,2px);padding-inline-start:initial}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--prefix{color:var(--mdc-text-field-label-ink-color)}#helper-text ha-markdown{display:inline-block}`,"rtl"===l.E.document.dir?s.iv`.mdc-floating-label,.mdc-text-field--with-leading-icon,.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label,.mdc-text-field__icon--leading,.mdc-text-field__input[type=number]{direction:rtl;--direction:rtl}`:s.iv``]}]}}),a.P)},95439:function(e,t,i){var n=i(44249),o=(i(9359),i(70104),i(87319),i(57243)),a=i(15093),r=i(36522),s=i(49976);i(92824);(0,n.Z)([(0,a.Mo)("ha-theme-picker")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,a.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,a.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:"include-default",type:Boolean})],key:"includeDefault",value:()=>!1},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.Cb)({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"required",value:()=>!1},{kind:"method",key:"render",value:function(){return o.dy` <ha-select .label="${this.label||this.hass.localize("ui.components.theme-picker.theme")}" .value="${this.value}" .required="${this.required}" .disabled="${this.disabled}" @selected="${this._changed}" @closed="${s.U}" fixedMenuPosition naturalMenuWidth> ${this.required?o.Ld:o.dy` <mwc-list-item value="remove"> ${this.hass.localize("ui.components.theme-picker.no_theme")} </mwc-list-item> `} ${this.includeDefault?o.dy` <mwc-list-item .value="${"default"}"> ioBroker </mwc-list-item> `:o.Ld} ${Object.keys(this.hass.themes.themes).sort().map((e=>o.dy`<mwc-list-item .value="${e}">${e}</mwc-list-item>`))} </ha-select> `}},{kind:"field",static:!0,key:"styles",value:()=>o.iv`ha-select{width:100%}`},{kind:"method",key:"_changed",value:function(e){this.hass&&""!==e.target.value&&(this.value="remove"===e.target.value?void 0:e.target.value,(0,r.B)(this,"value-changed",{value:this.value}))}}]}}),o.oi)},52032:function(e,t,i){i.a(e,(async function(e,n){try{i.d(t,{w:()=>u});i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814);var o=i(35729),a=(i(83442),i(92263)),r=i(15367),s=i(56332),d=i(13888),l=(i(9427),i(40249)),c=e([o,a,r,s,d]);[o,a,r,s,d]=c.then?(await c)():c;const h=new Set(["conditional","icon","image","service-button","state-badge","state-icon","state-label"]),u=e=>("action-button"===e.type&&(e={...e,type:"service-button"}),(0,l.Tw)("element",e,h));n()}catch(e){n(e)}}))},63930:function(e,t,i){i.a(e,(async function(e,n){try{i.r(t),i.d(t,{HuiEntitiesCardEditor:()=>H});var o=i(44249),a=i(57243),r=i(15093),s=i(62900),d=i(36522),l=i(93344),c=(i(54977),i(55486),i(65981),i(1888),i(83166),i(95439),i(17951)),h=i(38070),u=i(45079),f=(i(80696),i(13286)),p=i(50357),g=i(35826),v=i(30571),m=i(18200),y=i(92228),_=i(8148),k=i(10991),b=e([f,p]);[f,p]=b.then?(await b)():b;const x=(0,s.Ry)({type:(0,s.i0)("button"),entity:(0,s.jt)((0,s.Z_)()),name:(0,s.jt)((0,s.Z_)()),icon:(0,s.jt)((0,s.Z_)()),action_name:(0,s.jt)((0,s.Z_)()),tap_action:v.fJ,hold_action:(0,s.jt)(v.fJ),double_tap_action:(0,s.jt)(v.fJ)}),w=(0,s.Ry)({type:(0,s.i0)("cast"),view:(0,s.jt)((0,s.G0)([(0,s.Z_)(),(0,s.Rx)()])),dashboard:(0,s.jt)((0,s.Z_)()),name:(0,s.jt)((0,s.Z_)()),icon:(0,s.jt)((0,s.Z_)()),hide_if_unavailable:(0,s.jt)((0,s.O7)())}),E=(0,s.Ry)({type:(0,s.kE)(["call-service","perform-action"]),name:(0,s.Z_)(),service:(0,s.jt)((0,s.Z_)()),action:(0,s.jt)((0,s.Z_)()),icon:(0,s.jt)((0,s.Z_)()),action_name:(0,s.jt)((0,s.Z_)()),service_data:(0,s.jt)((0,s.Yj)()),data:(0,s.jt)((0,s.Yj)())}),C=(0,s.Ry)({type:(0,s.i0)("conditional"),row:(0,s.Yj)(),conditions:(0,s.IX)((0,s.Yj)())}),$=(0,s.Ry)({type:(0,s.i0)("divider"),style:(0,s.jt)((0,s.Yj)())}),L=(0,s.Ry)({type:(0,s.i0)("section"),label:(0,s.jt)((0,s.Z_)())}),S=(0,s.Ry)({type:(0,s.i0)("weblink"),url:(0,s.Z_)(),name:(0,s.jt)((0,s.Z_)()),icon:(0,s.jt)((0,s.Z_)())}),Z=(0,s.Ry)({type:(0,s.i0)("buttons"),entities:(0,s.IX)(y.k)}),j=(0,s.Ry)({type:(0,s.i0)("attribute"),entity:(0,s.Z_)(),attribute:(0,s.Z_)(),prefix:(0,s.jt)((0,s.Z_)()),suffix:(0,s.jt)((0,s.Z_)()),name:(0,s.jt)((0,s.Z_)()),icon:(0,s.jt)((0,s.Z_)()),format:(0,s.jt)((0,s.kE)(h.Q))}),B=(0,s.Ry)({type:(0,s.i0)("text"),name:(0,s.Z_)(),text:(0,s.Z_)(),icon:(0,s.jt)((0,s.Z_)())}),M=(0,s.dt)({type:(0,l.T)()}),V=(0,s.D8)((e=>{if(e&&"object"==typeof e&&"type"in e){if((0,c.IT)(e.type))return M;switch(e.type){case"attribute":return j;case"button":return x;case"buttons":return Z;case"perform-action":case"call-service":return E;case"cast":return w;case"conditional":return C;case"divider":return $;case"section":return L;case"text":return B;case"weblink":return S}}return _.K})),z=(0,s.f0)(m.I,(0,s.Ry)({title:(0,s.jt)((0,s.G0)([(0,s.Z_)(),(0,s.O7)()])),entity:(0,s.jt)((0,s.Z_)()),theme:(0,s.jt)((0,s.Z_)()),icon:(0,s.jt)((0,s.Z_)()),show_header_toggle:(0,s.jt)((0,s.O7)()),state_color:(0,s.jt)((0,s.O7)()),entities:(0,s.IX)(V),header:(0,s.jt)(u.ds),footer:(0,s.jt)(u.ds)}));let H=(0,o.Z)([(0,r.Mo)("hui-entities-card-editor")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_config",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_configEntities",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_subElementEditorConfig",value:void 0},{kind:"method",key:"setConfig",value:function(e){(0,s.hu)(e,z),this._config=e,this._configEntities=(0,g.Q)(e.entities)}},{kind:"get",key:"_title",value:function(){return this._config.title||""}},{kind:"get",key:"_theme",value:function(){return this._config.theme||""}},{kind:"method",key:"render",value:function(){return this.hass&&this._config?this._subElementEditorConfig?a.dy` <hui-sub-element-editor .hass="${this.hass}" .config="${this._subElementEditorConfig}" @go-back="${this._goBack}" @config-changed="${this._handleSubElementChanged}"> </hui-sub-element-editor> `:a.dy` <div class="card-config"> <ha-textfield .label="${this.hass.localize("ui.panel.lovelace.editor.card.generic.title")} (${this.hass.localize("ui.panel.lovelace.editor.card.config.optional")})" .value="${this._title}" .configValue="${"title"}" @input="${this._valueChanged}"></ha-textfield> <ha-theme-picker .hass="${this.hass}" .value="${this._theme}" .label="${`${this.hass.localize("ui.panel.lovelace.editor.card.generic.theme")} (${this.hass.localize("ui.panel.lovelace.editor.card.config.optional")})`}" .configValue="${"theme"}" @value-changed="${this._valueChanged}"></ha-theme-picker> <div class="side-by-side"> <ha-formfield .label="${this.hass.localize("ui.panel.lovelace.editor.card.entities.show_header_toggle")}"> <ha-switch .checked="${!1!==this._config.show_header_toggle}" .configValue="${"show_header_toggle"}" @change="${this._valueChanged}"></ha-switch> </ha-formfield> <ha-formfield .label="${this.hass.localize("ui.panel.lovelace.editor.card.generic.state_color")}"> <ha-switch .checked="${this._config.state_color}" .configValue="${"state_color"}" @change="${this._valueChanged}"></ha-switch> </ha-formfield> </div> <hui-header-footer-editor .hass="${this.hass}" .configValue="${"header"}" .config="${this._config.header}" @value-changed="${this._valueChanged}" @edit-detail-element="${this._editDetailElement}"></hui-header-footer-editor> <hui-header-footer-editor .hass="${this.hass}" .configValue="${"footer"}" .config="${this._config.footer}" @value-changed="${this._valueChanged}" @edit-detail-element="${this._editDetailElement}"></hui-header-footer-editor> </div> <hui-entities-card-row-editor .hass="${this.hass}" .entities="${this._configEntities}" @entities-changed="${this._valueChanged}" @edit-detail-element="${this._editDetailElement}"></hui-entities-card-row-editor> `:a.Ld}},{kind:"method",key:"_valueChanged",value:function(e){if(e.stopPropagation(),!this._config||!this.hass)return;const t=e.target,i=t.configValue||this._subElementEditorConfig?.type,n=void 0!==t.checked?t.checked:t.value||e.detail.config||e.detail.value;if(!("title"===i&&t.value===this._title||"theme"===i&&t.value===this._theme)){if("row"===i||e.detail&&e.detail.entities){const t=e.detail.entities||this._configEntities.concat();"row"===i&&(n?t[this._subElementEditorConfig.index]=n:(t.splice(this._subElementEditorConfig.index,1),this._goBack()),this._subElementEditorConfig.elementConfig=n),this._config={...this._config,entities:t},this._configEntities=(0,g.Q)(this._config.entities)}else i&&(""===n?(this._config={...this._config},delete this._config[i]):this._config={...this._config,[i]:n});(0,d.B)(this,"config-changed",{config:this._config})}}},{kind:"method",key:"_handleSubElementChanged",value:function(e){if(e.stopPropagation(),!this._config||!this.hass)return;const t=this._subElementEditorConfig?.type,i=e.detail.config;if("row"===t){const e=this._configEntities.concat();i?e[this._subElementEditorConfig.index]=i:(e.splice(this._subElementEditorConfig.index,1),this._goBack()),this._config={...this._config,entities:e},this._configEntities=(0,g.Q)(this._config.entities)}else t&&(""===i?(this._config={...this._config},delete this._config[t]):this._config={...this._config,[t]:i});this._subElementEditorConfig={...this._subElementEditorConfig,elementConfig:i},(0,d.B)(this,"config-changed",{config:this._config})}},{kind:"method",key:"_editDetailElement",value:function(e){this._subElementEditorConfig=e.detail.subElementConfig}},{kind:"method",key:"_goBack",value:function(){this._subElementEditorConfig=void 0}},{kind:"get",static:!0,key:"styles",value:function(){return[k.A,a.iv`.edit-entity-row-header{display:flex;justify-content:space-between;align-items:center;font-size:18px}hui-header-footer-editor{padding-top:4px}ha-textfield{display:block;margin-bottom:16px}`]}}]}}),a.oi);n()}catch(e){n(e)}}))},32012:function(e,t,i){i.d(t,{e:()=>n});class n 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}}},80696:function(e,t,i){var n=i(44249),o=i(57243),a=i(15093),r=i(36522);i(23334);const s=()=>Promise.all([i.e("97983"),i.e("58640"),i.e("1262")]).then(i.bind(i,81680));(0,n.Z)([(0,a.Mo)("hui-header-footer-editor")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",key:"hass",value:void 0},{kind:"field",key:"lovelaceConfig",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"config",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"configValue",value:void 0},{kind:"method",key:"render",value:function(){return o.dy` <div> <span> ${this.hass.localize(`ui.panel.lovelace.editor.header-footer.${this.configValue}`)}: ${this.config?.type?this.hass.localize(`ui.panel.lovelace.editor.header-footer.types.${this.config?.type}.name`):this.hass.localize("ui.panel.lovelace.editor.common.none")} </span> </div> <div> ${this.config?.type?o.dy` <ha-icon-button .label="${this.hass.localize("ui.panel.lovelace.editor.common.clear")}" .path="${"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"}" class="remove-icon" @click="${this._delete}"></ha-icon-button> <ha-icon-button .label="${this.hass.localize("ui.panel.lovelace.editor.common.edit")}" .path="${"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"}" class="edit-icon" @click="${this._edit}"></ha-icon-button> `:o.dy` <ha-icon-button .label="${this.hass.localize("ui.panel.lovelace.editor.common.add")}" .path="${"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"}" class="add-icon" @click="${this._add}"></ha-icon-button> `} </div> `}},{kind:"method",key:"_edit",value:function(){(0,r.B)(this,"edit-detail-element",{subElementConfig:{elementConfig:this.config,type:this.configValue}})}},{kind:"method",key:"_add",value:function(){var e,t;e=this,t={pickHeaderFooter:e=>this._elementPicked(e),type:this.configValue},(0,r.B)(e,"show-dialog",{dialogTag:"hui-dialog-create-headerfooter",dialogImport:s,dialogParams:t})}},{kind:"method",key:"_elementPicked",value:function(e){(0,r.B)(this,"value-changed",{value:e}),(0,r.B)(this,"edit-detail-element",{subElementConfig:{elementConfig:e,type:this.configValue}})}},{kind:"method",key:"_delete",value:function(){(0,r.B)(this,"value-changed",{value:""})}},{kind:"field",static:!0,key:"styles",value:()=>o.iv`:host{font-size:16px;display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;padding-bottom:12px}:host>div{display:flex;align-items:center}.header-footer-icon,ha-icon-button{--mdc-icon-button-size:36px;color:var(--secondary-text-color)}.header-footer-icon{padding-right:8px;padding-inline-end:8px;padding-inline-start:initial}`}]}}),o.oi)},43299:function(e,t,i){i.a(e,(async function(e,n){try{i.d(t,{O:()=>v});var o=i(44249),a=i(72621),r=(i(9359),i(31526),i(70104),i(57243)),s=i(15093),d=i(67064),l=i(36522),c=i(22381),h=i(41680),u=i(48045),f=(i(99426),i(17170)),p=(i(64889),i(32012)),g=e([f]);f=(g.then?(await g)():g)[0];let v=(0,o.Z)(null,(function(e,t){class n extends t{constructor(...t){super(...t),e(this)}}return{F:n,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:"context",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_config",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_configElement",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_subElementEditorConfig",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_guiMode",value:()=>!0},{kind:"field",decorators:[(0,s.SB)()],key:"_errors",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_pendingYamlError",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_yamlError",value:()=>!1},{kind:"field",decorators:[(0,s.SB)()],key:"_warnings",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_guiSupported",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_loading",value:()=>!1},{kind:"field",decorators:[(0,s.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((()=>{(0,l.B)(this,"config-changed",{config:this.value,error:this._errors?.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,l.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(){this._configElement?.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 r.dy`${this._configElement}`}},{kind:"method",key:"_renderSubElement",value:function(){return r.dy` <hui-sub-element-editor .hass="${this.hass}" .config="${this._subElementEditorConfig}" @go-back="${this._goBack}" @config-changed="${this._subElementChanged}"> </hui-sub-element-editor> `}},{kind:"method",key:"_subElementChanged",value:function(e){e.stopPropagation();const t=e.detail.config;this._subElementEditorConfig={...this._subElementEditorConfig,elementConfig:t},this._subElementEditorConfig.saveElementConfig?.(t)}},{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("37602"),i.e("18865"),i.e("88975"),i.e("79931"),i.e("44251"),i.e("65005"),i.e("60487"),i.e("3371"),i.e("38326"),i.e("10745"),i.e("16912"),i.e("92368"),i.e("95444"),i.e("8754"),i.e("54291"),i.e("76986")]).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 r.dy` <div class="wrapper"> ${this.GUImode?r.dy` <div class="gui-editor" @edit-sub-element="${this._editSubElement}"> ${this._loading?r.dy` <ha-spinner class="center margin-bot"></ha-spinner> `:(0,d.F)(this._subElementEditorConfig?this._renderSubElement():this.renderConfigElement())} </div> `:r.dy` <div class="yaml-editor"> <ha-yaml-editor .defaultValue="${this._config}" autofocus .hass="${this.hass}" @value-changed="${this._handleYAMLChanged}" @blur="${this._onBlurYaml}" @keydown="${this._ignoreKeydown}" dir="ltr"></ha-yaml-editor> </div> `} ${!1===this._guiSupported&&!1===this._loading?r.dy` <ha-alert alert-type="info" .title="${this.hass.localize("ui.errors.config.visual_editor_not_supported")}"> ${this.hass.localize("ui.errors.config.visual_editor_not_supported_reason_type")} <br> ${this.hass.localize("ui.errors.config.edit_in_yaml_supported")} </ha-alert> `:r.Ld} ${this.hasError?r.dy` <ha-alert alert-type="error" .title="${this.hass.localize("ui.errors.config.configuration_error")}"> <ul> ${this._errors.map((e=>r.dy`<li>${e}</li>`))} </ul> </ha-alert> `:r.Ld} ${this.hasWarning?r.dy` <ha-alert alert-type="warning" .title="${this.hass.localize("ui.errors.config.visual_editor_not_supported")}"> <ul> ${this._warnings.map((e=>r.dy`<li>${e}</li>`))} </ul> ${this.hass.localize("ui.errors.config.edit_in_yaml_supported")} </ha-alert> `:r.Ld} </div> `}},{kind:"method",key:"updated",value:function(e){(0,a.Z)(n,"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:n,assertConfig:o,computeLabel:a,computeHelper:r}=t;e.schema=n,a&&(e.computeLabel=a),r&&(e.computeHelper=r),o&&(e.assertConfig=o)}}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(e){const t=(0,h.p)(this.hass,e);throw new p.e("Config is not supported",t.warnings,t.errors)}else this._guiSupported=!1,this.GUImode=!1}catch(e){e instanceof p.e?(this._warnings=e.warnings??[e.message],this._errors=e.errors||void 0):this._errors=[e.message],this.GUImode=!1}finally{this._loading=!1}}},{kind:"method",key:"_ignoreKeydown",value:function(e){e.stopPropagation()}},{kind:"field",static:!0,key:"styles",value:()=>r.iv`: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}`}]}}),r.oi);n()}catch(e){n(e)}}))},13286:function(e,t,i){i.a(e,(async function(e,t){try{var n=i(44249),o=i(57243),a=i(15093),r=i(91583),s=i(36522),d=i(58725),l=(i(23334),i(62801),i(37583),e([d]));d=(l.then?(await l)():l)[0];const c="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",h="M7,19V17H9V19H7M11,19V17H13V19H11M15,19V17H17V19H15M7,15V13H9V15H7M11,15V13H13V15H11M15,15V13H17V15H15M7,11V9H9V11H7M11,11V9H13V11H11M15,11V9H17V11H15M7,7V5H9V7H7M11,7V5H13V7H11M15,7V5H17V7H15Z",u="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,n.Z)([(0,a.Mo)("hui-entities-card-row-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:"entities",value:void 0},{kind:"field",decorators:[(0,a.Cb)()],key:"label",value:void 0},{kind:"field",key:"_entityKeys",value:()=>new WeakMap},{kind:"method",key:"_getKey",value:function(e){return this._entityKeys.has(e)||this._entityKeys.set(e,Math.random().toString()),this._entityKeys.get(e)}},{kind:"method",key:"render",value:function(){return this.entities&&this.hass?o.dy` <h3> ${this.label||`${this.hass.localize("ui.panel.lovelace.editor.card.generic.entities")} (${this.hass.localize("ui.panel.lovelace.editor.card.config.required")})`} </h3> <ha-sortable handle-selector=".handle" @item-moved="${this._rowMoved}"> <div class="entities"> ${(0,r.r)(this.entities,(e=>this._getKey(e)),((e,t)=>o.dy` <div class="entity"> <div class="handle"> <ha-svg-icon .path="${h}"></ha-svg-icon> </div> ${e.type?o.dy` <div class="special-row"> <div> <span> ${this.hass.localize(`ui.panel.lovelace.editor.card.entities.entity_row.${e.type}`)} </span> <span class="secondary">${this.hass.localize("ui.panel.lovelace.editor.card.entities.edit_special_row")}</span> </div> </div> `:o.dy` <ha-entity-picker allow-custom-entity hide-clear-icon .hass="${this.hass}" .value="${e.entity}" .index="${t}" @value-changed="${this._valueChanged}"></ha-entity-picker> `} <ha-icon-button .label="${this.hass.localize("ui.components.entity.entity-picker.clear")}" .path="${c}" class="remove-icon" .index="${t}" @click="${this._removeRow}"></ha-icon-button> <ha-icon-button .label="${this.hass.localize("ui.components.entity.entity-picker.edit")}" .path="${u}" class="edit-icon" .index="${t}" @click="${this._editRow}"></ha-icon-button> </div> `))} </div> </ha-sortable> <ha-entity-picker class="add-entity" .hass="${this.hass}" @value-changed="${this._addEntity}"></ha-entity-picker> `:o.Ld}},{kind:"method",key:"_addEntity",value:async function(e){const t=e.detail.value;if(""===t)return;const i=this.entities.concat({entity:t});e.target.value="",(0,s.B)(this,"entities-changed",{entities:i})}},{kind:"method",key:"_rowMoved",value:function(e){e.stopPropagation();const{oldIndex:t,newIndex:i}=e.detail,n=this.entities.concat();n.splice(i,0,n.splice(t,1)[0]),(0,s.B)(this,"entities-changed",{entities:n})}},{kind:"method",key:"_removeRow",value:function(e){const t=e.currentTarget.index,i=this.entities.concat();i.splice(t,1),(0,s.B)(this,"entities-changed",{entities:i})}},{kind:"method",key:"_valueChanged",value:function(e){const t=e.detail.value,i=e.target.index,n=this.entities.concat();""===t||void 0===t?n.splice(i,1):n[i]={...n[i],entity:t},(0,s.B)(this,"entities-changed",{entities:n})}},{kind:"method",key:"_editRow",value:function(e){const t=e.currentTarget.index;(0,s.B)(this,"edit-detail-element",{subElementConfig:{index:t,type:"row",elementConfig:this.entities[t]}})}},{kind:"field",static:!0,key:"styles",value:()=>o.iv`ha-entity-picker{margin-top:8px}.add-entity{display:block;margin-left:31px;margin-right:71px;margin-inline-start:31px;margin-inline-end:71px;direction:var(--direction)}.entity{display:flex;align-items:center}.entity .handle{padding-right:8px;cursor:move;cursor:grab;padding-inline-end:8px;padding-inline-start:initial;direction:var(--direction)}.entity .handle>*{pointer-events:none}.entity ha-entity-picker{flex-grow:1}.special-row{height:60px;font-size:16px;display:flex;align-items:center;justify-content:space-between;flex-grow:1}.special-row div{display:flex;flex-direction:column}.edit-icon,.remove-icon{--mdc-icon-button-size:36px;color:var(--secondary-text-color)}.secondary{font-size:12px;color:var(--secondary-text-color)}`}]}}),o.oi);t()}catch(e){t(e)}}))},6973:function(e,t,i){i.a(e,(async function(e,n){try{i.d(t,{k:()=>l});var o=i(44249),a=i(72621),r=i(15093),s=i(43299),d=e([s]);s=(d.then?(await d)():d)[0];let l=(0,o.Z)(null,(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,r.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)([])}}]}}),s.O);n()}catch(e){n(e)}}))},35826:function(e,t,i){i.d(t,{Q:()=>n});i(9359),i(70104);function n(e){return e.map((e=>"string"==typeof e?{entity:e}:e))}},18200:function(e,t,i){i.d(t,{I:()=>o});var n=i(62900);const o=(0,n.Ry)({type:(0,n.Z_)(),view_layout:(0,n.Yj)(),layout_options:(0,n.Yj)(),grid_options:(0,n.Yj)(),visibility:(0,n.Yj)()})},92228:function(e,t,i){i.d(t,{k:()=>a});var n=i(62900),o=i(30571);const a=(0,n.Ry)({entity:(0,n.Z_)(),name:(0,n.jt)((0,n.Z_)()),icon:(0,n.jt)((0,n.Z_)()),image:(0,n.jt)((0,n.Z_)()),show_name:(0,n.jt)((0,n.O7)()),show_icon:(0,n.jt)((0,n.O7)()),tap_action:(0,n.jt)(o.fJ),hold_action:(0,n.jt)(o.fJ),double_tap_action:(0,n.jt)(o.fJ)})},45079:function(e,t,i){i.d(t,{ds:()=>l,gg:()=>d});var n=i(62900),o=i(30571),a=i(92228);const r=(0,n.Ry)({type:(0,n.Z_)(),image:(0,n.Z_)(),tap_action:(0,n.jt)(o.fJ),hold_action:(0,n.jt)(o.fJ),double_tap_action:(0,n.jt)(o.fJ),alt_text:(0,n.jt)((0,n.Z_)())}),s=(0,n.Ry)({type:(0,n.Z_)(),entities:(0,n.IX)(a.k)}),d=(0,n.Ry)({type:(0,n.Z_)(),entity:(0,n.Z_)(),detail:(0,n.jt)((0,n.Rx)()),hours_to_show:(0,n.jt)((0,n.Rx)())}),l=(0,n.D8)((e=>{if(e&&"object"==typeof e&&"type"in e)switch(e.type){case"buttons":return s;case"graph":return d;case"picture":return r}return(0,n.G0)([s,d,r])}))},48734:function(e,t,i){i.a(e,(async function(e,n){try{i.d(t,{P5:()=>u,Ve:()=>p});var o=i(16485),a=(i(9359),i(70104),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),e([o]));o=(a.then?(await a)():a)[0];const r=new Set,s=new Map;let d,l="ltr",c="en";const h="undefined"!=typeof MutationObserver&&"undefined"!=typeof document&&void 0!==document.documentElement;if(h){const g=new MutationObserver(f);l=document.documentElement.dir||"ltr",c=document.documentElement.lang||navigator.language,g.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]})}function u(...e){e.map((e=>{const t=e.$code.toLowerCase();s.has(t)?s.set(t,Object.assign(Object.assign({},s.get(t)),e)):s.set(t,e),d||(d=e)})),f()}function f(){h&&(l=document.documentElement.dir||"ltr",c=document.documentElement.lang||navigator.language),[...r.keys()].map((e=>{"function"==typeof e.requestUpdate&&e.requestUpdate()}))}class p{constructor(e){this.host=e,this.host.addController(this)}hostConnected(){r.add(this.host)}hostDisconnected(){r.delete(this.host)}dir(){return`${this.host.dir||l}`.toLowerCase()}lang(){return`${this.host.lang||c}`.toLowerCase()}getTranslationData(e){var t,i;const n=new Intl.Locale(e.replace(/_/g,"-")),o=null==n?void 0:n.language.toLowerCase(),a=null!==(i=null===(t=null==n?void 0:n.region)||void 0===t?void 0:t.toLowerCase())&&void 0!==i?i:"";return{locale:n,language:o,region:a,primary:s.get(`${o}-${a}`),secondary:s.get(o)}}exists(e,t){var i;const{primary:n,secondary:o}=this.getTranslationData(null!==(i=t.lang)&&void 0!==i?i:this.lang());return t=Object.assign({includeFallback:!1},t),!!(n&&n[e]||o&&o[e]||t.includeFallback&&d&&d[e])}term(e,...t){const{primary:i,secondary:n}=this.getTranslationData(this.lang());let o;if(i&&i[e])o=i[e];else if(n&&n[e])o=n[e];else{if(!d||!d[e])return console.error(`No translation found for: ${String(e)}`),String(e);o=d[e]}return"function"==typeof o?o(...t):o}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)}}n()}catch(v){n(v)}}))},68783:function(e,t,i){i.a(e,(async function(e,n){try{i.d(t,{A:()=>c});var o=i(64699),a=i(15073),r=i(81048),s=i(31027),d=i(57243),l=e([a]);a=(l.then?(await l)():l)[0];var c=class extends s.P{constructor(){super(...arguments),this.localize=new a.V(this)}render(){return d.dy` <svg part="base" class="spinner" role="progressbar" aria-label="${this.localize.term("loading")}"> <circle class="spinner__track"></circle> <circle class="spinner__indicator"></circle> </svg> `}};c.styles=[r.N,o.D],n()}catch(e){n(e)}}))},31027:function(e,t,i){i.d(t,{P:()=>s});i(9359),i(31526);var n,o=i(52812),a=i(57243),r=i(15093),s=class extends a.oi{constructor(){super(),(0,o.Ko)(this,n,!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,o.ih)({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(i),i}static define(e,t=this,i={}){const n=customElements.get(e);if(!n){try{customElements.define(e,t,i)}catch(n){customElements.define(e,class extends t{},i)}return}let o=" (unknown version)",a=o;"version"in t&&t.version&&(o=" v"+t.version),"version"in n&&n.version&&(a=" v"+n.version),o&&a&&o===a||console.warn(`Attempted to register <${e}>${o}, but <${e}>${a} has already been registered.`)}attributeChangedCallback(e,t,i){(0,o.ac)(this,n)||(this.constructor.elementProperties.forEach(((e,t)=>{e.reflect&&null!=this[t]&&this.initialReflectedProperties.set(t,this[t])})),(0,o.qx)(this,n,!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)}))}};n=new WeakMap,s.version="2.20.1",s.dependencies={},(0,o.u2)([(0,r.Cb)()],s.prototype,"dir",2),(0,o.u2)([(0,r.Cb)()],s.prototype,"lang",2)},15073:function(e,t,i){i.a(e,(async function(e,n){try{i.d(t,{V:()=>s});var o=i(21262),a=i(48734),r=e([a,o]);[a,o]=r.then?(await r)():r;var s=class extends a.Ve{};(0,a.P5)(o.K),n()}catch(e){n(e)}}))},21262:function(e,t,i){i.a(e,(async function(e,n){try{i.d(t,{K:()=>s});var o=i(48734),a=e([o]);o=(a.then?(await a)():a)[0];var r={$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,o.P5)(r);var s=r;n()}catch(e){n(e)}}))},64699:function(e,t,i){i.d(t,{D:()=>n});var n=i(57243).iv`: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:()=>f,Ko:()=>m,ac:()=>v,ih:()=>u,qx:()=>y,u2:()=>p});var n=Object.defineProperty,o=Object.defineProperties,a=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,c=e=>{throw TypeError(e)},h=(e,t,i)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,u=(e,t)=>{for(var i in t||(t={}))d.call(t,i)&&h(e,i,t[i]);if(s)for(var i of s(t))l.call(t,i)&&h(e,i,t[i]);return e},f=(e,t)=>o(e,r(t)),p=(e,t,i,o)=>{for(var r,s=o>1?void 0:o?a(t,i):t,d=e.length-1;d>=0;d--)(r=e[d])&&(s=(o?r(t,i,s):r(s))||s);return o&&s&&n(t,i,s),s},g=(e,t,i)=>t.has(e)||c("Cannot "+i),v=(e,t,i)=>(g(e,t,"read from private field"),i?i.call(e):t.get(e)),m=(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,n)=>(g(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i)},81048:function(e,t,i){i.d(t,{N:()=>n});var n=i(57243).iv`: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,n){try{i.d(t,{Z:()=>o.A});var o=i(68783),a=(i(64699),i(15073)),r=i(21262),s=(i(81048),i(31027),i(52812),e([a,r,o]));[a,r,o]=s.then?(await s)():s,n()}catch(e){n(e)}}))},43580:function(e,t,i){i.d(t,{Z:()=>n.D});var n=i(64699);i(52812)},67064:function(e,t,i){i.d(t,{F:()=>s});var n=i(2841),o=i(45779),a=i(53232);const r=e=>(0,a.dZ)(e)?e._$litType$.h:e.strings,s=(0,o.XM)(class extends o.Xe{constructor(e){super(e),this.tt=new WeakMap}render(e){return[e]}update(e,[t]){const i=(0,a.hN)(this.et)?r(this.et):null,o=(0,a.hN)(t)?r(t):null;if(null!==i&&(null===o||i!==o)){const t=(0,a.i9)(e).pop();let o=this.tt.get(i);if(void 0===o){const e=document.createDocumentFragment();o=(0,n.sY)(n.Ld,e),o.setConnected(!1),this.tt.set(i,o)}(0,a.hl)(o,[t]),(0,a._Y)(o,void 0,t)}if(null!==o){if(null===i||i!==o){const t=this.tt.get(o);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=81488.385d3f9087e5300b.js.map