iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 21 kB
JavaScript
;(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["13197"],{46467:function(e,t,a){a.a(e,(async function(e,i){try{a.d(t,{D_:()=>$,NC:()=>y,Nh:()=>g,U8:()=>M,WB:()=>h,mn:()=>f,p6:()=>c,ud:()=>b,yQ:()=>_});a(63434),a(9359),a(1331),a(96829);var n=a(16485),o=a(27486),d=a(20382),s=a(11104),r=e([n,s]);[n,s]=r.then?(await r)():r;(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"long",month:"long",day:"numeric",timeZone:(0,s.f)(e.time_zone,t)})));const c=(e,t,a)=>l(t,a.time_zone).format(e),l=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",timeZone:(0,s.f)(e.time_zone,t)}))),f=(e,t,a)=>u(t,a.time_zone).format(e),u=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"short",day:"numeric",timeZone:(0,s.f)(e.time_zone,t)}))),h=(e,t,a)=>{var i,n,o,s;const r=m(t,a.time_zone);if(t.date_format===d.t6.language||t.date_format===d.t6.system)return r.format(e);const c=r.formatToParts(e),l=null===(i=c.find((e=>"literal"===e.type)))||void 0===i?void 0:i.value,f=null===(n=c.find((e=>"day"===e.type)))||void 0===n?void 0:n.value,u=null===(o=c.find((e=>"month"===e.type)))||void 0===o?void 0:o.value,h=null===(s=c.find((e=>"year"===e.type)))||void 0===s?void 0:s.value,b=c.at(c.length-1);let v="literal"===(null==b?void 0:b.type)?null==b?void 0:b.value:"";"bg"===t.language&&t.date_format===d.t6.YMD&&(v="");return{[d.t6.DMY]:`${f}${l}${u}${l}${h}${v}`,[d.t6.MDY]:`${u}${l}${f}${l}${h}${v}`,[d.t6.YMD]:`${h}${l}${u}${l}${f}${v}`}[t.date_format]},m=(0,o.Z)(((e,t)=>{const a=e.date_format===d.t6.system?void 0:e.language;return e.date_format===d.t6.language||(e.date_format,d.t6.system),new Intl.DateTimeFormat(a,{year:"numeric",month:"numeric",day:"numeric",timeZone:(0,s.f)(e.time_zone,t)})})),b=(e,t,a)=>v(t,a.time_zone).format(e),v=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{day:"numeric",month:"short",timeZone:(0,s.f)(e.time_zone,t)}))),y=(e,t,a)=>k(t,a.time_zone).format(e),k=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{month:"long",year:"numeric",timeZone:(0,s.f)(e.time_zone,t)}))),g=(e,t,a)=>p(t,a.time_zone).format(e),p=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{month:"long",timeZone:(0,s.f)(e.time_zone,t)}))),_=(e,t,a)=>w(t,a.time_zone).format(e),w=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",timeZone:(0,s.f)(e.time_zone,t)}))),$=(e,t,a)=>z(t,a.time_zone).format(e),z=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"long",timeZone:(0,s.f)(e.time_zone,t)}))),M=(e,t,a)=>Z(t,a.time_zone).format(e),Z=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"short",timeZone:(0,s.f)(e.time_zone,t)})));i()}catch(c){i(c)}}))},33570:function(e,t,a){a.a(e,(async function(e,i){try{a.d(t,{Vu:()=>f,Zs:()=>b,mr:()=>c,xO:()=>h});var n=a(16485),o=a(27486),d=a(11104),s=a(16922),r=e([n,d]);[n,d]=r.then?(await r)():r;const c=(e,t,a)=>l(t,a.time_zone).format(e),l=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{hour:"numeric",minute:"2-digit",hourCycle:(0,s.y)(e)?"h12":"h23",timeZone:(0,d.f)(e.time_zone,t)}))),f=(e,t,a)=>u(t,a.time_zone).format(e),u=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{hour:(0,s.y)(e)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,s.y)(e)?"h12":"h23",timeZone:(0,d.f)(e.time_zone,t)}))),h=(e,t,a)=>m(t,a.time_zone).format(e),m=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"long",hour:(0,s.y)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,s.y)(e)?"h12":"h23",timeZone:(0,d.f)(e.time_zone,t)}))),b=(e,t,a)=>v(t,a.time_zone).format(e),v=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat("en-GB",{hour:"numeric",minute:"2-digit",hour12:!1,timeZone:(0,d.f)(e.time_zone,t)})));i()}catch(c){i(c)}}))},16922:function(e,t,a){a.d(t,{y:()=>o});a(19083),a(61006);var i=a(27486),n=a(20382);const o=(0,i.Z)((e=>{if(e.time_format===n.zt.language||e.time_format===n.zt.system){const t=e.time_format===n.zt.language?e.language:void 0;return new Date("January 1, 2023 22:00:00").toLocaleString(t).includes("10")}return e.time_format===n.zt.am_pm}))},34618:function(e,t,a){a.d(t,{N:()=>i});const i=(e,t=2)=>Math.round(e*10**t)/10**t},65981:function(e,t,a){a.r(t),a.d(t,{HaIcon:()=>M});var i=a(61701),n=a(72621),o=(a(19083),a(71695),a(40251),a(61006),a(47021),a(57243)),d=a(50778),s=a(36522),r=a(22381),c=a(80654),l=(a(92745),a(9359),a(31526),a(27608)),f=a(27486),u=a(37394);const h=JSON.parse('{"version":"7.4.47","parts":[{"file":"7a7139d465f1f41cb26ab851a17caa21a9331234"},{"start":"account-supervisor-circle-","file":"9561286c4c1021d46b9006596812178190a7cc1c"},{"start":"alpha-r-c","file":"eb466b7087fb2b4d23376ea9bc86693c45c500fa"},{"start":"arrow-decision-o","file":"4b3c01b7e0723b702940c5ac46fb9e555646972b"},{"start":"baby-f","file":"2611401d85450b95ab448ad1d02c1a432b409ed2"},{"start":"battery-hi","file":"89bcd31855b34cd9d31ac693fb073277e74f1f6a"},{"start":"blur-r","file":"373709cd5d7e688c2addc9a6c5d26c2d57c02c48"},{"start":"briefcase-account-","file":"a75956cf812ee90ee4f656274426aafac81e1053"},{"start":"calendar-question-","file":"3253f2529b5ebdd110b411917bacfacb5b7063e6"},{"start":"car-lig","file":"74566af3501ad6ae58ad13a8b6921b3cc2ef879d"},{"start":"cellphone-co","file":"7677f1cfb2dd4f5562a2aa6d3ae43a2e6997b21a"},{"start":"circle-slice-2","file":"70d08c50ec4522dd75d11338db57846588263ee2"},{"start":"cloud-co","file":"141d2bfa55ca4c83f4bae2812a5da59a84fec4ff"},{"start":"cog-s","file":"5a640365f8e47c609005d5e098e0e8104286d120"},{"start":"cookie-l","file":"dd85b8eb8581b176d3acf75d1bd82e61ca1ba2fc"},{"start":"currency-eur-","file":"15362279f4ebfc3620ae55f79d2830ad86d5213e"},{"start":"delete-o","file":"239434ab8df61237277d7599ebe066c55806c274"},{"start":"draw-","file":"5605918a592070803ba2ad05a5aba06263da0d70"},{"start":"emoticon-po","file":"a838cfcec34323946237a9f18e66945f55260f78"},{"start":"fan","file":"effd56103b37a8c7f332e22de8e4d67a69b70db7"},{"start":"file-question-","file":"b2424b50bd465ae192593f1c3d086c5eec893af8"},{"start":"flask-off-","file":"3b76295cde006a18f0301dd98eed8c57e1d5a425"},{"start":"food-s","file":"1c6941474cbeb1755faaaf5771440577f4f1f9c6"},{"start":"gamepad-u","file":"c6efe18db6bc9654ae3540c7dee83218a5450263"},{"start":"google-f","file":"df341afe6ad4437457cf188499cb8d2df8ac7b9e"},{"start":"head-c","file":"282121c9e45ed67f033edcc1eafd279334c00f46"},{"start":"home-pl","file":"27e8e38fc7adcacf2a210802f27d841b49c8c508"},{"start":"inbox-","file":"0f0316ec7b1b7f7ce3eaabce26c9ef619b5a1694"},{"start":"key-v","file":"ea33462be7b953ff1eafc5dac2d166b210685a60"},{"start":"leaf-circle-","file":"33db9bbd66ce48a2db3e987fdbd37fb0482145a4"},{"start":"lock-p","file":"b89e27ed39e9d10c44259362a4b57f3c579d3ec8"},{"start":"message-s","file":"7b5ab5a5cadbe06e3113ec148f044aa701eac53a"},{"start":"moti","file":"01024d78c248d36805b565e343dd98033cc3bcaf"},{"start":"newspaper-variant-o","file":"22a6ec4a4fdd0a7c0acaf805f6127b38723c9189"},{"start":"on","file":"c73d55b412f394e64632e2011a59aa05e5a1f50d"},{"start":"paw-ou","file":"3f669bf26d16752dc4a9ea349492df93a13dcfbf"},{"start":"pigg","file":"0c24edb27eb1c90b6e33fc05f34ef3118fa94256"},{"start":"printer-pos-sy","file":"41a55cda866f90b99a64395c3bb18c14983dcf0a"},{"start":"read","file":"c7ed91552a3a64c9be88c85e807404cf705b7edf"},{"start":"robot-vacuum-variant-o","file":"917d2a35d7268c0ea9ad9ecab2778060e19d90e0"},{"start":"sees","file":"6e82d9861d8fac30102bafa212021b819f303bdb"},{"start":"shoe-f","file":"e2fe7ce02b5472301418cc90a0e631f187b9f238"},{"start":"snowflake-m","file":"a28ba9f5309090c8b49a27ca20ff582a944f6e71"},{"start":"st","file":"7e92d03f095ec27e137b708b879dfd273bd735ab"},{"start":"su","file":"61c74913720f9de59a379bdca37f1d2f0dc1f9db"},{"start":"tag-plus-","file":"8f3184156a4f38549cf4c4fffba73a6a941166ae"},{"start":"timer-a","file":"baab470d11cfb3a3cd3b063ee6503a77d12a80d0"},{"start":"transit-d","file":"8561c0d9b1ac03fab360fd8fe9729c96e8693239"},{"start":"vector-arrange-b","file":"c9a3439257d4bab33d3355f1f2e11842e8171141"},{"start":"water-ou","file":"02dbccfb8ca35f39b99f5a085b095fc1275005a0"},{"start":"webc","file":"57bafd4b97341f4f2ac20a609d023719f23a619c"},{"start":"zip","file":"65ae094e8263236fa50486584a08c03497a38d93"}]}'),m=(0,f.Z)((async()=>{const e=(0,l.MT)("hass-icon-db","mdi-icon-store");{const t=await(0,l.U2)("_version",e);t?t!==h.version&&(await(0,l.ZH)(e),(0,l.t8)("_version",h.version,e)):(0,l.t8)("_version",h.version,e)}return e})),b=["mdi","hass","hassio","hademo"];let v=[];a(37583);let y,k,g,p=e=>e;const _={},w={},$=(0,r.D)((()=>(async e=>{const t=Object.keys(e),a=await Promise.all(Object.values(e));(await m())("readwrite",(i=>{a.forEach(((a,n)=>{Object.entries(a).forEach((([e,t])=>{i.put(t,e)})),delete e[t[n]]}))}))})(w)),2e3),z={};let M=(0,i.Z)([(0,d.Mo)("ha-icon")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)()],key:"icon",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_path",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_secondaryPath",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_viewBox",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_legacy",value(){return!1}},{kind:"method",key:"willUpdate",value:function(e){(0,n.Z)(i,"willUpdate",this,3)([e]),e.has("icon")&&(this._path=void 0,this._secondaryPath=void 0,this._viewBox=void 0,this._loadIcon())}},{kind:"method",key:"render",value:function(){return this.icon?this._legacy?(0,o.dy)(y||(y=p` <iron-icon .icon="${0}"></iron-icon>`),this.icon):(0,o.dy)(k||(k=p`<ha-svg-icon .path="${0}" .secondaryPath="${0}" .viewBox="${0}"></ha-svg-icon>`),this._path,this._secondaryPath,this._viewBox):o.Ld}},{kind:"method",key:"_loadIcon",value:async function(){if(!this.icon)return;const e=this.icon,[t,i]=this.icon.split(":",2);let n,o=i;if(!t||!o)return;if(!b.includes(t)){const a=c.g[t];return a?void(a&&"function"==typeof a.getIcon&&this._setCustomPath(a.getIcon(o),e)):void(this._legacy=!0)}if(this._legacy=!1,o in _){const e=_[o];let a;e.newName?(a=`Icon ${t}:${o} was renamed to ${t}:${e.newName}, please change your config, it will be removed in version ${e.removeIn}.`,o=e.newName):a=`Icon ${t}:${o} was removed from MDI, please replace this icon with an other icon in your config, it will be removed in version ${e.removeIn}.`,console.warn(a),(0,s.B)(this,"write_log",{level:"warning",message:a})}if(o in z)return void(this._path=z[o]);if("home-assistant"===o){const t=(await a.e("48348").then(a.bind(a,30511))).mdiHomeAssistant;return this.icon===e&&(this._path=t),void(z[o]=t)}try{n=await(e=>new Promise(((t,a)=>{if(v.push([e,t,a]),v.length>1)return;const i=m();(0,u.n)(1e3,(async()=>{(await i)("readonly",(e=>{for(const[t,a,i]of v)(0,l.RV)(e.get(t)).then((e=>a(e))).catch((e=>i(e)));v=[]}))})()).catch((e=>{for(const[,,t]of v)t(e);v=[]}))})))(o)}catch(f){n=void 0}if(n)return this.icon===e&&(this._path=n),void(z[o]=n);const d=(e=>{let t;for(const a of h.parts){if(void 0!==a.start&&e<a.start)break;t=a}return t.file})(o);if(d in w)return void this._setPath(w[d],o,e);const r=fetch(`/static/mdi/${d}.json`).then((e=>e.json()));w[d]=r,this._setPath(r,o,e),$()}},{kind:"method",key:"_setCustomPath",value:async function(e,t){const a=await e;this.icon===t&&(this._path=a.path,this._secondaryPath=a.secondaryPath,this._viewBox=a.viewBox)}},{kind:"method",key:"_setPath",value:async function(e,t,a){const i=await e;this.icon===a&&(this._path=i[t]),z[t]=i[t]}},{kind:"field",static:!0,key:"styles",value(){return(0,o.iv)(g||(g=p`:host{fill:currentcolor}`))}}]}}),o.oi)},34363:function(e,t,a){var i=a(61701),n=(a(71695),a(47021),a(57243)),o=a(50778);let d,s,r=e=>e;(0,i.Z)([(0,o.Mo)("ha-input-helper-text")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"method",key:"render",value:function(){return(0,n.dy)(d||(d=r`<slot></slot>`))}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(s||(s=r`:host{display:block;color:var(--mdc-text-field-label-ink-color,rgba(0,0,0,.6));font-size:.75rem;padding-left:16px;padding-right:16px;padding-inline-start:16px;padding-inline-end:16px}`))}}]}}),n.oi)},51223:function(e,t,a){a.a(e,(async function(e,t){try{var i=a(61701),n=(a(71695),a(47021),a(57243)),o=a(50778),d=a(94571),s=a(59847),r=a(45729),c=(a(65981),a(37583),e([r]));r=(c.then?(await c)():c)[0];let l,f,u,h,m=e=>e;(0,i.Z)([(0,o.Mo)("ha-state-icon")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"stateObj",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"stateValue",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"icon",value:void 0},{kind:"method",key:"render",value:function(){var e,t;const a=this.icon||this.stateObj&&(null===(e=this.hass)||void 0===e||null===(e=e.entities[this.stateObj.entity_id])||void 0===e?void 0:e.icon)||(null===(t=this.stateObj)||void 0===t?void 0:t.attributes.icon);if(a)return(0,n.dy)(l||(l=m`<ha-icon .icon="${0}"></ha-icon>`),a);if(!this.stateObj)return n.Ld;if(!this.hass)return this._renderFallback();const i=(0,r.gD)(this.hass,this.stateObj,this.stateValue).then((e=>e?(0,n.dy)(f||(f=m`<ha-icon .icon="${0}"></ha-icon>`),e):this._renderFallback()));return(0,n.dy)(u||(u=m`${0}`),(0,d.C)(i))}},{kind:"method",key:"_renderFallback",value:function(){const e=(0,s.N)(this.stateObj);return(0,n.dy)(h||(h=m` <ha-svg-icon .path="${0}"></ha-svg-icon> `),r.Ls[e]||r.Rb)}}]}}),n.oi);t()}catch(l){t(l)}}))},5346:function(e,t,a){a.a(e,(async function(e,t){try{var i=a(61701),n=a(72621),o=(a(71695),a(92745),a(9359),a(56475),a(31526),a(70104),a(40251),a(47021),a(57243)),d=a(50778),s=a(27486),r=a(36522),c=(a(34363),a(65986)),l=e([c]);c=(l.then?(await l)():l)[0];let f,u,h,m=e=>e;(0,i.Z)([(0,d.Mo)("ha-locations-editor")],(function(e,t){class i extends t{constructor(){super(),e(this),this._loadPromise=Promise.resolve().then(a.t.bind(a,94010,23)).then((e=>a.e("76090").then(a.t.bind(a,39135,23)).then((()=>(this.Leaflet=e.default,this._updateMarkers(),this.updateComplete.then((()=>this.fitMap())))))))}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"locations",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:"auto-fit",type:Boolean})],key:"autoFit",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({type:Number})],key:"zoom",value(){return 16}},{kind:"field",decorators:[(0,d.Cb)({attribute:"theme-mode",type:String})],key:"themeMode",value(){return"auto"}},{kind:"field",decorators:[(0,d.Cb)({type:Boolean,attribute:"pin-on-click"})],key:"pinOnClick",value(){return!1}},{kind:"field",decorators:[(0,d.SB)()],key:"_locationMarkers",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_circles",value(){return{}}},{kind:"field",decorators:[(0,d.IO)("ha-map",!0)],key:"map",value:void 0},{kind:"field",key:"Leaflet",value:void 0},{kind:"field",key:"_loadPromise",value:void 0},{kind:"method",key:"fitMap",value:function(e){this.map.fitMap(e)}},{kind:"method",key:"fitBounds",value:function(e,t){this.map.fitBounds(e,t)}},{kind:"method",key:"fitMarker",value:async function(e,t){if(this.Leaflet||await this._loadPromise,!this.map.leafletMap||!this._locationMarkers)return;const a=this._locationMarkers[e];if(a)if("getBounds"in a)this.map.leafletMap.fitBounds(a.getBounds()),a.bringToFront();else{const i=this._circles[e];i?this.map.leafletMap.fitBounds(i.getBounds()):this.map.leafletMap.setView(a.getLatLng(),(null==t?void 0:t.zoom)||this.zoom)}}},{kind:"method",key:"render",value:function(){return(0,o.dy)(f||(f=m` <ha-map .hass="${0}" .layers="${0}" .zoom="${0}" .autoFit="${0}" .themeMode="${0}" .clickable="${0}" @map-clicked="${0}"></ha-map> ${0} `),this.hass,this._getLayers(this._circles,this._locationMarkers),this.zoom,this.autoFit,this.themeMode,this.pinOnClick,this._mapClicked,this.helper?(0,o.dy)(u||(u=m`<ha-input-helper-text>${0}</ha-input-helper-text>`),this.helper):"")}},{kind:"field",key:"_getLayers",value(){return(0,s.Z)(((e,t)=>{const a=[];return Array.prototype.push.apply(a,Object.values(e)),t&&Array.prototype.push.apply(a,Object.values(t)),a}))}},{kind:"method",key:"willUpdate",value:function(e){(0,n.Z)(i,"willUpdate",this,3)([e]),this.Leaflet&&e.has("locations")&&this._updateMarkers()}},{kind:"method",key:"updated",value:function(e){if(this.Leaflet&&e.has("locations")){var t;const i=e.get("locations"),n=null===(t=this.locations)||void 0===t?void 0:t.filter(((e,t)=>{var a,n;return!i[t]||(e.latitude!==i[t].latitude||e.longitude!==i[t].longitude)&&(null===(a=this.map.leafletMap)||void 0===a?void 0:a.getBounds().contains({lat:i[t].latitude,lng:i[t].longitude}))&&!(null!==(n=this.map.leafletMap)&&void 0!==n&&n.getBounds().contains({lat:e.latitude,lng:e.longitude}))}));var a;if(1===(null==n?void 0:n.length))null===(a=this.map.leafletMap)||void 0===a||a.panTo({lat:n[0].latitude,lng:n[0].longitude})}}},{kind:"method",key:"_normalizeLongitude",value:function(e){return Math.abs(e)>180?(e%360+540)%360-180:e}},{kind:"method",key:"_updateLocation",value:function(e){const t=e.target,a=t.getLatLng(),i=[a.lat,this._normalizeLongitude(a.lng)];(0,r.B)(this,"location-updated",{id:t.id,location:i},{bubbles:!1})}},{kind:"method",key:"_updateRadius",value:function(e){const t=e.target,a=this._locationMarkers[t.id];(0,r.B)(this,"radius-updated",{id:t.id,radius:a.getRadius()},{bubbles:!1})}},{kind:"method",key:"_markerClicked",value:function(e){const t=e.target;(0,r.B)(this,"marker-clicked",{id:t.id},{bubbles:!1})}},{kind:"method",key:"_mapClicked",value:function(e){if(this.pinOnClick&&this._locationMarkers){const a=Object.keys(this._locationMarkers)[0],i=[e.detail.location[0],this._normalizeLongitude(e.detail.location[1])];var t;if((0,r.B)(this,"location-updated",{id:a,location:i},{bubbles:!1}),i[1]!==e.detail.location[1])null===(t=this.map.leafletMap)||void 0===t||t.panTo({lat:i[0],lng:i[1]})}}},{kind:"method",key:"_updateMarkers",value:function(){if(!this.locations||!this.locations.length)return this._circles={},void(this._locationMarkers=void 0);const e={},t={},a=getComputedStyle(this).getPropertyValue("--accent-color");this.locations.forEach((i=>{let n;if(i.icon||i.iconPath){const e=document.createElement("div");let t;e.className="named-icon",void 0!==i.name&&(e.innerText=i.name),i.icon?(t=document.createElement("ha-icon"),t.setAttribute("icon",i.icon)):(t=document.createElement("ha-svg-icon"),t.setAttribute("path",i.iconPath)),e.prepend(t),n=this.Leaflet.divIcon({html:e.outerHTML,iconSize:[24,24],className:"light"})}if(i.radius){const o=this.Leaflet.circle([i.latitude,i.longitude],{color:i.radius_color||a,radius:i.radius});i.radius_editable||i.location_editable?(o.editing.enable(),o.addEventListener("add",(()=>{const e=o.editing._moveMarker,t=o.editing._resizeMarkers[0];n&&e.setIcon(n),t.id=e.id=i.id,e.addEventListener("dragend",(e=>this._updateLocation(e))).addEventListener("click",(e=>this._markerClicked(e))),i.radius_editable?t.addEventListener("dragend",(e=>this._updateRadius(e))):t.remove()})),e[i.id]=o):t[i.id]=o}if(!i.radius||!i.radius_editable&&!i.location_editable){const t={title:i.name,draggable:i.location_editable};n&&(t.icon=n);const a=this.Leaflet.marker([i.latitude,i.longitude],t).addEventListener("dragend",(e=>this._updateLocation(e))).addEventListener("click",(e=>this._markerClicked(e)));a.id=i.id,e[i.id]=a}})),this._circles=t,this._locationMarkers=e,(0,r.B)(this,"markers-updated")}},{kind:"field",static:!0,key:"styles",value(){return(0,o.iv)(h||(h=m`ha-map{display:block;height:100%}`))}}]}}),o.oi);t()}catch(f){t(f)}}))},80654:function(e,t,a){a.d(t,{g:()=>d});const i=window;"customIconsets"in i||(i.customIconsets={});const n=i.customIconsets,o=window;"customIcons"in o||(o.customIcons={});const d=new Proxy(o.customIcons,{get:(e,t)=>{var a;return null!==(a=e[t])&&void 0!==a?a:n[t]?{getIcon:n[t]}:void 0}})},30511:function(e,t,a){a.r(t),a.d(t,{mdiHomeAssistant:()=>i});const i="m12.151 1.5882c-.3262 0-.6523.1291-.8996.3867l-8.3848 8.7354c-.0619.0644-.1223.1368-.1807.2154-.0588.0789-.1151.1638-.1688.2534-.2593.4325-.4552.9749-.5232 1.4555-.0026.018-.0076.0369-.0094.0548-.0121.0987-.0184.1944-.0184.2857v8.0124a1.2731 1.2731 0 001.2731 1.2731h7.8313l-3.4484-3.593a1.7399 1.7399 0 111.0803-1.125l2.6847 2.7972v-10.248a1.7399 1.7399 0 111.5276-0v7.187l2.6702-2.782a1.7399 1.7399 0 111.0566 1.1505l-3.7269 3.8831v2.7299h8.174a1.2471 1.2471 0 001.2471-1.2471v-8.0375c0-.0912-.0059-.1868-.0184-.2855-.0603-.4935-.2636-1.0617-.5326-1.5105-.0537-.0896-.1101-.1745-.1684-.253-.0588-.079-.1191-.1513-.181-.2158l-8.3848-8.7363c-.2473-.2577-.5735-.3866-.8995-.3864"},79291:function(e,t,a){a.d(t,{T:()=>i});const i="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}}]);
//# sourceMappingURL=13197.22c9d4c101ad3a68.js.map