UNPKG

iobroker.lovelace

Version:

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

3 lines 25.6 kB
/*! For license information please see 35940.d6ac2c17f9c063f2.js.LICENSE.txt */ export const __webpack_ids__=["35940"];export const __webpack_modules__={4918:function(e,t,i){i.d(t,{a:()=>f});var o=i(9065),a=i(80573),n={ROOT:"mdc-form-field"},r={LABEL_SELECTOR:".mdc-form-field > label"};const d=function(e){function t(i){var a=e.call(this,(0,o.__assign)((0,o.__assign)({},t.defaultAdapter),i))||this;return a.click=function(){a.handleClick()},a}return(0,o.__extends)(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return n},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return r},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{activateInputRipple:function(){},deactivateInputRipple:function(){},deregisterInteractionHandler:function(){},registerInteractionHandler:function(){}}},enumerable:!1,configurable:!0}),t.prototype.init=function(){this.adapter.registerInteractionHandler("click",this.click)},t.prototype.destroy=function(){this.adapter.deregisterInteractionHandler("click",this.click)},t.prototype.handleClick=function(){var e=this;this.adapter.activateInputRipple(),requestAnimationFrame((function(){e.adapter.deactivateInputRipple()}))},t}(a.K);var l=i(11911),s=i(88618),c=i(78611),h=i(57243),u=i(15093),m=i(35359);class f extends l.H{constructor(){super(...arguments),this.alignEnd=!1,this.spaceBetween=!1,this.nowrap=!1,this.label="",this.mdcFoundationClass=d}createAdapter(){return{registerInteractionHandler:(e,t)=>{this.labelEl.addEventListener(e,t)},deregisterInteractionHandler:(e,t)=>{this.labelEl.removeEventListener(e,t)},activateInputRipple:async()=>{const e=this.input;if(e instanceof s.Wg){const t=await e.ripple;t&&t.startPress()}},deactivateInputRipple:async()=>{const e=this.input;if(e instanceof s.Wg){const t=await e.ripple;t&&t.endPress()}}}}get input(){var e,t;return null!==(t=null===(e=this.slottedInputs)||void 0===e?void 0:e[0])&&void 0!==t?t:null}render(){const e={"mdc-form-field--align-end":this.alignEnd,"mdc-form-field--space-between":this.spaceBetween,"mdc-form-field--nowrap":this.nowrap};return h.dy` <div class="mdc-form-field ${(0,m.$)(e)}"> <slot></slot> <label class="mdc-label" @click="${this._labelClick}">${this.label}</label> </div>`}click(){this._labelClick()}_labelClick(){const e=this.input;e&&(e.focus(),e.click())}}(0,o.__decorate)([(0,u.Cb)({type:Boolean})],f.prototype,"alignEnd",void 0),(0,o.__decorate)([(0,u.Cb)({type:Boolean})],f.prototype,"spaceBetween",void 0),(0,o.__decorate)([(0,u.Cb)({type:Boolean})],f.prototype,"nowrap",void 0),(0,o.__decorate)([(0,u.Cb)({type:String}),(0,c.P)((async function(e){var t;null===(t=this.input)||void 0===t||t.setAttribute("aria-label",e)}))],f.prototype,"label",void 0),(0,o.__decorate)([(0,u.IO)(".mdc-form-field")],f.prototype,"mdcRoot",void 0),(0,o.__decorate)([(0,u.vZ)("",!0,"*")],f.prototype,"slottedInputs",void 0),(0,o.__decorate)([(0,u.IO)("label")],f.prototype,"labelEl",void 0)},6394:function(e,t,i){i.d(t,{W:()=>o});const o=i(57243).iv`.mdc-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.875rem;font-size:var(--mdc-typography-body2-font-size, .875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight,400);letter-spacing:.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, .0178571429em);text-decoration:inherit;text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));display:inline-flex;align-items:center;vertical-align:middle}.mdc-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}.mdc-form-field>label[dir=rtl],[dir=rtl] .mdc-form-field>label{margin-left:auto;margin-right:0}.mdc-form-field>label[dir=rtl],[dir=rtl] .mdc-form-field>label{padding-left:0;padding-right:4px}.mdc-form-field--nowrap>label{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}.mdc-form-field--align-end>label[dir=rtl],[dir=rtl] .mdc-form-field--align-end>label{margin-left:0;margin-right:auto}.mdc-form-field--align-end>label[dir=rtl],[dir=rtl] .mdc-form-field--align-end>label{padding-left:4px;padding-right:0}.mdc-form-field--space-between{justify-content:space-between}.mdc-form-field--space-between>label{margin:0}.mdc-form-field--space-between>label[dir=rtl],[dir=rtl] .mdc-form-field--space-between>label{margin:0}:host{display:inline-flex}.mdc-form-field{width:100%}::slotted(*){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.875rem;font-size:var(--mdc-typography-body2-font-size, .875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight,400);letter-spacing:.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, .0178571429em);text-decoration:inherit;text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}::slotted(mwc-switch){margin-right:10px}::slotted(mwc-switch[dir=rtl]),[dir=rtl] ::slotted(mwc-switch){margin-left:10px}`},99152:function(e,t,i){i.d(t,{V:()=>n});i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814);const o=Symbol("selection controller");class a{constructor(){this.selected=null,this.ordered=null,this.set=new Set}}class n{constructor(e){this.sets={},this.focusedSet=null,this.mouseIsDown=!1,this.updating=!1,e.addEventListener("keydown",(e=>{this.keyDownHandler(e)})),e.addEventListener("mousedown",(()=>{this.mousedownHandler()})),e.addEventListener("mouseup",(()=>{this.mouseupHandler()}))}static getController(e){const t=!("global"in e)||"global"in e&&e.global?document:e.getRootNode();let i=t[o];return void 0===i&&(i=new n(t),t[o]=i),i}keyDownHandler(e){const t=e.target;"checked"in t&&this.has(t)&&("ArrowRight"==e.key||"ArrowDown"==e.key?this.selectNext(t):"ArrowLeft"!=e.key&&"ArrowUp"!=e.key||this.selectPrevious(t))}mousedownHandler(){this.mouseIsDown=!0}mouseupHandler(){this.mouseIsDown=!1}has(e){return this.getSet(e.name).set.has(e)}selectPrevious(e){const t=this.getOrdered(e),i=t.indexOf(e),o=t[i-1]||t[t.length-1];return this.select(o),o}selectNext(e){const t=this.getOrdered(e),i=t.indexOf(e),o=t[i+1]||t[0];return this.select(o),o}select(e){e.click()}focus(e){if(this.mouseIsDown)return;const t=this.getSet(e.name),i=this.focusedSet;this.focusedSet=t,i!=t&&t.selected&&t.selected!=e&&t.selected.focus()}isAnySelected(e){const t=this.getSet(e.name);for(const e of t.set)if(e.checked)return!0;return!1}getOrdered(e){const t=this.getSet(e.name);return t.ordered||(t.ordered=Array.from(t.set),t.ordered.sort(((e,t)=>e.compareDocumentPosition(t)==Node.DOCUMENT_POSITION_PRECEDING?1:0))),t.ordered}getSet(e){return this.sets[e]||(this.sets[e]=new a),this.sets[e]}register(e){const t=e.name||e.getAttribute("name")||"",i=this.getSet(t);i.set.add(e),i.ordered=null}unregister(e){const t=this.getSet(e.name);t.set.delete(e),t.ordered=null,t.selected==e&&(t.selected=null)}update(e){if(this.updating)return;this.updating=!0;const t=this.getSet(e.name);if(e.checked){for(const i of t.set)i!=e&&(i.checked=!1);t.selected=e}if(this.isAnySelected(e))for(const e of t.set){if(void 0===e.formElementTabIndex)break;e.formElementTabIndex=e.checked?0:-1}this.updating=!1}}},94279:function(e,t,i){var o=i(44249),a=i(72621),n=(i(9359),i(31526),i(2394)),r=(i(30080),i(43631)),d=i(57243),l=i(15093),s=i(20552),c=i(36522);i(23334),i(7285),i(83166);(0,r.hC)("vaadin-combo-box-item",d.iv`:host{padding:0!important}:host([focused]:not([disabled])){background-color:rgba(var(--rgb-primary-text-color,0,0,0),.12)}:host([selected]:not([disabled])){background-color:transparent;color:var(--mdc-theme-primary);--mdc-ripple-color:var(--mdc-theme-primary);--mdc-theme-text-primary-on-background:var(--mdc-theme-primary)}:host([selected]:not([disabled])):before{background-color:var(--mdc-theme-primary);opacity:.12;content:"";position:absolute;top:0;left:0;width:100%;height:100%}:host([selected][focused]:not([disabled])):before{opacity:.24}:host(:hover:not([disabled])){background-color:transparent}[part=content]{width:100%}[part=checkmark]{display:none}`);(0,o.Z)([(0,l.Mo)("ha-combo-box")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,l.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,l.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,l.Cb)()],key:"placeholder",value:void 0},{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"validationMessage",value:void 0},{kind:"field",decorators:[(0,l.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,l.Cb)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"invalid",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"icon",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"items",value:void 0},{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"filteredItems",value:void 0},{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"dataProvider",value:void 0},{kind:"field",decorators:[(0,l.Cb)({attribute:"allow-custom-value",type:Boolean})],key:"allowCustomValue",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)({attribute:"item-value-path"})],key:"itemValuePath",value:()=>"value"},{kind:"field",decorators:[(0,l.Cb)({attribute:"item-label-path"})],key:"itemLabelPath",value:()=>"label"},{kind:"field",decorators:[(0,l.Cb)({attribute:"item-id-path"})],key:"itemIdPath",value:void 0},{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"renderer",value:void 0},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"required",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)({type:Boolean,reflect:!0})],key:"opened",value:()=>!1},{kind:"field",decorators:[(0,l.IO)("vaadin-combo-box-light",!0)],key:"_comboBox",value:void 0},{kind:"field",decorators:[(0,l.IO)("ha-textfield",!0)],key:"_inputElement",value:void 0},{kind:"field",key:"_overlayMutationObserver",value:void 0},{kind:"field",key:"_bodyMutationObserver",value:void 0},{kind:"method",key:"open",value:async function(){await this.updateComplete,this._comboBox?.open()}},{kind:"method",key:"focus",value:async function(){await this.updateComplete,await(this._inputElement?.updateComplete),this._inputElement?.focus()}},{kind:"method",key:"disconnectedCallback",value:function(){(0,a.Z)(i,"disconnectedCallback",this,3)([]),this._overlayMutationObserver&&(this._overlayMutationObserver.disconnect(),this._overlayMutationObserver=void 0),this._bodyMutationObserver&&(this._bodyMutationObserver.disconnect(),this._bodyMutationObserver=void 0)}},{kind:"get",key:"selectedItem",value:function(){return this._comboBox.selectedItem}},{kind:"method",key:"setInputValue",value:function(e){this._comboBox.value=e}},{kind:"method",key:"render",value:function(){return d.dy` <vaadin-combo-box-light .itemValuePath="${this.itemValuePath}" .itemIdPath="${this.itemIdPath}" .itemLabelPath="${this.itemLabelPath}" .items="${this.items}" .value="${this.value||""}" .filteredItems="${this.filteredItems}" .dataProvider="${this.dataProvider}" .allowCustomValue="${this.allowCustomValue}" .disabled="${this.disabled}" .required="${this.required}" ${(0,n.t)(this.renderer||this._defaultRowRenderer)} @opened-changed="${this._openedChanged}" @filter-changed="${this._filterChanged}" @value-changed="${this._valueChanged}" attr-for-value="value"> <ha-textfield label="${(0,s.o)(this.label)}" placeholder="${(0,s.o)(this.placeholder)}" ?disabled="${this.disabled}" ?required="${this.required}" validationMessage="${(0,s.o)(this.validationMessage)}" .errorMessage="${this.errorMessage}" class="input" autocapitalize="none" autocomplete="off" autocorrect="off" input-spellcheck="false" .suffix="${d.dy`<div style="width:28px" role="none presentation"></div>`}" .icon="${this.icon}" .invalid="${this.invalid}" .helper="${this.helper}" helperPersistent> <slot name="icon" slot="leadingIcon"></slot> </ha-textfield> ${this.value?d.dy`<ha-svg-icon role="button" tabindex="-1" aria-label="${(0,s.o)(this.hass?.localize("ui.common.clear"))}" class="clear-button" .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"}" @click="${this._clearValue}"></ha-svg-icon>`:""} <ha-svg-icon role="button" tabindex="-1" aria-label="${(0,s.o)(this.label)}" aria-expanded="${this.opened?"true":"false"}" class="toggle-button" .path="${this.opened?"M7,15L12,10L17,15H7Z":"M7,10L12,15L17,10H7Z"}" @click="${this._toggleOpen}"></ha-svg-icon> </vaadin-combo-box-light> `}},{kind:"field",key:"_defaultRowRenderer",value(){return e=>d.dy`<ha-list-item> ${this.itemLabelPath?e[this.itemLabelPath]:e} </ha-list-item>`}},{kind:"method",key:"_clearValue",value:function(e){e.stopPropagation(),(0,c.B)(this,"value-changed",{value:void 0})}},{kind:"method",key:"_toggleOpen",value:function(e){this.opened?(this._comboBox?.close(),e.stopPropagation()):this._comboBox?.inputElement.focus()}},{kind:"method",key:"_openedChanged",value:function(e){e.stopPropagation();const t=e.detail.value;if(setTimeout((()=>{this.opened=t}),0),(0,c.B)(this,"opened-changed",{value:e.detail.value}),t){const e=document.querySelector("vaadin-combo-box-overlay");e&&this._removeInert(e),this._observeBody()}else this._bodyMutationObserver?.disconnect(),this._bodyMutationObserver=void 0}},{kind:"method",key:"_observeBody",value:function(){"MutationObserver"in window&&!this._bodyMutationObserver&&(this._bodyMutationObserver=new MutationObserver((e=>{e.forEach((e=>{e.addedNodes.forEach((e=>{"VAADIN-COMBO-BOX-OVERLAY"===e.nodeName&&this._removeInert(e)})),e.removedNodes.forEach((e=>{"VAADIN-COMBO-BOX-OVERLAY"===e.nodeName&&(this._overlayMutationObserver?.disconnect(),this._overlayMutationObserver=void 0)}))}))})),this._bodyMutationObserver.observe(document.body,{childList:!0}))}},{kind:"method",key:"_removeInert",value:function(e){if(e.inert)return e.inert=!1,this._overlayMutationObserver?.disconnect(),void(this._overlayMutationObserver=void 0);"MutationObserver"in window&&!this._overlayMutationObserver&&(this._overlayMutationObserver=new MutationObserver((e=>{e.forEach((e=>{if("inert"===e.attributeName){const t=e.target;t.inert&&(this._overlayMutationObserver?.disconnect(),this._overlayMutationObserver=void 0,t.inert=!1)}}))})),this._overlayMutationObserver.observe(e,{attributes:!0}))}},{kind:"method",key:"_filterChanged",value:function(e){e.stopPropagation(),(0,c.B)(this,"filter-changed",{value:e.detail.value})}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation(),this.allowCustomValue||(this._comboBox._closeOnBlurIsPrevented=!0);const t=e.detail.value;t!==this.value&&(0,c.B)(this,"value-changed",{value:t||void 0})}},{kind:"field",static:!0,key:"styles",value:()=>d.iv`:host{display:block;width:100%}vaadin-combo-box-light{position:relative;--vaadin-combo-box-overlay-max-height:calc(45vh - 56px)}ha-textfield{width:100%}ha-textfield>ha-icon-button{--mdc-icon-button-size:24px;padding:2px;color:var(--secondary-text-color)}ha-svg-icon{color:var(--input-dropdown-icon-color);position:absolute;cursor:pointer}.toggle-button{right:12px;top:-10px;inset-inline-start:initial;inset-inline-end:12px;direction:var(--direction)}:host([opened]) .toggle-button{color:var(--primary-color)}.clear-button{--mdc-icon-size:20px;top:-7px;right:36px;inset-inline-start:initial;inset-inline-end:36px;direction:var(--direction)}`}]}}),d.oi)},55486:function(e,t,i){var o=i(44249),a=i(4918),n=i(6394),r=i(57243),d=i(15093),l=i(35359),s=i(36522);(0,o.Z)([(0,d.Mo)("ha-formfield")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,d.Cb)({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"method",key:"render",value:function(){const e={"mdc-form-field--align-end":this.alignEnd,"mdc-form-field--space-between":this.spaceBetween,"mdc-form-field--nowrap":this.nowrap};return r.dy` <div class="mdc-form-field ${(0,l.$)(e)}"> <slot></slot> <label class="mdc-label" @click="${this._labelClick}"> <slot name="label">${this.label}</slot> </label> </div>`}},{kind:"method",key:"_labelClick",value:function(){const e=this.input;if(e&&(e.focus(),!e.disabled))switch(e.tagName){case"HA-CHECKBOX":e.checked=!e.checked,(0,s.B)(e,"change");break;case"HA-RADIO":e.checked=!0,(0,s.B)(e,"change");break;default:e.click()}}},{kind:"field",static:!0,key:"styles",value:()=>[n.W,r.iv`:host(:not([alignEnd])) ::slotted(ha-switch){margin-right:10px;margin-inline-end:10px;margin-inline-start:inline}.mdc-form-field{align-items:var(--ha-formfield-align-items,center);gap:4px}.mdc-form-field>label{direction:var(--direction);margin-inline-start:0;margin-inline-end:auto;padding:0}:host([disabled]) label{color:var(--disabled-text-color)}`]}]}}),a.a)},21393:function(e,t,i){i.r(t),i.d(t,{HaIconPicker:()=>m});var o=i(44249),a=(i(92745),i(9359),i(56475),i(31526),i(70104),i(52924),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(57243)),n=i(15093),r=i(27486),d=i(36522),l=i(80654);i(94279),i(7285),i(65981);let s=[],c=!1;const h=async e=>{try{const t=l.g[e].getIconList;if("function"!=typeof t)return[];const i=await t();return i.map((t=>({icon:`${e}:${t.name}`,parts:new Set(t.name.split("-")),keywords:t.keywords??[]})))}catch(t){return console.warn(`Unable to load icon list for ${e} iconset`),[]}},u=e=>a.dy`<ha-list-item graphic="avatar"> <ha-icon .icon="${e.icon}" slot="graphic"></ha-icon> ${e.icon} </ha-list-item>`;let m=(0,o.Z)([(0,n.Mo)("ha-icon-picker")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"placeholder",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"required",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"invalid",value:()=>!1},{kind:"method",key:"render",value:function(){return a.dy` <ha-combo-box .hass="${this.hass}" item-value-path="icon" item-label-path="icon" .value="${this._value}" allow-custom-value .dataProvider="${c?this._iconProvider:void 0}" .label="${this.label}" .helper="${this.helper}" .disabled="${this.disabled}" .required="${this.required}" .placeholder="${this.placeholder}" .errorMessage="${this.errorMessage}" .invalid="${this.invalid}" .renderer="${u}" icon @opened-changed="${this._openedChanged}" @value-changed="${this._valueChanged}"> ${this._value||this.placeholder?a.dy` <ha-icon .icon="${this._value||this.placeholder}" slot="icon"> </ha-icon> `:a.dy`<slot slot="icon" name="fallback"></slot>`} </ha-combo-box> `}},{kind:"field",key:"_filterIcons",value:()=>(0,r.Z)(((e,t=s)=>{if(!e)return t;const i=[],o=(e,t)=>i.push({icon:e,rank:t});for(const i of t)i.parts.has(e)?o(i.icon,1):i.keywords.includes(e)?o(i.icon,2):i.icon.includes(e)?o(i.icon,3):i.keywords.some((t=>t.includes(e)))&&o(i.icon,4);return 0===i.length&&o(e,0),i.sort(((e,t)=>e.rank-t.rank))}))},{kind:"field",key:"_iconProvider",value(){return(e,t)=>{const i=this._filterIcons(e.filter.toLowerCase(),s),o=e.page*e.pageSize,a=o+e.pageSize;t(i.slice(o,a),i.length)}}},{kind:"method",key:"_openedChanged",value:async function(e){e.detail.value&&!c&&(await(async()=>{c=!0;const e=await i.e("25016").then(i.t.bind(i,58134,19));s=e.default.map((e=>({icon:`mdi:${e.name}`,parts:new Set(e.name.split("-")),keywords:e.keywords})));const t=[];Object.keys(l.g).forEach((e=>{t.push(h(e))})),(await Promise.all(t)).forEach((e=>{s.push(...e)}))})(),this.requestUpdate())}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation(),this._setValue(e.detail.value)}},{kind:"method",key:"_setValue",value:function(e){this.value=e,(0,d.B)(this,"value-changed",{value:this._value},{bubbles:!1,composed:!1})}},{kind:"get",key:"_value",value:function(){return this.value||""}},{kind:"field",static:!0,key:"styles",value:()=>a.iv`[slot=icon]{color:var(--primary-text-color);position:relative;bottom:2px}[slot=prefix]{margin-right:8px;margin-inline-end:8px;margin-inline-start:initial}`}]}}),a.oi)},72781:function(e,t,i){var o=i(44249),a=i(47711),n=i(81577),r=i(57243),d=i(15093);(0,o.Z)([(0,d.Mo)("ha-radio")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",static:!0,key:"styles",value:()=>[n.W,r.iv`:host{--mdc-theme-secondary:var(--primary-color)}`]}]}}),a.J)},17092:function(e,t,i){i.r(t);var o=i(44249),a=i(57243),n=i(15093),r=i(36522),d=(i(55486),i(21393),i(72781),i(83166),i(28008));(0,o.Z)([(0,n.Mo)("ha-input_datetime-form")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"new",value:()=>!1},{kind:"field",key:"_item",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_name",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_icon",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_mode",value:void 0},{kind:"set",key:"item",value:function(e){this._item=e,e?(this._name=e.name||"",this._icon=e.icon||"",this._mode=e.has_time&&e.has_date?"datetime":e.has_time?"time":"date",this._item.has_date=!e.has_date&&!e.has_time||e.has_date):(this._name="",this._icon="",this._mode="date")}},{kind:"method",key:"focus",value:function(){this.updateComplete.then((()=>this.shadowRoot?.querySelector("[dialogInitialFocus]")?.focus()))}},{kind:"method",key:"render",value:function(){return this.hass?a.dy` <div class="form"> <ha-textfield .value="${this._name}" .configValue="${"name"}" @input="${this._valueChanged}" .label="${this.hass.localize("ui.dialogs.helper_settings.generic.name")}" autoValidate required .validationMessage="${this.hass.localize("ui.dialogs.helper_settings.required_error_msg")}" dialogInitialFocus></ha-textfield> <ha-icon-picker .hass="${this.hass}" .value="${this._icon}" .configValue="${"icon"}" @value-changed="${this._valueChanged}" .label="${this.hass.localize("ui.dialogs.helper_settings.generic.icon")}"></ha-icon-picker> <br> ${this.hass.localize("ui.dialogs.helper_settings.input_datetime.mode")}: <br> <ha-formfield .label="${this.hass.localize("ui.dialogs.helper_settings.input_datetime.date")}"> <ha-radio name="mode" value="date" .checked="${"date"===this._mode}" @change="${this._modeChanged}"></ha-radio> </ha-formfield> <ha-formfield .label="${this.hass.localize("ui.dialogs.helper_settings.input_datetime.time")}"> <ha-radio name="mode" value="time" .checked="${"time"===this._mode}" @change="${this._modeChanged}"></ha-radio> </ha-formfield> <ha-formfield .label="${this.hass.localize("ui.dialogs.helper_settings.input_datetime.datetime")}"> <ha-radio name="mode" value="datetime" .checked="${"datetime"===this._mode}" @change="${this._modeChanged}"></ha-radio> </ha-formfield> </div> `:a.Ld}},{kind:"method",key:"_modeChanged",value:function(e){const t=e.target.value;(0,r.B)(this,"value-changed",{value:{...this._item,has_time:["time","datetime"].includes(t),has_date:["date","datetime"].includes(t)}})}},{kind:"method",key:"_valueChanged",value:function(e){if(!this.new&&!this._item)return;e.stopPropagation();const t=e.target.configValue,i=e.detail?.value||e.target.value;if(this[`_${t}`]===i)return;const o={...this._item};i?o[t]=i:delete o[t],(0,r.B)(this,"value-changed",{value:o})}},{kind:"get",static:!0,key:"styles",value:function(){return[d.Qx,a.iv`.form{color:var(--primary-text-color)}.row{padding:16px 0}ha-textfield{display:block;margin:8px 0}`]}}]}}),a.oi)},30338:function(e,t,i){var o=i(97934),a=i(71998),n=i(4576),r=i(36760);e.exports=function(e,t){t&&"string"==typeof e||a(e);var i=r(e);return n(a(void 0!==i?o(i,e):e))}},25677:function(e,t,i){var o=i(40810),a=i(97934),n=i(63983),r=i(71998),d=i(4576),l=i(30338),s=i(79995),c=i(14181),h=i(92288),u=s((function(){for(var e,t,i=this.iterator,o=this.mapper;;){if(t=this.inner)try{if(!(e=r(a(t.next,t.iterator))).done)return e.value;this.inner=null}catch(e){c(i,"throw",e)}if(e=r(a(this.next,i)),this.done=!!e.done)return;try{this.inner=l(o(e.value,this.counter++),!1)}catch(e){c(i,"throw",e)}}}));o({target:"Iterator",proto:!0,real:!0,forced:h},{flatMap:function(e){return r(this),n(e),new u(d(this),{mapper:e,inner:null})}})}}; //# sourceMappingURL=35940.d6ac2c17f9c063f2.js.map