Files
2026-01-30 23:31:00 -06:00

3 lines
13 KiB
JavaScript

/*! For license information please see 7014.a602945490de7535.js.LICENSE.txt */
"use strict";(self.webpackChunkhacs_frontend=self.webpackChunkhacs_frontend||[]).push([["7014"],{29939:function(e,t,i){var c=i(73577),r=i(72621),o=(i(71695),i(47021),i(62523)),s=i(83835),a=i(57243),n=i(50778),d=i(26610);let l,h=e=>e;(0,c.Z)([(0,n.Mo)("ha-switch")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"haptic",value(){return!1}},{kind:"method",key:"firstUpdated",value:function(){(0,r.Z)(i,"firstUpdated",this,3)([]),this.addEventListener("change",(()=>{this.haptic&&(0,d.j)("light")}))}},{kind:"field",static:!0,key:"styles",value(){return[s.W,(0,a.iv)(l||(l=h`:host{--mdc-theme-secondary:var(--switch-checked-color)}.mdc-switch.mdc-switch--checked .mdc-switch__thumb{background-color:var(--switch-checked-button-color);border-color:var(--switch-checked-button-color)}.mdc-switch.mdc-switch--checked .mdc-switch__track{background-color:var(--switch-checked-track-color);border-color:var(--switch-checked-track-color)}.mdc-switch:not(.mdc-switch--checked) .mdc-switch__thumb{background-color:var(--switch-unchecked-button-color);border-color:var(--switch-unchecked-button-color)}.mdc-switch:not(.mdc-switch--checked) .mdc-switch__track{background-color:var(--switch-unchecked-track-color);border-color:var(--switch-unchecked-track-color)}`))]}}]}}),o.H)},26610:function(e,t,i){i.d(t,{j:function(){return r}});var c=i(11297);const r=e=>{(0,c.B)(window,"haptic",e)}},34026:function(e,t,i){i.r(t);var c=i(73577),r=(i(71695),i(19423),i(47021),i(57243)),o=i(50778),s=i(11297),a=(i(29939),i(70596),i(66193));let n,d,l,h=e=>e;(0,c.Z)([(0,o.Mo)("ha-counter-form")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"new",value(){return!1}},{kind:"field",key:"_item",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_name",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_icon",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_maximum",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_minimum",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_restore",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_initial",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_step",value:void 0},{kind:"set",key:"item",value:function(e){var t,i,c,r,o;(this._item=e,e)?(this._name=e.name||"",this._icon=e.icon||"",this._maximum=null!==(t=e.maximum)&&void 0!==t?t:void 0,this._minimum=null!==(i=e.minimum)&&void 0!==i?i:void 0,this._restore=null===(c=e.restore)||void 0===c||c,this._step=null!==(r=e.step)&&void 0!==r?r:1,this._initial=null!==(o=e.initial)&&void 0!==o?o:0):(this._name="",this._icon="",this._maximum=void 0,this._minimum=void 0,this._restore=!0,this._step=1,this._initial=0)}},{kind:"method",key:"focus",value:function(){this.updateComplete.then((()=>{var e;return null===(e=this.shadowRoot)||void 0===e||null===(e=e.querySelector("[dialogInitialFocus]"))||void 0===e?void 0:e.focus()}))}},{kind:"method",key:"render",value:function(){var e;return this.hass?(0,r.dy)(n||(n=h` <div class="form"> <ha-textfield .value="${0}" .configValue="${0}" @input="${0}" .label="${0}" autoValidate required .validationMessage="${0}" dialogInitialFocus></ha-textfield> <ha-icon-picker .hass="${0}" .value="${0}" .configValue="${0}" @value-changed="${0}" .label="${0}"></ha-icon-picker> <ha-textfield .value="${0}" .configValue="${0}" type="number" @input="${0}" .label="${0}"></ha-textfield> <ha-textfield .value="${0}" .configValue="${0}" type="number" @input="${0}" .label="${0}"></ha-textfield> <ha-textfield .value="${0}" .configValue="${0}" type="number" @input="${0}" .label="${0}"></ha-textfield> ${0} </div> `),this._name,"name",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.generic.name"),this.hass.localize("ui.dialogs.helper_settings.required_error_msg"),this.hass,this._icon,"icon",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.generic.icon"),this._minimum,"minimum",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.counter.minimum"),this._maximum,"maximum",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.counter.maximum"),this._initial,"initial",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.counter.initial"),null!==(e=this.hass.userData)&&void 0!==e&&e.showAdvanced?(0,r.dy)(d||(d=h` <ha-textfield .value="${0}" .configValue="${0}" type="number" @input="${0}" .label="${0}"></ha-textfield> <div class="row"> <ha-switch .checked="${0}" .configValue="${0}" @change="${0}"> </ha-switch> <div> ${0} </div> </div> `),this._step,"step",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.counter.step"),this._restore,"restore",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.counter.restore")):""):r.Ld}},{kind:"method",key:"_valueChanged",value:function(e){var t;if(!this.new&&!this._item)return;e.stopPropagation();const i=e.target,c=i.configValue,r="number"===i.type?""!==i.value?Number(i.value):void 0:"ha-switch"===i.localName?e.target.checked:(null===(t=e.detail)||void 0===t?void 0:t.value)||i.value;if(this[`_${c}`]===r)return;const o=Object.assign({},this._item);void 0===r||""===r?delete o[c]:o[c]=r,(0,s.B)(this,"value-changed",{value:o})}},{kind:"get",static:!0,key:"styles",value:function(){return[a.Qx,(0,r.iv)(l||(l=h`.form{color:var(--primary-text-color)}.row{margin-top:12px;margin-bottom:12px;color:var(--primary-text-color);display:flex;align-items:center}.row div{margin-left:16px;margin-inline-start:16px;margin-inline-end:initial}ha-textfield{display:block;margin:8px 0}`))]}}]}}),r.oi)},62523:function(e,t,i){i.d(t,{H:()=>_});i("71695"),i("19423"),i("47021");var c=i("9065"),r=(i("16060"),i("4428")),o=i("11911"),s=i("78611"),a=i("91532"),n=i("80573"),d={CHECKED:"mdc-switch--checked",DISABLED:"mdc-switch--disabled"},l={ARIA_CHECKED_ATTR:"aria-checked",NATIVE_CONTROL_SELECTOR:".mdc-switch__native-control",RIPPLE_SURFACE_SELECTOR:".mdc-switch__thumb-underlay"};const h=function(e){function t(i){return e.call(this,(0,c.pi)((0,c.pi)({},t.defaultAdapter),i))||this}return(0,c.ZT)(t,e),Object.defineProperty(t,"strings",{get:function(){return l},enumerable:!1,configurable:!0}),Object.defineProperty(t,"cssClasses",{get:function(){return d},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNativeControlChecked:function(){},setNativeControlDisabled:function(){},setNativeControlAttr:function(){}}},enumerable:!1,configurable:!0}),t.prototype.setChecked=function(e){this.adapter.setNativeControlChecked(e),this.updateAriaChecked(e),this.updateCheckedStyling(e)},t.prototype.setDisabled=function(e){this.adapter.setNativeControlDisabled(e),e?this.adapter.addClass(d.DISABLED):this.adapter.removeClass(d.DISABLED)},t.prototype.handleChange=function(e){var t=e.target;this.updateAriaChecked(t.checked),this.updateCheckedStyling(t.checked)},t.prototype.updateCheckedStyling=function(e){e?this.adapter.addClass(d.CHECKED):this.adapter.removeClass(d.CHECKED)},t.prototype.updateAriaChecked=function(e){this.adapter.setNativeControlAttr(l.ARIA_CHECKED_ATTR,""+!!e)},t}(n.K);var u=i("57243"),p=i("50778"),m=i("20552");let v,b,f=e=>e;class _ extends o.H{constructor(){super(...arguments),this.checked=!1,this.disabled=!1,this.shouldRenderRipple=!1,this.mdcFoundationClass=h,this.rippleHandlers=new a.A((()=>(this.shouldRenderRipple=!0,this.ripple)))}changeHandler(e){this.mdcFoundation.handleChange(e),this.checked=this.formElement.checked}createAdapter(){return Object.assign(Object.assign({},(0,o.q)(this.mdcRoot)),{setNativeControlChecked:e=>{this.formElement.checked=e},setNativeControlDisabled:e=>{this.formElement.disabled=e},setNativeControlAttr:(e,t)=>{this.formElement.setAttribute(e,t)}})}renderRipple(){return this.shouldRenderRipple?(0,u.dy)(v||(v=f` <mwc-ripple .accent="${0}" .disabled="${0}" unbounded> </mwc-ripple>`),this.checked,this.disabled):""}focus(){const e=this.formElement;e&&(this.rippleHandlers.startFocus(),e.focus())}blur(){const e=this.formElement;e&&(this.rippleHandlers.endFocus(),e.blur())}click(){this.formElement&&!this.disabled&&(this.formElement.focus(),this.formElement.click())}firstUpdated(){super.firstUpdated(),this.shadowRoot&&this.mdcRoot.addEventListener("change",(e=>{this.dispatchEvent(new Event("change",e))}))}render(){return(0,u.dy)(b||(b=f` <div class="mdc-switch"> <div class="mdc-switch__track"></div> <div class="mdc-switch__thumb-underlay"> ${0} <div class="mdc-switch__thumb"> <input type="checkbox" id="basic-switch" class="mdc-switch__native-control" role="switch" aria-label="${0}" aria-labelledby="${0}" @change="${0}" @focus="${0}" @blur="${0}" @mousedown="${0}" @mouseenter="${0}" @mouseleave="${0}" @touchstart="${0}" @touchend="${0}" @touchcancel="${0}"> </div> </div> </div>`),this.renderRipple(),(0,m.o)(this.ariaLabel),(0,m.o)(this.ariaLabelledBy),this.changeHandler,this.handleRippleFocus,this.handleRippleBlur,this.handleRippleMouseDown,this.handleRippleMouseEnter,this.handleRippleMouseLeave,this.handleRippleTouchStart,this.handleRippleDeactivate,this.handleRippleDeactivate)}handleRippleMouseDown(e){const t=()=>{window.removeEventListener("mouseup",t),this.handleRippleDeactivate()};window.addEventListener("mouseup",t),this.rippleHandlers.startPress(e)}handleRippleTouchStart(e){this.rippleHandlers.startPress(e)}handleRippleDeactivate(){this.rippleHandlers.endPress()}handleRippleMouseEnter(){this.rippleHandlers.startHover()}handleRippleMouseLeave(){this.rippleHandlers.endHover()}handleRippleFocus(){this.rippleHandlers.startFocus()}handleRippleBlur(){this.rippleHandlers.endFocus()}}(0,c.gn)([(0,p.Cb)({type:Boolean}),(0,s.P)((function(e){this.mdcFoundation.setChecked(e)}))],_.prototype,"checked",void 0),(0,c.gn)([(0,p.Cb)({type:Boolean}),(0,s.P)((function(e){this.mdcFoundation.setDisabled(e)}))],_.prototype,"disabled",void 0),(0,c.gn)([r.L,(0,p.Cb)({attribute:"aria-label"})],_.prototype,"ariaLabel",void 0),(0,c.gn)([r.L,(0,p.Cb)({attribute:"aria-labelledby"})],_.prototype,"ariaLabelledBy",void 0),(0,c.gn)([(0,p.IO)(".mdc-switch")],_.prototype,"mdcRoot",void 0),(0,c.gn)([(0,p.IO)("input")],_.prototype,"formElement",void 0),(0,c.gn)([(0,p.GC)("mwc-ripple")],_.prototype,"ripple",void 0),(0,c.gn)([(0,p.SB)()],_.prototype,"shouldRenderRipple",void 0),(0,c.gn)([(0,p.hO)({passive:!0})],_.prototype,"handleRippleMouseDown",null),(0,c.gn)([(0,p.hO)({passive:!0})],_.prototype,"handleRippleTouchStart",null)},83835:function(e,t,i){i.d(t,{W:function(){return r}});let c;const r=(0,i(57243).iv)(c||(c=(e=>e)`.mdc-switch__thumb-underlay{left:-14px;right:initial;top:-17px;width:48px;height:48px}.mdc-switch__thumb-underlay[dir=rtl],[dir=rtl] .mdc-switch__thumb-underlay{left:initial;right:-14px}.mdc-switch__native-control{width:64px;height:48px}.mdc-switch{display:inline-block;position:relative;outline:0;user-select:none}.mdc-switch.mdc-switch--checked .mdc-switch__track{background-color:#018786;background-color:var(--mdc-theme-secondary,#018786)}.mdc-switch.mdc-switch--checked .mdc-switch__thumb{background-color:#018786;background-color:var(--mdc-theme-secondary,#018786);border-color:#018786;border-color:var(--mdc-theme-secondary,#018786)}.mdc-switch:not(.mdc-switch--checked) .mdc-switch__track{background-color:#000;background-color:var(--mdc-theme-on-surface,#000)}.mdc-switch:not(.mdc-switch--checked) .mdc-switch__thumb{background-color:#fff;background-color:var(--mdc-theme-surface,#fff);border-color:#fff;border-color:var(--mdc-theme-surface,#fff)}.mdc-switch__native-control{left:0;right:initial;position:absolute;top:0;margin:0;opacity:0;cursor:pointer;pointer-events:auto;transition:transform 90ms cubic-bezier(.4, 0, .2, 1)}.mdc-switch__native-control[dir=rtl],[dir=rtl] .mdc-switch__native-control{left:initial;right:0}.mdc-switch__track{box-sizing:border-box;width:36px;height:14px;border:1px solid transparent;border-radius:7px;opacity:.38;transition:opacity 90ms cubic-bezier(.4, 0, .2, 1),background-color 90ms cubic-bezier(.4, 0, .2, 1),border-color 90ms cubic-bezier(.4, 0, .2, 1)}.mdc-switch__thumb-underlay{display:flex;position:absolute;align-items:center;justify-content:center;transform:translateX(0);transition:transform 90ms cubic-bezier(.4, 0, .2, 1),background-color 90ms cubic-bezier(.4, 0, .2, 1),border-color 90ms cubic-bezier(.4, 0, .2, 1)}.mdc-switch__thumb{box-shadow:0px 3px 1px -2px rgba(0,0,0,.2),0px 2px 2px 0px rgba(0,0,0,.14),0px 1px 5px 0px rgba(0,0,0,.12);box-sizing:border-box;width:20px;height:20px;border:10px solid;border-radius:50%;pointer-events:none;z-index:1}.mdc-switch--checked .mdc-switch__track{opacity:.54}.mdc-switch--checked .mdc-switch__thumb-underlay{transform:translateX(16px)}.mdc-switch--checked .mdc-switch__thumb-underlay[dir=rtl],[dir=rtl] .mdc-switch--checked .mdc-switch__thumb-underlay{transform:translateX(-16px)}.mdc-switch--checked .mdc-switch__native-control{transform:translateX(-16px)}.mdc-switch--checked .mdc-switch__native-control[dir=rtl],[dir=rtl] .mdc-switch--checked .mdc-switch__native-control{transform:translateX(16px)}.mdc-switch--disabled{opacity:.38;pointer-events:none}.mdc-switch--disabled .mdc-switch__thumb{border-width:1px}.mdc-switch--disabled .mdc-switch__native-control{cursor:default;pointer-events:none}:host{display:inline-flex;outline:0;-webkit-tap-highlight-color:transparent}`))}}]);
//# sourceMappingURL=7014.a602945490de7535.js.map