init
This commit is contained in:
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1 @@
|
||||
!function(){const e=document.querySelector("body");let a=customElements.get("bubble-card");const t=setInterval((function(){a=customElements.get("bubble-card"),a?(clearInterval(t),e.style.transition="opacity 0.5s",e.style.opacity="1"):e.style.opacity="0"}),0);setTimeout((function(){clearInterval(t),e.style.transition="opacity 0.5s",e.style.opacity="1"}),1500)}(),console.info("%c Bubble Card %c Pop-up fix","background-color: #555;color: #fff;padding: 3px 2px 3px 3px;border-radius: 14px 0 0 14px;font-family: DejaVu Sans,Verdana,Geneva,sans-serif;text-shadow: 0 1px 0 rgba(1, 1, 1, 0.3)","background-color: #506eac;color: #fff;padding: 3px 3px 3px 2px;border-radius: 0 14px 14px 0;font-family: DejaVu Sans,Verdana,Geneva,sans-serif;text-shadow: 0 1px 0 rgba(1, 1, 1, 0.3)");
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
import"./card-b98d578d.js";
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
import{dC as t,f5 as e}from"./card-b98d578d.js";const a=2,s=(t,e)=>{t._controlsHideTimer&&(t._controlsHideTimer.stop(),delete t._controlsHideTimer,delete t._controlsOriginalValue),t.controls=e},o=(e,a=1)=>{const o=e._controlsOriginalValue??e.controls;s(e,!1),e._controlsHideTimer??=new t,e._controlsOriginalValue=o;const i=()=>{s(e,o),e.removeEventListener("loadstart",i)};e.addEventListener("loadstart",i),e._controlsHideTimer.start(a,(()=>{s(e,o)}))};class i{constructor(t,e,a){this._host=t,this._getVideoCallback=e,this._getControlsDefaultCallback=a??null}async play(){await this._host.updateComplete;const t=this._getVideoCallback();if(t?.play)try{await t.play()}catch(e){if("NotAllowedError"===e.name&&!this.isMuted()){await this.mute();try{await t.play()}catch(t){}}}}async pause(){await this._host.updateComplete,this._getVideoCallback()?.pause()}async mute(){await this._host.updateComplete;const t=this._getVideoCallback();t&&(t.muted=!0)}async unmute(){await this._host.updateComplete;const t=this._getVideoCallback();t&&(t.muted=!1)}isMuted(){return this._getVideoCallback()?.muted??!0}async seek(t){await this._host.updateComplete;const e=this._getVideoCallback();e&&(o(e),e.currentTime=t)}async setControls(t){await this._host.updateComplete;const e=this._getVideoCallback(),a=t??this._getControlsDefaultCallback?.();e&&void 0!==a&&s(e,a)}isPaused(){return this._getVideoCallback()?.paused??!0}async getScreenshotURL(){await this._host.updateComplete;const t=this._getVideoCallback();return t?e(t):null}getFullscreenElement(){return this._getVideoCallback()??null}}const n=t=>void 0!==t.mozHasAudio?t.mozHasAudio:void 0!==t.audioTracks?Boolean(t.audioTracks?.length):!("undefined"!=typeof MediaStream&&t.srcObject instanceof MediaStream)||t.srcObject.getAudioTracks().length>0,l=(t,e,a)=>{if(e){const t=e.getReceivers();if(t.length>0)return t.some((t=>"audio"===t.track?.kind&&!t.track?.muted))}return a?a.includes("mp4a")||a.includes("opus")||a.includes("flac"):n(t)},r=t=>!!t?.getTransceivers().some((t=>"audio"===t.sender.track?.kind&&("sendonly"===t.direction||"sendrecv"===t.direction))),c=(t,e)=>{if(!t)return null;const a=t.getReceivers().map((t=>t.track)).filter((t=>"audio"===t?.kind));if(0===a.length)return null;const s=()=>a.some((t=>!t.muted));let o=s();const i=()=>{const t=s();t!==o&&(o=t,e(t))};return a.forEach((t=>{t.addEventListener("unmute",i),t.addEventListener("mute",i)})),()=>a.forEach((t=>{t.removeEventListener("unmute",i),t.removeEventListener("mute",i)}))};export{a as M,i as V,l as a,c as b,r as c,o as h,n as m,s};
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
import{_ as t,n as s,a as e,ea as a,r as i}from"./card-b98d578d.js";class n extends e{constructor(){super(...arguments),this.fadeIn=!0}firstUpdated(){this.fadeIn&&this._startFadeIn()}updated(t){void 0!==t.get("fadeIn")&&(this.fadeIn?this._startFadeIn():this._setOpacity(1))}startFadeOut(){return new Promise((t=>{const s=e=>{"opacity"===e.propertyName&&(this.removeEventListener("transitionend",s),t())};this.addEventListener("transitionend",s),this._setOpacity(0)}))}_startFadeIn(){this._setOpacity(0),a(this),this._setOpacity(1)}_setOpacity(t){this.style.opacity=`${t}`}static get styles(){return i(":host {\n position: absolute;\n inset: 0;\n opacity: 1;\n transition: opacity 1.5s ease-in;\n}")}}t([s({type:Boolean})],n.prototype,"fadeIn",void 0);export{n as B};
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1,15 @@
|
||||
import{_ as e,n as t,t as n,a as i,d7 as a,x as c,l as r,d9 as l,dd as s,r as o,dL as d}from"./card-b98d578d.js";let p=class extends i{constructor(){super(...arguments),this._refInput=a()}get value(){return this._refInput.value?.value?new Date(this._refInput.value.value):null}reset(){this._refInput.value&&(this._refInput.value.value="")}render(){const e=()=>{const e=this._refInput.value?.value;d(this,"date-picker:change",{date:e?new Date(e):null})};return c`<input
|
||||
aria-label="${r("timeline.select_date")}"
|
||||
title="${r("timeline.select_date")}"
|
||||
${l(this._refInput)}
|
||||
type="datetime-local"
|
||||
@input=${()=>e()}
|
||||
@change=${()=>e()}
|
||||
/>
|
||||
<advanced-camera-card-icon
|
||||
aria-label="${r("timeline.select_date")}"
|
||||
title="${r("timeline.select_date")}"
|
||||
.icon=${{icon:this.icon??"mdi:calendar-search"}}
|
||||
@click=${e=>{s(e),this._refInput.value?.showPicker()}}
|
||||
>
|
||||
</advanced-camera-card-icon>`}static get styles(){return o(":host {\n display: inline-block;\n position: relative;\n width: var(--mdc-icon-size, 24px);\n height: var(--mdc-icon-size, 24px);\n}\n\ninput {\n display: block;\n height: 100%;\n width: 100%;\n position: absolute;\n padding: 0px;\n border: 0px;\n}\n\n/**\n * Hack warning: Safari on iOS does not support showPicker with\n * datetime-local:\n * https://caniuse.com/mdn-api_htmlinputelement_showpicker_datetime_local_input\n *\n * The hack is to render the input element in front of the icon, with an\n * opacity of 0. This only works if the underlying input element accepts the\n * click at the exact place the user happens to click. From trial and error,\n * this seems to work better than expected / quite reliably, but had the user\n * manually changed icon sizes with Safari iOS their experience may vary.\n */\n@supports (-webkit-touch-callout: none) {\n input {\n opacity: 0;\n z-index: 1;\n }\n}\n@supports not (-webkit-touch-callout: none) {\n input {\n visibility: hidden;\n }\n}\nadvanced-camera-card-icon {\n display: block;\n height: 100%;\n width: 100%;\n position: absolute;\n}")}};e([t({attribute:!1})],p.prototype,"icon",void 0),p=e([n("advanced-camera-card-date-picker")],p);export{p as A};
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1 @@
|
||||
import{dU as r}from"./card-b98d578d.js";function o(o){const s=r(o);return s.setHours(23,59,59,999),s}export{o as e};
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
const e=1e4;export{e as C};
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
import{ep as e,dX as t,eL as a,eJ as r}from"./card-b98d578d.js";import{G as s}from"./engine-generic-75ad9390.js";const n=(t,a,r)=>!(!t._metadata?.startDate||!t._metadata?.endDate)&&(a&&r?e({start:t._metadata.startDate,end:t._metadata.endDate},{start:a,end:r}):!a&&r?t._metadata.startDate<=r:!(a&&!r)||t._metadata.startDate>=a);class d extends s{constructor(e,t,a,r,s,n){super(t,n),this._entityRegistryManager=e,this._browseMediaWalker=a,this._resolvedMediaCache=r,this._requestCache=s}generateDefaultEventQuery(e,a,r){return[{type:t.Event,cameraIDs:a,...r}]}async getMediaDownloadPath(e,t,r){return a(e,r.getContentID(),this._resolvedMediaCache)}getQueryResultMaxAge(e){return e.type===t.Event?r:null}getMediaCapabilities(e){return{canFavorite:!1,canDownload:!0}}}export{d as B,n as i};
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1 @@
|
||||
import{ex as t,eM as e,eN as i,eO as a,l as n,eA as s,ev as r,j as l}from"./card-b98d578d.js";import{l as o}from"./live-provider-845afb16.js";const c=(t,e,i)=>{const a=i?.url??t.go2rtc?.url,n=i?.stream??t.go2rtc?.stream;if(!a||!n)return null;const s=e(a,n);return{endpoint:s,sign:s.startsWith("/")}},g=(t,e)=>c(t,((t,e)=>`${t}/api/ws?src=${e}`),e),u=(t,e)=>c(t,((t,e)=>`${t}/api/streams?src=${e}&video=all&audio=allµphone`),e),h=(t,e,i)=>"preset"===e?(i?.preset?t.ptz.presets?.[i.preset]:null)??null:i?.phase?t.ptz[`actions_${e}_${i.phase}`]??null:t.ptz[`actions_${e}`]??null,p=(t,e,i)=>!!h(t,e,i),_=(e,i)=>{const a=p(e,i,{phase:"start"})&&p(e,i,{phase:"stop"}),n=p(e,i);return a||n?[...a?[t.Continuous]:[],...n?[t.Relative]:[]]:null},d=t=>{const e=_(t,"left"),i=_(t,"right"),a=_(t,"up"),n=_(t,"down"),s=_(t,"zoom_in"),r=_(t,"zoom_out"),l=t.ptz.presets?Object.keys(t.ptz.presets):void 0;return e?.length||i?.length||a?.length||n?.length||s?.length||r?.length||l?.length?{...e?{left:e}:{},...i?{right:i}:{},...a?{up:a}:{},...n?{down:n}:{},...s?{zoomIn:s}:{},...r?{zoomOut:r}:{},...l?{presets:l}:{}}:null};class b{constructor(t,i,a){this._destroyCallbacks=[],this._stateChangeHandler=t=>{this._eventCallback?.({cameraID:this.getID(),type:e(t.newState.state)?"new":"end"})},this._config=t,this._engine=i,this._eventCallback=a?.eventCallback,this._capabilities=a?.capabilities}async initialize(t){return await this._initialize(t),this._capabilities=t.capabilityOptions?.capabilities??this._capabilities??await this._buildCapabilities(t),this._subscribeBasedOnCapabilities(t.stateWatcher),this._onDestroy((()=>t.stateWatcher.unsubscribe(this._stateChangeHandler))),this}async _initialize(t){}async _buildCapabilities(t){const e=await this._getRawCapabilities(t),a=this.getConfig(),n=await o(t.hass,a,this._getGo2RTCMetadataEndpoint(),this.getProxyConfig());return new i({...e,"2-way-audio":n},{disable:a.capabilities?.disable,disableExcept:a.capabilities?.disable_except})}async _getRawCapabilities(t){return{live:!0,menu:!0,substream:!0,trigger:!0,"remote-control-entity":!0,...t.capabilityOptions?.raw}}async destroy(){this._destroyCallbacks.forEach((t=>t()))}getConfig(){return this._config}setID(t){this._config.id=t}getID(){if(this._config.id)return this._config.id;throw new a(n("error.no_camera_id"))}getEngine(){return this._engine}getCapabilities(){return this._capabilities??null}getEndpoints(t){const e=this._getUIEndpoint(t),i=this._getGo2RTCStreamEndpoint(),a=this._getWebRTCCardEndpoint();return e||i||a?{...e&&{ui:e},...i&&{go2rtc:i},...a&&{webrtcCard:a}}:null}_getGo2RTCMetadataEndpoint(){return u(this._config)}_getGo2RTCStreamEndpoint(){return g(this._config)}_getWebRTCCardEndpoint(){return this._config.camera_entity?{endpoint:this._config.camera_entity}:null}_getUIEndpoint(t){return null}getProxyConfig(){return{live:"auto"===this._config.proxy.live?"go2rtc"===this._config.live_provider&&!!this._config.go2rtc?.url:this._config.proxy.live,media:"auto"!==this._config.proxy.media&&this._config.proxy.media,dynamic:this._config.proxy.dynamic,ssl_verification:!1!==this._config.proxy.ssl_verification,ssl_ciphers:"auto"===this._config.proxy.ssl_ciphers?"default":this._config.proxy.ssl_ciphers}}async executePTZAction(t,e,i){const a=h(this.getConfig(),e,i);return!!a&&(await t.executeActions({actions:a}),!0)}_onDestroy(t){this._destroyCallbacks.push(t)}_subscribeBasedOnCapabilities(t){this._capabilities?.has("trigger")&&(t.unsubscribe(this._stateChangeHandler),t.subscribe(this._stateChangeHandler,this._config.triggers.entities))}}class y{constructor(t,e){this._stateWatcher=t,this._eventCallback=e}getEngineType(){return s.Generic}async createCamera(t,e){return await new b(e,this,{eventCallback:this._eventCallback}).initialize({hass:t,stateWatcher:this._stateWatcher,capabilityOptions:{raw:{ptz:d(e)??void 0},disable:e.capabilities?.disable,disableExcept:e.capabilities?.disable_except}})}generateDefaultEventQuery(t,e,i){return null}generateDefaultRecordingQuery(t,e,i){return null}generateDefaultRecordingSegmentsQuery(t,e,i){return null}async getEvents(t,e,i,a){return null}async getRecordings(t,e,i,a){return null}async getRecordingSegments(t,e,i,a){return null}generateMediaFromEvents(t,e,i,a){return null}generateMediaFromRecordings(t,e,i,a){return null}async getMediaDownloadPath(t,e,i){return null}async favoriteMedia(t,e,i,a){}getQueryResultMaxAge(t){return null}async getMediaSeekTime(t,e,i,a,n){return null}async getMediaMetadata(t,e,i,a){return null}getCameraMetadata(t,e){const i=r(e);return{title:e.title??l(t,e.camera_entity)??l(t,e.webrtc_card?.entity)??e.id??"",icon:{entity:i??void 0,icon:e.icon,fallback:"mdi:video"}}}getMediaCapabilities(t){return null}}var f=Object.freeze({__proto__:null,GenericCameraManagerEngine:y});export{b as C,y as G,u as a,g as b,f as e,d as g};
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
import{eE as e,eA as t,dZ as a,eF as i,dV as s,eC as n,eG as r,eD as o,ef as c,eH as m,eI as d,d_ as l,e0 as h,eJ as u}from"./card-b98d578d.js";import{B as y,i as g}from"./engine-browse-media-e35cac7a.js";import{C as _}from"./engine-86b0096c.js";import{E as p}from"./entity-camera-94c8dadf.js";import{g as f}from"./engine-generic-75ad9390.js";import{e as M}from"./endOfDay-8eba624c.js";import"./live-provider-845afb16.js";class C extends p{getProxyConfig(){return{...super.getProxyConfig(),media:"auto"===this._config.proxy.media||this._config.proxy.media}}_getUIEndpoint(e){return this._config.motioneye?.url?{endpoint:this._config.motioneye.url}:null}async _getRawCapabilities(e){const t=f(this.getConfig());return{...await super._getRawCapabilities(e),clips:!0,snapshots:!0,...t&&{ptz:t}}}}class w{static isMotionEyeEventQueryResults(e){return e.engine===t.MotionEye&&e.type===o.Event}}const D={"%Y":"yyyy","%m":"MM","%d":"dd","%H":"HH","%M":"mm","%S":"ss"},E=new RegExp(/(%Y|%m|%d|%H|%M|%S)/g);class v extends y{constructor(){super(...arguments),this._directoryCache=new e,this._fileCache=new e}getEngineType(){return t.MotionEye}async createCamera(e,t){const a=new C(t,this,{eventCallback:this._eventCallback});return await a.initialize({entityRegistryManager:this._entityRegistryManager,hass:e,stateWatcher:this._stateWatcher})}_convertMotionEyeTimeFormatToDateFNS(e){return e.replace(E,((e,t)=>D[t]))}_motionEyeMetadataGeneratorFile(e,t,s,n){let r=n?._metadata?.startDate??new Date;if(t){const e=s.title.replace(/\.[^/.]+$/,"");if(r=a(e,t,r),!i(r))return null}return{cameraID:e,startDate:r,endDate:r}}_motionEyeMetadataGeneratorDirectory(e,t,n,r){let o=r?._metadata?.startDate??new Date;if(t){const e=a(n.title,t,o);if(!i(e))return null;o=s(e)}return{cameraID:e,startDate:o,endDate:r?._metadata?.endDate??M(o)}}async _getMatchingDirectories(e,t,a,i,s){const n=t.getCamera(a),r=n?.getConfig();if(!(n instanceof p&&r))return null;const o=n.getEntity(),c=o?.config_entry_id,m=o?.device_id;if(!c||!m)return null;const d=(e,t)=>{const s=e.shift();if(!s)return[];const n=s.includes("%")?this._convertMotionEyeTimeFormatToDateFNS(s):null;return[{targets:t,metadataGenerator:(e,t)=>this._motionEyeMetadataGeneratorDirectory(a,n,e,t),matcher:e=>e.can_expand&&(!!n||e.title===s)&&g(e,i?.start,i?.end),advance:t=>d(e,t)}]};return await this._browseMediaWalker.walk(e,[...!1===i?.hasClip||i?.hasSnapshot?[]:d(r.motioneye.movies.directory_pattern.split("/"),[`media-source://motioneye/${c}#${m}#movies`]),...!1===i?.hasSnapshot||i?.hasClip?[]:d(r.motioneye.images.directory_pattern.split("/"),[`media-source://motioneye/${c}#${m}#images`])],{...!1!==s?.useCache&&{cache:this._directoryCache}})}async getEvents(e,a,i,s){if(i.favorite||i.tags?.size||i.what?.size||i.where?.size)return null;const r=new Map,c=async n=>{const c={...i,cameraIDs:new Set([n])},h=s?.useCache??1?this._requestCache.get(c):null;if(h)return void r.set(c,h);const u=a.getCameraConfig(n);if(!u)return;const y=await this._getMatchingDirectories(e,a,n,c,s);if(!y||!y.length)return;const p=this._convertMotionEyeTimeFormatToDateFNS(u.motioneye.movies.file_pattern),f=this._convertMotionEyeTimeFormatToDateFNS(u.motioneye.images.file_pattern),M=c.limit??_,C=await this._browseMediaWalker.walk(e,[{targets:y,metadataGenerator:(e,t)=>e.media_class===m||e.media_class===d?this._motionEyeMetadataGeneratorFile(n,e.media_class===m?f:p,e,t):null,earlyExit:e=>e.length>=M,matcher:e=>!e.can_expand&&g(e,c.start,c.end)}],{...!1!==s?.useCache&&{cache:this._fileCache}}),w=l(C,(e=>e._metadata?.startDate),"desc").slice(0,c.limit??_),D={type:o.Event,engine:t.MotionEye,browseMedia:w};(s?.useCache??1)&&this._requestCache.set(c,{...D,cached:!0},D.expiry),r.set(c,D)};return await n(i.cameraIDs,(e=>c(e))),r.size?r:null}generateMediaFromEvents(e,t,a,i){return w.isMotionEyeEventQueryResults(i)?r(i.browseMedia):null}async getMediaMetadata(e,a,i,s){const r=new Map;if((s?.useCache??1)&&this._requestCache.has(i)){const e=this._requestCache.get(i);if(e)return r.set(i,e),r}const m=new Set,d=async t=>{const i=await this._getMatchingDirectories(e,a,t,null,s);for(const e of i??[])e._metadata?.startDate&&m.add(h(e._metadata.startDate))};await n(i.cameraIDs,(e=>d(e)));const l={type:o.MediaMetadata,engine:t.MotionEye,metadata:{...m.size&&{days:m}},expiry:c(new Date,{seconds:u}),cached:!1};return(s?.useCache??1)&&this._requestCache.set(i,{...l,cached:!0},l.expiry),r.set(i,l),r}getCameraMetadata(e,t){return{...super.getCameraMetadata(e,t),engineIcon:"motioneye"}}}export{v as MotionEyeCameraManagerEngine};
|
||||
Binary file not shown.
@@ -0,0 +1,14 @@
|
||||
import{d_ as e,l as t,ex as i,eK as a,ew as n,eE as s,eA as r,eI as o,dZ as c,eF as l,ef as u,dV as h,eC as _,eG as g,eD as d,e0 as m,eJ as p}from"./card-b98d578d.js";import{B as y,i as f}from"./engine-browse-media-e35cac7a.js";import{C}from"./engine-86b0096c.js";import{E as w}from"./entity-camera-94c8dadf.js";import{g as k}from"./engine-generic-75ad9390.js";import{e as D}from"./endOfDay-8eba624c.js";import"./live-provider-845afb16.js";const M=t=>e(t,(e=>e._metadata?.startDate),"desc");class b extends n{}class E extends w{constructor(){super(...arguments),this._reolinkHostID=null,this._reolinkCameraUID=null,this._reolinkChannel=null,this._ptzEntities=null}async initialize(e){return super.initialize(e)}async _getChannelFromConfigurationURL(e,t){const i=this._entity?.device_id;if(!i)return null;const a=await t.getDevice(e,i);if(!a?.configuration_url)return null;try{const e=new URL(a.configuration_url),t=Number(e.searchParams.get("ch"));return isNaN(t)?null:t}catch{return null}}async _initializeChannel(e,i){const a=this._entity?.unique_id,n=a?String(a).match(/^(?<hostid>[^_]+)_(?<channel_or_uid>[^_]+)_/):null,s=n?.groups?.hostid??null,r=n?.groups?.channel_or_uid??null;if(null===s||null===r)throw new b(t("error.camera_initialization_reolink"),this.getConfig());const o=Number(r),c=!isNaN(o)&&o<=999,l=(c?o:null)??await this._getChannelFromConfigurationURL(e,i)??0,u=c?null:r;this._reolinkChannel=l,this._reolinkHostID=s,this._reolinkCameraUID=u}async _initialize(e){await this._initializeChannel(e.hass,e.deviceRegistryManager),this._ptzEntities=await this._getPTZEntities(e.hass,e.entityRegistryManager)}_getUIEndpoint(e){return this._config.reolink?.url?{endpoint:this._config.reolink.url}:null}async _getRawCapabilities(e){const t=k(this.getConfig()),i=this._ptzEntities?this._entitiesToCapabilities(e.hass,this._ptzEntities):null,a=t||i?{...i,...t}:null;return{...await super._getRawCapabilities(e),clips:!0,...a&&{ptz:a}}}_entitiesToCapabilities(e,t){const a={};for(const e of Object.keys(t))switch(e){case"left":case"right":case"up":case"down":a[e]=[i.Continuous];break;case"zoom_in":a.zoomIn=[i.Continuous];break;case"zoom_out":a.zoomOut=[i.Continuous]}const n=t?.presets?e.states[t.presets]:null;
|
||||
/* istanbul ignore next: this path cannot be reached as ptzEntities will
|
||||
always have contents when this function is called -- @preserve */
|
||||
return Array.isArray(n?.attributes.options)&&(a.presets=n.attributes.options),Object.keys(a).length?a:null}async _getPTZEntities(e,t){
|
||||
/* istanbul ignore next: this path cannot be reached as an exception is
|
||||
thrown in initialize() if this value is not found -- @preserve */
|
||||
if(!this._reolinkHostID)return null;const i=this._getPTZEntityUniqueIDPrefix(),a=await t.getMatchingEntities(e,(e=>e.config_entry_id===this._entity?.config_entry_id&&!!e.unique_id&&String(e.unique_id).startsWith(i)&&!e.disabled_by)),n=a.filter((e=>e.entity_id.startsWith("button."))),s=a.filter((e=>e.unique_id===`${i}ptz_preset`&&e.entity_id.startsWith("select."))),r=["stop","left","right","up","down","zoom_in","zoom_out"],o={};for(const e of n)for(const t of r)e.unique_id&&String(e.unique_id).endsWith(t)&&(o[t]=e.entity_id);return 1===s.length&&(o.presets=s[0].entity_id),Object.keys(o).length?o:null}getChannel(){return this._reolinkChannel}_getPTZEntityUniqueIDPrefix(){return`${this._reolinkHostID}_${this._reolinkCameraUID??this._reolinkChannel}_`}getProxyConfig(){return{...super.getProxyConfig(),media:"auto"===this._config.proxy.media||this._config.proxy.media,ssl_verification:"auto"!==this._config.proxy.ssl_verification&&this._config.proxy.ssl_verification,ssl_ciphers:"auto"===this._config.proxy.ssl_ciphers?"intermediate":this._config.proxy.ssl_ciphers}}async executePTZAction(e,t,i){if(await super.executePTZAction(e,t,i))return!0;if(!this._ptzEntities)return!1;if("preset"===t){const t=this._ptzEntities.presets,n=i?.preset;return!(!n||!t)&&(await e.executeActions({actions:[a("select",t,n)]}),!0)}const n="start"===i?.phase?this._ptzEntities[t]:"stop"===i?.phase?this._ptzEntities.stop:null;return!!n&&(await e.executeActions({actions:[{action:"perform-action",perform_action:"button.press",target:{entity_id:n}}]}),!0)}}class z{static isReolinkEventQueryResults(e){return e.engine===r.Reolink&&e.type===d.Event}}class x extends y{constructor(e,t,i,a,n,r,o){super(e,i,a,n,r,o),this._camerasCache=new s,this._cache=new s,this._deviceRegistryManager=t}getEngineType(){return r.Reolink}_reolinkFileMetadataGenerator(e,t,i){
|
||||
/* istanbul ignore next: This situation cannot happen as the directory would
|
||||
be rejected by _reolinkDirectoryMetadataGenerator if there was no start date
|
||||
-- @preserve */
|
||||
if(!i?._metadata?.startDate||t.media_class!==o)return null;const a=t.title.split(/ +/),n=c(a[0],"HH:mm:ss",i._metadata.startDate);if(!l(n))return null;const s=a.length>1?a[1].match(/(?<hours>\d+):(?<minutes>\d+):(?<seconds>\d+)/):null,r=s?.groups?{hours:Number(s.groups.hours),minutes:Number(s.groups.minutes),seconds:Number(s.groups.seconds)}:null,h=a.length>2?a.splice(2).map((e=>e.toLowerCase())).sort():null;return{cameraID:e,startDate:n,endDate:r?u(n,r):n,...h&&{what:h}}}_reolinkDirectoryMetadataGenerator(e,t){const i=c(t.title,"yyyy/M/d",new Date);return l(i)?{cameraID:e,startDate:h(i),endDate:D(i)}:null}_reolinkCameraMetadataGenerator(e){const t=e.media_content_id.match(/^media-source:\/\/reolink\/CAM\|(?<configEntryID>.+)\|(?<channel>\d+)$/);return t?.groups?{configEntryID:t.groups.configEntryID,channel:Number(t.groups.channel)}:null}async createCamera(e,t){const i=new E(t,this,{eventCallback:this._eventCallback});return await i.initialize({entityRegistryManager:this._entityRegistryManager,deviceRegistryManager:this._deviceRegistryManager,hass:e,stateWatcher:this._stateWatcher})}async _getMatchingDirectories(e,t,i,a){const n=t.getConfig(),s=t.getEntity(),r=s?.config_entry_id;if(null===t.getChannel()||!r)return null;const o=await this._browseMediaWalker.walk(e,[{targets:["media-source://reolink"],metadataGenerator:(e,t)=>this._reolinkCameraMetadataGenerator(e),matcher:e=>e._metadata?.channel===t.getChannel()&&e._metadata?.configEntryID===r}],{...!1!==a?.useCache&&{cache:this._camerasCache}});return o?.length?await this._browseMediaWalker.walk(e,[{targets:[`media-source://reolink/RES|${r}|${t.getChannel()}|`+("low"===n.reolink?.media_resolution?"sub":"main")],metadataGenerator:(e,i)=>this._reolinkDirectoryMetadataGenerator(t.getID(),e),matcher:e=>e.can_expand&&f(e,i?.start,i?.end),sorter:e=>M(e)}],{...!1!==a?.useCache&&{cache:this._cache}}):null}async getEvents(t,i,a,n){if(a.favorite||a.tags?.size||a.what?.size||a.where?.size||a.hasSnapshot)return null;const s=new Map,o=async o=>{const c={...a,cameraIDs:new Set([o])},l=n?.useCache??1?this._requestCache.get(c):null;if(l)return void s.set(c,l);const u=i.getCamera(o),h=u&&u instanceof E?await this._getMatchingDirectories(t,u,c,n):null,_=c.limit??C;let g=[];h?.length&&(g=await this._browseMediaWalker.walk(t,[{targets:h,concurrency:1,metadataGenerator:(e,t)=>this._reolinkFileMetadataGenerator(o,e,t),earlyExit:e=>e.length>=_,matcher:e=>!e.can_expand&&f(e,c.start,c.end),sorter:e=>M(e)}],{...!1!==n?.useCache&&{cache:this._cache}}));const m=e(g,(e=>e._metadata?.startDate),"desc").slice(0,_),p={type:d.Event,engine:r.Reolink,browseMedia:m};(n?.useCache??1)&&this._requestCache.set(c,{...p,cached:!0},p.expiry),s.set(c,p)};return await _(a.cameraIDs,(e=>o(e))),s}generateMediaFromEvents(e,t,i,a){return z.isReolinkEventQueryResults(a)?g(a.browseMedia):null}async getMediaMetadata(e,t,i,a){const n=new Map,s=a?.useCache??1?this._requestCache.get(i):null;if(s)return n.set(i,s),n;const o=new Set,c=async i=>{const n=t.getCamera(i);if(!(n&&n instanceof E))return;const s=await this._getMatchingDirectories(e,n,null,a);for(const e of s??[])
|
||||
/* istanbul ignore next: This situation cannot happen as the directory
|
||||
will not match without metadata -- @preserve */
|
||||
e._metadata?.startDate&&o.add(m(e._metadata.startDate))};await _(i.cameraIDs,(e=>c(e)));const l={type:d.MediaMetadata,engine:r.Reolink,metadata:{...o.size&&{days:o}},expiry:u(new Date,{seconds:p}),cached:!1};return(a?.useCache??1)&&this._requestCache.set(i,{...l,cached:!0},l.expiry),n.set(i,l),n}getCameraMetadata(e,t){return{...super.getCameraMetadata(e,t),engineIcon:"reolink"}}}export{x as ReolinkCameraManagerEngine,z as ReolinkQueryResultsClassifier};
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
import{g as t,G as e}from"./engine-generic-75ad9390.js";import{ex as i,eA as n}from"./card-b98d578d.js";import{E as s}from"./entity-camera-94c8dadf.js";import"./live-provider-845afb16.js";class a extends s{constructor(){super(...arguments),this._ptzEntities=null}async _initialize(t){this._ptzEntities=await this._getPTZEntities(t.hass,t.entityRegistryManager)}async _getRawCapabilities(e){const i=t(this.getConfig()),n=this._ptzEntities?this._entitiesToCapabilities(this._ptzEntities):null,s=i||n?{...n,...i}:null;return{...await super._getRawCapabilities(e),...s&&{ptz:s}}}async _getPTZEntities(t,e){if(!this._entity?.device_id)return null;const i=await e.getMatchingEntities(t,(t=>t.device_id===this._entity?.device_id&&t.entity_id.startsWith("button.")&&!t.disabled_by)),n={pan_left:"left",pan_right:"right",tilt_up:"up",tilt_down:"down"},s={};for(const t of i)for(const[e,i]of Object.entries(n))t.entity_id.endsWith(`_${e}`)&&(s[i]=t.entity_id);return Object.keys(s).length?s:null}_entitiesToCapabilities(t){const e={};for(const n of Object.keys(t))e[n]=[i.Relative];return e}async executePTZAction(t,e,i){if(await super.executePTZAction(t,e,i))return!0;if(!this._ptzEntities)return!1;if("preset"===e)return!1;if("zoom_in"===e||"zoom_out"===e)return!1;if("stop"===i?.phase)return!0;const n=this._ptzEntities[e];return!!n&&(await t.executeActions({actions:[{action:"perform-action",perform_action:"button.press",target:{entity_id:n}}]}),!0)}}class r extends e{constructor(t,e,i){super(e,i),this._entityRegistryManager=t}getEngineType(){return n.TPLink}async createCamera(t,e){const i=new a(e,this,{eventCallback:this._eventCallback});return await i.initialize({entityRegistryManager:this._entityRegistryManager,hass:t,stateWatcher:this._stateWatcher})}getCameraMetadata(t,e){return{...super.getCameraMetadata(t,e),engineIcon:"tplink"}}}export{r as TPLinkCameraManagerEngine};
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
import{ev as t,ew as e,l as i}from"./card-b98d578d.js";import{C as n}from"./engine-generic-75ad9390.js";class r extends n{constructor(){super(...arguments),this._entity=null}async initialize(n){const r=this.getConfig(),s=t(r),a=s?await n.entityRegistryManager.getEntity(n.hass,s):null;if(!a||!s)throw new e(i("error.no_camera_entity"),r);return this._entity=a,await super.initialize(n)}getEntity(){return this._entity}}export{r as E};
|
||||
Binary file not shown.
@@ -0,0 +1,23 @@
|
||||
import{_ as t,n as a,t as e,a as r,x as s,r as i,dC as o,b as n}from"./card-b98d578d.js";import{c as d}from"./repeat-08ca48e7.js";import{B as l}from"./base-91ab3d27.js";let c=class extends r{constructor(){super(...arguments),this.angle=0,this.distance=100,this.color="#ffcc00",this.size="4px",this.duration="1.5s",this.delay="0s",this.gravity=0}render(){return s`<span class="spark">✦</span>`}updated(){const t=this.angle*Math.PI/180,a=Math.cos(t)*this.distance,e=Math.sin(t)*this.distance+this.gravity;this.style.setProperty("--end-x",`${a}px`),this.style.setProperty("--end-y",`${e}px`),this.style.setProperty("--color",this.color),this.style.setProperty("--size",this.size),this.style.setProperty("--duration",this.duration),this.style.setProperty("--delay",this.delay)}static get styles(){return i(":host {\n position: absolute;\n left: 0;\n top: 0;\n user-select: none;\n pointer-events: none;\n will-change: transform, opacity;\n animation: explode var(--duration) ease-out forwards;\n animation-delay: var(--delay);\n opacity: 0;\n}\n\n.spark {\n font-size: var(--size, 4px);\n color: var(--color, #ffcc00);\n text-shadow: 0 0 4px #fff, 0 0 8px var(--color), 0 0 16px var(--color), 0 0 32px var(--color), 0 0 48px var(--color);\n filter: brightness(1.3);\n}\n\n@keyframes explode {\n 0% {\n transform: translate(0, 0) scale(1);\n opacity: 1;\n }\n 55% {\n opacity: 1;\n }\n 100% {\n transform: translate(var(--end-x), var(--end-y)) scale(0.3);\n opacity: 0;\n }\n}")}};t([a({type:Number})],c.prototype,"angle",void 0),t([a({type:Number})],c.prototype,"distance",void 0),t([a({type:String})],c.prototype,"color",void 0),t([a({type:String})],c.prototype,"size",void 0),t([a({type:String})],c.prototype,"duration",void 0),t([a({type:String})],c.prototype,"delay",void 0),t([a({type:Number})],c.prototype,"gravity",void 0),c=t([e("advanced-camera-card-firework-particle")],c);const p=["#ff2222","#ffdd00","#22ff22","#22aaff","#ff22ff","#ffffff","#ffaa00","#22ffff","#ff66aa","#aaaaff"];let h=class extends r{constructor(){super(...arguments),this.posX="50%",this.posY="50%",this.delay="0s",this.scale=1,this.burstType="standard",this._particles=[],this._color="",this._initialized=!1}_initializeParticles(){if(!this._initialized)switch(this._initialized=!0,this._color=p[Math.floor(Math.random()*p.length)],this.burstType){case"ring":this._initializeRingParticles();break;case"palm":this._initializePalmParticles();break;default:this._initializeStandardParticles()}}_initializeStandardParticles(){const t=Math.round(36*this.scale);this._particles=Array.from({length:t},((a,e)=>({id:e,angle:360/t*e+20*(Math.random()-.5),distance:(80*Math.random()+100)*this.scale,color:this._color,size:(12*Math.random()+18)*this.scale+"px",duration:.5*Math.random()+1.8+"s",delay:.08*Math.random()+"s",gravity:0})))}_initializeRingParticles(){const t=Math.round(36*this.scale*1.5),a=(120+40*Math.random())*this.scale;this._particles=Array.from({length:t},((e,r)=>({id:r,angle:360/t*r,distance:a+10*(Math.random()-.5),color:this._color,size:(8*Math.random()+14)*this.scale+"px",duration:.3*Math.random()+1.5+"s",delay:.02*Math.random()+"s",gravity:0})))}_initializePalmParticles(){const t=Math.round(18*this.scale);this._particles=Array.from({length:t},((a,e)=>({id:e,angle:360/t*e+15*(Math.random()-.5),distance:(60*Math.random()+140)*this.scale,color:this._color,size:(10*Math.random()+20)*this.scale+"px",duration:.8*Math.random()+2.2+"s",delay:.05*Math.random()+"s",gravity:80+60*Math.random()})))}render(){return this._initializeParticles(),s`
|
||||
${d(this._particles,(t=>t.id),(t=>s`
|
||||
<advanced-camera-card-firework-particle
|
||||
.angle=${t.angle}
|
||||
.distance=${t.distance}
|
||||
.color=${t.color}
|
||||
.size=${t.size}
|
||||
.duration=${t.duration}
|
||||
.delay=${t.delay}
|
||||
.gravity=${t.gravity}
|
||||
></advanced-camera-card-firework-particle>
|
||||
`))}
|
||||
`}updated(){this.style.setProperty("--pos-x",this.posX),this.style.setProperty("--pos-y",this.posY),this.style.setProperty("--delay",this.delay)}static get styles(){return i(":host {\n position: absolute;\n left: var(--pos-x, 50%);\n top: var(--pos-y, 50%);\n user-select: none;\n pointer-events: none;\n opacity: 0;\n animation: burst-appear 0.01s linear forwards;\n animation-delay: var(--delay, 0s);\n}\n\n@keyframes burst-appear {\n to {\n opacity: 1;\n }\n}")}};t([a({type:String})],h.prototype,"posX",void 0),t([a({type:String})],h.prototype,"posY",void 0),t([a({type:String})],h.prototype,"delay",void 0),t([a({type:Number})],h.prototype,"scale",void 0),t([a({type:String})],h.prototype,"burstType",void 0),h=t([e("advanced-camera-card-firework-burst")],h);let y=class extends l{constructor(){super(...arguments),this._bursts=[],this._burstIdCounter=0,this._timer=new o}connectedCallback(){super.connectedCallback(),this._startFireworks()}disconnectedCallback(){super.disconnectedCallback(),this._stopFireworks()}_startFireworks(){this._createBursts(3),this._timer.startRepeated(2,(()=>{const t=Math.floor(4*Math.random())+2;this._createBursts(t)}))}_stopFireworks(){this._timer.stop()}_createBursts(t){const a=[];for(let e=0;e<t;e++)a.push(this._createBurstConfig());this._bursts=a}_createBurstConfig(){const t=Math.random()<.2?.5*Math.random()+1.5:.4*Math.random()+.8,a=Math.random();let e;return e=a<.6?"standard":a<.85?"ring":"palm",{id:this._burstIdCounter++,posX:80*Math.random()+10+"%",posY:60*Math.random()+20+"%",delay:1.2*Math.random()+"s",scale:t,burstType:e}}render(){return s`
|
||||
${d(this._bursts,(t=>t.id),(t=>s`
|
||||
<advanced-camera-card-firework-burst
|
||||
.posX=${t.posX}
|
||||
.posY=${t.posY}
|
||||
.delay=${t.delay}
|
||||
.scale=${t.scale}
|
||||
.burstType=${t.burstType}
|
||||
></advanced-camera-card-firework-burst>
|
||||
`))}
|
||||
`}};t([n()],y.prototype,"_bursts",void 0),y=t([e("advanced-camera-card-effect-fireworks")],y);export{y as AdvancedCameraCardEffectFireworks};
|
||||
Binary file not shown.
@@ -0,0 +1,27 @@
|
||||
import{dh as e,dd as a,ds as r,di as t,_ as n,n as o,t as s,a as i,x as l,e as d,dS as c,a4 as h,l as u,dT as m,r as g}from"./card-b98d578d.js";import"./gallery-core-05218fbc.js";import"./endOfDay-8eba624c.js";import"./date-picker-a6a20636.js";class y{constructor(e){this._host=e}setThumbnailSize(a){this._host.style.setProperty("--advanced-camera-card-thumbnail-size",`${a??e}px`)}getColumnWidth(a){return a?a.show_details?200:a.size:e}getColumnCountRoundMethod(e){return e?.show_details?"floor":"ceil"}itemClickHandler(e,n,o,s){a(o);const i=e.getView();if(i)if(r.isMedia(n))e.setViewByParameters({params:{view:"media",queryResults:i.queryResults?.clone().selectResultIfFound((e=>e===n))}});else if(r.isFolder(n)&&t.isFolderQuery(i.query)){const a=i.query.getQuery();if(!a||!s)return;const r=s.generateChildFolderQuery(a,n);if(!r)return;e.setViewByParametersWithExistingQuery({params:{query:i.query.clone().setQuery(r)}})}}}let v=class extends i{constructor(){super(...arguments),this._controller=new y(this)}willUpdate(e){e.has("galleryConfig")&&this._controller.setThumbnailSize(this.galleryConfig?.controls.thumbnails.size)}_renderThumbnail(e,a,r){return l`<advanced-camera-card-thumbnail
|
||||
class=${d({selected:a})}
|
||||
.hass=${this.hass}
|
||||
.item=${e}
|
||||
.viewManagerEpoch=${this.viewManagerEpoch}
|
||||
.viewItemManager=${this.viewItemManager}
|
||||
?selected=${a}
|
||||
?details=${!!this.galleryConfig?.controls.thumbnails.show_details}
|
||||
?show_favorite_control=${!!this.galleryConfig?.controls.thumbnails.show_favorite_control}
|
||||
?show_timeline_control=${!!this.galleryConfig?.controls.thumbnails.show_timeline_control}
|
||||
?show_download_control=${!!this.galleryConfig?.controls.thumbnails.show_download_control}
|
||||
@click=${a=>r(e,a)}
|
||||
>
|
||||
</advanced-camera-card-thumbnail>`}_renderThumbnails(){const e=this.viewManagerEpoch?.manager.getView()?.queryResults?.getSelectedResult();return l`
|
||||
${this.viewManagerEpoch?.manager.getView()?.queryResults?.getResults()?.map((a=>this._renderThumbnail(a,a===e,((e,a)=>{const r=this.viewManagerEpoch?.manager;r&&this._controller.itemClickHandler(r,e,a,this.foldersManager)}))))}
|
||||
`}render(){const e=!!this.viewManagerEpoch?.manager.getView()?.context?.loading?.query,a=c(this.viewManagerEpoch?.manager.getView());return l`
|
||||
<advanced-camera-card-surround-basic>
|
||||
${this.viewManagerEpoch?.manager.getView()?.queryResults?.hasResults()||!e&&a?l`<advanced-camera-card-gallery-core
|
||||
.hass=${this.hass}
|
||||
.columnWidth=${this._controller.getColumnWidth(this.galleryConfig?.controls.thumbnails)}
|
||||
.columnCountRoundMethod=${this._controller.getColumnCountRoundMethod(this.galleryConfig?.controls.thumbnails)}
|
||||
>
|
||||
${a?this._renderThumbnail(a,!1,((e,a)=>m(e,a,this.viewManagerEpoch))):""}
|
||||
${this._renderThumbnails()}
|
||||
</advanced-camera-card-gallery-core>`:h({type:"info",message:u(e?"error.awaiting_folder":"common.no_folder"),icon:"mdi:folder-play",dotdotdot:e})}
|
||||
</advanced-camera-card-surround-basic>
|
||||
`}static get styles(){return g(":host {\n width: 100%;\n height: 100%;\n display: block;\n}\n\nadvanced-camera-card-surround-basic {\n max-height: 110dvh;\n}\n\nadvanced-camera-card-thumbnail {\n height: 100%;\n min-height: var(--advanced-camera-card-thumbnail-size);\n background-color: var(--secondary-background-color);\n}\n\nadvanced-camera-card-thumbnail:not([details]) {\n width: 100%;\n}\n\nadvanced-camera-card-thumbnail.selected {\n border: 4px solid var(--accent-color);\n border-radius: calc(var(--advanced-camera-card-border-radius-final) + 4px);\n}")}};n([o({attribute:!1})],v.prototype,"hass",void 0),n([o({attribute:!1})],v.prototype,"viewManagerEpoch",void 0),n([o({attribute:!1})],v.prototype,"viewItemManager",void 0),n([o({attribute:!1})],v.prototype,"galleryConfig",void 0),n([o({attribute:!1})],v.prototype,"foldersManager",void 0),v=n([s("advanced-camera-card-folder-gallery")],v);export{v as AdvancedCameraCardFolderGallery};
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
import"./card-b98d578d.js";
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1 @@
|
||||
const e=e=>{const s=[...e.pc?["webrtc"]:[],...!e.pc&&e.mseCodecs?["mse","hls"]:[]];return s.length?s:void 0};export{e as g};
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
import{x as n,r as e,_ as s,t}from"./card-b98d578d.js";import{B as o}from"./base-91ab3d27.js";let a=class extends o{render(){return n`<span class="ghost">👻</span>`}static get styles(){return e(":host {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: opacity 1.5s ease-in;\n}\n\n.ghost {\n font-size: 10em;\n color: #ffffff;\n user-select: none;\n pointer-events: none;\n opacity: 0.5;\n filter: drop-shadow(0 0 20px #ffffff) drop-shadow(0 0 40px #e0e0e0) drop-shadow(0 0 60px #c0c0c0);\n animation: ghost-float 3s ease-in-out infinite;\n}\n\n@keyframes ghost-float {\n 0%, 100% {\n transform: translateY(0);\n filter: drop-shadow(0 0 20px #ffffff) drop-shadow(0 0 40px #e0e0e0) drop-shadow(0 0 60px #c0c0c0);\n }\n 50% {\n transform: translateY(-10px);\n filter: drop-shadow(0 0 30px #ffffff) drop-shadow(0 0 60px #e0e0e0) drop-shadow(0 0 90px #c0c0c0);\n }\n}")}};a=s([t("advanced-camera-card-effect-ghost")],a);export{a as AdvancedCameraCardEffectGhost};
|
||||
Binary file not shown.
@@ -0,0 +1,70 @@
|
||||
import{_ as e,t,a4 as a,x as s,df as r,dp as i,dq as d,dr as o,dn as l,r as n,f0 as h,eS as c,d6 as p,a as m,d7 as u,d9 as y,n as _}from"./card-b98d578d.js";import{c as $,e as v}from"./image-player-46de9efa.js";import{d as g}from"./dispatch-live-error-5bb8d032.js";import{V as b,h as f,M as C,a as w,b as P}from"./audio-13475a81.js";customElements.whenDefined("ha-web-rtc-player").then((()=>{const c=customElements.get("ha-web-rtc-player");let p=class extends c{constructor(){super(...arguments),this._mediaPlayerController=new b(this,(()=>this._videoEl),(()=>this.controls)),this._audioTracksMuteStateCleanup=null,this._addTrack=async e=>{this._remoteStream&&(this._remoteStream.addTrack(e.track),this.hasUpdated||await this.updateComplete,this._videoEl.srcObject=this._remoteStream)}}async getMediaPlayerController(){return this._mediaPlayerController}async _startWebRtc(){await super._startWebRtc(),this.isConnected||this._cleanUp()}render(){return this._error?(g(this),a({type:"error",message:this._error,context:{entity_id:this.entityid}})):s`
|
||||
<video
|
||||
id="remote-stream"
|
||||
?autoplay=${this.autoPlay}
|
||||
.muted=${this.muted}
|
||||
?playsinline=${this.playsInline}
|
||||
?controls=${this.controls}
|
||||
poster=${r(this.posterUrl)}
|
||||
@loadedmetadata=${()=>{this.controls&&f(this._videoEl,C)}}
|
||||
@loadeddata=${e=>this._loadedDataHandler(e)}
|
||||
@volumechange=${()=>i(this)}
|
||||
@play=${()=>d(this)}
|
||||
@pause=${()=>o(this)}
|
||||
></video>
|
||||
`}_loadedDataHandler(e){super._loadedData(),l(this,e,{mediaPlayerController:this._mediaPlayerController,capabilities:{supportsPause:!0,hasAudio:w(this._videoEl,this._peerConnection)},technology:["webrtc"]}),this._audioTracksMuteStateCleanup?.(),this._audioTracksMuteStateCleanup=P(this._peerConnection,(()=>{l(this,this._videoEl,{mediaPlayerController:this._mediaPlayerController,capabilities:{supportsPause:!0,hasAudio:w(this._videoEl,this._peerConnection)},technology:["webrtc"]})}))}_cleanUp(){super._cleanUp(),this._audioTracksMuteStateCleanup?.(),this._audioTracksMuteStateCleanup=null}static get styles(){return[super.styles,n($),h`
|
||||
:host {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
video {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
`]}};p=e([t("advanced-camera-card-ha-web-rtc-player")],p)})),customElements.whenDefined("ha-camera-stream").then((()=>{const a="web_rtc",r="mjpeg";let i=class extends(customElements.get("ha-camera-stream")){constructor(){super(...arguments),this._mediaLoadedInfoPerStream={},this._mediaLoadedInfoDispatched=null}async getMediaPlayerController(){return await this.updateComplete,await(this._player?.getMediaPlayerController())??null}_storeMediaLoadedInfoHandler(e,t){this._storeMediaLoadedInfo(e,t.detail),t.stopPropagation()}_storeMediaLoadedInfo(e,t){this._mediaLoadedInfoPerStream[e]=t,this.requestUpdate()}_renderStream(e){return this.stateObj?e.type===r?s`
|
||||
<advanced-camera-card-image-player
|
||||
@advanced-camera-card:media:loaded=${e=>{this._storeMediaLoadedInfo(r,e.detail),e.stopPropagation()}}
|
||||
src=${void 0===this._connected||this._connected?(t=this.stateObj,`/api/camera_proxy_stream/${t.entity_id}?token=${t.attributes.access_token}`):this._posterUrl||""}
|
||||
technology="mjpeg"
|
||||
class="player"
|
||||
></advanced-camera-card-image-player>
|
||||
`:"hls"===e.type?s` <advanced-camera-card-ha-hls-player
|
||||
?autoplay=${!1}
|
||||
playsinline
|
||||
.allowExoPlayer=${this.allowExoPlayer}
|
||||
.muted=${this.muted}
|
||||
.controls=${this.controls}
|
||||
.hass=${this.hass}
|
||||
.entityid=${this.stateObj.entity_id}
|
||||
.posterUrl=${this._posterUrl}
|
||||
@advanced-camera-card:media:loaded=${e=>{this._storeMediaLoadedInfoHandler("hls",e),e.stopPropagation()}}
|
||||
@streams=${this._handleHlsStreams}
|
||||
class="player ${e.visible?"":"hidden"}"
|
||||
></advanced-camera-card-ha-hls-player>`:e.type===a?s`<advanced-camera-card-ha-web-rtc-player
|
||||
?autoplay=${!1}
|
||||
playsinline
|
||||
.muted=${this.muted}
|
||||
.controls=${this.controls}
|
||||
.hass=${this.hass}
|
||||
.entityid=${this.stateObj.entity_id}
|
||||
.posterUrl=${this._posterUrl}
|
||||
@advanced-camera-card:media:loaded=${e=>{this._storeMediaLoadedInfoHandler(a,e),e.stopPropagation()}}
|
||||
@streams=${this._handleWebRtcStreams}
|
||||
class="player ${e.visible?"":"hidden"}"
|
||||
></advanced-camera-card-ha-web-rtc-player>`:c:c;var t}updated(e){super.updated(e);const t=this._streams(this._capabilities?.frontend_stream_types,this._hlsStreams,this._webRtcStreams,this.muted).find((e=>e.visible))??null;if(t){const e=this._mediaLoadedInfoPerStream[t.type];e&&e!==this._mediaLoadedInfoDispatched&&(this._mediaLoadedInfoDispatched=e,p(this,e))}}static get styles(){return[super.styles,n($),h`
|
||||
:host {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
`]}};e([v(".player:not(.hidden)")],i.prototype,"_player",void 0),i=e([t("advanced-camera-card-ha-camera-stream")],i)}));let M=class extends m{constructor(){super(...arguments),this.controls=!1,this._playerRef=u()}async getMediaPlayerController(){return await this.updateComplete,await(this._playerRef.value?.getMediaPlayerController())??null}render(){if(this.hass)return s` <advanced-camera-card-ha-camera-stream
|
||||
${y(this._playerRef)}
|
||||
.hass=${this.hass}
|
||||
.stateObj=${this.cameraConfig?.camera_entity?this.hass.states[this.cameraConfig.camera_entity]:void 0}
|
||||
.controls=${this.controls}
|
||||
.muted=${!0}
|
||||
>
|
||||
</advanced-camera-card-ha-camera-stream>`}static get styles(){return n(":host {\n width: 100%;\n height: 100%;\n display: block;\n}")}};e([_({attribute:!1})],M.prototype,"hass",void 0),e([_({attribute:!1})],M.prototype,"cameraConfig",void 0),e([_({attribute:!0,type:Boolean})],M.prototype,"controls",void 0),M=e([t("advanced-camera-card-live-ha")],M);export{M as AdvancedCameraCardLiveHA};
|
||||
Binary file not shown.
@@ -0,0 +1,16 @@
|
||||
import{_ as t,n as a,t as e,a as s,x as r,r as n}from"./card-b98d578d.js";import{c as i}from"./repeat-08ca48e7.js";import{B as o}from"./base-91ab3d27.js";let h=class extends s{constructor(){super(...arguments),this.char="❤️",this.size="1em",this.hue=340,this.saturation=80,this.lightness=55,this.maxOpacity=1,this.pulseDuration="3s",this.pulseDelay="0s",this.startX="0%",this.startY="0%",this._handleAnimationIteration=t=>{"pulse"===t.animationName&&(this.startX=100*Math.random()+"%",this.startY=100*Math.random()+"%")}}connectedCallback(){super.connectedCallback(),this.addEventListener("animationiteration",this._handleAnimationIteration)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("animationiteration",this._handleAnimationIteration)}render(){return r`${this.char}`}updated(){this.style.setProperty("--size",this.size),this.style.setProperty("--hue",`${this.hue}`),this.style.setProperty("--saturation",`${this.saturation}`),this.style.setProperty("--lightness",`${this.lightness}`),this.style.setProperty("--max-opacity",`${this.maxOpacity}`),this.style.setProperty("--pulse-duration",this.pulseDuration),this.style.setProperty("--pulse-delay",this.pulseDelay),this.style.setProperty("--start-x",this.startX),this.style.setProperty("--start-y",this.startY)}static get styles(){return n(":host {\n position: absolute;\n left: var(--start-x);\n top: var(--start-y);\n font-size: var(--size, 1em);\n color: hsl(var(--hue, 340), var(--saturation, 80%), var(--lightness, 55%));\n user-select: none;\n pointer-events: none;\n will-change: transform;\n animation: pulse var(--pulse-duration) ease-in-out infinite;\n animation-delay: var(--pulse-delay);\n}\n\n@keyframes pulse {\n 0% {\n transform: scale(0);\n opacity: 0;\n }\n 15% {\n opacity: var(--max-opacity, 1);\n }\n 50% {\n transform: scale(1.3);\n }\n 85% {\n opacity: var(--max-opacity, 1);\n }\n 100% {\n transform: scale(0);\n opacity: 0;\n }\n}")}};t([a({type:String})],h.prototype,"char",void 0),t([a({type:String})],h.prototype,"size",void 0),t([a({type:Number})],h.prototype,"hue",void 0),t([a({type:Number})],h.prototype,"saturation",void 0),t([a({type:Number})],h.prototype,"lightness",void 0),t([a({type:Number})],h.prototype,"maxOpacity",void 0),t([a({type:String})],h.prototype,"pulseDuration",void 0),t([a({type:String})],h.prototype,"pulseDelay",void 0),t([a({type:String})],h.prototype,"startX",void 0),t([a({type:String})],h.prototype,"startY",void 0),h=t([e("advanced-camera-card-heart")],h);const p=["❤️","💖","💕","💗","💓"];let l=class extends o{constructor(){super(),this._hearts=Array.from({length:50},((t,a)=>{const e=4*Math.random()+4,s=-Math.random()*e*.8;return{id:a,char:p[Math.floor(Math.random()*p.length)],size:1.5*Math.random()+.5+"em",hue:40*Math.random()+320,saturation:40*Math.random()+60,lightness:20*Math.random()+45,maxOpacity:.5*Math.random()+.2,pulseDuration:`${e}s`,pulseDelay:`${s}s`,startX:100*Math.random()+"%",startY:100*Math.random()+"%"}}))}render(){return r`
|
||||
${i(this._hearts,(t=>t.id),(t=>r`
|
||||
<advanced-camera-card-heart
|
||||
.char=${t.char}
|
||||
.size=${t.size}
|
||||
.hue=${t.hue}
|
||||
.saturation=${t.saturation}
|
||||
.lightness=${t.lightness}
|
||||
.maxOpacity=${t.maxOpacity}
|
||||
.pulseDuration=${t.pulseDuration}
|
||||
.pulseDelay=${t.pulseDelay}
|
||||
.startX=${t.startX}
|
||||
.startY=${t.startY}
|
||||
></advanced-camera-card-heart>
|
||||
`))}
|
||||
`}};l=t([e("advanced-camera-card-effect-hearts")],l);export{l as AdvancedCameraCardEffectHearts};
|
||||
Binary file not shown.
@@ -0,0 +1,20 @@
|
||||
import{_ as a,n as i,t as g,a as I,d7 as e,x as C,db as o,d9 as M,r as t,dM as c}from"./card-b98d578d.js";import{i as n}from"./media-dimensions-container-677d7a50.js";import{r as m}from"./image-updating-player-fdcee69c.js";import"./zoomer-c5c2e275.js";let r=class extends I{constructor(){super(...arguments),this._refImage=e()}async getMediaPlayerController(){return await this.updateComplete,await(this._refImage.value?.getMediaPlayerController())??null}_renderContainer(a){const i=c,g=this.viewManagerEpoch?.manager.getView(),I=m({imageConfig:this.imageConfig,cameraConfig:this.cameraConfig}),e=C` <advanced-camera-card-media-dimensions-container
|
||||
.dimensionsConfig=${"camera"===I?this.cameraConfig?.dimensions:void 0}
|
||||
>
|
||||
${a}
|
||||
</advanced-camera-card-media-dimensions-container>`;return C` ${this.imageConfig?.zoomable?C`<advanced-camera-card-zoomer
|
||||
.defaultSettings=${n([this.imageConfig,this.cameraConfig?.dimensions?.layout],(()=>"camera"===I&&this.cameraConfig?.dimensions?.layout?{pan:this.cameraConfig.dimensions.layout.pan,zoom:this.cameraConfig.dimensions.layout.zoom}:void 0))}
|
||||
.settings=${g?.context?.zoom?.[i]?.requested}
|
||||
@advanced-camera-card:zoom:change=${a=>o(a,this.viewManagerEpoch?.manager,i)}
|
||||
>
|
||||
${e}
|
||||
</advanced-camera-card-zoomer>`:e}`}render(){if(this.hass&&this.cameraConfig)return this._renderContainer(C`
|
||||
<advanced-camera-card-image-updating-player
|
||||
${M(this._refImage)}
|
||||
.hass=${this.hass}
|
||||
.view=${this.viewManagerEpoch?.manager.getView()}
|
||||
.imageConfig=${this.imageConfig}
|
||||
.cameraConfig=${this.cameraConfig}
|
||||
>
|
||||
</advanced-camera-card-image-updating-player>
|
||||
`)}static get styles(){return t(':host {\n background-color: var(--advanced-camera-card-background);\n background-position: center;\n background-repeat: no-repeat;\n background-image: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgaW5rc2NhcGU6dmVyc2lvbj0iMS4yLjIgKGIwYTg0ODY1NDEsIDIwMjItMTItMDEpIgogICBzb2RpcG9kaTpkb2NuYW1lPSJpcmlzLW91dGxpbmUuc3ZnIgogICBpZD0ic3ZnNCIKICAgdmVyc2lvbj0iMS4xIgogICB2aWV3Qm94PSIwIDAgMjQgMjQiCiAgIHhtbG5zOmlua3NjYXBlPSJodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy9uYW1lc3BhY2VzL2lua3NjYXBlIgogICB4bWxuczpzb2RpcG9kaT0iaHR0cDovL3NvZGlwb2RpLnNvdXJjZWZvcmdlLm5ldC9EVEQvc29kaXBvZGktMC5kdGQiCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c3ZnPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPGRlZnMKICAgICBpZD0iZGVmczgiIC8+CiAgPHNvZGlwb2RpOm5hbWVkdmlldwogICAgIGlkPSJuYW1lZHZpZXc2IgogICAgIHBhZ2Vjb2xvcj0iI2I5M2UzZSIKICAgICBib3JkZXJjb2xvcj0iIzAwMDAwMCIKICAgICBib3JkZXJvcGFjaXR5PSIwLjI1IgogICAgIGlua3NjYXBlOnNob3dwYWdlc2hhZG93PSIyIgogICAgIGlua3NjYXBlOnBhZ2VvcGFjaXR5PSIwLjYwNzg0MzE0IgogICAgIGlua3NjYXBlOnBhZ2VjaGVja2VyYm9hcmQ9ImZhbHNlIgogICAgIGlua3NjYXBlOmRlc2tjb2xvcj0iI2QxZDFkMSIKICAgICBzaG93Z3JpZD0iZmFsc2UiCiAgICAgaW5rc2NhcGU6em9vbT0iMTkuMzc4NTc4IgogICAgIGlua3NjYXBlOmN4PSI4LjI4MjM0MTUiCiAgICAgaW5rc2NhcGU6Y3k9IjEyLjM1OTAwOCIKICAgICBpbmtzY2FwZTp3aW5kb3ctd2lkdGg9IjM4NDAiCiAgICAgaW5rc2NhcGU6d2luZG93LWhlaWdodD0iMTUyNyIKICAgICBpbmtzY2FwZTp3aW5kb3cteD0iMTA4MCIKICAgICBpbmtzY2FwZTp3aW5kb3cteT0iMjI3IgogICAgIGlua3NjYXBlOndpbmRvdy1tYXhpbWl6ZWQ9IjEiCiAgICAgaW5rc2NhcGU6Y3VycmVudC1sYXllcj0ic3ZnNCIgLz4KICA8ZwogICAgIGlkPSJnMTExOSIKICAgICBzdHlsZT0iZmlsbC1vcGFjaXR5OjAuMDU7ZmlsbDojZmZmZmZmIj4KICAgIDxjaXJjbGUKICAgICAgIHN0eWxlPSJkaXNwbGF5OmlubGluZTtmaWxsOiMwMDAwMDA7ZmlsbC1vcGFjaXR5OjAuNDk3ODI4MjU7c3Ryb2tlLXdpZHRoOjEuMzk3Mjk7b3BhY2l0eTowLjUiCiAgICAgICBpZD0icGF0aDE3MCIKICAgICAgIGN4PSIxMiIKICAgICAgIGN5PSIxMiIKICAgICAgIGlua3NjYXBlOmxhYmVsPSJCYWNrZ3JvdW5kIgogICAgICAgcj0iMTEuMjUiIC8+CiAgICA8cGF0aAogICAgICAgZD0iTSAxMy43MzAwMDEsMTUgOS44MzAwMDAzLDIxLjc2IEMgMTAuNTMsMjEuOTEgMTEuMjUsMjIgMTIsMjIgYyAyLjQwMDAwMSwwIDQuNiwtMC44NSA2LjMyLC0yLjI1IEwgMTQuNjYwMDAxLDEzLjQgTSAyLjQ2MDAwMDMsMTUgYyAwLjkyLDIuOTIgMy4xNSw1LjI2IDUuOTksNi4zNCBMIDEyLjEyLDE1IG0gLTMuNTc5OTk5NywtMyAtMy45LC02Ljc0OTk5OTYgYyAtMS42NCwxLjc0OTk5OSAtMi42NCw0LjEzOTk5OTMgLTIuNjQsNi43NDk5OTk2IDAsMC42OCAwLjA3LDEuMzUgMC4yLDIgaCA3LjQ5IE0gMjEuOCw5Ljk5OTk5OTcgSCAxNC4zMTAwMDEgTCAxNC42MDAwMDEsMTAuNSAxOS4zNiwxOC43NSBDIDIxLDE2Ljk3IDIyLDE0LjYgMjIsMTIgMjIsMTEuMzEgMjEuOTMsMTAuNjQgMjEuOCw5Ljk5OTk5OTcgbSAtMC4yNiwtMSBDIDIwLjYyLDYuMDcwMDAwNSAxOC4zOSwzLjc0MDAwMDIgMTUuNTUwMDAxLDIuNjYwMDAwMiBMIDExLjg4LDguOTk5OTk5NyBNIDkuNDAwMDAwMywxMC41IDE0LjE3MDAwMSwyLjI0MDAwMDIgYyAtMC43LC0wLjE1IC0xLjQyMDAwMSwtMC4yNCAtMi4xNzAwMDEsLTAuMjQgLTIuMzk5OTk5NywwIC00LjU5OTk5OTcsMC44NCAtNi4zMTk5OTk3LDIuMjUwMDAwMyBsIDMuNjYsNi4zNDk5OTk1IHoiCiAgICAgICBpZD0icGF0aDIiCiAgICAgICBpbmtzY2FwZTpsYWJlbD0iSXJpcyIKICAgICAgIHN0eWxlPSJmaWxsLW9wYWNpdHk6MC41MDIyMTAwMjtmaWxsOiNmZmZmZmY7b3BhY2l0eTowLjc1IiAvPgogIDwvZz4KPC9zdmc+Cg==");\n background-size: 10%;\n background-position: center;\n}\n\n:host {\n width: 100%;\n height: 100%;\n display: block;\n}\n\n.zoom-wrapper {\n display: block;\n width: 100%;\n height: 100%;\n}')}};a([i({attribute:!1})],r.prototype,"hass",void 0),a([i({attribute:!1})],r.prototype,"viewManagerEpoch",void 0),a([i({attribute:!1})],r.prototype,"cameraConfig",void 0),a([i({attribute:!1})],r.prototype,"cameraManager",void 0),a([i({attribute:!1})],r.prototype,"imageConfig",void 0),r=a([g("advanced-camera-card-image")],r);export{r as AdvancedCameraCardImage};
|
||||
Binary file not shown.
@@ -0,0 +1,9 @@
|
||||
import{a,d7 as e,x as t,d9 as r,r as i,dg as s,_ as d,n,t as o}from"./card-b98d578d.js";import"./image-updating-player-fdcee69c.js";let g=class extends a{constructor(){super(...arguments),this._refImage=e()}async getMediaPlayerController(){return await this.updateComplete,await(this._refImage.value?.getMediaPlayerController())??null}render(){if(this.hass&&this.cameraConfig)return t`
|
||||
<advanced-camera-card-image-updating-player
|
||||
${r(this._refImage)}
|
||||
.hass=${this.hass}
|
||||
.imageConfig=${this.cameraConfig.image}
|
||||
.cameraConfig=${this.cameraConfig}
|
||||
>
|
||||
</advanced-camera-card-image-updating-player>
|
||||
`}static get styles(){return i(s)}};d([n({attribute:!1})],g.prototype,"hass",void 0),d([n({attribute:!1})],g.prototype,"cameraConfig",void 0),g=d([o("advanced-camera-card-live-image")],g);export{g as AdvancedCameraCardLiveImage};
|
||||
Binary file not shown.
@@ -0,0 +1,38 @@
|
||||
import{_ as e,t as a,a4 as t,dj as r,x as o,dp as i,dq as s,dr as n,dn as d,r as l,f0 as c,f3 as h,n as m,a as u,d7 as y,d9 as v,df as p}from"./card-b98d578d.js";import{d as g}from"./dispatch-live-error-5bb8d032.js";import{V as b,h as _,m as f,M as w}from"./audio-13475a81.js";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/const x=(e,a,t)=>(t.configurable=!0,t.enumerable=!0,Reflect.decorate&&"object"!=typeof a&&Object.defineProperty(e,a,t),t)
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/;function C(e,a){return(t,r,o)=>{const i=a=>a.renderRoot?.querySelector(e)??null;if(a){const{get:e,set:a}="object"==typeof r?t:o??(()=>{const e=Symbol();return{get(){return this[e]},set(a){this[e]=a}}})();return x(t,r,{get(){let t=e.call(this);return void 0===t&&(t=i(this),(null!==t||this.hasUpdated)&&a.call(this,t)),t}})}return x(t,r,{get(){return i(this)}})}}var P="img,\nvideo {\n object-fit: var(--advanced-camera-card-media-layout-fit, contain);\n object-position: var(--advanced-camera-card-media-layout-position-x, 50%) var(--advanced-camera-card-media-layout-position-y, 50%);\n object-view-box: inset(var(--advanced-camera-card-media-layout-view-box-top, 0%) var(--advanced-camera-card-media-layout-view-box-right, 0%) var(--advanced-camera-card-media-layout-view-box-bottom, 0%) var(--advanced-camera-card-media-layout-view-box-left, 0%));\n}";customElements.whenDefined("ha-hls-player").then((()=>{const h=customElements.get("ha-hls-player");let m=class extends h{constructor(){super(...arguments),this._mediaPlayerController=new b(this,(()=>this._video),(()=>this.controls))}async getMediaPlayerController(){return this._mediaPlayerController}render(){if(this._error){if(this._errorIsFatal)return g(this),t({type:"error",message:this._error,context:{entity_id:this.entityid}});r(this._error,console.error)}return o`
|
||||
<video
|
||||
id="video"
|
||||
.poster=${this.posterUrl}
|
||||
?autoplay=${this.autoPlay}
|
||||
.muted=${this.muted}
|
||||
?playsinline=${this.playsInline}
|
||||
?controls=${this.controls}
|
||||
@loadedmetadata=${()=>{this.controls&&_(this._video,w)}}
|
||||
@loadeddata=${e=>this._loadedDataHandler(e)}
|
||||
@volumechange=${()=>i(this)}
|
||||
@play=${()=>s(this)}
|
||||
@pause=${()=>n(this)}
|
||||
></video>
|
||||
`}_loadedDataHandler(e){super._loadedData(),d(this,e,{mediaPlayerController:this._mediaPlayerController,capabilities:{supportsPause:!0,hasAudio:f(this._video)},technology:["hls"]})}static get styles(){return[super.styles,l(P),c`
|
||||
:host {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
video {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
`]}};e([C("#video")],m.prototype,"_video",void 0),m=e([a("advanced-camera-card-ha-hls-player")],m)}));class j{constructor(e,a){this._host=e,this._getImageCallback=a}async play(){}async pause(){}async mute(){}async unmute(){}isMuted(){return!0}async seek(e){}async setControls(e){}isPaused(){return!1}async getScreenshotURL(){await this._host.updateComplete;const e=this._getImageCallback();return e?h(e):null}getFullscreenElement(){return this._getImageCallback()??null}}let $=class extends u{constructor(){super(...arguments),this._refImage=y(),this._mediaPlayerController=new j(this,(()=>this._refImage.value??null))}async getMediaPlayerController(){return this._mediaPlayerController}render(){return o`<img
|
||||
${v(this._refImage)}
|
||||
src="${p(this.url)}"
|
||||
@load=${e=>{d(this,e,{...this._mediaPlayerController&&{mediaPlayerController:this._mediaPlayerController},technology:[this.technology??"jpg"]})}}
|
||||
/>`}static get styles(){return l(":host {\n width: 100%;\n height: 100%;\n display: block;\n}\n\nimg {\n width: 100%;\n height: 100%;\n display: block;\n object-fit: var(--advanced-camera-card-media-layout-fit, contain);\n object-position: var(--advanced-camera-card-media-layout-position-x, 50%) var(--advanced-camera-card-media-layout-position-y, 50%);\n object-view-box: inset(var(--advanced-camera-card-media-layout-view-box-top, 0%) var(--advanced-camera-card-media-layout-view-box-right, 0%) var(--advanced-camera-card-media-layout-view-box-bottom, 0%) var(--advanced-camera-card-media-layout-view-box-left, 0%));\n}")}};e([m()],$.prototype,"url",void 0),e([m()],$.prototype,"technology",void 0),$=e([a("advanced-camera-card-image-player")],$);export{P as c,C as e};
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1 @@
|
||||
import{dx as e,eu as r,l as t,er as a,dw as o,dj as n}from"./card-b98d578d.js";const i=a.object({medias:a.array(a.string()).optional()}),s=a.object({producers:a.array(i).optional()}),c=async(a,o)=>{try{return await(async(a,o,n,i)=>{let s,c,d=o.endpoint;if(o.sign){try{d=await e(a,d)}catch(e){throw new r(t("error.failed_sign"),{endpoint:o,error:e})}if(!d)throw new r(t("error.failed_sign"),{endpoint:o})}try{s=await fetch(d,{...i?.timeoutSeconds&&{signal:AbortSignal.timeout(1e3*i.timeoutSeconds)}})}catch(e){throw new r(`${t("error.failed_fetch")}: ${d}`,{endpoint:o,error:e})}if(!s.ok)throw new r(t("error.failed_response"),{endpoint:o,response:s});try{c=await s.json()}catch(e){throw new r(t("error.invalid_response"),{endpoint:o,response:s,error:e})}const l=n.safeParse(c);if(!l.success)throw new r(t("error.invalid_response"),{endpoint:o,data:c,error:l.error});return l.data})(a,o,s,{timeoutSeconds:2})}catch(e){return n(e),null}},d=e=>"auto"===e?.live_provider?e.webrtc_card?.entity||e.webrtc_card?.url?"webrtc-card":e.camera_entity?"ha":e.frigate?.camera_name?"jsmpeg":"image":e?.live_provider??"image",l=async(e,r,t,a)=>"go2rtc"===d(r)&&(async(e,r,t)=>{if(!r)return!1;const a=await o(e,r,t,{context:"live",openLimit:1});return n=await c(e,a),!!n?.producers&&n.producers.some((e=>e.medias?.some((e=>e.includes("audio")&&(e.includes("sendonly")||e.includes("sendrecv"))))??!1));var n})(e,t,a);export{d as g,l};
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1,45 @@
|
||||
import{dh as e,di as a,dj as t,dk as r,dl as i,dm as n,dd as s,_ as o,n as l,t as d,a as c,x as h,e as g,a4 as u,l as m,r as y}from"./card-b98d578d.js";import"./gallery-core-05218fbc.js";import"./endOfDay-8eba624c.js";import"./date-picker-a6a20636.js";class v{constructor(e){this._media=null,this._host=e}getMedia(){return this._media}setMediaFromView(e,a){const t=e?.queryResults?.getResults()??null;null!==t?this._media&&a?.queryResults?.getResults()===t||(this._media=[...t].reverse()):this._media=null}setThumbnailSize(a){this._host.style.setProperty("--advanced-camera-card-thumbnail-size",`${a??e}px`)}getColumnWidth(a){return a?a.show_details?300:a.size:e}getColumnCountRoundMethod(e){return e?.show_details?"floor":"ceil"}async extendMediaGallery(e,s,o,l=!0){const d=s.manager.getView();if(!d)return;const c=d.query,h=d.queryResults?.getResults();if(!h||!c||!a.isMediaQuery(c))return;const g=c.getQuery()??null;if(!g)return;let u;try{u=await e.extendMediaQueries(g,h,o,{useCache:l})}catch(e){return void t(e)}if(u){const e=a.isEventQuery(c)?new r(u.queries):a.isRecordingQuery(c)?new i(u.queries):/* istanbul ignore next: this path cannot be reached -- @preserve */
|
||||
null;
|
||||
/* istanbul ignore else: this path cannot be reached, as we explicitly
|
||||
check for media queries above -- @preserve */e&&s.manager.setViewByParameters({baseView:d,params:{query:e,queryResults:new n({results:u.results}).selectResultIfFound((e=>e===d.queryResults?.getSelectedResult()))}})}}itemClickHandler(e,a,t){s(t);const r=e.getView();r&&this._media?.length&&e.setViewByParameters({params:{view:"media",queryResults:r.queryResults?.clone().selectIndex(this._media.length-a-1)}})}}const w={closed:"mdi:filter-cog-outline",open:"mdi:filter-cog"};let p=class extends c{constructor(){super(...arguments),this._controller=new v(this)}willUpdate(e){e.has("viewManagerEpoch")&&this._controller.setMediaFromView(this.viewManagerEpoch?.manager.getView(),this.viewManagerEpoch?.oldView),e.has("galleryConfig")&&this._controller.setThumbnailSize(this.galleryConfig?.controls.thumbnails.size)}_renderThumbnails(){const e=this.viewManagerEpoch?.manager.getView()?.queryResults?.getSelectedResult();return h`
|
||||
${this._controller.getMedia()?.map(((a,t)=>h`<advanced-camera-card-thumbnail
|
||||
class=${g({selected:a===e})}
|
||||
.hass=${this.hass}
|
||||
.cameraManager=${this.cameraManager}
|
||||
.viewItemManager=${this.viewItemManager}
|
||||
.item=${a}
|
||||
.viewManagerEpoch=${this.viewManagerEpoch}
|
||||
?selected=${a===e}
|
||||
?details=${!!this.galleryConfig?.controls.thumbnails.show_details}
|
||||
?show_favorite_control=${!!this.galleryConfig?.controls.thumbnails.show_favorite_control}
|
||||
?show_timeline_control=${!!this.galleryConfig?.controls.thumbnails.show_timeline_control}
|
||||
?show_download_control=${!!this.galleryConfig?.controls.thumbnails.show_download_control}
|
||||
@click=${e=>{const a=this.viewManagerEpoch?.manager;a&&this._controller.itemClickHandler(a,t,e)}}
|
||||
>
|
||||
</advanced-camera-card-thumbnail>`))}
|
||||
`}render(){const e=!!this.viewManagerEpoch?.manager.getView()?.context?.loading?.query;return h`
|
||||
<advanced-camera-card-surround-basic
|
||||
.drawerIcons=${{...this.galleryConfig&&"none"!==this.galleryConfig.controls.filter.mode&&{[this.galleryConfig.controls.filter.mode]:w}}}
|
||||
>
|
||||
${this.galleryConfig&&"none"!==this.galleryConfig.controls.filter.mode?h` <advanced-camera-card-media-filter
|
||||
.hass=${this.hass}
|
||||
.cameraManager=${this.cameraManager}
|
||||
.viewManagerEpoch=${this.viewManagerEpoch}
|
||||
.cardWideConfig=${this.cardWideConfig}
|
||||
slot=${this.galleryConfig.controls.filter.mode}
|
||||
>
|
||||
</advanced-camera-card-media-filter>`:""}
|
||||
${this._controller.getMedia()?.length?h`<advanced-camera-card-gallery-core
|
||||
.hass=${this.hass}
|
||||
.columnWidth=${this._controller.getColumnWidth(this.galleryConfig?.controls.thumbnails)}
|
||||
.columnCountRoundMethod=${this._controller.getColumnCountRoundMethod(this.galleryConfig?.controls.thumbnails)}
|
||||
.cardWideConfig=${this.cardWideConfig}
|
||||
.extendUp=${!0}
|
||||
.extendDown=${!0}
|
||||
@advanced-camera-card:gallery:extend:up=${e=>this._extendGallery(e,"later",!1)}
|
||||
@advanced-camera-card:gallery:extend:down=${e=>this._extendGallery(e,"earlier")}
|
||||
>
|
||||
${this._renderThumbnails()}
|
||||
</advanced-camera-card-gallery-core>`:u({type:"info",message:m(e?"error.awaiting_media":"common.no_media"),icon:"mdi:multimedia",dotdotdot:e})}
|
||||
</advanced-camera-card-surround-basic>
|
||||
`}async _extendGallery(e,a,t=!0){this.cameraManager&&this.viewManagerEpoch&&(await this._controller.extendMediaGallery(this.cameraManager,this.viewManagerEpoch,a,t),e.detail.resolve())}static get styles(){return y(":host {\n width: 100%;\n height: 100%;\n display: block;\n}\n\nadvanced-camera-card-surround-basic {\n max-height: 110dvh;\n}\n\nadvanced-camera-card-thumbnail {\n height: 100%;\n min-height: var(--advanced-camera-card-thumbnail-size);\n background-color: var(--secondary-background-color);\n}\n\nadvanced-camera-card-thumbnail:not([details]) {\n width: 100%;\n}\n\nadvanced-camera-card-thumbnail.selected {\n border: 4px solid var(--accent-color);\n border-radius: calc(var(--advanced-camera-card-border-radius-final) + 4px);\n}")}};o([l({attribute:!1})],p.prototype,"hass",void 0),o([l({attribute:!1})],p.prototype,"viewManagerEpoch",void 0),o([l({attribute:!1})],p.prototype,"galleryConfig",void 0),o([l({attribute:!1})],p.prototype,"cameraManager",void 0),o([l({attribute:!1})],p.prototype,"viewItemManager",void 0),o([l({attribute:!1})],p.prototype,"cardWideConfig",void 0),p=o([d("advanced-camera-card-media-gallery")],p);export{p as AdvancedCameraCardMediaGallery};
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
import{dN as e,dO as s,e4 as t,e5 as r,e6 as l,e7 as n,e8 as o,e9 as i,dP as a}from"./card-b98d578d.js";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/const u=(e,s,t)=>{const r=new Map;for(let l=s;l<=t;l++)r.set(e[l],l);return r},f=e(class extends s{constructor(e){if(super(e),e.type!==t.CHILD)throw Error("repeat() can only be used in text expressions")}dt(e,s,t){let r;void 0===t?t=s:void 0!==s&&(r=s);const l=[],n=[];let o=0;for(const s of e)l[o]=r?r(s,o):o,n[o]=t(s,o),o++;return{values:n,keys:l}}render(e,s,t){return this.dt(e,s,t).values}update(e,[s,t,f]){const c=r(e),{values:d,keys:h}=this.dt(s,t,f);if(!Array.isArray(c))return this.ut=h,d;const p=this.ut??=[],v=[];let y,x,g=0,k=c.length-1,m=0,w=d.length-1;for(;g<=k&&m<=w;)if(null===c[g])g++;else if(null===c[k])k--;else if(p[g]===h[m])v[m]=l(c[g],d[m]),g++,m++;else if(p[k]===h[w])v[w]=l(c[k],d[w]),k--,w--;else if(p[g]===h[w])v[w]=l(c[g],d[w]),n(e,v[w+1],c[g]),g++,w--;else if(p[k]===h[m])v[m]=l(c[k],d[m]),n(e,c[g],c[k]),k--,m++;else if(void 0===y&&(y=u(h,m,w),x=u(p,g,k)),y.has(p[g]))if(y.has(p[k])){const s=x.get(h[m]),t=void 0!==s?c[s]:null;if(null===t){const s=n(e,c[g]);l(s,d[m]),v[m]=s}else v[m]=l(t,d[m]),n(e,c[g],t),c[s]=null;m++}else o(c[k]),k--;else o(c[g]),g++;for(;m<=w;){const s=n(e,v[w+1]);l(s,d[m]),v[m++]=s}for(;g<=k;){const e=c[g++];null!==e&&o(e)}return this.ut=h,i(e,v),a}});export{f as c};
|
||||
Binary file not shown.
@@ -0,0 +1,12 @@
|
||||
import{_ as t,n as a,t as e,a as s,x as r,r as n}from"./card-b98d578d.js";import{c as i}from"./repeat-08ca48e7.js";import{B as o}from"./base-91ab3d27.js";let p=class extends s{constructor(){super(...arguments),this.char="☘️",this.size="1em",this.maxOpacity=1,this.pulseDuration="3s",this.pulseDelay="0s",this.startX="0%",this.startY="0%",this._handleAnimationIteration=t=>{"shamrock-pulse"===t.animationName&&(this.startX=100*Math.random()+"%",this.startY=100*Math.random()+"%")}}connectedCallback(){super.connectedCallback(),this.addEventListener("animationiteration",this._handleAnimationIteration)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("animationiteration",this._handleAnimationIteration)}render(){return r`${this.char}`}updated(){this.style.setProperty("--size",this.size),this.style.setProperty("--max-opacity",`${this.maxOpacity}`),this.style.setProperty("--pulse-duration",this.pulseDuration),this.style.setProperty("--pulse-delay",this.pulseDelay),this.style.setProperty("--start-x",this.startX),this.style.setProperty("--start-y",this.startY)}static get styles(){return n(":host {\n position: absolute;\n left: var(--start-x);\n top: var(--start-y);\n font-size: var(--size, 1em);\n transform-origin: center center;\n translate: -50% -50%;\n user-select: none;\n pointer-events: none;\n will-change: transform, opacity;\n animation: shamrock-pulse var(--pulse-duration) ease-in-out infinite;\n animation-delay: var(--pulse-delay);\n}\n\n@keyframes shamrock-pulse {\n 0% {\n scale: 0;\n rotate: -20deg;\n opacity: 0;\n }\n 20% {\n opacity: var(--max-opacity, 1);\n }\n 50% {\n scale: 1;\n rotate: 10deg;\n }\n 80% {\n opacity: var(--max-opacity, 1);\n }\n 100% {\n scale: 0;\n rotate: 25deg;\n opacity: 0;\n }\n}")}};t([a({type:String})],p.prototype,"char",void 0),t([a({type:String})],p.prototype,"size",void 0),t([a({type:Number})],p.prototype,"maxOpacity",void 0),t([a({type:String})],p.prototype,"pulseDuration",void 0),t([a({type:String})],p.prototype,"pulseDelay",void 0),t([a({type:String})],p.prototype,"startX",void 0),t([a({type:String})],p.prototype,"startY",void 0),p=t([e("advanced-camera-card-shamrock")],p);let c=class extends o{constructor(){super(),this._shamrocks=Array.from({length:10},((t,a)=>{const e=3*Math.random()+5,s=-Math.random()*e*.9;return{id:a,size:12*Math.random()+8+"em",maxOpacity:.3*Math.random()+.5,pulseDuration:`${e}s`,pulseDelay:`${s}s`,startX:80*Math.random()+10+"%",startY:80*Math.random()+10+"%"}}))}render(){return r`
|
||||
${i(this._shamrocks,(t=>t.id),(t=>r`
|
||||
<advanced-camera-card-shamrock
|
||||
.size=${t.size}
|
||||
.maxOpacity=${t.maxOpacity}
|
||||
.pulseDuration=${t.pulseDuration}
|
||||
.pulseDelay=${t.pulseDelay}
|
||||
.startX=${t.startX}
|
||||
.startY=${t.startY}
|
||||
></advanced-camera-card-shamrock>
|
||||
`))}
|
||||
`}};c=t([e("advanced-camera-card-effect-shamrocks")],c);export{c as AdvancedCameraCardEffectShamrocks};
|
||||
Binary file not shown.
@@ -0,0 +1,13 @@
|
||||
import{_ as t,n as a,t as r,a as e,x as n,r as s}from"./card-b98d578d.js";import{c as o}from"./repeat-08ca48e7.js";import{B as i}from"./base-91ab3d27.js";let l=class extends e{constructor(){super(...arguments),this.char="❄",this.size="1em",this.maxOpacity=1,this.fallDuration="10s",this.fallDelay="0s",this.startX="0%",this.endX="0%"}render(){return n`${this.char}`}updated(){this.style.setProperty("--max-opacity",`${this.maxOpacity}`),this.style.setProperty("--fall-duration",this.fallDuration),this.style.setProperty("--fall-delay",this.fallDelay),this.style.setProperty("--start-x",this.startX),this.style.setProperty("--end-x",this.endX),this.style.fontSize=this.size}static get styles(){return s(":host {\n position: absolute;\n left: var(--start-x);\n color: white;\n user-select: none;\n pointer-events: none;\n will-change: transform;\n animation: fall var(--fall-duration) linear infinite;\n animation-delay: var(--fall-delay);\n}\n\n@keyframes fall {\n 0% {\n top: -2em;\n transform: translateX(0);\n opacity: var(--max-opacity, 1);\n }\n 25% {\n top: 25%;\n transform: translateX(calc(var(--end-x) - var(--start-x) + 8px));\n }\n 50% {\n top: 50%;\n transform: translateX(calc(var(--end-x) - var(--start-x) - 10px));\n }\n 75% {\n top: 75%;\n transform: translateX(calc(var(--end-x) - var(--start-x) + 20px));\n }\n 90% {\n opacity: var(--max-opacity, 1);\n }\n 100% {\n top: 100%;\n transform: translateX(calc(var(--end-x) - var(--start-x)));\n opacity: 0;\n }\n}")}};t([a({type:String})],l.prototype,"char",void 0),t([a({type:String})],l.prototype,"size",void 0),t([a({type:Number})],l.prototype,"maxOpacity",void 0),t([a({type:String})],l.prototype,"fallDuration",void 0),t([a({type:String})],l.prototype,"fallDelay",void 0),t([a({type:String})],l.prototype,"startX",void 0),t([a({type:String})],l.prototype,"endX",void 0),l=t([r("advanced-camera-card-snowflake")],l);const p=["❄","❅","❆"];let c=class extends i{constructor(){super(),this._snowflakes=Array.from({length:50},((t,a)=>{const r=10*Math.random()+10,e=-Math.random()*r*.8;return{id:a,char:p[Math.floor(Math.random()*p.length)],size:1.5*Math.random()+.5+"em",maxOpacity:.5*Math.random()+.5,fallDuration:`${r}s`,fallDelay:`${e}s`,startX:100*Math.random()+"%",endX:100*Math.random()+"%"}}))}render(){return n`
|
||||
${o(this._snowflakes,(t=>t.id),(t=>n`
|
||||
<advanced-camera-card-snowflake
|
||||
.char=${t.char}
|
||||
.size=${t.size}
|
||||
.maxOpacity=${t.maxOpacity}
|
||||
.fallDuration=${t.fallDuration}
|
||||
.fallDelay=${t.fallDelay}
|
||||
.startX=${t.startX}
|
||||
.endX=${t.endX}
|
||||
></advanced-camera-card-snowflake>
|
||||
`))}
|
||||
`}};c=t([r("advanced-camera-card-effect-snow")],c);export{c as AdvancedCameraCardEffectSnow};
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
import{dU as t}from"./card-b98d578d.js";function s(s){const n=t(s);return n.setMinutes(59,59,999),n}function n(s){const n=t(s);return n.setMinutes(0,0,0),n}export{s as e,n as s};
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user