UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

10 lines 17.8 kB
export const __rspack_esm_id=36748;export const __rspack_esm_ids=[36748];export const __webpack_modules__={93421(e,t,o){o.d(t,{IW:()=>c,dH:()=>d,fI:()=>l});o(44114);var i=o(35211),n=o(22792),a=o(32172);const r=(e,t)=>{let o=e;for(const e of t){if(null==o)return;o=o[e]}return o},s=(e,t,o)=>{const n=(0,a.p)({transformer:function(e){return o.call(this,e)},watch:t?[t]:[]}),r=(0,i.Fg)({context:e,subscribe:!0});return(e,t)=>{n(e,t),r(e,t)}},l=e=>s(n.iN,e.entityIdPath[0],function(t){const o=r(this,e.entityIdPath);return"string"==typeof o?t?.[o]:void 0}),d=e=>s(n.X1,e.entityIdPath[0],function(t){const o=r(this,e.entityIdPath);return"string"==typeof o?t?.[o]:void 0}),c=()=>s(n.D5,void 0,({localize:e})=>e)},38962(e,t,o){o.a(e,async function(e,i){try{o.r(t);var n=o(62826),a=o(5124),r=o(22441),s=o(6412),l=o(93421),d=o(1087),c=o(26300),p=(o(67094),e([c]));c=(p.then?(await p)():p)[0];const h="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",m={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"};class g extends a.WF{render(){return a.qy` <div class="issue-type ${(0,s.H)({[this.alertType]:!0})}" role="alert"> <div class="icon ${this.title?"":"no-title"}"> <slot name="icon"> <ha-svg-icon .path="${m[this.alertType]}"></ha-svg-icon> </slot> </div> <div class="${(0,s.H)({content:!0,narrow:this.narrow})}"> <div class="main-content"> ${this.title?a.qy`<div class="title">${this.title}</div>`:a.s6} <slot></slot> </div> <div class="action"> <slot name="action"> ${this.dismissable?a.qy`<ha-icon-button @click="${this._dismissClicked}" .label="${this._localize?.("ui.common.dismiss_alert")}" .path="${h}"></ha-icon-button>`:a.s6} </slot> </div> </div> </div> `}_dismissClicked(){(0,d.r)(this,"alert-dismissed-clicked")}constructor(...e){super(...e),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}g.styles=a.AH`.issue-type{position:relative;padding:8px;display:flex}.icon{height:var(--ha-alert-icon-size,24px);width:var(--ha-alert-icon-size,24px)}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:var(--ha-border-radius-sm)}.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;line-height:normal;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:8px}.title{margin-top:2px;font-weight:var(--ha-font-weight-bold)}.action ha-icon-button{--mdc-theme-primary:var(--primary-text-color);--ha-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}`,(0,n.Cg)([(0,r.MZ)()],g.prototype,"title",void 0),(0,n.Cg)([(0,r.MZ)({attribute:"alert-type"})],g.prototype,"alertType",void 0),(0,n.Cg)([(0,r.MZ)({type:Boolean})],g.prototype,"dismissable",void 0),(0,n.Cg)([(0,r.wk)(),(0,l.IW)()],g.prototype,"_localize",void 0),(0,n.Cg)([(0,r.MZ)({type:Boolean})],g.prototype,"narrow",void 0),g=(0,n.Cg)([(0,r.EM)("ha-alert")],g),i()}catch(e){i(e)}})},76776(e,t,o){var i=o(62826),n=o(5124),a=o(22441);class r extends n.WF{render(){return n.qy` ${this.header?n.qy`<h1 class="card-header">${this.header}</h1>`:n.s6} <slot></slot> `}constructor(...e){super(...e),this.raised=!1}}r.styles=n.AH`:host{background:var(--ha-card-background,var(--card-background-color,#fff));-webkit-backdrop-filter:var(--ha-card-backdrop-filter,none);backdrop-filter:var(--ha-card-backdrop-filter,none);box-shadow:var(--ha-card-box-shadow,none);box-sizing:border-box;border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-width:var(--ha-card-border-width,1px);border-style:solid;border-color:var(--ha-card-border-color,var(--divider-color,#e0e0e0));color:var(--primary-text-color);display:block;transition:all .3s ease-out;position:relative}:host([raised]){border:none;box-shadow:var(--ha-card-box-shadow,0px 2px 1px -1px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 1px 3px 0px rgba(0,0,0,.12))}.card-header,:host ::slotted(.card-header){color:var(--ha-card-header-color,var(--primary-text-color));font-family:var(--ha-card-header-font-family, inherit);font-size:var(--ha-card-header-font-size, var(--ha-font-size-2xl));letter-spacing:-.012em;line-height:var(--ha-line-height-expanded);padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4);display:block;margin-block-start:0;margin-block-end:0;font-weight:var(--ha-font-weight-normal)} :host ::slotted( .card-content:not(:nth-child(1 of .card-content, .card-header)) ), slot:not(:first-child)::slotted(.card-content) { padding-top: 0; margin-top: calc(var(--ha-space-2) * -1); } :host ::slotted(.card-content){padding:var(--ha-space-4)}:host ::slotted(.card-actions){border-top:1px solid var(--divider-color,#e8e8e8);padding:var(--ha-space-2)}`,(0,i.Cg)([(0,a.MZ)()],r.prototype,"header",void 0),(0,i.Cg)([(0,a.MZ)({type:Boolean,reflect:!0})],r.prototype,"raised",void 0),r=(0,i.Cg)([(0,a.EM)("ha-card")],r)},28732(e,t,o){var i=o(62826),n=o(27686),a=o(7731),r=o(5124),s=o(22441);class l extends n.J{renderRipple(){return this.noninteractive?"":super.renderRipple()}static get styles(){return[a.R,r.AH`:host{padding-left:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-inline-start:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-right:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px));padding-inline-end:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px))}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:48px}span.material-icons:first-of-type{margin-inline-start:0px!important;margin-inline-end:var(--mdc-list-item-graphic-margin,16px)!important;direction:var(--direction)!important}span.material-icons:last-of-type{margin-inline-start:auto!important;margin-inline-end:0px!important;direction:var(--direction)!important}.mdc-deprecated-list-item__meta{display:var(--mdc-list-item-meta-display);align-items:center;flex-shrink:0}:host([graphic=icon]:not([twoline])) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,20px)!important}:host([multiline-secondary]){height:auto}:host([multiline-secondary]) .mdc-deprecated-list-item__text{padding:8px 0}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text{text-overflow:initial;white-space:normal;overflow:auto;display:inline-block;margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text{margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text::before{display:none}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text::before{display:none}:host([disabled]){color:var(--disabled-text-color)}:host([noninteractive]){pointer-events:unset}`,"rtl"===document.dir?r.AH`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`:r.AH``]}}l=(0,i.Cg)([(0,s.EM)("ha-list-item")],l)},81762(e,t,o){var i=o(62826),n=o(5124),a=o(22441),r=o(6412),s=o(14503),l=o(27330);const d={passive:!0};class c extends l.L{_isPaneHeader(){return this.pane}_renderContent(){return n.qy` <div class="${(0,r.H)({"top-app-bar-fixed-adjust":!0,"top-app-bar-fixed-adjust--pane":this.pane})}"> ${this.pane?n.qy`<div class="pane"> <div class="shadow-container"></div> <div class="ha-scrollbar"> <slot name="pane"></slot> </div> ${this.footer?n.qy`<div class="footer"> <slot name="pane-footer"></slot> </div>`:n.s6} </div>`:n.s6} <div class="main"> ${this.pane?n.qy`<div class="shadow-container"></div>`:n.s6} <div class="content"> <slot></slot> </div> </div> </div> `}willUpdate(e){super.willUpdate(e),e.has("pane")&&this.hasUpdated&&this._unregisterListeners()}updated(e){super.updated(e),e.has("pane")&&void 0!==e.get("pane")&&(this._registerListeners(),this._syncScrollState())}_registerListeners(){if(this.pane)return this._paneElement?.addEventListener("scroll",this._handlePaneScroll,d),void this._contentElement?.addEventListener("scroll",this._handlePaneScroll,d);super._registerListeners()}_unregisterListeners(){this._paneElement?.removeEventListener("scroll",this._handlePaneScroll),this._contentElement?.removeEventListener("scroll",this._handlePaneScroll),super._unregisterListeners()}constructor(...e){super(...e),this.pane=!1,this.footer=!1,this._handlePaneScroll=e=>{const t=e.currentTarget;t.parentElement?.classList.toggle("scrolled",t.scrollTop>0)}}}c.styles=[l.p,s.dp,n.AH`.shadow-container{position:absolute;top:calc(-1 * var(--header-height));width:100%;height:var(--header-height);z-index:1;transition:box-shadow .2s linear}.scrolled .shadow-container{box-shadow:var(--ha-box-shadow-m)}#title{border-right:1px solid rgba(255,255,255,.12);border-inline-end:1px solid rgba(255,255,255,0.12);border-inline-start:initial;box-sizing:border-box;flex:0 0 var(--sidepane-width,250px);width:var(--sidepane-width,250px)}.top-app-bar-fixed-adjust--pane{display:flex;height:calc(100vh - var(--header-height,0px) - var(--safe-area-inset-top,0px) - var(--safe-area-inset-bottom,0px))}.pane{border-right:1px solid var(--divider-color);border-inline-end:1px solid var(--divider-color);border-inline-start:initial;box-sizing:border-box;display:flex;flex:0 0 var(--sidepane-width,250px);width:var(--sidepane-width,250px);flex-direction:column;position:relative}.pane .ha-scrollbar{flex:1}.pane .footer{border-top:1px solid var(--divider-color);padding-bottom:8px}.main{min-height:100%}.top-app-bar-fixed-adjust--pane .main{position:relative;flex:1;height:100%}.top-app-bar-fixed-adjust--pane .content{height:100%;overflow:auto}`],(0,i.Cg)([(0,a.MZ)({type:Boolean})],c.prototype,"pane",void 0),(0,i.Cg)([(0,a.MZ)({type:Boolean})],c.prototype,"footer",void 0),(0,i.Cg)([(0,a.P)(".content")],c.prototype,"_contentElement",void 0),(0,i.Cg)([(0,a.P)(".pane .ha-scrollbar")],c.prototype,"_paneElement",void 0),c=(0,i.Cg)([(0,a.EM)("ha-two-pane-top-app-bar-fixed")],c)},26571(e,t,o){o.d(t,{Al:()=>a,KY:()=>n,PN:()=>l,dG:()=>c,jm:()=>d,m7:()=>f,sR:()=>p,t1:()=>s,t2:()=>m,x:()=>g,yu:()=>h});var i=o(95350);const n=["bluetooth","dhcp","discovery","esphome","hardware","hassio","homekit","integration_discovery","mqtt","ssdp","unignore","usb","zeroconf"],a=["reauth"],r={"HA-Frontend-Base":`${location.protocol}//${location.host}`},s=(e,t,o)=>e.callApi("POST","config/config_entries/flow",{handler:t,entry_id:o},r),l=(e,t)=>e.callApi("GET",`config/config_entries/flow/${t}`,void 0,r),d=(e,t,o)=>e.callApi("POST",`config/config_entries/flow/${t}`,o,r),c=(e,t,o)=>e.callWS({type:"config_entries/ignore_flow",flow_id:t,title:o}),p=(e,t)=>e.callApi("DELETE",`config/config_entries/flow/${t}`),h=(e,t)=>e.callApi("GET","config/config_entries/flow_handlers"+(t?`?type=${t}`:"")),m=e=>e.sendMessagePromise({type:"config_entries/flow/progress"}),g=(e,t)=>e.connection.subscribeMessage(e=>t(e),{type:"config_entries/flow/subscribe"}),f=(e,t)=>t.context.title_placeholders&&0!==Object.keys(t.context.title_placeholders).length?e(`component.${t.handler}.config.flow_title`,t.context.title_placeholders)||("name"in t.context.title_placeholders?t.context.title_placeholders.name:(0,i.p$)(e,t.handler)):(0,i.p$)(e,t.handler)},77763(e,t,o){o.d(t,{W:()=>s});var i=o(5124),n=o(26571),a=o(95350),r=o(29094);const s=(e,t)=>(0,r.g)(e,t,{flowType:"config_flow",showDevices:!0,createFlow:async(e,o)=>{const[i]=await Promise.all([(0,n.t1)(e,o,t.entryId),e.loadFragmentTranslation("config"),e.loadBackendTranslation("config",o),e.loadBackendTranslation("selector",o),e.loadBackendTranslation("title",o)]);return i},fetchFlow:async(e,t)=>{const[o]=await Promise.all([(0,n.PN)(e,t),e.loadFragmentTranslation("config")]);return await Promise.all([e.loadBackendTranslation("config",o.handler),e.loadBackendTranslation("selector",o.handler),e.loadBackendTranslation("title",o.handler)]),o},handleFlowStep:n.jm,deleteFlow:n.sR,renderAbortDescription(e,t){const o=e.localize(`component.${t.translation_domain||t.handler}.config.abort.${t.reason}`,t.description_placeholders);return o?i.qy` <ha-markdown allow-svg breaks .content="${o}"></ha-markdown> `:t.reason},renderShowFormStepHeader:(e,t)=>e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.title`,t.description_placeholders)||e.localize(`component.${t.handler}.title`),renderShowFormStepDescription(e,t){const o=e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.description`,t.description_placeholders);return o?i.qy` <ha-markdown .allowDataUrl="${"zwave_js"===t.handler}" allow-svg breaks .content="${o}"></ha-markdown> `:""},renderShowFormStepFieldLabel(e,t,o,i){if("expandable"===o.type)return e.localize(`component.${t.handler}.config.step.${t.step_id}.sections.${o.name}.name`,t.description_placeholders)||o.name;const n=i?.path?.[0]?`sections.${i.path[0]}.`:"";return e.localize(`component.${t.handler}.config.step.${t.step_id}.${n}data.${o.name}`,t.description_placeholders)||o.name},renderShowFormStepFieldHelper(e,t,o,n){if("expandable"===o.type)return e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.sections.${o.name}.description`,t.description_placeholders);const a=n?.path?.[0]?`sections.${n.path[0]}.`:"",r=e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.${a}data_description.${o.name}`,t.description_placeholders);return r?i.qy`<ha-markdown breaks .content="${r}"></ha-markdown>`:""},renderShowFormStepFieldError:(e,t,o)=>e.localize(`component.${t.translation_domain||t.translation_domain||t.handler}.config.error.${o}`,t.description_placeholders)||o,renderShowFormStepFieldLocalizeValue:(e,t,o)=>e.localize(`component.${t.handler}.selector.${o}`),renderShowFormStepSubmitButton:(e,t)=>e.localize(`component.${t.handler}.config.step.${t.step_id}.submit`)||e.localize("ui.panel.config.integrations.config_flow."+(!1===t.last_step?"next":"submit")),renderExternalStepHeader:(e,t)=>e.localize(`component.${t.handler}.config.step.${t.step_id}.title`)||e.localize("ui.panel.config.integrations.config_flow.external_step.open_site"),renderExternalStepDescription(e,t){const o=e.localize(`component.${t.translation_domain||t.handler}.config.${t.step_id}.description`,t.description_placeholders);return i.qy` <p> ${e.localize("ui.panel.config.integrations.config_flow.external_step.description")} </p> ${o?i.qy` <ha-markdown allow-svg breaks .content="${o}"></ha-markdown> `:""} `},renderCreateEntryDescription(e,t){const o=e.localize(`component.${t.translation_domain||t.handler}.config.create_entry.${t.description||"default"}`,t.description_placeholders);return i.qy` ${o?i.qy` <ha-markdown allow-svg breaks .content="${o}"></ha-markdown> `:i.s6} `},renderShowFormProgressHeader:(e,t)=>e.localize(`component.${t.handler}.config.step.${t.step_id}.title`)||e.localize(`component.${t.handler}.title`),renderShowFormProgressDescription(e,t){const o=e.localize(`component.${t.translation_domain||t.handler}.config.progress.${t.progress_action}`,t.description_placeholders);return o?i.qy` <ha-markdown allow-svg breaks .content="${o}"></ha-markdown> `:""},renderMenuHeader:(e,t)=>e.localize(`component.${t.handler}.config.step.${t.step_id}.title`)||e.localize(`component.${t.handler}.title`),renderMenuDescription(e,t){const o=e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.description`,t.description_placeholders);return o?i.qy` <ha-markdown allow-svg breaks .content="${o}"></ha-markdown> `:""},renderMenuOption:(e,t,o)=>e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.menu_options.${o}`,t.description_placeholders),renderMenuOptionDescription:(e,t,o)=>e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.menu_option_descriptions.${o}`,t.description_placeholders),renderLoadingDescription(e,t,o,i){if("loading_flow"!==t&&"loading_step"!==t)return"";const n=i?.handler||o;return e.localize(`ui.panel.config.integrations.config_flow.loading.${t}`,{integration:n?(0,a.p$)(e.localize,n):e.localize("ui.panel.config.integrations.config_flow.loading.fallback_title")})}})},29094(e,t,o){o.d(t,{g:()=>a});var i=o(1087);const n=()=>Promise.all([o.e(4801),o.e(39763),o.e(32450),o.e(46095),o.e(7305),o.e(92769),o.e(3283),o.e(80131),o.e(58416),o.e(54066),o.e(84038),o.e(69205),o.e(26092),o.e(48531),o.e(92411),o.e(44642)]).then(o.bind(o,78314)),a=(e,t,o)=>{(0,i.r)(e,"show-dialog",{dialogTag:"dialog-data-entry-flow",dialogImport:n,dialogParams:{...t,flowConfig:o,dialogParentElement:e}})}}};