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

166 lines
107 KiB
JavaScript

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.$children$[r];let n,a,s,l=0;if(Z||(ee=!0,"slot"===o.$tag$&&(G&&i.classList.add(G+"-s"),o.$flags$|=o.$children$?2:1)),null!==o.$text$)n=o.$elm$=at.createTextNode(o.$text$);else if(1&o.$flags$)n=o.$elm$=at.createTextNode("");else{if(te||(te="svg"===o.$tag$),n=o.$elm$=at.createElementNS(te?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",2&o.$flags$?"slot-fb":o.$tag$),te&&"foreignObject"===o.$tag$&&(te=!1),$e(null,o,te),null!=G&&n["s-si"]!==G&&n.classList.add(n["s-si"]=G),o.$children$)for(l=0;l<o.$children$.length;++l)a=xe(e,o,l,n),a&&n.appendChild(a);"svg"===o.$tag$?te=!1:"foreignObject"===n.tagName&&(te=!0)}return n["s-hn"]=X,3&o.$flags$&&(n["s-sr"]=!0,n["s-cr"]=Q,n["s-sn"]=o.$name$||"",s=e&&e.$children$&&e.$children$[r],s&&s.$tag$===o.$tag$&&e.$elm$&&ke(e.$elm$,!1)),n},ke=(e,t)=>{lt.$flags$|=1;const r=e.childNodes;for(let e=r.length-1;e>=0;e--){const i=r[e];i["s-hn"]!==X&&i["s-ol"]&&(Ee(i).insertBefore(i,Se(i)),i["s-ol"].remove(),i["s-ol"]=void 0,ee=!0),t&&ke(i,t)}lt.$flags$&=-2},Ce=(e,t,r,i,o,n)=>{let a,s=e["s-cr"]&&e["s-cr"].parentNode||e;for(s.shadowRoot&&s.tagName===X&&(s=s.shadowRoot);o<=n;++o)i[o]&&(a=xe(null,r,o,e),a&&(i[o].$elm$=a,s.insertBefore(a,Se(t))))},_e=(e,t,r,i,o)=>{for(;t<=r;++t)(i=e[t])&&(o=i.$elm$,Ae(i),J=!0,o["s-ol"]?o["s-ol"].remove():ke(o,!0),o.remove())},Te=(e,t)=>e.$tag$===t.$tag$&&("slot"===e.$tag$?e.$name$===t.$name$:e.$key$===t.$key$),Se=e=>e&&e["s-ol"]||e,Ee=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,Oe=(e,t)=>{const r=t.$elm$=e.$elm$,i=e.$children$,o=t.$children$,n=t.$tag$,a=t.$text$;let s;null===a?(te="svg"===n||"foreignObject"!==n&&te,"slot"===n||$e(e,t,te),null!==i&&null!==o?((e,t,r,i)=>{let o,n,a=0,s=0,l=0,c=0,d=t.length-1,h=t[0],g=t[d],u=i.length-1,m=i[0],p=i[u];for(;a<=d&&s<=u;)if(null==h)h=t[++a];else if(null==g)g=t[--d];else if(null==m)m=i[++s];else if(null==p)p=i[--u];else if(Te(h,m))Oe(h,m),h=t[++a],m=i[++s];else if(Te(g,p))Oe(g,p),g=t[--d],p=i[--u];else if(Te(h,p))"slot"!==h.$tag$&&"slot"!==p.$tag$||ke(h.$elm$.parentNode,!1),Oe(h,p),e.insertBefore(h.$elm$,g.$elm$.nextSibling),h=t[++a],p=i[--u];else if(Te(g,m))"slot"!==h.$tag$&&"slot"!==p.$tag$||ke(g.$elm$.parentNode,!1),Oe(g,m),e.insertBefore(g.$elm$,h.$elm$),g=t[--d],m=i[++s];else{for(l=-1,c=a;c<=d;++c)if(t[c]&&null!==t[c].$key$&&t[c].$key$===m.$key$){l=c;break}l>=0?(n=t[l],n.$tag$!==m.$tag$?o=xe(t&&t[s],r,l,e):(Oe(n,m),t[l]=void 0,o=n.$elm$),m=i[++s]):(o=xe(t&&t[s],r,s,e),m=i[++s]),o&&Ee(h.$elm$).insertBefore(o,Se(h.$elm$))}a>d?Ce(e,null==i[u+1]?null:i[u+1].$elm$,r,i,s,u):s>u&&_e(t,a,d)})(r,i,t,o):null!==o?(null!==e.$text$&&(r.textContent=""),Ce(r,null,t,o,0,o.length-1)):null!==i&&_e(i,0,i.length-1),te&&"svg"===n&&(te=!1)):(s=r["s-cr"])?s.parentNode.textContent=a:e.$text$!==a&&(r.data=a)},ze=e=>{const t=e.childNodes;let r,i,o,n,a,s;for(i=0,o=t.length;i<o;i++)if(r=t[i],1===r.nodeType){if(r["s-sr"])for(a=r["s-sn"],r.hidden=!1,n=0;n<o;n++)if(s=t[n].nodeType,t[n]["s-hn"]!==r["s-hn"]||""!==a){if(1===s&&a===t[n].getAttribute("slot")){r.hidden=!0;break}}else if(1===s||3===s&&""!==t[n].textContent.trim()){r.hidden=!0;break}ze(r)}},Me=[],Le=e=>{let t,r,i,o,n,a,s=0;const l=e.childNodes,c=l.length;for(;s<c;s++){if(t=l[s],t["s-sr"]&&(r=t["s-cr"])&&r.parentNode)for(i=r.parentNode.childNodes,o=t["s-sn"],a=i.length-1;a>=0;a--)r=i[a],r["s-cn"]||r["s-nr"]||r["s-hn"]===t["s-hn"]||(De(r,o)?(n=Me.find((e=>e.$nodeToRelocate$===r)),J=!0,r["s-sn"]=r["s-sn"]||o,n?n.$slotRefNode$=t:Me.push({$slotRefNode$:t,$nodeToRelocate$:r}),r["s-sr"]&&Me.map((e=>{De(e.$nodeToRelocate$,r["s-sn"])&&(n=Me.find((e=>e.$nodeToRelocate$===r)),n&&!e.$slotRefNode$&&(e.$slotRefNode$=n.$slotRefNode$))}))):Me.some((e=>e.$nodeToRelocate$===r))||Me.push({$nodeToRelocate$:r}));1===t.nodeType&&Le(t)}},De=(e,t)=>1===e.nodeType?null===e.getAttribute("slot")&&""===t||e.getAttribute("slot")===t:e["s-sn"]===t||""===t,Ae=e=>{e.$attrs$&&e.$attrs$.ref&&e.$attrs$.ref(null),e.$children$&&e.$children$.map(Ae)},Ie=(e,t)=>{const r=e.$hostElement$,i=e.$cmpMeta$,o=e.$vnode$||le(null,null),n=(a=t)&&a.$tag$===ce?t:se(null,null,t);var a;if(X=r.tagName,i.$attrsToReflect$&&(n.$attrs$=n.$attrs$||{},i.$attrsToReflect$.map((([e,t])=>n.$attrs$[t]=r[e]))),n.$tag$=null,n.$flags$|=4,e.$vnode$=n,n.$elm$=o.$elm$=r.shadowRoot||r,G=r["s-sc"],Q=r["s-cr"],Z=0!=(1&i.$flags$),J=!1,Oe(o,n),lt.$flags$|=1,ee){let e,t,r,i,o,a;Le(n.$elm$);let s=0;for(;s<Me.length;s++)e=Me[s],t=e.$nodeToRelocate$,t["s-ol"]||(r=at.createTextNode(""),r["s-nr"]=t,t.parentNode.insertBefore(t["s-ol"]=r,t));for(s=0;s<Me.length;s++)if(e=Me[s],t=e.$nodeToRelocate$,e.$slotRefNode$){for(i=e.$slotRefNode$.parentNode,o=e.$slotRefNode$.nextSibling,r=t["s-ol"];r=r.previousSibling;)if(a=r["s-nr"],a&&a["s-sn"]===t["s-sn"]&&i===a.parentNode&&(a=a.nextSibling,!a||!a["s-nr"])){o=a;break}(!o&&i!==t.parentNode||t.nextSibling!==o)&&t!==o&&(!t["s-hn"]&&t["s-ol"]&&(t["s-hn"]=t["s-ol"].parentNode.nodeName),i.insertBefore(t,o))}else 1===t.nodeType&&(t.hidden=!0)}J&&ze(n.$elm$),lt.$flags$&=-2,Me.length=0},Re=(e,t)=>{e.$flags$|=16,e.$ancestorComponent$;return vt((()=>Fe(e,t)))},Fe=(e,t)=>{const r=e.$hostElement$,i=(e.$cmpMeta$.$tagName$,()=>{}),o=r;let n;return n=We(o,t?"componentWillLoad":"componentWillUpdate"),n=Be(n,(()=>We(o,"componentWillRender"))),i(),Be(n,(()=>He(e,o,t)))},He=async(e,t,r)=>{const i=e.$hostElement$,o=(e.$cmpMeta$.$tagName$,()=>{});i["s-rc"],r&&fe(e);const n=(e.$cmpMeta$.$tagName$,()=>{});Ne(e,t,i),n(),o(),je(e)},Ne=(e,t,r)=>{try{re=t,t=t.render&&t.render(),e.$flags$&=-17,e.$flags$|=2,(P||V)&&(K||V)&&(U||Ie(e,t))}catch(t){rt(t,e.$hostElement$)}return re=null,null},je=e=>{e.$cmpMeta$.$tagName$;const t=()=>{},r=e.$hostElement$;e.$ancestorComponent$,We(r,"componentDidRender"),64&e.$flags$?(We(r,"componentDidUpdate"),t()):(e.$flags$|=64,We(r,"componentDidLoad"),t())},We=(e,t,r)=>{if(e&&e[t])try{return e[t](r)}catch(e){rt(e)}},Be=(e,t)=>e&&e.then?e.then(t):t(),qe=(e,t,r,i)=>{const o=Je(e),n=e,a=o.$instanceValues$.get(t),s=o.$flags$,l=n;var c,d;c=r,d=i.$members$[t][0],r=null==c||ae(c)?c:4&d?"false"!==c&&(""===c||!!c):2&d?parseFloat(c):1&d?String(c):c;const h=Number.isNaN(a)&&Number.isNaN(r);if(r!==a&&!h){if(o.$instanceValues$.set(t,r),i.$watchers$&&128&s){const e=i.$watchers$[t];e&&e.map((e=>{try{l[e](r,a,t)}catch(e){rt(e,n)}}))}if(2==(18&s)){if(l.componentShouldUpdate&&!1===l.componentShouldUpdate(r,a,t))return;Re(o,!1)}}},Pe=(e,t,r)=>{if(t.$members$){e.watchers&&(t.$watchers$=e.watchers);const r=Object.entries(t.$members$),i=e.prototype;r.map((([e,[r]])=>{(31&r||32&r)&&Object.defineProperty(i,e,{get(){return t=e,Je(this).$instanceValues$.get(t);var t},set(r){qe(this,e,r,t)},configurable:!0,enumerable:!0})}));{const o=new Map;i.attributeChangedCallback=function(e,t,r){lt.jmp((()=>{const t=o.get(e);if(this.hasOwnProperty(t))r=this[t],delete this[t];else if(i.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==r)return;this[t]=(null!==r||"boolean"!=typeof this[t])&&r}))},e.observedAttributes=r.filter((([e,t])=>15&t[0])).map((([e,r])=>{const i=r[1]||e;return o.set(i,e),512&r[0]&&t.$attrsToReflect$.push([e,i]),i}))}}return e},Ve=async(e,t,r,i,o)=>{if(0==(32&t.$flags$)&&(o=e.constructor,t.$flags$|=32,customElements.whenDefined(r.$tagName$).then((()=>t.$flags$|=128)),o.style)){let i=o.style;"string"!=typeof i&&(i=i[t.$modeName$=(e=>ot.map((t=>t(e))).find((e=>!!e)))(e)]);const n=ve(r,t.$modeName$);if(!it.has(n)){const e=(r.$tagName$,()=>{});((e,t,r)=>{let i=it.get(e);dt&&r?(i=i||new CSSStyleSheet,"string"==typeof i?i=t:i.replaceSync(t)):i=t,it.set(e,i)})(n,i,!!(1&r.$flags$)),e()}}t.$ancestorComponent$;Re(t,!0)},Ke=e=>{const t=e["s-cr"]=at.createComment("");t["s-cn"]=!0,e.insertBefore(t,e.firstChild)},Ue=(e,t)=>{const r={$flags$:t[0],$tagName$:t[1]};r.$members$=t[2],r.$listeners$=t[3],r.$watchers$=e.$watchers$,r.$attrsToReflect$=[];const i=e.prototype.connectedCallback,o=e.prototype.disconnectedCallback;return Object.assign(e.prototype,{__registerHost(){et(this,r)},connectedCallback(){(e=>{if(0==(1&lt.$flags$)){const t=Je(e),r=t.$cmpMeta$,i=(r.$tagName$,()=>{});1&t.$flags$?(Ye(e,t,r.$listeners$),t.$lazyInstance$):(t.$flags$|=1,12&r.$flags$&&Ke(e),r.$members$&&Object.entries(r.$members$).map((([t,[r]])=>{if(31&r&&e.hasOwnProperty(t)){const r=e[t];delete e[t],e[t]=r}})),Ve(e,t,r)),i()}})(this),i&&i.call(this)},disconnectedCallback(){(e=>{if(0==(1&lt.$flags$)){const t=Je(e);t.$rmListeners$&&(t.$rmListeners$.map((e=>e())),t.$rmListeners$=void 0)}})(this),o&&o.call(this)},__attachShadow(){this.attachShadow({mode:"open",delegatesFocus:!!(16&r.$flags$)})}}),e.is=r.$tagName$,Pe(e,r)},Ye=(e,t,r,i)=>{r&&r.map((([r,i,o])=>{const n=Qe(e,r),a=Ge(t,o),s=Xe(r);lt.ael(n,i,a,s),(t.$rmListeners$=t.$rmListeners$||[]).push((()=>lt.rel(n,i,a,s)))}))},Ge=(e,t)=>r=>{try{Y||e.$hostElement$[t](r)}catch(e){rt(e)}},Qe=(e,t)=>4&t?at:8&t?nt:16&t?at.body:e,Xe=e=>ct?{passive:0!=(1&e),capture:0!=(2&e)}:0!=(2&e),Ze=new WeakMap,Je=e=>Ze.get(e),et=(e,t)=>{const r={$flags$:0,$hostElement$:e,$cmpMeta$:t,$instanceValues$:new Map};return Ye(e,r,t.$listeners$),Ze.set(e,r)},tt=(e,t)=>t in e,rt=(e,t)=>(0,console.error)(e,t),it=new Map,ot=[],nt="undefined"!=typeof window?window:{},at=nt.document||{head:{}},st=nt.HTMLElement||class{},lt={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,r,i)=>e.addEventListener(t,r,i),rel:(e,t,r,i)=>e.removeEventListener(t,r,i),ce:(e,t)=>new CustomEvent(e,t)},ct=(()=>{let e=!1;try{at.addEventListener("e",null,Object.defineProperty({},"passive",{get(){e=!0}}))}catch(e){}return e})(),dt=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),ht=[],gt=[],ut=(e,t)=>r=>{e.push(r),ie||(ie=!0,t&&4&lt.$flags$?ft(pt):lt.raf(pt))},mt=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){rt(e)}e.length=0},pt=()=>{mt(ht),mt(gt),(ie=ht.length>0)&&lt.raf(pt)},ft=e=>{return Promise.resolve(t).then(e);var t},vt=ut(gt,!0),bt=(e,t)=>{const r=!!e.label||e.hasLabelSlot,i=!!e.helpText||e.hasHelpTextSlot,o=!!e.invalidText||e.hasInvalidTextSlot,n=!e.invalid,a=!!e.invalid;return se("div",{class:{"form-control":!0,[`form-control-${e.size}`]:!0,"form-control-has-label":r,"form-control-has-help-text":i,"form-control-has-invalid-text":o}},se("label",{id:e.labelId,class:"form-control-label",htmlFor:e.inputId,"aria-hidden":r?"false":"true",onClick:e.onLabelClick},se("slot",{name:"label"},e.label),e.requiredIndicator&&se("div",{class:"asterisk"},se("svg",{role:"img","aria-hidden":"true",viewBox:"0 0 1200 1200"},se("path",{fill:"currentColor",d:"M489.838 29.354v443.603L68.032 335.894 0 545.285l421.829 137.086-260.743 358.876 178.219 129.398L600.048 811.84l260.673 358.806 178.146-129.398-260.766-358.783L1200 545.379l-68.032-209.403-421.899 137.07V29.443H489.84l-.002-.089z"})))),se("div",{class:"form-control-input"},t),n&&se("div",{id:e.helpTextId,class:"form-control-help-text","aria-hidden":i?"false":"true"},se("slot",{name:"help-text"},e.helpText)),a&&se("div",{id:e.invalidTextId,class:"form-control-invalid-text","aria-hidden":o?"false":"true"},se("div",{class:"icon"},se("svg",{role:"img","aria-hidden":"true",viewBox:"0 0 512 512"},se("title",null,"Alert Circle"),se("path",{d:"M256,48C141.31,48,48,141.31,48,256s93.31,208,208,208,208-93.31,208-208S370.69,48,256,48Zm0,319.91a20,20,0,1,1,20-20A20,20,0,0,1,256,367.91Zm21.72-201.15-5.74,122a16,16,0,0,1-32,0l-5.74-121.94v-.05a21.74,21.74,0,1,1,43.44,0Z",fill:"currentColor"}))),se("div",{class:"text"},se("slot",{name:"invalid-text"},e.invalidText))))};
/*!
* (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){--border-color:var(--gr-color-danger);--background:transparent;--color:var(--gr-color-danger);--border-color-hover:var(--gr-color-danger);--background-hover:var(--gr-color-danger);--color-hover:var(--gr-color-danger-contrast);--border-color-focus:var(--gr-color-danger);--background-focus:var(--gr-color-danger);--color-focus:var(--gr-color-danger-contrast);--focus-ring:0 0 0 var(--gr-focus-ring-width) rgb(var(--gr-color-danger-rgb), 0.33)}:host(.button-plain){--border-color:transparent;--background:transparent;--color:var(--gr-color-primary);--border-color-hover:transparent;--background-hover:transparent;--color-hover:var(--gr-color-primary-shade);--border-color-focus:transparent;--background-focus:transparent;--color-focus:var(--gr-color-primary-shade);--focus-ring:0 0 0 var(--gr-focus-ring-width) rgb(var(--gr-color-primary-rgb), 0.33)}:host(.button-small){--padding-start:var(--gr-spacing-small);--padding-end:var(--gr-spacing-small);--border-radius:var(--gr-form-element-border-radius-small);--height:var(--gr-form-element-height-small);font-size:var(--gr-form-element-font-size-small)}:host(.button-large){--padding-start:var(--gr-spacing-large);--padding-end:var(--gr-spacing-large);--border-radius:var(--gr-form-element-border-radius-large);--height:var(--gr-form-element-height-large);font-size:var(--gr-form-element-font-size-large)}:host(.button-block){display:block}:host(.button-block) .button-native{margin-left:0;margin-right:0;display:block;width:100%;clear:both;contain:content}:host(.button-block) .button-native::after{clear:both}:host(.button-full){display:block}:host(.button-full) .button-native{margin-left:0;margin-right:0;display:block;width:100%;contain:content;border-radius:0;border-right-width:0;border-left-width:0}.button-native{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:block;position:relative;padding-top:var(--padding-top);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-bottom:var(--padding-bottom);width:100%;height:var(--height);transition:var(--transition);border-radius:var(--border-radius);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);color:var(--color);box-shadow:var(--shadow);line-height:1;cursor:pointer;z-index:0;text-decoration:none;box-sizing:border-box}.button-native::-moz-focus-inner{border:0}.button-native:focus{outline:none;box-shadow:var(--focus-ring);border-color:var(--border-color-focus);background-color:var(--background-focus);color:var(--color-focus)}.button-native *,.button-native *:before,.button-native *:after{box-sizing:inherit}.button-inner{display:flex;position:relative;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;width:100%;height:100%;z-index:1}:host(.button-circle) .button-native{padding-top:0;padding-bottom:0;padding-left:0;padding-right:0;border-radius:50%;width:var(--height)}@media (any-hover: hover){.button-native:hover{color:var(--color-hover);background:var(--background-hover);border-color:var(--border-color-hover)}}:host(.button-caret) .caret{display:flex;align-items:center;margin-left:0.3em}:host(.button-caret) .caret svg{width:1em;height:1em}:host(.button-pill) .button-native{border-radius:var(--height)}::slotted(*){pointer-events:none}::slotted([slot=start]){margin-top:0;margin-left:-0.3em;margin-right:0.3em;margin-bottom:0}::slotted([slot=end]){margin-top:0;margin-left:0.3em;margin-right:-0.2em;margin-bottom:0}::slotted([slot=icon-only]){font-size:1.4em;pointer-events:none}:host(.button-loading){position:relative;pointer-events:none}:host(.button-loading) .caret{visibility:hidden}:host(.button-loading) slot[name=start],:host(.button-loading) slot[name=end],:host(.button-loading) slot[name=icon-only],:host(.button-loading) slot:not([name]){visibility:hidden}:host(.button-loading) gr-spinner{--indicator-color:currentColor;position:absolute;height:1em;width:1em;top:calc(50% - 0.5em);left:calc(50% - 0.5em)}@media not all and (min-resolution: 0.001dpcm){@supports (-webkit-appearance: none) and (stroke-color: transparent){:host([type=button]),:host([type=reset]),:host([type=submit]){-webkit-appearance:none !important}}}"}},[1,"gr-button",{variant:[513],disabled:[516],loading:[516],size:[513],caret:[4],pill:[516],expand:[513],circle:[516],href:[1],target:[1],rel:[1],type:[1],setFocus:[64],removeFocus:[64]}]);function _t(){if("undefined"==typeof customElements)return;["gr-button","gr-spinner"].forEach((e=>{switch(e){case"gr-button":customElements.get(e)||customElements.define(e,Ct);break;case"gr-spinner":customElements.get(e)||kt()}}))}function Tt(e,t,r="vertical",i="smooth"){const o=
/*!
* (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"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:gr(e,At))};const mr={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,r=e.state,i=e.name,o=e.options,n=r.elements.arrow,a=r.modifiersData.popperOffsets,s=Qt(r.placement),l=cr(s),c=[Lt,Mt].indexOf(s)>=0?"height":"width";if(n&&a){var d=ur(o.padding,r),h=tr(n),g="y"===l?Ot:Lt,u="y"===l?zt:Mt,m=r.rects.reference[c]+r.rects.reference[l]-a[l]-r.rects.popper[c],p=a[l]-r.rects.reference[l],f=lr(n),v=f?"y"===l?f.clientHeight||0:f.clientWidth||0:0,b=m/2-p/2,y=d[g],w=v-h[c]-d[u],$=v/2-h[c]/2+b,x=dr(y,$,w),k=l;r.modifiersData[i]=((t={})[k]=x,t.centerOffset=x-$,t)}},effect:function(e){var t=e.state,r=e.options.element,i=void 0===r?"[data-popper-arrow]":r;null!=i&&("string"!=typeof i||(i=t.elements.popper.querySelector(i)))&&rr(t.elements.popper,i)&&(t.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function pr(e){return e.split("-")[1]}var fr={top:"auto",right:"auto",bottom:"auto",left:"auto"};function vr(e){var t,r=e.popper,i=e.popperRect,o=e.placement,n=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,d=e.roundOffsets,h=e.isFixed,g=a.x,u=void 0===g?0:g,m=a.y,p=void 0===m?0:m,f="function"==typeof d?d({x:u,y:p}):{x:u,y:p};u=f.x,p=f.y;var v=a.hasOwnProperty("x"),b=a.hasOwnProperty("y"),y=Lt,w=Ot,$=window;if(c){var x=lr(r),k="clientHeight",C="clientWidth";if(x===Vt(r)&&"static"!==ir(x=nr(r)).position&&"absolute"===s&&(k="scrollHeight",C="scrollWidth"),o===Ot||(o===Lt||o===Mt)&&n===Rt)w=zt,p-=(h&&x===$&&$.visualViewport?$.visualViewport.height:x[k])-i.height,p*=l?1:-1;if(o===Lt||(o===Ot||o===zt)&&n===Rt)y=Mt,u-=(h&&x===$&&$.visualViewport?$.visualViewport.width:x[C])-i.width,u*=l?1:-1}var _,T=Object.assign({position:s},c&&fr),S=!0===d?function(e){var t=e.x,r=e.y,i=window.devicePixelRatio||1;return{x:Jt(t*i)/i||0,y:Jt(r*i)/i||0}}({x:u,y:p}):{x:u,y:p};return u=S.x,p=S.y,l?Object.assign({},T,((_={})[w]=b?"0":"",_[y]=v?"0":"",_.transform=($.devicePixelRatio||1)<=1?"translate("+u+"px, "+p+"px)":"translate3d("+u+"px, "+p+"px, 0)",_)):Object.assign({},T,((t={})[w]=b?p+"px":"",t[y]=v?u+"px":"",t.transform="",t))}var br={passive:!0};var yr={left:"right",right:"left",bottom:"top",top:"bottom"};function wr(e){return e.replace(/left|right|bottom|top/g,(function(e){return yr[e]}))}var $r={start:"end",end:"start"};function xr(e){return e.replace(/start|end/g,(function(e){return $r[e]}))}function kr(e){var t=Vt(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Cr(e){return er(nr(e)).left+kr(e).scrollLeft}function _r(e){var t=ir(e),r=t.overflow,i=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+i)}function Tr(e){return["html","body","#document"].indexOf(Pt(e))>=0?e.ownerDocument.body:Ut(e)&&_r(e)?e:Tr(ar(e))}function Sr(e,t){var r;void 0===t&&(t=[]);var i=Tr(e),o=i===(null==(r=e.ownerDocument)?void 0:r.body),n=Vt(i),a=o?[n].concat(n.visualViewport||[],_r(i)?i:[]):i,s=t.concat(a);return o?s:s.concat(Sr(ar(a)))}function Er(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Or(e,t){return t===Ht?Er(function(e){var t=Vt(e),r=nr(e),i=t.visualViewport,o=r.clientWidth,n=r.clientHeight,a=0,s=0;return i&&(o=i.width,n=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=i.offsetLeft,s=i.offsetTop)),{width:o,height:n,x:a+Cr(e),y:s}}(e)):Kt(t)?function(e){var t=er(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):Er(function(e){var t,r=nr(e),i=kr(e),o=null==(t=e.ownerDocument)?void 0:t.body,n=Xt(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Xt(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-i.scrollLeft+Cr(e),l=-i.scrollTop;return"rtl"===ir(o||r).direction&&(s+=Xt(r.clientWidth,o?o.clientWidth:0)-n),{width:n,height:a,x:s,y:l}}(nr(e)))}function zr(e,t,r){var i="clippingParents"===t?function(e){var t=Sr(ar(e)),r=["absolute","fixed"].indexOf(ir(e).position)>=0&&Ut(e)?lr(e):e;return Kt(r)?t.filter((function(e){return Kt(e)&&rr(e,r)&&"body"!==Pt(e)})):[]}(e):[].concat(t),o=[].concat(i,[r]),n=o[0],a=o.reduce((function(t,r){var i=Or(e,r);return t.top=Xt(i.top,t.top),t.right=Zt(i.right,t.right),t.bottom=Zt(i.bottom,t.bottom),t.left=Xt(i.left,t.left),t}),Or(e,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Mr(e){var t,r=e.reference,i=e.element,o=e.placement,n=o?Qt(o):null,a=o?pr(o):null,s=r.x+r.width/2-i.width/2,l=r.y+r.height/2-i.height/2;switch(n){case Ot:t={x:s,y:r.y-i.height};break;case zt:t={x:s,y:r.y+r.height};break;case Mt:t={x:r.x+r.width,y:l};break;case Lt:t={x:r.x-i.width,y:l};break;default:t={x:r.x,y:r.y}}var c=n?cr(n):null;if(null!=c){var d="y"===c?"height":"width";switch(a){case It:t[c]=t[c]-(r[d]/2-i[d]/2);break;case Rt:t[c]=t[c]+(r[d]/2-i[d]/2)}}return t}function Lr(e,t){void 0===t&&(t={});var r=t,i=r.placement,o=void 0===i?e.placement:i,n=r.boundary,a=void 0===n?Ft:n,s=r.rootBoundary,l=void 0===s?Ht:s,c=r.elementContext,d=void 0===c?Nt:c,h=r.altBoundary,g=void 0!==h&&h,u=r.padding,m=void 0===u?0:u,p=hr("number"!=typeof m?m:gr(m,At)),f=d===Nt?jt:Nt,v=e.rects.popper,b=e.elements[g?f:d],y=zr(Kt(b)?b:b.contextElement||nr(e.elements.popper),a,l),w=er(e.elements.reference),$=Mr({reference:w,element:v,strategy:"absolute",placement:o}),x=Er(Object.assign({},v,$)),k=d===Nt?x:w,C={top:y.top-k.top+p.top,bottom:k.bottom-y.bottom+p.bottom,left:y.left-k.left+p.left,right:k.right-y.right+p.right},_=e.modifiersData.offset;if(d===Nt&&_){var T=_[o];Object.keys(C).forEach((function(e){var t=[Mt,zt].indexOf(e)>=0?1:-1,r=[Ot,zt].indexOf(e)>=0?"y":"x";C[e]+=T[r]*t}))}return C}function Dr(e,t){void 0===t&&(t={});var r=t,i=r.placement,o=r.boundary,n=r.rootBoundary,a=r.padding,s=r.flipVariations,l=r.allowedAutoPlacements,c=void 0===l?Bt:l,d=pr(i),h=d?s?Wt:Wt.filter((function(e){return pr(e)===d})):At,g=h.filter((function(e){return c.indexOf(e)>=0}));0===g.length&&(g=h);var u=g.reduce((function(t,r){return t[r]=Lr(e,{placement:r,boundary:o,rootBoundary:n,padding:a})[Qt(r)],t}),{});return Object.keys(u).sort((function(e,t){return u[e]-u[t]}))}const Ar={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var o=r.mainAxis,n=void 0===o||o,a=r.altAxis,s=void 0===a||a,l=r.fallbackPlacements,c=r.padding,d=r.boundary,h=r.rootBoundary,g=r.altBoundary,u=r.flipVariations,m=void 0===u||u,p=r.allowedAutoPlacements,f=t.options.placement,v=Qt(f),b=l||(v===f||!m?[wr(f)]:function(e){if(Qt(e)===Dt)return[];var t=wr(e);return[xr(e),t,xr(t)]}(f)),y=[f].concat(b).reduce((function(e,r){return e.concat(Qt(r)===Dt?Dr(t,{placement:r,boundary:d,rootBoundary:h,padding:c,flipVariations:m,allowedAutoPlacements:p}):r)}),[]),w=t.rects.reference,$=t.rects.popper,x=new Map,k=!0,C=y[0],_=0;_<y.length;_++){var T=y[_],S=Qt(T),E=pr(T)===It,O=[Ot,zt].indexOf(S)>=0,z=O?"width":"height",M=Lr(t,{placement:T,boundary:d,rootBoundary:h,altBoundary:g,padding:c}),L=O?E?Mt:Lt:E?zt:Ot;w[z]>$[z]&&(L=wr(L));var D=wr(L),A=[];if(n&&A.push(M[S]<=0),s&&A.push(M[L]<=0,M[D]<=0),A.every((function(e){return e}))){C=T,k=!1;break}x.set(T,A)}if(k)for(var I=function(e){var t=y.find((function(t){var r=x.get(t);if(r)return r.slice(0,e).every((function(e){return e}))}));if(t)return C=t,"break"},R=m?3:1;R>0;R--){if("break"===I(R))break}t.placement!==C&&(t.modifiersData[i]._skip=!0,t.placement=C,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Ir(e,t,r){return void 0===r&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function Rr(e){return[Ot,Mt,zt,Lt].some((function(t){return e[t]>=0}))}const Fr={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,r=e.options,i=e.name,o=r.offset,n=void 0===o?[0,0]:o,a=Bt.reduce((function(e,r){return e[r]=function(e,t,r){var i=Qt(e),o=[Lt,Ot].indexOf(i)>=0?-1:1,n="function"==typeof r?r(Object.assign({},t,{placement:e})):r,a=n[0],s=n[1];return a=a||0,s=(s||0)*o,[Lt,Mt].indexOf(i)>=0?{x:s,y:a}:{x:a,y:s}}(r,t.rects,n),e}),{}),s=a[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[i]=a}};const Hr={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,i=e.name,o=r.mainAxis,n=void 0===o||o,a=r.altAxis,s=void 0!==a&&a,l=r.boundary,c=r.rootBoundary,d=r.altBoundary,h=r.padding,g=r.tether,u=void 0===g||g,m=r.tetherOffset,p=void 0===m?0:m,f=Lr(t,{boundary:l,rootBoundary:c,padding:h,altBoundary:d}),v=Qt(t.placement),b=pr(t.placement),y=!b,w=cr(v),$="x"===w?"y":"x",x=t.modifiersData.popperOffsets,k=t.rects.reference,C=t.rects.popper,_="function"==typeof p?p(Object.assign({},t.rects,{placement:t.placement})):p,T="number"==typeof _?{mainAxis:_,altAxis:_}:Object.assign({mainAxis:0,altAxis:0},_),S=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,E={x:0,y:0};if(x){if(n){var O,z="y"===w?Ot:Lt,M="y"===w?zt:Mt,L="y"===w?"height":"width",D=x[w],A=D+f[z],I=D-f[M],R=u?-C[L]/2:0,F=b===It?k[L]:C[L],H=b===It?-C[L]:-k[L],N=t.elements.arrow,j=u&&N?tr(N):{width:0,height:0},W=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},B=W[z],q=W[M],P=dr(0,k[L],j[L]),V=y?k[L]/2-R-P-B-T.mainAxis:F-P-B-T.mainAxis,K=y?-k[L]/2+R+P+q+T.mainAxis:H+P+q+T.mainAxis,U=t.elements.arrow&&lr(t.elements.arrow),Y=U?"y"===w?U.clientTop||0:U.clientLeft||0:0,G=null!=(O=null==S?void 0:S[w])?O:0,Q=D+K-G,X=dr(u?Zt(A,D+V-G-Y):A,D,u?Xt(I,Q):I);x[w]=X,E[w]=X-D}if(s){var Z,J="x"===w?Ot:Lt,ee="x"===w?zt:Mt,te=x[$],re="y"===$?"height":"width",ie=te+f[J],oe=te-f[ee],ne=-1!==[Ot,Lt].indexOf(v),ae=null!=(Z=null==S?void 0:S[$])?Z:0,se=ne?ie:te-k[re]-C[re]-ae+T.altAxis,le=ne?te+k[re]+C[re]-ae-T.altAxis:oe,ce=u&&ne?function(e,t,r){var i=dr(e,t,r);return i>r?r:i}(se,te,le):dr(u?se:ie,te,u?le:oe);x[$]=ce,E[$]=ce-te}t.modifiersData[i]=E}},requiresIfExists:["offset"]};function Nr(e,t,r){void 0===r&&(r=!1);var i,o,n=Ut(t),a=Ut(t)&&function(e){var t=e.getBoundingClientRect(),r=Jt(t.width)/e.offsetWidth||1,i=Jt(t.height)/e.offsetHeight||1;return 1!==r||1!==i}(t),s=nr(t),l=er(e,a),c={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(n||!n&&!r)&&(("body"!==Pt(t)||_r(s))&&(c=(i=t)!==Vt(i)&&Ut(i)?{scrollLeft:(o=i).scrollLeft,scrollTop:o.scrollTop}:kr(i)),Ut(t)?((d=er(t,!0)).x+=t.clientLeft,d.y+=t.clientTop):s&&(d.x=Cr(s))),{x:l.left+c.scrollLeft-d.x,y:l.top+c.scrollTop-d.y,width:l.width,height:l.height}}function jr(e){var t=new Map,r=new Set,i=[];function o(e){r.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!r.has(e)){var i=t.get(e);i&&o(i)}})),i.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){r.has(e.name)||o(e)})),i}var Wr={placement:"bottom",modifiers:[],strategy:"absolute"};function Br(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function qr(e){void 0===e&&(e={});var t=e,r=t.defaultModifiers,i=void 0===r?[]:r,o=t.defaultOptions,n=void 0===o?Wr:o;return function(e,t,r){void 0===r&&(r=n);var o,a,s={placement:"bottom",orderedModifiers:[],options:Object.assign({},Wr,n),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],c=!1,d={state:s,setOptions:function(r){var o="function"==typeof r?r(s.options):r;h(),s.options=Object.assign({},n,s.options,o),s.scrollParents={reference:Kt(e)?Sr(e):e.contextElement?Sr(e.contextElement):[],popper:Sr(t)};var a,c,g=function(e){var t=jr(e);return qt.reduce((function(e,r){return e.concat(t.filter((function(e){return e.phase===r})))}),[])}((a=[].concat(i,s.options.modifiers),c=a.reduce((function(e,t){var r=e[t.name];return e[t.name]=r?Object.assign({},r,t,{options:Object.assign({},r.options,t.options),data:Object.assign({},r.data,t.data)}):t,e}),{}),Object.keys(c).map((function(e){return c[e]}))));return s.orderedModifiers=g.filter((function(e){return e.enabled})),s.orderedModifiers.forEach((function(e){var t=e.name,r=e.options,i=void 0===r?{}:r,o=e.effect;if("function"==typeof o){var n=o({state:s,name:t,instance:d,options:i}),a=function(){};l.push(n||a)}})),d.update()},forceUpdate:function(){if(!c){var e=s.elements,t=e.reference,r=e.popper;if(Br(t,r)){s.rects={reference:Nr(t,lr(r),"fixed"===s.options.strategy),popper:tr(r)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)}));for(var i=0;i<s.orderedModifiers.length;i++)if(!0!==s.reset){var o=s.orderedModifiers[i],n=o.fn,a=o.options,l=void 0===a?{}:a,h=o.name;"function"==typeof n&&(s=n({state:s,options:l,name:h,instance:d})||s)}else s.reset=!1,i=-1}}},update:(o=function(){return new Promise((function(e){d.forceUpdate(),e(s)}))},function(){return a||(a=new Promise((function(e){Promise.resolve().then((function(){a=void 0,e(o())}))}))),a}),destroy:function(){h(),c=!0}};if(!Br(e,t))return d;function h(){l.forEach((function(e){return e()})),l=[]}return d.setOptions(r).then((function(e){!c&&r.onFirstUpdate&&r.onFirstUpdate(e)})),d}}var Pr=qr({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,r=e.instance,i=e.options,o=i.scroll,n=void 0===o||o,a=i.resize,s=void 0===a||a,l=Vt(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return n&&c.forEach((function(e){e.addEventListener("scroll",r.update,br)})),s&&l.addEventListener("resize",r.update,br),function(){n&&c.forEach((function(e){e.removeEventListener("scroll",r.update,br)})),s&&l.removeEventListener("resize",r.update,br)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,r=e.name;t.modifiersData[r]=Mr({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,r=e.options,i=r.gpuAcceleration,o=void 0===i||i,n=r.adaptive,a=void 0===n||n,s=r.roundOffsets,l=void 0===s||s,c={placement:Qt(t.placement),variation:pr(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,vr(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,vr(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Gt,Fr,Ar,Hr,mr,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,r=e.name,i=t.rects.reference,o=t.rects.popper,n=t.modifiersData.preventOverflow,a=Lr(t,{elementContext:"reference"}),s=Lr(t,{altBoundary:!0}),l=Ir(a,i),c=Ir(s,o,n),d=Rr(l),h=Rr(c);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":h})}}]});class Vr{constructor(e,t,r){this.handleTransitionEnd=this.handleTransitionEnd.bind(this),this.anchor=e,this.popover=t,this.options=Object.assign({skidding:0,distance:0,placement:"bottom-start",strategy:"absolute",transitionElement:this.popover,visibleClass:"popover-visible",onAfterShow:()=>{},onAfterHide:()=>{},onTransitionEnd:()=>{}},r),this.isVisible=!1,this.popover.hidden=!0,this.popover.classList.remove(this.options.visibleClass),this.popover.addEventListener("transitionend",this.handleTransitionEnd)}handleTransitionEnd(e){e.target===this.options.transitionElement&&(this.options.onTransitionEnd.call(this,e),this.isVisible||this.popover.hidden||(this.popover.hidden=!0,this.popover.classList.remove(this.options.visibleClass),this.options.onAfterHide.call(this)))}destroy(){this.popover.removeEventListener("transitionend",this.handleTransitionEnd),this.popper&&(this.popper.destroy(),this.popper=null)}show(){this.isVisible=!0,this.popover.hidden=!1,requestAnimationFrame((()=>this.popover.classList.add(this.options.visibleClass))),this.popper&&this.popper.destroy(),this.popper=Pr(this.anchor,this.popover,{placement:this.options.placement,strategy:this.options.strategy,modifiers:[{name:"flip",options:{boundary:"viewport"}},{name:"offset",options:{offset:[this.options.skidding,this.options.distance]}}]}),this.popover.addEventListener("transitionend",(()=>this.options.onAfterShow.call(this)),{once:!0}),requestAnimationFrame((()=>this.popper.update()))}hide(){this.isVisible=!1,this.popover.classList.remove(this.options.visibleClass)}setOptions(e){this.options=Object.assign(this.options,e),this.isVisible?this.popover.classList.add(this.options.visibleClass):this.popover.classList.remove(this.options.visibleClass),this.popper&&(this.popper.setOptions({placement:this.options.placement,strategy:this.options.strategy}),requestAnimationFrame((()=>this.popper.update())))}}let Kr=0;const Ur=Ue(class extends st{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.grShow=ue(this,"gr-show",7),this.grAfterShow=ue(this,"gr-after-show",7),this.grHide=ue(this,"gr-hide",7),this.grAfterHide=ue(this,"gr-after-hide",7),this.componentId="dropdown-"+ ++Kr,this.isVisible=!1,this.open=!1,this.placement="bottom-start",this.closeOnSelect=!0,this.containingElement=void 0,this.distance=2,this.skidding=0,this.hoist=!1}handleOpenChange(){this.open?this.show():this.hide(),this.updateAccessibleTrigger()}handlePopoverOptionsChange(){this.popoverElement.setOptions({strategy:this.hoist?"fixed":"absolute",placement:this.placement,distance:this.distance,skidding:this.skidding})}connectedCallback(){this.containingElement||(this.containingElement=this.el),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.handleMenuItemActivate=this.handleMenuItemActivate.bind(this),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleTriggerClick=this.handleTriggerClick.bind(this),this.handleTriggerKeyDown=this.handleTriggerKeyDown.bind(this),this.handleTriggerKeyUp=this.handleTriggerKeyUp.bind(this),this.handleTriggerSlotChange=this.handleTriggerSlotChange.bind(this)}componentDidLoad(){this.popoverElement=new Vr(this.trigger,this.positioner,{strategy:this.hoist?"fixed":"absolute",placement:this.placement,distance:this.distance,skidding:this.skidding,transitionElement:this.panel,onAfterHide:()=>this.grAfterHide.emit(),onAfterShow:()=>this.grAfterShow.emit(),onTransitionEnd:()=>{this.open||(this.panel.scrollTop=0)}}),this.open&&this.show()}disconnectedCallback(){this.hide(),this.popoverElement.destroy()}async show(){if(this.isVisible)return;this.grShow.emit().defaultPrevented?this.open=!1:(this.panel.addEventListener("gr-activate",this.handleMenuItemActivate),this.panel.addEventListener("gr-select",this.handlePanelSelect),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown),this.isVisible=!0,this.open=!0,this.popoverElement.show())}async hide(){if(!this.isVisible)return;this.grHide.emit().defaultPrevented?this.open=!0:(this.panel.removeEventListener("gr-activate",this.handleMenuItemActivate),this.panel.removeEventListener("gr-select",this.handlePanelSelect),document.addEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown),this.isVisible=!1,this.open=!1,this.popoverElement.hide())}async focusOnTrigger(){const e=this.trigger.querySelector("slot").assignedElements({flatten:!0})[0];e&&("function"==typeof e.setFocus?e.setFocus():"function"==typeof e.focus&&e.focus())}getMenu(){return this.panel.querySelector("slot").assignedElements({flatten:!0}).filter((e=>"gr-menu"===e.tagName.toLowerCase()))[0]}handleDocumentKeyDown(e){var t;if("Escape"===e.key)return this.hide(),void this.focusOnTrigger();if("Tab"===e.key){if(this.open&&"gr-menu-item"===(null===(t=document.activeElement)||void 0===t?void 0:t.tagName.toLowerCase()))return e.preventDefault(),this.hide(),void this.focusOnTrigger();setTimeout((()=>{var e;const t=this.containingElement.getRootNode()instanceof ShadowRoot?null===(e=document.activeElement.shadowRoot)||void 0===e?void 0:e.activeElement:document.activeElement;(null==t?void 0:t.closest(this.containingElement.tagName.toLowerCase()))===this.containingElement||this.hide()}))}}handleDocumentMouseDown(e){e.composedPath().includes(this.containingElement)||this.hide()}handleMenuItemActivate(e){Tt(e.target,this.panel)}handlePanelSelect(e){const t=e.target;this.closeOnSelect&&"gr-menu"===t.tagName.toLowerCase()&&(this.hide(),this.focusOnTrigger())}handleTriggerClick(){this.open?this.hide():this.show()}handleTriggerKeyDown(e){const t=this.getMenu(),r=t?[...t.querySelectorAll("gr-menu-item")]:null,i=r[0],o=r[r.length-1];if("Escape"===e.key)return this.focusOnTrigger(),void this.hide();if([" ","Enter"].includes(e.key))return e.preventDefault(),void(this.open?this.hide():this.show());if(["ArrowDown","ArrowUp"].includes(e.key)){if(e.preventDefault(),this.open||this.show(),"ArrowDown"===e.key&&i)return void i.setFocus();if("ArrowUp"===e.key&&o)return void o.setFocus()}this.open&&t&&!["Tab","Shift","Meta","Ctrl","Alt"].includes(e.key)&&t.typeToSelect(e.key)}handleTriggerKeyUp(e){" "===e.key&&e.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}updateAccessibleTrigger(){const e=this.trigger.querySelector("slot").assignedElements({flatten:!0}).map(Et)[0];e&&(e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-expanded",this.open?"true":"false"))}render(){return se(ce,{id:this.componentId,class:{"dropdown-open":this.open}},se("span",{class:"dropdown-trigger",ref:e=>this.trigger=e,onClick:this.handleTriggerClick,onKeyDown:this.handleTriggerKeyDown,onKeyUp:this.handleTriggerKeyUp},se("slot",{name:"trigger",onSlotchange:this.handleTriggerSlotChange})),se("div",{ref:e=>this.positioner=e,class:"dropdown-positioner"},se("div",{ref:e=>this.panel=e,class:"dropdown-panel",role:"menu","aria-hidden":this.open?"false":"true","aria-labelledby":this.componentId},se("slot",null))))}get el(){return this}static get watchers(){return{open:["handleOpenChange"],distance:["handlePopoverOptionsChange"],hoist:["handlePopoverOptionsChange"],placement:["handlePopoverOptionsChange"],skidding:["handlePopoverOptionsChange"]}}static get style(){return".gr-scroll-lock{overflow:hidden !important}:host{--panel-background-color:var(--gr-color-white);--panel-border-radius:var(--gr-border-radius-medium);--panel-border-color:var(--gr-panel-border-color);--panel-box-shadow:var(--gr-shadow-large);--transition:150ms opacity, 150ms transform;display:inline-block;position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}.dropdown-trigger{display:block}.dropdown-positioner{position:absolute;z-index:var(--gr-z-index-dropdown)}.dropdown-panel{max-height:50vh;font-family:var(--gr-font-family);font-size:var(--gr-font-size-medium);font-weight:var(--gr-font-weight-normal);background-color:var(--panel-background-color);border:solid 1px var(--panel-border-color);border-radius:var(--panel-border-radius);box-shadow:var(--panel-box-shadow);opacity:0;overflow:auto;overscroll-behavior:none;pointer-events:none;transform:scale(0.9);transition:var(--transition)}.dropdown-positioner[data-popper-placement^=top] .dropdown-panel{transform-origin:bottom}.dropdown-positioner[data-popper-placement^=bottom] .dropdown-panel{transform-origin:top}.dropdown-positioner[data-popper-placement^=left] .dropdown-panel{transform-origin:right}.dropdown-positioner[data-popper-placement^=right] .dropdown-panel{transform-origin:left}.dropdown-positioner.popover-visible .dropdown-panel{opacity:1;transform:none;pointer-events:all}"}},[1,"gr-dropdown",{open:[1540],placement:[1],closeOnSelect:[4,"close-on-select"],containingElement:[1040],distance:[2],skidding:[2],hoist:[4],show:[64],hide:[64],focusOnTrigger:[64]}]);function Yr(){if("undefined"==typeof customElements)return;["gr-dropdown"].forEach((e=>{if("gr-dropdown"===e)customElements.get(e)||customElements.define(e,Ur)}))}Yr();
/*!
* (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-color:var(--background-color);border-color:var(--border-color);color:var(--color)}.tag-clear{--color:var(--clear-color);--color-hover:var(--clear-color-hover);--padding-start:0;--padding-end:0;margin-left:var(--clear-margin-left);margin-right:var(--clear-margin-right);--height:1em}.tag-clear svg{font-size:0.7em}.tag-clear svg{width:1.1em;height:1.1em}:host(.tag-pill) .tag{border-radius:var(--height)}"}},[1,"gr-tag",{type:[513],size:[513],pill:[516],clearable:[516]}]);function Zr(){if("undefined"==typeof customElements)return;["gr-tag","gr-button","gr-spinner"].forEach((e=>{switch(e){case"gr-tag":customElements.get(e)||customElements.define(e,Xr);break;case"gr-button":customElements.get(e)||_t();break;case"gr-spinner":customElements.get(e)||kt()}}))}Zr();
/*!
* (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('", "')+'"')}resizeMenu(){this.menu.style.width=`${this.box.clientWidth}px`}syncItemsFromValue(){const e=this.getItems(),t=this.getValueAsArray();if(e.map((e=>e.checked=t.includes(e.value))),this.multiple){const r=[];if(t.map((t=>e.map((e=>e.value===t?r.push(e):null)))),this.displayTags=r.map((e=>se("gr-tag",{type:"info",size:this.size,pill:this.pill,clearable:!0,onClick:this.handleTagInteraction,onKeyDown:this.handleTagInteraction,"onGr-clear":t=>{t.stopPropagation(),this.disabled||(e.checked=!1,this.syncValueFromItems())}},this.getItemLabel(e)))),this.maxTagsVisible>0&&this.displayTags.length>this.maxTagsVisible){const e=this.displayTags.length;this.displayLabel="",this.displayTags=this.displayTags.slice(0,this.maxTagsVisible),this.displayTags.push(se("gr-tag",{type:"info",size:this.size,pill:this.pill},"+",e-this.maxTagsVisible))}}else{const r=e.filter((e=>e.value===t[0]))[0];this.displayLabel=r?this.getItemLabel(r):"",this.displayTags=[]}}syncValueFromItems(){const e=this.getItems().filter((e=>e.checked)).map((e=>e.value));this.multiple?this.value=this.value.filter((t=>e.includes(t))):this.value=e.length>0?e[0]:""}render(){var e;const t=this.multiple?this.value.length>0:""!==this.value,r=this.inheritedAttributes["aria-label"]?{"aria-label":this.inheritedAttributes["aria-label"]}:{"aria-labelledby":this.labelId};return((e,t,r,i)=>{let o=e.querySelector("input.aux-input");o||(o=e.ownerDocument.createElement("input"),o.type="hidden",o.classList.add("aux-input"),e.appendChild(o)),o.disabled=i,o.name=t,o.value=r||""})(this.el,this.name,ri(this.value),this.disabled),se(bt,{inputId:this.inputId,label:this.label,labelId:this.labelId,hasLabelSlot:this.hasLabelSlot,helpTextId:this.helpTextId,helpText:this.helpText,hasHelpTextSlot:this.hasHelpTextSlot,invalidTextId:this.invalidTextId,invalidText:this.invalidText,invalid:this.invalid,hasInvalidTextSlot:this.hasInvalidTextSlot,size:this.size,onLabelClick:this.handleLabelClick,requiredIndicator:this.requiredIndicator},se("gr-dropdown",{ref:e=>this.dropdown=e,hoist:this.hoist,closeOnSelect:!this.multiple,containingElement:this.el,class:{select:!0,"select-open":this.isOpen,"select-empty":0===(null===(e=this.value)||void 0===e?void 0:e.length),"select-focused":this.hasFocus,"select-clearable":this.clearable,"select-disabled":this.disabled,"select-multiple":this.multiple,"select-has-tags":this.multiple&&t,"select-placeholder-visible":""===this.displayLabel,[`select-${this.size}`]:!0,"select-pill":this.pill,"select-invalid":this.invalid},"onGr-show":this.handleMenuShow,"onGr-hide":this.handleMenuHide},se("div",Object.assign({slot:"trigger",ref:e=>this.box=e,id:this.inputId,class:"select-box",role:"combobox"},r,{"aria-describedby":this.invalid?this.invalidTextId:this.helpTextId,"aria-haspopup":"true","aria-expanded":this.isOpen?"true":"false","aria-invalid":this.invalid?"true":"false","aria-required":this.requiredIndicator?"true":"false",tabIndex:this.disabled?-1:0,onBlur:this.handleBlur,onFocus:this.handleFocus,onKeyDown:this.handleKeyDown}),se("div",{class:"select-label"},this.displayTags.length?se("span",{class:"select-tags"},this.displayTags):this.displayLabel||this.placeholder),this.clearable&&t&&se("button",{class:"select-clear",type:"button",onClick:this.handleClearClick,"aria-label":"clear",tabindex:"-1"},se("svg",{role:"img","aria-hidden":"true",viewBox:"0 0 512 512"},se("title",null,"Close Circle"),se("path",{d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192 192-86 192-192z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"}),se("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M320 320L192 192M192 320l128-128"}))),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"}))),se("input",{class:"select-hidden-select","aria-hidden":"true",value:t?"1":"",tabIndex:-1})),se("gr-menu",{ref:e=>this.menu=e,class:"select-menu","onGr-select":this.handleMenuSelect},se("slot",{onSlotchange:this.handleSlotChange}))))}get el(){return this}static get watchers(){return{disabled:["handleDisabledChange"],helpText:["handleLabelChange"],invalidText:["handleLabelChange"],label:["handleLabelChange"],multiple:["handleMultipleChange"],value:["handleValueChange"]}}static get style(){return".form-control .form-control-label{display:none}.form-control .form-control-help-text{display:none}.form-control .form-control-invalid-text{display:none}.form-control-has-label .form-control-label{display:flex;line-height:var(--gr-line-height-normal);color:var(--gr-form-element-label-color);margin-bottom:var(--gr-spacing-xxx-small)}.form-control-has-label.form-control-small .form-control-label{font-size:var(--gr-form-element-label-font-size-small)}.form-control-has-label.form-control-medium .form-control-label{font-size:var(--gr-form-element-label-font-size-medium)}.form-control-has-label.form-control-large .form-control-label{font-size:var(--gr-form-element-label-font-size-large)}.form-control-has-label .form-control-label .asterisk{margin-left:var(--gr-spacing-x-small);color:var(--gr-color-medium)}.form-control-has-label .form-control-label .asterisk svg{width:0.6em;height:0.6em;margin-bottom:var(--gr-spacing-xxx-small)}.form-control-has-help-text .form-control-help-text{display:block;line-height:var(--gr-line-height-normal);color:var(--gr-form-element-help-text-color);margin-top:var(--gr-spacing-xxx-small)}.form-control-has-help-text.form-control-small .form-control-help-text{font-size:var(--gr-form-element-help-text-font-size-small);min-height:1.625rem}.form-control-has-help-text.form-control-medium .form-control-help-text{font-size:var(--gr-form-element-help-text-font-size-medium);min-height:1.875rem}.form-control-has-help-text.form-control-large .form-control-help-text{font-size:var(--gr-form-element-help-text-font-size-large);min-height:2.125rem}.form-control-has-invalid-text .form-control-invalid-text{display:flex;margin-left:-2px;line-height:var(--gr-line-height-normal);color:var(--gr-form-element-invalid-text-color);margin-top:var(--gr-spacing-xxx-small)}.form-control-has-invalid-text .form-control-invalid-text .icon{margin-top:var(--gr-spacing-xxx-small);margin-right:var(--gr-spacing-xx-small)}.form-control-has-invalid-text .form-control-invalid-text .icon svg{width:1.4em;height:1.4em}.form-control-has-invalid-text.form-control-small .form-control-invalid-text{font-size:var(--gr-form-element-invalid-text-font-size-small);min-height:1.625rem}.form-control-has-invalid-text.form-control-medium .form-control-invalid-text{font-size:var(--gr-form-element-invalid-text-font-size-medium);min-height:1.875rem}.form-control-has-invalid-text.form-control-large .form-control-invalid-text{font-size:var(--gr-form-element-invalid-text-font-size-large);min-height:2.125rem}.gr-scroll-lock{overflow:hidden !important}:host{--font-size:var(--gr-form-element-font-size-medium);--font-weight:var(--gr-font-weight-normal);--background-color:var(--gr-color-white);--background-color-hover:var(--gr-color-white);--background-color-focus:var(--gr-color-white);--background-color-invalid:var(--gr-color-white);--background-color-invalid-hover:var(--gr-color-white);--border-radius:var(--gr-form-element-border-radius-small);--border-color:var(--gr-color-light-shade);--border-color-hover:var(--gr-color-medium);--border-color-focus:var(--gr-color-primary);--border-color-invalid:var(--gr-color-danger);--border-color-invalid-hover:var(--gr-color-danger-shade);--color:var(--gr-color-dark-tint);--placeholder-color:var(--gr-color-medium-tint);--min-height:var(--gr-form-element-height-medium);--label-margin-start:var(--gr-spacing-medium);--label-margin-end:var(--gr-spacing-medium);--clear-icon-margin-end:var(--gr-spacing-medium);--caret-margin-end:var(--gr-spacing-medium);--tags-padding-top:3px;--tags-padding-bottom:3px;--tags-margin-end:var(--gr-spacing-xx-small);--focus-ring:0 0 0 var(--gr-focus-ring-width) rgb(var(--gr-color-primary-rgb), 0.33);display:block;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}.select-small{--font-size:var(--gr-form-element-font-size-small);--min-height:var(--gr-form-element-height-small);--label-margin-start:var(--gr-spacing-small);--label-margin-end:var(--gr-spacing-small);--clear-icon-margin-end:var(--gr-spacing-small);--caret-margin-end:var(--gr-spacing-small);--tags-padding-top:2px;--tags-padding-bottom:2px}.select-large{--font-size:var(--gr-form-element-font-size-large);--min-height:var(--gr-form-element-height-large);--label-margin-start:var(--gr-spacing-large);--label-margin-end:var(--gr-spacing-large);--clear-icon-margin-end:var(--gr-spacing-large);--caret-margin-end:var(--gr-spacing-large);--tags-padding-top:4px;--tags-padding-bottom:4px}.select{display:block}.select-box{display:inline-flex;align-items:center;justify-content:start;position:relative;width:100%;font-family:var(--gr-font-family);font-size:var(--font-size);font-weight:var(--font-weight);letter-spacing:normal;background-color:var(--background-color);border:solid 1px var(--border-color);border-radius:var(--border-radius);min-height:var(--min-height);color:var(--color);vertical-align:middle;overflow:hidden;transition:150ms color, 150ms border, 150ms box-shadow;cursor:pointer}.select.select-invalid:not(.select-disabled) .select-box{background-color:var(--background-color-invalid);border-color:var(--border-color-invalid)}.select.select-invalid:not(.select-disabled):not(.select-focused) .select-box:hover{background-color:var(--background-color-invalid-hover);border-color:var(--border-color-invalid-hover)}.select.select-invalid:not(.select-disabled) .select-box{background-color:var(--background-color-invalid);border-color:var(--border-color-invalid)}.select:not(.select-disabled) .select-box:hover{background-color:var(--background-color-hover);border-color:var(--border-color-hover)}.select.select-focused:not(.select-disabled) .select-box{outline:none;box-shadow:var(--focus-ring);border-color:var(--border-color-focus);background-color:var(--background-color-focus)}.select-disabled .select-box{opacity:0.5;cursor:not-allowed;outline:none}.select-disabled .select-tags,.select-disabled .select-clear{pointer-events:none}.select-label{flex:1 1 auto;display:flex;align-items:center;user-select:none;margin-top:0;margin-left:var(--label-margin-start);margin-right:var(--label-margin-end);margin-bottom:0;scrollbar-width:none;-ms-overflow-style:none;overflow-x:auto;overflow-y:hidden;white-space:nowrap}.select-label::-webkit-scrollbar{width:0;height:0}.select-has-tags .select-label{margin-left:0}.select-clear{display:inline-flex;align-items:center;font-size:inherit;color:var(--gr-color-medium);border:none;background:none;padding:0;transition:150ms color;cursor:pointer;margin-right:var(--clear-icon-margin-end)}.select-clear:hover{color:var(--gr-color-dark)}.select-clear:focus{outline:none}.select-clear svg{width:1.2em;height:1.2em;font-size:var(--font-size)}.caret{flex:0 0 auto;display:inline-flex;transition:250ms transform ease;margin-right:var(--caret-margin-end)}.caret svg{width:1em;height:1em;font-size:var(--font-size)}.select-open .caret{transform:rotate(-180deg)}.select-placeholder-visible .select-label{color:var(--placeholder-color)}.select-tags{display:inline-flex;align-items:center;flex-wrap:wrap;justify-content:left;margin-left:var(--gr-spacing-xx-small);padding-bottom:var(--tags-padding-bottom)}.select-tags gr-tag{padding-top:var(--tags-padding-top)}.select-tags gr-tag:not(:last-of-type){margin-right:var(--tags-margin-end)}.select-hidden-select{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px;position:absolute;top:0;left:0;width:100%;height:100%}.select-pill .select-box{border-radius:var(--min-height)}"}},[1,"gr-select",{multiple:[4],maxTagsVisible:[2,"max-tags-visible"],disabled:[4],name:[1],placeholder:[1],size:[1],hoist:[4],value:[1025],pill:[4],label:[1],requiredIndicator:[4,"required-indicator"],helpText:[1,"help-text"],invalidText:[1,"invalid-text"],invalid:[516],clearable:[4],hasFocus:[32],hasHelpTextSlot:[32],hasInvalidTextSlot:[32],hasLabelSlot:[32],isOpen:[32],items:[32],displayLabel:[32],displayTags:[32],setFocus:[64]}]),ri=e=>{if(null!=e)return Array.isArray(e)?e.join(","):e.toString()};!function(){if("undefined"==typeof customElements)return;["gr-select","gr-button","gr-dropdown","gr-menu","gr-spinner","gr-tag"].forEach((e=>{switch(e){case"gr-select":customElements.get(e)||customElements.define(e,ti);break;case"gr-button":customElements.get(e)||_t();break;case"gr-dropdown":customElements.get(e)||Yr();break;case"gr-menu":customElements.get(e)||Qr();break;case"gr-spinner":customElements.get(e)||kt();break;case"gr-tag":customElements.get(e)||Zr()}}))}();const ii=ti,oi=Ue(class extends st{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.hasFocus=!1,this.checked=!1,this.value="",this.disabled=!1}connectedCallback(){this.handleBlur=this.handleBlur.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleMouseEnter=this.handleMouseEnter.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this)}async setFocus(e){this.el.focus(e)}async removeFocus(){this.el.blur()}handleBlur(){this.hasFocus=!1}handleFocus(){this.hasFocus=!0}handleMouseEnter(){this.setFocus()}handleMouseLeave(){this.removeFocus()}render(){return se(ce,{class:{"menu-item-checked":this.checked,"menu-item-disabled":this.disabled,"menu-item-focused":this.hasFocus},role:"menuitem","aria-disabled":this.disabled?"true":"false","aria-checked":this.checked?"true":"false",tabIndex:this.disabled?null:0,onFocus:this.handleFocus,onBlur:this.handleBlur,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},se("span",{class:"checkmark"},se("svg",{role:"img","aria-hidden":"true",viewBox:"0 0 512 512"},se("title",null,"Checkmark"),se("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M416 128L192 384l-96-96"}))),se("span",{class:"start"},se("slot",{name:"start"})),se("span",{class:"label"},se("slot",null)),se("span",{class:"end"},se("slot",{name:"end"})))}get el(){return this}static get style(){return".gr-scroll-lock{overflow:hidden !important}:host{--line-height:var(--gr-line-height-normal);--background-color:transparent;--background-color-focused:var(--gr-color-primary);--color:var(--gr-color-dark);--color-focused:var(--gr-color-primary-contrast);--color-disabled:var(--gr-color-medium);--padding-top:var(--gr-spacing-xx-small);--padding-start:var(--gr-spacing-x-large);--padding-end:var(--gr-spacing-x-large);--padding-bottom:var(--gr-spacing-xx-small);--transition:background-color 150ms linear, color 150ms linear;position:relative;display:flex;align-items:stretch;font-family:var(--gr-font-family);font-size:var(--gr-font-size-medium);font-weight:var(--gr-font-weight-normal);line-height:var(--line-height);letter-spacing:var(--gr-letter-spacing-normal);text-align:left;background-color:var(--background-color);color:var(--color);padding-top:var(--padding-top);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-bottom:var(--padding-bottom);transition:var(--transition);user-select:none;white-space:nowrap;cursor:pointer;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}:host(.menu-item-focused:not(.menu-item-disabled)){outline:none;background-color:var(--background-color-focused);color:var(--color-focused)}:host(.menu-item-disabled){outline:none;color:var(--color-disabled);cursor:not-allowed}.checkmark{display:flex;position:absolute;left:0.5em;top:calc(50% - 0.5em);visibility:hidden;align-items:center;font-size:inherit}.checkmark svg{display:inline-block;width:1.1em;height:1.1em;contain:strict;fill:currentcolor;box-sizing:content-box !important}:host(.menu-item-checked) .checkmark{visibility:visible}.label{flex:1 1 auto}.start{flex:0 0 auto;display:flex;align-items:center}.start ::slotted(:last-child){margin-right:0.5em}.end{flex:0 0 auto;display:flex;align-items:center}.end ::slotted(:first-child){margin-left:0.5em}"}},[1,"gr-menu-item",{checked:[516],value:[513],disabled:[516],hasFocus:[32],setFocus:[64],removeFocus:[64]}]);
/*!
* (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);\n --gr-form-element-font-size-small: var(--gr-font-size-small);\n --gr-form-element-font-size-medium: var(--gr-font-size-medium);\n --gr-form-element-font-size-large: var(--gr-font-size-large);\n --gr-form-element-height-small: 2.188rem;\n --gr-form-element-height-medium: 3.125rem;\n --gr-form-element-height-large: 4.063rem;\n --gr-form-element-border-radius-small: var(--gr-border-radius-medium);\n --gr-form-element-border-radius-medium: var(--gr-border-radius-medium);\n --gr-form-element-border-radius-large: var(--gr-border-radius-medium);\n --gr-focus-ring-width: 2px;\n --gr-form-element-label-font-size-small: var(--gr-font-size-small);\n --gr-form-element-label-font-size-medium: var(--gr-font-size-medium);\n --gr-form-element-label-font-size-large: var(--gr-font-size-large);\n --gr-form-element-label-color: inherit;\n --gr-form-element-help-text-font-size-small: var(--gr-font-size-x-small);\n --gr-form-element-help-text-font-size-medium: var(--gr-font-size-small);\n --gr-form-element-help-text-font-size-large: var(--gr-font-size-medium);\n --gr-form-element-help-text-color: var(--gr-color-medium);\n --gr-form-element-invalid-text-font-size-small: var(--gr-font-size-x-small);\n --gr-form-element-invalid-text-font-size-medium: var(--gr-font-size-small);\n --gr-form-element-invalid-text-font-size-large: var(--gr-font-size-medium);\n --gr-form-element-invalid-text-color: var(--gr-color-danger);\n --gr-toggle-size: 1rem;\n --gr-panel-border-color: var(--gr-color-light-shade);\n --gr-z-index-dropdown: 900;\n}\n\n')}}function si(){var e=new Date,t=e.getFullYear(),r=e.getMonth(),i=e.getDate(),o=new Date(0);return o.setFullYear(t,r,i-1),o.setHours(23,59,59,999),o}function li(){var e=new Date,t=e.getFullYear(),r=e.getMonth(),i=e.getDate(),o=new Date(0);return o.setFullYear(t,r,i-1),o.setHours(0,0,0,0),o}function ci(e){u(1,arguments);var t=m(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(23,59,59,999),t}var di,hi,gi;ai.elementDefinitions={...ni},t([r({attribute:!1,hasChanged:i})],ai.prototype,"options",void 0),t([r({attribute:!1,hasChanged:i})],ai.prototype,"value",void 0),t([r({attribute:!0})],ai.prototype,"label",void 0),t([r({attribute:!0})],ai.prototype,"placeholder",void 0),t([r({attribute:!0,type:Boolean})],ai.prototype,"multiple",void 0),t([r({attribute:!0,type:Boolean})],ai.prototype,"clearable",void 0),function(e){e.Favorite="favorite",e.NotFavorite="not-favorite"}(di||(di={})),function(e){e.Today="today",e.Yesterday="yesterday",e.PastWeek="past-week",e.PastMonth="past-month"}(hi||(hi={})),function(e){e.Clips="clips",e.Snapshots="snapshots",e.Recordings="recordings"}(gi||(gi={}));let ui=class extends(q(d)){constructor(){super(),this._defaults=null,this._refMediaType=o(),this._refCamera=o(),this._refWhen=o(),this._refWhat=o(),this._refWhere=o(),this._refFavorite=o(),this._refTags=o(),this._favoriteOptions=[{value:di.Favorite,label:f("media_filter.favorite")},{value:di.NotFavorite,label:f("media_filter.not_favorite")}],this._mediaTypeOptions=[{value:gi.Clips,label:f("media_filter.media_types.clips")},{value:gi.Snapshots,label:f("media_filter.media_types.snapshots")},{value:gi.Recordings,label:f("media_filter.media_types.recordings")}]}_stringToDateRange(e){const t=e.split(",");return{start:B(t[0],"yyyy-MM-dd",new Date),end:B(t[1],"yyyy-MM-dd",new Date)}}_dateRangeToString(e){return`${v(e.start)},${v(e.end)}`}_getWhen(){const e=this._refWhen.value?.value;if(!e||Array.isArray(e))return null;const t=new Date;switch(e){case hi.Today:return{start:g(Date.now()),end:h(Date.now())};case hi.Yesterday:return{start:li(),end:si()};case hi.PastWeek:return{start:g(W(t,{days:7})),end:h(t)};case hi.PastMonth:return{start:g(W(t,{months:1})),end:h(t)};default:return this._stringToDateRange(e)}}async _valueChangedHandler(e){const t=this.cameraManager?.getStore().getVisibleCameras();if(!(this.hass&&t&&this.cameraManager&&this.view))return;const r=e=>e&&Array.isArray(e)&&e.length&&!e.includes("")?new Set([...e]):null,i=r(this._refCamera.value?.value)??new Set(t.keys()),o=this._refMediaType.value?.value,n=this._getWhen(),a=this._refFavorite.value?.value?this._refFavorite.value.value===di.Favorite:null,s=this.cardWideConfig?.performance?.features.media_chunk_size;if(o===gi.Clips||o===gi.Snapshots){const e=r(this._refWhere.value?.value),t=r(this._refWhat.value?.value),l=r(this._refTags.value?.value),c=new b([{type:y.Event,cameraIDs:i,...l&&{tags:l},...t&&{what:t},...e&&{where:e},...null!==a&&{favorite:a},...n&&{start:n.start,end:n.end},...s&&{limit:s},...o===gi.Clips&&{hasClip:!0},...o===gi.Snapshots&&{hasSnapshot:!0}}]);(await w(this,this.hass,this.cameraManager,this.view,c,{...1===i.size&&{targetCameraID:[...i][0]},targetView:o===gi.Clips?"clips":"snapshots"}))?.dispatchChangeEvent(this)}else if(o===gi.Recordings){const e=new $([{type:y.Recording,cameraIDs:i,...s&&{limit:s},...n&&{start:n.start,end:n.end}}]);(await w(this,this.hass,this.cameraManager,this.view,e,{...1===i.size&&{targetCameraID:[...i][0]},targetView:"recordings"}))?.dispatchChangeEvent(this)}}willUpdate(e){if(e.has("cameraManager")){const e=this.cameraManager?.getStore().getVisibleCameras();e&&(this._cameraOptions=Array.from(e.keys()).map((e=>({value:e,label:this.hass?this.cameraManager?.getCameraMetadata(this.hass,e)?.title??"":""}))))}if(e.has("cameraManager")&&this.hass&&this.cameraManager&&(this._mediaMetadataController=new mi(this,this.hass,this.cameraManager)),this._whenOptions=[{value:hi.Today,label:f("media_filter.whens.today")},{value:hi.Yesterday,label:f("media_filter.whens.yesterday")},{value:hi.PastWeek,label:f("media_filter.whens.past_week")},{value:hi.PastMonth,label:f("media_filter.whens.past_month")},...this._mediaMetadataController?.whenOptions??[]],e.has("view")){const e=this._getDefaultsFromView();n(e,this._defaults)||(this._defaults=e)}}_getDefaultsFromView(){const e=this.view?.query?.getQueries(),t=this.cameraManager?.getStore().getVisibleCameras();if(!this.view||!e||!t)return null;let r,i,o,a,s,l;1!==j(e.map((e=>e.cameraIDs)),n).length||n(e[0].cameraIDs,t)||(i=[...e[0].cameraIDs]);if(1===j(e.map((e=>e.favorite)),n).length&&void 0!==e[0].favorite&&(s=e[0].favorite?di.Favorite:di.NotFavorite),x.areEventQueries(this.view.query)){const e=this.view.query.getQueries();if(!e)return null;const t=j(e.map((e=>e.hasClip)),n),i=j(e.map((e=>e.hasSnapshot)),n);1===t.length&&1===i.length&&(r=t[0]?gi.Clips:i[0]?gi.Snapshots:void 0);1===j(e.map((e=>e.what)),n).length&&e[0].what?.size&&(o=[...e[0].what]);1===j(e.map((e=>e.where)),n).length&&e[0].where?.size&&(a=[...e[0].where]);1===j(e.map((e=>e.tags)),n).length&&e[0].tags?.size&&(l=[...e[0].tags])}else x.areRecordingQueries(this.view.query)&&(r=gi.Recordings);return{...r&&{mediaType:r},...i&&{cameraIDs:i},...o&&{what:o},...a&&{where:a},...void 0!==s&&{favorite:s},...l&&{tags:l}}}render(){if(!this._mediaMetadataController)return;const e=!(!this.view?.query||!x.areEventQueries(this.view.query)),t=!(!this.view?.query||!x.areRecordingQueries(this.view.query)),r=this.cameraManager?.getAggregateCameraCapabilities(),i=e?!!r?.canFavoriteEvents:!!t&&!!r?.canFavoriteRecordings;return s` <frigate-card-select
${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?.getResultsCount()??0))return R({type:"info",message:f("common.no_media"),icon:"mdi:multimedia"});const e=this.view?.queryResults?.getSelectedResult();return s` <div class="grid">
${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};