+ `}};function Oc(t){var e,i,o,n,r;return{layout:null!==(e=t.layout)&&void 0!==e?e:Ic(t),fill_container:null!==(i=t.fill_container)&&void 0!==i&&i,primary_info:null!==(o=t.primary_info)&&void 0!==o?o:Mc(t),secondary_info:null!==(n=t.secondary_info)&&void 0!==n?n:jc(t),icon_type:null!==(r=t.icon_type)&&void 0!==r?r:zc(t)}}function Ic(t){return t.vertical?"vertical":"default"}function zc(t){return t.hide_icon?"none":t.use_entity_picture||t.use_media_artwork?"entity-picture":"icon"}function Mc(t){return t.hide_name?"none":"name"}function jc(t){return t.hide_state?"none":"state"}n([gt()],Tc.prototype,"appearance",void 0),Tc=n([pt("mushroom-state-item")],Tc);let Pc=class extends ht{constructor(){super(...arguments),this.picture_url=""}render(){return q`
+
- `}static get styles(){return h`
+ `}static get styles(){return u`
:host {
--main-color: var(--primary-text-color);
--icon-color-disabled: rgb(var(--rgb-disabled));
@@ -1134,7 +1243,7 @@ const ca="important",da=" !"+ca,ua=He(class extends Ye{constructor(t){var e;if(s
height: 100%;
border-radius: var(--icon-border-radius);
}
- `}};n([_t()],Ms.prototype,"picture_url",void 0),Ms=n([pt("mushroom-shape-avatar")],Ms);const js=h`
+ `}};n([gt()],Pc.prototype,"picture_url",void 0),Pc=n([pt("mushroom-shape-avatar")],Pc);const Dc=u`
--spacing: var(--mush-spacing, 10px);
/* Title */
@@ -1223,7 +1332,7 @@ const ca="important",da=" !"+ca,ua=He(class extends Ye{constructor(t){var e;if(s
--icon-border-radius: var(--mush-icon-border-radius, 50%);
--icon-size: var(--mush-icon-size, 36px);
--icon-symbol-size: var(--mush-icon-symbol-size, 0.6em);
-`,Ds=h`
+`,Lc=u`
/* RGB */
/* Standard colors */
--rgb-red: var(--mush-rgb-red, var(--default-red));
@@ -1352,16 +1461,16 @@ const ca="important",da=" !"+ca,ua=He(class extends Ye{constructor(t){var e;if(s
--mush-rgb-state-climate-off,
var(--rgb-disabled)
);
-`;function Ls(t){return!!t&&t.themes.darkMode}class Ps extends ht{firstUpdated(t){this.toggleAttribute("pre-2024-8",!ai(this.hass.config.version,2024,8))}updated(t){if(super.updated(t),t.has("hass")&&this.hass){const e=Ls(t.get("hass")),i=Ls(this.hass);e!==i&&this.toggleAttribute("dark-mode",i)}}static get styles(){return[Cs,h`
+`;function Nc(t){return!!t&&t.themes.darkMode}class Rc extends ht{firstUpdated(t){this.toggleAttribute("pre-2024-8",!ei(this.hass.config.version,2024,8))}updated(t){if(super.updated(t),t.has("hass")&&this.hass){const e=Nc(t.get("hass")),i=Nc(this.hass);e!==i&&this.toggleAttribute("dark-mode",i)}}static get styles(){return[Ec,u`
:host {
- ${ts}
+ ${ec}
}
:host([dark-mode]) {
- ${es}
+ ${ic}
}
:host {
- ${Ds}
- ${js}
+ ${Lc}
+ ${Dc}
}
:host([pre-2024-8]) {
--spacing: var(--mush-spacing, 12px);
@@ -1369,14 +1478,14 @@ const ca="important",da=" !"+ca,ua=He(class extends Ye{constructor(t){var e;if(s
--control-spacing: var(--mush-spacing, 12px);
--icon-size: var(--mush-icon-size, 40px);
}
- `]}}n([_t({attribute:!1})],Ps.prototype,"hass",void 0);class Ns extends Ps{get _stateObj(){if(!this._config||!this.hass||!this._config.entity)return;const t=this._config.entity;return this.hass.states[t]}get hasControls(){return!1}setConfig(t){this._config=Object.assign({tap_action:{action:"more-info"},hold_action:{action:"more-info"}},t)}getCardSize(){var t;let e=1;if(!this._config)return e;const i=Ss(this._config);return"vertical"===i.layout&&(e+=1),"horizontal"===(null==i?void 0:i.layout)||!this.hasControls||"collapsible_controls"in this._config&&(null===(t=this._config)||void 0===t?void 0:t.collapsible_controls)||(e+=1),e}getLayoutOptions(){if(!this._config)return{grid_columns:2,grid_rows:1};const t={grid_columns:2,grid_rows:0},e=Ss(this._config),i="collapsible_controls"in this._config&&Boolean(this._config.collapsible_controls),o="none"!==e.primary_info||"none"!==e.secondary_info,n="none"!==e.icon_type,r=this._stateObj&&Bt(this._stateObj),a=this.hasControls&&(!i||r);return"vertical"===e.layout&&(n&&(t.grid_rows+=1),o&&(t.grid_rows+=1),a&&(t.grid_rows+=1)),"horizontal"===e.layout&&(t.grid_rows=1,t.grid_columns=4),"default"===e.layout&&((o||n)&&(t.grid_rows+=1),a&&(t.grid_rows+=1)),a||o||(t.grid_columns=1,t.grid_rows=1),t.grid_rows=Math.max(t.grid_rows,1),t}renderPicture(t){return Y`
+ `]}}n([gt({attribute:!1})],Rc.prototype,"hass",void 0);class Uc extends Rc{get _stateObj(){if(!this._config||!this.hass||!this._config.entity)return;const t=this._config.entity;return this.hass.states[t]}get hasControls(){return!1}setConfig(t){this._config=Object.assign({tap_action:{action:"more-info"},hold_action:{action:"more-info"}},t)}getCardSize(){var t;let e=1;if(!this._config)return e;const i=Oc(this._config);return"vertical"===i.layout&&(e+=1),"horizontal"===(null==i?void 0:i.layout)||!this.hasControls||"collapsible_controls"in this._config&&(null===(t=this._config)||void 0===t?void 0:t.collapsible_controls)||(e+=1),e}getLayoutOptions(){if(!this._config)return{grid_columns:2,grid_rows:1};const t={grid_columns:2,grid_rows:0},e=Oc(this._config),i="collapsible_controls"in this._config&&Boolean(this._config.collapsible_controls),o="none"!==e.primary_info||"none"!==e.secondary_info,n="none"!==e.icon_type,r=this._stateObj&&Nt(this._stateObj),a=this.hasControls&&(!i||r);return"vertical"===e.layout&&(n&&(t.grid_rows+=1),o&&(t.grid_rows+=1),a&&(t.grid_rows+=1)),"horizontal"===e.layout&&(t.grid_rows=1,t.grid_columns=4),"default"===e.layout&&((o||n)&&(t.grid_rows+=1),a&&(t.grid_rows+=1)),a||o||(t.grid_columns=1,t.grid_rows=1),t.grid_rows=Math.max(t.grid_rows,1),t}getGridOptions(){if(!this._config)return{columns:6,rows:1};const t={min_rows:1,min_columns:4,columns:6,rows:0},e=Oc(this._config),i="collapsible_controls"in this._config&&Boolean(this._config.collapsible_controls),o="none"!==e.primary_info||"none"!==e.secondary_info,n="none"!==e.icon_type,r=this._stateObj&&Nt(this._stateObj),a=this.hasControls&&(!i||r);return"vertical"===e.layout&&(n&&(t.rows+=1),o&&(t.rows+=1),a&&(t.rows+=1),t.min_columns=2),"horizontal"===e.layout&&(t.rows=1,t.columns=12),"default"===e.layout&&((o||n)&&(t.rows+=1),a&&(t.rows+=1)),a||o||(t.columns=3,t.rows=1,t.min_columns=2),t.rows=Math.max(t.rows,1),t.min_rows=t.rows,t}renderPicture(t){return q`
- `}renderNotFound(t){const e=Ss(t),i=Ie(this.hass),o=jo(this.hass);return Y`
+ `}renderNotFound(t){const e=Oc(t),i=Ee(this.hass),o=Io(this.hass);return q`
@@ -1396,7 +1505,7 @@ const ca="important",da=" !"+ca,ua=He(class extends Ye{constructor(t){var e;if(s
- `}renderIcon(t,e){const i=Bt(t);return Y`
+ `}renderIcon(t,e){const i=Nt(t);return q`
- `}renderBadge(t){return!Ut(t)?Y`
+ `}renderBadge(t){return!Rt(t)?q`
- `:K}renderStateInfo(t,e,i,o){const n=this.hass.formatEntityState?this.hass.formatEntityState(t):ne(this.hass.localize,t,this.hass.locale,this.hass.config,this.hass.entities),r=null!=o?o:n,a=ss(e.primary_info,i,r,t,this.hass),s=ss(e.secondary_info,i,r,t,this.hass);return Y`
+ `:J}renderStateInfo(t,e,i,o){const n=this.hass.formatEntityState?this.hass.formatEntityState(t):te(this.hass.localize,t,this.hass.locale,this.hass.config,this.hass.entities),r=null!=o?o:n,a=lc(e.primary_info,i,r,t,this.hass),s=lc(e.secondary_info,i,r,t,this.hass);return q`
- `}}n([vt()],Ns.prototype,"_config",void 0),n([_t({reflect:!0,type:String})],Ns.prototype,"layout",void 0);const Rs=h`
+ `}}n([_t()],Uc.prototype,"_config",void 0),n([gt({reflect:!0,type:String})],Uc.prototype,"layout",void 0);const Vc=u`
ha-card {
box-sizing: border-box;
display: flex;
@@ -1459,46 +1568,46 @@ const ca="important",da=" !"+ca,ua=He(class extends Ye{constructor(t){var e;if(s
mushroom-state-item[disabled] {
cursor: initial;
}
-`;function Fs(e){const i=window;i.customCards=i.customCards||[];const o=e.type.replace("-card","").replace("mushroom-","");i.customCards.push(Object.assign(Object.assign({},e),{preview:!0,documentationURL:`${t}/blob/main/docs/cards/${o}.md`}))}const Vs="mushroom",Bs=`${Vs}-alarm-control-panel-card`,Us=`${Bs}-editor`,Hs=["alarm_control_panel"],Ys={disarmed:"var(--rgb-state-alarm-disarmed)",armed:"var(--rgb-state-alarm-armed)",triggered:"var(--rgb-state-alarm-triggered)",unavailable:"var(--rgb-warning)"};function Ws(t){var e;return null!==(e=Ys[t.split("_")[0]])&&void 0!==e?e:"var(--rgb-grey)"}function Xs(t){return["arming","triggered","pending",Nt].indexOf(t)>=0}Fs({type:Bs,name:"Mushroom Alarm Control Panel Card",description:"Card for alarm control panel"});let Ks=class extends Ns{static async getConfigElement(){return await Promise.resolve().then((function(){return tu})),document.createElement(Us)}static async getStubConfig(t){const e=Object.keys(t.states).filter((t=>Hs.includes(t.split(".")[0])));return{type:`custom:${Bs}`,entity:e[0],states:["armed_home","armed_away"]}}get hasControls(){var t,e;return Boolean(null===(e=null===(t=this._config)||void 0===t?void 0:t.states)||void 0===e?void 0:e.length)}_onTap(t,e){t.stopPropagation(),(async(t,e,i,o)=>{var n,r;const{service:a}=_s[o];let s;if("disarmed"!==o&&i.attributes.code_arm_required||"disarmed"===o&&i.attributes.code_format){const a=await((t,e)=>t.callWS({type:"config/entity_registry/get",entity_id:e}))(e,i.entity_id).catch((()=>{}));if(!(null===(r=null===(n=null==a?void 0:a.options)||void 0===n?void 0:n.alarm_control_panel)||void 0===r?void 0:r.default_code)){const n="disarmed"===o,r=await window.loadCardHelpers(),a=await r.showEnterCodeDialog(t,{codeFormat:i.attributes.code_format,title:e.localize("ui.card.alarm_control_panel."+(n?"disarm":"arm")),submitText:e.localize("ui.card.alarm_control_panel."+(n?"disarm":"arm"))});if(null==a)throw new Error("Code dialog closed");s=a}}await e.callService("alarm_control_panel",a,{entity_id:i.entity_id,code:s})})(this,this.hass,this._stateObj,e)}_handleAction(t){Ke(this,this.hass,this._config,t.detail.action)}render(){if(!this.hass||!this._config||!this._config.entity)return K;const t=this._stateObj;if(!t)return this.renderNotFound(this._config);const e=this._config.name||t.attributes.friendly_name||"",i=this._config.icon,o=Ss(this._config),n=ls(t,o.icon_type),r=this._config.states&&this._config.states.length>0?function(t){return"disarmed"===t.state}(t)?this._config.states.map((t=>({mode:t}))):[{mode:"disarmed"}]:[],a=function(t){return Nt!==t.state}(t),s=Ie(this.hass);return Y`
+`;function Bc(e){const i=window;i.customCards=i.customCards||[];const o=e.type.replace("-card","").replace("mushroom-","");i.customCards.push(Object.assign(Object.assign({},e),{preview:!0,documentationURL:`${t}/blob/main/docs/cards/${o}.md`}))}const Fc="mushroom",Hc=`${Fc}-alarm-control-panel-card`,Wc=`${Hc}-editor`,Yc=["alarm_control_panel"],Kc={disarmed:"var(--rgb-state-alarm-disarmed)",armed:"var(--rgb-state-alarm-armed)",triggered:"var(--rgb-state-alarm-triggered)",unavailable:"var(--rgb-warning)"};function Xc(t){var e;return null!==(e=Kc[t.split("_")[0]])&&void 0!==e?e:"var(--rgb-grey)"}function qc(t){return["arming","triggered","pending",jt].indexOf(t)>=0}Bc({type:Hc,name:"Mushroom Alarm Control Panel Card",description:"Card for alarm control panel"});let Gc=class extends Uc{static async getConfigElement(){return await Promise.resolve().then((function(){return rp})),document.createElement(Wc)}static async getStubConfig(t){const e=Object.keys(t.states).filter((t=>Yc.includes(t.split(".")[0])));return{type:`custom:${Hc}`,entity:e[0],states:["armed_home","armed_away"]}}get hasControls(){var t,e;return Boolean(null===(e=null===(t=this._config)||void 0===t?void 0:t.states)||void 0===e?void 0:e.length)}_onTap(t,e){t.stopPropagation(),(async(t,e,i,o)=>{var n,r;const{service:a}=bc[o];let s;if("disarmed"!==o&&i.attributes.code_arm_required||"disarmed"===o&&i.attributes.code_format){const a=await((t,e)=>t.callWS({type:"config/entity_registry/get",entity_id:e}))(e,i.entity_id).catch((()=>{}));if(!(null===(r=null===(n=null==a?void 0:a.options)||void 0===n?void 0:n.alarm_control_panel)||void 0===r?void 0:r.default_code)){const n="disarmed"===o,r=await window.loadCardHelpers(),a=await r.showEnterCodeDialog(t,{codeFormat:i.attributes.code_format,title:e.localize("ui.card.alarm_control_panel."+(n?"disarm":"arm")),submitText:e.localize("ui.card.alarm_control_panel."+(n?"disarm":"arm"))});if(null==a)throw new Error("Code dialog closed");s=a}}await e.callService("alarm_control_panel",a,{entity_id:i.entity_id,code:s})})(this,this.hass,this._stateObj,e)}_handleAction(t){Fe(this,this.hass,this._config,t.detail.action)}render(){if(!this.hass||!this._config||!this._config.entity)return J;const t=this._stateObj;if(!t)return this.renderNotFound(this._config);const e=this._config.name||t.attributes.friendly_name||"",i=this._config.icon,o=Oc(this._config),n=cc(t,o.icon_type),r=this._config.states&&this._config.states.length>0?function(t){return"disarmed"===t.state}(t)?this._config.states.map((t=>({mode:t}))):[{mode:"disarmed"}]:[],a=function(t){return jt!==t.state}(t),s=Ee(this.hass);return q`
${n?this.renderPicture(n):this.renderIcon(t,i)}
${this.renderBadge(t)}
${this.renderStateInfo(t,o,e)};
- ${r.length>0?Y`
+ ${r.length>0?q`
- ${r.map((t=>Y`
+ ${r.map((t=>q`
this._onTap(e,t.mode)}
.disabled=${!a}
>
-
+
`))}
- `:K}
+ `:J}
- `}renderIcon(t,e){const i=Ws(t.state),o=Xs(t.state);return Y`
+ `}renderIcon(t,e){const i=Xc(t.state),o=qc(t.state);return q`
- `}static get styles(){return[super.styles,Rs,h`
+ `}static get styles(){return[super.styles,Vc,u`
mushroom-state-item {
cursor: pointer;
}
mushroom-shape-icon.pulse {
--shape-animation: 1s ease 0s infinite normal none running pulse;
}
- `]}};Ks=n([pt(Bs)],Ks);let qs=class extends ht{constructor(){super(...arguments),this.icon="",this.label="",this.avatar="",this.avatarOnly=!1}render(){return Y`
+ `]}};Gc=n([pt(Hc)],Gc);let Zc=class extends ht{constructor(){super(...arguments),this.icon="",this.label="",this.avatar="",this.avatarOnly=!1}render(){return q`
- ${this.avatar?Y` `:K}
- ${this.avatarOnly?K:Y`
+ ${this.avatar?q` `:J}
+ ${this.avatarOnly?J:q`
`}
- `}static get styles(){return[Cs,h`
+ `}static get styles(){return[Ec,u`
:host {
--icon-color: var(--primary-text-color);
--text-color: var(--primary-text-color);
@@ -1592,33 +1701,33 @@ const ca="important",da=" !"+ca,ua=He(class extends Ye{constructor(t){var e;if(s
margin-right: initial;
margin-left: 0.15em;
}
- `]}};n([_t()],qs.prototype,"icon",void 0),n([_t()],qs.prototype,"label",void 0),n([_t()],qs.prototype,"avatar",void 0),n([_t()],qs.prototype,"avatarOnly",void 0),qs=n([pt("mushroom-chip")],qs);const Gs=t=>{try{const e=Zs(t.type);if(customElements.get(e)){const i=document.createElement(e,t);return i.setConfig(t),i}const i=document.createElement(e);return customElements.whenDefined(e).then((()=>{try{customElements.upgrade(i),i.setConfig(t)}catch(t){}})),i}catch(t){return void console.error(t)}};function Zs(t){return`${Vs}-${t}-chip`}function Js(t){return`${Vs}-${t}-chip-editor`}let Qs=class extends ht{static async getConfigElement(){return await Promise.resolve().then((function(){return ou})),document.createElement(Js("entity"))}static async getStubConfig(t){return{type:"entity",entity:Object.keys(t.states)[0]}}setConfig(t){this._config=t}_handleAction(t){Ke(this,this.hass,this._config,t.detail.action)}render(){var t;if(!this.hass||!this._config||!this._config.entity)return K;const e=this._config.entity,i=this.hass.states[e];if(!i)return K;const o=this._config.name||i.attributes.friendly_name||"",n=this._config.icon,r=this._config.icon_color,a=this._config.use_entity_picture?Yt(i):void 0,s=this.hass.formatEntityState?this.hass.formatEntityState(i):ne(this.hass.localize,i,this.hass.locale,this.hass.config,this.hass.entities),l=Bt(i),c=ss(null!==(t=this._config.content_info)&&void 0!==t?t:"state",o,s,i,this.hass),d=Ie(this.hass);return Y`
+ `]}};n([gt()],Zc.prototype,"icon",void 0),n([gt()],Zc.prototype,"label",void 0),n([gt()],Zc.prototype,"avatar",void 0),n([gt()],Zc.prototype,"avatarOnly",void 0),Zc=n([pt("mushroom-chip")],Zc);const Jc=t=>{try{const e=Qc(t.type);if(customElements.get(e)){const i=document.createElement(e,t);return i.setConfig(t),i}const i=document.createElement(e);return customElements.whenDefined(e).then((()=>{try{customElements.upgrade(i),i.setConfig(t)}catch(t){}})),i}catch(t){return void console.error(t)}};function Qc(t){return`${Fc}-${t}-chip`}function td(t){return`${Fc}-${t}-chip-editor`}let ed=class extends ht{static async getConfigElement(){return await Promise.resolve().then((function(){return lp})),document.createElement(td("entity"))}static async getStubConfig(t){return{type:"entity",entity:Object.keys(t.states)[0]}}setConfig(t){this._config=t}_handleAction(t){Fe(this,this.hass,this._config,t.detail.action)}render(){var t;if(!this.hass||!this._config||!this._config.entity)return J;const e=this._config.entity,i=this.hass.states[e];if(!i)return J;const o=this._config.name||i.attributes.friendly_name||"",n=this._config.icon,r=this._config.icon_color,a=this._config.use_entity_picture?Vt(i):void 0,s=this.hass.formatEntityState?this.hass.formatEntityState(i):te(this.hass.localize,i,this.hass.locale,this.hass.config,this.hass.entities),l=Nt(i),c=lc(null!==(t=this._config.content_info)&&void 0!==t?t:"state",o,s,i,this.hass),d=Ee(this.hass);return q`
- ${a?K:this.renderIcon(i,n,r,l)}
- ${c?Y`${c}`:K}
+ ${a?J:this.renderIcon(i,n,r,l)}
+ ${c?q`${c}`:J}
- `}renderIcon(t,e,i,o){const n={};if(i){const t=Qa(i);n["--color"]=`rgb(${t})`}return Y`
+ `}renderIcon(t,e,i,o){const n={};if(i){const t=tc(i);n["--color"]=`rgb(${t})`}return q`
- `}static get styles(){return h`
+ `}static get styles(){return u`
mushroom-chip {
cursor: pointer;
}
ha-state-icon.active {
color: var(--color);
}
- `}};n([_t({attribute:!1})],Qs.prototype,"hass",void 0),n([vt()],Qs.prototype,"_config",void 0),Qs=n([pt(Zs("entity"))],Qs);const tl=new Set(["partlycloudy","cloudy","fog","windy","windy-variant","hail","rainy","snowy","snowy-rainy","pouring","lightning","lightning-rainy"]),el=new Set(["hail","rainy","pouring"]),il=new Set(["windy","windy-variant"]),ol=new Set(["snowy","snowy-rainy"]),nl=new Set(["lightning","lightning-rainy"]),rl=h`
+ `}};n([gt({attribute:!1})],ed.prototype,"hass",void 0),n([_t()],ed.prototype,"_config",void 0),ed=n([pt(Qc("entity"))],ed);const id=new Set(["partlycloudy","cloudy","fog","windy","windy-variant","hail","rainy","snowy","snowy-rainy","pouring","lightning","lightning-rainy"]),od=new Set(["hail","rainy","pouring"]),nd=new Set(["windy","windy-variant"]),rd=new Set(["snowy","snowy-rainy"]),ad=new Set(["lightning","lightning-rainy"]),sd=u`
.rain {
fill: var(--weather-icon-rain-color, #30b3ff);
}
@@ -1634,35 +1743,35 @@ const ca="important",da=" !"+ca,ua=He(class extends Ye{constructor(t){var e;if(s
.cloud-front {
fill: var(--weather-icon-cloud-front-color, #f9f9f9);
}
-`,al=(t,e)=>W`
+`,ld=(t,e)=>G`
`;let sl=class extends ht{static async getConfigElement(){return await Promise.resolve().then((function(){return cu})),document.createElement(Js("weather"))}static async getStubConfig(t){const e=Object.keys(t.states).filter((t=>"weather"===t.split(".")[0]));return{type:"weather",entity:e[0]}}setConfig(t){this._config=t}_handleAction(t){Ke(this,this.hass,this._config,t.detail.action)}render(){if(!this.hass||!this._config||!this._config.entity)return K;const t=this._config.entity,e=this.hass.states[t];if(!e)return K;const i=al(e.state,!0),o=[];if(this._config.show_conditions){const t=this.hass.formatEntityState?this.hass.formatEntityState(e):ne(this.hass.localize,e,this.hass.locale,this.hass.config,this.hass.entities);o.push(t)}if(this._config.show_temperature){const t=`${te(e.attributes.temperature,this.hass.locale)} ${this.hass.config.unit_system.temperature}`;o.push(t)}const n=Ie(this.hass);return Y`
+ `;let cd=class extends ht{static async getConfigElement(){return await Promise.resolve().then((function(){return mp})),document.createElement(td("weather"))}static async getStubConfig(t){const e=Object.keys(t.states).filter((t=>"weather"===t.split(".")[0]));return{type:"weather",entity:e[0]}}setConfig(t){this._config=t}_handleAction(t){Fe(this,this.hass,this._config,t.detail.action)}render(){if(!this.hass||!this._config||!this._config.entity)return J;const t=this._config.entity,e=this.hass.states[t];if(!e)return J;const i=ld(e.state,!0),o=[];if(this._config.show_conditions){const t=this.hass.formatEntityState?this.hass.formatEntityState(e):te(this.hass.localize,e,this.hass.locale,this.hass.config,this.hass.entities);o.push(t)}if(this._config.show_temperature){const t=`${Gt(e.attributes.temperature,this.hass.locale)} ${this.hass.config.unit_system.temperature}`;o.push(t)}const n=Ee(this.hass);return q`
${i}
- ${o.length>0?Y`${o.join(" / ")}`:K}
+ ${o.length>0?q`${o.join(" / ")}`:J}
- `}static get styles(){return[rl,h`
+ `}static get styles(){return[sd,u`
mushroom-chip {
cursor: pointer;
}
- `]}};n([_t({attribute:!1})],sl.prototype,"hass",void 0),n([vt()],sl.prototype,"_config",void 0),sl=n([pt(Zs("weather"))],sl);const ll="mdi:arrow-left";let cl=class extends ht{static async getConfigElement(){return await Promise.resolve().then((function(){return hu})),document.createElement(Js("back"))}static async getStubConfig(t){return{type:"back"}}setConfig(t){this._config=t}_handleAction(){window.history.back()}render(){if(!this.hass||!this._config)return K;const t=this._config.icon||ll,e=Ie(this.hass);return Y`
+ `]}};n([gt({attribute:!1})],cd.prototype,"hass",void 0),n([_t()],cd.prototype,"_config",void 0),cd=n([pt(Qc("weather"))],cd);const dd="mdi:arrow-left";let hd=class extends ht{static async getConfigElement(){return await Promise.resolve().then((function(){return _p})),document.createElement(td("back"))}static async getStubConfig(t){return{type:"back"}}setConfig(t){this._config=t}_handleAction(){window.history.back()}render(){if(!this.hass||!this._config)return J;const t=this._config.icon||dd,e=Ee(this.hass);return q`
- `}static get styles(){return h`
+ `}static get styles(){return u`
mushroom-chip {
cursor: pointer;
}
- `}};n([_t({attribute:!1})],cl.prototype,"hass",void 0),n([vt()],cl.prototype,"_config",void 0),cl=n([pt(Zs("back"))],cl);const dl="mdi:flash";let ul=class extends ht{static async getConfigElement(){return await Promise.resolve().then((function(){return gu})),document.createElement(Js("action"))}static async getStubConfig(t){return{type:"action"}}setConfig(t){this._config=t}_handleAction(t){Ke(this,this.hass,this._config,t.detail.action)}render(){if(!this.hass||!this._config)return K;const t=this._config.icon||dl,e=this._config.icon_color,i={};if(e){const t=Qa(e);i["--color"]=`rgb(${t})`}const o=Ie(this.hass);return Y`
+ `}};n([gt({attribute:!1})],hd.prototype,"hass",void 0),n([_t()],hd.prototype,"_config",void 0),hd=n([pt(Qc("back"))],hd);const ud="mdi:flash";let pd=class extends ht{static async getConfigElement(){return await Promise.resolve().then((function(){return xp})),document.createElement(td("action"))}static async getStubConfig(t){return{type:"action"}}setConfig(t){this._config=t}_handleAction(t){Fe(this,this.hass,this._config,t.detail.action)}render(){if(!this.hass||!this._config)return J;const t=this._config.icon||ud,e=this._config.icon_color,i={};if(e){const t=tc(e);i["--color"]=`rgb(${t})`}const o=Ee(this.hass);return q`
- `}static get styles(){return h`
+ `}static get styles(){return u`
mushroom-chip {
cursor: pointer;
}
ha-state-icon {
color: var(--color);
}
- `}};n([_t({attribute:!1})],ul.prototype,"hass",void 0),n([vt()],ul.prototype,"_config",void 0),ul=n([pt(Zs("action"))],ul);const hl="mdi:menu";let ml=class extends ht{static async getConfigElement(){return await Promise.resolve().then((function(){return bu})),document.createElement(Js("menu"))}static async getStubConfig(t){return{type:"menu"}}setConfig(t){this._config=t}_handleAction(){Lt(this,"hass-toggle-menu")}render(){if(!this.hass||!this._config)return K;const t=this._config.icon||hl,e=Ie(this.hass);return Y`
+ `}};n([gt({attribute:!1})],pd.prototype,"hass",void 0),n([_t()],pd.prototype,"_config",void 0),pd=n([pt(Qc("action"))],pd);const md="mdi:menu";let fd=class extends ht{static async getConfigElement(){return await Promise.resolve().then((function(){return kp})),document.createElement(td("menu"))}static async getStubConfig(t){return{type:"menu"}}setConfig(t){this._config=t}_handleAction(){zt(this,"hass-toggle-menu")}render(){if(!this.hass||!this._config)return J;const t=this._config.icon||md,e=Ee(this.hass);return q`
- `}static get styles(){return h`
+ `}static get styles(){return u`
mushroom-chip {
cursor: pointer;
}
- `}};n([_t({attribute:!1})],ml.prototype,"hass",void 0),n([vt()],ml.prototype,"_config",void 0),ml=n([pt(Zs("menu"))],ml);const pl=new Set(["clear-night","cloudy","fog","lightning","lightning-rainy","partlycloudy","pouring","rainy","hail","snowy","snowy-rainy","sunny","windy","windy-variant"]),fl=t=>{if(!t||!t.startsWith("weather-"))return;const e=t.replace("weather-","");return pl.has(e)?al(e,!0):void 0},gl=["content","icon","icon_color","picture"];let _l=class extends ht{constructor(){super(...arguments),this._templateResults={},this._unsubRenderTemplates=new Map}static async getConfigElement(){return await Promise.resolve().then((function(){return Au})),document.createElement(Js("template"))}static async getStubConfig(t){return{type:"template"}}setConfig(t){gl.forEach((e=>{var i,o;(null===(i=this._config)||void 0===i?void 0:i[e])===t[e]&&(null===(o=this._config)||void 0===o?void 0:o.entity)==t.entity||this._tryDisconnectKey(e)})),this._config=Object.assign({tap_action:{action:"toggle"},hold_action:{action:"more-info"}},t)}connectedCallback(){super.connectedCallback(),this._tryConnect()}disconnectedCallback(){this._tryDisconnect()}_handleAction(t){Ke(this,this.hass,this._config,t.detail.action)}isTemplate(t){var e;const i=null===(e=this._config)||void 0===e?void 0:e[t];return null==i?void 0:i.includes("{")}getValue(t){var e,i,o;return this.isTemplate(t)?null===(i=null===(e=this._templateResults[t])||void 0===e?void 0:e.result)||void 0===i?void 0:i.toString():null===(o=this._config)||void 0===o?void 0:o[t]}render(){if(!this.hass||!this._config)return K;const t=this.getValue("icon"),e=this.getValue("icon_color"),i=this.getValue("content"),o=this.getValue("picture"),n=Ie(this.hass),r=fl(t);return Y`
+ `}};n([gt({attribute:!1})],fd.prototype,"hass",void 0),n([_t()],fd.prototype,"_config",void 0),fd=n([pt(Qc("menu"))],fd);const gd=new Set(["clear-night","cloudy","fog","lightning","lightning-rainy","partlycloudy","pouring","rainy","hail","snowy","snowy-rainy","sunny","windy","windy-variant"]),_d=t=>{if(!t||!t.startsWith("weather-"))return;const e=t.replace("weather-","");return gd.has(e)?ld(e,!0):void 0},vd=["content","icon","icon_color","picture"];let bd=class extends ht{constructor(){super(...arguments),this._templateResults={},this._unsubRenderTemplates=new Map}static async getConfigElement(){return await Promise.resolve().then((function(){return zp})),document.createElement(td("template"))}static async getStubConfig(t){return{type:"template"}}setConfig(t){vd.forEach((e=>{var i,o;(null===(i=this._config)||void 0===i?void 0:i[e])===t[e]&&(null===(o=this._config)||void 0===o?void 0:o.entity)==t.entity||this._tryDisconnectKey(e)})),this._config=Object.assign({tap_action:{action:"toggle"},hold_action:{action:"more-info"}},t)}connectedCallback(){super.connectedCallback(),this._tryConnect()}disconnectedCallback(){this._tryDisconnect()}_handleAction(t){Fe(this,this.hass,this._config,t.detail.action)}isTemplate(t){var e;const i=null===(e=this._config)||void 0===e?void 0:e[t];return null==i?void 0:i.includes("{")}getValue(t){var e,i,o;return this.isTemplate(t)?null===(i=null===(e=this._templateResults[t])||void 0===e?void 0:e.result)||void 0===i?void 0:i.toString():null===(o=this._config)||void 0===o?void 0:o[t]}render(){if(!this.hass||!this._config)return J;const t=this.getValue("icon"),e=this.getValue("icon_color"),i=this.getValue("content"),o=this.getValue("picture"),n=Ee(this.hass),r=_d(t);return q`
- ${o?K:r||(t?this.renderIcon(t,e):K)}
- ${i?this.renderContent(i):K}
+ ${o?J:r||(t?this.renderIcon(t,e):J)}
+ ${i?this.renderContent(i):J}
- `}renderIcon(t,e){const i={};if(e){const t=Qa(e);i["--color"]=`rgb(${t})`}return Y`
`}renderContent(t){return Y`
${t}`}updated(t){super.updated(t),this._config&&this.hass&&this._tryConnect()}async _tryConnect(){gl.forEach((t=>{this._tryConnectKey(t)}))}async _tryConnectKey(t){var e,i;if(void 0===this._unsubRenderTemplates.get(t)&&this.hass&&this._config&&this.isTemplate(t))try{const i=Fe(this.hass.connection,(e=>{this._templateResults=Object.assign(Object.assign({},this._templateResults),{[t]:e})}),{template:null!==(e=this._config[t])&&void 0!==e?e:"",entity_ids:this._config.entity_id,variables:{config:this._config,user:this.hass.user.name,entity:this._config.entity},strict:!0});this._unsubRenderTemplates.set(t,i),await i}catch(e){const o={result:null!==(i=this._config[t])&&void 0!==i?i:"",listeners:{all:!1,domains:[],entities:[],time:!1}};this._templateResults=Object.assign(Object.assign({},this._templateResults),{[t]:o}),this._unsubRenderTemplates.delete(t)}}async _tryDisconnect(){gl.forEach((t=>{this._tryDisconnectKey(t)}))}async _tryDisconnectKey(t){const e=this._unsubRenderTemplates.get(t);if(e)try{(await e)(),this._unsubRenderTemplates.delete(t)}catch(t){if("not_found"!==t.code&&"template_error"!==t.code)throw t}}static get styles(){return h`
+ style=${Sl(i)}
+ >`}renderContent(t){return q`
${t}`}updated(t){super.updated(t),this._config&&this.hass&&this._tryConnect()}async _tryConnect(){vd.forEach((t=>{this._tryConnectKey(t)}))}async _tryConnectKey(t){var e,i;if(void 0===this._unsubRenderTemplates.get(t)&&this.hass&&this._config&&this.isTemplate(t))try{const i=Le(this.hass.connection,(e=>{this._templateResults=Object.assign(Object.assign({},this._templateResults),{[t]:e})}),{template:null!==(e=this._config[t])&&void 0!==e?e:"",entity_ids:this._config.entity_id,variables:{config:this._config,user:this.hass.user.name,entity:this._config.entity},strict:!0});this._unsubRenderTemplates.set(t,i),await i}catch(e){const o={result:null!==(i=this._config[t])&&void 0!==i?i:"",listeners:{all:!1,domains:[],entities:[],time:!1}};this._templateResults=Object.assign(Object.assign({},this._templateResults),{[t]:o}),this._unsubRenderTemplates.delete(t)}}async _tryDisconnect(){vd.forEach((t=>{this._tryDisconnectKey(t)}))}async _tryDisconnectKey(t){const e=this._unsubRenderTemplates.get(t);if(e)try{(await e)(),this._unsubRenderTemplates.delete(t)}catch(t){if("not_found"!==t.code&&"template_error"!==t.code)throw t}}static get styles(){return u`
mushroom-chip {
cursor: pointer;
}
ha-state-icon {
color: var(--color);
}
- ${rl}
- `}};n([_t({attribute:!1})],_l.prototype,"hass",void 0),n([vt()],_l.prototype,"_config",void 0),n([vt()],_l.prototype,"_templateResults",void 0),n([vt()],_l.prototype,"_unsubRenderTemplates",void 0),_l=n([pt(Zs("template"))],_l);const vl=()=>{var t,e,i;customElements.get("ha-form")||null===(t=customElements.get("hui-button-card"))||void 0===t||t.getConfigElement(),customElements.get("ha-entity-picker")||null===(e=customElements.get("hui-entities-card"))||void 0===e||e.getConfigElement(),customElements.get("ha-card-conditions-editor")||null===(i=customElements.get("hui-conditional-card"))||void 0===i||i.getConfigElement()},bl=Zs("conditional"),yl=async()=>{if(customElements.get(bl))return;if(!customElements.get("hui-conditional-base")){(await window.loadCardHelpers()).createCardElement({type:"conditional",card:{type:"button"},conditions:[]})}const t=await(async t=>{let e=customElements.get(t);return e||(await customElements.whenDefined(t),customElements.get(t))})("hui-conditional-base");class e extends t{static async getConfigElement(){return await Promise.resolve().then((function(){return jp})),document.createElement(Js("conditional"))}static async getStubConfig(){return{type:"conditional",conditions:[]}}setConfig(t){if(this.validateConfig(t),!t.chip)throw new Error("No chip configured");this._element=Gs(t.chip)}}customElements.get(bl)||customElements.define(bl,e)};function xl(t){return null!=t.attributes.brightness?Math.max(Math.round(100*t.attributes.brightness/255),1):void 0}function wl(t){return null!=t.attributes.rgb_color?t.attributes.rgb_color:void 0}function kl(t){return Za.rgb(t).l()>96}function Cl(t){return Za.rgb(t).l()>97}function $l(t){return(t=>{var e;return(null===(e=t.attributes.supported_color_modes)||void 0===e?void 0:e.some((t=>De.includes(t))))||!1})(t)}function El(t){return(t=>{var e;return(null===(e=t.attributes.supported_color_modes)||void 0===e?void 0:e.some((t=>Le.includes(t))))||!1})(t)}let Al=class extends ht{static async getConfigElement(){return await Promise.resolve().then((function(){return Bp})),document.createElement(Js("light"))}static async getStubConfig(t){const e=Object.keys(t.states).filter((t=>"light"===t.split(".")[0]));return{type:"light",entity:e[0]}}setConfig(t){this._config=Object.assign({tap_action:{action:"toggle"},hold_action:{action:"more-info"}},t)}_handleAction(t){Ke(this,this.hass,this._config,t.detail.action)}render(){var t,e;if(!this.hass||!this._config||!this._config.entity)return K;const i=this._config.entity,o=this.hass.states[i];if(!o)return K;const n=this._config.name||o.attributes.friendly_name||"",r=this._config.icon,a=this.hass.formatEntityState?this.hass.formatEntityState(o):ne(this.hass.localize,o,this.hass.locale,this.hass.config,this.hass.entities),s=Bt(o),l=wl(o),c={};if(l&&(null===(t=this._config)||void 0===t?void 0:t.use_light_color)){const t=l.join(",");c["--color"]=`rgb(${t})`,Cl(l)&&(c["--color"]="rgba(var(--rgb-primary-text-color), 0.2)")}const d=ss(null!==(e=this._config.content_info)&&void 0!==e?e:"state",n,a,o,this.hass),u=Ie(this.hass);return Y`
+ ${sd}
+ `}};n([gt({attribute:!1})],bd.prototype,"hass",void 0),n([_t()],bd.prototype,"_config",void 0),n([_t()],bd.prototype,"_templateResults",void 0),n([_t()],bd.prototype,"_unsubRenderTemplates",void 0),bd=n([pt(Qc("template"))],bd);const yd=()=>{var t,e,i;customElements.get("ha-form")||null===(t=customElements.get("hui-button-card"))||void 0===t||t.getConfigElement(),customElements.get("ha-entity-picker")||null===(e=customElements.get("hui-entities-card"))||void 0===e||e.getConfigElement(),customElements.get("ha-card-conditions-editor")||null===(i=customElements.get("hui-conditional-card"))||void 0===i||i.getConfigElement()},xd=Qc("conditional"),wd=async()=>{if(customElements.get(xd))return;if(!customElements.get("hui-conditional-base")){(await window.loadCardHelpers()).createCardElement({type:"conditional",card:{type:"button"},conditions:[]})}const t=await(async t=>customElements.get(t)||(await customElements.whenDefined(t),customElements.get(t)))("hui-conditional-base");class e extends t{static async getConfigElement(){return await Promise.resolve().then((function(){return nv})),document.createElement(td("conditional"))}static async getStubConfig(){return{type:"conditional",conditions:[]}}setConfig(t){if(this.validateConfig(t),!t.chip)throw new Error("No chip configured");this._element=Jc(t.chip)}}customElements.get(xd)||customElements.define(xd,e)};function $d(t){return null!=t.attributes.brightness?Math.max(Math.round(100*t.attributes.brightness/255),1):void 0}function kd(t){return null!=t.attributes.rgb_color?t.attributes.rgb_color:void 0}function Cd(t){return Jl.rgb(t).l()>96}function Ed(t){return Jl.rgb(t).l()>97}function Ad(t){return(t=>{var e;return(null===(e=t.attributes.supported_color_modes)||void 0===e?void 0:e.some((t=>ze.includes(t))))||!1})(t)}function Sd(t){return(t=>{var e;return(null===(e=t.attributes.supported_color_modes)||void 0===e?void 0:e.some((t=>Me.includes(t))))||!1})(t)}let Td=class extends ht{static async getConfigElement(){return await Promise.resolve().then((function(){return uv})),document.createElement(td("light"))}static async getStubConfig(t){const e=Object.keys(t.states).filter((t=>"light"===t.split(".")[0]));return{type:"light",entity:e[0]}}setConfig(t){this._config=Object.assign({tap_action:{action:"toggle"},hold_action:{action:"more-info"}},t)}_handleAction(t){Fe(this,this.hass,this._config,t.detail.action)}render(){var t,e;if(!this.hass||!this._config||!this._config.entity)return J;const i=this._config.entity,o=this.hass.states[i];if(!o)return J;const n=this._config.name||o.attributes.friendly_name||"",r=this._config.icon,a=this.hass.formatEntityState?this.hass.formatEntityState(o):te(this.hass.localize,o,this.hass.locale,this.hass.config,this.hass.entities),s=Nt(o),l=kd(o),c={};if(l&&(null===(t=this._config)||void 0===t?void 0:t.use_light_color)){const t=l.join(",");c["--color"]=`rgb(${t})`,Ed(l)&&(c["--color"]="rgba(var(--rgb-primary-text-color), 0.2)")}const d=lc(null!==(e=this._config.content_info)&&void 0!==e?e:"state",n,a,o,this.hass),h=Ee(this.hass);return q`
- ${d?Y`${d}`:K}
+ ${d?q`${d}`:J}
- `}static get styles(){return h`
+ `}static get styles(){return u`
:host {
--color: rgb(var(--rgb-state-light));
}
@@ -1834,22 +1943,22 @@ const ca="important",da=" !"+ca,ua=He(class extends Ye{constructor(t){var e;if(s
ha-state-icon.active {
color: var(--color);
}
- `}};n([_t({attribute:!1})],Al.prototype,"hass",void 0),n([vt()],Al.prototype,"_config",void 0),Al=n([pt(Zs("light"))],Al);let Sl=class extends ht{static async getConfigElement(){return await Promise.resolve().then((function(){return Wp})),document.createElement(Js("alarm-control-panel"))}static async getStubConfig(t){const e=Object.keys(t.states).filter((t=>Hs.includes(t.split(".")[0])));return{type:"alarm-control-panel",entity:e[0]}}setConfig(t){this._config=t}_handleAction(t){Ke(this,this.hass,this._config,t.detail.action)}render(){var t;if(!this.hass||!this._config||!this._config.entity)return K;const e=this._config.entity,i=this.hass.states[e];if(!i)return K;const o=this._config.name||i.attributes.friendly_name||"",n=this._config.icon,r=Ws(i.state),a=Xs(i.state),s=this.hass.formatEntityState?this.hass.formatEntityState(i):ne(this.hass.localize,i,this.hass.locale,this.hass.config,this.hass.entities),l={};if(r){const t=Qa(r);l["--color"]=`rgb(${t})`}const c=ss(null!==(t=this._config.content_info)&&void 0!==t?t:"state",o,s,i,this.hass),d=Ie(this.hass);return Y`
+ `}};n([gt({attribute:!1})],Td.prototype,"hass",void 0),n([_t()],Td.prototype,"_config",void 0),Td=n([pt(Qc("light"))],Td);let Od=class extends ht{static async getConfigElement(){return await Promise.resolve().then((function(){return gv})),document.createElement(td("alarm-control-panel"))}static async getStubConfig(t){const e=Object.keys(t.states).filter((t=>Yc.includes(t.split(".")[0])));return{type:"alarm-control-panel",entity:e[0]}}setConfig(t){this._config=t}_handleAction(t){Fe(this,this.hass,this._config,t.detail.action)}render(){var t;if(!this.hass||!this._config||!this._config.entity)return J;const e=this._config.entity,i=this.hass.states[e];if(!i)return J;const o=this._config.name||i.attributes.friendly_name||"",n=this._config.icon,r=Xc(i.state),a=qc(i.state),s=this.hass.formatEntityState?this.hass.formatEntityState(i):te(this.hass.localize,i,this.hass.locale,this.hass.config,this.hass.entities),l={};if(r){const t=tc(r);l["--color"]=`rgb(${t})`}const c=lc(null!==(t=this._config.content_info)&&void 0!==t?t:"state",o,s,i,this.hass),d=Ee(this.hass);return q`
- ${c?Y`${c}`:K}
+ ${c?q`${c}`:J}
- `}static get styles(){return h`
+ `}static get styles(){return u`
mushroom-chip {
cursor: pointer;
}
@@ -1859,18 +1968,18 @@ const ca="important",da=" !"+ca,ua=He(class extends Ye{constructor(t){var e;if(s
ha-state-icon.pulse {
animation: 1s ease 0s infinite normal none running pulse;
}
- ${ks}
- `}};n([_t({attribute:!1})],Sl.prototype,"hass",void 0),n([vt()],Sl.prototype,"_config",void 0),Sl=n([pt(Zs("alarm-control-panel"))],Sl);let Il=class extends ht{setConfig(){}static get styles(){return h`
+ ${Cc}
+ `}};n([gt({attribute:!1})],Od.prototype,"hass",void 0),n([_t()],Od.prototype,"_config",void 0),Od=n([pt(Qc("alarm-control-panel"))],Od);let Id=class extends ht{setConfig(){}static get styles(){return u`
:host {
flex-grow: 1;
}
- `}};Il=n([pt(Zs("spacer"))],Il);const Tl=`${Vs}-chips-card`,zl=`${Tl}-editor`;Fs({type:Tl,name:"Mushroom Chips Card",description:"Card with chips to display informations"});let Ol=class extends ht{static async getConfigElement(){return await Promise.resolve().then((function(){return hf})),document.createElement(zl)}static async getStubConfig(t){const e=await Promise.all([Qs.getStubConfig(t)]);return{type:`custom:${Tl}`,chips:e}}set hass(t){var e;const i=Ls(this._hass),o=Ls(t);i!==o&&this.toggleAttribute("dark-mode",o),this._hass=t,null===(e=this.shadowRoot)||void 0===e||e.querySelectorAll("div > *").forEach((e=>{e.hass=t}))}getCardSize(){return 1}setConfig(t){this._config=t}render(){if(!this._config||!this._hass)return K;let t="";this._config.alignment&&(t=`align-${this._config.alignment}`);const e=Ie(this._hass);return Y`
+ `}};Id=n([pt(Qc("spacer"))],Id);const zd=`${Fc}-chips-card`,Md=`${zd}-editor`;Bc({type:zd,name:"Mushroom Chips Card",description:"Card with chips to display informations"});let jd=class extends ht{static async getConfigElement(){return await Promise.resolve().then((function(){return Pv})),document.createElement(Md)}static async getStubConfig(t){const e=await Promise.all([ed.getStubConfig(t)]);return{type:`custom:${zd}`,chips:e}}set hass(t){var e;const i=Nc(this._hass),o=Nc(t);i!==o&&this.toggleAttribute("dark-mode",o),this._hass=t,null===(e=this.shadowRoot)||void 0===e||e.querySelectorAll("div > *").forEach((e=>{e.hass=t}))}getCardSize(){return 1}setConfig(t){this._config=t}render(){if(!this._config||!this._hass)return J;let t="";this._config.alignment&&(t=`align-${this._config.alignment}`);const e=Ee(this._hass);return q`
${this._config.chips.map((t=>this.renderChip(t)))}
- `}renderChip(t){"conditional"===t.type&&yl();const e=Gs(t);return e?(this._hass&&(e.hass=this._hass),e.editMode=this.editMode||this.preview,e.preview=this.preview||this.editMode,Y`${e}`):K}static get styles(){return[Ps.styles,h`
+ `}renderChip(t){"conditional"===t.type&&wd();const e=Jc(t);return e?(this._hass&&(e.hass=this._hass),e.editMode=this.editMode||this.preview,e.preview=this.preview||this.editMode,q`${e}`):J}static get styles(){return[Rc.styles,u`
ha-card {
background: none;
box-shadow: none;
@@ -1894,20 +2003,20 @@ const ca="important",da=" !"+ca,ua=He(class extends Ye{constructor(t){var e;if(s
.chip-container.align-justify {
justify-content: space-between;
}
- `]}};n([_t()],Ol.prototype,"preview",void 0),n([_t()],Ol.prototype,"editMode",void 0),n([vt()],Ol.prototype,"_config",void 0),Ol=n([pt(Tl)],Ol);const Ml=`${Vs}-climate-card`,jl=`${Ml}-editor`,Dl=["climate"],Ll={auto:"var(--rgb-state-climate-auto)",cool:"var(--rgb-state-climate-cool)",dry:"var(--rgb-state-climate-dry)",fan_only:"var(--rgb-state-climate-fan-only)",heat:"var(--rgb-state-climate-heat)",heat_cool:"var(--rgb-state-climate-heat-cool)",off:"var(--rgb-state-climate-off)"},Pl={cooling:"var(--rgb-state-climate-cool)",drying:"var(--rgb-state-climate-dry)",heating:"var(--rgb-state-climate-heat)",idle:"var(--rgb-state-climate-idle)",off:"var(--rgb-state-climate-off)"},Nl={auto:"mdi:calendar-sync",cool:"mdi:snowflake",dry:"mdi:water-percent",fan_only:"mdi:fan",heat:"mdi:fire",heat_cool:"mdi:autorenew",off:"mdi:power"},Rl={cooling:"mdi:snowflake",drying:"mdi:water-percent",heating:"mdi:fire",idle:"mdi:clock-outline",off:"mdi:power"};function Fl(t){var e;return null!==(e=Ll[t])&&void 0!==e?e:Ll.off}let Vl=class extends ht{constructor(){super(...arguments),this.fill=!1}callService(t){t.stopPropagation();const e=t.target.mode;this.hass.callService("climate","set_hvac_mode",{entity_id:this.entity.entity_id,hvac_mode:e})}render(){const t=Ie(this.hass),e=this.entity.attributes.hvac_modes.filter((t=>{var e;return(null!==(e=this.modes)&&void 0!==e?e:[]).includes(t)})).sort(je);return Y`
+ `]}};n([gt()],jd.prototype,"preview",void 0),n([gt()],jd.prototype,"editMode",void 0),n([_t()],jd.prototype,"_config",void 0),jd=n([pt(zd)],jd);const Pd=`${Fc}-climate-card`,Dd=`${Pd}-editor`,Ld=["climate"],Nd={auto:"var(--rgb-state-climate-auto)",cool:"var(--rgb-state-climate-cool)",dry:"var(--rgb-state-climate-dry)",fan_only:"var(--rgb-state-climate-fan-only)",heat:"var(--rgb-state-climate-heat)",heat_cool:"var(--rgb-state-climate-heat-cool)",off:"var(--rgb-state-climate-off)"},Rd={cooling:"var(--rgb-state-climate-cool)",drying:"var(--rgb-state-climate-dry)",heating:"var(--rgb-state-climate-heat)",idle:"var(--rgb-state-climate-idle)",off:"var(--rgb-state-climate-off)"},Ud={auto:"mdi:calendar-sync",cool:"mdi:snowflake",dry:"mdi:water-percent",fan_only:"mdi:fan",heat:"mdi:fire",heat_cool:"mdi:autorenew",off:"mdi:power"},Vd={cooling:"mdi:snowflake",drying:"mdi:water-percent",heating:"mdi:fire",idle:"mdi:clock-outline",off:"mdi:power"};function Bd(t){var e;return null!==(e=Nd[t])&&void 0!==e?e:Nd.off}let Fd=class extends ht{constructor(){super(...arguments),this.fill=!1}callService(t){t.stopPropagation();const e=t.target.mode;this.hass.callService("climate","set_hvac_mode",{entity_id:this.entity.entity_id,hvac_mode:e})}render(){const t=Ee(this.hass),e=this.entity.attributes.hvac_modes.filter((t=>{var e;return(null!==(e=this.modes)&&void 0!==e?e:[]).includes(t)})).sort(Ie);return q`
${e.map((t=>this.renderModeButton(t)))}
- `}renderModeButton(t){const e={},i="off"===t?"var(--rgb-grey)":Fl(t);return t===this.entity.state&&(e["--icon-color"]=`rgb(${i})`,e["--bg-color"]=`rgba(${i}, 0.2)`),Y`
+ `}renderModeButton(t){const e={},i="off"===t?"var(--rgb-grey)":Bd(t);return t===this.entity.state&&(e["--icon-color"]=`rgb(${i})`,e["--bg-color"]=`rgba(${i}, 0.2)`),q`
-
+
- `}};n([_t({attribute:!1})],Vl.prototype,"hass",void 0),n([_t({attribute:!1})],Vl.prototype,"entity",void 0),n([_t({attribute:!1})],Vl.prototype,"modes",void 0),n([_t()],Vl.prototype,"fill",void 0),Vl=n([pt("mushroom-climate-hvac-modes-control")],Vl);let Bl=class extends ht{constructor(){super(...arguments),this.disabled=!1,this.formatOptions={},this.pending=!1,this.dispatchValue=t=>{this.pending=!1,this.dispatchEvent(new CustomEvent("change",{detail:{value:t}}))},this.debounceDispatchValue=this.dispatchValue}get _precision(){return Math.ceil(Math.log10(1/this._step))}get _step(){var t;return null!==(t=this.step)&&void 0!==t?t:1}_incrementValue(t){if(t.stopPropagation(),null==this.value)return;const e=Qt(this.value+this._step,this._precision);this._processNewValue(e)}_decrementValue(t){if(t.stopPropagation(),null==this.value)return;const e=Qt(this.value-this._step,this._precision);this._processNewValue(e)}firstUpdated(t){super.firstUpdated(t);const e=(t=>{const e=window.getComputedStyle(t).getPropertyValue("--input-number-debounce"),i=parseFloat(e);return isNaN(i)?2e3:i})(this.container);e&&(this.debounceDispatchValue=Te(this.dispatchValue,e))}_processNewValue(t){const e=((t,e,i)=>{let o;return o=e?Math.max(t,e):t,o=i?Math.min(o,i):o,o})(t,this.min,this.max);this.value!==e&&(this.value=e,this.pending=!0),this.debounceDispatchValue(e)}render(){const t=null!=this.value?te(this.value,this.locale,this.formatOptions):"-";return Y`
+ `}};n([gt({attribute:!1})],Fd.prototype,"hass",void 0),n([gt({attribute:!1})],Fd.prototype,"entity",void 0),n([gt({attribute:!1})],Fd.prototype,"modes",void 0),n([gt()],Fd.prototype,"fill",void 0),Fd=n([pt("mushroom-climate-hvac-modes-control")],Fd);let Hd=class extends ht{constructor(){super(...arguments),this.disabled=!1,this.formatOptions={},this.pending=!1,this.dispatchValue=t=>{this.pending=!1,this.dispatchEvent(new CustomEvent("change",{detail:{value:t}}))},this.debounceDispatchValue=this.dispatchValue}get _precision(){return Math.ceil(Math.log10(1/this._step))}get _step(){var t;return null!==(t=this.step)&&void 0!==t?t:1}_incrementValue(t){if(t.stopPropagation(),null==this.value)return;const e=qt(this.value+this._step,this._precision);this._processNewValue(e)}_decrementValue(t){if(t.stopPropagation(),null==this.value)return;const e=qt(this.value-this._step,this._precision);this._processNewValue(e)}firstUpdated(t){super.firstUpdated(t);const e=(t=>{const e=window.getComputedStyle(t).getPropertyValue("--input-number-debounce"),i=parseFloat(e);return isNaN(i)?2e3:i})(this.container);e&&(this.debounceDispatchValue=Ae(this.dispatchValue,e))}_processNewValue(t){const e=((t,e,i)=>{let o;return o=e?Math.max(t,e):t,o=i?Math.min(o,i):o,o})(t,this.min,this.max);this.value!==e&&(this.value=e,this.pending=!0),this.debounceDispatchValue(e)}render(){const t=null!=this.value?Gt(this.value,this.locale,this.formatOptions):"-";return q`
${t}
@@ -1929,7 +2038,7 @@ const ca="important",da=" !"+ca,ua=He(class extends Ye{constructor(t){var e;if(s
- `}static get styles(){return h`
+ `}static get styles(){return u`
:host {
--text-color: var(--primary-text-color);
--text-color-disabled: rgb(var(--rgb-disabled));
@@ -2002,9 +2111,9 @@ const ca="important",da=" !"+ca,ua=He(class extends Ye{constructor(t){var e;if(s
.value.pending {
opacity: 0.5;
}
- `}};n([_t({attribute:!1})],Bl.prototype,"locale",void 0),n([_t({type:Boolean})],Bl.prototype,"disabled",void 0),n([_t({attribute:!1,type:Number,reflect:!0})],Bl.prototype,"value",void 0),n([_t({type:Number})],Bl.prototype,"step",void 0),n([_t({type:Number})],Bl.prototype,"min",void 0),n([_t({type:Number})],Bl.prototype,"max",void 0),n([_t({attribute:"false"})],Bl.prototype,"formatOptions",void 0),n([vt()],Bl.prototype,"pending",void 0),n([xt("#container")],Bl.prototype,"container",void 0),Bl=n([pt("mushroom-input-number")],Bl);let Ul=class extends ht{constructor(){super(...arguments),this.fill=!1}get _stepSize(){return this.entity.attributes.target_temp_step?this.entity.attributes.target_temp_step:"°F"===this.hass.config.unit_system.temperature?1:.5}onValueChange(t){const e=t.detail.value;this.hass.callService("climate","set_temperature",{entity_id:this.entity.entity_id,temperature:e})}onLowValueChange(t){const e=t.detail.value;this.hass.callService("climate","set_temperature",{entity_id:this.entity.entity_id,target_temp_low:e,target_temp_high:this.entity.attributes.target_temp_high})}onHighValueChange(t){const e=t.detail.value;this.hass.callService("climate","set_temperature",{entity_id:this.entity.entity_id,target_temp_low:this.entity.attributes.target_temp_low,target_temp_high:e})}render(){const t=Ie(this.hass),e=Ut(this.entity),i=1===this._stepSize?{maximumFractionDigits:0}:{minimumFractionDigits:1,maximumFractionDigits:1},o=t=>({"--bg-color":`rgba(var(--rgb-state-climate-${t}), 0.05)`,"--icon-color":`rgb(var(--rgb-state-climate-${t}))`,"--text-color":`rgb(var(--rgb-state-climate-${t}))`});return Y`
+ `}};n([gt({attribute:!1})],Hd.prototype,"locale",void 0),n([gt({type:Boolean})],Hd.prototype,"disabled",void 0),n([gt({attribute:!1,type:Number,reflect:!0})],Hd.prototype,"value",void 0),n([gt({type:Number})],Hd.prototype,"step",void 0),n([gt({type:Number})],Hd.prototype,"min",void 0),n([gt({type:Number})],Hd.prototype,"max",void 0),n([gt({attribute:"false"})],Hd.prototype,"formatOptions",void 0),n([_t()],Hd.prototype,"pending",void 0),n([vt("#container")],Hd.prototype,"container",void 0),Hd=n([pt("mushroom-input-number")],Hd);let Wd=class extends ht{constructor(){super(...arguments),this.fill=!1}get _stepSize(){return this.entity.attributes.target_temp_step?this.entity.attributes.target_temp_step:"°F"===this.hass.config.unit_system.temperature?1:.5}onValueChange(t){const e=t.detail.value;this.hass.callService("climate","set_temperature",{entity_id:this.entity.entity_id,temperature:e})}onLowValueChange(t){const e=t.detail.value;this.hass.callService("climate","set_temperature",{entity_id:this.entity.entity_id,target_temp_low:e,target_temp_high:this.entity.attributes.target_temp_high})}onHighValueChange(t){const e=t.detail.value;this.hass.callService("climate","set_temperature",{entity_id:this.entity.entity_id,target_temp_low:this.entity.attributes.target_temp_low,target_temp_high:e})}render(){const t=Ee(this.hass),e=Rt(this.entity),i=1===this._stepSize?{maximumFractionDigits:0}:{minimumFractionDigits:1,maximumFractionDigits:1},o=t=>({"--bg-color":`rgba(var(--rgb-state-climate-${t}), 0.05)`,"--icon-color":`rgb(var(--rgb-state-climate-${t}))`,"--text-color":`rgb(var(--rgb-state-climate-${t}))`});return q`
- ${null!=this.entity.attributes.temperature?Y`
+ ${null!=this.entity.attributes.temperature?q`
- `:K}
- ${null!=this.entity.attributes.target_temp_low&&null!=this.entity.attributes.target_temp_high?Y`
+ `:J}
+ ${null!=this.entity.attributes.target_temp_low&&null!=this.entity.attributes.target_temp_high?q`
- `:K}
+ `:J}
- `}};n([_t({attribute:!1})],Ul.prototype,"hass",void 0),n([_t({attribute:!1})],Ul.prototype,"entity",void 0),n([_t()],Ul.prototype,"fill",void 0),Ul=n([pt("mushroom-climate-temperature-control")],Ul);const Hl={temperature_control:"mdi:thermometer",hvac_mode_control:"mdi:thermostat"};Fs({type:Ml,name:"Mushroom Climate Card",description:"Card for climate entity"});let Yl=class extends Ns{static async getConfigElement(){return await Promise.resolve().then((function(){return vf})),document.createElement(jl)}static async getStubConfig(t){const e=Object.keys(t.states).filter((t=>Dl.includes(t.split(".")[0])));return{type:`custom:${Ml}`,entity:e[0]}}get _controls(){if(!this._config||!this._stateObj)return[];const t=this._stateObj,e=[];var i;return(null!=(i=t).attributes.temperature||null!=i.attributes.target_temp_low&&null!=i.attributes.target_temp_high)&&this._config.show_temperature_control&&e.push("temperature_control"),((t,e)=>(t.attributes.hvac_modes||[]).some((t=>(null!=e?e:[]).includes(t))))(t,this._config.hvac_modes)&&e.push("hvac_mode_control"),e}get hasControls(){return this._controls.length>0}_onControlTap(t,e){e.stopPropagation(),this._activeControl=t}setConfig(t){super.setConfig(Object.assign({tap_action:{action:"toggle"},hold_action:{action:"more-info"}},t)),this.updateActiveControl()}updated(t){super.updated(t),this.hass&&t.has("hass")&&this.updateActiveControl()}updateActiveControl(){const t=!!this._activeControl&&this._controls.includes(this._activeControl);this._activeControl=t?this._activeControl:this._controls[0]}_handleAction(t){Ke(this,this.hass,this._config,t.detail.action)}render(){if(!this.hass||!this._config||!this._config.entity)return K;const t=this._stateObj;if(!t)return this.renderNotFound(this._config);const e=this._config.name||t.attributes.friendly_name||"",i=this._config.icon,o=Ss(this._config),n=ls(t,o.icon_type);let r=this.hass.formatEntityState?this.hass.formatEntityState(t):ne(this.hass.localize,t,this.hass.locale,this.hass.config,this.hass.entities);if(null!==t.attributes.current_temperature){r+=` - ${te(t.attributes.current_temperature,this.hass.locale)} ${this.hass.config.unit_system.temperature}`}const a=Ie(this.hass),s=(!this._config.collapsible_controls||Bt(t))&&this._controls.length;return Y`
+ `}};n([gt({attribute:!1})],Wd.prototype,"hass",void 0),n([gt({attribute:!1})],Wd.prototype,"entity",void 0),n([gt()],Wd.prototype,"fill",void 0),Wd=n([pt("mushroom-climate-temperature-control")],Wd);const Yd={temperature_control:"mdi:thermometer",hvac_mode_control:"mdi:thermostat"};Bc({type:Pd,name:"Mushroom Climate Card",description:"Card for climate entity"});let Kd=class extends Uc{static async getConfigElement(){return await Promise.resolve().then((function(){return Vv})),document.createElement(Dd)}static async getStubConfig(t){const e=Object.keys(t.states).filter((t=>Ld.includes(t.split(".")[0])));return{type:`custom:${Pd}`,entity:e[0]}}get _controls(){if(!this._config||!this._stateObj)return[];const t=this._stateObj,e=[];var i;return(null!=(i=t).attributes.temperature||null!=i.attributes.target_temp_low&&null!=i.attributes.target_temp_high)&&this._config.show_temperature_control&&e.push("temperature_control"),((t,e)=>(t.attributes.hvac_modes||[]).some((t=>(null!=e?e:[]).includes(t))))(t,this._config.hvac_modes)&&e.push("hvac_mode_control"),e}get hasControls(){return this._controls.length>0}_onControlTap(t,e){e.stopPropagation(),this._activeControl=t}setConfig(t){super.setConfig(Object.assign({tap_action:{action:"toggle"},hold_action:{action:"more-info"}},t)),this.updateActiveControl()}updated(t){super.updated(t),this.hass&&t.has("hass")&&this.updateActiveControl()}updateActiveControl(){const t=!!this._activeControl&&this._controls.includes(this._activeControl);this._activeControl=t?this._activeControl:this._controls[0]}_handleAction(t){Fe(this,this.hass,this._config,t.detail.action)}render(){if(!this.hass||!this._config||!this._config.entity)return J;const t=this._stateObj;if(!t)return this.renderNotFound(this._config);const e=this._config.name||t.attributes.friendly_name||"",i=this._config.icon,o=Oc(this._config),n=cc(t,o.icon_type);let r=this.hass.formatEntityState?this.hass.formatEntityState(t):te(this.hass.localize,t,this.hass.locale,this.hass.config,this.hass.entities);if(null!==t.attributes.current_temperature){r+=` - ${Gt(t.attributes.current_temperature,this.hass.locale)} ${this.hass.config.unit_system.temperature}`}const a=Ee(this.hass),s=(!this._config.collapsible_controls||Nt(t))&&this._controls.length;return q`
${n?this.renderPicture(n):this.renderIcon(t,i)}
${this.renderBadge(t)}
${this.renderStateInfo(t,o,e,r)};
- ${s?Y`
+ ${s?q`
${this.renderActiveControl(t)}
${this.renderOtherControls()}
- `:K}
+ `:J}
- `}renderIcon(t,e){const i=Ut(t),o=Fl(t.state),n={};return n["--icon-color"]=`rgb(${o})`,n["--shape-color"]=`rgba(${o}, 0.2)`,Y`
+ `}renderIcon(t,e){const i=Rt(t),o=Bd(t.state),n={};return n["--icon-color"]=`rgb(${o})`,n["--shape-color"]=`rgba(${o}, 0.2)`,q`
- `}renderBadge(t){return!Ut(t)?super.renderBadge(t):this.renderActionBadge(t)}renderActionBadge(t){const e=t.attributes.hvac_action;if(!e||"off"==e)return K;const i=function(t){var e;return null!==(e=Pl[t])&&void 0!==e?e:Pl.off}(e),o=function(t){var e;return null!==(e=Rl[t])&&void 0!==e?e:""}(e);return o?Y`
+ `}renderBadge(t){return!Rt(t)?super.renderBadge(t):this.renderActionBadge(t)}renderActionBadge(t){const e=t.attributes.hvac_action;if(!e||"off"==e)return J;const i=function(t){var e;return null!==(e=Rd[t])&&void 0!==e?e:Rd.off}(e),o=function(t){var e;return null!==(e=Vd[t])&&void 0!==e?e:""}(e);return o?q`
- `:K}renderOtherControls(){const t=this._controls.filter((t=>t!=this._activeControl));return Y`
- ${t.map((t=>Y`
+ `:J}renderOtherControls(){const t=this._controls.filter((t=>t!=this._activeControl));return q`
+ ${t.map((t=>q`
this._onControlTap(t,e)}>
-
+
`))}
- `}renderActiveControl(t){var e;const i=null!==(e=this._config.hvac_modes)&&void 0!==e?e:[],o=Ss(this._config);switch(this._activeControl){case"temperature_control":return Y`
+ `}renderActiveControl(t){var e;const i=null!==(e=this._config.hvac_modes)&&void 0!==e?e:[],o=Oc(this._config);switch(this._activeControl){case"temperature_control":return q`
- `;case"hvac_mode_control":return Y`
+ `;case"hvac_mode_control":return q`
- `;default:return K}}static get styles(){return[super.styles,Rs,h`
+ `;default:return J}}static get styles(){return[super.styles,Vc,u`
mushroom-state-item {
cursor: pointer;
}
@@ -2109,53 +2218,53 @@ const ca="important",da=" !"+ca,ua=He(class extends Ye{constructor(t){var e;if(s
mushroom-climate-hvac-modes-control {
flex: 1;
}
- `]}};n([vt()],Yl.prototype,"_activeControl",void 0),Yl=n([pt(Ml)],Yl);const Wl=`${Vs}-cover-card`,Xl=`${Wl}-editor`,Kl=["cover"];let ql=class extends ht{constructor(){super(...arguments),this.fill=!1}_onOpenTap(t){t.stopPropagation(),this.hass.callService("cover","open_cover",{entity_id:this.entity.entity_id})}_onCloseTap(t){t.stopPropagation(),this.hass.callService("cover","close_cover",{entity_id:this.entity.entity_id})}_onStopTap(t){t.stopPropagation(),this.hass.callService("cover","stop_cover",{entity_id:this.entity.entity_id})}get openDisabled(){const t=!0===this.entity.attributes.assumed_state;return((void 0!==(e=this.entity).attributes.current_position?100===e.attributes.current_position:"open"===e.state)||function(t){return"opening"===t.state}(this.entity))&&!t;var e}get closedDisabled(){const t=!0===this.entity.attributes.assumed_state;return((void 0!==(e=this.entity).attributes.current_position?0===e.attributes.current_position:"closed"===e.state)||function(t){return"closing"===t.state}(this.entity))&&!t;var e}render(){const t=Ie(this.hass);return Y`
+ `]}};n([_t()],Kd.prototype,"_activeControl",void 0),Kd=n([pt(Pd)],Kd);const Xd=`${Fc}-cover-card`,qd=`${Xd}-editor`,Gd=["cover"];let Zd=class extends ht{constructor(){super(...arguments),this.fill=!1}_onOpenTap(t){t.stopPropagation(),this.hass.callService("cover","open_cover",{entity_id:this.entity.entity_id})}_onCloseTap(t){t.stopPropagation(),this.hass.callService("cover","close_cover",{entity_id:this.entity.entity_id})}_onStopTap(t){t.stopPropagation(),this.hass.callService("cover","stop_cover",{entity_id:this.entity.entity_id})}get openDisabled(){const t=!0===this.entity.attributes.assumed_state;return((void 0!==(e=this.entity).attributes.current_position?100===e.attributes.current_position:"open"===e.state)||function(t){return"opening"===t.state}(this.entity))&&!t;var e}get closedDisabled(){const t=!0===this.entity.attributes.assumed_state;return((void 0!==(e=this.entity).attributes.current_position?0===e.attributes.current_position:"closed"===e.state)||function(t){return"closing"===t.state}(this.entity))&&!t;var e}render(){const t=Ee(this.hass);return q`
- ${Wt(this.entity,1)?Y`
+ ${Bt(this.entity,1)?q`
{switch(t.attributes.device_class){case"awning":case"curtain":case"door":case"gate":return"mdi:arrow-expand-horizontal";default:return"mdi:arrow-up"}})(this.entity)}>
`:void 0}
- ${Wt(this.entity,8)?Y`
+ ${Bt(this.entity,8)?q`
`:void 0}
- ${Wt(this.entity,2)?Y`
+ ${Bt(this.entity,2)?q`
{switch(t.attributes.device_class){case"awning":case"curtain":case"door":case"gate":return"mdi:arrow-collapse-horizontal";default:return"mdi:arrow-down"}})(this.entity)}>
`:void 0}
- `}};n([_t({attribute:!1})],ql.prototype,"hass",void 0),n([_t({attribute:!1})],ql.prototype,"entity",void 0),n([_t()],ql.prototype,"fill",void 0),ql=n([pt("mushroom-cover-buttons-control")],ql);var Gl;
+ `}};n([gt({attribute:!1})],Zd.prototype,"hass",void 0),n([gt({attribute:!1})],Zd.prototype,"entity",void 0),n([gt()],Zd.prototype,"fill",void 0),Zd=n([pt("mushroom-cover-buttons-control")],Zd);var Jd,Qd,th={exports:{}};
/*! Hammer.JS - v2.0.7 - 2016-04-22
* http://hammerjs.github.io/
*
* Copyright (c) 2016 Jorik Tangelder;
- * Licensed under the MIT license */Gl={exports:{}},function(t,e,i,o){var n,r=["","webkit","Moz","MS","ms","o"],a=e.createElement("div"),s="function",l=Math.round,c=Math.abs,d=Date.now;function u(t,e,i){return setTimeout(v(t,i),e)}function h(t,e,i){return!!Array.isArray(t)&&(m(t,i[e],i),!0)}function m(t,e,i){var n;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==o)for(n=0;n
\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=t.console&&(t.console.warn||t.console.log);return r&&r.call(t.console,n,o),e.apply(this,arguments)}}n="function"!=typeof Object.assign?function(t){if(t===o||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i-1}function $(t){return t.trim().split(/\s+/g)}function E(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var o=0;oi[e]})),o}function I(t,e){for(var i,n,a=e[0].toUpperCase()+e.slice(1),s=0;s1&&!i.firstMultiple?i.firstMultiple=Q(e):1===r&&(i.firstMultiple=!1);var a=i.firstInput,s=i.firstMultiple,l=s?s.center:a.center,u=e.center=tt(n);e.timeStamp=d(),e.deltaTime=e.timeStamp-a.timeStamp,e.angle=nt(l,u),e.distance=ot(l,u),function(t,e){var i=e.center,o=t.offsetDelta||{},n=t.prevDelta||{},r=t.prevInput||{};e.eventType!==N&&r.eventType!==R||(n=t.prevDelta={x:r.deltaX||0,y:r.deltaY||0},o=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=n.x+(i.x-o.x),e.deltaY=n.y+(i.y-o.y)}(i,e),e.offsetDirection=it(e.deltaX,e.deltaY);var h,m,p=et(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=p.x,e.overallVelocityY=p.y,e.overallVelocity=c(p.x)>c(p.y)?p.x:p.y,e.scale=s?(h=s.pointers,ot((m=n)[0],m[1],G)/ot(h[0],h[1],G)):1,e.rotation=s?function(t,e){return nt(e[1],e[0],G)+nt(t[1],t[0],G)}(s.pointers,n):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,function(t,e){var i,n,r,a,s=t.lastInterval||e,l=e.timeStamp-s.timeStamp;if(e.eventType!=F&&(l>P||s.velocity===o)){var d=e.deltaX-s.deltaX,u=e.deltaY-s.deltaY,h=et(l,d,u);n=h.x,r=h.y,i=c(h.x)>c(h.y)?h.x:h.y,a=it(d,u),t.lastInterval=e}else i=s.velocity,n=s.velocityX,r=s.velocityY,a=s.direction;e.velocity=i,e.velocityX=n,e.velocityY=r,e.direction=a}(i,e);var f=t.element;k(e.srcEvent.target,f)&&(f=e.srcEvent.target),e.target=f}(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function Q(t){for(var e=[],i=0;i=c(e)?t<0?B:U:e<0?H:Y}function ot(t,e,i){i||(i=q);var o=e[i[0]]-t[i[0]],n=e[i[1]]-t[i[1]];return Math.sqrt(o*o+n*n)}function nt(t,e,i){i||(i=q);var o=e[i[0]]-t[i[0]],n=e[i[1]]-t[i[1]];return 180*Math.atan2(n,o)/Math.PI}Z.prototype={handler:function(){},init:function(){this.evEl&&x(this.element,this.evEl,this.domHandler),this.evTarget&&x(this.target,this.evTarget,this.domHandler),this.evWin&&x(z(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(z(this.element),this.evWin,this.domHandler)}};var rt={mousedown:N,mousemove:2,mouseup:R},at="mousedown",st="mousemove mouseup";function lt(){this.evEl=at,this.evWin=st,this.pressed=!1,Z.apply(this,arguments)}_(lt,Z,{handler:function(t){var e=rt[t.type];e&N&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=R),this.pressed&&(e&R&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:L,srcEvent:t}))}});var ct={pointerdown:N,pointermove:2,pointerup:R,pointercancel:F,pointerout:F},dt={2:D,3:"pen",4:L,5:"kinect"},ut="pointerdown",ht="pointermove pointerup pointercancel";function mt(){this.evEl=ut,this.evWin=ht,Z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(ut="MSPointerDown",ht="MSPointerMove MSPointerUp MSPointerCancel"),_(mt,Z,{handler:function(t){var e=this.store,i=!1,o=t.type.toLowerCase().replace("ms",""),n=ct[o],r=dt[t.pointerType]||t.pointerType,a=r==D,s=E(e,t.pointerId,"pointerId");n&N&&(0===t.button||a)?s<0&&(e.push(t),s=e.length-1):n&(R|F)&&(i=!0),s<0||(e[s]=t,this.callback(this.manager,n,{pointers:e,changedPointers:[t],pointerType:r,srcEvent:t}),i&&e.splice(s,1))}});var pt={touchstart:N,touchmove:2,touchend:R,touchcancel:F};function ft(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,Z.apply(this,arguments)}function gt(t,e){var i=A(t.touches),o=A(t.changedTouches);return e&(R|F)&&(i=S(i.concat(o),"identifier")),[i,o]}_(ft,Z,{handler:function(t){var e=pt[t.type];if(e===N&&(this.started=!0),this.started){var i=gt.call(this,t,e);e&(R|F)&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:D,srcEvent:t})}}});var _t={touchstart:N,touchmove:2,touchend:R,touchcancel:F},vt="touchstart touchmove touchend touchcancel";function bt(){this.evTarget=vt,this.targetIds={},Z.apply(this,arguments)}function yt(t,e){var i=A(t.touches),o=this.targetIds;if(e&(2|N)&&1===i.length)return o[i[0].identifier]=!0,[i,i];var n,r,a=A(t.changedTouches),s=[],l=this.target;if(r=i.filter((function(t){return k(t.target,l)})),e===N)for(n=0;n-1&&o.splice(t,1)}),xt)}}function $t(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,o=0;o-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,i=this.state;function o(i){e.manager.emit(i,t)}i<8&&o(e.options.event+Rt(i)),o(e.options.event),t.additionalEvent&&o(t.additionalEvent),i>=8&&o(e.options.event+Rt(i))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=Pt},canEmit:function(){for(var t=0;te.threshold&&n&e.direction},attrTest:function(t){return Bt.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=Ft(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),_(Ht,Bt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[zt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),_(Yt,Nt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[It]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,o=t.distancee.time;if(this._input=t,!o||!i||t.eventType&(R|F)&&!n)this.reset();else if(t.eventType&N)this.reset(),this._timer=u((function(){this.state=8,this.tryEmit()}),e.time,this);else if(t.eventType&R)return 8;return Pt},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&t.eventType&R?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=d(),this.manager.emit(this.options.event,this._input)))}}),_(Wt,Bt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[zt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),_(Xt,Bt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:W|X,pointers:1},getTouchAction:function(){return Ut.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return i&(W|X)?e=t.overallVelocity:i&W?e=t.overallVelocityX:i&X&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&c(e)>this.options.velocity&&t.eventType&R},emit:function(t){var e=Ft(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),_(Kt,Nt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Tt]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,o=t.distance{const e=t.center.x,i=t.target.getBoundingClientRect().left,o=t.target.clientWidth;return Math.max(Math.min(1,(e-i)/o),0)};let Jl=class extends ht{constructor(){super(...arguments),this.disabled=!1,this.inactive=!1,this.step=1,this.min=0,this.max=100,this.controlled=!1}valueToPercentage(t){return(t-this.min)/(this.max-this.min)}percentageToValue(t){return(this.max-this.min)*t+this.min}firstUpdated(t){super.firstUpdated(t),this.setupListeners()}connectedCallback(){super.connectedCallback(),this.setupListeners()}disconnectedCallback(){super.disconnectedCallback(),this.destroyListeners()}setupListeners(){if(this.slider&&!this._mc){const t=(t=>{const e=window.getComputedStyle(t).getPropertyValue("--slider-threshold"),i=parseFloat(e);return isNaN(i)?10:i})(this.slider);let e;this._mc=new Hammer.Manager(this.slider,{touchAction:"pan-y"}),this._mc.add(new Hammer.Pan({threshold:t,direction:Hammer.DIRECTION_ALL,enable:!0})),this._mc.add(new Hammer.Tap({event:"singletap"})),this._mc.on("panstart",(()=>{this.disabled||(this.controlled=!0,e=this.value)})),this._mc.on("pancancel",(()=>{this.disabled||(this.controlled=!1,this.value=e)})),this._mc.on("panmove",(t=>{if(this.disabled)return;const e=Zl(t);this.value=this.percentageToValue(e),this.dispatchEvent(new CustomEvent("current-change",{detail:{value:Math.round(this.value/this.step)*this.step}}))})),this._mc.on("panend",(t=>{if(this.disabled)return;this.controlled=!1;const e=Zl(t);this.value=Math.round(this.percentageToValue(e)/this.step)*this.step,this.dispatchEvent(new CustomEvent("current-change",{detail:{value:void 0}})),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value}}))})),this._mc.on("singletap",(t=>{if(this.disabled)return;const e=Zl(t);this.value=Math.round(this.percentageToValue(e)/this.step)*this.step,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value}}))}))}}destroyListeners(){this._mc&&(this._mc.destroy(),this._mc=void 0)}render(){var t;return Y`
+ * Licensed under the MIT license */Jd||(Jd=1,Qd=th,function(t,e,i,o){var n,r=["","webkit","Moz","MS","ms","o"],a=e.createElement("div"),s="function",l=Math.round,c=Math.abs,d=Date.now;function h(t,e,i){return setTimeout(v(t,i),e)}function u(t,e,i){return!!Array.isArray(t)&&(p(t,i[e],i),!0)}function p(t,e,i){var n;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==o)for(n=0;n\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=t.console&&(t.console.warn||t.console.log);return r&&r.call(t.console,n,o),e.apply(this,arguments)}}n="function"!=typeof Object.assign?function(t){if(t===o||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i-1}function C(t){return t.trim().split(/\s+/g)}function E(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var o=0;oi[e]})),o}function T(t,e){for(var i,n,a=e[0].toUpperCase()+e.slice(1),s=0;s1&&!i.firstMultiple?i.firstMultiple=Q(e):1===r&&(i.firstMultiple=!1);var a=i.firstInput,s=i.firstMultiple,l=s?s.center:a.center,h=e.center=tt(n);e.timeStamp=d(),e.deltaTime=e.timeStamp-a.timeStamp,e.angle=nt(l,h),e.distance=ot(l,h),function(t,e){var i=e.center,o=t.offsetDelta||{},n=t.prevDelta||{},r=t.prevInput||{};e.eventType!==N&&r.eventType!==R||(n=t.prevDelta={x:r.deltaX||0,y:r.deltaY||0},o=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=n.x+(i.x-o.x),e.deltaY=n.y+(i.y-o.y)}(i,e),e.offsetDirection=it(e.deltaX,e.deltaY);var u,p,m=et(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=m.x,e.overallVelocityY=m.y,e.overallVelocity=c(m.x)>c(m.y)?m.x:m.y,e.scale=s?(u=s.pointers,ot((p=n)[0],p[1],G)/ot(u[0],u[1],G)):1,e.rotation=s?function(t,e){return nt(e[1],e[0],G)+nt(t[1],t[0],G)}(s.pointers,n):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,function(t,e){var i,n,r,a,s=t.lastInterval||e,l=e.timeStamp-s.timeStamp;if(e.eventType!=U&&(l>L||s.velocity===o)){var d=e.deltaX-s.deltaX,h=e.deltaY-s.deltaY,u=et(l,d,h);n=u.x,r=u.y,i=c(u.x)>c(u.y)?u.x:u.y,a=it(d,h),t.lastInterval=e}else i=s.velocity,n=s.velocityX,r=s.velocityY,a=s.direction;e.velocity=i,e.velocityX=n,e.velocityY=r,e.direction=a}(i,e);var f=t.element;$(e.srcEvent.target,f)&&(f=e.srcEvent.target),e.target=f}(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function Q(t){for(var e=[],i=0;i=c(e)?t<0?B:F:e<0?H:W}function ot(t,e,i){i||(i=q);var o=e[i[0]]-t[i[0]],n=e[i[1]]-t[i[1]];return Math.sqrt(o*o+n*n)}function nt(t,e,i){i||(i=q);var o=e[i[0]]-t[i[0]],n=e[i[1]]-t[i[1]];return 180*Math.atan2(n,o)/Math.PI}Z.prototype={handler:function(){},init:function(){this.evEl&&x(this.element,this.evEl,this.domHandler),this.evTarget&&x(this.target,this.evTarget,this.domHandler),this.evWin&&x(I(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(I(this.element),this.evWin,this.domHandler)}};var rt={mousedown:N,mousemove:2,mouseup:R},at="mousedown",st="mousemove mouseup";function lt(){this.evEl=at,this.evWin=st,this.pressed=!1,Z.apply(this,arguments)}_(lt,Z,{handler:function(t){var e=rt[t.type];e&N&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=R),this.pressed&&(e&R&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:D,srcEvent:t}))}});var ct={pointerdown:N,pointermove:2,pointerup:R,pointercancel:U,pointerout:U},dt={2:P,3:"pen",4:D,5:"kinect"},ht="pointerdown",ut="pointermove pointerup pointercancel";function pt(){this.evEl=ht,this.evWin=ut,Z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(ht="MSPointerDown",ut="MSPointerMove MSPointerUp MSPointerCancel"),_(pt,Z,{handler:function(t){var e=this.store,i=!1,o=t.type.toLowerCase().replace("ms",""),n=ct[o],r=dt[t.pointerType]||t.pointerType,a=r==P,s=E(e,t.pointerId,"pointerId");n&N&&(0===t.button||a)?s<0&&(e.push(t),s=e.length-1):n&(R|U)&&(i=!0),s<0||(e[s]=t,this.callback(this.manager,n,{pointers:e,changedPointers:[t],pointerType:r,srcEvent:t}),i&&e.splice(s,1))}});var mt={touchstart:N,touchmove:2,touchend:R,touchcancel:U};function ft(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,Z.apply(this,arguments)}function gt(t,e){var i=A(t.touches),o=A(t.changedTouches);return e&(R|U)&&(i=S(i.concat(o),"identifier")),[i,o]}_(ft,Z,{handler:function(t){var e=mt[t.type];if(e===N&&(this.started=!0),this.started){var i=gt.call(this,t,e);e&(R|U)&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:P,srcEvent:t})}}});var _t={touchstart:N,touchmove:2,touchend:R,touchcancel:U},vt="touchstart touchmove touchend touchcancel";function bt(){this.evTarget=vt,this.targetIds={},Z.apply(this,arguments)}function yt(t,e){var i=A(t.touches),o=this.targetIds;if(e&(2|N)&&1===i.length)return o[i[0].identifier]=!0,[i,i];var n,r,a=A(t.changedTouches),s=[],l=this.target;if(r=i.filter((function(t){return $(t.target,l)})),e===N)for(n=0;n-1&&o.splice(t,1)}),xt)}}function Ct(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,o=0;o-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,i=this.state;function o(i){e.manager.emit(i,t)}i<8&&o(e.options.event+Rt(i)),o(e.options.event),t.additionalEvent&&o(t.additionalEvent),i>=8&&o(e.options.event+Rt(i))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=Lt},canEmit:function(){for(var t=0;te.threshold&&n&e.direction},attrTest:function(t){return Bt.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=Ut(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),_(Ht,Bt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[It]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),_(Wt,Nt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Tt]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,o=t.distancee.time;if(this._input=t,!o||!i||t.eventType&(R|U)&&!n)this.reset();else if(t.eventType&N)this.reset(),this._timer=h((function(){this.state=8,this.tryEmit()}),e.time,this);else if(t.eventType&R)return 8;return Lt},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&t.eventType&R?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=d(),this.manager.emit(this.options.event,this._input)))}}),_(Yt,Bt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[It]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),_(Kt,Bt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Y|K,pointers:1},getTouchAction:function(){return Ft.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return i&(Y|K)?e=t.overallVelocity:i&Y?e=t.overallVelocityX:i&K&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&c(e)>this.options.velocity&&t.eventType&R},emit:function(t){var e=Ut(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),_(Xt,Nt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ot]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,o=t.distance{const e=t.center.x,i=t.target.getBoundingClientRect().left,o=t.target.clientWidth;return Math.max(Math.min(1,(e-i)/o),0)};let ih=class extends ht{constructor(){super(...arguments),this.disabled=!1,this.inactive=!1,this.step=1,this.min=0,this.max=100,this.controlled=!1}valueToPercentage(t){return(t-this.min)/(this.max-this.min)}percentageToValue(t){return(this.max-this.min)*t+this.min}firstUpdated(t){super.firstUpdated(t),this.setupListeners()}connectedCallback(){super.connectedCallback(),this.setupListeners()}disconnectedCallback(){super.disconnectedCallback(),this.destroyListeners()}setupListeners(){if(this.slider&&!this._mc){const t=(t=>{const e=window.getComputedStyle(t).getPropertyValue("--slider-threshold"),i=parseFloat(e);return isNaN(i)?10:i})(this.slider);let e;this._mc=new Hammer.Manager(this.slider,{touchAction:"pan-y"}),this._mc.add(new Hammer.Pan({threshold:t,direction:Hammer.DIRECTION_ALL,enable:!0})),this._mc.add(new Hammer.Tap({event:"singletap"})),this._mc.on("panstart",(()=>{this.disabled||(this.controlled=!0,e=this.value)})),this._mc.on("pancancel",(()=>{this.disabled||(this.controlled=!1,this.value=e)})),this._mc.on("panmove",(t=>{if(this.disabled)return;const e=eh(t);this.value=this.percentageToValue(e),this.dispatchEvent(new CustomEvent("current-change",{detail:{value:Math.round(this.value/this.step)*this.step}}))})),this._mc.on("panend",(t=>{if(this.disabled)return;this.controlled=!1;const e=eh(t);this.value=Math.round(this.percentageToValue(e)/this.step)*this.step,this.dispatchEvent(new CustomEvent("current-change",{detail:{value:void 0}})),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value}}))})),this._mc.on("singletap",(t=>{if(this.disabled)return;const e=eh(t);this.value=Math.round(this.percentageToValue(e)/this.step)*this.step,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value}}))}))}}destroyListeners(){this._mc&&(this._mc.destroy(),this._mc=void 0)}render(){var t;return q`
- ${this.showActive?Y`
`:K}
- ${this.showIndicator?Y`
`:K}
+ ${this.showActive?q`
`:J}
+ ${this.showIndicator?q`
`:J}
- `}static get styles(){return h`
+ `}static get styles(){return u`
:host {
--main-color: rgba(var(--rgb-secondary-text-color), 1);
--bg-gradient: none;
@@ -2241,61 +2350,61 @@ const ca="important",da=" !"+ca,ua=He(class extends Ye{constructor(t){var e;if(s
.controlled .slider .slider-track-indicator {
transition: none;
}
- `}};function Ql(t){return null!=t.attributes.current_position?Math.round(t.attributes.current_position):void 0}function tc(t){const e=t.state;return"open"===e||"opening"===e?"var(--rgb-state-cover-open)":"closed"===e||"closing"===e?"var(--rgb-state-cover-closed)":"var(--rgb-disabled)"}n([_t({type:Boolean})],Jl.prototype,"disabled",void 0),n([_t({type:Boolean})],Jl.prototype,"inactive",void 0),n([_t({type:Boolean,attribute:"show-active"})],Jl.prototype,"showActive",void 0),n([_t({type:Boolean,attribute:"show-indicator"})],Jl.prototype,"showIndicator",void 0),n([_t({attribute:!1,type:Number,reflect:!0})],Jl.prototype,"value",void 0),n([_t({type:Number})],Jl.prototype,"step",void 0),n([_t({type:Number})],Jl.prototype,"min",void 0),n([_t({type:Number})],Jl.prototype,"max",void 0),n([vt()],Jl.prototype,"controlled",void 0),n([xt("#slider")],Jl.prototype,"slider",void 0),Jl=n([pt("mushroom-slider")],Jl);let ec=class extends ht{onChange(t){const e=t.detail.value;this.hass.callService("cover","set_cover_position",{entity_id:this.entity.entity_id,position:e})}onCurrentChange(t){const e=t.detail.value;this.dispatchEvent(new CustomEvent("current-change",{detail:{value:e}}))}render(){const t=Ql(this.entity);return Y`
+ `}};function oh(t){return null!=t.attributes.current_position?Math.round(t.attributes.current_position):void 0}function nh(t){const e=t.state;return"open"===e||"opening"===e?"var(--rgb-state-cover-open)":"closed"===e||"closing"===e?"var(--rgb-state-cover-closed)":"var(--rgb-disabled)"}n([gt({type:Boolean})],ih.prototype,"disabled",void 0),n([gt({type:Boolean})],ih.prototype,"inactive",void 0),n([gt({type:Boolean,attribute:"show-active"})],ih.prototype,"showActive",void 0),n([gt({type:Boolean,attribute:"show-indicator"})],ih.prototype,"showIndicator",void 0),n([gt({attribute:!1,type:Number,reflect:!0})],ih.prototype,"value",void 0),n([gt({type:Number})],ih.prototype,"step",void 0),n([gt({type:Number})],ih.prototype,"min",void 0),n([gt({type:Number})],ih.prototype,"max",void 0),n([_t()],ih.prototype,"controlled",void 0),n([vt("#slider")],ih.prototype,"slider",void 0),ih=n([pt("mushroom-slider")],ih);let rh=class extends ht{onChange(t){const e=t.detail.value;this.hass.callService("cover","set_cover_position",{entity_id:this.entity.entity_id,position:e})}onCurrentChange(t){const e=t.detail.value;this.dispatchEvent(new CustomEvent("current-change",{detail:{value:e}}))}render(){const t=oh(this.entity);return q`
- `}static get styles(){return h`
+ `}static get styles(){return u`
mushroom-slider {
--main-color: var(--slider-color);
--bg-color: var(--slider-bg-color);
}
- `}};n([_t({attribute:!1})],ec.prototype,"hass",void 0),n([_t({attribute:!1})],ec.prototype,"entity",void 0),ec=n([pt("mushroom-cover-position-control")],ec);const ic=function(t=24,e=.2){const i=[];for(let o=0;o
- `}static get styles(){const t=ic.map((([t,e])=>`${e} ${100*t}%`)).join(", ");return h`
+ `}static get styles(){const t=ah.map((([t,e])=>`${e} ${100*t}%`)).join(", ");return u`
mushroom-slider {
--main-color: var(--slider-color);
--bg-color: var(--slider-bg-color);
- --gradient: -webkit-linear-gradient(right, ${u(t)});
+ --gradient: -webkit-linear-gradient(right, ${h(t)});
}
- `}};n([_t({attribute:!1})],oc.prototype,"hass",void 0),n([_t({attribute:!1})],oc.prototype,"entity",void 0),oc=n([pt("mushroom-cover-tilt-position-control")],oc);const nc={buttons_control:"mdi:gesture-tap-button",position_control:"mdi:gesture-swipe-horizontal",tilt_position_control:"mdi:rotate-right"};Fs({type:Wl,name:"Mushroom Cover Card",description:"Card for cover entity"});let rc=class extends Ns{static async getConfigElement(){return await Promise.resolve().then((function(){return kf})),document.createElement(Xl)}static async getStubConfig(t){const e=Object.keys(t.states).filter((t=>Kl.includes(t.split(".")[0])));return{type:`custom:${Wl}`,entity:e[0]}}get hasControls(){return this._controls.length>0}get _nextControl(){var t;if(this._activeControl)return null!==(t=this._controls[this._controls.indexOf(this._activeControl)+1])&&void 0!==t?t:this._controls[0]}_onNextControlTap(t){t.stopPropagation(),this._activeControl=this._nextControl}getCardSize(){return 1}setConfig(t){super.setConfig(Object.assign({tap_action:{action:"toggle"},hold_action:{action:"more-info"}},t)),this.updateActiveControl(),this.updatePosition()}get _controls(){if(!this._config||!this._stateObj)return[];const t=[];return this._config.show_buttons_control&&t.push("buttons_control"),this._config.show_position_control&&t.push("position_control"),this._config.show_tilt_position_control&&t.push("tilt_position_control"),t}updateActiveControl(){const t=!!this._activeControl&&this._controls.includes(this._activeControl);this._activeControl=t?this._activeControl:this._controls[0]}updated(t){super.updated(t),this.hass&&t.has("hass")&&(this.updatePosition(),this.updateActiveControl())}updatePosition(){this.position=void 0;const t=this._stateObj;t&&(this.position=Ql(t))}onCurrentPositionChange(t){null!=t.detail.value&&(this.position=t.detail.value)}_handleAction(t){Ke(this,this.hass,this._config,t.detail.action)}render(){if(!this.hass||!this._config||!this._config.entity)return K;const t=this._stateObj;if(!t)return this.renderNotFound(this._config);const e=this._config.name||t.attributes.friendly_name||"",i=this._config.icon,o=Ss(this._config),n=ls(t,o.icon_type);let r=this.hass.formatEntityState?this.hass.formatEntityState(t):ne(this.hass.localize,t,this.hass.locale,this.hass.config,this.hass.entities);this.position&&(r+=` - ${this.position}${oe(this.hass.locale)}%`);const a=Ie(this.hass);return Y`
+ `}};n([gt({attribute:!1})],sh.prototype,"hass",void 0),n([gt({attribute:!1})],sh.prototype,"entity",void 0),sh=n([pt("mushroom-cover-tilt-position-control")],sh);const lh={buttons_control:"mdi:gesture-tap-button",position_control:"mdi:gesture-swipe-horizontal",tilt_position_control:"mdi:rotate-right"};Bc({type:Xd,name:"Mushroom Cover Card",description:"Card for cover entity"});let ch=class extends Uc{static async getConfigElement(){return await Promise.resolve().then((function(){return Yv})),document.createElement(qd)}static async getStubConfig(t){const e=Object.keys(t.states).filter((t=>Gd.includes(t.split(".")[0])));return{type:`custom:${Xd}`,entity:e[0]}}get hasControls(){return this._controls.length>0}get _nextControl(){var t;if(this._activeControl)return null!==(t=this._controls[this._controls.indexOf(this._activeControl)+1])&&void 0!==t?t:this._controls[0]}_onNextControlTap(t){t.stopPropagation(),this._activeControl=this._nextControl}getCardSize(){return 1}setConfig(t){super.setConfig(Object.assign({tap_action:{action:"toggle"},hold_action:{action:"more-info"}},t)),this.updateActiveControl(),this.updatePosition()}get _controls(){if(!this._config||!this._stateObj)return[];const t=[];return this._config.show_buttons_control&&t.push("buttons_control"),this._config.show_position_control&&t.push("position_control"),this._config.show_tilt_position_control&&t.push("tilt_position_control"),t}updateActiveControl(){const t=!!this._activeControl&&this._controls.includes(this._activeControl);this._activeControl=t?this._activeControl:this._controls[0]}updated(t){super.updated(t),this.hass&&t.has("hass")&&(this.updatePosition(),this.updateActiveControl())}updatePosition(){this.position=void 0;const t=this._stateObj;t&&(this.position=oh(t))}onCurrentPositionChange(t){null!=t.detail.value&&(this.position=t.detail.value)}_handleAction(t){Fe(this,this.hass,this._config,t.detail.action)}render(){if(!this.hass||!this._config||!this._config.entity)return J;const t=this._stateObj;if(!t)return this.renderNotFound(this._config);const e=this._config.name||t.attributes.friendly_name||"",i=this._config.icon,o=Oc(this._config),n=cc(t,o.icon_type);let r=this.hass.formatEntityState?this.hass.formatEntityState(t):te(this.hass.localize,t,this.hass.locale,this.hass.config,this.hass.entities);this.position&&(r+=` - ${this.position}${Qt(this.hass.locale)}%`);const a=Ee(this.hass);return q`
${n?this.renderPicture(n):this.renderIcon(t,i)}
${this.renderBadge(t)}
${this.renderStateInfo(t,o,e,r)};
- ${this._controls.length>0?Y`
+ ${this._controls.length>0?q`
${this.renderActiveControl(t,o.layout)}
${this.renderNextControlButton()}
- `:K}
+ `:J}
- `}renderIcon(t,e){const i={},o=Ut(t),n=tc(t);return i["--icon-color"]=`rgb(${n})`,i["--shape-color"]=`rgba(${n}, 0.2)`,Y`
+ `}renderIcon(t,e){const i={},o=Rt(t),n=nh(t);return i["--icon-color"]=`rgb(${n})`,i["--shape-color"]=`rgba(${n}, 0.2)`,q`
- `}renderNextControlButton(){return this._nextControl&&this._nextControl!=this._activeControl?Y`
+ `}renderNextControlButton(){return this._nextControl&&this._nextControl!=this._activeControl?q`
-
+
- `:K}renderActiveControl(t,e){switch(this._activeControl){case"buttons_control":return Y`
+ `:J}renderActiveControl(t,e){switch(this._activeControl){case"buttons_control":return q`
- `;case"position_control":{const e=tc(t),i={};return i["--slider-color"]=`rgb(${e})`,i["--slider-bg-color"]=`rgba(${e}, 0.2)`,Y`
+ `;case"position_control":{const e=nh(t),i={};return i["--slider-color"]=`rgb(${e})`,i["--slider-bg-color"]=`rgba(${e}, 0.2)`,q`
- `}case"tilt_position_control":{const e=tc(t),i={};return i["--slider-color"]=`rgb(${e})`,i["--slider-bg-color"]=`rgba(${e}, 0.2)`,Y`
+ `}case"tilt_position_control":{const e=nh(t),i={};return i["--slider-color"]=`rgb(${e})`,i["--slider-bg-color"]=`rgba(${e}, 0.2)`,q`
- `}default:return K}}static get styles(){return[super.styles,Rs,h`
+ `}default:return J}}static get styles(){return[super.styles,Vc,u`
mushroom-state-item {
cursor: pointer;
}
@@ -2341,16 +2450,16 @@ const ca="important",da=" !"+ca,ua=He(class extends Ye{constructor(t){var e;if(s
mushroom-cover-tilt-position-control {
flex: 1;
}
- `]}};n([vt()],rc.prototype,"_activeControl",void 0),n([vt()],rc.prototype,"position",void 0),rc=n([pt(Wl)],rc);const ac=`${Vs}-entity-card`,sc=`${ac}-editor`;Fs({type:ac,name:"Mushroom Entity Card",description:"Card for all entities"});let lc=class extends Ns{static async getConfigElement(){return await Promise.resolve().then((function(){return Af})),document.createElement(sc)}static async getStubConfig(t){const e=Object.keys(t.states);return{type:`custom:${ac}`,entity:e[0]}}_handleAction(t){Ke(this,this.hass,this._config,t.detail.action)}render(){if(!this._config||!this.hass||!this._config.entity)return K;const t=this._stateObj;if(!t)return this.renderNotFound(this._config);const e=this._config.name||t.attributes.friendly_name||"",i=this._config.icon,o=Ss(this._config),n=ls(t,o.icon_type),r=Ie(this.hass);return Y`
+ `]}};n([_t()],ch.prototype,"_activeControl",void 0),n([_t()],ch.prototype,"position",void 0),ch=n([pt(Xd)],ch);const dh=`${Fc}-entity-card`,hh=`${dh}-editor`;Bc({type:dh,name:"Mushroom Entity Card",description:"Card for all entities"});let uh=class extends Uc{static async getConfigElement(){return await Promise.resolve().then((function(){return Gv})),document.createElement(hh)}static async getStubConfig(t){const e=Object.keys(t.states);return{type:`custom:${dh}`,entity:e[0]}}_handleAction(t){Fe(this,this.hass,this._config,t.detail.action)}render(){if(!this._config||!this.hass||!this._config.entity)return J;const t=this._stateObj;if(!t)return this.renderNotFound(this._config);const e=this._config.name||t.attributes.friendly_name||"",i=this._config.icon,o=Oc(this._config),n=cc(t,o.icon_type),r=Ee(this.hass);return q`
${n?this.renderPicture(n):this.renderIcon(t,i)}
${this.renderBadge(t)}
@@ -2358,11 +2467,11 @@ const ca="important",da=" !"+ca,ua=He(class extends Ye{constructor(t){var e;if(s
- `}renderIcon(t,e){var i;const o=Bt(t),n={},r=null===(i=this._config)||void 0===i?void 0:i.icon_color;if(r){const t=Qa(r);n["--icon-color"]=`rgb(${t})`,n["--shape-color"]=`rgba(${t}, 0.2)`}return Y`
+ `}renderIcon(t,e){var i;const o=Nt(t),n={},r=null===(i=this._config)||void 0===i?void 0:i.icon_color;if(r){const t=tc(r);n["--icon-color"]=`rgb(${t})`,n["--shape-color"]=`rgba(${t}, 0.2)`}return q`
- `}static get styles(){return[super.styles,Rs,h`
+ `}static get styles(){return[super.styles,Vc,u`
mushroom-state-item {
cursor: pointer;
}
@@ -2378,9 +2487,9 @@ const ca="important",da=" !"+ca,ua=He(class extends Ye{constructor(t){var e;if(s
--icon-color: rgb(var(--rgb-state-entity));
--shape-color: rgba(var(--rgb-state-entity), 0.2);
}
- `]}};lc=n([pt(ac)],lc);const cc=`${Vs}-fan-card`,dc=`${cc}-editor`,uc=["fan"];function hc(t){return null!=t.attributes.percentage?Math.round(t.attributes.percentage):void 0}function mc(t){return null!=t.attributes.oscillating&&Boolean(t.attributes.oscillating)}let pc=class extends ht{_onTap(t){t.stopPropagation();const e=mc(this.entity);this.hass.callService("fan","oscillate",{entity_id:this.entity.entity_id,oscillating:!e})}render(){const t=mc(this.entity),e=Bt(this.entity);return Y`
+ `]}};uh=n([pt(dh)],uh);const ph=`${Fc}-fan-card`,mh=`${ph}-editor`,fh=["fan"];function gh(t){return null!=t.attributes.percentage?Math.round(t.attributes.percentage):void 0}function _h(t){return null!=t.attributes.oscillating&&Boolean(t.attributes.oscillating)}let vh=class extends ht{_onTap(t){t.stopPropagation();const e=_h(this.entity);this.hass.callService("fan","oscillate",{entity_id:this.entity.entity_id,oscillating:!e})}render(){const t=_h(this.entity),e=Nt(this.entity);return q`
@@ -2388,7 +2497,7 @@ const ca="important",da=" !"+ca,ua=He(class extends Ye{constructor(t){var e;if(s
.icon=${t?"mdi:arrow-oscillating":"mdi:arrow-oscillating-off"}
>
- `}static get styles(){return h`
+ `}static get styles(){return u`
:host {
display: flex;
}
@@ -2396,60 +2505,60 @@ const ca="important",da=" !"+ca,ua=He(class extends Ye{constructor(t){var e;if(s
--icon-color: rgb(var(--rgb-state-fan));
--bg-color: rgba(var(--rgb-state-fan), 0.2);
}
- `}};n([_t({attribute:!1})],pc.prototype,"hass",void 0),n([_t({attribute:!1})],pc.prototype,"entity",void 0),pc=n([pt("mushroom-fan-oscillate-control")],pc);let fc=class extends ht{onChange(t){const e=t.detail.value;this.hass.callService("fan","set_percentage",{entity_id:this.entity.entity_id,percentage:e})}onCurrentChange(t){const e=t.detail.value;this.dispatchEvent(new CustomEvent("current-change",{detail:{value:e}}))}render(){const t=hc(this.entity);return Y`
+ `}};n([gt({attribute:!1})],vh.prototype,"hass",void 0),n([gt({attribute:!1})],vh.prototype,"entity",void 0),vh=n([pt("mushroom-fan-oscillate-control")],vh);let bh=class extends ht{onChange(t){const e=t.detail.value;this.hass.callService("fan","set_percentage",{entity_id:this.entity.entity_id,percentage:e})}onCurrentChange(t){const e=t.detail.value;this.dispatchEvent(new CustomEvent("current-change",{detail:{value:e}}))}render(){const t=gh(this.entity);return q`
- `;var e}static get styles(){return h`
+ `;var e}static get styles(){return u`
mushroom-slider {
--main-color: rgb(var(--rgb-state-fan));
--bg-color: rgba(var(--rgb-state-fan), 0.2);
}
- `}};n([_t({attribute:!1})],fc.prototype,"hass",void 0),n([_t({attribute:!1})],fc.prototype,"entity",void 0),fc=n([pt("mushroom-fan-percentage-control")],fc),Fs({type:cc,name:"Mushroom Fan Card",description:"Card for fan entity"});let gc=class extends Ns{static async getConfigElement(){return await Promise.resolve().then((function(){return Of})),document.createElement(dc)}static async getStubConfig(t){const e=Object.keys(t.states).filter((t=>uc.includes(t.split(".")[0])));return{type:`custom:${cc}`,entity:e[0]}}get hasControls(){var t,e;return Boolean(null===(t=this._config)||void 0===t?void 0:t.show_percentage_control)||Boolean(null===(e=this._config)||void 0===e?void 0:e.show_oscillate_control)}setConfig(t){super.setConfig(Object.assign({tap_action:{action:"toggle"},hold_action:{action:"more-info"}},t)),this.updatePercentage()}updated(t){super.updated(t),this.hass&&t.has("hass")&&this.updatePercentage()}updatePercentage(){this.percentage=void 0;const t=this._stateObj;this._config&&this.hass&&t&&(this.percentage=hc(t))}onCurrentPercentageChange(t){null!=t.detail.value&&(this.percentage=Math.round(t.detail.value))}_handleAction(t){Ke(this,this.hass,this._config,t.detail.action)}render(){if(!this._config||!this.hass||!this._config.entity)return K;const t=this._stateObj;if(!t)return this.renderNotFound(this._config);const e=this._config.name||t.attributes.friendly_name||"",i=this._config.icon,o=Ss(this._config),n=ls(t,o.icon_type);let r=this.hass.formatEntityState?this.hass.formatEntityState(t):ne(this.hass.localize,t,this.hass.locale,this.hass.config,this.hass.entities);null!=this.percentage&&"on"===t.state&&(r=`${this.percentage}${oe(this.hass.locale)}%`);const a=Ie(this.hass),s=(!this._config.collapsible_controls||Bt(t))&&(this._config.show_percentage_control||this._config.show_oscillate_control);return Y`
+ `}};n([gt({attribute:!1})],bh.prototype,"hass",void 0),n([gt({attribute:!1})],bh.prototype,"entity",void 0),bh=n([pt("mushroom-fan-percentage-control")],bh),Bc({type:ph,name:"Mushroom Fan Card",description:"Card for fan entity"});let yh=class extends Uc{static async getConfigElement(){return await Promise.resolve().then((function(){return eb})),document.createElement(mh)}static async getStubConfig(t){const e=Object.keys(t.states).filter((t=>fh.includes(t.split(".")[0])));return{type:`custom:${ph}`,entity:e[0]}}get hasControls(){var t,e;return Boolean(null===(t=this._config)||void 0===t?void 0:t.show_percentage_control)||Boolean(null===(e=this._config)||void 0===e?void 0:e.show_oscillate_control)}setConfig(t){super.setConfig(Object.assign({tap_action:{action:"toggle"},hold_action:{action:"more-info"}},t)),this.updatePercentage()}updated(t){super.updated(t),this.hass&&t.has("hass")&&this.updatePercentage()}updatePercentage(){this.percentage=void 0;const t=this._stateObj;this._config&&this.hass&&t&&(this.percentage=gh(t))}onCurrentPercentageChange(t){null!=t.detail.value&&(this.percentage=Math.round(t.detail.value))}_handleAction(t){Fe(this,this.hass,this._config,t.detail.action)}render(){if(!this._config||!this.hass||!this._config.entity)return J;const t=this._stateObj;if(!t)return this.renderNotFound(this._config);const e=this._config.name||t.attributes.friendly_name||"",i=this._config.icon,o=Oc(this._config),n=cc(t,o.icon_type);let r=this.hass.formatEntityState?this.hass.formatEntityState(t):te(this.hass.localize,t,this.hass.locale,this.hass.config,this.hass.entities);null!=this.percentage&&"on"===t.state&&(r=`${this.percentage}${Qt(this.hass.locale)}%`);const a=Ee(this.hass),s=(!this._config.collapsible_controls||Nt(t))&&(this._config.show_percentage_control||this._config.show_oscillate_control);return q`
${n?this.renderPicture(n):this.renderIcon(t,i)}
${this.renderBadge(t)}
${this.renderStateInfo(t,o,e,r)};
- ${s?Y`
+ ${s?q`
- ${this._config.show_percentage_control?Y`
+ ${this._config.show_percentage_control?q`
- `:K}
- ${this._config.show_oscillate_control?Y`
+ `:J}
+ ${this._config.show_oscillate_control?q`
- `:K}
+ `:J}
- `:K}
+ `:J}
- `}renderIcon(t,e){var i;let o={};const n=hc(t),r=Bt(t);if(r)if(n){const t=1.5*(n/100)**.5;o["--animation-duration"]=1/t+"s"}else o["--animation-duration"]="1s";return Y`
+ `}renderIcon(t,e){var i;let o={};const n=gh(t),r=Nt(t);if(r)if(n){const t=1.5*(n/100)**.5;o["--animation-duration"]=1/t+"s"}else o["--animation-duration"]="1s";return q`
- `}static get styles(){return[super.styles,Rs,h`
+ `}static get styles(){return[super.styles,Vc,u`
mushroom-state-item {
cursor: pointer;
}
@@ -2472,36 +2581,36 @@ const ca="important",da=" !"+ca,ua=He(class extends Ye{constructor(t){var e;if(s
mushroom-fan-percentage-control {
flex: 1;
}
- `]}};n([vt()],gc.prototype,"percentage",void 0),gc=n([pt(cc)],gc);const _c=`${Vs}-humidifier-card`,vc=`${_c}-editor`,bc=["humidifier"];let yc=class extends ht{onChange(t){const e=t.detail.value;this.hass.callService("humidifier","set_humidity",{entity_id:this.entity.entity_id,humidity:e})}onCurrentChange(t){const e=t.detail.value;this.dispatchEvent(new CustomEvent("current-change",{detail:{value:e}}))}render(){const t=this.entity.attributes.max_humidity||100,e=this.entity.attributes.min_humidity||0;return Y``}static get styles(){return h`
+ />`}static get styles(){return u`
mushroom-slider {
--main-color: rgb(var(--rgb-state-humidifier));
--bg-color: rgba(var(--rgb-state-humidifier), 0.2);
}
- `}};n([_t({attribute:!1})],yc.prototype,"hass",void 0),n([_t({attribute:!1})],yc.prototype,"entity",void 0),n([_t({attribute:!1})],yc.prototype,"color",void 0),yc=n([pt("mushroom-humidifier-humidity-control")],yc),Fs({type:_c,name:"Mushroom Humidifier Card",description:"Card for humidifier entity"});let xc=class extends Ns{static async getConfigElement(){return await Promise.resolve().then((function(){return Pf})),document.createElement(vc)}static async getStubConfig(t){const e=Object.keys(t.states).filter((t=>bc.includes(t.split(".")[0])));return{type:`custom:${_c}`,entity:e[0]}}get hasControls(){var t;return Boolean(null===(t=this._config)||void 0===t?void 0:t.show_target_humidity_control)}setConfig(t){super.setConfig(Object.assign({tap_action:{action:"toggle"},hold_action:{action:"more-info"}},t))}_handleAction(t){Ke(this,this.hass,this._config,t.detail.action)}onCurrentHumidityChange(t){null!=t.detail.value&&(this.humidity=t.detail.value)}render(){if(!this._config||!this.hass||!this._config.entity)return K;const t=this._stateObj;if(!t)return this.renderNotFound(this._config);const e=this._config.name||t.attributes.friendly_name||"",i=this._config.icon,o=Ss(this._config),n=ls(t,o.icon_type);let r=this.hass.formatEntityState?this.hass.formatEntityState(t):ne(this.hass.localize,t,this.hass.locale,this.hass.config,this.hass.entities);this.humidity&&(r=`${this.humidity}${oe(this.hass.locale)}%`);const a=Ie(this.hass),s=(!this._config.collapsible_controls||Bt(t))&&this._config.show_target_humidity_control;return Y`
+ `}};n([gt({attribute:!1})],kh.prototype,"hass",void 0),n([gt({attribute:!1})],kh.prototype,"entity",void 0),n([gt({attribute:!1})],kh.prototype,"color",void 0),kh=n([pt("mushroom-humidifier-humidity-control")],kh),Bc({type:xh,name:"Mushroom Humidifier Card",description:"Card for humidifier entity"});let Ch=class extends Uc{static async getConfigElement(){return await Promise.resolve().then((function(){return ab})),document.createElement(wh)}static async getStubConfig(t){const e=Object.keys(t.states).filter((t=>$h.includes(t.split(".")[0])));return{type:`custom:${xh}`,entity:e[0]}}get hasControls(){var t;return Boolean(null===(t=this._config)||void 0===t?void 0:t.show_target_humidity_control)}setConfig(t){super.setConfig(Object.assign({tap_action:{action:"toggle"},hold_action:{action:"more-info"}},t))}_handleAction(t){Fe(this,this.hass,this._config,t.detail.action)}onCurrentHumidityChange(t){null!=t.detail.value&&(this.humidity=t.detail.value)}render(){if(!this._config||!this.hass||!this._config.entity)return J;const t=this._stateObj;if(!t)return this.renderNotFound(this._config);const e=this._config.name||t.attributes.friendly_name||"",i=this._config.icon,o=Oc(this._config),n=cc(t,o.icon_type);let r=this.hass.formatEntityState?this.hass.formatEntityState(t):te(this.hass.localize,t,this.hass.locale,this.hass.config,this.hass.entities);this.humidity&&(r=`${this.humidity}${Qt(this.hass.locale)}%`);const a=Ee(this.hass),s=(!this._config.collapsible_controls||Nt(t))&&this._config.show_target_humidity_control;return q`
${n?this.renderPicture(n):this.renderIcon(t,i)}
${this.renderBadge(t)}
${this.renderStateInfo(t,o,e,r)};
- ${s?Y`
+ ${s?q`
- `:K}
+ `:J}
- `}static get styles(){return[super.styles,Rs,h`
+ `}static get styles(){return[super.styles,Vc,u`
mushroom-state-item {
cursor: pointer;
}
@@ -2523,22 +2632,22 @@ const ca="important",da=" !"+ca,ua=He(class extends Ye{constructor(t){var e;if(s
mushroom-humidifier-humidity-control {
flex: 1;
}
- `]}};n([vt()],xc.prototype,"humidity",void 0),xc=n([pt(_c)],xc);const wc=`${Vs}-number-card`,kc=`${wc}-editor`,Cc=["number","input_number"];let $c=class extends ht{onChange(t){const e=t.detail.value,i=this.entity.entity_id.split(".")[0];this.hass.callService(i,"set_value",{entity_id:this.entity.entity_id,value:e})}onCurrentChange(t){const e=t.detail.value;this.dispatchEvent(new CustomEvent("current-change",{detail:{value:e}}))}render(){var t;const e=Number(this.entity.state),i=null!==(t=ee(this.entity,this.hass.entities[this.entity.entity_id]))&&void 0!==t?t:ie(this.entity.state);return"buttons"===this.displayMode?Y`
+ `]}};n([_t()],Ch.prototype,"humidity",void 0),Ch=n([pt(xh)],Ch);const Eh=`${Fc}-number-card`,Ah=`${Eh}-editor`,Sh=["number","input_number"];let Th=class extends ht{onChange(t){const e=t.detail.value,i=this.entity.entity_id.split(".")[0];this.hass.callService(i,"set_value",{entity_id:this.entity.entity_id,value:e})}onCurrentChange(t){const e=t.detail.value;this.dispatchEvent(new CustomEvent("current-change",{detail:{value:e}}))}render(){var t;const e=Number(this.entity.state),i=null!==(t=Zt(this.entity,this.hass.entities[this.entity.entity_id]))&&void 0!==t?t:Jt(this.entity.state);return"buttons"===this.displayMode?q`
- `:Y`
+ `:q`
- `}static get styles(){return h`
+ `}static get styles(){return u`
:host {
--slider-color: rgb(var(--rgb-state-number));
--slider-outline-color: transparent;
@@ -2557,16 +2666,16 @@ const ca="important",da=" !"+ca,ua=He(class extends Ye{constructor(t){var e;if(s
--bg-color: var(--slider-bg-color);
--main-outline-color: var(--slider-outline-color);
}
- `}};n([_t({attribute:!1})],$c.prototype,"hass",void 0),n([_t({attribute:!1})],$c.prototype,"entity",void 0),n([_t({attribute:!1})],$c.prototype,"displayMode",void 0),$c=n([pt("mushroom-number-value-control")],$c),Fs({type:wc,name:"Mushroom Number Card",description:"Card for number and input number entity"});let Ec=class extends Ns{static async getConfigElement(){return await Promise.resolve().then((function(){return Uf})),document.createElement(kc)}static async getStubConfig(t){const e=Object.keys(t.states).filter((t=>Cc.includes(t.split(".")[0])));return{type:`custom:${wc}`,entity:e[0]}}get hasControls(){return!0}_handleAction(t){Ke(this,this.hass,this._config,t.detail.action)}onCurrentValueChange(t){null!=t.detail.value&&(this.value=t.detail.value)}updated(t){super.updated(t),this.hass&&t.has("hass")&&this.updateValue()}updateValue(){this.value=void 0;const t=this._stateObj;t&&!Number.isNaN(t.state)&&(this.value=Number(t.state))}render(){var t,e,i;if(!this._config||!this.hass||!this._config.entity)return K;const o=this._stateObj;if(!o)return this.renderNotFound(this._config);const n=this._config.name||o.attributes.friendly_name||"",r=this._config.icon,a=Ss(this._config),s=ls(o,a.icon_type);let l=this.hass.formatEntityState?this.hass.formatEntityState(o):ne(this.hass.localize,o,this.hass.locale,this.hass.config,this.hass.entities);if(void 0!==this.value){l=`${te(this.value,this.hass.locale,null!==(t=ee(o,this.hass.entities[o.entity_id]))&&void 0!==t?t:ie(o.state))} ${null!==(e=o.attributes.unit_of_measurement)&&void 0!==e?e:""}`}const c=Ie(this.hass),d={},u=null===(i=this._config)||void 0===i?void 0:i.icon_color;if(u){const t=Qa(u);d["--slider-color"]=`rgb(${t})`,d["--slider-bg-color"]=`rgba(${t}, 0.2)`}return Y`
+ `}};n([gt({attribute:!1})],Th.prototype,"hass",void 0),n([gt({attribute:!1})],Th.prototype,"entity",void 0),n([gt({attribute:!1})],Th.prototype,"displayMode",void 0),Th=n([pt("mushroom-number-value-control")],Th),Bc({type:Eh,name:"Mushroom Number Card",description:"Card for number and input number entity"});let Oh=class extends Uc{static async getConfigElement(){return await Promise.resolve().then((function(){return ub})),document.createElement(Ah)}static async getStubConfig(t){const e=Object.keys(t.states).filter((t=>Sh.includes(t.split(".")[0])));return{type:`custom:${Eh}`,entity:e[0]}}get hasControls(){return!0}_handleAction(t){Fe(this,this.hass,this._config,t.detail.action)}onCurrentValueChange(t){null!=t.detail.value&&(this.value=t.detail.value)}updated(t){super.updated(t),this.hass&&t.has("hass")&&this.updateValue()}updateValue(){this.value=void 0;const t=this._stateObj;t&&!Number.isNaN(t.state)&&(this.value=Number(t.state))}render(){var t,e,i;if(!this._config||!this.hass||!this._config.entity)return J;const o=this._stateObj;if(!o)return this.renderNotFound(this._config);const n=this._config.name||o.attributes.friendly_name||"",r=this._config.icon,a=Oc(this._config),s=cc(o,a.icon_type);let l=this.hass.formatEntityState?this.hass.formatEntityState(o):te(this.hass.localize,o,this.hass.locale,this.hass.config,this.hass.entities);if(void 0!==this.value){l=`${Gt(this.value,this.hass.locale,null!==(t=Zt(o,this.hass.entities[o.entity_id]))&&void 0!==t?t:Jt(o.state))} ${null!==(e=o.attributes.unit_of_measurement)&&void 0!==e?e:""}`}const c=Ee(this.hass),d={},h=null===(i=this._config)||void 0===i?void 0:i.icon_color;if(h){const t=tc(h);d["--slider-color"]=`rgb(${t})`,d["--slider-bg-color"]=`rgba(${t}, 0.2)`}return q`
${s?this.renderPicture(s):this.renderIcon(o,r)}
${this.renderBadge(o)}
@@ -2577,17 +2686,17 @@ const ca="important",da=" !"+ca,ua=He(class extends Ye{constructor(t){var e;if(s
.hass=${this.hass}
.entity=${o}
.displayMode=${this._config.display_mode}
- style=${ua(d)}
+ style=${Sl(d)}
@current-change=${this.onCurrentValueChange}
>
- `}renderIcon(t,e){var i;const o=Bt(t),n={},r=null===(i=this._config)||void 0===i?void 0:i.icon_color;if(r){const t=Qa(r);n["--icon-color"]=`rgb(${t})`,n["--shape-color"]=`rgba(${t}, 0.2)`}return Y`
+ `}renderIcon(t,e){var i;const o=Nt(t),n={},r=null===(i=this._config)||void 0===i?void 0:i.icon_color;if(r){const t=tc(r);n["--icon-color"]=`rgb(${t})`,n["--shape-color"]=`rgba(${t}, 0.2)`}return q`