14 lines
33 KiB
JavaScript
14 lines
33 KiB
JavaScript
|
import{cL as A,cM as e,eR as t,eS as i,dC as a,cN as r,cO as g,dD as o,_ as c,n as s,cW as h,t as C,a as l,cR as I,eT as n,dy as E,dz as u,x as m,cV as w,eP as Q,i as M,cP as B,cQ as d,l as b,r as L}from"./card-09c4bade.js";
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright 2020 Google LLC
|
||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||
|
*/const D=A(class extends e{constructor(A){if(super(A),A.type!==t.PROPERTY&&A.type!==t.ATTRIBUTE&&A.type!==t.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!i(A))throw Error("`live` bindings can only contain a single expression")}render(A){return A}update(A,[e]){if(e===a||e===r)return e;const i=A.element,o=A.name;if(A.type===t.PROPERTY){if(e===i[o])return a}else if(A.type===t.BOOLEAN_ATTRIBUTE){if(!!e===i.hasAttribute(o))return a}else if(A.type===t.ATTRIBUTE&&i.getAttribute(o)===e+"")return a;return g(A),e}});class p{constructor(A,e,t,i,a){this._timer=new o,this._timerSeconds=e,this._callback=t,this._timerStartCallback=i,this._timerStopCallback=a,(this._host=A).addController(this)}removeController(){this.stopTimer(),this._host.removeController(this)}get value(){return this._value}updateValue(){this._value=this._callback()}clearValue(){this._value=void 0}stopTimer(){this._timer.isRunning()&&(this._timer.stop(),this._timerStopCallback?.())}startTimer(){this.stopTimer(),this._timerStartCallback?.(),this._timer.startRepeated(this._timerSeconds,(()=>{this.updateValue(),this._host.requestUpdate()}))}hasTimer(){return this._timer.isRunning()}hostConnected(){this.updateValue(),this.startTimer(),this._host.requestUpdate()}hostDisconnected(){this.clearValue(),this.stopTimer()}}var k="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/2wBDAQUFBQcGBw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65vn9G/PpvjdQE1lrKRrUuuNbY3pNgAAAB85/S/niAdhBRDGAQUIKIgBSkEACpwEYvmPH7fCeH2dVx2mmVLFNnvLruq+o/R+ZyOvCprTO2c3z+jmce2uNMipsz1nPeHNa41rne3PWudtQAAAPnH6T86DAB0Q6IcFFJCBSwhKCBBQ43PfQ+fv5zyerzfl9XGzYRy6LCCiKucdxqfZPs/Fcu+OnJ5dUmmd87z+jkc9hOk2QznuXm6Z1pnWuN6501AEJGofOf0v51wAADGAQWCiClAgEEB13Lr82+T9TpOHaEUOXlzVmlaDlzlmzg3N12J9p+x8blaztjfJ5dtcbqORz68nl1cKgmxI2rmqy1xrSbYEiZais+c/pfzzQgAdOAAAAAKQQgpRwuX
|
||
|
<img
|
||
|
${w(this._refImage)}
|
||
|
src=${D(A)}
|
||
|
@load=${A=>{const e=Q(A,{player:this,capabilities:{supportsPause:!!this.imageConfig?.refresh_seconds}});e&&!M(this._mediaLoadedInfo,e)&&(this._mediaLoadedInfo=e,B(this,e))}}
|
||
|
@error=${()=>{const A=this._resolveMode(this.imageConfig?.mode);"camera"===A||"entity"===A?this._forceSafeImage(!0):"url"===A&&d(this,b("error.image_load_error"),{context:this.imageConfig})}}
|
||
|
/>
|
||
|
`:m``}static get styles(){return L(':host {\n background-color: var(--primary-background-color);\n background-position: center;\n background-repeat: no-repeat;\n background-image: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgaW5rc2NhcGU6dmVyc2lvbj0iMS4yLjIgKGIwYTg0ODY1NDEsIDIwMjItMTItMDEpIgogICBzb2RpcG9kaTpkb2NuYW1lPSJjYW1lcmEtaXJpcy5zdmciCiAgIGlkPSJzdmc0IgogICB2ZXJzaW9uPSIxLjEiCiAgIHZpZXdCb3g9IjAgMCAyNCAyNCIKICAgeG1sbnM6aW5rc2NhcGU9Imh0dHA6Ly93d3cuaW5rc2NhcG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0wLjI0IC0yLjM5OTk5OTcsMCAtNC41OTk5OTk3LDAuODQgLTYuMzE5OTk5NywyLjI1MDAwMDMgbCAzLjY2LDYuMzQ5OTk5NSB6IgogICAgICAgaWQ9InBhdGgyIgogICAgICAgaW5rc2NhcGU6bGFiZWw9IklyaXMiCiAgICAgICBzdHlsZT0iZmlsbC1vcGFjaXR5OjAuMDU7ZmlsbDojZmZmZmZmIiAvPgogIDwvZz4KPC9zdmc+Cg==");\n background-size: 10%;\n background-position: center;\n}\n\nimg {\n width: 100%;\n height: 100%;\n display: block;\n object-fit: var(--frigate-card-media-layout-fit, contain);\n object-position: var(--frigate-card-media-layout-position-x, 50%) var(--frigate-card-media-layout-position-y, 50%);\n object-view-box: inset(var(--frigate-card-media-layout-view-box-top, 0%) var(--frigate-card-media-layout-view-box-right, 0%) var(--frigate-card-media-layout-view-box-bottom, 0%) var(--frigate-card-media-layout-view-box-left, 0%));\n}')}};c([s({attribute:!1})],U.prototype,"hass",void 0),c([s({attribute:!1})],U.prototype,"view",void 0),c([s({attribute:!1})],U.prototype,"cameraConfig",void 0),c([s({attribute:!1})],U.prototype,"cameraManager",void 0),c([s({attribute:!1,hasChanged:h})],U.prototype,"imageConfig",void 0),U=c([C("frigate-card-image")],U);export{U as FrigateCardImage};
|