iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
5 lines • 37.2 kB
JavaScript
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["16703"],{99426:function(e,t,i){"use strict";i.r(t);var a=i(61701),o=(i(71695),i(47021),i(57243)),n=i(50778),r=i(35359),s=i(36522);i(23334),i(37583);let l,d,c,h,u=e=>e;const p={info:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",success:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"};(0,a.Z)([(0,n.Mo)("ha-alert")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)()],key:"title",value(){return""}},{kind:"field",decorators:[(0,n.Cb)({attribute:"alert-type"})],key:"alertType",value(){return"info"}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"dismissable",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"method",key:"render",value:function(){return(0,o.dy)(l||(l=u` <div class="issue-type ${0}" role="alert"> <div class="icon ${0}"> <slot name="icon"> <ha-svg-icon .path="${0}"></ha-svg-icon> </slot> </div> <div class="${0}"> <div class="main-content"> ${0} <slot></slot> </div> <div class="action"> <slot name="action"> ${0} </slot> </div> </div> </div> `),(0,r.$)({[this.alertType]:!0}),this.title?"":"no-title",p[this.alertType],(0,r.$)({content:!0,narrow:this.narrow}),this.title?(0,o.dy)(d||(d=u`<div class="title">${0}</div>`),this.title):o.Ld,this.dismissable?(0,o.dy)(c||(c=u`<ha-icon-button ="${0}" label="Dismiss alert" .path="${0}"></ha-icon-button>`),this._dismissClicked,"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"):o.Ld)}},{kind:"method",key:"_dismissClicked",value:function(){(0,s.B)(this,"alert-dismissed-clicked")}},{kind:"field",static:!0,key:"styles",value(){return(0,o.iv)(h||(h=u`.issue-type{position:relative;padding:8px;display:flex}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:4px}.icon{z-index:1}.icon.no-title{align-self:center}.content{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:var(--float-start)}.content.narrow{flex-direction:column;align-items:flex-end}.action{z-index:1;width:min-content;--mdc-theme-primary:var(--primary-text-color)}.main-content{overflow-wrap:anywhere;word-break:break-word;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:0}.title{margin-top:2px;font-weight:700}.action ha-icon-button,.action mwc-button{--mdc-theme-primary:var(--primary-text-color);--mdc-icon-button-size:36px}.issue-type.info>.icon{color:var(--info-color)}.issue-type.info::after{background-color:var(--info-color)}.issue-type.warning>.icon{color:var(--warning-color)}.issue-type.warning::after{background-color:var(--warning-color)}.issue-type.error>.icon{color:var(--error-color)}.issue-type.error::after{background-color:var(--error-color)}.issue-type.success>.icon{color:var(--success-color)}.issue-type.success::after{background-color:var(--success-color)}:host ::slotted(ul){margin:0;padding-inline-start:20px}`))}}]}}),o.oi)},59826:function(e,t,i){"use strict";var a=i(61701),o=(i(71695),i(47021),i(31622)),n=i(57243),r=i(50778),s=i(22344);let l,d=e=>e;(0,a.Z)([(0,r.Mo)("ha-button")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",static:!0,key:"styles",value(){return[s.W,(0,n.iv)(l||(l=d`::slotted([slot=icon]){margin-inline-start:0px;margin-inline-end:8px;direction:var(--direction);display:block}.mdc-button{height:var(--button-height,36px)}.trailing-icon{display:flex}.slot-container{overflow:var(--button-slot-container-overflow,visible)}:host([destructive]){--mdc-theme-primary:var(--error-color)}`))]}}]}}),o.Button)},94279:function(e,t,i){"use strict";i.a(e,(async function(e,t){try{var a=i(61701),o=i(72621),n=(i(71695),i(9359),i(31526),i(40251),i(47021),i(2394)),r=i(28737),s=i(43631),l=i(57243),d=i(50778),c=i(20552),h=i(36522),u=(i(23334),i(7285),i(83166),e([r]));r=(u.then?(await u)():u)[0];let p,v,m,k,y,f,b=e=>e;const g="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",_="M7,10L12,15L17,10H7Z",C="M7,15L12,10L17,15H7Z";(0,s.hC)("vaadin-combo-box-item",(0,l.iv)(p||(p=b`:host{padding:0!important}:host([focused]:not([disabled])){background-color:rgba(var(--rgb-primary-text-color,0,0,0),.12)}:host([selected]:not([disabled])){background-color:transparent;color:var(--mdc-theme-primary);--mdc-ripple-color:var(--mdc-theme-primary);--mdc-theme-text-primary-on-background:var(--mdc-theme-primary)}:host([selected]:not([disabled])):before{background-color:var(--mdc-theme-primary);opacity:.12;content:"";position:absolute;top:0;left:0;width:100%;height:100%}:host([selected][focused]:not([disabled])):before{opacity:.24}:host(:hover:not([disabled])){background-color:transparent}[part=content]{width:100%}[part=checkmark]{display:none}`)));(0,a.Z)([(0,d.Mo)("ha-combo-box")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"placeholder",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"validationMessage",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"invalid",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"icon",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"items",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"filteredItems",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"dataProvider",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:"allow-custom-value",type:Boolean})],key:"allowCustomValue",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({attribute:"item-value-path"})],key:"itemValuePath",value(){return"value"}},{kind:"field",decorators:[(0,d.Cb)({attribute:"item-label-path"})],key:"itemLabelPath",value(){return"label"}},{kind:"field",decorators:[(0,d.Cb)({attribute:"item-id-path"})],key:"itemIdPath",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"renderer",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"required",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({type:Boolean,reflect:!0})],key:"opened",value(){return!1}},{kind:"field",decorators:[(0,d.IO)("vaadin-combo-box-light",!0)],key:"_comboBox",value:void 0},{kind:"field",decorators:[(0,d.IO)("ha-textfield",!0)],key:"_inputElement",value:void 0},{kind:"field",key:"_overlayMutationObserver",value:void 0},{kind:"field",key:"_bodyMutationObserver",value:void 0},{kind:"method",key:"open",value:async function(){var e;await this.updateComplete,null===(e=this._comboBox)||void 0===e||e.open()}},{kind:"method",key:"focus",value:async function(){var e,t;await this.updateComplete,await(null===(e=this._inputElement)||void 0===e?void 0:e.updateComplete),null===(t=this._inputElement)||void 0===t||t.focus()}},{kind:"method",key:"disconnectedCallback",value:function(){(0,o.Z)(i,"disconnectedCallback",this,3)([]),this._overlayMutationObserver&&(this._overlayMutationObserver.disconnect(),this._overlayMutationObserver=void 0),this._bodyMutationObserver&&(this._bodyMutationObserver.disconnect(),this._bodyMutationObserver=void 0)}},{kind:"get",key:"selectedItem",value:function(){return this._comboBox.selectedItem}},{kind:"method",key:"setInputValue",value:function(e){this._comboBox.value=e}},{kind:"method",key:"render",value:function(){var e;return(0,l.dy)(v||(v=b` <vaadin-combo-box-light .itemValuePath="${0}" .itemIdPath="${0}" .itemLabelPath="${0}" .items="${0}" .value="${0}" .filteredItems="${0}" .dataProvider="${0}" .allowCustomValue="${0}" .disabled="${0}" .required="${0}" ${0} -changed="${0}" -changed="${0}" -changed="${0}" attr-for-value="value"> <ha-textfield label="${0}" placeholder="${0}" ?disabled="${0}" ?required="${0}" validationMessage="${0}" .errorMessage="${0}" class="input" autocapitalize="none" autocomplete="off" autocorrect="off" input-spellcheck="false" .suffix="${0}" .icon="${0}" .invalid="${0}" .helper="${0}" helperPersistent> <slot name="icon" slot="leadingIcon"></slot> </ha-textfield> ${0} <ha-svg-icon role="button" tabindex="-1" aria-label="${0}" aria-expanded="${0}" class="toggle-button" .path="${0}" ="${0}"></ha-svg-icon> </vaadin-combo-box-light> `),this.itemValuePath,this.itemIdPath,this.itemLabelPath,this.items,this.value||"",this.filteredItems,this.dataProvider,this.allowCustomValue,this.disabled,this.required,(0,n.t)(this.renderer||this._defaultRowRenderer),this._openedChanged,this._filterChanged,this._valueChanged,(0,c.o)(this.label),(0,c.o)(this.placeholder),this.disabled,this.required,(0,c.o)(this.validationMessage),this.errorMessage,(0,l.dy)(m||(m=b`<div style="width:28px" role="none presentation"></div>`)),this.icon,this.invalid,this.helper,this.value?(0,l.dy)(k||(k=b`<ha-svg-icon role="button" tabindex="-1" aria-label="${0}" class="clear-button" .path="${0}" ="${0}"></ha-svg-icon>`),(0,c.o)(null===(e=this.hass)||void 0===e?void 0:e.localize("ui.common.clear")),g,this._clearValue):"",(0,c.o)(this.label),this.opened?"true":"false",this.opened?C:_,this._toggleOpen)}},{kind:"field",key:"_defaultRowRenderer",value(){return e=>(0,l.dy)(y||(y=b`<ha-list-item> ${0} </ha-list-item>`),this.itemLabelPath?e[this.itemLabelPath]:e)}},{kind:"method",key:"_clearValue",value:function(e){e.stopPropagation(),(0,h.B)(this,"value-changed",{value:void 0})}},{kind:"method",key:"_toggleOpen",value:function(e){var t,i;this.opened?(null===(t=this._comboBox)||void 0===t||t.close(),e.stopPropagation()):null===(i=this._comboBox)||void 0===i||i.inputElement.focus()}},{kind:"method",key:"_openedChanged",value:function(e){e.stopPropagation();const t=e.detail.value;if(setTimeout((()=>{this.opened=t}),0),(0,h.B)(this,"opened-changed",{value:e.detail.value}),t){const e=document.querySelector("vaadin-combo-box-overlay");e&&this._removeInert(e),this._observeBody()}else{var i;null===(i=this._bodyMutationObserver)||void 0===i||i.disconnect(),this._bodyMutationObserver=void 0}}},{kind:"method",key:"_observeBody",value:function(){"MutationObserver"in window&&!this._bodyMutationObserver&&(this._bodyMutationObserver=new MutationObserver((e=>{e.forEach((e=>{e.addedNodes.forEach((e=>{"VAADIN-COMBO-BOX-OVERLAY"===e.nodeName&&this._removeInert(e)})),e.removedNodes.forEach((e=>{var t;"VAADIN-COMBO-BOX-OVERLAY"===e.nodeName&&(null===(t=this._overlayMutationObserver)||void 0===t||t.disconnect(),this._overlayMutationObserver=void 0)}))}))})),this._bodyMutationObserver.observe(document.body,{childList:!0}))}},{kind:"method",key:"_removeInert",value:function(e){var t;if(e.inert)return e.inert=!1,null===(t=this._overlayMutationObserver)||void 0===t||t.disconnect(),void(this._overlayMutationObserver=void 0);"MutationObserver"in window&&!this._overlayMutationObserver&&(this._overlayMutationObserver=new MutationObserver((e=>{e.forEach((e=>{if("inert"===e.attributeName){const i=e.target;var t;if(i.inert)null===(t=this._overlayMutationObserver)||void 0===t||t.disconnect(),this._overlayMutationObserver=void 0,i.inert=!1}}))})),this._overlayMutationObserver.observe(e,{attributes:!0}))}},{kind:"method",key:"_filterChanged",value:function(e){e.stopPropagation(),(0,h.B)(this,"filter-changed",{value:e.detail.value})}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation(),this.allowCustomValue||(this._comboBox._closeOnBlurIsPrevented=!0);const t=e.detail.value;t!==this.value&&(0,h.B)(this,"value-changed",{value:t||void 0})}},{kind:"field",static:!0,key:"styles",value(){return(0,l.iv)(f||(f=b`:host{display:block;width:100%}vaadin-combo-box-light{position:relative;--vaadin-combo-box-overlay-max-height:calc(45vh - 56px)}ha-textfield{width:100%}ha-textfield>ha-icon-button{--mdc-icon-button-size:24px;padding:2px;color:var(--secondary-text-color)}ha-svg-icon{color:var(--input-dropdown-icon-color);position:absolute;cursor:pointer}.toggle-button{right:12px;top:-10px;inset-inline-start:initial;inset-inline-end:12px;direction:var(--direction)}:host([opened]) .toggle-button{color:var(--primary-color)}.clear-button{--mdc-icon-size:20px;top:-7px;right:36px;inset-inline-start:initial;inset-inline-end:36px;direction:var(--direction)}`))}}]}}),l.oi);t()}catch(p){t(p)}}))},53013:function(e,t,i){"use strict";var a=i(61701),o=i(72621),n=i(91179),r=(i(19083),i(71695),i(52805),i(9359),i(56475),i(70104),i(48136),i(40251),i(19134),i(61006),i(47021),i(57243)),s=i(50778),l=i(94886),d=i.n(l),c=i(36522),h=(i(72700),i(8038),i(71513),i(75656),i(50100),i(18084),i(75351));let u;const p=new(i(80262).L)(1e3),v={reType:(0,n.Z)(/((\[!(caution|important|note|tip|warning)\])(?:\s|\\n)?)/i,{input:1,type:3}),typeToHaAlert:{caution:"error",important:"info",note:"info",tip:"success",warning:"warning"}};(0,a.Z)([(0,s.Mo)("ha-markdown-element")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",decorators:[(0,s.Cb)()],key:"content",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:"allow-svg",type:Boolean})],key:"allowSvg",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"breaks",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,attribute:"lazy-images"})],key:"lazyImages",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"cache",value(){return!1}},{kind:"method",key:"disconnectedCallback",value:function(){if((0,o.Z)(a,"disconnectedCallback",this,3)([]),this.cache){const e=this._computeCacheKey();p.set(e,this.innerHTML)}}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"update",value:function(e){(0,o.Z)(a,"update",this,3)([e]),void 0!==this.content&&this._render()}},{kind:"method",key:"willUpdate",value:function(e){if(!this.innerHTML&&this.cache){const e=this._computeCacheKey();p.has(e)&&(this.innerHTML=p.get(e),this._resize())}}},{kind:"method",key:"_computeCacheKey",value:function(){return d()({content:this.content,allowSvg:this.allowSvg,breaks:this.breaks})}},{kind:"method",key:"_render",value:async function(){this.innerHTML=await(async(e,t,a)=>(u||(u=(0,h.Ud)(new Worker(new URL(i.p+i.u("45845"),i.b)))),u.renderMarkdown(e,t,a)))(String(this.content),{breaks:this.breaks,gfm:!0},{allowSvg:this.allowSvg}),this._resize();const e=document.createTreeWalker(this,NodeFilter.SHOW_ELEMENT,null);for(;e.nextNode();){const a=e.currentNode;if(a instanceof HTMLAnchorElement&&a.host!==document.location.host)a.target="_blank",a.rel="noreferrer noopener";else if(a instanceof HTMLImageElement)this.lazyImages&&(a.loading="lazy"),a.addEventListener("load",this._resize);else if(a instanceof HTMLQuoteElement){var t;const i=(null===(t=a.firstElementChild)||void 0===t||null===(t=t.firstChild)||void 0===t?void 0:t.textContent)&&v.reType.exec(a.firstElementChild.firstChild.textContent);if(i){const{type:t}=i.groups,o=document.createElement("ha-alert");o.alertType=v.typeToHaAlert[t.toLowerCase()],o.append(...Array.from(a.childNodes).map((e=>{const t=Array.from(e.childNodes);if(!this.breaks&&t.length){var a;const e=t[0];e.nodeType===Node.TEXT_NODE&&e.textContent===i.input&&null!==(a=e.textContent)&&void 0!==a&&a.includes("\n")&&(e.textContent=e.textContent.split("\n").slice(1).join("\n"))}return t})).reduce(((e,t)=>e.concat(t)),[]).filter((e=>e.textContent&&e.textContent!==i.input))),e.parentNode().replaceChild(o,a)}}else a instanceof HTMLElement&&["ha-alert","ha-qr-code","ha-icon","ha-svg-icon"].includes(a.localName)&&i(23265)(`./${a.localName}`)}}},{kind:"field",key:"_resize",value(){return()=>(0,c.B)(this,"content-resize")}}]}}),r.fl)},99254:function(e,t,i){"use strict";var a=i(61701),o=(i(71695),i(47021),i(57243)),n=i(50778);i(53013);let r,s,l=e=>e;(0,a.Z)([(0,n.Mo)("ha-markdown")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)()],key:"content",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"allow-svg",type:Boolean})],key:"allowSvg",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"breaks",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"lazy-images"})],key:"lazyImages",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"cache",value(){return!1}},{kind:"method",key:"render",value:function(){return this.content?(0,o.dy)(r||(r=l`<ha-markdown-element .content="${0}" .allowSvg="${0}" .breaks="${0}" .lazyImages="${0}" .cache="${0}"></ha-markdown-element>`),this.content,this.allowSvg,this.breaks,this.lazyImages,this.cache):o.Ld}},{kind:"field",static:!0,key:"styles",value(){return(0,o.iv)(s||(s=l`:host{display:block}ha-markdown-element{-ms-user-select:text;-webkit-user-select:text;-moz-user-select:text}ha-markdown-element>:first-child{margin-top:0}ha-markdown-element>:last-child{margin-bottom:0}ha-alert{display:block;margin:4px 0}a{color:var(--primary-color)}img{max-width:100%}code,pre{background-color:var(--markdown-code-background-color,none);border-radius:3px}svg{background-color:var(--markdown-svg-background-color,none);color:var(--markdown-svg-color,none)}code{font-size:85%;padding:.2em .4em}pre code{padding:0}pre{padding:16px;overflow:auto;line-height:1.45;font-family:var(--code-font-family, monospace)}h1,h2,h3,h4,h5,h6{line-height:initial}h2{font-size:1.5em;font-weight:700}hr{border-color:var(--divider-color);border-bottom:none;margin:16px 0}`))}}]}}),o.oi)},34326:function(e,t,i){"use strict";var a=i(61701),o=(i(71695),i(47021),i(57243)),n=i(50778);i(23334),i(83166);let r,s,l,d=e=>e;(0,a.Z)([(0,n.Mo)("ha-password-field")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"invalid",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"icon",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"iconTrailing",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)()],key:"autocomplete",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"autocorrect",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"input-spellcheck"})],key:"inputSpellcheck",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"value",value(){return""}},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"placeholder",value(){return""}},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"label",value(){return""}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"required",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Number})],key:"minLength",value(){return-1}},{kind:"field",decorators:[(0,n.Cb)({type:Number})],key:"maxLength",value(){return-1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"outlined",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"helper",value(){return""}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"validateOnInitialRender",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"validationMessage",value(){return""}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"autoValidate",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"pattern",value(){return""}},{kind:"field",decorators:[(0,n.Cb)({type:Number})],key:"size",value(){return null}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"helperPersistent",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"charCounter",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"endAligned",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"prefix",value(){return""}},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"suffix",value(){return""}},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"name",value(){return""}},{kind:"field",decorators:[(0,n.Cb)({type:String,attribute:"input-mode"})],key:"inputMode",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"readOnly",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({attribute:!1,type:String})],key:"autocapitalize",value(){return""}},{kind:"field",decorators:[(0,n.SB)()],key:"_unmaskedPassword",value(){return!1}},{kind:"field",decorators:[(0,n.IO)("ha-textfield")],key:"_textField",value:void 0},{kind:"method",key:"render",value:function(){var e;return(0,o.dy)(r||(r=d`<ha-textfield .invalid="${0}" .errorMessage="${0}" .icon="${0}" .iconTrailing="${0}" .autocomplete="${0}" .autocorrect="${0}" .inputSpellcheck="${0}" .value="${0}" .placeholder="${0}" .label="${0}" .disabled="${0}" .required="${0}" .minLength="${0}" .maxLength="${0}" .outlined="${0}" .helper="${0}" .validateOnInitialRender="${0}" .validationMessage="${0}" .autoValidate="${0}" .pattern="${0}" .size="${0}" .helperPersistent="${0}" .charCounter="${0}" .endAligned="${0}" .prefix="${0}" .name="${0}" .inputMode="${0}" .readOnly="${0}" .autocapitalize="${0}" .type="${0}" .suffix="${0}" ="${0}" ="${0}"></ha-textfield> <ha-icon-button .label="${0}" ="${0}" .path="${0}"></ha-icon-button>`),this.invalid,this.errorMessage,this.icon,this.iconTrailing,this.autocomplete,this.autocorrect,this.inputSpellcheck,this.value,this.placeholder,this.label,this.disabled,this.required,this.minLength,this.maxLength,this.outlined,this.helper,this.validateOnInitialRender,this.validationMessage,this.autoValidate,this.pattern,this.size,this.helperPersistent,this.charCounter,this.endAligned,this.prefix,this.name,this.inputMode,this.readOnly,this.autocapitalize,this._unmaskedPassword?"text":"password",(0,o.dy)(s||(s=d`<div style="width:24px"></div>`)),this._handleInputEvent,this._handleChangeEvent,(null===(e=this.hass)||void 0===e?void 0:e.localize(this._unmaskedPassword?"ui.components.selectors.text.hide_password":"ui.components.selectors.text.show_password"))||(this._unmaskedPassword?"Hide password":"Show password"),this._toggleUnmaskedPassword,this._unmaskedPassword?"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":"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")}},{kind:"method",key:"focus",value:function(){this._textField.focus()}},{kind:"method",key:"checkValidity",value:function(){return this._textField.checkValidity()}},{kind:"method",key:"reportValidity",value:function(){return this._textField.reportValidity()}},{kind:"method",key:"setCustomValidity",value:function(e){return this._textField.setCustomValidity(e)}},{kind:"method",key:"layout",value:function(){return this._textField.layout()}},{kind:"method",key:"_toggleUnmaskedPassword",value:function(){this._unmaskedPassword=!this._unmaskedPassword}},{kind:"method",decorators:[(0,n.hO)({passive:!0})],key:"_handleInputEvent",value:function(e){this.value=e.target.value}},{kind:"method",decorators:[(0,n.hO)({passive:!0})],key:"_handleChangeEvent",value:function(e){this.value=e.target.value,this._reDispatchEvent(e)}},{kind:"method",key:"_reDispatchEvent",value:function(e){const t=new Event(e.type,e);this.dispatchEvent(t)}},{kind:"field",static:!0,key:"styles",value(){return(0,o.iv)(l||(l=d`:host{display:block;position:relative}ha-textfield{width:100%}ha-icon-button{position:absolute;top:8px;right:8px;inset-inline-start:initial;inset-inline-end:8px;--mdc-icon-button-size:40px;--mdc-icon-size:20px;color:var(--secondary-text-color);direction:var(--direction)}`))}}]}}),o.oi)},17170:function(e,t,i){"use strict";i.a(e,(async function(e,a){try{i.r(t),i.d(t,{HaSpinner:()=>p});var o=i(61701),n=i(72621),r=(i(71695),i(47021),i(97677)),s=i(43580),l=i(57243),d=i(50778),c=e([r]);r=(c.then?(await c)():c)[0];let h,u=e=>e,p=(0,o.Z)([(0,d.Mo)("ha-spinner")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)()],key:"size",value:void 0},{kind:"method",key:"updated",value:function(e){if((0,n.Z)(i,"updated",this,3)([e]),e.has("size"))switch(this.size){case"tiny":this.style.setProperty("--ha-spinner-size","16px");break;case"small":this.style.setProperty("--ha-spinner-size","28px");break;case"medium":this.style.setProperty("--ha-spinner-size","48px");break;case"large":this.style.setProperty("--ha-spinner-size","68px");break;case void 0:this.style.removeProperty("--ha-progress-ring-size")}}},{kind:"field",static:!0,key:"styles",value(){return[s.Z,(0,l.iv)(h||(h=u`:host{--indicator-color:var(
--ha-spinner-indicator-color,
var(--primary-color)
);--track-color:var(--ha-spinner-divider-color, var(--divider-color));--track-width:4px;--speed:3.5s;font-size:var(--ha-spinner-size, 48px)}`))]}}]}}),r.Z);a()}catch(h){a(h)}}))},11498:function(e,t,i){"use strict";i.d(t,{A8:()=>a,Ax:()=>o,Fc:()=>n,G$:()=>r,zq:()=>s});i(40251);const a=async e=>e.callWS({type:"application_credentials/config"}),o=async(e,t)=>e.callWS({type:"application_credentials/config_entry",config_entry_id:t}),n=async e=>e.callWS({type:"application_credentials/list"}),r=async(e,t,i,a,o)=>e.callWS({type:"application_credentials/create",domain:t,client_id:i,client_secret:a,name:o}),s=async(e,t)=>e.callWS({type:"application_credentials/delete",application_credentials_id:t})},58670:function(e,t,i){"use strict";i.a(e,(async function(e,a){try{i.r(t),i.d(t,{DialogAddApplicationCredential:()=>A});var o=i(61701),n=(i(71695),i(9359),i(70104),i(40251),i(47021),i(87319),i(57243)),r=i(50778),s=i(36522),l=(i(99426),i(59826),i(17170)),d=i(94279),c=i(73729),h=(i(99254),i(34326),i(83166),i(11498)),u=i(57816),p=i(28008),v=i(73192),m=e([l,d]);[l,d]=m.then?(await m)():m;let k,y,f,b,g,_,C,x,$,w,M,L=e=>e;const z="M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z",B=e=>(0,n.dy)(k||(k=L`<mwc-list-item> <span>${0}</span> </mwc-list-item>`),e.name);let A=(0,o.Z)([(0,r.Mo)("dialog-add-application-credential")],(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:"_loading",value(){return!1}},{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:"_domain",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_manifest",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_name",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_description",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_clientId",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_clientSecret",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_domains",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_config",value:void 0},{kind:"method",key:"showDialog",value:function(e){this._params=e,this._domain=e.selectedDomain,this._manifest=e.manifest,this._name="",this._description="",this._clientId="",this._clientSecret="",this._error=void 0,this._loading=!1,this._fetchConfig()}},{kind:"method",key:"_fetchConfig",value:async function(){this._config=await(0,h.A8)(this.hass),this._domains=Object.keys(this._config.integrations).map((e=>({id:e,name:(0,u.Lh)(this.hass.localize,e)}))),await this.hass.loadBackendTranslation("application_credentials"),this._updateDescription()}},{kind:"method",key:"render",value:function(){var e,t;if(!this._params||!this._domains)return n.Ld;const i=this._params.selectedDomain?(0,u.Lh)(this.hass.localize,this._domain):"";return(0,n.dy)(y||(y=L` <ha-dialog open ="${0}" scrimClickAction escapeKeyAction .heading="${0}"> <div> ${0} ${0} ${0} ${0} ${0} <ha-textfield class="name" name="name" .label="${0}" .value="${0}" required ="${0}" .validationMessage="${0}" dialogInitialFocus></ha-textfield> <ha-textfield class="clientId" name="clientId" .label="${0}" .value="${0}" required ="${0}" .validationMessage="${0}" dialogInitialFocus .helper="${0}" helperPersistent></ha-textfield> <ha-password-field .label="${0}" name="clientSecret" .value="${0}" required ="${0}" .validationMessage="${0}" .helper="${0}" helperPersistent></ha-password-field> </div> ${0} </ha-dialog> `),this._abortDialog,(0,c.i)(this.hass,this.hass.localize("ui.panel.config.application_credentials.editor.caption")),this._error?(0,n.dy)(f||(f=L`<ha-alert alert-type="error">${0}</ha-alert> `),this._error):"",this._params.selectedDomain&&!this._description?(0,n.dy)(b||(b=L`<p> ${0} ${0} </p>`),this.hass.localize("ui.panel.config.application_credentials.editor.missing_credentials",{integration:i}),null!==(e=this._manifest)&&void 0!==e&&e.is_built_in||null!==(t=this._manifest)&&void 0!==t&&t.documentation?(0,n.dy)(g||(g=L`<a href="${0}" target="_blank" rel="noreferrer"> ${0} <ha-svg-icon .path="${0}"></ha-svg-icon> </a>`),this._manifest.is_built_in?(0,v.R)(this.hass,`/integrations/${this._domain}`):this._manifest.documentation,this.hass.localize("ui.panel.config.application_credentials.editor.missing_credentials_domain_link",{integration:i}),z):""):"",this._params.selectedDomain&&this._description?"":(0,n.dy)(_||(_=L`<p> ${0} <a href="${0}" target="_blank" rel="noreferrer"> ${0} <ha-svg-icon .path="${0}"></ha-svg-icon> </a> </p>`),this.hass.localize("ui.panel.config.application_credentials.editor.description"),(0,v.R)(this.hass,"/integrations/application_credentials"),this.hass.localize("ui.panel.config.application_credentials.editor.view_documentation"),z),this._params.selectedDomain?"":(0,n.dy)(C||(C=L`<ha-combo-box name="domain" .hass="${0}" .label="${0}" .value="${0}" .renderer="${0}" .items="${0}" item-id-path="id" item-value-path="id" item-label-path="name" required -changed="${0}"></ha-combo-box>`),this.hass,this.hass.localize("ui.panel.config.application_credentials.editor.domain"),this._domain,B,this._domains,this._handleDomainPicked),this._description?(0,n.dy)(x||(x=L`<ha-markdown breaks .content="${0}"></ha-markdown>`),this._description):"",this.hass.localize("ui.panel.config.application_credentials.editor.name"),this._name,this._handleValueChanged,this.hass.localize("ui.common.error_required"),this.hass.localize("ui.panel.config.application_credentials.editor.client_id"),this._clientId,this._handleValueChanged,this.hass.localize("ui.common.error_required"),this.hass.localize("ui.panel.config.application_credentials.editor.client_id_helper"),this.hass.localize("ui.panel.config.application_credentials.editor.client_secret"),this._clientSecret,this._handleValueChanged,this.hass.localize("ui.common.error_required"),this.hass.localize("ui.panel.config.application_credentials.editor.client_secret_helper"),this._loading?(0,n.dy)($||($=L` <div slot="primaryAction" class="submit-spinner"> <ha-spinner></ha-spinner> </div> `)):(0,n.dy)(w||(w=L` <ha-button slot="secondaryAction" ="${0}"> ${0} </ha-button> <ha-button slot="primaryAction" .disabled="${0}" ="${0}"> ${0} </ha-button> `),this._abortDialog,this.hass.localize("ui.common.cancel"),!this._domain||!this._clientId||!this._clientSecret,this._addApplicationCredential,this.hass.localize("ui.panel.config.application_credentials.editor.add")))}},{kind:"method",key:"closeDialog",value:function(){this._params=void 0,this._domains=void 0,(0,s.B)(this,"dialog-closed",{dialog:this.localName})}},{kind:"method",key:"_handleDomainPicked",value:function(e){e.stopPropagation(),this._domain=e.detail.value,this._updateDescription()}},{kind:"method",key:"_updateDescription",value:async function(){if(!this._domain)return;await this.hass.loadBackendTranslation("application_credentials",this._domain);const e=this._config.integrations[this._domain];this._description=this.hass.localize(`component.${this._domain}.application_credentials.description`,e.description_placeholders)}},{kind:"method",key:"_handleValueChanged",value:function(e){this._error=void 0;const t=e.target.name,i=e.target.value;this[`_${t}`]=i}},{kind:"method",key:"_abortDialog",value:function(){this._params&&this._params.dialogAbortedCallback&&this._params.dialogAbortedCallback(),this.closeDialog()}},{kind:"method",key:"_addApplicationCredential",value:async function(e){if(e.preventDefault(),!this._domain||!this._clientId||!this._clientSecret)return;let t;this._loading=!0,this._error="";try{t=await(0,h.G$)(this.hass,this._domain,this._clientId,this._clientSecret,this._name)}catch(i){return this._loading=!1,void(this._error=i.message)}this._params.applicationCredentialAddedCallback(t),this.closeDialog()}},{kind:"get",static:!0,key:"styles",value:function(){return[p.yu,(0,n.iv)(M||(M=L`ha-dialog{--mdc-dialog-max-width:500px;--dialog-z-index:10}.row{display:flex;padding:8px 0}ha-combo-box{display:block;margin-bottom:24px}ha-textfield{display:block;margin-bottom:24px}a{text-decoration:none}a ha-svg-icon{--mdc-icon-size:16px}ha-markdown{margin-bottom:16px}`))]}}]}}),n.oi);a()}catch(k){a(k)}}))},80262:function(e,t,i){"use strict";i.d(t,{L:()=>a});i(71695),i(47021);class a{constructor(e){this._expiration=void 0,this._cache=new Map,this._expiration=e}get(e){return this._cache.get(e)}set(e,t){this._cache.set(e,t),this._expiration&&window.setTimeout((()=>this._cache.delete(e)),this._expiration)}has(e){return this._cache.has(e)}}},73192:function(e,t,i){"use strict";i.d(t,{R:()=>a});const a=(e,t)=>`https://www.iobroker.net/#${e.language&&e.language.split("-")[0]||"en"}/adapters/adapterref/iobroker.lovelace/README.md#`},23265:function(e,t,i){var a={"./ha-icon":["65981","97406"],"./ha-icon-button-toggle":["79505","80175"],"./ha-svg-icon":["37583"],"./ha-icon-button-group":["45747","97792"],"./ha-svg-icon.ts":["37583"],"./ha-icon.ts":["65981","97406"],"./ha-icon-overflow-menu":["59959","91552","78456","56898","99287","14932"],"./ha-icon-next":["13928","99172"],"./ha-icon-picker":["21393","46379","66031","24199","78943","45760"],"./ha-qr-code.ts":["50634","53750","70472"],"./ha-icon-button-arrow-prev.ts":["54202","41069"],"./ha-icon-button-arrow-prev":["54202","41069"],"./ha-icon-overflow-menu.ts":["59959","91552","78456","56898","99287","14932"],"./ha-alert":["99426","4809"],"./ha-icon-button-next":["4635","51577"],"./ha-icon-button":["23334"],"./ha-icon-button-next.ts":["4635","51577"],"./ha-icon-picker.ts":["21393","46379","66031","24199","78943","45760"],"./ha-icon-button-group.ts":["45747","97792"],"./ha-icon-button-toggle.ts":["79505","80175"],"./ha-icon-button-arrow-next.ts":["54237","21559"],"./ha-icon-button-prev.ts":["5828","43537"],"./ha-icon-prev":["95499","87557"],"./ha-icon-prev.ts":["95499","87557"],"./ha-icon-button.ts":["23334"],"./ha-alert.ts":["99426","4809"],"./ha-icon-button-prev":["5828","43537"],"./ha-qr-code":["50634","53750","70472"],"./ha-icon-next.ts":["13928","99172"],"./ha-icon-button-arrow-next":["54237","21559"]};function o(e){if(!i.o(a,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=a[e],o=t[0];return Promise.all(t.slice(1).map(i.e)).then((function(){return i(o)}))}o.keys=()=>Object.keys(a),o.id=23265,e.exports=o}}]);
//# sourceMappingURL=16703.2a89670c4c490deb.js.map