iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
10 lines • 29.1 kB
JavaScript
/*! For license information please see 63019.9676427ebf83e506.js.LICENSE.txt */
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["63019"],{27323:function(e,t,i){i.d(t,{O:()=>p});i(71695),i(47021);var a=i(9065),n=i(1105),o=i(57243),d=i(50778),r=i(35359),l=i(20552),s=i(91928);let c,h,u=e=>e;const m={fromAttribute(e){return null!==e&&(""===e||e)},toAttribute(e){return"boolean"==typeof e?e?"":null:e}};class p extends n.P{constructor(){super(...arguments),this.rows=2,this.cols=20,this.charCounter=!1}render(){const e=this.charCounter&&-1!==this.maxLength,t=e&&"internal"===this.charCounter,i=e&&!t,a=!!this.helper||!!this.validationMessage||i,n={"mdc-text-field--disabled":this.disabled,"mdc-text-field--no-label":!this.label,"mdc-text-field--filled":!this.outlined,"mdc-text-field--outlined":this.outlined,"mdc-text-field--end-aligned":this.endAligned,"mdc-text-field--with-internal-counter":t};return(0,o.dy)(c||(c=u` <label class="mdc-text-field mdc-text-field--textarea ${0}"> ${0} ${0} ${0} ${0} ${0} </label> ${0} `),(0,r.$)(n),this.renderRipple(),this.outlined?this.renderOutline():this.renderLabel(),this.renderInput(),this.renderCharCounter(t),this.renderLineRipple(),this.renderHelperText(a,i))}renderInput(){const e=this.label?"label":void 0,t=-1===this.minLength?void 0:this.minLength,i=-1===this.maxLength?void 0:this.maxLength,a=this.autocapitalize?this.autocapitalize:void 0;return(0,o.dy)(h||(h=u` <textarea aria-labelledby="${0}" class="mdc-text-field__input" .value="${0}" rows="${0}" cols="${0}" ?disabled="${0}" placeholder="${0}" ?required="${0}" ?readonly="${0}" minlength="${0}" maxlength="${0}" name="${0}" inputmode="${0}" autocapitalize="${0}" ="${0}" ="${0}">
</textarea>`),(0,l.o)(e),(0,s.a)(this.value),this.rows,this.cols,this.disabled,this.placeholder,this.required,this.readOnly,(0,l.o)(t),(0,l.o)(i),(0,l.o)(""===this.name?void 0:this.name),(0,l.o)(this.inputMode),(0,l.o)(a),this.handleInputChange,this.onInputBlur)}}(0,a.__decorate)([(0,d.IO)("textarea")],p.prototype,"formElement",void 0),(0,a.__decorate)([(0,d.Cb)({type:Number})],p.prototype,"rows",void 0),(0,a.__decorate)([(0,d.Cb)({type:Number})],p.prototype,"cols",void 0),(0,a.__decorate)([(0,d.Cb)({converter:m})],p.prototype,"charCounter",void 0)},88540:function(e,t,i){i.d(t,{W:()=>n});let a;const n=(0,i(57243).iv)(a||(a=(e=>e)`.mdc-text-field{height:100%}.mdc-text-field__input{resize:none}`))},83456:function(e,t,i){var a=i(61701),n=(i(71695),i(47021),i(92444)),o=i(76688),d=i(57243),r=i(50778);let l,s=e=>e;(0,a.Z)([(0,r.Mo)("ha-checkbox")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",static:!0,key:"styles",value(){return[o.W,(0,d.iv)(l||(l=s`:host{--mdc-theme-secondary:var(--primary-color)}`))]}}]}}),n.A)},36185:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),n=(i(19083),i(71695),i(19423),i(40251),i(47021),i(57243)),o=i(50778),d=i(19631),r=i(46467),l=i(36522),s=i(20382),c=(i(37583),i(83166),e([r,d]));[r,d]=c.then?(await c)():c;let h,u,m=e=>e;const p="M19,19H5V8H19M16,1V3H8V1H6V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3H18V1M17,12H12V17H17V12Z",f=()=>Promise.all([i.e("97983"),i.e("3134"),i.e("58640"),i.e("60351"),i.e("46360")]).then(i.bind(i,88944)),v=(e,t)=>{(0,l.B)(e,"show-dialog",{dialogTag:"ha-dialog-date-picker",dialogImport:f,dialogParams:t})};(0,a.Z)([(0,o.Mo)("ha-date-input")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"locale",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"min",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"max",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"required",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:"can-clear",type:Boolean})],key:"canClear",value(){return!1}},{kind:"method",key:"render",value:function(){return(0,n.dy)(h||(h=m`<ha-textfield .label="${0}" .helper="${0}" .disabled="${0}" iconTrailing helperPersistent readonly="readonly" ="${0}" ="${0}" .value="${0}" .required="${0}"> <ha-svg-icon slot="trailingIcon" .path="${0}"></ha-svg-icon> </ha-textfield>`),this.label,this.helper,this.disabled,this._openDialog,this._keyDown,this.value?(0,r.WB)(new Date(`${this.value.split("T")[0]}T00:00:00`),Object.assign(Object.assign({},this.locale),{},{time_zone:s.c_.local}),{}):"",this.required,p)}},{kind:"method",key:"_openDialog",value:function(){this.disabled||v(this,{min:this.min||"1970-01-01",max:this.max,value:this.value,canClear:this.canClear,onChange:e=>this._valueChanged(e),locale:this.locale.language,firstWeekday:(0,d.Bt)(this.locale)})}},{kind:"method",key:"_keyDown",value:function(e){this.canClear&&["Backspace","Delete"].includes(e.key)&&this._valueChanged(void 0)}},{kind:"method",key:"_valueChanged",value:function(e){this.value!==e&&(this.value=e,(0,l.B)(this,"change"),(0,l.B)(this,"value-changed",{value:e}))}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(u||(u=m`ha-svg-icon{color:var(--secondary-text-color)}ha-textfield{display:block}`))}}]}}),n.oi);t()}catch(h){t(h)}}))},73729:function(e,t,i){i.d(t,{i:()=>f});var a=i(61701),n=i(72621),o=(i(22152),i(71695),i(47021),i(74966)),d=i(51408),r=i(57243),l=i(50778),s=i(76525);i(23334);let c,h,u,m=e=>e;const p=["button","ha-list-item"],f=(e,t)=>{var i;return(0,r.dy)(c||(c=m` <div class="header_title"> <ha-icon-button .label="${0}" .path="${0}" dialogAction="close" class="header_button"></ha-icon-button> <span>${0}</span> </div> `),null!==(i=null==e?void 0:e.localize("ui.common.close"))&&void 0!==i?i:"Close","M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",t)};(0,a.Z)([(0,l.Mo)("ha-dialog")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",key:s.gA,value:void 0},{kind:"method",key:"scrollToPos",value:function(e,t){var i;null===(i=this.contentElement)||void 0===i||i.scrollTo(e,t)}},{kind:"method",key:"renderHeading",value:function(){return(0,r.dy)(h||(h=m`<slot name="heading"> ${0} </slot>`),(0,n.Z)(i,"renderHeading",this,3)([]))}},{kind:"method",key:"firstUpdated",value:function(){var e;(0,n.Z)(i,"firstUpdated",this,3)([]),this.suppressDefaultPressSelector=[this.suppressDefaultPressSelector,p].join(", "),this._updateScrolledAttribute(),null===(e=this.contentElement)||void 0===e||e.addEventListener("scroll",this._onScroll,{passive:!0})}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(i,"disconnectedCallback",this,3)([]),this.contentElement.removeEventListener("scroll",this._onScroll)}},{kind:"field",key:"_onScroll",value(){return()=>{this._updateScrolledAttribute()}}},{kind:"method",key:"_updateScrolledAttribute",value:function(){this.contentElement&&this.toggleAttribute("scrolled",0!==this.contentElement.scrollTop)}},{kind:"field",static:!0,key:"styles",value(){return[d.W,(0,r.iv)(u||(u=m`:host([scrolled]) ::slotted(ha-dialog-header){border-bottom:1px solid var(--mdc-dialog-scroll-divider-color,rgba(0,0,0,.12))}.mdc-dialog{--mdc-dialog-scroll-divider-color:var(
--dialog-scroll-divider-color,
var(--divider-color)
);z-index:var(--dialog-z-index,8);-webkit-backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));--mdc-dialog-box-shadow:var(--dialog-box-shadow, none);--mdc-typography-headline6-font-weight:400;--mdc-typography-headline6-font-size:1.574rem}.mdc-dialog__actions{justify-content:var(--justify-action-buttons,flex-end);padding-bottom:max(env(safe-area-inset-bottom),24px)}.mdc-dialog__actions span:first-child{flex:var(--secondary-action-button-flex,unset)}.mdc-dialog__actions span:nth-child(2){flex:var(--primary-action-button-flex,unset)}.mdc-dialog__container{align-items:var(--vertical-align-dialog,center)}.mdc-dialog__title{padding:24px 24px 0 24px}.mdc-dialog__title:has(span){padding:12px 12px 0}.mdc-dialog__actions{padding:12px 24px 12px 24px}.mdc-dialog__title::before{content:unset}.mdc-dialog .mdc-dialog__content{position:var(--dialog-content-position,relative);padding:var(--dialog-content-padding,24px)}:host([hideactions]) .mdc-dialog .mdc-dialog__content{padding-bottom:max(var(--dialog-content-padding,24px),env(safe-area-inset-bottom))}.mdc-dialog .mdc-dialog__surface{position:var(--dialog-surface-position,relative);top:var(--dialog-surface-top);margin-top:var(--dialog-surface-margin-top);min-height:var(--mdc-dialog-min-height,auto);border-radius:var(--ha-dialog-border-radius,28px);-webkit-backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);background:var(--ha-dialog-surface-background,var(--mdc-theme-surface,#fff))}:host([flexContent]) .mdc-dialog .mdc-dialog__content{display:flex;flex-direction:column}.header_title{display:flex;align-items:center;direction:var(--direction)}.header_title span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;padding-left:4px}.header_button{text-decoration:none;color:inherit;inset-inline-start:initial;inset-inline-end:-12px;direction:var(--direction)}.dialog-actions{inset-inline-start:initial!important;inset-inline-end:0px!important;direction:var(--direction)}`))]}}]}}),o.M)},40917:function(e,t,i){var a=i(61701),n=i(72621),o=(i(71695),i(47021),i(27323)),d=i(33990),r=i(88540),l=i(57243),s=i(50778);let c,h=e=>e;(0,a.Z)([(0,s.Mo)("ha-textarea")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,s.Cb)({type:Boolean,reflect:!0})],key:"autogrow",value(){return!1}},{kind:"method",key:"updated",value:function(e){(0,n.Z)(i,"updated",this,3)([e]),this.autogrow&&e.has("value")&&(this.mdcRoot.dataset.value=this.value+'="')}},{kind:"field",static:!0,key:"styles",value(){return[d.W,r.W,(0,l.iv)(c||(c=h`:host([autogrow]) .mdc-text-field{position:relative;min-height:74px;min-width:178px;max-height:200px}:host([autogrow]) .mdc-text-field:after{content:attr(data-value);margin-top:23px;margin-bottom:9px;line-height:1.5rem;min-height:42px;padding:0px 32px 0 16px;letter-spacing:var(
--mdc-typography-subtitle1-letter-spacing,
.009375em
);visibility:hidden;white-space:pre-wrap}:host([autogrow]) .mdc-text-field__input{position:absolute;height:calc(100% - 32px)}:host([autogrow]) .mdc-text-field.mdc-text-field--no-label:after{margin-top:16px;margin-bottom:16px}.mdc-floating-label{inset-inline-start:16px!important;inset-inline-end:initial!important;transform-origin:var(--float-start) top} only screen and (min-width:459px){:host([mobile-multiline]) .mdc-text-field__input{white-space:nowrap;max-height:16px}}`))]}}]}}),o.O)},83166:function(e,t,i){var a=i(61701),n=i(72621),o=(i(71695),i(47021),i(1105)),d=i(33990),r=i(57243),l=i(50778),s=i(5111);let c,h,u,m,p=e=>e;(0,a.Z)([(0,l.Mo)("ha-textfield")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"invalid",value:void 0},{kind:"field",decorators:[(0,l.Cb)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"icon",value(){return!1}},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"iconTrailing",value(){return!1}},{kind:"field",decorators:[(0,l.Cb)()],key:"autocomplete",value:void 0},{kind:"field",decorators:[(0,l.Cb)()],key:"autocorrect",value:void 0},{kind:"field",decorators:[(0,l.Cb)({attribute:"input-spellcheck"})],key:"inputSpellcheck",value:void 0},{kind:"field",decorators:[(0,l.IO)("input")],key:"formElement",value:void 0},{kind:"method",key:"updated",value:function(e){(0,n.Z)(i,"updated",this,3)([e]),(e.has("invalid")||e.has("errorMessage"))&&(this.setCustomValidity(this.invalid?this.errorMessage||this.validationMessage||"Invalid":""),(this.invalid||this.validateOnInitialRender||e.has("invalid")&&void 0!==e.get("invalid"))&&this.reportValidity()),e.has("autocomplete")&&(this.autocomplete?this.formElement.setAttribute("autocomplete",this.autocomplete):this.formElement.removeAttribute("autocomplete")),e.has("autocorrect")&&(this.autocorrect?this.formElement.setAttribute("autocorrect",this.autocorrect):this.formElement.removeAttribute("autocorrect")),e.has("inputSpellcheck")&&(this.inputSpellcheck?this.formElement.setAttribute("spellcheck",this.inputSpellcheck):this.formElement.removeAttribute("spellcheck"))}},{kind:"method",key:"renderIcon",value:function(e,t=!1){const i=t?"trailing":"leading";return(0,r.dy)(c||(c=p` <span class="mdc-text-field__icon mdc-text-field__icon--${0}" tabindex="${0}"> <slot name="${0}Icon"></slot> </span> `),i,t?1:-1,i)}},{kind:"field",static:!0,key:"styles",value(){return[d.W,(0,r.iv)(h||(h=p`.mdc-text-field__input{width:var(--ha-textfield-input-width,100%)}.mdc-text-field:not(.mdc-text-field--with-leading-icon){padding:var(--text-field-padding,0px 16px)}.mdc-text-field__affix--suffix{padding-left:var(--text-field-suffix-padding-left,12px);padding-right:var(--text-field-suffix-padding-right,0px);padding-inline-start:var(--text-field-suffix-padding-left,12px);padding-inline-end:var(--text-field-suffix-padding-right,0px);direction:ltr}.mdc-text-field--with-leading-icon{padding-inline-start:var(--text-field-suffix-padding-left,0px);padding-inline-end:var(--text-field-suffix-padding-right,16px);direction:var(--direction)}.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon{padding-left:var(--text-field-suffix-padding-left,0px);padding-right:var(--text-field-suffix-padding-right,0px);padding-inline-start:var(--text-field-suffix-padding-left,0px);padding-inline-end:var(--text-field-suffix-padding-right,0px)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--suffix{color:var(--secondary-text-color)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__icon{color:var(--secondary-text-color)}.mdc-text-field__icon--leading{margin-inline-start:16px;margin-inline-end:8px;direction:var(--direction)}.mdc-text-field__icon--trailing{padding:var(--textfield-icon-trailing-padding,12px)}.mdc-floating-label:not(.mdc-floating-label--float-above){text-overflow:ellipsis;width:inherit;padding-right:30px;padding-inline-end:30px;padding-inline-start:initial;box-sizing:border-box;direction:var(--direction)}input{text-align:var(--text-field-text-align,start)}input[type=color]{height:20px}::-ms-reveal{display:none}:host([no-spinner]) input::-webkit-inner-spin-button,:host([no-spinner]) input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=color]::-webkit-color-swatch-wrapper{padding:0}:host([no-spinner]) input[type=number]{-moz-appearance:textfield}.mdc-text-field__ripple{overflow:hidden}.mdc-text-field{overflow:var(--text-field-overflow)}.mdc-floating-label{inset-inline-start:16px!important;inset-inline-end:initial!important;transform-origin:var(--float-start);direction:var(--direction);text-align:var(--float-start)}.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label{max-width:calc(100% - 48px - var(--text-field-suffix-padding-left,0px));inset-inline-start:calc(48px + var(--text-field-suffix-padding-left,0px))!important;inset-inline-end:initial!important;direction:var(--direction)}.mdc-text-field__input[type=number]{direction:var(--direction)}.mdc-text-field__affix--prefix{padding-right:var(--text-field-prefix-padding-right,2px);padding-inline-end:var(--text-field-prefix-padding-right,2px);padding-inline-start:initial}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--prefix{color:var(--mdc-text-field-label-ink-color)}#helper-text ha-markdown{display:inline-block}`)),"rtl"===s.E.document.dir?(0,r.iv)(u||(u=p`.mdc-floating-label,.mdc-text-field--with-leading-icon,.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label,.mdc-text-field__icon--leading,.mdc-text-field__input[type=number]{direction:rtl;--direction:rtl}`)):(0,r.iv)(m||(m=p``))]}}]}}),o.P)},49653:function(e,t,i){var a=i(61701),n=(i(71695),i(11740),i(47021),i(57243)),o=i(50778),d=i(16922),r=i(36522);i(97828);let l,s=e=>e;(0,a.Z)([(0,o.Mo)("ha-time-input")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"locale",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"required",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,attribute:"enable-second"})],key:"enableSecond",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,reflect:!0})],key:"clearable",value:void 0},{kind:"method",key:"render",value:function(){var e;const t=(0,d.y)(this.locale),i=(null===(e=this.value)||void 0===e?void 0:e.split(":"))||[];let a=i[0];const o=Number(i[0]);return o&&t&&o>12&&o<24&&(a=String(o-12).padStart(2,"0")),t&&0===o&&(a="12"),(0,n.dy)(l||(l=s` <ha-base-time-input .label="${0}" .hours="${0}" .minutes="${0}" .seconds="${0}" .format="${0}" .amPm="${0}" .disabled="${0}" -changed="${0}" .enableSecond="${0}" .required="${0}" .clearable="${0}" .helper="${0}"></ha-base-time-input> `),this.label,Number(a),Number(i[1]),Number(i[2]),t?12:24,t&&o>=12?"PM":"AM",this.disabled,this._timeChanged,this.enableSecond,this.required,this.clearable&&void 0!==this.value,this.helper)}},{kind:"method",key:"_timeChanged",value:function(e){e.stopPropagation();const t=e.detail.value,i=(0,d.y)(this.locale);let a;if(!(void 0===t||isNaN(t.hours)&&isNaN(t.minutes)&&isNaN(t.seconds))){let e=t.hours||0;t&&i&&("PM"===t.amPm&&e<12&&(e+=12),"AM"===t.amPm&&12===e&&(e=0)),a=`${e.toString().padStart(2,"0")}:${t.minutes?t.minutes.toString().padStart(2,"0"):"00"}:${t.seconds?t.seconds.toString().padStart(2,"0"):"00"}`}a!==this.value&&(this.value=a,(0,r.B)(this,"change"),(0,r.B)(this,"value-changed",{value:a}))}}]}}),n.oi)},54712:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t);var n=i(61701),o=(i(63721),i(19083),i(71695),i(19423),i(40251),i(61006),i(47021),i(31622),i(35895)),d=i(57243),r=i(50778),l=i(27486),s=i(11104),c=i(36522),h=i(75278),u=(i(99426),i(83456),i(36185)),m=i(73729),p=(i(40917),i(83166),i(49653),i(95276)),f=i(76131),v=i(28008),g=e([u,s,o]);[u,s,o]=g.then?(await g)():g;let _,x,k,b,y,$,w,C,T,S=e=>e;(0,n.Z)([(0,r.Mo)("dialog-todo-item-editor")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_error",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_params",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_summary",value(){return""}},{kind:"field",decorators:[(0,r.SB)()],key:"_description",value(){return""}},{kind:"field",decorators:[(0,r.SB)()],key:"_due",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_checked",value(){return!1}},{kind:"field",decorators:[(0,r.SB)()],key:"_hasTime",value(){return!1}},{kind:"field",decorators:[(0,r.SB)()],key:"_submitting",value(){return!1}},{kind:"field",key:"_timeZone",value:void 0},{kind:"method",key:"showDialog",value:function(e){if(this._error=void 0,this._params=e,this._timeZone=(0,s.f)(this.hass.locale.time_zone,this.hass.config.time_zone),e.item){var t;const i=e.item;this._checked=i.status===p.wL.Completed,this._summary=i.summary,this._description=i.description||"",this._hasTime=(null===(t=i.due)||void 0===t?void 0:t.includes("T"))||!1,this._due=i.due?new Date(this._hasTime?i.due:`${i.due}T00:00:00`):void 0}else this._hasTime=!1,this._checked=!1,this._due=void 0}},{kind:"method",key:"closeDialog",value:function(){this._params&&(this._error=void 0,this._params=void 0,this._due=void 0,this._summary="",this._description="",this._hasTime=!1,(0,c.B)(this,"dialog-closed",{dialog:this.localName}))}},{kind:"method",key:"render",value:function(){if(!this._params)return d.Ld;const e=void 0===this._params.item,{dueDate:t,dueTime:i}=this._getLocaleStrings(this._due),a=this._todoListSupportsFeature(p.$g.UPDATE_TODO_ITEM);return(0,d.dy)(_||(_=S` <ha-dialog open ="${0}" scrimClickAction .heading="${0}"> <div class="content"> ${0} <div class="flex"> <ha-checkbox .checked="${0}" ="${0}" .disabled="${0}"></ha-checkbox> <ha-textfield class="summary" name="summary" .label="${0}" .value="${0}" required ="${0}" .validationMessage="${0}" dialogInitialFocus .disabled="${0}"></ha-textfield> </div> ${0} ${0} </div> ${0} </ha-dialog> `),this.closeDialog,(0,m.i)(this.hass,this.hass.localize("ui.components.todo.item."+(e?"add":"edit"))),this._error?(0,d.dy)(x||(x=S`<ha-alert alert-type="error">${0}</ha-alert>`),this._error):"",this._checked,this._checkedCanged,e||!a,this.hass.localize("ui.components.todo.item.summary"),this._summary,this._handleSummaryChanged,this.hass.localize("ui.common.error_required"),!a,this._todoListSupportsFeature(p.$g.SET_DESCRIPTION_ON_ITEM)?(0,d.dy)(k||(k=S`<ha-textarea class="description" name="description" .label="${0}" .value="${0}" ="${0}" autogrow .disabled="${0}"></ha-textarea>`),this.hass.localize("ui.components.todo.item.description"),this._description,this._handleDescriptionChanged,!a):d.Ld,this._todoListSupportsFeature(p.$g.SET_DUE_DATE_ON_ITEM)||this._todoListSupportsFeature(p.$g.SET_DUE_DATETIME_ON_ITEM)?(0,d.dy)(b||(b=S`<div> <span class="label">${0}:</span> <div class="flex"> <ha-date-input .value="${0}" .locale="${0}" .disabled="${0}" -changed="${0}" can-clear></ha-date-input> ${0} </div> </div>`),this.hass.localize("ui.components.todo.item.due"),t,this.hass.locale,!a,this._dueDateChanged,this._todoListSupportsFeature(p.$g.SET_DUE_DATETIME_ON_ITEM)?(0,d.dy)(y||(y=S`<ha-time-input .value="${0}" .locale="${0}" .disabled="${0}" -changed="${0}"></ha-time-input>`),i,this.hass.locale,!a,this._dueTimeChanged):d.Ld):d.Ld,e?(0,d.dy)($||($=S` <mwc-button slot="primaryAction" ="${0}" .disabled="${0}"> ${0} </mwc-button> `),this._createItem,this._submitting,this.hass.localize("ui.components.todo.item.add")):(0,d.dy)(w||(w=S` <mwc-button slot="primaryAction" ="${0}" .disabled="${0}"> ${0} </mwc-button> ${0} `),this._saveItem,!a||this._submitting,this.hass.localize("ui.components.todo.item.save"),this._todoListSupportsFeature(p.$g.DELETE_TODO_ITEM)?(0,d.dy)(C||(C=S` <mwc-button slot="secondaryAction" class="warning" ="${0}" .disabled="${0}"> ${0} </mwc-button> `),this._deleteItem,this._submitting,this.hass.localize("ui.components.todo.item.delete")):""))}},{kind:"method",key:"_todoListSupportsFeature",value:function(e){var t,i;if(null===(t=this._params)||void 0===t||!t.entity)return!1;const a=this.hass.states[null===(i=this._params)||void 0===i?void 0:i.entity];return a&&(0,h.e)(a,e)}},{kind:"field",key:"_getLocaleStrings",value(){return(0,l.Z)((e=>({dueDate:e?this._formatDate(e):void 0,dueTime:e?this._formatTime(e):void 0})))}},{kind:"method",key:"_formatDate",value:function(e,t=this._timeZone){return(0,o.CV)(e,t,"yyyy-MM-dd")}},{kind:"method",key:"_formatTime",value:function(e,t=this._timeZone){return this._hasTime?(0,o.CV)(e,t,"HH:mm:ss"):void 0}},{kind:"method",key:"_parseDate",value:function(e){return(0,o.ZU)(e,{timeZone:this._timeZone})}},{kind:"method",key:"_checkedCanged",value:function(e){this._checked=e.target.checked}},{kind:"method",key:"_handleSummaryChanged",value:function(e){this._summary=e.target.value}},{kind:"method",key:"_handleDescriptionChanged",value:function(e){this._description=e.target.value}},{kind:"method",key:"_dueDateChanged",value:function(e){if(!e.detail.value)return void(this._due=void 0);const t=this._due?this._formatTime(this._due):void 0;this._due=this._parseDate(`${e.detail.value}${t?`T${t}`:""}`)}},{kind:"method",key:"_dueTimeChanged",value:function(e){this._hasTime=!0,this._due=this._parseDate(`${this._formatDate(this._due||new Date)}T${e.detail.value}`)}},{kind:"method",key:"_createItem",value:async function(){if(this._summary){this._submitting=!0;try{await(0,p.fC)(this.hass,this._params.entity,{summary:this._summary,description:this._description,due:this._due?this._hasTime?this._due.toISOString():this._formatDate(this._due):void 0})}catch(e){return void(this._error=e?e.message:"Unknown error")}finally{this._submitting=!1}this.closeDialog()}else this._error=this.hass.localize("ui.components.todo.item.not_all_required_fields")}},{kind:"method",key:"_saveItem",value:async function(){if(!this._summary)return void(this._error=this.hass.localize("ui.components.todo.item.not_all_required_fields"));this._submitting=!0;const e=this._params.item;try{await(0,p.$G)(this.hass,this._params.entity,Object.assign(Object.assign({},e),{},{summary:this._summary,description:this._description||(this._todoListSupportsFeature(p.$g.SET_DESCRIPTION_ON_ITEM)?null:void 0),due:this._due?this._hasTime?this._due.toISOString():this._formatDate(this._due):this._todoListSupportsFeature(p.$g.SET_DUE_DATETIME_ON_ITEM)||this._todoListSupportsFeature(p.$g.SET_DUE_DATE_ON_ITEM)?null:void 0,status:this._checked?p.wL.Completed:p.wL.NeedsAction}))}catch(t){return void(this._error=t?t.message:"Unknown error")}finally{this._submitting=!1}this.closeDialog()}},{kind:"method",key:"_deleteItem",value:async function(){this._submitting=!0;const e=this._params.item;if(await(0,f.showConfirmationDialog)(this,{title:this.hass.localize("ui.components.todo.item.confirm_delete.delete"),text:this.hass.localize("ui.components.todo.item.confirm_delete.prompt"),destructive:!0,confirmText:this.hass.localize("ui.common.delete"),dismissText:this.hass.localize("ui.common.cancel")})){try{await(0,p.CV)(this.hass,this._params.entity,[e.uid])}catch(t){return void(this._error=t?t.message:"Unknown error")}finally{this._submitting=!1}this.closeDialog()}else this._submitting=!1}},{kind:"get",static:!0,key:"styles",value:function(){return[v.yu,(0,d.iv)(T||(T=S` all and (min-width:450px) and (min-height:500px){ha-dialog{--mdc-dialog-min-width:min(600px, 95vw);--mdc-dialog-max-width:min(600px, 95vw)}}ha-alert{display:block;margin-bottom:16px}ha-textarea,ha-textfield{display:block;width:100%}ha-checkbox{margin-top:4px}ha-textarea{margin-bottom:16px}ha-date-input{flex-grow:1}ha-time-input{margin-left:16px;margin-inline-start:16px;margin-inline-end:initial}.flex{display:flex;justify-content:space-between}.label{font-size:12px;font-weight:500;color:var(--input-label-ink-color)}.date-range-details-content{display:inline-block}ha-svg-icon{width:40px;margin-right:8px;margin-inline-end:16px;margin-inline-start:initial;direction:var(--direction);vertical-align:top}.key{display:inline-block;vertical-align:top}.value{display:inline-block;vertical-align:top}`))]}}]}}),d.oi);a()}catch(_){a(_)}}))},86256:function(e,t,i){var a=i(88045),n=i(72616),o=i(95011),d=RangeError;e.exports=function(e){var t=n(o(this)),i="",r=a(e);if(r<0||r===1/0)throw new d("Wrong number of repetitions");for(;r>0;(r>>>=1)&&(t+=t))1&r&&(i+=t);return i}},35638:function(e,t,i){var a=i(72878);e.exports=a(1..valueOf)},49278:function(e,t,i){var a=i(40810),n=i(72878),o=i(88045),d=i(35638),r=i(86256),l=i(29660),s=RangeError,c=String,h=Math.floor,u=n(r),m=n("".slice),p=n(1..toFixed),f=function(e,t,i){return 0===t?i:t%2==1?f(e,t-1,i*e):f(e*e,t/2,i)},v=function(e,t,i){for(var a=-1,n=i;++a<6;)n+=t*e[a],e[a]=n%1e7,n=h(n/1e7)},g=function(e,t){for(var i=6,a=0;--i>=0;)a+=e[i],e[i]=h(a/t),a=a%t*1e7},_=function(e){for(var t=6,i="";--t>=0;)if(""!==i||0===t||0!==e[t]){var a=c(e[t]);i=""===i?a:i+u("0",7-a.length)+a}return i};a({target:"Number",proto:!0,forced:l((function(){return"0.000"!==p(8e-5,3)||"1"!==p(.9,0)||"1.25"!==p(1.255,2)||"1000000000000000128"!==p(0xde0b6b3a7640080,0)}))||!l((function(){p({})}))},{toFixed:function(e){var t,i,a,n,r=d(this),l=o(e),h=[0,0,0,0,0,0],p="",x="0";if(l<0||l>20)throw new s("Incorrect fraction digits");if(r!=r)return"NaN";if(r<=-1e21||r>=1e21)return c(r);if(r<0&&(p="-",r=-r),r>1e-21)if(i=(t=function(e){for(var t=0,i=e;i>=4096;)t+=12,i/=4096;for(;i>=2;)t+=1,i/=2;return t}(r*f(2,69,1))-69)<0?r*f(2,-t,1):r/f(2,t,1),i*=4503599627370496,(t=52-t)>0){for(v(h,0,i),a=l;a>=7;)v(h,1e7,0),a-=7;for(v(h,f(10,a,1),0),a=t-1;a>=23;)g(h,1<<23),a-=23;g(h,1<<a),v(h,1,1),g(h,2),x=_(h)}else v(h,0,i),v(h,1<<-t,0),x=_(h)+u("0",l);return x=l>0?p+((n=x.length)<=l?"0."+u("0",l-n)+x:m(x,0,n-l)+"."+m(x,n-l)):p+x}})}}]);
//# sourceMappingURL=63019.9676427ebf83e506.js.map