Home-AssistantConfig/config/www/community/frigate-hass-card/gallery-6281c347.js

166 lines
107 KiB
JavaScript
Raw Normal View History

2024-04-24 04:21:06 +00:00
import{d3 as e,bk as t,bl as r,cO as i,cP as o,c0 as n,d1 as a,y as s,cS as l,bj as c,s as d,cq as h,cp as g,bY as u,bZ as m,bn as p,l as f,ch as v,d4 as b,c6 as y,d5 as w,d6 as $,d7 as x,d8 as k,p as C,ce as _,cg as T,d9 as S,da as E,db as O,c2 as z,dc as M,bQ as L,dd as D,u as A,de as I,df as R,o as F,cU as H,bm as N}from"./card-555679fd.js";import{u as j}from"./uniqWith-12b3ff8a.js";import{s as W}from"./index-52dee8bb.js";import{p as B}from"./index-af8cf05c.js";
/**
* @license
* Copyright 2021 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
function q(t){return class extends t{createRenderRoot(){const t=this.constructor,{registry:r,elementDefinitions:i,shadowRootOptions:o}=t;i&&!r&&(t.registry=new CustomElementRegistry,Object.entries(i).forEach((([e,r])=>t.registry.define(e,r))));const n=this.renderOptions.creationScope=this.attachShadow({...o,customElements:t.registry});return e(n,this.constructor.elementStyles),n}}}const P=!0,V=!0,K=!0,U=!1,Y=!1;let G,Q,X,Z=!1,J=!1,ee=!1,te=!1,re=null,ie=!1;const oe="http://www.w3.org/1999/xlink",ne={},ae=e=>"object"===(e=typeof e)||"function"===e;const se=(e,t,...r)=>{let i=null,o=null,n=null,a=!1,s=!1;const l=[],c=t=>{for(let r=0;r<t.length;r++)i=t[r],Array.isArray(i)?c(i):null!=i&&"boolean"!=typeof i&&((a="function"!=typeof e&&!ae(i))&&(i=String(i)),a&&s?l[l.length-1].$text$+=i:l.push(a?le(null,i):i),s=a)};if(c(r),t){t.key&&(o=t.key),t.name&&(n=t.name);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}if("function"==typeof e)return e(null===t?{}:t,l,de);const d=le(e,null);return d.$attrs$=t,l.length>0&&(d.$children$=l),d.$key$=o,d.$name$=n,d},le=(e,t)=>{const r={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null,$attrs$:null,$key$:null,$name$:null};return r},ce={},de={forEach:(e,t)=>e.map(he).forEach(t),map:(e,t)=>e.map(he).map(t).map(ge)},he=e=>({vattrs:e.$attrs$,vchildren:e.$children$,vkey:e.$key$,vname:e.$name$,vtag:e.$tag$,vtext:e.$text$}),ge=e=>{if("function"==typeof e.vtag){const t=Object.assign({},e.vattrs);return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),se(e.vtag,t,...e.vchildren||[])}const t=le(e.vtag,e.vtext);return t.$attrs$=e.vattrs,t.$children$=e.vchildren,t.$key$=e.vkey,t.$name$=e.vname,t},ue=(e,t,r)=>{const i=e;return{emit:e=>me(i,t,{bubbles:!!(4&r),composed:!!(2&r),cancelable:!!(1&r),detail:e})}},me=(e,t,r)=>{const i=lt.ce(t,r);return e.dispatchEvent(i),i},pe=new WeakMap,fe=e=>{const t=e.$cmpMeta$,r=e.$hostElement$,i=t.$flags$,o=(t.$tagName$,()=>{}),n=((e,t,r,i)=>{var o;let n=ve(t,r);const a=it.get(n);if(e=11===e.nodeType?e:at,a)if("string"==typeof a){e=e.head||e;let t,r=pe.get(e);if(r||pe.set(e,r=new Set),!r.has(n)){{t=at.createElement("style"),t.innerHTML=a;const r=null!==(o=lt.$nonce$)&&void 0!==o?o:function(e){var t,r,i;return null!==(i=null===(r=null===(t=e.head)||void 0===t?void 0:t.querySelector('meta[name="csp-nonce"]'))||void 0===r?void 0:r.getAttribute("content"))&&void 0!==i?i:void 0}(at);null!=r&&t.setAttribute("nonce",r),e.insertBefore(t,e.querySelector("link"))}r&&r.add(n)}}else e.adoptedStyleSheets.includes(a)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,a]);return n})(r.shadowRoot?r.shadowRoot:r.getRootNode(),t,e.$modeName$);10&i&&(r["s-sc"]=n,r.classList.add(n+"-h"),2&i&&r.classList.add(n+"-s")),o()},ve=(e,t)=>"sc-"+(t&&32&e.$flags$?e.$tagName$+"-"+t:e.$tagName$),be=(e,t,r,i,o,n)=>{if(r!==i){let a=tt(e,t),s=t.toLowerCase();if("class"===t){const t=e.classList,o=we(r),n=we(i);t.remove(...o.filter((e=>e&&!n.includes(e)))),t.add(...n.filter((e=>e&&!o.includes(e))))}else if("style"===t){for(const t in r)i&&null!=i[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in i)r&&i[t]===r[t]||(t.includes("-")?e.style.setProperty(t,i[t]):e.style[t]=i[t])}else if("key"===t);else if("ref"===t)i&&i(e);else if(e.__lookupSetter__(t)||"o"!==t[0]||"n"!==t[1]){const l=ae(i);if((a||l&&null!==i)&&!o)try{if(e.tagName.includes("-"))e[t]=i;else{const o=null==i?"":i;"list"===t?a=!1:null!=r&&e[t]==o||(e[t]=o)}}catch(e){}let c=!1;s!==(s=s.replace(/^xlink\:?/,""))&&(t=s,c=!0),null==i||!1===i?!1===i&&""!==e.getAttribute(t)||(c?e.removeAttributeNS(oe,t):e.removeAttribute(t)):(!a||4&n||o)&&!l&&(i=!0===i?"":i,c?e.setAttributeNS(oe,t,i):e.setAttribute(t,i))}else t="-"===t[2]?t.slice(3):tt(nt,s)?s.slice(2):s[2]+t.slice(3),r&&lt.rel(e,t,r,!1),i&&lt.ael(e,t,i,!1)}},ye=/\s/,we=e=>e?e.split(ye):[],$e=(e,t,r,i)=>{const o=11===t.$elm$.nodeType&&t.$elm$.host?t.$elm$.host:t.$elm$,n=e&&e.$attrs$||ne,a=t.$attrs$||ne;for(i in n)i in a||be(o,i,n[i],void 0,r,t.$flags$);for(i in a)be(o,i,n[i],a[i],r,t.$flags$)},xe=(e,t,r,i)=>{const o=t.$child
/*!
* (C) PAQT.com B.V. https://paqt.com - MIT License
*/
function yt(e){const t=e?e.assignedNodes({flatten:!0}):[];let r="";return[...t].map((e=>{e.nodeType===Node.TEXT_NODE&&(r+=e.textContent)})),r}function wt(e,t){return t?null!==e.querySelector(`[slot="${t}"]`):[...e.childNodes].some((e=>{if(e.nodeType===e.TEXT_NODE&&""!==e.textContent.trim())return!0;if(e.nodeType===e.ELEMENT_NODE){if(!e.hasAttribute("slot"))return!0}return!1}))}
/*!
* (C) PAQT.com B.V. https://paqt.com - MIT License
*/const $t=(e,t=[])=>{const r={};return t.forEach((t=>{if(e.hasAttribute(t)){null!==e.getAttribute(t)&&(r[t]=e.getAttribute(t)),e.removeAttribute(t)}})),r},xt=Ue(class extends st{constructor(){super(),this.__registerHost(),this.__attachShadow()}render(){return se("span",{class:"spinner","aria-busy":"true","aria-live":"polite"})}static get style(){return":host{--track-color:var(--gr-color-light-shade);--indicator-color:var(--gr-color-primary);--stroke-width:2px;display:inline-flex;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}.spinner{display:inline-block;width:1em;height:1em;border-radius:50%;border:solid var(--stroke-width) var(--track-color);border-top-color:var(--indicator-color);border-right-color:var(--indicator-color);animation:1s linear infinite spin}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}"}},[1,"gr-spinner"]);function kt(){if("undefined"==typeof customElements)return;["gr-spinner"].forEach((e=>{if("gr-spinner"===e)customElements.get(e)||customElements.define(e,xt)}))}kt();
/*!
* (C) PAQT.com B.V. https://paqt.com - MIT License
*/
const Ct=Ue(class extends st{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.grFocus=ue(this,"gr-focus",7),this.grBlur=ue(this,"gr-blur",7),this.inheritedAttributes={},this.handleClick=e=>{if("button"!==this.type){const t=this.el.closest("form");if(t){e.preventDefault();const r=document.createElement("button");r.type=this.type,r.style.display="none",t.appendChild(r),r.click(),r.remove()}}},this.onFocus=()=>{this.grFocus.emit()},this.onBlur=()=>{this.grBlur.emit()},this.variant="default",this.disabled=!1,this.loading=!1,this.size="medium",this.caret=!1,this.pill=!1,this.expand=void 0,this.circle=!1,this.href=void 0,this.target=void 0,this.rel=void 0,this.type="button"}componentWillLoad(){this.inheritedAttributes=$t(this.el,["aria-label","tabindex","title"])}async setFocus(e){this.button.focus(e)}async removeFocus(){this.button.blur()}render(){const{rel:e,target:t,href:r,variant:i,size:o,expand:n,type:a,inheritedAttributes:s,disabled:l}=this,c=void 0===r?"button":"a",d="button"===c?{type:a}:{href:r,rel:e,target:t};return se(ce,{onClick:this.handleClick,"aria-disabled":l?"true":null,class:{[`button-${i}`]:!0,[`button-${o}`]:!0,[`button-${n}`]:void 0!==n,"button-caret":this.caret,"button-circle":this.circle,"button-pill":this.pill,"button-disabled":l,"button-loading":this.loading}},se(c,Object.assign({ref:e=>this.button=e},d,{class:"button-native",disabled:l,onFocus:this.onFocus,onBlur:this.onBlur},s),se("span",{class:"button-inner"},se("slot",{name:"icon-only"}),se("slot",{name:"start"}),se("slot",null),se("slot",{name:"end"}),this.caret&&se("span",{class:"caret"},se("svg",{role:"img","aria-hidden":"true",viewBox:"0 0 512 512"},se("title",null,"Chevron Down"),se("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"M112 184l144 144 144-144"})))),this.loading&&se("gr-spinner",null)))}get el(){return this}static get style(){return".gr-scroll-lock{overflow:hidden !important}:host{display:inline-block;width:auto;font-family:var(--gr-font-family);font-weight:var(--gr-font-weight-medium);font-size:var(--gr-form-element-font-size-medium);font-kerning:none;user-select:none;vertical-align:top;vertical-align:-webkit-baseline-middle;pointer-events:auto;--height:var(--gr-form-element-height-medium);--border-radius:var(--gr-form-element-border-radius-medium);--border-width:1px;--border-style:solid;--background:transparent;--background-hover:transparent;--background-focus:transparent;--color:var(--gr-color-dark-tint);--color-hover:var(--gr-color-dark-tint);--color-focus:var(--gr-color-dark-tint);--border-color:var(--gr-color-light-shade);--border-color-hover:var(--gr-color-medium);--border-color-focus:var(--gr-color-primary);--padding-top:0;--padding-start:var(--gr-spacing-medium);--padding-end:var(--gr-spacing-medium);--padding-bottom:0;--focus-ring:0 0 0 var(--gr-focus-ring-width) rgb(var(--gr-color-primary-rgb), 0.33);--shadow:none;--transition:background-color 150ms linear, opacity 150ms linear, border 150ms linear, color 150ms linear}:host(.button-disabled){pointer-events:none;opacity:0.5}:host(.button-primary){--border-color:var(--gr-color-primary);--background:var(--gr-color-primary);--color:var(--gr-color-primary-contrast);--border-color-hover:var(--gr-color-primary-shade);--background-hover:var(--gr-color-primary-shade);--color-hover:var(--gr-color-primary-contrast);--border-color-focus:var(--gr-color-primary);--background-focus:var(--gr-color-primary-shade);--color-focus:var(--gr-color-primary-contrast);--focus-ring:0 0 0 var(--gr-focus-ring-width) rgb(var(--gr-color-primary-rgb), 0.33)}:host(.button-secondary){--border-color:var(--gr-color-light-shade);--background:transparent;--color:var(--gr-color-primary);--border-color-hover:var(--gr-color-primary);--background-hover:transparent;--color-hover:var(--gr-color-primary);--border-color-focus:var(--gr-color-primary);--background-focus:transparent;--color-focus:var(--gr-color-primary);--focus-ring:0 0 0 var(--gr-focus-ring-width) rgb(var(--gr-color-primary-rgb), 0.33)}:host(.button-danger){--bor
/*!
* (C) PAQT.com B.V. https://paqt.com - MIT License
*/
function(e,t){return{top:Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top),left:Math.round(e.getBoundingClientRect().left-t.getBoundingClientRect().left)}}(e,t),n=o.top+t.scrollTop,a=o.left+t.scrollLeft,s=t.scrollLeft,l=t.scrollLeft+t.offsetWidth,c=t.scrollTop,d=t.scrollTop+t.offsetHeight;"horizontal"!==r&&"both"!==r||(a<s?t.scrollTo({left:a,behavior:i}):a+e.clientWidth>l&&t.scrollTo({left:a-t.offsetWidth+e.clientWidth,behavior:i})),"vertical"!==r&&"both"!==r||(n<c?t.scrollTo({top:n,behavior:i}):n+e.clientHeight>d&&t.scrollTo({top:n-t.offsetHeight+e.clientHeight,behavior:i}))}
/*!
* (C) PAQT.com B.V. https://paqt.com - MIT License
*/function St(e){return e.tabIndex>-1}function Et(e){if(St(e))return e;if(e.shadowRoot){const t=[...e.shadowRoot.children].find(St);if(t)return t}return e.children?[...e.children].map(Et)[0]:null}_t();var Ot="top",zt="bottom",Mt="right",Lt="left",Dt="auto",At=[Ot,zt,Mt,Lt],It="start",Rt="end",Ft="clippingParents",Ht="viewport",Nt="popper",jt="reference",Wt=At.reduce((function(e,t){return e.concat([t+"-"+It,t+"-"+Rt])}),[]),Bt=[].concat(At,[Dt]).reduce((function(e,t){return e.concat([t,t+"-"+It,t+"-"+Rt])}),[]),qt=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Pt(e){return e?(e.nodeName||"").toLowerCase():null}function Vt(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Kt(e){return e instanceof Vt(e).Element||e instanceof Element}function Ut(e){return e instanceof Vt(e).HTMLElement||e instanceof HTMLElement}function Yt(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Vt(e).ShadowRoot||e instanceof ShadowRoot)}const Gt={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var r=t.styles[e]||{},i=t.attributes[e]||{},o=t.elements[e];Ut(o)&&Pt(o)&&(Object.assign(o.style,r),Object.keys(i).forEach((function(e){var t=i[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach((function(e){var i=t.elements[e],o=t.attributes[e]||{},n=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:r[e]).reduce((function(e,t){return e[t]="",e}),{});Ut(i)&&Pt(i)&&(Object.assign(i.style,n),Object.keys(o).forEach((function(e){i.removeAttribute(e)})))}))}},requires:["computeStyles"]};function Qt(e){return e.split("-")[0]}var Xt=Math.max,Zt=Math.min,Jt=Math.round;function er(e,t){void 0===t&&(t=!1);var r=e.getBoundingClientRect(),i=1,o=1;if(Ut(e)&&t){var n=e.offsetHeight,a=e.offsetWidth;a>0&&(i=Jt(r.width)/a||1),n>0&&(o=Jt(r.height)/n||1)}return{width:r.width/i,height:r.height/o,top:r.top/o,right:r.right/i,bottom:r.bottom/o,left:r.left/i,x:r.left/i,y:r.top/o}}function tr(e){var t=er(e),r=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:i}}function rr(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&Yt(r)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function ir(e){return Vt(e).getComputedStyle(e)}function or(e){return["table","td","th"].indexOf(Pt(e))>=0}function nr(e){return((Kt(e)?e.ownerDocument:e.document)||window.document).documentElement}function ar(e){return"html"===Pt(e)?e:e.assignedSlot||e.parentNode||(Yt(e)?e.host:null)||nr(e)}function sr(e){return Ut(e)&&"fixed"!==ir(e).position?e.offsetParent:null}function lr(e){for(var t=Vt(e),r=sr(e);r&&or(r)&&"static"===ir(r).position;)r=sr(r);return r&&("html"===Pt(r)||"body"===Pt(r)&&"static"===ir(r).position)?t:r||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&Ut(e)&&"fixed"===ir(e).position)return null;var r=ar(e);for(Yt(r)&&(r=r.host);Ut(r)&&["html","body"].indexOf(Pt(r))<0;){var i=ir(r);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return r;r=r.parentNode}return null}(e)||t}function cr(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function dr(e,t,r){return Xt(e,Zt(t,r))}function hr(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function gr(e,t){return t.reduce((function(t,r){return t[r]=e,t}),{})}var ur=function(e,t){return hr("number"!=typeof(e="function"==t
/*!
* (C) PAQT.com B.V. https://paqt.com - MIT License
*/
const Gr=Ue(class extends st{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.grSelect=ue(this,"gr-select",7),this.typeToSelectString=""}connectedCallback(){this.handleClick=this.handleClick.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}async typeToSelect(e){clearTimeout(this.typeToSelectTimeout),this.typeToSelectTimeout=setTimeout((()=>this.typeToSelectString=""),750),this.typeToSelectString+=e.toLowerCase();const t=this.getItems();for(const e of t){if(yt(e.shadowRoot.querySelector("slot:not([name])")).toLowerCase().trim().substring(0,this.typeToSelectString.length)===this.typeToSelectString){e.setFocus();break}}}getItems(){return[...this.menu.querySelector("slot").assignedElements({flatten:!0})].filter((e=>"gr-menu-item"===e.tagName.toLowerCase()&&!e.disabled))}getActiveItem(){return this.getItems().find((e=>e===document.activeElement))}setActiveItem(e){e.setFocus()}handleClick(e){const t=e.target.closest("gr-menu-item");t&&!t.disabled&&this.grSelect.emit({item:t})}handleKeyDown(e){if("Enter"===e.key){const t=this.getActiveItem();e.preventDefault(),t&&this.grSelect.emit({item:t})}if(" "===e.key&&e.preventDefault(),["ArrowDown","ArrowUp","Home","End"].includes(e.key)){const t=this.getItems(),r=this.getActiveItem();let i=t.indexOf(r);if(t.length)return e.preventDefault(),"ArrowDown"===e.key?i++:"ArrowUp"===e.key?i--:"Home"===e.key?i=0:"End"===e.key&&(i=t.length-1),i<0&&(i=0),i>t.length-1&&(i=t.length-1),void this.setActiveItem(t[i])}this.typeToSelect(e.key)}render(){return se("div",{ref:e=>this.menu=e,class:"menu",role:"menu",onClick:this.handleClick,onKeyDown:this.handleKeyDown},se("slot",null))}static get style(){return".gr-scroll-lock{overflow:hidden !important}:host{--padding-top:var(--gr-spacing-x-small);--padding-bottom:var(--gr-spacing-x-small);display:block;padding-top:var(--padding-top);padding-left:0;padding-right:0;padding-bottom:var(--padding-bottom);box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}:host:focus{outline:none}"}},[1,"gr-menu",{typeToSelect:[64]}]);function Qr(){if("undefined"==typeof customElements)return;["gr-menu"].forEach((e=>{if("gr-menu"===e)customElements.get(e)||customElements.define(e,Gr)}))}Qr();
/*!
* (C) PAQT.com B.V. https://paqt.com - MIT License
*/
const Xr=Ue(class extends st{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.grClear=ue(this,"gr-clear",7),this.type="primary",this.size="medium",this.pill=!1,this.clearable=!1}connectedCallback(){this.handleClearClick=this.handleClearClick.bind(this)}handleClearClick(){this.grClear.emit()}render(){return se(ce,{class:{[`tag-${this.type}`]:!0,[`tag-${this.size}`]:!0,"tag-pill":this.pill,"tag-clearable":this.clearable}},se("span",{class:"tag"},se("slot",null),this.clearable&&se("gr-button",{variant:"plain",size:this.size,class:"tag-clear","aria-label":"clear",onClick:this.handleClearClick},se("svg",{slot:"icon-only",role:"img","aria-hidden":"true",viewBox:"0 0 512 512"},se("title",null,"Close"),se("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 368L144 144M368 144L144 368"})))))}static get style(){return":host{--height:calc(var(--gr-form-element-height-medium) * 0.8);--line-height:calc(var(--gr-form-element-height-medium) - 1px * 2);--border-radius:var(--gr-form-element-border-radius-medium);--border-width:1px;--border-style:solid;--padding-top:0;--padding-start:var(--gr-spacing-small);--padding-end:var(--gr-spacing-small);--padding-bottom:0;--font-size:var(--gr-form-element-font-size-medium);--background-color:rgba(var(--gr-color-primary-rgb), 0.05);--border-color:rgba(var(--gr-color-primary-rgb), 0.2);--color:var(--gr-color-primary-shade);--clear-color:var(--gr-color-primary);--clear-color-hover:var(--gr-color-primary-shade);--clear-margin-left:var(--gr-spacing-xx-small);--clear-margin-right:calc(-1 * var(--gr-spacing-xxx-small));display:inline-block;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}:host(.tag-success){--background-color:rgba(var(--gr-color-success-rgb), 0.05);--border-color:rgba(var(--gr-color-success-rgb), 0.2);--color:var(--gr-color-success-shade);--clear-color:var(--gr-color-success);--clear-color-hover:var(--gr-color-success-shade)}:host(.tag-info){--background-color:rgba(var(--gr-color-medium-rgb), 0.05);--border-color:rgba(var(--gr-color-medium-rgb), 0.2);--color:var(--gr-color-medium-shade);--clear-color:var(--gr-color-medium);--clear-color-hover:var(--gr-color-medium-shade)}:host(.tag-warning){--background-color:rgba(var(--gr-color-warning-rgb), 0.05);--border-color:rgba(var(--gr-color-warning-rgb), 0.2);--color:var(--gr-color-warning-shade);--clear-color:var(--gr-color-warning);--clear-color-hover:var(--gr-color-warning-shade)}:host(.tag-danger){--background-color:rgba(var(--gr-color-danger-rgb), 0.05);--border-color:rgba(var(--gr-color-danger-rgb), 0.2);--color:var(--gr-color-danger-shade);--clear-color:var(--gr-color-danger);--clear-color-hover:var(--gr-color-danger-shade)}:host(.tag-small){--font-size:var(--gr-form-element-font-size-small);--height:calc(var(--gr-form-element-height-small) * 0.8);--line-height:calc(var(--gr-form-element-height-small) - 1px * 2);--border-radius:var(--gr-form-element-border-radius-small);--padding-start:var(--gr-spacing-x-small);--padding-end:var(--gr-spacing-x-small);--clear-margin-left:var(--gr-spacing-xx-small);--clear-margin-right:calc(-1 * var(--gr-spacing-xxx-small))}:host(.tag-large){--font-size:var(--gr-form-element-font-size-large);--height:calc(var(--gr-form-element-height-large) * 0.8);--line-height:calc(var(--gr-form-element-height-large) - 1px * 2);--border-radius:var(--gr-form-element-border-radius-large);--padding:0 var(--gr-spacing-medium);--clear-margin-left:var(--gr-spacing-xx-small);--clear-margin-right:calc(-1 * var(--gr-spacing-x-small))}.tag{display:flex;align-items:center;border-style:var(--border-style);border-width:var(--border-width);border-radius:var(--border-radius);white-space:nowrap;user-select:none;cursor:default;font-family:var(--gr-font-family);font-size:var(--font-size);font-weight:var(--gr-font-weight-normal);height:var(--height);line-height:var(--line-height);padding-top:var(--padding-top);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-bottom:var(--padding-bottom);background
/*!
* (C) PAQT.com B.V. https://paqt.com - MIT License
*/
const Jr="undefined"!=typeof HTMLElement?HTMLElement:class{};let ei=0;const ti=Ue(class extends st{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.grChange=ue(this,"gr-change",7),this.grFocus=ue(this,"gr-focus",7),this.grBlur=ue(this,"gr-blur",7),this.inputId="select-"+ ++ei,this.labelId=`select-label-${ei}`,this.helpTextId=`select-help-text-${ei}`,this.invalidTextId=`select-invalid-text-${ei}`,this.inheritedAttributes={},this.handleBlur=()=>{this.isOpen||(this.hasFocus=!1,this.grBlur.emit())},this.handleFocus=()=>{this.hasFocus||(this.hasFocus=!0,this.grFocus.emit())},this.hasFocus=!1,this.hasHelpTextSlot=!1,this.hasInvalidTextSlot=!1,this.hasLabelSlot=!1,this.isOpen=!1,this.items=[],this.displayLabel="",this.displayTags=[],this.multiple=!1,this.maxTagsVisible=3,this.disabled=!1,this.name="",this.placeholder="",this.size="medium",this.hoist=!1,this.value="",this.pill=!1,this.label="",this.requiredIndicator=!1,this.helpText="",this.invalidText="",this.invalid=!1,this.clearable=!1}handleDisabledChange(){this.disabled&&this.isOpen&&this.dropdown.hide()}handleLabelChange(){this.handleSlotChange()}handleMultipleChange(){const e=this.getValueAsArray();this.value=this.multiple?e:e[0]||"",this.syncItemsFromValue()}handleValueChange(){this.syncItemsFromValue(),this.grChange.emit()}connectedCallback(){this.handleClearClick=this.handleClearClick.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleLabelClick=this.handleLabelClick.bind(this),this.handleMenuHide=this.handleMenuHide.bind(this),this.handleMenuShow=this.handleMenuShow.bind(this),this.handleMenuSelect=this.handleMenuSelect.bind(this),this.handleSlotChange=this.handleSlotChange.bind(this),this.handleTagInteraction=this.handleTagInteraction.bind(this),this.el.shadowRoot.addEventListener("slotchange",this.handleSlotChange)}componentWillLoad(){this.handleSlotChange(),this.inheritedAttributes=$t(this.el,["aria-label"])}componentDidLoad(){this.resizeObserver=new ResizeObserver((()=>this.resizeMenu())),this.reportDuplicateItemValues(),requestAnimationFrame((()=>this.syncItemsFromValue()))}disconnectedCallback(){this.el.shadowRoot.removeEventListener("slotchange",this.handleSlotChange)}async setFocus(){this.hasFocus=!0,this.grFocus.emit(),this.dropdown.focusOnTrigger()}getItemLabel(e){return yt(e.shadowRoot.querySelector("slot:not([name])"))}getItems(){return[...this.el.querySelectorAll("gr-menu-item")]}getValueAsArray(){return Array.isArray(this.value)?this.value:[this.value]}handleClearClick(e){e.stopPropagation(),this.value=this.multiple?[]:"",this.syncItemsFromValue()}handleKeyDown(e){const t=e.target,r=this.getItems(),i=r[0],o=r[r.length-1];if("gr-tag"!==t.tagName.toLowerCase())if("Tab"!==e.key){if(["ArrowDown","ArrowUp"].includes(e.key)){if(e.preventDefault(),this.isOpen||this.dropdown.show(),"ArrowDown"===e.key&&i)return void i.setFocus();if("ArrowUp"===e.key&&o)return void o.setFocus()}this.isOpen||1!==e.key.length||(e.stopPropagation(),e.preventDefault(),this.dropdown.show(),this.menu.typeToSelect(e.key))}else this.isOpen&&this.dropdown.hide()}handleLabelClick(){this.box.focus()}handleMenuSelect(e){const t=e.detail.item;this.multiple?this.value=this.value.includes(t.value)?this.value.filter((e=>e!==t.value)):[...this.value,t.value]:this.value=t.value,this.syncItemsFromValue()}handleMenuShow(e){this.disabled?e.preventDefault():(this.resizeMenu(),this.resizeObserver.observe(this.el),this.isOpen=!0)}handleMenuHide(){this.resizeObserver.unobserve(this.el),this.isOpen=!1,this.box.focus()}handleSlotChange(){this.hasHelpTextSlot=wt(this.el,"help-text"),this.hasInvalidTextSlot=wt(this.el,"invalid-text"),this.hasLabelSlot=wt(this.el,"label"),this.syncItemsFromValue(),this.reportDuplicateItemValues()}handleTagInteraction(e){e.composedPath().find((e=>{if(e instanceof Jr)return e.classList.contains("tag-clear")}))&&e.stopPropagation()}reportDuplicateItemValues(){const e=this.getItems().map((e=>e.value)).filter(((e,t,r)=>r.indexOf(e)!==t));if(e.length)throw new Error('Duplicate value found on <gr-menu-item> in <gr-select>: "'+e.join('", "')
/*!
* (C) PAQT.com B.V. https://paqt.com - MIT License
*/!function(){if("undefined"==typeof customElements)return;["gr-menu-item"].forEach((e=>{if("gr-menu-item"===e)customElements.get(e)||customElements.define(e,oi)}))}();const ni={"gr-select":ii,"gr-menu-item":oi};class ai extends(q(d)){constructor(){super(...arguments),this.multiple=!1,this.clearable=!1,this._refSelect=o()}_valueChangedHandler(e){const t=this._refSelect.value?.value;void 0===t||n(this.value,t)||(this.value=t,a(this,"select:change",t))}render(){return s` <gr-select
${l(this._refSelect)}
label=${this.label??""}
placeholder=${this.placeholder??""}
size="small"
?multiple=${this.multiple}
?clearable=${this.clearable}
.value=${this.value??this._refSelect.value?.value??[]}
@gr-change=${this._valueChangedHandler.bind(this)}
>
${this.options?.map((e=>s`<gr-menu-item value="${e.value??""}"
>${e.label}</gr-menu-item
>`))}
</gr-select>`}static get styles(){return c(':root, :host {\n --gr-color-primary: #1079b2;\n --gr-color-primary-rgb: 16, 121, 178;\n --gr-color-primary-contrast: #ffffff;\n --gr-color-primary-contrast-rgb: 255, 255, 255;\n --gr-color-primary-shade: #0d6696;\n --gr-color-primary-tint: #1499e1;\n --gr-color-secondary: #051f2c;\n --gr-color-secondary-rgb: 5, 31, 44;\n --gr-color-secondary-contrast: #ffffff;\n --gr-color-secondary-contrast-rgb: 255, 255, 255;\n --gr-color-secondary-shade: #000000;\n --gr-color-secondary-tint: #0a415c;\n --gr-color-tertiary: #0c4a6e;\n --gr-color-tertiary-rgb: 12, 74, 110;\n --gr-color-tertiary-contrast: #ffffff;\n --gr-color-tertiary-contrast-rgb: 255, 255, 255;\n --gr-color-tertiary-shade: #083249;\n --gr-color-tertiary-tint: #106393;\n --gr-color-success: #0fbe78;\n --gr-color-success-rgb: 15, 190, 120;\n --gr-color-success-contrast: #000000;\n --gr-color-success-contrast-rgb: 0, 0, 0;\n --gr-color-success-shade: #057f4e;\n --gr-color-success-tint: #12e28f;\n --gr-color-warning: #fbbc4e;\n --gr-color-warning-rgb: 251, 188, 78;\n --gr-color-warning-contrast: #051f2c;\n --gr-color-warning-contrast-rgb: 5, 31, 44;\n --gr-color-warning-shade: #9e6400;\n --gr-color-warning-tint: #fdd187;\n --gr-color-danger: #e60017;\n --gr-color-danger-rgb: 230, 0, 23;\n --gr-color-danger-contrast: #ffffff;\n --gr-color-danger-contrast-rgb: 255, 255, 255;\n --gr-color-danger-shade: #cc0014;\n --gr-color-danger-tint: #ff1f35;\n --gr-color-light: #f4f5f8;\n --gr-color-light-rgb: 244, 245, 248;\n --gr-color-light-contrast: #051f2c;\n --gr-color-light-contrast-rgb: 5, 31, 44;\n --gr-color-light-shade: #d7d8da;\n --gr-color-light-tint: #f9fafb;\n --gr-color-medium: #5e6c78;\n --gr-color-medium-rgb: 94, 108, 120;\n --gr-color-medium-contrast: #ffffff;\n --gr-color-medium-contrast-rgb: 255, 255, 255;\n --gr-color-medium-shade: #48535b;\n --gr-color-medium-tint: #81909c;\n --gr-color-dark: #02131b;\n --gr-color-dark-rgb: 2, 19, 27;\n --gr-color-dark-contrast: #ffffff;\n --gr-color-dark-contrast-rgb: 255, 255, 255;\n --gr-color-dark-shade: #000000;\n --gr-color-dark-tint: #222428;\n --gr-color-white: #ffffff;\n --gr-color-black: #000000;\n --gr-border-radius-small: 0.125rem;\n --gr-border-radius-medium: 0.25rem;\n --gr-border-radius-large: 0.5rem;\n --gr-border-radius-x-large: 1rem;\n --gr-border-width-small: 0.063rem;\n --gr-border-width-medium: 0.125rem;\n --gr-border-width-large: 0.188rem;\n --gr-shadow-x-small: 0 1px 0 #0d131e0d;\n --gr-shadow-small: 0 1px 2px #0d131e1a;\n --gr-shadow-medium: 0 2px 4px #0d131e1a;\n --gr-shadow-large: 0 2px 8px #0d131e1a;\n --gr-shadow-x-large: 0 4px 16px #0d131e1a;\n --gr-spacing-xxx-small: 0.125rem;\n --gr-spacing-xx-small: 0.25rem;\n --gr-spacing-x-small: 0.5rem;\n --gr-spacing-small: 0.75rem;\n --gr-spacing-medium: 1rem;\n --gr-spacing-large: 1.25rem;\n --gr-spacing-x-large: 1.75rem;\n --gr-spacing-xx-large: 2.25rem;\n --gr-spacing-xxx-large: 3rem;\n --gr-spacing-xxxx-large: 4.5rem;\n --gr-font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,\n sans-serif;\n --gr-letter-spacing-dense: -0.015em;\n --gr-letter-spacing-normal: normal;\n --gr-letter-spacing-loose: 0.075em;\n --gr-line-height-dense: 1.4;\n --gr-line-height-normal: 1.8;\n --gr-line-height-loose: 2.2;\n --gr-font-size-xx-small: 0.625rem;\n --gr-font-size-x-small: 0.75rem;\n --gr-font-size-small: 0.875rem;\n --gr-font-size-medium: 1rem;\n --gr-font-size-large: 1.25rem;\n --gr-font-size-x-large: 1.5rem;\n --gr-font-size-xx-large: 2.25rem;\n --gr-font-size-xxx-large: 3rem;\n --gr-font-size-xxxx-large: 4.5rem;\n --gr-font-weight-thin: 100;\n --gr-font-weight-extra-light: 200;\n --gr-font-weight-light: 300;\n --gr-font-weight-normal: 400;\n --gr-font-weight-medium: 500;\n --gr-font-weight-semi-bold: 600;\n --gr-font-weight-bold: 700;\n --gr-font-weight-extra-bold: 800;\n --gr-font-weight-black: 900;\n --gr-form-element-font-size-x-small: var(--gr-font-size-x-small);
${l(this._refMediaType)}
label=${f("media_filter.media_type")}
placeholder=${f("media_filter.select_media_type")}
.options=${this._mediaTypeOptions}
.value=${this._defaults?.mediaType}
@frigate-card:select:change=${this._valueChangedHandler.bind(this)}
>
</frigate-card-select>
<frigate-card-select
${l(this._refWhen)}
.label=${f("media_filter.when")}
placeholder=${f("media_filter.select_when")}
.options=${this._whenOptions}
.value=${this._defaults?.when}
clearable
@frigate-card:select:change=${this._valueChangedHandler.bind(this)}
>
</frigate-card-select>
<frigate-card-select
${l(this._refCamera)}
.label=${f("media_filter.camera")}
placeholder=${f("media_filter.select_camera")}
.options=${this._cameraOptions}
.value=${this._defaults?.cameraIDs}
clearable
multiple
@frigate-card:select:change=${this._valueChangedHandler.bind(this)}
>
</frigate-card-select>
${e&&this._mediaMetadataController.whatOptions.length?s` <frigate-card-select
${l(this._refWhat)}
label=${f("media_filter.what")}
placeholder=${f("media_filter.select_what")}
clearable
multiple
.options=${this._mediaMetadataController.whatOptions}
.value=${this._defaults?.what}
@frigate-card:select:change=${this._valueChangedHandler.bind(this)}
>
</frigate-card-select>`:""}
${e&&this._mediaMetadataController.tagsOptions.length?s` <frigate-card-select
${l(this._refTags)}
label=${f("media_filter.tag")}
placeholder=${f("media_filter.select_tag")}
clearable
multiple
.options=${this._mediaMetadataController.tagsOptions}
.value=${this._defaults?.tags}
@frigate-card:select:change=${this._valueChangedHandler.bind(this)}
>
</frigate-card-select>`:""}
${e&&this._mediaMetadataController.whereOptions.length?s` <frigate-card-select
${l(this._refWhere)}
label=${f("media_filter.where")}
placeholder=${f("media_filter.select_where")}
clearable
multiple
.options=${this._mediaMetadataController.whereOptions}
.value=${this._defaults?.where}
@frigate-card:select:change=${this._valueChangedHandler.bind(this)}
>
</frigate-card-select>`:""}
${i?s`
<frigate-card-select
${l(this._refFavorite)}
label=${f("media_filter.favorite")}
placeholder=${f("media_filter.select_favorite")}
.options=${this._favoriteOptions}
.value=${this._defaults?.favorite}
clearable
@frigate-card:select:change=${this._valueChangedHandler.bind(this)}
>
</frigate-card-select>
`:""}`}static get styles(){return c(":host {\n display: flex;\n flex-direction: column;\n overflow: auto;\n scrollbar-width: none;\n -ms-overflow-style: none;\n height: 100%;\n width: 300px;\n margin: 5px;\n}\n\n/* Hide scrollbar for Chrome, Safari and Opera */\n:host::-webkit-scrollbar {\n display: none;\n}\n\nfrigate-card-select {\n padding: 5px;\n}")}};ui.elementDefinitions={"frigate-card-select":ai},t([r({attribute:!1})],ui.prototype,"hass",void 0),t([r({attribute:!1})],ui.prototype,"cameraManager",void 0),t([r({attribute:!1})],ui.prototype,"view",void 0),t([r({attribute:!1})],ui.prototype,"cardWideConfig",void 0),ui=t([p("frigate-card-media-filter")],ui);class mi{constructor(e,t,r){this.tagsOptions=[],this.whenOptions=[],this.whatOptions=[],this.whereOptions=[],this._host=e,this._hass=t,this._cameraManager=r,e.addController(this)}_dateRangeToString(e){return`${v(e.start)},${v(e.end)}`}async hostConnected(){let e;try{e=await this._cameraManager.getMediaMetadata(this._hass)}catch(e){return void k(e)}if(e){if(e.what&&(this.whatOptions=[...e.what].sort().map((e=>({value:e,label:C(e)})))),e.where&&(this.whereOptions=[...e.where].sort().map((e=>({value:e,label:C(e)})))),e.tags&&(this.tagsOptions=[...e.tags].sort().map((e=>({value:e,label:C(e)})))),e.days){const t=new Set;[...e.days].forEach((e=>{t.add(e.substring(0,7))}));const r=[];t.forEach((e=>{r.push(B(e,"yyyy-MM",new Date))})),this.whenOptions=_(r,(e=>e.getTime()),"desc").map((e=>({label:T(e,"MMMM yyyy"),value:this._dateRangeToString({start:e,end:ci(e)})})))}this._host.requestUpdate()}}}const pi={closed:"mdi:filter-cog-outline",open:"mdi:filter-cog"};let fi=class extends d{render(){if(this.hass&&this.view&&this.view.isGalleryView()&&this.cameraManager&&this.cardWideConfig){if(!this.view.query){if(this.view.is("recordings"))S(this,this.hass,this.cameraManager,this.cardWideConfig,this.view);else{const e=this.view.is("snapshots")?"snapshots":this.view.is("clips")?"clips":null;E(this,this.hass,this.cameraManager,this.cardWideConfig,this.view,{...e&&{mediaType:e}})}return O({cardWideConfig:this.cardWideConfig})}return s`
<frigate-card-surround-basic
.drawerIcons=${{...this.galleryConfig&&"none"!==this.galleryConfig.controls.filter.mode&&{[this.galleryConfig.controls.filter.mode]:pi}}}
>
${this.galleryConfig&&"none"!==this.galleryConfig.controls.filter.mode?s` <frigate-card-media-filter
.hass=${this.hass}
.cameraManager=${this.cameraManager}
.view=${this.view}
.cardWideConfig=${this.cardWideConfig}
slot=${this.galleryConfig.controls.filter.mode}
>
</frigate-card-media-filter>`:""}
<frigate-card-gallery-core
.hass=${this.hass}
.view=${this.view}
.galleryConfig=${this.galleryConfig}
.cameraManager=${this.cameraManager}
.cardWideConfig=${this.cardWideConfig}
>
</frigate-card-gallery-core>
</frigate-card-surround-basic>
`}}static get styles(){return c(":host {\n width: 100%;\n height: 100%;\n display: block;\n}\n\nfrigate-card-surround-basic {\n max-height: var(--frigate-card-max-height);\n}")}};t([r({attribute:!1})],fi.prototype,"hass",void 0),t([r({attribute:!1})],fi.prototype,"view",void 0),t([r({attribute:!1})],fi.prototype,"galleryConfig",void 0),t([r({attribute:!1})],fi.prototype,"cameraManager",void 0),t([r({attribute:!1})],fi.prototype,"cardWideConfig",void 0),fi=t([p("frigate-card-gallery")],fi);let vi=class extends d{constructor(){super(),this._refLoaderBottom=o(),this._refSelected=o(),this._showLoaderBottom=!0,this._showLoaderTop=!1,this._boundWheelHandler=this._wheelHandler.bind(this),this._boundTouchStartHandler=this._touchStartHandler.bind(this),this._boundTouchEndHandler=this._touchEndHandler.bind(this),this._throttleExtendGalleryLater=z(this._extendGallery.bind(this),500,{leading:!0,trailing:!1}),this._touchScrollYPosition=null,this._resizeObserver=new ResizeObserver(this._resizeHandler.bind(this)),this._intersectionObserver=new IntersectionObserver(this._intersectionHandler.bind(this))}_touchStartHandler(e){1===e.touches.length?this._touchScrollYPosition=e.touches[0].screenY:this._touchScrollYPosition=null}async _touchEndHandler(e){!this.scrollTop&&1===e.changedTouches.length&&this._touchScrollYPosition&&e.changedTouches[0].screenY>this._touchScrollYPosition&&await this._extendLater(),this._touchScrollYPosition=null}async _wheelHandler(e){!this.scrollTop&&e.deltaY<0&&await this._extendLater()}async _extendLater(){const e=new Date;this._showLoaderTop=!0,await this._throttleExtendGalleryLater("later",!1);const t=(new Date).getTime()-e.getTime();t<500&&await M(.5-t/1e3),this._showLoaderTop=!1}connectedCallback(){super.connectedCallback(),this._resizeObserver.observe(this),this.addEventListener("wheel",this._boundWheelHandler,{passive:!0}),this.addEventListener("touchstart",this._boundTouchStartHandler,{passive:!0}),this.addEventListener("touchend",this._boundTouchEndHandler),this.requestUpdate()}disconnectedCallback(){this.removeEventListener("wheel",this._boundWheelHandler),this.removeEventListener("touchstart",this._boundTouchStartHandler),this.removeEventListener("touchend",this._boundTouchEndHandler),this._resizeObserver.disconnect(),this._intersectionObserver.disconnect(),super.disconnectedCallback()}_setColumnCount(){const e=this.galleryConfig?.controls.thumbnails.size??L.media_gallery.controls.thumbnails.size,t=this.galleryConfig?.controls.thumbnails.show_details?Math.max(1,Math.floor(this.clientWidth/D)):Math.max(1,Math.ceil(this.clientWidth/A),Math.ceil(this.clientWidth/e));this.style.setProperty("--frigate-card-gallery-columns",String(t))}_resizeHandler(){this._setColumnCount()}async _intersectionHandler(e){e.every((e=>!e.isIntersecting))||(this._showLoaderBottom=!1,await this._extendGallery("earlier"))}async _extendGallery(e,t=!0){if(!this.cameraManager||!this.hass||!this.view)return;const r=this.view?.query,i=r?.getQueries()??null,o=this.view.queryResults?.getResults();if(!r||!i||!o)return;let n;try{n=await this.cameraManager.extendMediaQueries(this.hass,i,o,e,{useCache:t})}catch(e){return void k(e)}if(n){const e=x.areEventQueries(r)?new b(n.queries):x.areRecordingQueries(r)?new $(n.queries):null;e&&this.view?.evolve({query:e,queryResults:new I(n.results).selectResultIfFound((e=>e===this.view?.queryResults?.getSelectedResult()))}).dispatchChangeEvent(this)}}willUpdate(e){if(e.has("galleryConfig")&&(this.galleryConfig?.controls.thumbnails.show_details?this.setAttribute("details",""):this.removeAttribute("details"),this._setColumnCount(),this.galleryConfig?.controls.thumbnails.size&&this.style.setProperty("--frigate-card-thumbnail-size",`${this.galleryConfig.controls.thumbnails.size}px`)),e.has("view")){this._showLoaderBottom=!0;e.get("view")?.queryResults?.getResults()!==this.view?.queryResults?.getResults()&&(this._media=[...this.view?.queryResults?.getResults()??[]].reverse())}}render(){if(!(this._media&&this.hass&&this.view&&this.view.isGalleryView()))return s``;if(0===(this.view?.queryResults?.getRe
${this._showLoaderTop?s`${O({cardWideConfig:this.cardWideConfig,classes:{top:!0},size:"small"})}`:""}
${this._media.map(((t,r)=>s`<frigate-card-thumbnail
${t===e?l(this._refSelected):""}
class=${F({selected:t===e})}
.hass=${this.hass}
.cameraManager=${this.cameraManager}
.media=${t}
.view=${this.view}
?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=>{this.view&&this._media&&this.view.evolve({view:"media",queryResults:this.view.queryResults?.clone().selectResult(this._media.length-r-1)}).dispatchChangeEvent(this),H(e)}}
>
</frigate-card-thumbnail>`))}
${this._showLoaderBottom?s`${O({cardWideConfig:this.cardWideConfig,componentRef:this._refLoaderBottom})}`:""}
</div>`}updated(e){this._refLoaderBottom.value&&(this._intersectionObserver.disconnect(),this._intersectionObserver.observe(this._refLoaderBottom.value)),this.updateComplete.then((()=>{e.has("view")&&!e.get("view")&&this._refSelected.value&&this._refSelected.value.scrollIntoView()}))}static get styles(){return c(":host {\n width: 100%;\n height: 100%;\n display: block;\n overflow: auto;\n -ms-overflow-style: none;\n scrollbar-width: none;\n --frigate-card-gallery-gap: 3px;\n --frigate-card-gallery-columns: 4;\n}\n\n.grid {\n display: grid;\n grid-template-columns: repeat(var(--frigate-card-gallery-columns), minmax(0, 1fr));\n grid-auto-rows: min-content;\n gap: var(--frigate-card-gallery-gap);\n}\n\n:host::-webkit-scrollbar {\n display: none;\n}\n\nfrigate-card-thumbnail {\n height: 100%;\n max-height: var(--frigate-card-thumbnail-size);\n}\n\nfrigate-card-thumbnail:not([details]) {\n width: 100%;\n}\n\nfrigate-card-thumbnail.selected {\n border: 4px solid var(--accent-color);\n border-radius: calc(var(--frigate-card-css-border-radius, var(--ha-card-border-radius, 4px)) + 4px);\n}\n\nfrigate-card-progress-indicator.top {\n grid-column: 1/-1;\n}")}};t([r({attribute:!1})],vi.prototype,"hass",void 0),t([r({attribute:!1})],vi.prototype,"view",void 0),t([r({attribute:!1})],vi.prototype,"galleryConfig",void 0),t([r({attribute:!1})],vi.prototype,"cameraManager",void 0),t([r({attribute:!1})],vi.prototype,"cardWideConfig",void 0),t([N()],vi.prototype,"_showLoaderBottom",void 0),t([N()],vi.prototype,"_showLoaderTop",void 0),vi=t([p("frigate-card-gallery-core")],vi);export{fi as FrigateCardGallery,vi as FrigateCardGalleryCore};