iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
45 lines • 36.2 kB
JavaScript
export const __rspack_esm_id=67988;export const __rspack_esm_ids=[67988];export const __webpack_modules__={57237(t,a,e){e.d(a,{d:()=>i});const i=t=>t.stopPropagation()},3449(t,a,e){var i=e(62826),o=e(5124),r=e(22441);class s extends o.WF{render(){return o.qy`<slot></slot>`}constructor(...t){super(...t),this.disabled=!1}}s.styles=o.AH`:host{display:block;color:var(--mdc-text-field-label-ink-color,rgba(0,0,0,.6));font-size:var(--ha-font-size-s);padding-left:16px;padding-right:16px;padding-inline-start:16px;padding-inline-end:16px;letter-spacing:var(
--mdc-typography-caption-letter-spacing,
.0333333333em
);line-height:normal}:host([disabled]){color:var(--mdc-text-field-disabled-ink-color,rgba(0,0,0,.6))}`,(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],s.prototype,"disabled",void 0),s=(0,i.Cg)([(0,r.EM)("ha-input-helper-text")],s)},47971(t,a,e){e.a(t,async function(t,i){try{e.r(a),e.d(a,{HaTextSelector:()=>u});var o=e(62826),r=e(5124),s=e(22441),l=e(44537),n=e(1087),h=e(56304),d=e(91485),p=e(26613),c=t([h,d,p]);[h,d,p]=c.then?(await c)():c;class u extends r.WF{async focus(){await this.updateComplete,this._input?.focus()}reportValidity(){return!!this.selector.text?.multiple||(this._input?.reportValidity()??!0)}render(){return this.selector.text?.multiple?r.qy` <ha-input-multi .value="${(0,l.e)(this.value??[])}" .disabled="${this.disabled}" .label="${this.label}" .inputType="${this.selector.text?.type}" .inputSuffix="${this.selector.text?.suffix}" .inputPrefix="${this.selector.text?.prefix}" .helper="${this.helper}" .autocomplete="${this.selector.text?.autocomplete}" -changed="${this._handleChange}"> </ha-input-multi> `:this.selector.text?.multiline?r.qy`<ha-textarea .name="${this.name}" .label="${this.label}" .placeholder="${this.placeholder}" .value="${this.value||""}" .hint="${this.helper}" .disabled="${this.disabled}" ="${this._handleChange}" autocapitalize="none" .autocomplete="${this.selector.text?.autocomplete}" spellcheck="false" .required="${this.required}" resize="auto"></ha-textarea>`:r.qy`<ha-input .name="${this.name}" .value="${this.value||""}" .placeholder="${this.placeholder||this.selector.text?.placeholder||""}" .hint="${this.helper}" .disabled="${this.disabled}" .type="${this.selector.text?.type}" ="${this._handleChange}" ="${this._handleChange}" .label="${this.label||""}" .required="${this.required}" .autocomplete="${this.selector.text?.autocomplete}" .passwordToggle="${"password"===this.selector.text?.type}"> ${this.selector.text?.prefix?r.qy`<span slot="start">${this.selector.text.prefix}</span>`:r.s6} ${this.selector.text?.suffix?r.qy`<span slot="end">${this.selector.text.suffix}</span>`:r.s6} </ha-input>`}_handleChange(t){t.stopPropagation();let a=t.detail?.value??t.target.value;this.value!==a&&((""===a||Array.isArray(a)&&0===a.length)&&!this.required&&(a=void 0),(0,n.r)(this,"value-changed",{value:a}))}constructor(...t){super(...t),this.disabled=!1,this.required=!0}}u.styles=r.AH`:host{display:block;position:relative}ha-input,ha-textarea{width:100%}`,(0,o.Cg)([(0,s.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,o.Cg)([(0,s.MZ)()],u.prototype,"value",void 0),(0,o.Cg)([(0,s.MZ)()],u.prototype,"name",void 0),(0,o.Cg)([(0,s.MZ)()],u.prototype,"label",void 0),(0,o.Cg)([(0,s.MZ)()],u.prototype,"placeholder",void 0),(0,o.Cg)([(0,s.MZ)()],u.prototype,"helper",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],u.prototype,"selector",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],u.prototype,"disabled",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],u.prototype,"required",void 0),(0,o.Cg)([(0,s.P)("ha-input, ha-textarea")],u.prototype,"_input",void 0),u=(0,o.Cg)([(0,s.EM)("ha-selector-text")],u),i()}catch(t){i(t)}})},85938(t,a,e){e(18111),e(22489),e(46058);var i=e(62826),o=e(5124),r=e(22441),s=e(1087);class l extends o.WF{updated(t){t.has("disabled")&&(this.disabled?this._destroySortable():this._createSortable())}disconnectedCallback(){super.disconnectedCallback(),this._shouldBeDestroy=!0,setTimeout(()=>{this._shouldBeDestroy&&(this._destroySortable(),this._shouldBeDestroy=!1)},1)}connectedCallback(){super.connectedCallback(),this._shouldBeDestroy=!1,this.hasUpdated&&!this.disabled&&this._createSortable()}createRenderRoot(){return this}render(){return this.noStyle?o.s6:o.qy` <style>.sortable-fallback{display:none!important}.sortable-ghost{box-shadow:0 0 0 2px var(--primary-color);background:rgba(var(--rgb-primary-color),.25);border-radius:var(--ha-border-radius-sm);opacity:.4}.sortable-drag{border-radius:var(--ha-border-radius-sm);opacity:1;background:var(--card-background-color);box-shadow:0px 4px 8px 3px #00000026;cursor:grabbing}</style> `}async _createSortable(){if(this._sortable)return;const t=this.children[0];if(!t)return;const a=(await Promise.all([e.e(85283),e.e(70322)]).then(e.bind(e,80745))).default,i={scroll:!0,forceAutoScrollFallback:!0,scrollSpeed:20,animation:150,...this.options,onChoose:this._handleChoose,onStart:this._handleStart,onEnd:this._handleEnd,onUpdate:this._handleUpdate,onAdd:this._handleAdd,onRemove:this._handleRemove};this.draggableSelector&&(i.draggable=this.draggableSelector),this.handleSelector&&(i.handle=this.handleSelector),void 0!==this.invertSwap&&(i.invertSwap=this.invertSwap),this.group&&(i.group=this.group),this.filter&&(i.filter=this.filter),this._sortable=new a(t,i)}_destroySortable(){this._sortable&&(this._sortable.destroy(),this._sortable=void 0)}constructor(...t){super(...t),this.disabled=!1,this.noStyle=!1,this.invertSwap=!1,this.rollback=!0,this._shouldBeDestroy=!1,this._handleUpdate=t=>{(0,s.r)(this,"item-moved",{newIndex:t.newIndex,oldIndex:t.oldIndex})},this._handleAdd=t=>{(0,s.r)(this,"item-added",{index:t.newIndex,data:t.item.sortableData,item:t.item})},this._handleRemove=t=>{(0,s.r)(this,"item-removed",{index:t.oldIndex})},this._handleEnd=async t=>{(0,s.r)(this,"drag-end"),this.rollback&&t.item.placeholder&&(t.item.placeholder.replaceWith(t.item),delete t.item.placeholder)},this._handleStart=()=>{(0,s.r)(this,"drag-start")},this._handleChoose=t=>{this.rollback&&(t.item.placeholder=document.createComment("sort-placeholder"),t.item.after(t.item.placeholder))}}}(0,i.Cg)([(0,r.MZ)({type:Boolean})],l.prototype,"disabled",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"no-style"})],l.prototype,"noStyle",void 0),(0,i.Cg)([(0,r.MZ)({type:String,attribute:"draggable-selector"})],l.prototype,"draggableSelector",void 0),(0,i.Cg)([(0,r.MZ)({type:String,attribute:"handle-selector"})],l.prototype,"handleSelector",void 0),(0,i.Cg)([(0,r.MZ)({type:String,attribute:"filter"})],l.prototype,"filter",void 0),(0,i.Cg)([(0,r.MZ)({type:String})],l.prototype,"group",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"invert-swap"})],l.prototype,"invertSwap",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],l.prototype,"options",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],l.prototype,"rollback",void 0),l=(0,i.Cg)([(0,r.EM)("ha-sortable")],l)},56304(t,a,e){e.a(t,async function(t,a){try{var i=e(62826),o=e(99324),r=e(92070),s=e(5124),l=e(22441),n=e(6412),h=e(63672),d=e(57237),p=e(53305),c=t([o]);o=(c.then?(await c)():c)[0];class u extends((0,p.w)(s.WF)){get _formControl(){return this._textarea}setFocused(t){t?this.toggleAttribute("focused",!0):this.removeAttribute("focused")}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",d.d)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",d.d)}async firstUpdated(t){super.firstUpdated(t),this.autofocus&&(await(this._textarea?.updateComplete),this._textarea?.focus())}focus(t){this._textarea?.focus(t)}render(){const t=!this.label&&this._hasSlotController.test("label"),a=!this.hint&&this._hasSlotController.test("hint");return s.qy` <wa-textarea .value="${this.value??null}" .placeholder="${this.placeholder}" .readonly="${this.readonly}" .required="${this.required}" .rows="${this.rows??4}" .resize="${this.resize}" .disabled="${this.disabled}" name="${(0,h.J)(this.name)}" autocapitalize="${(0,h.J)(this.autocapitalize||void 0)}" autocomplete="${(0,h.J)(this.autocomplete)}" .autofocus="${this.autofocus}" .spellcheck="${this.spellcheck}" inputmode="${(0,h.J)(this.inputmode||void 0)}" enterkeyhint="${(0,h.J)(this.enterkeyhint||void 0)}" minlength="${(0,h.J)(this.minlength)}" maxlength="${(0,h.J)(this.maxlength)}" class="${(0,n.H)({input:!0,invalid:this.invalid||this._invalid,"label-raised":void 0!==this.value&&""!==this.value||this.label&&this.placeholder,"no-label":!this.label,"hint-hidden":!(this.hint||a||this.required||this._invalid||this.invalid)})}" ="${this._handleInput}" ="${this._handleChange}" ="${this._handleBlur}" -invalid="${this._handleInvalid}" exportparts="base:wa-base, hint:wa-hint, textarea:wa-textarea"> ${this.label||t?s.qy`<slot name="label" slot="label">${this.label?this._renderLabel(this.label,this.required):s.s6}</slot>`:s.s6} <div slot="hint" class="${(0,n.H)({error:this.invalid||this._invalid})}" role="${(0,h.J)(this.invalid||this._invalid?"alert":void 0)}" aria-live="polite"> ${this._invalid||this.invalid?this.validationMessage||this._textarea?.validationMessage:this.hint||(a?s.qy`<slot name="hint"></slot>`:s.s6)} </div> </wa-textarea> `}constructor(...t){super(...t),this.resize="none",this._hasSlotController=new r.X(this,"label","hint"),this._requiredMarkerCSSVar="--ha-textarea-required-marker"}}u.styles=[p.N,s.AH`:host{display:flex;align-items:flex-start;padding-bottom:var(--ha-textarea-padding-bottom)}wa-textarea::part(label){width:calc(100% - var(--ha-space-2));background-color:var(--ha-color-form-background);transition:all var(--wa-transition-normal) ease-in-out,background-color var(--wa-transition-normal) ease-in-out;padding-inline-start:var(--ha-space-3);padding-inline-end:var(--ha-space-3);margin:var(--ha-space-1) var(--ha-space-1) 0;padding-top:var(--ha-space-4);white-space:nowrap;overflow:hidden}:host(:focus-within) wa-textarea::part(label),:host([focused]) wa-textarea::part(label){color:var(--primary-color)}:host(:focus-within) wa-textarea::part(label),:host([focused]) wa-textarea::part(label),wa-textarea.label-raised::part(label){padding-top:var(--ha-space-2);font-size:var(--ha-font-size-xs)}wa-textarea.no-label::part(label){height:0;padding:0}wa-textarea::part(base){min-height:56px;padding-top:var(--ha-space-6);padding-bottom:var(--ha-space-2)}wa-textarea.no-label::part(base){padding-top:var(--ha-space-3)}wa-textarea::part(base)::after{content:"";position:absolute;bottom:0;left:0;right:0;height:1px;background-color:var(--ha-color-border-neutral-loud);transition:height var(--wa-transition-normal) ease-in-out,background-color var(--wa-transition-normal) ease-in-out}:host(:focus-within) wa-textarea::part(base)::after,:host([focused]) wa-textarea::part(base)::after{height:2px;background-color:var(--primary-color)}:host(:focus-within) wa-textarea.invalid::part(base)::after,wa-textarea.invalid:not([disabled])::part(base)::after{background-color:var(--ha-color-border-danger-normal)}wa-textarea::part(textarea){padding:0 var(--ha-space-4);font-family:var(--ha-font-family-body);font-size:var(--ha-font-size-m)}:host([resize=auto]) wa-textarea::part(textarea){max-height:var(--ha-textarea-max-height,200px);overflow-y:auto}wa-textarea:hover::part(base),wa-textarea:hover::part(label){background-color:var(--ha-color-form-background-hover)}wa-textarea[disabled]::part(textarea){cursor:not-allowed}wa-textarea[disabled]::part(base),wa-textarea[disabled]::part(label){background-color:var(--ha-color-form-background-disabled)}`],(0,i.Cg)([(0,l.MZ)({type:Number})],u.prototype,"rows",void 0),(0,i.Cg)([(0,l.MZ)()],u.prototype,"resize",void 0),(0,i.Cg)([(0,l.P)("wa-textarea")],u.prototype,"_textarea",void 0),u=(0,i.Cg)([(0,l.EM)("ha-textarea")],u),a()}catch(t){a(t)}})},34127(t,a,e){e.a(t,async function(t,a){try{var i=e(62826),o=e(52630),r=e(5124),s=e(22441),l=t([o]);o=(l.then?(await l)():l)[0];class n extends o.A{static get styles(){return[o.A.styles,r.AH`:host{--wa-tooltip-background-color:var(
--ha-tooltip-background-color,
var(--ha-color-surface-default)
);--wa-tooltip-content-color:var(
--ha-tooltip-text-color,
var(--primary-text-color)
);--wa-tooltip-font-family:var(
--ha-tooltip-font-family,
var(--ha-font-family-body)
);--wa-tooltip-font-size:var(
--ha-tooltip-font-size,
var(--ha-font-size-m)
);--wa-tooltip-font-weight:var(
--ha-tooltip-font-weight,
var(--ha-font-weight-medium)
);--wa-tooltip-line-height:var(
--ha-tooltip-line-height,
var(--ha-line-height-condensed)
);--wa-tooltip-padding:var(--ha-tooltip-padding, var(--ha-space-2));--wa-tooltip-border-radius:var(
--ha-tooltip-border-radius,
var(--ha-border-radius-md)
);--wa-tooltip-arrow-size:var(--ha-tooltip-arrow-size, 0px);--wa-tooltip-border-width:0px;--wa-z-index-tooltip:1000}.tooltip::part(popup){animation-duration:var(--ha-tooltip-animation-duration, 0)}.body{box-shadow:var(--ha-tooltip-box-shadow,var(--ha-box-shadow-m))}`]}constructor(...t){super(...t),this.showDelay=350,this.hideDelay=150}}(0,i.Cg)([(0,s.MZ)({attribute:"show-delay",type:Number})],n.prototype,"showDelay",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"hide-delay",type:Number})],n.prototype,"hideDelay",void 0),n=(0,i.Cg)([(0,s.EM)("ha-tooltip")],n),a()}catch(t){a(t)}})},26613(t,a,e){e.a(t,async function(t,a){try{var i=e(62826),o=e(35211),r=e(5124),s=e(22441),l=e(75751),n=e(1087),h=e(22792),d=e(14503),p=e(18350),c=e(26300),u=(e(3449),e(85938),e(91485)),g=t([p,c,u]);[p,c,u]=g.then?(await g)():g;const v="M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19M8,9H16V19H8V9M15.5,4L14.5,3H9.5L8.5,4H5V6H19V4H15.5Z",b="M21 11H3V9H21V11M21 13H3V15H21V13Z",m="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z";class y extends r.WF{render(){return r.qy` <ha-sortable handle-selector=".handle" draggable-selector=".row" .disabled="${!this.sortable||this.disabled}" -moved="${this._itemMoved}"> <div class="items"> ${(0,l.u)(this._items,(t,a)=>`${t}-${a}`,(t,a)=>{const e=""+(this.itemIndex?` ${a+1}`:"");return r.qy` <div class="layout horizontal center-center row"> <ha-input .type="${this.inputType}" .autocomplete="${this.autocomplete}" .disabled="${this.disabled}" dialogInitialFocus="${a}" .index="${a}" class="flex-auto" .label="${""+(this.label?`${this.label}${e}`:"")}" .value="${t}" ?data-last="${a===this._items.length-1}" ="${this._editItem}" ="${this._editItem}" ="${this._keyDown}"> ${this.inputPrefix?r.qy`<span slot="start">${this.inputPrefix}</span>`:r.s6} ${this.inputSuffix?r.qy`<span slot="end">${this.inputSuffix}</span>`:r.s6} </ha-input> <ha-icon-button .disabled="${this.disabled}" .index="${a}" slot="navigationIcon" .label="${this.removeLabel??this._i18n?.localize("ui.common.remove")??"Remove"}" ="${this._removeItem}" .path="${v}"></ha-icon-button> ${this.sortable?r.qy`<ha-svg-icon class="handle" .path="${b}"></ha-svg-icon>`:r.s6} </div> `})} </div> </ha-sortable> <div class="layout horizontal"> <ha-button size="small" appearance="filled" ="${this._addItem}" .disabled="${this.disabled||null!=this.max&&this._items.length>=this.max}"> <ha-svg-icon slot="start" .path="${m}"></ha-svg-icon> ${this.addLabel??(this.label?this._i18n?.localize("ui.components.multi-textfield.add_item",{item:this.label}):this._i18n?.localize("ui.common.add"))??"Add"} </ha-button> </div> ${this.helper?r.qy`<ha-input-helper-text .disabled="${this.disabled}">${this.helper}</ha-input-helper-text>`:r.s6} `}get _items(){return this.value??[]}async _addItem(){if(null!=this.max&&this._items.length>=this.max)return;const t=[...this._items,""];this._fireChanged(t),await this.updateComplete,this._lastInput?.focus()}async _editItem(t){if(this.updateOnBlur&&"input"===t.type)return;if(!this.updateOnBlur&&"change"===t.type)return;const a=t.target.index,e=[...this._items];e[a]=t.target.value,this._fireChanged(e)}async _keyDown(t){"Enter"===t.key&&(t.stopPropagation(),this._addItem())}_itemMoved(t){t.stopPropagation();const{oldIndex:a,newIndex:e}=t.detail,i=[...this._items],[o]=i.splice(a,1);i.splice(e,0,o),this._fireChanged(i)}async _removeItem(t){const a=t.target.index,e=[...this._items];e.splice(a,1),this._fireChanged(e)}_fireChanged(t){this.value=t,(0,n.r)(this,"value-changed",{value:t})}static get styles(){return[d.RF,r.AH`.row{margin-bottom:8px;--ha-input-padding-bottom:0}ha-icon-button{display:block}.handle{cursor:grab;padding:8px;margin:-8px}`]}constructor(...t){super(...t),this.disabled=!1,this.itemIndex=!1,this.sortable=!1,this.updateOnBlur=!1}}(0,i.Cg)([(0,s.MZ)({attribute:!1})],y.prototype,"value",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],y.prototype,"disabled",void 0),(0,i.Cg)([(0,s.MZ)()],y.prototype,"label",void 0),(0,i.Cg)([(0,s.MZ)()],y.prototype,"helper",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"input-type"})],y.prototype,"inputType",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"input-suffix"})],y.prototype,"inputSuffix",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"input-prefix"})],y.prototype,"inputPrefix",void 0),(0,i.Cg)([(0,s.MZ)()],y.prototype,"autocomplete",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"add-label"})],y.prototype,"addLabel",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"remove-label"})],y.prototype,"removeLabel",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"item-index",type:Boolean})],y.prototype,"itemIndex",void 0),(0,i.Cg)([(0,s.MZ)({type:Number})],y.prototype,"max",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],y.prototype,"sortable",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,attribute:"update-on-blur"})],y.prototype,"updateOnBlur",void 0),(0,i.Cg)([(0,s.wk)(),(0,o.Fg)({context:h.D5,subscribe:!0})],y.prototype,"_i18n",void 0),(0,i.Cg)([(0,s.P)("ha-input[data-last]")],y.prototype,"_lastInput",void 0),y=(0,i.Cg)([(0,s.EM)("ha-input-multi")],y),a()}catch(t){a(t)}})},91485(t,a,e){e.a(t,async function(t,i){try{e.d(a,{U:()=>w});var o=e(62826),r=(e(86137),e(30006)),s=e(92070),l=e(35211),n=e(5124),h=e(22441),d=e(6412),p=e(63672),c=e(57237),u=e(22792),g=e(26300),v=(e(67094),e(34127)),b=e(53305),m=t([r,g,v]);[r,g,v]=m.then?(await m)():m;const y="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",f="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z",x="M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z";class w extends((0,b.w)(n.WF)){get _formControl(){return this._input}showPicker(){this._input?.showPicker()}stepUp(){this._input?.stepUp()}stepDown(){this._input?.stepDown()}async firstUpdated(t){super.firstUpdated(t),this.insetLabel||(await(this._input?.updateComplete),this._syncStartSlotWidth())}render(){const t=!this.label&&this._hasSlotController.test("label"),a=!this.hint&&this._hasSlotController.test("hint"),e=this._hasSlotController.test("start");return n.qy` <wa-input .type="${this.type}" .value="${this.value??null}" .withClear="${this.withClear}" .placeholder="${this.placeholder}" .readonly="${this.readonly}" .passwordToggle="${this.passwordToggle}" .passwordVisible="${this.passwordVisible}" .withoutSpinButtons="${this.withoutSpinButtons}" .required="${this.required}" .pattern="${this.pattern}" .minlength="${this.minlength}" .maxlength="${this.maxlength}" .min="${this.min}" .max="${this.max}" .step="${this.step}" .autocapitalize="${this.autocapitalize||void 0}" .autocorrect="${this.autocorrect?"on":"off"}" .autocomplete="${this.autocomplete}" .autofocus="${this.autofocus}" .enterkeyhint="${this.enterkeyhint||void 0}" .spellcheck="${this.spellcheck}" .inputmode="${this.inputmode||void 0}" .name="${this.name}" .disabled="${this.disabled}" class="${(0,d.H)({input:!0,invalid:this.invalid||this._invalid,"label-raised":void 0!==this.value&&""!==this.value||this.label&&this.placeholder||e&&this.insetLabel,"no-label":!this.label,"hint-hidden":!(this.hint||a||this.required||this._invalid||this.invalid)})}" ="${this._handleInput}" ="${this._handleChange}" ="${this._handleBlur}" -invalid="${this._handleInvalid}" exportparts="base:wa-base, hint:wa-hint, input:wa-input"> ${this.label||t?n.qy`<slot name="label" slot="label">${this.label?this._renderLabel(this.label,this.required):n.s6}</slot>`:n.s6} <slot name="start" slot="start" ="${this._syncStartSlotWidth}"> ${this.renderStartDefault()} </slot> <slot name="end" slot="end"> ${this.renderEndDefault()} </slot> <slot name="clear-button" slot="clear-button"> <ha-icon-button ="${this._handleClearClick}" .label="${this.i18n?.localize?.("ui.components.input.clear")||"Clear"}" .path="${y}"></ha-icon-button> </slot> <slot name="password-toggle-button" slot="password-toggle-button"> <ha-icon-button ="${c.d}" ="${this._handlePasswordToggle}" .label="${this.i18n?.localize?.("ui.components.input."+(this.passwordVisible?"hide_password":"show_password"))||(this.passwordVisible?"Hide password":"Show password")}" .path="${this.passwordVisible?x:f}"></ha-icon-button> </slot> <div slot="hint" class="${(0,d.H)({error:this.invalid||this._invalid})}" role="${(0,p.J)(this.invalid||this._invalid?"alert":void 0)}" aria-live="polite"> ${this._invalid||this.invalid?this.validationMessage||this._input?.validationMessage:this.hint||(a?n.qy`<slot name="hint"></slot>`:n.s6)} </div> </wa-input> `}renderStartDefault(){return n.s6}renderEndDefault(){return n.s6}_handleClearClick(){this._input?.clear()}_handlePasswordToggle(){this.passwordVisible=!this.passwordVisible}constructor(...t){super(...t),this.appearance="material",this.type="text",this.withClear=!1,this.passwordToggle=!1,this.passwordVisible=!1,this.withoutSpinButtons=!1,this.autocorrect=!1,this.insetLabel=!1,this._hasSlotController=new s.X(this,"label","hint","input","start"),this._syncStartSlotWidth=()=>{const t=this._input?.shadowRoot?.querySelector('[part~="start"]'),a=t?.offsetWidth??0;a>0&&!this.insetLabel?(this.style.setProperty("--start-slot-width",`calc(${a}px + var(--ha-space-1))`),this.style.setProperty("--input-padding-inline-start","var(--ha-space-1)")):(this.style.removeProperty("--start-slot-width"),this.style.removeProperty("--input-padding-inline-start"))}}}w.styles=[b.N,n.AH`:host{display:flex;align-items:flex-start;padding-top:var(--ha-input-padding-top);padding-bottom:var(--ha-input-padding-bottom,var(--ha-space-2));text-align:var(--ha-input-text-align,start)}:host([appearance=outlined]){padding-bottom:var(--ha-input-padding-bottom)}wa-input::part(label){padding-inline-start:calc(var(--start-slot-width,0px) + var(--ha-space-4));padding-inline-end:var(--ha-space-4);padding-top:var(--ha-space-5)}:host([appearance=material]:focus-within) wa-input::part(label){color:var(--primary-color)}:host(:focus-within) wa-input::part(label),:host([type=date]) wa-input::part(label),wa-input.label-raised::part(label){padding-top:var(--ha-space-3);font-size:var(--ha-font-size-xs)}wa-input::part(base){height:56px;padding:0 var(--ha-space-4)}:host([appearance=outlined]) wa-input.no-label::part(base){height:32px;padding:0 var(--ha-space-2)}:host([appearance=outlined]) wa-input::part(base){border:1px solid var(--ha-color-border-neutral-quiet);background-color:var(--card-background-color);border-radius:var(--ha-border-radius-md);transition:border-color var(--wa-transition-normal) ease-in-out}:host([appearance=material]) ::part(base)::after{content:"";position:absolute;bottom:0;left:0;right:0;height:1px;background-color:var(--ha-color-border-neutral-loud);transition:height var(--wa-transition-normal) ease-in-out,background-color var(--wa-transition-normal) ease-in-out}:host([appearance=material]:focus-within) wa-input::part(base)::after{height:2px;background-color:var(--primary-color)}:host([appearance=material]) wa-input.invalid:not([disabled])::part(base)::after,:host([appearance=material]:focus-within) wa-input.invalid::part(base)::after{background-color:var(--ha-color-border-danger-normal)}wa-input::part(input){padding-top:var(--ha-space-3);padding-inline-start:var(--input-padding-inline-start,0)}wa-input.no-label::part(input){padding-top:0}:host([type=color]) wa-input::part(input){padding-top:var(--ha-space-6);padding-bottom:2px;cursor:pointer}:host([type=color]) wa-input.no-label::part(input){padding:var(--ha-space-2)}:host([type=color]) wa-input.no-label::part(base){padding:0}wa-input::part(input)::placeholder{color:var(--ha-color-neutral-60)}wa-input::part(base):hover{background-color:var(--ha-color-form-background-hover)}:host([appearance=outlined]) wa-input::part(base):hover{border-color:var(--ha-color-border-neutral-normal)}:host([appearance=outlined]:focus-within) wa-input::part(base){border-color:var(--primary-color)}wa-input:disabled::part(base){background-color:var(--ha-color-form-background-disabled)}wa-input:disabled::part(label){opacity:.5}wa-input::part(end){color:var(--ha-color-text-secondary)}ha-icon-button{display:flex;align-items:center;color:var(--ha-color-text-secondary)}:host([appearance=outlined]) wa-input.no-label{--ha-icon-button-size:24px;--mdc-icon-size:18px}`],(0,o.Cg)([(0,h.MZ)({reflect:!0})],w.prototype,"appearance",void 0),(0,o.Cg)([(0,h.MZ)({reflect:!0})],w.prototype,"type",void 0),(0,o.Cg)([(0,h.MZ)({type:Boolean,attribute:"with-clear"})],w.prototype,"withClear",void 0),(0,o.Cg)([(0,h.MZ)({type:Boolean,attribute:"password-toggle"})],w.prototype,"passwordToggle",void 0),(0,o.Cg)([(0,h.MZ)({type:Boolean,attribute:"password-visible"})],w.prototype,"passwordVisible",void 0),(0,o.Cg)([(0,h.MZ)({type:Boolean,attribute:"without-spin-buttons"})],w.prototype,"withoutSpinButtons",void 0),(0,o.Cg)([(0,h.MZ)()],w.prototype,"pattern",void 0),(0,o.Cg)([(0,h.MZ)()],w.prototype,"min",void 0),(0,o.Cg)([(0,h.MZ)()],w.prototype,"max",void 0),(0,o.Cg)([(0,h.MZ)()],w.prototype,"step",void 0),(0,o.Cg)([(0,h.MZ)({type:Boolean})],w.prototype,"autocorrect",void 0),(0,o.Cg)([(0,h.MZ)({type:Boolean,attribute:"inset-label"})],w.prototype,"insetLabel",void 0),(0,o.Cg)([(0,h.P)("wa-input")],w.prototype,"_input",void 0),(0,o.Cg)([(0,h.wk)(),(0,l.Fg)({context:u.D5,subscribe:!0})],w.prototype,"i18n",void 0),w=(0,o.Cg)([(0,h.EM)("ha-input")],w),i()}catch(t){i(t)}})},53305(t,a,e){e.d(a,{w:()=>n,N:()=>h});var i=e(62826),o=e(5124),r=e(22441),s=e(22786);e(74423);const l=Boolean(globalThis.ElementInternals)&&globalThis.HTMLElement?.prototype.attachInternals?.toString().includes("[native code]"),n=t=>{class a extends t{get _formControl(){throw new Error("_formControl getter must be implemented by subclass")}select(){this._formControl?.select()}setSelectionRange(t,a,e){this._formControl?.setSelectionRange(t,a,e)}setRangeText(t,a,e,i){this._formControl?.setRangeText(t,a,e,i)}checkValidity(){return!l||(this._formControl?.checkValidity()??!0)}reportValidity(){const t=this.checkValidity();return this._invalid=!t,t}_handleInput(){this.value=this._formControl?.value??void 0,this._invalid&&this._formControl?.checkValidity()&&(this._invalid=!1)}_handleChange(){this.value=this._formControl?.value??void 0}_handleBlur(){this.autoValidate&&(this._invalid=!this._formControl?.checkValidity())}_handleInvalid(){this._invalid=!0}constructor(...t){super(...t),this.label="",this.hint="",this.placeholder="",this.readonly=!1,this.required=!1,this.autocapitalize="",this.autofocus=!1,this.spellcheck=!0,this.inputmode="",this.enterkeyhint="",this.disabled=!1,this.validationMessage="",this.autoValidate=!1,this.invalid=!1,this._invalid=!1,this._requiredMarkerCSSVar="--ha-input-required-marker",this._renderLabel=(0,s.A)((t,a)=>{if(!a)return t;let e=getComputedStyle(this).getPropertyValue(this._requiredMarkerCSSVar);return e||(e="*"),e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1)),e?`${t}${e}`:t})}}return a.shadowRootOptions={mode:"open",delegatesFocus:!0},(0,i.Cg)([(0,r.MZ)()],a.prototype,"value",void 0),(0,i.Cg)([(0,r.MZ)()],a.prototype,"label",void 0),(0,i.Cg)([(0,r.MZ)()],a.prototype,"hint",void 0),(0,i.Cg)([(0,r.MZ)()],a.prototype,"placeholder",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],a.prototype,"readonly",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],a.prototype,"required",void 0),(0,i.Cg)([(0,r.MZ)({type:Number})],a.prototype,"minlength",void 0),(0,i.Cg)([(0,r.MZ)({type:Number})],a.prototype,"maxlength",void 0),(0,i.Cg)([(0,r.MZ)()],a.prototype,"autocapitalize",void 0),(0,i.Cg)([(0,r.MZ)()],a.prototype,"autocomplete",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],a.prototype,"autofocus",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],a.prototype,"spellcheck",void 0),(0,i.Cg)([(0,r.MZ)()],a.prototype,"inputmode",void 0),(0,i.Cg)([(0,r.MZ)()],a.prototype,"enterkeyhint",void 0),(0,i.Cg)([(0,r.MZ)()],a.prototype,"name",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],a.prototype,"disabled",void 0),(0,i.Cg)([(0,r.MZ)({attribute:"validation-message"})],a.prototype,"validationMessage",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"auto-validate"})],a.prototype,"autoValidate",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],a.prototype,"invalid",void 0),(0,i.Cg)([(0,r.wk)()],a.prototype,"_invalid",void 0),a},h=o.AH`.input{flex:1;min-width:0;--wa-transition-fast:var(--wa-transition-normal);position:relative}.input::part(label){position:absolute;top:0;font-weight:var(--ha-font-weight-normal);font-family:var(--ha-font-family-body);transition:all var(--wa-transition-normal) ease-in-out;color:var(--secondary-text-color);line-height:var(--ha-line-height-condensed);z-index:1;pointer-events:none;font-size:var(--ha-font-size-m)}.input.invalid:not([disabled])::part(label),:host(:focus-within) .input.invalid::part(label){color:var(--ha-color-fill-danger-loud-resting)}.input::part(base){background-color:var(--ha-color-form-background);border-top-left-radius:var(--ha-border-radius-sm);border-top-right-radius:var(--ha-border-radius-sm);border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square);border:none;position:relative;transition:background-color var(--wa-transition-normal) ease-in-out}:host(:focus-within) .input::part(base){outline:0}.input::part(hint){min-height:var(--ha-space-5);margin-block-start:0;margin-inline-start:var(--ha-space-3);font-size:var(--ha-font-size-s);display:flex;align-items:center;color:var(--ha-color-text-secondary)}.input.hint-hidden::part(hint){height:0;min-height:0}.error{color:var(--ha-color-on-danger-quiet)}`},14503(t,a,e){e.d(a,{RF:()=>r,dp:()=>n,kO:()=>l,nA:()=>s,og:()=>o});var i=e(5124);const o=i.AH`button.link{background:0 0;color:inherit;border:none;padding:0;font:inherit;text-align:left;text-decoration:underline;cursor:pointer;outline:0}`,r=i.AH`:host{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-m);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal)}app-header div[sticky]{height:48px}app-toolbar [main-title]{margin-left:20px;margin-inline-start:20px;margin-inline-end:initial}.header{transition:box-shadow .2s linear,width var(--ha-animation-duration-normal) ease,padding-left var(--ha-animation-duration-normal) ease,padding-right var(--ha-animation-duration-normal) ease} (prefers-reduced-motion:reduce){.header{transition:box-shadow .2s linear}}h1{font-family:var(--ha-font-family-heading);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-2xl);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-condensed)}h2{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:var(--ha-font-size-xl);font-weight:var(--ha-font-weight-medium);line-height:var(--ha-line-height-normal)}h3{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-l);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal)}a{color:var(--primary-color)}.secondary{color:var(--secondary-text-color)}.error{color:var(--error-color)}.warning{color:var(--error-color)}${o} .card-actions a{text-decoration:none}.card-actions .warning{--mdc-theme-primary:var(--error-color)}.layout.horizontal,.layout.vertical{display:flex}.layout.inline{display:inline-flex}.layout.horizontal{flex-direction:row}.layout.vertical{flex-direction:column}.layout.wrap{flex-wrap:wrap}.layout.no-wrap{flex-wrap:nowrap}.layout.center,.layout.center-center{align-items:center}.layout.bottom{align-items:flex-end}.layout.center-center,.layout.center-justified{justify-content:center}.flex{flex:1;flex-basis:0.000000001px}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.layout.justified{justify-content:space-between}`,s=i.AH`ha-adaptive-dialog,ha-dialog{--mdc-dialog-min-width:400px;--mdc-dialog-max-width:600px;--mdc-dialog-max-width:min(600px, 95vw);--justify-action-buttons:space-between;--dialog-container-padding:var(--safe-area-inset-top, 0) var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0) var(--safe-area-inset-left, 0);--dialog-surface-padding:0px}ha-adaptive-dialog .form,ha-dialog .form{color:var(--primary-text-color)}a{color:var(--primary-color)} all and (max-width:450px),all and (max-height:500px){ha-adaptive-dialog,ha-dialog{--mdc-dialog-min-width:100vw;--mdc-dialog-max-width:100vw;--mdc-dialog-min-height:100vh;--mdc-dialog-min-height:100svh;--mdc-dialog-max-height:100vh;--mdc-dialog-max-height:100svh;--dialog-container-padding:0px;--dialog-surface-padding:var(--safe-area-inset-top, 0) var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0) var(--safe-area-inset-left, 0);--vertical-align-dialog:flex-end}ha-dialog{--ha-dialog-border-radius:var(--ha-border-radius-square)}}.error{color:var(--error-color)}`,l=i.AH`ha-adaptive-dialog,ha-dialog{--vertical-align-dialog:flex-start;--dialog-surface-margin-top:var(--ha-space-10);--mdc-dialog-max-height:calc(
100vh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
--safe-area-inset-y,
0px
)
);--mdc-dialog-max-height:calc(
100svh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
--safe-area-inset-y,
0px
)
);--ha-dialog-max-height:calc(
100vh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
--safe-area-inset-y,
0px
)
);--ha-dialog-max-height:calc(
100svh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
--safe-area-inset-y,
0px
)
)} all and (max-width:450px),all and (max-height:500px){ha-adaptive-dialog,ha-dialog{--dialog-surface-margin-top:0px;--mdc-dialog-min-height:100vh;--mdc-dialog-min-height:100svh;--mdc-dialog-max-height:100vh;--mdc-dialog-max-height:100svh;--ha-dialog-max-height:100vh;--ha-dialog-max-height:100svh}}`,n=i.AH`.ha-scrollbar::-webkit-scrollbar{width:.4rem;height:.4rem}.ha-scrollbar::-webkit-scrollbar-thumb{border-radius:var(--ha-border-radius-sm);background:var(--scrollbar-thumb-color)}.ha-scrollbar{overflow-y:auto;scrollbar-color:var(--scrollbar-thumb-color) transparent;scrollbar-width:thin}`;i.AH`body{background-color:var(--primary-background-color);color:var(--primary-text-color);height:calc(100vh - 32px);width:100vw}`},89429(t){t.exports=function(){}}};