UNPKG

iobroker.lovelace

Version:

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

7 lines 21 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[62612],{62647:function(t,e,i){var a=i(40445),o=i(9866),s=i(5124),n=i(67576);let l,r=t=>t;class c extends o.A{static get styles(){return[o.A.styles,(0,s.AH)(l||(l=r`:host{font-size:var(--ha-font-size-m);--wa-color-brand-on-quiet:var( --ha-tab-active-text-color, var(--primary-color) );--wa-color-neutral-on-quiet:var(--wa-color-brand-on-quiet);opacity:.8;color:inherit;--wa-space-l:16px}:host([active]:not([disabled])){opacity:1}@media (hover:hover){:host(:hover:not([disabled]):not([active])) .tab{color:var(--wa-color-brand-on-quiet)}}`))]}}c=(0,a.Cg)([(0,n.EM)("ha-tab-group-tab")],c)},66289:function(t,e,i){i.a(t,async function(t,e){try{i(62953);var a=i(40445),o=i(42814),s=i(5124),n=i(67576),l=i(36356),r=t([o]);o=(r.then?(await r)():r)[0];let c,h=t=>t;class d extends o.A{connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this._handleKeyDown,!0)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this._handleKeyDown,!0)}handleClick(t){this._dragScrollController.scrolled||super.handleClick(t)}static get styles(){return[o.A.styles,(0,s.AH)(c||(c=h`:host{--track-width:2px;--track-color:var(--ha-tab-track-color, var(--divider-color));--indicator-color:var( --ha-tab-indicator-color, var(--primary-color) );--wa-color-neutral-on-quiet:var(--indicator-color)}.tab-group-top ::slotted(ha-tab-group-tab[active]){border-block-end:solid var(--track-width) var(--indicator-color);margin-block-end:calc(-1 * var(--track-width))}.tab-group-start ::slotted(ha-tab-group-tab[active]){border-inline-end:solid var(--track-width) var(--indicator-color);margin-inline-end:calc(-1 * var(--track-width))}.tab-group-end ::slotted(ha-tab-group-tab[active]){border-inline-start:solid var(--track-width) var(--indicator-color);margin-inline-start:calc(-1 * var(--track-width))}.scroll-button::part(base):hover{background-color:transparent}`))]}constructor(...t){super(...t),this._dragScrollController=new l.q(this,{selector:".nav"}),this.tabTag="ha-tab-group-tab",this.tabOnly=!0,this._handleKeyDown=t=>{(t.altKey||t.metaKey)&&t.stopPropagation()}}}(0,a.Cg)([(0,n.MZ)({attribute:"tab-tag"})],d.prototype,"tabTag",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"tab-only",type:Boolean})],d.prototype,"tabOnly",void 0),d=(0,a.Cg)([(0,n.EM)("ha-tab-group")],d),e()}catch(c){e(c)}})},83892:function(t,e,i){i.d(e,{x:function(){return g}});i(18111),i(13579),i(27495),i(42762),i(62953);var a=i(40445),o=i(92070),s=i(5124),n=i(67576);let l,r,c,h,d,v,p,u=t=>t;class g extends s.WF{_onSlotChange(t){return e=>{const i=e.target.assignedNodes({flatten:!0}).some(t=>{var e;return t.nodeType===Node.ELEMENT_NODE||t.nodeType===Node.TEXT_NODE&&""!==(null===(e=t.textContent)||void 0===e?void 0:e.trim())});"start"===t?this._hasStart=i:this._hasEnd=i}}render(){return this._renderBase(this._renderInner())}_renderBase(t){return(0,s.qy)(l||(l=u`<div part="base" class="base" id="item">${0}</div>`),t)}_renderInner(){const t=this._slotController.test("content");return(0,s.qy)(r||(r=u` <div part="start" class="start" ?hidden="${0}"> <slot name="start" @slotchange="${0}"></slot> </div> <div part="content" class="content"> ${0} </div> <div part="end" class="end" ?hidden="${0}"> <slot name="end" @slotchange="${0}"></slot> </div> `),!this._hasStart,this._onSlotChange("start"),t?(0,s.qy)(c||(c=u`<slot name="content"></slot>`)):this._renderDefaultContent(),!this._hasEnd,this._onSlotChange("end"))}_renderDefaultContent(){var t,e;const i=this._slotController.test("headline"),a=this._slotController.test("supporting-text"),o=i||void 0!==this.headline,n=a||void 0!==this.supportingText;return(0,s.qy)(h||(h=u` ${0} ${0} `),o?(0,s.qy)(d||(d=u`<div part="headline" class="headline"> <slot name="headline">${0}</slot> </div>`),null!==(t=this.headline)&&void 0!==t?t:s.s6):s.s6,n?(0,s.qy)(v||(v=u`<div part="supporting-text" class="supporting"> <slot name="supporting-text">${0}</slot> </div>`),null!==(e=this.supportingText)&&void 0!==e?e:s.s6):s.s6)}constructor(...t){super(...t),this.disabled=!1,this._slotController=new o.X(this,"headline","supporting-text","content"),this._hasStart=!1,this._hasEnd=!1}}g.styles=(0,s.AH)(p||(p=u`:host{display:block;color:var(--primary-text-color);font-size:var(--ha-font-size-m);line-height:var(--ha-line-height-normal)}:host([disabled]){color:var(--disabled-text-color);pointer-events:none}.base{position:relative;display:flex;flex-direction:row;align-items:center;gap:var(--ha-row-item-gap,var(--ha-space-4));padding-block:var(--ha-row-item-padding-block,var(--ha-space-3));padding-inline:var(--ha-row-item-padding-inline,var(--ha-space-4));min-height:var(--ha-row-item-min-height,48px);box-sizing:border-box}.content{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;justify-content:center}.end,.start{display:flex;align-items:center;flex:0 0 auto}.end[hidden],.start[hidden]{display:none}.headline{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.supporting{color:var(--secondary-text-color);font-size:var(--ha-font-size-s);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}`)),(0,a.Cg)([(0,n.MZ)({type:String})],g.prototype,"headline",void 0),(0,a.Cg)([(0,n.MZ)({type:String,attribute:"supporting-text"})],g.prototype,"supportingText",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],g.prototype,"disabled",void 0),(0,a.Cg)([(0,n.wk)()],g.prototype,"_hasStart",void 0),(0,a.Cg)([(0,n.wk)()],g.prototype,"_hasEnd",void 0),g=(0,a.Cg)([(0,n.EM)("ha-row-item")],g)},30461:function(t,e,i){i.a(t,async function(t,e){try{i(62953);var a=i(40445),o=i(35211),s=i(5124),n=i(67576),l=i(87047),r=i(38962),c=(i(67094),i(83892)),h=i(14487),d=i(82747),v=t([r,h,l]);[r,h,l]=v.then?(await v)():v;let p,u,g=t=>t;const _={visible:"M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z",hidden:"M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z",invalid:"M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"};class m extends s.WF{willUpdate(t){var e;(super.willUpdate(t),t.has("conditions")||t.has("hass"))&&this._listeners.setup(null!==(e=this.conditions)&&void 0!==e?e:[],this.hass,()=>this._evaluate());(t.has("hass")||t.has("conditions")||t.has("_entityContext"))&&this._evaluate()}render(){var t,e,i,a;return(0,s.qy)(p||(p=g` <ha-alert .alertType="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="headline"> ${0} </div> <div class="supporting"> ${0} </div> </ha-alert> `),"visible"===this.state?"success":"hidden"===this.state?"warning":"error",_[this.state],null===(t=this.hass)||void 0===t?void 0:t.localize(`ui.panel.lovelace.editor.condition-editor.visibility_status.${this.state}.headline`),null===(e=this.hass)||void 0===e?void 0:e.localize(`ui.panel.lovelace.editor.condition-editor.visibility_status.${this.state}.supporting${0===(null!==(i=null===(a=this.conditions)||void 0===a?void 0:a.length)&&void 0!==i?i:0)?"_empty":""}`))}_evaluate(){var t;const e=null!==(t=this.conditions)&&void 0!==t?t:[];let i;if(0===e.length)i="visible";else if((0,h.db)(e)){var a;const t="current"===(null===(a=this._entityContext)||void 0===a?void 0:a.mode)?{entity_id:this._entityContext.entityId}:{};i=(0,h.XH)(e,this.hass,t)?"visible":"hidden"}else i="invalid";i!==this.state&&(this.state=i)}constructor(...t){super(...t),this.conditions=[],this.state="visible",this._listeners=new l.x(this)}}m.styles=[c.x.styles,(0,s.AH)(u||(u=g`ha-alert{display:block;--mdc-icon-size:24px}.headline{font-weight:var(--ha-font-weight-medium);margin-bottom:var(--ha-space-1)}`))],(0,a.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"conditions",void 0),(0,a.Cg)([(0,n.wk)(),(0,o.Fg)({context:d.$,subscribe:!0})],m.prototype,"_entityContext",void 0),(0,a.Cg)([(0,n.MZ)()],m.prototype,"state",void 0),m=(0,a.Cg)([(0,n.EM)("ha-visibility-status")],m),e()}catch(p){e(p)}})},70559:function(t,e,i){i.a(t,async function(t,a){try{i.r(e),i.d(e,{HuiDialogEditSection:function(){return j}});i(3362),i(27495),i(25440),i(62953);var o=i(40445),s=i(5124),n=i(67576),l=i(6412),r=i(1087),c=i(57237),h=i(18350),d=(i(76538),i(93444),i(72554)),v=i(29823),p=(i(70947),i(26300)),u=i(66289),g=(i(62647),i(10763)),_=i(35952),m=i(91984),b=i(65063),y=i(14503),C=i(82360),f=i(75196),w=i(85633),A=i(36457),$=i(19490),k=i(36751),x=i(49365),M=t([h,d,v,p,u,g,A,$]);[h,d,v,p,u,g,A,$]=M.then?(await M)():M;let L,H,z,T,Z,q,V,E=t=>t;const S="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",D="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",P="M14 2H6C4.9 2 4 2.9 4 4V20C4 20.41 4.12 20.8 4.34 21.12C4.41 21.23 4.5 21.33 4.59 21.41C4.95 21.78 5.45 22 6 22H13.53C13 21.42 12.61 20.75 12.35 20H6V4H13V9H18V12C18.7 12 19.37 12.12 20 12.34V8L14 2M18 23L23 18.5L20 15.8L18 14V17H14V20H18V23Z",I="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",O=["tab-settings","tab-visibility"];class j extends s.WF{updated(t){if(this._yamlMode&&t.has("_yamlMode")){var e;const t=Object.assign({},this._config);null===(e=this._editor)||void 0===e||e.setValue(t)}}async showDialog(t){this._params=t,this._open=!0,this.lovelace=t.lovelace,this._config=(0,f.ys)(this._params.lovelaceConfig,[this._params.viewIndex,this._params.sectionIndex]),this._viewConfig=(0,f.ys)(this._params.lovelaceConfig,[this._params.viewIndex])}closeDialog(){return this._open=!1,!0}_dialogClosed(){this._params=void 0,this._yamlMode=!1,this._config=void 0,this._currTab=O[0],(0,r.r)(this,"dialog-closed",{dialog:this.localName})}render(){if(!this._params||!this._config)return s.s6;const t=this.hass.localize("ui.panel.lovelace.editor.edit_section.header");let e=s.s6;if(this._yamlMode)e=(0,s.qy)(L||(L=E` <ha-yaml-editor autofocus in-dialog @value-changed="${0}"></ha-yaml-editor> `),this._viewYamlChanged);else switch(this._currTab){case"tab-settings":e=(0,s.qy)(H||(H=E` <hui-section-settings-editor .hass="${0}" .config="${0}" .viewConfig="${0}" @value-changed="${0}"> </hui-section-settings-editor> `),this.hass,this._config,this._viewConfig,this._configChanged);break;case"tab-visibility":e=(0,s.qy)(z||(z=E` <hui-section-visibility-editor .hass="${0}" .config="${0}" @value-changed="${0}"> </hui-section-visibility-editor> `),this.hass,this._config,this._configChanged)}return(0,s.qy)(T||(T=E` <ha-dialog .open="${0}" prevent-scrim-close @keydown="${0}" @closed="${0}" class="${0}"> <ha-dialog-header show-border slot="header"> <ha-icon-button slot="navigationIcon" @click="${0}" .label="${0}" .path="${0}"></ha-icon-button> <span slot="title">${0}</span> <ha-dropdown slot="actionItems" placement="bottom-end" @closed="${0}" @wa-select="${0}"> <ha-icon-button slot="trigger" .label="${0}" .path="${0}"></ha-icon-button> <ha-dropdown-item value="toggle-yaml"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> ${0} </ha-dropdown-item> <ha-dropdown-item value="move-to-view"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> ${0} </ha-dropdown-item> </ha-dropdown> ${0} </ha-dialog-header> ${0} <ha-dialog-footer slot="footer"> <ha-button slot="secondaryAction" appearance="plain" @click="${0}"> ${0} </ha-button> <ha-button slot="primaryAction" @click="${0}"> ${0} </ha-button> </ha-dialog-footer> </ha-dialog> `),this._open,this._ignoreKeydown,this._dialogClosed,(0,l.H)({"yaml-mode":this._yamlMode}),this._cancel,this.hass.localize("ui.common.close"),S,t,c.d,this._handleAction,this.hass.localize("ui.common.menu"),D,I,this.hass.localize("ui.panel.lovelace.editor.edit_view.edit_"+(this._yamlMode?"ui":"yaml")),P,this.hass.localize("ui.panel.lovelace.editor.edit_view.move_to_view"),this._yamlMode?s.s6:(0,s.qy)(Z||(Z=E` <ha-tab-group @wa-tab-show="${0}"> ${0} </ha-tab-group> `),this._handleTabChanged,O.map(t=>(0,s.qy)(q||(q=E` <ha-tab-group-tab slot="nav" .panel="${0}" .active="${0}"> ${0} </ha-tab-group-tab> `),t,this._currTab===t,this.hass.localize(`ui.panel.lovelace.editor.edit_section.${t.replace("-","_")}`)))),e,this._cancel,this.hass.localize("ui.common.cancel"),this._save,this.hass.localize("ui.common.save"))}_configChanged(t){t.stopPropagation(),this._config=t.detail.value}_handleTabChanged(t){const e=t.detail.name;e!==this._currTab&&(this._currTab=e)}async _handleAction(t){switch(t.detail.item.value){case"toggle-yaml":this._yamlMode=!this._yamlMode;break;case"move-to-view":this._openSelectView()}}_openSelectView(){this._params&&this.lovelace&&(0,w.X)(this,{lovelaceConfig:this._params.lovelaceConfig,urlPath:this.lovelace.urlPath,allowDashboardChange:!0,header:this.hass.localize("ui.panel.lovelace.editor.move_section.header"),viewSelectedCallback:this._moveSectionToView})}_viewYamlChanged(t){t.stopPropagation(),t.detail.isValid&&(this._config=t.detail.value)}_ignoreKeydown(t){t.stopPropagation()}_cancel(t){t&&t.stopPropagation(),this.closeDialog()}async _save(){if(!this._params||!this._config)return;const t=(0,f.uZ)(this._params.lovelaceConfig,[this._params.viewIndex,this._params.sectionIndex],this._config);this._params.saveConfig(t),this.closeDialog()}static get styles(){return[y.nA,y.kO,(0,s.AH)(V||(V=E`ha-dialog{--dialog-content-padding:var(--ha-space-6)}ha-dialog.yaml-mode{--dialog-content-padding:0}ha-tab-group-tab{flex:1}ha-tab-group-tab::part(base){width:100%;justify-content:center}`))]}constructor(...t){super(...t),this._yamlMode=!1,this._currTab=O[0],this._open=!1,this._moveSectionToView=async(t,e,i)=>{if(!this._params||!this.lovelace)return;const a=e.views[i];if((0,m.R6)(a)||(0,k.E)(a)!==x._H)return void(0,b.showAlertDialog)(this,{title:this.hass.localize("ui.panel.lovelace.editor.move_section.error_title"),text:this.hass.localize("ui.panel.lovelace.editor.move_section.error_text"),warning:!0});const o=this._params.viewIndex,s=this._params.sectionIndex;if(t===this.lovelace.urlPath){var n,l;const t=this.lovelace.config,e=null!==(n=null===(l=a.sections)||void 0===l?void 0:l.length)&&void 0!==n?n:0;try{await this.lovelace.saveConfig((0,C.hB)(t,[o,s],[i,e])),this.lovelace.showToast({message:this.hass.localize("ui.panel.lovelace.editor.move_section.success"),duration:4e3,action:{action:async()=>{await this.lovelace.saveConfig(t)},text:this.hass.localize("ui.common.undo")}}),this.closeDialog()}catch(h){this.lovelace.showToast({message:this.hass.localize("ui.panel.lovelace.editor.move_section.error")}),console.error(h)}return}const r=this.lovelace.config,c=e;try{const e=(0,f.ys)(r,[o,s]);await(0,_.ql)(this.hass,t,(0,C.Bn)(c,i,e)),await this.lovelace.saveConfig((0,C.tA)(r,o,s)),this.lovelace.showToast({message:this.hass.localize("ui.panel.lovelace.editor.move_section.success"),duration:4e3,action:{action:async()=>{await(0,_.ql)(this.hass,t,c),await this.lovelace.saveConfig(r)},text:this.hass.localize("ui.common.undo")}}),this.closeDialog()}catch(h){this.lovelace.showToast({message:this.hass.localize("ui.panel.lovelace.editor.move_section.error")}),console.error(h)}}}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],j.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],j.prototype,"lovelace",void 0),(0,o.Cg)([(0,n.wk)()],j.prototype,"_params",void 0),(0,o.Cg)([(0,n.wk)()],j.prototype,"_config",void 0),(0,o.Cg)([(0,n.wk)()],j.prototype,"_viewConfig",void 0),(0,o.Cg)([(0,n.wk)()],j.prototype,"_yamlMode",void 0),(0,o.Cg)([(0,n.wk)()],j.prototype,"_currTab",void 0),(0,o.Cg)([(0,n.wk)()],j.prototype,"_open",void 0),(0,o.Cg)([(0,n.P)("ha-yaml-editor")],j.prototype,"_editor",void 0),j=(0,o.Cg)([(0,n.EM)("hui-dialog-edit-section")],j),a()}catch(L){a(L)}})},36457:function(t,e,i){i.a(t,async function(t,e){try{i(62953);var a=i(40445),o=i(5124),s=i(67576),n=i(22786),l=i(1087),r=i(52763),c=i(28918),h=t([r]);r=(h.then?(await h)():h)[0];let d,v=t=>t;const p="M17.5,12A1.5,1.5 0 0,1 16,10.5A1.5,1.5 0 0,1 17.5,9A1.5,1.5 0 0,1 19,10.5A1.5,1.5 0 0,1 17.5,12M14.5,8A1.5,1.5 0 0,1 13,6.5A1.5,1.5 0 0,1 14.5,5A1.5,1.5 0 0,1 16,6.5A1.5,1.5 0 0,1 14.5,8M9.5,8A1.5,1.5 0 0,1 8,6.5A1.5,1.5 0 0,1 9.5,5A1.5,1.5 0 0,1 11,6.5A1.5,1.5 0 0,1 9.5,8M6.5,12A1.5,1.5 0 0,1 5,10.5A1.5,1.5 0 0,1 6.5,9A1.5,1.5 0 0,1 8,10.5A1.5,1.5 0 0,1 6.5,12M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A1.5,1.5 0 0,0 13.5,19.5C13.5,19.11 13.35,18.76 13.11,18.5C12.88,18.23 12.73,17.88 12.73,17.5A1.5,1.5 0 0,1 14.23,16H16A5,5 0 0,0 21,11C21,6.58 16.97,3 12,3Z";class u extends o.WF{render(){var t,e;const i=void 0!==this.config.background,a=(0,c.o)(this.config.background),s={column_span:this.config.column_span||1,background_enabled:i,background_color:null!==(t=null==a?void 0:a.color)&&void 0!==t?t:"default",background_opacity:null!==(e=null==a?void 0:a.opacity)&&void 0!==e?e:50,theme:this.config.theme},n=this._schema(this.viewConfig.max_columns||4,i,this.hass.localize);return(0,o.qy)(d||(d=v` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .computeLabel="${0}" .computeHelper="${0}" @value-changed="${0}"></ha-form> `),this.hass,s,n,this._computeLabel,this._computeHelper,this._valueChanged)}_valueChanged(t){t.stopPropagation();const e=t.detail.value,i=Object.assign(Object.assign({},this.config),{},{column_span:e.column_span});if(e.background_enabled){const t=void 0!==e.background_color&&"default"!==e.background_color;i.background=Object.assign(Object.assign({},t?{color:e.background_color}:{}),{},{opacity:e.background_opacity})}else delete i.background;e.theme?i.theme=e.theme:delete i.theme,(0,l.r)(this,"value-changed",{value:i})}constructor(...t){super(...t),this._schema=(0,n.A)((t,e,i)=>[{name:"column_span",selector:{number:{min:1,max:t,slider_ticks:!0}}},{name:"background_enabled",selector:{boolean:{}}},...e?[{name:"background",type:"expandable",flatten:!0,expanded:!0,iconPath:p,schema:[{name:"background_color",selector:{ui_color:{extra_options:[{value:"default",label:i("ui.panel.lovelace.editor.edit_section.settings.background_color_default"),display_color:"var(--ha-section-background-color, var(--secondary-background-color))"}]}}},{name:"background_opacity",selector:{number:{min:0,max:100,step:1,unit_of_measurement:"%",mode:"slider"}}}]}]:[],{name:"theme",selector:{theme:{}}}]),this._computeLabel=t=>this.hass.localize(`ui.panel.lovelace.editor.edit_section.settings.${t.name}`),this._computeHelper=t=>this.hass.localize(`ui.panel.lovelace.editor.edit_section.settings.${t.name}_helper`)||""}}(0,a.Cg)([(0,s.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],u.prototype,"config",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],u.prototype,"viewConfig",void 0),u=(0,a.Cg)([(0,s.EM)("hui-section-settings-editor")],u),e()}catch(d){e(d)}})},19490:function(t,e,i){i.a(t,async function(t,e){try{var a=i(40445),o=i(5124),s=i(67576),n=i(1087),l=i(13898),r=i(30461),c=t([l,r]);[l,r]=c.then?(await c)():c;let h,d,v=t=>t;class p extends o.WF{render(){var t;const e=null!==(t=this.config.visibility)&&void 0!==t?t:[];return(0,o.qy)(h||(h=v` <ha-visibility-status .hass="${0}" .conditions="${0}"></ha-visibility-status> <ha-card-conditions-editor .hass="${0}" .conditions="${0}" @value-changed="${0}"> </ha-card-conditions-editor> `),this.hass,e,this.hass,e,this._valueChanged)}_valueChanged(t){var e;t.stopPropagation();const i=t.detail.value,a=Object.assign(Object.assign({},this.config),{},{visibility:i});0===(null===(e=a.visibility)||void 0===e?void 0:e.length)&&delete a.visibility,(0,n.r)(this,"value-changed",{value:a})}}p.styles=(0,o.AH)(d||(d=v`ha-visibility-status{margin-bottom:var(--ha-space-3)}`)),(0,a.Cg)([(0,s.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],p.prototype,"config",void 0),p=(0,a.Cg)([(0,s.EM)("hui-section-visibility-editor")],p),e()}catch(h){e(h)}})},85633:function(t,e,i){i.d(e,{X:function(){return o}});i(3362),i(62953);var a=i(1087);const o=(t,e)=>{(0,a.r)(t,"show-dialog",{dialogTag:"hui-dialog-select-view",dialogImport:()=>Promise.all([i.e(44335),i.e(40901)]).then(i.bind(i,54564)),dialogParams:e})}}}]);