UNPKG

iobroker.lovelace

Version:

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

7 lines 22.8 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[26092],{32023:function(e,t,i){i(62953);var o=i(40445),s=i(42034),l=i(20832),r=i(63374),n=i(75640),a=i(91735),c=i(43826),d=i(5124),h=i(67576);let m,u,p=e=>e;class v extends l.${renderLeadingIcon(){return this.noLeadingIcon?(0,d.qy)(m||(m=p``)):super.renderLeadingIcon()}constructor(...e){super(...e),this.noLeadingIcon=!1}}v.styles=[a.R,s.R,c.R,n.R,r.R,(0,d.AH)(u||(u=p`:host{--md-sys-color-primary:var(--primary-text-color);--md-sys-color-on-surface:var(--primary-text-color);--md-sys-color-on-surface-variant:var(--primary-text-color);--md-sys-color-on-secondary-container:var(--primary-text-color);--md-filter-chip-container-shape:var(--ha-border-radius-md);--md-filter-chip-outline-color:var(--outline-color);--md-filter-chip-selected-container-color:rgba( var(--rgb-primary-text-color), 0.15 );--_label-text-font:var(--ha-font-family-body)}`))],(0,o.Cg)([(0,h.MZ)({type:Boolean,reflect:!0,attribute:"no-leading-icon"})],v.prototype,"noLeadingIcon",void 0),v=(0,o.Cg)([(0,h.EM)("ha-filter-chip")],v)},75064:function(e,t,i){i(62953);var o=i(40445),s=i(5124),l=i(67576),r=i(2846);let n;class a extends r.G{constructor(...e){super(...e),this.borderTop=!1}}a.styles=[...r.J,(0,s.AH)(n||(n=(e=>e)`:host{--md-list-item-one-line-container-height:48px;--md-list-item-two-line-container-height:64px}:host([border-top]) md-item{border-top:1px solid var(--divider-color)}[slot=start]{--state-icon-color:var(--secondary-text-color)}[slot=overline]{line-height:1.15rem;font-size:calc(var(--mdc-typography-subtitle1-font-size, 1rem) * .75);font-weight:var(--mdc-typography-subtitle1-font-weight,400);font-family:var( --mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family) );color:var(--mdc-select-label-ink-color,rgba(0,0,0,.6))}[slot=headline]{line-height:var(--ha-line-height-normal);font-size:var(--ha-font-size-m);white-space:nowrap}[slot=supporting-text]{line-height:var(--ha-line-height-normal);font-size:var(--ha-font-size-s);white-space:nowrap}::slotted(img),::slotted(state-badge){width:32px;height:32px}::slotted(.code){font-family:var(--ha-font-family-code);font-size:var(--ha-font-size-xs)}::slotted(.domain){font-size:var(--ha-font-size-s);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal);align-self:flex-end;max-width:30%;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}`))],(0,o.Cg)([(0,l.MZ)({type:Boolean,reflect:!0,attribute:"border-top"})],a.prototype,"borderTop",void 0),a=(0,o.Cg)([(0,l.EM)("ha-combo-box-item")],a)},2846:function(e,t,i){i.d(t,{G:function(){return m},J:function(){return h}});var o=i(40445),s=i(58168),l=i(82553),r=i(5124),n=i(67576);i(54276);let a,c,d=e=>e;const h=[l.R,(0,r.AH)(a||(a=d`:host{--ha-icon-display:block;--md-sys-color-primary:var(--primary-text-color);--md-sys-color-secondary:var(--secondary-text-color);--md-sys-color-surface:var(--card-background-color);--md-sys-color-on-surface:var(--primary-text-color);--md-sys-color-on-surface-variant:var(--secondary-text-color)}md-item{overflow:var(--md-item-overflow,hidden);align-items:var(--md-item-align-items,center);gap:var(--ha-md-list-item-gap,16px)}`))];class m extends s.n{renderRipple(){return"text"===this.type?r.s6:(0,r.qy)(c||(c=d`<ha-ripple part="ripple" for="item" ?disabled="${0}"></ha-ripple>`),this.disabled&&"link"!==this.type)}}m.styles=h,m=(0,o.Cg)([(0,n.EM)("ha-md-list-item")],m)},49639:function(e,t,i){i.a(e,async function(e,o){try{i.d(t,{A1:function(){return j},LE:function(){return K},RR:function(){return B}});i(44114),i(26910),i(18111),i(22489),i(7588),i(61701),i(42762),i(62953);var s=i(40445),l=i(35211),r=i(78648),n=i(5124),a=i(67576),c=i(22786),d=i(91335),h=i(1087),m=i(52220),u=i(22792),p=i(59992),v=i(59653),g=i(14503),f=i(85614),_=i(88438),y=(i(5745),i(32023),i(75064),i(47680),i(26300)),b=(i(67094),i(36866)),x=e([y,b,p]);[y,b,p]=x.then?(await x)():x;let I,w,C,S,z,E,$,k,L,M,q,A,F,V,Z,T=e=>e;const H="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z",P="M19,19V5H5V19H19M19,3A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V5C3,3.89 3.9,3 5,3H19M17,11V13H7V11H17Z",R="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",j=[{name:"primary",weight:10},{name:"secondary",weight:7},{name:"id",weight:3}],B="___no_items_available___",O="___padding___",K=e=>(0,n.qy)(I||(I=T` ${0} <span slot="headline">${0}</span> ${0}`),e.icon?(0,n.qy)(w||(w=T`<ha-icon slot="start" .icon="${0}"></ha-icon>`),e.icon):e.icon_path?(0,n.qy)(C||(C=T`<ha-svg-icon slot="start" .path="${0}"></ha-svg-icon>`),e.icon_path):n.s6,e.primary,e.secondary?(0,n.qy)(S||(S=T`<span slot="supporting-text">${0}</span>`),e.secondary):n.s6),D=e=>(0,n.qy)(z||(z=T`<ha-combo-box-item type="button" compact="compact"> ${0} </ha-combo-box-item>`),K(e));class U extends((0,p.V)(n.WF)){setFieldValue(e){this._searchFieldElement&&(this._searchFieldElement.value=e)}get scrollableElement(){return this.virtualizerElement}firstUpdated(){this._registerKeyboardShortcuts()}willUpdate(){this.hasUpdated||((0,f.i)(),this._selectedSection=this.selectedSection,this._allItems=this._getItems(),this._items=this._allItems)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this._removeKeyboardShortcuts)||void 0===e||e.call(this)}refreshItems(){var e;this._allItems=this._getItems(),(!this._search||null!==(e=this.sections)&&void 0!==e&&e.length)&&(this._items=this._allItems)}render(){var e,t,i,o,s,l,r,a;const c=null!==(e=this.label)&&void 0!==e?e:this.allowCustomValue?null!==(t=null===(i=this.i18n)||void 0===i||null===(o=i.localize)||void 0===o?void 0:o.call(i,"ui.components.combo-box.search_or_custom"))&&void 0!==t?t:"Search | Add custom value":null!==(s=null===(l=this.i18n)||void 0===l||null===(r=l.localize)||void 0===r?void 0:r.call(l,"ui.common.search"))&&void 0!==s?s:"Search";return(0,n.qy)(E||(E=T`<ha-input-search appearance="outlined" .placeholder="${0}" @blur="${0}" @input="${0}"> </ha-input-search> ${0} ${0} <div class="virtualizer-wrapper"> <lit-virtualizer .keyFunction="${0}" tabindex="0" scroller .items="${0}" .renderItem="${0}" style="min-height:36px" class="${0}" .layout="${0}" @unpinned="${0}" @scroll="${0}" @focus="${0}" @blur="${0}" @visibilityChanged="${0}"> </lit-virtualizer> ${0} </div>`),c,this._resetSelectedItem,this._filterChanged,this._renderSectionButtons(),null!==(a=this.sections)&&void 0!==a&&a.length?(0,n.qy)($||($=T` <div class="section-title-wrapper"> <div class="section-title ${0}"> ${0} </div> </div> `),!this._selectedSection&&this._sectionTitle?"show":"",this._sectionTitle):n.s6,this._keyFunction,this._items,this._renderItem,this._listScrolled?"scrolled":"",this.value&&this._valuePinned?{pin:{index:this._getInitialSelectedIndex(),block:"center"}}:void 0,this._handleUnpinned,this._onScrollList,this._focusList,this._resetSelectedItem,this._visibilityChanged,this.renderScrollableFades())}_renderSectionButtons(){return this.sections&&0!==this.sections.length?(0,n.qy)(k||(k=T` <ha-chip-set class="sections"> ${0} </ha-chip-set> `),this.sections.map(e=>"separator"===e?(0,n.qy)(L||(L=T`<div class="separator"></div>`)):(0,n.qy)(M||(M=T`<ha-filter-chip @mousedown="${0}" @click="${0}" .section-id="${0}" .selected="${0}" .label="${0}"> </ha-filter-chip>`),_.C?void 0:this._preventBlur,this._toggleSection,e.id,this._selectedSection===e.id,e.label))):n.s6}_visibilityChanged(e){var t;if(this.virtualizerElement&&this.sectionTitleFunction&&null!==(t=this.sections)&&void 0!==t&&t.length){const t=this.virtualizerElement.items[e.first],i=this.virtualizerElement.items[e.first+1];this._sectionTitle=this.sectionTitleFunction({firstIndex:e.first,lastIndex:e.last,firstItem:t,secondItem:i,itemsCount:this.virtualizerElement.items.length})}}_handleUnpinned(){this._valuePinned=!1}_onScrollList(e){var t;const i=null!==(t=e.target.scrollTop)&&void 0!==t?t:0;this._listScrolled=i>0}_fireSelectedEvents(e,t,i=!1){(0,h.r)(this,"value-changed",{value:e}),(0,h.r)(this,"index-selected",{index:t,newTab:i})}_preventBlur(e){e.preventDefault()}_toggleSection(e){var t;e.stopPropagation(),this._resetSelectedItem(),this._sectionTitle=void 0;const i=e.target["section-id"];i&&(this._selectedSection===i?this._selectedSection=void 0:this._selectedSection=i,this._items=this._getItems(),null===(t=this.virtualizerElement)||void 0===t||null===(t=t.element(0))||void 0===t||t.scrollIntoView())}_registerKeyboardShortcuts(){this._removeKeyboardShortcuts=(0,d.Tc)(this,{ArrowUp:this._selectPreviousItem,ArrowDown:this._selectNextItem,Home:this._selectFirstItem,End:this._selectLastItem,Enter:this._pickSelectedItem,"$mod+Enter":this._pickSelectedItemNewTab})}_focusList(){-1===this._selectedItemIndex&&this._initializeSelectedIndex()}_initializeSelectedIndex(){var e;if(null===(e=this.virtualizerElement)||void 0===e||null===(e=e.items)||void 0===e||!e.length)return;const t=this._getInitialSelectedIndex();if(0===t&&!this._search)return;let i=t;"string"==typeof this.virtualizerElement.items[i]&&(i+=1),i>=this.virtualizerElement.items.length||(this._selectedItemIndex=i,this._scrollToSelectedItem())}_resetSelectedItem(){var e;null===(e=this.virtualizerElement)||void 0===e||null===(e=e.querySelector(".selected"))||void 0===e||e.classList.remove("selected"),this._selectedItemIndex=-1}_getInitialSelectedIndex(){if(!this.virtualizerElement||this._search||!this.value)return 0;const e=this.virtualizerElement.items.findIndex(e=>"string"!=typeof e&&e.id===this.value);return-1===e?0:e}static get styles(){return[...super.styles,g.dp,(0,n.AH)(q||(q=T`:host{display:flex;flex-direction:column;padding-top:var(--ha-space-4);flex:1}:host([clearable]){--text-field-padding-top:0;--text-field-padding-bottom:0;--text-field-padding-start:var(--ha-space-4);--text-field-padding-end:0}ha-input-search{padding:0 var(--ha-space-3) var(--ha-space-3)}:host([mode=dialog]) ha-input-search{padding:0 var(--ha-space-4) var(--ha-space-3)}ha-combo-box-item{width:100%}ha-combo-box-item.selected{background-color:var(--ha-color-fill-neutral-quiet-hover)}@media (prefers-color-scheme:dark){ha-combo-box-item.selected{background-color:var(--ha-color-fill-neutral-normal-hover)}}.virtualizer-wrapper{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}lit-virtualizer{flex:1}lit-virtualizer:focus-visible{outline:0}lit-virtualizer.scrolled{border-top:1px solid var(--ha-color-border-neutral-quiet)}.bottom-padding{height:max(var(--safe-area-inset-bottom,0px),var(--ha-space-8));width:100%}.empty{text-align:center}.combo-box-row{display:flex;width:100%;align-items:center;box-sizing:border-box;min-height:36px}.combo-box-row.current-value{background-color:var(--ha-color-fill-primary-quiet-resting)}.combo-box-row.selected{background-color:var(--ha-color-fill-neutral-quiet-hover)}@media (prefers-color-scheme:dark){.combo-box-row.selected{background-color:var(--ha-color-fill-neutral-normal-hover)}}.sections{display:flex;flex-wrap:nowrap;gap:var(--ha-space-2);padding:0 var(--ha-space-3) var(--ha-space-3);overflow:auto}:host([mode=dialog]) .sections{padding:0 var(--ha-space-4) var(--ha-space-3)}.sections ha-filter-chip{flex-shrink:0;--md-filter-chip-selected-container-color:var(--ha-color-fill-primary-normal-hover);color:var(--primary-color)}.sections .separator{height:var(--ha-space-8);width:0;border:1px solid var(--ha-color-border-neutral-quiet)}.section-title,.title{box-sizing:border-box;background-color:var(--ha-color-fill-neutral-quiet-resting);padding:var(--ha-space-1) var(--ha-space-4);font-weight:var(--ha-font-weight-bold);color:var(--secondary-text-color);min-height:var(--ha-space-6);display:flex;align-items:center}.title{width:100%}:host([mode=dialog]) .title{padding:var(--ha-space-1) var(--ha-space-4)}.section-title-wrapper{height:0;position:relative}.section-title{opacity:0;position:absolute;top:1px;width:calc(100% - var(--ha-space-4))}.section-title.show{opacity:1;z-index:1}.empty-search{display:flex;width:100%;flex-direction:column;align-items:center;padding:var(--ha-space-3)}`))]}constructor(...e){super(...e),this.autofocus=!1,this.disabled=!1,this.required=!1,this._listScrolled=!1,this.mode="popover",this.clearable=!1,this.noSort=!1,this._items=[],this._valuePinned=!0,this._allItems=[],this._selectedItemIndex=-1,this._search="",this._getAdditionalItems=e=>{var t;return(null===(t=this.getAdditionalItems)||void 0===t?void 0:t.call(this,e))||[]},this._getItems=()=>{var e;let t=[...this.getItems(this._search,this._selectedSection)||[]];null!==(e=this.sections)&&void 0!==e&&e.length||this.noSort||(t=t.sort((e,t)=>{var i,o;const s="string"==typeof e?e:e.sorting_label,l="string"==typeof t?t:t.sorting_label;return s&&l?l?s?(0,m.SH)(s,l,null!==(i=null===(o=this.i18n)||void 0===o||null===(o=o.locale)||void 0===o?void 0:o.language)&&void 0!==i?i:navigator.language):1:-1:0})),t.length||this.allowCustomValue||t.push({id:B,primary:""});const i=this._getAdditionalItems();var o,s,l,r;(t.push(...i),this.allowCustomValue&&this._search)&&t.push({id:this._search,primary:null!==(o=null!==(s=this.customValueLabel)&&void 0!==s?s:null===(l=this.i18n)||void 0===l||null===(r=l.localize)||void 0===r?void 0:r.call(l,"ui.components.combo-box.add_custom_item"))&&void 0!==o?o:"Add custom item",secondary:`"${this._search}"`,icon_path:R});return"dialog"===this.mode&&t.push({id:O,primary:""}),t},this._renderItem=(e,t)=>{if(!e)return n.s6;if(e.id===O)return(0,n.qy)(A||(A=T`<div class="bottom-padding"></div>`));var i,o,s,l;if(e.id===B)return(0,n.qy)(F||(F=T` <div class="combo-box-row"> <ha-combo-box-item type="text" compact="compact"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> <span slot="headline">${0}</span> </ha-combo-box-item> </div> `),this._search?H:P,this._search?"function"==typeof this.notFoundLabel?this.notFoundLabel(this._search):this.notFoundLabel||(null===(i=this.i18n)||void 0===i||null===(o=i.localize)||void 0===o?void 0:o.call(i,"ui.components.combo-box.no_match"))||"No matching items found":this.emptyLabel||(null===(s=this.i18n)||void 0===s||null===(l=s.localize)||void 0===l?void 0:l.call(s,"ui.components.combo-box.no_items"))||"No items available");if("string"==typeof e)return(0,n.qy)(V||(V=T`<div class="title">${0}</div>`),e);const r=this.rowRenderer||D;return(0,n.qy)(Z||(Z=T`<div id="${0}" class="combo-box-row ${0}" .value="${0}" .index="${0}" .disabled="${0}" @click="${0}"> ${0} </div>`),`list-item-${t}`,this.value===e.id?"current-value":"",e.id,t,e.disabled,this._valueSelected,r(e,t))},this._valueSelected=e=>{e.stopPropagation();const{disabled:t,index:i,value:o}=e.currentTarget;if(t)return;const s=null==o?void 0:o.trim(),l=e.ctrlKey||e.metaKey;this._fireSelectedEvents(s,i,l)},this._fuseIndex=(0,c.A)((e,t)=>r.A.createIndex(t||j,e)),this._filterChanged=e=>{var t,i;const o=(null!==(t=e.target.value)&&void 0!==t?t:"").trim();if(this._search=o,null!==(i=this.sections)&&void 0!==i&&i.length)this._items=this._getItems();else{if(!o)return void(this._items=this._allItems);const e=this._fuseIndex(this._allItems,this.searchKeys);let t=(0,v.x)(this._allItems,o,this.searchKeys||j,e=>e.id,e);t.length||this.allowCustomValue||t.push({id:B,primary:""});const i=this._getAdditionalItems(o);var s,l,r,n;if(t.push(...i),this.searchFn&&(t=this.searchFn(o,t,this._allItems)),this.allowCustomValue&&o)t.push({id:o,primary:null!==(s=null!==(l=this.customValueLabel)&&void 0!==l?l:null===(r=this.i18n)||void 0===r||null===(n=r.localize)||void 0===n?void 0:n.call(r,"ui.components.combo-box.add_custom_item"))&&void 0!==s?s:"Add custom item",secondary:`"${o}"`,icon_path:R});this._items=t}this._selectedItemIndex=-1,this._valuePinned=!0},this._selectNextItem=e=>{var t;if(null==e||e.stopPropagation(),null==e||e.preventDefault(),!this.virtualizerElement)return;null===(t=this._searchFieldElement)||void 0===t||t.focus();const i=this.virtualizerElement.items,o=i.length-1;if(-1===o)return void this._resetSelectedItem();if(-1===this._selectedItemIndex&&(this._initializeSelectedIndex(),-1!==this._selectedItemIndex))return;const s=o===this._selectedItemIndex?this._selectedItemIndex:this._selectedItemIndex+1;if(i[s]){if("string"==typeof i[s]){if(s===o)return;this._selectedItemIndex=s+1}else this._selectedItemIndex=s;this._scrollToSelectedItem()}},this._selectPreviousItem=e=>{if(e.stopPropagation(),e.preventDefault(),this.virtualizerElement&&this._selectedItemIndex>0){const e=this._selectedItemIndex-1,t=this.virtualizerElement.items;if(!t[e])return;if("string"==typeof t[e]){if(0===e)return;this._selectedItemIndex=e-1}else this._selectedItemIndex=e;this._scrollToSelectedItem()}},this._selectFirstItem=e=>{if(e.stopPropagation(),!this.virtualizerElement||!this.virtualizerElement.items.length)return;"string"==typeof this.virtualizerElement.items[0]?this._selectedItemIndex=1:this._selectedItemIndex=0,this._scrollToSelectedItem()},this._selectLastItem=e=>{if(e.stopPropagation(),!this.virtualizerElement||!this.virtualizerElement.items.length)return;const t=this.virtualizerElement.items.length-1;"string"==typeof this.virtualizerElement.items[t]?this._selectedItemIndex=t-1:this._selectedItemIndex=t,this._scrollToSelectedItem()},this._scrollToSelectedItem=()=>{var e,t;null===(e=this.virtualizerElement)||void 0===e||null===(e=e.querySelector(".selected"))||void 0===e||e.classList.remove("selected"),null===(t=this.virtualizerElement)||void 0===t||null===(t=t.element(this._selectedItemIndex))||void 0===t||t.scrollIntoView({block:"nearest"}),requestAnimationFrame(()=>{var e;null===(e=this.virtualizerElement)||void 0===e||null===(e=e.querySelector(`#list-item-${this._selectedItemIndex}`))||void 0===e||e.classList.add("selected")})},this._pickSelectedItem=e=>{this._pickItem(e,!1)},this._pickSelectedItemNewTab=e=>{this._pickItem(e,!0)},this._pickItem=(e,t)=>{var i,o,s;if(e.stopPropagation(),void 0!==(null===(i=this.virtualizerElement)||void 0===i||null===(i=i.items)||void 0===i?void 0:i.length)&&this.virtualizerElement.items.length<4&&1===this.virtualizerElement.items.filter(e=>"string"!=typeof e).length)return void(null===(s=this.virtualizerElement)||void 0===s?void 0:s.items).forEach((e,i)=>{"string"==typeof e||e.disabled||this._fireSelectedEvents(e.id,i,t)});if(-1===this._selectedItemIndex&&(this._initializeSelectedIndex(),-1===this._selectedItemIndex))return;e.preventDefault();const l=null===(o=this.virtualizerElement)||void 0===o?void 0:o.items[this._selectedItemIndex];l&&!l.disabled&&this._fireSelectedEvents(l.id,this._selectedItemIndex,t)},this._keyFunction=e=>"string"==typeof e?e:null==e?void 0:e.id}}U.shadowRootOptions=Object.assign(Object.assign({},n.WF.shadowRootOptions),{},{delegatesFocus:!0}),(0,s.Cg)([(0,a.MZ)({type:Boolean})],U.prototype,"autofocus",void 0),(0,s.Cg)([(0,a.MZ)({type:Boolean})],U.prototype,"disabled",void 0),(0,s.Cg)([(0,a.MZ)({type:Boolean})],U.prototype,"required",void 0),(0,s.Cg)([(0,a.MZ)({type:Boolean,attribute:"allow-custom-value"})],U.prototype,"allowCustomValue",void 0),(0,s.Cg)([(0,a.MZ)({attribute:"custom-value-label"})],U.prototype,"customValueLabel",void 0),(0,s.Cg)([(0,a.MZ)()],U.prototype,"label",void 0),(0,s.Cg)([(0,a.MZ)()],U.prototype,"value",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],U.prototype,"searchKeys",void 0),(0,s.Cg)([(0,a.wk)()],U.prototype,"_listScrolled",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],U.prototype,"getItems",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],U.prototype,"getAdditionalItems",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],U.prototype,"rowRenderer",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],U.prototype,"notFoundLabel",void 0),(0,s.Cg)([(0,a.MZ)({attribute:"empty-label"})],U.prototype,"emptyLabel",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],U.prototype,"searchFn",void 0),(0,s.Cg)([(0,a.MZ)({reflect:!0})],U.prototype,"mode",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],U.prototype,"sections",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],U.prototype,"sectionTitleFunction",void 0),(0,s.Cg)([(0,a.MZ)({attribute:"selected-section"})],U.prototype,"selectedSection",void 0),(0,s.Cg)([(0,a.MZ)({type:Boolean,reflect:!0})],U.prototype,"clearable",void 0),(0,s.Cg)([(0,a.MZ)({type:Boolean,attribute:"no-sort"})],U.prototype,"noSort",void 0),(0,s.Cg)([(0,a.P)("lit-virtualizer")],U.prototype,"virtualizerElement",void 0),(0,s.Cg)([(0,a.P)("ha-input-search")],U.prototype,"_searchFieldElement",void 0),(0,s.Cg)([(0,a.wk)(),(0,l.Fg)({context:u.D5,subscribe:!0})],U.prototype,"i18n",void 0),(0,s.Cg)([(0,a.wk)()],U.prototype,"_items",void 0),(0,s.Cg)([(0,a.wk)()],U.prototype,"_selectedSection",void 0),(0,s.Cg)([(0,a.wk)()],U.prototype,"_sectionTitle",void 0),(0,s.Cg)([(0,a.wk)()],U.prototype,"_valuePinned",void 0),(0,s.Cg)([(0,a.Ls)({passive:!0})],U.prototype,"_visibilityChanged",null),(0,s.Cg)([(0,a.Ls)({passive:!0})],U.prototype,"_handleUnpinned",null),(0,s.Cg)([(0,a.Ls)({passive:!0})],U.prototype,"_onScrollList",null),U=(0,s.Cg)([(0,a.EM)("ha-picker-combo-box")],U),o()}catch(I){o(I)}})},59653:function(e,t,i){i.d(t,{C:function(){return n},x:function(){return a}});i(26910),i(18111),i(22489),i(20116),i(7588),i(61701),i(27495),i(42762),i(62953);var o=i(78648);const s={ignoreDiacritics:!0,isCaseSensitive:!1,threshold:.3,minMatchCharLength:2,ignoreLocation:!0},l=2;function r(e,t,i,r,n){return new o.A(e,Object.assign(Object.assign({},s),{},{minMatchCharLength:null!=n?n:"string"==typeof t&&t.length<l?t.length:l},r||{}),i).search(t)}function n(e,t,i,o,s={}){const n=t.toLowerCase().split(" ").filter(e=>e.trim());if(!n.length)return e;let a=l;n.forEach(e=>{e.length<a&&(a=e.length)});return r(e,{$and:n.map(e=>({$or:i.map(t=>({$path:"string"==typeof t?t:Array.isArray(t)?t.join("."):"string"==typeof t.name?t.name:t.name.join("."),$val:e}))}))},o,Object.assign(Object.assign({},s),{},{shouldSort:!1}),a).map(e=>e.item)}function a(e,t,i,o,s,l={}){const n=t.toLowerCase().split(" ").filter(e=>e.trim());if(!n.length)return e;if(1===n.length)return r(e,n[0],s,l).map(e=>e.item);const a={};let c=0;if(n.forEach(t=>{if(!t.trim())return;const n=r(e,t,s,Object.assign(Object.assign({},l),{},{shouldSort:!1,includeScore:!0,includeMatches:!0}));n.length&&(c++,n.forEach(e=>{const t=o(e.item);a[t]||(a[t]={item:e.item,hits:0,score:0}),a[t].hits+=1;const s=function(e,t){if(!e.matches||0===e.matches.length)return 1;let i=1;for(const o of e.matches){const e=t.find(e=>"string"==typeof e.name?e.name===o.key:e.name.join(".")===o.key);e&&e.weight&&e.weight>i&&(i=e.weight)}return i}(e,i),l=(e.score?1-e.score:0)*s;a[t].score+=l}))}),c!==n.length)return[];const d=Object.values(a).filter(({hits:e})=>e===n.length);return d.sort((e,t)=>t.score-e.score),d.map(({item:e})=>e)}}}]);