iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
24 lines (20 loc) • 7.97 kB
JavaScript
/*! For license information please see chunk.cc2c9486ca171e982123.js.LICENSE.txt */
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[782,1823],{18601:(e,t,n)=>{"use strict";n.d(t,{qN:()=>s.q,Wg:()=>i});var s=n(78220);class i extends s.H{createRenderRoot(){return this.attachShadow({mode:"open",delegatesFocus:!0})}click(){this.formElement&&(this.formElement.focus(),this.formElement.click())}setAriaLabel(e){this.formElement&&this.formElement.setAttribute("aria-label",e)}firstUpdated(){super.firstUpdated(),this.mdcRoot.addEventListener("change",(e=>{this.dispatchEvent(new Event("change",e))}))}}},63207:(e,t,n)=>{"use strict";n(65660),n(15112);var s=n(9672),i=n(87156),r=n(50856),a=n(43437);(0,s.k)({_template:r.d`
<style>
:host {
--layout-inline;
--layout-center-center;
position: relative;
vertical-align: middle;
fill: var(--iron-icon-fill-color, currentcolor);
stroke: var(--iron-icon-stroke-color, none);
width: var(--iron-icon-width, 24px);
height: var(--iron-icon-height, 24px);
--iron-icon;
}
:host([hidden]) {
display: none;
}
</style>
`,is:"iron-icon",properties:{icon:{type:String},theme:{type:String},src:{type:String},_meta:{value:a.XY.create("iron-meta",{type:"iconset"})}},observers:["_updateIcon(_meta, isAttached)","_updateIcon(theme, isAttached)","_srcChanged(src, isAttached)","_iconChanged(icon, isAttached)"],_DEFAULT_ICONSET:"icons",_iconChanged:function(e){var t=(e||"").split(":");this._iconName=t.pop(),this._iconsetName=t.pop()||this._DEFAULT_ICONSET,this._updateIcon()},_srcChanged:function(e){this._updateIcon()},_usesIconset:function(){return this.icon||!this.src},_updateIcon:function(){this._usesIconset()?(this._img&&this._img.parentNode&&(0,i.vz)(this.root).removeChild(this._img),""===this._iconName?this._iconset&&this._iconset.removeIcon(this):this._iconsetName&&this._meta&&(this._iconset=this._meta.byKey(this._iconsetName),this._iconset?(this._iconset.applyIcon(this,this._iconName,this.theme),this.unlisten(window,"iron-iconset-added","_updateIcon")):this.listen(window,"iron-iconset-added","_updateIcon"))):(this._iconset&&this._iconset.removeIcon(this),this._img||(this._img=document.createElement("img"),this._img.style.width="100%",this._img.style.height="100%",this._img.draggable=!1),this._img.src=this.src,(0,i.vz)(this.root).appendChild(this._img))}})},15112:(e,t,n)=>{"use strict";n.d(t,{P:()=>i});n(43437);var s=n(9672);class i{constructor(e){i[" "](e),this.type=e&&e.type||"default",this.key=e&&e.key,e&&"value"in e&&(this.value=e.value)}get value(){var e=this.type,t=this.key;if(e&&t)return i.types[e]&&i.types[e][t]}set value(e){var t=this.type,n=this.key;t&&n&&(t=i.types[t]=i.types[t]||{},null==e?delete t[n]:t[n]=e)}get list(){if(this.type){var e=i.types[this.type];return e?Object.keys(e).map((function(e){return r[this.type][e]}),this):[]}}byKey(e){return this.key=e,this.value}}i[" "]=function(){},i.types={};var r=i.types;(0,s.k)({is:"iron-meta",properties:{type:{type:String,value:"default"},key:{type:String},value:{type:String,notify:!0},self:{type:Boolean,observer:"_selfChanged"},__meta:{type:Boolean,computed:"__computeMeta(type, key, value)"}},hostAttributes:{hidden:!0},__computeMeta:function(e,t,n){var s=new i({type:e,key:t});return void 0!==n&&n!==s.value?s.value=n:this.value!==s.value&&(this.value=s.value),s},get list(){return this.__meta&&this.__meta.list},_selfChanged:function(e){e&&(this.value=this)},byKey:function(e){return new i({type:this.type,key:e}).value}})},91107:(e,t,n)=>{"use strict";n.d(t,{Ud:()=>l});const s=Symbol("Comlink.proxy"),i=Symbol("Comlink.endpoint"),r=Symbol("Comlink.releaseProxy"),a=Symbol("Comlink.thrown"),o=e=>"object"==typeof e&&null!==e||"function"==typeof e,c=new Map([["proxy",{canHandle:e=>o(e)&&e[s],serialize(e){const{port1:t,port2:n}=new MessageChannel;return u(e,t),[n,[n]]},deserialize:e=>(e.start(),l(e))}],["throw",{canHandle:e=>o(e)&&a in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function u(e,t=self){t.addEventListener("message",(function n(i){if(!i||!i.data)return;const{id:r,type:o,path:c}=Object.assign({path:[]},i.data),l=(i.data.argumentList||[]).map(g);let p;try{const t=c.slice(0,-1).reduce(((e,t)=>e[t]),e),n=c.reduce(((e,t)=>e[t]),e);switch(o){case 0:p=n;break;case 1:t[c.slice(-1)[0]]=g(i.data.value),p=!0;break;case 2:p=n.apply(t,l);break;case 3:p=function(e){return Object.assign(e,{[s]:!0})}(new n(...l));break;case 4:{const{port1:t,port2:n}=new MessageChannel;u(e,n),p=function(e,t){return y.set(e,t),e}(t,[t])}break;case 5:p=void 0}}catch(d){p={value:d,[a]:0}}Promise.resolve(p).catch((e=>({value:e,[a]:0}))).then((e=>{const[s,i]=f(e);t.postMessage(Object.assign(Object.assign({},s),{id:r}),i),5===o&&(t.removeEventListener("message",n),h(t))}))})),t.start&&t.start()}function h(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function l(e,t){return d(e,[],t)}function p(e){if(e)throw new Error("Proxy has been released and is not useable")}function d(e,t=[],n=function(){}){let s=!1;const a=new Proxy(n,{get(n,i){if(p(s),i===r)return()=>v(e,{type:5,path:t.map((e=>e.toString()))}).then((()=>{h(e),s=!0}));if("then"===i){if(0===t.length)return{then:()=>a};const n=v(e,{type:0,path:t.map((e=>e.toString()))}).then(g);return n.then.bind(n)}return d(e,[...t,i])},set(n,i,r){p(s);const[a,o]=f(r);return v(e,{type:1,path:[...t,i].map((e=>e.toString())),value:a},o).then(g)},apply(n,r,a){p(s);const o=t[t.length-1];if(o===i)return v(e,{type:4}).then(g);if("bind"===o)return d(e,t.slice(0,-1));const[c,u]=m(a);return v(e,{type:2,path:t.map((e=>e.toString())),argumentList:c},u).then(g)},construct(n,i){p(s);const[r,a]=m(i);return v(e,{type:3,path:t.map((e=>e.toString())),argumentList:r},a).then(g)}});return a}function m(e){const t=e.map(f);return[t.map((e=>e[0])),(n=t.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}const y=new WeakMap;function f(e){for(const[t,n]of c)if(n.canHandle(e)){const[s,i]=n.serialize(e);return[{type:3,name:t,value:s},i]}return[{type:0,value:e},y.get(e)||[]]}function g(e){switch(e.type){case 3:return c.get(e.name).deserialize(e.value);case 0:return e.value}}function v(e,t,n){return new Promise((s=>{const i=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");e.addEventListener("message",(function t(n){n.data&&n.data.id&&n.data.id===i&&(e.removeEventListener("message",t),s(n.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:i},t),n)}))}},3239:(e,t,n)=>{"use strict";function s(e){if(!e||"object"!=typeof e)return e;if("[object Date]"==Object.prototype.toString.call(e))return new Date(e.getTime());if(Array.isArray(e))return e.map(s);var t={};return Object.keys(e).forEach((function(n){t[n]=s(e[n])})),t}n.d(t,{Z:()=>s})},58993:(e,t,n)=>{"use strict";n.d(t,{yh:()=>s,U2:()=>a,t8:()=>o,ZH:()=>c});class s{constructor(e="keyval-store",t="keyval"){this.storeName=t,this._dbp=new Promise(((n,s)=>{const i=indexedDB.open(e,1);i.onerror=()=>s(i.error),i.onsuccess=()=>n(i.result),i.onupgradeneeded=()=>{i.result.createObjectStore(t)}}))}_withIDBStore(e,t){return this._dbp.then((n=>new Promise(((s,i)=>{const r=n.transaction(this.storeName,e);r.oncomplete=()=>s(),r.onabort=r.onerror=()=>i(r.error),t(r.objectStore(this.storeName))}))))}}let i;function r(){return i||(i=new s),i}function a(e,t=r()){let n;return t._withIDBStore("readonly",(t=>{n=t.get(e)})).then((()=>n.result))}function o(e,t,n=r()){return n._withIDBStore("readwrite",(n=>{n.put(t,e)}))}function c(e=r()){return e._withIDBStore("readwrite",(e=>{e.clear()}))}}}]);
//# sourceMappingURL=chunk.cc2c9486ca171e982123.js.map