usda-hass-config/custom_components/hacs/hacs_frontend/c.82eccc94.js

42 lines
35 KiB
JavaScript
Raw Normal View History

2024-10-01 14:06:39 +00:00
import{l as t,f as e,_ as i,i as s,g as r,e as d,t as a,h as n,R as o,$ as c,o as l,r as m,n as h,M as p,B as u,j as g,k as _,p as f,q as x}from"./main-ad130be7.js";import{o as v}from"./c.8e28b461.js";function E(i,s,r){let d,a=i;return"object"==typeof i?(a=i.slot,d=i):d={flatten:s},r?t({slot:a,flatten:s,selector:r}):e({descriptor:t=>({get(){var t,e;const i="slot"+(a?`[name=${a}]`:":not([name])"),s=null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector(i);return null!==(e=null==s?void 0:s.assignedNodes(d))&&void 0!==e?e:[]},enumerable:!0,configurable:!0})})}class I extends n{constructor(){super(...arguments),this.value="",this.group=null,this.tabindex=-1,this.disabled=!1,this.twoline=!1,this.activated=!1,this.graphic=null,this.multipleGraphics=!1,this.hasMeta=!1,this.noninteractive=!1,this.selected=!1,this.shouldRenderRipple=!1,this._managingList=null,this.boundOnClick=this.onClick.bind(this),this._firstChanged=!0,this._skipPropRequest=!1,this.rippleHandlers=new o((()=>(this.shouldRenderRipple=!0,this.ripple))),this.listeners=[{target:this,eventNames:["click"],cb:()=>{this.onClick()}},{target:this,eventNames:["mouseenter"],cb:this.rippleHandlers.startHover},{target:this,eventNames:["mouseleave"],cb:this.rippleHandlers.endHover},{target:this,eventNames:["focus"],cb:this.rippleHandlers.startFocus},{target:this,eventNames:["blur"],cb:this.rippleHandlers.endFocus},{target:this,eventNames:["mousedown","touchstart"],cb:t=>{const e=t.type;this.onDown("mousedown"===e?"mouseup":"touchend",t)}}]}get text(){const t=this.textContent;return t?t.trim():""}render(){const t=this.renderText(),e=this.graphic?this.renderGraphic():c``,i=this.hasMeta?this.renderMeta():c``;return c`
${this.renderRipple()}
${e}
${t}
${i}`}renderRipple(){return this.shouldRenderRipple?c`
<mwc-ripple
.activated=${this.activated}>
</mwc-ripple>`:this.activated?c`<div class="fake-activated-ripple"></div>`:""}renderGraphic(){const t={multi:this.multipleGraphics};return c`
<span class="mdc-deprecated-list-item__graphic material-icons ${l(t)}">
<slot name="graphic"></slot>
</span>`}renderMeta(){return c`
<span class="mdc-deprecated-list-item__meta material-icons">
<slot name="meta"></slot>
</span>`}renderText(){const t=this.twoline?this.renderTwoline():this.renderSingleLine();return c`
<span class="mdc-deprecated-list-item__text">
${t}
</span>`}renderSingleLine(){return c`<slot></slot>`}renderTwoline(){return c`
<span class="mdc-deprecated-list-item__primary-text">
<slot></slot>
</span>
<span class="mdc-deprecated-list-item__secondary-text">
<slot name="secondary"></slot>
</span>
`}onClick(){this.fireRequestSelected(!this.selected,"interaction")}onDown(t,e){const i=()=>{window.removeEventListener(t,i),this.rippleHandlers.endPress()};window.addEventListener(t,i),this.rippleHandlers.startPress(e)}fireRequestSelected(t,e){if(this.noninteractive)return;const i=new CustomEvent("request-selected",{bubbles:!0,composed:!0,detail:{source:e,selected:t}});this.dispatchEvent(i)}connectedCallback(){super.connectedCallback(),this.noninteractive||this.setAttribute("mwc-list-item","");for(const t of this.listeners)for(const e of t.eventNames)t.target.addEventListener(e,t.cb,{passive:!0})}disconnectedCallback(){super.disconnectedCallback();for(const t of this.listeners)for(const e of t.eventNames)t.target.removeEventListener(e,t.cb);this._managingList&&(this._managingList.debouncedLayout?this._managingList.debouncedLayout(!0):this._managingList.layout(!0))}firstUpdated(){const t=new Event("list-item-rendered",{bubbles:!0,composed:!0});this.dispatchEvent(t)}}i([s("slot")],I.prototype,"slotElement",void 0),i([r("mwc-ripple")],I.prototype,"ripple",void 0),i([d({type:String})],I.prototype,"value",void 0),i([d({type:String,reflect:!0})],I.prototype,"group",void 0),i([d({type:Number,reflect:!0})],I.prototype,"tabindex",void 0),i([d({type:Boolean,reflect:!0}),v((function(t){t?this.setAttribute("aria-disabled","true"):this.setAttribute("aria-disabled","false")}))],I.prototype,"disabled",void 0),i([d({type:Boolean,reflect:!0})],I.prototype,"twoline",void 0),i([d({type:Boolean,reflect:!0})],I.prototype,"activated",void 0),i([d({type:String,reflect:!0})],I.prototype,"graphic",void 0),i([d({type:Boolean})],I.prototype,"multipleGraphics",void 0),i([d({type:Boolean})],I.prototype,"hasMeta",void 0),i([d({type:Boolean,reflect:!0}),v((function(t){t?(this.removeAttribute("aria-checked"),this.removeAttribute("mwc-list-item"),this.selected=!1,this.activated=!1,this.tabIndex=-1):this.setAttribute("mwc-list-item","")}))],I.prototype,"noninteractive",void 0),i([d({type:Boolean,reflect:!0}),v((function(t){const e=this.getAttribute("role"),i="gridcell"===e||"option"===e||"row"===e||"tab"===e;i&&t?this.setAttribute("aria-selected","true"):i&&this.setAttribute("aria-selected","false"),this._firstChanged?this._firstChanged=!1:this._skipPropRequest||this.fireRequestSelected(t,"property")}))],I.prototype,"selected",void 0),i([a()],I.prototype,"shouldRenderRipple",void 0),i([a()],I.prototype,"_managingList",void 0);const b=m`:host{cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;height:48px;display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;padding:0;padding-left:var(--mdc-list-side-padding, 16px);padding-right:var(--mdc-list-side-padding, 16px);outline:none;height:48px;color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background, rgba(0, 0, 0, 0.87))}:host:focus{outline:none}:host([activated]){color:#6200ee;color:var(--mdc-theme-primary, #6200ee);--mdc-ripple-color: var( --mdc-theme-primary, #6200ee )}:host([activated]) .mdc-deprecated-list-item__graphic{color:#6200ee;color:var(--mdc-theme-primary, #6200ee)}:host([activated]) .fake-activated-ripple::before{position:absolute;display:block;top:0;bottom:0;left:0;right:0;width:100%;height:100%;pointer-events:none;z-index:1;content:"";opacity:0.12;opacity:var(--mdc-ripple-activated-opacity, 0.12);background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-deprecated-list-item__graphic{flex-shrink:0;align-items:center;justify-content:center;fill:currentColor;display:inline-flex}.mdc-deprecated-list-item__graphic ::slotted(*){flex-shrink:0;align-items:center;justify-content:center;fill:currentColor;width:100%;height:100%;text-align:center}.mdc-deprecated-list-item__meta{width:var(--mdc-list-item-meta-size, 24px);height:var(--mdc-list-item-meta-size, 24px);margin-left:auto;margin-right:0;color:rgba(0, 0, 0, 0.38);color:var(--mdc-theme-text-hint-on-background, rgba(0, 0, 0, 0.38))}.mdc-deprecated-list-item__meta.multi{width:auto}.mdc-deprecated-list-item__meta ::slotted(*){widt
<!-- @ts-ignore -->
<ul
tabindex=${i}
role="${g(t)}"
aria-label="${g(e)}"
class="mdc-deprecated-list"
@keydown=${this.onKeydown}
@focusin=${this.onFocusIn}
@focusout=${this.onFocusOut}
@request-selected=${this.onRequestSelected}
@list-item-rendered=${this.onListItemConnected}>
<slot></slot>
${this.renderPlaceholder()}
</ul>
`}renderPlaceholder(){var t;const e=null!==(t=this.assignedElements)&&void 0!==t?t:[];return void 0!==this.emptyMessage&&0===e.length?c`
<mwc-list-item noninteractive>${this.emptyMessage}</mwc-list-item>
`:null}firstUpdated(){super.firstUpdated(),this.items.length||(this.mdcFoundation.setMulti(this.multi),this.layout())}onFocusIn(t){if(this.mdcFoundation&&this.mdcRoot){const e=this.getIndexOfTarget(t);this.mdcFoundation.handleFocusIn(t,e)}}onFocusOut(t){if(this.mdcFoundation&&this.mdcRoot){const e=this.getIndexOfTarget(t);this.mdcFoundation.handleFocusOut(t,e)}}onKeydown(t){if(this.mdcFoundation&&this.mdcRoot){const e=this.getIndexOfTarget(t),i=t.target,s=tt(i);this.mdcFoundation.handleKeydown(t,s,e)}}onRequestSelected(t){if(this.mdcFoundation){let e=this.getIndexOfTarget(t);if(-1===e&&(this.layout(),e=this.getIndexOfTarget(t),-1===e))return;if(this.items[e].disabled)return;const i=t.detail.selected,s=t.detail.source;this.mdcFoundation.handleSingleSelection(e,"interaction"===s,i),t.stopPropagation()}}getIndexOfTarget(t){const e=this.items,i=t.composedPath();for(const t of i){let i=-1;if(_(t)&&tt(t)&&(i=e.indexOf(t)),-1!==i)return i}return-1}createAdapter(){return this.mdcAdapter={getListItemCount:()=>this.mdcRoot?this.items.length:0,getFocusedElementIndex:this.getFocusedItemIndex,getAttributeForElementIndex:(t,e)=>{if(!this.mdcRoot)return"";const i=this.items[t];return i?i.getAttribute(e):""},setAttributeForElementIndex:(t,e,i)=>{if(!this.mdcRoot)return;const s=this.items[t];s&&s.setAttribute(e,i)},focusItemAtIndex:t=>{const e=this.items[t];e&&e.focus()},setTabIndexForElementIndex:(t,e)=>{const i=this.items[t];i&&(i.tabindex=e)},notifyAction:t=>{const e={bubbles:!0,composed:!0};e.detail={index:t};const i=new CustomEvent("action",e);this.dispatchEvent(i)},notifySelected:(t,e)=>{const i={bubbles:!0,composed:!0};i.detail={index:t,diff:e};const s=new CustomEvent("selected",i);this.dispatchEvent(s)},isFocusInsideList:()=>f(this),isRootFocused:()=>{const t=this.mdcRoot;return t.getRootNode().activeElement===t},setDisabledStateForElementIndex:(t,e)=>{const i=this.items[t];i&&(i.disabled=e)},getDisabledStateForElementIndex:t=>{const e=this.items[t];return!!e&&e.disabled},setSelectedStateForElementIndex:(t,e)=>{const i=this.items[t];i&&(i.selected=e)},getSelectedStateForElementIndex:t=>{const e=this.items[t];return!!e&&e.selected},setActivatedStateForElementIndex:(t,e)=>{const i=this.items[t];i&&(i.activated=e)}},this.mdcAdapter}selectUi(t,e=!1){const i=this.items[t];i&&(i.selected=!0,i.activated=e)}deselectUi(t){const e=this.items[t];e&&(e.selected=!1,e.activated=!1)}select(t){this.mdcFoundation&&this.mdcFoundation.setSelectedIndex(t)}toggle(t,e){this.multi&&this.mdcFoundation.toggleMultiAtIndex(t,e)}onListItemConnected(t){const e=t.target;this.layout(-1===this.items.indexOf(e))}layout(t=!0){t&&this.updateItems();const e=this.items[0];for(const t of this.items)t.tabindex=-1;e&&(this.noninteractive?this.previousTabindex||(this.previousTabindex=e):e.tabindex=0),this.itemsReadyResolver()}getFocusedItemIndex(){if(!this.mdcRoot)return-1;if(!this.items.length)return-1;const t=x();if(!t.length)return-1;for(let e=t.length-1;e>=0;e--){const i=t[e];if(tt(i))return this.items.indexOf(i)}return-1}focusItemAtIndex(t){for(const t of this.items)if(0===t.tabindex){t.tabindex=-1;break}this.items[t].tabindex=0,this.items[t].focus()}focus(){const t=this.mdcRoot;t&&t.focus()}blur(){const t=this.mdcRoot;t&&t.blur()}}i([d({type:String})],it.prototype,"emptyMessage",void 0),i([s(".mdc-deprecated-list")],it.prototype,"mdcRoot",void 0),i([E("",!0,"*")],it.prototype,"assignedElements",void 0),i([E("",!0,'[tabindex="0"]')],it.prototype,"tabbableElements",void 0),i([d({type:Boolean}),v((function(t){this.mdcFoundation&&this.mdcFoundation.setUseActivatedClass(t)}))],it.prototype,"activatable",void 0),i([d({type:Boolean}),v((function(t,e){this.mdcFoundation&&this.mdcFoundation.setMulti(t),void 0!==e&&this.layout()}))],it.prototype,"multi",void 0),i([d({type:Boolean}),v((function(t){this.mdcFoundation&&this.mdcFoundation.setWrapFocus(t)}))],it.prototype,"wrapFocus",void 0),i([d({type:String}),v((function(t,e){void 0!==e&&this.updateItems()}))],it.prototype,"itemRoles",void 0),i([d({type:String})],it.prototype,"innerRole",void 0),i([d({type:String})],it.