diff --git a/config/.HA_VERSION b/config/.HA_VERSION index b6503254..ff5300cf 100755 --- a/config/.HA_VERSION +++ b/config/.HA_VERSION @@ -1 +1 @@ -2024.3.0 \ No newline at end of file +2024.4.3 \ No newline at end of file diff --git a/config/automation/away.yaml b/config/automation/away.yaml index 22033e56..6407a41b 100755 --- a/config/automation/away.yaml +++ b/config/automation/away.yaml @@ -39,9 +39,4 @@ - service: switch.turn_off entity_id: switch.back_landscaping - # Arm the "alarm_control_panel.alexa_guard" alarm unless the "input_boolean.guest_mode" entity is "on" - - condition: template - value_template: > - {{ states.input_boolean.guest_mode.state != "on" }} - - service: alarm_control_panel.alarm_arm_away - entity_id: alarm_control_panel.alexa_guard + diff --git a/config/configuration.yaml b/config/configuration.yaml index c5e3bc0b..fbc26b70 100755 --- a/config/configuration.yaml +++ b/config/configuration.yaml @@ -94,12 +94,6 @@ logbook: logger: !include logger.yaml recorder: !include recorder.yaml -panel_iframe: - dashy: - title: 'Dashy' - icon: 'mdi:dashboard' - url: 'http://192.168.10.10:4000/' - # zwave: # usb_path: /dev/ttyACM0 # config_path: /srv/hass/hass_venv/lib/python3.4/site-packages/libopenzwave-0.3.1-py3.4-linux-armv7l.egg/config diff --git a/config/group/media_players.yaml b/config/group/media_players.yaml index b929cda8..dd47dc57 100755 --- a/config/group/media_players.yaml +++ b/config/group/media_players.yaml @@ -7,10 +7,10 @@ media_players: # - media_player.bedroom_alarm_panel - media_player.living_room - media_player.front_room_flex + - media_player.garage - media_player.office - media_player.kitchen - media_player.justin_room - - media_player.tap - media_player.upstairs - media_player.stacey_bedroom - media_player.carlo_bedroom diff --git a/config/packages/cbyge.yaml b/config/packages/cbyge.yaml index 033f07cc..133b3056 100755 --- a/config/packages/cbyge.yaml +++ b/config/packages/cbyge.yaml @@ -17,7 +17,7 @@ script: sequence: - service: media_player.play_media data: - entity_id: media_player.tap + entity_id: media_player.garage media_content_id: 'turn off paige bed' media_content_type: custom @@ -36,7 +36,7 @@ script: - service: media_player.play_media data: - entity_id: media_player.tap + entity_id: media_player.garage media_content_id: 'turn off c life 3' media_content_type: custom @@ -44,7 +44,7 @@ script: - service: media_player.play_media data: - entity_id: media_player.tap + entity_id: media_player.garage media_content_id: 'turn off c life 4' media_content_type: custom @@ -52,7 +52,7 @@ script: - service: media_player.play_media data: - entity_id: media_player.tap + entity_id: media_player.garage media_content_id: 'turn off c sleep 1' media_content_type: custom @@ -60,6 +60,6 @@ script: - service: media_player.play_media data: - entity_id: media_player.tap + entity_id: media_player.garage media_content_id: 'turn off c sleep 2' media_content_type: custom diff --git a/config/packages/garadget.yaml b/config/packages/garadget.yaml index 0c30dbe5..57320687 100755 --- a/config/packages/garadget.yaml +++ b/config/packages/garadget.yaml @@ -83,16 +83,16 @@ automation: from: 'not_home' to: 'home' condition: - - condition: state - entity_id: cover.large_garage_door - state: 'closed' + - condition: state + entity_id: cover.large_garage_door + state: 'closed' action: - variables: person_triggered: "{{ trigger.to_state.entity_id.split('.')[1] }}" - service: script.notify_engine_two_button data: title: 'Welcome Home!' - value1: 'Open Garage Door?' + value1: 'Open Large Garage door?' title1: 'Yes' action1: 'OPEN_LARGE_GARAGE' icon1: 'sfsymbols:arrow.up.circle' @@ -111,7 +111,7 @@ automation: event_type: mobile_app_notification_action event_data: action: OPEN_LARGE_GARAGE - condition: + conditions: - condition: state entity_id: cover.large_garage_door state: 'closed' @@ -122,6 +122,43 @@ automation: - service: cover.open_cover entity_id: cover.large_garage_door + - alias: 'Prompt to Open Front Door' + id: ece2b4a8-af21-41f4-a8fc-480a4d1ddabc + trigger: + platform: event + event_type: mobile_app_notification_action + event_data: + action: 'NO_OPEN_LARGE_GARAGE' + conditions: + - condition: state + entity_id: group.family + state: 'home' + action: + - service: script.notify_engine_two_button + data: + title: 'Unlock Front Door?' + value1: 'Do you want to unlock the front door instead?' + title1: 'Yes' + action1: 'UNLOCK_FRONT_DOOR' + icon1: 'sfsymbols:unlock' + destructive1: 'false' + title2: 'No' + action2: 'KEEP_FRONT_DOOR_LOCKED' + icon2: 'sfsymbols:lock' + destructive2: 'true' + who: "{{ person_triggered }}" + group: 'Welcome_Home' + + - alias: 'Unlock Front Door Action' + id: c3106db1-f2c4-4800-b1a3-76d440228600 + trigger: + platform: event + event_type: mobile_app_notification_action + event_data: + action: 'UNLOCK_FRONT_DOOR' + action: + - service: lock.unlock + entity_id: lock.front_door ###################################################################### diff --git a/config/recorder.yaml b/config/recorder.yaml index f1f0db7e..6dee079b 100755 --- a/config/recorder.yaml +++ b/config/recorder.yaml @@ -9,9 +9,12 @@ include: exclude: domains: - device_tracker + - camera entity_globs: - sensor.*uptime* - sensor.vpn_client_* + - binary_sensor.*_motion + - binary_sensor.*is_present entities: - automation.update_garage_get_status - binary_sensor.camera1_motion_sensor @@ -20,7 +23,6 @@ exclude: - binary_sensor.powerwall_charging - media_player.carlo_s_4th_fire - media_player.alarm_panel_2 - - media_player.tap - script.speech_processing - script.amp_settings - sensor.carlo_ap diff --git a/config/www/community/frigate-hass-card/_commonjsHelpers-1789f0cf.js b/config/www/community/frigate-hass-card/_commonjsHelpers-1789f0cf.js new file mode 100644 index 00000000..d6f8d42a --- /dev/null +++ b/config/www/community/frigate-hass-card/_commonjsHelpers-1789f0cf.js @@ -0,0 +1 @@ +var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}export{e as c,o as g}; diff --git a/config/www/community/frigate-hass-card/_commonjsHelpers-1789f0cf.js.gz b/config/www/community/frigate-hass-card/_commonjsHelpers-1789f0cf.js.gz new file mode 100644 index 00000000..500c55b0 Binary files /dev/null and b/config/www/community/frigate-hass-card/_commonjsHelpers-1789f0cf.js.gz differ diff --git a/config/www/community/frigate-hass-card/audio-557099cb.js b/config/www/community/frigate-hass-card/audio-557099cb.js new file mode 100644 index 00000000..268044d1 --- /dev/null +++ b/config/www/community/frigate-hass-card/audio-557099cb.js @@ -0,0 +1 @@ +const o=o=>void 0!==o.mozHasAudio?o.mozHasAudio:void 0===o.audioTracks||Boolean(o.audioTracks?.length);export{o as m}; diff --git a/config/www/community/frigate-hass-card/audio-557099cb.js.gz b/config/www/community/frigate-hass-card/audio-557099cb.js.gz new file mode 100644 index 00000000..ddb79dad Binary files /dev/null and b/config/www/community/frigate-hass-card/audio-557099cb.js.gz differ diff --git a/config/www/community/frigate-hass-card/card-555679fd.js b/config/www/community/frigate-hass-card/card-555679fd.js new file mode 100644 index 00000000..6f71740c --- /dev/null +++ b/config/www/community/frigate-hass-card/card-555679fd.js @@ -0,0 +1,565 @@ +function e(e,t,n,i){var a,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(r<3?a(o):r>3?a(t,n,o):a(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o}var t=window&&window.__assign||function(){return t=Object.assign||function(e){for(var t,n=1,i=arguments.length;nnew y("string"==typeof e?e:e+"",void 0,v),w=(e,...t)=>{const n=1===e.length?e[0]:t.reduce(((t,n,i)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[i+1]),e[0]);return new y(n,e,v)},x=(e,t)=>{g?e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet)):t.forEach((t=>{const n=document.createElement("style"),i=f.litNonce;void 0!==i&&n.setAttribute("nonce",i),n.textContent=t.cssText,e.appendChild(n)}))},C=g?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return b(t)})(e):e +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */;var $;const k=window,E=k.trustedTypes,M=E?E.emptyScript:"",S=k.reactiveElementPolyfillSupport,T={toAttribute(e,t){switch(t){case Boolean:e=e?M:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},A=(e,t)=>t!==e&&(t==t||e==e),z={attribute:!0,type:String,converter:T,reflect:!1,hasChanged:A};class j extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(e){var t;this.finalize(),(null!==(t=this.h)&&void 0!==t?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach(((t,n)=>{const i=this._$Ep(n,t);void 0!==i&&(this._$Ev.set(i,n),e.push(i))})),e}static createProperty(e,t=z){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const n="symbol"==typeof e?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,t);void 0!==i&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(i){const a=this[e];this[t]=i,this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||z}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),void 0!==e.h&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const e=this.properties,t=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const n of t)this.createProperty(n,e[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(C(e))}else void 0!==e&&t.push(C(e));return t}static _$Ep(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}u(){var e;this._$E_=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(e=this.constructor.h)||void 0===e||e.forEach((e=>e(this)))}addController(e){var t,n;(null!==(t=this._$ES)&&void 0!==t?t:this._$ES=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&(null===(n=e.hostConnected)||void 0===n||n.call(e))}removeController(e){var t;null===(t=this._$ES)||void 0===t||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])}))}createRenderRoot(){var e;const t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return x(t,this.constructor.elementStyles),t}connectedCallback(){var e;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)}))}enableUpdating(e){}disconnectedCallback(){var e;null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)}))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EO(e,t,n=z){var i;const a=this.constructor._$Ep(e,n);if(void 0!==a&&!0===n.reflect){const r=(void 0!==(null===(i=n.converter)||void 0===i?void 0:i.toAttribute)?n.converter:T).toAttribute(t,n.type);this._$El=e,null==r?this.removeAttribute(a):this.setAttribute(a,r),this._$El=null}}_$AK(e,t){var n;const i=this.constructor,a=i._$Ev.get(e);if(void 0!==a&&this._$El!==a){const e=i.getPropertyOptions(a),r="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==(null===(n=e.converter)||void 0===n?void 0:n.fromAttribute)?e.converter:T;this._$El=a,this[a]=r.fromAttribute(t,e.type),this._$El=null}}requestUpdate(e,t,n){let i=!0;void 0!==e&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||A)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),!0===n.reflect&&this._$El!==e&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(e,n))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((e,t)=>this[t]=e)),this._$Ei=void 0);let t=!1;const n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)})),this.update(n)):this._$Ek()}catch(e){throw t=!1,this._$Ek(),e}t&&this._$AE(n)}willUpdate(e){}_$AE(e){var t;null===(t=this._$ES)||void 0===t||t.forEach((e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){void 0!==this._$EC&&(this._$EC.forEach(((e,t)=>this._$EO(t,this[t],e))),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}} +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +var O;j.finalized=!0,j.elementProperties=new Map,j.elementStyles=[],j.shadowRootOptions={mode:"open"},null==S||S({ReactiveElement:j}),(null!==($=k.reactiveElementVersions)&&void 0!==$?$:k.reactiveElementVersions=[]).push("1.6.1");const I=window,R=I.trustedTypes,D=R?R.createPolicy("lit-html",{createHTML:e=>e}):void 0,P=`lit$${(Math.random()+"").slice(9)}$`,L="?"+P,N=`<${L}>`,U=document,F=(e="")=>U.createComment(e),H=e=>null===e||"object"!=typeof e&&"function"!=typeof e,Z=Array.isArray,q=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,W=/>/g,B=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),Y=/'/g,Q=/"/g,G=/^(?:script|style|textarea|title)$/i,K=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),X=Symbol.for("lit-noChange"),J=Symbol.for("lit-nothing"),ee=new WeakMap,te=U.createTreeWalker(U,129,null,!1),ne=(e,t)=>{const n=e.length-1,i=[];let a,r=2===t?"":"",o=q;for(let t=0;t"===c[0]?(o=null!=a?a:q,l=-1):void 0===c[1]?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=void 0===c[3]?B:'"'===c[3]?Q:Y):o===Q||o===Y?o=B:o===V||o===W?o=q:(o=B,a=void 0);const u=o===B&&e[t+1].startsWith("/>")?" ":"";r+=o===q?n+N:l>=0?(i.push(s),n.slice(0,l)+"$lit$"+n.slice(l)+P+u):n+P+(-2===l?(i.push(void 0),t):u)}const s=r+(e[n]||"")+(2===t?"":"");if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==D?D.createHTML(s):s,i]};class ie{constructor({strings:e,_$litType$:t},n){let i;this.parts=[];let a=0,r=0;const o=e.length-1,s=this.parts,[c,l]=ne(e,t);if(this.el=ie.createElement(c,n),te.currentNode=this.el.content,2===t){const e=this.el.content,t=e.firstChild;t.remove(),e.append(...t.childNodes)}for(;null!==(i=te.nextNode())&&s.length0){i.textContent=R?R.emptyScript:"";for(let n=0;nZ(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]))(e)?this.k(e):this.g(e)}O(e,t=this._$AB){return this._$AA.parentNode.insertBefore(e,t)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}g(e){this._$AH!==J&&H(this._$AH)?this._$AA.nextSibling.data=e:this.T(U.createTextNode(e)),this._$AH=e}$(e){var t;const{values:n,_$litType$:i}=e,a="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=ie.createElement(i.h,this.options)),i);if((null===(t=this._$AH)||void 0===t?void 0:t._$AD)===a)this._$AH.p(n);else{const e=new re(a,this),t=e.v(this.options);e.p(n),this.T(t),this._$AH=e}}_$AC(e){let t=ee.get(e.strings);return void 0===t&&ee.set(e.strings,t=new ie(e)),t}k(e){Z(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,i=0;for(const a of e)i===t.length?t.push(n=new oe(this.O(F()),this.O(F()),this,this.options)):n=t[i],n._$AI(a),i++;i2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=J}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,n,i){const a=this.strings;let r=!1;if(void 0===a)e=ae(this,e,t,0),r=!H(e)||e!==this._$AH&&e!==X,r&&(this._$AH=e);else{const i=e;let o,s;for(e=a[0],o=0;o{var i,a;const r=null!==(i=null==n?void 0:n.renderBefore)&&void 0!==i?i:t;let o=r._$litPart$;if(void 0===o){const e=null!==(a=null==n?void 0:n.renderBefore)&&void 0!==a?a:null;r._$litPart$=o=new oe(t.insertBefore(F(),e),e,void 0,null!=n?n:{})}return o._$AI(e),o})(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}render(){return X}}ge.finalized=!0,ge._$litElement$=!0,null===(pe=globalThis.litElementHydrateSupport)||void 0===pe||pe.call(globalThis,{LitElement:ge});const ve=globalThis.litElementPolyfillSupport;null==ve||ve({LitElement:ge}),(null!==(fe=globalThis.litElementVersions)&&void 0!==fe?fe:globalThis.litElementVersions=[]).push("3.2.2"); +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const _e=e=>t=>"function"==typeof t?((e,t)=>(customElements.define(e,t),t))(e,t):((e,t)=>{const{kind:n,elements:i}=t;return{kind:n,elements:i,finisher(t){customElements.define(e,t)}}})(e,t) +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */,ye=(e,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(n){n.createProperty(t.key,e)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher(n){n.createProperty(t.key,e)}};function be(e){return(t,n)=>void 0!==n?((e,t,n)=>{t.constructor.createProperty(n,e)})(e,t,n):ye(e,t) +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */}function we(e){return be({...e,state:!0})} +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var xe;null===(xe=window.HTMLSlotElement)||void 0===xe||xe.prototype.assignedElements; +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const Ce={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},$e=e=>(...t)=>({_$litDirective$:e,values:t});class ke{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}} +/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Ee=$e(class extends ke{constructor(e){var t;if(super(e),e.type!==Ce.ATTRIBUTE||"class"!==e.name||(null===(t=e.strings)||void 0===t?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter((t=>e[t])).join(" ")+" "}update(e,[t]){var n,i;if(void 0===this.nt){this.nt=new Set,void 0!==e.strings&&(this.st=new Set(e.strings.join(" ").split(/\s/).filter((e=>""!==e))));for(const e in t)t[e]&&!(null===(n=this.st)||void 0===n?void 0:n.has(e))&&this.nt.add(e);return this.render(t)}const a=e.element.classList;this.nt.forEach((e=>{e in t||(a.remove(e),this.nt.delete(e))}));for(const e in t){const n=!!t[e];n===this.nt.has(e)||(null===(i=this.st)||void 0===i?void 0:i.has(e))||(n?(a.add(e),this.nt.add(e)):(a.remove(e),this.nt.delete(e)))}return X}}),Me=e=>null===e||"object"!=typeof e&&"function"!=typeof e,Se=e=>void 0===e.strings,Te={},Ae=(e,t=Te)=>e._$AH=t +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */,ze=(e,t)=>{var n,i;const a=e._$AN;if(void 0===a)return!1;for(const e of a)null===(i=(n=e)._$AO)||void 0===i||i.call(n,t,!1),ze(e,t);return!0},je=e=>{let t,n;do{if(void 0===(t=e._$AM))break;n=t._$AN,n.delete(e),e=t}while(0===(null==n?void 0:n.size))},Oe=e=>{for(let t;t=e._$AM;e=t){let n=t._$AN;if(void 0===n)t._$AN=n=new Set;else if(n.has(e))break;n.add(e),De(t)}}; +/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */function Ie(e){void 0!==this._$AN?(je(this),this._$AM=e,Oe(this)):this._$AM=e}function Re(e,t=!1,n=0){const i=this._$AH,a=this._$AN;if(void 0!==a&&0!==a.size)if(t)if(Array.isArray(i))for(let e=n;e{var t,n,i,a;e.type==Ce.CHILD&&(null!==(t=(i=e)._$AP)&&void 0!==t||(i._$AP=Re),null!==(n=(a=e)._$AQ)&&void 0!==n||(a._$AQ=Ie))};class Pe extends ke{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),Oe(this),this.isConnected=e._$AU}_$AO(e,t=!0){var n,i;e!==this.isConnected&&(this.isConnected=e,e?null===(n=this.reconnected)||void 0===n||n.call(this):null===(i=this.disconnected)||void 0===i||i.call(this)),t&&(ze(this,e),je(this))}setValue(e){if(Se(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}} +/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Le=()=>new Ne;class Ne{}const Ue=new WeakMap,Fe=$e(class extends Pe{render(e){return J}update(e,[t]){var n;const i=t!==this.Y;return i&&void 0!==this.Y&&this.rt(void 0),(i||this.lt!==this.ct)&&(this.Y=t,this.dt=null===(n=e.options)||void 0===n?void 0:n.host,this.rt(this.ct=e.element)),J}rt(e){var t;if("function"==typeof this.Y){const n=null!==(t=this.dt)&&void 0!==t?t:globalThis;let i=Ue.get(n);void 0===i&&(i=new WeakMap,Ue.set(n,i)),void 0!==i.get(this.Y)&&this.Y.call(this.dt,void 0),i.set(this.Y,e),void 0!==e&&this.Y.call(this.dt,e)}else this.Y.value=e}get lt(){var e,t,n;return"function"==typeof this.Y?null===(t=Ue.get(null!==(e=this.dt)&&void 0!==e?e:globalThis))||void 0===t?void 0:t.get(this.Y):null===(n=this.Y)||void 0===n?void 0:n.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),He=$e(class extends ke{constructor(e){var t;if(super(e),e.type!==Ce.ATTRIBUTE||"style"!==e.name||(null===(t=e.strings)||void 0===t?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce(((t,n)=>{const i=e[n];return null==i?t:t+`${n=n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(e,[t]){const{style:n}=e.element;if(void 0===this.vt){this.vt=new Set;for(const e in t)this.vt.add(e);return this.render(t)}this.vt.forEach((e=>{null==t[e]&&(this.vt.delete(e),e.includes("-")?n.removeProperty(e):n[e]="")}));for(const e in t){const i=t[e];null!=i&&(this.vt.add(e),e.includes("-")?n.setProperty(e,i):n[e]=i)}return X}}); +/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */function Ze(e,t){return e===t||e!=e&&t!=t}function qe(e,t){for(var n=e.length;n--;)if(Ze(e[n][0],t))return n;return-1}var Ve=Array.prototype.splice;function We(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1},We.prototype.set=function(e,t){var n=this.__data__,i=qe(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};var Be="object"==typeof global&&global&&global.Object===Object&&global,Ye="object"==typeof self&&self&&self.Object===Object&&self,Qe=Be||Ye||Function("return this")(),Ge=Qe.Symbol,Ke=Object.prototype,Xe=Ke.hasOwnProperty,Je=Ke.toString,et=Ge?Ge.toStringTag:void 0;var tt=Object.prototype.toString;var nt="[object Null]",it="[object Undefined]",at=Ge?Ge.toStringTag:void 0;function rt(e){return null==e?void 0===e?it:nt:at&&at in Object(e)?function(e){var t=Xe.call(e,et),n=e[et];try{e[et]=void 0;var i=!0}catch(e){}var a=Je.call(e);return i&&(t?e[et]=n:delete e[et]),a}(e):function(e){return tt.call(e)}(e)}function ot(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var st="[object AsyncFunction]",ct="[object Function]",lt="[object GeneratorFunction]",dt="[object Proxy]";function ut(e){if(!ot(e))return!1;var t=rt(e);return t==ct||t==lt||t==st||t==dt}var ht,mt=Qe["__core-js_shared__"],pt=(ht=/[^.]+$/.exec(mt&&mt.keys&&mt.keys.IE_PROTO||""))?"Symbol(src)_1."+ht:"";var ft=Function.prototype.toString;function gt(e){if(null!=e){try{return ft.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var vt=/^\[object .+?Constructor\]$/,_t=Function.prototype,yt=Object.prototype,bt=_t.toString,wt=yt.hasOwnProperty,xt=RegExp("^"+bt.call(wt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ct(e){return!(!ot(e)||(t=e,pt&&pt in t))&&(ut(e)?xt:vt).test(gt(e));var t}function $t(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Ct(n)?n:void 0}var kt=$t(Qe,"Map"),Et=$t(Object,"create");var Mt="__lodash_hash_undefined__",St=Object.prototype.hasOwnProperty;var Tt=Object.prototype.hasOwnProperty;var At="__lodash_hash_undefined__";function zt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=nn}var rn={};function on(e){return function(t){return e(t)}}rn["[object Float32Array]"]=rn["[object Float64Array]"]=rn["[object Int8Array]"]=rn["[object Int16Array]"]=rn["[object Int32Array]"]=rn["[object Uint8Array]"]=rn["[object Uint8ClampedArray]"]=rn["[object Uint16Array]"]=rn["[object Uint32Array]"]=!0,rn["[object Arguments]"]=rn["[object Array]"]=rn["[object ArrayBuffer]"]=rn["[object Boolean]"]=rn["[object DataView]"]=rn["[object Date]"]=rn["[object Error]"]=rn["[object Function]"]=rn["[object Map]"]=rn["[object Number]"]=rn["[object Object]"]=rn["[object RegExp]"]=rn["[object Set]"]=rn["[object String]"]=rn["[object WeakMap]"]=!1;var sn="object"==typeof exports&&exports&&!exports.nodeType&&exports,cn=sn&&"object"==typeof module&&module&&!module.nodeType&&module,ln=cn&&cn.exports===sn&&Be.process,dn=function(){try{var e=cn&&cn.require&&cn.require("util").types;return e||ln&&ln.binding&&ln.binding("util")}catch(e){}}(),un=dn&&dn.isTypedArray,hn=un?on(un):function(e){return Ft(e)&&an(e.length)&&!!rn[rt(e)]},mn=Object.prototype.hasOwnProperty;function pn(e,t){var n=Yt(e),i=!n&&Bt(e),a=!n&&!i&&Xt(e),r=!n&&!i&&!a&&hn(e),o=n||i||a||r,s=o?function(e,t){for(var n=-1,i=Array(e);++ns))return!1;var l=r.get(e),d=r.get(t);if(l&&d)return l==t&&d==e;var u=-1,h=!0,m=n&na?new Xi:void 0;for(r.set(e,t),r.set(t,e);++u0){if(++Ga>=Wa)return arguments[0]}else Ga=0;return Qa.apply(void 0,arguments)});function Ja(e,t){return Xa(function(e,t,n){return t=qa(void 0===t?e.length-1:t,0),function(){for(var i=arguments,a=-1,r=qa(i.length-t,0),o=Array(r);++a1?t[i-1]:void 0,r=i>2?t[2]:void 0;for(a=er.length>3&&"function"==typeof a?(i--,a):void 0,r&&function(e,t,n){if(!ot(n))return!1;var i=typeof t;return!!("number"==i?bn(n)&&tn(t,n.length):"string"==i&&t in n)&&Ze(n[t],e)}(t[0],t[1],r)&&(a=i<3?void 0:a,i=1),e=Object(e);++n=t||n<0||u&&e-l>=r}function f(){var e=nr();if(p(e))return g(e);s=setTimeout(f,function(e){var n=t-(e-c);return u?gr(n,r-(e-l)):n}(e))}function g(e){return s=void 0,h&&i?m(e):(i=a=void 0,o)}function v(){var e=nr(),n=p(e);if(i=arguments,a=this,c=e,n){if(void 0===s)return function(e){return l=e,s=setTimeout(f,t),d?m(e):o}(c);if(u)return clearTimeout(s),s=setTimeout(f,t),m(c)}return void 0===s&&(s=setTimeout(f,t)),o}return t=mr(t)||0,ot(n)&&(d=!!n.leading,r=(u="maxWait"in n)?fr(mr(n.maxWait)||0,t):r,h="trailing"in n?!!n.trailing:h),v.cancel=function(){void 0!==s&&clearTimeout(s),l=0,i=c=a=s=void 0},v.flush=function(){return void 0===s?o:g(nr())},v}var _r="Expected a function";function yr(e,t,n){var i=!0,a=!0;if("function"!=typeof e)throw new TypeError(_r);return ot(n)&&(i="leading"in n?!!n.leading:i,a="trailing"in n?!!n.trailing:a),vr(e,t,{leading:i,maxWait:t,trailing:a})}const br=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],wr=(()=>{if("undefined"==typeof document)return!1;const e=br[0],t={};for(const n of br){const i=n?.[1];if(i in document){for(const[i,a]of n.entries())t[e[i]]=a;return t}}return!1})(),xr={change:wr.fullscreenchange,error:wr.fullscreenerror};let Cr={request:(e=document.documentElement,t)=>new Promise(((n,i)=>{const a=()=>{Cr.off("change",a),n()};Cr.on("change",a);const r=e[wr.requestFullscreen](t);r instanceof Promise&&r.then(a).catch(i)})),exit:()=>new Promise(((e,t)=>{if(!Cr.isFullscreen)return void e();const n=()=>{Cr.off("change",n),e()};Cr.on("change",n);const i=document[wr.exitFullscreen]();i instanceof Promise&&i.then(n).catch(t)})),toggle:(e,t)=>Cr.isFullscreen?Cr.exit():Cr.request(e,t),onchange(e){Cr.on("change",e)},onerror(e){Cr.on("error",e)},on(e,t){const n=xr[e];n&&document.addEventListener(n,t,!1)},off(e,t){const n=xr[e];n&&document.removeEventListener(n,t,!1)},raw:wr};Object.defineProperties(Cr,{isFullscreen:{get:()=>Boolean(document[wr.fullscreenElement])},element:{enumerable:!0,get:()=>document[wr.fullscreenElement]??void 0},isEnabled:{enumerable:!0,get:()=>Boolean(document[wr.fullscreenEnabled])}}),wr||(Cr={isEnabled:!1});var $r=Cr;function kr(e,t,n,i=20,a=0){let r=[];if(a>=i)return r;const o=e=>{const r=e.assignedNodes().filter((e=>1===e.nodeType));return r.length>0?kr(r[0].parentElement,t,n,i,a+1):[]},s=Array.from(e.children||[]);for(const e of s)t(e)||(n(e)&&r.push(e),null!=e.shadowRoot?r.push(...kr(e.shadowRoot,t,n,i,a+1)):"SLOT"===e.tagName?r.push(...o(e)):r.push(...kr(e,t,n,i,a+1)));return r}function Er(e){return e.hasAttribute("hidden")||e.hasAttribute("aria-hidden")&&"false"!==e.getAttribute("aria-hidden")||"none"===e.style.display||"0"===e.style.opacity||"hidden"===e.style.visibility||"collapse"===e.style.visibility}function Mr(e){return"-1"!==e.getAttribute("tabindex")&&!Er(e)&&!function(e){return e.hasAttribute("disabled")||e.hasAttribute("aria-disabled")&&"false"!==e.getAttribute("aria-disabled")}(e)&&(e.hasAttribute("tabindex")||(e instanceof HTMLAnchorElement||e instanceof HTMLAreaElement)&&e.hasAttribute("href")||e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLIFrameElement)}const Sr=new Map;const Tr=document.createElement("template");Tr.innerHTML='\n\t
\n\t
\n\t\n\t
\n';class Ar extends HTMLElement{constructor(){super(),this.debounceId=Math.random().toString(),this._focused=!1;const e=this.attachShadow({mode:"open"});e.appendChild(Tr.content.cloneNode(!0)),this.$backup=e.querySelector("#backup"),this.$start=e.querySelector("#start"),this.$end=e.querySelector("#end"),this.focusLastElement=this.focusLastElement.bind(this),this.focusFirstElement=this.focusFirstElement.bind(this),this.onFocusIn=this.onFocusIn.bind(this),this.onFocusOut=this.onFocusOut.bind(this)}static get observedAttributes(){return["inactive"]}get inactive(){return this.hasAttribute("inactive")}set inactive(e){e?this.setAttribute("inactive",""):this.removeAttribute("inactive")}get focused(){return this._focused}connectedCallback(){this.$start.addEventListener("focus",this.focusLastElement),this.$end.addEventListener("focus",this.focusFirstElement),this.addEventListener("focusin",this.onFocusIn),this.addEventListener("focusout",this.onFocusOut),this.render()}disconnectedCallback(){this.$start.removeEventListener("focus",this.focusLastElement),this.$end.removeEventListener("focus",this.focusFirstElement),this.removeEventListener("focusin",this.onFocusIn),this.removeEventListener("focusout",this.onFocusOut)}attributeChangedCallback(){this.render()}focusFirstElement(){this.trapFocus()}focusLastElement(){this.trapFocus(!0)}getFocusableElements(){return kr(this,Er,Mr)}trapFocus(e){if(this.inactive)return;let t=this.getFocusableElements();t.length>0?(e?t[t.length-1].focus():t[0].focus(),this.$backup.setAttribute("tabindex","-1")):(this.$backup.setAttribute("tabindex","0"),this.$backup.focus())}onFocusIn(){this.updateFocused(!0)}onFocusOut(){this.updateFocused(!1)}updateFocused(e){!function(e,t,n){const i=Sr.get(n);null!=i&&window.clearTimeout(i),Sr.set(n,window.setTimeout((()=>{e(),Sr.delete(n)}),t))}((()=>{this.focused!==e&&(this._focused=e,this.render())}),0,this.debounceId)}render(){this.$start.setAttribute("tabindex",!this.focused||this.inactive?"-1":"0"),this.$end.setAttribute("tabindex",!this.focused||this.inactive?"-1":"0"),this.focused?this.setAttribute("focused",""):this.removeAttribute("focused")}}function zr(e){return Number(e.getAttribute("data-dialog-count"))||0}function jr(e,t){e.setAttribute("data-dialog-count",t.toString())}function Or(e=document.activeElement){return null!=e&&null!=e.shadowRoot&&null!=e.shadowRoot.activeElement?Or(e.shadowRoot.activeElement):e}window.customElements.define("focus-trap",Ar);const Ir=document.createElement("template");Ir.innerHTML='\n \n
\n \n \n \n';class Rr extends HTMLElement{constructor(){super(),this.$scrollContainer=document.documentElement,this.$previousActiveElement=null;const e=this.attachShadow({mode:"open"});e.appendChild(Ir.content.cloneNode(!0)),this.$dialog=e.querySelector("#dialog"),this.$backdrop=e.querySelector("#backdrop"),this.onBackdropClick=this.onBackdropClick.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.setAttribute("aria-modal","true"),this.$dialog.setAttribute("role","alertdialog")}static get observedAttributes(){return["open","center"]}get open(){return this.hasAttribute("open")}set open(e){e?this.setAttribute("open",""):this.removeAttribute("open")}get center(){return this.hasAttribute("center")}set center(e){e?this.setAttribute("center",""):this.removeAttribute("center")}connectedCallback(){this.$backdrop.addEventListener("click",this.onBackdropClick)}disconnectedCallback(){this.$backdrop.removeEventListener("click",this.onBackdropClick),this.open&&this.didClose()}show(){this.open=!0}close(e){this.result=e,this.open=!1}onBackdropClick(){this.assertClosing()&&this.close()}onKeyDown(e){if("Escape"===e.code)this.assertClosing()&&(this.close(),e.stopImmediatePropagation())}assertClosing(){return this.dispatchEvent(new CustomEvent("closing",{cancelable:!0}))}didOpen(){this.$previousActiveElement=Or(document.activeElement),requestAnimationFrame((()=>{this.$dialog.focusFirstElement()})),this.tabIndex=0,this.$scrollContainer.style.overflow="hidden",this.addEventListener("keydown",this.onKeyDown,{capture:!0,passive:!0}),jr(this.$scrollContainer,zr(this.$scrollContainer)+1),this.dispatchEvent(new CustomEvent("open"))}didClose(){this.removeEventListener("keydown",this.onKeyDown,{capture:!0}),jr(this.$scrollContainer,Math.max(0,zr(this.$scrollContainer)-1)),zr(this.$scrollContainer)<=0&&(this.$scrollContainer.style.overflow=""),this.tabIndex=-1,null!=this.$previousActiveElement&&(this.$previousActiveElement.focus(),this.$previousActiveElement=null),this.dispatchEvent(new CustomEvent("close",{detail:this.result}))}attributeChangedCallback(e,t,n){if("open"===e)this.open?this.didOpen():this.didClose()}}customElements.define("web-dialog",Rr);var Dr,Pr,Lr="5.2.0",Nr="Fri, 23 Jun 2023 15:26:26 GMT",Ur="Thu, 22 Jun 2023 09:21:26 -0600",Fr="5.2.0-HEAD+g69249b6";!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),i={};for(const e of n)i[e]=t[e];return e.objectValues(i)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(Dr||(Dr={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(Pr||(Pr={}));const Hr=Dr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Zr=e=>{switch(typeof e){case"undefined":return Hr.undefined;case"string":return Hr.string;case"number":return isNaN(e)?Hr.nan:Hr.number;case"boolean":return Hr.boolean;case"function":return Hr.function;case"bigint":return Hr.bigint;case"symbol":return Hr.symbol;case"object":return Array.isArray(e)?Hr.array:null===e?Hr.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?Hr.promise:"undefined"!=typeof Map&&e instanceof Map?Hr.map:"undefined"!=typeof Set&&e instanceof Set?Hr.set:"undefined"!=typeof Date&&e instanceof Date?Hr.date:Hr.object;default:return Hr.unknown}},qr=Dr.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Vr extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},n={_errors:[]},i=e=>{for(const a of e.issues)if("invalid_union"===a.code)a.unionErrors.map(i);else if("invalid_return_type"===a.code)i(a.returnTypeError);else if("invalid_arguments"===a.code)i(a.argumentsError);else if(0===a.path.length)n._errors.push(t(a));else{let e=n,i=0;for(;ie.message)){const t={},n=[];for(const i of this.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}Vr.create=e=>new Vr(e);const Wr=(e,t)=>{let n;switch(e.code){case qr.invalid_type:n=e.received===Hr.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case qr.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Dr.jsonStringifyReplacer)}`;break;case qr.unrecognized_keys:n=`Unrecognized key(s) in object: ${Dr.joinValues(e.keys,", ")}`;break;case qr.invalid_union:n="Invalid input";break;case qr.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Dr.joinValues(e.options)}`;break;case qr.invalid_enum_value:n=`Invalid enum value. Expected ${Dr.joinValues(e.options)}, received '${e.received}'`;break;case qr.invalid_arguments:n="Invalid function arguments";break;case qr.invalid_return_type:n="Invalid function return type";break;case qr.invalid_date:n="Invalid date";break;case qr.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Dr.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case qr.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case qr.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case qr.custom:n="Invalid input";break;case qr.invalid_intersection_types:n="Intersection results could not be merged";break;case qr.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case qr.not_finite:n="Number must be finite";break;default:n=t.defaultError,Dr.assertNever(e)}return{message:n}};let Br=Wr;function Yr(){return Br}const Qr=e=>{const{data:t,path:n,errorMaps:i,issueData:a}=e,r=[...n,...a.path||[]],o={...a,path:r};let s="";const c=i.filter((e=>!!e)).slice().reverse();for(const e of c)s=e(o,{data:t,defaultError:s}).message;return{...a,path:r,message:a.message||s}};function Gr(e,t){const n=Qr({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Yr(),Wr].filter((e=>!!e))});e.common.issues.push(n)}class Kr{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const i of t){if("aborted"===i.status)return Xr;"dirty"===i.status&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t)n.push({key:await e.key,value:await e.value});return Kr.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const i of t){const{key:t,value:a}=i;if("aborted"===t.status)return Xr;if("aborted"===a.status)return Xr;"dirty"===t.status&&e.dirty(),"dirty"===a.status&&e.dirty(),(void 0!==a.value||i.alwaysSet)&&(n[t.value]=a.value)}return{status:e.value,value:n}}}const Xr=Object.freeze({status:"aborted"}),Jr=e=>({status:"dirty",value:e}),eo=e=>({status:"valid",value:e}),to=e=>"aborted"===e.status,no=e=>"dirty"===e.status,io=e=>"valid"===e.status,ao=e=>"undefined"!=typeof Promise&&e instanceof Promise;var ro;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(ro||(ro={}));class oo{constructor(e,t,n,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const so=(e,t)=>{if(io(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Vr(e.common.issues);return this._error=t,this._error}}};function co(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:i,description:a}=e;if(t&&(n||i))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:a};return{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=i?i:t.defaultError}:{message:null!=n?n:t.defaultError},description:a}}class lo{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Zr(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Zr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Kr,ctx:{common:e.parent.common,data:e.data,parsedType:Zr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ao(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const i={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Zr(e)},a=this._parseSync({data:e,path:i.path,parent:i});return so(i,a)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Zr(e)},i=this._parse({data:e,path:n.path,parent:n}),a=await(ao(i)?i:Promise.resolve(i));return so(n,a)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,i)=>{const a=e(t),r=()=>i.addIssue({code:qr.custom,...n(t)});return"undefined"!=typeof Promise&&a instanceof Promise?a.then((e=>!!e||(r(),!1))):!!a||(r(),!1)}))}refinement(e,t){return this._refinement(((n,i)=>!!e(n)||(i.addIssue("function"==typeof t?t(n,i):t),!1)))}_refinement(e){return new Xo({schema:this,typeName:ls.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Jo.create(this,this._def)}nullable(){return es.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Oo.create(this,this._def)}promise(){return Ko.create(this,this._def)}or(e){return Do.create([this,e],this._def)}and(e){return Uo.create(this,e,this._def)}transform(e){return new Xo({...co(this._def),schema:this,typeName:ls.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ts({...co(this._def),innerType:this,defaultValue:t,typeName:ls.ZodDefault})}brand(){return new rs({typeName:ls.ZodBranded,type:this,...co(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ns({...co(this._def),innerType:this,catchValue:t,typeName:ls.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return os.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const uo=/^c[^\s-]{8,}$/i,ho=/^[a-z][a-z0-9]*$/,mo=/[0-9A-HJKMNP-TV-Z]{26}/,po=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,fo=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/,go=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,vo=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,_o=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;function yo(e,t){return!("v4"!==t&&t||!vo.test(e))||!("v6"!==t&&t||!_o.test(e))}class bo extends lo{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:qr.invalid_string,...ro.errToObj(n)}),this.nonempty=e=>this.min(1,ro.errToObj(e)),this.trim=()=>new bo({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new bo({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new bo({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==Hr.string){const t=this._getOrReturnCtx(e);return Gr(t,{code:qr.invalid_type,expected:Hr.string,received:t.parsedType}),Xr}const t=new Kr;let n;for(const a of this._def.checks)if("min"===a.kind)e.data.lengtha.value&&(n=this._getOrReturnCtx(e,n),Gr(n,{code:qr.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),t.dirty());else if("length"===a.kind){const i=e.data.length>a.value,r=e.data.length"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.valuei?n:i;return parseInt(e.toFixed(a).replace(".",""))%parseInt(t.toFixed(a).replace(".",""))/Math.pow(10,a)}bo.create=e=>{var t;return new bo({checks:[],typeName:ls.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...co(e)})};class xo extends lo{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==Hr.number){const t=this._getOrReturnCtx(e);return Gr(t,{code:qr.invalid_type,expected:Hr.number,received:t.parsedType}),Xr}let t;const n=new Kr;for(const i of this._def.checks)if("int"===i.kind)Dr.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Gr(t,{code:qr.invalid_type,expected:"integer",received:"float",message:i.message}),n.dirty());else if("min"===i.kind){(i.inclusive?e.datai.value:e.data>=i.value)&&(t=this._getOrReturnCtx(e,t),Gr(t,{code:qr.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty())}else"multipleOf"===i.kind?0!==wo(e.data,i.value)&&(t=this._getOrReturnCtx(e,t),Gr(t,{code:qr.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):"finite"===i.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Gr(t,{code:qr.not_finite,message:i.message}),n.dirty()):Dr.assertNever(i);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,ro.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ro.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ro.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ro.toString(t))}setLimit(e,t,n,i){return new xo({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:ro.toString(i)}]})}_addCheck(e){return new xo({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ro.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ro.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ro.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ro.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ro.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:ro.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:ro.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ro.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ro.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value"int"===e.kind||"multipleOf"===e.kind&&Dr.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.valuenew xo({checks:[],typeName:ls.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...co(e)});class Co extends lo{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==Hr.bigint){const t=this._getOrReturnCtx(e);return Gr(t,{code:qr.invalid_type,expected:Hr.bigint,received:t.parsedType}),Xr}let t;const n=new Kr;for(const i of this._def.checks)if("min"===i.kind){(i.inclusive?e.datai.value:e.data>=i.value)&&(t=this._getOrReturnCtx(e,t),Gr(t,{code:qr.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty())}else"multipleOf"===i.kind?e.data%i.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),Gr(t,{code:qr.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):Dr.assertNever(i);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,ro.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ro.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ro.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ro.toString(t))}setLimit(e,t,n,i){return new Co({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:ro.toString(i)}]})}_addCheck(e){return new Co({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ro.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ro.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ro.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ro.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:ro.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value{var t;return new Co({checks:[],typeName:ls.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...co(e)})};class $o extends lo{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==Hr.boolean){const t=this._getOrReturnCtx(e);return Gr(t,{code:qr.invalid_type,expected:Hr.boolean,received:t.parsedType}),Xr}return eo(e.data)}}$o.create=e=>new $o({typeName:ls.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...co(e)});class ko extends lo{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==Hr.date){const t=this._getOrReturnCtx(e);return Gr(t,{code:qr.invalid_type,expected:Hr.date,received:t.parsedType}),Xr}if(isNaN(e.data.getTime())){return Gr(this._getOrReturnCtx(e),{code:qr.invalid_date}),Xr}const t=new Kr;let n;for(const i of this._def.checks)"min"===i.kind?e.data.getTime()i.value&&(n=this._getOrReturnCtx(e,n),Gr(n,{code:qr.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),t.dirty()):Dr.assertNever(i);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ko({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:ro.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:ro.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.valuenew ko({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:ls.ZodDate,...co(e)});class Eo extends lo{_parse(e){if(this._getType(e)!==Hr.symbol){const t=this._getOrReturnCtx(e);return Gr(t,{code:qr.invalid_type,expected:Hr.symbol,received:t.parsedType}),Xr}return eo(e.data)}}Eo.create=e=>new Eo({typeName:ls.ZodSymbol,...co(e)});class Mo extends lo{_parse(e){if(this._getType(e)!==Hr.undefined){const t=this._getOrReturnCtx(e);return Gr(t,{code:qr.invalid_type,expected:Hr.undefined,received:t.parsedType}),Xr}return eo(e.data)}}Mo.create=e=>new Mo({typeName:ls.ZodUndefined,...co(e)});class So extends lo{_parse(e){if(this._getType(e)!==Hr.null){const t=this._getOrReturnCtx(e);return Gr(t,{code:qr.invalid_type,expected:Hr.null,received:t.parsedType}),Xr}return eo(e.data)}}So.create=e=>new So({typeName:ls.ZodNull,...co(e)});class To extends lo{constructor(){super(...arguments),this._any=!0}_parse(e){return eo(e.data)}}To.create=e=>new To({typeName:ls.ZodAny,...co(e)});class Ao extends lo{constructor(){super(...arguments),this._unknown=!0}_parse(e){return eo(e.data)}}Ao.create=e=>new Ao({typeName:ls.ZodUnknown,...co(e)});class zo extends lo{_parse(e){const t=this._getOrReturnCtx(e);return Gr(t,{code:qr.invalid_type,expected:Hr.never,received:t.parsedType}),Xr}}zo.create=e=>new zo({typeName:ls.ZodNever,...co(e)});class jo extends lo{_parse(e){if(this._getType(e)!==Hr.undefined){const t=this._getOrReturnCtx(e);return Gr(t,{code:qr.invalid_type,expected:Hr.void,received:t.parsedType}),Xr}return eo(e.data)}}jo.create=e=>new jo({typeName:ls.ZodVoid,...co(e)});class Oo extends lo{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),i=this._def;if(t.parsedType!==Hr.array)return Gr(t,{code:qr.invalid_type,expected:Hr.array,received:t.parsedType}),Xr;if(null!==i.exactLength){const e=t.data.length>i.exactLength.value,a=t.data.lengthi.maxLength.value&&(Gr(t,{code:qr.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>i.type._parseAsync(new oo(t,e,t.path,n))))).then((e=>Kr.mergeArray(n,e)));const a=[...t.data].map(((e,n)=>i.type._parseSync(new oo(t,e,t.path,n))));return Kr.mergeArray(n,a)}get element(){return this._def.type}min(e,t){return new Oo({...this._def,minLength:{value:e,message:ro.toString(t)}})}max(e,t){return new Oo({...this._def,maxLength:{value:e,message:ro.toString(t)}})}length(e,t){return new Oo({...this._def,exactLength:{value:e,message:ro.toString(t)}})}nonempty(e){return this.min(1,e)}}function Io(e){if(e instanceof Ro){const t={};for(const n in e.shape){const i=e.shape[n];t[n]=Jo.create(Io(i))}return new Ro({...e._def,shape:()=>t})}return e instanceof Oo?new Oo({...e._def,type:Io(e.element)}):e instanceof Jo?Jo.create(Io(e.unwrap())):e instanceof es?es.create(Io(e.unwrap())):e instanceof Fo?Fo.create(e.items.map((e=>Io(e)))):e}Oo.create=(e,t)=>new Oo({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ls.ZodArray,...co(t)});class Ro extends lo{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=Dr.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Hr.object){const t=this._getOrReturnCtx(e);return Gr(t,{code:qr.invalid_type,expected:Hr.object,received:t.parsedType}),Xr}const{status:t,ctx:n}=this._processInputParams(e),{shape:i,keys:a}=this._getCached(),r=[];if(!(this._def.catchall instanceof zo&&"strip"===this._def.unknownKeys))for(const e in n.data)a.includes(e)||r.push(e);const o=[];for(const e of a){const t=i[e],a=n.data[e];o.push({key:{status:"valid",value:e},value:t._parse(new oo(n,a,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof zo){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of r)o.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)r.length>0&&(Gr(n,{code:qr.unrecognized_keys,keys:r}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of r){const i=n.data[t];o.push({key:{status:"valid",value:t},value:e._parse(new oo(n,i,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of o){const n=await t.key;e.push({key:n,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>Kr.mergeObjectSync(t,e))):Kr.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(e){return ro.errToObj,new Ro({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var i,a,r,o;const s=null!==(r=null===(a=(i=this._def).errorMap)||void 0===a?void 0:a.call(i,t,n).message)&&void 0!==r?r:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(o=ro.errToObj(e).message)&&void 0!==o?o:s}:{message:s}}}:{}})}strip(){return new Ro({...this._def,unknownKeys:"strip"})}passthrough(){return new Ro({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ro({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ro({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ls.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Ro({...this._def,catchall:e})}pick(e){const t={};return Dr.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new Ro({...this._def,shape:()=>t})}omit(e){const t={};return Dr.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new Ro({...this._def,shape:()=>t})}deepPartial(){return Io(this)}partial(e){const t={};return Dr.objectKeys(this.shape).forEach((n=>{const i=this.shape[n];e&&!e[n]?t[n]=i:t[n]=i.optional()})),new Ro({...this._def,shape:()=>t})}required(e){const t={};return Dr.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Jo;)e=e._def.innerType;t[n]=e}})),new Ro({...this._def,shape:()=>t})}keyof(){return Yo(Dr.objectKeys(this.shape))}}Ro.create=(e,t)=>new Ro({shape:()=>e,unknownKeys:"strip",catchall:zo.create(),typeName:ls.ZodObject,...co(t)}),Ro.strictCreate=(e,t)=>new Ro({shape:()=>e,unknownKeys:"strict",catchall:zo.create(),typeName:ls.ZodObject,...co(t)}),Ro.lazycreate=(e,t)=>new Ro({shape:e,unknownKeys:"strip",catchall:zo.create(),typeName:ls.ZodObject,...co(t)});class Do extends lo{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map((e=>new Vr(e.ctx.common.issues)));return Gr(t,{code:qr.invalid_union,unionErrors:n}),Xr}));{let e;const i=[];for(const a of n){const n={...t,common:{...t.common,issues:[]},parent:null},r=a._parseSync({data:t.data,path:t.path,parent:n});if("valid"===r.status)return r;"dirty"!==r.status||e||(e={result:r,ctx:n}),n.common.issues.length&&i.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const a=i.map((e=>new Vr(e)));return Gr(t,{code:qr.invalid_union,unionErrors:a}),Xr}}get options(){return this._def.options}}Do.create=(e,t)=>new Do({options:e,typeName:ls.ZodUnion,...co(t)});const Po=e=>e instanceof Wo?Po(e.schema):e instanceof Xo?Po(e.innerType()):e instanceof Bo?[e.value]:e instanceof Qo?e.options:e instanceof Go?Object.keys(e.enum):e instanceof ts?Po(e._def.innerType):e instanceof Mo?[void 0]:e instanceof So?[null]:null;class Lo extends lo{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Hr.object)return Gr(t,{code:qr.invalid_type,expected:Hr.object,received:t.parsedType}),Xr;const n=this.discriminator,i=t.data[n],a=this.optionsMap.get(i);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(Gr(t,{code:qr.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Xr)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const i=new Map;for(const n of t){const t=Po(n.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of t){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,n)}}return new Lo({typeName:ls.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...co(n)})}}function No(e,t){const n=Zr(e),i=Zr(t);if(e===t)return{valid:!0,data:e};if(n===Hr.object&&i===Hr.object){const n=Dr.objectKeys(t),i=Dr.objectKeys(e).filter((e=>-1!==n.indexOf(e))),a={...e,...t};for(const n of i){const i=No(e[n],t[n]);if(!i.valid)return{valid:!1};a[n]=i.data}return{valid:!0,data:a}}if(n===Hr.array&&i===Hr.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let i=0;i{if(to(e)||to(i))return Xr;const a=No(e.value,i.value);return a.valid?((no(e)||no(i))&&t.dirty(),{status:t.value,value:a.data}):(Gr(n,{code:qr.invalid_intersection_types}),Xr)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>i(e,t))):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Uo.create=(e,t,n)=>new Uo({left:e,right:t,typeName:ls.ZodIntersection,...co(n)});class Fo extends lo{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Hr.array)return Gr(n,{code:qr.invalid_type,expected:Hr.array,received:n.parsedType}),Xr;if(n.data.lengththis._def.items.length&&(Gr(n,{code:qr.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const i=[...n.data].map(((e,t)=>{const i=this._def.items[t]||this._def.rest;return i?i._parse(new oo(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(i).then((e=>Kr.mergeArray(t,e))):Kr.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new Fo({...this._def,rest:e})}}Fo.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fo({items:e,typeName:ls.ZodTuple,rest:null,...co(t)})};class Ho extends lo{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Hr.object)return Gr(n,{code:qr.invalid_type,expected:Hr.object,received:n.parsedType}),Xr;const i=[],a=this._def.keyType,r=this._def.valueType;for(const e in n.data)i.push({key:a._parse(new oo(n,e,n.path,e)),value:r._parse(new oo(n,n.data[e],n.path,e))});return n.common.async?Kr.mergeObjectAsync(t,i):Kr.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,n){return new Ho(t instanceof lo?{keyType:e,valueType:t,typeName:ls.ZodRecord,...co(n)}:{keyType:bo.create(),valueType:e,typeName:ls.ZodRecord,...co(t)})}}class Zo extends lo{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Hr.map)return Gr(n,{code:qr.invalid_type,expected:Hr.map,received:n.parsedType}),Xr;const i=this._def.keyType,a=this._def.valueType,r=[...n.data.entries()].map((([e,t],r)=>({key:i._parse(new oo(n,e,n.path,[r,"key"])),value:a._parse(new oo(n,t,n.path,[r,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of r){const i=await n.key,a=await n.value;if("aborted"===i.status||"aborted"===a.status)return Xr;"dirty"!==i.status&&"dirty"!==a.status||t.dirty(),e.set(i.value,a.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of r){const i=n.key,a=n.value;if("aborted"===i.status||"aborted"===a.status)return Xr;"dirty"!==i.status&&"dirty"!==a.status||t.dirty(),e.set(i.value,a.value)}return{status:t.value,value:e}}}}Zo.create=(e,t,n)=>new Zo({valueType:t,keyType:e,typeName:ls.ZodMap,...co(n)});class qo extends lo{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Hr.set)return Gr(n,{code:qr.invalid_type,expected:Hr.set,received:n.parsedType}),Xr;const i=this._def;null!==i.minSize&&n.data.sizei.maxSize.value&&(Gr(n,{code:qr.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());const a=this._def.valueType;function r(e){const n=new Set;for(const i of e){if("aborted"===i.status)return Xr;"dirty"===i.status&&t.dirty(),n.add(i.value)}return{status:t.value,value:n}}const o=[...n.data.values()].map(((e,t)=>a._parse(new oo(n,e,n.path,t))));return n.common.async?Promise.all(o).then((e=>r(e))):r(o)}min(e,t){return new qo({...this._def,minSize:{value:e,message:ro.toString(t)}})}max(e,t){return new qo({...this._def,maxSize:{value:e,message:ro.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}qo.create=(e,t)=>new qo({valueType:e,minSize:null,maxSize:null,typeName:ls.ZodSet,...co(t)});class Vo extends lo{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Hr.function)return Gr(t,{code:qr.invalid_type,expected:Hr.function,received:t.parsedType}),Xr;function n(e,n){return Qr({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Yr(),Wr].filter((e=>!!e)),issueData:{code:qr.invalid_arguments,argumentsError:n}})}function i(e,n){return Qr({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Yr(),Wr].filter((e=>!!e)),issueData:{code:qr.invalid_return_type,returnTypeError:n}})}const a={errorMap:t.common.contextualErrorMap},r=t.data;return this._def.returns instanceof Ko?eo((async(...e)=>{const t=new Vr([]),o=await this._def.args.parseAsync(e,a).catch((i=>{throw t.addIssue(n(e,i)),t})),s=await r(...o),c=await this._def.returns._def.type.parseAsync(s,a).catch((e=>{throw t.addIssue(i(s,e)),t}));return c})):eo(((...e)=>{const t=this._def.args.safeParse(e,a);if(!t.success)throw new Vr([n(e,t.error)]);const o=r(...t.data),s=this._def.returns.safeParse(o,a);if(!s.success)throw new Vr([i(o,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Vo({...this._def,args:Fo.create(e).rest(Ao.create())})}returns(e){return new Vo({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Vo({args:e||Fo.create([]).rest(Ao.create()),returns:t||Ao.create(),typeName:ls.ZodFunction,...co(n)})}}class Wo extends lo{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Wo.create=(e,t)=>new Wo({getter:e,typeName:ls.ZodLazy,...co(t)});class Bo extends lo{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return Gr(t,{received:t.data,code:qr.invalid_literal,expected:this._def.value}),Xr}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Yo(e,t){return new Qo({values:e,typeName:ls.ZodEnum,...co(t)})}Bo.create=(e,t)=>new Bo({value:e,typeName:ls.ZodLiteral,...co(t)});class Qo extends lo{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return Gr(t,{expected:Dr.joinValues(n),received:t.parsedType,code:qr.invalid_type}),Xr}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return Gr(t,{received:t.data,code:qr.invalid_enum_value,options:n}),Xr}return eo(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return Qo.create(e)}exclude(e){return Qo.create(this.options.filter((t=>!e.includes(t))))}}Qo.create=Yo;class Go extends lo{_parse(e){const t=Dr.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Hr.string&&n.parsedType!==Hr.number){const e=Dr.objectValues(t);return Gr(n,{expected:Dr.joinValues(e),received:n.parsedType,code:qr.invalid_type}),Xr}if(-1===t.indexOf(e.data)){const e=Dr.objectValues(t);return Gr(n,{received:n.data,code:qr.invalid_enum_value,options:e}),Xr}return eo(e.data)}get enum(){return this._def.values}}Go.create=(e,t)=>new Go({values:e,typeName:ls.ZodNativeEnum,...co(t)});class Ko extends lo{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Hr.promise&&!1===t.common.async)return Gr(t,{code:qr.invalid_type,expected:Hr.promise,received:t.parsedType}),Xr;const n=t.parsedType===Hr.promise?t.data:Promise.resolve(t.data);return eo(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Ko.create=(e,t)=>new Ko({type:e,typeName:ls.ZodPromise,...co(t)});class Xo extends lo{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ls.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),i=this._def.effect||null;if("preprocess"===i.type){const e=i.transform(n.data);return n.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:n.path,parent:n}))):this._def.schema._parseSync({data:e,path:n.path,parent:n})}const a={addIssue:e=>{Gr(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),"refinement"===i.type){const e=e=>{const t=i.refinement(e,a);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===i.status?Xr:("dirty"===i.status&&t.dirty(),e(i.value),{status:t.value,value:i.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?Xr:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===i.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!io(e))return e;const r=i.transform(e.value,a);if(r instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:r}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>io(e)?Promise.resolve(i.transform(e.value,a)).then((e=>({status:t.value,value:e}))):e))}Dr.assertNever(i)}}Xo.create=(e,t,n)=>new Xo({schema:e,typeName:ls.ZodEffects,effect:t,...co(n)}),Xo.createWithPreprocess=(e,t,n)=>new Xo({schema:t,effect:{type:"preprocess",transform:e},typeName:ls.ZodEffects,...co(n)});class Jo extends lo{_parse(e){return this._getType(e)===Hr.undefined?eo(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Jo.create=(e,t)=>new Jo({innerType:e,typeName:ls.ZodOptional,...co(t)});class es extends lo{_parse(e){return this._getType(e)===Hr.null?eo(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}es.create=(e,t)=>new es({innerType:e,typeName:ls.ZodNullable,...co(t)});class ts extends lo{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===Hr.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ts.create=(e,t)=>new ts({innerType:e,typeName:ls.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...co(t)});class ns extends lo{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ao(i)?i.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new Vr(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===i.status?i.value:this._def.catchValue({get error(){return new Vr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ns.create=(e,t)=>new ns({innerType:e,typeName:ls.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...co(t)});class is extends lo{_parse(e){if(this._getType(e)!==Hr.nan){const t=this._getOrReturnCtx(e);return Gr(t,{code:qr.invalid_type,expected:Hr.nan,received:t.parsedType}),Xr}return{status:"valid",value:e.data}}}is.create=e=>new is({typeName:ls.ZodNaN,...co(e)});const as=Symbol("zod_brand");class rs extends lo{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class os extends lo{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?Xr:"dirty"===e.status?(t.dirty(),Jr(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})()}{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?Xr:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new os({in:e,out:t,typeName:ls.ZodPipeline})}}const ss=(e,t={},n)=>e?To.create().superRefine(((i,a)=>{var r,o;if(!e(i)){const e="function"==typeof t?t(i):"string"==typeof t?{message:t}:t,s=null===(o=null!==(r=e.fatal)&&void 0!==r?r:n)||void 0===o||o,c="string"==typeof e?{message:e}:e;a.addIssue({code:"custom",...c,fatal:s})}})):To.create(),cs={object:Ro.lazycreate};var ls;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline"}(ls||(ls={}));const ds=bo.create,us=xo.create,hs=is.create,ms=Co.create,ps=$o.create,fs=ko.create,gs=Eo.create,vs=Mo.create,_s=So.create,ys=To.create,bs=Ao.create,ws=zo.create,xs=jo.create,Cs=Oo.create,$s=Ro.create,ks=Ro.strictCreate,Es=Do.create,Ms=Lo.create,Ss=Uo.create,Ts=Fo.create,As=Ho.create,zs=Zo.create,js=qo.create,Os=Vo.create,Is=Wo.create,Rs=Bo.create,Ds=Qo.create,Ps=Go.create,Ls=Ko.create,Ns=Xo.create,Us=Jo.create,Fs=es.create,Hs=Xo.createWithPreprocess,Zs=os.create,qs={string:e=>bo.create({...e,coerce:!0}),number:e=>xo.create({...e,coerce:!0}),boolean:e=>$o.create({...e,coerce:!0}),bigint:e=>Co.create({...e,coerce:!0}),date:e=>ko.create({...e,coerce:!0})},Vs=Xr;var Ws=Object.freeze({__proto__:null,defaultErrorMap:Wr,setErrorMap:function(e){Br=e},getErrorMap:Yr,makeIssue:Qr,EMPTY_PATH:[],addIssueToContext:Gr,ParseStatus:Kr,INVALID:Xr,DIRTY:Jr,OK:eo,isAborted:to,isDirty:no,isValid:io,isAsync:ao,get util(){return Dr},get objectUtil(){return Pr},ZodParsedType:Hr,getParsedType:Zr,ZodType:lo,ZodString:bo,ZodNumber:xo,ZodBigInt:Co,ZodBoolean:$o,ZodDate:ko,ZodSymbol:Eo,ZodUndefined:Mo,ZodNull:So,ZodAny:To,ZodUnknown:Ao,ZodNever:zo,ZodVoid:jo,ZodArray:Oo,ZodObject:Ro,ZodUnion:Do,ZodDiscriminatedUnion:Lo,ZodIntersection:Uo,ZodTuple:Fo,ZodRecord:Ho,ZodMap:Zo,ZodSet:qo,ZodFunction:Vo,ZodLazy:Wo,ZodLiteral:Bo,ZodEnum:Qo,ZodNativeEnum:Go,ZodPromise:Ko,ZodEffects:Xo,ZodTransformer:Xo,ZodOptional:Jo,ZodNullable:es,ZodDefault:ts,ZodCatch:ns,ZodNaN:is,BRAND:as,ZodBranded:rs,ZodPipeline:os,custom:ss,Schema:lo,ZodSchema:lo,late:cs,get ZodFirstPartyTypeKind(){return ls},coerce:qs,any:ys,array:Cs,bigint:ms,boolean:ps,date:fs,discriminatedUnion:Ms,effect:Ns,enum:Ds,function:Os,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>ss((t=>t instanceof e),t),intersection:Ss,lazy:Is,literal:Rs,map:zs,nan:hs,nativeEnum:Ps,never:ws,null:_s,nullable:Fs,number:us,object:$s,oboolean:()=>ps().optional(),onumber:()=>us().optional(),optional:Us,ostring:()=>ds().optional(),pipeline:Zs,preprocess:Hs,promise:Ls,record:As,set:js,strictObject:ks,string:ds,symbol:gs,transformer:Ns,tuple:Ts,undefined:vs,union:Es,unknown:bs,void:xs,NEVER:Vs,ZodIssueCode:qr,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:Vr});const Bs="https://github.com/dermotduffy/frigate-hass-card",Ys=`${Bs}#troubleshooting`,Qs="cameras",Gs=`${Qs}.#.camera_entity`,Ks=`${Qs}.#.frigate.camera_name`,Xs=`${Qs}.#.frigate.client_id`,Js=`${Qs}.#.frigate.labels`,ec=`${Qs}.#.frigate.url`,tc=`${Qs}.#.frigate.zones`,nc=`${Qs}.#.go2rtc.modes`,ic=`${Qs}.#.go2rtc.stream`,ac=`${Qs}.#.hide`,rc=`${Qs}.#.icon`,oc=`${Qs}.#.id`,sc=`${Qs}.#.image.refresh_seconds`,cc=`${Qs}.#.image.url`,lc=`${Qs}.#.motioneye.images.directory_pattern`,dc=`${Qs}.#.motioneye.images.file_pattern`,uc=`${Qs}.#.motioneye.movies.directory_pattern`,hc=`${Qs}.#.motioneye.movies.file_pattern`,mc=`${Qs}.#.motioneye.url`,pc=`${Qs}.#.title`,fc=`${Qs}.#.webrtc_card.entity`,gc=`${Qs}.#.webrtc_card.url`,vc=`${Qs}.#.live_provider`,_c=`${Qs}.#.dependencies.cameras`,yc=`${Qs}.#.dependencies.all_cameras`,bc=`${Qs}.#.triggers.motion`,wc=`${Qs}.#.triggers.occupancy`,xc=`${Qs}.#.triggers.entities`,Cc="cameras_global",$c=`${Cc}.image`,kc=`${Cc}.jsmpeg`,Ec=`${Cc}.webrtc_card`,Mc=`${Cc}.triggers.occupancy`,Sc=`${Cc}.image.refresh_seconds`,Tc="view",Ac=`${Tc}.camera_select`,zc=`${Tc}.dark_mode`,jc=`${Tc}.default`,Oc=`${Tc}.timeout_seconds`,Ic=`${Tc}.update_cycle_camera`,Rc=`${Tc}.update_force`,Dc=`${Tc}.update_seconds`,Pc=`${Tc}.scan`,Lc=`${Pc}.enabled`,Nc=`${Pc}.show_trigger_status`,Uc=`${Pc}.untrigger_reset`,Fc=`${Pc}.untrigger_seconds`,Hc="media_gallery",Zc=`${Hc}.controls.filter.mode`,qc=`${Hc}.controls.thumbnails.show_details`,Vc=`${Hc}.controls.thumbnails.show_download_control`,Wc=`${Hc}.controls.thumbnails.show_favorite_control`,Bc=`${Hc}.controls.thumbnails.show_timeline_control`,Yc=`${Hc}.controls.thumbnails.size`,Qc="media_viewer",Gc=`${Qc}.auto_play`,Kc=`${Qc}.auto_pause`,Xc=`${Qc}.auto_mute`,Jc=`${Qc}.auto_unmute`,el=`${Qc}.draggable`,tl=`${Qc}.lazy_load`,nl=`${Qc}.snapshot_click_plays_clip`,il=`${Qc}.transition_effect`,al=`${Qc}.controls.builtin`,rl=`${Qc}.controls.next_previous.style`,ol=`${Qc}.controls.next_previous.size`,sl=`${Qc}.controls.thumbnails.mode`,cl=`${Qc}.controls.thumbnails.show_details`,ll=`${Qc}.controls.thumbnails.show_download_control`,dl=`${Qc}.controls.thumbnails.show_favorite_control`,ul=`${Qc}.controls.thumbnails.show_timeline_control`,hl=`${Qc}.controls.thumbnails.size`,ml=`${Qc}.controls.timeline.clustering_threshold`,pl=`${Qc}.controls.timeline.media`,fl=`${Qc}.controls.timeline.mode`,gl=`${Qc}.controls.timeline.show_recordings`,vl=`${Qc}.controls.timeline.style`,_l=`${Qc}.controls.timeline.window_seconds`,yl=`${Qc}.zoomable`,bl=`${Qc}.controls.title.mode`,wl=`${Qc}.controls.title.duration_seconds`,xl=`${Qc}.layout.fit`,Cl=`${Qc}.layout.position.x`,$l=`${Qc}.layout.position.y`,kl="live",El=`${kl}.auto_play`,Ml=`${kl}.auto_pause`,Sl=`${kl}.auto_mute`,Tl=`${kl}.auto_unmute`,Al=`${kl}.controls.builtin`,zl=`${kl}.controls.next_previous.style`,jl=`${kl}.controls.next_previous.size`,Ol=`${kl}.controls.thumbnails.media`,Il=`${kl}.controls.thumbnails.mode`,Rl=`${kl}.controls.thumbnails.size`,Dl=`${kl}.controls.thumbnails.show_details`,Pl=`${kl}.controls.thumbnails.show_download_control`,Ll=`${kl}.controls.thumbnails.show_favorite_control`,Nl=`${kl}.controls.thumbnails.show_timeline_control`,Ul=`${kl}.controls.timeline.clustering_threshold`,Fl=`${kl}.controls.timeline.media`,Hl=`${kl}.controls.timeline.mode`,Zl=`${kl}.controls.timeline.show_recordings`,ql=`${kl}.controls.timeline.style`,Vl=`${kl}.controls.timeline.window_seconds`,Wl=`${kl}.controls.title.mode`,Bl=`${kl}.controls.title.duration_seconds`,Yl=`${kl}.layout.fit`,Ql=`${kl}.layout.position.x`,Gl=`${kl}.layout.position.y`,Kl=`${kl}.draggable`,Xl=`${kl}.lazy_load`,Jl=`${kl}.lazy_unload`,ed=`${kl}.preload`,td=`${kl}.transition_effect`,nd=`${kl}.show_image_during_load`,id=`${kl}.microphone.disconnect_seconds`,ad=`${kl}.microphone.always_connected`,rd=`${kl}.zoomable`,od="image",sd=`${od}.layout.fit`,cd=`${od}.layout.position.x`,ld=`${od}.layout.position.y`,dd=`${od}.mode`,ud=`${od}.refresh_seconds`,hd=`${od}.url`,md=`${od}.zoomable`,pd="timeline",fd=`${pd}.window_seconds`,gd=`${pd}.clustering_threshold`,vd=`${pd}.media`,_d=`${pd}.show_recordings`,yd=`${pd}.style`,bd=`${pd}.controls.thumbnails.mode`,wd=`${pd}.controls.thumbnails.size`,xd=`${pd}.controls.thumbnails.show_details`,Cd=`${pd}.controls.thumbnails.show_download_control`,$d=`${pd}.controls.thumbnails.show_favorite_control`,kd=`${pd}.controls.thumbnails.show_timeline_control`,Ed="menu",Md=`${Ed}.alignment`,Sd=`${Ed}.position`,Td=`${Ed}.style`,Ad=`${Ed}.button_size`,zd=`${Ed}.buttons`,jd=`${Ed}.buttons.cameras`,Od=`${Ed}.buttons.clips`,Id=`${Ed}.buttons.download`,Rd=`${Ed}.buttons.frigate`,Dd=`${Ed}.buttons.camera_ui`,Pd=`${Ed}.buttons.fullscreen`,Ld=`${Ed}.buttons.image`,Nd=`${Ed}.buttons.live`,Ud=`${Ed}.buttons.media_player`,Fd=`${Ed}.buttons.snapshots`,Hd=`${Ed}.buttons.timeline`,Zd="dimensions",qd=`${Zd}.aspect_ratio`,Vd=`${Zd}.aspect_ratio_mode`,Wd=`${Zd}.max_height`,Bd=`${Zd}.min_height`,Yd="overrides",Qd="performance",Gd=`${Qd}.features.animated_progress_indicator`,Kd=`${Qd}.features.media_chunk_size`,Xd=`${Qd}.profile`,Jd=`${Qd}.style.box_shadow`,eu=`${Qd}.style.border_radius`,tu=1e3,nu="frigate";function iu(e){if(e instanceof Ws.ZodDefault)return iu(e.removeDefault());if(e instanceof Ws.ZodObject){const t={};for(const n in e.shape){const i=e.shape[n];t[n]=Ws.ZodOptional.create(iu(i))}return new Ws.ZodObject({...e._def,shape:()=>t})}return e instanceof Ws.ZodArray?Ws.ZodArray.create(iu(e.element)):e instanceof Ws.ZodOptional?Ws.ZodOptional.create(iu(e.unwrap())):e instanceof Ws.ZodNullable?Ws.ZodNullable.create(iu(e.unwrap())):e instanceof Ws.ZodTuple?Ws.ZodTuple.create(e.items.map((e=>iu(e)))):e}function au(e){const t=e.format();return Object.keys(t).filter((e=>!e.startsWith("_")))}const ru=e=>{const t=new Set;if(e&&e.issues)for(let n=0;n{let t="";for(let n=0;n"fire-dom-event")).or(Ws.literal("fire-dom-event")),card_id:Ws.string().optional()}),Mu=["camera_ui","default","diagnostics","expand","download","fullscreen","menu_toggle","mute","live_substream_on","live_substream_off","microphone_mute","microphone_unmute","play","pause","screenshot","unmute"],Su=Eu.extend({frigate_card_action:Ws.enum(du)}),Tu=Eu.extend({frigate_card_action:Ws.enum(Mu)}),Au=Eu.extend({frigate_card_action:Ws.literal("camera_select"),camera:Ws.string()}),zu=Eu.extend({frigate_card_action:Ws.literal("live_substream_select"),camera:Ws.string()}),ju=Eu.extend({frigate_card_action:Ws.literal("media_player"),media_player:Ws.string(),media_player_action:Ws.enum(["play","stop"])}),Ou=Ws.union([Su,Tu,Au,zu,ju]),Iu=Ws.union([yu,bu,wu,xu,Cu,ku,$u,Ou]),Ru=Ws.object({tap_action:Iu.or(Iu.array()).optional(),hold_action:Iu.or(Iu.array()).optional(),double_tap_action:Iu.or(Iu.array()).optional(),start_tap_action:Iu.or(Iu.array()).optional(),end_tap_action:Iu.or(Iu.array()).optional()}).passthrough(),Du=Ws.object({actions:Ru.optional()}),Pu=Ru.extend({style:Ws.object({}).passthrough().optional(),title:Ws.string().nullable().optional()}),Lu=Pu.extend({type:Ws.literal("state-badge"),entity:Ws.string()}),Nu=Pu.extend({type:Ws.literal("state-icon"),entity:Ws.string(),icon:Ws.string().optional(),state_color:Ws.boolean().default(!0)}),Uu=Pu.extend({type:Ws.literal("state-label"),entity:Ws.string(),attribute:Ws.string().optional(),prefix:Ws.string().optional(),suffix:Ws.string().optional()}),Fu=Pu.extend({type:Ws.literal("service-button"),title:Ws.string(),service:Ws.string(),service_data:Ws.object({}).passthrough().optional()}),Hu=Pu.extend({type:Ws.literal("icon"),icon:Ws.string(),entity:Ws.string().optional()}),Zu=Pu.extend({type:Ws.literal("image"),entity:Ws.string().optional(),image:Ws.string().optional(),camera_image:Ws.string().optional(),camera_view:Ws.string().optional(),state_image:Ws.object({}).passthrough().optional(),filter:Ws.string().optional(),state_filter:Ws.object({}).passthrough().optional(),aspect_ratio:Ws.string().optional()}),qu=Ws.object({entity:Ws.string(),state:Ws.string().optional(),state_not:Ws.string().optional()}).array(),Vu=Ws.object({type:Ws.literal("conditional"),conditions:qu,elements:Ws.lazy((()=>mh))}),Wu=Ws.object({type:Ws.string().superRefine(((e,t)=>{e.match(/^custom:(?!frigate-card).+/)||t.addIssue({code:Ws.ZodIssueCode.custom,message:"Frigate-card custom elements must match specific schemas",fatal:!0})}))}).passthrough(),Bu={refresh_seconds:1},Yu=Ws.object({url:Ws.string().optional(),refresh_seconds:Ws.number().min(0).default(Bu.refresh_seconds)}),Qu={always_connected:!1,disconnect_seconds:60},Gu=Ws.object({always_connected:Ws.boolean().default(Qu.always_connected),disconnect_seconds:Ws.number().min(0).default(Qu.disconnect_seconds)}).default(Qu),Ku=Ws.object({modes:Ws.enum(["webrtc","mse","mp4","mjpeg"]).array().optional(),stream:Ws.string().optional()}),Xu=Yu,Ju=Ws.object({entity:Ws.string().optional(),url:Ws.string().optional()}).passthrough(),eh=Ws.object({options:Ws.object({audio:Ws.boolean().optional(),video:Ws.boolean().optional(),pauseWhenHidden:Ws.boolean().optional(),disableGl:Ws.boolean().optional(),disableWebAssembly:Ws.boolean().optional(),preserveDrawingBuffer:Ws.boolean().optional(),progressive:Ws.boolean().optional(),throttled:Ws.boolean().optional(),chunkSize:Ws.number().optional(),maxAudioLag:Ws.number().optional(),videoBufferSize:Ws.number().optional(),audioBufferSize:Ws.number().optional()}).optional()}),th={dependencies:{all_cameras:!1,cameras:[]},engine:"auto",frigate:{client_id:"frigate"},hide:!1,image:{refresh_seconds:1},live_provider:"auto",motioneye:{images:{directory_pattern:"%Y-%m-%d",file_pattern:"%H-%M-%S"},movies:{directory_pattern:"%Y-%m-%d",file_pattern:"%H-%M-%S"}},triggers:{motion:!1,occupancy:!0,entities:[]}},nh=Ws.object({camera_entity:Ws.string().optional(),icon:Ws.string().optional(),title:Ws.string().optional(),hide:Ws.boolean().optional(),id:Ws.string().optional(),dependencies:Ws.object({all_cameras:Ws.boolean().default(th.dependencies.all_cameras),cameras:Ws.string().array().default(th.dependencies.cameras)}).default(th.dependencies),triggers:Ws.object({motion:Ws.boolean().default(th.triggers.motion),occupancy:Ws.boolean().default(th.triggers.occupancy),entities:Ws.string().array().default(th.triggers.entities)}).default(th.triggers),engine:Ws.enum(["auto","frigate","generic","motioneye"]).default("auto"),frigate:Ws.object({url:Ws.string().optional(),client_id:Ws.string().default(th.frigate.client_id),camera_name:Ws.string().optional(),labels:Ws.string().array().optional(),zones:Ws.string().array().optional()}).default(th.frigate),motioneye:Ws.object({url:Ws.string().optional(),images:Ws.object({directory_pattern:Ws.string().includes("%").default(th.motioneye.images.directory_pattern),file_pattern:Ws.string().includes("%").default(th.motioneye.images.file_pattern)}).default(th.motioneye.images),movies:Ws.object({directory_pattern:Ws.string().includes("%").default(th.motioneye.movies.directory_pattern),file_pattern:Ws.string().includes("%").default(th.motioneye.movies.file_pattern)}).default(th.motioneye.movies)}).default(th.motioneye),live_provider:Ws.enum(["auto","image","ha","jsmpeg","go2rtc","webrtc-card"]).default(th.live_provider),go2rtc:Ku.optional(),image:Xu.default(th.image),jsmpeg:eh.optional(),webrtc_card:Ju.optional()}).default(th),ih=nh.array().min(1),ah=Ws.object({enabled:Ws.boolean().default(!0).optional(),priority:Ws.number().min(0).max(100).default(50).optional(),alignment:Ws.enum(["matching","opposing"]).default("matching").optional(),icon:Ws.string().optional()}),rh=ah.merge(Hu).extend({type:Ws.literal("custom:frigate-card-menu-icon")}),oh=ah.merge(Nu).extend({type:Ws.literal("custom:frigate-card-menu-state-icon")}).merge(ah),sh=Pu.extend({entity:Ws.string().optional(),icon:Ws.string().optional(),state_color:Ws.boolean().default(!0),selected:Ws.boolean().default(!1),subtitle:Ws.string().optional(),enabled:Ws.boolean().default(!0)}),ch=ah.merge(Hu).extend({type:Ws.literal("custom:frigate-card-menu-submenu"),items:sh.array()}),lh=ah.merge(Nu).extend({type:Ws.literal("custom:frigate-card-menu-submenu-select"),options:Ws.record(sh.deepPartial()).optional()}),dh=Ws.object({view:Ws.string().array().optional(),fullscreen:Ws.boolean().optional(),expand:Ws.boolean().optional(),camera:Ws.string().array().optional(),media_loaded:Ws.boolean().optional(),state:qu.optional(),media_query:Ws.string().optional()}),uh=Ws.object({type:Ws.literal("custom:frigate-card-conditional"),conditions:dh,elements:Ws.lazy((()=>mh))}),hh=Ws.preprocess((e=>{if(!e||"object"!=typeof e||!e.service)return e;const t={...e};return["left","right","up","down","zoom_in","zoom_out","home"].forEach((n=>{`data_${n}`in e&&!(`actions_${n}`in e)&&(t[`actions_${n}`]={tap_action:{action:"call-service",service:e.service,service_data:e[`data_${n}`]}},delete t[`data_${n}`])})),t}),Ws.object({type:Ws.literal("custom:frigate-card-ptz"),style:Ws.object({}).passthrough().optional(),orientation:Ws.enum(["vertical","horizontal"]).default("vertical").optional(),service:Ws.string().optional(),actions_left:Ru.optional(),actions_right:Ru.optional(),actions_up:Ru.optional(),actions_down:Ru.optional(),actions_zoom_in:Ru.optional(),actions_zoom_out:Ru.optional(),actions_home:Ru.optional()})),mh=Ws.union([oh,rh,ch,lh,uh,hh,Lu,Nu,Uu,Fu,Hu,Zu,Vu,Wu]).array().optional(),ph=Ws.object({fit:Ws.enum(["contain","cover","fill"]).optional(),position:Ws.object({x:Ws.number().min(0).max(100).optional(),y:Ws.number().min(0).max(100).optional()}).optional()}),fh={default:uu,camera_select:"current",timeout_seconds:300,update_seconds:0,update_force:!1,update_cycle_camera:!1,dark_mode:"off",scan:{enabled:!1,show_trigger_status:!0,untrigger_seconds:0,untrigger_reset:!0}},gh=Ws.object({default:Ws.enum(du).default(fh.default),camera_select:Ws.enum([...du,"current"]).default(fh.camera_select),timeout_seconds:Ws.number().default(fh.timeout_seconds),update_seconds:Ws.number().default(fh.update_seconds),update_force:Ws.boolean().default(fh.update_force),update_cycle_camera:Ws.boolean().default(fh.update_cycle_camera),update_entities:Ws.string().array().optional(),render_entities:Ws.string().array().optional(),dark_mode:Ws.enum(["on","off","auto"]).optional(),scan:Ws.object({enabled:Ws.boolean().default(fh.scan.enabled),show_trigger_status:Ws.boolean().default(fh.scan.show_trigger_status),untrigger_seconds:Ws.number().default(fh.scan.untrigger_seconds),untrigger_reset:Ws.boolean().default(fh.scan.untrigger_reset)}).default(fh.scan)}).merge(Du).default(fh),vh={mode:"url",zoomable:!0,...Bu},_h=Yu.extend({mode:Ws.enum(["screensaver","camera","url"]).default(vh.mode),layout:ph.optional(),zoomable:Ws.boolean().default(vh.zoomable)}).merge(Du).default(vh),yh={size:100,show_details:!0,show_favorite_control:!0,show_timeline_control:!0,show_download_control:!0},bh=Ws.object({size:Ws.number().min(75).max(cu).default(yh.size),show_details:Ws.boolean().default(yh.show_details),show_favorite_control:Ws.boolean().default(yh.show_favorite_control),show_timeline_control:Ws.boolean().default(yh.show_timeline_control),show_download_control:Ws.boolean().default(yh.show_download_control)}),wh={...yh,mode:"right"},xh=bh.extend({mode:Ws.enum(["none","above","below","left","right"]).default(wh.mode)}),Ch={clustering_threshold:3,media:"all",window_seconds:3600,show_recordings:!0,style:"stack"},$h=Ws.enum(["all","clips","snapshots"]),kh=Ws.object({clustering_threshold:Ws.number().optional().default(Ch.clustering_threshold),media:$h.optional().default(Ch.media),window_seconds:Ws.number().min(60).max(86400).optional().default(Ch.window_seconds),show_recordings:Ws.boolean().optional().default(Ch.show_recordings),style:Ws.enum(["stack","ribbon"]).optional().default(Ch.style)}),Eh={...Ch,mode:"none",style:"ribbon"},Mh=kh.extend({mode:Ws.enum(["none","above","below"]).default(Eh.mode),style:kh.shape.style.default(Eh.style)}),Sh=Ws.object({style:Ws.enum(["none","chevrons","icons","thumbnails"]),size:Ws.number().min(su)}),Th=Ws.enum(["none","slide"]),Ah=Ws.object({mode:Ws.enum(["none","popup-top-right","popup-top-left","popup-bottom-right","popup-bottom-left"]),duration_seconds:Ws.number().min(0).max(60)}),zh={auto_play:"all",auto_pause:"never",auto_mute:"all",auto_unmute:"never",preload:!1,lazy_load:!0,lazy_unload:"never",draggable:!0,zoomable:!0,transition_effect:"slide",show_image_during_load:!0,controls:{builtin:!0,next_previous:{size:48,style:"chevrons"},thumbnails:{...wh,media:"all"},timeline:Eh,title:{mode:"popup-bottom-right",duration_seconds:2}},microphone:{...Qu}},jh=xh.extend({media:Ws.enum(["all","clips","snapshots"]).default(zh.controls.thumbnails.media)}),Oh=Ws.object({controls:Ws.object({builtin:Ws.boolean().default(zh.controls.builtin),next_previous:Sh.extend({style:Ws.enum(["none","chevrons","icons"]).default(zh.controls.next_previous.style),size:Sh.shape.size.default(zh.controls.next_previous.size)}).default(zh.controls.next_previous),thumbnails:jh.default(zh.controls.thumbnails),timeline:Mh.default(zh.controls.timeline),title:Ah.extend({mode:Ah.shape.mode.default(zh.controls.title.mode),duration_seconds:Ah.shape.duration_seconds.default(zh.controls.title.duration_seconds)}).default(zh.controls.title)}).default(zh.controls),show_image_during_load:Ws.boolean().default(zh.show_image_during_load),layout:ph.optional(),microphone:Gu.default(zh.microphone),zoomable:Ws.boolean().default(zh.zoomable)}).merge(Du),Ih=Oh.extend({auto_play:Ws.enum(gu).default(zh.auto_play),auto_pause:Ws.enum(fu).default(zh.auto_pause),auto_mute:Ws.enum(fu).default(zh.auto_mute),auto_unmute:Ws.enum(gu).default(zh.auto_unmute),preload:Ws.boolean().default(zh.preload),lazy_load:Ws.boolean().default(zh.lazy_load),lazy_unload:Ws.enum(fu).default(zh.lazy_unload),draggable:Ws.boolean().default(zh.draggable),transition_effect:Th.default(zh.transition_effect)}).default(zh),Rh={priority:50,enabled:!0},Dh={priority:50,enabled:!1},Ph={style:"hidden",position:"top",alignment:"left",buttons:{frigate:Rh,cameras:Rh,substreams:Rh,live:Rh,clips:Rh,snapshots:Rh,image:Dh,timeline:Rh,download:Rh,camera_ui:Rh,fullscreen:Rh,expand:Dh,media_player:Rh,microphone:{...Dh,type:"momentary"},mute:Dh,play:Dh,recordings:Dh,screenshot:Dh},button_size:40},Lh=ah.extend({enabled:ah.shape.enabled.default(Rh.enabled),priority:ah.shape.priority.default(Rh.priority)}),Nh=ah.extend({enabled:ah.shape.enabled.default(Dh.enabled),priority:ah.shape.priority.default(Dh.priority)}),Uh=Ws.object({style:Ws.enum(["none","hidden","overlay","hover","hover-card","outside"]).default(Ph.style),position:Ws.enum(hu).default(Ph.position),alignment:Ws.enum(mu).default(Ph.alignment),buttons:Ws.object({frigate:Lh.default(Ph.buttons.frigate),cameras:Lh.default(Ph.buttons.cameras),substreams:Lh.default(Ph.buttons.substreams),live:Lh.default(Ph.buttons.live),clips:Lh.default(Ph.buttons.clips),snapshots:Lh.default(Ph.buttons.snapshots),image:Nh.default(Ph.buttons.image),timeline:Lh.default(Ph.buttons.timeline),download:Lh.default(Ph.buttons.download),camera_ui:Lh.default(Ph.buttons.camera_ui),fullscreen:Lh.default(Ph.buttons.fullscreen),expand:Nh.default(Ph.buttons.expand),media_player:Lh.default(Ph.buttons.media_player),microphone:Nh.extend({type:Ws.enum(["momentary","toggle"]).default(Ph.buttons.microphone.type)}).default(Ph.buttons.microphone),recordings:Nh.default(Ph.buttons.recordings),mute:Nh.default(Ph.buttons.mute),play:Nh.default(Ph.buttons.play),screenshot:Nh.default(Ph.buttons.screenshot)}).default(Ph.buttons),button_size:Ws.number().min(su).default(Ph.button_size)}).default(Ph),Fh={auto_play:"all",auto_pause:"all",auto_mute:"all",auto_unmute:"never",lazy_load:!0,draggable:!0,zoomable:!0,transition_effect:"slide",snapshot_click_plays_clip:!0,controls:{builtin:!0,next_previous:{size:48,style:"thumbnails"},thumbnails:wh,timeline:Eh,title:{mode:"popup-bottom-right",duration_seconds:2}}},Hh=Sh.extend({style:Ws.enum(["none","thumbnails","chevrons"]).default(Fh.controls.next_previous.style),size:Sh.shape.size.default(Fh.controls.next_previous.size)}),Zh=Ws.object({auto_play:Ws.enum(gu).default(Fh.auto_play),auto_pause:Ws.enum(fu).default(Fh.auto_pause),auto_mute:Ws.enum(fu).default(Fh.auto_mute),auto_unmute:Ws.enum(gu).default(Fh.auto_unmute),lazy_load:Ws.boolean().default(Fh.lazy_load),draggable:Ws.boolean().default(Fh.draggable),zoomable:Ws.boolean().default(Fh.zoomable),transition_effect:Th.default(Fh.transition_effect),snapshot_click_plays_clip:Ws.boolean().default(Fh.snapshot_click_plays_clip),controls:Ws.object({builtin:Ws.boolean().default(Fh.controls.builtin),next_previous:Hh.default(Fh.controls.next_previous),thumbnails:xh.default(Fh.controls.thumbnails),timeline:Mh.default(Fh.controls.timeline),title:Ah.extend({mode:Ah.shape.mode.default(Fh.controls.title.mode),duration_seconds:Ah.shape.duration_seconds.default(Fh.controls.title.duration_seconds)}).default(Fh.controls.title)}).default(Fh.controls),layout:ph.optional()}).merge(Du).default(Fh),qh={...wh,show_details:!1},Vh={controls:{thumbnails:qh,filter:{mode:"right"}}},Wh=xh.extend({show_details:Ws.boolean().default(qh.show_details)}),Bh=Ws.object({controls:Ws.object({thumbnails:Wh.default(Vh.controls.thumbnails),filter:Ws.object({mode:Ws.enum(["none","left","right"]).default(Vh.controls.filter.mode)}).default(Vh.controls.filter)}).default(Vh.controls)}).merge(Du).default(Vh),Yh={aspect_ratio_mode:"dynamic",aspect_ratio:[16,9],max_height:"100vh",min_height:"100px"},Qh=Ws.object({aspect_ratio_mode:Ws.enum(["dynamic","static","unconstrained"]).default(Yh.aspect_ratio_mode),aspect_ratio:Ws.number().array().length(2).or(Ws.string().regex(/^\s*\d+\s*[:\/]\s*\d+\s*$/).transform((e=>e.split(/[:\/]/).map((e=>Number(e)))))).default(Yh.aspect_ratio),max_height:Ws.string().default(Yh.max_height),min_height:Ws.string().default(Yh.min_height)}).default(Yh),Gh={...Ch,controls:{thumbnails:wh}},Kh=kh.extend({controls:Ws.object({thumbnails:xh.default(Gh.controls.thumbnails)}).default(Gh.controls)}).default(Gh),Xh=Ws.object({cameras:iu(ih).optional(),cameras_global:iu(nh).optional(),live:iu(Oh).optional(),menu:iu(Uh).optional(),image:iu(_h).optional(),view:iu(gh).optional(),dimensions:iu(Qh).optional()}),Jh=Ws.object({conditions:dh,overrides:Xh}).array().optional();Ws.object({conditions:dh,overrides:Oh}).array().optional();const em=Iu.array().optional(),tm=Ws.object({conditions:dh,actions:em,actions_not:em}).array().optional(),nm={profile:"high",features:{animated_progress_indicator:!0,media_chunk_size:50},style:{border_radius:!0,box_shadow:!0}},im=Ws.object({profile:Ws.enum(["low","high"]).default(nm.profile),features:Ws.object({animated_progress_indicator:Ws.boolean().default(nm.features.animated_progress_indicator),media_chunk_size:Ws.number().min(0).max(1e3).default(nm.features.media_chunk_size)}).default(nm.features),style:Ws.object({border_radius:Ws.boolean().default(nm.style.border_radius),box_shadow:Ws.boolean().default(nm.style.box_shadow)}).default(nm.style)}).default(nm),am={logging:!1},rm=Ws.object({logging:Ws.boolean().default(am.logging)}).default(am),om=Ws.object({cameras:iu(ih),cameras_global:nh,view:gh,menu:Uh,live:Ih,media_gallery:Bh,media_viewer:Zh,image:_h,elements:mh,dimensions:Qh,timeline:Kh,performance:im,debug:rm,automations:tm,overrides:Jh,card_mod:Ws.unknown(),card_id:Ws.string().regex(/^\w+$/).optional(),type:Ws.string(),test_gui:Ws.boolean().optional()}),sm={cameras:th,view:fh,menu:Ph,live:zh,media_gallery:Vh,media_viewer:Fh,image:vh,timeline:Gh,performance:nm,debug:am};Ws.discriminatedUnion("type",[rh,oh,ch,lh]);const cm={info:10,error:20,connection:30,diagnostics:40},lm=Ws.object({url:Ws.string(),mime_type:Ws.string()}),dm=Ws.object({path:Ws.string()});function um(e){if(!e)return null;const t=Ou.safeParse(e);return t.success?t.data:null}function hm(e,t){return"camera_select"===e||"live_substream_select"===e?t?.camera?{action:"fire-dom-event",frigate_card_action:e,camera:t.camera,...t.cardID&&{card_id:t.cardID}}:null:"media_player"===e?t?.media_player&&t.media_player_action?{action:"fire-dom-event",frigate_card_action:e,media_player:t.media_player,media_player_action:t.media_player_action,...t.cardID&&{card_id:t.cardID}}:null:{action:"fire-dom-event",frigate_card_action:e,...t?.cardID&&{card_id:t.cardID}}}function mm(e,t){if(e&&t)return"tap"==e&&t.tap_action?t.tap_action:"hold"==e&&t.hold_action?t.hold_action:"double_tap"==e&&t.double_tap_action?t.double_tap_action:"end_tap"==e&&t.end_tap_action?t.end_tap_action:"start_tap"==e&&t.start_tap_action?t.start_tap_action:void 0}const pm=(e,t,n,i,a)=>!(!a&&"tap"!=i)&&(fm(e,t,n,a),!0),fm=(e,t,n,i)=>{Array.isArray(i)?i.forEach((i=>h(e,t,n,i))):h(e,t,n,i)},gm=e=>Array.isArray(e)?!!e.find((e=>m(e))):m(e),vm=e=>{e.stopPropagation()};class _m{constructor(){this._timer=null}stop(){this._timer&&(window.clearTimeout(this._timer),this._timer=null)}isRunning(){return null!==this._timer}start(e,t){this.stop(),this._timer=window.setTimeout((()=>{this._timer=null,t()}),1e3*e)}startRepeated(e,t){this.stop(),this._timer=window.setInterval((()=>{t()}),1e3*e)}}class ym extends HTMLElement{constructor(){super(...arguments),this.holdTime=.4,this.holdTimer=new _m,this.doubleClickTimer=new _m,this.held=!1}connectedCallback(){["touchcancel","mouseout","mouseup","touchmove","mousewheel","wheel","scroll"].forEach((e=>{document.addEventListener(e,(()=>{this.holdTimer.stop()}),{passive:!0})}))}bind(e,t){if(e.actionHandlerOptions)return void(e.actionHandlerOptions=t);e.actionHandlerOptions=t,e.addEventListener("contextmenu",(e=>{const t=e||window.event;return t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0,t.returnValue=!1,!1}));const n=()=>{this.held=!1,this.holdTimer.start(this.holdTime,(()=>{this.held=!0})),l(e,"action",{action:"start_tap"})},i=t=>{const n=e.actionHandlerOptions;n?.allowPropagation||vm(t),["touchend","touchcancel"].includes(t.type)&&!this.held||(this.holdTimer.stop(),l(e,"action",{action:"end_tap"}),n?.hasHold&&this.held?l(e,"action",{action:"hold"}):n?.hasDoubleClick?"click"===t.type&&t.detail<2||!this.doubleClickTimer.isRunning()?this.doubleClickTimer.start(.25,(()=>l(e,"action",{action:"tap"}))):(this.doubleClickTimer.stop(),l(e,"action",{action:"double_tap"})):l(e,"action",{action:"tap"}))};e.addEventListener("touchstart",n,{passive:!0}),e.addEventListener("touchend",i),e.addEventListener("touchcancel",i),e.addEventListener("mousedown",n,{passive:!0}),e.addEventListener("click",i),e.addEventListener("keyup",(e=>{"Enter"===e.key&&i(e)}))}}customElements.define("action-handler-frigate-card",ym);const bm=(e,t)=>{const n=(()=>{const e=document.body;if(e.querySelector("action-handler-frigate-card"))return e.querySelector("action-handler-frigate-card");const t=document.createElement("action-handler-frigate-card");return e.appendChild(t),t})();n&&n.bind(e,t)},wm=$e(class extends ke{update(e,[t]){return bm(e.element,t),X}render(e){}});var xm={frigate_card:"Frigate card",frigate_card_description:"A Lovelace card for use with Frigate",live:"Live",no_media:"No media to display",recordings:"Recordings",version:"Version"},Cm={cameras:{camera_entity:"Camera Entity",dependencies:{all_cameras:"Show events for all cameras with this camera",cameras:"Show events for specific cameras with this camera",editor_label:"Dependency Options"},engines:{editor_label:"Camera engine options"},frigate:{camera_name:"Frigate camera name (Autodetected from entity)",client_id:"Frigate client id (For >1 Frigate server)",editor_label:"Frigate Options",labels:"Frigate labels/object filters",url:"Frigate server URL",zones:"Frigate zones"},go2rtc:{editor_label:"go2rtc Options",modes:{editor_label:"go2rtc Modes",mjpeg:"Motion JPEG (MJPEG)",mp4:"MPEG-4 (MP4)",mse:"Media Source Extensions (MSE)",webrtc:"Web Real-Time Communication (WebRTC)"},stream:"go2rtc stream name"},hide:"Hide camera from UI",icon:"Icon for this camera (Autodetected from entity)",id:"Unique id for this camera in this card",image:{editor_label:"Image Options",refresh_seconds:"Number of seconds after which to refresh live image (0=never)",url:"Image URL to use instead of camera entity snapshot"},live_provider:"Live view provider for this camera",live_provider_options:{editor_label:"Live provider options"},live_providers:{auto:"Automatic",go2rtc:"go2rtc",ha:"Home Assistant video stream (i.e. HLS, LL-HLS, WebRTC via HA)",image:"Home Assistant images",jsmpeg:"JSMpeg","webrtc-card":"WebRTC Card (i.e. AlexxIT's WebRTC Card)"},motioneye:{editor_label:"MotionEye Options",images:{directory_pattern:"Images directory pattern",file_pattern:"Images file pattern"},movies:{directory_pattern:"Movies directory pattern",file_pattern:"Movies file pattern"},url:"MotionEye UI URL"},title:"Title for this camera (Autodetected from entity)",triggers:{editor_label:"Trigger Options",entities:"Trigger from other entities",motion:"Trigger by auto-detecting the motion sensor",occupancy:"Trigger by auto-detecting the occupancy sensor"},webrtc_card:{editor_label:"WebRTC Card Options",entity:"WebRTC Card Camera Entity (Not a Frigate camera)",url:"WebRTC Card Camera URL"}},common:{controls:{builtin:"Built-in video controls",filter:{editor_label:"Media Filter",mode:"Filter mode",modes:{left:"Media filter in a drawer to the left",none:"No media filter",right:"Media filter in a drawer to the right"}},next_previous:{editor_label:"Next & Previous",size:"Next & previous control size in pixels",style:"Next & previous control style",styles:{chevrons:"Chevrons",icons:"Icons",none:"None",thumbnails:"Thumbnails"}},thumbnails:{editor_label:"Thumbnails",media:"Whether to show thumbnails of clips or snapshots",medias:{clips:"Clip thumbnails",snapshots:"Snapshot thumbnails"},mode:"Thumbnails mode",modes:{above:"Thumbnails above",below:"Thumbnails below",left:"Thumbnails in a drawer to the left",none:"No thumbnails",right:"Thumbnails in a drawer to the right"},show_details:"Show details with thumbnails",show_download_control:"Show download control on thumbnails",show_favorite_control:"Show favorite control on thumbnails",show_timeline_control:"Show timeline control on thumbnails",size:"Thumbnails size in pixels"},timeline:{editor_label:"Mini Timeline",mode:"Mode",modes:{above:"Above",below:"Below",none:"None"}},title:{duration_seconds:"Seconds to display popup title (0=forever)",editor_label:"Popup Title Controls",mode:"Popup title display mode",modes:{none:"No title display","popup-bottom-left":"Popup on the bottom left","popup-bottom-right":"Popup on the bottom right","popup-top-left":"Popup on the top left","popup-top-right":"Popup on the top right"}}},layout:{fit:"Layout fit",fits:{contain:"Media is contained/letterboxed",cover:"Media expands proportionally to cover the card",fill:"Media is stretched to fill the card"},position:{x:"Horizontal placement percentage",y:"Vertical placement percentage"}},media_action_conditions:{all:"All opportunities",hidden:"On browser/tab hiding",never:"Never",selected:"On selection",unselected:"On unselection",visible:"On browser/tab visibility"},timeline:{clustering_threshold:"The count of events at which they are clustered (0=no clustering)",media:"The media the timeline displays",medias:{all:"All media types",clips:"Clips",snapshots:"Snapshots"},show_recordings:"Show recordings",style:"Timeline style",styles:{ribbon:"Events on a single ribbon",stack:"Stacked & clustered events"},window_seconds:"The default length of the timeline view in seconds"}},dimensions:{aspect_ratio:"Default aspect ratio (e.g. '16:9')",aspect_ratio_mode:"Aspect ratio mode",aspect_ratio_modes:{dynamic:"Aspect ratio adjusts to media",static:"Static aspect ratio",unconstrained:"Unconstrained aspect ratio"},max_height:"Maximum card height in CSS units (e.g. '100vh')",min_height:"Minimum card height in CSS units (e.g. '100px')"},image:{layout:"Image Layout",mode:"Image view mode",modes:{camera:"Home Assistant camera snapshot of camera entity",screensaver:"Embedded Frigate logo",url:"Arbitrary image specified by URL"},refresh_seconds:"Number of seconds after which to refresh (0=never)",url:"Static image URL for image view",zoomable:"Image can be zoomed/panned"},live:{auto_mute:"Automatically mute live cameras",auto_pause:"Automatically pause live cameras",auto_play:"Automatically play live cameras",auto_unmute:"Automatically unmute live cameras",controls:{editor_label:"Live Controls"},draggable:"Live cameras view can be dragged/swiped",layout:"Live Layout",lazy_load:"Live cameras are lazily loaded",lazy_unload:"Live cameras are lazily unloaded",microphone:{always_connected:"Always keep the microphone connected",disconnect_seconds:"Seconds after which to disconnect microphone (0=never)",editor_label:"Microphone",enabled:"Microphone enabled"},preload:"Preload live view in the background",show_image_during_load:"Show still image while the live stream is loading",transition_effect:"Live camera transition effect",zoomable:"Live cameras can be zoomed/panned"},media_viewer:{auto_mute:"Automatically mute media",auto_pause:"Automatically pause media",auto_play:"Automatically play media",auto_unmute:"Automatically unmute media",controls:{editor_label:"Media Viewer Controls"},draggable:"Media Viewer can be dragged/swiped",layout:"Media Viewer Layout",lazy_load:"Media Viewer media is lazily loaded in carousel",snapshot_click_plays_clip:"Clicking on a snapshot plays a related clip",transition_effect:"Media Viewer transition effect",transition_effects:{none:"No transition",slide:"Slide transition"},zoomable:"Media Viewer can be zoomed/panned"},menu:{alignment:"Menu alignment",alignments:{bottom:"Aligned to the bottom",left:"Aligned to the left",right:"Aligned to the right",top:"Aligned to the top"},button_size:"Menu button size in pixels",buttons:{alignment:"Button alignment",alignments:{matching:"Matching the menu alignment",opposing:"Opposing the menu alignment"},camera_ui:"Camera user interface",cameras:"Cameras",clips:"Clips",download:"Download",enabled:"Button enabled",expand:"Expand",frigate:"Frigate menu / Default view",fullscreen:"Fullscreen",icon:"Icon",image:"Image",live:"Live",media_player:"Send to media player",microphone:"Microphone",mute:"Mute / Unmute",play:"Play / Pause",priority:"Priority",recordings:"Recordings",screenshot:"Screenshot",snapshots:"Snapshots",substreams:"Substream(s)",timeline:"Timeline",type:"Button type",types:{momentary:"Momentary",toggle:"Toggle"}},position:"Menu position",positions:{bottom:"Positioned on the bottom",left:"Positioned on the left",right:"Positioned on the right",top:"Positioned on the top"},style:"Menu style",styles:{hidden:"Hidden menu",hover:"Hover menu","hover-card":"Hover menu (card-wide)",none:"No menu",outside:"Outside menu",overlay:"Overlay menu"}},overrides:{info:"This card configuration has manually specified overrides configured which may override values shown in the visual editor, please consult the code editor to view/modify these overrides"},performance:{features:{animated_progress_indicator:"Animated Progress Indicator",editor_label:"Feature Options",media_chunk_size:"Media chunk size"},profile:"Performance profile",profiles:{high:"High/full performance",low:"Low performance"},style:{border_radius:"Curves",box_shadow:"Shadows",editor_label:"Style Options"},warning:"This card is in low profile mode so defaults have changed to optimize performance"},view:{camera_select:"View for newly selected cameras",dark_mode:"Dark mode",dark_modes:{auto:"Auto",off:"Off",on:"On"},default:"Default view",scan:{enabled:"Scan mode enabled",scan_mode:"Scan mode",show_trigger_status:"Show pulsing border when triggered",untrigger_reset:"Reset the view to default after untrigger",untrigger_seconds:"Seconds after inactive state change to untrigger"},timeout_seconds:"Reset to default view X seconds after user action (0=never)",update_cycle_camera:"Cycle through cameras when default view updates",update_force:"Force card updates (ignore user interaction)",update_seconds:"Refresh default view every X seconds (0=never)",views:{clip:"Most recent clip",clips:"Clips gallery",current:"Current view",image:"Static image",live:"Live view",recording:"Most recent recording",recordings:"Recordings gallery",snapshot:"Most recent snapshot",snapshots:"Snapshots gallery",timeline:"Timeline view"}}},$m={add_new_camera:"Add new camera",button:"Button",camera:"Camera",cameras:"Cameras",cameras_secondary:"What cameras to render on this card",delete:"Delete",dimensions:"Dimensions",dimensions_secondary:"Dimensions & shape options",image:"Image",image_secondary:"Static image view options",live:"Live",live_secondary:"Live camera view options",media_gallery:"Media gallery",media_gallery_secondary:"Media gallery options",media_viewer:"Media viewer",media_viewer_secondary:"Viewer for static media (clips, snapshots or recordings)",menu:"Menu",menu_secondary:"Menu look & feel options",move_down:"Move down",move_up:"Move up",overrides:"Overrides are active",overrides_secondary:"Dynamic configuration overrides detected",performance:"Performance",performance_secondary:"Card performance options",timeline:"Timeline",timeline_secondary:"Event timeline options",upgrade:"Upgrade",upgrade_available:"An automatic card configuration upgrade is available",view:"View",view_secondary:"What the card should show and how to show it"},km={ptz:{down:"Down",home:"Home",left:"Left",right:"Right",up:"Up",zoom_in:"Zoom In",zoom_out:"Zoom Out"}},Em={could_not_render_elements:"Could not render picture elements",could_not_resolve:"Could not resolve media URL",diagnostics:"Card diagnostics. Please review for confidential information prior to sharing",download_no_media:"No media to download",download_sign_failed:"Could not sign media URL for download",duplicate_camera_id:"Duplicate Frigate camera id for the following camera, use the 'id' parameter to uniquely identify cameras",empty_response:"Received empty response from Home Assistant for request",failed_response:"Failed to receive response from Home Assistant for request",failed_retain:"Could not retain event",failed_sign:"Could not sign Home Assistant URL",image_load_error:"The image could not be loaded",invalid_configuration:"Invalid configuration",invalid_configuration_no_hint:"No location hint available (bad or missing type?)",invalid_elements_config:"Invalid picture elements configuration",invalid_response:"Received invalid response from Home Assistant for request",jsmpeg_no_player:"Could not start JSMPEG player",live_camera_no_endpoint:"Could not get camera endpoint for this live provider (incomplete configuration?)",live_camera_not_found:"The configured camera_entity was not found",live_camera_unavailable:"Camera unavailable",no_camera_engine:"Could not determine suitable engine for camera",no_camera_entity:"Could not find camera entity",no_camera_entity_for_triggers:"A camera entity is required in order to autodetect triggers",no_camera_id:"Could not determine camera id for the following camera, may need to set 'id' parameter manually",no_camera_name:"Could not determine a Frigate camera name for camera (or one of its dependents), please specify either 'camera_entity' or 'camera_name'",no_live_camera:"The camera_entity parameter must be set and valid for this live provider",no_visible_cameras:"No visible cameras found, you must configure at least one non-hidden camera",reconnecting:"Reconnecting",timeline_no_cameras:"No Frigate cameras to show in timeline",too_many_automations:"Too many nested automation calls, please check your configuration for loops",troubleshooting:"Check troubleshooting",unknown:"Unknown error",upgrade_available:"An automated card configuration upgrade is available, please visit the visual card editor",webrtc_card_reported_error:"WebRTC Card reported an error",webrtc_card_waiting:"Waiting for WebRTC Card to load ..."},Mm={camera:"Camera",duration:"Duration",in_progress:"In Progress",score:"Score",seek:"Seek",start:"Start",tag:"Tag",what:"What",where:"Where"},Sm={all:"All",camera:"Camera",favorite:"Favorite",media_type:"Media Type",media_types:{clips:"Clips",recordings:"Recordings",snapshots:"Snapshots"},not_favorite:"Not Favorite",select_camera:"Select camera...",select_favorite:"Select favorite...",select_media_type:"Select media type...",select_tag:"Select tag...",select_what:"Select what...",select_when:"Select when...",select_where:"Select where...",tag:"Tag",what:"What",when:"When",whens:{past_month:"Past Month",past_week:"Past Week",today:"Today",yesterday:"Yesterday"},where:"Where"},Tm={camera:"Camera",duration:"Duration",events:"Events",in_progress:"In Progress",seek:"Seek",start:"Start"},Am={download:"Download media",no_thumbnail:"No thumbnail available",retain_indefinitely:"Media will be indefinitely retained",timeline:"See media in timeline"},zm={pan_behavior:{pan:"Pan",seek:"Pan seeks across all media","seek-in-media":"Pan seeks within selected media item only"},select_date:"Choose date"},jm={common:xm,config:Cm,editor:$m,elements:km,error:Em,event:Mm,media_filter:Sm,recording:Tm,thumbnail:Am,timeline:zm};const Om="en",Im={[Om]:Object.freeze({__proto__:null,common:xm,config:Cm,editor:$m,elements:km,error:Em,event:Mm,media_filter:Sm,recording:Tm,thumbnail:Am,timeline:zm,default:jm})};let Rm;function Dm(e){const t=e=>e.replace("-","_"),n=e?.language??e?.selectedLanguage;if(n)return t(n);const i=localStorage.getItem("selectedLanguage");if(i){const e=JSON.parse(i);if(e)return t(e)}for(const e of navigator.languages){const n=t(e);if(n&&n in Im)return n}return Om}function Pm(e,t="",n=""){let i="";try{i=e.split(".").reduce(((e,t)=>e[t]),Im[Rm??Om])}catch(e){}return i||(i=e.split(".").reduce(((e,t)=>e[t]),Im[Om])),""!==t&&""!==n&&(i=i.replace(t,n)),i}class Lm extends vu{}class Nm{constructor(e){this._priorEvaluations=new Map,this._nestedAutomationExecutions=0,this._automations=e}execute(e,t,n){const i=[];for(const e of this._automations??[]){const t=n.evaluateCondition(e.conditions),a=t?e.actions:e.actions_not,r=this._priorEvaluations.get(e);this._priorEvaluations.set(e,t),t!==r&&a&&i.push(a)}if(++this._nestedAutomationExecutions,this._nestedAutomationExecutions>10)throw new Lm(Pm("error.too_many_automations"));i.forEach((n=>{fm(e,t,{},n)})),--this._nestedAutomationExecutions}}function Um(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function Fm(e,t){if(t.length1?"s":"")+" required, but only "+t.length+" present")}function Hm(e){return Hm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hm(e)}function Zm(e){Fm(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===Hm(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function qm(e,t){Fm(2,arguments);var n=Zm(e),i=Um(t);return isNaN(i)?new Date(NaN):i?(n.setDate(n.getDate()+i),n):n}function Vm(e,t){Fm(2,arguments);var n=Zm(e),i=Um(t);if(isNaN(i))return new Date(NaN);if(!i)return n;var a=n.getDate(),r=new Date(n.getTime());return r.setMonth(n.getMonth()+i+1,0),a>=r.getDate()?r:(n.setFullYear(r.getFullYear(),r.getMonth(),a),n)}function Wm(e){return Wm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wm(e)}function Bm(e,t){if(Fm(2,arguments),!t||"object"!==Wm(t))return new Date(NaN);var n=t.years?Um(t.years):0,i=t.months?Um(t.months):0,a=t.weeks?Um(t.weeks):0,r=t.days?Um(t.days):0,o=t.hours?Um(t.hours):0,s=t.minutes?Um(t.minutes):0,c=t.seconds?Um(t.seconds):0,l=Zm(e),d=i||n?Vm(l,i+12*n):l,u=r||a?qm(d,r+7*a):d,h=1e3*(c+60*(s+60*o));return new Date(u.getTime()+h)}const Ym=(e,t)=>0!=((e.attributes.supported_features??0)&t),Qm=e=>(e=>Ym(e,4)&&"number"==typeof e.attributes.in_progress)(e)||!!e.attributes.in_progress,Gm=e=>{switch(e){case"armed_away":return"mdi:shield-lock";case"armed_vacation":return"mdi:shield-airplane";case"armed_home":return"mdi:shield-home";case"armed_night":return"mdi:shield-moon";case"armed_custom_bypass":return"mdi:security";case"pending":case"arming":return"mdi:shield-sync";case"triggered":return"mdi:bell-ring";case"disarmed":return"mdi:shield-off";default:return"mdi:shield"}},Km=(e,t)=>{const n="off"===e;switch(t?.attributes.device_class){case"battery":return n?"mdi:battery":"mdi:battery-outline";case"battery_charging":return n?"mdi:battery":"mdi:battery-charging";case"cold":return n?"mdi:thermometer":"mdi:snowflake";case"connectivity":return n?"mdi:close-network-outline":"mdi:check-network-outline";case"door":return n?"mdi:door-closed":"mdi:door-open";case"garage_door":return n?"mdi:garage":"mdi:garage-open";case"power":case"plug":return n?"mdi:power-plug-off":"mdi:power-plug";case"gas":case"problem":case"safety":case"tamper":return n?"mdi:check-circle":"mdi:alert-circle";case"smoke":return n?"mdi:check-circle":"mdi:smoke";case"heat":return n?"mdi:thermometer":"mdi:fire";case"light":return n?"mdi:brightness5":"mdi:brightness-7";case"lock":return n?"mdi:lock":"mdi:lock-open";case"moisture":return n?"mdi:water-off":"mdi:water";case"motion":return n?"mdi:motion-sensor-off":"mdi:motion-sensor";case"occupancy":case"presence":return n?"mdi:home-outline":"mdi:home";case"opening":return n?"mdi:square":"mdi:square-outline";case"running":return n?"mdi:stop":"mdi:play";case"sound":return n?"mdi:music-note-off":"mdi:music-note";case"update":return n?"mdi:package":"mdi:package-up";case"vibration":return n?"mdi:crop-portrait":"mdi:vibrate";case"window":return n?"mdi:window-closed":"mdi:window-open";default:return n?"mdi:radiobox-blank":"mdi:checkbox-marked-circle"}},Xm=(e,t)=>{const n="closed"!==e;switch(t?.attributes.device_class){case"garage":switch(e){case"opening":return"mdi:arrow-up-box";case"closing":return"mdi:arrow-down-box";case"closed":return"mdi:garage";default:return"mdi:garage-open"}case"gate":switch(e){case"opening":case"closing":return"mdi:gate-arrow-right";case"closed":return"mdi:gate";default:return"mdi:gate-open"}case"door":return n?"mdi:door-open":"mdi:door-closed";case"damper":return n?"md:circle":"mdi:circle-slice-8";case"shutter":switch(e){case"opening":return"mdi:arrow-up-box";case"closing":return"mdi:arrow-down-box";case"closed":return"mdi:window-shutter";default:return"mdi:window-shutter-open"}case"curtain":switch(e){case"opening":return"mdi:arrow-split-vertical";case"closing":return"mdi:arrow-collapse-horizontal";case"closed":return"mdi:curtains-closed";default:return"mdi:curtains"}case"blind":case"shade":switch(e){case"opening":return"mdi:arrow-up-box";case"closing":return"mdi:arrow-down-box";case"closed":return"mdi:blinds";default:return"mdi:blinds-open"}case"window":switch(e){case"opening":return"mdi:arrow-up-box";case"closing":return"mdi:arrow-down-box";case"closed":return"mdi:window-closed";default:return"mdi:window-open"}}switch(e){case"opening":return"mdi:arrow-up-box";case"closing":return"mdi:arrow-down-box";case"closed":return"mdi:window-closed";default:return"mdi:window-open"}},Jm={apparent_power:"mdi:flash",aqi:"mdi:air-filter",carbon_dioxide:"mdi:molecule-co2",carbon_monoxide:"mdi:molecule-co",current:"mdi:current-ac",date:"mdi:calendar",energy:"mdi:lightning-bolt",frequency:"mdi:sine-wave",gas:"mdi:gas-cylinder",humidity:"mdi:water-percent",illuminance:"mdi:brightness-5",monetary:"mdi:cash",nitrogen_dioxide:"mdi:molecule",nitrogen_monoxide:"mdi:molecule",nitrous_oxide:"mdi:molecule",ozone:"mdi:molecule",pm1:"mdi:molecule",pm10:"mdi:molecule",pm25:"mdi:molecule",power:"mdi:flash",power_factor:"mdi:angle-acute",pressure:"mdi:gauge",reactive_power:"mdi:flash",signal_strength:"mdi:wifi",sulphur_dioxide:"mdi:molecule",temperature:"mdi:thermometer",timestamp:"mdi:clock",volatile_organic_compounds:"mdi:molecule",voltage:"mdi:sine-wave"},ep={10:"mdi:battery-10",20:"mdi:battery-20",30:"mdi:battery-30",40:"mdi:battery-40",50:"mdi:battery-50",60:"mdi:battery-60",70:"mdi:battery-70",80:"mdi:battery-80",90:"mdi:battery-90",100:"mdi:battery"},tp={10:"mdi:battery-charging-10",20:"mdi:battery-charging-20",30:"mdi:battery-charging-30",40:"mdi:battery-charging-40",50:"mdi:battery-charging-50",60:"mdi:battery-charging-60",70:"mdi:battery-charging-70",80:"mdi:battery-charging-80",90:"mdi:battery-charging-90",100:"mdi:battery-charging"},np=(e,t)=>{const n=Number(e);if(isNaN(n))return"off"===e?"mdi:battery":"on"===e?"mdi:battery-alert":"mdi:battery-unknown";const i=10*Math.round(n/10);return t&&n>=10?tp[i]:t?"mdi:battery-charging-outline":n<=5?"mdi:battery-alert-variant-outline":ep[i]},ip=e=>{const t=e?.attributes.device_class;if(t&&t in Jm)return Jm[t];if("battery"===t)return e?((e,t)=>{const n=e.state;return np(n,"on"===t?.state)})(e):"mdi:battery";const n=e?.attributes.unit_of_measurement;return"°C"===n||"°F"===n?"mdi:thermometer":void 0},ap="mdi:bookmark",rp={alert:"mdi:alert",air_quality:"mdi:air-filter",automation:"mdi:robot",calendar:"mdi:calendar",camera:"mdi:video",climate:"mdi:thermostat",configurator:"mdi:cog",conversation:"mdi:text-to-speech",counter:"mdi:counter",fan:"mdi:fan",google_assistant:"mdi:google-assistant",group:"mdi:google-circles-communities",homeassistant:"mdi:home-assistant",homekit:"mdi:home-automation",image_processing:"mdi:image-filter-frames",input_button:"mdi:gesture-tap-button",input_datetime:"mdi:calendar-clock",input_number:"mdi:ray-vertex",input_select:"mdi:format-list-bulleted",input_text:"mdi:form-textbox",light:"mdi:lightbulb",mailbox:"mdi:mailbox",notify:"mdi:comment-alert",number:"mdi:ray-vertex",persistent_notification:"mdi:bell",person:"mdi:account",plant:"mdi:flower",proximity:"mdi:apple-safari",remote:"mdi:remote",scene:"mdi:palette",script:"mdi:script-text",select:"mdi:format-list-bulleted",sensor:"mdi:eye",siren:"mdi:bullhorn",simple_alarm:"mdi:bell",sun:"mdi:white-balance-sunny",timer:"mdi:timer-outline",updater:"mdi:cloud-upload",vacuum:"mdi:robot-vacuum",water_heater:"mdi:thermometer",weather:"mdi:weather-cloudy",zone:"mdi:map-marker-radius"};function op(e,t,n){switch(e){case"alarm_control_panel":return Gm(n);case"binary_sensor":return Km(n,t);case"button":switch(t?.attributes.device_class){case"restart":return"mdi:restart";case"update":return"mdi:package-up";default:return"mdi:gesture-tap-button"}case"cover":return Xm(n,t);case"device_tracker":return"router"===t?.attributes.source_type?"home"===n?"mdi:lan-connect":"mdi:lan-disconnect":["bluetooth","bluetooth_le"].includes(t?.attributes.source_type)?"home"===n?"mdi:bluetooth-connect":"mdi:bluetooth":"not_home"===n?"mdi:account-arrow-right":"mdi:account";case"humidifier":return n&&"off"===n?"mdi:air-humidifier-off":"mdi:air-humidifier";case"input_boolean":return"on"===n?"mdi:check-circle-outline":"mdi:close-circle-outline";case"lock":switch(n){case"unlocked":return"mdi:lock-open";case"jammed":return"mdi:lock-alert";case"locking":case"unlocking":return"mdi:lock-clock";default:return"mdi:lock"}case"media_player":switch(t?.attributes.device_class){case"speaker":switch(n){case"playing":return"mdi:speaker-play";case"paused":return"mdi:speaker-pause";case"off":return"mdi:speaker-off";default:return"mdi:speaker"}case"tv":switch(n){case"playing":return"mdi:television-play";case"paused":return"mdi:television-pause";case"off":return"mdi:television-off";default:return"mdi:television"}default:switch(n){case"playing":case"paused":return"mdi:cast-connected";case"off":return"mdi:cast-off";default:return"mdi:cast"}}case"switch":switch(t?.attributes.device_class){case"outlet":return"on"===n?"mdi:power-plug":"mdi:power-plug-off";case"switch":return"on"===n?"mdi:toggle-switch":"mdi:toggle-switch-off";default:return"mdi:flash"}case"zwave":switch(n){case"dead":return"mdi:emoticon-dead";case"sleeping":return"mdi:sleep";case"initializing":return"mdi:timer-sand";default:return"mdi:z-wave"}case"sensor":{const e=ip(t);if(e)return e;break}case"input_datetime":if(!t?.attributes.has_date)return"mdi:clock";if(!t.attributes.has_time)return"mdi:calendar";break;case"sun":return"above_horizon"===t?.state?rp[e]:"mdi:weather-night";case"update":return"on"===t?.state?Qm(t)?"mdi:package-down":"mdi:package-up":"mdi:package"}return e in rp?rp[e]:(console.warn(`Unable to find icon for domain: ${e}`),ap)}function sp(e){if(!e)return ap;if(e.attributes.icon)return e.attributes.icon;return op(s(e.entity_id),e,e.state)}async function cp(e,t,n,i=!1){let a;try{a=await e.callWS(n)}catch(e){if(!(e instanceof Error))throw new vu(Pm("error.failed_response"),{request:n,response:e});throw e}if(!a)throw new vu(Pm("error.empty_response"),{request:n});const r=i?t.safeParse(JSON.parse(a)):t.safeParse(a);if(!r.success)throw new vu(Pm("error.invalid_response"),{request:n,response:a,invalid_keys:au(r.error)});return r.data}async function lp(e,t,n){const i={type:"auth/sign_path",path:t,expires:n},a=await cp(e,dm,i);return a?e.hassUrl(a.path):null}function dp(e,t,n,i){if(!e||!n||!n.length)return[];const a=[];for(const r of n){const n=t?.states[r],o=e.states[r];if((i?.stateOnly&&n?.state!==o?.state||!i?.stateOnly&&n!==o)&&(a.push({entity:r,oldState:n,newState:o}),i?.firstOnly))break}return a}function up(e,t,n,i){return!!dp(e,t,n,{...i,firstOnly:!0}).length}function hp(e){if("off"===e.state||!e.attributes.brightness)return"";return`brightness(${(e.attributes.brightness+245)/5}%)`}function mp(e){return"off"===e.state?"":e.attributes.rgb_color?`rgb(${e.attributes.rgb_color.join(",")})`:""}function pp(e){return{color:mp(e),filter:hp(e)}}const fp=e=>{const t=e.entity_id.split(".")[0];let n=e.state;return"climate"===t&&(n=e.attributes.hvac_action),n};function gp(e,t){if(!t.entity)return t;const n=e.states[t.entity];n&&t.state_color&&(t.style={...pp(n),...t.style}),t.title=t.title??(n?.attributes?.friendly_name||t.entity),t.icon=t.icon??sp(n);const i=n?function(e){return s(e.entity_id)}(n):void 0;return t.data_domain=t.state_color||"light"===i&&!1!==t.state_color?i:void 0,n&&(t.data_state=fp(n)),t}function vp(e,t){return t?e?.states[t]?.attributes?.friendly_name:void 0}function _p(e,t){return sp(t?e?.states[t]:null)}const yp=async()=>{if(["ha-selector","ha-menu-button","ha-camera-stream","ha-hls-player","ha-web-rtc-player","ha-icon","ha-circular-progress","ha-icon-button","ha-card","ha-svg-icon","ha-button-menu"].every((e=>customElements.get(e))))return!0;const e=await window.loadCardHelpers(),t=await e.createCardElement({type:"picture-glance",entities:[],camera_image:"dummy-to-load-editor-components"});return!!t.constructor.getConfigElement&&(await t.constructor.getConfigElement(),!0)},bp=e=>!!e&&["on","open"].includes(e.state),wp=(e,t)=>{if(!e)return[];const n=Object.keys(e.states).filter((e=>!t||e.substr(0,e.indexOf("."))===t));return n.sort(),n};function xp(e,t){return e&&t&&t.startsWith("/")?e.hassUrl(t):t??null}var Cp=6e4,$p=36e5,kp=1e3;function Ep(e,t){return Fm(2,arguments),Zm(e).getTime()-Zm(t).getTime()}var Mp={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},Sp="trunc";function Tp(e){return e?Mp[e]:Mp[Sp]}function Ap(e,t,n){Fm(2,arguments);var i=Ep(e,t)/1e3;return Tp(null==n?void 0:n.roundingMethod)(i)}function zp(e){return zp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zp(e)}function jp(e){if(Fm(1,arguments),!function(e){return Fm(1,arguments),e instanceof Date||"object"===zp(e)&&"[object Date]"===Object.prototype.toString.call(e)}(e)&&"number"!=typeof e)return!1;var t=Zm(e);return!isNaN(Number(t))}function Op(e,t){return Fm(2,arguments),function(e,t){Fm(2,arguments);var n=Zm(e).getTime(),i=Um(t);return new Date(n+i)}(e,-Um(t))}var Ip=864e5;function Rp(e){Fm(1,arguments);var t=Zm(e),n=t.getUTCDay(),i=(n<1?7:0)+n-1;return t.setUTCDate(t.getUTCDate()-i),t.setUTCHours(0,0,0,0),t}function Dp(e){Fm(1,arguments);var t=Zm(e),n=t.getUTCFullYear(),i=new Date(0);i.setUTCFullYear(n+1,0,4),i.setUTCHours(0,0,0,0);var a=Rp(i),r=new Date(0);r.setUTCFullYear(n,0,4),r.setUTCHours(0,0,0,0);var o=Rp(r);return t.getTime()>=a.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}var Pp=6048e5;function Lp(e){Fm(1,arguments);var t=Zm(e),n=Rp(t).getTime()-function(e){Fm(1,arguments);var t=Dp(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),Rp(n)}(t).getTime();return Math.round(n/Pp)+1}var Np={};function Up(){return Np}function Fp(e,t){var n,i,a,r,o,s,c,l;Fm(1,arguments);var d=Up(),u=Um(null!==(n=null!==(i=null!==(a=null!==(r=null==t?void 0:t.weekStartsOn)&&void 0!==r?r:null==t||null===(o=t.locale)||void 0===o||null===(s=o.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==a?a:d.weekStartsOn)&&void 0!==i?i:null===(c=d.locale)||void 0===c||null===(l=c.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==n?n:0);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=Zm(e),m=h.getUTCDay(),p=(m=1&&m<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(u+1,0,m),p.setUTCHours(0,0,0,0);var f=Fp(p,t),g=new Date(0);g.setUTCFullYear(u,0,m),g.setUTCHours(0,0,0,0);var v=Fp(g,t);return d.getTime()>=f.getTime()?u+1:d.getTime()>=v.getTime()?u:u-1}var Zp=6048e5;function qp(e,t){Fm(1,arguments);var n=Zm(e),i=Fp(n,t).getTime()-function(e,t){var n,i,a,r,o,s,c,l;Fm(1,arguments);var d=Up(),u=Um(null!==(n=null!==(i=null!==(a=null!==(r=null==t?void 0:t.firstWeekContainsDate)&&void 0!==r?r:null==t||null===(o=t.locale)||void 0===o||null===(s=o.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==a?a:d.firstWeekContainsDate)&&void 0!==i?i:null===(c=d.locale)||void 0===c||null===(l=c.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==n?n:1),h=Hp(e,t),m=new Date(0);return m.setUTCFullYear(h,0,u),m.setUTCHours(0,0,0,0),Fp(m,t)}(n,t).getTime();return Math.round(i/Zp)+1}function Vp(e,t){for(var n=e<0?"-":"",i=Math.abs(e).toString();i.length0?n:1-n;return Vp("yy"===t?i%100:i,t.length)},Bp=function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):Vp(n+1,2)},Yp=function(e,t){return Vp(e.getUTCDate(),t.length)},Qp=function(e,t){return Vp(e.getUTCHours()%12||12,t.length)},Gp=function(e,t){return Vp(e.getUTCHours(),t.length)},Kp=function(e,t){return Vp(e.getUTCMinutes(),t.length)},Xp=function(e,t){return Vp(e.getUTCSeconds(),t.length)},Jp=function(e,t){var n=t.length,i=e.getUTCMilliseconds();return Vp(Math.floor(i*Math.pow(10,n-3)),t.length)},ef="midnight",tf="noon",nf="morning",af="afternoon",rf="evening",of="night",sf={G:function(e,t,n){var i=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var i=e.getUTCFullYear(),a=i>0?i:1-i;return n.ordinalNumber(a,{unit:"year"})}return Wp(e,t)},Y:function(e,t,n,i){var a=Hp(e,i),r=a>0?a:1-a;return"YY"===t?Vp(r%100,2):"Yo"===t?n.ordinalNumber(r,{unit:"year"}):Vp(r,t.length)},R:function(e,t){return Vp(Dp(e),t.length)},u:function(e,t){return Vp(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Vp(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Vp(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){var i=e.getUTCMonth();switch(t){case"M":case"MM":return Bp(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){var i=e.getUTCMonth();switch(t){case"L":return String(i+1);case"LL":return Vp(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){var a=qp(e,i);return"wo"===t?n.ordinalNumber(a,{unit:"week"}):Vp(a,t.length)},I:function(e,t,n){var i=Lp(e);return"Io"===t?n.ordinalNumber(i,{unit:"week"}):Vp(i,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):Yp(e,t)},D:function(e,t,n){var i=function(e){Fm(1,arguments);var t=Zm(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var i=n-t.getTime();return Math.floor(i/Ip)+1}(e);return"Do"===t?n.ordinalNumber(i,{unit:"dayOfYear"}):Vp(i,t.length)},E:function(e,t,n){var i=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){var a=e.getUTCDay(),r=(a-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return Vp(r,2);case"eo":return n.ordinalNumber(r,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){var a=e.getUTCDay(),r=(a-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return Vp(r,t.length);case"co":return n.ordinalNumber(r,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){var i=e.getUTCDay(),a=0===i?7:i;switch(t){case"i":return String(a);case"ii":return Vp(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){var i=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){var i,a=e.getUTCHours();switch(i=12===a?tf:0===a?ef:a/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){var i,a=e.getUTCHours();switch(i=a>=17?rf:a>=12?af:a>=4?nf:of,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var i=e.getUTCHours()%12;return 0===i&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Qp(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):Gp(e,t)},K:function(e,t,n){var i=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(i,{unit:"hour"}):Vp(i,t.length)},k:function(e,t,n){var i=e.getUTCHours();return 0===i&&(i=24),"ko"===t?n.ordinalNumber(i,{unit:"hour"}):Vp(i,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):Kp(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):Xp(e,t)},S:function(e,t){return Jp(e,t)},X:function(e,t,n,i){var a=(i._originalDate||e).getTimezoneOffset();if(0===a)return"Z";switch(t){case"X":return lf(a);case"XXXX":case"XX":return df(a);default:return df(a,":")}},x:function(e,t,n,i){var a=(i._originalDate||e).getTimezoneOffset();switch(t){case"x":return lf(a);case"xxxx":case"xx":return df(a);default:return df(a,":")}},O:function(e,t,n,i){var a=(i._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+cf(a,":");default:return"GMT"+df(a,":")}},z:function(e,t,n,i){var a=(i._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+cf(a,":");default:return"GMT"+df(a,":")}},t:function(e,t,n,i){var a=i._originalDate||e;return Vp(Math.floor(a.getTime()/1e3),t.length)},T:function(e,t,n,i){return Vp((i._originalDate||e).getTime(),t.length)}};function cf(e,t){var n=e>0?"-":"+",i=Math.abs(e),a=Math.floor(i/60),r=i%60;if(0===r)return n+String(a);var o=t||"";return n+String(a)+o+Vp(r,2)}function lf(e,t){return e%60==0?(e>0?"-":"+")+Vp(Math.abs(e)/60,2):df(e,t)}function df(e,t){var n=t||"",i=e>0?"-":"+",a=Math.abs(e);return i+Vp(Math.floor(a/60),2)+n+Vp(a%60,2)}var uf=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},hf=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},mf={p:hf,P:function(e,t){var n,i=e.match(/(P+)(p+)?/)||[],a=i[1],r=i[2];if(!r)return uf(e,t);switch(a){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",uf(a,t)).replace("{{time}}",hf(r,t))}};function pf(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}var ff=["D","DD"],gf=["YY","YYYY"];function vf(e){return-1!==ff.indexOf(e)}function _f(e){return-1!==gf.indexOf(e)}function yf(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var bf={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function wf(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var xf={date:wf({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:wf({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:wf({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Cf={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function $f(e){return function(t,n){var i;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,r=null!=n&&n.width?String(n.width):a;i=e.formattingValues[r]||e.formattingValues[a]}else{var o=e.defaultWidth,s=null!=n&&n.width?String(n.width):e.defaultWidth;i=e.values[s]||e.values[o]}return i[e.argumentCallback?e.argumentCallback(t):t]}}function kf(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.width,a=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],r=t.match(a);if(!r)return null;var o,s=r[0],c=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(c)?function(e,t){for(var n=0;n0?"in "+i:i+" ago":i},formatLong:xf,formatRelative:function(e,t,n,i){return Cf[e]},localize:{ordinalNumber:function(e,t){var n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:$f({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:$f({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:$f({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:$f({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:$f({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(Ef={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.match(Ef.matchPattern);if(!n)return null;var i=n[0],a=e.match(Ef.parsePattern);if(!a)return null;var r=Ef.valueCallback?Ef.valueCallback(a[0]):a[0];return{value:r=t.valueCallback?t.valueCallback(r):r,rest:e.slice(i.length)}}),era:kf({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:kf({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:kf({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:kf({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:kf({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},Sf=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Tf=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Af=/^'([^]*?)'?$/,zf=/''/g,jf=/[a-zA-Z]/;function Of(e,t,n){var i,a,r,o,s,c,l,d,u,h,m,p,f,g,v,_,y,b;Fm(2,arguments);var w=String(t),x=Up(),C=null!==(i=null!==(a=null==n?void 0:n.locale)&&void 0!==a?a:x.locale)&&void 0!==i?i:Mf,$=Um(null!==(r=null!==(o=null!==(s=null!==(c=null==n?void 0:n.firstWeekContainsDate)&&void 0!==c?c:null==n||null===(l=n.locale)||void 0===l||null===(d=l.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==s?s:x.firstWeekContainsDate)&&void 0!==o?o:null===(u=x.locale)||void 0===u||null===(h=u.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==r?r:1);if(!($>=1&&$<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var k=Um(null!==(m=null!==(p=null!==(f=null!==(g=null==n?void 0:n.weekStartsOn)&&void 0!==g?g:null==n||null===(v=n.locale)||void 0===v||null===(_=v.options)||void 0===_?void 0:_.weekStartsOn)&&void 0!==f?f:x.weekStartsOn)&&void 0!==p?p:null===(y=x.locale)||void 0===y||null===(b=y.options)||void 0===b?void 0:b.weekStartsOn)&&void 0!==m?m:0);if(!(k>=0&&k<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!C.localize)throw new RangeError("locale must contain localize property");if(!C.formatLong)throw new RangeError("locale must contain formatLong property");var E=Zm(e);if(!jp(E))throw new RangeError("Invalid time value");var M=Op(E,pf(E)),S={firstWeekContainsDate:$,weekStartsOn:k,locale:C,_originalDate:E};return w.match(Tf).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,mf[t])(e,C.formatLong):e})).join("").match(Sf).map((function(i){if("''"===i)return"'";var a=i[0];if("'"===a)return function(e){var t=e.match(Af);if(!t)return e;return t[1].replace(zf,"'")}(i);var r=sf[a];if(r)return null!=n&&n.useAdditionalWeekYearTokens||!_f(i)||yf(i,t,String(e)),null!=n&&n.useAdditionalDayOfYearTokens||!vf(i)||yf(i,t,String(e)),r(M,i,C.localize,S);if(a.match(jf))throw new RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");return i})).join("")}function If(e,t,n){e.dispatchEvent(new CustomEvent(`frigate-card:${t}`,{bubbles:!0,composed:!0,detail:n}))}function Rf(e){if(!e)return;return e.split(/[_\s]+/).map((e=>e[0].toUpperCase()+e.substring(1))).join(" ")}function Df(e,t,n){const i=e[t];return e.splice(t,1),e.splice(n,0,i),e}const Pf=e=>Array.isArray(e)?e:[e];function Lf(e,t){return!Aa(e,t)}function Nf(e,t=console.warn){e instanceof vu&&e.context?t(e,e.context):t(e)}const Uf=()=>window.matchMedia("(hover: hover) and (pointer: fine)").matches,Ff=(e,t)=>Of(e,"yyyy-MM-dd HH:mm"+(t?":ss":"")),Hf=e=>Of(e,"yyyy-MM-dd"),Zf=(e,t)=>{window.requestIdleCallback?window.requestIdleCallback(e,{...t&&{timeout:t}}):e()};function qf(e,t){const n=function(e,t,n){Fm(2,arguments);var i=Ep(e,t)/$p;return Tp(null==n?void 0:n.roundingMethod)(i)}(t,e),i=function(e,t,n){Fm(2,arguments);var i=Ep(e,t)/Cp;return Tp(null==n?void 0:n.roundingMethod)(i)}(t,e)-60*n;let a="";return n&&(a+=`${n}h `),i&&(a+=`${i}m `),a+=`${Ap(t,e)-60*n*60-60*i}s`,a}const Vf=async(e,t)=>await Promise.all(Array.from(e).map((e=>t(e)))),Wf=e=>new Date(`${e}T00:00:00`),Bf=async e=>{await new Promise((t=>setTimeout(t,1e3*e)))},Yf=e=>!isNaN(e.getTime()),Qf=(e,t,n,i)=>{t?e.setAttribute(n,i??""):e.removeAttribute(n)},Gf=Ws.lazy((()=>Ws.object({title:Ws.string(),media_class:Ws.string(),media_content_type:Ws.string(),media_content_id:Ws.string(),can_play:Ws.boolean(),can_expand:Ws.boolean(),children_media_class:Ws.string().nullable().optional(),thumbnail:Ws.string().nullable(),children:Ws.array(Gf).nullable().optional()}))),Kf="video",Xf="image",Jf=60;class eg{constructor(e){this._cache=e}async walkBrowseMedias(e,t,n){return t&&t.length?(await Vf(t,(async t=>await this._walkBrowseMedia(e,t,n)))).flat():[]}async _walkBrowseMedia(e,t,n){const i=await Vf(t.targets,(async i=>await this._browseMedia(e,i,{useCache:n?.useCache,metadataGenerator:t.metadataGenerator}))),a=[];for(const e of i)for(const n of e.children??[])t.matcher(n)&&a.push(n);const r=t.advance?t.advance(a):null;if(!r||!r.length)return a;const o=new Set(r.map((e=>e.targets)).flat()),s=[];for(const e of a)o.has(e)||s.push(e);const c=await this.walkBrowseMedias(e,r,n);return s.concat(c)}async _browseMedia(e,t,n){const i="object"==typeof t?t.media_content_id:t,a=n?.useCache??1?this._cache.get(i):null;if(a)return a;const r={type:"media_source/browse_media",media_content_id:i},o=await cp(e,Gf,r);if(n?.metadataGenerator)for(const e of o.children??[])e._metadata=n.metadataGenerator(e,"object"==typeof t?t:void 0)??void 0;return(n?.useCache??1)&&this._cache.set(i,o,Bm(new Date,{seconds:60})),o}}function tg(e,t){for(var n=-1,i=null==e?0:e.length,a=Array(i);++nt||r&&o&&c&&!s&&!l||i&&o&&c||!n&&c||!a)return 1;if(!i&&!r&&!l&&e=s?c:c*("desc"==n[i]?-1:1)}return e.index-t.index}(e,t,n)}))}function Rg(e,t,n,i){return null==e?[]:(Yt(t)||(t=null==t?[]:[t]),Yt(n=i?void 0:n)||(n=null==n?[]:[n]),Ig(e,t,n))}function Dg(e,t){return e&&e.length?function(e,t){for(var n=-1,i=e.length,a=0,r=[];++nNg(t,e)))}add(e){this._ranges.push(e),this._ranges=Fg(this._ranges)}clear(){this._ranges=[]}}class Lg{constructor(e){this._ranges=e??[]}hasCoverage(e){const t=new Date;return this._ranges.some((n=>tet.start>=e.start&&t.end<=e.end,Ug=(e,t)=>e.start>=t.start&&e.start<=t.end||e.end>=t.start&&e.end<=t.end||e.start<=t.start&&e.end>=t.end,Fg=(e,t=0)=>{const n=[];e=Rg(e,(e=>e.start),"asc");let i=null;for(let a=0;a=o?r.end>i.end&&(i.end=r.end):(n.push(i),i={...r})}return i&&n.push(i),n};class Hg{constructor(){this._data=[]}get(e){const t=new Date;for(const n of this._data)if((!n.expires||t<=n.expires)&&this._contains(e,n.request))return n.response;return null}clear(){this._data=[]}has(e){return!!this.get(e)}set(e,t,n){this._data.push({request:e,response:t,expires:n}),this._expireOldRequests()}_contains(e,t){return Aa(e,t)}_expireOldRequests(){const e=new Date;this._data=this._data.filter((t=>!t.expires||e=e.start.getTime()){if(i>e.end.getTime())break;t.push(n)}}return t}getSize(){return this._data.length}expireMatches(e){this._data=this._data.filter((t=>!e(t)))}}class Vg{constructor(){this._segments=new Map}add(e,t,n){let i=this._segments.get(e);i||(i=new qg((e=>1e3*e.start_time),(e=>e.id)),this._segments.set(e,i)),i.add(t,n)}clear(){this._segments.clear()}hasCoverage(e,t){return!!this._segments.get(e)?.hasCoverage(t)}get(e,t){return this._segments.get(e)?.get(t)??null}getSize(e){return this._segments.get(e)?.getSize()??null}getCameraIDs(){return[...this._segments.keys()]}expireMatches(e,t){this._segments.get(e)?.expireMatches(t)}}class Wg extends vu{}var Bg,Yg,Qg;function Gg(e){Fm(1,arguments);var t=Zm(e);return t.setMinutes(0,0,0),t}function Kg(e){Fm(1,arguments);var t=Zm(e);return t.setMinutes(59,59,999),t}function Xg(e){Fm(1,arguments);var t=Zm(e);return t.setHours(0,0,0,0),t}function Jg(e){Fm(1,arguments);var t=Zm(e);return t.setHours(23,59,59,999),t}function ev(e){return e!=e}function tv(e,t){return!!(null==e?0:e.length)&&function(e,t,n){return t==t?function(e,t,n){for(var i=n-1,a=e.length;++i-1}function nv(e,t,n){for(var i=-1,a=null==e?0:e.length;++i=av){var l=t?null:iv(e);if(l)return ra(l);o=!1,a=ea,c=new Xi}else c=t?[]:s;e:for(;++i{let n,i;return(e.end.getTime()-e.start.getTime())/1e3<=3600?(n=Gg(e.start),i=Kg(e.end)):(n=Xg(e.start),i=Jg(e.end)),t?.endCap&&(i=function(e){Fm(1,arguments);var t=Zm(e);return t.setSeconds(59,999),t}(sv(i))),{start:n,end:i}},sv=e=>{const t=new Date;return e>t?t:e},cv=e=>{return Rg((n=e=>e.getID()??e,(t=e)&&t.length?rv(t,zg(n)):[]),(e=>e.getStartTime()),"asc");var t,n},lv=e=>e.camera_entity??e.webrtc_card?.entity??null;class dv{constructor(e,t,n){this._entityRegistryManager=e,this._cardWideConfig=n,this._resolvedMediaCache=t}async createEngine(e){let t=null;switch(e){case Qg.Generic:const{GenericCameraManagerEngine:e}=await import("./engine-generic-395b8c68.js");t=new e;break;case Qg.Frigate:const{FrigateCameraManagerEngine:n}=await import("./engine-frigate-2c5e3aa9.js");t=new n(this._cardWideConfig,new Vg,new Zg);break;case Qg.MotionEye:const{MotionEyeCameraManagerEngine:i}=await import("./engine-motioneye-ae70fe08.js");t=new i(new eg(new Hg),this._resolvedMediaCache,new Zg)}return t}async getEngineForCamera(e,t){let n=null;if("frigate"===t.engine)n=Qg.Frigate;else if("motioneye"===t.engine)n=Qg.MotionEye;else if("generic"===t.engine)n=Qg.Generic;else if("auto"===t.engine){const i=lv(t);if(i){let a;try{a=await this._entityRegistryManager.getEntity(e,i)}catch(n){if(e.states[i])return Qg.Generic;throw new Wg(Pm("error.no_camera_entity"),t)}switch(a?.platform){case"frigate":n=Qg.Frigate;break;case"motioneye":n=Qg.MotionEye;break;default:n=Qg.Generic}}else t.frigate.camera_name&&(n=Qg.Frigate)}return n}}function uv(e){return e&&e.length?function(e,t){for(var n,i=-1,a=e.length;++i{e?.debug?.logging&&console.debug(...t)};function mv(e){return"string"==typeof e?.id&&e.id||"string"==typeof e?.camera_entity&&e.camera_entity||"object"==typeof e?.webrtc_card&&e.webrtc_card&&"string"==typeof e.webrtc_card.entity&&e.webrtc_card.entity||"object"==typeof e?.frigate&&e.frigate&&"string"==typeof e?.frigate.camera_name&&e.frigate.camera_name||""}function pv(e,t){if(!e||!t)return null;const n=e.getStore().getCameras(),i=new Set,a=e=>{const t=n.get(e);if(t){i.add(e);const r=new Set;t.dependencies.cameras.forEach((e=>r.add(e))),t.dependencies.all_cameras&&n.forEach(((e,t)=>r.add(t)));for(const e of r)i.has(e)||a(e)}};return t&&a(t),i}class fv{constructor(){this._allConfigs=new Map,this._visibleConfigs=new Map,this._enginesByCamera=new Map,this._enginesByType=new Map}addCamera(e,t,n){t.hide||this._visibleConfigs.set(e,t),this._allConfigs.set(e,t),this._enginesByCamera.set(e,n),this._enginesByType.set(n.getEngineType(),n)}getCameraConfig(e){return this._allConfigs.get(e)??null}hasCameraID(e){return this._allConfigs.has(e)}hasVisibleCameraID(e){return this._visibleConfigs.has(e)}getCameraCount(){return this._allConfigs.size}getVisibleCameraCount(){return this._visibleConfigs.size}getCameras(){return this._allConfigs}getVisibleCameras(){return this._visibleConfigs}getCameraIDs(){return new Set(this._allConfigs.keys())}getVisibleCameraIDs(){return new Set(this._visibleConfigs.keys())}getCameraConfigForMedia(e){const t=e.getCameraID();return t?this.getCameraConfig(t):null}getEngineOfType(e){return this._enginesByType.get(e)??null}getEngineForCameraID(e){return this._enginesByCamera.get(e)??null}getEnginesForCameraIDs(e){const t=new Map;for(const n of e){const e=this.getEngineForCameraID(n);e&&(t.has(e)||t.set(e,new Set),t.get(e)?.add(n))}return t.size?t:null}getEngineForMedia(e){const t=e.getCameraID();return t?this.getEngineForCameraID(t):null}getAllEngines(){return[...this._enginesByType.values()]}}class gv{static isEventQuery(e){return e.type===Bg.Event}static isRecordingQuery(e){return e.type===Bg.Recording}static isRecordingSegmentsQuery(e){return e.type===Bg.RecordingSegments}static isMediaMetadataQuery(e){return e.type===Bg.MediaMetadata}}class vv{static isEventQueryResult(e){return e.type===Yg.Event}static isRecordingQuery(e){return e.type===Yg.Recording}static isRecordingSegmentsQuery(e){return e.type===Yg.RecordingSegments}static isMediaMetadataQuery(e){return e.type===Yg.MediaMetadata}}class _v{constructor(e,t){this._engineFactory=e,this._cardWideConfig=t,this._store=new fv}async _getEnginesForCameras(e,t){const n=new Map,i=new Map,a=await(async t=>await Vf(t,(t=>this._engineFactory.getEngineForCamera(e,t))))(t);for(const[e,r]of t.entries()){const t=a[e],o=t?i.get(t)??await this._engineFactory.createEngine(t):null;if(!o||!t)throw new Wg(Pm("error.no_camera_engine"),r);i.set(t,o),n.set(r,o)}return n}async _initializeCamera(e,t,n,i){return{inputConfig:i,initializedConfig:await t.initializeCamera(e,n,Gi(i)),engine:t}}async initializeCameras(e,t,n){const i=new Date;n.some((e=>(e=>e.triggers.motion||e.triggers.occupancy)(e)))&&await t.fetchEntityList(e);const a=await this._getEnginesForCameras(e,n);if((await Vf(a.entries(),(async([n,i])=>await this._initializeCamera(e,i,t,n)))).forEach((e=>{const t=mv(e.initializedConfig);if(!t)throw new Wg(Pm("error.no_camera_id"),e.inputConfig);if(this._store.hasCameraID(t))throw new Wg(Pm("error.duplicate_camera_id"),e.inputConfig);this._store.addCamera(t,e.initializedConfig,e.engine)})),!this._store.getVisibleCameraCount())throw new Wg(Pm("error.no_visible_cameras"));hv(this._cardWideConfig,"Frigate Card CameraManager initialized (Cameras: ",this._store.getCameras(),`, Duration: ${((new Date).getTime()-i.getTime())/1e3}s,`,")")}isInitialized(){return this._store.getCameraCount()>0}getStore(){return this._store}generateDefaultEventQueries(e,t){return this._generateDefaultQueries(e,{type:Bg.Event,...t})}generateDefaultRecordingQueries(e,t){return this._generateDefaultQueries(e,{type:Bg.Recording,...t})}generateDefaultRecordingSegmentsQueries(e,t){return this._generateDefaultQueries(e,{type:Bg.RecordingSegments,...t})}async getMediaMetadata(e){const t=new Set,n=new Set,i=new Set,a=new Set,r={type:Bg.MediaMetadata,cameraIDs:this._store.getCameraIDs()},o=await this._handleQuery(e,r);for(const e of o?.values()??[])e.metadata.tags&&e.metadata.tags.forEach(t.add,t),e.metadata.what&&e.metadata.what.forEach(n.add,n),e.metadata.where&&e.metadata.where.forEach(i.add,i),e.metadata.days&&e.metadata.days.forEach(a.add,a);return n.size||i.size||a.size?{...t.size&&{tags:t},...n.size&&{what:n},...i.size&&{where:i},...a.size&&{days:a}}:null}_generateDefaultQueries(e,t){const n=[],i=(a=e)instanceof Set?a:new Set(Pf(a));var a;const r=this._store.getEnginesForCameraIDs(i);if(!r)return null;for(const[e,i]of r){let a=null;gv.isEventQuery(t)?a=e.generateDefaultEventQuery(this._store.getVisibleCameras(),i,t):gv.isRecordingQuery(t)?a=e.generateDefaultRecordingQuery(this._store.getVisibleCameras(),i,t):gv.isRecordingSegmentsQuery(t)&&(a=e.generateDefaultRecordingSegmentsQuery(this._store.getVisibleCameras(),i,t));for(const e of a??[])n.push(e)}return n.length?n:null}async getEvents(e,t,n){return await this._handleQuery(e,t,n)}async getRecordings(e,t,n){return await this._handleQuery(e,t,n)}async getRecordingSegments(e,t,n){return await this._handleQuery(e,t,n)}async executeMediaQueries(e,t,n){return this._convertQueryResultsToMedia(e,await this._handleQuery(e,t,n))}async extendMediaQueries(e,t,n,i,a){const r=e=>{let t=null;for(const i of n){const n=i.getStartTime();n&&(!t||"earliest"===e&&nt)&&(t=n)}return t},o=this._cardWideConfig?.performance?.features.media_chunk_size??50,s=[],c=[];for(const e of t){const t={...e};if("later"===i){const e=r("latest");e&&(t.start=e)}else if("earlier"===i){const e=r("earliest");e&&(t.end=e)}t.limit=o,c.push({...e,limit:(e.limit??0)+o}),s.push(t)}const l=this._convertQueryResultsToMedia(e,await this._handleQuery(e,s,a));if(!l.length)return null;const d=cv(n.concat(l));return d.length===n.length?null:{queries:c,results:d}}async getMediaDownloadPath(e,t){const n=this._store.getCameraConfigForMedia(t),i=this._store.getEngineForMedia(t);return n&&i?await i.getMediaDownloadPath(e,n,t):null}getMediaCapabilities(e){const t=this._store.getEngineForMedia(e);return t?t.getMediaCapabilities(e):null}async favoriteMedia(e,t,n){const i=this._store.getCameraConfigForMedia(t),a=this._store.getEngineForMedia(t);if(!i||!a)return;const r=new Date;await a.favoriteMedia(e,i,t,n),hv(this._cardWideConfig,"Frigate Card CameraManager favorite request (",`Duration: ${((new Date).getTime()-r.getTime())/1e3}s,`,"Media:",t.getID(),", Favorite:",n,")")}areMediaQueriesResultsFresh(e,t){const n=new Date;for(const i of e){const e=this._store.getEnginesForCameraIDs(i.cameraIDs);for(const[a,r]of e??[]){const e=a.getQueryResultMaxAge({...i,cameraIDs:r});if(null!==e&&Bm(t,{seconds:e})a?null:await o.getMediaSeekTime(e,this._store.getCameras(),t,n)}async _handleQuery(e,t,n){const i=Pf(t),a=new Map,r=new Date,o=async(t,i)=>{if(!i)return;let r=null;gv.isEventQuery(i)?r=await t.getEvents(e,this._store.getCameras(),i,n):gv.isRecordingQuery(i)?r=await t.getRecordings(e,this._store.getCameras(),i,n):gv.isRecordingSegmentsQuery(i)?r=await t.getRecordingSegments(e,this._store.getCameras(),i,n):gv.isMediaMetadataQuery(i)&&(r=await t.getMediaMetadata(e,this._store.getCameras(),i,n)),r?.forEach(((e,t)=>a.set(t,e)))},s=async e=>{const t=this._store.getEnginesForCameraIDs(e.cameraIDs);t&&await Promise.all(Array.from(t.keys()).map((n=>o(n,{...e,cameraIDs:t.get(n)}))))};await Promise.all(i.map((e=>s(e))));const c=uv(Array.from(a.values()).map((e=>Number(e.cached??0))));return hv(this._cardWideConfig,"Frigate Card CameraManager request [Input queries:",i.length,", Cached output queries:",c,", Total output queries:",a.size,", Duration:",((new Date).getTime()-r.getTime())/1e3+"s,",", Queries:",i,", Results:",a,"]"),a}_convertQueryResultsToMedia(e,t){const n=[];for(const[i,a]of t.entries()){const t=this._store.getEngineOfType(a.engine);if(t){let r=null;gv.isEventQuery(i)&&vv.isEventQueryResult(a)?r=t.generateMediaFromEvents(e,this._store.getCameras(),i,a):gv.isRecordingQuery(i)&&vv.isRecordingQuery(a)&&(r=t.generateMediaFromRecordings(e,this._store.getCameras(),i,a)),r&&n.push(...r)}}return cv(n)}getCameraEndpoints(e,t){const n=this._store.getCameraConfig(e),i=this._store.getEngineForCameraID(e);return n&&i?i.getCameraEndpoints(n,t):null}getCameraMetadata(e,t){const n=this._store.getCameraConfig(t),i=this._store.getEngineForCameraID(t);return n&&i?i.getCameraMetadata(e,n):null}getCameraCapabilities(e){const t=this._store.getCameraConfig(e),n=this._store.getEngineForCameraID(e);return t&&n?n.getCameraCapabilities(t):null}getAggregateCameraCapabilities(e){const t=[...e??this._store.getCameraIDs()].map((e=>this.getCameraCapabilities(e)));return{canFavoriteEvents:t.some((e=>e?.canFavoriteEvents)),canFavoriteRecordings:t.some((e=>e?.canFavoriteRecordings)),canSeek:t.some((e=>e?.canSeek)),supportsClips:t.some((e=>e?.supportsClips)),supportsRecordings:t.some((e=>e?.supportsRecordings)),supportsSnapshots:t.some((e=>e?.supportsSnapshots)),supportsTimeline:t.some((e=>e?.supportsTimeline))}}}var yv='.dotdotdot:after {\n animation: dots 2s linear infinite;\n content: "";\n display: inline-block;\n width: 3em;\n}\n@keyframes dots {\n 0%, 20% {\n content: ".";\n }\n 40% {\n content: "..";\n }\n 60% {\n content: "...";\n }\n 90%, 100% {\n content: "";\n }\n}\n\n:host {\n display: block;\n height: 100%;\n width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n user-select: text;\n -webkit-user-select: text;\n color: var(--primary-text-color);\n}\n\ndiv.wrapper {\n height: 100%;\n}\n\ndiv.message {\n display: flex;\n justify-content: center;\n align-items: center;\n box-sizing: border-box;\n height: 100%;\n}\n\ndiv.message.padded {\n padding: 20px;\n}\n\ndiv.message div.contents {\n display: flex;\n flex-direction: column;\n padding: 10px;\n margin-top: auto;\n margin-bottom: auto;\n min-width: 0;\n}\n\ndiv.message div.icon {\n padding: 10px;\n}\n\n.vertical {\n flex-direction: column;\n}\n\n.message a {\n color: var(--primary-text-color, white);\n word-break: break-word;\n}\n\n.message pre {\n margin-top: 20px;\n white-space: pre-wrap;\n word-break: break-all;\n}';let bv=class extends ge{constructor(){super(...arguments),this.message=""}render(){const e=this.icon?this.icon:"mdi:information-outline",t={dotdotdot:!!this.dotdotdot};return K`
+
+
+ +
+
+ + ${this.message?K`${this.message}${this.context&&"string"==typeof this.context?": "+this.context:""}`:""} + + ${this.context&&"string"!=typeof this.context?K`
${JSON.stringify(this.context,null,2)}
`:""} +
+
+
`}static get styles(){return b(yv)}};e([be({attribute:!1})],bv.prototype,"message",void 0),e([be({attribute:!1})],bv.prototype,"context",void 0),e([be({attribute:!1})],bv.prototype,"icon",void 0),e([be({attribute:!0,type:Boolean})],bv.prototype,"dotdotdot",void 0),bv=e([_e("frigate-card-message")],bv);let wv=class extends ge{render(){if(this.message)return K` ${Pm("error.troubleshooting")}.`} + .icon=${"mdi:alert-circle"} + .context=${this.message.context} + .dotdotdot=${this.message.dotdotdot} + > + `}static get styles(){return b(yv)}};e([be({attribute:!1})],wv.prototype,"message",void 0),wv=e([_e("frigate-card-error-message")],wv);let xv=class extends ge{constructor(){super(...arguments),this.message="",this.animated=!1,this.size="large"}render(){return K`
+ ${this.animated?K` + `:K``} + ${this.message?K`${this.message}`:K``} +
`}static get styles(){return b(yv)}};function Cv(e){return"error"===e.type?K` `:K` `}function $v(e){return K` + + + `}function kv(e,t,n,i){If(e,"message",{message:t,type:n,icon:i?.icon,context:i?.context})}function Ev(e,t,n){kv(e,t,"error",{context:n?.context})}function Mv(e,t){t instanceof Error&&Ev(e,t.message,{...t instanceof vu&&{context:t.context}})}function Sv(e,t,n){return null==e?e:function(e,t,n,i){if(!ot(e))return e;for(var a=-1,r=(t=gg(t,e)).length,o=r-1,s=e;null!=s&&++a{Sv(e,t,n)},Av=(e,t,n)=>kg(e,t,n),zv=(e,t)=>{let n=t,i=e;if(t&&t.split&&t.includes(".")){const a=t.split(".");n=a[a.length-1],i=Av(e,a.slice(0,-1).join("."))}i&&"object"==typeof i&&delete i[n]},jv=function(e){let t=!1;for(let n=0;nGi(e),Rv=function(e,t,n){return i=>{let a=e(i);return"number"!=typeof a||(a=t?Math.max(t,a):a,a=n?Math.min(n,a):a),a}},Dv=function(e){if("number"!=typeof e)return"string"!=typeof e?null:(e=e.replace(/px$/i,""),isNaN(e)?null:Number(e))},Pv=function(e){return null},Lv=(e,t)=>e.replace("#",`[${t.toString()}]`),Nv=function(e,t,n){return function(i){return((e,t,n,i)=>{const a=Av(e,t);if(void 0===a)return!1;const r=i?.transform?i.transform(a):a;return!(t===n&&Aa(a,r)||(null===r?i?.keepOriginal||(zv(e,t),0):void 0===r||(i?.keepOriginal||zv(e,t),Tv(e,n,r),0)))})(i,e,t,n)}},Uv=function(e,t,n){return function(i){let a=Nv(e,t,n)(i);return a=Zv(Yd,Nv(e,t,n),(e=>e.overrides))(i)||a,a}},Fv=function(e,t){return Uv(e,e,{transform:t})},Hv=function(e,t){return Nv(e,e,{transform:t})},Zv=function(e,t,n){return function(i){let a=!1;const r=Av(i,e);return Array.isArray(r)&&r.forEach((e=>{const i=n?n(e):e;i&&"object"==typeof i&&(a=t(i)||a)})),a}},qv=function(e){if("object"!=typeof e)return"boolean"!=typeof e?null:{enabled:e}},Vv=e=>{const t=`${e}.show_controls`;return function(n){let i=!1;return i=Uv(t,`${e}.show_favorite_control`,{keepOriginal:!0})(n)||i,i=Uv(t,`${e}.show_timeline_control`,{keepOriginal:!0})(n)||i,Fv(t,Pv)(n)||i}},Wv=(e,t)=>{const n=i=>{let a=!1;if(i&&"object"==typeof i){const r=t?t(i):i;r&&(a=e(r)||a),Array.isArray(i)?i.filter((e=>"object"==typeof e)).forEach((e=>{a=n(e)||a})):Object.keys(i).filter((e=>"object"==typeof i[e])).forEach((e=>{a=n(i[e])||a}))}return a};return n},Bv=e=>!("object"!=typeof e||!e||void 0===e.mediaLoaded)&&(e.media_loaded=e.mediaLoaded,delete e.mediaLoaded,!0),Yv=e=>!("object"!=typeof e||!e||"custom:frigate-card-action"!==e.action||"frigate_ui"!==e.frigate_card_action)&&(e.frigate_card_action="camera_ui",!0),Qv=[Fv(Rl,Rv(Dv,75,cu)),Fv("event_viewer.controls.thumbnails.size",Rv(Dv,75,cu)),Fv(jl,Rv(Dv,su)),Fv("event_viewer.controls.next_previous.size",Rv(Dv,su)),Fv(Ad,Rv(Dv,su)),Fv("event_gallery.min_columns",Pv),function(e){let t=!1;return t=Uv("menu.mode",Td,{transform:e=>{if("string"==typeof e){const t=e.match(/^(hover|hidden|overlay|above|below|none)/);if(t)switch(t[1]){case"hover":case"hidden":case"overlay":case"none":return t[1];case"above":case"below":return"outside"}}},keepOriginal:!0})(e)||t,t=Uv("menu.mode",Sd,{transform:e=>{if("string"==typeof e){const t=e.match(/(above|below|left|right|top|bottom)$/);if(t)switch(t[1]){case"left":case"right":case"top":case"bottom":return t[1];case"above":return"top";case"below":return"bottom"}}},keepOriginal:!0})(e)||t,Fv("menu.mode",Pv)(e)||t},Fv(Rd,qv),Fv(jd,qv),Fv(Nd,qv),Fv(Od,qv),Fv(Fd,qv),Fv(Ld,qv),Fv(Id,qv),Fv("menu.buttons.frigate_ui",qv),Fv(Pd,qv),Hv(Jl,(e=>"boolean"==typeof e?e?"all":"never":void 0)),Hv(Tl,(e=>"boolean"==typeof e?e?"all":"never":void 0)),Hv("event_viewer.auto_play",(e=>"boolean"==typeof e?e?"all":"never":void 0)),Hv("event_viewer.auto_unmute",(e=>"boolean"==typeof e?e?"all":"never":void 0)),Uv("event_viewer",Qc),Zv(Qs,Nv("camera_name","frigate.camera_name")),Zv(Qs,Nv("client_id","frigate.client_id")),Zv(Qs,Nv("label","frigate.label")),Zv(Qs,Nv("frigate_url","frigate.url")),Zv(Qs,Nv("zone","frigate.zone")),Vv("event_gallery.controls.thumbnails"),Vv("media_viewer.controls.thumbnails"),Vv("live.controls.thumbnails"),Vv("timeline.controls.thumbnails"),Zv(Yd,Bv,(e=>e.conditions)),e=>Wv(Bv,(e=>e.conditions))("object"==typeof e&&e?e.elements:{}),Uv("event_gallery",Hc),Uv("menu.buttons.frigate_ui",Dd),e=>Wv(Yv)("object"==typeof e&&e?e:{}),Zv(Qs,Fv("live_provider",(e=>"frigate-jsmpeg"===e?"jsmpeg":e))),Uv("live.image",$c),Uv("live.jsmpeg",kc),Uv("live.webrtc_card",Ec),Zv(Qs,Uv("frigate.zone","frigate.zones",{transform:e=>Pf(e)})),Zv(Qs,Uv("frigate.label","frigate.labels",{transform:e=>Pf(e)}))];class Gv extends Event{constructor(e,t){super("frigate-card:condition:evaluate",t),this.condition=e}}function Kv(e,t,n,i){const a=Iv(t);let r=!1;if(n)for(const t of n)e.evaluateCondition(t.conditions,i)&&(tr(a,t.overrides),r=!0);return r?a:t}class Xv{constructor(e){this._state={},this._epoch=this._createEpoch(),this._stateListeners=[],this._hasHAStateConditions=!1,this._mediaQueries=[],this._mediaQueryTrigger=()=>this._triggerChange(),e&&this._initConditions(e)}addStateListener(e){this._stateListeners.push(e)}removeStateListener(e){this._stateListeners=this._stateListeners.filter((t=>t!=e))}destroy(){this._mediaQueries.forEach((e=>e.removeEventListener("change",this._mediaQueryTrigger))),this._mediaQueries=[]}setState(e){this._state={...this._state,...e},this._triggerChange()}get hasHAStateConditions(){return this._hasHAStateConditions}getEpoch(){return this._epoch}evaluateCondition(e,t){const n={...this._state,...t};let i=!0;if(e.view?.length&&(i&&=!!n?.view&&e.view.includes(n.view)),void 0!==e.fullscreen&&(i&&=void 0!==n.fullscreen&&e.fullscreen==n.fullscreen),void 0!==e.expand&&(i&&=void 0!==n.expand&&e.expand==n.expand),e.camera?.length&&(i&&=!!n.camera&&e.camera.includes(n.camera)),e.state?.length)for(const t of e.state)i&&=!(!n.state||(t.state||t.state_not)&&(!(t.entity in n.state)||t.state&&n.state[t.entity].state!==t.state||t.state_not&&n.state[t.entity].state===t.state_not));return void 0!==e.media_loaded&&(i&&=void 0!==n.media_loaded&&e.media_loaded==n.media_loaded),e.media_query&&(i&&=window.matchMedia(e.media_query).matches),i}_createEpoch(){return{controller:this}}_triggerChange(){this._epoch=this._createEpoch(),this._stateListeners.forEach((e=>e()))}_initConditions(e){const t=(e=>{const t=[];e.overrides?.forEach((e=>t.push(e.conditions)));const n=e=>{const i=uh.safeParse(e);i.success?(t.push(i.data.conditions),i.data.elements?.forEach(n)):e&&"object"==typeof e&&Object.keys(e).forEach((t=>n(e[t])))};return e.elements?.forEach(n),t})(e);this._hasHAStateConditions=t.some((e=>!!e.state?.length)),t.forEach((e=>{if(e.media_query){const t=window.matchMedia(e.media_query);t.addEventListener("change",this._mediaQueryTrigger),this._mediaQueries.push(t)}}))}}let Jv=class extends ge{constructor(){super(...arguments),this._root=null}createRenderRoot(){return this}_createRoot(){const e=customElements.get("hui-conditional-element");if(!e||!this.hass)throw new Error(Pm("error.could_not_render_elements"));const t=new e;t.hass=this.hass;const n={type:"conditional",conditions:[],elements:this.elements};try{t.setConfig(n)}catch(e){throw console.error(e),new vu(Pm("error.invalid_elements_config"))}return t}willUpdate(e){try{!this.elements||this._root&&!e.has("elements")||(this._root=this._createRoot())}catch(e){return Mv(this,e)}}render(){return K`${this._root||""}`}updated(){this.hass&&this._root&&(this._root.hass=this.hass)}};e([be({attribute:!1})],Jv.prototype,"elements",void 0),e([be({attribute:!1})],Jv.prototype,"conditionControllerEpoch",void 0),e([be({attribute:!1})],Jv.prototype,"hass",void 0),Jv=e([_e("frigate-card-elements-core")],Jv);let e_=class extends ge{constructor(){super(...arguments),this._boundMenuRemoveHandler=this._menuRemoveHandler.bind(this)}_menuRemoveHandler(e){If(this,"menu-remove",e.detail)}_menuAddHandler(e){const t=e.composedPath();t.length&&(t[0].removeEventListener("frigate-card:menu-remove",this._boundMenuRemoveHandler),t[0].addEventListener("frigate-card:menu-remove",this._boundMenuRemoveHandler))}connectedCallback(){super.connectedCallback(),this.addEventListener("frigate-card:menu-add",this._menuAddHandler)}disconnectedCallback(){this.removeEventListener("frigate-card:menu-add",this._menuAddHandler),super.disconnectedCallback()}render(){return K` + `}static get styles(){return b(":host {\n position: absolute;\n inset: 0;\n overflow: hidden;\n pointer-events: none;\n}\n\n.element {\n position: absolute;\n transform: translate(-50%, -50%);\n pointer-events: auto;\n}\n\nhui-error-card.element {\n inset: 0px;\n transform: unset;\n}")}};e([be({attribute:!1})],e_.prototype,"hass",void 0),e([be({attribute:!1})],e_.prototype,"conditionControllerEpoch",void 0),e([be({attribute:!1})],e_.prototype,"elements",void 0),e_=e([_e("frigate-card-elements")],e_);let t_=class extends ge{setConfig(e){this._config=e}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.className=""}render(){if(function(e,t){if(!t)return!0;const n=new Gv(t,{bubbles:!0,composed:!0});return e.dispatchEvent(n),n.evaluation??!1}(this,this._config.conditions))return K` + `}};e([be({attribute:!1,hasChanged:()=>!0})],t_.prototype,"hass",void 0),t_=e([_e("frigate-card-conditional")],t_);class n_ extends ge{constructor(){super(...arguments),this._config=null}setConfig(e){this._config=e}connectedCallback(){super.connectedCallback(),this._config&&If(this,"menu-add",this._config)}disconnectedCallback(){this._config&&If(this,"menu-remove",this._config),super.disconnectedCallback()}}e([we()],n_.prototype,"_config",void 0);let i_=class extends n_{};i_=e([_e("frigate-card-menu-icon")],i_);let a_=class extends n_{};a_=e([_e("frigate-card-menu-state-icon")],a_);let r_=class extends n_{};r_=e([_e("frigate-card-menu-submenu")],r_);let o_=class extends n_{};o_=e([_e("frigate-card-menu-submenu-select")],o_);let s_=class extends ge{constructor(){super(...arguments),this._config=null}setConfig(e){this._config=e}willUpdate(e){e.has("_config")&&this.setAttribute("data-orientation",this._config?.orientation??"vertical")}_actionHandler(e,t){e.stopPropagation();const n=e.detail.action,i=mm(n,t);t&&i&&this.hass&&pm(this,this.hass,t,n,i)}render(){if(!this._config)return;const e=(e,t,n)=>{const i=gm(n?.hold_action),a=gm(n?.double_tap_action);return K`this._actionHandler(e,n)} + >`};return K`
+
+ ${e("right","mdi:arrow-right",this._config.actions_right)} + ${e("left","mdi:arrow-left",this._config.actions_left)} + ${e("up","mdi:arrow-up",this._config.actions_up)} + ${e("down","mdi:arrow-down",this._config.actions_down)} +
+ ${this._config.actions_zoom_in||this._config.actions_zoom_out?K`
+ ${e("zoom_in","mdi:plus",this._config.actions_zoom_in)} + ${e("zoom_out","mdi:minus",this._config.actions_zoom_out)} +
`:K``} + ${this._config.actions_home?K` +
+ ${e("home","mdi:home",this._config.actions_home)} +
+ `:K``} +
`}static get styles(){return b(":host {\n position: relative;\n width: fit-content;\n height: fit-content;\n --frigate-card-ptz-icon-size: 24px;\n}\n\n/*****************\n * Main Containers\n *****************/\n.ptz {\n display: flex;\n gap: 10px;\n color: var(--light-primary-color);\n opacity: 0.4;\n transition: opacity 0.3s ease-in-out;\n}\n\n:host([data-orientation=vertical]) .ptz {\n flex-direction: column;\n}\n\n:host([data-orientation=horizontal]) .ptz {\n flex-direction: row;\n}\n\n.ptz:hover {\n opacity: 1;\n}\n\n:host([data-orientation=vertical]) .ptz div {\n width: calc(var(--frigate-card-ptz-icon-size) * 3);\n}\n\n:host([data-orientation=horizontal]) .ptz div {\n height: calc(var(--frigate-card-ptz-icon-size) * 3);\n}\n\n.ptz-move,\n.ptz-zoom,\n.ptz-home {\n position: relative;\n background-color: rgba(0, 0, 0, 0.3);\n}\n\n.ptz-move {\n height: calc(var(--frigate-card-ptz-icon-size) * 3);\n width: calc(var(--frigate-card-ptz-icon-size) * 3);\n border-radius: 50%;\n}\n\n:host([data-orientation=horizontal]) .ptz .ptz-zoom,\n:host([data-orientation=horizontal]) .ptz .ptz-home {\n width: calc(var(--frigate-card-ptz-icon-size) * 1.5);\n}\n\n:host([data-orientation=vertical]) .ptz .ptz-zoom,\n:host([data-orientation=vertical]) .ptz .ptz-home {\n height: calc(var(--frigate-card-ptz-icon-size) * 1.5);\n}\n\n.ptz-zoom,\n.ptz-home {\n border-radius: var(--ha-card-border-radius, 4px);\n}\n\n/***********\n * PTZ Icons\n ***********/\nha-icon {\n position: absolute;\n --mdc-icon-size: var(--frigate-card-ptz-icon-size);\n}\n\nha-icon:not(.disabled) {\n cursor: pointer;\n}\n\n.disabled {\n color: var(--disabled-text-color);\n}\n\n.up {\n top: 5px;\n left: 50%;\n transform: translateX(-50%);\n}\n\n.down {\n bottom: 5px;\n left: 50%;\n transform: translateX(-50%);\n}\n\n.left {\n left: 5px;\n top: 50%;\n transform: translateY(-50%);\n}\n\n.right {\n right: 5px;\n top: 50%;\n transform: translateY(-50%);\n}\n\n:host([data-orientation=vertical]) .zoom_in {\n right: 5px;\n top: 50%;\n}\n\n:host([data-orientation=vertical]) .zoom_out {\n left: 5px;\n top: 50%;\n}\n\n:host([data-orientation=horizontal]) .zoom_in {\n left: 50%;\n top: 5px;\n}\n\n:host([data-orientation=horizontal]) .zoom_out {\n left: 50%;\n bottom: 5px;\n}\n\n:host([data-orientation=vertical]) .zoom_in,\n:host([data-orientation=vertical]) .zoom_out {\n transform: translateY(-50%);\n}\n\n:host([data-orientation=horizontal]) .zoom_in,\n:host([data-orientation=horizontal]) .zoom_out {\n transform: translateX(-50%);\n}\n\n.home {\n top: 50%;\n left: 50%;\n transform: translateX(-50%) translateY(-50%);\n}")}};e([be({attribute:!1})],s_.prototype,"hass",void 0),e([we()],s_.prototype,"_config",void 0),s_=e([_e("frigate-card-ptz")],s_); +/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const c_=e=>null!=e?e:J;const l_="m 4.8759466,22.743573 c 0.0866,0.69274 0.811811,1.16359 0.37885,1.27183 -0.43297,0.10824 -2.32718,-3.43665 -2.7601492,-4.95202 -0.4329602,-1.51538 -0.6764993,-3.22017 -0.5682593,-4.19434 0.1082301,-0.97417 5.7097085,-2.48955 5.7097085,-2.89545 0,-0.4059 -1.81304,-0.0271 -1.89422,-0.35178 -0.0812,-0.32472 1.36925,-0.12989 1.75892,-0.64945 0.60885,-0.81181 1.3800713,-0.6765 1.8671505,-1.1094696 0.4870902,-0.4329599 1.0824089,-2.0836399 1.1906589,-2.7871996 0.108241,-0.70357 -1.0824084,-1.51538 -1.4071389,-2.05658 -0.3247195,-0.54121 0.7035702,-0.92005 3.1931099,-1.94834 2.48954,-1.02829 10.39114,-3.30134994 10.49938,-3.03074994 0.10824,0.27061 -2.59779,1.40713994 -4.492,2.11069994 -1.89422,0.70357 -4.97909,2.05658 -4.97909,2.43542 0,0.37885 0.16236,0.67651 0.0541,1.54244 -0.10824,0.86593 -0.12123,1.2702597 -0.32472,1.8400997 -0.1353,0.37884 -0.2706,1.27183 0,2.0836295 0.21648,0.64945 0.92005,1.13653 1.24477,1.24478 0.2706,0.018 1.01746,0.0433 1.8401,0 1.02829,-0.0541 2.48954,0.0541 2.48954,0.32472 0,0.2706 -2.21894,0.10824 -2.21894,0.48708 0,0.37885 2.27306,-0.0541 2.21894,0.32473 -0.0541,0.37884 -1.89422,0.21648 -2.86839,0.21648 -0.77933,0 -1.93031,-0.0361 -2.43542,-0.21648 l -0.10824,0.37884 c -0.18038,0 -0.55744,0.10824 -0.94711,0.10824 -0.48708,0 -0.51414,0.16236 -1.40713,0.16236 -0.892989,0 -0.622391,-0.0541 -1.4341894,-0.10824 -0.81181,-0.0541 -3.842561,2.27306 -4.383761,3.03075 -0.54121,0.75768 -0.21649,2.59778 -0.21649,3.43665 0,0.75379 -0.10824,2.43542 0,3.30135 z";const d_=(e,t,n)=>{const i=e.states[t],a=n?.state?n.state:i?i.state:null;if(!a)return null;const r=s(t),o=i?i.attributes:null;return n?.entity?.translation_key&&e.localize(`component.${n.entity.platform}.entity.${r}.${n.entity.translation_key}.state.${a}`)||o?.device_class&&e.localize(`component.${r}.state.${o.device_class}.${a}`)||e.localize(`component.${r}.state._.${a}`)||a};let u_=class extends ge{_renderItem(e){if(!this.hass)return;const t=gp(this.hass,{...e});return K` + {t.detail.config=e}} + .actionHandler=${wm({hasHold:gm(e.hold_action),hasDoubleClick:gm(e.double_tap_action)})} + > + ${t.title||""} + ${e.subtitle?K`${e.subtitle}`:""} + ${(e=>e.icon?K` + `:K``)(t)} + + `}render(){return this.submenu?K` + e.stopPropagation()} + @click=${e=>vm(e)} + > + + + + ${this.submenu.items.map(this._renderItem.bind(this))} + + `:K``}static get styles(){return b("ha-icon-button.button {\n color: var(--secondary-color, white);\n background-color: rgba(0, 0, 0, 0.6);\n border-radius: 50%;\n padding: 0px;\n margin: 3px;\n --ha-icon-display: block;\n /* Buttons can always be clicked */\n pointer-events: auto;\n opacity: 0.9;\n}\n\n@keyframes pulse {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0.6;\n }\n 100% {\n opacity: 1;\n }\n}\nha-icon[data-domain=alert][data-state=on],\nha-icon[data-domain=automation][data-state=on],\nha-icon[data-domain=binary_sensor][data-state=on],\nha-icon[data-domain=calendar][data-state=on],\nha-icon[data-domain=camera][data-state=streaming],\nha-icon[data-domain=cover][data-state=open],\nha-icon[data-domain=fan][data-state=on],\nha-icon[data-domain=humidifier][data-state=on],\nha-icon[data-domain=light][data-state=on],\nha-icon[data-domain=input_boolean][data-state=on],\nha-icon[data-domain=lock][data-state=unlocked],\nha-icon[data-domain=media_player][data-state=on],\nha-icon[data-domain=media_player][data-state=paused],\nha-icon[data-domain=media_player][data-state=playing],\nha-icon[data-domain=script][data-state=on],\nha-icon[data-domain=sun][data-state=above_horizon],\nha-icon[data-domain=switch][data-state=on],\nha-icon[data-domain=timer][data-state=active],\nha-icon[data-domain=vacuum][data-state=cleaning],\nha-icon[data-domain=group][data-state=on],\nha-icon[data-domain=group][data-state=home],\nha-icon[data-domain=group][data-state=open],\nha-icon[data-domain=group][data-state=locked],\nha-icon[data-domain=group][data-state=problem] {\n color: var(--paper-item-icon-active-color, #fdd835);\n}\n\nha-icon[data-domain=climate][data-state=cooling] {\n color: var(--cool-color, var(--state-climate-cool-color));\n}\n\nha-icon[data-domain=climate][data-state=heating] {\n color: var(--heat-color, var(--state-climate-heat-color));\n}\n\nha-icon[data-domain=climate][data-state=drying] {\n color: var(--dry-color, var(--state-climate-dry-color));\n}\n\nha-icon[data-domain=alarm_control_panel] {\n color: var(--alarm-color-armed, var(--label-badge-red));\n}\n\nha-icon[data-domain=alarm_control_panel][data-state=disarmed] {\n color: var(--alarm-color-disarmed, var(--label-badge-green));\n}\n\nha-icon[data-domain=alarm_control_panel][data-state=pending],\nha-icon[data-domain=alarm_control_panel][data-state=arming] {\n color: var(--alarm-color-pending, var(--label-badge-yellow));\n animation: pulse 1s infinite;\n}\n\nha-icon[data-domain=alarm_control_panel][data-state=triggered] {\n color: var(--alarm-color-triggered, var(--label-badge-red));\n animation: pulse 1s infinite;\n}\n\nha-icon[data-domain=plant][data-state=problem],\nha-icon[data-domain=zwave][data-state=dead] {\n color: var(--state-icon-error-color);\n}\n\n/* Color the icon if unavailable */\nha-icon[data-state=unavailable] {\n color: var(--state-unavailable-color);\n}\n\nha-icon-button[data-domain=alert][data-state=on],\nha-icon-button[data-domain=automation][data-state=on],\nha-icon-button[data-domain=binary_sensor][data-state=on],\nha-icon-button[data-domain=calendar][data-state=on],\nha-icon-button[data-domain=camera][data-state=streaming],\nha-icon-button[data-domain=cover][data-state=open],\nha-icon-button[data-domain=fan][data-state=on],\nha-icon-button[data-domain=humidifier][data-state=on],\nha-icon-button[data-domain=light][data-state=on],\nha-icon-button[data-domain=input_boolean][data-state=on],\nha-icon-button[data-domain=lock][data-state=unlocked],\nha-icon-button[data-domain=media_player][data-state=on],\nha-icon-button[data-domain=media_player][data-state=paused],\nha-icon-button[data-domain=media_player][data-state=playing],\nha-icon-button[data-domain=script][data-state=on],\nha-icon-button[data-domain=sun][data-state=above_horizon],\nha-icon-button[data-domain=switch][data-state=on],\nha-icon-button[data-domain=timer][data-state=active],\nha-icon-button[data-domain=vacuum][data-state=cleaning],\nha-icon-button[data-domain=group][data-state=on],\nha-icon-button[data-domain=group][data-state=home],\nha-icon-button[data-domain=group][data-state=open],\nha-icon-button[data-domain=group][data-state=locked],\nha-icon-button[data-domain=group][data-state=problem] {\n color: var(--paper-item-icon-active-color, #fdd835);\n}\n\nha-icon-button[data-domain=climate][data-state=cooling] {\n color: var(--cool-color, var(--state-climate-cool-color));\n}\n\nha-icon-button[data-domain=climate][data-state=heating] {\n color: var(--heat-color, var(--state-climate-heat-color));\n}\n\nha-icon-button[data-domain=climate][data-state=drying] {\n color: var(--dry-color, var(--state-climate-dry-color));\n}\n\nha-icon-button[data-domain=alarm_control_panel] {\n color: var(--alarm-color-armed, var(--label-badge-red));\n}\n\nha-icon-button[data-domain=alarm_control_panel][data-state=disarmed] {\n color: var(--alarm-color-disarmed, var(--label-badge-green));\n}\n\nha-icon-button[data-domain=alarm_control_panel][data-state=pending],\nha-icon-button[data-domain=alarm_control_panel][data-state=arming] {\n color: var(--alarm-color-pending, var(--label-badge-yellow));\n animation: pulse 1s infinite;\n}\n\nha-icon-button[data-domain=alarm_control_panel][data-state=triggered] {\n color: var(--alarm-color-triggered, var(--label-badge-red));\n animation: pulse 1s infinite;\n}\n\nha-icon-button[data-domain=plant][data-state=problem],\nha-icon-button[data-domain=zwave][data-state=dead] {\n color: var(--state-icon-error-color);\n}\n\n/* Color the icon if unavailable */\nha-icon-button[data-state=unavailable] {\n color: var(--state-unavailable-color);\n}\n\n:host {\n pointer-events: auto;\n}\n\nmwc-list-item {\n z-index: 20;\n}")}};e([be({attribute:!1})],u_.prototype,"hass",void 0),e([be({attribute:!1})],u_.prototype,"submenu",void 0),u_=e([_e("frigate-card-submenu")],u_);let h_=class extends ge{shouldUpdate(e){const t=e.get("hass");return!e.has("hass")||!t||!this.submenuSelect||up(this.hass,t,[this.submenuSelect.entity])}async _refreshOptionTitles(){if(!this.hass||!this.submenuSelect)return;const e=this.submenuSelect.entity,t=this.hass.states[e]?.attributes?.options,n=await(this.entityRegistryManager?.getEntity(this.hass,e))??null,i={};for(const a of t){const t=d_(this.hass,e,{...n&&{entity:n},state:a});t&&(i[a]=t)}this._optionTitles=i}willUpdate(){if(!this.submenuSelect||!this.hass)return;this._optionTitles||this._refreshOptionTitles();const e=this.submenuSelect.entity,t=this.hass.states[e],n=t?.attributes?.options;if(!t||!n)return;const i={icon:op("select"),...gp(this.hass,this.submenuSelect),...this.submenuSelect,type:"custom:frigate-card-menu-submenu",items:[]};delete i.options;for(const a of n){const n=this._optionTitles?.[a]??a;i.items.push({state_color:!0,selected:t.state===a,enabled:!0,title:n||a,...(e.startsWith("select.")||e.startsWith("input_select."))&&{tap_action:{action:"call-service",service:e.startsWith("select.")?"select.select_option":"input_select.select_option",service_data:{entity_id:e,option:a}}},...this.submenuSelect.options&&this.submenuSelect.options[a]})}this._generatedSubmenu=i}render(){return K` `}};var m_;e([be({attribute:!1})],h_.prototype,"hass",void 0),e([be({attribute:!1})],h_.prototype,"submenuSelect",void 0),e([be({attribute:!1})],h_.prototype,"entityRegistryManager",void 0),e([we()],h_.prototype,"_optionTitles",void 0),h_=e([_e("frigate-card-submenu-select")],h_);let p_=m_=class extends ge{constructor(){super(...arguments),this.expanded=!1,this.buttons=[]}set menuConfig(e){this._menuConfig=e,e&&this.style.setProperty("--frigate-card-menu-button-size",`${e.button_size}px`),this.setAttribute("data-style",e.style),this.setAttribute("data-position",e.position),this.setAttribute("data-alignment",e.alignment)}static isHidingMenu(e){return"hidden"===e?.style??!1}toggleMenu(){this._isHidingMenu()&&(this.expanded=!this.expanded)}_isHidingMenu(){return m_.isHidingMenu(this._menuConfig)}_isMenuToggleAction(e){if(!e)return!1;const t=um(e);return!!t&&"menu_toggle"==t.frigate_card_action}_actionHandler(e,t){if(!e)return;e.detail.config&&(t=e.detail.config),e.stopPropagation();const n=e.detail.action;let i=mm(n,t);if(!t||!n)return;let a=!1,r=!1;if(Array.isArray(i)){const e=i.length;i=i.filter((e=>!this._isMenuToggleAction(e))),i.length!=e&&(r=!0),i.length&&(a=pm(this,this.hass,t,n,i))}else this._isMenuToggleAction(i)?r=!0:a=pm(this,this.hass,t,n,i);this._isHidingMenu()&&(r?this.expanded=!this.expanded:a&&(this.expanded=!1))}willUpdate(e){const t=this._menuConfig?.style,n=(e,n)=>{if("hidden"===t){if(e.icon===nu)return-1;if(n.icon===nu)return 1}return void 0===e.priority||void 0!==n.priority&&n.priority>e.priority?1:void 0===n.priority||void 0!==e.priority&&n.priority + `;if("custom:frigate-card-menu-submenu-select"===e.type)return K` + `;let t={...e};const n=t.icon===nu?l_:"";this.hass&&"custom:frigate-card-menu-state-icon"===e.type&&(t=gp(this.hass,t));const i=gm(e.hold_action),a=gm(e.double_tap_action);return K` this._actionHandler(t,e)} + > + ${n?K``:K``} + `}render(){if(!this._menuConfig)return;const e=this._menuConfig.style;if("none"===e)return;const t=("hidden"!==e||this.expanded?this.buttons.filter((e=>!e.alignment||"matching"===e.alignment)):this.buttons.filter((e=>e.icon===nu))).filter((e=>!1!==e.enabled)),n="hidden"!==e||this.expanded?this.buttons.filter((e=>"opposing"===e.alignment&&!1!==e.enabled)):[],i={flex:String(t.length)},a={flex:String(n.length)};return K`
+ ${t.map((e=>this._renderButton(e)))} +
+
+ ${n.map((e=>this._renderButton(e)))} +
`}static get styles(){return b('ha-icon-button.button {\n color: var(--secondary-color, white);\n background-color: rgba(0, 0, 0, 0.6);\n border-radius: 50%;\n padding: 0px;\n margin: 3px;\n --ha-icon-display: block;\n /* Buttons can always be clicked */\n pointer-events: auto;\n opacity: 0.9;\n}\n\n@keyframes pulse {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0.6;\n }\n 100% {\n opacity: 1;\n }\n}\nha-icon[data-domain=alert][data-state=on],\nha-icon[data-domain=automation][data-state=on],\nha-icon[data-domain=binary_sensor][data-state=on],\nha-icon[data-domain=calendar][data-state=on],\nha-icon[data-domain=camera][data-state=streaming],\nha-icon[data-domain=cover][data-state=open],\nha-icon[data-domain=fan][data-state=on],\nha-icon[data-domain=humidifier][data-state=on],\nha-icon[data-domain=light][data-state=on],\nha-icon[data-domain=input_boolean][data-state=on],\nha-icon[data-domain=lock][data-state=unlocked],\nha-icon[data-domain=media_player][data-state=on],\nha-icon[data-domain=media_player][data-state=paused],\nha-icon[data-domain=media_player][data-state=playing],\nha-icon[data-domain=script][data-state=on],\nha-icon[data-domain=sun][data-state=above_horizon],\nha-icon[data-domain=switch][data-state=on],\nha-icon[data-domain=timer][data-state=active],\nha-icon[data-domain=vacuum][data-state=cleaning],\nha-icon[data-domain=group][data-state=on],\nha-icon[data-domain=group][data-state=home],\nha-icon[data-domain=group][data-state=open],\nha-icon[data-domain=group][data-state=locked],\nha-icon[data-domain=group][data-state=problem] {\n color: var(--paper-item-icon-active-color, #fdd835);\n}\n\nha-icon[data-domain=climate][data-state=cooling] {\n color: var(--cool-color, var(--state-climate-cool-color));\n}\n\nha-icon[data-domain=climate][data-state=heating] {\n color: var(--heat-color, var(--state-climate-heat-color));\n}\n\nha-icon[data-domain=climate][data-state=drying] {\n color: var(--dry-color, var(--state-climate-dry-color));\n}\n\nha-icon[data-domain=alarm_control_panel] {\n color: var(--alarm-color-armed, var(--label-badge-red));\n}\n\nha-icon[data-domain=alarm_control_panel][data-state=disarmed] {\n color: var(--alarm-color-disarmed, var(--label-badge-green));\n}\n\nha-icon[data-domain=alarm_control_panel][data-state=pending],\nha-icon[data-domain=alarm_control_panel][data-state=arming] {\n color: var(--alarm-color-pending, var(--label-badge-yellow));\n animation: pulse 1s infinite;\n}\n\nha-icon[data-domain=alarm_control_panel][data-state=triggered] {\n color: var(--alarm-color-triggered, var(--label-badge-red));\n animation: pulse 1s infinite;\n}\n\nha-icon[data-domain=plant][data-state=problem],\nha-icon[data-domain=zwave][data-state=dead] {\n color: var(--state-icon-error-color);\n}\n\n/* Color the icon if unavailable */\nha-icon[data-state=unavailable] {\n color: var(--state-unavailable-color);\n}\n\nha-icon-button[data-domain=alert][data-state=on],\nha-icon-button[data-domain=automation][data-state=on],\nha-icon-button[data-domain=binary_sensor][data-state=on],\nha-icon-button[data-domain=calendar][data-state=on],\nha-icon-button[data-domain=camera][data-state=streaming],\nha-icon-button[data-domain=cover][data-state=open],\nha-icon-button[data-domain=fan][data-state=on],\nha-icon-button[data-domain=humidifier][data-state=on],\nha-icon-button[data-domain=light][data-state=on],\nha-icon-button[data-domain=input_boolean][data-state=on],\nha-icon-button[data-domain=lock][data-state=unlocked],\nha-icon-button[data-domain=media_player][data-state=on],\nha-icon-button[data-domain=media_player][data-state=paused],\nha-icon-button[data-domain=media_player][data-state=playing],\nha-icon-button[data-domain=script][data-state=on],\nha-icon-button[data-domain=sun][data-state=above_horizon],\nha-icon-button[data-domain=switch][data-state=on],\nha-icon-button[data-domain=timer][data-state=active],\nha-icon-button[data-domain=vacuum][data-state=cleaning],\nha-icon-button[data-domain=group][data-state=on],\nha-icon-button[data-domain=group][data-state=home],\nha-icon-button[data-domain=group][data-state=open],\nha-icon-button[data-domain=group][data-state=locked],\nha-icon-button[data-domain=group][data-state=problem] {\n color: var(--paper-item-icon-active-color, #fdd835);\n}\n\nha-icon-button[data-domain=climate][data-state=cooling] {\n color: var(--cool-color, var(--state-climate-cool-color));\n}\n\nha-icon-button[data-domain=climate][data-state=heating] {\n color: var(--heat-color, var(--state-climate-heat-color));\n}\n\nha-icon-button[data-domain=climate][data-state=drying] {\n color: var(--dry-color, var(--state-climate-dry-color));\n}\n\nha-icon-button[data-domain=alarm_control_panel] {\n color: var(--alarm-color-armed, var(--label-badge-red));\n}\n\nha-icon-button[data-domain=alarm_control_panel][data-state=disarmed] {\n color: var(--alarm-color-disarmed, var(--label-badge-green));\n}\n\nha-icon-button[data-domain=alarm_control_panel][data-state=pending],\nha-icon-button[data-domain=alarm_control_panel][data-state=arming] {\n color: var(--alarm-color-pending, var(--label-badge-yellow));\n animation: pulse 1s infinite;\n}\n\nha-icon-button[data-domain=alarm_control_panel][data-state=triggered] {\n color: var(--alarm-color-triggered, var(--label-badge-red));\n animation: pulse 1s infinite;\n}\n\nha-icon-button[data-domain=plant][data-state=problem],\nha-icon-button[data-domain=zwave][data-state=dead] {\n color: var(--state-icon-error-color);\n}\n\n/* Color the icon if unavailable */\nha-icon-button[data-state=unavailable] {\n color: var(--state-unavailable-color);\n}\n\n:host {\n --frigate-card-menu-button-size: 40px;\n --mdc-icon-button-size: var(--frigate-card-menu-button-size);\n --mdc-icon-size: calc(var(--mdc-icon-button-size) / 2);\n pointer-events: none;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n}\n\n/***********************************\n * Aligned divs: matching & opposing\n ***********************************/\ndiv.matching,\ndiv.opposing {\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n align-items: flex-start;\n min-width: 0px;\n min-height: 0px;\n}\n\ndiv.matching {\n justify-content: flex-start;\n}\n\ndiv.opposing {\n justify-content: flex-end;\n}\n\n/********************\n * Outside menu style\n ********************/\n:host([data-style=outside]) {\n width: 100%;\n background: var(--secondary-background-color);\n}\n\n/************************************\n * Match menu rounded corners to card\n ************************************/\n:host([data-position=top]),\n:host([data-position=left]) {\n border-top-left-radius: var(--ha-card-border-radius, 4px);\n}\n\n:host([data-position=top]),\n:host([data-position=right]) {\n border-top-right-radius: var(--ha-card-border-radius, 4px);\n}\n\n:host([data-position=bottom]),\n:host([data-position=left]) {\n border-bottom-left-radius: var(--ha-card-border-radius, 4px);\n}\n\n:host([data-position=bottom]),\n:host([data-position=right]) {\n border-bottom-right-radius: var(--ha-card-border-radius, 4px);\n}\n\n/**************************************\n * Positioning for absolute menu styles\n **************************************/\n:host(:not([data-style=outside])[data-position=top]),\n:host(:not([data-style=outside])[data-position=left][data-alignment=top]),\n:host(:not([data-style=outside])[data-position=right][data-alignment=top]) {\n top: 0px;\n}\n\n:host(:not([data-style=outside])[data-position=bottom]),\n:host(:not([data-style=outside])[data-position=left][data-alignment=bottom]),\n:host(:not([data-style=outside])[data-position=right][data-alignment=bottom]) {\n bottom: 0px;\n}\n\n:host(:not([data-style=outside])[data-position=left]),\n:host(:not([data-style=outside])[data-position=top][data-alignment=left]),\n:host(:not([data-style=outside])[data-position=bottom][data-alignment=left]) {\n left: 0px;\n}\n\n:host(:not([data-style=outside])[data-position=right]),\n:host(:not([data-style=outside])[data-position=top][data-alignment=right]),\n:host(:not([data-style=outside])[data-position=bottom][data-alignment=right]) {\n right: 0px;\n}\n\n/********************************************************\n * Hack: Ensure host & div expand for column flex layouts\n ********************************************************/\n:host(:not([data-style=outside])[data-position=left]) {\n writing-mode: vertical-lr;\n}\n\n:host(:not([data-style=outside])[data-position=right]) {\n writing-mode: vertical-rl;\n}\n\n:host(:not([data-style=outside])[data-style=overlay][data-position=left]) div > *,\n:host(:not([data-style=outside])[data-style=overlay][data-position=right]) div > *,\n:host(:not([data-style=outside])[data-style*=hover][data-position=left]) div > *,\n:host(:not([data-style=outside])[data-style*=hover][data-position=right]) div > *,\n:host(:not([data-style=outside])[data-style=hidden][data-position=left]) div > *,\n:host(:not([data-style=outside])[data-style=hidden][data-position=right]) div > * {\n writing-mode: horizontal-tb;\n}\n\n/**********************\n * "Reverse" alignments\n **********************/\n:host(:not([data-style=outside])[data-position=left][data-alignment=bottom]),\n:host(:not([data-style=outside])[data-position=right][data-alignment=bottom]),\n:host([data-position=top][data-alignment=right]),\n:host([data-position=bottom][data-alignment=right]),\n:host(:not([data-style=outside])[data-position=left][data-alignment=bottom]) div,\n:host(:not([data-style=outside])[data-position=right][data-alignment=bottom]) div,\n:host([data-position=top][data-alignment=right]) div,\n:host([data-position=bottom][data-alignment=right]) div {\n flex-direction: row-reverse;\n}\n\n/****************************\n * Wrap upwards on the bottom\n ****************************/\n:host(:not([data-style=outside])[data-position=bottom]) div {\n flex-wrap: wrap-reverse;\n}\n\n/********************************************\n * Positioning for absolute based menu styles\n ********************************************/\n:host([data-style=overlay]),\n:host([data-style*=hover]),\n:host([data-style=hidden]) {\n position: absolute;\n overflow: hidden;\n width: calc(var(--frigate-card-menu-button-size) + 6px);\n height: calc(var(--frigate-card-menu-button-size) + 6px);\n}\n\n:host([data-style=overlay][data-position=top]),\n:host([data-style=overlay][data-position=bottom]),\n:host([data-style*=hover][data-position=top]),\n:host([data-style*=hover][data-position=bottom]),\n:host([data-style=hidden][data-position=top][expanded]),\n:host([data-style=hidden][data-position=bottom][expanded]) {\n width: 100%;\n height: auto;\n overflow: visible;\n background: linear-gradient(90deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0));\n}\n\n:host([data-style=overlay][data-position=left]),\n:host([data-style=overlay][data-position=right]),\n:host([data-style*=hover][data-position=left]),\n:host([data-style*=hover][data-position=right]),\n:host([data-style=hidden][data-position=left][expanded]),\n:host([data-style=hidden][data-position=right][expanded]) {\n height: 100%;\n width: auto;\n overflow: visible;\n background: linear-gradient(180deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0));\n}')}};function f_(e){return"number"==typeof e}function g_(e){return"[object Object]"===Object.prototype.toString.call(e)}function v_(e){return g_(e)||function(e){return Array.isArray(e)}(e)}function __(e){return Math.abs(e)}function y_(e){return e?e/__(e):0}function b_(e,t){return __(e-t)}function w_(e){return $_(e).map(Number)}function x_(e){return e[C_(e)]}function C_(e){return Math.max(0,e.length-1)}function $_(e){return Object.keys(e)}function k_(e,t){return[e,t].reduce((function(e,t){return $_(t).forEach((function(n){var i=e[n],a=t[n],r=g_(i)&&g_(a);e[n]=r?k_(i,a):a})),e}),{})}function E_(e,t){var n=$_(e),i=$_(t);return n.length===i.length&&n.every((function(n){var i=e[n],a=t[n];return"function"==typeof i?"".concat(i)==="".concat(a):v_(i)&&v_(a)?E_(i,a):i===a}))}function M_(e,t){var n={start:function(){return 0},center:function(e){return i(e)/2},end:i};function i(e){return t-e}var a={measure:function(i){return f_(e)?t*Number(e):n[e](i)}};return a}function S_(e,t){var n=__(e-t);function i(t){return tt}function r(e){return i(e)||a(e)}var o={length:n,max:t,min:e,constrain:function(n){return r(n)?i(n)?e:t:n},reachedAny:r,reachedMax:a,reachedMin:i,removeOffset:function(e){return n?e-n*Math.ceil((e-t)/n):e}};return o}function T_(e,t,n){var i=S_(0,e),a=i.min,r=i.constrain,o=e+1,s=c(t);function c(e){return n?__((o+e)%o):r(e)}function l(){return s}function d(e){return s=c(e),u}var u={add:function(e){return d(l()+e)},clone:function(){return T_(e,l(),n)},get:l,set:d,min:a,max:e};return u}function A_(){var e=[];var t={add:function(n,i,a,r){return void 0===r&&(r={passive:!0}),n.addEventListener(i,a,r),e.push((function(){return n.removeEventListener(i,a,r)})),t},removeAll:function(){return e=e.filter((function(e){return e()})),t}};return t}function z_(e){var t=e;function n(e){return t/=e,a}function i(e){return f_(e)?e:e.get()}var a={add:function(e){return t+=i(e),a},divide:n,get:function(){return t},multiply:function(e){return t*=e,a},normalize:function(){return 0!==t&&n(t),a},set:function(e){return t=i(e),a},subtract:function(e){return t-=i(e),a}};return a}function j_(e,t,n,i,a,r,o,s,c,l,d,u,h,m,p,f){var g=e.cross,v=["INPUT","SELECT","TEXTAREA"],_={passive:!1},y=z_(0),b=A_(),w=A_(),x=h.measure(20),C={mouse:300,touch:400},$={mouse:500,touch:600},k=p?5:16,E=1,M=0,S=0,T=!1,A=!1,z=!1,j=!1;function O(e){if(!((j=!a.isTouchEvent(e))&&0!==e.button||function(e){var t=e.nodeName||"";return v.indexOf(t)>-1}(e.target))){var t,o=b_(i.get(),r.get())>=2,s=j||!o;T=!0,a.pointerDown(e),y.set(i),i.set(r),c.useBaseMass().useSpeed(80),t=j?document:n,w.add(t,"touchmove",I,_).add(t,"touchend",R).add(t,"mousemove",I,_).add(t,"mouseup",R),M=a.readPoint(e),S=a.readPoint(e,g),u.emit("pointerDown"),s&&(z=!1)}}function I(e){if(!A&&!j){if(!e.cancelable)return R(e);var n=a.readPoint(e),r=a.readPoint(e,g),s=b_(n,M),c=b_(r,S);if(!(A=s>c)&&!z)return R(e)}var l=a.pointerMove(e);!z&&l&&(z=!0),o.start(),i.add(t.apply(l)),e.preventDefault()}function R(e){var n=l.byDistance(0,!1).index!==d.get(),r=a.pointerUp(e)*(p?$:C)[j?"mouse":"touch"],o=function(e,t){var n=d.clone().add(-1*y_(e)),i=n.get()===d.min||n.get()===d.max,a=l.byDistance(e,!p).distance;return p||__(e)=.5,v=n&&h>.75,_=__(r)0?e.concat([n]):e}),[])}function f(n,a){var r="start"===a,l=r?-i:i,d=o.findSlideBounds([l]);return n.map((function(n){var a=r?0:-i,o=r?i:0,l=d.filter((function(e){return e.index===n}))[0],u=l[r?"end":"start"],h=z_(-1),m=z_(-1),p=N_(e,t,c[n]);return{index:n,location:m,translate:p,target:function(){return h.set(s.get()>u?a:o)}}}))}var g={canLoop:function(){return h.every((function(e){var t=e.index,i=d.filter((function(e){return e!==t}));return m(i,n)<=.1}))},clear:function(){h.forEach((function(e){return e.translate.clear()}))},loop:function(){h.forEach((function(e){var t=e.target,n=e.translate,i=e.location,a=t();a.get()!==i.get()&&(0===a.get()?n.clear():n.to(a),i.set(a))}))},loopPoints:h};return g}function F_(e,t,n,i,a,r,o){var s=a.removeOffset,c=a.constrain,l=.5,d=r?[0,t,-t]:[0],u=h(d,o);function h(t,a){var r=t||d,o=function(e){var t=e||0;return n.map((function(e){return S_(l,e-l).constrain(e*t)}))}(a);return r.reduce((function(t,a){var r=i.map((function(t,i){return{start:t-n[i]+o[i]+a,end:t+e-o[i]+a,index:i}}));return t.concat(r)}),[])}return{check:function(e,t){var n=r?s(e):c(e);return(t||u).reduce((function(e,t){var i=t.index,a=t.start,r=t.end;return!(-1!==e.indexOf(i))&&(an)?e.concat([i]):e}),[])},findSlideBounds:h}}function H_(e,t,n){var i=f_(n);var a={groupSlides:function(a){return i?function(e,t){return w_(e).filter((function(e){return e%t==0})).map((function(n){return e.slice(n,n+t)}))}(a,n):function(n){return w_(n).reduce((function(n,i){var a=t.slice(x_(n),i+1).reduce((function(e,t){return e+t}),0);return!i||a>e?n.concat(i):n}),[]).map((function(e,t,i){return n.slice(e,i[t+1])}))}(a)}};return a}function Z_(e,t,n,i,a){var r=i.align,o=i.axis,s=i.direction,c=i.startIndex,l=i.inViewThreshold,d=i.loop,u=i.speed,h=i.dragFree,m=i.slidesToScroll,p=i.skipSnaps,f=i.containScroll,g=t.getBoundingClientRect(),v=n.map((function(e){return e.getBoundingClientRect()})),_=function(e){var t="rtl"===e?-1:1,n={apply:function(e){return e*t}};return n}(s),y=function(e,t){var n="y"===e?"y":"x";return{scroll:n,cross:"y"===e?"x":"y",startEdge:"y"===n?"top":"rtl"===t?"right":"left",endEdge:"y"===n?"bottom":"rtl"===t?"left":"right",measureSize:function(e){var t=e.width,i=e.height;return"x"===n?t:i}}}(o,s),b=y.measureSize(g),w=function(e){var t={measure:function(t){return e*(t/100)}};return t}(b),x=M_(r,b),C=!d&&""!==f,$=function(e,t,n,i,a){var r=e.measureSize,o=e.startEdge,s=e.endEdge,c=n[0]&&a,l=function(){if(!c)return 0;var e=n[0];return __(t[o]-e[o])}(),d=function(){if(!c)return 0;var e=window.getComputedStyle(x_(i));return parseFloat(e.getPropertyValue("margin-".concat(s)))}(),u=n.map(r),h=n.map((function(e,t,n){var i=!t,a=t===C_(n);return i?u[t]+l:a?u[t]+d:n[t+1][o]-e[o]})).map(__);return{slideSizes:u,slideSizesWithGaps:h}}(y,g,v,n,d||""!==f),k=$.slideSizes,E=$.slideSizesWithGaps,M=H_(b,E,m),S=function(e,t,n,i,a,r,o){var s,c=e.startEdge,l=e.endEdge,d=r.groupSlides,u=d(i).map((function(e){return x_(e)[l]-e[0][c]})).map(__).map(t.measure),h=i.map((function(e){return n[c]-e[c]})).map((function(e){return-__(e)})),m=(s=x_(h)-x_(a),d(h).map((function(e){return e[0]})).map((function(e,t,n){var i=!t,a=t===C_(n);return o&&i?0:o&&a?s:e+u[t]})));return{snaps:h,snapsAligned:m}}(y,x,g,v,E,M,C),T=S.snaps,A=S.snapsAligned,z=-x_(T)+x_(E),j=R_(b,z,A,f).snapsContained,O=C?j:A,I=function(e,t,n){var i,a;return{limit:(i=t[0],a=x_(t),S_(n?i-e:a,i))}}(z,O,d).limit,R=T_(C_(O),c,d),D=R.clone(),P=w_(n),L=function(e){var t=0;function n(e,n){return function(){e===!!t&&n()}}function i(){t=window.requestAnimationFrame(e)}return{proceed:n(!0,i),start:n(!1,i),stop:n(!0,(function(){window.cancelAnimationFrame(t),t=0}))}}((function(){d||B.scrollBounds.constrain(B.dragHandler.pointerDown()),B.scrollBody.seek(F).update();var e=B.scrollBody.settle(F);e&&!B.dragHandler.pointerDown()&&(B.animation.stop(),a.emit("settle")),e||a.emit("scroll"),d&&(B.scrollLooper.loop(B.scrollBody.direction()),B.slideLooper.loop()),B.translate.to(U),B.animation.proceed()})),N=O[R.get()],U=z_(N),F=z_(N),H=O_(U,u,1),Z=L_(d,O,z,I,F),q=function(e,t,n,i,a,r){function o(i){var o=i.distance,s=i.index!==t.get();o&&(e.start(),a.add(o)),s&&(n.set(t.get()),t.set(i.index),r.emit("select"))}var s={distance:function(e,t){o(i.byDistance(e,t))},index:function(e,n){var a=t.clone().set(e);o(i.byIndex(a.get(),n))}};return s}(L,R,D,Z,F,a),V=F_(b,z,k,T,I,d,l),W=j_(y,_,e,F,function(e){var t,n,i=170;function a(e){return"undefined"!=typeof TouchEvent&&e instanceof TouchEvent}function r(e){return e.timeStamp}function o(t,n){var i=n||e.scroll,r="client".concat("x"===i?"X":"Y");return(a(t)?t.touches[0]:t)[r]}return{isTouchEvent:a,pointerDown:function(e){return t=e,n=e,o(e)},pointerMove:function(e){var a=o(e)-o(n),s=r(e)-r(t)>i;return n=e,s&&(t=e),a},pointerUp:function(e){if(!t||!n)return 0;var a=o(n)-o(t),s=r(e)-r(t),c=r(e)-r(n)>i,l=a/s;return s&&!c&&__(l)>.1?l:0},readPoint:o}}(y),U,L,q,H,Z,R,a,w,d,h,p),B={containerRect:g,slideRects:v,animation:L,axis:y,direction:_,dragHandler:W,eventStore:A_(),percentOfView:w,index:R,indexPrevious:D,limit:I,location:U,options:i,scrollBody:H,scrollBounds:I_(I,U,F,H,w),scrollLooper:D_(z,I,U,[U,F]),scrollProgress:P_(I),scrollSnaps:O,scrollTarget:Z,scrollTo:q,slideLooper:U_(y,_,b,z,E,O,V,U,n),slidesToScroll:M,slidesInView:V,slideIndexes:P,target:F,translate:N_(y,_,t)};return B}e([be({attribute:!1})],p_.prototype,"hass",void 0),e([be({attribute:!0,type:Boolean,reflect:!0})],p_.prototype,"expanded",void 0),e([we()],p_.prototype,"_menuConfig",void 0),e([be({attribute:!1})],p_.prototype,"buttons",void 0),e([be({attribute:!1})],p_.prototype,"entityRegistryManager",void 0),p_=m_=e([_e("frigate-card-menu")],p_);var q_={align:"center",axis:"x",containScroll:"",direction:"ltr",slidesToScroll:1,breakpoints:{},dragFree:!1,draggable:!0,inViewThreshold:0,loop:!1,skipSnaps:!1,speed:10,startIndex:0,active:!0};function V_(){function e(e,t){return k_(e,t||{})}var t={merge:e,areEqual:function(e,t){return JSON.stringify($_(e.breakpoints||{}))===JSON.stringify($_(t.breakpoints||{}))&&E_(e,t)},atMedia:function(t){var n=t.breakpoints||{},i=$_(n).filter((function(e){return window.matchMedia(e).matches})).map((function(e){return n[e]})).reduce((function(t,n){return e(t,n)}),{});return e(t,i)}};return t}function W_(e,t,n){var i,a,r,o,s,c=A_(),l=V_(),d=function(){var e=V_(),t=e.atMedia,n=e.areEqual,i=[],a=[];function r(e){var i=t(e.options);return function(){return!n(i,t(e.options))}}var o={init:function(e,n){return a=e.map(r),(i=e.filter((function(e){return t(e.options).active}))).forEach((function(e){return e.init(n)})),e.reduce((function(e,t){var n;return Object.assign(e,((n={})[t.name]=t,n))}),{})},destroy:function(){i=i.filter((function(e){return e.destroy()}))},haveChanged:function(){return a.some((function(e){return e()}))}};return o}(),u=function(){var e={};function t(t){return e[t]||[]}var n={emit:function(e){return t(e).forEach((function(t){return t(e)})),n},off:function(i,a){return e[i]=t(i).filter((function(e){return e!==a})),n},on:function(i,a){return e[i]=t(i).concat([a]),n}};return n}(),h=u.on,m=u.off,p=w,f=!1,g=l.merge(q_,W_.globalOptions),v=l.merge(g),_=[],y=0;function b(t,n){if(!f){var c,h;if(c="container"in e&&e.container,h="slides"in e&&e.slides,r="root"in e?e.root:e,o=c||r.children[0],s=h||[].slice.call(o.children),g=l.merge(g,t),v=l.atMedia(g),i=Z_(r,o,s,v,u),y=i.axis.measureSize(r.getBoundingClientRect()),!v.active)return x();if(i.translate.to(i.location),_=n||_,a=d.init(_,E),v.loop){if(!i.slideLooper.canLoop())return x(),b({loop:!1},n),void(g=l.merge(g,{loop:!0}));i.slideLooper.loop()}v.draggable&&o.offsetParent&&s.length&&i.dragHandler.addActivationEvents()}}function w(e,t){var n=k();x(),b(l.merge({startIndex:n},e),t),u.emit("reInit")}function x(){i.dragHandler.removeAllEvents(),i.animation.stop(),i.eventStore.removeAll(),i.translate.clear(),i.slideLooper.clear(),d.destroy()}function C(e){var t=i[e?"target":"location"].get(),n=v.loop?"removeOffset":"constrain";return i.slidesInView.check(i.limit[n](t))}function $(e,t,n){v.active&&!f&&(i.scrollBody.useBaseMass().useSpeed(t?100:v.speed),i.scrollTo.index(e,n||0))}function k(){return i.index.get()}var E={canScrollNext:function(){return i.index.clone().add(1).get()!==k()},canScrollPrev:function(){return i.index.clone().add(-1).get()!==k()},clickAllowed:function(){return i.dragHandler.clickAllowed()},containerNode:function(){return o},internalEngine:function(){return i},destroy:function(){f||(f=!0,c.removeAll(),x(),u.emit("destroy"))},off:m,on:h,plugins:function(){return a},previousScrollSnap:function(){return i.indexPrevious.get()},reInit:p,rootNode:function(){return r},scrollNext:function(e){$(i.index.clone().add(1).get(),!0===e,-1)},scrollPrev:function(e){$(i.index.clone().add(-1).get(),!0===e,1)},scrollProgress:function(){return i.scrollProgress.get(i.location.get())},scrollSnapList:function(){return i.scrollSnaps.map(i.scrollProgress.get)},scrollTo:$,selectedScrollSnap:k,slideNodes:function(){return s},slidesInView:C,slidesNotInView:function(e){var t=C(e);return i.slideIndexes.filter((function(e){return-1===t.indexOf(e)}))}};return b(t,n),c.add(window,"resize",(function(){var e=l.atMedia(g),t=!l.areEqual(e,v),n=i.axis.measureSize(r.getBoundingClientRect()),a=y!==n,o=d.haveChanged();(a||t||o)&&w(),u.emit("resize")})),setTimeout((function(){return u.emit("init")}),0),E}function B_(){return B_=Object.assign||function(e){for(var t=1;t=e;case"y":return Math.abs(a)>=e;case"z":return Math.abs(r)>=e;default:return!1}}(r,i)&&e.preventDefault(),l.isStarted?l.isMomentum&&r>Math.max(2,2*l.lastAbsDelta)&&($(!0),x()):x(),0===r&&Object.is&&Object.is(e.deltaX,-0)?d=!0:(t=e,l.axisMovement=Q_(l.axisMovement,i),l.lastAbsDelta=r,l.scrollPointsToMerge.push({axisDelta:i,timeStamp:a}),f(),m({axisDelta:i,isStart:!l.isStartPublished}),l.isStartPublished=!0,C())},f=function(){var e;l.scrollPointsToMerge.length===iy?(l.scrollPoints.unshift({axisDeltaSum:l.scrollPointsToMerge.map((function(e){return e.axisDelta})).reduce(Q_),timeStamp:(e=l.scrollPointsToMerge.map((function(e){return e.timeStamp})),e.reduce((function(e,t){return e+t}))/e.length)}),v(),l.scrollPointsToMerge.length=0,l.scrollPoints.length=1,l.isMomentum||b()):l.isStartPublished||g()},g=function(){var e;l.axisVelocity=(e=l.scrollPointsToMerge,e[e.length-1]).axisDelta.map((function(e){return e/l.willEndTimeout}))},v=function(){var e=l.scrollPoints,t=e[0],n=e[1];if(n&&t){var i=t.timeStamp-n.timeStamp;if(!(i<=0)){var a=t.axisDeltaSum.map((function(e){return e/i})),r=a.map((function(e,t){return e/(l.axisVelocity[t]||1)}));l.axisVelocity=a,l.accelerationFactors.push(r),_(i)}}},_=function(e){var t=10*Math.ceil(e/10)*1.2;l.isMomentum||(t=Math.max(100,2*t)),l.willEndTimeout=Math.min(1e3,Math.round(t))},y=function(e){return 0===e||e<=ny&&e>=ty},b=function(){if(l.accelerationFactors.length>=ay){if(d&&(d=!1,G_(l.axisVelocity)>=.2))return void w();var e=l.accelerationFactors.slice(-1*ay);e.every((function(e){var t=!!e.reduce((function(e,t){return e&&e<1&&e===t?1:0})),n=e.filter(y).length===e.length;return t||n}))&&w(),l.accelerationFactors=e}},w=function(){l.isMomentum=!0},x=function(){(l=sy()).isStarted=!0,l.startTime=Date.now(),n=void 0,d=!1},C=function(){clearTimeout(i),i=setTimeout($,l.willEndTimeout)},$=function(e){void 0===e&&(e=!1),l.isStarted&&(l.isMomentum&&e?m({isEnding:!0,isMomentumCancel:!0}):m({isEnding:!0}),l.isMomentum=!1,l.isStarted=!1)},k=function(e){var t=[],n=function(n){n.removeEventListener("wheel",e),t=t.filter((function(e){return e!==n}))};return K_({observe:function(i){return i.addEventListener("wheel",e,{passive:!1}),t.push(i),function(){return n(i)}},unobserve:n,disconnect:function(){t.forEach(n)}})}(u),E=k.observe,M=k.unobserve,S=k.disconnect;return h(e),K_({on:r,off:o,observe:E,unobserve:M,disconnect:S,feedWheel:u,updateOptions:h})}var ly={active:!0,breakpoints:{},wheelDraggingClass:"is-wheel-dragging",forceWheelAxis:void 0,target:void 0};function dy(e){var t,n=W_.optionsHandler(),i=n.merge(ly,dy.globalOptions),a=function(){};var r={name:"wheelGestures",options:n.merge(i,e),init:function(e){var i,o;t=n.atMedia(r.options);var s,c=e.internalEngine(),l=null!=(i=t.target)?i:e.containerNode().parentNode,d=null!=(o=t.forceWheelAxis)?o:c.options.axis,u=cy({preventWheelAction:d,reverseSign:[!0,!0,!1]}),h=u.observe(l),m=u.on("wheel",(function(e){var n=e.axisDelta,i=n[0],r=n[1],o="x"===d?i:r,c="x"===d?r:i,u=e.isMomentum&&e.previous&&!e.previous.isMomentum,h=e.isEnding&&!e.isMomentum||u;Math.abs(o)>Math.abs(c)&&!p&&!e.isMomentum&&function(e){try{_(s=new MouseEvent("mousedown",e.event))}catch(e){return a()}p=!0,document.documentElement.addEventListener("mousemove",g,!0),document.documentElement.addEventListener("mouseup",g,!0),void document.documentElement.addEventListener("mousedown",g,!0),t.wheelDraggingClass&&l.classList.add(t.wheelDraggingClass)}(e);if(!p)return;h?function(e){p=!1,_(v("mouseup",e)),f(),t.wheelDraggingClass&&l.classList.remove(t.wheelDraggingClass)}(e):_(v("mousemove",e))})),p=!1;function f(){document.documentElement.removeEventListener("mousemove",g,!0),document.documentElement.removeEventListener("mouseup",g,!0),document.documentElement.removeEventListener("mousedown",g,!0)}function g(e){p&&e.isTrusted&&e.stopImmediatePropagation()}function v(e,t){var n,i;if(d===c.options.axis){var a=t.axisMovement;n=a[0],i=a[1]}else{var r=t.axisMovement;i=r[0],n=r[1]}return new MouseEvent(e,{clientX:s.clientX+n,clientY:s.clientY+i,screenX:s.screenX+n,screenY:s.screenY+i,movementX:n,movementY:i,button:0,bubbles:!0,cancelable:!0,composed:!0})}function _(t){e.containerNode().dispatchEvent(t)}a=function(){h(),m(),f()}},destroy:function(){return a()}};return r}dy.globalOptions=void 0;var uy=":host {\n display: flex;\n flex-direction: column;\n width: 100%;\n margin-left: 5px;\n padding: 5px;\n color: var(--primary-text-color);\n overflow: hidden;\n column-gap: 5%;\n}\n\ndiv.title {\n font-size: 1.2rem;\n font-weight: bold;\n}\n\ndiv.details {\n flex: 1;\n display: flex;\n flex-direction: column;\n flex-wrap: wrap;\n --mdc-icon-size: 16px;\n min-height: 0px;\n}";const hy=(e,t,n,i)=>{const a={...i?.cardWideConfig&&{cardWideConfig:i.cardWideConfig}};return K` ${t.render({initial:()=>i?.inProgressFunc?.()??$v(a),pending:()=>i?.inProgressFunc?.()??$v(a),error:t=>{Nf(t),Mv(e,t)},complete:n})}`},my=0,py=Symbol(); +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */class fy{constructor(e,t,n){this.o=0,this.status=0,this.autoRun=!0,this.i=e,this.i.addController(this);const i="object"==typeof t?t:{task:t,args:n};this.t=i.task,this.h=i.args,void 0!==i.autoRun&&(this.autoRun=i.autoRun),this.taskComplete=new Promise(((e,t)=>{this.l=e,this.u=t}))}hostUpdated(){this.performTask()}async performTask(){var e;const t=null===(e=this.h)||void 0===e?void 0:e.call(this);this.shouldRun(t)&&this.run(t)}shouldRun(e){return this.autoRun&&this.v(e)}async run(e){var t;let n,i;null!=e||(e=null===(t=this.h)||void 0===t?void 0:t.call(this)),2!==this.status&&3!==this.status||(this.taskComplete=new Promise(((e,t)=>{this.l=e,this.u=t}))),this.status=1,this._=void 0,this.m=void 0,this.i.requestUpdate();const a=++this.o;try{n=await this.t(e)}catch(e){i=e}this.o===a&&(n===py?this.status=0:(void 0===i?(this.status=2,this.l(n)):(this.status=3,this.u(i)),this.m=n,this._=i),this.i.requestUpdate())}get value(){return this.m}get error(){return this._}render(e){var t,n,i,a;switch(this.status){case 0:return null===(t=e.initial)||void 0===t?void 0:t.call(e);case 1:return null===(n=e.pending)||void 0===n?void 0:n.call(e);case 2:return null===(i=e.complete)||void 0===i?void 0:i.call(e,this.value);case 3:return null===(a=e.error)||void 0===a?void 0:a.call(e,this.error);default:this.status}}v(e){const t=this.T;return this.T=e,Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.some(((e,n)=>A(e,t[n]))):e!==t}}const gy=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,vy=(e,t,n,i=!0)=>new fy(e,{args:()=>[!!t(),n()],task:async([e,n])=>{const i=t();return e&&i&&n?(async(e,t)=>e&&t?t.startsWith("data:")||t.match(gy)?t:new Promise(((n,i)=>{e?e.fetchWithAuth(t).then((e=>e.blob())).then((e=>{const t=new FileReader;t.onload=()=>{const e=t.result;n("string"==typeof e?e:null)},t.onerror=e=>i(e),t.readAsDataURL(e)})):i()})):null)(i,n):null},autoRun:i});class _y{static isEvent(e){return this.isClip(e)||this.isSnapshot(e)}static isRecording(e){return"recording"===e.getMediaType()}static isClip(e){return"clip"===e.getMediaType()}static isSnapshot(e){return"snapshot"===e.getMediaType()}static isVideo(e){return this.isClip(e)||this.isRecording(e)}}const yy=(e,t="download")=>{const n=new URL(e).origin===window.location.origin,i=e.startsWith("data:");if(navigator.userAgent.startsWith("Home Assistant/")||navigator.userAgent.startsWith("HomeAssistant/")||!n&&!i)window.open(e,"_blank");else{const n=document.createElement("a");n.setAttribute("download",t),n.href=e,n.click(),n.remove()}},by=async(e,t,n)=>{const i=await t.getMediaDownloadPath(e,n);if(!i)throw new vu(Pm("error.download_no_media"));let a=i.endpoint;if(i.sign){let t;try{t=await lp(e,i.endpoint)}catch(e){Nf(e)}if(!t)throw new vu(Pm("error.download_sign_failed"));a=t}yy(a)},wy=300;let xy=class extends ge{constructor(){super(),this._intersectionObserver=new IntersectionObserver(this._intersectionHandler.bind(this))}connectedCallback(){this._intersectionObserver.observe(this),super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this._intersectionObserver.disconnect()}willUpdate(e){e.has("thumbnail")&&(this._embedThumbnailTask=vy(this,(()=>this.hass),(()=>this.thumbnail),!1),this._intersectionObserver.unobserve(this),this._intersectionObserver.observe(this))}_intersectionHandler(e){this._embedThumbnailTask?.status===my&&e.some((e=>e.isIntersecting))&&this._embedThumbnailTask?.run()}render(){if(!this._embedThumbnailTask)return;const e=K` `;return K`${this.thumbnail?hy(this,this._embedThumbnailTask,(e=>e?K``:K``),{inProgressFunc:()=>e}):e} `}static get styles(){return b(":host {\n display: block;\n overflow: hidden;\n aspect-ratio: 1/1;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\nimg {\n display: block;\n}\n\nimg,\nha-icon {\n display: inline-block;\n vertical-align: top;\n margin: 0;\n border-radius: var(--frigate-card-css-border-radius, var(--ha-card-border-radius, 4px));\n max-width: var(--frigate-card-thumbnail-size);\n max-height: 100%;\n aspect-ratio: 1/1;\n object-fit: cover;\n}\n\nha-icon {\n --mdc-icon-size: 50%;\n color: var(--primary-text-color);\n display: flex;\n justify-content: center;\n align-items: center;\n border: 1px solid rgba(255, 255, 255, 0.3);\n box-sizing: border-box;\n opacity: 0.2;\n}")}};e([be({attribute:!1})],xy.prototype,"thumbnail",void 0),e([be({attribute:!1})],xy.prototype,"hass",void 0),xy=e([_e("frigate-card-thumbnail-feature-event")],xy);let Cy=class extends ge{render(){if(this.date)return K` +
${Of(this.date,"HH:mm")}
+
${Of(this.date,"MMM do")}
+ ${this.cameraTitle?K`
${this.cameraTitle}
`:K``} + `}static get styles(){return b(":host {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n aspect-ratio: 1/1;\n overflow: hidden;\n max-width: var(--frigate-card-thumbnail-size);\n max-height: var(--frigate-card-thumbnail-size);\n padding: 10px;\n border: 1px solid var(--secondary-color);\n background-color: var(--secondary-background-color);\n border-radius: var(--frigate-card-css-border-radius, var(--ha-card-border-radius, 4px));\n box-sizing: border-box;\n color: var(--primary-text-color);\n}\n\ndiv {\n text-align: center;\n}\n\ndiv.title {\n font-size: 1.5rem;\n}\n\ndiv.camera {\n font-size: 0.7em;\n}")}};e([be({attribute:!1})],Cy.prototype,"date",void 0),e([be({attribute:!1})],Cy.prototype,"cameraTitle",void 0),Cy=e([_e("frigate-card-thumbnail-feature-recording")],Cy);let $y=class extends ge{render(){if(!this.media)return;const e=this.media.getScore(),t=e?(100*e).toFixed(2)+"%":null,n=this.media.getStartTime(),i=n?Ff(n):null,a=this.media.getEndTime(),r=n&&a?qf(n,a):null,o=this.media.inProgress()?Pm("event.in_progress"):null,s=Rf(this.media.getWhat()?.join(", "))??null,c=Rf(this.media.getWhere()?.join(", "))??null,l=Rf(this.media.getTags()?.join(", "))??null,d=s||l?(s??"")+(s&&l?": ":"")+(l??""):null,u=this.seek?Of(this.seek,"HH:mm:ss"):null;return K` + ${d?K`
+ ${d} + ${t?K`${t}`:""} +
`:""} +
+ ${i?K`
+ + ${i} +
+ ${r||o?K`
+ + ${r?K`${r}`:""} + ${o?K`${o}`:""} +
`:""}`:""} + ${this.cameraTitle?K`
+ + ${this.cameraTitle} +
`:""} + ${c?K`
+ + ${c} +
`:K``} + ${l?K`
+ + ${l} +
`:K``} + ${u?K`
+ + ${u} +
`:K``} +
+ `}static get styles(){return b(uy)}};e([be({attribute:!1})],$y.prototype,"media",void 0),e([be({attribute:!1})],$y.prototype,"seek",void 0),e([be({attribute:!1})],$y.prototype,"cameraTitle",void 0),$y=e([_e("frigate-card-thumbnail-details-event")],$y);let ky=class extends ge{render(){if(!this.media)return;const e=this.media.getStartTime(),t=e?Ff(e):null,n=this.media.getEndTime(),i=e&&n?qf(e,n):null,a=this.media.inProgress()?Pm("recording.in_progress"):null,r=this.seek?Of(this.seek,"HH:mm:ss"):null,o=this.media.getEventCount();return K` + ${this.cameraTitle?K`
+ ${this.cameraTitle} +
`:""} +
+ ${t?K`
+ + ${t} +
+ ${i||a?K`
+ + ${i?K`${i}`:""} + ${a?K`${a}`:""} +
`:""}`:""} + ${r?K`
+ + ${r} +
`:K``} + ${null!==o?K`
+ + ${o} +
`:""} +
+ `}static get styles(){return b(uy)}};e([be({attribute:!1})],ky.prototype,"media",void 0),e([be({attribute:!1})],ky.prototype,"seek",void 0),e([be({attribute:!1})],ky.prototype,"cameraTitle",void 0),ky=e([_e("frigate-card-thumbnail-details-recording")],ky);let Ey=class extends ge{constructor(){super(...arguments),this.details=!1,this.show_favorite_control=!1,this.show_timeline_control=!1,this.show_download_control=!1}render(){if(!this.media||!this.cameraManager||!this.hass)return;const e=this.media.getThumbnail(),t=this.media.getTitle()??"",n={star:!0,starred:!!this.media?.isFavorite()},i=this.show_timeline_control&&this.view&&(!_y.isRecording(this.media)||this.media.getStartTime()&&this.media.getEndTime()),a=this.cameraManager?.getMediaCapabilities(this.media),r=this.show_favorite_control&&this.media&&this.hass&&a?.canFavorite,o=this.show_download_control&&this.hass&&this.media.getID()&&a?.canDownload,s=this.cameraManager.getCameraMetadata(this.hass,this.media.getCameraID())?.title;return K` + ${_y.isEvent(this.media)?K``:_y.isRecording(this.media)?K``:K``} + ${r?K` {if(vm(e),this.hass&&this.media){try{await(this.cameraManager?.favoriteMedia(this.hass,this.media,!this.media?.isFavorite()))}catch(e){return void Nf(e)}this.requestUpdate()}}} + />`:""} + ${this.details&&_y.isEvent(this.media)?K``:this.details&&_y.isRecording(this.media)?K``:K``} + ${i?K`{vm(e),this.view&&this.media&&this.view.evolve({view:"timeline",queryResults:this.view.queryResults?.clone().selectResultIfFound((e=>e===this.media))}).removeContext("timeline").dispatchChangeEvent(this)}} + >`:""} + ${o?K` {if(vm(e),this.hass&&this.cameraManager&&this.media)try{await by(this.hass,this.cameraManager,this.media)}catch(e){Mv(this,e)}}} + >`:""} + `}static get styles(){return b(":host {\n display: flex;\n flex-direction: row;\n box-sizing: border-box;\n position: relative;\n overflow: hidden;\n transition: transform 0.2s linear;\n}\n\n:host(:not([details])) {\n aspect-ratio: 1/1;\n}\n\n:host([details]) {\n border: 1px solid var(--primary-color);\n border-radius: var(--frigate-card-css-border-radius, var(--ha-card-border-radius, 4px));\n padding: 2px;\n background-color: var(--primary-background-color, black);\n}\n\n:host(:hover) {\n transform: scale(1.04);\n}\n\nha-icon {\n position: absolute;\n border-radius: 50%;\n opacity: 0.5;\n color: var(--primary-color);\n cursor: pointer;\n transition: opacity 0.2s ease-in-out, color 0.2s ease-in-out;\n}\n\nha-icon:hover {\n opacity: 1;\n}\n\nha-icon.star {\n top: 3px;\n left: 3px;\n}\n\nha-icon.star.starred {\n color: gold;\n}\n\nha-icon.timeline {\n top: 3px;\n right: 3px;\n}\n\nha-icon.download {\n right: 3px;\n bottom: 3px;\n}\n\nfrigate-card-thumbnail-details-event, frigate-card-thumbnail-details-recording {\n flex: 1;\n}")}};e([be({attribute:!1})],Ey.prototype,"hass",void 0),e([be({attribute:!1})],Ey.prototype,"cameraManager",void 0),e([be({attribute:!0})],Ey.prototype,"media",void 0),e([be({attribute:!0,type:Boolean})],Ey.prototype,"details",void 0),e([be({attribute:!0,type:Boolean})],Ey.prototype,"show_favorite_control",void 0),e([be({attribute:!0,type:Boolean})],Ey.prototype,"show_timeline_control",void 0),e([be({attribute:!0,type:Boolean})],Ey.prototype,"show_download_control",void 0),e([be({attribute:!1})],Ey.prototype,"seek",void 0),e([be({attribute:!1})],Ey.prototype,"view",void 0),Ey=e([_e("frigate-card-thumbnail")],Ey);let My=class extends ge{constructor(){super(...arguments),this.direction="horizontal",this.selected=0,this._refSlot=Le(),this._scrolling=!1,this._reInitOnSettle=!1,this._carouselReInitInPlace=yr(this._carouselReInitInPlaceInternal.bind(this),500,{trailing:!0})}connectedCallback(){super.connectedCallback(),this.requestUpdate()}disconnectedCallback(){this._destroyCarousel(),super.disconnectedCallback()}willUpdate(e){["direction","carouselOptions","carouselPlugins"].some((t=>e.has(t)))&&this._destroyCarousel()}getCarouselSelected(){const e=this._carousel?.selectedScrollSnap(),t=void 0!==e?this._carousel?.slideNodes()[e]??null:null;return void 0!==e&&t?{index:e,element:t}:null}carousel(){return this._carousel??null}_carouselReInitInPlaceInternal(){(e=>{window.requestAnimationFrame((()=>{this._carousel?.reInit({...e})}))})({startIndex:this.selected})}carouselReInitWhenSafe(){this._scrolling?this._reInitOnSettle=!0:this._carouselReInitInPlace()}getCarouselPlugins(){return this._carousel?.plugins()??null}updated(e){super.updated(e),this._carousel||this._initCarousel(),e.has("selected")&&this._carousel?.scrollTo(this.selected,"none"===this.transitionEffect)}_destroyCarousel(){this._carousel&&this._carousel.destroy(),this._carousel=void 0}_initCarousel(){const e=this.renderRoot.querySelector(".embla__viewport"),t={root:e,slides:this._refSlot.value?.assignedElements({flatten:!0})};if(e&&t.slides){this._carousel=W_(t,{axis:"horizontal"==this.direction?"x":"y",speed:30,startIndex:this.selected,...this.carouselOptions},this.carouselPlugins);const e=()=>{const e=this.getCarouselSelected();e&&If(this,"carousel:select",e),this.requestUpdate()};this._carousel.on("init",e),this._carousel.on("select",e),this._carousel.on("scroll",(()=>{this._scrolling=!0})),this._carousel.on("settle",(()=>{this._scrolling=!1,this._reInitOnSettle&&(this._reInitOnSettle=!1,this._carouselReInitInPlace())})),this._carousel.on("settle",(()=>{const e=this.getCarouselSelected();e&&If(this,"carousel:settle",e)}))}}_slotChanged(){this._destroyCarousel(),this.requestUpdate()}render(){const e=this._refSlot.value?.assignedElements({flatten:!0})||[],t=this.carouselOptions?.loop||this.selected>0,n=this.carouselOptions?.loop||this.selected+1 + ${t?K``:""} +
+
+ +
+
+ ${n?K``:""} + `}static get styles(){return b(":host {\n display: block;\n height: 100%;\n width: 100%;\n}\n\n.embla {\n width: 100%;\n height: 100%;\n margin-left: auto;\n margin-right: auto;\n}\n\n.embla__container {\n display: flex;\n width: 100%;\n height: 100%;\n user-select: none;\n -webkit-touch-callout: none;\n -khtml-user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n\n:host([direction=vertical]) .embla__container {\n flex-direction: column;\n}\n\n:host([direction=horizontal]) .embla__container {\n flex-direction: row;\n}\n\n.embla__viewport {\n width: 100%;\n height: 100%;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n justify-content: center;\n}\n\n.embla__viewport.is-draggable {\n cursor: move;\n cursor: grab;\n}\n\n.embla__viewport.is-dragging {\n cursor: grabbing;\n}\n\n:host([direction=vertical]) ::slotted(.embla__slide) {\n margin-bottom: 5px;\n}\n\n:host([direction=horizontal]) ::slotted(.embla__slide) {\n margin-right: 5px;\n}")}};e([be({attribute:!0,reflect:!0})],My.prototype,"direction",void 0),e([be({attribute:!1})],My.prototype,"carouselOptions",void 0),e([be({attribute:!1})],My.prototype,"carouselPlugins",void 0),e([be({attribute:!1})],My.prototype,"selected",void 0),e([be({attribute:!0})],My.prototype,"transitionEffect",void 0),My=e([_e("frigate-card-carousel")],My);let Sy=class extends ge{constructor(){super(),this._refCarousel=Le(),this.selected=0,this._carouselOptions={containScroll:"keepSnaps",dragFree:!0},this._carouselPlugins=[dy({forceWheelAxis:"y"})],this._resizeObserver=new ResizeObserver(this._resizeHandler.bind(this))}_resizeHandler(){this._refCarousel.value?.carouselReInitWhenSafe()}connectedCallback(){super.connectedCallback(),this._resizeObserver.observe(this)}disconnectedCallback(){this._resizeObserver.disconnect(),super.disconnectedCallback()}_getSlides(){if(!this.view?.query||!this.view.queryResults?.hasResults())return[];const e=[];for(let t=0;t{this.view&&this.view.queryResults&&If(this,"thumbnail-carousel:tap",{queryResults:this.view.queryResults.clone().selectResult(e)}),vm(t)}} + > + `}_getDirection(){return"left"===this.config?.mode||"right"===this.config?.mode?"vertical":"above"===this.config?.mode||"below"===this.config?.mode?"horizontal":void 0}render(){const e=this._getSlides();if(e.length&&this.config&&"none"!==this.config.mode)return K` + ${e} + `}static get styles(){return b(":host {\n --frigate-card-thumbnail-size-max: 175px;\n --frigate-card-thumbnail-details-width: calc(\n var(--frigate-card-thumbnail-size) + 200px\n );\n}\n\n:host {\n display: block;\n width: 100%;\n height: 100%;\n --frigate-card-carousel-thumbnail-opacity: 1;\n}\n\n:host([direction=vertical]) {\n height: 100%;\n}\n\n:host([direction=horizontal]) {\n height: auto;\n}\n\n.embla__slide {\n flex: 0 0 auto;\n opacity: var(--frigate-card-carousel-thumbnail-opacity);\n}\n\n.embla__slide.slide-selected {\n opacity: 1;\n}\n\nfrigate-card-thumbnail {\n width: var(--frigate-card-thumbnail-size);\n height: var(--frigate-card-thumbnail-size);\n max-width: 100%;\n}\n\nfrigate-card-thumbnail[details] {\n width: var(--frigate-card-thumbnail-details-width);\n}")}};e([be({attribute:!1})],Sy.prototype,"hass",void 0),e([be({attribute:!1})],Sy.prototype,"view",void 0),e([be({attribute:!1})],Sy.prototype,"cameraManager",void 0),e([be({attribute:!1})],Sy.prototype,"config",void 0),e([be({attribute:!1})],Sy.prototype,"selected",void 0),Sy=e([_e("frigate-card-thumbnail-carousel")],Sy);class Ty{constructor(e){this._queries=null,e&&(this._queries=e)}clone(){return Gi(this)}getQueries(){return this._queries}setQueries(e){this._queries=e}}class Ay extends Ty{convertToClipsQueries(){for(const e of this._queries??[])delete e.hasSnapshot,e.hasClip=!0}clone(){return Gi(this)}}class zy extends Ty{}class jy{static areEventQueries(e){return e instanceof Ay}static areRecordingQueries(e){return e instanceof zy}}class Oy{constructor(e){this.view=e.view,this.camera=e.camera,this.query=e.query??null,this.queryResults=e.queryResults??null,this.context=e.context??null}static isMajorMediaChange(e,t){return!e||!t||e.view!==t.view||e.camera!==t.camera||"live"===t.view&&e.context?.live?.overrides?.get(e.camera)!==t.context?.live?.overrides?.get(t.camera)||"live"!==t.view&&e.queryResults!==t.queryResults}static adoptFromViewIfAppropriate(e,t){if(!t)return;let n=null;if(jy.areEventQueries(t.query)){const e=t.query.getQueries();e?.every((e=>e.hasClip))?n="clips":e?.every((e=>e.hasSnapshot))&&(n="snapshots")}else jy.areRecordingQueries(t.query)&&(n="recordings");const i=!e.query||!e.queryResults,a=t.isViewerView()&&e.isGalleryView()&&e.view===n,r=t?.is("media")&&e.is("media");if(i&&(a?(t.query&&(e.query=t.query),t.queryResults&&(e.queryResults=t.queryResults)):r&&n&&(e.view="clips"===n?"clip":"snapshots"===n?"snapshot":"recording")),t.is("live")&&e.is("live")&&t.context?.live?.overrides&&!e.context?.live?.overrides){const n=e.context?.live??{};n.overrides=t.context.live.overrides,e.mergeInContext({live:n})}}clone(){return new Oy({view:this.view,camera:this.camera,query:this.query?.clone()??null,queryResults:this.queryResults?.clone()??null,context:this.context})}evolve(e){return new Oy({view:void 0!==e.view?e.view:this.view,camera:void 0!==e.camera?e.camera:this.camera,query:void 0!==e.query?e.query:this.query?.clone()??null,queryResults:void 0!==e.queryResults?e.queryResults:this.queryResults?.clone()??null,context:void 0!==e.context?e.context:this.context})}mergeInContext(e){return this.context={...this.context,...e},this}removeContext(e){return this.context&&delete this.context[e],this}is(e){return this.view==e}isGalleryView(){return["clips","snapshots","recordings"].includes(this.view)}isAnyMediaView(){return this.isViewerView()||this.is("live")||this.is("image")}isViewerView(){return["clip","snapshot","media","recording"].includes(this.view)}getDefaultMediaType(){return["clip","clips"].includes(this.view)?"clips":["snapshot","snapshots"].includes(this.view)?"snapshots":["recording","recordings"].includes(this.view)?"recordings":null}dispatchChangeEvent(e){If(e,"view:change",this)}}const Iy=(e,t)=>{If(e,"view:change-context",t)},Ry=document.createElement("template");Ry.innerHTML='\n
\n
\n';class Dy extends HTMLElement{constructor(){super();const e=this.attachShadow({mode:"open"});e.appendChild(Ry.content.cloneNode(!0)),this._freeSpaceDiv=e.getElementById("fs")}connectedCallback(){this._freeSpaceDiv&&this._freeSpaceDiv.addEventListener("click",this.handleFreeSpaceDivClick),this.upgradeProperty("open")}disconnectedCallback(){document.removeEventListener("keyup",this.handleKeyUp)}upgradeProperty(e){if(this.hasOwnProperty(e)){let t=this[e];delete this[e],this[e]=t}}handleKeyUp=e=>{if(!e.altKey&&"Escape"===e.key)e.preventDefault(),this.open=!1};get open(){return this.hasAttribute("open")}set open(e){e?this.hasAttribute("open")||this.setAttribute("open",""):this.hasAttribute("open")&&this.removeAttribute("open")}static get observedAttributes(){return["open"]}attributeChangedCallback(e,t,n){"open"===e&&(this.open?(this.setAttribute("tabindex","0"),this.setAttribute("aria-disabled","false"),this.focus({preventScroll:!0}),document.addEventListener("keyup",this.handleKeyUp),this.dispatchEvent(new CustomEvent("open",{bubbles:!0}))):(this.setAttribute("tabindex","-1"),this.setAttribute("aria-disabled","true"),document.removeEventListener("keyup",this.handleKeyUp),this.dispatchEvent(new CustomEvent("close",{bubbles:!0}))))}handleFreeSpaceDivClick=()=>{this.open=!1}}customElements.define("side-drawer",Dy);let Py=class extends ge{constructor(){super(...arguments),this.location="left",this.control=!0,this.open=!1,this.empty=!0,this._refDrawer=Le(),this._refSlot=Le(),this._resizeObserver=new ResizeObserver((()=>this._hideDrawerIfNecessary())),this._isHoverableDevice=Uf()}firstUpdated(e){super.firstUpdated(e);const t=document.createElement("style");t.innerHTML=":host {\n width: unset;\n}\n\n#fs {\n display: none;\n width: 100%;\n inset: 0;\n}\n\n#d,\n#fs {\n height: 100%;\n position: absolute;\n}\n\n#d {\n overflow: visible;\n max-width: 90%;\n}\n\n:host([location=right]) #d {\n left: unset;\n right: 0;\n transform: translateX(100%);\n}\n\n:host([location=right][open]) #d {\n transform: none;\n box-shadow: var(--frigate-card-css-box-shadow, 0px 0px 25px 0px black);\n}\n\n#ifs {\n height: 100%;\n}",this._refDrawer.value?.shadowRoot?.appendChild(t)}_slotChanged(){const e=this._refSlot.value?.assignedElements({flatten:!0});this._resizeObserver.disconnect();for(const t of e??[])this._resizeObserver.observe(t);this._hideDrawerIfNecessary()}_hideDrawerIfNecessary(){if(!this._refDrawer.value)return;const e=this._refSlot.value?.assignedElements({flatten:!0});this.empty=!e||!e.length||e.every((e=>{const t=e.getBoundingClientRect();return!t.width||!t.height}))}render(){return K` + {this.open&&(this.open=!1)}} + > + ${this.control?K` +
{vm(e),this.open=!this.open}} + > + {this._isHoverableDevice&&!this.open&&(this.open=!0)}} + > + +
+ `:""} + this._slotChanged()}> +
+ `}static get styles(){return b("side-drawer {\n background-color: var(--card-background-color);\n}\n\ndiv.control-surround {\n position: absolute;\n bottom: 50%;\n transform: translateY(50%);\n z-index: 0;\n padding-top: 20px;\n padding-bottom: 20px;\n}\n\n:host([location=left]) div.control-surround {\n padding-right: 12px;\n left: 100%;\n}\n\n:host([location=right]) div.control-surround {\n padding-left: 12px;\n right: 100%;\n}\n\n:host([empty]), :host([empty]) > * {\n visibility: hidden;\n}\n\n:host(:not([empty])), :host(:not([empty])) > * {\n visibility: visible;\n}\n\nha-icon.control {\n color: var(--secondary-color, white);\n background-color: rgba(0, 0, 0, 0.7);\n opacity: 0.5;\n pointer-events: all;\n --mdc-icon-size: 20px;\n padding-top: 20px;\n padding-bottom: 20px;\n transition: opacity 0.5s ease;\n}\n\n:host([open]) ha-icon.control, ha-icon.control:hover {\n opacity: 1;\n background-color: black;\n}\n\n:host([location=left]) ha-icon.control {\n border-top-right-radius: 20px;\n border-bottom-right-radius: 20px;\n}\n\n:host([location=right]) ha-icon.control {\n border-top-left-radius: 20px;\n border-bottom-left-radius: 20px;\n}")}};e([be({attribute:!0,reflect:!0})],Py.prototype,"location",void 0),e([be({attribute:!0,reflect:!0,type:Boolean})],Py.prototype,"control",void 0),e([be({type:Boolean,reflect:!0,attribute:!0})],Py.prototype,"open",void 0),e([be({attribute:!1})],Py.prototype,"icons",void 0),e([be({type:Boolean,reflect:!0,attribute:!0})],Py.prototype,"empty",void 0),Py=e([_e("frigate-card-drawer")],Py);let Ly=class extends ge{constructor(){super(...arguments),this._refDrawerLeft=Le(),this._refDrawerRight=Le(),this._boundDrawerHandler=this._drawerHandler.bind(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("frigate-card:drawer:open",this._boundDrawerHandler),this.addEventListener("frigate-card:drawer:close",this._boundDrawerHandler)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("frigate-card:drawer:open",this._boundDrawerHandler),this.removeEventListener("frigate-card:drawer:close",this._boundDrawerHandler)}_drawerHandler(e){const t=e.detail.drawer,n=e.type.endsWith(":open");"left"===t&&this._refDrawerLeft.value?this._refDrawerLeft.value.open=n:"right"===t&&this._refDrawerRight.value&&(this._refDrawerRight.value.open=n)}render(){return K` + + + + + + + + `}static get styles(){return b(":host {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n position: relative;\n overflow: hidden;\n}\n\n::slotted(:not([slot])) {\n flex: 1;\n min-height: 0px;\n}")}};e([be({attribute:!1})],Ly.prototype,"drawerIcons",void 0),Ly=e([_e("frigate-card-surround-basic")],Ly);var Ny=4;class Uy{constructor(e,t){this._results=null,this._resultsTimestamp=null,this._selectedIndex=null,e&&this.setResults(e),void 0!==t&&this.selectResult(t)}clone(){return Bi(this,Ny)}isSupersetOf(e){if(!this._results||!e._results)return!1;const t=new Set(this._results.map((e=>e.getID()))),n=new Set(e._results.map((e=>e.getID())));return!(!t||!n||t.has(null)||n.has(null))&&((e,t)=>{for(const n of t)if(!e.has(n))return!1;return!0})(t,n)}getResults(){return this._results}getResultsCount(){return this._results?.length??0}hasResults(){return!!this._results}setResults(e){this._results=e,this._resultsTimestamp=new Date}getResult(e){return this._results&&void 0!==e?this._results[e]:null}getSelectedResult(){return null===this._selectedIndex?null:this.getResult(this._selectedIndex)}getSelectedIndex(){return this._selectedIndex}hasSelectedResult(){return null!==this.getSelectedResult()}resetSelectedResult(){return this._selectedIndex=null,this}getResultsTimestamp(){return this._resultsTimestamp}selectResult(e){return(null===e||this._results&&e>=0&&e{const o=pv(n,a.camera);if(!o)return;const s=Hy(n,i,o,{mediaType:r?.mediaType});s&&(await Vy(e,t,n,a,s,{targetView:r?.targetView,select:r?.select}))?.dispatchChangeEvent(e)},Hy=(e,t,n,i)=>{const a=t.performance?.features.media_chunk_size??50,r=e.generateDefaultEventQueries(n,{limit:a,..."clips"===i?.mediaType&&{hasClip:!0},..."snapshots"===i?.mediaType&&{hasSnapshot:!0}});return r?new Ay(r):null},Zy=async(e,t,n,i,a,r)=>{const o=pv(n,a.camera);if(!o)return;const s=qy(n,i,o);s&&(await Vy(e,t,n,a,s,{targetView:r?.targetView,select:r?.select}))?.dispatchChangeEvent(e)},qy=(e,t,n,i)=>{const a=t.performance?.features.media_chunk_size??50,r=e.generateDefaultRecordingQueries(n,{limit:a,...i?.start&&{start:i.start},...i?.end&&{end:i.end}});return r?new zy(r):null},Vy=async(e,t,n,i,a,r)=>{let o;const s=a.getQueries();if(!s)return null;try{o=await n.executeMediaQueries(t,s)}catch(t){return Nf(t),Mv(e,t),null}if(!o)return null;const c=new Uy(o,"latest"===r?.select&&o.length?o.length-1:void 0);let l={};return"time"===r?.select&&r?.targetTime&&(c.selectBestResult((e=>Wy(e,r.targetTime))),l={mediaViewer:{seek:r.targetTime}}),i?.evolve({query:a,queryResults:c,view:r?.targetView,camera:r?.targetCameraID}).mergeInContext(l)??null},Wy=(e,t)=>{let n;for(const[i,a]of e.entries()){const e=a.getStartTime(),r=a.getUsableEndTime();if(a.includesTime(t)&&e&&r){const t=r.getTime()-e.getTime();(!n||t>n.duration)&&(n={index:i,duration:t})}}return n?n.index:null};let By=class extends ge{async _fetchMedia(){this.cameraManager&&this.cardWideConfig&&this.fetchMedia&&this.hass&&this.view&&!this.view.query&&this.thumbnailConfig&&"none"!==this.thumbnailConfig.mode&&(this.view.context?.thumbnails?.fetch??1)&&await Fy(this,this.hass,this.cameraManager,this.cardWideConfig,this.view,{targetView:this.view.view,mediaType:this.fetchMedia,select:"latest"})}_hasDrawer(){return!!this.thumbnailConfig&&["left","right"].includes(this.thumbnailConfig.mode)}willUpdate(e){this.timelineConfig?.mode&&"none"!==this.timelineConfig.mode&&import("./timeline-6aa9e747.js"),e.has("view")&&Oy.isMajorMediaChange(e.get("view"),this.view)&&(this._cameraIDsForTimeline=this._getCameraIDsForTimeline()??void 0),["view","fetch","browseMediaParams"].some((t=>e.has(t)))&&this._fetchMedia()}_getCameraIDsForTimeline(){return this.view?this.view?.is("live")?pv(this.cameraManager,this.view.camera):this.view.isViewerView()?new Set(this.view.query?.getQueries()?.map((e=>[...e.cameraIDs])).flat()):null:null}render(){if(!this.hass||!this.view)return;const e=(e,t)=>{this.thumbnailConfig&&this._hasDrawer()&&If(e.composedPath()[0],"drawer:"+t,{drawer:this.thumbnailConfig.mode})};return K` e(t,"open")} + @frigate-card:thumbnails:close=${t=>e(t,"close")} + > + ${this.thumbnailConfig&&"none"!==this.thumbnailConfig.mode?K` e(t,"close")} + @frigate-card:thumbnail-carousel:tap=${e=>{const t=e.detail.queryResults.getSelectedResult();t&&this.view?.evolve({view:"media",queryResults:e.detail.queryResults,...t.getCameraID()&&{camera:t.getCameraID()}}).removeContext("timeline").dispatchChangeEvent(e.composedPath()[0])}} + > + `:""} + ${this.timelineConfig&&"none"!==this.timelineConfig.mode?K` + `:""} + + `}static get styles(){return b(":host {\n width: 100%;\n height: 100%;\n display: block;\n}")}};e([be({attribute:!1})],By.prototype,"hass",void 0),e([be({attribute:!1})],By.prototype,"view",void 0),e([be({attribute:!1,hasChanged:Lf})],By.prototype,"thumbnailConfig",void 0),e([be({attribute:!1,hasChanged:Lf})],By.prototype,"timelineConfig",void 0),e([be({attribute:!1,hasChanged:Lf})],By.prototype,"fetchMedia",void 0),e([be({attribute:!1})],By.prototype,"cameraManager",void 0),e([be({attribute:!1})],By.prototype,"cardWideConfig",void 0),By=e([_e("frigate-card-surround")],By);let Yy=class extends ge{willUpdate(e){(e.has("view")||e.has("config"))&&((this.view?.is("live")||this._shouldLivePreload())&&import("./live-e0c9196c.js"),this.view?.isGalleryView()?import("./gallery-6281c347.js"):this.view?.isViewerView()?import("./viewer-b95bc789.js"):this.view?.is("image")?import("./image-0b99ab11.js"):this.view?.is("timeline")&&import("./timeline-6aa9e747.js")),e.has("hide")&&(this.hide?this.setAttribute("hidden",""):this.removeAttribute("hidden"))}shouldUpdate(e){return!0}_shouldLivePreload(){return!!this.config?.live.preload}render(){if(!this.hass||!this.config||!this.nonOverriddenConfig)return K``;const e={hidden:this._shouldLivePreload()&&!this.view?.is("live")},t={hidden:!!this.hide},n=this.view?.is("live")?this.config.live.controls.thumbnails:this.view?.isViewerView()?this.config.media_viewer.controls.thumbnails:this.view?.is("timeline")?this.config.timeline.controls.thumbnails:void 0,i=this.view?.is("live")?this.config.live.controls.timeline:this.view?.isViewerView()?this.config.media_viewer.controls.timeline:void 0,a=this.view?this.cameraManager?.getStore().getCameraConfig(this.view.camera)??null:null;return K` + ${!this.hide&&this.view?.is("image")&&a?K` + `:""} + ${!this.hide&&this.view?.isGalleryView()?K` + `:""} + ${!this.hide&&this.view?.isViewerView()?K` + + + `:""} + ${!this.hide&&this.view?.is("timeline")?K` + `:""} + ${this._shouldLivePreload()||!this.hide&&this.view?.is("live")?K` + r in e.overrides)).map((e=>({conditions:e.conditions,overrides:e.overrides[r]})))??[]} + .cameraManager=${this.cameraManager} + .cardWideConfig=${this.cardWideConfig} + .microphoneStream=${this.microphoneStream} + class="${Ee(e)}" + > + + `:""} + `;var r,o}static get styles(){return b(":host {\n width: 100%;\n height: 100%;\n display: block;\n}\n\n:host([hidden]),\n.hidden {\n display: none;\n}")}};e([be({attribute:!1})],Yy.prototype,"hass",void 0),e([be({attribute:!1})],Yy.prototype,"view",void 0),e([be({attribute:!1})],Yy.prototype,"cameraManager",void 0),e([be({attribute:!1})],Yy.prototype,"config",void 0),e([be({attribute:!1})],Yy.prototype,"nonOverriddenConfig",void 0),e([be({attribute:!1})],Yy.prototype,"cardWideConfig",void 0),e([be({attribute:!1})],Yy.prototype,"resolvedMediaCache",void 0),e([be({attribute:!1})],Yy.prototype,"conditionControllerEpoch",void 0),e([be({attribute:!1})],Yy.prototype,"hide",void 0),e([be({attribute:!1})],Yy.prototype,"microphoneStream",void 0),Yy=e([_e("frigate-card-views")],Yy);const Qy={[Il]:"none",[sl]:"none",[bd]:"none",[Zl]:!1,[gl]:!1,[_d]:!1,[Sl]:"never",[Gc]:"never",[Kc]:"never",[Xc]:"never",[Jl]:"all",[Kl]:!1,[el]:!1,[td]:"none",[il]:"none",[nd]:!1,[rl]:"chevrons",[bl]:"none",[Wl]:"none",[Td]:"outside",[`${Rd}.enabled`]:!1,[`${Hd}.enabled`]:!1,[`${Hd}.enabled`]:!1,[`${Ud}.enabled`]:!1,[Vc]:!1,[Wc]:!1,[Bc]:!1,[qc]:!1,[Pl]:!1,[Ll]:!1,[Nl]:!1,[Dl]:!1,[ll]:!1,[dl]:!1,[ul]:!1,[cl]:!1,[Cd]:!1,[$d]:!1,[kd]:!1,[xd]:!1,[Gd]:!1,[Kd]:10,[eu]:!1,[Jd]:!1,[nl]:!1,[Mc]:!1,[Sc]:10},Gy=(e,t)=>{const n=iu(om).safeParse(e);if(n.success){const e=n.data;Object.entries(Qy).forEach((([n,i])=>((e,t,n,i)=>{void 0===Av(e,n)&&Tv(t,n,i)})(e,t,n,i)))}return t},Ky={box_shadow:"none",border_radius:"0px"};const Xy=Ws.object({model:Ws.string().nullable(),config_entries:Ws.string().array(),manufacturer:Ws.string().nullable()}).array();class Jy{constructor(){this._cache=new Map}has(e){return this._cache.has(e)}getMatches(e){return[...this._cache.values()].filter(e)}get(e){return this._cache.get(e)}set(e){const t=e=>this._cache.set(e.entity_id,e);Array.isArray(e)?e.forEach(t):t(e)}}const eb=Ws.object({config_entry_id:Ws.string().nullable(),device_id:Ws.string().nullable(),disabled_by:Ws.string().nullable(),entity_id:Ws.string(),hidden_by:Ws.string().nullable(),platform:Ws.string(),translation_key:Ws.string().nullable(),unique_id:Ws.string().or(Ws.number()).optional()}),tb=eb.array();class nb{constructor(e){this._fetchedEntityList=!1,this._cache=e}async getEntity(e,t){const n=this._cache.get(t);if(n)return n;const i=await cp(e,eb,{type:"config/entity_registry/get",entity_id:t});return this._cache.set(i),i}async getMatchingEntities(e,t){return await this.fetchEntityList(e),this._cache.getMatches(t)}async getEntities(e,t){const n=new Map;return await Promise.all(t.map((async t=>{let i=null;try{i=await this.getEntity(e,t)}catch{return}i&&n.set(t,i)}))),n}async fetchEntityList(e){if(this._fetchedEntityList)return;const t=await cp(e,tb,{type:"config/entity_registry/list"});this._cache.set(t),this._fetchedEntityList=!0}}class ib extends Map{constructor(e={}){if(super(),!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");if("number"==typeof e.maxAge&&0===e.maxAge)throw new TypeError("`maxAge` must be a number greater than 0");this.maxSize=e.maxSize,this.maxAge=e.maxAge||Number.POSITIVE_INFINITY,this.onEviction=e.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_emitEvictions(e){if("function"==typeof this.onEviction)for(const[t,n]of e)this.onEviction(t,n.value)}_deleteIfExpired(e,t){return"number"==typeof t.expiry&&t.expiry<=Date.now()&&("function"==typeof this.onEviction&&this.onEviction(e,t.value),this.delete(e))}_getOrDeleteIfExpired(e,t){if(!1===this._deleteIfExpired(e,t))return t.value}_getItemValue(e,t){return t.expiry?this._getOrDeleteIfExpired(e,t):t.value}_peek(e,t){const n=t.get(e);return this._getItemValue(e,n)}_set(e,t){this.cache.set(e,t),this._size++,this._size>=this.maxSize&&(this._size=0,this._emitEvictions(this.oldCache),this.oldCache=this.cache,this.cache=new Map)}_moveToRecent(e,t){this.oldCache.delete(e),this._set(e,t)}*_entriesAscending(){for(const e of this.oldCache){const[t,n]=e;if(!this.cache.has(t)){!1===this._deleteIfExpired(t,n)&&(yield e)}}for(const e of this.cache){const[t,n]=e;!1===this._deleteIfExpired(t,n)&&(yield e)}}get(e){if(this.cache.has(e)){const t=this.cache.get(e);return this._getItemValue(e,t)}if(this.oldCache.has(e)){const t=this.oldCache.get(e);if(!1===this._deleteIfExpired(e,t))return this._moveToRecent(e,t),t.value}}set(e,t,{maxAge:n=this.maxAge}={}){const i="number"==typeof n&&n!==Number.POSITIVE_INFINITY?Date.now()+n:void 0;this.cache.has(e)?this.cache.set(e,{value:t,expiry:i}):this._set(e,{value:t,expiry:i})}has(e){return this.cache.has(e)?!this._deleteIfExpired(e,this.cache.get(e)):!!this.oldCache.has(e)&&!this._deleteIfExpired(e,this.oldCache.get(e))}peek(e){return this.cache.has(e)?this._peek(e,this.cache):this.oldCache.has(e)?this._peek(e,this.oldCache):void 0}delete(e){const t=this.cache.delete(e);return t&&this._size--,this.oldCache.delete(e)||t}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}resize(e){if(!(e&&e>0))throw new TypeError("`maxSize` must be a number greater than 0");const t=[...this._entriesAscending()],n=t.length-e;n<0?(this.cache=new Map(t),this.oldCache=new Map,this._size=t.length):(n>0&&this._emitEvictions(t.slice(0,n)),this.oldCache=new Map(t.slice(n)),this.cache=new Map,this._size=0),this.maxSize=e}*keys(){for(const[e]of this)yield e}*values(){for(const[,e]of this)yield e}*[Symbol.iterator](){for(const e of this.cache){const[t,n]=e;!1===this._deleteIfExpired(t,n)&&(yield[t,n.value])}for(const e of this.oldCache){const[t,n]=e;if(!this.cache.has(t)){!1===this._deleteIfExpired(t,n)&&(yield[t,n.value])}}}*entriesDescending(){let e=[...this.cache];for(let t=e.length-1;t>=0;--t){const n=e[t],[i,a]=n;!1===this._deleteIfExpired(i,a)&&(yield[i,a.value])}e=[...this.oldCache];for(let t=e.length-1;t>=0;--t){const n=e[t],[i,a]=n;if(!this.cache.has(i)){!1===this._deleteIfExpired(i,a)&&(yield[i,a.value])}}}*entriesAscending(){for(const[e,t]of this._entriesAscending())yield[e,t.value]}get size(){if(!this._size)return this.oldCache.size;let e=0;for(const t of this.oldCache.keys())this.cache.has(t)||e++;return Math.min(this._size+e,this.maxSize)}entries(){return this.entriesAscending()}forEach(e,t=this){for(const[n,i]of this.entriesAscending())e.call(t,i,n,this)}get[Symbol.toStringTag](){return JSON.stringify([...this.entriesAscending()])}}class ab{constructor(){this._cache=new ib({maxSize:1e3})}has(e){return this._cache.has(e)}get(e){return this._cache.get(e)}set(e,t){this._cache.set(e,t)}}const rb=async(e,t,n)=>{const i=n?n.get(t):void 0;if(i)return i;const a={type:"media_source/resolve_media",media_content_id:t};let r=null;try{r=await cp(e,lm,a)}catch(e){Nf(e)}return n&&r&&n.set(t,r),r};var ob;!function(e){e.INITIALIZING="initializing",e.INITIALIZED="initialized"}(ob||(ob={}));class sb{constructor(){this._state=new Map}async initializeMultipleIfNecessary(e){return(await Vf(Object.entries(e),(async([e,t])=>this.initializeIfNecessary(e,t)))).every(Boolean)}async initializeIfNecessary(e,t){const n=this._state.get(e);return n===ob.INITIALIZED||n!==ob.INITIALIZING&&(t?(this._state.set(e,ob.INITIALIZING),await t(),this._state.set(e,ob.INITIALIZED)):this._state.set(e,ob.INITIALIZED),!0)}uninitialize(e){return this._state.delete(e)}isInitialized(e){return this._state.get(e)==ob.INITIALIZED}isInitializedMultiple(e){return e.every((e=>this.isInitialized(e)))}}class cb{constructor(){this._current=null,this._lastKnown=null}set(e){this._current=e,this._lastKnown=e}get(){return this._current}getLastKnown(){return this._lastKnown}clear(){this._current=null}has(){return!!this._current}}const lb=50,db=lb;function ub(e,t){let n;return n=e instanceof Event?e.composedPath()[0]:e,n instanceof HTMLImageElement?{width:n.naturalWidth,height:n.naturalHeight,...t}:n instanceof HTMLVideoElement?{width:n.videoWidth,height:n.videoHeight,...t}:n instanceof HTMLCanvasElement?{width:n.width,height:n.height,player:t?.player,...t}:null}function hb(e,t,n){const i=ub(t,n);i&&mb(e,i)}function mb(e,t){If(e,"media:loaded",t)}function pb(e){If(e,"media:unloaded")}function fb(e){If(e,"media:volumechange")}function gb(e){If(e,"media:play")}function vb(e){If(e,"media:pause")}function _b(e){return e.height>=lb&&e.width>=db}const yb=e=>{const t=e?.context?.live?.overrides?.get(e.camera);return!!t&&t!==e.camera};class bb{constructor(){this._dynamicMenuButtons=[]}addDynamicMenuButton(e){this._dynamicMenuButtons.includes(e)||this._dynamicMenuButtons.push(e)}removeDynamicMenuButton(e){this._dynamicMenuButtons=this._dynamicMenuButtons.filter((t=>t!=e))}calculateButtons(e,t,n,i,a,r){const o=n.getStore().getVisibleCameras(),s=i.camera,c=n.getStore().getCameraConfig(s),l=pv(n,s),d=i.queryResults?.getSelectedResult(),u=n.getAggregateCameraCapabilities(l),h=d?n?.getMediaCapabilities(d):null,m=[];if(m.push({icon:nu,...t.menu.buttons.frigate,type:"custom:frigate-card-menu-icon",title:Pm("config.menu.buttons.frigate"),tap_action:"hidden"===t.menu?.style?hm("menu_toggle"):hm("default"),hold_action:hm("diagnostics")}),o){const i=Array.from(o,(([t,i])=>{const a=hm("camera_select",{camera:t}),r=n.getCameraMetadata(e,t)??void 0;return{enabled:!0,icon:r?.icon,entity:i.camera_entity,state_color:!0,title:r?.title,selected:s===t,...a&&{tap_action:a}}}));m.push({icon:"mdi:video-switch",...t.menu.buttons.cameras,type:"custom:frigate-card-menu-submenu",title:Pm("config.menu.buttons.cameras"),items:i})}if(s&&l&&i.is("live")){const a=[...l],r=i.context?.live?.overrides?.get(s);if(2===a.length)m.push({icon:"mdi:video-input-component",style:r&&r!==s?this._getEmphasizedStyle():{},title:Pm("config.menu.buttons.substreams"),...t.menu.buttons.substreams,type:"custom:frigate-card-menu-icon",tap_action:hm(yb(i)?"live_substream_off":"live_substream_on")});else if(a.length>2){const o=Array.from(a,(t=>{const a=hm("live_substream_select",{camera:t}),r=n.getCameraMetadata(e,t)??void 0,o=n.getStore().getCameraConfig(t);return{enabled:!0,icon:r?.icon,entity:o?.camera_entity,state_color:!0,title:r?.title,selected:(i.context?.live?.overrides?.get(s)??s)===t,...a&&{tap_action:a}}}));m.push({icon:"mdi:video-input-component",title:Pm("config.menu.buttons.substreams"),style:r&&r!==s?this._getEmphasizedStyle():{},...t.menu.buttons.substreams,type:"custom:frigate-card-menu-submenu",items:o})}}if(m.push({icon:"mdi:cctv",...t.menu.buttons.live,type:"custom:frigate-card-menu-icon",title:Pm("config.view.views.live"),style:i.is("live")?this._getEmphasizedStyle():{},tap_action:hm("live")}),u?.supportsClips&&m.push({icon:"mdi:filmstrip",...t.menu.buttons.clips,type:"custom:frigate-card-menu-icon",title:Pm("config.view.views.clips"),style:i?.is("clips")?this._getEmphasizedStyle():{},tap_action:hm("clips"),hold_action:hm("clip")}),u?.supportsSnapshots&&m.push({icon:"mdi:camera",...t.menu.buttons.snapshots,type:"custom:frigate-card-menu-icon",title:Pm("config.view.views.snapshots"),style:i?.is("snapshots")?this._getEmphasizedStyle():{},tap_action:hm("snapshots"),hold_action:hm("snapshot")}),u?.supportsRecordings&&m.push({icon:"mdi:album",...t.menu.buttons.recordings,type:"custom:frigate-card-menu-icon",title:Pm("config.view.views.recordings"),style:i.is("recordings")?this._getEmphasizedStyle():{},tap_action:hm("recordings"),hold_action:hm("recording")}),m.push({icon:"mdi:image",...t.menu.buttons.image,type:"custom:frigate-card-menu-icon",title:Pm("config.view.views.image"),style:i?.is("image")?this._getEmphasizedStyle():{},tap_action:hm("image")}),u?.supportsTimeline&&m.push({icon:"mdi:chart-gantt",...t.menu.buttons.timeline,type:"custom:frigate-card-menu-icon",title:Pm("config.view.views.timeline"),style:i.is("timeline")?this._getEmphasizedStyle():{},tap_action:hm("timeline")}),h?.canDownload&&!this._isBeingCasted()&&m.push({icon:"mdi:download",...t.menu.buttons.download,type:"custom:frigate-card-menu-icon",title:Pm("config.menu.buttons.download"),tap_action:hm("download")}),r?.cameraURL&&m.push({icon:"mdi:web",...t.menu.buttons.camera_ui,type:"custom:frigate-card-menu-icon",title:Pm("config.menu.buttons.camera_ui"),tap_action:hm("camera_ui")}),r?.microphoneController&&r?.currentMediaLoadedInfo?.capabilities?.supports2WayAudio){const e=r.microphoneController.isForbidden(),n=r.microphoneController.isMuted(),i=t.menu.buttons.microphone.type;m.push({icon:e?"mdi:microphone-message-off":n?"mdi:microphone-off":"mdi:microphone",...t.menu.buttons.microphone,type:"custom:frigate-card-menu-icon",title:Pm("config.menu.buttons.microphone"),style:e||n?{}:this._getEmphasizedStyle(!0),...!e&&"momentary"===i&&{start_tap_action:hm("microphone_unmute"),end_tap_action:hm("microphone_mute")},...!e&&"toggle"===i&&{tap_action:hm(r.microphoneController.isMuted()?"microphone_unmute":"microphone_mute")}})}if($r.isEnabled&&!this._isBeingCasted()&&m.push({icon:$r.isFullscreen?"mdi:fullscreen-exit":"mdi:fullscreen",...t.menu.buttons.fullscreen,type:"custom:frigate-card-menu-icon",title:Pm("config.menu.buttons.fullscreen"),tap_action:hm("fullscreen"),style:$r.isFullscreen?this._getEmphasizedStyle():{}}),m.push({icon:a?"mdi:arrow-collapse-all":"mdi:arrow-expand-all",...t.menu.buttons.expand,type:"custom:frigate-card-menu-icon",title:Pm("config.menu.buttons.expand"),tap_action:hm("expand"),style:a?this._getEmphasizedStyle():{}}),r?.mediaPlayers?.length&&(i?.isViewerView()||i.is("live")&&c?.camera_entity)){const n=r.mediaPlayers.map((t=>{const n=vp(e,t)||t,i=e.states[t],a=hm("media_player",{media_player:t,media_player_action:"play"}),r=hm("media_player",{media_player:t,media_player_action:"stop"}),o=!i||"unavailable"===i.state;return{enabled:!0,selected:!1,icon:_p(e,t),entity:t,state_color:!1,title:n,disabled:o,...!o&&a&&{tap_action:a},...!o&&r&&{hold_action:r}}}));m.push({icon:"mdi:cast",...t.menu.buttons.media_player,type:"custom:frigate-card-menu-submenu",title:Pm("config.menu.buttons.media_player"),items:n})}if(r?.currentMediaLoadedInfo&&r.currentMediaLoadedInfo.player){if(r.currentMediaLoadedInfo.capabilities?.supportsPause){const e=r.currentMediaLoadedInfo.player.isPaused();m.push({icon:e?"mdi:play":"mdi:pause",...t.menu.buttons.play,type:"custom:frigate-card-menu-icon",title:Pm("config.menu.buttons.play"),tap_action:hm(e?"play":"pause")})}if(r.currentMediaLoadedInfo.capabilities?.hasAudio){const e=r.currentMediaLoadedInfo.player.isMuted();m.push({icon:e?"mdi:volume-off":"mdi:volume-high",...t.menu.buttons.mute,type:"custom:frigate-card-menu-icon",title:Pm("config.menu.buttons.mute"),tap_action:hm(e?"unmute":"mute")})}}r?.currentMediaLoadedInfo&&r.currentMediaLoadedInfo.player&&m.push({icon:"mdi:monitor-screenshot",...t.menu.buttons.screenshot,type:"custom:frigate-card-menu-icon",title:Pm("config.menu.buttons.screenshot"),tap_action:hm("screenshot")});const p=this._dynamicMenuButtons.map((e=>({style:this._getStyleFromActions(t,i,e),...e})));return m.concat(p)}_getEmphasizedStyle(e){return e?{animation:"pulse 3s infinite",color:"var(--error-color, white)"}:{color:"var(--primary-color, white)"}}_getStyleFromActions(e,t,n){for(const i of[n.tap_action,n.double_tap_action,n.hold_action,n.start_tap_action,n.end_tap_action]){const n=Array.isArray(i)?i:[i];for(const i of n){if(!i||"fire-dom-event"!==i.action||!("frigate_card_action"in i))continue;const n=i;if(du.some((e=>e===n.frigate_card_action&&t?.is(n.frigate_card_action)))||"default"===n.frigate_card_action&&t.is(e.view.default)||"fullscreen"===n.frigate_card_action&&$r.isEnabled&&$r.isFullscreen||"camera_select"===n.frigate_card_action&&t.camera===n.camera)return this._getEmphasizedStyle()}}return{}}_isBeingCasted(){return!!navigator.userAgent.match(/CrKey\//)}}class wb{constructor(e){this._timer=new _m,this._mute=!0,this._disconnectSeconds=e??0}async connect(){try{this._stream=await navigator.mediaDevices.getUserMedia({audio:!0,video:!1})}catch(e){Nf(e),this._stream=null}this._setMute()}async disconnect(){this._stream?.getTracks().forEach((e=>e.stop())),this._stream=void 0}getStream(){return this._stream??void 0}_setMute(){this._stream?.getTracks().forEach((e=>{e.enabled=!this._mute})),this._startTimer()}mute(){this._mute=!0,this._setMute()}unmute(){this._mute=!1,this._setMute()}isConnected(){return!!this._stream}isForbidden(){return null===this._stream}isMuted(){return!this._stream||this._stream.getTracks().every((e=>!e.enabled))}_startTimer(){this._disconnectSeconds&&this._timer.start(this._disconnectSeconds,(()=>{this.disconnect()}))}}const xb=()=>{const e=new URLSearchParams(window.location.search),t=[],n=new RegExp(/^frigate-card-action(:(?\w+))?:(?\w+)/);for(const[i,a]of e.entries()){const e=i.match(n);if(!e||!e.groups)continue;const r=e.groups.cardID,o=e.groups.action;let s=null;switch(o){case"camera_select":case"live_substream_select":a&&(s=hm(o,{camera:a,cardID:r}));break;case"camera_ui":case"clip":case"clips":case"default":case"diagnostics":case"download":case"expand":case"image":case"live":case"menu_toggle":case"recording":case"recordings":case"snapshot":case"snapshots":case"timeline":s=hm(o,{cardID:r});break;default:console.warn(`Frigate card received unknown card action in query string: ${o}`)}s&&t.push(s)}return t},Cb=e=>{const t=document.createElement("canvas");t.width=e.videoWidth,t.height=e.videoHeight;const n=t.getContext("2d");return n?(n.drawImage(e,0,0,t.width,t.height),t.toDataURL("image/jpeg")):null};var $b;console.info(`%c FRIGATE-HASS-CARD \n%c ${Pm("common.version")} ${Lr} `,"color: pink; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),window.customCards=window.customCards||[],window.customCards.push({type:"frigate-card",name:Pm("common.frigate_card"),description:Pm("common.frigate_card_description"),preview:!0,documentationURL:Bs}),function(e){e.LANGUAGES="languages",e.SIDE_LOAD_ELEMENTS="side-load-elements",e.MEDIA_PLAYERS="media-players",e.CAMERAS="cameras",e.MICROPHONE="microphone"}($b||($b={}));let kb=class extends ge{constructor(){super(),this._panel=!1,this._expand=!1,this._menuButtonController=new bb,this._mediaLoadedInfoController=new cb,this._refMenu=Le(),this._refMain=Le(),this._refElements=Le(),this._refViews=Le(),this._interactionTimer=new _m,this._updateTimer=new _m,this._untriggerTimer=new _m,this._message=null,this._resolvedMediaCache=new ab,this._boundMouseHandler=yr(this._mouseHandler.bind(this),1e3),this._boundCardActionEventHandler=this._cardActionEventHandler.bind(this),this._boundFullscreenHandler=this._fullscreenHandler.bind(this),this._triggers=new Map,this._initializer=new sb,this._locationChangeHandler=()=>{this.hasUpdated&&xb().forEach((e=>this._cardActionHandler(e)))},this._entityRegistryManager=new nb(new Jy)}set hass(e){this._hass=e,this._hass&&(this._refMenu.value&&(this._refMenu.value.hass=this._hass),this._refElements.value&&(this._refElements.value.hass=this._hass),this._refViews.value&&(this._refViews.value.hass=this._hass)),this._conditionController?.hasHAStateConditions&&this._conditionController.setState({state:this._hass.states}),this._setLightOrDarkMode()}static async getConfigElement(){return await import("./editor-7b16019d.js"),document.createElement("frigate-card-editor")}static getStubConfig(e,t){return{cameras:[{camera_entity:t.find((e=>e.startsWith("camera.")))}]}}_requestUpdateForComponentsThatUseConditions(){this._refViews.value&&(this._refViews.value.conditionControllerEpoch=this._conditionController?.getEpoch()),this._refElements.value&&(this._refElements.value.conditionControllerEpoch=this._conditionController?.getEpoch())}_overrideConfig(){if(!this._conditionController)return;const e=Kv(this._conditionController,this._config,this._config.overrides);Aa(e,this._overriddenConfig)||(Aa(e.cameras,this._overriddenConfig?.cameras)&&Aa(e.cameras_global,this._overriddenConfig?.cameras_global)||this._initializer.uninitialize($b.CAMERAS),this._overriddenConfig=e)}_getSelectedCameraConfig(){return this._view&&this._cameraManager?this._cameraManager.getStore().getCameraConfig(this._view.camera):null}setConfig(e){if(!e)throw new Error(Pm("error.invalid_configuration"));const t=om.safeParse(e);if(!t.success){const n=Ov(e),i=ru(t.error);let a="";throw n&&"yaml"!==p().mode&&(a=`${Pm("error.upgrade_available")}. `),new Error(a+`${Pm("error.invalid_configuration")}: `+(i&&i.size?JSON.stringify([...i],null," "):Pm("error.invalid_configuration_no_hint")))}const n="low"!==t.data.performance.profile?t.data:Gy(e,t.data);n.test_gui&&p().setEditMode(!0),this._rawConfig=e,this._config=n,this._cardWideConfig={performance:n.performance,debug:n.debug},this._overriddenConfig=void 0,this._cameraManager=void 0,this._view=void 0,this._message=null,this._setupConditionController(),this._automationsController=new Nm(this._config.automations),this._setLightOrDarkMode(),this._setPropertiesForMinMaxHeight(),this._untrigger()}_setupConditionController(){this._conditionController?.destroy(),this._conditionController=new Xv(this._config),this._conditionController.addStateListener(this._overrideConfig.bind(this)),this._conditionController.addStateListener(this._requestUpdateForComponentsThatUseConditions.bind(this)),this._conditionController.addStateListener(this._executeAutomations.bind(this)),this._conditionController.setState({view:void 0,fullscreen:this._isInFullscreen(),expand:this._expand,camera:void 0,...this._hass&&this._conditionController?.hasHAStateConditions&&{state:this._hass.states},media_loaded:this._mediaLoadedInfoController.has()})}_executeAutomations(){if("error"!==this._message?.type&&this._hass&&this._conditionController)try{this._automationsController?.execute(this,this._hass,this._conditionController)}catch(e){this._handleThrownError(e)}}_getConfig(){return this._overriddenConfig||this._config}_changeView(e){hv(this._cardWideConfig,"Frigate Card view change: ",e?.view??e?.viewName??"[default]");const t=e=>{Oy.isMajorMediaChange(this._view,e)&&this._mediaLoadedInfoController.clear(),this._view?.view!==e.view&&this._resetMainScroll(),Oy.adoptFromViewIfAppropriate(e,this._view),this._view=e,this._conditionController?.setState({view:this._view.view,camera:this._view.camera})};if((e?.resetMessage??1)&&(this._message=null),e?.view)t(e.view);else{let n=null;if(this._cameraManager){const t=this._cameraManager.getStore().getVisibleCameras();if(t)if(e?.cameraID&&t.has(e.cameraID))n=e.cameraID;else if(this._view?.camera&&this._getConfig().view.update_cycle_camera){const e=Array.from(t.keys()),i=e.indexOf(this._view.camera);n=e[i+1>=e.length?0:i+1]}else n=t.keys().next().value}n&&(t(new Oy({view:e?.viewName??this._getConfig().view.default,camera:n})),this._startUpdateTimer())}}_setLightOrDarkMode(){"on"===this._getConfig().view.dark_mode||"auto"===this._getConfig().view.dark_mode&&(!this._interactionTimer.isRunning()||this._hass?.themes.darkMode)?this.setAttribute("dark",""):this.removeAttribute("dark")}_changeViewHandler(e){this._changeView({view:e.detail})}_addViewContextHandler(e){this._changeView({view:this._view?.clone().mergeInContext(e.detail)})}willUpdate(e){e.has("_cardWideConfig")&&((e,t)=>{const n=t?.style??{};for(const t of Object.keys(n)){const i=`--frigate-card-css-${t.replaceAll("_","-")}`;!1===n[t]?e.style.setProperty(i,Ky[t]):e.style.removeProperty(i)}})(this,this._cardWideConfig?.performance),e.has("_view")&&this._setPropertiesForExpandedMode();const t=e.get("_overriddenConfig")??e.get("_config"),n=this._getConfig();if((!this._microphoneController||e.has("_overriddenConfig")||e.has("_config"))&&t?.live.microphone.disconnect_seconds!==n.live.microphone.disconnect_seconds){const e=this._getConfig();this._microphoneController=new wb(e.live.microphone.always_connected?void 0:e.live.microphone.disconnect_seconds)}this._initializeBackground()}_setPropertiesForMinMaxHeight(){this.style.setProperty("--frigate-card-max-height",this._getConfig().dimensions.max_height),this.style.setProperty("--frigate-card-min-height",this._getConfig().dimensions.min_height)}_getMostRecentTrigger(){const e=[...this._triggers.entries()].sort(((e,t)=>t[1].getTime()-e[1].getTime()));return e.length?e[0][0]:null}_updateTriggeredCameras(e){if(!this._view||!this._isAutomatedViewUpdateAllowed(!0))return!1;const t=new Date;let n=!1,i=!1;const a=this._cameraManager?.getStore().getVisibleCameras();for(const[n,r]of a?.entries()??[]){const a=r.triggers.entities??[],o=dp(this._hass,e,a,{stateOnly:!0}).some((e=>bp(e.newState))),s=a.every((e=>!bp(this._hass?.states[e])));o?(this._triggers.set(n,t),i=!0):s&&this._triggers.has(n)&&(this._triggers.delete(n),i=!0)}if(i)if(this._triggers.size){const e=this._getMostRecentTrigger();!e||this._view.camera===e&&this._view.is("live")||(this._changeView({view:new Oy({view:"live",camera:e})}),n=!0)}else this._startUntriggerTimer();return n}_isTriggered(){return!!this._triggers.size||this._untriggerTimer.isRunning()}_untrigger(){const e=this._isTriggered();this._triggers.clear(),this._untriggerTimer.stop(),e&&this.requestUpdate()}_startUntriggerTimer(){this._untriggerTimer.start(this._getConfig().view.scan.untrigger_seconds,(()=>{this._untrigger(),this._isAutomatedViewUpdateAllowed()&&this._getConfig().view.scan.untrigger_reset&&this._changeView()}))}_handleThrownError(e){e instanceof Error&&Nf(e),e instanceof vu&&this._setMessageAndUpdate({message:e.message,type:"error",context:e.context})}async _initializeCameras(e,t,n){this._cameraManager=new _v(new dv(this._entityRegistryManager,this._resolvedMediaCache,n),this._cardWideConfig);const i=t.cameras.map((e=>tr(Gi(t.cameras_global),e)));try{await this._cameraManager.initializeCameras(e,this._entityRegistryManager,i)}catch(e){this._handleThrownError(e)}if(!this._view){xb().find((e=>(e=>{switch(e.frigate_card_action){case"clip":case"clips":case"image":case"live":case"recording":case"recordings":case"snapshot":case"snapshots":case"timeline":return!0}return!1})(e)||"diagnostics"===e.frigate_card_action))||this._changeView({resetMessage:!1})}}async _initializeMicrophone(){await(this._microphoneController?.connect())}async _initializeMediaPlayers(e){const t=Object.keys(this._hass?.states||{}).filter((e=>{if(e.startsWith("media_player.")){const t=this._hass?.states[e];if(t&&"unavailable"!==t.state&&Ym(t,131072))return!0}return!1}));let n;try{n=await this._entityRegistryManager.getEntities(e,t)}catch(e){return void Nf(e)}this._mediaPlayers=t.filter((e=>{const t=n.get(e);return!t||!t.hidden_by}))}_initializeMandatory(){if(this._initializer.isInitializedMultiple([$b.LANGUAGES,$b.SIDE_LOAD_ELEMENTS,$b.CAMERAS]))return!0;const e=this._hass,t=this._getConfig(),n=this._cardWideConfig;return!!(e&&t&&n)&&(this._initializer.initializeMultipleIfNecessary({[$b.LANGUAGES]:async()=>await(async e=>{const t=Dm(e);"it"===t?Im[t]=await import("./lang-it-0e2e946c.js"):"pt"===t?Im[t]=await import("./lang-pt-PT-440b6dfd.js"):"pt_BR"===t&&(Im[t]=await import("./lang-pt-BR-1648942c.js")),t&&(Rm=t)})(e),[$b.SIDE_LOAD_ELEMENTS]:async()=>await yp()}).then((i=>!!i&&this._initializer.initializeIfNecessary($b.CAMERAS,(async()=>await this._initializeCameras(e,t,n))))).then((e=>{if(e)return this.requestUpdate()})),!1)}_initializeBackground(){const e=this._hass,t=this._getConfig();e&&t&&(this._initializer.isInitializedMultiple([...t.menu.buttons.media_player.enabled?[$b.MEDIA_PLAYERS]:[],...t.live.microphone.always_connected?[$b.MICROPHONE]:[]])||this._initializer.initializeMultipleIfNecessary({...t.menu.buttons.media_player.enabled&&{[$b.MEDIA_PLAYERS]:async()=>await this._initializeMediaPlayers(e)},...t.live.microphone.always_connected&&{[$b.MICROPHONE]:async()=>await this._initializeMicrophone()}}).then((e=>{e&&this.requestUpdate()})))}shouldUpdate(e){if(!this._initializeMandatory())return!1;const t=e.get("_hass");let n=!t||1!=e.size;if(!t&&!this._hass?.connected||t&&t.connected!==!!this._hass?.connected)return this._hass?.connected?this._changeView():this._setMessageAndUpdate({message:Pm("error.reconnecting"),icon:"mdi:lan-disconnect",type:"connection",dotdotdot:!0},!0),!0;if(t){const e=this._getSelectedCameraConfig();this._getConfig().view.scan.enabled&&this._updateTriggeredCameras(t)?n=!0:this._isAutomatedViewUpdateAllowed()&&up(this._hass,t,[...this._getConfig().view.update_entities||[],...e?.triggers.entities||[]])?(this._changeView(),n=!0):n||=up(this._hass,t,[...this._getConfig().view.render_entities??[],...this._mediaPlayers??[]])}return n}async _downloadViewerMedia(){const e=this._view?.queryResults?.getSelectedResult();if(this._hass&&this._cameraManager&&e)try{await by(this._hass,this._cameraManager,e)}catch(e){this._handleThrownError(e)}}_mediaPlayerAction(e,t){if(!(["play","stop"].includes(t)&&this._view&&this._hass&&this._cameraManager))return;let n=null,i=null,a=null,r=null;const o=this._getSelectedCameraConfig();if(!o)return;const s=o.camera_entity??null,c=this._view.queryResults?.getSelectedResult();this._view.isViewerView()&&c?(n=c.getContentID(),i=c.getContentType(),a=c.getTitle(),r=c.getThumbnail()):this._view?.is("live")&&s&&(n=`media-source://camera/${s}`,i="application/vnd.apple.mpegurl",a=this._cameraManager.getCameraMetadata(this._hass,this._view.camera)?.title??null,r=this._hass?.states[s]?.attributes?.entity_picture??null),n&&i&&("play"===t?this._hass?.callService("media_player","play_media",{entity_id:e,media_content_id:n,media_content_type:i,extra:{...a&&{title:a},...r&&{thumb:r}}}):"stop"===t&&this._hass?.callService("media_player","media_stop",{entity_id:e}))}_cardActionEventHandler(e){if("detail"in e){const t=um(e.detail);t&&this._cardActionHandler(t)}}_cardActionHandler(e){if(!this._cameraManager)return;if(e.card_id&&this._getConfig().card_id!==e.card_id)return;const t=e.frigate_card_action;switch(t){case"default":this._changeView();break;case"clip":case"clips":case"image":case"live":case"recording":case"recordings":case"snapshot":case"snapshots":case"timeline":this._changeView({viewName:t,cameraID:this._view?.camera});break;case"download":this._downloadViewerMedia();break;case"camera_ui":const n=this._getCameraURLFromContext();n&&window.open(n);break;case"expand":this._setExpand(!this._expand);break;case"fullscreen":$r.toggle(this);break;case"menu_toggle":this._refMenu.value?.toggleMenu();break;case"camera_select":const i=e.camera;if(this._view&&this._cameraManager?.getStore().hasVisibleCameraID(i)){const e=this._getConfig().view.camera_select,t="current"===e?this._view.view:e,n=this.isViewSupportedByCamera(i,t)?t:uu;this._changeView({view:new Oy({view:n,camera:i})})}break;case"live_substream_select":if(this._view){const t=((e,t)=>{const n=e.context?.live?.overrides??new Map;return n.set(e.camera,t),e.clone().mergeInContext({live:{overrides:n}})})(this._view,e.camera);t&&this._changeView({view:t})}break;case"live_substream_off":if(this._view){const e=(e=>{const t=e.clone(),n=t.context?.live?.overrides;return n&&n.has(e.camera)&&t.context?.live?.overrides?.delete(e.camera),t})(this._view);e&&this._changeView({view:e})}break;case"live_substream_on":if(this._view){const e=((e,t)=>{const n=[...pv(e,t.camera)];if(n.length<=1)return t.clone();const i=t.clone(),a=i.context?.live?.overrides??new Map,r=a.get(i.camera)??i.camera,o=n.indexOf(r),s=o<0?0:(o+1)%n.length;return a.set(t.camera,n[s]),i.mergeInContext({live:{overrides:a}}),i})(this._cameraManager,this._view);e&&this._changeView({view:e})}break;case"media_player":this._mediaPlayerAction(e.media_player,e.media_player_action);break;case"diagnostics":this._diagnostics();break;case"microphone_mute":this._microphoneController?.mute(),this.requestUpdate();break;case"microphone_unmute":this._microphoneController?.isConnected()||this._microphoneController?.isForbidden()?this._microphoneController?.isConnected()&&(this._microphoneController.unmute(),this.requestUpdate()):(this._microphoneController?.unmute(),this._initializeMicrophone().then((()=>this.requestUpdate())));break;case"mute":this._mediaLoadedInfoController.get()?.player?.mute();break;case"unmute":this._mediaLoadedInfoController.get()?.player?.unmute();break;case"play":this._mediaLoadedInfoController.get()?.player?.play();break;case"pause":this._mediaLoadedInfoController.get()?.player?.pause();break;case"screenshot":this._mediaLoadedInfoController.get()?.player?.getScreenshotURL().then((e=>{e&&yy(e,(e=>{if(e?.is("live")||e?.is("image"))return`${e.view}-${e.camera}-${Of(new Date,"yyyy-MM-dd-HH-mm-ss")}.jpg`;if(e?.isViewerView()){const t=e.queryResults?.getSelectedResult(),n=t?.getID()??null;return`${e.view}-${e.camera}${n?`-${n}`:""}.jpg`}return"screenshot.jpg"})(this._view))}));break;default:console.warn(`Frigate card received unknown card action: ${t}`)}}isViewSupportedByCamera(e,t){const n=this._cameraManager?.getCameraCapabilities(e);switch(t){case"live":case"image":return!0;case"clip":case"clips":return!!n?.supportsClips;case"snapshot":case"snapshots":return!!n?.supportsSnapshots;case"recording":case"recordings":return!!n?.supportsRecordings;case"timeline":return!!n?.supportsTimeline;case"media":return!!n?.supportsClips||!!n?.supportsSnapshots||!!n?.supportsRecordings}return!1}async _diagnostics(){if(this._hass){let e=[];try{e=await(async e=>await cp(e,Xy,{type:"config/device_registry/list"}))(this._hass)}catch(e){}const t=e.filter((e=>"Frigate"===e.manufacturer)),n=new Map;t.forEach((e=>{e.config_entries.forEach((t=>{e.model&&n.set(t,e.model)}))})),this._setMessageAndUpdate({message:Pm("error.diagnostics"),type:"diagnostics",icon:"mdi:information",context:{ha_version:this._hass.config.version,card_version:Lr,browser:navigator.userAgent,date:new Date,frigate_version:Object.fromEntries(n),lang:Dm(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,git:{build_version:Fr,build_date:Nr,commit_date:Ur},...this._rawConfig&&{config:this._rawConfig}}})}}_getCameraURLFromContext(){if(!this._view)return null;const e=this._view.camera,t=this._view.queryResults?.getSelectedResult()??null;return(this._cameraManager?.getCameraEndpoints(e,{view:this._view.view,...t&&{media:t}})??null)?.ui?.endpoint??null}_actionHandler(e,t){const n=e.detail.action,i=e.currentTarget,a=mm(n,t);this._hass&&t&&i&&n&&a&&pm(i,this._hass,t,e.detail.action,a),this._startInteractionTimer()}_mouseHandler(){this._startInteractionTimer()}_startInteractionTimer(){this._interactionTimer.stop(),this._untrigger(),this._getConfig().view.timeout_seconds&&this._interactionTimer.start(this._getConfig().view.timeout_seconds,(()=>{this._isAutomatedViewUpdateAllowed()&&(this._changeView(),this._setLightOrDarkMode())})),this._setLightOrDarkMode()}_startUpdateTimer(){this._updateTimer.stop(),this._getConfig().view.update_seconds&&this._updateTimer.start(this._getConfig().view.update_seconds,(()=>{this._isAutomatedViewUpdateAllowed()?this._changeView():this._startUpdateTimer()}))}_isAutomatedViewUpdateAllowed(e){return(e||!this._isTriggered())&&(this._getConfig().view.update_force||!this._interactionTimer.isRunning())}_renderMenu(){if(this._hass&&this._cameraManager&&this._view)return K` + + `}_setMessageAndUpdate(e,t){const n=this._message?cm[this._message.type]??0:0,i=cm[e.type]??0;(!this._message||i>=n)&&(this._message=e,this._mediaUnloadedHandler(),t||(this.requestUpdate(),this._resetMainScroll()))}_resetMainScroll(){this._refMain.value?.scroll({top:0})}_messageHandler(e){return this._setMessageAndUpdate(e.detail)}_mediaLoadedHandler(e){const t=e.detail;_b(t)&&(hv(this._cardWideConfig,"Frigate Card media load: ",t),this._mediaLoadedInfoController.set(t),this._setPropertiesForExpandedMode(),this._conditionController?.setState({media_loaded:this._mediaLoadedInfoController.has()}),this.requestUpdate())}_setPropertiesForExpandedMode(){const e=this._mediaLoadedInfoController.getLastKnown();this.style.setProperty("--frigate-card-expand-aspect-ratio",this._view?.isAnyMediaView()&&e?`${e.width} / ${e.height}`:"unset"),this.style.setProperty("--frigate-card-expand-width",this._view?.isAnyMediaView()?"none":"var(--frigate-card-expand-max-width)"),this.style.setProperty("--frigate-card-expand-height",this._view?.isAnyMediaView()?"none":"var(--frigate-card-expand-max-height)")}_mediaUnloadedHandler(){this._mediaLoadedInfoController.clear(),this._conditionController?.setState({media_loaded:!1})}firstUpdated(){this._locationChangeHandler()}connectedCallback(){super.connectedCallback(),$r.isEnabled&&$r.on("change",this._boundFullscreenHandler),this.addEventListener("mousemove",this._boundMouseHandler),this.addEventListener("ll-custom",this._boundCardActionEventHandler),this._panel=(e=>{const t=e.getRootNode();return!!(t&&t instanceof ShadowRoot&&"HUI-PANEL-VIEW"===t.host.tagName)})(this),window.addEventListener("location-changed",this._locationChangeHandler),window.addEventListener("popstate",this._locationChangeHandler),this._locationChangeHandler()}disconnectedCallback(){this._mediaUnloadedHandler(),$r.isEnabled&&$r.off("change",this._boundFullscreenHandler),this.removeEventListener("mousemove",this._boundMouseHandler),this.removeEventListener("ll-custom",this._boundCardActionEventHandler),window.removeEventListener("location-changed",this._locationChangeHandler),window.removeEventListener("popstate",this._locationChangeHandler),super.disconnectedCallback()}_isAspectRatioEnforced(){const e=this._getConfig().dimensions.aspect_ratio_mode;return!($r.isEnabled&&$r.isFullscreen||this._expand||"unconstrained"==e||"dynamic"==e&&(this._view?.isAnyMediaView()||this._view?.is("timeline")))}_getAspectRatioStyle(){if(!this._isAspectRatioEnforced())return"auto";const e=this._getConfig().dimensions.aspect_ratio_mode,t=this._mediaLoadedInfoController.getLastKnown();if(t&&"dynamic"===e)return`${t.width} / ${t.height}`;const n=this._getConfig().dimensions.aspect_ratio;return n?`${n[0]} / ${n[1]}`:"16 / 9"}_getMergedActions(){if(this._message||this._view?.is("timeline"))return{};let e;return this._view?.is("live")?e=this._getConfig().live.actions:this._view?.isGalleryView()?e=this._getConfig().media_gallery?.actions:this._view?.isViewerView()?e=this._getConfig().media_viewer.actions:this._view?.is("image")&&(e=this._getConfig().image?.actions),{...this._getConfig().view.actions,...e}}_isInFullscreen(){return $r.isEnabled&&$r.isFullscreen}_setExpand(e){e&&this._isInFullscreen()&&$r.exit(),this._expand=e,this._conditionController?.setState({expand:this._expand})}_fullscreenHandler(){this._isInFullscreen()&&(this._expand=!1),this._conditionController?.setState({fullscreen:this._isInFullscreen(),expand:this._expand}),this.requestUpdate()}_renderInDialogIfNecessary(e){return this._expand?K` {this._setExpand(!1)}} + > + ${e} + `:e}render(){if(!this._hass)return;const e={"aspect-ratio":this._getAspectRatioStyle()},t={triggered:!!this._isTriggered()&&this._getConfig().view.scan.show_trigger_status},n={main:!0,"curve-top":"outside"!==this._getConfig().menu.style||"top"!==this._getConfig().menu.position,"curve-bottom":"outside"!==this._getConfig().menu.style||"top"===this._getConfig().menu.position},i=this._getMergedActions(),a="outside"===this._getConfig().menu.style&&"top"===this._getConfig().menu.position;return this._renderInDialogIfNecessary(K` this._actionHandler(e,i)} + @frigate-card:message=${this._messageHandler.bind(this)} + @frigate-card:view:change=${this._changeViewHandler.bind(this)} + @frigate-card:view:change-context=${this._addViewContextHandler.bind(this)} + @frigate-card:media:loaded=${this._mediaLoadedHandler.bind(this)} + @frigate-card:media:unloaded=${this._mediaUnloadedHandler.bind(this)} + @frigate-card:media:volumechange=${()=>this.requestUpdate()} + @frigate-card:media:play=${()=>this.requestUpdate()} + @frigate-card:media:pause=${()=>this.requestUpdate()} + @frigate-card:render=${()=>this.requestUpdate()} + > + ${a?this._renderMenu():""} +
+ ${this._cameraManager?.isInitialized()||this._message?K``:$v({cardWideConfig:this._cardWideConfig})} + ${this._message?Cv(this._message):""} +
+ ${a?"":this._renderMenu()} + ${this._getConfig().elements?K` {this._menuButtonController.addDynamicMenuButton(e.detail),this.requestUpdate()}} + @frigate-card:menu-remove=${e=>{this._menuButtonController.removeDynamicMenuButton(e.detail),this.requestUpdate()}} + @frigate-card:condition:evaluate=${e=>{e.evaluation=this._conditionController?.evaluateCondition(e.condition)}} + > + `:""} +
`)}static get styles(){return b(":host {\n display: block;\n position: relative;\n background-color: var(--card-background-color);\n border-radius: var(--ha-card-border-radius, 4px);\n max-height: var(--frigate-card-max-height);\n min-height: var(--frigate-card-min-height);\n --frigate-card-expand-max-height: calc( ( 100vh - (2 * 56px) ) * 0.85 );\n --frigate-card-expand-max-width: 85vw;\n --frigate-card-expand-width: none;\n --frigate-card-expand-height: none;\n --frigate-card-expand-aspect-ratio: unset;\n --frigate-card-max-height: none;\n --frigate-card-min-height: none;\n}\n\n:host([dark]) {\n filter: brightness(75%);\n}\n\n:host([panel]) {\n height: 100%;\n}\n\ndiv.main {\n position: relative;\n overflow: auto;\n width: 100%;\n height: 100%;\n margin: auto;\n display: block;\n transform: translateZ(0);\n box-sizing: border-box;\n scrollbar-width: none;\n -ms-overflow-style: none;\n}\n\n/* Hide scrollbar for Chrome, Safari and Opera */\ndiv.main::-webkit-scrollbar {\n display: none;\n}\n\ndiv.main.curve-top {\n border-top-left-radius: var(--ha-card-border-radius, 4px);\n border-top-right-radius: var(--ha-card-border-radius, 4px);\n}\n\ndiv.main.curve-bottom {\n border-bottom-left-radius: var(--ha-card-border-radius, 4px);\n border-bottom-right-radius: var(--ha-card-border-radius, 4px);\n}\n\n/* The 'hover' menu mode is styled applied outside of the menu itself */\nfrigate-card-menu[data-style*=hover] {\n z-index: 1;\n transition: opacity 0.5s ease;\n}\n\n.main + frigate-card-menu[data-style*=hover] {\n opacity: 0;\n}\n\nfrigate-card-menu[data-style=hover]:hover {\n opacity: 1;\n}\n\n.main:hover + frigate-card-menu[data-style=hover-card],\nfrigate-card-menu[data-style=hover-card]:hover {\n opacity: 1;\n}\n\nha-card {\n display: flex;\n flex-direction: column;\n margin: auto;\n border: 0px;\n overflow: visible;\n width: 100%;\n height: 100%;\n position: static;\n color: var(--secondary-text-color, white);\n}\n\nha-card.triggered {\n animation: warning-pulse 5s infinite;\n}\n@keyframes warning-pulse {\n 0% {\n border: solid 2px rgba(0, 0, 0, 0);\n }\n 50% {\n border: solid 2px var(--warning-color);\n }\n 100% {\n border: solid 2px rgba(0, 0, 0, 0);\n }\n}\n\n/************\n * Fullscreen\n *************/\n:host(:fullscreen) #ha-card {\n border-radius: 0px;\n box-shadow: none;\n margin: 0;\n}\n\n:host(:-webkit-full-screen) #ha-card {\n border-radius: 0px;\n box-shadow: none;\n margin: 0;\n}\n\n:host(:fullscreen) div.main,\n:host(:fullscreen) frigate-card-menu {\n border-radius: 0px;\n}\n\n:host(:-webkit-full-screen) div.main,\n:host(:-webkit-full-screen) frigate-card-menu {\n border-radius: 0px;\n}\n\n/***************\n * Expanded mode\n ***************/\nweb-dialog {\n --dialog-padding: 0px;\n --dialog-container-padding: 0px;\n --dialog-max-height: var(--frigate-card-expand-max-height);\n --dialog-max-width: var(--frigate-card-expand-max-width);\n --dialog-width: var(--frigate-card-expand-width);\n --dialog-height: var(--frigate-card-expand-height);\n --dialog-overflow-x: visible;\n --dialog-overflow-y: visible;\n max-height: 100vh;\n}\n\nweb-dialog::part(dialog) {\n aspect-ratio: var(--frigate-card-expand-aspect-ratio);\n border-radius: 0px;\n background: transparent;\n}")}getCardSize(){const e=this._mediaLoadedInfoController.getLastKnown();return e?e.height/50:6}};e([we()],kb.prototype,"_hass",void 0),e([we()],kb.prototype,"_config",void 0),e([we()],kb.prototype,"_cardWideConfig",void 0),e([we()],kb.prototype,"_overriddenConfig",void 0),e([we()],kb.prototype,"_view",void 0),e([be({attribute:"panel",type:Boolean,reflect:!0})],kb.prototype,"_panel",void 0),e([we()],kb.prototype,"_expand",void 0),kb=e([_e("frigate-card")],kb);export{nd as $,wp as A,su as B,Pc as C,jv as D,jc as E,pu as F,Ac as G,zc as H,Oc as I,Dc as J,Rc as K,Ic as L,Td as M,Sd as N,Md as O,Ad as P,ed as Q,Kl as R,rd as S,lu as T,Xl as U,Jl as V,El as W,Ml as X,Sl as Y,Tl as Z,td as _,Gy as a,cd as a$,Al as a0,zl as a1,jl as a2,Rl as a3,Dl as a4,Ll as a5,Nl as a6,Pl as a7,Ol as a8,Il as a9,il as aA,nl as aB,al as aC,rl as aD,ol as aE,hl as aF,cl as aG,dl as aH,ul as aI,ll as aJ,sl as aK,bl as aL,wl as aM,fl as aN,vl as aO,_l as aP,ml as aQ,pl as aR,gl as aS,xl as aT,Cl as aU,$l as aV,dd as aW,hd as aX,ud as aY,md as aZ,sd as a_,Wl as aa,Bl as ab,Hl as ac,ql as ad,Vl as ae,Ul as af,Fl as ag,Zl as ah,Yl as ai,Ql as aj,Gl as ak,id as al,ad as am,Yc as an,qc as ao,Wc as ap,Bc as aq,Vc as ar,Zc as as,Gc as at,Kc as au,Xc as av,Jc as aw,el as ax,yl as ay,tl as az,yp as b,Ff as b$,ld as b0,wd as b1,xd as b2,$d as b3,kd as b4,Cd as b5,bd as b6,Vd as b7,qd as b8,Wd as b9,mc as bA,lc as bB,dc as bC,uc as bD,hc as bE,nc as bF,ic as bG,sc as bH,cc as bI,fc as bJ,gc as bK,yc as bL,_c as bM,wc as bN,bc as bO,xc as bP,sm as bQ,Qs as bR,Qg as bS,_p as bT,Ws as bU,Wf as bV,cp as bW,vu as bX,Fm as bY,Zm as bZ,Um as b_,Bd as ba,Xd as bb,Gd as bc,Kd as bd,tu as be,eu as bf,Jd as bg,zv as bh,Tv as bi,b as bj,e as bk,be as bl,we as bm,_e as bn,Df as bo,Gs as bp,vc as bq,pc as br,rc as bs,oc as bt,ac as bu,Ks as bv,ec as bw,Js as bx,tc as by,Xs as bz,Iv as c,_b as c$,Aa as c0,rv as c1,yr as c2,lv as c3,Wg as c4,_y as c5,Bg as c6,Zf as c7,Vf as c8,Yg as c9,Mf as cA,mf as cB,_f as cC,yf as cD,vf as cE,Op as cF,pf as cG,$e as cH,ke as cI,J as cJ,Ae as cK,Ev as cL,kv as cM,mb as cN,Lf as cO,Le as cP,dy as cQ,Kv as cR,Fe as cS,Iy as cT,vm as cU,pb as cV,X as cW,_m as cX,vy as cY,hy as cZ,vr as c_,Bm as ca,hv as cb,Gg as cc,Kg as cd,Rg as ce,uv as cf,Of as cg,Hf as ch,Kf as ci,Xf as cj,rb as ck,xp as cl,Jf as cm,Ug as cn,Yf as co,Xg as cp,Jg as cq,$p as cr,Cp as cs,kp as ct,Hp as cu,Fp as cv,Rp as cw,qp as cx,Lp as cy,Up as cz,vp as d,c_ as d0,If as d1,W_ as d2,x as d3,Ay as d4,Vy as d5,zy as d6,jy as d7,Nf as d8,Zy as d9,qy as dA,Ap as dB,Qf as dC,mr as dD,Qe as dE,fg as dF,Pe as dG,Me as dH,lp as dI,fy as dJ,Fy as da,$v as db,Bf as dc,wy as dd,Uy as de,Cv as df,qm as dg,Vm as dh,Cb as di,hb as dj,fb as dk,gb as dl,vb as dm,w as dn,Ce as dp,Se as dq,up as dr,ub as ds,Pg as dt,Lg as du,ov as dv,sv as dw,Fg as dx,Uf as dy,Wy as dz,Lc as e,Nc as f,Av as g,Uc as h,Ov as i,Fc as j,zd as k,Pm as l,yd as m,fd as n,Ee as o,Rf as p,gd as q,vd as r,ge as s,_d as t,cu as u,mv as v,Lv as w,l_ as x,K as y,l as z}; diff --git a/config/www/community/frigate-hass-card/card-555679fd.js.gz b/config/www/community/frigate-hass-card/card-555679fd.js.gz new file mode 100644 index 00000000..340a2bd6 Binary files /dev/null and b/config/www/community/frigate-hass-card/card-555679fd.js.gz differ diff --git a/config/www/community/frigate-hass-card/editor-7b16019d.js b/config/www/community/frigate-hass-card/editor-7b16019d.js new file mode 100644 index 00000000..e6ce79b4 --- /dev/null +++ b/config/www/community/frigate-hass-card/editor-7b16019d.js @@ -0,0 +1,381 @@ +import{l as e,s as a,c as n,i as t,a as i,b as o,y as s,g as r,d as l,p as d,o as c,C as m,e as u,f as h,h as _,j as b,k as g,F as p,m as v,n as f,q as $,r as y,t as w,B as S,T as M,u as x,v as I,w as C,x as O,z as k,A as N,D as T,E as B,G as A,H as P,I as H,J as z,K as L,L as E,M as j,N as q,O as U,P as Z,Q as F,R as V,S as R,U as D,V as G,W as J,X as K,Y as Q,Z as W,_ as X,$ as Y,a0 as ee,a1 as ae,a2 as ne,a3 as te,a4 as ie,a5 as oe,a6 as se,a7 as re,a8 as le,a9 as de,aa as ce,ab as me,ac as ue,ad as he,ae as _e,af as be,ag as ge,ah as pe,ai as ve,aj as fe,ak as $e,al as ye,am as we,an as Se,ao as Me,ap as xe,aq as Ie,ar as Ce,as as Oe,at as ke,au as Ne,av as Te,aw as Be,ax as Ae,ay as Pe,az as He,aA as ze,aB as Le,aC as Ee,aD as je,aE as qe,aF as Ue,aG as Ze,aH as Fe,aI as Ve,aJ as Re,aK as De,aL as Ge,aM as Je,aN as Ke,aO as Qe,aP as We,aQ as Xe,aR as Ye,aS as ea,aT as aa,aU as na,aV as ta,aW as ia,aX as oa,aY as sa,aZ as ra,a_ as la,a$ as da,b0 as ca,b1 as ma,b2 as ua,b3 as ha,b4 as _a,b5 as ba,b6 as ga,b7 as pa,b8 as va,b9 as fa,ba as $a,bb as ya,bc as wa,bd as Sa,be as Ma,bf as xa,bg as Ia,bh as Ca,bi as Oa,bj as ka,bk as Na,bl as Ta,bm as Ba,bn as Aa,bo as Pa,bp as Ha,bq as za,br as La,bs as Ea,bt as ja,bu as qa,bv as Ua,bw as Za,bx as Fa,by as Va,bz as Ra,bA as Da,bB as Ga,bC as Ja,bD as Ka,bE as Qa,bF as Wa,bG as Xa,bH as Ya,bI as en,bJ as an,bK as nn,bL as tn,bM as on,bN as sn,bO as rn,bP as ln,bQ as dn,bR as cn}from"./card-555679fd.js";const mn="buttons",un="cameras",hn="options",_n="scan",bn={cameras:{icon:"video",name:e("editor.cameras"),secondary:e("editor.cameras_secondary")},view:{icon:"eye",name:e("editor.view"),secondary:e("editor.view_secondary")},menu:{icon:"menu",name:e("editor.menu"),secondary:e("editor.menu_secondary")},live:{icon:"cctv",name:e("editor.live"),secondary:e("editor.live_secondary")},media_gallery:{icon:"grid",name:e("editor.media_gallery"),secondary:e("editor.media_gallery_secondary")},media_viewer:{icon:"filmstrip",name:e("editor.media_viewer"),secondary:e("editor.media_viewer_secondary")},image:{icon:"image",name:e("editor.image"),secondary:e("editor.image_secondary")},timeline:{icon:"chart-gantt",name:e("editor.timeline"),secondary:e("editor.timeline_secondary")},dimensions:{icon:"aspect-ratio",name:e("editor.dimensions"),secondary:e("editor.dimensions_secondary")},performance:{icon:"speedometer",name:e("editor.performance"),secondary:e("editor.performance_secondary")},overrides:{icon:"file-replace",name:e("editor.overrides"),secondary:e("editor.overrides_secondary")}};let gn=class extends a{constructor(){super(...arguments),this._defaults=n(dn),this._initialized=!1,this._configUpgradeable=!1,this._expandedMenus={},this._viewModes=[{value:"",label:""},{value:"live",label:e("config.view.views.live")},{value:"clips",label:e("config.view.views.clips")},{value:"snapshots",label:e("config.view.views.snapshots")},{value:"recordings",label:e("config.view.views.recordings")},{value:"clip",label:e("config.view.views.clip")},{value:"snapshot",label:e("config.view.views.snapshot")},{value:"recording",label:e("config.view.views.recording")},{value:"image",label:e("config.view.views.image")},{value:"timeline",label:e("config.view.views.timeline")}],this._cameraSelectViewModes=[...this._viewModes,{value:"current",label:e("config.view.views.current")}],this._filterModes=[{value:"",label:""},{value:"none",label:e("config.common.controls.filter.modes.none")},{value:"left",label:e("config.common.controls.filter.modes.left")},{value:"right",label:e("config.common.controls.filter.modes.right")}],this._menuStyles=[{value:"",label:""},{value:"none",label:e("config.menu.styles.none")},{value:"hidden",label:e("config.menu.styles.hidden")},{value:"overlay",label:e("config.menu.styles.overlay")},{value:"hover",label:e("config.menu.styles.hover")},{value:"hover-card",label:e("config.menu.styles.hover-card")},{value:"outside",label:e("config.menu.styles.outside")}],this._menuPositions=[{value:"",label:""},{value:"left",label:e("config.menu.positions.left")},{value:"right",label:e("config.menu.positions.right")},{value:"top",label:e("config.menu.positions.top")},{value:"bottom",label:e("config.menu.positions.bottom")}],this._menuAlignments=[{value:"",label:""},{value:"left",label:e("config.menu.alignments.left")},{value:"right",label:e("config.menu.alignments.right")},{value:"top",label:e("config.menu.alignments.top")},{value:"bottom",label:e("config.menu.alignments.bottom")}],this._nextPreviousControlStyles=[{value:"",label:""},{value:"chevrons",label:e("config.common.controls.next_previous.styles.chevrons")},{value:"icons",label:e("config.common.controls.next_previous.styles.icons")},{value:"none",label:e("config.common.controls.next_previous.styles.none")},{value:"thumbnails",label:e("config.common.controls.next_previous.styles.thumbnails")}],this._aspectRatioModes=[{value:"",label:""},{value:"dynamic",label:e("config.dimensions.aspect_ratio_modes.dynamic")},{value:"static",label:e("config.dimensions.aspect_ratio_modes.static")},{value:"unconstrained",label:e("config.dimensions.aspect_ratio_modes.unconstrained")}],this._thumbnailModes=[{value:"",label:""},{value:"none",label:e("config.common.controls.thumbnails.modes.none")},{value:"above",label:e("config.common.controls.thumbnails.modes.above")},{value:"below",label:e("config.common.controls.thumbnails.modes.below")},{value:"left",label:e("config.common.controls.thumbnails.modes.left")},{value:"right",label:e("config.common.controls.thumbnails.modes.right")}],this._thumbnailMedias=[{value:"",label:""},{value:"clips",label:e("config.common.controls.thumbnails.medias.clips")},{value:"snapshots",label:e("config.common.controls.thumbnails.medias.snapshots")}],this._titleModes=[{value:"",label:""},{value:"none",label:e("config.common.controls.title.modes.none")},{value:"popup-top-left",label:e("config.common.controls.title.modes.popup-top-left")},{value:"popup-top-right",label:e("config.common.controls.title.modes.popup-top-right")},{value:"popup-bottom-left",label:e("config.common.controls.title.modes.popup-bottom-left")},{value:"popup-bottom-right",label:e("config.common.controls.title.modes.popup-bottom-right")}],this._transitionEffects=[{value:"",label:""},{value:"none",label:e("config.media_viewer.transition_effects.none")},{value:"slide",label:e("config.media_viewer.transition_effects.slide")}],this._imageModes=[{value:"",label:""},{value:"camera",label:e("config.image.modes.camera")},{value:"screensaver",label:e("config.image.modes.screensaver")},{value:"url",label:e("config.image.modes.url")}],this._timelineMediaTypes=[{value:"",label:""},{value:"all",label:e("config.common.timeline.medias.all")},{value:"clips",label:e("config.common.timeline.medias.clips")},{value:"snapshots",label:e("config.common.timeline.medias.snapshots")}],this._timelineStyleTypes=[{value:"",label:""},{value:"ribbon",label:e("config.common.timeline.styles.ribbon")},{value:"stack",label:e("config.common.timeline.styles.stack")}],this._darkModes=[{value:"",label:""},{value:"on",label:e("config.view.dark_modes.on")},{value:"off",label:e("config.view.dark_modes.off")},{value:"auto",label:e("config.view.dark_modes.auto")}],this._mediaActionNegativeConditions=[{value:"",label:""},{value:"all",label:e("config.common.media_action_conditions.all")},{value:"unselected",label:e("config.common.media_action_conditions.unselected")},{value:"hidden",label:e("config.common.media_action_conditions.hidden")},{value:"never",label:e("config.common.media_action_conditions.never")}],this._mediaActionPositiveConditions=[{value:"",label:""},{value:"all",label:e("config.common.media_action_conditions.all")},{value:"selected",label:e("config.common.media_action_conditions.selected")},{value:"visible",label:e("config.common.media_action_conditions.visible")},{value:"never",label:e("config.common.media_action_conditions.never")}],this._layoutFits=[{value:"",label:""},{value:"contain",label:e("config.common.layout.fits.contain")},{value:"cover",label:e("config.common.layout.fits.cover")},{value:"fill",label:e("config.common.layout.fits.fill")}],this._miniTimelineModes=[{value:"",label:""},{value:"none",label:e("config.common.controls.timeline.modes.none")},{value:"above",label:e("config.common.controls.timeline.modes.above")},{value:"below",label:e("config.common.controls.timeline.modes.below")}],this._performanceProfiles=[{value:"",label:""},{value:"low",label:e("config.performance.profiles.low")},{value:"high",label:e("config.performance.profiles.high")}],this._go2rtcModes=[{value:"",label:""},{value:"mse",label:e("config.cameras.go2rtc.modes.mse")},{value:"webrtc",label:e("config.cameras.go2rtc.modes.webrtc")},{value:"mp4",label:e("config.cameras.go2rtc.modes.mp4")},{value:"mjpeg",label:e("config.cameras.go2rtc.modes.mjpeg")}],this._microphoneButtonTypes=[{value:"",label:""},{value:"momentary",label:e("config.menu.buttons.types.momentary")},{value:"toggle",label:e("config.menu.buttons.types.toggle")}]}setConfig(e){this._config=e,this._configUpgradeable=t(e);let a=null;try{a=this._config.performance?.profile}catch(e){}if("high"===a||"low"===a){const e=n(dn);"low"===a&&i(this._config,e),this._defaults=e}}willUpdate(){this._initialized||o().then((e=>{e&&(this._initialized=!0)}))}_renderOptionSetHeader(e,a){const n=bn[e];return s` +
+
+ +
${n.name}
+
+
${n.secondary}
+
+ `}_getLabel(a){const n=a.split(".").filter((e=>!e.match(/^\[[0-9]+\]$/))).join(".");return e(`config.${n}`)}_renderEntitySelector(e,a){if(this._config)return s` + this._valueChangedHandler(e,a)} + > + + `}_renderOptionSelector(e,a=[],n){if(this._config)return s` + this._valueChangedHandler(e,a)} + > + + `}_renderIconSelector(e,a){if(this._config)return s` + this._valueChangedHandler(e,a)} + > + + `}_renderNumberInput(e,a){if(!this._config)return;const n=r(this._config,e),t=void 0===a?.max?"box":"slider";return s` + this._valueChangedHandler(e,a)} + > + + `}_renderInfo(e){return s` ${e}`}_getEditorCameraTitle(a,n){return"string"==typeof n?.title&&n.title||("string"==typeof n?.camera_entity?l(this.hass,n.camera_entity):"")||"object"==typeof n?.webrtc_card&&n.webrtc_card&&"string"==typeof n.webrtc_card.entity&&n.webrtc_card.entity||("object"==typeof n?.frigate&&n.frigate&&"string"==typeof n?.frigate.camera_name&&n.frigate.camera_name?d(n.frigate.camera_name):"")||"string"==typeof n?.id&&n.id||e("editor.camera")+" #"+a}_renderViewScanMenu(){const a={submenu:!0,selected:!!this._expandedMenus[_n]};return s` +
+ + ${this._expandedMenus[_n]?s`
+ ${this._renderSwitch(u,this._defaults.view.scan.enabled,{label:e(`config.${u}`)})} + ${this._renderSwitch(h,this._defaults.view.scan.show_trigger_status,{label:e(`config.${h}`)})} + ${this._renderSwitch(_,this._defaults.view.scan.untrigger_reset)} + ${this._renderNumberInput(b,{default:this._defaults.view.scan.untrigger_seconds})} +
`:""} +
+ `}_renderMenuButton(a,n){const t=[{value:"",label:""},{value:"matching",label:e("config.menu.buttons.alignments.matching")},{value:"opposing",label:e("config.menu.buttons.alignments.opposing")}],i={submenu:!0,selected:this._expandedMenus[mn]===a};return s` +
+ + + ${this._expandedMenus[mn]===a?s`
+ ${this._renderSwitch(`${g}.${a}.enabled`,this._defaults.menu.buttons[a]?.enabled??!0,{label:e("config.menu.buttons.enabled")})} + ${this._renderOptionSelector(`${g}.${a}.alignment`,t,{label:e("config.menu.buttons.alignment")})} + ${this._renderNumberInput(`${g}.${a}.priority`,{max:p,default:this._defaults.menu.buttons[a]?.priority,label:e("config.menu.buttons.priority")})} + ${this._renderIconSelector(`${g}.${a}.icon`,{label:e("config.menu.buttons.icon")})} + ${n} +
`:""} +
+ `}_putInSubmenu(a,n,t,i,o){const r=this._expandedMenus[a]===n;return s`
+ + ${r?s`
${o}
`:""} +
`}_renderMediaLayout(a,n,t,i,o){return this._putInSubmenu(a,!0,n,{name:"mdi:page-layout-body"},s` + ${this._renderOptionSelector(t,this._layoutFits)} + ${this._renderNumberInput(i,{min:0,max:100,label:e("config.common.layout.position.x")})} + ${this._renderNumberInput(o,{min:0,max:100,label:e("config.common.layout.position.y")})} + `)}_renderTimelineCoreControls(a,n,t,i,o,r){return s` ${this._renderOptionSelector(a,this._timelineStyleTypes,{label:e(`config.common.${v}`)})} + ${this._renderNumberInput(n,{label:e(`config.common.${f}`)})} + ${this._renderNumberInput(t,{label:e(`config.common.${$}`)})} + ${this._renderOptionSelector(i,this._timelineMediaTypes,{label:e(`config.common.${y}`)})} + ${this._renderSwitch(o,r,{label:e(`config.common.${w}`)})}`}_renderMiniTimeline(a,n,t,i,o,r,l,d){return this._putInSubmenu(a,!0,"config.common.controls.timeline.editor_label",{name:"mdi:chart-gantt"},s` ${this._renderOptionSelector(n,this._miniTimelineModes,{label:e("config.common.controls.timeline.mode")})} + ${this._renderTimelineCoreControls(t,i,o,r,l,d)}`)}_renderNextPreviousControls(a,n,t,i){return this._putInSubmenu(a,!0,"config.common.controls.next_previous.editor_label",{name:"mdi:arrow-right-bold-circle"},s` + ${this._renderOptionSelector(n,this._nextPreviousControlStyles.filter((e=>!(!i?.allowThumbnails&&"thumbnails"===e.value||!i?.allowIcons&&"icons"===e.value))),{label:e("config.common.controls.next_previous.style")})} + ${this._renderNumberInput(t,{min:S,label:e("config.common.controls.next_previous.size")})} + `)}_renderThumbnailsControls(a,n,t,i,o,r,l,d){return this._putInSubmenu(a,!0,"config.common.controls.thumbnails.editor_label",{name:"mdi:image-text"},s` + ${d?.configPathMode?s`${this._renderOptionSelector(d.configPathMode,this._thumbnailModes,{label:e("config.common.controls.thumbnails.mode")})}`:s``} + ${d?.configPathMedia?s`${this._renderOptionSelector(d.configPathMedia,this._thumbnailMedias,{label:e("config.common.controls.thumbnails.media")})}`:s``} + ${this._renderNumberInput(n,{min:M,max:x,label:e("config.common.controls.thumbnails.size")})} + ${this._renderSwitch(t,l.show_details,{label:e("config.common.controls.thumbnails.show_details")})} + ${this._renderSwitch(i,l.show_favorite_control,{label:e("config.common.controls.thumbnails.show_favorite_control")})} + ${this._renderSwitch(o,l.show_timeline_control,{label:e("config.common.controls.thumbnails.show_timeline_control")})} + ${this._renderSwitch(r,l.show_download_control,{label:e("config.common.controls.thumbnails.show_download_control")})} + `)}_renderFilterControls(a,n){return this._putInSubmenu(a,!0,"config.common.controls.filter.editor_label",{name:"mdi:filter-cog"},s` + ${n?s`${this._renderOptionSelector(n,this._filterModes,{label:e("config.common.controls.filter.mode")})}`:s``} + `)}_renderTitleControls(a,n,t){return this._putInSubmenu(a,!0,"config.common.controls.title.editor_label",{name:"mdi:subtitles"},s` ${this._renderOptionSelector(n,this._titleModes,{label:e("config.common.controls.title.mode")})} + ${this._renderNumberInput(t,{min:0,max:60,label:e("config.common.controls.title.duration_seconds")})}`)}_renderCamera(a,t,i,o){const r=[{value:"",label:""},{value:"auto",label:e("config.cameras.live_providers.auto")},{value:"ha",label:e("config.cameras.live_providers.ha")},{value:"image",label:e("config.cameras.live_providers.image")},{value:"jsmpeg",label:e("config.cameras.live_providers.jsmpeg")},{value:"go2rtc",label:e("config.cameras.live_providers.go2rtc")},{value:"webrtc-card",label:e("config.cameras.live_providers.webrtc-card")}],l=[];a.forEach(((e,a)=>{a!==t&&l.push({value:I(e),label:this._getEditorCameraTitle(a,e)})}));const d=e=>{if(this._config){const a=n(this._config);e(a)&&this._updateConfig(a)}},m={submenu:!0,selected:this._expandedMenus[un]===t};return s` +
+ + ${this._expandedMenus[un]===t?s`
+
+ !o&&d((e=>!!(Array.isArray(e.cameras)&&t>0)&&(Pa(e.cameras,t,t-1),this._openMenu(un,t-1),!0)))} + > + + + =this._config.cameras.length-1} + @click=${()=>!o&&d((e=>!!(Array.isArray(e.cameras)&&t + + + {d((e=>!!Array.isArray(e.cameras)&&(e.cameras.splice(t,1),this._closeMenu(un),!0)))}} + > + + +
+ ${this._renderEntitySelector(C(Ha,t),"camera")} + ${this._renderOptionSelector(C(za,t),r)} + ${this._renderStringInput(C(La,t))} + ${this._renderIconSelector(C(Ea,t),{label:e("config.cameras.icon")})} + ${this._renderStringInput(C(ja,t))} + ${this._renderSwitch(C(qa,t),this._defaults.cameras.hide)} + ${this._putInSubmenu("cameras.engine",!0,"config.cameras.engines.editor_label",{name:"mdi:engine"},s`${this._putInSubmenu("cameras.frigate",t,"config.cameras.frigate.editor_label",{path:O},s` + ${this._renderStringInput(C(Ua,t))} + ${this._renderStringInput(C(Za,t))} + ${this._renderOptionSelector(C(Fa,t),[],{multiple:!0,label:e("config.cameras.frigate.labels")})} + ${this._renderOptionSelector(C(Va,t),[],{multiple:!0,label:e("config.cameras.frigate.zones")})} + ${this._renderStringInput(C(Ra,t))} + `)} + ${this._putInSubmenu("cameras.motioneye",t,"config.cameras.motioneye.editor_label",{path:"M 49.65,10.81 C 44.24,10.84 36.85,13.50 31.48,15.96 25.84,13.92 20.04,10.69 13.50,10.84 13.07,10.85 12.65,10.87 12.20,10.91 12.20,10.91 7.08,11.33 7.08,11.33 7.08,11.33 11.94,12.95 11.94,12.95 18.62,15.13 24.49,16.51 29.66,25.48 30.86,25.48 33.22,25.48 34.34,25.48 39.49,16.57 45.66,15.08 52.02,12.95 52.02,12.95 56.83,11.39 56.83,11.39 56.83,11.39 51.83,10.91 51.83,10.91 51.15,10.84 50.43,10.80 49.65,10.81 49.65,10.81 49.65,10.81 49.65,10.81 Z M 32.00,5.00 C 26.53,5.00 21.45,6.75 17.20,9.54 21.80,10.04 26.33,11.22 31.48,13.76 36.69,11.11 42.02,10.00 46.83,9.45 42.57,6.64 37.48,5.00 32.00,5.00 Z M 43.42,22.65 C 41.70,22.65 40.31,24.05 40.31,25.77 40.31,27.49 41.70,28.88 43.42,28.88 45.14,28.88 46.54,27.49 46.54,25.77 46.54,24.05 45.14,22.65 43.42,22.65 Z M 20.58,22.65 C 18.86,22.65 17.46,24.05 17.46,25.77 17.46,27.49 18.86,28.88 20.58,28.88 22.30,28.88 23.69,27.49 23.69,25.77 23.69,24.05 22.30,22.65 20.58,22.65 Z M 11.91,14.02 C 7.61,18.80 5.00,25.06 5.00,32.00 5.00,46.91 17.09,59.00 32.00,59.00 46.91,59.00 59.00,46.91 59.00,32.00 59.00,25.09 56.40,18.80 52.12,14.02 50.08,14.77 48.04,15.65 46.02,16.78 49.92,17.91 52.77,21.53 52.77,25.77 52.77,30.90 48.59,35.12 43.42,35.12 39.04,35.12 35.36,32.09 34.34,28.04 34.34,28.04 29.66,28.04 29.66,28.04 28.65,32.09 24.96,35.12 20.58,35.12 15.41,35.12 11.20,30.90 11.20,25.77 11.20,21.48 14.16,17.83 18.14,16.75 16.12,15.65 14.04,14.79 11.91,14.02 11.91,14.02 11.91,14.02 11.91,14.02 Z M 32.00,30.96 C 32.64,33.35 33.33,35.72 36.15,37.19 36.15,37.19 32.00,43.42 32.00,43.42 32.00,43.42 27.85,37.19 27.85,37.19 30.32,35.44 31.46,33.29 32.00,30.96 Z",viewBox:"0 0 64 64"},s` + ${this._renderStringInput(C(Da,t))} + ${this._renderStringInput(C(Ga,t))} + ${this._renderStringInput(C(Ja,t))} + ${this._renderStringInput(C(Ka,t))} + ${this._renderStringInput(C(Qa,t))} + `)} `)} + ${this._putInSubmenu("cameras.live_provider",!0,"config.cameras.live_provider_options.editor_label",{name:"mdi:cctv"},s` ${this._putInSubmenu("cameras.go2rtc",t,"config.cameras.go2rtc.editor_label",{name:"mdi:alpha-g-circle"},s`${this._renderOptionSelector(C(Wa,t),this._go2rtcModes,{multiple:!0,label:e("config.cameras.go2rtc.modes.editor_label")})} + ${this._renderStringInput(C(Xa,t))}`)} + ${this._putInSubmenu("cameras.image",!0,"config.cameras.image.editor_label",{name:"mdi:image"},s` + ${this._renderNumberInput(C(Ya,t))} + ${this._renderStringInput(C(en,t))} + `)} + ${this._putInSubmenu("cameras.webrtc_card",t,"config.cameras.webrtc_card.editor_label",{name:"mdi:webrtc"},s`${this._renderEntitySelector(C(an,t),"camera")} + ${this._renderStringInput(C(nn,t))}`)}`)} + ${this._putInSubmenu("cameras.dependencies",t,"config.cameras.dependencies.editor_label",{name:"mdi:graph"},s` ${this._renderSwitch(C(tn,t),this._defaults.cameras.dependencies.all_cameras)} + ${this._renderOptionSelector(C(on,t),l,{multiple:!0})}`)} + ${this._putInSubmenu("cameras.triggers",t,"config.cameras.triggers.editor_label",{name:"mdi:magnify-scan"},s` ${this._renderSwitch(C(sn,t),this._defaults.cameras.triggers.occupancy)} + ${this._renderSwitch(C(rn,t),this._defaults.cameras.triggers.motion)} + ${this._renderOptionSelector(C(ln,t),i,{multiple:!0})}`)} +
`:""} +
+ `}_renderStringInput(e,a){if(this._config)return s` + this._valueChangedHandler(e,a)} + > + + `}_renderSwitch(e,a,n){if(this._config)return s` + this._valueChangedHandler(e,a)} + > + + `}_updateConfig(e){this._config=e,k(this,"config-changed",{config:this._config})}render(){if(!this.hass||!this._config)return s``;const a=N(this.hass),t=r(this._config,cn)||[];return s` + ${this._configUpgradeable?s`
+ ${e("editor.upgrade_available")} + + {if(this._config){const e=n(this._config);T(e),this._updateConfig(e)}}} + > + + +
+
`:s``} +
+ ${this._renderOptionSetHeader("cameras")} + ${"cameras"===this._expandedMenus[hn]?s` +
+ ${t.map(((e,n)=>this._renderCamera(t,n,a)))} + ${this._renderCamera(t,t.length,a,!0)} +
+ `:""} + ${this._renderOptionSetHeader("view")} + ${"view"===this._expandedMenus[hn]?s` +
+ ${this._renderOptionSelector(B,this._viewModes)} + ${this._renderOptionSelector(A,this._cameraSelectViewModes)} + ${this._renderOptionSelector(P,this._darkModes)} + ${this._renderNumberInput(H)} + ${this._renderNumberInput(z)} + ${this._renderSwitch(L,this._defaults.view.update_force)} + ${this._renderSwitch(E,this._defaults.view.update_cycle_camera)} + ${this._renderViewScanMenu()} +
+ `:""} + ${this._renderOptionSetHeader("menu")} + ${"menu"===this._expandedMenus[hn]?s` +
+ ${this._renderOptionSelector(j,this._menuStyles)} + ${this._renderOptionSelector(q,this._menuPositions)} + ${this._renderOptionSelector(U,this._menuAlignments)} + ${this._renderNumberInput(Z,{min:S})} + ${this._renderMenuButton("frigate")} + ${this._renderMenuButton("cameras")} + ${this._renderMenuButton("substreams")} + ${this._renderMenuButton("live")} + ${this._renderMenuButton("clips")} + ${this._renderMenuButton("snapshots")} + ${this._renderMenuButton("recordings")} + ${this._renderMenuButton("image")} + ${this._renderMenuButton("download")} + ${this._renderMenuButton("camera_ui")} + ${this._renderMenuButton("fullscreen")} + ${this._renderMenuButton("expand")} + ${this._renderMenuButton("timeline")} + ${this._renderMenuButton("media_player")} + ${this._renderMenuButton("microphone",s`${this._renderOptionSelector(`${g}.microphone.type`,this._microphoneButtonTypes,{label:e("config.menu.buttons.type")})}`)} + ${this._renderMenuButton("play")} + ${this._renderMenuButton("mute")} + ${this._renderMenuButton("screenshot")} +
+ `:""} + ${this._renderOptionSetHeader("live")} + ${"live"===this._expandedMenus[hn]?s` +
+ ${this._renderSwitch(F,this._defaults.live.preload)} + ${this._renderSwitch(V,this._defaults.live.draggable)} + ${this._renderSwitch(R,this._defaults.live.zoomable)} + ${this._renderSwitch(D,this._defaults.live.lazy_load)} + ${this._renderOptionSelector(G,this._mediaActionNegativeConditions)} + ${this._renderOptionSelector(J,this._mediaActionPositiveConditions)} + ${this._renderOptionSelector(K,this._mediaActionNegativeConditions)} + ${this._renderOptionSelector(Q,this._mediaActionNegativeConditions)} + ${this._renderOptionSelector(W,this._mediaActionPositiveConditions)} + ${this._renderOptionSelector(X,this._transitionEffects)} + ${this._renderSwitch(Y,this._defaults.live.show_image_during_load)} + ${this._putInSubmenu("live.controls",!0,"config.live.controls.editor_label",{name:"mdi:gamepad"},s` + ${this._renderSwitch(ee,this._defaults.live.controls.builtin,{label:e("config.common.controls.builtin")})} + ${this._renderNextPreviousControls("live.controls.next_previous",ae,ne,{allowIcons:!0})} + ${this._renderThumbnailsControls("live.controls.thumbnails",te,ie,oe,se,re,this._defaults.live.controls.thumbnails,{configPathMedia:le,configPathMode:de})} + ${this._renderTitleControls("live.controls.title",ce,me)} + ${this._renderMiniTimeline("live.controls.timeline",ue,he,_e,be,ge,pe,this._defaults.live.controls.timeline.show_recordings)} + `)} + ${this._renderMediaLayout("live.layout","config.live.layout",ve,fe,$e)} + ${this._putInSubmenu("live.microphone",!0,"config.live.microphone.editor_label",{name:"mdi:microphone"},s` + ${this._renderNumberInput(ye)} + ${this._renderSwitch(we,this._defaults.live.microphone.always_connected)} + `)} +
+ `:""} + ${this._renderOptionSetHeader("media_gallery")} + ${"media_gallery"===this._expandedMenus[hn]?s`
+ ${this._renderThumbnailsControls("media_gallery.controls.thumbnails",Se,Me,xe,Ie,Ce,this._defaults.media_gallery.controls.thumbnails)} + ${this._renderFilterControls("media_gallery.controls.filter",Oe)} +
`:""} + ${this._renderOptionSetHeader("media_viewer")} + ${"media_viewer"===this._expandedMenus[hn]?s`
+ ${this._renderOptionSelector(ke,this._mediaActionPositiveConditions)} + ${this._renderOptionSelector(Ne,this._mediaActionNegativeConditions)} + ${this._renderOptionSelector(Te,this._mediaActionNegativeConditions)} + ${this._renderOptionSelector(Be,this._mediaActionPositiveConditions)} + ${this._renderSwitch(Ae,this._defaults.media_viewer.draggable)} + ${this._renderSwitch(Pe,this._defaults.media_viewer.zoomable)} + ${this._renderSwitch(He,this._defaults.media_viewer.lazy_load)} + ${this._renderOptionSelector(ze,this._transitionEffects)} + ${this._renderSwitch(Le,this._defaults.media_viewer.snapshot_click_plays_clip)} + ${this._putInSubmenu("media_viewer.controls",!0,"config.media_viewer.controls.editor_label",{name:"mdi:gamepad"},s` + ${this._renderSwitch(Ee,this._defaults.media_viewer.controls.builtin,{label:e("config.common.controls.builtin")})} + ${this._renderNextPreviousControls("media_viewer.controls.next_previous",je,qe,{allowThumbnails:!0})} + ${this._renderThumbnailsControls("media_viewer.controls.thumbnails",Ue,Ze,Fe,Ve,Re,this._defaults.media_viewer.controls.thumbnails,{configPathMode:De})} + ${this._renderTitleControls("media_viewer.controls.title",Ge,Je)} + ${this._renderMiniTimeline("media_viewer.controls.timeline",Ke,Qe,We,Xe,Ye,ea,this._defaults.media_viewer.controls.timeline.show_recordings)} + `)} + ${this._renderMediaLayout("media_viewer.layout","config.media_viewer.layout",aa,na,ta)} +
`:""} + ${this._renderOptionSetHeader("image")} + ${"image"===this._expandedMenus[hn]?s`
+ ${this._renderOptionSelector(ia,this._imageModes)} + ${this._renderStringInput(oa)} + ${this._renderNumberInput(sa)} + ${this._renderSwitch(ra,this._defaults.image.zoomable)} + ${this._renderMediaLayout("image.layout","config.image.layout",la,da,ca)} +
`:""} + ${this._renderOptionSetHeader("timeline")} + ${"timeline"===this._expandedMenus[hn]?s`
+ ${this._renderTimelineCoreControls(v,f,$,y,w,this._defaults.timeline.show_recordings)} + ${this._renderThumbnailsControls("timeline.controls.thumbnails",ma,ua,ha,_a,ba,this._defaults.timeline.controls.thumbnails,{configPathMode:ga})} +
`:""} + ${this._renderOptionSetHeader("dimensions")} + ${"dimensions"===this._expandedMenus[hn]?s`
+ ${this._renderOptionSelector(pa,this._aspectRatioModes)} + ${this._renderStringInput(va)} + ${this._renderStringInput(fa)} + ${this._renderStringInput($a)} +
`:""} + ${this._renderOptionSetHeader("performance","low"===r(this._config,ya)?"warning":void 0)} + ${"performance"===this._expandedMenus[hn]?s`
+ ${"low"===r(this._config,ya)?this._renderInfo(e("config.performance.warning")):s``} + ${this._renderOptionSelector(ya,this._performanceProfiles)} + ${this._putInSubmenu("performance.features",!0,"config.performance.features.editor_label",{name:"mdi:feature-search"},s` + ${this._renderSwitch(wa,this._defaults.performance.features.animated_progress_indicator)} + ${this._renderNumberInput(Sa,{max:Ma})} + `)} + ${this._putInSubmenu("performance.style",!0,"config.performance.style.editor_label",{name:"mdi:palette-swatch-variant"},s` + ${this._renderSwitch(xa,this._defaults.performance.style.border_radius)} + ${this._renderSwitch(Ia,this._defaults.performance.style.box_shadow)} + `)} +
`:""} + ${void 0!==this._config.overrides?s` ${this._renderOptionSetHeader("overrides")} + ${"overrides"===this._expandedMenus[hn]?s`
+ ${this._renderInfo(e("config.overrides.info"))} +
`:""}`:s``} +
+ `}_closeMenu(e){delete this._expandedMenus[e],this.requestUpdate()}_openMenu(e,a){this._expandedMenus[e]=a,this.requestUpdate()}_toggleMenu(e){if(e&&e.target){const a=e.target.domain,n=e.target.key;this._expandedMenus[a]===n?this._closeMenu(a):this._openMenu(a,n)}}_valueChangedHandler(e,a){if(!this._config||!this.hass)return;let t;if(a.detail&&void 0!==a.detail.value&&(t=a.detail.value,"string"==typeof t&&(t=t.trim())),r(this._config,e)===t)return;const i=n(this._config);""===t||void 0===t?Ca(i,e):Oa(i,e,t),this._updateConfig(i)}static get styles(){return ka('ha-icon-button.button {\n color: var(--secondary-color, white);\n background-color: rgba(0, 0, 0, 0.6);\n border-radius: 50%;\n padding: 0px;\n margin: 3px;\n --ha-icon-display: block;\n /* Buttons can always be clicked */\n pointer-events: auto;\n opacity: 0.9;\n}\n\n@keyframes pulse {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0.6;\n }\n 100% {\n opacity: 1;\n }\n}\nha-icon[data-domain=alert][data-state=on],\nha-icon[data-domain=automation][data-state=on],\nha-icon[data-domain=binary_sensor][data-state=on],\nha-icon[data-domain=calendar][data-state=on],\nha-icon[data-domain=camera][data-state=streaming],\nha-icon[data-domain=cover][data-state=open],\nha-icon[data-domain=fan][data-state=on],\nha-icon[data-domain=humidifier][data-state=on],\nha-icon[data-domain=light][data-state=on],\nha-icon[data-domain=input_boolean][data-state=on],\nha-icon[data-domain=lock][data-state=unlocked],\nha-icon[data-domain=media_player][data-state=on],\nha-icon[data-domain=media_player][data-state=paused],\nha-icon[data-domain=media_player][data-state=playing],\nha-icon[data-domain=script][data-state=on],\nha-icon[data-domain=sun][data-state=above_horizon],\nha-icon[data-domain=switch][data-state=on],\nha-icon[data-domain=timer][data-state=active],\nha-icon[data-domain=vacuum][data-state=cleaning],\nha-icon[data-domain=group][data-state=on],\nha-icon[data-domain=group][data-state=home],\nha-icon[data-domain=group][data-state=open],\nha-icon[data-domain=group][data-state=locked],\nha-icon[data-domain=group][data-state=problem] {\n color: var(--paper-item-icon-active-color, #fdd835);\n}\n\nha-icon[data-domain=climate][data-state=cooling] {\n color: var(--cool-color, var(--state-climate-cool-color));\n}\n\nha-icon[data-domain=climate][data-state=heating] {\n color: var(--heat-color, var(--state-climate-heat-color));\n}\n\nha-icon[data-domain=climate][data-state=drying] {\n color: var(--dry-color, var(--state-climate-dry-color));\n}\n\nha-icon[data-domain=alarm_control_panel] {\n color: var(--alarm-color-armed, var(--label-badge-red));\n}\n\nha-icon[data-domain=alarm_control_panel][data-state=disarmed] {\n color: var(--alarm-color-disarmed, var(--label-badge-green));\n}\n\nha-icon[data-domain=alarm_control_panel][data-state=pending],\nha-icon[data-domain=alarm_control_panel][data-state=arming] {\n color: var(--alarm-color-pending, var(--label-badge-yellow));\n animation: pulse 1s infinite;\n}\n\nha-icon[data-domain=alarm_control_panel][data-state=triggered] {\n color: var(--alarm-color-triggered, var(--label-badge-red));\n animation: pulse 1s infinite;\n}\n\nha-icon[data-domain=plant][data-state=problem],\nha-icon[data-domain=zwave][data-state=dead] {\n color: var(--state-icon-error-color);\n}\n\n/* Color the icon if unavailable */\nha-icon[data-state=unavailable] {\n color: var(--state-unavailable-color);\n}\n\nha-icon-button[data-domain=alert][data-state=on],\nha-icon-button[data-domain=automation][data-state=on],\nha-icon-button[data-domain=binary_sensor][data-state=on],\nha-icon-button[data-domain=calendar][data-state=on],\nha-icon-button[data-domain=camera][data-state=streaming],\nha-icon-button[data-domain=cover][data-state=open],\nha-icon-button[data-domain=fan][data-state=on],\nha-icon-button[data-domain=humidifier][data-state=on],\nha-icon-button[data-domain=light][data-state=on],\nha-icon-button[data-domain=input_boolean][data-state=on],\nha-icon-button[data-domain=lock][data-state=unlocked],\nha-icon-button[data-domain=media_player][data-state=on],\nha-icon-button[data-domain=media_player][data-state=paused],\nha-icon-button[data-domain=media_player][data-state=playing],\nha-icon-button[data-domain=script][data-state=on],\nha-icon-button[data-domain=sun][data-state=above_horizon],\nha-icon-button[data-domain=switch][data-state=on],\nha-icon-button[data-domain=timer][data-state=active],\nha-icon-button[data-domain=vacuum][data-state=cleaning],\nha-icon-button[data-domain=group][data-state=on],\nha-icon-button[data-domain=group][data-state=home],\nha-icon-button[data-domain=group][data-state=open],\nha-icon-button[data-domain=group][data-state=locked],\nha-icon-button[data-domain=group][data-state=problem] {\n color: var(--paper-item-icon-active-color, #fdd835);\n}\n\nha-icon-button[data-domain=climate][data-state=cooling] {\n color: var(--cool-color, var(--state-climate-cool-color));\n}\n\nha-icon-button[data-domain=climate][data-state=heating] {\n color: var(--heat-color, var(--state-climate-heat-color));\n}\n\nha-icon-button[data-domain=climate][data-state=drying] {\n color: var(--dry-color, var(--state-climate-dry-color));\n}\n\nha-icon-button[data-domain=alarm_control_panel] {\n color: var(--alarm-color-armed, var(--label-badge-red));\n}\n\nha-icon-button[data-domain=alarm_control_panel][data-state=disarmed] {\n color: var(--alarm-color-disarmed, var(--label-badge-green));\n}\n\nha-icon-button[data-domain=alarm_control_panel][data-state=pending],\nha-icon-button[data-domain=alarm_control_panel][data-state=arming] {\n color: var(--alarm-color-pending, var(--label-badge-yellow));\n animation: pulse 1s infinite;\n}\n\nha-icon-button[data-domain=alarm_control_panel][data-state=triggered] {\n color: var(--alarm-color-triggered, var(--label-badge-red));\n animation: pulse 1s infinite;\n}\n\nha-icon-button[data-domain=plant][data-state=problem],\nha-icon-button[data-domain=zwave][data-state=dead] {\n color: var(--state-icon-error-color);\n}\n\n/* Color the icon if unavailable */\nha-icon-button[data-state=unavailable] {\n color: var(--state-unavailable-color);\n}\n\n.option {\n padding: 4px 4px;\n cursor: pointer;\n}\n\n.option.option-overrides .title {\n color: var(--warning-color);\n}\n\n.row {\n display: flex;\n margin-bottom: -14px;\n pointer-events: none;\n}\n\n.title {\n padding-left: 16px;\n margin-top: -6px;\n pointer-events: none;\n}\n\n.title.warning {\n color: var(--warning-color);\n}\n\n.secondary {\n padding-left: 40px;\n color: var(--secondary-text-color);\n pointer-events: none;\n}\n\n.values {\n background: var(--secondary-background-color);\n display: grid;\n}\n\n.values + .option,\n.submenu + .option {\n margin-top: 10px;\n}\n\ndiv.upgrade {\n width: auto;\n border: 1px dotted var(--primary-color);\n margin: 10px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\ndiv.upgrade span {\n padding: 10px;\n}\n\n.submenu-header {\n display: flex;\n padding: 10px;\n cursor: pointer;\n}\n\n.submenu.selected > .submenu-header {\n background-color: var(--primary-color);\n color: var(--primary-text-color);\n}\n\n.submenu-header * {\n flex-basis: auto;\n pointer-events: none;\n}\n\n.submenu-header .new-camera {\n font-style: italic;\n}\n\n.submenu:not(.selected) > .submenu-header .new-camera {\n color: var(--secondary-text-color, "black");\n}\n\n.submenu-header ha-icon,\n.submenu-header ha-svg-icon {\n padding-right: 15px;\n}\n\n.submenu.selected {\n border: 1px solid var(--primary-color);\n}\n\n.submenu {\n width: calc(100% - 20px);\n margin-left: auto;\n margin-right: auto;\n margin-bottom: 10px;\n}\n\n.submenu:first-child,\n:not(.submenu) + .submenu {\n margin-top: 10px;\n}\n\n.submenu .controls {\n display: inline-block;\n margin-left: auto;\n margin-right: 0px;\n margin-bottom: 5px;\n}\n\n.submenu .controls ha-icon-button.button {\n --mdc-icon-button-size: 32px;\n --mdc-icon-size: calc(var(--mdc-icon-button-size) / 2);\n}\n\nspan.info {\n padding: 10px;\n}\n\nha-selector {\n padding: 10px;\n border: 1px solid var(--divider-color);\n}')}};Na([Ta({attribute:!1})],gn.prototype,"hass",void 0),Na([Ba()],gn.prototype,"_config",void 0),Na([Ba()],gn.prototype,"_defaults",void 0),Na([Ba()],gn.prototype,"_expandedMenus",void 0),gn=Na([Aa("frigate-card-editor")],gn);export{gn as FrigateCardEditor}; diff --git a/config/www/community/frigate-hass-card/editor-7b16019d.js.gz b/config/www/community/frigate-hass-card/editor-7b16019d.js.gz new file mode 100644 index 00000000..c852598a Binary files /dev/null and b/config/www/community/frigate-hass-card/editor-7b16019d.js.gz differ diff --git a/config/www/community/frigate-hass-card/endpoint-aa68fc9e.js b/config/www/community/frigate-hass-card/endpoint-aa68fc9e.js new file mode 100644 index 00000000..a09ee8ad --- /dev/null +++ b/config/www/community/frigate-hass-card/endpoint-aa68fc9e.js @@ -0,0 +1 @@ +import{dI as r,d8 as t,cL as n,l as a}from"./card-555679fd.js";const e=async(e,s,i,l)=>{if(!i.sign)return i.endpoint;let c;try{c=await r(s,i.endpoint,l)}catch(r){return t(r),null}return c?c.replace(/^http/i,"ws"):(n(e,a("error.failed_sign")),null)};export{e as g}; diff --git a/config/www/community/frigate-hass-card/endpoint-aa68fc9e.js.gz b/config/www/community/frigate-hass-card/endpoint-aa68fc9e.js.gz new file mode 100644 index 00000000..705432e7 Binary files /dev/null and b/config/www/community/frigate-hass-card/endpoint-aa68fc9e.js.gz differ diff --git a/config/www/community/frigate-hass-card/engine-e412e9a0.js b/config/www/community/frigate-hass-card/engine-e412e9a0.js new file mode 100644 index 00000000..e0a518f7 --- /dev/null +++ b/config/www/community/frigate-hass-card/engine-e412e9a0.js @@ -0,0 +1 @@ +const e=1e4;export{e as C}; diff --git a/config/www/community/frigate-hass-card/engine-e412e9a0.js.gz b/config/www/community/frigate-hass-card/engine-e412e9a0.js.gz new file mode 100644 index 00000000..4b6193a0 Binary files /dev/null and b/config/www/community/frigate-hass-card/engine-e412e9a0.js.gz differ diff --git a/config/www/community/frigate-hass-card/engine-frigate-2c5e3aa9.js b/config/www/community/frigate-hass-card/engine-frigate-2c5e3aa9.js new file mode 100644 index 00000000..7770aac0 --- /dev/null +++ b/config/www/community/frigate-hass-card/engine-frigate-2c5e3aa9.js @@ -0,0 +1 @@ +import{bU as e,bV as t,bW as r,bX as a,l as n,bY as i,bZ as s,b_ as o,b$ as c,p as u,c0 as g,c1 as l,c2 as d,bS as m,c3 as f,c4 as p,c5 as h,c6 as _,c7 as y,c8 as v,c9 as w,ca as b,cb as C,d as D,cc as T,cd as M,ce as S,cf as I,cg as x,ch as F}from"./card-555679fd.js";import{C as $}from"./engine-e412e9a0.js";import{u as N}from"./uniqWith-12b3ff8a.js";import{V as R,a as Y}from"./media-b0eb3f2a.js";import{g as E}from"./_commonjsHelpers-1789f0cf.js";import{GenericCameraManagerEngine as z}from"./engine-generic-395b8c68.js";const j=e.object({camera:e.string(),end_time:e.number().nullable(),false_positive:e.boolean().nullable(),has_clip:e.boolean(),has_snapshot:e.boolean(),id:e.string(),label:e.string(),sub_label:e.string().nullable(),start_time:e.number(),top_score:e.number().nullable(),zones:e.string().array(),retain_indefinitely:e.boolean().optional()}).array(),H=e.object({hour:e.preprocess((e=>Number(e)),e.number().min(0).max(23)),duration:e.number().min(0),events:e.number().min(0)}),Z=e.object({day:e.preprocess((e=>"string"==typeof e?t(e):e),e.date()),events:e.number(),hours:H.array()}).array(),U=e.object({start_time:e.number(),end_time:e.number(),id:e.string()}).array(),P=e.object({success:e.boolean(),message:e.string()}),Q=e.object({camera:e.string(),day:e.string(),label:e.string(),sub_label:e.string().nullable(),zones:e.string().array()}).array();const W=async(e,t)=>await r(e,j,{type:"frigate/events/get",...t},!0);function q(e){i(1,arguments);var t=o(e);return s(1e3*t)}var O={exports:{}},A={exports:{}},L={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=function(e){if(!a[e]){var t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),r="06/25/2014, 00:00:00"===t||"‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00"===t;a[e]=r?new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return a[e]}(t);return n.formatToParts?function(e,t){try{for(var a=e.formatToParts(t),n=[],i=0;i=0&&(n[s]=parseInt(a[i].value,10))}return n}catch(e){if(e instanceof RangeError)return[NaN];throw e}}(n,e):function(e,t){var r=e.format(t).replace(/\u200E/g,""),a=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(r);return[a[3],a[1],a[2],a[4],a[5],a[6]]}(n,e)};var r={year:0,month:1,day:2,hour:3,minute:4,second:5};var a={};e.exports=t.default}(L,L.exports);var V,k,G={exports:{}};V=G,k=G.exports,Object.defineProperty(k,"__esModule",{value:!0}),k.default=function(e,t,r,a,n,i,s){var o=new Date(0);return o.setUTCFullYear(e,t,r),o.setUTCHours(a,n,i,s),o},V.exports=k.default,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){var n,l,d;if(!e)return 0;if(n=o.timezoneZ.exec(e))return 0;if(n=o.timezoneHH.exec(e))return u(d=parseInt(n[1],10))?-d*i:NaN;if(n=o.timezoneHHMM.exec(e)){d=parseInt(n[1],10);var m=parseInt(n[2],10);return u(d,m)?(l=Math.abs(d)*i+m*s,d>0?-l:l):NaN}if(function(e){if(g[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),g[e]=!0,!0}catch(e){return!1}}(e)){t=new Date(t||Date.now());var f=r?t:function(e){return(0,a.default)(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}(t),p=c(f,e),h=r?p:function(e,t,r){var a=e.getTime(),n=a-t,i=c(new Date(n),r);if(t===i)return t;n-=i-t;var s=c(new Date(n),r);if(i===s)return i;return Math.max(i,s)}(t,p,e);return-h}return NaN};var r=n(L.exports),a=n(G.exports);function n(e){return e&&e.__esModule?e:{default:e}}var i=36e5,s=6e4,o={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function c(e,t){var n=(0,r.default)(e,t),i=(0,a.default)(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime(),s=e.getTime(),o=s%1e3;return i-(s-=o>=0?o:1e3+o)}function u(e,t){return-23<=e&&e<=23&&(null==t||0<=t&&t<=59)}var g={};e.exports=t.default}(A,A.exports);var B={exports:{}},X={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);if(isNaN(t))return t;return t<0?Math.ceil(t):Math.floor(t)},e.exports=t.default}(X,X.exports);var J={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()},e.exports=t.default}(J,J.exports);var K={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/;t.default=r,e.exports=t.default}(K,K.exports),function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(null===e)return new Date(NaN);var i=t||{},s=null==i.additionalDigits?u:(0,r.default)(i.additionalDigits);if(2!==s&&1!==s&&0!==s)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))return new Date(e.getTime());if("number"==typeof e||"[object Number]"===Object.prototype.toString.call(e))return new Date(e);if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var d=function(e){var t,r={},a=g.dateTimePattern.exec(e);a?(r.date=a[1],t=a[3]):(a=g.datePattern.exec(e))?(r.date=a[1],t=a[2]):(r.date=null,t=e);if(t){var n=g.timeZone.exec(t);n?(r.time=t.replace(n[1],""),r.timeZone=n[1].trim()):r.time=t}return r}(e),m=function(e,t){var r,a=g.YYY[t],n=g.YYYYY[t];if(r=g.YYYY.exec(e)||n.exec(e)){var i=r[1];return{year:parseInt(i,10),restDateString:e.slice(i.length)}}if(r=g.YY.exec(e)||a.exec(e)){var s=r[1];return{year:100*parseInt(s,10),restDateString:e.slice(s.length)}}return{year:null}}(d.date,s),y=m.year,v=function(e,t){if(null===t)return null;var r,a,n,i;if(0===e.length)return(a=new Date(0)).setUTCFullYear(t),a;if(r=g.MM.exec(e))return a=new Date(0),p(t,n=parseInt(r[1],10)-1)?(a.setUTCFullYear(t,n),a):new Date(NaN);if(r=g.DDD.exec(e)){a=new Date(0);var s=parseInt(r[1],10);return function(e,t){if(t<1)return!1;var r=f(e);if(r&&t>366)return!1;if(!r&&t>365)return!1;return!0}(t,s)?(a.setUTCFullYear(t,0,s),a):new Date(NaN)}if(r=g.MMDD.exec(e)){a=new Date(0),n=parseInt(r[1],10)-1;var o=parseInt(r[2],10);return p(t,n,o)?(a.setUTCFullYear(t,n,o),a):new Date(NaN)}if(r=g.Www.exec(e))return h(t,i=parseInt(r[1],10)-1)?l(t,i):new Date(NaN);if(r=g.WwwD.exec(e)){i=parseInt(r[1],10)-1;var c=parseInt(r[2],10)-1;return h(t,i,c)?l(t,i,c):new Date(NaN)}return null}(m.restDateString,y);if(isNaN(v))return new Date(NaN);if(v){var w,b=v.getTime(),C=0;if(d.time&&(C=function(e){var t,r,a;if(t=g.HH.exec(e))return _(r=parseFloat(t[1].replace(",",".")))?r%24*o:NaN;if(t=g.HHMM.exec(e))return _(r=parseInt(t[1],10),a=parseFloat(t[2].replace(",",".")))?r%24*o+a*c:NaN;if(t=g.HHMMSS.exec(e)){r=parseInt(t[1],10),a=parseInt(t[2],10);var n=parseFloat(t[3].replace(",","."));return _(r,a,n)?r%24*o+a*c+1e3*n:NaN}return null}(d.time),isNaN(C)))return new Date(NaN);if(d.timeZone||i.timeZone){if(w=(0,n.default)(d.timeZone||i.timeZone,new Date(b+C)),isNaN(w))return new Date(NaN)}else w=(0,a.default)(new Date(b+C)),w=(0,a.default)(new Date(b+C+w));return new Date(b+C+w)}return new Date(NaN)};var r=s(X.exports),a=s(J.exports),n=s(A.exports),i=s(K.exports);function s(e){return e&&e.__esModule?e:{default:e}}var o=36e5,c=6e4,u=2,g={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:i.default};function l(e,t,r){t=t||0,r=r||0;var a=new Date(0);a.setUTCFullYear(e,0,4);var n=7*t+r+1-(a.getUTCDay()||7);return a.setUTCDate(a.getUTCDate()+n),a}var d=[31,28,31,30,31,30,31,31,30,31,30,31],m=[31,29,31,30,31,30,31,31,30,31,30,31];function f(e){return e%400==0||e%4==0&&e%100!=0}function p(e,t,r){if(t<0||t>11)return!1;if(null!=r){if(r<1)return!1;var a=f(e);if(a&&r>m[t])return!1;if(!a&&r>d[t])return!1}return!0}function h(e,t,r){return!(t<0||t>52)&&(null==r||!(r<0||r>6))}function _(e,t,r){return(null==e||!(e<0||e>=25))&&((null==t||!(t<0||t>=60))&&(null==r||!(r<0||r>=60)))}e.exports=t.default}(B,B.exports),function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var i=(0,a.default)(e,n),s=(0,r.default)(t,i,!0),o=new Date(i.getTime()-s),c=new Date(0);return c.setFullYear(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()),c.setHours(o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds()),c};var r=n(A.exports),a=n(B.exports);function n(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(O,O.exports);var ee=E(O.exports);class te extends R{constructor(e,t,r,a,n,i){super(e,t),this._event=r,this._contentID=a,this._thumbnail=n,this._subLabels=i??null}getStartTime(){return q(this._event.start_time)}getEndTime(){return this._event.end_time?q(this._event.end_time):null}inProgress(){return!this.getEndTime()}getVideoContentType(){return Y.HLS}getID(){return this._event.id}getContentID(){return this._contentID}getTitle(){return(e=>{const t=Intl.DateTimeFormat().resolvedOptions().timeZone,r=Math.round(e.end_time?e.end_time-e.start_time:Date.now()/1e3-e.start_time),a=null!==e.top_score?` ${Math.round(100*e.top_score)}%`:"";return`${c(ee(1e3*e.start_time,t))} [${r}s, ${u(e.label)}${a}]`})(this._event)}getThumbnail(){return this._thumbnail}isFavorite(){return this._event.retain_indefinitely??null}setFavorite(e){this._event.retain_indefinitely=e}getWhat(){return[this._event.label]}getWhere(){const e=this._event.zones;return e.length?e:null}getScore(){return this._event.top_score}getTags(){return this._subLabels}isGroupableWith(e){return this.getMediaType()===e.getMediaType()&&g(this.getWhere(),e.getWhere())&&g(this.getWhat(),e.getWhat())}}class re extends R{constructor(e,t,r,a,n,i){super(e,t),this._recording=r,this._id=a,this._contentID=n,this._title=i}getID(){return this._id}getStartTime(){return this._recording.startTime}getEndTime(){return this._recording.endTime}inProgress(){return!this.getEndTime()}getVideoContentType(){return Y.HLS}getContentID(){return this._contentID}getTitle(){return this._title}getEventCount(){return this._recording.events}}class ae{static createEventViewMedia(e,t,r,a,n){return"clip"===e&&!a.has_clip||"snapshot"===e&&!a.has_snapshot||!r.frigate.client_id||!r.frigate.camera_name?null:new te(e,t,a,((e,t,r,a)=>`media-source://frigate/${e}/event/${a}/${t}/${r.id}`)(r.frigate.client_id,r.frigate.camera_name,a,"clip"===e?"clips":"snapshots"),((e,t)=>`/api/frigate/${e}/thumbnail/${t.id}`)(r.frigate.client_id,a),n)}static createRecordingViewMedia(e,t,r,a){return r.frigate.client_id&&r.frigate.camera_name?new re("recording",e,t,((e,t)=>`${e.frigate?.client_id??""}/${e.frigate.camera_name??""}/${t.startTime.getTime()}/${t.endTime.getTime()}`)(r,t),((e,t,r)=>["media-source://frigate",e,"recordings",t,`${r.startTime.getFullYear()}-${String(r.startTime.getMonth()+1).padStart(2,"0")}-${String(String(r.startTime.getDate()).padStart(2,"0"))}`,String(r.startTime.getHours()).padStart(2,"0")].join("/"))(r.frigate.client_id,r.frigate.camera_name,t),((e,t)=>`${e} ${c(t.startTime)}`)(a,t)):null}}class ne{static isFrigateMedia(e){return this.isFrigateEvent(e)||this.isFrigateRecording(e)}static isFrigateEvent(e){return e instanceof te}static isFrigateRecording(e){return e instanceof re}}const ie="birdseye";class se{static isFrigateEventQueryResults(e){return e.engine===m.Frigate&&e.type===w.Event}static isFrigateRecordingQueryResults(e){return e.engine===m.Frigate&&e.type===w.Recording}static isFrigateRecordingSegmentsResults(e){return e.engine===m.Frigate&&e.type===w.RecordingSegments}}class oe extends z{constructor(e,t,r){super(),this._throttledSegmentGarbageCollector=d(this._garbageCollectSegments.bind(this),36e5,{leading:!1,trailing:!0}),this._cardWideConfig=e,this._recordingSegmentsCache=t,this._requestCache=r}getEngineType(){return m.Frigate}async initializeCamera(e,t,r){const a=!!r.frigate?.camera_name,i=r.triggers.motion||r.triggers.occupancy;let s=null;const o=f(r);if(o&&(!a||i))try{s=await t.getEntity(e,o)}catch(e){throw new p(n("error.no_camera_entity"),r)}if(s&&!a){const e=this._getFrigateCameraNameFromEntity(s);e&&(r.frigate.camera_name=e)}if(i){const a=await t.getMatchingEntities(e,(e=>e.config_entry_id===s?.config_entry_id&&!e.disabled_by&&e.entity_id.startsWith("binary_sensor.")));if(r.triggers.motion){const e=this._getMotionSensor(r,[...a.values()]);e&&r.triggers.entities.push(e)}if(r.triggers.occupancy){const e=this._getOccupancySensor(r,[...a.values()]);e&&r.triggers.entities.push(...e)}r.triggers.entities=(c=r.triggers.entities)&&c.length?l(c):[]}var c;return r}_getFrigateCameraNameFromEntity(e){if("frigate"===e.platform&&e.unique_id&&"string"==typeof e.unique_id){const t=e.unique_id.match(/:camera:(?[^:]+)$/);if(t&&t.groups)return t.groups.camera}return null}_getMotionSensor(e,t){return e.frigate.camera_name?t.find((t=>"string"==typeof t.unique_id&&!!t.unique_id?.match(new RegExp(`:motion_sensor:${e.frigate.camera_name}`))))?.entity_id??null:null}_getOccupancySensor(e,t){const r=[],a=(e,a)=>{const n=t.find((t=>"string"==typeof t.unique_id&&!!t.unique_id?.match(new RegExp(`:occupancy_sensor:${e}_${a}`))))?.entity_id??null;n&&r.push(n)};if(e.frigate.camera_name){const t=e.frigate.zones?.length?e.frigate.zones:[e.frigate.camera_name],n=e.frigate.labels?.length?e.frigate.labels:["all"];for(const e of t)for(const t of n)a(e,t);if(r.length)return r}return null}async getMediaDownloadPath(e,t,r){return ne.isFrigateEvent(r)?{endpoint:`/api/frigate/${t.frigate.client_id}/notifications/${r.getID()}/`+(h.isClip(r)?"clip.mp4":"snapshot.jpg")+"?download=true",sign:!0}:ne.isFrigateRecording(r)?{endpoint:`/api/frigate/${t.frigate.client_id}/recording/${t.frigate.camera_name}/start/${Math.floor(r.getStartTime().getTime()/1e3)}/end/${Math.floor(r.getEndTime().getTime()/1e3)}?download=true`,sign:!0}:null}generateDefaultEventQuery(e,t,r){const a=Array.from(t).map((t=>e.get(t))),n=N(a.map((e=>e?.frigate.zones)),g),i=N(a.map((e=>e?.frigate.labels)),g);if(1===n.length&&1===i.length)return[{type:_.Event,cameraIDs:t,...i[0]&&{what:new Set(i[0])},...n[0]&&{where:new Set(n[0])},...r}];const s=[];for(const a of t){const t=e.get(a);t&&s.push({type:_.Event,cameraIDs:new Set([a]),...t.frigate.labels&&{what:new Set(t.frigate.labels)},...t.frigate.zones&&{where:new Set(t.frigate.zones)},...r})}return s.length?s:null}generateDefaultRecordingQuery(e,t,r){return[{type:_.Recording,cameraIDs:t,...r}]}generateDefaultRecordingSegmentsQuery(e,t,r){return r.start&&r.end?[{type:_.RecordingSegments,cameraIDs:t,start:r.start,end:r.end,...r}]:null}async favoriteMedia(e,t,i,s){ne.isFrigateEvent(i)&&(await async function(e,t,i,s){const o={type:"frigate/event/retain",instance_id:t,event_id:i,retain:s},c=await r(e,P,o,!0);if(!c.success)throw new a(n("error.failed_retain"),{request:o,response:c})}(e,t.frigate.client_id,i.getID(),s),i.setFavorite(s))}_buildInstanceToCameraIDMapFromQuery(e,t){const r=new Map;for(const a of t){const t=this._getQueryableCameraConfig(e,a)?.frigate.client_id;t&&(r.has(t)||r.set(t,new Set),r.get(t)?.add(a))}return r}_getFrigateCameraNamesForCameraIDs(e,t){const r=new Set;for(const a of t){const t=this._getQueryableCameraConfig(e,a);t?.frigate.camera_name&&r.add(t.frigate.camera_name)}return r}async getEvents(e,t,r,a){const n=new Map,i=async(i,s)=>{if(!s||!s.size)return;const o={...r,cameraIDs:s},c=a?.useCache??1?this._requestCache.get(o):null;if(c)return void n.set(r,c);const u={instance_id:i,cameras:Array.from(this._getFrigateCameraNamesForCameraIDs(t,s)),...r.what&&{labels:Array.from(r.what)},...r.where&&{zones:Array.from(r.where)},...r.tags&&{sub_labels:Array.from(r.tags)},...r.end&&{before:Math.floor(r.end.getTime()/1e3)},...r.start&&{after:Math.floor(r.start.getTime()/1e3)},...r.limit&&{limit:r.limit},...r.hasClip&&{has_clip:r.hasClip},...r.hasSnapshot&&{has_snapshot:r.hasSnapshot},...r.favorite&&{favorites:r.favorite},limit:r?.limit??$},g={type:w.Event,engine:m.Frigate,instanceID:i,events:await W(e,u),expiry:b(new Date,{seconds:60}),cached:!1};(a?.useCache??1)&&this._requestCache.set(r,{...g,cached:!0},g.expiry),n.set(o,g)},s=this._buildInstanceToCameraIDMapFromQuery(t,r.cameraIDs);return await Promise.all(Array.from(s.keys()).map((e=>i(e,s.get(e))))),n.size?n:null}async getRecordings(e,t,a,n){const i=new Map,s=async(a,s)=>{const o={...a,cameraIDs:new Set([s])},c=n?.useCache??1?this._requestCache.get(o):null;if(c)return void i.set(o,c);const u=this._getQueryableCameraConfig(t,s);if(!u||!u.frigate.camera_name)return;const g=await(async(e,t,a)=>await r(e,Z,{type:"frigate/recordings/summary",instance_id:t,camera:a,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone},!0))(e,u.frigate.client_id,u.frigate.camera_name);let l=[];for(const e of g??[])for(const t of e.hours){const r=b(e.day,{hours:t.hour}),a=T(r),n=M(r);(!o.start||a>=o.start)&&(!o.end||n<=o.end)&&l.push({cameraID:s,startTime:a,endTime:n,events:t.events})}void 0!==o.limit&&(l=S(l,(e=>e.startTime),"desc").slice(0,o.limit));const d={type:w.Recording,engine:m.Frigate,instanceID:u.frigate.client_id,recordings:l,expiry:b(new Date,{seconds:60}),cached:!1};(n?.useCache??1)&&this._requestCache.set(o,{...d,cached:!0},d.expiry),i.set(o,d)};return await Promise.all(Array.from(a.cameraIDs).map((e=>s(a,e)))),i.size?i:null}async getRecordingSegments(e,t,a,n){const i=new Map,s=async(a,s)=>{const o={...a,cameraIDs:new Set([s])},c=this._getQueryableCameraConfig(t,s);if(!c||!c.frigate.camera_name)return;const u={start:o.start,end:o.end},g=n?.useCache??1?this._recordingSegmentsCache.get(s,u):null;if(g)return void i.set(o,{type:w.RecordingSegments,engine:m.Frigate,instanceID:c.frigate.client_id,segments:g,cached:!0});const l={instance_id:c.frigate.client_id,camera:c.frigate.camera_name,after:Math.floor(o.start.getTime()/1e3),before:Math.floor(o.end.getTime()/1e3)},d=await(async(e,t)=>await r(e,U,{type:"frigate/recordings/get",...t},!0))(e,l);(n?.useCache??1)&&this._recordingSegmentsCache.add(s,u,d),i.set(o,{type:w.RecordingSegments,engine:m.Frigate,instanceID:c.frigate.client_id,segments:d,cached:!1})};return await Promise.all(Array.from(a.cameraIDs).map((e=>s(a,e)))),y((()=>this._throttledSegmentGarbageCollector(e,t))),i.size?i:null}_getCameraIDMatch(e,t,r,a){if(1===t.cameraIDs.size)return[...t.cameraIDs][0];for(const[t,n]of e.entries())if(n.frigate.client_id===r&&n.frigate.camera_name===a)return t;return null}generateMediaFromEvents(e,t,r,a){if(!se.isFrigateEventQueryResults(a))return null;const n=[];for(const e of a.events){const i=this._getCameraIDMatch(t,r,a.instanceID,e.camera);if(!i)continue;const s=this._getQueryableCameraConfig(t,i);if(!s)continue;let o=null;if(r.hasClip||r.hasSnapshot||!e.has_clip&&!e.has_snapshot?r.hasSnapshot&&e.has_snapshot?o="snapshot":r.hasClip&&e.has_clip&&(o="clip"):o=e.has_clip?"clip":"snapshot",!o)continue;const c=ae.createEventViewMedia(o,i,s,e,e.sub_label?this._splitSubLabels(e.sub_label):void 0);c&&n.push(c)}return n}generateMediaFromRecordings(e,t,r,a){if(!se.isFrigateRecordingQueryResults(a))return null;const n=[];for(const r of a.recordings){const a=this._getQueryableCameraConfig(t,r.cameraID);if(!a)continue;const i=ae.createRecordingViewMedia(r.cameraID,r,a,this.getCameraMetadata(e,a).title);i&&n.push(i)}return n}getQueryResultMaxAge(e){return e.type===_.Event||e.type===_.Recording?60:null}async getMediaSeekTime(e,t,r,a,n){const i=r.getStartTime(),s=r.getEndTime();if(!i||!s||as)return null;const o=r.getCameraID(),c={cameraIDs:new Set([o]),start:i,end:s,type:_.RecordingSegments},u=await this.getRecordingSegments(e,t,c,n);return u?this._getSeekTimeInSegments(i,a,Array.from(u.values())[0].segments):null}_getQueryableCameraConfig(e,t){const r=e.get(t);return r&&r.frigate.camera_name!=ie?r:null}_splitSubLabels(e){return e.split(",").map((e=>e.trim()))}async getMediaMetadata(e,t,a,n){const i=new Map;if((n?.useCache??1)&&this._requestCache.has(a)){const e=this._requestCache.get(a);if(e)return i.set(a,e),i}const s=new Set,o=new Set,c=new Set,u=new Set,g=this._buildInstanceToCameraIDMapFromQuery(t,a.cameraIDs),l=async(a,n)=>{const i=this._getFrigateCameraNamesForCameraIDs(t,n);for(const t of await(async(e,t)=>await r(e,Q,{type:"frigate/events/summary",instance_id:t,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone},!0))(e,a))i.has(t.camera)&&(t.label&&s.add(t.label),t.zones.length&&t.zones.forEach(o.add,o),t.day&&c.add(t.day),t.sub_label&&this._splitSubLabels(t.sub_label).forEach(u.add,u))},d=async r=>{const a=await this.getRecordings(e,t,{type:_.Recording,cameraIDs:r},n);if(a)for(const e of a.values())if(se.isFrigateRecordingQueryResults(e))for(const t of e.recordings)c.add(F(t.startTime))};await v([...g.entries()],(([e,t])=>(async()=>{await Promise.all([l(e,t),d(t)])})()));const f={type:w.MediaMetadata,engine:m.Frigate,metadata:{...s.size&&{what:s},...o.size&&{where:o},...c.size&&{days:c},...u.size&&{tags:u}},expiry:b(new Date,{seconds:60}),cached:!1};return(n?.useCache??1)&&this._requestCache.set(a,{...f,cached:!0},f.expiry),i.set(a,f),i}async _garbageCollectSegments(e,t){const r=this._recordingSegmentsCache.getCameraIDs(),a={cameraIDs:new Set(r),type:_.Recording},n=()=>I(r.map((e=>this._recordingSegmentsCache.getSize(e)??0))),i=n(),s=(e,t)=>`${e}/${t.getDate()}/${t.getHours()}`,o=await this.getRecordings(e,t,a);if(o){for(const[e,t]of o){if(!se.isFrigateRecordingQueryResults(t))continue;const r=new Set;for(const e of t.recordings)r.add(s(e.cameraID,e.startTime));const a=Array.from(e.cameraIDs)[0];this._recordingSegmentsCache.expireMatches(a,(e=>{const t=s(a,q(e.start_time));return!r.has(t)}))}C(this._cardWideConfig,`Frigate Card recording segment garbage collection: Released ${i-n()} segment(s)`)}}_getSeekTimeInSegments(e,t,r){if(!r.length)return null;let a=0;for(const n of r){const r=q(n.start_time);if(r>t)break;const i=q(n.end_time),s=rt?t:i).getTime()-s.getTime()}return a/1e3}getCameraCapabilities(e){const t=e.frigate.camera_name===ie;return{canFavoriteEvents:!t,canFavoriteRecordings:!t,canSeek:!0,supportsClips:!t,supportsSnapshots:!t,supportsRecordings:!t,supportsTimeline:!t}}getMediaCapabilities(e){return{canFavorite:h.isEvent(e),canDownload:!0}}getCameraMetadata(e,t){const r=super.getCameraMetadata(e,t);return{title:t.title??D(e,t.camera_entity)??D(e,t.webrtc_card?.entity)??u(t.frigate?.camera_name)??t.id??"",icon:r.icon,engineLogo:"data:image/svg+xml,%3csvg width='512' height='512' viewBox='0 0 512 512' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M130 446.5C131.6 459.3 145 468 137 470C129 472 94 406.5 86 378.5C78 350.5 73.5 319 75.4999 301C77.4999 283 181 255 181 247.5C181 240 147.5 247 146 241C144.5 235 171.3 238.6 178.5 229C189.75 214 204 216.5 213 208.5C222 200.5 233 170 235 157C237 144 215 129 209 119C203 109 222 102 268 83C314 64 460 22 462 27C464 32 414 53 379 66C344 79 287 104 287 111C287 118 290 123.5 288 139.5C286 155.5 285.76 162.971 282 173.5C279.5 180.5 277 197 282 212C286 224 299 233 305 235C310 235.333 323.8 235.8 339 235C358 234 385 236 385 241C385 246 344 243 344 250C344 257 386 249 385 256C384 263 350 260 332 260C317.6 260 296.333 259.333 287 256L285 263C281.667 263 274.7 265 267.5 265C258.5 265 258 268 241.5 268C225 268 230 267 215 266C200 265 144 308 134 322C124 336 130 370 130 385.5C130 399.428 128 430.5 130 446.5Z' fill='white'/%3e%3c/svg%3e"}}getCameraEndpoints(e,t){const r=(()=>{if(!e.frigate.url)return null;if(!e.frigate.camera_name)return{endpoint:e.frigate.url};const r=`${e.frigate.url}/cameras/`+e.frigate.camera_name;if("live"===t?.view)return{endpoint:r};const a=`${e.frigate.url}/events?camera=`+e.frigate.camera_name,n=`${e.frigate.url}/recording/`+e.frigate.camera_name;switch(t?.media?.getMediaType()){case"clip":case"snapshot":return{endpoint:a};case"recording":const e=t.media.getStartTime();if(e)return{endpoint:n+x(e,"yyyy-MM-dd/HH")}}switch(t?.view){case"clip":case"clips":case"snapshots":case"snapshot":return{endpoint:a};case"recording":case"recordings":return{endpoint:n}}return{endpoint:r}})(),a={endpoint:`/api/frigate/${e.frigate.client_id}/mse/api/ws?src=${e.go2rtc?.stream??e.frigate.camera_name}`,sign:!0},n={endpoint:`/api/frigate/${e.frigate.client_id}/jsmpeg/${e.frigate.camera_name}`,sign:!0},i=(()=>{const t=e.frigate.camera_name?e.frigate.camera_name:null;return t?{endpoint:t}:null})();return{...r&&{ui:r},...a&&{go2rtc:a},...n&&{jsmpeg:n},...i&&{webrtcCard:i}}}}export{oe as FrigateCameraManagerEngine}; diff --git a/config/www/community/frigate-hass-card/engine-frigate-2c5e3aa9.js.gz b/config/www/community/frigate-hass-card/engine-frigate-2c5e3aa9.js.gz new file mode 100644 index 00000000..6df4c649 Binary files /dev/null and b/config/www/community/frigate-hass-card/engine-frigate-2c5e3aa9.js.gz differ diff --git a/config/www/community/frigate-hass-card/engine-generic-395b8c68.js b/config/www/community/frigate-hass-card/engine-generic-395b8c68.js new file mode 100644 index 00000000..4062dbc5 --- /dev/null +++ b/config/www/community/frigate-hass-card/engine-generic-395b8c68.js @@ -0,0 +1 @@ +import{bS as e,d as n,bT as t}from"./card-555679fd.js";class r{getEngineType(){return e.Generic}async initializeCamera(e,n,t){return t}generateDefaultEventQuery(e,n,t){return null}generateDefaultRecordingQuery(e,n,t){return null}generateDefaultRecordingSegmentsQuery(e,n,t){return null}async getEvents(e,n,t,r){return null}async getRecordings(e,n,t,r){return null}async getRecordingSegments(e,n,t,r){return null}generateMediaFromEvents(e,n,t,r){return null}generateMediaFromRecordings(e,n,t,r){return null}async getMediaDownloadPath(e,n,t){return null}async favoriteMedia(e,n,t,r){}getQueryResultMaxAge(e){return null}async getMediaSeekTime(e,n,t,r,a){return null}async getMediaMetadata(e,n,t,r){return null}getCameraMetadata(e,r){return{title:r.title??n(e,r.camera_entity)??n(e,r.webrtc_card?.entity)??r.id??"",icon:r?.icon??t(e,r.camera_entity)??"mdi:video"}}getCameraCapabilities(e){return{canFavoriteEvents:!1,canFavoriteRecordings:!1,canSeek:!1,supportsClips:!1,supportsRecordings:!1,supportsSnapshots:!1,supportsTimeline:!1}}getMediaCapabilities(e){return null}getCameraEndpoints(e,n){return null}}export{r as GenericCameraManagerEngine}; diff --git a/config/www/community/frigate-hass-card/engine-generic-395b8c68.js.gz b/config/www/community/frigate-hass-card/engine-generic-395b8c68.js.gz new file mode 100644 index 00000000..f12fb23a Binary files /dev/null and b/config/www/community/frigate-hass-card/engine-generic-395b8c68.js.gz differ diff --git a/config/www/community/frigate-hass-card/engine-motioneye-ae70fe08.js b/config/www/community/frigate-hass-card/engine-motioneye-ae70fe08.js new file mode 100644 index 00000000..5b5c2e4a --- /dev/null +++ b/config/www/community/frigate-hass-card/engine-motioneye-ae70fe08.js @@ -0,0 +1 @@ +import{cg as e,b$ as t,c0 as a,ci as i,cj as c,c4 as r,l as o,c6 as s,ck as n,cl as l,cm as d,cn as p,bS as f,co as u,cp as m,cq as y,c8 as h,c9 as g,ca as w,ce as _,ch as b}from"./card-555679fd.js";import{C as M}from"./engine-e412e9a0.js";import{p as x}from"./index-af8cf05c.js";import{GenericCameraManagerEngine as k}from"./engine-generic-395b8c68.js";import{V as G,a as v}from"./media-b0eb3f2a.js";class C extends G{constructor(t,a,i){super(t,a),this._browseMedia=i,i._metadata?.startDate?this._id=`${a}/${e(i._metadata.startDate,"yyyy-MM-dd HH:mm:ss")}`:this._id=i.media_content_id}getStartTime(){return this._browseMedia._metadata?.startDate??null}getEndTime(){return null}getVideoContentType(){return v.MP4}getID(){return this._id}getContentID(){return this._browseMedia.media_content_id}getTitle(){const e=this.getStartTime();return e?t(e):this._browseMedia.title}getThumbnail(){return this._browseMedia.thumbnail}getWhat(){return null}getScore(){return null}getTags(){return null}isGroupableWith(e){return this.getMediaType()===e.getMediaType()&&a(this.getWhere(),e.getWhere())&&a(this.getWhat(),e.getWhat())}}class D{static createEventViewMedia(e,t,a){return new C(e,a,t)}}const E=(e,t,a)=>{const i=t??a;return!i||!!e._metadata&&p({start:e._metadata.startDate,end:e._metadata.endDate},{start:t??i,end:a??i})};class S extends k{constructor(e,t,a){super(),this._cameraEntities=new Map,this._browseMediaManager=e,this._resolvedMediaCache=t,this._requestCache=a}async initializeCamera(e,t,a){const i=a.camera_entity?await t.getEntity(e,a.camera_entity):null;if(!i||!a.camera_entity)throw new r(o("error.no_camera_entity"),a);return this._cameraEntities.set(a.camera_entity,i),a}generateDefaultEventQuery(e,t,a){return[{type:s.Event,cameraIDs:t,...a}]}async getMediaDownloadPath(e,t,a){const i=a.getContentID();if(!i)return null;const c=await n(e,i,this._resolvedMediaCache);return c?{endpoint:l(e,c.url)}:null}getQueryResultMaxAge(e){return e.type===s.Event?d:null}getCameraCapabilities(e){const t=super.getCameraCapabilities(e);return t?{...t,supportsClips:!0,supportsSnapshots:!0,supportsTimeline:!0}:null}getMediaCapabilities(e){return{canFavorite:!1,canDownload:!0}}}class T{static isMotionEyeEventQueryResults(e){return e.engine===f.MotionEye&&e.type===g.Event}}const F={"%Y":"yyyy","%m":"MM","%d":"dd","%H":"HH","%M":"mm","%S":"ss"},B=new RegExp(/(%Y|%m|%d|%H|%M|%S)/g);class z extends S{getEngineType(){return f.MotionEye}_convertMotionEyeTimeFormatToDateFNS(e){return e.replace(B,((e,t)=>F[t]))}_motionEyeMetadataGeneratorFile(e,t,a,i){let c=i?._metadata?.startDate??new Date;if(t){const e=a.title.replace(/\.[^/.]+$/,"");if(c=x(e,t,c),!u(c))return null}return{cameraID:e,startDate:c,endDate:c}}_motionEyeMetadataGeneratorDirectory(e,t,a,i){let c=i?._metadata?.startDate??new Date;if(t){const e=x(a.title,t,c);if(!u(e))return null;c=m(e)}return{cameraID:e,startDate:c,endDate:i?._metadata?.endDate??y(c)}}async _getMatchingDirectories(e,t,a,i,c){const r=t.get(a)?.camera_entity,o=r?this._cameraEntities.get(r):null,s=o?.config_entry_id,n=o?.device_id,l=t.get(a);if(!s||!n||!l)return null;const d=(e,t)=>{const c=e.shift();if(!c)return[];const r=c.includes("%")?this._convertMotionEyeTimeFormatToDateFNS(c):null;return[{targets:t,metadataGenerator:(e,t)=>this._motionEyeMetadataGeneratorDirectory(a,r,e,t),matcher:e=>e.can_expand&&(!!r||e.title===c)&&E(e,i?.start,i?.end),advance:t=>d(e,t)}]};return await this._browseMediaManager.walkBrowseMedias(e,[...!1===i?.hasClip||i?.hasSnapshot?[]:d(l.motioneye.movies.directory_pattern.split("/"),[`media-source://motioneye/${s}#${n}#movies`]),...!1===i?.hasSnapshot||i?.hasClip?[]:d(l.motioneye.images.directory_pattern.split("/"),[`media-source://motioneye/${s}#${n}#images`])],{useCache:c?.useCache})}async getEvents(e,t,a,r){if(a.favorite||a.tags?.size||a.what?.size||a.where?.size)return null;const o=new Map,s=async s=>{const n={...a,cameraIDs:new Set([s])},l=r?.useCache??1?this._requestCache.get(n):null;if(l)return void o.set(n,l);const d=t.get(s);if(!d)return;const p=await this._getMatchingDirectories(e,t,s,n,r);if(!p||!p.length)return;const u=this._convertMotionEyeTimeFormatToDateFNS(d.motioneye.movies.file_pattern),m=this._convertMotionEyeTimeFormatToDateFNS(d.motioneye.images.file_pattern),y=await this._browseMediaManager.walkBrowseMedias(e,[{targets:p,metadataGenerator:(e,t)=>e.media_class===c||e.media_class===i?this._motionEyeMetadataGeneratorFile(s,e.media_class===c?m:u,e,t):null,matcher:e=>!e.can_expand&&E(e,n.start,n.end)}],{useCache:r?.useCache}),h=_(y,(e=>e._metadata?.startDate),"desc").slice(0,n.limit??M),w={type:g.Event,engine:f.MotionEye,browseMedia:h};(r?.useCache??1)&&this._requestCache.set(n,{...w,cached:!0},w.expiry),o.set(n,w)};return await h(a.cameraIDs,(e=>s(e))),o.size?o:null}generateMediaFromEvents(e,t,a,r){return T.isMotionEyeEventQueryResults(r)?(e=>{const t=new Map;for(const a of e){const e=a._metadata?.cameraID;if(!e)continue;const r=a.media_class===i?"clip":a.media_class===c?"snapshot":null;if(!r)continue;const o=D.createEventViewMedia(r,a,e);if(o){const e=o.getID(),a=t.get(e);(!a||"snapshot"===a.getMediaType()&&"clip"===o.getMediaType())&&t.set(e,o)}}return[...t.values()]})(r.browseMedia):null}async getMediaMetadata(e,t,a,i){const c=new Map;if((i?.useCache??1)&&this._requestCache.has(a)){const e=this._requestCache.get(a);if(e)return c.set(a,e),c}const r=new Set,o=async a=>{const c=await this._getMatchingDirectories(e,t,a,null,i);for(const e of c??[])e._metadata&&r.add(b(e._metadata?.startDate))};await h(a.cameraIDs,(e=>o(e)));const s={type:g.MediaMetadata,engine:f.MotionEye,metadata:{...r.size&&{days:r}},expiry:w(new Date,{seconds:d}),cached:!1};return(i?.useCache??1)&&this._requestCache.set(a,{...s,cached:!0},s.expiry),c.set(a,s),c}getCameraMetadata(e,t){return{...super.getCameraMetadata(e,t),engineLogo:"data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8' standalone='no'%3f%3e%3c!-- Created with Inkscape (http://www.inkscape.org/) --%3e%3csvg xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:cc='http://creativecommons.org/ns%23' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23' xmlns:svg='http://www.w3.org/2000/svg' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' id='svg2' version='1.1' inkscape:version='0.91 r13725' width='64' height='64' xml:space='preserve' sodipodi:docname='motioneye-icon.svg' inkscape:export-filename='/home/ccrisan/projects/motioneye/static/img/motioneye-logo.png' inkscape:export-xdpi='960' inkscape:export-ydpi='960'%3e%3cmetadata id='metadata8'%3e%3crdf:RDF%3e%3ccc:Work rdf:about=''%3e%3cdc:format%3eimage/svg%2bxml%3c/dc:format%3e%3cdc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage' /%3e%3cdc:title /%3e%3c/cc:Work%3e%3c/rdf:RDF%3e%3c/metadata%3e%3cdefs id='defs6'%3e%3clinearGradient id='linearGradient4351' inkscape:collect='always'%3e%3cstop id='stop4353' offset='0' style='stop-color:%23737373%3bstop-opacity:1' /%3e%3cstop id='stop4355' offset='1' style='stop-color:%23585858%3bstop-opacity:1' /%3e%3c/linearGradient%3e%3clinearGradient inkscape:collect='always' id='linearGradient4205'%3e%3cstop style='stop-color:%234aa3e0%3bstop-opacity:1' offset='0' id='stop4207' /%3e%3cstop style='stop-color:%233096db%3bstop-opacity:1' offset='1' id='stop4209' /%3e%3c/linearGradient%3e%3clinearGradient inkscape:collect='always' id='linearGradient4197'%3e%3cstop style='stop-color:%23787878%3bstop-opacity:1' offset='0' id='stop4199' /%3e%3cstop style='stop-color:%23585858%3bstop-opacity:1' offset='1' id='stop4201' /%3e%3c/linearGradient%3e%3clinearGradient inkscape:collect='always' xlink:href='%23linearGradient4351' id='linearGradient4203' x1='26.445793' y1='47.517574' x2='26.445793' y2='3.8183768' gradientUnits='userSpaceOnUse' /%3e%3clinearGradient inkscape:collect='always' xlink:href='%23linearGradient4205' id='linearGradient4211' x1='26.602072' y1='43.034946' x2='26.602072' y2='29.466328' gradientUnits='userSpaceOnUse' gradientTransform='matrix(0.96428571%2c0%2c0%2c0.96428571%2c0.91428571%2c0.91428571)' /%3e%3cfilter style='color-interpolation-filters:sRGB%3b' inkscape:label='Drop Shadow' id='filter4285'%3e%3cfeFlood flood-opacity='0.588235' flood-color='rgb(0%2c0%2c0)' result='flood' id='feFlood4287' /%3e%3cfeComposite in='flood' in2='SourceGraphic' operator='in' result='composite1' id='feComposite4289' /%3e%3cfeGaussianBlur in='composite1' stdDeviation='0.6' result='blur' id='feGaussianBlur4291' /%3e%3cfeOffset dx='0' dy='-1' result='offset' id='feOffset4293' /%3e%3cfeComposite in='SourceGraphic' in2='offset' operator='over' result='composite2' id='feComposite4295' /%3e%3c/filter%3e%3clinearGradient inkscape:collect='always' xlink:href='%23linearGradient4197' id='linearGradient4309' gradientUnits='userSpaceOnUse' x1='26.445793' y1='47.517574' x2='26.445793' y2='3.8183768' /%3e%3clinearGradient inkscape:collect='always' xlink:href='%23linearGradient4197' id='linearGradient4311' gradientUnits='userSpaceOnUse' x1='26.445793' y1='47.517574' x2='26.445793' y2='3.8183768' /%3e%3clinearGradient inkscape:collect='always' xlink:href='%23linearGradient4197' id='linearGradient4313' gradientUnits='userSpaceOnUse' x1='26.445793' y1='47.517574' x2='26.445793' y2='3.8183768' /%3e%3cfilter style='color-interpolation-filters:sRGB%3b' inkscape:label='Drop Shadow' id='filter4315' x='-0.10000000000000001' y='-0.16000000000000003'%3e%3cfeFlood flood-opacity='0.588235' flood-color='rgb(0%2c0%2c0)' result='flood' id='feFlood4317' /%3e%3cfeComposite in='flood' in2='SourceGraphic' operator='in' result='composite1' id='feComposite4319' /%3e%3cfeGaussianBlur in='composite1' stdDeviation='0.6' result='blur' id='feGaussianBlur4321' /%3e%3cfeOffset dx='0' dy='-1' result='offset' id='feOffset4323' /%3e%3cfeComposite in='SourceGraphic' in2='offset' operator='over' result='composite2' id='feComposite4325' /%3e%3c/filter%3e%3cfilter style='color-interpolation-filters:sRGB%3b' inkscape:label='Drop Shadow' id='filter4327'%3e%3cfeFlood flood-opacity='0.588235' flood-color='rgb(0%2c0%2c0)' result='flood' id='feFlood4329' /%3e%3cfeComposite in='flood' in2='SourceGraphic' operator='in' result='composite1' id='feComposite4331' /%3e%3cfeGaussianBlur in='composite1' stdDeviation='0.6' result='blur' id='feGaussianBlur4333' /%3e%3cfeOffset dx='0' dy='-1' result='offset' id='feOffset4335' /%3e%3cfeComposite in='SourceGraphic' in2='offset' operator='over' result='composite2' id='feComposite4337' /%3e%3c/filter%3e%3cfilter style='color-interpolation-filters:sRGB%3b' inkscape:label='Drop Shadow' id='filter4339'%3e%3cfeFlood flood-opacity='0.588235' flood-color='rgb(0%2c0%2c0)' result='flood' id='feFlood4341' /%3e%3cfeComposite in='flood' in2='SourceGraphic' operator='in' result='composite1' id='feComposite4343' /%3e%3cfeGaussianBlur in='composite1' stdDeviation='0.2' result='blur' id='feGaussianBlur4345' /%3e%3cfeOffset dx='0' dy='-0.5' result='offset' id='feOffset4347' /%3e%3cfeComposite in='SourceGraphic' in2='offset' operator='over' result='composite2' id='feComposite4349' /%3e%3c/filter%3e%3c/defs%3e%3csodipodi:namedview pagecolor='white' bordercolor='%23666666' borderopacity='1' objecttolerance='10' gridtolerance='10' guidetolerance='10' inkscape:pageopacity='0' inkscape:pageshadow='2' inkscape:window-width='1920' inkscape:window-height='1025' id='namedview4' showgrid='false' inkscape:zoom='2' inkscape:cx='-94.597631' inkscape:cy='10.226517' inkscape:window-x='0' inkscape:window-y='27' inkscape:window-maximized='1' inkscape:current-layer='g10' showguides='true' inkscape:guide-bbox='true' /%3e%3cg id='g10' inkscape:groupmode='layer' inkscape:label='ink_ext_XXXXXX' transform='matrix(1.25%2c0%2c0%2c-1.25%2c0%2c64)'%3e%3cg id='g4170' style='fill:url(%23linearGradient4203)%3bfill-opacity:1%3bfilter:url(%23filter4327)' transform='matrix(0.96428571%2c0%2c0%2c0.96428571%2c0.91428571%2c0.91428571)'%3e%3cpath id='path4244' d='M 8.9346154%2c40.515385 C 5.3647588%2c36.547307 3.2%2c31.357779 3.2%2c25.6 3.2%2c13.228821 13.228821%2c3.2 25.6%2c3.2 37.971179%2c3.2 48%2c13.228821 48%2c25.6 c 0%2c5.736682 -2.161128%2c10.952493 -5.707692%2c14.915385 -1.695935%2c-0.623286 -3.387833%2c-1.349065 -5.061539%2c-2.288462 3.2394%2c-0.937363 5.6%2c-3.937988 5.6%2c-7.457692 0%2c-4.260339 -3.469626%2c-7.753846 -7.753846%2c-7.753846 -3.633936%2c0 -6.690552%2c2.51055 -7.538461%2c5.869231 l -3.876924%2c0 c -0.840685%2c-3.360193 -3.903443%2c-5.869231 -7.538461%2c-5.869231 -4.284219%2c0 -7.7807693%2c3.493507 -7.7807693%2c7.753846 0%2c3.56112 2.4570323%2c6.5856 5.7615383%2c7.484616 -1.676267%2c0.912203 -3.404813%2c1.620556 -5.1692306%2c2.261538 z M 25.6%2c26.461538 c 0.532632%2c-1.981435 1.101793%2c-3.947553 3.446154%2c-5.16923 L 25.6%2c16.123077 22.153846%2c21.292308 c 2.053593%2c1.454966 3.000771%2c3.237758 3.446154%2c5.16923 z' style='fill:url(%23linearGradient4309)%3bfill-opacity:1%3bstroke:none' inkscape:connector-curvature='0' /%3e%3cpath id='path4242' d='m 16.123077%2c33.353847 c -1.427443%2c0 -2.584616%2c-1.157173 -2.584616%2c-2.584616 0%2c-1.427444 1.157173%2c-2.584615 2.584616%2c-2.584615 1.427444%2c0 2.584615%2c1.157171 2.584615%2c2.584615 0%2c1.427443 -1.157171%2c2.584616 -2.584615%2c2.584616 z' style='fill:url(%23linearGradient4311)%3bfill-opacity:1%3bstroke:none' inkscape:connector-curvature='0' /%3e%3cpath id='path4240' d='m 35.076923%2c33.353847 c -1.427443%2c0 -2.584615%2c-1.157173 -2.584615%2c-2.584616 0%2c-1.427444 1.157172%2c-2.584615 2.584615%2c-2.584615 1.427443%2c0 2.584616%2c1.157171 2.584616%2c2.584615 0%2c1.427443 -1.157173%2c2.584616 -2.584616%2c2.584616 z' style='fill:url(%23linearGradient4313)%3bfill-opacity:1%3bstroke:none' inkscape:connector-curvature='0' /%3e%3c/g%3e%3cpath inkscape:connector-curvature='0' style='fill:%23737373%3bfill-opacity:1%3bstroke:none%3bfilter:url(%23filter4339)' d='m 25.6%2c47.2 c -4.373944%2c0 -8.437159%2c-1.399808 -11.838461%2c-3.634616 3.677605%2c-0.394237 7.305921%2c-1.342945 11.423077%2c-3.375 4.166157%2c2.122533 8.434154%2c3.008875 12.279808%2c3.452886 C 34.057131%2c45.890032 29.986674%2c47.2 25.6%2c47.2 Z' id='path4248' /%3e%3cpath inkscape:connector-curvature='0' style='fill:url(%23linearGradient4211)%3bfill-opacity:1%3bstroke:none%3bfilter:url(%23filter4315)' d='M 39.723077%2c42.552884 C 35.394064%2c42.5242 29.479588%2c40.397223 25.184616%2c38.432418 20.668821%2c40.064102 16.035448%2c42.649343 10.801923%2c42.526924 10.453022%2c42.51873 10.118061%2c42.50105 9.7634616%2c42.475 L 5.6615384%2c42.1375 9.5557693%2c40.839424 c 5.3417977%2c-1.74056 10.0398397%2c-2.851302 14.1749997%2c-10.025963 0.959101%2c0 2.845924%2c-4.15e-4 3.738462%2c-4.15e-4 4.11884%2c7.134039 9.059296%2c8.324614 14.149039%2c10.026378 L 45.460577%2c42.085577 41.4625%2c42.475 c -0.544847%2c0.05181 -1.120992%2c0.08198 -1.739423%2c0.07788 z' id='path4246' sodipodi:nodetypes='cccccccccccc' /%3e%3c/g%3e%3c/svg%3e"}}getCameraEndpoints(e,t){const a=e.motioneye?.url?{endpoint:e.motioneye.url}:null;return{...a&&{ui:a}}}}export{z as MotionEyeCameraManagerEngine}; diff --git a/config/www/community/frigate-hass-card/engine-motioneye-ae70fe08.js.gz b/config/www/community/frigate-hass-card/engine-motioneye-ae70fe08.js.gz new file mode 100644 index 00000000..4f3e3531 Binary files /dev/null and b/config/www/community/frigate-hass-card/engine-motioneye-ae70fe08.js.gz differ diff --git a/config/www/community/frigate-hass-card/frigate-hass-card.js b/config/www/community/frigate-hass-card/frigate-hass-card.js new file mode 100644 index 00000000..764fd995 --- /dev/null +++ b/config/www/community/frigate-hass-card/frigate-hass-card.js @@ -0,0 +1 @@ +import"./card-555679fd.js"; diff --git a/config/www/community/frigate-hass-card/frigate-hass-card.js.gz b/config/www/community/frigate-hass-card/frigate-hass-card.js.gz new file mode 100644 index 00000000..c33a8011 Binary files /dev/null and b/config/www/community/frigate-hass-card/frigate-hass-card.js.gz differ diff --git a/config/www/community/frigate-hass-card/frigate-hass-card.zip b/config/www/community/frigate-hass-card/frigate-hass-card.zip new file mode 100644 index 00000000..0475a05a Binary files /dev/null and b/config/www/community/frigate-hass-card/frigate-hass-card.zip differ diff --git a/config/www/community/frigate-hass-card/gallery-6281c347.js b/config/www/community/frigate-hass-card/gallery-6281c347.js new file mode 100644 index 00000000..72f28814 --- /dev/null +++ b/config/www/community/frigate-hass-card/gallery-6281c347.js @@ -0,0 +1,165 @@ +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;re[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&<.rel(e,t,r,!1),i&<.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{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{let t,r,i,o,n,a,s=0;const l=e.childNodes,c=l.length;for(;s=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{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<.$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<.$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<.$flags$?ft(pt):lt.raf(pt))},mt=e=>{for(let t=0;t{mt(ht),mt(gt),(ie=ht.length>0)&<.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||(al&&t.scrollTo({left:a-t.offsetWidth+e.clientWidth,behavior:i})),"vertical"!==r&&"both"!==r||(nd&&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;_=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{},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 in : "'+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` + ${this.options?.map((e=>s`${e.label}`))} + `}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` + + + + + + ${e&&this._mediaMetadataController.whatOptions.length?s` + `:""} + ${e&&this._mediaMetadataController.tagsOptions.length?s` + `:""} + ${e&&this._mediaMetadataController.whereOptions.length?s` + `:""} + ${i?s` + + + `:""}`}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` + + ${this.galleryConfig&&"none"!==this.galleryConfig.controls.filter.mode?s` + `:""} + + + + `}}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`
+ ${this._showLoaderTop?s`${O({cardWideConfig:this.cardWideConfig,classes:{top:!0},size:"small"})}`:""} + ${this._media.map(((t,r)=>s`{this.view&&this._media&&this.view.evolve({view:"media",queryResults:this.view.queryResults?.clone().selectResult(this._media.length-r-1)}).dispatchChangeEvent(this),H(e)}} + > + `))} + ${this._showLoaderBottom?s`${O({cardWideConfig:this.cardWideConfig,componentRef:this._refLoaderBottom})}`:""} +
`}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}; diff --git a/config/www/community/frigate-hass-card/gallery-6281c347.js.gz b/config/www/community/frigate-hass-card/gallery-6281c347.js.gz new file mode 100644 index 00000000..b8bd643b Binary files /dev/null and b/config/www/community/frigate-hass-card/gallery-6281c347.js.gz differ diff --git a/config/www/community/frigate-hass-card/ha-hls-player-aef987da.js b/config/www/community/frigate-hass-card/ha-hls-player-aef987da.js new file mode 100644 index 00000000..748c12a0 --- /dev/null +++ b/config/www/community/frigate-hass-card/ha-hls-player-aef987da.js @@ -0,0 +1,33 @@ +import{di as e,cL as t,y as i,dj as s,dk as o,dl as r,dm as a,bj as n,dn as d,bk as l,bn as h}from"./card-555679fd.js";import{m as u}from"./audio-557099cb.js";import{h as c,s as v,M as y}from"./lazyload-c2d6254a.js"; +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const p=({finisher:e,descriptor:t})=>(i,s)=>{var o;if(void 0===s){const s=null!==(o=i.originalKey)&&void 0!==o?o:i.key,r=null!=t?{kind:"method",placement:"prototype",key:s,descriptor:t(i.key)}:{...i,key:s};return null!=e&&(r.finisher=function(t){e(t,s)}),r}{const o=i.constructor;void 0!==t&&Object.defineProperty(i,s,t(s)),null==e||e(o,s)}} +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */;function m(e,t){return p({descriptor:i=>{const s={get(){var t,i;return null!==(i=null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector(e))&&void 0!==i?i:null},enumerable:!0,configurable:!0};if(t){const t="symbol"==typeof i?Symbol():"__"+i;s.get=function(){var i,s;return void 0===this[t]&&(this[t]=null!==(s=null===(i=this.renderRoot)||void 0===i?void 0:i.querySelector(e))&&void 0!==s?s:null),this[t]}}return s}})}var _="img, video {\n object-fit: var(--frigate-card-media-layout-fit, contain);\n object-position: var(--frigate-card-media-layout-position-x, 50%) var(--frigate-card-media-layout-position-y, 50%);\n}";customElements.whenDefined("ha-hls-player").then((()=>{let p=class extends(customElements.get("ha-hls-player")){async play(){return this._video?.play()}async pause(){this._video?.pause()}async mute(){this._video&&(this._video.muted=!0)}async unmute(){this._video&&(this._video.muted=!1)}isMuted(){return this._video?.muted??!0}async seek(e){this._video&&(c(this._video),this._video.currentTime=e)}async setControls(e){this._video&&v(this._video,e??this.controls)}isPaused(){return this._video?.paused??!0}async getScreenshotURL(){return this._video?e(this._video):null}render(){if(this._error){if(this._errorIsFatal)return t(this,this._error);console.error(this._error)}return i` + + `}static get styles(){return[super.styles,n(_),d` + :host { + width: 100%; + height: 100%; + } + video { + width: 100%; + height: 100%; + } + `]}};l([m("#video")],p.prototype,"_video",void 0),p=l([h("frigate-card-ha-hls-player")],p)}));export{_ as c,m as i}; diff --git a/config/www/community/frigate-hass-card/ha-hls-player-aef987da.js.gz b/config/www/community/frigate-hass-card/ha-hls-player-aef987da.js.gz new file mode 100644 index 00000000..c3e88c8c Binary files /dev/null and b/config/www/community/frigate-hass-card/ha-hls-player-aef987da.js.gz differ diff --git a/config/www/community/frigate-hass-card/image-0b99ab11.js b/config/www/community/frigate-hass-card/image-0b99ab11.js new file mode 100644 index 00000000..17614ba8 --- /dev/null +++ b/config/www/community/frigate-hass-card/image-0b99ab11.js @@ -0,0 +1,11 @@ +import{cH as A,cI as e,dp as t,dq as i,cW as a,cJ as r,cK as o,cX as s,s as h,cP as c,dr as l,dl as g,dm as E,y as n,cS as C,ds as Q,c0 as B,cN as u,cL as m,l as w,bj as d,bk as I,bl as f,cO as p,bn as b}from"./card-555679fd.js";import{u as U}from"./media-layout-8e0c974f.js"; +/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const k=A(class extends e{constructor(A){if(super(A),A.type!==t.PROPERTY&&A.type!==t.ATTRIBUTE&&A.type!==t.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!i(A))throw Error("`live` bindings can only contain a single expression")}render(A){return A}update(A,[e]){if(e===a||e===r)return e;const i=A.element,s=A.name;if(A.type===t.PROPERTY){if(e===i[s])return a}else if(A.type===t.BOOLEAN_ATTRIBUTE){if(!!e===i.hasAttribute(s))return a}else if(A.type===t.ATTRIBUTE&&i.getAttribute(s)===e+"")return a;return o(A),e}});class H{constructor(A,e,t,i,a){this._timer=new s,this._timerSeconds=e,this._callback=t,this._timerStartCallback=i,this._timerStopCallback=a,(this._host=A).addController(this)}removeController(){this.stopTimer(),this._host.removeController(this)}get value(){return this._value}updateValue(){this._value=this._callback()}clearValue(){this._value=void 0}stopTimer(){this._timer.isRunning()&&(this._timer.stop(),this._timerStopCallback?.())}startTimer(){this.stopTimer(),this._timerSeconds>0&&(this._timerStartCallback?.(),this._timer.startRepeated(this._timerSeconds,(()=>{this.updateValue(),this._host.requestUpdate()})))}hasTimer(){return this._timer.isRunning()}hostConnected(){this.updateValue(),this.startTimer(),this._host.requestUpdate()}hostDisconnected(){this.clearValue(),this.stopTimer()}}var L="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/2wBDAQUFBQcGBw4ICA4eFBEUHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh7/wgARCAEVAewDAREAAhEBAxEB/8QAGwAAAwEAAwEAAAAAAAAAAAAAAAECAwQFBgf/xAAaAQEBAQEBAQEAAAAAAAAAAAAAAQIDBAUG/9oADAMBAAIQAxAAAAHu/wBF+fKuKWoua2zblcOpTDeJqLJsVgAACCiNQEKJRCmEoMAhy1FzThq4VrCHDWbHCoilBWQKqzaa2xeTz3Uumd+Z+h4Sxy0VGmdbzV5AybMdZjUz1kEFA4AAEAAdEFAAEVKBDVxc1UtSgiaY1cSI4nPfl/N6eZrHp/Rw11mLJq83XO9c2ovO+Ry6ea+j4FY1uKl1zrSAAIucd5mlYUoBggA1ACiRiVgiCiW81w6JQqWpazQVTQCo6fz9vH+L2ec83o937PJ7P6HgsBAaZ1vjemdJNcb5HLr536PgACrioqFU2RZFkWLcAgAAokdoEhRKwgoHCCgrKpWrlQ1ctQpVU0jovN38P4fZ1HDta+y9HD3f1Pm2jEBrm78+muNXNVnW2N6Z15z6fz7zWSlDEkVnrMWKyaVgOCkA6AkBipwKBDhgIa1AC3KoaiuJtmPP+b0eM8Ps6Pl01lprsenL6V9T5vadMUJEa41y+XXXGqmrzrTOrzamvNfU+brnThgRrOdk2Z6yqSKxBTAQAgojBBRQAHDhhDViRLc1cpKhV5rzd/nnz/dw+PbkIqheXrH036nz+578LipVY42xvl8u14uk1pjeuNXNB5f6vzNc6uERc56znokjUEBBYAFACGAIAAAAKDyoqaEJRWVNOOn5dfnXz/b5rz9he1zutRGtfSvo/O731+aoYwjTOuRz6b893nW2N6Z3ebpnTXyf1/laZ0xM5azGpFioQAVgCiAAKmgAAoCAhgpDHLctZoNUvh/H6vnfzvfjHJl56taNNT6L9L5voPT59s1UAVLti8nl2rN1zrbn00zq860zoPJ/Y+SDM7nPUmxWIBiQoAKABAAAAAFEQ1BIBFTV5uktTXnOXX4/8n6euNbnYzWVjXkdMfR/qfL7X0cNM63xqpagKl5PLrrjdy643rjeuN641cpL4n73xUFmdzNCAACFAAFAAgAAogACCiQCiUlqWoqa0zfkXzvo+Z8fq7XnvmVx9Zmu27cvon1Pmcrvwcu+N6S689a51pnWmdb8+m/PppjeuNbZ3ea5QZ4H9D8JWISKhAKIApgAAgAK0SCiiACCwCEooOWocvTcuvx74v1+RjfZmk1jrPp/Z4/cfU+a9QHHIxupeRz3tjXJ5dXLvz6crl11570zqpXRDVnz39F8BwqlDUSCgwABgMIVORqkLEoAAJAFQAqsakOX5T8j6nQ+P19xNTc8nHXk9uP1L7fxI3hUK5d8a2xrk8+muNcnj25HPptjfI59NM6AHDVqHz79D+fCbFokAoHAAwAcEFEMWghKgALEgoAhaCiPLznm9Py3431+djXay8TU7vty919L5/YejzTYhDl3xrl8+nJ5dd+XTkc+nJ5ddcavOnKqCotoA+efovz9RGorEFMIYQUDQlYBAAtQAIKIVgoqRiqbAcuWNfH/AIv2ev4du3zrSqj6R9L5/fezxRYqRUC65vL5dOTx7crl15PLrtjd5tTRBTilagHzr9H+eZNgAwpwAADgGAQUAKwUQAQArjLG+s83p7P3+BhnXy/5H1vN+T1b5vPa1s9r34+++h87PWc9RwE2TV5cjn05vDvz/P6N+e9MbuWlBqAAQHzn9N+ecKwgGFjlBhBRDAIACkMSClEi0UOXTNpfN+L3ec+D+k7z6Xx+r8/o8FvlWddkbHP6Y+vfT+VyZqUmzTOtcbZnrNTXK49eVy67c9643rnVNAAAAAR84/TfnmgADgGADgAKcFEIBolKAEiRWhWbyMbivi3wf0EcuvKmuH38mWNdrbon036fy+768dsbcumd6Y1rjfL5dalBy0ry1zvXG6UAAAAA+cfpPzrAdAAMIcEFAACFoAISlCJSxQrUjl1zry3l9Pyz5P1MY1O72wxruK9F6vL7j6PzNc6359N8dORy6a43rje+NuAnRDjTGts7uaAAAAAPnH6T886IaFAQwGOEAAFAgAAAAAQ5Vm+D8Pt8J873xLKJeyrntdpL9I+n8vse/m1zvTOtM65vn9G/PpvjdQE1lrKRrUuuNbY3pNgAAAB85/S/niAdhBRDGAQUIKIgBSkEACpwEYvmPH7fCeH2dVx2mmVLFNnvLruq+o/R+ZyOvCprTO2c3z+jmce2uNMipsz1nPeHNa41rne3PWudtQAAAPnH6T86DAB0Q6IcFFJCBSwhKCBBQ43PfQ+fv5zyerzfl9XGzYRy6LCCiKucdxqfZPs/Fcu+OnJ5dUmmd87z+jkc9hOk2QznuXm6Z1pnWuN6501AEJGofOf0v51wAADGAQWCiClAgEEB13Lr82+T9TpOHaEUOXlzVmlaDlzlmzg3N12J9p+x8blaztjfJ5dtcbqORz68nl1cKgmxI2rmqy1xrSbYEiZais+c/pfzzQgAdOAAAAAKQQgpRwuXX5N8X6/X8+hHLObNaLnZRUFVL3HLp6P0eXzPSddJ0fPp9G4693+g+Lvm8nl15fHtU1rjV5rWpqoBDVxebpndytUJEjVqz5x+k/PMEFKcjAIKEFAAQhBWeNfJ/ifY6Xh25kvPWrMiluXVexzPQ/Q8HoPf4OT24llZvH8vp+X/ABPt9fqfSvT5fX/R8PL49eXx7OUVoS1LUuudENai860ztqwAEFAPnf6P88QtFRIU4YQUAOFaCRUiZfmHxvreb8vp5Evay1YWcatJe+9Pn9f7/ndp6fPGiSpRKl359PM/N9/kvN6uQfSvX5O81ORy63mxqTrNZ1rnTl0zqoqW86qaqVq4KAAAPnX6P8+IrFTHKIwhUwHCpWkIVnhPmfQ8N876HNl3rQYrnkdM/QfpfM7f1+VWCkXLedXCNcbvN+a/K+p6j0+fpPL6vqnq82+NXnUazNjNcbvOrlcC1LedXm0rUCAAoPm/6X88SA6ZWaBQhDBUipFZpb53y+r538f6txnWpVmusfTfqfL7D0cTWVQhDmtZrTN0zrTLfn00zrjY38u8fs+gduPF59PadMXmgE2VLctTSRq5by1zu86pQMgKAPm36b86wh2seQjUokqUEToi83qePb5b8b6153QrGdv25fRvq/K5PTDSLA0zqpXDW5dcXk8+nI5ddM6cvTZ347n07BPb9McrNqVjlcquW05QqXXFvOtJpqBAEAHzf9P+dACCql0zXEWMagkjSs3jc+nyf4/1sOfTSWyLO87+f6N9X5fJ1EBNjipdJalqWjbnvlce2/PprndZoeXzvgmlnsrnTN0zsVWRc3NXmuXTOtM6pQAAAAI+bfpfzgNUMoZWarCWgWbIoxr5b8f6/V8O2hcvYaz636Hz/Sezyck0zpWJLlZFgJbl0zeTy6czj25HLrU040zpnQY6d9rFDilCUVaY1rnVzTUAAAAAAPmv6T86wBGrCiAocriNJTwHyfq+U8Xr2NK9j6fN7j6Pz63ijk8+jgBBdsaqWUw6Yqa2xrXG+Xx7b8+ly1nVy6Z1WaCqNZVjzWVLpndKAAAAAAAB81/SfnC1hIDtBhDHKQjy/k9fgPk/V7beO69HD1Hp8/e+jz6ZrSbNM60zdM6i5z3nbn05fHtpnXH6c1W2N6Y1tjemdXnWmbedaZ2xIiNZjWQrOtc6poAAAAAAAAPmf6X845XRIwV2uAqLzoTi8uvnvH7O16c+768uRrNDluHGeo0vOtsbjWYueRz68nl10zus1rebct51UrlqNM7uVqIEmW+cay5rTGrmqUAAAAAAAD5l+l/OMYQwKtcripdc6uJ8nr7a5DXG9M6x3zy3loLFyJlvJLUa53yeXXbHTfnu86ZedVm6TQCOW5qpWoAJnc5ayy5qs22gAAAAAAAPmX6b825QcOiKtakmmdVLpm9t5PTyOfSprfnu86z1ni9uMazGs5bzFzjvIuubyuPXkcuu+OmmNXLeNbY1U01STqVLebTQAAJJQGtAoEFAAAAAAf/EACkQAAEEAgIBBAIDAQEBAAAAAAEAAgMEBREQIBITIUBQFCIGMDFBFSP/2gAIAQEAAQUC6hDofrwE1D+gIdDwfpNqxZggbNnAXQQ5Kwom+DOQgEBwEFrjXGkOpKJ+kuZKrWVvMWJUXeTsDVsMQ6gIDjSa1ALS8VpaWlrqfo7uUrVlcytqwhG8rwaFim0GzjqAgFpaQCA50tLS19Pcy9SBXMpYsrW0PZHax1J1ySjViqxjo0JoQHAC0tcBD6MdcjloKqu5GzaMMZI1pa4q1ZrMmMpMpxBDoxDkIchDk/R38hXptv5izYTimAl2zx4uKirSyyYim6pBpa6BNHAQCCHIQ5P0GuM1mPTT3lxUUJcgGtQCLXKNs7zhq81eu3s0IcBDgdifov5Db/GpOO1FE6VRQ/s4+y0CoK80rsZXdWqhBDjS0g1NatIBBqAQCAWlrja388chfyC3+TeVD/5Sy68/bijSltGnB+NXQQ4bwAgE0IBBqAQC19PtZu3+LRJ2q0fm4f7M0sQCxWMc6VrWsbwE3hqCAWkwIBAIfVZy3+TbYNuDWta9VnhyoVX2LX/OjUE1BNQag1AfV565+PVcdqkP3sBoR9xg6vqZCrTirSdAmhAJoTQmhBD6ueVkMN+y6zZHuWjxa8pgWDpehWIWuNLS0moJqaEAh119FJ5+Fa4JJOJHMijy+RdbkKrj9h/p91hcc90WkQtLS8V48NCaFGE0ID6cLSzNYPhNyz6dHMQyr+T+qXJo2QxrQG6VCo+1aiaGMCKAQCDV6a9JNjTWINQQ+nBQKc0OEkz6tya5t8V10jJmaMTSSxvtolYmr+LWCHDWrxTAgF4rxWuQh9O1ZvKNga874YdKPUsNc6k0Y34Wn52EE1BNCAQCHYIfTPLWMymb2nHyK1xVk0+WLb2bLMZCIqAagEE1NTUOu1tAoFD6OSRkTbmcgjV29YtO6FN9jE/yZjx52arDFXQWk1MTUOh5CCCHz5bEESsZupGrGctPUs75XE8BBjii0hNBJWlDoNx0xFkoIJqITE0odCtIBBBBD5t+3FUiu5OxYJcSt8AEoV3kCshGGoex9t+jomPyJBaWHRpvNexDI2aJqCaeAE1DrrkIfNu2Y6sF61Jan4ZXcQxjGD9db415BjduLC12Mr2JF/48L68uJsvnyGKsVZfJYa/tjSgmhNHA433CHzJZGRR5O263YUcBeoowxErSA9gAS6N8clenudmHb6sUEER2toFWofWiyNdvlVc6E4e2HhqYh12h1HzCQ1uYyBtSbUTNljkTobBBPu1U8XPMq9CrAieoQWaq+TcYIzas1pcbYxdgWa7Qh0HA/v38L+Q3/f3Ka1qPuWeyemD9Y60srocZTiPTSAXivFNavFZqia0uMljymOpSSYvJNIIHQcDqPl5e+K0etqb3LRzHDPIG1YparWhjOw4DUGoNVqsyxAPWxOTuwR36n8es7a3+sIIfIyVxlOB73zSjpjqL7hqwsrwddLS0gEAmBAIBaWVoMu18FZfTtZmF9O1XlbNDzrkchDgf3BHuFbnjrQXLEluf/gQTP2diKTprUUbI2865HRqaEBzpZrGC2zFWhbhwfq1rKCA6BaWkAtfB33c5rGZW665OOB/lWnNPHg6H47WMa0NatLS0vFeK1yEE1NQ5AWlexcdicMG9LXTSAWlr5Wcv+q5vuf8AuiXQYSQsjYGN0mhALS0tcNC8EYkWJrUGprUwIcaQWlpa7AIfLzdwwsmjeySWg+vRw2JLlSxsFZ4WlrgIcHhiHDmoNQagEAgEOB1PIQ+XcmbWrYyjM5UMXHA51dj3+C8V4rXGuBweGBDjS8UAtIDkIdSjyEPjjhn+zUhYm9NeCaxemnM77W0AmoIdNf1noPjjiP8A2M+yCHDgiODw7lqagghwAgOw+R//xAAsEQABBAEEAQQCAQQDAAAAAAABAAIDERAEEiAhMRMwQFAiQQUUQlFhIzIz/9oACAEDAQE/AfaPwB7Y+KPZHC0flj3GsLvCbpT/AHFF8bP+oRO43yGBms19WyB7kzSsHlCgtTM0jbypDLQgMUq+rZp3O89JkLWeFRVKXdR7rkEFSpUgM19VHpnO89JkLWeM0VI8Mbaklc/zxAQCrACr3L+gjgc/tRxtZ4QGaT3BnZU05k6/XIIZCH0tYGWROf4UcLWYGaTjtFlaicSdDm0YCpDA+mrEEO7s5rAVFF+3yVqJmyHpDgMAIYCGAPqImb3VgC0ETik+RrPJWolEh6QwOACa1UgEAgEAqVKs39EFpWU2/wDOGdFHMkzY/Kmm9U3zAQCAVIBAKlXC/pImb3bUEO1aIpV/lTztaKae0ST55BAIBUmhAIBV9VpY9rbP7yVGQfxKmf6Te047jfMBAJqpBqA+r00W92Go4lJjbam1DpBR5BAIBAIBDA+qaCTQUUQjbWbVLUybvx5hBNTQgPqGP2m1JpdzfUi7GAgLWn0+zs+cDMuo2t2DzwpUqxSATQgEFX09L+P1f9PJ+XgrV6COvUYEP42GZ/4Gv9KT+Pbpm7m8XvDBaJs2UEcAINXpr00I01iDcD6cZ0WtliYKUkrd++Ppf1Bcwschwnl3u4Bq2poQC2raqyEPpwoIPU7Pji3Gpk2NrAQQQCAQHMIfTBqi0v7egONILU9yFUqQQQQ52rVoH6NoLugo9I7+5MibH45hF+3tTyB77GaQTUPaH0DY3u8BN0bz56TNHGPPaaA3ocKVcSL6wEEFSaU08qwMD50URkNBRQNj8cdq2qs0qzSlidG6iggmnACbxpVwHzYozIaCYwMFDO3F8aUUrIzUnhanWxRvqMWjqYnC7UUgkvb+sSxCdlftVRo4AQCpDF+wPmMaXGgoYhGKxWL4EV5RLWi7Tte2ugn6iR/kqycBQSmJ+4I04bgmmlrIb/5AgE1DN5HEfMAtaeD0x/vgeEuqYwf5T9XI798KVYC0k1fgVKCOx5UMweFLF6bqQCHAfR6WGvyPEoJzwAn6p540qVKkAgoJN4o+VKwxutq/9WIIYpUhgcLQPy9LBvNnwq4lwCM7g40UST2eIQzSDVtTbabCNSNUTzE5TMo7ghwrA4hBD5EMRkKaABQ4yTNj8qSQvNn2qTRgBUmHaVIyxuCjdY2leOFKsDgAq+OExheaCYwMFDjPN6YTnuebPCuYQQGaTHbU9ldhOF94CrgMUgFXwb5tF9BQxemOBeB0VqZ+6aiS42UAqzSrgFSamhAZAVJppUq5AKlXytLBtG48HaloBTnF3lUqzWQFsXpotQC2oNQGKzSpVypAfL0sO47iimyBxoKXUbemqXUl/XIYOGoYIQag1AKlWQhwrgPlxx7zSfIB+A8KScu6b4Qc4CgqVKlXAK8tCGKVKlSriOJ+WMBR/iOltW1Bi2Itr2QE3AwM17RVKvkjDUzAQwQqwcHg1BDgAq9yvg//xAAsEQABBAEDBAICAgEFAAAAAAABAAIDERAEEiATITFQMEAiQTJhIxQVM0JR/9oACAECAQE/Afmr1h9q6RrPKdq/00JrJH/yKa0NFDiVeDwv4q9G/UMYn6qR3hdytLp3A7ieRKOS5Xi1fq5NSxvhSTverxCRY7WeRKJV4tHjfEZH3z2Umqa3wpJ3yec2omdR21RxNjHbiSiVeCVav1cuoaxSTOf5V8GMc801QacR9/3yKPrpJms8qTUOfxtNaXGgtNp+l+R88iUTgq/hHotRPt/EInjaazd4C00Do7JR5HJRzav00r9jC5WiawMWmRuf4WnhMY78bVolFytErcrVq1avNeiK1Ulu2/8AmHiwhmKB0nhQQiIVxOLVolWiVav4qVfelk6bd2CqQN40+nc424dkAB45FFEq04olWr9Vq5N7qH6yE8V+QUTOqaCY3aK5FFEpy3IuRPq9TL02/wB4Kbf7xC0SOpRQNjNjkUSiUSiUfkHoHODRZU0vUdeAqxpo9o3IHkUU5Eon46+5akZvb2UWrp3Tl7HJdS1M/U7Dxxi0+5284BVq1avBKJTiiUT6i1rtJ12WPIUGrk/gSv8AcJYmfl3TNc7UdjxYwyGggK7YCtWi5b11EZEXon1NZ1WnYZCms/Ha/uhEA4EJ2AqUMWxvAuVpxVrcr4H1BU8/T8eUTwKC08e43koolEon1xKm1f6Yib4DOmoMV5KKPCsUqVIhH6dfQc4N8qTWNH8VJM5/lXzDd3ZQsLGUVWSnchwKPoHSsb5KdrWDwn6158IuLvPxAoDBRQKciOVq8n70szYhZUuofJxtXmlavIKhlbK2wjgjFoo+mlkEbbKkkMhs5vFcbUkTpB+HlaXSyyMuTsv9PI00pWdKt37xDIdLLf8A1KsEWMOKJ+M/dc4NFlTSmR14vkDY7IbnnaGlN0Dv2UzTMZ4C2qlS1MDZmFpTCR+LvITm7gtDMW/4nIpyOaxXoiaWon6h/rgAqzFpXv8A6TNJG39IDhaONZp7/wAjfIUTgVNCWd1DN1GIlHgVfotZPf4DiMNYXJmkYONq1atEolTRdN1jwo3CRu0r/hfg4CtHnX2gtVqNg2jzya0lDTtLRaDQOwzfA4tbluTqcKKFxuUrBKxQusbSj6WaURNRcXGzxiidL4UcYY2hzvJKcVatWnjcFG7aaKe2nbgvPC/QPeGCypJDI6zx08XUd3TWBgocL5lEonNp4tMffYpprt8Fq1f0aVc3Gu5U8vUPANJFhaaDtbk1oaKCvF4tblfAopyvNq0RatWrzatEq/sjGr1G47RwZpX2E1oaKCtE4tWrwSt6EiDkXLci5OObVq1avA4X9zVT7BtHnDoy0WVDpy/u5Q6YR9z3Ob4jDkcAouRcrV/CD9+SQMbaZETbz5UUAb3d3KLWk2VuW5WrxfAYccWrW5WrV/EPulSfke63rei9b0Hc6wSjg5tX8YVq/tuT8FHDSgcDAyUUUckq8j7f/8QANxAAAQMBBQYEAwcFAQAAAAAAAQACAxEQEiExUQQTIjJBUCAjUmFxgaEwM0JikcHRBRRAYOFy/9oACAEBAAY/Av8Ab6zSNZ8Vc2SF0rtSr207RuG+iPNBoJNNTXvNHPvO9LVSOkDfqqm9I7Ulb2QNjachdxPeaV3j9Gq7euM0asli5MZGH7RL6rtGt7xRrt6/Rqu1uM0bZgsUQ0igzJVyMfE692LG+bJoMgvMfw+kZIuPguxtJVBi88x7rxuq/wBAzRAO7Z6W2YW4BXGNLj7Ihxq52Y07qdn2V3F+J6JJqbKnAKjRZkrsd4nQIia7U9Kd1ow0fJgLKMxOiN/CnS3NUiaXfBXH3b1endnXTwM4W2NkcMETbWMcIzJQiDr3dnUPG/BtlTkLcRgVvNoj8rQ9VdY0NGg7uSORuDVRUbYYZOU5exW4HKMSfZU7vum/eSfQWXim3MqY2M3gq0NvJ7468Xd3SyHhanSu62AIJt4G6TRCVxq+Rv6DuZ3brruhojBKN3M3NuvwtL5DdaOqutwiGQsrpbG+cNMRN673UzjB8Yr8kDxPLciM/wDqEZY/eIUfWMdLAFQWCMYDq5NY3JooO60OSk3D+AONEJIQY304qap7ZiX3lhlZihQVOSunmdi7ux2eE1lOZ9Pgu9eixWozRnrwRnD37qXvcGtHUoxbJgPWqnw32mlV+ZqiAFCRePc70j2tHuUWwN3h16KsrzTTp4/ZMiOF40qmRuIJaKdw8yVjfiV5YdIf0C8u7GPbNVke5x9zbgsrKWkE5j9FE8dHdvvyHHo3Vc11vpCxNuS6LFypZQ5K+OVUVFUYJklA6hyTZG5Htpkk+Q1Rlk+Q0swVTgsqqlLKqqp1V0ggoncl8XVB7b8cujslcMVPforoG8bdvVFjb3wcqjLtZkeaNCLzyjlFlcgsvn4ANVdkBb8QmhkjHh2gKBkc271DaqscQHgoOcYtRNKFVxwOaEROB5f47UXE0AV1hpE3L3sqVSytnWhR3g3TNXDFNoy84dXfYGdo/wDf8p2ybR93Nh8D0KDXGrDyuCvfjGDu0/2kRwHOf2sGGPgocNE3ynmvUBAhhcR6j9neZyHlP7Iwz4vbg7+VupuXI+7dVUZdn3bD5rvosVgKKtt9kbnNrSoChZtELS5jQgxoo0ZD7R0UgwP0V4jLP8wTZYqF1KsP7J2yP5o+WunZrxxeeUIySGpPhdQ3WjqUImZD6/b3cpBylHYNoq1pOFfwlM/qMHq4wmysPC4VHZDLIcB9UZH/ACGngwQMjDuhmrkbQ1un+DvI8J25fmT9g2webSmPX/qm/p0lSG8Ubuxl7jRozKwwjHKPBI9jcGDFGaVvG7IHorrGho0H+GzaGvMUrfxAKtMexnZ4j5beY6myiutFSozI+7XnGio0U6943EX3r/oFuSDeGaEsho954WdaaoTbU3h6N1V8cT9T07y6Z3T6p+3TU378Yw7ot7J5sxxLig9zAXNy73GZMY2Y3dT/ALh//8QAKhABAAICAQMCBgIDAQAAAAAAAQARECExQVFhIHEwQFCBkbGh8MHR4fH/2gAIAQEAAT8hhBgwyGCcYxl/LkIes9JlIkPQFrBxgwQxGLl4PywlSoQhCVhyPoUqnlt+0v1GjQfjlle9ehX5dIJpdTp+7hlQemI1GKhAQgQl4vIX8oQxUrJlzcuW1H8jLNvB3+cLdDmLsspP5nYYmQzVTli0emiCKwxYvliEPSYvCy4YnzLj3Zci14vyzd2PLHizFp5391bggZM2QZMEIZBFYWOH0vx6lQMkMVlZdCug5Yg/iR+Zd7bxfmdyOtVv23L+b92CH7ekPacvTz85HF8HBWIgipywqVGLFjFl/JmD1glRxxxep+RjO06NYmhA4mrRGK7XLzzq9D3ilv7Ug9AMOMIYCVK9BcUWLF+XIZqVCDh545f5dps1+pz7vWKtwkWgCbX3lzrCBlXpFociHEEkVWAhxkOAYBKgyWKLH5kYMMVhUuahoOng/wBxKycq8xblDb305gmhLtavywUCbl3GJvbsAs93rhWSBiGoZwggSsDLwLF+cIMGER7quOh1f73jKNIHkbYPUnuBQBQaAn2nSG+zLDLw1CW5s048X1yqBfw+vKmBci/QBhRLP+4zrHvVuzxEhg28957Iu+bIuCJ2ZCRKK3VZHUMCWyj1DKRWbjh+eJcIsFX/AGmMoHlCfhigapLHvHEdXqF1gLNN4XIeAojlwhDDNU5eggegJX0WwN/f/Mr+FzoN5i0NQ/b2vrK6B1dx4SqFlorcckUMGoYfQUGLwel+OfJEy6a/YzrJXS0R1arR2ZfbApLjOicfublHf0O2KlSvWoUwQl5IZJcX58lCAL9/ETXlo7HaDggkcnMVeype8hTNUSdPNWRUMGmLm+aECBKlQgPQfOVAg03UH3IFnSs15RzAYI0Nqm07fe8su7snLsKSaFXFSEKduqIaayC+LCYGiZgIECVK+gk2jPXsh3EDxj2Svnp+3mcaZ1KP4mySeLxZ/wCxIbjVtXHSXfLLVvEurDdGgg8UT2CcIZZKZdg+EXGRBiQPoxcRAAopGGmpi7KuEvrwnwja4FK9bgXcmyaiS8vVAJazQ6wj2dK48fbBSr9ABqUlIQQ+lU7YKP8ArcuXi9LHo7jg2uEnA9APiE7Ude7n+IOQzRlx6CEUUH6HUCcuIEoJWv8AA9b7doqIq4YNMo91A5OXUp0Sv8kEoH5VyGkW5xgghGLF9ITh9AvCTuHVL0u/1FqLoOh9pd4Emq1BHCoF7L7Mu5YfvTd2AOJeHCaMeRixwuEH0Jfid2whPBoWIPuv5Med4LpbLvmWWoMW+odaaeJWERumKnfRHXRLmFLhi3iYLJTFTmMfSA9avB8vtcXFyo3t9PSR60fvG2NaJl9/aM6ofaeYd5fR/wCwLDtwr2dF1C6a+GXF0i+wIGqIvf4l4dN08nhwWILwGo9RcVKwCGQ+Meo+AuXjqLtEo/QO0Xe5VtRx49nmDqs6qS7SR50QcbdOScPz1lBVVoo5Y4G++o5dpq8L48w6rWdZf5luthrrUXzFztAXT2igO5N6LQB3Dr7n6hIIKLE6zfFolYjgMH0GQ9R8qAstqy/A1dsjuDbaNMf700o3EUzls9sjcrV13drzHdAB0/d0QCeHuH5iRGlXy/zChRqXiRr0Nq9+z4eIu7Zfceo+YNNCD9cZvX/I+8ME4xIS4ODhgIEEPTXoD0nxTBCtXpGLOF/ZluI/AhCbbq9R93R1KAHMp8pd6cLRe5UHDf6Ihibra9+3ESLjmVFHqDpr+H96f+QQa3XqfB+vuxau/pf+JDSThTv39n0FzCCECEIYPgEXLyYPh2rsy6sJup3BnMOY2A5TYl1y3MVeJ8nZNiFLs/jiLeSHopolURBHSMO2cna/4/XtNW+8ngxKDTacdp7c/mEEFFidc0iYjlcGDFCHxCHpPSRnFwarp7yjAX1mogDsRDC9QT1NAXApUa0j9oUIlB0zUqEMSWTXh7UQeq6JOjBanC9T+6Yo4fLjyveK7T3zx+0WCJKhCXgyXx1ZIZYQ4jirQ77/AKjqX2rOcdk8S91KJOlNX2hv9x7u8rDCBDCesQFwq2f8b4mu0H8b7MA/R9x/pl0oUCEqEV6QggQfFMRkxccKBnEd3aKfz7A7QKpB0nPfBAqFXxFTNna+IDCuBAjKjAQwIQgyQSsKxhNuzsx0wG+Kf9JRFvQ0nb+b/MCDBWTgYpFfGJeRDDgRZbTpN6K6/wA8Nbh3hvQtdE5LA058HmKLU0Lg95UwehRgIYIMLXF4DE3BAgZKskHqq4uAVVilrEySGEQfIj0DLlxxzaur+1Y93RKJCdoDnk6o6feU7hbeV5Y4uj0Mlk3wKehCiCBCBCDEkYYrAPkzJgxUvPp3UnQTa9bmld1fuLt0iqBzXT7+xEhPS/ShhDpA3kDXojqJqWeoMBAggZqCMPkgyekgSp0veju6Ep0ieAfRYoWx5DxAlIjTi+YPEghNTlAY4JWFYDKuE0wmBUrIYqVBkRRfKHohqC4Xc0/7/t/mACqhiOkolSokqMXcJLYjgcECEBKwQh6RKgSsD5AyYMV9BBDKhQbiTjCKpeBDrEYGIJWHB6ySpUCV8b//2gAMAwEAAgADAAAAEH2HUWVRt01vusrnCqQdyy4N9XeYWWL2cdbhqRx0hGkn/wAs0nkte+AQgaKPE2wWfkGt2j1Y/JJpId4PnLAe3/kikDJPKyX9pQNglIi9KcD3LyLIV2KB7QVOhQZHc7sQaly8r7/4D4Qydu2J49xjIXy8xb5zVpyBHOglgjzzstSQq/p8m8/zqMBYezDcRwhuKVZtACMCW0WTFLAy1sZGYTVrfsdgKP3Q3F7rKImyM8xCB83o55LZ6wGYu5RdeI7Lp6AMoRWg4CLzuePJ7M55rLG3M4oebZO68kG2S/DT0p3Th/cUmwbUm7g/skONjaEm2qCyavWvb6KYFW2AmKms78tEtYtZbdAacIzaL9b6iRIf5emPy+0ABiRvgoxTAR8dgDbD5plFyEogUtcBEv8Am8krr0HX0PRe1t89izE+0Gjz8jUaolnmsk5yyiks1bZKkkNqS2w52KAqkjWVytEkmiuysoYxLaGX0Y/4aHqrhKS5MZ6YkkkmhsqzkkkQOp9gfQRBkAFYPmxJR4kkkkkb4Epj1ujAAUPLDQOrC6wQNRtM+AkkkkQzNwgHiYE28zo6YUo8csVUJJ3iREkkkCxdyIQYPqE2UUYrF8dAbxwpfhiBMkkk3+ww3QnxeW+y7PLTznY8DudN8XMMgHkrSWzu++IgiYVZqRZkUV/WYn7Xgnkk6khawJJQuMXP3iflDG6A+EBhYBPQQMn6A26DRwYBa/r+b/imdAcuoISNcLhqkgMkLg10wsUTJlq2+UaWXKVLueOM9rmmkkkncCt+MbCVspCfTY5xK9Il1hvLkmskmkHxIQqM7/EQmpcQNRUuLuw2WZXkoEm00oQG6Df4BzRLB39WcnufoYWtzmwfMmm2AKgGyksQOV3Rqr9fM2DZszWWBkgkkkkXW3qeeGsg2eGFYhkGJlRzvk65Ekkkkky+Ti1yD25a5AtyDMXfugXkmYkkkkkkkcL9pZf+MoG7i7OqkFJtorQTzkkkkkkkmCfngR+ZIUUu06s8RU1hhMJikkkkkkktGftSppknhiZ/VhReALFkhOoQkkkkkkInvAZg3jSpMLQ+AHeigckkv8Mmkkkkk//EACkRAAMAAgIBAwQBBQEAAAAAAAABERAhIDFBMFFhgaGx0XFAkeHw8cH/2gAIAQMBAT8QzRCdQmJkEkQsUuLxmLCjE5lBeiWKL0UTEwjQsExOi6GUXXF0XgPKxvitnR2LYmdjYniwTJiZIaEuE4I160SVh/H7NRZ+7H0ZQkJa4KGsEtEEFmjGxsvClKUTwhiJBZWh0QnlEEsJiylw2Mi+Tc7v/fBHEiAKv8ft8UhBCQlw6BojCQWIQbKP0IQgtkOxcJwQhEFhdCQuO+0fP6OiV+7E4hdiO6EX3/6TigooFQsZLCDRCEy+SylntYpRP0Esp4lEsLC24j2I+/8AY6tv3feE/Yttll2Nb09hMeFgWJUTJSIIXBvDLg2UfJCOspHWEXKEI7wkISFlZWkJNf2aLiUXtE1YaBrBD6wlj0ExLBBLCFijeG9FxOE4pZuKMWi0vG4Qg2EbxNe5tJX7sh2GNCd+BFGIkL0vPkhDoSEqJYEhBBBCEELDZRso+FFzomJEEPQxEEoXFELMCR8L/Ikkdis0uhLinsEKC8fIw0LQ0I8WEiFggihJmlGylLi5XGlEd8FjvhcIQtCYhEl+u3/H+X9qQb1E98kPpiGyF1rJ9xhDYhGNfEK3AmFkuDZdYReK4dYSFiUhcI6LwTwsLDae/wAPH7+olBtzJtNDYnv9g7SmEJCELDDEs1QXCsnil9FsuEMTEUhBaLcrZBawnjwRvDz/AB/nr6iC9mLYugo+A4ANa2UI7EKGjhCgo4JEy8P04QSIPsRJwb4rEZsTw3z34eBI0tLBT4/Hwyg9h7G7ZRYQhI0DBBGWCcEuLw2T0FyeE8JCWUjo7E0XFx2fS2//ABEp22Ik9D6Hle/Aj+D7kIQRBeBchYhZUQuNG/QWJvmsIuhDwsdkGsdiYldjFBfr8sSJMFsm+hzT0hqMgkQhMGEuSSEhYgkJcExvC9KE49Y6WFopKJQhDdlV5XwN7F8eUN4OZJKtil8j7EZ2LhbvIO9saJw0EHMcsSCCRCei+Gxems74rCwkpK5Jr2ur+xZlWn2ot/v8lYz+C/2d19RIRbpt9/7rwQREkJUug13YyRYJUiUGLHiFgWsEhejcLM9FcfOUxDwh6YwnUSjvappVPaHoLfa8X4+DvRev74oZdHR9LoT2JkpI2wVIIFAvWF6lwli4uVrPkQ1mxv8Aq+P4939P4SSKWD2MO00ntlpWKGjIrXBYYb0pl8exC5z0khjcP0n7/QhaRDY0JoVbQlZaD8CgQ0HrOovDobomUIr1BeKzRCxSiKJ4oncvDSFY1t4vv+jru/fyQQmIaF2N4IHHQ3rif6KI6GrHO/B9D1hCVFgvQby+D40sxOMxZ2drv6Hiv3fj9nlf+vgTRi+BvCFQ2EniC0hCNhuPIuhyyD5DwSEEsF1xvrJCR3yQkeHnlibSv3ZTR2JUTQQ0FoXyXL4ErcI04zsfhRjXg0wJXCkF1mDwpTCwXFcHyWeuKz1l4v4oIJJESCeLRKjZONFeJN4b+4p6jzap+z7KvP8Ab9D1P+HhlPb70/8AwbORtC40JzBNcFobEdBdZeEuEF6DFyRRA7GQL6kNxKD2yknoa80HZ10vktdv8iiPaH2HhmKH1PleRluhl4ifq84J4bMokIJcZwhMUvFcZwY0XYir7CEhPwNBMpdbIpbf75La0XwbPBMEEsL/AAvr4f8AkWPoDMn9UXU68YlINzKCQsJCWE56NGy5hMpTKFwR+Ji6Eh0SwhLYzNtaL6Ti+C0kEIQWBYqQdc0+6/wdBkzWrtCeMIMMaF4KLIXoLhOEwkQgsJEPZt9xItIYmM6O9Y/tTbHr7HiEEhBBCjFWBFkNDRTf+plS/qK8CzqUWSGKUTyYb0kpwj4IRMJYm/C7EpGkJ3FGyT7xjKEwiCQlhLJSyG2E4m6NoxbFhNwIJCwIJeiniiEIayhlySQUSQkIbRsU9lj1iWJrBLCKJiYtFwJJCSwfo+inxkKUSEokXBCCwUJ6SxM0QohcHv5BMfL7xTwPV2MrV1+R8ZWNEIJCvGCwlFgpghD3MYWntCQkSgkTCQwRSL1ITC5LNEe4f4I28NJC4W39mMq1GEEosoUsOhhiLiwpCEEkhIWU1BieIIQ9ZMvBbysJEIe3K/JCUWxl2zyK8x/gRwohIhEJbySEzQmi5DBEQQSgkIJwYagmL+gMWijwniYQkQetRmup3PwIuoObtMrBChoSNjCSD2JYkEqIyIIpEJMghZQg0JhMTE/6ClxRFwgtISsZt835xXDckQaPI+sJluNIJCaOsIJCEwlhLhBMEEhevcIRBZQp2G0XBSCmNUxo0FvCiEdMUEhbEpgSEg1hIXKDQgkJT1v/xAApEQEBAQACAgECBQUBAQAAAAABABEQISAxQTBRQGGhsdFxgZHB8OHx/9oACAECAQE/EA2zjLJJvXJEEEQ4PwJL5LznPx4MMMM8PBLOpj1y8M8ZZBBBHr8Gy2274NtsPkl7jkC9qG3I+xwgI42Uzp4L3Dbw2WZsssggiH198H1P0Q8es3X8rrOp/wB8yNq22gfv/B47wK23OJm8CbbbwPARHO/SbPDYbZeV43l4756Xs/8AfN7Fw+xYtfiOQ/2Pz+fXGx4gxZq52HhvIQ4OByeO22cPhvO28ZzvKWSBq3T9n9LoF19iLD5g/EmJz5/tZj2+88HGUspteBjNmbctjuIIizgYbedjgeM5PBs43y22DjpDtke09s5XLNG3Yu18/wAS+X2nqWWW22Z4DYIIIPE8S2J8N465ySeV5TgXt3dDuFswZFiwTrKlexn5W287ySymLPK8ZBCCPELJjrgPLOAs5ecsnjbbbt+39rR142D7y5AlebNsn38fbgPA2yzl2ertKWWeTLIIIPE8sstvjk52zjPFsmbOPfo/q/wfrl2g9p9dQi19pnDs/Hu/pJPqSXPMasa1rwBZwCzwzgILNg5Hfr5w+Dqnr93z/H9pbSD3euWMEnnQ+8pDu8MzCWczwnitbq+GQWcByZwcZZ4B4FsH00sstH5fH9f/AD3LL7XpENl+0AgNwZZwzw5eIBrrw3neCI8Mg43keFtjnbfpZZZD8N+75lg33CZf5fzJz6IAHxHLMpXRKfAB9Asg+k8D4t8cbb5By3pfbo/mW7GE0MIj8fmffL+kW22yy8SNSzwE+WQ8ngs4XLbPPOM4PANjrhmCdEiv18S8Cb7D3Fs9vANtttvEXTmFl5HJfFgQcnG8nVtt7jqY65HfMt4Mgsfhv8knw8bkQVepV8D9Zs2DL1MHoy9ch4yjwBFzGy+bbweWeSTzl1weAcsxA3c7h/1MRJnrt/4lzJ+bc/yRvpfeHr/v62zBzgEg9T7lOJuEUMHGrLs/S7+mtscZxmwSTHl8WTE7hyL8+fZ7mfgPT+X53R3kMZhw937ZJLc8CLtW7Xh/CngbL1wO85ZHAWckvAhOf+H5v+v+1F14L2Qul+QyyeC4MbWXgjhJJPwG2+BYyWZHBDxlnIxbbYmtjv8Ak/iRKvfgupugsFPmaskeuKl4IgcjxB+APBmWcZZBZ9DIbVkJnZvd+vtw9+A5Hd/dI4+pEbbuQmfcQRwyTJfwhn1vSherrF50nte287ls8k46fF0dz1wXfANLKYjg4Me5fJln0dtt4PpbfMX4JDtw+1t8cbY4HcmzMevm6Gx2cYWh/wD7weLcmvYdwXqG222WZ8D6nxznJ5rqc+G7bVhx6ZetsJpaQqPk/acN2+Mx9+/6XqP8WDTP9vtxlnt7/J/7+P6BXoZ65DdmyySyGGXkvgcbzvmcHPUPk6bolS9fHDi9wcfM6dwbdpk9haT0/wBO5rT2AdBZkX9pt+z8P9raLOhP9n5PsjUfUjp/R/7/AL/MpShk4JwSTjbSWfo7bHlkE8lngAV9T5np6/m22S04ZZKa9LuezAQcbw7TMg/uH3P5PZ/iZB9M0D2emHb5PfII7g5Fm2ec+jkHhsc7zkdcbbx+6f4ngMJ5OADZamv5wYQcLMYc7oY2l7H6P/v73zlLH8lns3ko4MmSySyfFtsfQe48Nth5WV9yX6Tq6wQRBKdEcHsicOoh4bbbwZzMYEeiGO6xP8iQjgt6tmyySySSfEbfobwS8jDPGo+X0TD2MxZHVqfbBvCZZeCy8gx4Ryl4Lj02zjeGwc9Syy+GWWfQZh8CIJZbaTmfcXTDr5ig4Sw2xF4eWfMLbGITvzYPntCpZZYYhl4Nbv0Ms8s5Ak5JgL6Jen0euPd84ToOizZ+/j8rDOEzYm8hu0smXFTNtmF2ae+d5EeQ38Klk8H1dh9H6w2R9pTLh+pZ5wjgL3w6xwwjHBrwPA0ltmMeDUMuFtn8GPFbeNvvq/Sx9sA6dhPQXZELaxN6mbZQ9cFFnyDWLLLLyXrgHZNmfw28NssqfxB9t+h/eX2/Yi5dljg8Q8NJkfALdJup4mbLPkT4SSz62eBznDwsLo/A+Pzu/ILvbbDwOwTMzgcyt4YzeXzURm2/WPotl6Q7jguEJYeDGCzwSl5FW8Lhnz22H6//xAAnEAEAAgICAgICAwADAQAAAAABABEhMRBBUWFxgSCRMKGxwdHw4f/aAAgBAQABPxC2JlBL4sxx8ApgIMpux1ERdxmuAzCVKmp1OuAlSoSqhCEqBBDmGJAxCahgl3waqdzqYlPqCRLJbKpvKuETFhQNuIYSptCFloXiMHAh4uMuLh56hycHAQiSvwIOBwWu5rBcBUqoMMtl4nsixcTCMaMsP0gy/RLS4pVHqh/wQHKKHM8Ob+ywZuV84lFY9w3eIZcOGUwsxLrFZTOOLcfmlU0xPCWR95iZYtRgeKgQhwEDkgQ7lQJUeWriBcIFAqGo4OJcRH5g3GkOsNMxsd3hdH236l5cx3z/AB9VGgo2kq/+9yhHi0mSiye1QlwFQY4q2ZYz1x6yzCXqUaRswFamJCvHRChEjruPURjweJWIk7hKlcdQODg5CVK3ByBKxKzOptBxGLnghtAknigi/QfVsY1dvbHjY/5GcQ5cMoh6802EsaKwCbA7a8p8Fy1gk1FmTHS6nqlRqXdT0ygg1BcsI4VN9So4LUKOPBlQh74BKzKgSoFcEJiHAQJpPhwkuKLFSoQFEvHElWCtGgJXuMW4vvX9XGgYqWQ/LbFJcld7hkA8soL2LxuINdBbc9bP/rqANGp5/b48EMKrgFy5mCNQRwSs7YMqhNYpUyhlqUOYeJuhDElQhMSuCVwQIHcz+HhB6ivECEYjDcylkKRYmYskuDnn+no+6mUB5H6V5+W2D22AO4YP2RC8/Us6/IhMqTrHyuiAnqtNDWh6P7/yg4dSs8ARJeMmGGYYYwPuPMRUEjG3ncOIqw5CE+uO+DXBDcPyJcWYoa4OB8V2blW1dkK8ej2/QxNHGFFP2f49RFZb9wqcEyGvcpTDpe0bXeGIMs81GGBqX9+Ja9BF1GvbnLMVyiFkqyMvDVmGiWvJimYoDxKMzAi1Em3PCrjqVUKj8zuEIy/xNfgsuHBOocHljIUwtDaXzKExlzbv2+f08xU8rYKe2LsrALILP6DzPlaYy/cQqfFSf7MoEE2McB+i0folIE6k83WX0wrVY3KrmUqETuDPEiyqM2CmCYuFa1LzBB1K02zbw2Tc6gwYzqH4Gp98kJ3+XXNwvzGyrcKptF6LKU9d9UQpVV7h9AgKlni4Qg0CGbOmDI8MA9RQbUwPZO2BgZuaRKfLoPmWQ1OYhqlS6UtvmjERUWZcVBWJpwRZV1LViKxPEc6jPUp3MMp4j+ZhHGo9suXcGXu51Dg4OCViGeA4PcxO/wAji4blIT5x+544Aaaf7H+qlh53L36hOvI99kuRUo/tFYmFuyUAkOBodTf648QGs6wLasDox/vG8sh1FcN9SpCi7qCmoB1PXBhnUpKJRCUstluLl2S4TPFwccnITrgPxXhhOp3Bjgw4AESubJZ/Qf2kYZsu4j829vRKlEG1IxCCADQ8j4iP3IH+kU5OwfRixrvxiawfkH0RWcbRQLZhl7TKo8RFOpeanrgkKr8AENcP4HAcXwQgSpUCVx55J3LnXJ+AwbllWoAWr1HrlUdAc/Zz8VAYQK18HcwrezzFqAUq/MtmE+C9npqk+PEbWLYrQgvkt6mHAMKtaKzwrHBzOipe8JRjpTLuoR1CIASw4DBArgQKlYmNwUiwlcHHmEN8HO0eTmuOo8GYstnrgmQPTTTp+zR9+ItxONeoGVYz2wKkm3OVuvSV/cxC9jGVJNmkgfsEtkOCValaY9/0RyR4FXqBtlzNfED1Kpj1KJiY/AeoMco7lAl0XghC4EODUCEMXL/O8Q5udQhEjB4AMuXldD2sarSF2OsegiV5K1U0Hlq9xeXo3AdgAnxYPkGKiIQaWtPstv1KVi+ouoi3XAEMEh1CRi1xUHFg4WiSj8FFZb+BAhDk1x1Dg4qp5/JlLLBBgWrBd4TZ/fhGOCax9kdiZg9I6XhaLQf/AH1Gi7Mb/wC3+fuFnsdsvfQvzL6L8ZnmcxEC/AWtYeG731ACAAKAMEvtqbS1LBqIbIt6iRTBVhmHMqJXxYJSU/IZ1yQhCEN8EITz+JyS4pxcUrgwUxKMV0d5iX5Nn/2EVBtV3yIsOsmHpLgK2JE85Y+iJwKjgsEaA9LbemtRC8Sh/BUuvcastj1K3Oi8dRwbK5RCl/OvuUFAHgKP8huKtE8SGskAajYcR1xAnUM2f1CMEI4GyUfwjDjEqUwhCVCHPTBK4vgjOp1xqXczBplDAgw9QGEdjFnKSNB0njRkmzq6q5umh3Lo7DKAtt+rmNKdvqW5sMy4sI+kjtFgrbYKimYaNFIV/d/cWZilzKM1MtRRpjtJj1AOoB1BRHmbR/xEMwhOuCEITrj75oPwvi/wYyrYDE6juwu2Bwg/+nzFdNr3K3OzgRJTY+Tr7gmWfdHZCr2ljflBPIqbtEF9ZDEVl1hvcCAxcSl1KSARCopUUWYfmD5ln8NQ5OA4Ic4qD+Oody8QZcshEmXCe/rKB8stY8tFfF6e3PxEqBartiK1EhbIeqLmGDZRjV9t/r9xWaGg1XklIMxbp3b9UfUqc6hB1FF8Uw4LIKiqYJXDgW9xZbFZ/CQg8EOCMvg3zcZfFwZcWDDtBuFXXUD8XuHhEotN+Nv9SuNNq+iMfcUnbLRzL2Yq4BRbdwMlkXpf80fqJp3FYCoa73Mt1xWgtBYOCj6iWO5bTg3VBMCKiZIuNhjWd0NcV/BmEPXA9cGp1Djrj44HHFy5cvMGXCGKtWhb63BSMxT+xz/U8Q3pg/8AGqj1G2sf9ytgIJWoa1awdKboah5ZkXmNhtq6gqFMBkJmAEpTbIX1fjplxA90Jkyez2J5EsiiL0xLviGmWLI4CwUmRcGIODhmTwUQQQcrUYtmnBxc7lwzCVidcY4Nfwo6DRn/AMx5YH2jMoPfa+2KlfawyqVnSxm0eAgoJsunKXwukLXH6A/vYLF701oRzHqvT5I+fS2YLWr+5nIZfBdYjcUVVJHbqRwyUiJnrMMtqmQ3t8+SUAD0afaHScKmYpRtgjZG5I3NYycEdQcXw6iy4Zg1DUNfgQ4V+OUYfhcJoX4b6Y/76jyctBo6B4lnivYQw5eiWxu1Zb6hQLFXWfhgdyyGiaq5NSptTPzEgl/0MS17TYo6muWAbHpGANMCADTfCL0eYudFQshFJkCVnq9MFoU2FyUDgUMDWaMSgnmVN6TLYtIXs8ywVEx6nUvTuhVe6M43YwgwealrA6R8RRq4BSaSmFoBAYhAhDBBU7w1GVKgQYzAxuBidSuCEJWJX4E6nmLF4ueJ+5j/AJfUfiys4/73axqy7hlWNC7RyV+4IKtslu6s/uXVGTIxu3Tuo1Ors7IHaFUUBfWXBDRmiEj0q0+CJhi1gWqFgPNw3n3SfFqyZAVG6vFpamiQaAoIeRlzcVKd0WCPqLXzfUBd3BKCoDwRH96RhpkMDAmd+e4egRX1nfhc/QzRwUbh4DqY98dqixY4wckeoHRCVKhFEo4wSo1FhMIQZ5mIQ7hNcMeGhIeoBtY/CU031/1HR9xbTMqcu7NsJpFZeGCSjc5auIwY/pjPXyHuIhvSmceEZwpGjfFg/vEKCpS/mNH0RRV4iLuC3ARLEQeNk4AoGxg/SqOqaYWVQI0s3OkV8Kks88zanD7VNX9oyx5TUYWH0ZPs6lEFES5hFZmy0lE1rgMrzX8HRERi4QTuaRYQhi5eIvFRICtEOwWzcdFvB37x1Ea5tFEGl5SXb8Re6vEOlM7nV1UVijkWr9RJHgUxNKNVjOYuLgPsnaK/pEytgwgvXJNjUMtRNCJblQWI7EggZ/hTK3z0vcKQhne/c8+XyN4c6dHBstgd/wDRh+1IWB0j4gxKxLJtmDMXAaJXhpgsVk0/gGXiHHtMItwnXAxAxGOoMNkIDURAa9mU7e/H78ShO1pS1VyxAlFBUFAf8TMPiHaBAlrwRH0rTotY7yfuKaaooDJdLzv3bKgehoHqJEg258YczXgRIU0aQPETAnY6O10j/wCphElp4z36H+inUaJ/HxPgGiOk9MvnWnBXq99vHwniBUsqoBIE2xCxwXmW3HuCxvA/4SEGDBgmUnHtw+omL4hmEMcCpfsfT/5LulM7i2OpS1LepeQZgT4I8FJblW0rurfr3K1R6aU2vbARwRZhthQ3qHjHlHBT1MHAwYBqs0u/Y78YZbKUdva/s1dJtjjQAWBWFa6bH3nbL7mruk0+zT7iuGFp6JUJqK5UBiLylH8BUOLhxp3AckSBBGOEVsAsrFHZnoHtjpcq+oiGQMsUKZXcJewgwdeHAv2xEprNlOrna1rNRrw4NHy+X3MdwQSRN1KYcwFRZqU6mbiXsxcBkBWo2NR34wwDXu8P040YVwFGV38nnF7GB+vSxNLbWQU6YeI8DSMTPCRd1PXBIAP4RhDWZ3CfOYQuVF3FiKdRS8xmU2KAbY0UMjs8/bDFquOsrjIooA7jfHPFauqgzs/AwpRt07VHtMV4vzCbIsGH0RdxQqZJ6ZcaiqsIi1ESCJdjXxrSk4V4G3UPndE3VoYtK3eoVDIHJC6L8Fv7ZXxAGBUQrXCqz1z1wCAH8h4hCHBYLBmCEaRy8zvwyMB17D+36jdWP8J6TLjoABaszbLUdZB5Wb8e4scGky608qxHqUOSF04F4gNSp1ANVEPBGSwjNJLiUxL1KXBaTZjhu4KkGoOAXC/CZ1/MMHi4TSEqCAyxG44Q21oLdMX8uiEGcKIGaTySpP57oF+AMK3nqYALQfoM/wBjG7ZxjD0NPvfxCdwXMHKpRGsNwyBUrPEoC2JZupX1L+pT1OqohOiYuM6lYjuNphgqKoiVhr+YZSDGKDCViE3lpBrUISz264D5YKF1GYNausUdEv6MPYNtQ9325+Jc5wNXCnzCbJpqOMQJbpL2gCAOYzaVYXXjoISNwkPFAOoPiV9QMPCCaTSdSkpMEOXh5iBX84MGDdwfMIOY5cILlEDQy4hKCxcD6C6O30zTlAPEC8EHxAdIl2ph1CRqUtIQGVYRzFyxLiVkFsKsyg43zPMcR3ACHMMOPwSypjY5szwoQZmn8twgwXDc7/AwiVE0iM3ZCvUGrgIjCQcCMwUyVjhqKWDLmFBhVBUF1AZQgSBiDHBghr8QSJgCBUAfzf/Z";let q=class extends h{constructor(){super(...arguments),this._refImage=c(),this._boundVisibilityHandler=this._visibilityHandler.bind(this),this._mediaLoadedInfo=null}async play(){this._cachedValueController?.startTimer()}async pause(){this._cachedValueController?.stopTimer()}async mute(){}async unmute(){}isMuted(){return!0}async seek(A){}async setControls(A){}isPaused(){return!this._cachedValueController?.hasTimer()??!0}async getScreenshotURL(){return this._cachedValueController?.value??null}_getCameraEntity(){return(this.cameraConfig?.camera_entity||this.cameraConfig?.webrtc_card?.entity)??null}shouldUpdate(A){if(!this.hass||"visible"!==document.visibilityState)return!1;const e=this._getCameraEntity();return!A.has("hass")||1!=A.size||"camera"!==this.imageConfig?.mode||!e||!!l(this.hass,A.get("hass"),[e])&&(this._cachedValueController?.clearValue(),!0)}willUpdate(A){A.has("imageConfig")&&(this._cachedValueController&&this._cachedValueController.removeController(),this.imageConfig&&(this._cachedValueController=new H(this,this.imageConfig.refresh_seconds,this._getImageSource.bind(this),(()=>g(this)),(()=>E(this)))),U(this,this.imageConfig?.layout),A.has("imageConfig")&&this.imageConfig?.zoomable&&import("./zoomer-1857311a.js")),(A.has("cameraConfig")||A.has("view")||"camera"===this.imageConfig?.mode&&!this._getAcceptableState(this._getCameraEntity()))&&this._cachedValueController?.clearValue(),this._cachedValueController?.value||this._cachedValueController?.updateValue()}_getAcceptableState(A){const e=(A?this.hass?.states[A]:null)??null;return this.hass&&this.hass.connected&&e&&Date.now()-Date.parse(e.last_updated)<3e5?e:null}connectedCallback(){super.connectedCallback(),document.addEventListener("visibilitychange",this._boundVisibilityHandler),this._cachedValueController?.startTimer()}disconnectedCallback(){this._cachedValueController?.stopTimer(),document.removeEventListener("visibilitychange",this._boundVisibilityHandler),super.disconnectedCallback()}_visibilityHandler(){this._refImage.value&&("hidden"===document.visibilityState?(this._cachedValueController?.stopTimer(),this._cachedValueController?.clearValue(),this._forceSafeImage()):(this._cachedValueController?.startTimer(),this.requestUpdate()))}_buildImageURL(A){const e=new URL(A,document.baseURI);return e.searchParams.append("_t",String(Date.now())),e.toString()}_getImageSource(){if(this.hass&&"camera"===this.imageConfig?.mode){const A=this._getAcceptableState(this._getCameraEntity());if(A?.attributes.entity_picture)return this._buildImageURL(A.attributes.entity_picture)}return"screensaver"!==this.imageConfig?.mode&&this.imageConfig?.url?this._buildImageURL(this.imageConfig.url):L}_forceSafeImage(A){this._refImage.value&&(this._refImage.value.src=!A&&this.imageConfig?.url?this.imageConfig.url:L)}_useZoomIfRequired(A){return this.imageConfig?.zoomable?n` ${A} `:A}render(){const A=this._cachedValueController?.value;return A?this._useZoomIfRequired(n` {const e=Q(A,{player:this,capabilities:{supportsPause:!!this.imageConfig?.refresh_seconds}});e&&!B(this._mediaLoadedInfo,e)&&(this._mediaLoadedInfo=e,u(this,e))}} + @error=${()=>{"camera"===this.imageConfig?.mode?this._forceSafeImage(!0):"url"===this.imageConfig?.mode&&m(this,w("error.image_load_error"),{context:this.imageConfig})}} + />`):n``}static get styles(){return d("img {\n width: 100%;\n height: 100%;\n display: block;\n object-fit: var(--frigate-card-media-layout-fit, contain);\n object-position: var(--frigate-card-media-layout-position-x, 50%) var(--frigate-card-media-layout-position-y, 50%);\n}")}};I([f({attribute:!1})],q.prototype,"hass",void 0),I([f({attribute:!1})],q.prototype,"view",void 0),I([f({attribute:!1})],q.prototype,"cameraConfig",void 0),I([f({attribute:!1,hasChanged:p})],q.prototype,"imageConfig",void 0),q=I([b("frigate-card-image")],q);export{q as FrigateCardImage}; diff --git a/config/www/community/frigate-hass-card/image-0b99ab11.js.gz b/config/www/community/frigate-hass-card/image-0b99ab11.js.gz new file mode 100644 index 00000000..bac8cde5 Binary files /dev/null and b/config/www/community/frigate-hass-card/image-0b99ab11.js.gz differ diff --git a/config/www/community/frigate-hass-card/index-52dee8bb.js b/config/www/community/frigate-hass-card/index-52dee8bb.js new file mode 100644 index 00000000..ad90dfef --- /dev/null +++ b/config/www/community/frigate-hass-card/index-52dee8bb.js @@ -0,0 +1 @@ +import{bY as t,dg as o,b_ as e,dh as n}from"./card-555679fd.js";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function s(s,u){if(t(2,arguments),!u||"object"!==r(u))return new Date(NaN);var a=u.years?e(u.years):0,y=u.months?e(u.months):0,f=u.weeks?e(u.weeks):0,c=u.days?e(u.days):0,i=u.hours?e(u.hours):0,m=u.minutes?e(u.minutes):0,b=u.seconds?e(u.seconds):0,p=function(o,r){t(2,arguments);var s=e(r);return n(o,-s)}(s,y+12*a),d=function(n,r){t(2,arguments);var s=e(r);return o(n,-s)}(p,c+7*f),l=1e3*(b+60*(m+60*i));return new Date(d.getTime()-l)}export{s}; diff --git a/config/www/community/frigate-hass-card/index-52dee8bb.js.gz b/config/www/community/frigate-hass-card/index-52dee8bb.js.gz new file mode 100644 index 00000000..44c23b39 Binary files /dev/null and b/config/www/community/frigate-hass-card/index-52dee8bb.js.gz differ diff --git a/config/www/community/frigate-hass-card/index-af8cf05c.js b/config/www/community/frigate-hass-card/index-af8cf05c.js new file mode 100644 index 00000000..84f5b2df --- /dev/null +++ b/config/www/community/frigate-hass-card/index-af8cf05c.js @@ -0,0 +1 @@ +import{cr as t,cs as e,ct as n,cu as r,cv as o,cw as u,bY as i,bZ as c,cx as a,b_ as f,cy as l,cz as s,cA as y,cB as p,cC as b,cD as h,cE as v,cF as d,cG as w}from"./card-555679fd.js";function m(t,e){if(null==t)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function O(t){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O(t)}function g(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&j(t,e)}function j(t,e){return j=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},j(t,e)}function _(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=S(t);if(e){var o=S(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(t,e){if(e&&("object"===O(e)||"function"==typeof e))return e;return P(t)}(this,n)}}function P(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function S(t){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},S(t)}function R(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function T(t,e){for(var n=0;n0,o=r?e:1-e;if(o<=50)n=t||100;else{var u=o+50;n=t+100*Math.floor(u/100)-(t>=u%100?100:0)}return r?n:1-n}function ot(t){return t%400==0||t%4==0&&t%100!=0}function ut(t){return ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ut(t)}function it(t,e){for(var n=0;n0}},{key:"set",value:function(t,e,n){var r=t.getUTCFullYear();if(n.isTwoDigitYear){var o=rt(n.year,r);return t.setUTCFullYear(o,0,1),t.setUTCHours(0,0,0,0),t}var u="era"in e&&1!==e.era?1-n.year:n.year;return t.setUTCFullYear(u,0,1),t.setUTCHours(0,0,0,0),t}}])&&it(e.prototype,n),r&&it(e,r),u}();function pt(t){return pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pt(t)}function bt(t,e){for(var n=0;n0}},{key:"set",value:function(t,e,n,u){var i=r(t,u);if(n.isTwoDigitYear){var c=rt(n.year,i);return t.setUTCFullYear(c,0,u.firstWeekContainsDate),t.setUTCHours(0,0,0,0),o(t,u)}var a="era"in e&&1!==e.era?1-n.year:n.year;return t.setUTCFullYear(a,0,u.firstWeekContainsDate),t.setUTCHours(0,0,0,0),o(t,u)}}])&&bt(e.prototype,n),u&&bt(e,u),c}();function gt(t){return gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gt(t)}function jt(t,e){for(var n=0;n=1&&e<=4}},{key:"set",value:function(t,e,n){return t.setUTCMonth(3*(n-1),1),t.setUTCHours(0,0,0,0),t}}])&&Ht(e.prototype,n),r&&Ht(e,r),u}();function Ft(t){return Ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ft(t)}function Xt(t,e){for(var n=0;n=1&&e<=4}},{key:"set",value:function(t,e,n){return t.setUTCMonth(3*(n-1),1),t.setUTCHours(0,0,0,0),t}}])&&Xt(e.prototype,n),r&&Xt(e,r),u}();function Jt(t){return Jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jt(t)}function te(t,e){for(var n=0;n=0&&e<=11}},{key:"set",value:function(t,e,n){return t.setUTCMonth(n,1),t.setUTCHours(0,0,0,0),t}}])&&te(e.prototype,n),r&&te(e,r),u}();function ce(t){return ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ce(t)}function ae(t,e){for(var n=0;n=0&&e<=11}},{key:"set",value:function(t,e,n){return t.setUTCMonth(n,1),t.setUTCHours(0,0,0,0),t}}])&&ae(e.prototype,n),r&&ae(e,r),u}();function he(t){return he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},he(t)}function ve(t,e){for(var n=0;n=1&&e<=53}},{key:"set",value:function(t,e,n,r){return o(function(t,e,n){i(2,arguments);var r=c(t),o=f(e),u=a(r,n)-o;return r.setUTCDate(r.getUTCDate()-7*u),r}(t,n,r),r)}}],n&&ve(e.prototype,n),r&&ve(e,r),l}();function _e(t){return _e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_e(t)}function Pe(t,e){for(var n=0;n=1&&e<=53}},{key:"set",value:function(t,e,n){return u(function(t,e){i(2,arguments);var n=c(t),r=f(e),o=l(n)-r;return n.setUTCDate(n.getUTCDate()-7*o),n}(t,n))}}],n&&Pe(e.prototype,n),r&&Pe(e,r),a}();function Ce(t){return Ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ce(t)}function Be(t,e){for(var n=0;n=1&&e<=Ye[r]:e>=1&&e<=He[r]}},{key:"set",value:function(t,e,n){return t.setUTCDate(n),t.setUTCHours(0,0,0,0),t}}])&&Be(e.prototype,n),r&&Be(e,r),u}();function Ie(t){return Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ie(t)}function Le(t,e){for(var n=0;n=1&&e<=366:e>=1&&e<=365}},{key:"set",value:function(t,e,n){return t.setUTCMonth(0,n),t.setUTCHours(0,0,0,0),t}}])&&Le(e.prototype,n),r&&Le(e,r),u}();function Ke(t,e,n){var r,o,u,a,l,y,p,b;i(2,arguments);var h=s(),v=f(null!==(r=null!==(o=null!==(u=null!==(a=null==n?void 0:n.weekStartsOn)&&void 0!==a?a:null==n||null===(l=n.locale)||void 0===l||null===(y=l.options)||void 0===y?void 0:y.weekStartsOn)&&void 0!==u?u:h.weekStartsOn)&&void 0!==o?o:null===(p=h.locale)||void 0===p||null===(b=p.options)||void 0===b?void 0:b.weekStartsOn)&&void 0!==r?r:0);if(!(v>=0&&v<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=c(t),w=f(e),m=((w%7+7)%7=0&&e<=6}},{key:"set",value:function(t,e,n,r){return(t=Ke(t,n,r)).setUTCHours(0,0,0,0),t}}])&&$e(e.prototype,n),r&&$e(e,r),u}();function on(t){return on="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},on(t)}function un(t,e){for(var n=0;n=0&&e<=6}},{key:"set",value:function(t,e,n,r){return(t=Ke(t,n,r)).setUTCHours(0,0,0,0),t}}])&&un(e.prototype,n),r&&un(e,r),u}();function pn(t){return pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pn(t)}function bn(t,e){for(var n=0;n=0&&e<=6}},{key:"set",value:function(t,e,n,r){return(t=Ke(t,n,r)).setUTCHours(0,0,0,0),t}}])&&bn(e.prototype,n),r&&bn(e,r),u}();function gn(t){return gn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gn(t)}function jn(t,e){for(var n=0;n=1&&e<=7}},{key:"set",value:function(t,e,n){return t=function(t,e){i(2,arguments);var n=f(e);n%7==0&&(n-=7);var r=c(t),o=((n%7+7)%7<1?7:0)+n-r.getUTCDay();return r.setUTCDate(r.getUTCDate()+o),r}(t,n),t.setUTCHours(0,0,0,0),t}}],n&&jn(e.prototype,n),r&&jn(e,r),u}();function xn(t){return xn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xn(t)}function En(t,e){for(var n=0;n=1&&e<=12}},{key:"set",value:function(t,e,n){var r=t.getUTCHours()>=12;return r&&n<12?t.setUTCHours(n+12,0,0,0):r||12!==n?t.setUTCHours(n,0,0,0):t.setUTCHours(0,0,0,0),t}}])&&tr(e.prototype,n),r&&tr(e,r),u}();function cr(t){return cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cr(t)}function ar(t,e){for(var n=0;n=0&&e<=23}},{key:"set",value:function(t,e,n){return t.setUTCHours(n,0,0,0),t}}])&&ar(e.prototype,n),r&&ar(e,r),u}();function hr(t){return hr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hr(t)}function vr(t,e){for(var n=0;n=0&&e<=11}},{key:"set",value:function(t,e,n){return t.getUTCHours()>=12&&n<12?t.setUTCHours(n+12,0,0,0):t.setUTCHours(n,0,0,0),t}}])&&vr(e.prototype,n),r&&vr(e,r),u}();function _r(t){return _r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_r(t)}function Pr(t,e){for(var n=0;n=1&&e<=24}},{key:"set",value:function(t,e,n){var r=n<=24?n%24:n;return t.setUTCHours(r,0,0,0),t}}])&&Pr(e.prototype,n),r&&Pr(e,r),u}();function Cr(t){return Cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cr(t)}function Br(t,e){for(var n=0;n=0&&e<=59}},{key:"set",value:function(t,e,n){return t.setUTCMinutes(n,0,0),t}}])&&Br(e.prototype,n),r&&Br(e,r),u}();function Yr(t){return Yr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yr(t)}function Nr(t,e){for(var n=0;n=0&&e<=59}},{key:"set",value:function(t,e,n){return t.setUTCSeconds(n,0),t}}])&&Nr(e.prototype,n),r&&Nr(e,r),u}();function Wr(t){return Wr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wr(t)}function Zr(t,e){for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,i=!0,c=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return i=t.done,t},e:function(t){c=!0,u=t},f:function(){try{i||null==n.return||n.return()}finally{if(c)throw u}}}}function qo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=1&&Y<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var N=f(null!==(R=null!==(T=null!==(k=null!==(x=null==r?void 0:r.weekStartsOn)&&void 0!==x?x:null==r||null===(E=r.locale)||void 0===E||null===(C=E.options)||void 0===C?void 0:C.weekStartsOn)&&void 0!==k?k:q.weekStartsOn)&&void 0!==T?T:null===(B=q.locale)||void 0===B||null===(U=B.options)||void 0===U?void 0:U.weekStartsOn)&&void 0!==R?R:0);if(!(N>=0&&N<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(""===M)return""===A?c(n):new Date(NaN);var I,L={firstWeekContainsDate:Y,weekStartsOn:N,locale:H},Q=[new D],G=M.match(Yo).map((function(t){var e=t[0];return e in p?(0,p[e])(t,H.formatLong):t})).join("").match(Ho),F=[],X=Mo(G);try{var W=function(){var e=I.value;null!=r&&r.useAdditionalWeekYearTokens||!b(e)||h(e,M,t),null!=r&&r.useAdditionalDayOfYearTokens||!v(e)||h(e,M,t);var n=e[0],o=Uo[n];if(o){var u=o.incompatibleTokens;if(Array.isArray(u)){var i=F.find((function(t){return u.includes(t.token)||t.token===n}));if(i)throw new RangeError("The format string mustn't contain `".concat(i.fullToken,"` and `").concat(e,"` at the same time"))}else if("*"===o.incompatibleTokens&&F.length>0)throw new RangeError("The format string mustn't contain `".concat(e,"` and any other token at the same time"));F.push({token:n,fullToken:e});var c=o.run(A,e,H.match,L);if(!c)return{v:new Date(NaN)};Q.push(c.setter),A=c.rest}else{if(n.match(Qo))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");if("''"===e?e="'":"'"===n&&(e=e.match(No)[1].replace(Io,"'")),0!==A.indexOf(e))return{v:new Date(NaN)};A=A.slice(e.length)}};for(X.s();!(I=X.n()).done;){var Z=W();if("object"===Ao(Z))return Z.v}}catch(t){X.e(t)}finally{X.f()}if(A.length>0&&Lo.test(A))return new Date(NaN);var K=Q.map((function(t){return t.priority})).sort((function(t,e){return e-t})).filter((function(t,e,n){return n.indexOf(t)===e})).map((function(t){return Q.filter((function(e){return e.priority===t})).sort((function(t,e){return e.subPriority-t.subPriority}))})).map((function(t){return t[0]})),V=c(n);if(isNaN(V.getTime()))return new Date(NaN);var $,z=d(V,w(V)),J={},tt=Mo(K);try{for(tt.s();!($=tt.n()).done;){var et=$.value;if(!et.validate(z,L))return new Date(NaN);var nt=et.set(z,J,L);Array.isArray(nt)?(z=nt[0],m(J,nt[1])):z=nt}}catch(t){tt.e(t)}finally{tt.f()}return z}export{Go as p}; diff --git a/config/www/community/frigate-hass-card/index-af8cf05c.js.gz b/config/www/community/frigate-hass-card/index-af8cf05c.js.gz new file mode 100644 index 00000000..740aa098 Binary files /dev/null and b/config/www/community/frigate-hass-card/index-af8cf05c.js.gz differ diff --git a/config/www/community/frigate-hass-card/lang-it-0e2e946c.js b/config/www/community/frigate-hass-card/lang-it-0e2e946c.js new file mode 100644 index 00000000..cce710f3 --- /dev/null +++ b/config/www/community/frigate-hass-card/lang-it-0e2e946c.js @@ -0,0 +1 @@ +var e={frigate_card:"Frigate card",frigate_card_description:"Una scheda Lovelace per l'uso con Frigate",live:"Live",no_media:"Nessun contenuto multimediale da visualizzare",recordings:"Registrazioni",version:"Versione"},i={cameras:{camera_entity:"Entità della telecamera",dependencies:{all_cameras:"Mostra eventi per tutte le telecamere con questa telecamera",cameras:"Mostra eventi per telecamere specifiche con questa telecamera",editor_label:"Opzioni di dipendenza"},engines:{editor_label:"Opzioni del motore della fotocamera"},frigate:{camera_name:"Nome della telecamera frigate (autodificato dall'entità)",client_id:"ID client Frigate (per > 1 Frigate server)",editor_label:"Frigate Opzione",labels:"Etichette per fregate/filtri per oggetti",url:"Frigate URL del server",zones:"Frigate Zone"},go2rtc:{editor_label:"Opzioni go2rtc",modes:{editor_label:"Modalità go2rtc",mjpeg:"JPEG animato (MJPEG)",mp4:"MPEG-4 (MP4)",mse:"Estensioni sorgente multimediale (MSE)",webrtc:"Comunicazione Web in tempo reale (WebRTC)"},stream:"nome del flusso go2rtc"},hide:"Nascondi la videocamera dall'interfaccia utente",icon:"Icona per questa telecamera (Autoidentificato dall'entità)",id:"ID univoco per questa telecamera in questa carta",image:{editor_label:"Opzioni immagine",refresh_seconds:"Numero di secondi dopo i quali aggiornare l'immagine live (0=mai)",url:"URL dell'immagine da utilizzare al posto dell'istantanea dell'entità fotocamera"},live_provider:"Provider di visualizzazione dal vivo per questa telecamera",live_provider_options:{editor_label:"Opzioni del fornitore in tempo reale"},live_providers:{auto:"Automatica",go2rtc:"go2rtc",ha:"Streaming video di Home Assistant (ovvero HLS, LL-HLS, WebRTC tramite HA)",image:"Immagini Home Assistant",jsmpeg:"JSMpeg","webrtc-card":"Scheda WebRTC (ovvero la scheda WebRTC di Alexxit)"},motioneye:{editor_label:"Opzioni di MotionEye",images:{directory_pattern:"Modello di directory delle immagini",file_pattern:"Modello di file di immagini"},movies:{directory_pattern:"Modello di directory dei film",file_pattern:"Modello di file di film"},url:"URL dell'interfaccia utente di MotionEye"},title:"Titolo per questa telecamera (Autoidentificato dall'entità)",triggers:{editor_label:"Trigger Opzioni",entities:"Trigger da altre entità",motion:"Trigger rilevando automaticamente dal sensore di movimento",occupancy:"Attivare rilevando automatico tramite il sensore di presenza"},webrtc_card:{editor_label:"Opzioni della scheda WebRTC",entity:"Entità della telecamera della scheda WebRTC (non una telecamera Frigate)",url:"URL della telecamera della scheda WebRTC"}},common:{controls:{builtin:"",filter:{editor_label:"Filtro multimediale",mode:"Modalità filtro",modes:{left:"Filtro multimediale in un cassetto a sinistra",none:"Nessun filtro multimediale",right:"Filtro multimediale in un cassetto a destra"}},next_previous:{editor_label:"Successivo e precedente",size:"Successiva e Precedenti dimensioni di controllo nei pixel",style:"Stile di controllo successivo e precedente",styles:{chevrons:"Chevrons",icons:"Icone",none:"Nessuno",thumbnails:"Miniature"}},thumbnails:{editor_label:"Miniature",media:"Se mostrare miniature di clip o istantanee",medias:{clips:"Miniature di clip",snapshots:"Miniature istantanee"},mode:"Modalità miniatura",modes:{above:"Miniature sopra",below:"Miniature sotto",left:"Miniature in un cassetto a sinistra",none:"Nessuna miniatura",right:"Miniature in un cassetto a destra"},show_details:"Mostra i dettagli con le miniature",show_download_control:"Mostra il controllo del download sulle miniature",show_favorite_control:"Mostra il controllo preferito sulle miniature",show_timeline_control:"Mostra il controllo della sequenza temporale sulle miniature",size:"Dimensione delle miniature in pixel"},timeline:{editor_label:"Mini Cronologia",mode:"Modalità",modes:{above:"sopra",below:"sotto",none:"sessuna"}},title:{duration_seconds:"Secondi per visualizzare il titolo popup (0 = per sempre)",editor_label:"Controlli titolo popup",mode:"Modalità di visualizzazione del titolo",modes:{none:"Nessuna visualizzazione del titolo","popup-bottom-left":"Popup in basso a sinistra","popup-bottom-right":"Popup in basso a destra","popup-top-left":"Popup in alto a sinistra","popup-top-right":"Popup in alto a destra"}}},layout:{fit:"Adatta al layout",fits:{contain:"Il supporto è contenuto/in cassetta delle lettere",cover:"Il supporto si espande proporzionalmente per coprire la scheda",fill:"Il supporto viene allungato per riempire la scheda"},position:{x:"Percentuale di posizionamento orizzontale",y:"Percentuale di posizionamento verticale"}},media_action_conditions:{all:"Tutte le opportunità",hidden:"Sul browser/nascondere le schede",never:"Mai",selected:"Sulla selezione",unselected:"Sulla non selezione",visible:"Sul browser/visibilità della scheda"},timeline:{clustering_threshold:"Il conteggio degli eventi in cui sono raggruppati (0 = nessun clustering)",media:"I media vengono visualizzati la sequenza temporale",medias:{all:"Tutti i tipi di media",clips:"Clip",snapshots:"Istantanee"},show_recordings:"Mostra registrazioni",style:"",styles:{ribbon:"",stack:""},window_seconds:"La lunghezza predefinita della vista della sequenza temporale in secondi"}},dimensions:{aspect_ratio:"Proporzioni predefinite (ad es. '16:9')",aspect_ratio_mode:"Modalità proporzioni",aspect_ratio_modes:{dynamic:"Le proporzioni si adattano ai media",static:"Proporzioni statiche",unconstrained:"Proporzioni non vincolate"},max_height:"",min_height:""},image:{layout:"Disposizione dell'immagine",mode:"Modalità Visualizza immagine",modes:{camera:"Istantanea della telecamera di Home Assistant dell'entità telecamera",screensaver:"Logo Frigate incorporato",url:"Immagine arbitraria specificata dall'URL"},refresh_seconds:"Numero di secondi dopo i quali aggiornare (0 = mai)",url:"URL di immagine statica per la vista dell'immagine",zoomable:""},live:{auto_mute:"Muta automaticamente le telecamere in diretta",auto_pause:"Metti in pausa automaticamente le telecamere in diretta",auto_play:"Gioca automaticamente le telecamere dal vivo",auto_unmute:"Riattiva automaticamente l'audio delle telecamere live",controls:{editor_label:"Controlli dal vivo"},draggable:"Il Visualizzatore eventi può essere trascinato oppure puoi scorrere",layout:"Disposizione dal vivo",lazy_load:"Le telecamere dal vivo sono pigramente cariche",lazy_unload:"Le telecamere dal vivo sono pigramente non caricate",microphone:{always_connected:"",disconnect_seconds:"",editor_label:"",enabled:""},preload:"Precarica Live View in background",show_image_during_load:"Mostra un'immagine fissa durante il caricamento del live streaming",transition_effect:"Effetto di transizione della telecamera dal vivo",zoomable:""},media_viewer:{auto_mute:"Muta automaticamente i media",auto_pause:"Metti in Pausa automaticamente i media",auto_play:"Riproduci automaticamente i contenuti multimediali",auto_unmute:"Riattiva automaticamente i contenuti multimediali",controls:{editor_label:"Controlli di visualizzatore multimediale"},draggable:"Il visualizzatore multimediale può essere trascinato oppure può scorrere",layout:"Layout del visualizzatore multimediale",lazy_load:"Il media Viewer viene caricato pigramente nel carosello",transition_effect:"Effetto di transizione del visualizzatore multimediale",transition_effects:{none:"Nessuna transizione",slide:"Transizione diapositiva"},zoomable:""},menu:{alignment:"Allineamento dei menu",alignments:{bottom:"Allineato al fondo",left:"Allineato a sinistra",right:"Allineato a destra",top:"Allineato in cima"},button_size:"Dimensione del pulsante menu in pixel",buttons:{alignment:"Allineamento dei pulsanti",alignments:{matching:"Corrispondenza con l'allineamento del menu",opposing:"Contrastare l'allineamento del menu"},camera_ui:"Interfaccia utente della fotocamera",cameras:"Telecamere",clips:"Clip",download:"Download",enabled:"Pulsante abilitato",expand:"Espandere",frigate:"Frigate menu / Visualizzazione predefinita",fullscreen:"A schermo intero",icon:"Icona",image:"Immagine",live:"Abitare",media_player:"Invia a Media Player",mute:"",play:"",priority:"Priorità",screenshot:"",snapshots:"Istantanee",substreams:"Flusso/i secondario/i",timeline:"Timeline",type:"",types:{momentary:"",toggle:""}},position:"Posizione del menu",positions:{bottom:"Posizionato sul fondo",left:"Posizionato a sinistra",right:"Posizionato a destra",top:"Posizionato in alto"},style:"Stile menu",styles:{hidden:"Menu nascosto",hover:"Menu al passaggio del mouse",none:"Nessun menu",outside:"Menu esterno",overlay:"Menu di overlay"}},overrides:{info:"Questa configurazione della scheda ha specificato manualmente le sostituzioni configurate che possono sostituire i valori mostrati nell'editor visivo, consultare l'editor di codice per visualizzare/modificare queste sostituzioni"},performance:{features:{animated_progress_indicator:"Indicatore di avanzamento animato",editor_label:"Opzioni funzionalità",media_chunk_size:"Dimensione del blocco multimediale"},profile:"Profilo delle prestazioni",profiles:{high:"Prestazioni alte",low:"Prestazioni basse"},style:{border_radius:"Curve",box_shadow:"Ombre",editor_label:"Opzione di stile"},warning:"Questa scheda è in modalità basso profilo, quindi le impostazioni predefinite sono state modificate per ottimizzare le prestazioni"},view:{camera_select:"Visualizza per le telecamere appena selezionate",dark_mode:"Tema scuro",dark_modes:{auto:"auto",off:"Off",on:"On"},default:"Visualizzazione predefinita",scan:{enabled:"Modalità di scansione abilitata",scan_mode:"Modalità di scansione",show_trigger_status:"Mostra bordo pulsante quando attivato",untrigger_reset:"Reset the view to default after untrigger",untrigger_seconds:"Reimposta la vista ai valori predefiniti dopo aver annullato l'attivazione"},timeout_seconds:"Ripristina la vista predefinita x secondi dopo l'azione dell'utente (0 = mai)",update_cycle_camera:"Scorri le telecamere quando si aggiorna la visualizzazione predefinita",update_force:"Aggiornamenti della scheda forza (ignora l'interazione dell'utente)",update_seconds:"Aggiorna la visualizzazione predefinita ogni x secondi (0 = mai)",views:{clip:"Clip più recente",clips:"Galleria delle clip",current:"Vista corrente",image:"Immagine statica",live:"Dal vivo",snapshot:"Snapshot più recente",snapshots:"Galleria delle istantanee",timeline:"Vista della timeline"}}},a={add_new_camera:"Aggiungi nuova telecamera",button:"Pulsante",camera:"Telecamera",cameras:"Telecamere",cameras_secondary:"Quali telecamere visualizzare su questa card",delete:"Elimina",dimensions:"Dimensioni",dimensions_secondary:"Dimensioni e opzioni di forma",image:"Immagine",image_secondary:"Opzioni di visualizzazione dell'immagine statica",live:"Live",live_secondary:"Opzioni di visualizzazione della telecamera live",media_gallery:"Galleria multimediale",media_gallery_secondary:"Opzioni della galleria multimediale",media_viewer:"Visualizzatore dei media",media_viewer_secondary:"Visualizzatore per supporti statici (clip, istantanee o registrazioni)",menu:"Menu",menu_secondary:"Opzioni di aspetto e funzionalità del menu",move_down:"Sposta verso il basso",move_up:"Sposta verso l'alto",overrides:"La sovrascrittura è attiva",overrides_secondary:"Rilevate sovrascritture della configurazione dinamica",timeline:"Timeline",timeline_secondary:"Opzioni della timeline degli eventi",upgrade:"Aggiornamento",upgrade_available:"È disponibile un aggiornamento della configurazione della scheda automatica",view:"Visualizzazione",view_secondary:"Cosa dovrebbe mostrare la carta e come mostrarla"},o={ptz:{down:"Giù",home:"Home",left:"Sinistra",right:"Destra",up:"Su",zoom_in:"Ingrandire",zoom_out:"Zoom indietro"}},t={could_not_render_elements:"Impossibile renderizzare gli elementi dell'immagine",could_not_resolve:"Impossibile risolvere l'URL dei media",diagnostics:"Diagnostica delle carte.Si prega di rivedere per informazioni riservate prima di condividere",download_no_media:"Nessun media da scaricare",download_sign_failed:"Impossibile firmare URL multimediale per il download",duplicate_camera_id:"Duplicato ID dellla telecamera Frigate, utilizzare il parametro 'ID' per identificare in modo univoco le telecamere",empty_response:"Ricevuto risposta vuota da Home Assistant per la richiesta",failed_response:"Impossibile ricevere risposta da Home Assistant per la richiesta",failed_retain:"Impossibile conservare l'evento",failed_sign:"Impossibile firmare l'URL ad Home Assistant",image_load_error:"L'immagine non può essere caricata",invalid_configuration:"Configurazione non valida",invalid_configuration_no_hint:"Nessun suggerimento di posizione disponibile (tipo difettoso o mancante?)",invalid_elements_config:"Configurazione degli elementi di immagine non valida",invalid_response:"Ricevuta una risposta non valida da Home Assistant per la richiesta",jsmpeg_no_player:"Impossibile avviare JSMPEG Player",live_camera_no_endpoint:"Impossibile ottenere l'endpoint della videocamera per questo provider live (configurazione incompleta?)",live_camera_not_found:"La telecamera configurata non è stata trovata",live_camera_unavailable:"Telecamera non disponibile",no_camera_engine:"Impossibile determinare il motore adatto per la fotocamera",no_camera_entity:"Impossibile trovare l'entità fotocamera",no_camera_entity_for_triggers:"È necessaria un'entità telecamera per rilevare automaticamente i trigger",no_camera_id:"Impossibile determinare l'ID della telecamera , potrebbe essere necessario impostare manualmente il parametro 'ID'",no_camera_name:"Impossibile determinare un nome della telecamera in Frigate, si prega di specificare 'camera_enty' o 'camera_name'",no_live_camera:"Il parametro fotocamera_enty deve essere impostato e valido per questo provider live",no_visible_cameras:"Nessuna telecamera visibile trovata, è necessario configurare almeno una telecamera non nascosta",reconnecting:"Riconnessione",timeline_no_cameras:"Nessuna telecamera damostrare in Frigate nella timeline",troubleshooting:"Controllare la risoluzione dei problemi",too_many_automations:"",unknown:"Errore sconosciuto",upgrade_available:"È disponibile un aggiornamento di configurazione della scheda automatizzato, visitare l'editor di schede visive",webrtc_card_reported_error:"La scheda WebRTC ha riportato un errore",webrtc_card_waiting:"Aspettando che la scheda WebRTC si carichi ..."},n={camera:"Camera",duration:"Durata",in_progress:"In corso",score:"Punteggio",seek:"Cercare",start:"Avvia",what:"Che cosa",where:"Dove"},r={all:"Tutto",camera:"Telecamera",favorite:"Preferito",media_type:"Tipo di supporto",media_types:{clips:"Clip",recordings:"Registrazioni",snapshots:"Istantanee"},not_favorite:"Non preferito",select_camera:"Seleziona fotocamera...",select_favorite:"Seleziona preferito...",select_media_type:"Seleziona il tipo di supporto...",select_what:"Seleziona cosa...",select_when:"Seleziona quando...",select_where:"Seleziona dove...",tag:"Tag",what:"Che cosa",when:"Quando",whens:{past_month:"Mese scorso",past_week:"Settimana scorso",today:"Oggi",yesterday:"Ieri"},where:"Dove"},l={camera:"Camera",duration:"Durata",events:"Eventi",in_progress:"In corso",seek:"Cercare",start:"Inizio"},s={no_thumbnail:"Nessuna miniatura disponibile",retain_indefinitely:"L'evento sarà mantenuto indefinitamente",timeline:"Vedi evento nella timeline"},d={pan_behavior:{pan:"",seek:"","seek-in-media":""},select_date:"Scegli la data"},m={common:e,config:i,editor:a,elements:o,error:t,event:n,media_filter:r,recording:l,thumbnail:s,timeline:d};export{e as common,i as config,m as default,a as editor,o as elements,t as error,n as event,r as media_filter,l as recording,s as thumbnail,d as timeline}; diff --git a/config/www/community/frigate-hass-card/lang-it-0e2e946c.js.gz b/config/www/community/frigate-hass-card/lang-it-0e2e946c.js.gz new file mode 100644 index 00000000..21178311 Binary files /dev/null and b/config/www/community/frigate-hass-card/lang-it-0e2e946c.js.gz differ diff --git a/config/www/community/frigate-hass-card/lang-pt-BR-1648942c.js b/config/www/community/frigate-hass-card/lang-pt-BR-1648942c.js new file mode 100644 index 00000000..560094c1 --- /dev/null +++ b/config/www/community/frigate-hass-card/lang-pt-BR-1648942c.js @@ -0,0 +1 @@ +var e={frigate_card:"Cartão Frigate",frigate_card_description:"Um cartão da Lovelace para usar com Frigate",live:"Ao Vivo",no_media:"Nenhuma mídia para exibir",recordings:"Gravações",version:"Versão"},a={cameras:{camera_entity:"Entidade da Câmera",dependencies:{all_cameras:"Mostrar eventos para todas as câmeras nesta câmera",cameras:"Mostrar eventos para câmeras específicas nesta câmera",editor_label:"Opções de dependência"},engines:{editor_label:"Opções do motor da câmera"},frigate:{camera_name:"Nome da câmera do Frigate (detectado automaticamente pela entidade)",client_id:"ID do cliente do Frigate (para >1 servidor Frigate)",editor_label:"Opções do Frigate",labels:"Rótulos do Frigate/filtros de objetos",url:"URL do servidor Frigate",zones:"Zonas do Frigate"},go2rtc:{editor_label:"Opções do go2rtc",modes:{editor_label:"Modos do go2rtc",mjpeg:"Motion JPEG (MJPEG)",mp4:"MPEG-4 (MP4)",mse:"Media Source Extensions (MSE)",webrtc:"Web Real-Time Communication (WebRTC)"},stream:"Nome do stream do go2rtc"},hide:"Ocultar câmera da interface do usuário",icon:"Ícone para esta câmera (detectado automaticamente pela entidade)",id:"ID exclusivo para esta câmera nesse cartão",image:{editor_label:"Opções de Imagem",refresh_seconds:"Número de segundos após os quais atualizar a imagem ao vivo (0=nunca)",url:"URL da imagem para usar em vez do instantâneo da entidade da câmera"},live_provider:"Provedor de visualização ao vivo para esta câmera",live_provider_options:{editor_label:"Opções do provedor de visualização ao vivo"},live_providers:{auto:"Automatico",go2rtc:"go2rtc",ha:"Stream de vídeo do Home Assistant (ou seja, HLS, LL-HLS, WebRTC via HA)",image:"Imagens do Home Assistant",jsmpeg:"JSMpeg","webrtc-card":"Cartão WebRTC (de @AlexxIT)"},motioneye:{editor_label:"Opções do MotionEye",images:{directory_pattern:"Padrão de diretório de imagens",file_pattern:"Padrão de arquivo de imagens"},movies:{directory_pattern:"Padrão de diretório de filmes",file_pattern:"Padrão de arquivo de filmes"},url:"URL da interface de usuário do MotionEye"},title:"Título para esta câmera (detectado automaticamente pela entidade)",triggers:{editor_label:"Opções de acionamento",entities:"Acionar a partir de outras entidades",motion:"Acionar detectando automaticamente o sensor de movimento",occupancy:"Acionar detectando automaticamente o sensor de ocupação"},webrtc_card:{editor_label:"Opções do cartão WebRTC",entity:"Entidade de câmera de cartão WebRTC (não é uma câmera Frigate)",url:"URL da câmera do cartão WebRTC"}},common:{controls:{builtin:"",filter:{editor_label:"Filtro de Mídia",mode:"Modo do filtro",modes:{left:"Filtro de mídia em uma gaveta à esquerda",none:"Sem filtro de mídia",right:"Filtro de mídia em uma gaveta à direita"}},next_previous:{editor_label:"Próximo",size:"Tamanho de controle próximo e anterior",style:"Estilo do controle próximo e anterior",styles:{chevrons:"Setas",icons:"Ícones",none:"Nenhum",thumbnails:"Miniaturas"}},thumbnails:{editor_label:"Miniaturas",media:"Se deve mostrar miniaturas de clipes ou snapshots",medias:{clips:"Miniaturas de clipes",snapshots:"Miniaturas de Snapshots"},mode:"Modo de miniaturas",modes:{above:"Miniaturas acima da mídia",below:"Miniaturas abaixo da mídia",left:"Miniaturas em uma gaveta à esquerda",none:"Sem miniaturas",right:"Miniaturas em uma gaveta à direita"},show_details:"Mostrar detalhes com miniaturas",show_download_control:"Mostrar controle de download nas miniaturas",show_favorite_control:"Mostrar controle de favorito nas miniaturas",show_timeline_control:"Mostrar controle da linha do tempo nas miniaturas",size:"Tamanho das miniaturas em pixels"},timeline:{editor_label:"Controles da linha do tempo",mode:"Modo",modes:{above:"Acima",below:"Abaixo",none:"Nenhum"}},title:{duration_seconds:"Segundos para exibir o pop-up (0 = para sempre)",editor_label:"Controles do pop-up de título",mode:"Modo de exibição de título de mídia",modes:{none:"Sem exibição de título","popup-bottom-left":"Pop-up no canto inferior esquerdo","popup-bottom-right":"Pop-up no canto inferior direito","popup-top-left":"Pop-up no canto superior esquerdo","popup-top-right":"Pop-up no canto superior direito"}}},layout:{fit:"Ajuste de layout",fits:{contain:"A mídia é contida no cartão",cover:"A mídia se expande proporcionalmente para cobrir o cartão",fill:"A mídia é esticada para preencher o cartão"},position:{x:"Porcentagem do posicionamento horizontal",y:"Porcentagem do posicionamento vertical"}},media_action_conditions:{all:"Todas as oportunidades",hidden:"Ao ocultar o navegador/aba",never:"Nunca",selected:"Ao selecionar",unselected:"Ao desselecionar",visible:"Ao mostrar o navegador/aba"},timeline:{clustering_threshold:"A contagem de eventos nos quais eles são agrupados (0 = sem agrupamento)",media:"A mídia que a linha do tempo exibe",medias:{all:"Todos os tipos de mídia",clips:"Clipes",snapshots:"Instantâneos"},show_recordings:"Mostrar gravações",style:"",styles:{ribbon:"",stack:""},window_seconds:"A duração padrão da visualização da linha do tempo em segundos"}},dimensions:{aspect_ratio:"Proporção padrão (e.g. '16:9')",aspect_ratio_mode:"Modo de proporção",aspect_ratio_modes:{dynamic:"A proporção se ajusta à mídia",static:"Proporção estática",unconstrained:"Proporção irrestrita"},max_height:"",min_height:""},image:{layout:"Layout da imagem",mode:"Modo de visualização de imagem",modes:{camera:"Instantâneo da câmera do Home Assistant, da entidade de câmera",screensaver:"Logo Frigate embutido",url:"Imagem arbitrária especificada por URL"},refresh_seconds:"Número de segundos após o qual atualizar (0 = nunca)",url:"Imagem arbitrária especificada por URL",zoomable:""},live:{auto_mute:"Silenciar câmeras ao vivo automaticamente",auto_pause:"Pausar câmeras ao vivo automaticamente",auto_play:"Reproduzir câmeras ao vivo automaticamente",auto_unmute:"Ativar automaticamente o som das câmeras ao vivo",controls:{editor_label:"Controles da visualização ao vivo"},draggable:"A visualização ao vivo das câmeras pode ser arrastada/deslizada",layout:"Layout dinâmico",lazy_load:"As câmeras ao vivo são carregadas lentamente",lazy_unload:"As câmeras ao vivo são descarregadas preguiçosamente",microphone:{always_connected:"",disconnect_seconds:"",editor_label:"",enabled:""},preload:"Pré-carregar a visualização ao vivo em segundo plano",show_image_during_load:"Mostrar imagem estática enquanto a transmissão ao vivo está carregando",transition_effect:"Efeito de transição de câmera ao vivo",zoomable:""},media_viewer:{auto_mute:"Silenciar mídia automaticamente",auto_pause:"Pausar mídia automaticamente",auto_play:"Reproduzir mídia automaticamente",auto_unmute:"Ativar mídia automaticamente",controls:{editor_label:"Controles do visualizador de mídia"},draggable:"Visualizador de eventos pode ser arrastado/deslizado",layout:"Layout do visualizador de mídia",lazy_load:"A mídia do Visualizador de eventos é carregada lentamente no carrossel",snapshot_click_plays_clip:"Clicar em um instantâneo reproduz um clipe relacionado",transition_effect:"Efeito de transição do Visualizador de eventos",transition_effects:{none:"Sem transição",slide:"Transição de slides"},zoomable:""},menu:{alignment:"Alinhamento do menu",alignments:{bottom:"Alinhado à parte inferior",left:"Alinhado à esquerda",right:"Alinhado à direita",top:"Alinhado ao topo"},button_size:"Tamanho do botão de menu (e.g. '40px')",buttons:{alignment:"Alinhamento do botão",alignments:{matching:"Mesmo alinhamento do menu",opposing:"Opor-se ao alinhamento do menu"},camera_ui:"Interface de usuário da câmera",cameras:"Selecionar câmera",clips:"Clipes",download:"Baixe a mídia do evento",enabled:"Botão ativado",expand:"Expandir",frigate:"Frigate menu / Visualização padrão",fullscreen:"Tela cheia",icon:"Ícone",image:"Imagem",live:"Ao vivo",media_player:"Enviar para o reprodutor de mídia",mute:"",play:"",priority:"Prioridade",recordings:"Gravações",screenshot:"",snapshots:"Instantâneos",substreams:"Substream(s)",timeline:"Linha do tempo",type:"",types:{momentary:"",toggle:""}},position:"Posição do menu",positions:{bottom:"Posicionado na parte inferior",left:"Posicionado à esquerda",right:"Posicionado à direita",top:"Posicionado no topo"},style:"Estilo do menu",styles:{hidden:"Menu oculto",hover:"Menu suspenso","hover-card":"Menu suspenso (em todo o cartão)",none:"Sem menu",outside:"Menu externo",overlay:"Menu sobreposto"}},overrides:{info:"Esta configuração do cartão especificou manualmente as substituições configuradas que podem substituir os valores mostrados no editor visual, consulte o editor de código para visualizar/modificar essas substituições"},performance:{features:{animated_progress_indicator:"Indicador de Carregamento Animado",editor_label:"Opções de recursos",media_chunk_size:"Tamanho do bloco de mídia"},profile:"Perfil de desempenho",profiles:{high:"Alto desempenho/completo",low:"Baixo desempenho"},style:{border_radius:"Curvas",box_shadow:"Sombras",editor_label:"Opções de estilo"},warning:"Este cartão está no modo de baixo desempenho, então os padrões foram alterados para otimizar o desempenho"},view:{camera_select:"Visualização de câmeras recém-selecionadas",dark_mode:"Modo escuro",dark_modes:{auto:"Automático",off:"Desligado",on:"Ligado"},default:"Visualização padrão",scan:{enabled:"Modo scan ativado",scan_mode:"Modo scan",show_trigger_status:"Pulsar borda quando acionado",untrigger_reset:"Redefinir a visualização para o padrão após desacionar",untrigger_seconds:"Segundos após a mudar para o estado inativo para desacionar"},timeout_seconds:"Redefinir para a visualização padrão X segundos após a ação do usuário (0 = nunca)",update_cycle_camera:"Percorrer as câmeras quando a visualização padrão for atualizada",update_force:"Forçar atualizações do cartão (ignore a interação do usuário)",update_seconds:"Atualize a visualização padrão a cada X segundos (0 = nunca)",views:{clip:"Clipe mais recente",clips:"Galeria de clipes",current:"Visualização atual",image:"Imagem estática",live:"Visualização ao vivo",recording:"Gravação mais recente",recordings:"Galeria de gravações",snapshot:"Snapshot mais recente",snapshots:"Galeria de Snapshots",timeline:"Visualização da linha do tempo"}}},o={add_new_camera:"Adicionar nova câmera",button:"Botão",camera:"Câmera",cameras:"Câmeras",cameras_secondary:"Quais câmeras renderizar neste cartão",delete:"Excluir",dimensions:"Dimensões",dimensions_secondary:"Dimensões e opções de forma",image:"Imagem",image_secondary:"Opções de visualização de imagem estática",live:"Ao vivo",live_secondary:"Opções de visualização da câmera ao vivo",media_gallery:"Galeria de mídia",media_gallery_secondary:"Opções da galeria de mídia",media_viewer:"Visualizador de eventos",media_viewer_secondary:"Opções do visualizador de Snapshots e clipes",menu:"Menu",menu_secondary:"Opções de aparência do menu",move_down:"Descer",move_up:"Subir",overrides:"As substituições estão ativas",overrides_secondary:"Substituições de configuração dinâmica detectadas",performance:"Desempenho",performance_secondary:"Opções de desempenho do cartão",timeline:"Linha do tempo",timeline_secondary:"Opções do evento da linha do tempo",upgrade:"Upgrade",upgrade_available:"Um upgrade automático da configuração de cartão está disponível",view:"Visualizar",view_secondary:"O que o cartão deve mostrar e como mostrá-lo"},i={ptz:{down:"Baixo",home:"Casa",left:"Esquerda",right:"Direita",up:"Cima",zoom_in:"Aumentar Zoom",zoom_out:"Reduzir Zoom"}},r={could_not_render_elements:"Não foi possível renderizar os elementos da imagem",could_not_resolve:"Não foi possível resolver o URL de mídia",diagnostics:"Diagnósticos do cartão. Revise as informações confidenciais antes de compartilhar",download_no_media:"Nenhuma mídia para download",download_sign_failed:"Não foi possível assinar o URL de mídia para download",duplicate_camera_id:"Duplique o ID da câmera Frigate para a câmera a seguir, use o parâmetro 'id' para identificar exclusivamente as câmeras",empty_response:"Sem resposta do Home Assistant para a solicitação",failed_response:"Falha ao receber resposta do Home Assistant para solicitação",failed_retain:"Não foi possível reter o evento",failed_sign:"Não foi possível assinar a URL do Home Assistant",image_load_error:"A imagem não pôde ser carregada",invalid_configuration:"Configuração inválida",invalid_configuration_no_hint:"Nenhuma dica de local disponível (tipo incorreto ou ausente?)",invalid_elements_config:"Configuração de elementos de imagem inválida",invalid_response:"Resposta inválida recebida do Home Assistant para a solicitação",jsmpeg_no_player:"Não foi possível iniciar o player JSMPEG",live_camera_no_endpoint:"Não foi possível obter o endereço da câmera para este provedor ao vivo (configuração incompleta?)",live_camera_not_found:"A entidade de câmera configurada não foi encontrada",live_camera_unavailable:"Câmera indisponível",no_camera_engine:"Não foi possível determinar o motor adequado para a câmera",no_camera_entity:"Não foi possível encontrar a entidade da câmera",no_camera_entity_for_triggers:"Uma entidade de câmera é necessária para detectar automaticamente os gatilhos",no_camera_id:"Não foi possível determinar o ID da câmera para a câmera a seguir, pode ser necessário definir o parâmetro 'id' manualmente",no_camera_name:"Não foi possível determinar o nome da câmera da Frigate, especifique 'camera_entity' ou 'camera_name' para a câmera a seguir",no_live_camera:"O parâmetro camera_entity deve ser definido e válido para este provedor ativo",no_visible_cameras:"Nenhuma câmera visível encontrada, você deve configurar pelo menos uma câmera não oculta",reconnecting:"Reconectando",timeline_no_cameras:"Nenhuma câmera do Frigate para mostrar na linha do tempo",too_many_automations:"",troubleshooting:"Verifique a solução de problemas",unknown:"Erro desconhecido",upgrade_available:"Uma atualização automatizada da configuração do cartão está disponível, visite o editor visual do cartão",webrtc_card_reported_error:"O cartão WebRTC relatou um erro",webrtc_card_waiting:"Aguardando o cartão WebRTC carregar ..."},t={camera:"Câmera",duration:"Duração",in_progress:"Em andamento",score:"Pontuação",seek:"Procurar",start:"Início",tag:"Etiqueta",what:"O que",where:"Onde"},s={all:"Todos",camera:"Câmera",favorite:"Favorito",media_type:"Tipo de mídia",media_types:{clips:"Clipes",recordings:"Gravações",snapshots:"Instantâneos"},not_favorite:"Não favorito",select_camera:"Selecione a câmera...",select_favorite:"Selecione favorito...",select_media_type:"Selecione o tipo de mídia...",select_tag:"Selecione a etiqueta...",select_what:"Selecione o que...",select_when:"Selecione quando...",select_where:"Selecione onde...",tag:"Etiqueta",what:"O que",when:"Quando",whens:{past_month:"Mês passado",past_week:"Semana passada",today:"Hoje",yesterday:"Ontem"},where:"Onde"},d={camera:"Câmera",duration:"Duração",events:"Eventos",in_progress:"Em andamento",seek:"Procurar",start:"Começar"},n={download:"Baixar mídia",no_thumbnail:"Nenhuma miniatura disponível",retain_indefinitely:"Evento será retido por tempo indeterminado",timeline:"Ver evento na linha do tempo"},m={pan_behavior:{pan:"",seek:"","seek-in-media":""},select_date:"Escolha a data"},c={common:e,config:a,editor:o,elements:i,error:r,event:t,media_filter:s,recording:d,thumbnail:n,timeline:m};export{e as common,a as config,c as default,o as editor,i as elements,r as error,t as event,s as media_filter,d as recording,n as thumbnail,m as timeline}; diff --git a/config/www/community/frigate-hass-card/lang-pt-BR-1648942c.js.gz b/config/www/community/frigate-hass-card/lang-pt-BR-1648942c.js.gz new file mode 100644 index 00000000..f42feff8 Binary files /dev/null and b/config/www/community/frigate-hass-card/lang-pt-BR-1648942c.js.gz differ diff --git a/config/www/community/frigate-hass-card/lang-pt-PT-440b6dfd.js b/config/www/community/frigate-hass-card/lang-pt-PT-440b6dfd.js new file mode 100644 index 00000000..fd2ee7ab --- /dev/null +++ b/config/www/community/frigate-hass-card/lang-pt-PT-440b6dfd.js @@ -0,0 +1 @@ +var e={frigate_card:"Cartão Frigate",frigate_card_description:"Um cartão da Lovelace para usar com Frigate",live:"Ao Vivo",no_media:"Sem média",recordings:"Gravações",version:"Versão"},a={cameras:{camera_entity:"Entidade da Câmera",dependencies:{all_cameras:"Mostrar eventos para todas as câmeras nesta câmera",cameras:"Mostrar eventos para câmeras específicas nesta câmera",editor_label:"Opções de dependência"},engines:{editor_label:"Editor de etiquetas"},frigate:{camera_name:"Nome da câmera do Frigate (detectado automaticamente pela entidade)",client_id:"ID do cliente do Frigate (para >1 servidor Frigate)",editor_label:"Opções do Frigate",labels:"Etiquetas",url:"URL do servidor Frigate",zones:"Zonas"},go2rtc:{editor_label:"Editor de etiquetas",modes:{editor_label:"Editor de etiquetas",mjpeg:"Mjpeg",mp4:"Mp4",mse:"Mse",webrtc:"Webrtc"},stream:"Stream"},hide:"Esconder",icon:"Ícone para esta câmera (detectado automaticamente pela entidade)",id:"ID exclusivo para esta câmera nesse cartão",image:{editor_label:"Editor etiquetas",refresh_seconds:"Atualizar em segundos",url:"Link"},live_provider:"Fonte de visualização ao vivo para esta câmera",live_provider_options:{editor_label:"Editor de etiquetas"},live_providers:{auto:"Automatico",go2rtc:"Go2rtc",ha:"Ha",image:"Imagem",jsmpeg:"JSMpeg","webrtc-card":"Cartão WebRTC (de @AlexxIT)"},motioneye:{editor_label:"Directoria pre-definido",images:{directory_pattern:"Directoria pre-definido",file_pattern:"Ficheiro pre-definido"},movies:{directory_pattern:"Directoria pre-definida",file_pattern:"Ficheiro pre-definido"},url:"Link"},title:"Título para esta câmera (detectado automaticamente pela entidade)",triggers:{editor_label:"Opções de activação",entities:"Activar a partir de outras entidades",motion:"Activar detectando automaticamente o sensor de movimento",occupancy:"Activar detectando automaticamente o sensor de ocupação"},webrtc_card:{editor_label:"Opções do cartão WebRTC",entity:"Entidade de câmera de cartão WebRTC (não é uma câmera Frigate)",url:"URL da câmera do cartão WebRTC"}},common:{controls:{builtin:"",filter:{editor_label:"Editor de titulos",mode:"Modo",modes:{left:"Esquerda",none:"Nenhum",right:"Direita"}},next_previous:{editor_label:"Editor de titulos",size:"Tamanho de controle próximo e anterior",style:"Estilo do controle próximo e anterior",styles:{chevrons:"Setas",icons:"Ícones",none:"Nenhum",thumbnails:"Miniaturas"}},thumbnails:{editor_label:"Editor de titulos",media:"Mostrar miniaturas de clipes ou snapshots",medias:{clips:"Miniaturas de clipes",snapshots:"Miniaturas de Snapshots"},mode:"Modos",modes:{above:"Miniaturas acima da mídia",below:"Miniaturas abaixo da mídia",left:"Miniaturas em uma gaveta à esquerda",none:"Sem miniaturas",right:"Miniaturas em uma gaveta à direita"},show_details:"Mostrar detalhes",show_download_control:"Mostrar o botão de download",show_favorite_control:"Mostrar o botão de favorito nas miniaturas",show_timeline_control:"Mostrar a linha do tempo nas miniaturas",size:"Tamanho das miniaturas em pixels"},timeline:{editor_label:"Controles de linha do tempo",mode:"Modo",modes:{above:"Por cima",below:"Abaixo",none:"Nenhum"}},title:{duration_seconds:"Segundos para exibir o pop-up (0 = para sempre)",editor_label:"Editor de titulos",mode:"Modo de exibição de título de mídia",modes:{none:"Sem exibição de título","popup-bottom-left":"Pop-up no canto inferior esquerdo","popup-bottom-right":"Pop-up no canto inferior direito","popup-top-left":"Pop-up no canto superior esquerdo","popup-top-right":"Pop-up no canto superior direito"}}},layout:{fit:"Fit",fits:{contain:"Conter",cover:"Tapar",fill:"Preencher"},position:{x:"Percentagem da localização horizontal",y:"Percentagem da localização vertical"}},media_action_conditions:{all:"Todas as oportunidades",hidden:"Ao ocultar o navegador/aba",never:"Nunca",selected:"Ao selecionar",unselected:"Ao desselecionar",visible:"Ao mostrar o navegador/aba"},timeline:{clustering_threshold:"A contagem de eventos nos quais eles são agrupados (0 = sem agrupamento)",media:"A mídia que a linha do tempo exibe",medias:{all:"Todos os tipos de mídia",clips:"Clipes",snapshots:"Instantâneos"},show_recordings:"Mostrar gravações",window_seconds:"A duração padrão da visualização da linha do tempo em segundos"}},dimensions:{aspect_ratio:"Proporção padrão (e.g. '16:9')",aspect_ratio_mode:"Modo de proporção",aspect_ratio_modes:{dynamic:"A proporção se ajusta à mídia",static:"Proporção estática",unconstrained:"Proporção irrestrita"}},image:{layout:"Layout",mode:"Modo de visualização de imagem",modes:{camera:"Instantâneo da câmera do Home Assistant, da entidade de câmera",screensaver:"Logo Frigate embutido",url:"Imagem arbitrária especificada por URL"},refresh_seconds:"Número de segundos após o qual atualizar (0 = nunca)",url:"Imagem arbitrária especificada por URL",zoomable:""},live:{auto_mute:"Silenciar câmeras ao vivo automaticamente",auto_pause:"Parar câmeras ao vivo automaticamente",auto_play:"Reproduzir câmeras ao vivo automaticamente",auto_unmute:"Ativar automaticamente o som das câmeras ao vivo",controls:{editor_label:"Controles da visualização ao vivo"},draggable:"A visualização ao vivo das câmeras pode ser arrastada/deslizada",layout:"layout",lazy_load:"As câmeras ao vivo são carregadas lentamente",lazy_unload:"As câmeras ao vivo são descarregadas preguiçosamente",microphone:{always_connected:"",disconnect_seconds:"",editor_label:"",enabled:""},preload:"Pré-carregar a visualização ao vivo em segundo plano",show_image_during_load:"Mostar imagem durante o carregamento",transition_effect:"Efeito de transição de câmera ao vivo",zoomable:""},media_viewer:{auto_mute:"Silenciar mídia automaticamente",auto_pause:"Parar mídia automaticamente",auto_play:"Reproduzir mídia automaticamente",auto_unmute:"Ativar mídia automaticamente",controls:{editor_label:"Controles do visualizador de mídia"},draggable:"Visualizador de eventos pode ser arrastado/deslizado",layout:"Layout",lazy_load:"A mídia do Visualizador de eventos é carregada lentamente no carrossel",transition_effect:"Efeito de transição do Visualizador de eventos",transition_effects:{none:"Sem transição",slide:"Transição de slides"},zoomable:""},menu:{alignment:"Alinhamento do menu",alignments:{bottom:"Alinhado à parte inferior",left:"Alinhado à esquerda",right:"Alinhado à direita",top:"Alinhado ao topo"},button_size:"Tamanho do botão de menu (e.g. '40px')",buttons:{alignment:"Alinhamento do botão",alignments:{matching:"Mesmo alinhamento do menu",opposing:"Opor-se ao alinhamento do menu"},camera_ui:"Camera",cameras:"Selecionar câmera",clips:"Clipes",download:"Descarregar mídia do evento",enabled:"Botão ativado",expand:"Expandir",frigate:"Frigate menu / Visualização padrão",fullscreen:"Tela cheia",icon:"Ícone",image:"Imagem",live:"Ao vivo",media_player:"Enviar para o reprodutor de mídia",mute:"",play:"",priority:"Prioridade",screenshot:"",snapshots:"Instantâneos",substreams:"substreams",timeline:"Linha do tempo",type:"",types:{momentary:"",toggle:""}},position:"Posição do menu",positions:{bottom:"Posicionado na parte inferior",left:"Posicionado à esquerda",right:"Posicionado à direita",top:"Posicionado no topo"},style:"Estilo do menu",styles:{hidden:"Menu oculto",hover:"Menu suspenso",none:"Sem menu",outside:"Menu externo",overlay:"Menu sobreposto"}},overrides:{info:"Esta configuração do cartão especificou manualmente as substituições configuradas que podem substituir os valores mostrados no editor visual, consulte o editor de código para visualizar/modificar essas substituições"},performance:{features:{animated_progress_indicator:"Animação na barra de progresso",editor_label:"Editor de etiquetas",media_chunk_size:"Tamanho do ficheiro"},profile:"Perfil",profiles:{high:"Alto",low:"Baixo"},style:{border_radius:"Tamanho do bordo",box_shadow:"Caixa de Fundo",editor_label:"Editor de etiquetas"},warning:"Avisos"},view:{camera_select:"Visualização de câmeras recém-selecionadas",dark_mode:"Modo escuro",dark_modes:{auto:"Automático",off:"Desligado",on:"Ligado"},default:"Visualização padrão",scan:{enabled:"Modo scan ativado",scan_mode:"Modo scan",show_trigger_status:"Exibir estado do gatilho",untrigger_reset:"Redefinir a visualização para o padrão após desacionar",untrigger_seconds:"Segundos após a mudar para o estado inativo para desacionar"},timeout_seconds:"Redefinir para a visualização padrão X segundos após a ação do usuário (0 = nunca)",update_cycle_camera:"Percorrer as câmeras quando a visualização padrão for atualizada",update_force:"Forçar atualizações do cartão (ignore a interação do Utilizador)",update_seconds:"Atualize a visualização padrão a cada X segundos (0 = nunca)",views:{clip:"Clipe mais recente",clips:"Galeria de clipes",current:"Visualização atual",image:"Imagem estática",live:"Visualização ao vivo",snapshot:"Snapshot mais recente",snapshots:"Galeria de Snapshots",timeline:"Visualização da linha do tempo"}}},o={add_new_camera:"Adicionar nova câmera",button:"Botão",camera:"Câmera",cameras:"Câmeras",cameras_secondary:"Câmeras para renderizar neste cartão",delete:"Excluir",dimensions:"Dimensões",dimensions_secondary:"Dimensões e opções de forma",image:"Imagem",image_secondary:"Opções de visualização de imagem estática",live:"Ao vivo",live_secondary:"Opções de visualização da câmera ao vivo",media_gallery:"Galeria",media_gallery_secondary:"Galeria Secundaria",media_viewer:"Visualizador de eventos",media_viewer_secondary:"Opções do visualizador de Snapshots e clipes",menu:"Menu",menu_secondary:"Opções de aparência do menu",move_down:"Descer",move_up:"Subir",overrides:"As substituições estão ativas",overrides_secondary:"Substituições de configuração dinâmica detectadas",timeline:"Linha do tempo",timeline_secondary:"Opções do evento da linha do tempo",upgrade:"Actualização",upgrade_available:"Está disponível uma atualização automática do cartão",view:"Visualizar",view_secondary:"O que deve ser mostrado neste cartão"},i={ptz:{down:"Baixo",home:"Origem",left:"Esquerda",right:"Direira",up:"Cima",zoom_in:"Ampliar",zoom_out:"Reduzir"}},r={could_not_render_elements:"Não foi possível renderizar os elementos da imagem",could_not_resolve:"Não foi possível resolver o URL de mídia",diagnostics:"Diagnósticos do cartão. Reveja as informações confidenciais antes de partilhar",download_no_media:"Nenhuma mídia para download",download_sign_failed:"Não foi possível assinar o URL de mídia para download",duplicate_camera_id:"Duplique o ID da câmera Frigate para a câmera a seguir, use o parâmetro 'id' para identificar exclusivamente as câmeras",empty_response:"Sem resposta do Home Assistant para a solicitação",failed_response:"Falha ao receber resposta do Home Assistant para solicitação",failed_retain:"Não foi possível reter o evento",failed_sign:"Não foi possível assinar a URL do Home Assistant",image_load_error:"A imagem não pôde ser carregada",invalid_configuration:"Configuração inválida",invalid_configuration_no_hint:"Nenhuma dica de local disponível (tipo incorreto ou ausente?)",invalid_elements_config:"Configuração de elementos de imagem inválida",invalid_response:"Resposta inválida recebida do Home Assistant para a solicitação",jsmpeg_no_player:"Não foi possível iniciar o player JSMPEG",live_camera_no_endpoint:"Nenhuma câmera ao vivo",live_camera_not_found:"Nenhuma câmera ao vivo não foi encontrada",live_camera_unavailable:"Câmera ao vivo indisponivel",no_camera_engine:"Não existe câmera",no_camera_entity:"Não existe uma entidade câmera",no_camera_entity_for_triggers:"Não existe camera para a acção",no_camera_id:"Não foi possível determinar o ID da câmera para a câmera a seguir, pode ser necessário definir o parâmetro 'id' manualmente",no_camera_name:"Não foi possível determinar o nome da câmera da Frigate, especifique 'camera_entity' ou 'camera_name' para a câmera a seguir",no_live_camera:"O parâmetro camera_entity deve ser definido e válido para este serviço ativo",no_visible_cameras:"Sem camaras visiveis",reconnecting:"A voltar a ligar",timeline_no_cameras:"Nenhuma câmera do Frigate para mostrar na linha do tempo",troubleshooting:"Verifique a solução de problemas",too_many_automations:"",unknown:"Erro desconhecido",upgrade_available:"Uma atualização automatizada da configuração do cartão está disponível, visite o editor visual do cartão",webrtc_card_reported_error:"O cartão WebRTC relatou um erro",webrtc_card_waiting:"Aguardar o cartão WebRTC carregar ..."},t={camera:"Camera",duration:"Duração",in_progress:"Em andamento",score:"Pontuação",seek:"Procurar",start:"Início",what:"O quê",where:"Onde"},s={all:"Todos",camera:"Camera",favorite:"Favoritos",media_type:"Tipos de media",media_types:{clips:"Clips",recordings:"Gravações",snapshots:"Imagens"},not_favorite:"Não favorito",select_camera:"Seleciona a camara",select_favorite:"Seleciona o favorito",select_media_type:"Seleciona o tipo de media",select_what:"Seleciona",select_when:"Seleciona quando",select_where:"Seleciona onde",what:"O que",when:"Quando",whens:{past_month:"O mes passado",past_week:"A semana passada",today:"Hoje",yesterday:"Ontem"},where:"Onde"},n={camera:"Camera",duration:"Duração",events:"Eventos",in_progress:"Em andamento",seek:"Procurar",start:"Começar"},d={no_thumbnail:"Nenhuma miniatura disponível",retain_indefinitely:"Evento será retido por tempo indeterminado",timeline:"Ver evento na linha do tempo"},m={pan_behavior:{pan:"Pan",seek:"Pan seeks across all media","seek-in-media":"Pan seeks within selected media item only"},select_date:"Selecionar a data"},l={common:e,config:a,editor:o,elements:i,error:r,event:t,media_filter:s,recording:n,thumbnail:d,timeline:m};export{e as common,a as config,l as default,o as editor,i as elements,r as error,t as event,s as media_filter,n as recording,d as thumbnail,m as timeline}; diff --git a/config/www/community/frigate-hass-card/lang-pt-PT-440b6dfd.js.gz b/config/www/community/frigate-hass-card/lang-pt-PT-440b6dfd.js.gz new file mode 100644 index 00000000..6d92b376 Binary files /dev/null and b/config/www/community/frigate-hass-card/lang-pt-PT-440b6dfd.js.gz differ diff --git a/config/www/community/frigate-hass-card/lazyload-c2d6254a.js b/config/www/community/frigate-hass-card/lazyload-c2d6254a.js new file mode 100644 index 00000000..10bb306d --- /dev/null +++ b/config/www/community/frigate-hass-card/lazyload-c2d6254a.js @@ -0,0 +1,44 @@ +import{cH as t,cI as a,cW as e,cX as o,bk as n,bl as i,bm as d,bn as r,s,cY as l,y as c,o as u,cZ as h,bj as p,cP as m,c_ as g,cN as b,c$ as v,cS as f,d0 as y,d1 as _,d2 as C}from"./card-555679fd.js"; +/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const x={},z=t(class extends a{constructor(){super(...arguments),this.ot=x}render(t,a){return a()}update(t,[a,o]){if(Array.isArray(a)){if(Array.isArray(this.ot)&&this.ot.length===a.length&&a.every(((t,a)=>t===this.ot[a])))return e}else if(this.ot===a)return e;return this.ot=Array.isArray(a)?Array.from(a):a,this.render(a,o)}}),P=2,S=(t,a)=>{t._controlsHideTimer&&(t._controlsHideTimer.stop(),delete t._controlsHideTimer),t.controls=a},A=(t,a=1)=>{const e=t.controls;S(t,!1),t._controlsHideTimer??=new o,t._controlsHideTimer.start(a,(()=>{S(t,e)}))},L=async(t,a)=>{if(a?.play)try{await a.play()}catch(e){if("NotAllowedError"===e.name&&!t.isMuted()){await t.mute();try{await a.play()}catch(t){}}}};let k=class extends s{constructor(){super(...arguments),this.disabled=!1,this.label="",this._embedThumbnailTask=l(this,(()=>this.hass),(()=>this.thumbnail))}set controlConfig(t){t?.size&&this.style.setProperty("--frigate-card-next-prev-size",`${t.size}px`),this._controlConfig=t}render(){if(this.disabled||!this._controlConfig||"none"==this._controlConfig.style)return c``;const t={controls:!0,previous:"previous"===this.direction,next:"next"===this.direction,thumbnails:"thumbnails"===this._controlConfig.style,icons:["chevrons","icons"].includes(this._controlConfig.style),button:["chevrons","icons"].includes(this._controlConfig.style)};if(["chevrons","icons"].includes(this._controlConfig.style)){let a;if("chevrons"===this._controlConfig.style)a="previous"===this.direction?"mdi:chevron-left":"mdi:chevron-right";else{if(!this.icon)return c``;a=this.icon}return c` + + `}return this.thumbnail?h(this,this._embedThumbnailTask,(a=>a?c``:c``),{inProgressFunc:()=>c`
`}):c``}static get styles(){return p("ha-icon-button.button {\n color: var(--secondary-color, white);\n background-color: rgba(0, 0, 0, 0.6);\n border-radius: 50%;\n padding: 0px;\n margin: 3px;\n --ha-icon-display: block;\n /* Buttons can always be clicked */\n pointer-events: auto;\n opacity: 0.9;\n}\n\n@keyframes pulse {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0.6;\n }\n 100% {\n opacity: 1;\n }\n}\nha-icon[data-domain=alert][data-state=on],\nha-icon[data-domain=automation][data-state=on],\nha-icon[data-domain=binary_sensor][data-state=on],\nha-icon[data-domain=calendar][data-state=on],\nha-icon[data-domain=camera][data-state=streaming],\nha-icon[data-domain=cover][data-state=open],\nha-icon[data-domain=fan][data-state=on],\nha-icon[data-domain=humidifier][data-state=on],\nha-icon[data-domain=light][data-state=on],\nha-icon[data-domain=input_boolean][data-state=on],\nha-icon[data-domain=lock][data-state=unlocked],\nha-icon[data-domain=media_player][data-state=on],\nha-icon[data-domain=media_player][data-state=paused],\nha-icon[data-domain=media_player][data-state=playing],\nha-icon[data-domain=script][data-state=on],\nha-icon[data-domain=sun][data-state=above_horizon],\nha-icon[data-domain=switch][data-state=on],\nha-icon[data-domain=timer][data-state=active],\nha-icon[data-domain=vacuum][data-state=cleaning],\nha-icon[data-domain=group][data-state=on],\nha-icon[data-domain=group][data-state=home],\nha-icon[data-domain=group][data-state=open],\nha-icon[data-domain=group][data-state=locked],\nha-icon[data-domain=group][data-state=problem] {\n color: var(--paper-item-icon-active-color, #fdd835);\n}\n\nha-icon[data-domain=climate][data-state=cooling] {\n color: var(--cool-color, var(--state-climate-cool-color));\n}\n\nha-icon[data-domain=climate][data-state=heating] {\n color: var(--heat-color, var(--state-climate-heat-color));\n}\n\nha-icon[data-domain=climate][data-state=drying] {\n color: var(--dry-color, var(--state-climate-dry-color));\n}\n\nha-icon[data-domain=alarm_control_panel] {\n color: var(--alarm-color-armed, var(--label-badge-red));\n}\n\nha-icon[data-domain=alarm_control_panel][data-state=disarmed] {\n color: var(--alarm-color-disarmed, var(--label-badge-green));\n}\n\nha-icon[data-domain=alarm_control_panel][data-state=pending],\nha-icon[data-domain=alarm_control_panel][data-state=arming] {\n color: var(--alarm-color-pending, var(--label-badge-yellow));\n animation: pulse 1s infinite;\n}\n\nha-icon[data-domain=alarm_control_panel][data-state=triggered] {\n color: var(--alarm-color-triggered, var(--label-badge-red));\n animation: pulse 1s infinite;\n}\n\nha-icon[data-domain=plant][data-state=problem],\nha-icon[data-domain=zwave][data-state=dead] {\n color: var(--state-icon-error-color);\n}\n\n/* Color the icon if unavailable */\nha-icon[data-state=unavailable] {\n color: var(--state-unavailable-color);\n}\n\nha-icon-button[data-domain=alert][data-state=on],\nha-icon-button[data-domain=automation][data-state=on],\nha-icon-button[data-domain=binary_sensor][data-state=on],\nha-icon-button[data-domain=calendar][data-state=on],\nha-icon-button[data-domain=camera][data-state=streaming],\nha-icon-button[data-domain=cover][data-state=open],\nha-icon-button[data-domain=fan][data-state=on],\nha-icon-button[data-domain=humidifier][data-state=on],\nha-icon-button[data-domain=light][data-state=on],\nha-icon-button[data-domain=input_boolean][data-state=on],\nha-icon-button[data-domain=lock][data-state=unlocked],\nha-icon-button[data-domain=media_player][data-state=on],\nha-icon-button[data-domain=media_player][data-state=paused],\nha-icon-button[data-domain=media_player][data-state=playing],\nha-icon-button[data-domain=script][data-state=on],\nha-icon-button[data-domain=sun][data-state=above_horizon],\nha-icon-button[data-domain=switch][data-state=on],\nha-icon-button[data-domain=timer][data-state=active],\nha-icon-button[data-domain=vacuum][data-state=cleaning],\nha-icon-button[data-domain=group][data-state=on],\nha-icon-button[data-domain=group][data-state=home],\nha-icon-button[data-domain=group][data-state=open],\nha-icon-button[data-domain=group][data-state=locked],\nha-icon-button[data-domain=group][data-state=problem] {\n color: var(--paper-item-icon-active-color, #fdd835);\n}\n\nha-icon-button[data-domain=climate][data-state=cooling] {\n color: var(--cool-color, var(--state-climate-cool-color));\n}\n\nha-icon-button[data-domain=climate][data-state=heating] {\n color: var(--heat-color, var(--state-climate-heat-color));\n}\n\nha-icon-button[data-domain=climate][data-state=drying] {\n color: var(--dry-color, var(--state-climate-dry-color));\n}\n\nha-icon-button[data-domain=alarm_control_panel] {\n color: var(--alarm-color-armed, var(--label-badge-red));\n}\n\nha-icon-button[data-domain=alarm_control_panel][data-state=disarmed] {\n color: var(--alarm-color-disarmed, var(--label-badge-green));\n}\n\nha-icon-button[data-domain=alarm_control_panel][data-state=pending],\nha-icon-button[data-domain=alarm_control_panel][data-state=arming] {\n color: var(--alarm-color-pending, var(--label-badge-yellow));\n animation: pulse 1s infinite;\n}\n\nha-icon-button[data-domain=alarm_control_panel][data-state=triggered] {\n color: var(--alarm-color-triggered, var(--label-badge-red));\n animation: pulse 1s infinite;\n}\n\nha-icon-button[data-domain=plant][data-state=problem],\nha-icon-button[data-domain=zwave][data-state=dead] {\n color: var(--state-icon-error-color);\n}\n\n/* Color the icon if unavailable */\nha-icon-button[data-state=unavailable] {\n color: var(--state-unavailable-color);\n}\n\n:host {\n --frigate-card-next-prev-size: 48px;\n --frigate-card-next-prev-size-hover: calc(var(--frigate-card-next-prev-size) * 2);\n --frigate-card-prev-position: 45px;\n --frigate-card-next-position: 45px;\n --mdc-icon-button-size: var(--frigate-card-next-prev-size);\n --mdc-icon-size: calc(var(--mdc-icon-button-size) / 2);\n}\n\n.controls {\n position: absolute;\n z-index: 1;\n overflow: hidden;\n}\n\n.controls.previous {\n left: var(--frigate-card-prev-position);\n}\n\n.controls.next {\n right: var(--frigate-card-next-position);\n}\n\n.controls.icons {\n top: calc(50% - var(--frigate-card-next-prev-size) / 2);\n}\n\n.controls.thumbnails {\n border-radius: 50%;\n height: var(--frigate-card-next-prev-size);\n top: calc(50% - var(--frigate-card-next-prev-size) / 2);\n box-shadow: var(--frigate-card-css-box-shadow, 0px 0px 20px 5px black);\n transition: all 0.2s ease-out;\n opacity: 0.8;\n aspect-ratio: 1/1;\n}\n\n.controls.thumbnails:hover {\n opacity: 1 !important;\n height: var(--frigate-card-next-prev-size-hover);\n top: calc(50% - var(--frigate-card-next-prev-size-hover) / 2);\n}\n\n.controls.previous.thumbnails:hover {\n left: calc(var(--frigate-card-prev-position) - (var(--frigate-card-next-prev-size-hover) - var(--frigate-card-next-prev-size)) / 2);\n}\n\n.controls.next.thumbnails:hover {\n right: calc(var(--frigate-card-next-position) - (var(--frigate-card-next-prev-size-hover) - var(--frigate-card-next-prev-size)) / 2);\n}")}};n([i({attribute:!1})],k.prototype,"direction",void 0),n([i({attribute:!1})],k.prototype,"hass",void 0),n([d()],k.prototype,"_controlConfig",void 0),n([i({attribute:!1})],k.prototype,"thumbnail",void 0),n([i({attribute:!1})],k.prototype,"icon",void 0),n([i({attribute:!0,type:Boolean})],k.prototype,"disabled",void 0),n([i()],k.prototype,"label",void 0),k=n([r("frigate-card-next-previous-control")],k);const $=(t,a)=>{var e,o;a.stopPropagation(),e=a.composedPath()[0],o={slide:t,mediaLoadedInfo:a.detail},_(e,"carousel:media:loaded",o)},H=(t,a)=>{var e;a.stopPropagation(),e=a.composedPath()[0],_(e,"carousel:media:unloaded",{slide:t})};let M=class extends s{constructor(){super(),this.selected=0,this._mediaLoadedInfo={},this._nextControlRef=m(),this._previousControlRef=m(),this._titleControlRef=m(),this._titleTimer=new o,this._boundAutoPlayHandler=this.autoPlay.bind(this),this._boundAutoUnmuteHandler=this.autoUnmute.bind(this),this._boundTitleHandler=this._titleHandler.bind(this),this._debouncedAdaptContainerHeightToSlide=g(this._adaptContainerHeightToSlide.bind(this),100,{trailing:!0}),this._refCarousel=m(),this._slideResizeObserver=new ResizeObserver(this._reInitAndAdjustHeight.bind(this)),this._intersectionObserver=new IntersectionObserver(this._intersectionHandler.bind(this))}frigateCardCarousel(){return this._refCarousel.value??null}_getAutoMediaPlugin(){return this.frigateCardCarousel()?.carousel()?.plugins().autoMedia??null}autoPlay(){const t=this._getAutoMediaPlugin()?.options;t?.autoPlayCondition&&["all","selected"].includes(t?.autoPlayCondition)&&this._getAutoMediaPlugin()?.play()}autoPause(){const t=this._getAutoMediaPlugin()?.options;t?.autoPauseCondition&&["all","selected"].includes(t.autoPauseCondition)&&this._getAutoMediaPlugin()?.pause()}autoUnmute(){const t=this._getAutoMediaPlugin()?.options;t?.autoUnmuteCondition&&["all","selected"].includes(t?.autoUnmuteCondition)&&this._getAutoMediaPlugin()?.unmute()}autoMute(){const t=this._getAutoMediaPlugin()?.options;t?.autoMuteCondition&&["all","selected"].includes(t?.autoMuteCondition)&&this._getAutoMediaPlugin()?.mute()}_titleHandler(){const t=()=>{this._titleTimer.stop(),this._titleControlRef.value?.show()};this._titleControlRef.value?.isVisible()&&t(),this._titleTimer.start(.5,t)}connectedCallback(){super.connectedCallback(),this.addEventListener("frigate-card:media:loaded",this._boundAutoPlayHandler),this.addEventListener("frigate-card:media:loaded",this._boundAutoUnmuteHandler),this.addEventListener("frigate-card:media:loaded",this._debouncedAdaptContainerHeightToSlide),this.addEventListener("frigate-card:media:loaded",this._boundTitleHandler),this._intersectionObserver.observe(this)}disconnectedCallback(){this.removeEventListener("frigate-card:media:loaded",this._boundAutoPlayHandler),this.removeEventListener("frigate-card:media:loaded",this._boundAutoUnmuteHandler),this.removeEventListener("frigate-card:media:loaded",this._debouncedAdaptContainerHeightToSlide),this.removeEventListener("frigate-card:media:loaded",this._boundTitleHandler),this._intersectionObserver.disconnect(),this._mediaLoadedInfo={},super.disconnectedCallback()}_reInitAndAdjustHeight(){this.frigateCardCarousel()?.carouselReInitWhenSafe(),this._debouncedAdaptContainerHeightToSlide()}_intersectionHandler(t){t.some((t=>t.isIntersecting))&&this._reInitAndAdjustHeight()}_adaptContainerHeightToSlide(){const t=this.frigateCardCarousel()?.getCarouselSelected();if(t){this.style.removeProperty("max-height");const a=t.element.getBoundingClientRect().height;void 0!==a&&a>0&&(this.style.maxHeight=`${a}px`)}}_dispatchMediaLoadedInfo(t){const a=t.index;void 0!==a&&a in this._mediaLoadedInfo&&b(this,this._mediaLoadedInfo[a])}_storeMediaLoadedInfo(t){t.stopPropagation();const a=t.detail.mediaLoadedInfo,e=t.detail.slide;a&&v(a)&&(this._mediaLoadedInfo[e]=a,this.frigateCardCarousel()?.getCarouselSelected()?.index===e&&b(this,a))}_removeMediaLoadedInfo(t){const a=t.detail.slide;delete this._mediaLoadedInfo[a],this.frigateCardCarousel()?.getCarouselSelected()?.index!==a&&t.stopPropagation()}render(){const t=t=>{this._slideResizeObserver.disconnect();const a=this.getRootNode();a&&a instanceof ShadowRoot&&this._slideResizeObserver.observe(a.host);const e=t.detail;this._slideResizeObserver.observe(e.element),_(this,"media-carousel:select",e),this._dispatchMediaLoadedInfo(e)};return c` {t(a)}} + @frigate-card:carousel:media:loaded=${this._storeMediaLoadedInfo.bind(this)} + @frigate-card:carousel:media:unloaded=${this._removeMediaLoadedInfo.bind(this)} + > + + + + + ${this.label&&this.titlePopupConfig?c` + `:""}`}static get styles(){return p(":host {\n display: block;\n width: 100%;\n height: 100%;\n --video-max-height: none;\n position: relative;\n}")}};n([i({attribute:!1})],M.prototype,"nextPreviousConfig",void 0),n([i({attribute:!1})],M.prototype,"carouselOptions",void 0),n([i({attribute:!1})],M.prototype,"carouselPlugins",void 0),n([i({attribute:!1,type:Number})],M.prototype,"selected",void 0),n([i({attribute:!0})],M.prototype,"transitionEffect",void 0),n([i({attribute:!1})],M.prototype,"label",void 0),n([i({attribute:!1})],M.prototype,"logo",void 0),n([i({attribute:!1})],M.prototype,"titlePopupConfig",void 0),M=n([r("frigate-card-media-carousel")],M);let w=class extends s{constructor(){super(...arguments),this._toastRef=m()}render(){if(!this.text||!this.config||"none"==this.config.mode||!this.fitInto)return c``;const t=this.config.mode.match(/-top-/)?"top":"bottom",a=this.config.mode.match(/-left$/)?"left":"right";return c` + ${this.logo?c``:""} + `}isVisible(){return this._toastRef.value?.opened??!1}hide(){this._toastRef.value&&(this._toastRef.value.opened=!1)}show(){this._toastRef.value&&(this._toastRef.value.opened=!1,this._toastRef.value.opened=!0)}static get styles(){return p(":host {\n --paper-toast-background-color: rgba(0,0,0,0.6);\n --paper-toast-color: white;\n}\n\npaper-toast {\n max-width: unset;\n min-width: unset;\n display: flex;\n align-items: center;\n}\n\npaper-toast img {\n max-height: 24px;\n padding-left: 10px;\n}")}};n([i({attribute:!1})],w.prototype,"config",void 0),n([i({attribute:!1})],w.prototype,"text",void 0),n([i({attribute:!1})],w.prototype,"fitInto",void 0),n([i({attribute:!1})],w.prototype,"logo",void 0),w=n([r("frigate-card-title-control")],w);const I={active:!0,breakpoints:{}};function R(t){const a=C.optionsHandler(),e=a.merge(I,R.globalOptions);let o,n,i;function d(){"hidden"===document.visibilityState?(o.autoPauseCondition&&["all","hidden"].includes(o.autoPauseCondition)&&function(){for(const t of i)r(t)?.pause()}(),o.autoMuteCondition&&["all","hidden"].includes(o.autoMuteCondition)&&function(){for(const t of i)r(t)?.mute()}()):"visible"===document.visibilityState&&(o.autoPlayCondition&&["all","visible"].includes(o.autoPlayCondition)&&s(),o.autoUnmuteCondition&&["all","visible"].includes(o.autoUnmuteCondition)&&u())}function r(t){return o.playerSelector?t?.querySelector(o.playerSelector):null}function s(){r(i[n.selectedScrollSnap()])?.play()}function l(){r(i[n.selectedScrollSnap()])?.pause()}function c(){r(i[n.previousScrollSnap()])?.pause()}function u(){r(i[n.selectedScrollSnap()])?.unmute()}function h(){r(i[n.selectedScrollSnap()])?.mute()}function p(){r(i[n.previousScrollSnap()])?.mute()}const m={name:"autoMedia",options:a.merge(e,t),init:function(t){n=t,o=a.atMedia(m.options),i=n.slideNodes(),n.on("destroy",l),o.autoPauseCondition&&["all","unselected"].includes(o.autoPauseCondition)&&n.on("select",c),n.on("destroy",h),o.autoMuteCondition&&["all","unselected"].includes(o.autoMuteCondition)&&n.on("select",p),document.addEventListener("visibilitychange",d)},destroy:function(){n.off("destroy",l),o.autoPauseCondition&&["all","unselected"].includes(o.autoPauseCondition)&&n.off("select",c),n.off("destroy",h),o.autoMuteCondition&&["all","unselected"].includes(o.autoMuteCondition)&&n.off("select",p),document.removeEventListener("visibilitychange",d)},play:s,pause:l,mute:h,unmute:u};return m}R.globalOptions=void 0;const E={active:!0,breakpoints:{},lazyLoadCount:0};function T(t){const a=C.optionsHandler(),e=a.merge(E,T.globalOptions);let o,n,i;const d=new Set,r=["init","select","resize"],s=["select"];function l(){"hidden"===document.visibilityState&&o.lazyUnloadCallback&&o.lazyUnloadCondition&&["all","hidden"].includes(o.lazyUnloadCondition)?d.forEach((t=>{o.lazyUnloadCallback&&(o.lazyUnloadCallback(t,i[t]),d.delete(t))})):"visible"===document.visibilityState&&o.lazyLoadCallback&&u()}function c(t){return d.has(t)}function u(){const t=o.lazyLoadCount??0,a=n.selectedScrollSnap(),e=new Set;for(let o=1;o<=t&&a-o>=0;o++)e.add(a-o);e.add(a);for(let o=1;o<=t&&a+o{!c(t)&&o.lazyLoadCallback&&(d.add(t),o.lazyLoadCallback(t,i[t]))}))}function h(){const t=n.previousScrollSnap();c(t)&&o.lazyUnloadCallback&&(o.lazyUnloadCallback(t,i[t]),d.delete(t))}const p={name:"lazyload",options:a.merge(e,t),init:function(t){n=t,o=a.atMedia(p.options),i=n.slideNodes(),o.lazyLoadCallback&&r.forEach((t=>n.on(t,u))),o.lazyUnloadCallback&&o.lazyUnloadCondition&&["all","unselected"].includes(o.lazyUnloadCondition)&&s.forEach((t=>n.on(t,h))),document.addEventListener("visibilitychange",l)},destroy:function(){o.lazyLoadCallback&&r.forEach((t=>n.off(t,u))),o.lazyUnloadCallback&&s.forEach((t=>n.off(t,h))),document.removeEventListener("visibilitychange",l)},hasLazyloaded:c};return p}T.globalOptions=void 0;export{R as A,T as L,P as M,H as a,A as h,z as i,L as p,S as s,$ as w}; diff --git a/config/www/community/frigate-hass-card/lazyload-c2d6254a.js.gz b/config/www/community/frigate-hass-card/lazyload-c2d6254a.js.gz new file mode 100644 index 00000000..2b63d3b0 Binary files /dev/null and b/config/www/community/frigate-hass-card/lazyload-c2d6254a.js.gz differ diff --git a/config/www/community/frigate-hass-card/live-e0c9196c.js b/config/www/community/frigate-hass-card/live-e0c9196c.js new file mode 100644 index 00000000..77be9d02 --- /dev/null +++ b/config/www/community/frigate-hass-card/live-e0c9196c.js @@ -0,0 +1,127 @@ +import{cH as e,cI as i,cJ as t,cK as a,cL as r,l as s,cM as o,s as n,cN as d,y as l,bj as h,bk as c,bl as g,cO as u,bm as m,bn as v,cP as p,bQ as f,cQ as _,cR as C,cS as b,cT as $,cU as y,cV as w,o as P}from"./card-555679fd.js";import{L as M,A as S,i as k,w as x,a as L,p as I}from"./lazyload-c2d6254a.js";import{u as z}from"./media-layout-8e0c974f.js"; +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const E=e(class extends i{constructor(){super(...arguments),this.key=t}render(e,i){return this.key=e,i}update(e,[i,t]){return i!==this.key&&(a(e),this.key=i),t}});const R="frigate-card-live-provider",O=(e,i,t)=>{if(!t?.camera_entity)return r(e,s("error.no_live_camera"),{context:t}),null;const a=i.states[t.camera_entity];return a?"unavailable"===a.state?(o(e,s("error.live_camera_unavailable"),"info",{icon:"mdi:connection",context:t}),null):a:(r(e,s("error.live_camera_not_found"),{context:t}),null)};let V=class extends n{constructor(){super(),this._inBackground=!1,this._lastMediaLoadedInfo=null,this._messageReceivedPostRender=!1,this._renderKey=0,this._intersectionObserver=new IntersectionObserver(this._intersectionHandler.bind(this))}_intersectionHandler(e){this._inBackground=!e.some((e=>e.isIntersecting)),this._inBackground||this._messageReceivedPostRender||!this._lastMediaLoadedInfo||d(this._lastMediaLoadedInfo.source,this._lastMediaLoadedInfo.mediaLoadedInfo),this._messageReceivedPostRender&&!this._inBackground&&this.requestUpdate()}shouldUpdate(e){return!this._inBackground||!this._messageReceivedPostRender}connectedCallback(){this._intersectionObserver.observe(this),super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this._intersectionObserver.disconnect()}render(){if(!(this.hass&&this.liveConfig&&this.cameraManager&&this.view))return;const e=l`${E(this._renderKey,l` + {this._renderKey++,this._messageReceivedPostRender=!0,this._inBackground&&e.stopPropagation()}} + @frigate-card:media:loaded=${e=>{this._lastMediaLoadedInfo={source:e.composedPath()[0],mediaLoadedInfo:e.detail},this._inBackground&&e.stopPropagation()}} + @frigate-card:view:change=${e=>{this._inBackground&&e.stopPropagation()}} + > + + `)}`;return this._messageReceivedPostRender=!1,e}static get styles(){return h(":host {\n width: 100%;\n height: 100%;\n display: block;\n}")}};c([g({attribute:!1})],V.prototype,"conditionControllerEpoch",void 0),c([g({attribute:!1})],V.prototype,"hass",void 0),c([g({attribute:!1})],V.prototype,"view",void 0),c([g({attribute:!1})],V.prototype,"liveConfig",void 0),c([g({attribute:!1,hasChanged:u})],V.prototype,"liveOverrides",void 0),c([g({attribute:!1})],V.prototype,"cameraManager",void 0),c([g({attribute:!1})],V.prototype,"cardWideConfig",void 0),c([g({attribute:!1})],V.prototype,"microphoneStream",void 0),c([m()],V.prototype,"_inBackground",void 0),V=c([v("frigate-card-live")],V);let j=class extends n{constructor(){super(...arguments),this._cameraToSlide={},this._refMediaCarousel=p()}updated(e){super.updated(e),e.has("inBackground")&&this.updateComplete.then((async()=>{const e=this._refMediaCarousel.value;e&&(await e.updateComplete,this.inBackground?(e.autoPause(),e.autoMute()):(e.autoPlay(),e.autoUnmute()))}))}_getTransitionEffect(){return this.liveConfig?.transition_effect??f.live.transition_effect}_getSelectedCameraIndex(){const e=this.cameraManager?.getStore().getVisibleCameraIDs();return e&&this.view?Math.max(0,Array.from(e).indexOf(this.view.camera)):0}_getOptions(){return{draggable:this.liveConfig?.draggable,loop:!0}}_getPlugins(){const e=this.cameraManager?.getStore().getVisibleCameraIDs();return[...e&&e.size>1?[_({forceWheelAxis:"y"})]:[],M({...this.liveConfig?.lazy_load&&{lazyLoadCallback:(e,i)=>this._lazyloadOrUnloadSlide("load",e,i)},lazyUnloadCondition:this.liveConfig?.lazy_unload,lazyUnloadCallback:(e,i)=>this._lazyloadOrUnloadSlide("unload",e,i)}),S({playerSelector:R,...this.liveConfig?.auto_play&&{autoPlayCondition:this.liveConfig.auto_play},...this.liveConfig?.auto_pause&&{autoPauseCondition:this.liveConfig.auto_pause},...this.liveConfig?.auto_mute&&{autoMuteCondition:this.liveConfig.auto_mute},...this.liveConfig?.auto_unmute&&{autoUnmuteCondition:this.liveConfig.auto_unmute}})]}_getLazyLoadCount(){return!1===this.liveConfig?.lazy_load?null:0}_getSlides(){const e=this.cameraManager?.getStore().getVisibleCameras();if(!e)return[[],{}];const i=[],t={};for(const[a,r]of e){const e=this.view?.context?.live?.overrides?.get(a)??a,s=a===e?r:this.cameraManager?.getStore().getCameraConfig(e),o=s?this._renderLive(e,s,i.length):null;o&&(t[a]=i.length,i.push(o))}return[i,t]}_setViewHandler(e){const i=this.cameraManager?.getStore().getVisibleCameras();i&&e.detail.index!==this._getSelectedCameraIndex()&&this._setViewCameraID(Array.from(i.keys())[e.detail.index])}_setViewCameraID(e){e&&this.view?.evolve({camera:e,query:null,queryResults:null}).mergeInContext({thumbnails:{fetch:!1}}).dispatchChangeEvent(this)}_lazyloadOrUnloadSlide(e,i,t){t instanceof HTMLSlotElement&&(t=t.assignedElements({flatten:!0})[0]);const a=t?.querySelector(R);a&&(a.disabled="load"!==e)}_renderLive(e,i,t){if(!(this.liveConfig&&this.hass&&this.cameraManager&&this.conditionControllerEpoch))return;const a=C(this.conditionControllerEpoch.controller,this.liveConfig,this.liveOverrides,{camera:e}),r=this.cameraManager.getCameraMetadata(this.hass,e);return l` +
+ this.cameraManager?.getCameraEndpoints(e)??void 0))} + .label=${r?.title??""} + .liveConfig=${a} + .hass=${this.hass} + .cardWideConfig=${this.cardWideConfig} + @frigate-card:media:loaded=${e=>{x(t,e)}} + @frigate-card:media:unloaded=${e=>{L(t,e)}} + > + +
+ `}_getCameraIDsOfNeighbors(){const e=this.cameraManager?.getStore().getVisibleCameras();if(!e||!this.view||!this.hass)return[null,null];const i=Array.from(e.keys()),t=i.indexOf(this.view.camera);return t<0||e.size<=1?[null,null]:[i[t>0?t-1:e.size-1],i[t+1this.view?.context?.live?.overrides?.get(e)??e,o=t?this.cameraManager.getCameraMetadata(this.hass,r(t)):null,n=this.cameraManager.getCameraMetadata(this.hass,r(this.view.camera)),d=a?this.cameraManager.getCameraMetadata(this.hass,r(a)):null;return l` + {$(this,{thumbnails:{fetch:!0}})}} + > + {this._setViewCameraID(t),y(e)}} + > + + ${e} + {this._setViewCameraID(a),y(e)}} + > + + + `}static get styles(){return h(".embla__slide {\n height: 100%;\n flex: 0 0 100%;\n}")}};c([g({attribute:!1})],j.prototype,"hass",void 0),c([g({attribute:!1})],j.prototype,"view",void 0),c([g({attribute:!1})],j.prototype,"liveConfig",void 0),c([g({attribute:!1,hasChanged:u})],j.prototype,"liveOverrides",void 0),c([g({attribute:!1})],j.prototype,"inBackground",void 0),c([g({attribute:!1})],j.prototype,"conditionControllerEpoch",void 0),c([g({attribute:!1})],j.prototype,"cardWideConfig",void 0),c([g({attribute:!1})],j.prototype,"cameraManager",void 0),c([g({attribute:!1})],j.prototype,"microphoneStream",void 0),j=c([v("frigate-card-live-carousel")],j);let B=class extends n{constructor(){super(...arguments),this.disabled=!1,this.label="",this._isVideoMediaLoaded=!1,this._refProvider=p(),this._importPromises=[]}async play(){await this.updateComplete,await(this._refProvider.value?.updateComplete),await I(this,this._refProvider.value)}async pause(){await this.updateComplete,await(this._refProvider.value?.updateComplete),await(this._refProvider.value?.pause())}async mute(){await this.updateComplete,await(this._refProvider.value?.updateComplete),await(this._refProvider.value?.mute())}async unmute(){await this.updateComplete,await(this._refProvider.value?.updateComplete),await(this._refProvider.value?.unmute())}isMuted(){return this._refProvider.value?.isMuted()??!0}async seek(e){await this.updateComplete,await(this._refProvider.value?.updateComplete),await(this._refProvider.value?.seek(e))}async setControls(e){await this.updateComplete,await(this._refProvider.value?.updateComplete),await(this._refProvider.value?.setControls(e))}isPaused(){return this._refProvider.value?.isPaused()??!0}async getScreenshotURL(){return await this.updateComplete,await(this._refProvider.value?.updateComplete),await(this._refProvider.value?.getScreenshotURL())??null}_getResolvedProvider(){return"auto"===this.cameraConfig?.live_provider?this.cameraConfig?.webrtc_card?.entity||this.cameraConfig?.webrtc_card?.url?"webrtc-card":this.cameraConfig?.camera_entity?"low"===this.cardWideConfig?.performance?.profile?"image":"ha":this.cameraConfig?.frigate.camera_name?"jsmpeg":f.cameras.live_provider:this.cameraConfig?.live_provider||"image"}_shouldShowImageDuringLoading(){return!!this.cameraConfig?.camera_entity&&!!this.hass&&!!this.liveConfig?.show_image_during_load}disconnectedCallback(){this._isVideoMediaLoaded=!1}_videoMediaShowHandler(){this._isVideoMediaLoaded=!0}willUpdate(e){if(e.has("disabled")&&this.disabled&&(this._isVideoMediaLoaded=!1,w(this)),e.has("liveConfig")&&(z(this,this.liveConfig?.layout),this.liveConfig?.show_image_during_load&&this._importPromises.push(import("./live-image-c8850fc4.js")),this.liveConfig?.zoomable&&this._importPromises.push(import("./zoomer-1857311a.js"))),e.has("cameraConfig")){const e=this._getResolvedProvider();"jsmpeg"===e?this._importPromises.push(import("./live-jsmpeg-9c767737.js")):"ha"===e?this._importPromises.push(import("./live-ha-df63bfc8.js")):"webrtc-card"===e?this._importPromises.push(import("./live-webrtc-card-dfc8f852.js")):"image"===e?this._importPromises.push(import("./live-image-c8850fc4.js")):"go2rtc"===e&&this._importPromises.push(import("./live-go2rtc-0795a62f.js"))}}async getUpdateComplete(){const e=await super.getUpdateComplete();return await Promise.all(this._importPromises),this._importPromises=[],e}_useZoomIfRequired(e){return this.liveConfig?.zoomable?l` this.setControls(!1)} + @frigate-card:zoom:unzoomed=${()=>this.setControls()} + > + ${e} + `:e}render(){if(this.disabled||!this.hass||!this.liveConfig||!this.cameraConfig)return;this.title=this.label,this.ariaLabel=this.label;const e=this._getResolvedProvider(),i=!this._isVideoMediaLoaded&&this._shouldShowImageDuringLoading(),t={hidden:i};return this._useZoomIfRequired(l` + ${i||"image"===e?l` {"image"===e?this._videoMediaShowHandler():i.stopPropagation()}} + > + `:l``} + ${"ha"===e?l` + `:"go2rtc"===e?l` + `:"webrtc-card"===e?l` + `:"jsmpeg"===e?l` + `:l``} + `)}static get styles(){return h(":host {\n display: block;\n height: 100%;\n width: 100;\n}\n\n.hidden {\n display: none;\n}")}};c([g({attribute:!1})],B.prototype,"hass",void 0),c([g({attribute:!1})],B.prototype,"cameraConfig",void 0),c([g({attribute:!1})],B.prototype,"cameraEndpoints",void 0),c([g({attribute:!1})],B.prototype,"liveConfig",void 0),c([g({attribute:!0,type:Boolean})],B.prototype,"disabled",void 0),c([g({attribute:!1})],B.prototype,"label",void 0),c([g({attribute:!1})],B.prototype,"cardWideConfig",void 0),c([g({attribute:!1})],B.prototype,"microphoneStream",void 0),c([m()],B.prototype,"_isVideoMediaLoaded",void 0),B=c([v(R)],B);export{V as FrigateCardLive,j as FrigateCardLiveCarousel,B as FrigateCardLiveProvider,O as getStateObjOrDispatchError}; diff --git a/config/www/community/frigate-hass-card/live-e0c9196c.js.gz b/config/www/community/frigate-hass-card/live-e0c9196c.js.gz new file mode 100644 index 00000000..589a8ae1 Binary files /dev/null and b/config/www/community/frigate-hass-card/live-e0c9196c.js.gz differ diff --git a/config/www/community/frigate-hass-card/live-go2rtc-0795a62f.js b/config/www/community/frigate-hass-card/live-go2rtc-0795a62f.js new file mode 100644 index 00000000..00534318 --- /dev/null +++ b/config/www/community/frigate-hass-card/live-go2rtc-0795a62f.js @@ -0,0 +1 @@ +import{dj as e,dk as t,dl as s,dm as i,s as n,di as o,cL as a,l as c,y as r,bj as h,bk as d,bl as l,bn as p}from"./card-555679fd.js";import{g as m}from"./endpoint-aa68fc9e.js";import{s as u,h as v,M as y}from"./lazyload-c2d6254a.js";import"./image-0b99ab11.js";import{m as b}from"./audio-557099cb.js";import"./media-layout-8e0c974f.js";class g extends HTMLElement{constructor(){super(),this.DISCONNECT_TIMEOUT=5e3,this.RECONNECT_TIMEOUT=3e4,this.CODECS=["avc1.640029","avc1.64002A","avc1.640033","hvc1.1.6.L153.B0","mp4a.40.2","mp4a.40.5","flac","opus"],this.mode="webrtc,mse,mp4,mjpeg",this.background=!1,this.visibilityThreshold=0,this.visibilityCheck=!0,this.pcConfig={iceServers:[{urls:"stun:stun.l.google.com:19302"}],sdpSemantics:"unified-plan"},this.wsState=WebSocket.CLOSED,this.pcState=WebSocket.CLOSED,this.video=null,this.ws=null,this.wsURL="",this.pc=null,this.connectTS=0,this.mseCodecs="",this.disconnectTID=0,this.reconnectTID=0,this.ondata=null,this.onmessage=null,this.microphoneStream=null,this.containingPlayer=null,this.controls=!0}reconnect(){this.wsState!==WebSocket.CLOSED?(this.ws?.addEventListener("close",(()=>this.onconnect())),this.ondisconnect()):(this.ondisconnect(),this.onconnect())}set src(e){"string"!=typeof e&&(e=e.toString()),e.startsWith("http")?e="ws"+e.substring(4):e.startsWith("/")&&(e="ws"+location.origin.substring(4)+e),this.wsURL=e,this.onconnect()}play(){}send(e){this.ws&&this.ws.send(JSON.stringify(e))}codecs(e){const t="mse"===e?e=>MediaSource.isTypeSupported(`video/mp4; codecs="${e}"`):e=>this.video.canPlayType(`video/mp4; codecs="${e}"`);return this.CODECS.filter(t).join()}connectedCallback(){if(this.disconnectTID&&(clearTimeout(this.disconnectTID),this.disconnectTID=0),this.video){const e=this.video.seekable;e.length>0&&(this.video.currentTime=e.end(e.length-1)),this.play()}else this.oninit();this.onconnect()}disconnectedCallback(){this.background||this.disconnectTID||this.wsState===WebSocket.CLOSED&&this.pcState===WebSocket.CLOSED||(this.disconnectTID=setTimeout((()=>{this.reconnectTID&&(clearTimeout(this.reconnectTID),this.reconnectTID=0),this.disconnectTID=0,this.ondisconnect()}),this.DISCONNECT_TIMEOUT))}oninit(){if(this.video=document.createElement("video"),u(this.video,this.controls),this.video.playsInline=!0,this.video.preload="auto",this.video.style.display="block",this.video.style.width="100%",this.video.style.height="100%",this.appendChild(this.video),!this.background){if("hidden"in document&&this.visibilityCheck&&document.addEventListener("visibilitychange",(()=>{document.hidden?this.disconnectedCallback():this.isConnected&&this.connectedCallback()})),"IntersectionObserver"in window&&this.visibilityThreshold){new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting?this.isConnected&&this.connectedCallback():this.disconnectedCallback()}))}),{threshold:this.visibilityThreshold}).observe(this)}this.video.onloadeddata=()=>{this.controls&&v(this.video,y),e(this,this.video,{player:this.containingPlayer,capabilities:{supports2WayAudio:!!this.pc,supportsPause:!0,hasAudio:b(this.video)}})},this.video.onvolumechange=()=>t(this),this.video.onplay=()=>s(this),this.video.onpause=()=>i(this),this.video.muted=!0}}onconnect(){return!(!this.isConnected||!this.wsURL||this.ws||this.pc)&&(this.wsState=WebSocket.CONNECTING,this.connectTS=Date.now(),this.ws=new WebSocket(this.wsURL),this.ws.binaryType="arraybuffer",this.ws.addEventListener("open",(e=>this.onopen(e))),this.ws.addEventListener("close",(e=>this.onclose(e))),!0)}ondisconnect(){this.wsState=WebSocket.CLOSED,this.ws&&(this.ws.close(),this.ws=null),this.pcState=WebSocket.CLOSED,this.pc&&(this.pc.close(),this.pc=null)}onopen(){this.wsState=WebSocket.OPEN,this.ws.addEventListener("message",(e=>{if("string"==typeof e.data){const t=JSON.parse(e.data);for(const e in this.onmessage)this.onmessage[e](t)}else this.ondata(e.data)})),this.ondata=null,this.onmessage={};const e=[];return this.mode.indexOf("mse")>=0&&"MediaSource"in window?(e.push("mse"),this.onmse()):this.mode.indexOf("mp4")>=0&&(e.push("mp4"),this.onmp4()),this.mode.indexOf("webrtc")>=0&&"RTCPeerConnection"in window&&(e.push("webrtc"),this.onwebrtc()),this.mode.indexOf("mjpeg")>=0&&(e.length?this.onmessage.mjpeg=t=>{"error"===t.type&&0===t.value.indexOf(e[0])&&this.onmjpeg()}:(e.push("mjpeg"),this.onmjpeg())),e}onclose(){if(this.wsState===WebSocket.CLOSED)return!1;this.wsState=WebSocket.CONNECTING,this.ws=null;const e=Math.max(this.RECONNECT_TIMEOUT-(Date.now()-this.connectTS),0);return this.reconnectTID=setTimeout((()=>{this.reconnectTID=0,this.onconnect()}),e),!0}onmse(){const e=new MediaSource;e.addEventListener("sourceopen",(()=>{URL.revokeObjectURL(this.video.src),this.send({type:"mse",value:this.codecs("mse")})}),{once:!0}),this.video.src=URL.createObjectURL(e),this.video.srcObject=null,this.play(),this.mseCodecs="",this.onmessage.mse=t=>{if("mse"!==t.type)return;this.mseCodecs=t.value;const s=e.addSourceBuffer(t.value);s.mode="segments",s.addEventListener("updateend",(()=>{if(!s.updating)try{if(n>0){const e=i.slice(0,n);n=0,s.appendBuffer(e)}else if(s.buffered&&s.buffered.length){const t=s.buffered.end(s.buffered.length-1)-15,i=s.buffered.start(0);t>i&&(s.remove(i,t),e.setLiveSeekableRange(t,t+15))}}catch(e){}}));const i=new Uint8Array(2097152);let n=0;this.ondata=e=>{if(s.updating||n>0){const t=new Uint8Array(e);i.set(t,n),n+=t.byteLength}else try{s.appendBuffer(e)}catch(e){}}}}onwebrtc(){const e=new RTCPeerConnection(this.pcConfig),t=document.createElement("video");t.addEventListener("loadeddata",(e=>this.onpcvideo(e)),{once:!0}),e.addEventListener("icecandidate",(e=>{const t=e.candidate?e.candidate.toJSON().candidate:"";this.send({type:"webrtc/candidate",value:t})})),e.addEventListener("track",(e=>{null===t.srcObject&&0!==e.streams.length&&"{"!==e.streams[0].id[0]&&"video"===e.track.kind&&(t.srcObject=e.streams[0])})),e.addEventListener("connectionstatechange",(()=>{"failed"!==e.connectionState&&"disconnected"!==e.connectionState||(e.close(),this.pcState=WebSocket.CLOSED,this.pc=null,this.onconnect())})),this.onmessage.webrtc=t=>{switch(t.type){case"webrtc/candidate":e.addIceCandidate({candidate:t.value,sdpMid:"0"}).catch((()=>console.debug));break;case"webrtc/answer":e.setRemoteDescription({type:"answer",sdp:t.value}).catch((()=>console.debug));break;case"error":if(t.value.indexOf("webrtc/offer")<0)return;e.close()}},e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"}),this.microphoneStream?.getTracks().forEach((t=>{e.addTransceiver(t,{direction:"sendonly"})})),e.createOffer().then((t=>{e.setLocalDescription(t).then((()=>{this.send({type:"webrtc/offer",value:t.sdp})}))})),this.pcState=WebSocket.CONNECTING,this.pc=e}onpcvideo(e){if(!this.pc)return;const t=e.target,s=this.pc.connectionState;if("connected"===s||"connecting"===s||!s){let e=0,s=0;const i=t.srcObject;i.getVideoTracks().length>0&&(e+=544),i.getAudioTracks().length>0&&(e+=258),this.mseCodecs.indexOf("hvc1.")>=0&&(s+=560),this.mseCodecs.indexOf("avc1.")>=0&&(s+=528),this.mseCodecs.indexOf("mp4a.")>=0&&(s+=257),e>=s?(this.video.srcObject=i,this.play(),this.pcState=WebSocket.OPEN,this.wsState=WebSocket.CLOSED,this.ws.close(),this.ws=null):(this.pcState=WebSocket.CLOSED,this.pc.close(),this.pc=null)}t.srcObject=null}onmjpeg(){let t=!1;this.ondata=s=>{u(this.video,!1),this.video.poster="data:image/jpeg;base64,"+g.btoa(s),t||(t=!0,e(this,this.video,{player:this.containingPlayer}))},this.send({type:"mjpeg"})}onmp4(){const t=document.createElement("canvas");let s;const i=document.createElement("video");i.autoplay=!0,i.playsInline=!0,i.muted=!0,i.addEventListener("loadeddata",(n=>{s||(t.width=i.videoWidth,t.height=i.videoHeight,s=t.getContext("2d"),e(this,i,{player:this.containingPlayer})),s.drawImage(i,0,0,t.width,t.height),u(this.video,!1),this.video.poster=t.toDataURL("image/jpeg")})),this.ondata=e=>{i.src="data:video/mp4;base64,"+g.btoa(e)},this.send({type:"mp4",value:this.codecs("mp4")})}static btoa(e){const t=new Uint8Array(e),s=t.byteLength;let i="";for(let e=0;e{let u=class extends(customElements.get("ha-web-rtc-player")){async play(){return this._video?.play()}async pause(){this._video?.pause()}async mute(){this._video&&(this._video.muted=!0)}async unmute(){this._video&&(this._video.muted=!1)}isMuted(){return this._video?.muted??!0}async seek(e){this._video&&(this._video.currentTime=e)}async setControls(e){this._video&&$(this._video,e??this.controls)}isPaused(){return this._video?.paused??!0}async getScreenshotURL(){return this._video?e(this._video):null}render(){return this._error?t(this,`${this._error} (${this.entityid})`):s` + + `}static get styles(){return[super.styles,o(_),l` + :host { + width: 100%; + height: 100%; + } + video { + width: 100%; + height: 100%; + } + `]}};n([v("#remote-stream")],u.prototype,"_video",void 0),u=n([d("frigate-card-ha-web-rtc-player")],u)})),customElements.whenDefined("ha-camera-stream").then((()=>{let e=class extends(customElements.get("ha-camera-stream")){async play(){return this._player?.play()}async pause(){this._player?.pause()}async mute(){this._player?.mute()}async unmute(){this._player?.unmute()}isMuted(){return this._player?.isMuted()??!0}async seek(e){this._player?.seek(e)}async setControls(e){this._player&&this._player.setControls(e??this.controls)}isPaused(){return this._player?.isPaused()??!0}async getScreenshotURL(){return this._player?await this._player.getScreenshotURL():null}render(){return this.stateObj?this._shouldRenderMJPEG?s` + {a(this,e,{player:this})}} + .src=${void 0===this._connected||this._connected?(e=this.stateObj,`/api/camera_proxy_stream/${e.entity_id}?token=${e.attributes.access_token}`):""} + /> + `:"hls"===this.stateObj.attributes.frontend_stream_type?this._url?s` `:s``:"web_rtc"===this.stateObj.attributes.frontend_stream_type?s``:void 0:s``;var e}static get styles(){return[super.styles,o(_),l` + :host { + width: 100%; + height: 100%; + } + img { + width: 100%; + height: 100%; + } + `]}};n([v("#player")],e.prototype,"_player",void 0),e=n([d("frigate-card-ha-camera-stream")],e)}));let w=class extends u{constructor(){super(...arguments),this.controls=!0,this._playerRef=c()}async play(){return this._playerRef.value?.play()}async pause(){this._playerRef.value?.pause()}async mute(){this._playerRef.value?.mute()}async unmute(){this._playerRef.value?.unmute()}isMuted(){return this._playerRef.value?.isMuted()??!0}async seek(e){this._playerRef.value?.seek(e)}async setControls(e){this._playerRef.value?.setControls(e??this.controls)}isPaused(){return this._playerRef.value?.isPaused()??!0}async getScreenshotURL(){return await(this._playerRef.value?.getScreenshotURL())??null}render(){if(!this.hass)return;const e=m(this,this.hass,this.cameraConfig);return e?s` + `:void 0}static get styles(){return o(":host {\n width: 100%;\n height: 100%;\n display: block;\n --video-max-height: none;\n}")}};n([p({attribute:!1})],w.prototype,"hass",void 0),n([p({attribute:!1})],w.prototype,"cameraConfig",void 0),n([p({attribute:!0,type:Boolean})],w.prototype,"controls",void 0),w=n([d("frigate-card-live-ha")],w);export{w as FrigateCardLiveHA}; diff --git a/config/www/community/frigate-hass-card/live-ha-df63bfc8.js.gz b/config/www/community/frigate-hass-card/live-ha-df63bfc8.js.gz new file mode 100644 index 00000000..5587e875 Binary files /dev/null and b/config/www/community/frigate-hass-card/live-ha-df63bfc8.js.gz differ diff --git a/config/www/community/frigate-hass-card/live-image-c8850fc4.js b/config/www/community/frigate-hass-card/live-image-c8850fc4.js new file mode 100644 index 00000000..5146c2b8 --- /dev/null +++ b/config/www/community/frigate-hass-card/live-image-c8850fc4.js @@ -0,0 +1,7 @@ +import{s as e,cP as a,y as s,cS as t,bj as i,bk as r,bl as m,bn as o}from"./card-555679fd.js";import"./image-0b99ab11.js";import{getStateObjOrDispatchError as n}from"./live-e0c9196c.js";import"./media-layout-8e0c974f.js";import"./lazyload-c2d6254a.js";let u=class extends e{constructor(){super(...arguments),this._refImage=a()}async play(){await(this._refImage.value?.play())}async pause(){await(this._refImage.value?.pause())}async mute(){await(this._refImage.value?.mute())}async unmute(){await(this._refImage.value?.unmute())}isMuted(){return!!this._refImage.value?.isMuted()}async seek(e){await(this._refImage.value?.seek(e))}async setControls(e){await(this._refImage.value?.setControls(e))}isPaused(){return this._refImage.value?.isPaused()??!0}async getScreenshotURL(){return await(this._refImage.value?.getScreenshotURL())??null}render(){if(this.hass&&this.cameraConfig)return n(this,this.hass,this.cameraConfig),s` + `}static get styles(){return i(":host {\n width: 100%;\n height: 100%;\n display: block;\n}")}};r([m({attribute:!1})],u.prototype,"hass",void 0),r([m({attribute:!1})],u.prototype,"cameraConfig",void 0),u=r([o("frigate-card-live-image")],u);export{u as FrigateCardLiveImage}; diff --git a/config/www/community/frigate-hass-card/live-image-c8850fc4.js.gz b/config/www/community/frigate-hass-card/live-image-c8850fc4.js.gz new file mode 100644 index 00000000..3ab3fe7d Binary files /dev/null and b/config/www/community/frigate-hass-card/live-image-c8850fc4.js.gz differ diff --git a/config/www/community/frigate-hass-card/live-jsmpeg-9c767737.js b/config/www/community/frigate-hass-card/live-jsmpeg-9c767737.js new file mode 100644 index 00000000..f367a55f --- /dev/null +++ b/config/www/community/frigate-hass-card/live-jsmpeg-9c767737.js @@ -0,0 +1,12 @@ +import{cH as A,dG as t,cW as i,dH as e,s,cX as o,dl as g,dm as I,dj as a,cL as B,l as r,y as C,db as n,bj as E,bk as Q,bl as h,bn as d}from"./card-555679fd.js";import{g as c}from"./endpoint-aa68fc9e.js";function l(){return l=Object.assign?Object.assign.bind():function(A){for(var t=1;t"string"==typeof A&&A.constructor===String,D=A=>"Promise"===Object.prototype.toString.call(A).slice(8,-1);var m="WJ3NAvwFY9",f="tR2-0dd-e1",y="ZgIIHVSSYI",R="kAA8SjbHe2",k="OueN4AU4CJ";!function(A,t){void 0===t&&(t={});var i=t.insertAt;if(A&&"undefined"!=typeof document){var e=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===i&&e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s),s.styleSheet?s.styleSheet.cssText=A:s.appendChild(document.createTextNode(A))}}(".WJ3NAvwFY9,.ZgIIHVSSYI,.kAA8SjbHe2,.tR2-0dd-e1{height:100%;left:0;position:absolute;top:0;width:100%;z-index:1}.ZgIIHVSSYI{-ms-flex-pack:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-justify-content:center;justify-content:center}.WJ3NAvwFY9,.tR2-0dd-e1{display:block}.tR2-0dd-e1.OueN4AU4CJ{display:none}.ZgIIHVSSYI,.kAA8SjbHe2{-webkit-tap-highlight-color:rgba(255,0,0,0);cursor:pointer;opacity:.7}.OueN4AU4CJ.ZgIIHVSSYI,.OueN4AU4CJ.kAA8SjbHe2{display:none}.ZgIIHVSSYI{z-index:10}.ZgIIHVSSYI>svg{fill:#fff;height:12vw;max-height:60px;max-width:60px;width:12vw}.kAA8SjbHe2{-ms-flex-pack:end;-ms-flex-align:end;-webkit-align-items:flex-end;align-items:flex-end;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-justify-content:flex-end;justify-content:flex-end;z-index:10}.kAA8SjbHe2>svg{fill:#fff;height:9vw;margin:0 15px 15px 0;max-height:40px;max-width:40px;width:9vw}");var b=function(){function A(A,t,i,e){var s=void 0===i?{}:i,o=s.canvas,g=void 0===o?"":o,I=s.poster,a=void 0===I?"":I,B=s.autoplay,r=void 0!==B&&B,C=s.autoSetWrapperSize,n=void 0!==C&&C,E=s.loop,Q=void 0!==E&&E,h=s.control,d=void 0===h||h,c=s.decodeFirstFrame,u=void 0===c||c,w=s.picMode,D=void 0!==w&&w,m=s.progressive,f=void 0===m||m,y=s.chunkSize,R=void 0===y?1048576:y,k=s.hooks,b=void 0===k?{}:k;void 0===e&&(e={}),this.options=l({videoUrl:t,canvas:g,poster:a,picMode:D,autoplay:r,autoSetWrapperSize:n,loop:Q,control:d,decodeFirstFrame:u,progressive:f,chunkSize:R,hooks:l({play:function(){},pause:function(){},stop:function(){},load:function(){}},b)},e),this.options.needPlayButton=this.options.control&&!this.options.picMode,this.player=null,this.els={wrapper:p(A)?document.querySelector(A):A,canvas:null,playButton:document.createElement("div"),unmuteButton:null,poster:null},"static"===window.getComputedStyle(this.els.wrapper).getPropertyValue("position")&&(this.els.wrapper.style.position="relative"),this.els.wrapper.clientRect=this.els.wrapper.getBoundingClientRect(),this.initCanvas(),this.initPlayButton(),this.initPlayer()}var t=A.prototype;return t.initCanvas=function(){this.options.canvas?this.els.canvas=p(this.options.canvas)?document.querySelector(this.options.canvas):this.options.canvas:(this.els.canvas=document.createElement("canvas"),this.els.canvas.classList.add(m),this.els.wrapper.appendChild(this.els.canvas))},t.initPlayer=function(){var A=this;this.options=l(this.options,{canvas:this.els.canvas});var t=l({},this.options,{autoplay:!1});if(this.player=new X(this.options.videoUrl,t,{play:function(){A.options.needPlayButton&&A.els.playButton.classList.add(k),A.els.poster&&A.els.poster.classList.add(k),A.options.hooks.play()},pause:function(){A.options.needPlayButton&&A.els.playButton.classList.remove(k),A.options.hooks.pause()},stop:function(){A.els.poster&&A.els.poster.classList.remove(k),A.options.hooks.stop()},load:function(){A.options.autoplay&&A.play(),A._autoSetWrapperSize(),A.options.hooks.load()}}),this._copyPlayerFuncs(),this.els.wrapper.playerInstance=this.player,!this.options.poster||this.options.autoplay||this.player.options.streaming||(this.options.decodeFirstFrame=!1,this.els.poster=new Image,this.els.poster.src=this.options.poster,this.els.poster.classList.add(f),this.els.wrapper.appendChild(this.els.poster)),this.player.options.streaming||this.els.wrapper.addEventListener("click",this.onClick.bind(this)),(this.options.autoplay||this.player.options.streaming)&&this.els.playButton.classList.add(k),this.player.audioOut&&!this.player.audioOut.unlocked){var i=this.els.wrapper;(this.options.autoplay||this.player.options.streaming)&&(this.els.unmuteButton=document.createElement("div"),this.els.unmuteButton.innerHTML='\n\n \n\n',this.els.unmuteButton.classList.add(R),this.els.wrapper.appendChild(this.els.unmuteButton),i=this.els.unmuteButton),this.unlockAudioBound=this.onUnlockAudio.bind(this,i),i.addEventListener("touchstart",this.unlockAudioBound,!1),i.addEventListener("click",this.unlockAudioBound,!0)}},t.initPlayButton=function(){this.options.needPlayButton&&(this.els.playButton.classList.add(y),this.els.playButton.innerHTML='\n\n \n\n',this.els.wrapper.appendChild(this.els.playButton))},t._autoSetWrapperSize=function(){var A=this;if(!this.options.autoSetWrapperSize)return Promise.resolve();var t=this.player.video.destination;return t?Promise.resolve().then((function(){return function(A){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return D(A)?A:new Promise((i=>{A(),setTimeout(i,t)}))}((function(){A.els.wrapper.style.width=t.width+"px",A.els.wrapper.style.height=t.height+"px"}))})):Promise.resolve()},t.onUnlockAudio=function(A,t){var i=this;this.els.unmuteButton&&(t.preventDefault(),t.stopPropagation()),this.player.audioOut.unlock((function(){i.els.unmuteButton&&i.els.unmuteButton.classList.add(k),A.removeEventListener("touchstart",i.unlockAudioBound),A.removeEventListener("click",i.unlockAudioBound)}))},t.onClick=function(){this.options.control&&(this.player.isPlaying?this.pause():this.play())},t._copyPlayerFuncs=function(){var A=this;this.play=function(){return A.player.play()},this.pause=function(){return A.player.pause()},this.stop=function(){return A.player.stop()},this.destroy=function(){A.player.destroy(),A.els.wrapper.innerHTML="",A.els.wrapper.playerInstance=null}},A}(),G=function(){return window.performance?window.performance.now()/1e3:Date.now()/1e3},S=function(A,t){if(A.fill)A.fill(t);else for(var i=0;iA&&this.loadNextChunk())},t.destroy=function(){this.request.abort(),this.aborted=!0},t.loadNextChunk=function(){var A=this,t=this.loadedSize,i=Math.min(this.loadedSize+this.chunkSize-1,this.fileSize-1);if(t>=this.fileSize||this.aborted)return this.completed=!0,void(this.onCompletedCallback&&this.onCompletedCallback(this));this.isLoading=!0,this.loadStartTime=G(),this.request=new XMLHttpRequest,this.request.onreadystatechange=function(){A.request.readyState===A.request.DONE&&A.request.status>=200&&A.request.status<300?A.onChunkLoad(A.request.response):A.request.readyState===A.request.DONE&&A.loadFails++<3&&A.loadNextChunk()},0===t&&(this.request.onprogress=this.onProgress.bind(this)),this.request.open("GET",this.url+"?"+t+"-"+i),this.request.setRequestHeader("Range","bytes="+t+"-"+i),this.request.responseType="arraybuffer",this.request.send()},t.onProgress=function(A){this.progress=A.loaded/A.total},t.onChunkLoad=function(A){var t=!this.established;this.established=!0,this.progress=1,this.loadedSize+=A.byteLength,this.loadFails=0,this.isLoading=!1,t&&this.hookOnEstablished&&this.hookOnEstablished(),t&&this.onEstablishedCallback&&this.onEstablishedCallback(this),this.destination&&this.destination.write(A),this.loadTime=G()-this.loadStartTime,this.throttled||this.loadNextChunk()},A}(),N=function(){function A(A,t){this.url=A,this.options=t,this.socket=null,this.streaming=!0,this.callbacks={connect:[],data:[]},this.destination=null,this.reconnectInterval=void 0!==t.reconnectInterval?t.reconnectInterval:5,this.shouldAttemptReconnect=!!this.reconnectInterval,this.completed=!1,this.established=!1,this.progress=0,this.reconnectTimeoutId=0,this.onEstablishedCallback=t.onSourceEstablished,this.onCompletedCallback=t.onSourceCompleted,t.hookOnEstablished&&(this.hookOnEstablished=t.hookOnEstablished)}var t=A.prototype;return t.connect=function(A){this.destination=A},t.destroy=function(){clearTimeout(this.reconnectTimeoutId),this.shouldAttemptReconnect=!1,this.socket.close()},t.start=function(){this.shouldAttemptReconnect=!!this.reconnectInterval,this.progress=0,this.established=!1,this.options.protocols?this.socket=new WebSocket(this.url,this.options.protocols):this.socket=new WebSocket(this.url),this.socket.binaryType="arraybuffer",this.socket.onmessage=this.onMessage.bind(this),this.socket.onopen=this.onOpen.bind(this),this.socket.onerror=this.onClose.bind(this),this.socket.onclose=this.onClose.bind(this)},t.resume=function(){},t.onOpen=function(){this.progress=1},t.onClose=function(){var A=this;this.shouldAttemptReconnect&&(clearTimeout(this.reconnectTimeoutId),this.reconnectTimeoutId=setTimeout((function(){A.start()}),1e3*this.reconnectInterval))},t.onMessage=function(A){var t=!this.established;this.established=!0,t&&this.hookOnEstablished&&this.hookOnEstablished(),t&&this.onEstablishedCallback&&this.onEstablishedCallback(this),this.destination&&this.destination.write(A.data)},A}(),L=function(){function A(t,i){"object"==typeof t?(this.bytes=t instanceof Uint8Array?t:new Uint8Array(t),this.byteLength=this.bytes.length):(this.bytes=new Uint8Array(t||1048576),this.byteLength=0),this.mode=i||A.MODE.EXPAND,this.index=0}var t=A.prototype;return t.resize=function(A){var t=new Uint8Array(A);0!==this.byteLength&&(this.byteLength=Math.min(this.byteLength,A),t.set(this.bytes,0,this.byteLength)),this.bytes=t,this.index=Math.min(this.index,this.byteLength<<3)},t.evict=function(A){var t=this.index>>3,i=this.bytes.length-this.byteLength;if(this.index===this.byteLength<<3||A>i+t)return this.byteLength=0,void(this.index=0);0!==t&&(this.bytes.copyWithin?this.bytes.copyWithin(0,t,this.byteLength):this.bytes.set(this.bytes.subarray(t,this.byteLength)),this.byteLength-=t,this.index-=t<<3)},t.write=function(t){var i="object"==typeof t[0],e=0,s=this.bytes.length-this.byteLength;if(i){e=0;for(var o=0;os)if(this.mode===A.MODE.EXPAND){var g=Math.max(2*this.bytes.length,e-s);this.resize(g)}else this.evict(e);if(i)for(var I=0;I>3;A>3;return A>=this.byteLength||0===this.bytes[A]&&0===this.bytes[A+1]&&1===this.bytes[A+2]},t.peek=function(A){for(var t=this.index,i=0;A;){var e=8-(7&t),s=e>3]&255>>8-s<>o,t+=s,A-=s}return i},t.read=function(A){var t=this.peek(A);return this.index+=A,t},t.skip=function(A){return this.index+=A},t.rewind=function(A){this.index=Math.max(this.index-A,0)},t.has=function(A){return(this.byteLength<<3)-this.index>=A},A}();L.MODE={EVICT:1,EXPAND:2};var U=function(){function A(){this.bits=null,this.leftoverBytes=null,this.guessVideoFrameEnd=!0,this.pidsToStreamIds={},this.pesPacketInfo={},this.startTime=0,this.currentTime=0}var t=A.prototype;return t.connect=function(A,t){this.pesPacketInfo[A]={destination:t,currentLength:0,totalLength:0,pts:0,buffers:[]}},t.write=function(A){if(this.leftoverBytes){var t=A.byteLength+this.leftoverBytes.byteLength;this.bits=new L(t),this.bits.write([this.leftoverBytes,A])}else this.bits=new L(A);for(;this.bits.has(1504)&&this.parsePacket(););var i=this.bits.byteLength-(this.bits.index>>3);this.leftoverBytes=i>0?this.bits.bytes.subarray(this.bits.index>>3):null},t.parsePacket=function(){if(71!==this.bits.read(8)&&!this.resync())return!1;var A=187+(this.bits.index>>3);this.bits.read(1);var t=this.bits.read(1);this.bits.read(1);var i=this.bits.read(13);this.bits.read(2);var e=this.bits.read(2);this.bits.read(4);var s=this.pidsToStreamIds[i];if(t&&s){var o=this.pesPacketInfo[s];o&&o.currentLength&&this.packetComplete(o)}if(1&e){if(2&e){var g=this.bits.read(8);this.bits.skip(g<<3)}if(t&&this.bits.nextBytesAreStartCode()){this.bits.skip(24),s=this.bits.read(8),this.pidsToStreamIds[i]=s;var I=this.bits.read(16);this.bits.skip(8);var a=this.bits.read(2);this.bits.skip(6);var B=this.bits.read(8),r=this.bits.index+(B<<3),C=this.pesPacketInfo[s];if(C){var n=0;if(2&a){this.bits.skip(4);var E=this.bits.read(3);this.bits.skip(1);var Q=this.bits.read(15);this.bits.skip(1);var h=this.bits.read(15);this.bits.skip(1),n=(1073741824*E+32768*Q+h)/9e4,this.currentTime=n,-1===this.startTime&&(this.startTime=n)}var d=I?I-B-3:0;this.packetStart(C,n,d)}this.bits.index=r}if(s){var c=this.pesPacketInfo[s];if(c){var l=this.bits.index>>3,u=!t&&2&e;(this.packetAddData(c,l,A)||this.guessVideoFrameEnd&&u)&&this.packetComplete(c)}}}return this.bits.index=A<<3,!0},t.resync=function(){if(!this.bits.has(9024))return!1;for(var A=this.bits.index>>3,t=0;t<187;t++)if(71===this.bits.bytes[A+t]){for(var i=!0,e=1;e<5;e++)if(71!==this.bits.bytes[A+t+188*e]){i=!1;break}if(i)return this.bits.index=A+t+1<<3,!0}return console.warn("JSMpeg: Possible garbage data. Skipping."),this.bits.skip(1496),!1},t.packetStart=function(A,t,i){A.totalLength=i,A.currentLength=0,A.pts=t},t.packetAddData=function(A,t,i){return A.buffers.push(this.bits.bytes.subarray(t,i)),A.currentLength+=i-t,0!==A.totalLength&&A.currentLength>=A.totalLength},t.packetComplete=function(A){A.destination.write(A.pts,A.buffers),A.totalLength=0,A.currentLength=0,A.buffers=[]},A}();U.STREAM={PACK_HEADER:186,SYSTEM_HEADER:187,PROGRAM_MAP:188,PRIVATE_1:189,PADDING:190,PRIVATE_2:191,AUDIO_1:192,VIDEO_1:224,DIRECTORY:255};var J=function(){function A(A){this.destination=null,this.canPlay=!1,this.collectTimestamps=!A.streaming,this.bytesWritten=0,this.timestamps=[],this.timestampIndex=0,this.startTime=0,this.decodedTime=0,Object.defineProperty(this,"currentTime",{get:this.getCurrentTime})}var t=A.prototype;return t.destroy=function(){},t.connect=function(A){this.destination=A},t.bufferGetIndex=function(){return this.bits.index},t.bufferSetIndex=function(A){this.bits.index=A},t.bufferWrite=function(A){return this.bits.write(A)},t.write=function(A,t){this.collectTimestamps&&(0===this.timestamps.length&&(this.startTime=A,this.decodedTime=A),this.timestamps.push({index:this.bytesWritten<<3,time:A})),this.bytesWritten+=this.bufferWrite(t),this.canPlay=!0},t.seek=function(A){if(this.collectTimestamps){this.timestampIndex=0;for(var t=0;tA);t++)this.timestampIndex=t;var i=this.timestamps[this.timestampIndex];i?(this.bufferSetIndex(i.index),this.decodedTime=i.time):(this.bits.index=0,this.decodedTime=this.startTime)}},t.decode=function(){this.advanceDecodedTime(0)},t.advanceDecodedTime=function(A){if(this.collectTimestamps){for(var t=-1,i=this.bufferGetIndex(),e=this.timestampIndex;ei);e++)t=e;if(-1!==t&&t!==this.timestampIndex)return this.timestampIndex=t,void(this.decodedTime=this.timestamps[this.timestampIndex].time)}this.decodedTime+=A},t.getCurrentTime=function(){return this.decodedTime},A}(),T=function(A){function t(t){var i;(i=A.call(this,t)||this).onDecodeCallback=t.onVideoDecode;var e=t.videoBufferSize||524288,s=t.streaming?L.MODE.EVICT:L.MODE.EXPAND;return i.bits=new L(e,s),i.customIntraQuantMatrix=new Uint8Array(64),i.customNonIntraQuantMatrix=new Uint8Array(64),i.blockData=new Int32Array(64),i.currentFrame=0,i.decodeFirstFrame=!1!==t.decodeFirstFrame,i}u(t,A);var i=t.prototype;return i.write=function(A,i){if(J.prototype.write.call(this,A,i),!this.hasSequenceHeader){if(-1===this.bits.findStartCode(t.START.SEQUENCE))return!1;this.decodeSequenceHeader(),this.decodeFirstFrame&&this.decode()}},i.decode=function(){var A=G();if(!this.hasSequenceHeader)return!1;if(-1===this.bits.findStartCode(t.START.PICTURE))return!1;this.decodePicture(),this.advanceDecodedTime(1/this.frameRate);var i=G()-A;return this.onDecodeCallback&&this.onDecodeCallback(this,i),!0},i.readHuffman=function(A){var t=0;do{t=A[t+this.bits.read(1)]}while(t>=0&&0!==A[t]);return A[t+2]},i.decodeSequenceHeader=function(){var A=this.bits.read(12),i=this.bits.read(12);if(this.bits.skip(4),this.frameRate=t.PICTURE_RATE[this.bits.read(4)],this.bits.skip(30),A===this.width&&i===this.height||(this.width=A,this.height=i,this.initBuffers(),this.destination&&this.destination.resize(A,i)),this.bits.read(1)){for(var e=0;e<64;e++)this.customIntraQuantMatrix[t.ZIG_ZAG[e]]=this.bits.read(8);this.intraQuantMatrix=this.customIntraQuantMatrix}if(this.bits.read(1)){for(var s=0;s<64;s++){var o=t.ZIG_ZAG[s];this.customNonIntraQuantMatrix[o]=this.bits.read(8)}this.nonIntraQuantMatrix=this.customNonIntraQuantMatrix}this.hasSequenceHeader=!0},i.initBuffers=function(){this.intraQuantMatrix=t.DEFAULT_INTRA_QUANT_MATRIX,this.nonIntraQuantMatrix=t.DEFAULT_NON_INTRA_QUANT_MATRIX,this.mbWidth=this.width+15>>4,this.mbHeight=this.height+15>>4,this.mbSize=this.mbWidth*this.mbHeight,this.codedWidth=this.mbWidth<<4,this.codedHeight=this.mbHeight<<4,this.codedSize=this.codedWidth*this.codedHeight,this.halfWidth=this.mbWidth<<3,this.halfHeight=this.mbHeight<<3,this.currentY=new Uint8ClampedArray(this.codedSize),this.currentY32=new Uint32Array(this.currentY.buffer),this.currentCr=new Uint8ClampedArray(this.codedSize>>2),this.currentCr32=new Uint32Array(this.currentCr.buffer),this.currentCb=new Uint8ClampedArray(this.codedSize>>2),this.currentCb32=new Uint32Array(this.currentCb.buffer),this.forwardY=new Uint8ClampedArray(this.codedSize),this.forwardY32=new Uint32Array(this.forwardY.buffer),this.forwardCr=new Uint8ClampedArray(this.codedSize>>2),this.forwardCr32=new Uint32Array(this.forwardCr.buffer),this.forwardCb=new Uint8ClampedArray(this.codedSize>>2),this.forwardCb32=new Uint32Array(this.forwardCb.buffer)},i.decodePicture=function(){if(this.currentFrame++,this.bits.skip(10),this.pictureType=this.bits.read(3),this.bits.skip(16),!(this.pictureType<=0||this.pictureType>=t.PICTURE_TYPE.B)){if(this.pictureType===t.PICTURE_TYPE.PREDICTIVE){if(this.fullPelForward=this.bits.read(1),this.forwardFCode=this.bits.read(3),0===this.forwardFCode)return;this.forwardRSize=this.forwardFCode-1,this.forwardF=1<=t.START.SLICE_FIRST&&A<=t.START.SLICE_LAST;)this.decodeSlice(255&A),A=this.bits.findNextStartCode();if(-1!==A&&this.bits.rewind(32),this.destination&&this.destination.render(this.currentY,this.currentCr,this.currentCb,!0),this.pictureType===t.PICTURE_TYPE.INTRA||this.pictureType===t.PICTURE_TYPE.PREDICTIVE){var i=this.forwardY,e=this.forwardY32,s=this.forwardCr,o=this.forwardCr32,g=this.forwardCb,I=this.forwardCb32;this.forwardY=this.currentY,this.forwardY32=this.currentY32,this.forwardCr=this.currentCr,this.forwardCr32=this.currentCr32,this.forwardCb=this.currentCb,this.forwardCb32=this.currentCb32,this.currentY=i,this.currentY32=e,this.currentCr=s,this.currentCr32=o,this.currentCb=g,this.currentCb32=I}}},i.decodeSlice=function(A){for(this.sliceBegin=!0,this.macroblockAddress=(A-1)*this.mbWidth-1,this.motionFwH=this.motionFwHPrev=0,this.motionFwV=this.motionFwVPrev=0,this.dcPredictorY=128,this.dcPredictorCr=128,this.dcPredictorCb=128,this.quantizerScale=this.bits.read(5);this.bits.read(1);)this.bits.skip(8);do{this.decodeMacroblock()}while(!this.bits.nextBytesAreStartCode())},i.decodeMacroblock=function(){for(var A=0,i=this.readHuffman(t.MACROBLOCK_ADDRESS_INCREMENT);34===i;)i=this.readHuffman(t.MACROBLOCK_ADDRESS_INCREMENT);for(;35===i;)A+=33,i=this.readHuffman(t.MACROBLOCK_ADDRESS_INCREMENT);if(A+=i,this.sliceBegin)this.sliceBegin=!1,this.macroblockAddress+=A;else{if(this.macroblockAddress+A>=this.mbSize)return;for(A>1&&(this.dcPredictorY=128,this.dcPredictorCr=128,this.dcPredictorCb=128,this.pictureType===t.PICTURE_TYPE.PREDICTIVE&&(this.motionFwH=this.motionFwHPrev=0,this.motionFwV=this.motionFwVPrev=0));A>1;)this.macroblockAddress++,this.mbRow=this.macroblockAddress/this.mbWidth|0,this.mbCol=this.macroblockAddress%this.mbWidth,this.copyMacroblock(this.motionFwH,this.motionFwV,this.forwardY,this.forwardCr,this.forwardCb),A--;this.macroblockAddress++}this.mbRow=this.macroblockAddress/this.mbWidth|0,this.mbCol=this.macroblockAddress%this.mbWidth;var e=t.MACROBLOCK_TYPE[this.pictureType];this.macroblockType=this.readHuffman(e),this.macroblockIntra=1&this.macroblockType,this.macroblockMotFw=8&this.macroblockType,0!=(16&this.macroblockType)&&(this.quantizerScale=this.bits.read(5)),this.macroblockIntra?(this.motionFwH=this.motionFwHPrev=0,this.motionFwV=this.motionFwVPrev=0):(this.dcPredictorY=128,this.dcPredictorCr=128,this.dcPredictorCb=128,this.decodeMotionVectors(),this.copyMacroblock(this.motionFwH,this.motionFwV,this.forwardY,this.forwardCr,this.forwardCb));for(var s=0!=(2&this.macroblockType)?this.readHuffman(t.CODE_BLOCK_PATTERN):this.macroblockIntra?63:0,o=0,g=32;o<6;o++)0!=(s&g)&&this.decodeBlock(o),g>>=1},i.decodeMotionVectors=function(){var A,i,e=0;this.macroblockMotFw?(0!==(A=this.readHuffman(t.MOTION))&&1!==this.forwardF?(e=this.bits.read(this.forwardRSize),i=(Math.abs(A)-1<(this.forwardF<<4)-1?this.motionFwHPrev-=this.forwardF<<5:this.motionFwHPrev<-this.forwardF<<4&&(this.motionFwHPrev+=this.forwardF<<5),this.motionFwH=this.motionFwHPrev,this.fullPelForward&&(this.motionFwH<<=1),0!==(A=this.readHuffman(t.MOTION))&&1!==this.forwardF?(e=this.bits.read(this.forwardRSize),i=(Math.abs(A)-1<(this.forwardF<<4)-1?this.motionFwVPrev-=this.forwardF<<5:this.motionFwVPrev<-this.forwardF<<4&&(this.motionFwVPrev+=this.forwardF<<5),this.motionFwV=this.motionFwVPrev,this.fullPelForward&&(this.motionFwV<<=1)):this.pictureType===t.PICTURE_TYPE.PREDICTIVE&&(this.motionFwH=this.motionFwHPrev=0,this.motionFwV=this.motionFwVPrev=0)},i.copyMacroblock=function(A,t,i,e,s){var o,g,I,a,B,r,C,n,E,Q,h,d,c,l,u,w,p,D,m,f=this.currentY32,y=this.currentCb32,R=this.currentCr32;if(g=(o=this.codedWidth)-16,I=A>>1,a=t>>1,B=1==(1&A),r=1==(1&t),C=((this.mbRow<<4)+a)*o+(this.mbCol<<4)+I,E=(n=this.mbRow*o+this.mbCol<<2)+(o<<2),B)if(r)for(;n>2&255,c|=(h=i[++C]+i[C+o])+d+2<<6&65280,c|=h+(d=i[++C]+i[C+o])+2<<14&16711680,h=i[++C]+i[C+o],C++,c|=h+d+2<<22&4278190080,f[n++]=c;n+=g>>2,C+=g-1}else for(;n>1&255,c|=(h=i[C++])+d+1<<7&65280,c|=h+(d=i[C++])+1<<15&16711680,c|=(h=i[C++])+d+1<<23&4278190080,f[n++]=c;n+=g>>2,C+=g-1}else if(r)for(;n>1&255,c|=i[++C]+i[C+o]+1<<7&65280,c|=i[++C]+i[C+o]+1<<15&16711680,c|=i[++C]+i[C+o]+1<<23&4278190080,C++,f[n++]=c;n+=g>>2,C+=g}else for(;n>2,C+=g}if(g=(o=this.halfWidth)-8,I=A/2>>1,a=t/2>>1,B=1==(A/2&1),r=1==(t/2&1),C=((this.mbRow<<3)+a)*o+(this.mbCol<<3)+I,E=(n=this.mbRow*o+this.mbCol<<1)+(o<<1),B)if(r)for(;n>2&255,m=p+(D=s[C]+s[C+o])+2>>2&255,w|=(l=e[++C]+e[C+o])+u+2<<6&65280,m|=(p=s[C]+s[C+o])+D+2<<6&65280,w|=l+(u=e[++C]+e[C+o])+2<<14&16711680,m|=p+(D=s[C]+s[C+o])+2<<14&16711680,l=e[++C]+e[C+o],p=s[C]+s[C+o],C++,w|=l+u+2<<22&4278190080,m|=p+D+2<<22&4278190080,R[n]=w,y[n]=m,n++;n+=g>>2,C+=g-1}else for(;n>1&255,m=p+(D=s[C++])+1>>1&255,w|=(l=e[C])+u+1<<7&65280,m|=(p=s[C++])+D+1<<7&65280,w|=l+(u=e[C])+1<<15&16711680,m|=p+(D=s[C++])+1<<15&16711680,w|=(l=e[C])+u+1<<23&4278190080,m|=(p=s[C++])+D+1<<23&4278190080,R[n]=w,y[n]=m,n++;n+=g>>2,C+=g-1}else if(r)for(;n>1&255,m=s[C]+s[C+o]+1>>1&255,w|=e[++C]+e[C+o]+1<<7&65280,m|=s[C]+s[C+o]+1<<7&65280,w|=e[++C]+e[C+o]+1<<15&16711680,m|=s[C]+s[C+o]+1<<15&16711680,w|=e[++C]+e[C+o]+1<<23&4278190080,m|=s[C]+s[C+o]+1<<23&4278190080,C++,R[n]=w,y[n]=m,n++;n+=g>>2,C+=g}else for(;n>2,C+=g}},i.decodeBlock=function(A){var i,e=0;if(this.macroblockIntra){var s,o;if(A<4?(s=this.dcPredictorY,o=this.readHuffman(t.DCT_DC_SIZE_LUMINANCE)):(s=4===A?this.dcPredictorCr:this.dcPredictorCb,o=this.readHuffman(t.DCT_DC_SIZE_CHROMINANCE)),o>0){var g=this.bits.read(o);this.blockData[0]=0!=(g&1<0&&0===this.bits.read(1))break;65535===n?(C=this.bits.read(6),0===(r=this.bits.read(8))?r=this.bits.read(8):128===r?r=this.bits.read(8)-256:r>128&&(r-=256)):(C=n>>8,r=255&n,this.bits.read(1)&&(r=-r)),e+=C;var E=t.ZIG_ZAG[e];e++,r<<=1,this.macroblockIntra||(r+=r<0?-1:1),0==(1&(r=r*this.quantizerScale*i[E]>>4))&&(r-=r>0?1:-1),r>2047?r=2047:r<-2048&&(r=-2048),this.blockData[E]=r*t.PREMULTIPLIER_MATRIX[E]}A<4?(I=this.currentY,B=this.codedWidth-8,a=this.mbRow*this.codedWidth+this.mbCol<<4,0!=(1&A)&&(a+=8),0!=(2&A)&&(a+=this.codedWidth<<3)):(I=4===A?this.currentCb:this.currentCr,B=(this.codedWidth>>1)-8,a=(this.mbRow*this.codedWidth<<2)+(this.mbCol<<3)),this.macroblockIntra?1===e?(t.CopyValueToDestination(this.blockData[0]+128>>8,I,a,B),this.blockData[0]=0):(t.IDCT(this.blockData),t.CopyBlockToDestination(this.blockData,I,a,B),S(this.blockData,0)):1===e?(t.AddValueToDestination(this.blockData[0]+128>>8,I,a,B),this.blockData[0]=0):(t.IDCT(this.blockData),t.AddBlockToDestination(this.blockData,I,a,B),S(this.blockData,0)),e=0},t.CopyBlockToDestination=function(A,t,i,e){for(var s=0;s<64;s+=8,i+=e+8)t[i+0]=A[s+0],t[i+1]=A[s+1],t[i+2]=A[s+2],t[i+3]=A[s+3],t[i+4]=A[s+4],t[i+5]=A[s+5],t[i+6]=A[s+6],t[i+7]=A[s+7]},t.AddBlockToDestination=function(A,t,i,e){for(var s=0;s<64;s+=8,i+=e+8)t[i+0]+=A[s+0],t[i+1]+=A[s+1],t[i+2]+=A[s+2],t[i+3]+=A[s+3],t[i+4]+=A[s+4],t[i+5]+=A[s+5],t[i+6]+=A[s+6],t[i+7]+=A[s+7]},t.CopyValueToDestination=function(A,t,i,e){for(var s=0;s<64;s+=8,i+=e+8)t[i+0]=A,t[i+1]=A,t[i+2]=A,t[i+3]=A,t[i+4]=A,t[i+5]=A,t[i+6]=A,t[i+7]=A},t.AddValueToDestination=function(A,t,i,e){for(var s=0;s<64;s+=8,i+=e+8)t[i+0]+=A,t[i+1]+=A,t[i+2]+=A,t[i+3]+=A,t[i+4]+=A,t[i+5]+=A,t[i+6]+=A,t[i+7]+=A},t.IDCT=function(A){for(var t,i,e,s,o,g,I,a,B,r,C,n,E,Q,h,d,c,l,u=0;u<8;++u)t=A[32+u],i=A[16+u]+A[48+u],e=A[40+u]-A[24+u],g=A[8+u]+A[56+u],I=A[24+u]+A[40+u],B=(E=(473*(s=A[8+u]-A[56+u])-196*e+128>>8)-(o=g+I))-(362*(g-I)+128>>8),Q=(r=(a=A[0+u])-t)+(C=(362*(A[16+u]-A[48+u])+128>>8)-i),h=(n=a+t)+i,d=r-C,c=n-i,l=-B-(473*e+196*s+128>>8),A[0+u]=o+h,A[8+u]=E+Q,A[16+u]=d-B,A[24+u]=c-l,A[32+u]=c+l,A[40+u]=B+d,A[48+u]=Q-E,A[56+u]=h-o;for(var w=0;w<64;w+=8)t=A[4+w],i=A[2+w]+A[6+w],e=A[5+w]-A[3+w],g=A[1+w]+A[7+w],I=A[3+w]+A[5+w],B=(E=(473*(s=A[1+w]-A[7+w])-196*e+128>>8)-(o=g+I))-(362*(g-I)+128>>8),Q=(r=(a=A[0+w])-t)+(C=(362*(A[2+w]-A[6+w])+128>>8)-i),h=(n=a+t)+i,d=r-C,c=n-i,l=-B-(473*e+196*s+128>>8),A[0+w]=o+h+128>>8,A[1+w]=E+Q+128>>8,A[2+w]=d-B+128>>8,A[3+w]=c-l+128>>8,A[4+w]=c+l+128>>8,A[5+w]=B+d+128>>8,A[6+w]=Q-E+128>>8,A[7+w]=h-o+128>>8},t}(J);T.prototype.frameRate=30,T.prototype.currentY=null,T.prototype.currentCr=null,T.prototype.currentCb=null,T.prototype.pictureType=0,T.prototype.forwardY=null,T.prototype.forwardCr=null,T.prototype.forwardCb=null,T.prototype.fullPelForward=!1,T.prototype.forwardFCode=0,T.prototype.forwardRSize=0,T.prototype.forwardF=0,T.prototype.quantizerScale=0,T.prototype.sliceBegin=!1,T.prototype.macroblockAddress=0,T.prototype.mbRow=0,T.prototype.mbCol=0,T.prototype.macroblockType=0,T.prototype.macroblockIntra=!1,T.prototype.macroblockMotFw=!1,T.prototype.motionFwH=0,T.prototype.motionFwV=0,T.prototype.motionFwHPrev=0,T.prototype.motionFwVPrev=0,T.prototype.dcPredictorY=0,T.prototype.dcPredictorCr=0,T.prototype.dcPredictorCb=0,T.prototype.blockData=null,T.PICTURE_RATE=[0,23.976,24,25,29.97,30,50,59.94,60,0,0,0,0,0,0,0],T.ZIG_ZAG=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),T.DEFAULT_INTRA_QUANT_MATRIX=new Uint8Array([8,16,19,22,26,27,29,34,16,16,22,24,27,29,34,37,19,22,26,27,29,34,34,38,22,22,26,27,29,34,37,40,22,26,27,29,32,35,40,48,26,27,29,32,35,40,48,58,26,27,29,34,38,46,56,69,27,29,35,38,46,56,69,83]),T.DEFAULT_NON_INTRA_QUANT_MATRIX=new Uint8Array([16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16]),T.PREMULTIPLIER_MATRIX=new Uint8Array([32,44,42,38,32,25,17,9,44,62,58,52,44,35,24,12,42,58,55,49,42,33,23,12,38,52,49,44,38,30,20,10,32,44,42,38,32,25,17,9,25,35,33,30,25,20,14,7,17,24,23,20,17,14,9,5,9,12,12,10,9,7,5,2]),T.MACROBLOCK_ADDRESS_INCREMENT=new Int16Array([3,6,0,9,12,0,0,0,1,15,18,0,21,24,0,27,30,0,33,36,0,0,0,3,0,0,2,39,42,0,45,48,0,0,0,5,0,0,4,51,54,0,57,60,0,0,0,7,0,0,6,63,66,0,69,72,0,75,78,0,81,84,0,-1,87,0,-1,90,0,93,96,0,99,102,0,105,108,0,111,114,0,0,0,9,0,0,8,117,120,0,123,126,0,129,132,0,135,138,0,0,0,15,0,0,14,0,0,13,0,0,12,0,0,11,0,0,10,141,-1,0,-1,144,0,147,150,0,153,156,0,159,162,0,165,168,0,171,174,0,177,180,0,183,-1,0,-1,186,0,189,192,0,195,198,0,201,204,0,207,210,0,213,216,0,219,222,0,0,0,21,0,0,20,0,0,19,0,0,18,0,0,17,0,0,16,0,0,35,0,0,34,0,0,33,0,0,32,0,0,31,0,0,30,0,0,29,0,0,28,0,0,27,0,0,26,0,0,25,0,0,24,0,0,23,0,0,22]),T.MACROBLOCK_TYPE_INTRA=new Int8Array([3,6,0,-1,9,0,0,0,1,0,0,17]),T.MACROBLOCK_TYPE_PREDICTIVE=new Int8Array([3,6,0,9,12,0,0,0,10,15,18,0,0,0,2,21,24,0,0,0,8,27,30,0,33,36,0,-1,39,0,0,0,18,0,0,26,0,0,1,0,0,17]),T.MACROBLOCK_TYPE_B=new Int8Array([3,6,0,9,15,0,12,18,0,24,21,0,0,0,12,27,30,0,0,0,14,39,42,0,36,33,0,0,0,4,0,0,6,54,48,0,45,51,0,0,0,8,0,0,10,-1,57,0,0,0,1,60,63,0,0,0,30,0,0,17,0,0,22,0,0,26]),T.MACROBLOCK_TYPE=[null,T.MACROBLOCK_TYPE_INTRA,T.MACROBLOCK_TYPE_PREDICTIVE,T.MACROBLOCK_TYPE_B],T.CODE_BLOCK_PATTERN=new Int16Array([6,3,0,9,18,0,12,15,0,24,33,0,36,39,0,27,21,0,30,42,0,60,57,0,54,48,0,69,51,0,81,75,0,63,84,0,45,66,0,72,78,0,0,0,60,105,120,0,132,144,0,114,108,0,126,141,0,87,93,0,117,96,0,0,0,32,135,138,0,99,123,0,129,102,0,0,0,4,90,111,0,0,0,8,0,0,16,0,0,44,150,168,0,0,0,28,0,0,52,0,0,62,183,177,0,156,180,0,0,0,1,165,162,0,0,0,61,0,0,56,171,174,0,0,0,2,0,0,40,153,186,0,0,0,48,192,189,0,147,159,0,0,0,20,0,0,12,240,249,0,0,0,63,231,225,0,195,219,0,252,198,0,0,0,24,0,0,36,0,0,3,207,261,0,243,237,0,204,213,0,210,234,0,201,228,0,216,222,0,258,255,0,264,246,0,-1,282,0,285,291,0,0,0,33,0,0,9,318,330,0,306,348,0,0,0,5,0,0,10,279,267,0,0,0,6,0,0,18,0,0,17,0,0,34,339,357,0,309,312,0,270,276,0,327,321,0,351,354,0,303,297,0,294,288,0,300,273,0,342,345,0,315,324,0,336,333,0,363,375,0,0,0,41,0,0,14,0,0,21,372,366,0,360,369,0,0,0,11,0,0,19,0,0,7,0,0,35,0,0,13,0,0,50,0,0,49,0,0,58,0,0,37,0,0,25,0,0,45,0,0,57,0,0,26,0,0,29,0,0,38,0,0,53,0,0,23,0,0,43,0,0,46,0,0,42,0,0,22,0,0,54,0,0,51,0,0,15,0,0,30,0,0,39,0,0,47,0,0,55,0,0,27,0,0,59,0,0,31]),T.MOTION=new Int16Array([3,6,0,12,9,0,0,0,0,18,15,0,24,21,0,0,0,-1,0,0,1,27,30,0,36,33,0,0,0,2,0,0,-2,42,45,0,48,39,0,60,54,0,0,0,3,0,0,-3,51,57,0,-1,69,0,81,75,0,78,63,0,72,66,0,96,84,0,87,93,0,-1,99,0,108,105,0,0,0,-4,90,102,0,0,0,4,0,0,-7,0,0,5,111,123,0,0,0,-5,0,0,7,114,120,0,126,117,0,0,0,-6,0,0,6,153,162,0,150,147,0,135,138,0,156,141,0,129,159,0,132,144,0,0,0,10,0,0,9,0,0,8,0,0,-8,171,198,0,0,0,-9,180,192,0,168,183,0,165,186,0,174,189,0,0,0,-10,177,195,0,0,0,12,0,0,16,0,0,13,0,0,14,0,0,11,0,0,15,0,0,-16,0,0,-12,0,0,-14,0,0,-15,0,0,-11,0,0,-13]),T.DCT_DC_SIZE_LUMINANCE=new Int8Array([6,3,0,18,15,0,9,12,0,0,0,1,0,0,2,27,24,0,21,30,0,0,0,0,36,33,0,0,0,4,0,0,3,39,42,0,0,0,5,0,0,6,48,45,0,51,-1,0,0,0,7,0,0,8]),T.DCT_DC_SIZE_CHROMINANCE=new Int8Array([6,3,0,12,9,0,18,15,0,24,21,0,0,0,2,0,0,1,0,0,0,30,27,0,0,0,3,36,33,0,0,0,4,42,39,0,0,0,5,48,45,0,0,0,6,51,-1,0,0,0,7,0,0,8]),T.DCT_COEFF=new Int32Array([3,6,0,12,9,0,0,0,1,21,24,0,18,15,0,39,27,0,33,30,0,42,36,0,0,0,257,60,66,0,54,63,0,48,57,0,0,0,513,51,45,0,0,0,2,0,0,3,81,75,0,87,93,0,72,78,0,96,90,0,0,0,1025,69,84,0,0,0,769,0,0,258,0,0,1793,0,0,65535,0,0,1537,111,108,0,0,0,1281,105,102,0,117,114,0,99,126,0,120,123,0,156,150,0,162,159,0,144,147,0,129,135,0,138,132,0,0,0,2049,0,0,4,0,0,514,0,0,2305,153,141,0,165,171,0,180,168,0,177,174,0,183,186,0,0,0,2561,0,0,3329,0,0,6,0,0,259,0,0,5,0,0,770,0,0,2817,0,0,3073,228,225,0,201,210,0,219,213,0,234,222,0,216,231,0,207,192,0,204,189,0,198,195,0,243,261,0,273,240,0,246,237,0,249,258,0,279,276,0,252,255,0,270,282,0,264,267,0,0,0,515,0,0,260,0,0,7,0,0,1026,0,0,1282,0,0,4097,0,0,3841,0,0,3585,315,321,0,333,342,0,312,291,0,375,357,0,288,294,0,-1,369,0,285,303,0,318,363,0,297,306,0,339,309,0,336,348,0,330,300,0,372,345,0,351,366,0,327,354,0,360,324,0,381,408,0,417,420,0,390,378,0,435,438,0,384,387,0,0,0,2050,396,402,0,465,462,0,0,0,8,411,399,0,429,432,0,453,414,0,426,423,0,0,0,10,0,0,9,0,0,11,0,0,5377,0,0,1538,0,0,771,0,0,5121,0,0,1794,0,0,4353,0,0,4609,0,0,4865,444,456,0,0,0,1027,459,450,0,0,0,261,393,405,0,0,0,516,447,441,0,516,519,0,486,474,0,510,483,0,504,498,0,471,537,0,507,501,0,522,513,0,534,531,0,468,477,0,492,495,0,549,546,0,525,528,0,0,0,263,0,0,2562,0,0,2306,0,0,5633,0,0,5889,0,0,6401,0,0,6145,0,0,1283,0,0,772,0,0,13,0,0,12,0,0,14,0,0,15,0,0,517,0,0,6657,0,0,262,540,543,0,480,489,0,588,597,0,0,0,27,609,555,0,606,603,0,0,0,19,0,0,22,591,621,0,0,0,18,573,576,0,564,570,0,0,0,20,552,582,0,0,0,21,558,579,0,0,0,23,612,594,0,0,0,25,0,0,24,600,615,0,0,0,31,0,0,30,0,0,28,0,0,29,0,0,26,0,0,17,0,0,16,567,618,0,561,585,0,654,633,0,0,0,37,645,648,0,0,0,36,630,636,0,0,0,34,639,627,0,663,666,0,657,624,0,651,642,0,669,660,0,0,0,35,0,0,267,0,0,40,0,0,268,0,0,266,0,0,32,0,0,264,0,0,265,0,0,38,0,0,269,0,0,270,0,0,33,0,0,39,0,0,7937,0,0,6913,0,0,7681,0,0,4098,0,0,7425,0,0,7169,0,0,271,0,0,274,0,0,273,0,0,272,0,0,1539,0,0,2818,0,0,3586,0,0,3330,0,0,3074,0,0,3842]),T.PICTURE_TYPE={INTRA:1,PREDICTIVE:2,B:3},T.START={SEQUENCE:179,SLICE_FIRST:1,SLICE_LAST:175,PICTURE:0,EXTENSION:181,USER_DATA:178};var v=function(A){function t(t){var i;return(i=A.call(this,t)||this).onDecodeCallback=t.onVideoDecode,i.module=t.wasmModule,i.bufferSize=t.videoBufferSize||524288,i.bufferMode=t.streaming?L.MODE.EVICT:L.MODE.EXPAND,i.decodeFirstFrame=!1!==t.decodeFirstFrame,i.hasSequenceHeader=!1,i}u(t,A);var i=t.prototype;return i.initializeWasmDecoder=function(){this.module.instance?(this.instance=this.module.instance,this.functions=this.module.instance.exports,this.decoder=this.functions._mpeg1_decoder_create(this.bufferSize,this.bufferMode)):console.warn("JSMpeg: WASM module not compiled yet")},i.destroy=function(){this.decoder&&this.functions._mpeg1_decoder_destroy(this.decoder)},i.bufferGetIndex=function(){if(this.decoder)return this.functions._mpeg1_decoder_get_index(this.decoder)},i.bufferSetIndex=function(A){this.decoder&&this.functions._mpeg1_decoder_set_index(this.decoder,A)},i.bufferWrite=function(A){this.decoder||this.initializeWasmDecoder();for(var t=0,i=0;i>2)),g=this.instance.heapU8.subarray(e,e+(this.codedSize>>2));this.destination.render(s,o,g,!1)}this.advanceDecodedTime(1/this.frameRate);var I=G()-A;return this.onDecodeCallback&&this.onDecodeCallback(this,I),!0},t}(J),x=function(A){function t(i){var e;(e=A.call(this,i)||this).onDecodeCallback=i.onAudioDecode;var s=i.audioBufferSize||131072,o=i.streaming?L.MODE.EVICT:L.MODE.EXPAND;e.bits=new L(s,o),e.left=new Float32Array(1152),e.right=new Float32Array(1152),e.sampleRate=44100,e.D=new Float32Array(1024),e.D.set(t.SYNTHESIS_WINDOW,0),e.D.set(t.SYNTHESIS_WINDOW,512),e.V=[new Float32Array(1024),new Float32Array(1024)],e.U=new Int32Array(32),e.VPos=0,e.allocation=[new Array(32),new Array(32)],e.scaleFactorInfo=[new Uint8Array(32),new Uint8Array(32)],e.scaleFactor=[new Array(32),new Array(32)],e.sample=[new Array(32),new Array(32)];for(var g=0;g<2;g++)for(var I=0;I<32;I++)e.scaleFactor[g][I]=[0,0,0],e.sample[g][I]=[0,0,0];return e}u(t,A);var i=t.prototype;return i.decode=function(){var A=G(),t=this.bits.index>>3;if(t>=this.bits.byteLength)return!1;var i=this.decodeFrame(this.left,this.right);if(this.bits.index=t+i<<3,!i)return!1;this.destination&&this.destination.play(this.sampleRate,this.left,this.right),this.advanceDecodedTime(this.left.length/this.sampleRate);var e=G()-A;return this.onDecodeCallback&&this.onDecodeCallback(this,e),!0},i.getCurrentTime=function(){var A=this.destination?this.destination.enqueuedTime:0;return this.decodedTime-A},i.decodeFrame=function(A,i){var e=this.bits.read(11),s=this.bits.read(2),o=this.bits.read(2),g=!this.bits.read(1);if(e!==t.FRAME_SYNC||s!==t.VERSION.MPEG_1||o!==t.LAYER.II)return 0;var I=this.bits.read(4)-1;if(I>13)return 0;var a=this.bits.read(2),B=t.SAMPLE_RATE[a];if(3===a)return 0;s===t.VERSION.MPEG_2&&(a+=4,I+=14);var r=this.bits.read(1);this.bits.read(1);var C=this.bits.read(2),n=0;C===t.MODE.JOINT_STEREO?n=this.bits.read(2)+1<<2:(this.bits.skip(2),n=C===t.MODE.MONO?0:32),this.bits.skip(4),g&&this.bits.skip(16);var E=144e3*t.BIT_RATE[I]/(B=t.SAMPLE_RATE[a])+r|0,Q=0,h=0;if(s===t.VERSION.MPEG_2)Q=2,h=30;else{var d=C===t.MODE.MONO?0:1,c=t.QUANT_LUT_STEP_1[d][I];h=63&(Q=t.QUANT_LUT_STEP_2[c][a]),Q>>=6}n>h&&(n=h);for(var l=0;l>1),U=this.VPos%128>>1;U<1024;){for(var J=0;J<32;++J)this.U[J]+=this.D[L++]*this.V[N][U++];U+=96,L+=32}for(U=1120-U,L-=480;U<1024;){for(var T=0;T<32;++T)this.U[T]+=this.D[L++]*this.V[N][U++];U+=96,L+=32}for(var v=0===N?A:i,x=0;x<32;x++)v[R+x]=this.U[x]/2147418112}R+=32}}return this.sampleRate=B,E},i.readAllocation=function(A,i){var e=t.QUANT_LUT_STEP_3[i][A],s=t.QUANT_LUT_STEP4[15&e][this.bits.read(e>>4)];return s?t.QUANT_TAB[s-1]:0},i.readSamples=function(A,i,e){var s=this.allocation[A][i],o=this.scaleFactor[A][i][e],g=this.sample[A][i],I=0;if(s){if(63===o)o=0;else{var a=o/3|0;o=t.SCALEFACTOR_BASE[o%3]+(1<>1)>>a}var B=s.levels;s.group?(I=this.bits.read(s.bits),g[0]=I%B,I=I/B|0,g[1]=I%B,g[2]=I/B|0):(g[0]=this.bits.read(s.bits),g[1]=this.bits.read(s.bits),g[2]=this.bits.read(s.bits));var r=65536/(B+1)|0;I=((B=(B+1>>1)-1)-g[0])*r,g[0]=I*(o>>12)+(I*(4095&o)+2048>>12)>>12,I=(B-g[1])*r,g[1]=I*(o>>12)+(I*(4095&o)+2048>>12)>>12,I=(B-g[2])*r,g[2]=I*(o>>12)+(I*(4095&o)+2048>>12)>>12}else g[0]=g[1]=g[2]=0},t.MatrixTransform=function(A,t,i,e){var s,o,g,I,a,B,r,C,n,E,Q,h,d,c,l,u,w,p,D,m,f,y,R,k,b,G,S,F,M,q,N,L,U;s=A[0][t]+A[31][t],o=.500602998235*(A[0][t]-A[31][t]),g=A[1][t]+A[30][t],I=.505470959898*(A[1][t]-A[30][t]),a=A[2][t]+A[29][t],B=.515447309923*(A[2][t]-A[29][t]),r=A[3][t]+A[28][t],C=.53104259109*(A[3][t]-A[28][t]),n=A[4][t]+A[27][t],E=.553103896034*(A[4][t]-A[27][t]),Q=A[5][t]+A[26][t],h=.582934968206*(A[5][t]-A[26][t]),d=A[6][t]+A[25][t],c=.622504123036*(A[6][t]-A[25][t]),l=A[7][t]+A[24][t],u=.674808341455*(A[7][t]-A[24][t]),w=A[8][t]+A[23][t],p=.744536271002*(A[8][t]-A[23][t]),D=A[9][t]+A[22][t],m=.839349645416*(A[9][t]-A[22][t]),f=A[10][t]+A[21][t],y=.972568237862*(A[10][t]-A[21][t]),R=A[11][t]+A[20][t],k=1.16943993343*(A[11][t]-A[20][t]),b=A[12][t]+A[19][t],G=1.48416461631*(A[12][t]-A[19][t]),S=A[13][t]+A[18][t],F=2.05778100995*(A[13][t]-A[18][t]),M=A[14][t]+A[17][t],q=3.40760841847*(A[14][t]-A[17][t]),U=s+(N=A[15][t]+A[16][t]),N=.502419286188*(s-N),s=g+M,M=.52249861494*(g-M),g=a+S,S=.566944034816*(a-S),a=r+b,b=.64682178336*(r-b),r=n+R,R=.788154623451*(n-R),n=Q+f,f=1.06067768599*(Q-f),Q=d+D,D=1.72244709824*(d-D),d=l+w,w=5.10114861869*(l-w),l=U+d,d=.509795579104*(U-d),U=s+Q,s=.601344886935*(s-Q),Q=g+n,n=.899976223136*(g-n),g=a+r,r=2.56291544774*(a-r),a=l+g,l=.541196100146*(l-g),g=U+Q,Q=1.30656296488*(U-Q),U=a+g,a=.707106781187*(a-g),g=l+Q,g+=l=.707106781187*(l-Q),Q=d+r,d=.541196100146*(d-r),r=s+n,n=1.30656296488*(s-n),s=Q+r,r=.707106781187*(Q-r),Q=d+n,s+=Q+=d=.707106781187*(d-n),Q+=r,r+=d,n=N+w,N=.509795579104*(N-w),w=M+D,M=.601344886935*(M-D),D=S+f,f=.899976223136*(S-f),S=b+R,R=2.56291544774*(b-R),b=n+S,n=.541196100146*(n-S),S=w+D,D=1.30656296488*(w-D),w=b+S,S=.707106781187*(b-S),b=n+D,D=.707106781187*(n-D),n=N+R,N=.541196100146*(N-R),R=M+f,f=1.30656296488*(M-f),M=n+R,R=.707106781187*(n-R),n=N+f,w+=M+=n+=N=.707106781187*(N-f),M+=b+=D,b+=n+=R,n+=S,S+=R+=N,R+=D,D+=N,f=o+(L=10.1900081235*(A[15][t]-A[16][t])),o=.502419286188*(o-L),L=I+q,I=.52249861494*(I-q),q=B+F,F=.566944034816*(B-F),B=C+G,C=.64682178336*(C-G),G=E+k,E=.788154623451*(E-k),k=h+y,y=1.06067768599*(h-y),h=c+m,m=1.72244709824*(c-m),c=u+p,u=5.10114861869*(u-p),p=f+c,c=.509795579104*(f-c),f=L+h,L=.601344886935*(L-h),h=q+k,k=.899976223136*(q-k),q=B+G,G=2.56291544774*(B-G),B=p+q,p=.541196100146*(p-q),q=f+h,h=1.30656296488*(f-h),f=B+q,q=.707106781187*(B-q),B=p+h,h=.707106781187*(p-h),p=c+G,G=.541196100146*(c-G),c=L+k,k=1.30656296488*(L-k),L=p+c,c=.707106781187*(p-c),p=G+k,L+=p+=k=.707106781187*(G-k),p+=c,G=c+k,c=o+u,o=.509795579104*(o-u),u=I+m,I=.601344886935*(I-m),m=F+y,y=.899976223136*(F-y),F=C+E,E=2.56291544774*(C-E),C=c+F,c=.541196100146*(c-F),F=u+m,m=1.30656296488*(u-m),u=C+F,F=.707106781187*(C-F),C=c+m,m=.707106781187*(c-m),c=o+E,o=.541196100146*(o-E),E=I+y,y=1.30656296488*(I-y),I=c+E,E=.707106781187*(c-E),c=o+y,f+=u+=I+=c+=o=.707106781187*(o-y),u+=L,L+=I+=C+=m,I+=B+=h,B+=C+=c+=E,C+=p,p+=c+=F,c+=q,q+=F+=E+=o,F+=G,G+=E+=m,E+=h,h+=m+=o,m+=k,k+=o,i[e+48]=-U,i[e+49]=i[e+47]=-f,i[e+50]=i[e+46]=-w,i[e+51]=i[e+45]=-u,i[e+52]=i[e+44]=-s,i[e+53]=i[e+43]=-L,i[e+54]=i[e+42]=-M,i[e+55]=i[e+41]=-I,i[e+56]=i[e+40]=-g,i[e+57]=i[e+39]=-B,i[e+58]=i[e+38]=-b,i[e+59]=i[e+37]=-C,i[e+60]=i[e+36]=-Q,i[e+61]=i[e+35]=-p,i[e+62]=i[e+34]=-n,i[e+63]=i[e+33]=-c,i[e+32]=-a,i[e+0]=a,i[e+31]=-q,i[e+1]=q,i[e+30]=-S,i[e+2]=S,i[e+29]=-F,i[e+3]=F,i[e+28]=-r,i[e+4]=r,i[e+27]=-G,i[e+5]=G,i[e+26]=-R,i[e+6]=R,i[e+25]=-E,i[e+7]=E,i[e+24]=-l,i[e+8]=l,i[e+23]=-h,i[e+9]=h,i[e+22]=-D,i[e+10]=D,i[e+21]=-m,i[e+11]=m,i[e+20]=-d,i[e+12]=d,i[e+19]=-k,i[e+13]=k,i[e+18]=-N,i[e+14]=N,i[e+17]=-o,i[e+15]=o,i[e+16]=0},t}(J);x.FRAME_SYNC=2047,x.VERSION={MPEG_2_5:0,MPEG_2:2,MPEG_1:3},x.LAYER={III:1,II:2,I:3},x.MODE={STEREO:0,JOINT_STEREO:1,DUAL_CHANNEL:2,MONO:3},x.SAMPLE_RATE=new Uint16Array([44100,48e3,32e3,0,22050,24e3,16e3,0]),x.BIT_RATE=new Uint16Array([32,48,56,64,80,96,112,128,160,192,224,256,320,384,8,16,24,32,40,48,56,64,80,96,112,128,144,160]),x.SCALEFACTOR_BASE=new Uint32Array([33554432,26632170,21137968]),x.SYNTHESIS_WINDOW=new Float32Array([0,-.5,-.5,-.5,-.5,-.5,-.5,-1,-1,-1,-1,-1.5,-1.5,-2,-2,-2.5,-2.5,-3,-3.5,-3.5,-4,-4.5,-5,-5.5,-6.5,-7,-8,-8.5,-9.5,-10.5,-12,-13,-14.5,-15.5,-17.5,-19,-20.5,-22.5,-24.5,-26.5,-29,-31.5,-34,-36.5,-39.5,-42.5,-45.5,-48.5,-52,-55.5,-58.5,-62.5,-66,-69.5,-73.5,-77,-80.5,-84.5,-88,-91.5,-95,-98,-101,-104,106.5,109,111,112.5,113.5,114,114,113.5,112,110.5,107.5,104,100,94.5,88.5,81.5,73,63.5,53,41.5,28.5,14.5,-1,-18,-36,-55.5,-76.5,-98.5,-122,-147,-173.5,-200.5,-229.5,-259.5,-290.5,-322.5,-355.5,-389.5,-424,-459.5,-495.5,-532,-568.5,-605,-641.5,-678,-714,-749,-783.5,-817,-849,-879.5,-908.5,-935,-959.5,-981,-1000.5,-1016,-1028.5,-1037.5,-1042.5,-1043.5,-1040,-1031.5,1018.5,1e3,976,946.5,911,869.5,822,767.5,707,640,565.5,485,397,302.5,201,92.5,-22.5,-144,-272.5,-407,-547.5,-694,-846,-1003,-1165,-1331.5,-1502,-1675.5,-1852.5,-2031.5,-2212.5,-2394,-2576.5,-2758.5,-2939.5,-3118.5,-3294.5,-3467.5,-3635.5,-3798.5,-3955,-4104.5,-4245.5,-4377.5,-4499,-4609.5,-4708,-4792.5,-4863.5,-4919,-4958,-4979.5,-4983,-4967.5,-4931.5,-4875,-4796,-4694.5,-4569.5,-4420,-4246,-4046,-3820,-3567,3287,2979.5,2644,2280.5,1888,1467.5,1018.5,541,35,-499,-1061,-1650,-2266.5,-2909,-3577,-4270,-4987.5,-5727.5,-6490,-7274,-8077.5,-8899.5,-9739,-10594.5,-11464.5,-12347,-13241,-14144.5,-15056,-15973.5,-16895.5,-17820,-18744.5,-19668,-20588,-21503,-22410.5,-23308.5,-24195,-25068.5,-25926.5,-26767,-27589,-28389,-29166.5,-29919,-30644.5,-31342,-32009.5,-32645,-33247,-33814.5,-34346,-34839.5,-35295,-35710,-36084.5,-36417.5,-36707.5,-36954,-37156.5,-37315,-37428,-37496,37519,37496,37428,37315,37156.5,36954,36707.5,36417.5,36084.5,35710,35295,34839.5,34346,33814.5,33247,32645,32009.5,31342,30644.5,29919,29166.5,28389,27589,26767,25926.5,25068.5,24195,23308.5,22410.5,21503,20588,19668,18744.5,17820,16895.5,15973.5,15056,14144.5,13241,12347,11464.5,10594.5,9739,8899.5,8077.5,7274,6490,5727.5,4987.5,4270,3577,2909,2266.5,1650,1061,499,-35,-541,-1018.5,-1467.5,-1888,-2280.5,-2644,-2979.5,3287,3567,3820,4046,4246,4420,4569.5,4694.5,4796,4875,4931.5,4967.5,4983,4979.5,4958,4919,4863.5,4792.5,4708,4609.5,4499,4377.5,4245.5,4104.5,3955,3798.5,3635.5,3467.5,3294.5,3118.5,2939.5,2758.5,2576.5,2394,2212.5,2031.5,1852.5,1675.5,1502,1331.5,1165,1003,846,694,547.5,407,272.5,144,22.5,-92.5,-201,-302.5,-397,-485,-565.5,-640,-707,-767.5,-822,-869.5,-911,-946.5,-976,-1e3,1018.5,1031.5,1040,1043.5,1042.5,1037.5,1028.5,1016,1000.5,981,959.5,935,908.5,879.5,849,817,783.5,749,714,678,641.5,605,568.5,532,495.5,459.5,424,389.5,355.5,322.5,290.5,259.5,229.5,200.5,173.5,147,122,98.5,76.5,55.5,36,18,1,-14.5,-28.5,-41.5,-53,-63.5,-73,-81.5,-88.5,-94.5,-100,-104,-107.5,-110.5,-112,-113.5,-114,-114,-113.5,-112.5,-111,-109,106.5,104,101,98,95,91.5,88,84.5,80.5,77,73.5,69.5,66,62.5,58.5,55.5,52,48.5,45.5,42.5,39.5,36.5,34,31.5,29,26.5,24.5,22.5,20.5,19,17.5,15.5,14.5,13,12,10.5,9.5,8.5,8,7,6.5,5.5,5,4.5,4,3.5,3.5,3,2.5,2.5,2,2,1.5,1.5,1,1,1,1,.5,.5,.5,.5,.5,.5]),x.QUANT_LUT_STEP_1=[[0,0,1,1,1,2,2,2,2,2,2,2,2,2],[0,0,0,0,0,0,1,1,1,2,2,2,2,2]],x.QUANT_TAB={A:91,B:94,C:8,D:12},x.QUANT_LUT_STEP_2=[[x.QUANT_TAB.C,x.QUANT_TAB.C,x.QUANT_TAB.D],[x.QUANT_TAB.A,x.QUANT_TAB.A,x.QUANT_TAB.A],[x.QUANT_TAB.B,x.QUANT_TAB.A,x.QUANT_TAB.B]],x.QUANT_LUT_STEP_3=[[68,68,52,52,52,52,52,52,52,52,52,52],[67,67,67,66,66,66,66,66,66,66,66,49,49,49,49,49,49,49,49,49,49,49,49,32,32,32,32,32,32,32],[69,69,69,69,52,52,52,52,52,52,52,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36]],x.QUANT_LUT_STEP4=[[0,1,2,17],[0,1,2,3,4,5,6,17],[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17],[0,1,3,5,6,7,8,9,10,11,12,13,14,15,16,17],[0,1,2,4,5,6,7,8,9,10,11,12,13,14,15,17],[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]],x.QUANT_TAB=[{levels:3,group:1,bits:5},{levels:5,group:1,bits:7},{levels:7,group:0,bits:3},{levels:9,group:1,bits:10},{levels:15,group:0,bits:4},{levels:31,group:0,bits:5},{levels:63,group:0,bits:6},{levels:127,group:0,bits:7},{levels:255,group:0,bits:8},{levels:511,group:0,bits:9},{levels:1023,group:0,bits:10},{levels:2047,group:0,bits:11},{levels:4095,group:0,bits:12},{levels:8191,group:0,bits:13},{levels:16383,group:0,bits:14},{levels:32767,group:0,bits:15},{levels:65535,group:0,bits:16}];var Y=function(A){function t(t){var i;return(i=A.call(this,t)||this).onDecodeCallback=t.onAudioDecode,i.module=t.wasmModule,i.bufferSize=t.audioBufferSize||131072,i.bufferMode=t.streaming?L.MODE.EVICT:L.MODE.EXPAND,i.sampleRate=0,i}u(t,A);var i=t.prototype;return i.initializeWasmDecoder=function(){this.module.instance?(this.instance=this.module.instance,this.functions=this.module.instance.exports,this.decoder=this.functions._mp2_decoder_create(this.bufferSize,this.bufferMode)):console.warn("JSMpeg: WASM module not compiled yet")},i.destroy=function(){this.decoder&&this.functions._mp2_decoder_destroy(this.decoder)},i.bufferGetIndex=function(){if(this.decoder)return this.functions._mp2_decoder_get_index(this.decoder)},i.bufferSetIndex=function(A){this.decoder&&this.functions._mp2_decoder_set_index(this.decoder,A)},i.bufferWrite=function(A){this.decoder||this.initializeWasmDecoder();for(var t=0,i=0;i>4<<4;this.gl.viewport(0,0,i,this.height)},t.createTexture=function(A,t){var i=this.gl,e=i.createTexture();return i.bindTexture(i.TEXTURE_2D,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.uniform1i(i.getUniformLocation(this.program,t),A),e},t.createProgram=function(A,t){var i=this.gl,e=i.createProgram();return i.attachShader(e,this.compileShader(i.VERTEX_SHADER,A)),i.attachShader(e,this.compileShader(i.FRAGMENT_SHADER,t)),i.linkProgram(e),i.useProgram(e),e},t.compileShader=function(A,t){var i=this.gl,e=i.createShader(A);if(i.shaderSource(e,t),i.compileShader(e),!i.getShaderParameter(e,i.COMPILE_STATUS))throw new Error(i.getShaderInfoLog(e));return e},t.allowsClampedTextureData=function(){var A=this.gl,t=A.createTexture();return A.bindTexture(A.TEXTURE_2D,t),A.texImage2D(A.TEXTURE_2D,0,A.LUMINANCE,1,1,0,A.LUMINANCE,A.UNSIGNED_BYTE,new Uint8ClampedArray([0])),0===A.getError()},t.renderProgress=function(A){var t=this.gl;t.useProgram(this.loadingProgram);var i=t.getUniformLocation(this.loadingProgram,"progress");t.uniform1f(i,A),t.drawArrays(t.TRIANGLE_STRIP,0,4)},t.render=function(A,t,i,e){if(this.enabled){var s=this.gl,o=this.width+15>>4<<4,g=this.height,I=o>>1,a=g>>1;e&&this.shouldCreateUnclampedViews&&(A=new Uint8Array(A.buffer),t=new Uint8Array(t.buffer),i=new Uint8Array(i.buffer)),s.useProgram(this.program),this.updateTexture(s.TEXTURE0,this.textureY,o,g,A),this.updateTexture(s.TEXTURE1,this.textureCb,I,a,t),this.updateTexture(s.TEXTURE2,this.textureCr,I,a,i),s.drawArrays(s.TRIANGLE_STRIP,0,4)}},t.updateTexture=function(A,t,i,e,s){var o=this.gl;o.activeTexture(A),o.bindTexture(o.TEXTURE_2D,t),this.hasTextureData[A]?o.texSubImage2D(o.TEXTURE_2D,0,0,0,i,e,o.LUMINANCE,o.UNSIGNED_BYTE,s):(this.hasTextureData[A]=!0,o.texImage2D(o.TEXTURE_2D,0,o.LUMINANCE,i,e,0,o.LUMINANCE,o.UNSIGNED_BYTE,s))},t.deleteTexture=function(A,t){var i=this.gl;i.activeTexture(A),i.bindTexture(i.TEXTURE_2D,null),i.deleteTexture(t)},A.IsSupported=function(){try{if(!window.WebGLRenderingContext)return!1;var A=document.createElement("canvas");return!(!A.getContext("webgl")&&!A.getContext("experimental-webgl"))}catch(A){return!1}},A}();H.SHADER={FRAGMENT_YCRCB_TO_RGBA:["precision mediump float;","uniform sampler2D textureY;","uniform sampler2D textureCb;","uniform sampler2D textureCr;","varying vec2 texCoord;","mat4 rec601 = mat4(","1.16438, 0.00000, 1.59603, -0.87079,","1.16438, -0.39176, -0.81297, 0.52959,","1.16438, 2.01723, 0.00000, -1.08139,","0, 0, 0, 1",");","void main() {","float y = texture2D(textureY, texCoord).r;","float cb = texture2D(textureCb, texCoord).r;","float cr = texture2D(textureCr, texCoord).r;","gl_FragColor = vec4(y, cr, cb, 1.0) * rec601;","}"].join("\n"),FRAGMENT_LOADING:["precision mediump float;","uniform float progress;","varying vec2 texCoord;","void main() {","float c = ceil(progress-(1.0-texCoord.y));","gl_FragColor = vec4(c,c,c,1);","}"].join("\n"),VERTEX_IDENTITY:["attribute vec2 vertex;","varying vec2 texCoord;","void main() {","texCoord = vertex;","gl_Position = vec4((vertex * 2.0 - 1.0) * vec2(1, -1), 0.0, 1.0);","}"].join("\n")};var P=function(){function A(A){A.canvas?(this.canvas=A.canvas,this.ownsCanvasElement=!1):(this.canvas=document.createElement("canvas"),this.ownsCanvasElement=!0),this.width=this.canvas.width,this.height=this.canvas.height,this.enabled=!0,this.context=this.canvas.getContext("2d")}var t=A.prototype;return t.destroy=function(){this.ownsCanvasElement&&this.canvas.remove()},t.resize=function(A,t){this.width=0|A,this.height=0|t,this.canvas.width=this.width,this.canvas.height=this.height,this.imageData=this.context.getImageData(0,0,this.width,this.height),S(this.imageData.data,255)},t.renderProgress=function(A){var t=this.canvas.width,i=this.canvas.height,e=this.context;e.fillStyle="#222",e.fillRect(0,0,t,i),e.fillStyle="#fff",e.fillRect(0,i-i*A,t,i*A)},t.render=function(A,t,i){this.YCbCrToRGBA(A,t,i,this.imageData.data),this.context.putImageData(this.imageData,0,0)},t.YCbCrToRGBA=function(A,t,i,e){if(this.enabled)for(var s,o,g,I,a,B=this.width+15>>4<<4,r=B>>1,C=0,n=B,E=B+(B-this.width),Q=0,h=r-(this.width>>1),d=0,c=4*this.width,l=4*this.width,u=this.width>>1,w=this.height>>1,p=0;p>8)-179,I=(88*o>>8)-44+(183*s>>8)-91,a=o+(198*o>>8)-227;var m=A[C++],f=A[C++];e[d]=m+g,e[d+1]=m-I,e[d+2]=m+a,e[d+4]=f+g,e[d+5]=f-I,e[d+6]=f+a,d+=8;var y=A[n++],R=A[n++];e[c]=y+g,e[c+1]=y-I,e[c+2]=y+a,e[c+4]=R+g,e[c+5]=R-I,e[c+6]=R+a,c+=8}C+=E,n+=E,d+=l,c+=l,Q+=h}},A}(),O=function(){function A(){this.context=A.CachedContext=A.CachedContext||new(window.AudioContext||window.webkitAudioContext),this.gain=this.context.createGain(),this.destination=this.gain,this.gain.connect(this.context.destination),this.context._connections=(this.context._connections||0)+1,this.startTime=0,this.buffer=null,this.wallclockStartTime=0,this.volume=1,this.enabled=!0,this.unlocked=!A.NeedsUnlocking(),Object.defineProperty(this,"enqueuedTime",{get:this.getEnqueuedTime})}var t=A.prototype;return t.destroy=function(){this.gain.disconnect(),this.context._connections--,0===this.context._connections&&(this.context.close(),A.CachedContext=null)},t.play=function(A,t,i){if(this.enabled){if(!this.unlocked){var e=G();return this.wallclockStartTimethis.memory.buffer.byteLength){var i=this.brk-this.memory.buffer.byteLength,e=Math.ceil(i/this.pageSize);this.memory.grow(e),this.createHeapViews()}return t},t.c_abort=function(A){console.warn("JSMPeg: WASM abort",arguments)},t.c_assertFail=function(A){console.warn("JSMPeg: WASM ___assert_fail",arguments)},t.readDylinkSection=function(A){var t=new Uint8Array(A),i=0,e=function(){for(var A=0,e=1;;){var s=t[i++];if(A+=(127&s)*e,e*=128,!(128&s))return A}},s=function(A){for(var e=0;ethis.maxAudioLag&&(this.audioOut.resetEnqueuedTime(),this.audioOut.enabled=!1),A=this.audio.decode()}while(A);this.audioOut.enabled=!0}},t.updateForStaticFile=function(){var A=!1,t=0;if(this.audio&&this.audio.canPlay){for(;!A&&this.audio.decodedTime-this.audio.currentTime<.25;)A=!this.audio.decode();this.video&&this.video.currentTime0&&(e>2*s&&(this.startTime+=e),A=!this.video.decode()),t=this.demuxer.currentTime-i}this.source.resume(t),A&&this.source.completed?this.loop?this.seek(0):(this.stop(),this.options.onEnded&&this.options.onEnded(this)):A&&this.options.onStalled&&this.options.onStalled(this)},A}(),W={Player:X,VideoElement:b,BitBuffer:L,Source:{Ajax:M,AjaxProgressive:q,WebSocket:N,Fetch:function(){function A(A,t){this.url=A,this.destination=null,this.request=null,this.streaming=!0,this.completed=!1,this.established=!1,this.progress=0,this.aborted=!1,this.onEstablishedCallback=t.onSourceEstablished,this.onCompletedCallback=t.onSourceCompleted,t.hookOnEstablished&&(this.hookOnEstablished=t.hookOnEstablished)}var t=A.prototype;return t.connect=function(A){this.destination=A},t.start=function(){var A=this,t={method:"GET",headers:new Headers,cache:"default"};self.fetch(this.url,t).then((function(t){if(t.ok&&t.status>=200&&t.status<=299)return A.progress=1,A.established=!0,A.pump(t.body.getReader())})).catch((function(A){throw A}))},t.pump=function(A){var t=this;return A.read().then((function(i){if(!i.done)return t.aborted?A.cancel():(t.destination&&t.destination.write(i.value.buffer),t.pump(A));t.completed=!0})).catch((function(A){throw A}))},t.resume=function(){},t.abort=function(){this.aborted=!0},A}()},Demuxer:{TS:U},Decoder:{Base:J,MPEG1Video:T,MPEG1VideoWASM:v,MP2Audio:x,MP2AudioWASM:Y},Renderer:{WebGL:H,Canvas2D:P},AudioOutput:{WebAudio:O},WASMModule:K,Now:G,CreateVideoElements:function(){for(var A=document.querySelectorAll(".jsmpeg"),t=0;tthis.q=A)))}resume(){var A;null===(A=this.q)||void 0===A||A.call(this),this.Z=this.q=void 0}} +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const V=A=>!e(A)&&"function"==typeof A.then;const z=A(class extends t{constructor(){super(...arguments),this._$Cwt=1073741823,this._$Cyt=[],this._$CK=new Z(this),this._$CX=new j}render(...A){var t;return null!==(t=A.find((A=>!V(A))))&&void 0!==t?t:i}update(A,t){const e=this._$Cyt;let s=e.length;this._$Cyt=t;const o=this._$CK,g=this._$CX;this.isConnected||this.disconnected();for(let A=0;Athis._$Cwt);A++){const i=t[A];if(!V(i))return this._$Cwt=A,i;A{for(;g.get();)await g.get();const t=o.deref();if(void 0!==t){const e=t._$Cyt.indexOf(i);e>-1&&e{let i=!1;const e=new W.VideoElement(this,A,{canvas:this._jsmpegCanvasElement},{pauseWhenHidden:!1,autoplay:!1,protocols:[],audio:!1,videoBufferSize:4194304,preserveDrawingBuffer:!0,...this.cameraConfig?.jsmpeg?.options,reconnectInterval:0,onVideoDecode:()=>{!i&&this._jsmpegCanvasElement&&(i=!0,t(e))},onPlay:()=>g(this),onPause:()=>I(this)})})),this._jsmpegCanvasElement&&a(this,this._jsmpegCanvasElement,{player:this,capabilities:{supportsPause:!0}})}_resetPlayer(){if(this._refreshPlayerTimer.stop(),this._jsmpegVideoPlayer){try{this._jsmpegVideoPlayer.destroy()}catch(A){}this._jsmpegVideoPlayer=void 0}this._jsmpegCanvasElement&&(this._jsmpegCanvasElement.remove(),this._jsmpegCanvasElement=void 0)}connectedCallback(){super.connectedCallback(),this.isConnected&&this.requestUpdate()}disconnectedCallback(){this.isConnected||this._resetPlayer(),super.disconnectedCallback()}async _refreshPlayer(){if(!this.hass)return;this._resetPlayer(),this._jsmpegCanvasElement=document.createElement("canvas"),this._jsmpegCanvasElement.className="media";const A=this.cameraEndpoints?.jsmpeg;if(!A)return B(this,r("error.live_camera_no_endpoint"),{context:this.cameraConfig});const t=await c(this,this.hass,A,86400);t&&(await this._createJSMPEGPlayer(t),this._refreshPlayerTimer.start(82800,(()=>this.requestUpdate())))}render(){return C`${z((async()=>(await this._refreshPlayer(),this._jsmpegVideoPlayer&&this._jsmpegCanvasElement?C`${this._jsmpegCanvasElement}`:B(this,r("error.jsmpeg_no_player"))))(),n({cardWideConfig:this.cardWideConfig}))}`}static get styles(){return E(":host {\n width: 100%;\n height: 100%;\n display: flex;\n}\n\ncanvas {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: var(--frigate-card-media-layout-fit, contain);\n object-position: var(--frigate-card-media-layout-position-x, 50%) var(--frigate-card-media-layout-position-y, 50%);\n}")}};Q([h({attribute:!1})],$.prototype,"cameraConfig",void 0),Q([h({attribute:!1})],$.prototype,"cameraEndpoints",void 0),Q([h({attribute:!1})],$.prototype,"cardWideConfig",void 0),$=Q([d("frigate-card-live-jsmpeg")],$);export{$ as FrigateCardLiveJSMPEG}; diff --git a/config/www/community/frigate-hass-card/live-jsmpeg-9c767737.js.gz b/config/www/community/frigate-hass-card/live-jsmpeg-9c767737.js.gz new file mode 100644 index 00000000..9f701eb1 Binary files /dev/null and b/config/www/community/frigate-hass-card/live-jsmpeg-9c767737.js.gz differ diff --git a/config/www/community/frigate-hass-card/live-webrtc-card-dfc8f852.js b/config/www/community/frigate-hass-card/live-webrtc-card-dfc8f852.js new file mode 100644 index 00000000..c0b14c7b --- /dev/null +++ b/config/www/community/frigate-hass-card/live-webrtc-card-dfc8f852.js @@ -0,0 +1 @@ +import{s as t,dJ as e,di as a,cZ as r,dj as s,dl as n,dm as o,dk as i,bj as c,bk as d,bl as l,bn as u,db as h,l as p,cL as b,bX as y,y as g}from"./card-555679fd.js";import{m}from"./audio-557099cb.js";import{s as w,h as _,M as f}from"./lazyload-c2d6254a.js";let C=class extends t{constructor(){super(...arguments),this.controls=!1,this._webrtcTask=new e(this,this._getWebRTCCardElement,(()=>[1]))}async play(){return this._getPlayer()?.play()}async pause(){this._getPlayer()?.pause()}async mute(){const t=this._getPlayer();t&&(t.muted=!0)}async unmute(){const t=this._getPlayer();t&&(t.muted=!1)}isMuted(){return this._getPlayer()?.muted??!0}async seek(t){const e=this._getPlayer();e&&(e.currentTime=t)}async setControls(t){const e=this._getPlayer();e&&w(e,t??this.controls)}isPaused(){return this._getPlayer()?.paused??!0}async getScreenshotURL(){const t=this._getPlayer();return t?a(t):null}connectedCallback(){super.connectedCallback(),this.requestUpdate()}_getPlayer(){const t=this.renderRoot?.querySelector("#webrtc");return t?.video??null}async _getWebRTCCardElement(){return await customElements.whenDefined("webrtc-camera"),customElements.get("webrtc-camera")}_createWebRTC(){const t=this._webrtcTask.value;if(t&&this.hass&&this.cameraConfig){const e=new t,a={...this.cameraConfig.webrtc_card};return a.url||a.entity||!this.cameraEndpoints?.webrtcCard||(a.url=this.cameraEndpoints.webrtcCard.endpoint),e.setConfig(a),e.hass=this.hass,e}return null}render(){return r(this,this._webrtcTask,(()=>{let t;try{t=this._createWebRTC()}catch(t){return b(this,t instanceof y?t.message:p("error.webrtc_card_reported_error")+": "+t.message,{context:t.context})}return t&&(t.id="webrtc"),g`${t}`}),{inProgressFunc:()=>h({message:p("error.webrtc_card_waiting"),cardWideConfig:this.cardWideConfig})})}updated(){this.updateComplete.then((()=>{const t=this._getPlayer();t&&(w(t,this.controls),t.onloadeddata=()=>{this.controls&&_(t,f),s(this,t,{player:this,capabilities:{supportsPause:!0,hasAudio:m(t)}})},t.onplay=()=>n(this),t.onpause=()=>o(this),t.onvolumechange=()=>i(this))}))}static get styles(){return c(":host {\n width: 100%;\n height: 100%;\n display: block;\n}\n\n/* Don't drop shadow or have radius for nested webrtc card */\n#webrtc ha-card {\n border-radius: 0px;\n margin: 0px;\n box-shadow: none;\n}\n\nha-card,\ndiv.fix-safari,\n#video {\n background: unset;\n background-color: unset;\n}\n\n#webrtc #video {\n object-fit: var(--frigate-card-media-layout-fit, contain);\n object-position: var(--frigate-card-media-layout-position-x, 50%) var(--frigate-card-media-layout-position-y, 50%);\n}")}};d([l({attribute:!1})],C.prototype,"cameraConfig",void 0),d([l({attribute:!1})],C.prototype,"cameraEndpoints",void 0),d([l({attribute:!1})],C.prototype,"cardWideConfig",void 0),d([l({attribute:!0,type:Boolean})],C.prototype,"controls",void 0),C=d([u("frigate-card-live-webrtc-card")],C);export{C as FrigateCardLiveWebRTCCard}; diff --git a/config/www/community/frigate-hass-card/live-webrtc-card-dfc8f852.js.gz b/config/www/community/frigate-hass-card/live-webrtc-card-dfc8f852.js.gz new file mode 100644 index 00000000..e4f13846 Binary files /dev/null and b/config/www/community/frigate-hass-card/live-webrtc-card-dfc8f852.js.gz differ diff --git a/config/www/community/frigate-hass-card/media-b0eb3f2a.js b/config/www/community/frigate-hass-card/media-b0eb3f2a.js new file mode 100644 index 00000000..cb05b25e --- /dev/null +++ b/config/www/community/frigate-hass-card/media-b0eb3f2a.js @@ -0,0 +1 @@ +var e;!function(e){e.MP4="mp4",e.HLS="hls"}(e||(e={}));class t{constructor(e,t){this._mediaType=e,this._cameraID=t}getContentType(){return"snapshot"===this._mediaType?"image":"video"}getCameraID(){return this._cameraID}getMediaType(){return this._mediaType}getVideoContentType(){return null}getID(){return null}getStartTime(){return null}getEndTime(){return null}getUsableEndTime(){return this.getEndTime()??(this.inProgress()?new Date:this.getStartTime())}inProgress(){return null}getContentID(){return null}getTitle(){return null}getThumbnail(){return null}isFavorite(){return null}includesTime(e){const t=this.getStartTime(),r=this.getUsableEndTime();return!!t&&!!r&&e>=t&&e<=r}setFavorite(e){}getWhere(){return null}}export{t as V,e as a}; diff --git a/config/www/community/frigate-hass-card/media-b0eb3f2a.js.gz b/config/www/community/frigate-hass-card/media-b0eb3f2a.js.gz new file mode 100644 index 00000000..58c4cdd3 Binary files /dev/null and b/config/www/community/frigate-hass-card/media-b0eb3f2a.js.gz differ diff --git a/config/www/community/frigate-hass-card/media-layout-8e0c974f.js b/config/www/community/frigate-hass-card/media-layout-8e0c974f.js new file mode 100644 index 00000000..bf994871 --- /dev/null +++ b/config/www/community/frigate-hass-card/media-layout-8e0c974f.js @@ -0,0 +1 @@ +const t=(t,o)=>{void 0!==o?.fit?t.style.setProperty("--frigate-card-media-layout-fit",o.fit):t.style.removeProperty("--frigate-card-media-layout-fit");for(const e of["x","y"])void 0!==o?.position?.[e]?t.style.setProperty(`--frigate-card-media-layout-position-${e}`,`${o.position[e]}%`):t.style.removeProperty(`--frigate-card-media-layout-position-${e}`)};export{t as u}; diff --git a/config/www/community/frigate-hass-card/media-layout-8e0c974f.js.gz b/config/www/community/frigate-hass-card/media-layout-8e0c974f.js.gz new file mode 100644 index 00000000..ef692335 Binary files /dev/null and b/config/www/community/frigate-hass-card/media-layout-8e0c974f.js.gz differ diff --git a/config/www/community/frigate-hass-card/timeline-6aa9e747.js b/config/www/community/frigate-hass-card/timeline-6aa9e747.js new file mode 100644 index 00000000..fe1f3290 --- /dev/null +++ b/config/www/community/frigate-hass-card/timeline-6aa9e747.js @@ -0,0 +1,182 @@ +import{dt as t,du as e,d8 as n,dv as o,dw as s,ca as r,dx as a,bl as l,bn as h,s as d,dn as c,y as u,bk as p,cP as m,cS as f,d1 as g,bj as v,cO as y,bm as b,dy as w,c2 as _,l as x,cp as k,cq as D,b$ as C,dz as S,cU as T,dA as E,d5 as M,cc as O,cd as I,dB as A,d7 as P,d4 as N,c5 as F,bQ as R,cn as L,c0 as j,dC as Y,cM as H}from"./card-555679fd.js";import{s as z}from"./index-52dee8bb.js";import{c as B}from"./_commonjsHelpers-1789f0cf.js";var W={exports:{}};!function(t){function e(t){if(t)return function(t){for(var i in e.prototype)t[i]=e.prototype[i];return t}(t)}W.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},e.prototype.once=function(t,e){function i(){this.off(t,i),e.apply(this,arguments)}return i.fn=e,this.on(t,i),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var o=0;o-1}var Ft=function(){function t(t,e){this.manager=t,this.set(e)}var e=t.prototype;return e.set=function(t){t===st&&(t=this.compute()),ot&&this.manager.element.style&&ct[t]&&(this.manager.element.style[nt]=t),this.actions=t.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var t=[];return At(this.manager.recognizers,(function(e){Pt(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(Nt(t,lt))return lt;var e=Nt(t,ht),i=Nt(t,dt);return e&&i?lt:e||i?e?ht:dt:Nt(t,at)?at:rt}(t.join(" "))},e.preventDefaults=function(t){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var n=this.actions,o=Nt(n,lt)&&!ct[lt],s=Nt(n,dt)&&!ct[dt],r=Nt(n,ht)&&!ct[ht];if(o){var a=1===t.pointers.length,l=t.distance<2,h=t.deltaTime<250;if(a&&l&&h)return}if(!r||!s)return o||s&&i&Tt||r&&i&Et?this.preventSrc(e):void 0}},e.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},t}();function Rt(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function Lt(t){var e=t.length;if(1===e)return{x:J(t[0].clientX),y:J(t[0].clientY)};for(var i=0,n=0,o=0;o=tt(e)?t<0?kt:Dt:e<0?Ct:St}function Bt(t,e,i){return{x:e/t||0,y:i/t||0}}function Wt(t,e){var i=t.session,n=e.pointers,o=n.length;i.firstInput||(i.firstInput=jt(e)),o>1&&!i.firstMultiple?i.firstMultiple=jt(e):1===o&&(i.firstMultiple=!1);var s=i.firstInput,r=i.firstMultiple,a=r?r.center:s.center,l=e.center=Lt(n);e.timeStamp=et(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=Ht(a,l),e.distance=Yt(a,l),function(t,e){var i=e.center,n=t.offsetDelta||{},o=t.prevDelta||{},s=t.prevInput||{};e.eventType!==yt&&s.eventType!==wt||(o=t.prevDelta={x:s.deltaX||0,y:s.deltaY||0},n=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=o.x+(i.x-n.x),e.deltaY=o.y+(i.y-n.y)}(i,e),e.offsetDirection=zt(e.deltaX,e.deltaY);var h,d,c=Bt(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=c.x,e.overallVelocityY=c.y,e.overallVelocity=tt(c.x)>tt(c.y)?c.x:c.y,e.scale=r?(h=r.pointers,Yt((d=n)[0],d[1],It)/Yt(h[0],h[1],It)):1,e.rotation=r?function(t,e){return Ht(e[1],e[0],It)+Ht(t[1],t[0],It)}(r.pointers,n):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,function(t,e){var i,n,o,s,r=t.lastInterval||e,a=e.timeStamp-r.timeStamp;if(e.eventType!==_t&&(a>vt||void 0===r.velocity)){var l=e.deltaX-r.deltaX,h=e.deltaY-r.deltaY,d=Bt(a,l,h);n=d.x,o=d.y,i=tt(d.x)>tt(d.y)?d.x:d.y,s=zt(l,h),t.lastInterval=e}else i=r.velocity,n=r.velocityX,o=r.velocityY,s=r.direction;e.velocity=i,e.velocityX=n,e.velocityY=o,e.direction=s}(i,e);var u,p=t.element,m=e.srcEvent;Rt(u=m.composedPath?m.composedPath()[0]:m.path?m.path[0]:m.target,p)&&(p=u),e.target=p}function Gt(t,e,i){var n=i.pointers.length,o=i.changedPointers.length,s=e&yt&&n-o==0,r=e&(wt|_t)&&n-o==0;i.isFirst=!!s,i.isFinal=!!r,s&&(t.session={}),i.eventType=e,Wt(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function Vt(t){return t.trim().split(/\s+/g)}function Ut(t,e,i){At(Vt(e),(function(e){t.addEventListener(e,i,!1)}))}function $t(t,e,i){At(Vt(e),(function(e){t.removeEventListener(e,i,!1)}))}function qt(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||window}var Xt=function(){function t(t,e){var i=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){Pt(t.options.enable,[t])&&i.handler(e)},this.init()}var e=t.prototype;return e.handler=function(){},e.init=function(){this.evEl&&Ut(this.element,this.evEl,this.domHandler),this.evTarget&&Ut(this.target,this.evTarget,this.domHandler),this.evWin&&Ut(qt(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&$t(this.element,this.evEl,this.domHandler),this.evTarget&&$t(this.target,this.evTarget,this.domHandler),this.evWin&&$t(qt(this.element),this.evWin,this.domHandler)},t}();function Kt(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;ni[e]})):n.sort()),n}var oe={touchstart:yt,touchmove:bt,touchend:wt,touchcancel:_t},se="touchstart touchmove touchend touchcancel",re=function(t){function e(){var i;return e.prototype.evTarget=se,(i=t.apply(this,arguments)||this).targetIds={},i}return U(e,t),e.prototype.handler=function(t){var e=oe[t.type],i=ae.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:ft,srcEvent:t})},e}(Xt);function ae(t,e){var i,n,o=ie(t.touches),s=this.targetIds;if(e&(yt|bt)&&1===o.length)return s[o[0].identifier]=!0,[o,o];var r=ie(t.changedTouches),a=[],l=this.target;if(n=o.filter((function(t){return Rt(t.target,l)})),e===yt)for(i=0;i-1&&n.splice(t,1)}),ue)}}function fe(t,e){t&yt?(this.primaryTouch=e.changedPointers[0].identifier,me.call(this,e)):t&(wt|_t)&&me.call(this,e)}function ge(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,n=0;n-1&&this.requireFail.splice(e,1),this},e.hasRequireFailures=function(){return this.requireFail.length>0},e.canRecognizeWith=function(t){return!!this.simultaneous[t.id]},e.emit=function(t){var e=this,i=this.state;function n(i){e.manager.emit(i,t)}i=xe&&n(e.options.event+Ee(i))},e.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=Ce},e.canEmit=function(){for(var t=0;te.threshold&&o&e.direction},i.attrTest=function(t){return Ie.prototype.attrTest.call(this,t)&&(this.state&we||!(this.state&we)&&this.directionTest(t))},i.emit=function(e){this.pX=e.deltaX,this.pY=e.deltaY;var i=Ae(e.direction);i&&(e.additionalEvent=this.options.event+i),t.prototype.emit.call(this,e)},e}(Ie),Ne=function(t){function e(e){return void 0===e&&(e={}),t.call(this,V({event:"swipe",threshold:10,velocity:.3,direction:Tt|Et,pointers:1},e))||this}U(e,t);var i=e.prototype;return i.getTouchAction=function(){return Pe.prototype.getTouchAction.call(this)},i.attrTest=function(e){var i,n=this.options.direction;return n&(Tt|Et)?i=e.overallVelocity:n&Tt?i=e.overallVelocityX:n&Et&&(i=e.overallVelocityY),t.prototype.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers===this.options.pointers&&tt(i)>this.options.velocity&&e.eventType&wt},i.emit=function(t){var e=Ae(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)},e}(Ie),Fe=function(t){function e(e){return void 0===e&&(e={}),t.call(this,V({event:"pinch",threshold:0,pointers:2},e))||this}U(e,t);var i=e.prototype;return i.getTouchAction=function(){return[lt]},i.attrTest=function(e){return t.prototype.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&we)},i.emit=function(e){if(1!==e.scale){var i=e.scale<1?"in":"out";e.additionalEvent=this.options.event+i}t.prototype.emit.call(this,e)},e}(Ie),Re=function(t){function e(e){return void 0===e&&(e={}),t.call(this,V({event:"rotate",threshold:0,pointers:2},e))||this}U(e,t);var i=e.prototype;return i.getTouchAction=function(){return[lt]},i.attrTest=function(e){return t.prototype.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&we)},e}(Ie),Le=function(t){function e(e){var i;return void 0===e&&(e={}),(i=t.call(this,V({event:"press",pointers:1,time:251,threshold:9},e))||this)._timer=null,i._input=null,i}U(e,t);var i=e.prototype;return i.getTouchAction=function(){return[rt]},i.process=function(t){var e=this,i=this.options,n=t.pointers.length===i.pointers,o=t.distancei.time;if(this._input=t,!o||!n||t.eventType&(wt|_t)&&!s)this.reset();else if(t.eventType&yt)this.reset(),this._timer=setTimeout((function(){e.state=ke,e.tryEmit()}),i.time);else if(t.eventType&wt)return ke;return Ce},i.reset=function(){clearTimeout(this._timer)},i.emit=function(t){this.state===ke&&(t&&t.eventType&wt?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=et(),this.manager.emit(this.options.event,this._input)))},e}(Me),je={domEvents:!1,touchAction:st,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Ye=[[Re,{enable:!1}],[Fe,{enable:!1},["rotate"]],[Ne,{direction:Tt}],[Pe,{direction:Tt},["swipe"]],[Oe],[Oe,{event:"doubletap",taps:2},["tap"]],[Le]];function He(t,e){var i,n=t.element;n.style&&(At(t.options.cssProps,(function(o,s){i=it(n.style,s),e?(t.oldCssProps[i]=n.style[i],n.style[i]=o):n.style[i]=t.oldCssProps[i]||""})),e||(t.oldCssProps={}))}var ze=function(){function t(t,e){var i,n=this;this.options=X({},je,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new((i=this).options.inputClass||(pt?ee:mt?re:ut?ve:ce))(i,Gt),this.touchAction=new Ft(this,this.options.touchAction),He(this,!0),At(this.options.recognizers,(function(t){var e=n.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])}),this)}var e=t.prototype;return e.set=function(t){return X(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},e.stop=function(t){this.session.stopped=t?2:1},e.recognize=function(t){var e=this.session;if(!e.stopped){var i;this.touchAction.preventDefaults(t);var n=this.recognizers,o=e.curRecognizer;(!o||o&&o.state&ke)&&(e.curRecognizer=null,o=null);for(var s=0;s\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=window.console&&(window.console.warn||window.console.log);return o&&o.call(window.console,n,i),t.apply(this,arguments)}}var qe=$e((function(t,e,i){for(var n=Object.keys(e),o=0;o2)return ii(ei(t[0],t[1]),...t.slice(2));const e=t[0],i=t[1];for(const t of Reflect.ownKeys(i))Object.prototype.propertyIsEnumerable.call(i,t)&&(i[t]===Je?delete e[t]:null===e[t]||null===i[t]||"object"!=typeof e[t]||"object"!=typeof i[t]||Array.isArray(e[t])||Array.isArray(i[t])?e[t]=ni(i[t]):e[t]=ii(e[t],i[t]));return e}function ni(t){return Array.isArray(t)?t.map((t=>ni(t))):"object"==typeof t&&null!==t?ii({},t):t}function oi(t){for(const e of Object.keys(t))t[e]===Je?delete t[e]:"object"==typeof t[e]&&null!==t[e]&&oi(t[e])}const si="undefined"!=typeof window?window.Hammer||Qe:function(){return function(){const t=()=>{};return{on:t,off:t,destroy:t,emit:t,get:()=>({set:t})}}()};function ri(t){this._cleanupQueue=[],this.active=!1,this._dom={container:t,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push((()=>{this._dom.overlay.parentNode.removeChild(this._dom.overlay)}));const e=si(this._dom.overlay);e.on("tap",this._onTapOverlay.bind(this)),this._cleanupQueue.push((()=>{e.destroy()}));["tap","doubletap","press","pinch","pan","panstart","panmove","panend"].forEach((t=>{e.on(t,(t=>{t.srcEvent.stopPropagation()}))})),document&&document.body&&(this._onClick=e=>{(function(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1})(e.target,t)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push((()=>{document.body.removeEventListener("click",this._onClick)}))),this._escListener=t=>{("key"in t?"Escape"===t.key:27===t.keyCode)&&this.deactivate()}}G(ri.prototype),ri.current=null,ri.prototype.destroy=function(){this.deactivate();for(const t of this._cleanupQueue.splice(0).reverse())t()},ri.prototype.activate=function(){ri.current&&ri.current.deactivate(),ri.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)},ri.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")},ri.prototype._onTapOverlay=function(t){this.activate(),t.srcEvent.stopPropagation()};const ai=/^\/?Date\((-?\d+)/i,li=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,hi=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,di=/^rgb\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *\)$/i,ci=/^rgba\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *([01]|0?\.\d+) *\)$/i;function ui(t){return t instanceof Number||"number"==typeof t}function pi(t){return t instanceof String||"string"==typeof t}function mi(t){return"object"==typeof t&&null!==t}function fi(t,e,i,n){let o=!1;!0===n&&(o=null===e[i]&&void 0!==t[i]),o?delete t[i]:t[i]=e[i]}const gi=Object.assign;function vi(t,e,i=!1,n=!1){for(const o in e)(Object.prototype.hasOwnProperty.call(e,o)||!0===i)&&("object"==typeof e[o]&&null!==e[o]&&Object.getPrototypeOf(e[o])===Object.prototype?void 0===t[o]?t[o]=vi({},e[o],i):"object"==typeof t[o]&&null!==t[o]&&Object.getPrototypeOf(t[o])===Object.prototype?vi(t[o],e[o],i):fi(t,e,o,n):Array.isArray(e[o])?t[o]=e[o].slice():fi(t,e,o,n));return t}function yi(t){const e=typeof t;return"object"===e?null===t?"null":t instanceof Boolean?"Boolean":t instanceof Number?"Number":t instanceof String?"String":Array.isArray(t)?"Array":t instanceof Date?"Date":"Object":"number"===e?"Number":"boolean"===e?"Boolean":"string"===e?"String":void 0===e?"undefined":e}function bi(t,e){return[...t,e]}function wi(t){return t.slice()}const _i=Object.values;const xi={asBoolean:(t,e)=>("function"==typeof t&&(t=t()),null!=t?0!=t:e||null),asNumber:(t,e)=>("function"==typeof t&&(t=t()),null!=t?Number(t)||e||null:e||null),asString:(t,e)=>("function"==typeof t&&(t=t()),null!=t?String(t):e||null),asSize:(t,e)=>("function"==typeof t&&(t=t()),pi(t)?t:ui(t)?t+"px":e||null),asElement:(t,e)=>("function"==typeof t&&(t=t()),t||e||null)};function ki(t){let e;switch(t.length){case 3:case 4:return e=hi.exec(t),e?{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16)}:null;case 6:case 7:return e=li.exec(t),e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null;default:return null}}function Di(t,e,i){return"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)}function Ci(t,e,i){t/=255,e/=255,i/=255;const n=Math.min(t,Math.min(e,i)),o=Math.max(t,Math.max(e,i));if(n===o)return{h:0,s:0,v:n};return{h:60*((t===n?3:i===n?1:5)-(t===n?e-i:i===n?t-e:i-t)/(o-n))/360,s:(o-n)/o,v:o}}const Si={split(t){const e={};return t.split(";").forEach((t=>{if(""!=t.trim()){const i=t.split(":"),n=i[0].trim(),o=i[1].trim();e[n]=o}})),e},join:t=>Object.keys(t).map((function(e){return e+": "+t[e]})).join("; ")};function Ti(t,e,i){let n,o,s;const r=Math.floor(6*t),a=6*t-r,l=i*(1-e),h=i*(1-a*e),d=i*(1-(1-a)*e);switch(r%6){case 0:n=i,o=d,s=l;break;case 1:n=h,o=i,s=l;break;case 2:n=l,o=i,s=d;break;case 3:n=l,o=h,s=i;break;case 4:n=d,o=l,s=i;break;case 5:n=i,o=l,s=h}return{r:Math.floor(255*n),g:Math.floor(255*o),b:Math.floor(255*s)}}function Ei(t,e,i){const n=Ti(t,e,i);return Di(n.r,n.g,n.b)}function Mi(t){const e=ki(t);if(!e)throw new TypeError(`'${t}' is not a valid color.`);return Ci(e.r,e.g,e.b)}function Oi(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)}function Ii(t){return di.test(t)}function Ai(t){return ci.test(t)}function Pi(t){if(null===t||"object"!=typeof t)return null;if(t instanceof Element)return t;const e=Object.create(t);for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&"object"==typeof t[i]&&(e[i]=Pi(t[i]));return e}const Ni={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>t*(2-t),easeInOutQuad:t=>t<.5?2*t*t:(4-2*t)*t-1,easeInCubic:t=>t*t*t,easeOutCubic:t=>--t*t*t+1,easeInOutCubic:t=>t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1,easeInQuart:t=>t*t*t*t,easeOutQuart:t=>1- --t*t*t*t,easeInOutQuart:t=>t<.5?8*t*t*t*t:1-8*--t*t*t*t,easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>1+--t*t*t*t*t,easeInOutQuint:t=>t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t};const Fi={black:"#000000",navy:"#000080",darkblue:"#00008B",mediumblue:"#0000CD",blue:"#0000FF",darkgreen:"#006400",green:"#008000",teal:"#008080",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",lime:"#00FF00",springgreen:"#00FF7F",aqua:"#00FFFF",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",mediumaquamarine:"#66CDAA",dimgray:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",lightslategray:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",maroon:"#800000",purple:"#800080",olive:"#808000",gray:"#808080",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370D8",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",silver:"#C0C0C0",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgrey:"#D3D3D3",palevioletred:"#D87093",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",red:"#FF0000",fuchsia:"#FF00FF",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",yellow:"#FFFF00",lightyellow:"#FFFFE0",ivory:"#FFFFF0",white:"#FFFFFF"};class Ri{constructor(t=1){this.pixelRatio=t,this.generated=!1,this.centerCoordinates={x:144.5,y:144.5},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=()=>{},this.closeCallback=()=>{},this._create()}insertTo(t){void 0!==this.hammer&&(this.hammer.destroy(),this.hammer=void 0),this.container=t,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}setUpdateCallback(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker update callback is not a function.");this.updateCallback=t}setCloseCallback(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker closing callback is not a function.");this.closeCallback=t}_isColorString(t){if("string"==typeof t)return Fi[t]}setColor(t,e=!0){if("none"===t)return;let i;const n=this._isColorString(t);if(void 0!==n&&(t=n),!0===pi(t)){if(!0===Ii(t)){const e=t.substr(4).substr(0,t.length-5).split(",");i={r:e[0],g:e[1],b:e[2],a:1}}else if(!0===Ai(t)){const e=t.substr(5).substr(0,t.length-6).split(",");i={r:e[0],g:e[1],b:e[2],a:e[3]}}else if(!0===Oi(t)){const e=ki(t);i={r:e.r,g:e.g,b:e.b,a:1}}}else if(t instanceof Object&&void 0!==t.r&&void 0!==t.g&&void 0!==t.b){const e=void 0!==t.a?t.a:"1.0";i={r:t.r,g:t.g,b:t.b,a:e}}if(void 0===i)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+JSON.stringify(t));this._setColor(i,e)}show(){void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}_hide(t=!0){!0===t&&(this.previousColor=Object.assign({},this.color)),!0===this.applied&&this.updateCallback(this.initialColor),this.frame.style.display="none",setTimeout((()=>{void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0)}),0)}_save(){this.updateCallback(this.color),this.applied=!1,this._hide()}_apply(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}_loadLast(){void 0!==this.previousColor?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}_setColor(t,e=!0){!0===e&&(this.initialColor=Object.assign({},t)),this.color=t;const i=Ci(t.r,t.g,t.b),n=2*Math.PI,o=this.r*i.s,s=this.centerCoordinates.x+o*Math.sin(n*i.h),r=this.centerCoordinates.y+o*Math.cos(n*i.h);this.colorPickerSelector.style.left=s-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=r-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(t)}_setOpacity(t){this.color.a=t/100,this._updatePicker(this.color)}_setBrightness(t){const e=Ci(this.color.r,this.color.g,this.color.b);e.v=t/100;const i=Ti(e.h,e.s,e.v);i.a=this.color.a,this.color=i,this._updatePicker()}_updatePicker(t=this.color){const e=Ci(t.r,t.g,t.b),i=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1)),i.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);const n=this.colorPickerCanvas.clientWidth,o=this.colorPickerCanvas.clientHeight;i.clearRect(0,0,n,o),i.putImageData(this.hueCircle,0,0),i.fillStyle="rgba(0,0,0,"+(1-e.v)+")",i.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),i.fill(),this.brightnessRange.value=100*e.v,this.opacityRange.value=100*t.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}_setSize(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}_create(){if(this.frame=document.createElement("div"),this.frame.className="vis-color-picker",this.colorPickerDiv=document.createElement("div"),this.colorPickerSelector=document.createElement("div"),this.colorPickerSelector.className="vis-selector",this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement("canvas"),this.colorPickerDiv.appendChild(this.colorPickerCanvas),this.colorPickerCanvas.getContext){const t=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{const t=document.createElement("DIV");t.style.color="red",t.style.fontWeight="bold",t.style.padding="10px",t.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(t)}this.colorPickerDiv.className="vis-color",this.opacityDiv=document.createElement("div"),this.opacityDiv.className="vis-opacity",this.brightnessDiv=document.createElement("div"),this.brightnessDiv.className="vis-brightness",this.arrowDiv=document.createElement("div"),this.arrowDiv.className="vis-arrow",this.opacityRange=document.createElement("input");try{this.opacityRange.type="range",this.opacityRange.min="0",this.opacityRange.max="100"}catch(t){}this.opacityRange.value="100",this.opacityRange.className="vis-range",this.brightnessRange=document.createElement("input");try{this.brightnessRange.type="range",this.brightnessRange.min="0",this.brightnessRange.max="100"}catch(t){}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);const t=this;this.opacityRange.onchange=function(){t._setOpacity(this.value)},this.opacityRange.oninput=function(){t._setOpacity(this.value)},this.brightnessRange.onchange=function(){t._setBrightness(this.value)},this.brightnessRange.oninput=function(){t._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerText="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerText="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerText="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerText="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerText="cancel",this.cancelButton.onclick=this._hide.bind(this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerText="apply",this.applyButton.onclick=this._apply.bind(this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=this._save.bind(this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=this._loadLast.bind(this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}_bindHammer(){this.drag={},this.pinch={},this.hammer=new si(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",(t=>{t.isFirst&&this._moveSelector(t)})),this.hammer.on("tap",(t=>{this._moveSelector(t)})),this.hammer.on("panstart",(t=>{this._moveSelector(t)})),this.hammer.on("panmove",(t=>{this._moveSelector(t)})),this.hammer.on("panend",(t=>{this._moveSelector(t)}))}_generateHueCircle(){if(!1===this.generated){const t=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)),t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);const e=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;let n,o,s,r;t.clearRect(0,0,e,i),this.centerCoordinates={x:.5*e,y:.5*i},this.r=.49*e;const a=2*Math.PI/360,l=1/360,h=1/this.r;let d;for(s=0;s<360;s++)for(r=0;ro.distance?" in "+zi.printLocation(n.path,t,"")+"Perhaps it was misplaced? Matching option found at: "+zi.printLocation(o.path,o.closestMatch,""):n.distance<=8?'. Did you mean "'+n.closestMatch+'"?'+zi.printLocation(n.path,t):". Did you mean one of these: "+zi.print(Object.keys(e))+zi.printLocation(i,t),console.error('%cUnknown option detected: "'+t+'"'+s,Hi),Yi=!0}static findInOptions(t,e,i,n=!1){let o=1e9,s="",r=[];const a=t.toLowerCase();let l;for(const h in e){let d;if(void 0!==e[h].__type__&&!0===n){const n=zi.findInOptions(t,e[h],bi(i,h));o>n.distance&&(s=n.closestMatch,r=n.path,o=n.distance,l=n.indexMatch)}else-1!==h.toLowerCase().indexOf(a)&&(l=h),d=zi.levenshteinDistance(t,h),o>d&&(s=h,r=wi(i),o=d)}return{closestMatch:s,path:r,distance:o,indexMatch:l}}static printLocation(t,e,i="Problem value found at: \n"){let n="\n\n"+i+"options = {\n";for(let e=0;e!1)){this.parent=t,this.changedOptions=[],this.container=e,this.allowCreation=!1,this.hideOption=o,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},Object.assign(this.options,this.defaultOptions),this.configureOptions=i,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new Ri(n),this.wrapper=void 0}setOptions(t){if(void 0!==t){this.popupHistory={},this._removePopup();let e=!0;if("string"==typeof t)this.options.filter=t;else if(Array.isArray(t))this.options.filter=t.join();else if("object"==typeof t){if(null==t)throw new TypeError("options cannot be null");void 0!==t.container&&(this.options.container=t.container),void 0!==t.filter&&(this.options.filter=t.filter),void 0!==t.showButton&&(this.options.showButton=t.showButton),void 0!==t.enabled&&(e=t.enabled)}else"boolean"==typeof t?(this.options.filter=!0,e=t):"function"==typeof t&&(this.options.filter=t,e=!0);!1===this.options.filter&&(e=!1),this.options.enabled=e}this._clean()}setModuleOptions(t){this.moduleOptions=t,!0===this.options.enabled&&(this._clean(),void 0!==this.options.container&&(this.container=this.options.container),this._create())}_create(){this._clean(),this.changedOptions=[];const t=this.options.filter;let e=0,i=!1;for(const n in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,n)&&(this.allowCreation=!1,i=!1,"function"==typeof t?(i=t(n,[]),i=i||this._handleObject(this.configureOptions[n],[n],!0)):!0!==t&&-1===t.indexOf(n)||(i=!0),!1!==i&&(this.allowCreation=!0,e>0&&this._makeItem([]),this._makeHeader(n),this._handleObject(this.configureOptions[n],[n])),e++);this._makeButton(),this._push()}_push(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(let t=0;t{i.appendChild(t)})),this.domElements.push(i),this.domElements.length}return 0}_makeHeader(t){const e=document.createElement("div");e.className="vis-configuration vis-config-header",e.innerText=t,this._makeItem([],e)}_makeLabel(t,e,i=!1){const n=document.createElement("div");if(n.className="vis-configuration vis-config-label vis-config-s"+e.length,!0===i){for(;n.firstChild;)n.removeChild(n.firstChild);n.appendChild(Li("i","b",t))}else n.innerText=t+":";return n}_makeDropdown(t,e,i){const n=document.createElement("select");n.className="vis-configuration vis-config-select";let o=0;void 0!==e&&-1!==t.indexOf(e)&&(o=t.indexOf(e));for(let e=0;es&&1!==s&&(a.max=Math.ceil(e*t),h=a.max,l="range increased"),a.value=e}else a.value=n;const d=document.createElement("input");d.className="vis-configuration vis-config-rangeinput",d.value=a.value;const c=this;a.onchange=function(){d.value=this.value,c._update(Number(this.value),i)},a.oninput=function(){d.value=this.value};const u=this._makeLabel(i[i.length-1],i),p=this._makeItem(i,u,a,d);""!==l&&this.popupHistory[p]!==h&&(this.popupHistory[p]=h,this._setupPopup(l,p))}_makeButton(){if(!0===this.options.showButton){const t=document.createElement("div");t.className="vis-configuration vis-config-button",t.innerText="generate options",t.onclick=()=>{this._printOptions()},t.onmouseover=()=>{t.className="vis-configuration vis-config-button hover"},t.onmouseout=()=>{t.className="vis-configuration vis-config-button"},this.optionsContainer=document.createElement("div"),this.optionsContainer.className="vis-configuration vis-config-option-container",this.domElements.push(this.optionsContainer),this.domElements.push(t)}}_setupPopup(t,e){if(!0===this.initialized&&!0===this.allowCreation&&this.popupCounter{this._removePopup()},this.popupCounter+=1,this.popupDiv={html:i,index:e}}}_removePopup(){void 0!==this.popupDiv.html&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}_showPopupIfNeeded(){if(void 0!==this.popupDiv.html){const t=this.domElements[this.popupDiv.index].getBoundingClientRect();this.popupDiv.html.style.left=t.left+"px",this.popupDiv.html.style.top=t.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=setTimeout((()=>{this.popupDiv.html.style.opacity=0}),1500),this.popupDiv.deleteTimeout=setTimeout((()=>{this._removePopup()}),1800)}}_makeCheckbox(t,e,i){const n=document.createElement("input");n.type="checkbox",n.className="vis-configuration vis-config-checkbox",n.checked=t,void 0!==e&&(n.checked=e,e!==t&&("object"==typeof t?e!==t.enabled&&this.changedOptions.push({path:i,value:e}):this.changedOptions.push({path:i,value:e})));const o=this;n.onchange=function(){o._update(this.checked,i)};const s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,n)}_makeTextInput(t,e,i){const n=document.createElement("input");n.type="text",n.className="vis-configuration vis-config-text",n.value=e,e!==t&&this.changedOptions.push({path:i,value:e});const o=this;n.onchange=function(){o._update(this.value,i)};const s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,n)}_makeColorField(t,e,i){const n=t[1],o=document.createElement("div");"none"!==(e=void 0===e?n:e)?(o.className="vis-configuration vis-config-colorBlock",o.style.backgroundColor=e):o.className="vis-configuration vis-config-colorBlock none",e=void 0===e?n:e,o.onclick=()=>{this._showColorPicker(e,o,i)};const s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,o)}_showColorPicker(t,e,i){e.onclick=function(){},this.colorPicker.insertTo(e),this.colorPicker.show(),this.colorPicker.setColor(t),this.colorPicker.setUpdateCallback((t=>{const n="rgba("+t.r+","+t.g+","+t.b+","+t.a+")";e.style.backgroundColor=n,this._update(n,i)})),this.colorPicker.setCloseCallback((()=>{e.onclick=()=>{this._showColorPicker(t,e,i)}}))}_handleObject(t,e=[],i=!1){let n=!1;const o=this.options.filter;let s=!1;for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){n=!0;const a=t[r],l=bi(e,r);if("function"==typeof o&&(n=o(r,e),!1===n&&!Array.isArray(a)&&"string"!=typeof a&&"boolean"!=typeof a&&a instanceof Object&&(this.allowCreation=!1,n=this._handleObject(a,l,!0),this.allowCreation=!1===i)),!1!==n){s=!0;const t=this._getValue(l);if(Array.isArray(a))this._handleArray(a,t,l);else if("string"==typeof a)this._makeTextInput(a,t,l);else if("boolean"==typeof a)this._makeCheckbox(a,t,l);else if(a instanceof Object){if(!this.hideOption(e,r,this.moduleOptions))if(void 0!==a.enabled){const t=bi(l,"enabled"),e=this._getValue(t);if(!0===e){const t=this._makeLabel(r,l,!0);this._makeItem(l,t),s=this._handleObject(a,l)||s}else this._makeCheckbox(a,e,l)}else{const t=this._makeLabel(r,l,!0);this._makeItem(l,t),s=this._handleObject(a,l)||s}}else console.error("dont know how to handle",a,r,l)}}return s}_handleArray(t,e,i){"string"==typeof t[0]&&"color"===t[0]?(this._makeColorField(t,e,i),t[1]!==e&&this.changedOptions.push({path:i,value:e})):"string"==typeof t[0]?(this._makeDropdown(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:e})):"number"==typeof t[0]&&(this._makeRange(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:Number(e)}))}_update(t,e){const i=this._constructOptions(t,e);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",i),this.initialized=!0,this.parent.setOptions(i)}_constructOptions(t,e,i={}){let n=i;t="false"!==(t="true"===t||t)&&t;for(let i=0;in-this.padding&&(i=!0),o=i?this.x-e:this.x,s=r?this.y-t:this.y}else s=this.y-t,s+t+this.padding>i&&(s=i-t-this.padding),sn&&(o=n-e-this.padding),o>>0,n-=t,n*=t,t=n>>>0,n-=t,t+=4294967296*n}return 2.3283064365386963e-10*(t>>>0)}}();let i=e(" "),n=e(" "),o=e(" ");for(let s=0;s{const t=2091639*e+2.3283064365386963e-10*o;return e=i,i=n,n=t-(o=0|t)};return s.uint32=()=>4294967296*s(),s.fract53=()=>s()+11102230246251565e-32*(2097152*s()|0),s.algorithm="Alea",s.seed=t,s.version="0.9",s}(t.length?t:[Date.now()])},ColorPicker:Wi,Configurator:Gi,DELETE:Je,HSVToHex:Ei,HSVToRGB:Ti,Hammer:Vi,Popup:Ui,RGBToHSV:Ci,RGBToHex:Di,VALIDATOR_PRINT_STYLE:$i,Validator:qi,addClassName:function(t,e){let i=t.className.split(" ");const n=e.split(" ");i=i.concat(n.filter((function(t){return!i.includes(t)}))),t.className=i.join(" ")},addCssText:function(t,e){const i={...Si.split(t.style.cssText),...Si.split(e)};t.style.cssText=Si.join(i)},addEventListener:function(t,e,i,n){t.addEventListener?(void 0===n&&(n=!1),"mousewheel"===e&&navigator.userAgent.includes("Firefox")&&(e="DOMMouseScroll"),t.addEventListener(e,i,n)):t.attachEvent("on"+e,i)},binarySearchCustom:function(t,e,i,n){let o=0,s=0,r=t.length-1;for(;s<=r&&o<1e4;){const a=Math.floor((s+r)/2),l=t[a],h=e(void 0===n?l[i]:l[i][n]);if(0==h)return a;-1==h?s=a+1:r=a-1,o++}return-1},binarySearchValue:function(t,e,i,n,o){let s,r,a,l,h=0,d=0,c=t.length-1;for(o=null!=o?o:function(t,e){return t==e?0:t0)return"before"==n?Math.max(0,l-1):l;if(o(r,e)<0&&o(a,e)>0)return"before"==n?l:Math.min(t.length-1,l+1);o(r,e)<0?d=l+1:c=l-1,h++}return-1},bridgeObject:Pi,copyAndExtendArray:bi,copyArray:wi,deepExtend:vi,deepObjectAssign:ei,easingFunctions:Ni,equalArray:function(t,e){if(t.length!==e.length)return!1;for(let i=0,n=t.length;i0&&e(n,t[o-1])<0;o--)t[o]=t[o-1];t[o]=n}return t},isDate:function(t){if(t instanceof Date)return!0;if(pi(t)){if(ai.exec(t))return!0;if(!isNaN(Date.parse(t)))return!0}return!1},isNumber:ui,isObject:mi,isString:pi,isValidHex:Oi,isValidRGB:Ii,isValidRGBA:Ai,mergeOptions:function(t,e,i,n={}){const o=function(t){return null!=t},s=function(t){return null!==t&&"object"==typeof t};if(!s(t))throw new Error("Parameter mergeTarget must be an object");if(!s(e))throw new Error("Parameter options must be an object");if(!o(i))throw new Error("Parameter option must have a value");if(!s(n))throw new Error("Parameter globalOptions must be an object");const r=e[i],a=s(n)&&!function(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}(n)?n[i]:void 0,l=a?a.enabled:void 0;if(void 0===r)return;if("boolean"==typeof r)return s(t[i])||(t[i]={}),void(t[i].enabled=r);if(null===r&&!s(t[i])){if(!o(a))return;t[i]=Object.create(a)}if(!s(r))return;let h=!0;void 0!==r.enabled?h=r.enabled:void 0!==l&&(h=a.enabled),function(t,e,i){s(t[i])||(t[i]={});const n=e[i],o=t[i];for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(o[t]=n[t])}(t,e,i),t[i].enabled=h},option:xi,overrideOpacity:function(t,e){if(t.includes("rgba"))return t;if(t.includes("rgb")){const i=t.substr(t.indexOf("(")+1).replace(")","").split(",");return"rgba("+i[0]+","+i[1]+","+i[2]+","+e+")"}{const i=ki(t);return null==i?t:"rgba("+i.r+","+i.g+","+i.b+","+e+")"}},parseColor:function(t,e){if(pi(t)){let e=t;if(Ii(e)){const t=e.substr(4).substr(0,e.length-5).split(",").map((function(t){return parseInt(t)}));e=Di(t[0],t[1],t[2])}if(!0===Oi(e)){const t=Mi(e),i={h:t.h,s:.8*t.s,v:Math.min(1,1.02*t.v)},n={h:t.h,s:Math.min(1,1.25*t.s),v:.8*t.v},o=Ei(n.h,n.s,n.v),s=Ei(i.h,i.s,i.v);return{background:e,border:o,highlight:{background:s,border:o},hover:{background:s,border:o}}}return{background:e,border:e,highlight:{background:e,border:e},hover:{background:e,border:e}}}if(e){return{background:t.background||e.background,border:t.border||e.border,highlight:pi(t.highlight)?{border:t.highlight,background:t.highlight}:{background:t.highlight&&t.highlight.background||e.highlight.background,border:t.highlight&&t.highlight.border||e.highlight.border},hover:pi(t.hover)?{border:t.hover,background:t.hover}:{border:t.hover&&t.hover.border||e.hover.border,background:t.hover&&t.hover.background||e.hover.background}}}return{background:t.background||void 0,border:t.border||void 0,highlight:pi(t.highlight)?{border:t.highlight,background:t.highlight}:{background:t.highlight&&t.highlight.background||void 0,border:t.highlight&&t.highlight.border||void 0},hover:pi(t.hover)?{border:t.hover,background:t.hover}:{border:t.hover&&t.hover.border||void 0,background:t.hover&&t.hover.background||void 0}}},preventDefault:function(t){t||(t=window.event),t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)},pureDeepObjectAssign:ti,recursiveDOMDelete:function t(e){if(e)for(;!0===e.hasChildNodes();){const i=e.firstChild;i&&(t(i),e.removeChild(i))}},removeClassName:function(t,e){let i=t.className.split(" ");const n=e.split(" ");i=i.filter((function(t){return!n.includes(t)})),t.className=i.join(" ")},removeCssText:function(t,e){const i=Si.split(t.style.cssText),n=Si.split(e);for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&delete i[t];t.style.cssText=Si.join(i)},removeEventListener:function(t,e,i,n){t.removeEventListener?(void 0===n&&(n=!1),"mousewheel"===e&&navigator.userAgent.includes("Firefox")&&(e="DOMMouseScroll"),t.removeEventListener(e,i,n)):t.detachEvent("on"+e,i)},selectiveBridgeObject:function(t,e){if(null!==e&&"object"==typeof e){const i=Object.create(e);for(let n=0;n{e||(e=!0,requestAnimationFrame((()=>{e=!1,t()})))}},toArray:_i,topMost:function(t,e){let i;Array.isArray(e)||(e=[e]);for(const n of t)if(n){i=n[e[0]];for(let t=1;t1&&void 0!==arguments[1]?arguments[1]:0,i=(en[t[e+0]]+en[t[e+1]]+en[t[e+2]]+en[t[e+3]]+"-"+en[t[e+4]]+en[t[e+5]]+"-"+en[t[e+6]]+en[t[e+7]]+"-"+en[t[e+8]]+en[t[e+9]]+"-"+en[t[e+10]]+en[t[e+11]]+en[t[e+12]]+en[t[e+13]]+en[t[e+14]]+en[t[e+15]]).toLowerCase();if(!tn(i))throw TypeError("Stringified UUID is invalid");return i}var sn="6ba7b810-9dad-11d1-80b4-00c04fd430c8",rn="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function an(t,e,i){function n(t,n,o,s){if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));for(var e=[],i=0;i>>24,i[1]=e>>>16&255,i[2]=e>>>8&255,i[3]=255&e,i[4]=(e=parseInt(t.slice(9,13),16))>>>8,i[5]=255&e,i[6]=(e=parseInt(t.slice(14,18),16))>>>8,i[7]=255&e,i[8]=(e=parseInt(t.slice(19,23),16))>>>8,i[9]=255&e,i[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,i[11]=e/4294967296&255,i[12]=e>>>24&255,i[13]=e>>>16&255,i[14]=e>>>8&255,i[15]=255&e,i}(n)),16!==n.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var r=new Uint8Array(16+t.length);if(r.set(n),r.set(t,n.length),(r=i(r))[6]=15&r[6]|e,r[8]=63&r[8]|128,o){s=s||0;for(var a=0;a<16;++a)o[s+a]=r[a];return o}return on(r)}try{n.name=t}catch(t){}return n.DNS=sn,n.URL=rn,n}function ln(t){return 14+(t+64>>>9<<4)+1}function hn(t,e){var i=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(i>>16)<<16|65535&i}function dn(t,e,i,n,o,s){return hn((r=hn(hn(e,t),hn(n,s)))<<(a=o)|r>>>32-a,i);var r,a}function cn(t,e,i,n,o,s,r){return dn(e&i|~e&n,t,e,o,s,r)}function un(t,e,i,n,o,s,r){return dn(e&n|i&~n,t,e,o,s,r)}function pn(t,e,i,n,o,s,r){return dn(e^i^n,t,e,o,s,r)}function mn(t,e,i,n,o,s,r){return dn(i^(e|~n),t,e,o,s,r)}function fn(t,e,i){var n=(t=t||{}).random||(t.rng||Qi)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){i=i||0;for(var o=0;o<16;++o)e[i+o]=n[o];return e}return on(n)}function gn(t,e,i,n){switch(t){case 0:return e&i^~e&n;case 1:case 3:return e^i^n;case 2:return e&i^e&n^i&n}}function vn(t,e){return t<>>32-e}an("v3",48,(function(t){if("string"==typeof t){var e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(var i=0;i>5]>>>o%32&255,r=parseInt(n.charAt(s>>>4&15)+n.charAt(15&s),16);e.push(r)}return e}(function(t,e){t[e>>5]|=128<>5]|=(255&t[n/8])<>>0;b=y,y=v,v=vn(g,30)>>>0,g=f,f=x}i[0]=i[0]+f>>>0,i[1]=i[1]+g>>>0,i[2]=i[2]+v>>>0,i[3]=i[3]+y>>>0,i[4]=i[4]+b>>>0}return[i[0]>>24&255,i[0]>>16&255,i[0]>>8&255,255&i[0],i[1]>>24&255,i[1]>>16&255,i[1]>>8&255,255&i[1],i[2]>>24&255,i[2]>>16&255,i[2]>>8&255,255&i[2],i[3]>>24&255,i[3]>>16&255,i[3]>>8&255,255&i[3],i[4]>>24&255,i[4]>>16&255,i[4]>>8&255,255&i[4]]}));class yn{_source;_transformers;_target;_listeners={add:this._add.bind(this),remove:this._remove.bind(this),update:this._update.bind(this)};constructor(t,e,i){this._source=t,this._transformers=e,this._target=i}all(){return this._target.update(this._transformItems(this._source.get())),this}start(){return this._source.on("add",this._listeners.add),this._source.on("remove",this._listeners.remove),this._source.on("update",this._listeners.update),this}stop(){return this._source.off("add",this._listeners.add),this._source.off("remove",this._listeners.remove),this._source.off("update",this._listeners.update),this}_transformItems(t){return this._transformers.reduce(((t,e)=>e(t)),t)}_add(t,e){null!=e&&this._target.add(this._transformItems(this._source.get(e.items)))}_update(t,e){null!=e&&this._target.update(this._transformItems(this._source.get(e.items)))}_remove(t,e){null!=e&&this._target.remove(this._transformItems(e.oldData))}}class bn{_source;_transformers=[];constructor(t){this._source=t}filter(t){return this._transformers.push((e=>e.filter(t))),this}map(t){return this._transformers.push((e=>e.map(t))),this}flatMap(t){return this._transformers.push((e=>e.flatMap(t))),this}to(t){return new yn(this._source,this._transformers,t)}}function wn(t){return"string"==typeof t||"number"==typeof t}class _n{delay;max;_queue=[];_timeout=null;_extended=null;constructor(t){this.delay=null,this.max=1/0,this.setOptions(t)}setOptions(t){t&&void 0!==t.delay&&(this.delay=t.delay),t&&void 0!==t.max&&(this.max=t.max),this._flushIfNeeded()}static extend(t,e){const i=new _n(e);if(void 0!==t.flush)throw new Error("Target object already has a property flush");t.flush=()=>{i.flush()};const n=[{name:"flush",original:void 0}];if(e&&e.replace)for(let o=0;othis.max&&this.flush(),null!=this._timeout&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&"number"==typeof this.delay&&(this._timeout=setTimeout((()=>{this.flush()}),this.delay))}flush(){this._queue.splice(0).forEach((t=>{t.fn.apply(t.context||t.fn,t.args||[])}))}}class xn{_subscribers={"*":[],add:[],remove:[],update:[]};_trigger(t,e,i){if("*"===t)throw new Error("Cannot trigger event *");[...this._subscribers[t],...this._subscribers["*"]].forEach((n=>{n(t,e,null!=i?i:null)}))}on(t,e){"function"==typeof e&&this._subscribers[t].push(e)}off(t,e){this._subscribers[t]=this._subscribers[t].filter((t=>t!==e))}subscribe=xn.prototype.on;unsubscribe=xn.prototype.off}class kn{_pairs;constructor(t){this._pairs=t}*[Symbol.iterator](){for(const[t,e]of this._pairs)yield[t,e]}*entries(){for(const[t,e]of this._pairs)yield[t,e]}*keys(){for(const[t]of this._pairs)yield t}*values(){for(const[,t]of this._pairs)yield t}toIdArray(){return[...this._pairs].map((t=>t[0]))}toItemArray(){return[...this._pairs].map((t=>t[1]))}toEntryArray(){return[...this._pairs]}toObjectMap(){const t=Object.create(null);for(const[e,i]of this._pairs)t[e]=i;return t}toMap(){return new Map(this._pairs)}toIdSet(){return new Set(this.toIdArray())}toItemSet(){return new Set(this.toItemArray())}cache(){return new kn([...this._pairs])}distinct(t){const e=new Set;for(const[i,n]of this._pairs)e.add(t(n,i));return e}filter(t){const e=this._pairs;return new kn({*[Symbol.iterator](){for(const[i,n]of e)t(n,i)&&(yield[i,n])}})}forEach(t){for(const[e,i]of this._pairs)t(i,e)}map(t){const e=this._pairs;return new kn({*[Symbol.iterator](){for(const[i,n]of e)yield[i,t(n,i)]}})}max(t){const e=this._pairs[Symbol.iterator]();let i=e.next();if(i.done)return null;let n=i.value[1],o=t(i.value[1],i.value[0]);for(;!(i=e.next()).done;){const[e,s]=i.value,r=t(s,e);r>o&&(o=r,n=s)}return n}min(t){const e=this._pairs[Symbol.iterator]();let i=e.next();if(i.done)return null;let n=i.value[1],o=t(i.value[1],i.value[0]);for(;!(i=e.next()).done;){const[e,s]=i.value,r=t(s,e);r[...this._pairs].sort((([e,i],[n,o])=>t(i,o,e,n)))[Symbol.iterator]()})}}class Dn extends xn{flush;length;get idProp(){return this._idProp}_options;_data;_idProp;_queue=null;constructor(t,e){super(),t&&!Array.isArray(t)&&(e=t,t=[]),this._options=e||{},this._data=new Map,this.length=0,this._idProp=this._options.fieldId||"id",t&&t.length&&this.add(t),this.setOptions(e)}setOptions(t){t&&void 0!==t.queue&&(!1===t.queue?this._queue&&(this._queue.destroy(),this._queue=null):(this._queue||(this._queue=_n.extend(this,{replace:["add","update","remove"]})),t.queue&&"object"==typeof t.queue&&this._queue.setOptions(t.queue)))}add(t,e){const i=[];let n;if(Array.isArray(t)){if(t.map((t=>t[this._idProp])).some((t=>this._data.has(t))))throw new Error("A duplicate id was found in the parameter array.");for(let e=0,o=t.length;e{const e=t[r];if(null!=e&&this._data.has(e)){const i=t,r=Object.assign({},this._data.get(e)),a=this._updateItem(i);n.push(a),s.push(i),o.push(r)}else{const e=this._addItem(t);i.push(e)}};if(Array.isArray(t))for(let e=0,i=t.length;e{const e=this._data.get(t[this._idProp]);if(null==e)throw new Error("Updating non-existent items is not allowed.");return{oldData:e,update:t}})).map((({oldData:t,update:e})=>{const i=t[this._idProp],n=ti(t,e);return this._data.set(i,n),{id:i,oldData:t,updatedData:n}}));if(i.length){const t={items:i.map((t=>t.id)),oldData:i.map((t=>t.oldData)),data:i.map((t=>t.updatedData))};return this._trigger("update",t,e),t.items}return[]}get(t,e){let i,n,o;wn(t)?(i=t,o=e):Array.isArray(t)?(n=t,o=e):o=t;const s=o&&"Object"===o.returnType?"Object":"Array",r=o&&o.filter,a=[];let l,h,d;if(null!=i)l=this._data.get(i),l&&r&&!r(l)&&(l=void 0);else if(null!=n)for(let t=0,e=n.length;t(e[i]=t[i],e)),{}):t}_sort(t,e){if("string"==typeof e){const i=e;t.sort(((t,e)=>{const n=t[i],o=e[i];return n>o?1:ni)&&(e=n,i=o)}return e||null}min(t){let e=null,i=null;for(const n of this._data.values()){const o=n[t];"number"==typeof o&&(null==i||os(t)&&r(t)),null==n?this._data.get(o):this._data.get(n,o)}getIds(t){if(this._data.length){const e=this._options.filter,i=null!=t?t.filter:null;let n;return n=i?e?t=>e(t)&&i(t):i:e,this._data.getIds({filter:n,order:t&&t.order})}return[]}forEach(t,e){if(this._data){const i=this._options.filter,n=e&&e.filter;let o;o=n?i?function(t){return i(t)&&n(t)}:n:i,this._data.forEach(t,{filter:o,order:e&&e.order})}}map(t,e){if(this._data){const i=this._options.filter,n=e&&e.filter;let o;return o=n?i?t=>i(t)&&n(t):n:i,this._data.map(t,{filter:o,order:e&&e.order})}return[]}getDataSet(){return this._data.getDataSet()}stream(t){return this._data.stream(t||{[Symbol.iterator]:this._ids.keys.bind(this._ids)})}dispose(){this._data?.off&&this._data.off("*",this._listener);const t="This data view has already been disposed of.",e={get:()=>{throw new Error(t)},set:()=>{throw new Error(t)},configurable:!1};for(const t of Reflect.ownKeys(Cn.prototype))Object.defineProperty(this,t,e)}_onEvent(t,e,i){if(!e||!e.items||!this._data)return;const n=e.items,o=[],s=[],r=[],a=[],l=[],h=[];switch(t){case"add":for(let t=0,e=n.length;t>>0;for(e=0;e0)for(i=0;i=0?i?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+n}var F=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,R=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,L={},j={};function Y(t,e,i,n){var o=n;"string"==typeof n&&(o=function(){return this[n]()}),t&&(j[t]=o),e&&(j[e[0]]=function(){return N(o.apply(this,arguments),e[1],e[2])}),i&&(j[i]=function(){return this.localeData().ordinal(o.apply(this,arguments),t)})}function H(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function z(t){var e,i,n=t.match(F);for(e=0,i=n.length;e=0&&R.test(t);)t=t.replace(R,n),R.lastIndex=0,i-=1;return t}var G={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function V(t){var e=this._longDateFormat[t],i=this._longDateFormat[t.toUpperCase()];return e||!i?e:(this._longDateFormat[t]=i.match(F).map((function(t){return"MMMM"===t||"MM"===t||"DD"===t||"dddd"===t?t.slice(1):t})).join(""),this._longDateFormat[t])}var U="Invalid date";function $(){return this._invalidDate}var q="%d",X=/\d{1,2}/;function K(t){return this._ordinal.replace("%d",t)}var Z={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Q(t,e,i,n){var o=this._relativeTime[i];return E(o)?o(t,e,i,n):o.replace(/%d/i,t)}function J(t,e){var i=this._relativeTime[t>0?"future":"past"];return E(i)?i(e):i.replace(/%s/i,e)}var tt={};function et(t,e){var i=t.toLowerCase();tt[i]=tt[i+"s"]=tt[e]=t}function it(t){return"string"==typeof t?tt[t]||tt[t.toLowerCase()]:void 0}function nt(t){var e,i,n={};for(i in t)r(t,i)&&(e=it(i))&&(n[e]=t[i]);return n}var ot={};function st(t,e){ot[t]=e}function rt(t){var e,i=[];for(e in t)r(t,e)&&i.push({unit:e,priority:ot[e]});return i.sort((function(t,e){return t.priority-e.priority})),i}function at(t){return t%4==0&&t%100!=0||t%400==0}function lt(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function ht(t){var e=+t,i=0;return 0!==e&&isFinite(e)&&(i=lt(e)),i}function dt(t,e){return function(n){return null!=n?(ut(this,t,n),i.updateOffset(this,e),this):ct(this,t)}}function ct(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function ut(t,e,i){t.isValid()&&!isNaN(i)&&("FullYear"===e&&at(t.year())&&1===t.month()&&29===t.date()?(i=ht(i),t._d["set"+(t._isUTC?"UTC":"")+e](i,t.month(),Qt(i,t.month()))):t._d["set"+(t._isUTC?"UTC":"")+e](i))}function pt(t){return E(this[t=it(t)])?this[t]():this}function mt(t,e){if("object"==typeof t){var i,n=rt(t=nt(t)),o=n.length;for(i=0;i68?1900:2e3)};var fe=dt("FullYear",!0);function ge(){return at(this.year())}function ve(t,e,i,n,o,s,r){var a;return t<100&&t>=0?(a=new Date(t+400,e,i,n,o,s,r),isFinite(a.getFullYear())&&a.setFullYear(t)):a=new Date(t,e,i,n,o,s,r),a}function ye(t){var e,i;return t<100&&t>=0?((i=Array.prototype.slice.call(arguments))[0]=t+400,e=new Date(Date.UTC.apply(null,i)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function be(t,e,i){var n=7+e-i;return-(7+ye(t,0,n).getUTCDay()-e)%7+n-1}function we(t,e,i,n,o){var s,r,a=1+7*(e-1)+(7+i-n)%7+be(t,n,o);return a<=0?r=me(s=t-1)+a:a>me(t)?(s=t+1,r=a-me(t)):(s=t,r=a),{year:s,dayOfYear:r}}function _e(t,e,i){var n,o,s=be(t.year(),e,i),r=Math.floor((t.dayOfYear()-s-1)/7)+1;return r<1?n=r+xe(o=t.year()-1,e,i):r>xe(t.year(),e,i)?(n=r-xe(t.year(),e,i),o=t.year()+1):(o=t.year(),n=r),{week:n,year:o}}function xe(t,e,i){var n=be(t,e,i),o=be(t+1,e,i);return(me(t)-n+o)/7}function ke(t){return _e(t,this._week.dow,this._week.doy).week}Y("w",["ww",2],"wo","week"),Y("W",["WW",2],"Wo","isoWeek"),et("week","w"),et("isoWeek","W"),st("week",5),st("isoWeek",5),Pt("w",_t),Pt("ww",_t,vt),Pt("W",_t),Pt("WW",_t,vt),Yt(["w","ww","W","WW"],(function(t,e,i,n){e[n.substr(0,1)]=ht(t)}));var De={dow:0,doy:6};function Ce(){return this._week.dow}function Se(){return this._week.doy}function Te(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function Ee(t){var e=_e(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function Me(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}function Oe(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Ie(t,e){return t.slice(e,7).concat(t.slice(0,e))}Y("d",0,"do","day"),Y("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),Y("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),Y("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),Y("e",0,0,"weekday"),Y("E",0,0,"isoWeekday"),et("day","d"),et("weekday","e"),et("isoWeekday","E"),st("day",11),st("weekday",11),st("isoWeekday",11),Pt("d",_t),Pt("e",_t),Pt("E",_t),Pt("dd",(function(t,e){return e.weekdaysMinRegex(t)})),Pt("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),Pt("dddd",(function(t,e){return e.weekdaysRegex(t)})),Yt(["dd","ddd","dddd"],(function(t,e,i,n){var o=i._locale.weekdaysParse(t,n,i._strict);null!=o?e.d=o:f(i).invalidWeekday=t})),Yt(["d","e","E"],(function(t,e,i,n){e[n]=ht(t)}));var Ae="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Pe="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ne="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Fe=At,Re=At,Le=At;function je(t,e){var i=o(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"];return!0===t?Ie(i,this._week.dow):t?i[t.day()]:i}function Ye(t){return!0===t?Ie(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function He(t){return!0===t?Ie(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function ze(t,e,i){var n,o,s,r=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)s=p([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(s,"").toLocaleLowerCase();return i?"dddd"===e?-1!==(o=zt.call(this._weekdaysParse,r))?o:null:"ddd"===e?-1!==(o=zt.call(this._shortWeekdaysParse,r))?o:null:-1!==(o=zt.call(this._minWeekdaysParse,r))?o:null:"dddd"===e?-1!==(o=zt.call(this._weekdaysParse,r))||-1!==(o=zt.call(this._shortWeekdaysParse,r))||-1!==(o=zt.call(this._minWeekdaysParse,r))?o:null:"ddd"===e?-1!==(o=zt.call(this._shortWeekdaysParse,r))||-1!==(o=zt.call(this._weekdaysParse,r))||-1!==(o=zt.call(this._minWeekdaysParse,r))?o:null:-1!==(o=zt.call(this._minWeekdaysParse,r))||-1!==(o=zt.call(this._weekdaysParse,r))||-1!==(o=zt.call(this._shortWeekdaysParse,r))?o:null}function Be(t,e,i){var n,o,s;if(this._weekdaysParseExact)return ze.call(this,t,e,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(o=p([2e3,1]).day(n),i&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(o,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(o,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(o,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(s="^"+this.weekdays(o,"")+"|^"+this.weekdaysShort(o,"")+"|^"+this.weekdaysMin(o,""),this._weekdaysParse[n]=new RegExp(s.replace(".",""),"i")),i&&"dddd"===e&&this._fullWeekdaysParse[n].test(t))return n;if(i&&"ddd"===e&&this._shortWeekdaysParse[n].test(t))return n;if(i&&"dd"===e&&this._minWeekdaysParse[n].test(t))return n;if(!i&&this._weekdaysParse[n].test(t))return n}}function We(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Me(t,this.localeData()),this.add(t-e,"d")):e}function Ge(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function Ve(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=Oe(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7}function Ue(t){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||Xe.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(r(this,"_weekdaysRegex")||(this._weekdaysRegex=Fe),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function $e(t){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||Xe.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(r(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Re),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function qe(t){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||Xe.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(r(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Le),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Xe(){function t(t,e){return e.length-t.length}var e,i,n,o,s,r=[],a=[],l=[],h=[];for(e=0;e<7;e++)i=p([2e3,1]).day(e),n=Rt(this.weekdaysMin(i,"")),o=Rt(this.weekdaysShort(i,"")),s=Rt(this.weekdays(i,"")),r.push(n),a.push(o),l.push(s),h.push(n),h.push(o),h.push(s);r.sort(t),a.sort(t),l.sort(t),h.sort(t),this._weekdaysRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+r.join("|")+")","i")}function Ke(){return this.hours()%12||12}function Ze(){return this.hours()||24}function Qe(t,e){Y(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}function Je(t,e){return e._meridiemParse}function ti(t){return"p"===(t+"").toLowerCase().charAt(0)}Y("H",["HH",2],0,"hour"),Y("h",["hh",2],0,Ke),Y("k",["kk",2],0,Ze),Y("hmm",0,0,(function(){return""+Ke.apply(this)+N(this.minutes(),2)})),Y("hmmss",0,0,(function(){return""+Ke.apply(this)+N(this.minutes(),2)+N(this.seconds(),2)})),Y("Hmm",0,0,(function(){return""+this.hours()+N(this.minutes(),2)})),Y("Hmmss",0,0,(function(){return""+this.hours()+N(this.minutes(),2)+N(this.seconds(),2)})),Qe("a",!0),Qe("A",!1),et("hour","h"),st("hour",13),Pt("a",Je),Pt("A",Je),Pt("H",_t),Pt("h",_t),Pt("k",_t),Pt("HH",_t,vt),Pt("hh",_t,vt),Pt("kk",_t,vt),Pt("hmm",xt),Pt("hmmss",kt),Pt("Hmm",xt),Pt("Hmmss",kt),jt(["H","HH"],Vt),jt(["k","kk"],(function(t,e,i){var n=ht(t);e[Vt]=24===n?0:n})),jt(["a","A"],(function(t,e,i){i._isPm=i._locale.isPM(t),i._meridiem=t})),jt(["h","hh"],(function(t,e,i){e[Vt]=ht(t),f(i).bigHour=!0})),jt("hmm",(function(t,e,i){var n=t.length-2;e[Vt]=ht(t.substr(0,n)),e[Ut]=ht(t.substr(n)),f(i).bigHour=!0})),jt("hmmss",(function(t,e,i){var n=t.length-4,o=t.length-2;e[Vt]=ht(t.substr(0,n)),e[Ut]=ht(t.substr(n,2)),e[$t]=ht(t.substr(o)),f(i).bigHour=!0})),jt("Hmm",(function(t,e,i){var n=t.length-2;e[Vt]=ht(t.substr(0,n)),e[Ut]=ht(t.substr(n))})),jt("Hmmss",(function(t,e,i){var n=t.length-4,o=t.length-2;e[Vt]=ht(t.substr(0,n)),e[Ut]=ht(t.substr(n,2)),e[$t]=ht(t.substr(o))}));var ei=/[ap]\.?m?\.?/i,ii=dt("Hours",!0);function ni(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"}var oi,si={calendar:A,longDateFormat:G,invalidDate:U,ordinal:q,dayOfMonthOrdinalParse:X,relativeTime:Z,months:Jt,monthsShort:te,week:De,weekdays:Ae,weekdaysMin:Ne,weekdaysShort:Pe,meridiemParse:ei},ri={},ai={};function li(t,e){var i,n=Math.min(t.length,e.length);for(i=0;i0;){if(n=ui(o.slice(0,e).join("-")))return n;if(i&&i.length>=e&&li(o,i)>=e-1)break;e--}s++}return oi}function ci(t){return null!=t.match("^[^/\\\\]*$")}function ui(t){var e=null;if(void 0===ri[t]&&Tn&&Tn.exports&&ci(t))try{e=oi._abbr,Sn("./locale/"+t),pi(e)}catch(e){ri[t]=null}return ri[t]}function pi(t,e){var i;return t&&((i=l(e)?gi(t):mi(t,e))?oi=i:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),oi._abbr}function mi(t,e){if(null!==e){var i,n=si;if(e.abbr=t,null!=ri[t])T("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=ri[t]._config;else if(null!=e.parentLocale)if(null!=ri[e.parentLocale])n=ri[e.parentLocale]._config;else{if(null==(i=ui(e.parentLocale)))return ai[e.parentLocale]||(ai[e.parentLocale]=[]),ai[e.parentLocale].push({name:t,config:e}),null;n=i._config}return ri[t]=new I(O(n,e)),ai[t]&&ai[t].forEach((function(t){mi(t.name,t.config)})),pi(t),ri[t]}return delete ri[t],null}function fi(t,e){if(null!=e){var i,n,o=si;null!=ri[t]&&null!=ri[t].parentLocale?ri[t].set(O(ri[t]._config,e)):(null!=(n=ui(t))&&(o=n._config),e=O(o,e),null==n&&(e.abbr=t),(i=new I(e)).parentLocale=ri[t],ri[t]=i),pi(t)}else null!=ri[t]&&(null!=ri[t].parentLocale?(ri[t]=ri[t].parentLocale,t===pi()&&pi(t)):null!=ri[t]&&delete ri[t]);return ri[t]}function gi(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return oi;if(!o(t)){if(e=ui(t))return e;t=[t]}return di(t)}function vi(){return C(ri)}function yi(t){var e,i=t._a;return i&&-2===f(t).overflow&&(e=i[Wt]<0||i[Wt]>11?Wt:i[Gt]<1||i[Gt]>Qt(i[Bt],i[Wt])?Gt:i[Vt]<0||i[Vt]>24||24===i[Vt]&&(0!==i[Ut]||0!==i[$t]||0!==i[qt])?Vt:i[Ut]<0||i[Ut]>59?Ut:i[$t]<0||i[$t]>59?$t:i[qt]<0||i[qt]>999?qt:-1,f(t)._overflowDayOfYear&&(eGt)&&(e=Gt),f(t)._overflowWeeks&&-1===e&&(e=Xt),f(t)._overflowWeekday&&-1===e&&(e=Kt),f(t).overflow=e),t}var bi=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,wi=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_i=/Z|[+-]\d\d(?::?\d\d)?/,xi=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],ki=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Di=/^\/?Date\((-?\d+)/i,Ci=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Si={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ti(t){var e,i,n,o,s,r,a=t._i,l=bi.exec(a)||wi.exec(a),h=xi.length,d=ki.length;if(l){for(f(t).iso=!0,e=0,i=h;eme(s)||0===t._dayOfYear)&&(f(t)._overflowDayOfYear=!0),i=ye(s,0,t._dayOfYear),t._a[Wt]=i.getUTCMonth(),t._a[Gt]=i.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=r[e]=n[e];for(;e<7;e++)t._a[e]=r[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[Vt]&&0===t._a[Ut]&&0===t._a[$t]&&0===t._a[qt]&&(t._nextDay=!0,t._a[Vt]=0),t._d=(t._useUTC?ye:ve).apply(null,r),o=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Vt]=24),t._w&&void 0!==t._w.d&&t._w.d!==o&&(f(t).weekdayMismatch=!0)}}function ji(t){var e,i,n,o,s,r,a,l,h;null!=(e=t._w).GG||null!=e.W||null!=e.E?(s=1,r=4,i=Fi(e.GG,t._a[Bt],_e($i(),1,4).year),n=Fi(e.W,1),((o=Fi(e.E,1))<1||o>7)&&(l=!0)):(s=t._locale._week.dow,r=t._locale._week.doy,h=_e($i(),s,r),i=Fi(e.gg,t._a[Bt],h.year),n=Fi(e.w,h.week),null!=e.d?((o=e.d)<0||o>6)&&(l=!0):null!=e.e?(o=e.e+s,(e.e<0||e.e>6)&&(l=!0)):o=s),n<1||n>xe(i,s,r)?f(t)._overflowWeeks=!0:null!=l?f(t)._overflowWeekday=!0:(a=we(i,n,o,s,r),t._a[Bt]=a.year,t._dayOfYear=a.dayOfYear)}function Yi(t){if(t._f!==i.ISO_8601)if(t._f!==i.RFC_2822){t._a=[],f(t).empty=!0;var e,n,o,s,r,a,l,h=""+t._i,d=h.length,c=0;for(l=(o=W(t._f,t._locale).match(F)||[]).length,e=0;e0&&f(t).unusedInput.push(r),h=h.slice(h.indexOf(n)+n.length),c+=n.length),j[s]?(n?f(t).empty=!1:f(t).unusedTokens.push(s),Ht(s,n,t)):t._strict&&!n&&f(t).unusedTokens.push(s);f(t).charsLeftOver=d-c,h.length>0&&f(t).unusedInput.push(h),t._a[Vt]<=12&&!0===f(t).bigHour&&t._a[Vt]>0&&(f(t).bigHour=void 0),f(t).parsedDateParts=t._a.slice(0),f(t).meridiem=t._meridiem,t._a[Vt]=Hi(t._locale,t._a[Vt],t._meridiem),null!==(a=f(t).era)&&(t._a[Bt]=t._locale.erasConvertYear(a,t._a[Bt])),Li(t),yi(t)}else Pi(t);else Ti(t)}function Hi(t,e,i){var n;return null==i?e:null!=t.meridiemHour?t.meridiemHour(e,i):null!=t.isPM?((n=t.isPM(i))&&e<12&&(e+=12),n||12!==e||(e=0),e):e}function zi(t){var e,i,n,o,s,r,a=!1,l=t._f.length;if(0===l)return f(t).invalidFormat=!0,void(t._d=new Date(NaN));for(o=0;othis?this:t:v()}));function Ki(t,e){var i,n;if(1===e.length&&o(e[0])&&(e=e[0]),!e.length)return $i();for(i=e[0],n=1;nthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function _n(){if(!l(this._isDSTShifted))return this._isDSTShifted;var t,e={};return w(e,this),(e=Gi(e))._a?(t=e._isUTC?p(e._a):$i(e._a),this._isDSTShifted=this.isValid()&&ln(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function xn(){return!!this.isValid()&&!this._isUTC}function kn(){return!!this.isValid()&&this._isUTC}function Dn(){return!!this.isValid()&&this._isUTC&&0===this._offset}i.updateOffset=function(){};var Cn=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,En=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Mn(t,e){var i,n,o,s=t,a=null;return rn(t)?s={ms:t._milliseconds,d:t._days,M:t._months}:h(t)||!isNaN(+t)?(s={},e?s[e]=+t:s.milliseconds=+t):(a=Cn.exec(t))?(i="-"===a[1]?-1:1,s={y:0,d:ht(a[Gt])*i,h:ht(a[Vt])*i,m:ht(a[Ut])*i,s:ht(a[$t])*i,ms:ht(an(1e3*a[qt]))*i}):(a=En.exec(t))?(i="-"===a[1]?-1:1,s={y:On(a[2],i),M:On(a[3],i),w:On(a[4],i),d:On(a[5],i),h:On(a[6],i),m:On(a[7],i),s:On(a[8],i)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(o=An($i(s.from),$i(s.to)),(s={}).ms=o.milliseconds,s.M=o.months),n=new sn(s),rn(t)&&r(t,"_locale")&&(n._locale=t._locale),rn(t)&&r(t,"_isValid")&&(n._isValid=t._isValid),n}function On(t,e){var i=t&&parseFloat(t.replace(",","."));return(isNaN(i)?0:i)*e}function In(t,e){var i={};return i.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(i.months,"M").isAfter(e)&&--i.months,i.milliseconds=+e-+t.clone().add(i.months,"M"),i}function An(t,e){var i;return t.isValid()&&e.isValid()?(e=un(e,t),t.isBefore(e)?i=In(t,e):((i=In(e,t)).milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function Pn(t,e){return function(i,n){var o;return null===n||isNaN(+n)||(T(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=i,i=n,n=o),Nn(this,Mn(i,n),t),this}}function Nn(t,e,n,o){var s=e._milliseconds,r=an(e._days),a=an(e._months);t.isValid()&&(o=null==o||o,a&&le(t,ct(t,"Month")+a*n),r&&ut(t,"Date",ct(t,"Date")+r*n),s&&t._d.setTime(t._d.valueOf()+s*n),o&&i.updateOffset(t,r||a))}Mn.fn=sn.prototype,Mn.invalid=on;var Fn=Pn(1,"add"),Rn=Pn(-1,"subtract");function Ln(t){return"string"==typeof t||t instanceof String}function jn(t){return x(t)||d(t)||Ln(t)||h(t)||Hn(t)||Yn(t)||null==t}function Yn(t){var e,i,n=s(t)&&!a(t),o=!1,l=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],h=l.length;for(e=0;ei.valueOf():i.valueOf()9999?B(i,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):E(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",B(i,"Z")):B(i,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function eo(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t,e,i,n,o="moment",s="";return this.isLocal()||(o=0===this.utcOffset()?"moment.utc":"moment.parseZone",s="Z"),t="["+o+'("]',e=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",n=s+'[")]',this.format(t+e+i+n)}function io(t){t||(t=this.isUtc()?i.defaultFormatUtc:i.defaultFormat);var e=B(this,t);return this.localeData().postformat(e)}function no(t,e){return this.isValid()&&(x(t)&&t.isValid()||$i(t).isValid())?Mn({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function oo(t){return this.from($i(),t)}function so(t,e){return this.isValid()&&(x(t)&&t.isValid()||$i(t).isValid())?Mn({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function ro(t){return this.to($i(),t)}function ao(t){var e;return void 0===t?this._locale._abbr:(null!=(e=gi(t))&&(this._locale=e),this)}i.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",i.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var lo=D("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(t){return void 0===t?this.localeData():this.locale(t)}));function ho(){return this._locale}var co=1e3,uo=60*co,po=60*uo,mo=3506328*po;function fo(t,e){return(t%e+e)%e}function go(t,e,i){return t<100&&t>=0?new Date(t+400,e,i)-mo:new Date(t,e,i).valueOf()}function vo(t,e,i){return t<100&&t>=0?Date.UTC(t+400,e,i)-mo:Date.UTC(t,e,i)}function yo(t){var e,n;if(void 0===(t=it(t))||"millisecond"===t||!this.isValid())return this;switch(n=this._isUTC?vo:go,t){case"year":e=n(this.year(),0,1);break;case"quarter":e=n(this.year(),this.month()-this.month()%3,1);break;case"month":e=n(this.year(),this.month(),1);break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=n(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=fo(e+(this._isUTC?0:this.utcOffset()*uo),po);break;case"minute":e=this._d.valueOf(),e-=fo(e,uo);break;case"second":e=this._d.valueOf(),e-=fo(e,co)}return this._d.setTime(e),i.updateOffset(this,!0),this}function bo(t){var e,n;if(void 0===(t=it(t))||"millisecond"===t||!this.isValid())return this;switch(n=this._isUTC?vo:go,t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=po-fo(e+(this._isUTC?0:this.utcOffset()*uo),po)-1;break;case"minute":e=this._d.valueOf(),e+=uo-fo(e,uo)-1;break;case"second":e=this._d.valueOf(),e+=co-fo(e,co)-1}return this._d.setTime(e),i.updateOffset(this,!0),this}function wo(){return this._d.valueOf()-6e4*(this._offset||0)}function _o(){return Math.floor(this.valueOf()/1e3)}function xo(){return new Date(this.valueOf())}function ko(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function Do(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function Co(){return this.isValid()?this.toISOString():null}function So(){return g(this)}function To(){return u({},f(this))}function Eo(){return f(this).overflow}function Mo(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Oo(t,e){var n,o,s,r=this._eras||gi("en")._eras;for(n=0,o=r.length;n=0)return l[n]}function Ao(t,e){var n=t.since<=t.until?1:-1;return void 0===e?i(t.since).year():i(t.since).year()+(e-t.offset)*n}function Po(){var t,e,i,n=this.localeData().eras();for(t=0,e=n.length;t(s=xe(t,n,o))&&(e=s),Jo.call(this,t,e,i,n,o))}function Jo(t,e,i,n,o){var s=we(t,e,i,n,o),r=ye(s.year,0,s.dayOfYear);return this.year(r.getUTCFullYear()),this.month(r.getUTCMonth()),this.date(r.getUTCDate()),this}function ts(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}Y("N",0,0,"eraAbbr"),Y("NN",0,0,"eraAbbr"),Y("NNN",0,0,"eraAbbr"),Y("NNNN",0,0,"eraName"),Y("NNNNN",0,0,"eraNarrow"),Y("y",["y",1],"yo","eraYear"),Y("y",["yy",2],0,"eraYear"),Y("y",["yyy",3],0,"eraYear"),Y("y",["yyyy",4],0,"eraYear"),Pt("N",Ho),Pt("NN",Ho),Pt("NNN",Ho),Pt("NNNN",zo),Pt("NNNNN",Bo),jt(["N","NN","NNN","NNNN","NNNNN"],(function(t,e,i,n){var o=i._locale.erasParse(t,n,i._strict);o?f(i).era=o:f(i).invalidEra=t})),Pt("y",Tt),Pt("yy",Tt),Pt("yyy",Tt),Pt("yyyy",Tt),Pt("yo",Wo),jt(["y","yy","yyy","yyyy"],Bt),jt(["yo"],(function(t,e,i,n){var o;i._locale._eraYearOrdinalRegex&&(o=t.match(i._locale._eraYearOrdinalRegex)),i._locale.eraYearOrdinalParse?e[Bt]=i._locale.eraYearOrdinalParse(t,o):e[Bt]=parseInt(t,10)})),Y(0,["gg",2],0,(function(){return this.weekYear()%100})),Y(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),Vo("gggg","weekYear"),Vo("ggggg","weekYear"),Vo("GGGG","isoWeekYear"),Vo("GGGGG","isoWeekYear"),et("weekYear","gg"),et("isoWeekYear","GG"),st("weekYear",1),st("isoWeekYear",1),Pt("G",Et),Pt("g",Et),Pt("GG",_t,vt),Pt("gg",_t,vt),Pt("GGGG",Ct,bt),Pt("gggg",Ct,bt),Pt("GGGGG",St,wt),Pt("ggggg",St,wt),Yt(["gggg","ggggg","GGGG","GGGGG"],(function(t,e,i,n){e[n.substr(0,2)]=ht(t)})),Yt(["gg","GG"],(function(t,e,n,o){e[o]=i.parseTwoDigitYear(t)})),Y("Q",0,"Qo","quarter"),et("quarter","Q"),st("quarter",7),Pt("Q",gt),jt("Q",(function(t,e){e[Wt]=3*(ht(t)-1)})),Y("D",["DD",2],"Do","date"),et("date","D"),st("date",9),Pt("D",_t),Pt("DD",_t,vt),Pt("Do",(function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient})),jt(["D","DD"],Gt),jt("Do",(function(t,e){e[Gt]=ht(t.match(_t)[0])}));var es=dt("Date",!0);function is(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}Y("DDD",["DDDD",3],"DDDo","dayOfYear"),et("dayOfYear","DDD"),st("dayOfYear",4),Pt("DDD",Dt),Pt("DDDD",yt),jt(["DDD","DDDD"],(function(t,e,i){i._dayOfYear=ht(t)})),Y("m",["mm",2],0,"minute"),et("minute","m"),st("minute",14),Pt("m",_t),Pt("mm",_t,vt),jt(["m","mm"],Ut);var ns=dt("Minutes",!1);Y("s",["ss",2],0,"second"),et("second","s"),st("second",15),Pt("s",_t),Pt("ss",_t,vt),jt(["s","ss"],$t);var os,ss,rs=dt("Seconds",!1);for(Y("S",0,0,(function(){return~~(this.millisecond()/100)})),Y(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),Y(0,["SSS",3],0,"millisecond"),Y(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),Y(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),Y(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),Y(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),Y(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),Y(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),et("millisecond","ms"),st("millisecond",16),Pt("S",Dt,gt),Pt("SS",Dt,vt),Pt("SSS",Dt,yt),os="SSSS";os.length<=9;os+="S")Pt(os,Tt);function as(t,e){e[qt]=ht(1e3*("0."+t))}for(os="S";os.length<=9;os+="S")jt(os,as);function ls(){return this._isUTC?"UTC":""}function hs(){return this._isUTC?"Coordinated Universal Time":""}ss=dt("Milliseconds",!1),Y("z",0,0,"zoneAbbr"),Y("zz",0,0,"zoneName");var ds=_.prototype;function cs(t){return $i(1e3*t)}function us(){return $i.apply(null,arguments).parseZone()}function ps(t){return t}ds.add=Fn,ds.calendar=Wn,ds.clone=Gn,ds.diff=Zn,ds.endOf=bo,ds.format=io,ds.from=no,ds.fromNow=oo,ds.to=so,ds.toNow=ro,ds.get=pt,ds.invalidAt=Eo,ds.isAfter=Vn,ds.isBefore=Un,ds.isBetween=$n,ds.isSame=qn,ds.isSameOrAfter=Xn,ds.isSameOrBefore=Kn,ds.isValid=So,ds.lang=lo,ds.locale=ao,ds.localeData=ho,ds.max=Xi,ds.min=qi,ds.parsingFlags=To,ds.set=mt,ds.startOf=yo,ds.subtract=Rn,ds.toArray=ko,ds.toObject=Do,ds.toDate=xo,ds.toISOString=to,ds.inspect=eo,"undefined"!=typeof Symbol&&null!=Symbol.for&&(ds[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),ds.toJSON=Co,ds.toString=Jn,ds.unix=_o,ds.valueOf=wo,ds.creationData=Mo,ds.eraName=Po,ds.eraNarrow=No,ds.eraAbbr=Fo,ds.eraYear=Ro,ds.year=fe,ds.isLeapYear=ge,ds.weekYear=Uo,ds.isoWeekYear=$o,ds.quarter=ds.quarters=ts,ds.month=he,ds.daysInMonth=de,ds.week=ds.weeks=Te,ds.isoWeek=ds.isoWeeks=Ee,ds.weeksInYear=Ko,ds.weeksInWeekYear=Zo,ds.isoWeeksInYear=qo,ds.isoWeeksInISOWeekYear=Xo,ds.date=es,ds.day=ds.days=We,ds.weekday=Ge,ds.isoWeekday=Ve,ds.dayOfYear=is,ds.hour=ds.hours=ii,ds.minute=ds.minutes=ns,ds.second=ds.seconds=rs,ds.millisecond=ds.milliseconds=ss,ds.utcOffset=mn,ds.utc=gn,ds.local=vn,ds.parseZone=yn,ds.hasAlignedHourOffset=bn,ds.isDST=wn,ds.isLocal=xn,ds.isUtcOffset=kn,ds.isUtc=Dn,ds.isUTC=Dn,ds.zoneAbbr=ls,ds.zoneName=hs,ds.dates=D("dates accessor is deprecated. Use date instead.",es),ds.months=D("months accessor is deprecated. Use month instead",he),ds.years=D("years accessor is deprecated. Use year instead",fe),ds.zone=D("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",fn),ds.isDSTShifted=D("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",_n);var ms=I.prototype;function fs(t,e,i,n){var o=gi(),s=p().set(n,e);return o[i](s,t)}function gs(t,e,i){if(h(t)&&(e=t,t=void 0),t=t||"",null!=e)return fs(t,e,i,"month");var n,o=[];for(n=0;n<12;n++)o[n]=fs(t,n,i,"month");return o}function vs(t,e,i,n){"boolean"==typeof t?(h(e)&&(i=e,e=void 0),e=e||""):(i=e=t,t=!1,h(e)&&(i=e,e=void 0),e=e||"");var o,s=gi(),r=t?s._week.dow:0,a=[];if(null!=i)return fs(e,(i+r)%7,n,"day");for(o=0;o<7;o++)a[o]=fs(e,(o+r)%7,n,"day");return a}function ys(t,e){return gs(t,e,"months")}function bs(t,e){return gs(t,e,"monthsShort")}function ws(t,e,i){return vs(t,e,i,"weekdays")}function _s(t,e,i){return vs(t,e,i,"weekdaysShort")}function xs(t,e,i){return vs(t,e,i,"weekdaysMin")}ms.calendar=P,ms.longDateFormat=V,ms.invalidDate=$,ms.ordinal=K,ms.preparse=ps,ms.postformat=ps,ms.relativeTime=Q,ms.pastFuture=J,ms.set=M,ms.eras=Oo,ms.erasParse=Io,ms.erasConvertYear=Ao,ms.erasAbbrRegex=jo,ms.erasNameRegex=Lo,ms.erasNarrowRegex=Yo,ms.months=oe,ms.monthsShort=se,ms.monthsParse=ae,ms.monthsRegex=ue,ms.monthsShortRegex=ce,ms.week=ke,ms.firstDayOfYear=Se,ms.firstDayOfWeek=Ce,ms.weekdays=je,ms.weekdaysMin=He,ms.weekdaysShort=Ye,ms.weekdaysParse=Be,ms.weekdaysRegex=Ue,ms.weekdaysShortRegex=$e,ms.weekdaysMinRegex=qe,ms.isPM=ti,ms.meridiem=ni,pi("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===ht(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),i.lang=D("moment.lang is deprecated. Use moment.locale instead.",pi),i.langData=D("moment.langData is deprecated. Use moment.localeData instead.",gi);var ks=Math.abs;function Ds(){var t=this._data;return this._milliseconds=ks(this._milliseconds),this._days=ks(this._days),this._months=ks(this._months),t.milliseconds=ks(t.milliseconds),t.seconds=ks(t.seconds),t.minutes=ks(t.minutes),t.hours=ks(t.hours),t.months=ks(t.months),t.years=ks(t.years),this}function Cs(t,e,i,n){var o=Mn(e,i);return t._milliseconds+=n*o._milliseconds,t._days+=n*o._days,t._months+=n*o._months,t._bubble()}function Ss(t,e){return Cs(this,t,e,1)}function Ts(t,e){return Cs(this,t,e,-1)}function Es(t){return t<0?Math.floor(t):Math.ceil(t)}function Ms(){var t,e,i,n,o,s=this._milliseconds,r=this._days,a=this._months,l=this._data;return s>=0&&r>=0&&a>=0||s<=0&&r<=0&&a<=0||(s+=864e5*Es(Is(a)+r),r=0,a=0),l.milliseconds=s%1e3,t=lt(s/1e3),l.seconds=t%60,e=lt(t/60),l.minutes=e%60,i=lt(e/60),l.hours=i%24,r+=lt(i/24),a+=o=lt(Os(r)),r-=Es(Is(o)),n=lt(a/12),a%=12,l.days=r,l.months=a,l.years=n,this}function Os(t){return 4800*t/146097}function Is(t){return 146097*t/4800}function As(t){if(!this.isValid())return NaN;var e,i,n=this._milliseconds;if("month"===(t=it(t))||"quarter"===t||"year"===t)switch(e=this._days+n/864e5,i=this._months+Os(e),t){case"month":return i;case"quarter":return i/3;case"year":return i/12}else switch(e=this._days+Math.round(Is(this._months)),t){case"week":return e/7+n/6048e5;case"day":return e+n/864e5;case"hour":return 24*e+n/36e5;case"minute":return 1440*e+n/6e4;case"second":return 86400*e+n/1e3;case"millisecond":return Math.floor(864e5*e)+n;default:throw new Error("Unknown unit "+t)}}function Ps(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*ht(this._months/12):NaN}function Ns(t){return function(){return this.as(t)}}var Fs=Ns("ms"),Rs=Ns("s"),Ls=Ns("m"),js=Ns("h"),Ys=Ns("d"),Hs=Ns("w"),zs=Ns("M"),Bs=Ns("Q"),Ws=Ns("y");function Gs(){return Mn(this)}function Vs(t){return t=it(t),this.isValid()?this[t+"s"]():NaN}function Us(t){return function(){return this.isValid()?this._data[t]:NaN}}var $s=Us("milliseconds"),qs=Us("seconds"),Xs=Us("minutes"),Ks=Us("hours"),Zs=Us("days"),Qs=Us("months"),Js=Us("years");function tr(){return lt(this.days()/7)}var er=Math.round,ir={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function nr(t,e,i,n,o){return o.relativeTime(e||1,!!i,t,n)}function or(t,e,i,n){var o=Mn(t).abs(),s=er(o.as("s")),r=er(o.as("m")),a=er(o.as("h")),l=er(o.as("d")),h=er(o.as("M")),d=er(o.as("w")),c=er(o.as("y")),u=s<=i.ss&&["s",s]||s0,u[4]=n,nr.apply(null,u)}function sr(t){return void 0===t?er:"function"==typeof t&&(er=t,!0)}function rr(t,e){return void 0!==ir[t]&&(void 0===e?ir[t]:(ir[t]=e,"s"===t&&(ir.ss=e-1),!0))}function ar(t,e){if(!this.isValid())return this.localeData().invalidDate();var i,n,o=!1,s=ir;return"object"==typeof t&&(e=t,t=!1),"boolean"==typeof t&&(o=t),"object"==typeof e&&(s=Object.assign({},ir,e),null!=e.s&&null==e.ss&&(s.ss=e.s-1)),n=or(this,!o,s,i=this.localeData()),o&&(n=i.pastFuture(+this,n)),i.postformat(n)}var lr=Math.abs;function hr(t){return(t>0)-(t<0)||+t}function dr(){if(!this.isValid())return this.localeData().invalidDate();var t,e,i,n,o,s,r,a,l=lr(this._milliseconds)/1e3,h=lr(this._days),d=lr(this._months),c=this.asSeconds();return c?(t=lt(l/60),e=lt(t/60),l%=60,t%=60,i=lt(d/12),d%=12,n=l?l.toFixed(3).replace(/\.?0+$/,""):"",o=c<0?"-":"",s=hr(this._months)!==hr(c)?"-":"",r=hr(this._days)!==hr(c)?"-":"",a=hr(this._milliseconds)!==hr(c)?"-":"",o+"P"+(i?s+i+"Y":"")+(d?s+d+"M":"")+(h?r+h+"D":"")+(e||t||l?"T":"")+(e?a+e+"H":"")+(t?a+t+"M":"")+(l?a+n+"S":"")):"P0D"}var cr=sn.prototype;return cr.isValid=nn,cr.abs=Ds,cr.add=Ss,cr.subtract=Ts,cr.as=As,cr.asMilliseconds=Fs,cr.asSeconds=Rs,cr.asMinutes=Ls,cr.asHours=js,cr.asDays=Ys,cr.asWeeks=Hs,cr.asMonths=zs,cr.asQuarters=Bs,cr.asYears=Ws,cr.valueOf=Ps,cr._bubble=Ms,cr.clone=Gs,cr.get=Vs,cr.milliseconds=$s,cr.seconds=qs,cr.minutes=Xs,cr.hours=Ks,cr.days=Zs,cr.weeks=tr,cr.months=Qs,cr.years=Js,cr.humanize=ar,cr.toISOString=dr,cr.toString=dr,cr.toJSON=dr,cr.locale=ao,cr.localeData=ho,cr.toIsoString=D("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",dr),cr.lang=lo,Y("X",0,0,"unix"),Y("x",0,0,"valueOf"),Pt("x",Et),Pt("X",It),jt("X",(function(t,e,i){i._d=new Date(1e3*parseFloat(t))})),jt("x",(function(t,e,i){i._d=new Date(ht(t))})), +//! moment.js +i.version="2.29.4",n($i),i.fn=ds,i.min=Zi,i.max=Qi,i.now=Ji,i.utc=p,i.unix=cs,i.months=ys,i.isDate=d,i.locale=pi,i.invalid=v,i.duration=Mn,i.isMoment=x,i.weekdays=ws,i.parseZone=us,i.localeData=gi,i.isDuration=rn,i.monthsShort=bs,i.weekdaysMin=xs,i.defineLocale=mi,i.updateLocale=fi,i.locales=vi,i.weekdaysShort=_s,i.normalizeUnits=it,i.relativeTimeRounding=sr,i.relativeTimeThreshold=rr,i.calendarFormat=Bn,i.prototype=ds,i.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},i}();var Mn=En.exports,On={exports:{}},In={},An={exports:{}},Pn={};function Nn(){var t={"align-content":!1,"align-items":!1,"align-self":!1,"alignment-adjust":!1,"alignment-baseline":!1,all:!1,"anchor-point":!1,animation:!1,"animation-delay":!1,"animation-direction":!1,"animation-duration":!1,"animation-fill-mode":!1,"animation-iteration-count":!1,"animation-name":!1,"animation-play-state":!1,"animation-timing-function":!1,azimuth:!1,"backface-visibility":!1,background:!0,"background-attachment":!0,"background-clip":!0,"background-color":!0,"background-image":!0,"background-origin":!0,"background-position":!0,"background-repeat":!0,"background-size":!0,"baseline-shift":!1,binding:!1,bleed:!1,"bookmark-label":!1,"bookmark-level":!1,"bookmark-state":!1,border:!0,"border-bottom":!0,"border-bottom-color":!0,"border-bottom-left-radius":!0,"border-bottom-right-radius":!0,"border-bottom-style":!0,"border-bottom-width":!0,"border-collapse":!0,"border-color":!0,"border-image":!0,"border-image-outset":!0,"border-image-repeat":!0,"border-image-slice":!0,"border-image-source":!0,"border-image-width":!0,"border-left":!0,"border-left-color":!0,"border-left-style":!0,"border-left-width":!0,"border-radius":!0,"border-right":!0,"border-right-color":!0,"border-right-style":!0,"border-right-width":!0,"border-spacing":!0,"border-style":!0,"border-top":!0,"border-top-color":!0,"border-top-left-radius":!0,"border-top-right-radius":!0,"border-top-style":!0,"border-top-width":!0,"border-width":!0,bottom:!1,"box-decoration-break":!0,"box-shadow":!0,"box-sizing":!0,"box-snap":!0,"box-suppress":!0,"break-after":!0,"break-before":!0,"break-inside":!0,"caption-side":!1,chains:!1,clear:!0,clip:!1,"clip-path":!1,"clip-rule":!1,color:!0,"color-interpolation-filters":!0,"column-count":!1,"column-fill":!1,"column-gap":!1,"column-rule":!1,"column-rule-color":!1,"column-rule-style":!1,"column-rule-width":!1,"column-span":!1,"column-width":!1,columns:!1,contain:!1,content:!1,"counter-increment":!1,"counter-reset":!1,"counter-set":!1,crop:!1,cue:!1,"cue-after":!1,"cue-before":!1,cursor:!1,direction:!1,display:!0,"display-inside":!0,"display-list":!0,"display-outside":!0,"dominant-baseline":!1,elevation:!1,"empty-cells":!1,filter:!1,flex:!1,"flex-basis":!1,"flex-direction":!1,"flex-flow":!1,"flex-grow":!1,"flex-shrink":!1,"flex-wrap":!1,float:!1,"float-offset":!1,"flood-color":!1,"flood-opacity":!1,"flow-from":!1,"flow-into":!1,font:!0,"font-family":!0,"font-feature-settings":!0,"font-kerning":!0,"font-language-override":!0,"font-size":!0,"font-size-adjust":!0,"font-stretch":!0,"font-style":!0,"font-synthesis":!0,"font-variant":!0,"font-variant-alternates":!0,"font-variant-caps":!0,"font-variant-east-asian":!0,"font-variant-ligatures":!0,"font-variant-numeric":!0,"font-variant-position":!0,"font-weight":!0,grid:!1,"grid-area":!1,"grid-auto-columns":!1,"grid-auto-flow":!1,"grid-auto-rows":!1,"grid-column":!1,"grid-column-end":!1,"grid-column-start":!1,"grid-row":!1,"grid-row-end":!1,"grid-row-start":!1,"grid-template":!1,"grid-template-areas":!1,"grid-template-columns":!1,"grid-template-rows":!1,"hanging-punctuation":!1,height:!0,hyphens:!1,icon:!1,"image-orientation":!1,"image-resolution":!1,"ime-mode":!1,"initial-letters":!1,"inline-box-align":!1,"justify-content":!1,"justify-items":!1,"justify-self":!1,left:!1,"letter-spacing":!0,"lighting-color":!0,"line-box-contain":!1,"line-break":!1,"line-grid":!1,"line-height":!1,"line-snap":!1,"line-stacking":!1,"line-stacking-ruby":!1,"line-stacking-shift":!1,"line-stacking-strategy":!1,"list-style":!0,"list-style-image":!0,"list-style-position":!0,"list-style-type":!0,margin:!0,"margin-bottom":!0,"margin-left":!0,"margin-right":!0,"margin-top":!0,"marker-offset":!1,"marker-side":!1,marks:!1,mask:!1,"mask-box":!1,"mask-box-outset":!1,"mask-box-repeat":!1,"mask-box-slice":!1,"mask-box-source":!1,"mask-box-width":!1,"mask-clip":!1,"mask-image":!1,"mask-origin":!1,"mask-position":!1,"mask-repeat":!1,"mask-size":!1,"mask-source-type":!1,"mask-type":!1,"max-height":!0,"max-lines":!1,"max-width":!0,"min-height":!0,"min-width":!0,"move-to":!1,"nav-down":!1,"nav-index":!1,"nav-left":!1,"nav-right":!1,"nav-up":!1,"object-fit":!1,"object-position":!1,opacity:!1,order:!1,orphans:!1,outline:!1,"outline-color":!1,"outline-offset":!1,"outline-style":!1,"outline-width":!1,overflow:!1,"overflow-wrap":!1,"overflow-x":!1,"overflow-y":!1,padding:!0,"padding-bottom":!0,"padding-left":!0,"padding-right":!0,"padding-top":!0,page:!1,"page-break-after":!1,"page-break-before":!1,"page-break-inside":!1,"page-policy":!1,pause:!1,"pause-after":!1,"pause-before":!1,perspective:!1,"perspective-origin":!1,pitch:!1,"pitch-range":!1,"play-during":!1,position:!1,"presentation-level":!1,quotes:!1,"region-fragment":!1,resize:!1,rest:!1,"rest-after":!1,"rest-before":!1,richness:!1,right:!1,rotation:!1,"rotation-point":!1,"ruby-align":!1,"ruby-merge":!1,"ruby-position":!1,"shape-image-threshold":!1,"shape-outside":!1,"shape-margin":!1,size:!1,speak:!1,"speak-as":!1,"speak-header":!1,"speak-numeral":!1,"speak-punctuation":!1,"speech-rate":!1,stress:!1,"string-set":!1,"tab-size":!1,"table-layout":!1,"text-align":!0,"text-align-last":!0,"text-combine-upright":!0,"text-decoration":!0,"text-decoration-color":!0,"text-decoration-line":!0,"text-decoration-skip":!0,"text-decoration-style":!0,"text-emphasis":!0,"text-emphasis-color":!0,"text-emphasis-position":!0,"text-emphasis-style":!0,"text-height":!0,"text-indent":!0,"text-justify":!0,"text-orientation":!0,"text-overflow":!0,"text-shadow":!0,"text-space-collapse":!0,"text-transform":!0,"text-underline-position":!0,"text-wrap":!0,top:!1,transform:!1,"transform-origin":!1,"transform-style":!1,transition:!1,"transition-delay":!1,"transition-duration":!1,"transition-property":!1,"transition-timing-function":!1,"unicode-bidi":!1,"vertical-align":!1,visibility:!1,"voice-balance":!1,"voice-duration":!1,"voice-family":!1,"voice-pitch":!1,"voice-range":!1,"voice-rate":!1,"voice-stress":!1,"voice-volume":!1,volume:!1,"white-space":!1,widows:!1,width:!0,"will-change":!1,"word-break":!0,"word-spacing":!0,"word-wrap":!0,"wrap-flow":!1,"wrap-through":!1,"writing-mode":!1,"z-index":!1};return t}var Fn=/javascript\s*\:/gim;Pn.whiteList=Nn(),Pn.getDefaultWhiteList=Nn,Pn.onAttr=function(t,e,i){},Pn.onIgnoreAttr=function(t,e,i){},Pn.safeAttrValue=function(t,e){return Fn.test(e)?"":e};var Rn={indexOf:function(t,e){var i,n;if(Array.prototype.indexOf)return t.indexOf(e);for(i=0,n=t.length;i/g,Qn=/"/g,Jn=/"/g,to=/&#([a-zA-Z0-9]*);?/gim,eo=/:?/gim,io=/&newline;?/gim,no=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,oo=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,so=/u\s*r\s*l\s*\(.*/gi;function ro(t){return t.replace(Qn,""")}function ao(t){return t.replace(Jn,'"')}function lo(t){return t.replace(to,(function(t,e){return"x"===e[0]||"X"===e[0]?String.fromCharCode(parseInt(e.substr(1),16)):String.fromCharCode(parseInt(e,10))}))}function ho(t){return t.replace(eo,":").replace(io," ")}function co(t){for(var e="",i=0,n=t.length;i0;e--){var i=t[e];if(" "!==i)return"="===i?e:-1}}function xo(t){return function(t){return'"'===t[0]&&'"'===t[t.length-1]||"'"===t[0]&&"'"===t[t.length-1]}(t)?t.substr(1,t.length-2):t}mo.parseTag=function(t,e,i){var n="",o=0,s=!1,r=!1,a=0,l=t.length,h="",d="";t:for(a=0;a"===c||a===l-1){n+=i(t.slice(o,s)),h=go(d=t.slice(s,a+1)),n+=e(s,n.length,h,d,vo(d)),o=a+1,s=!1;continue}if('"'===c||"'"===c)for(var u=1,p=t.charAt(a-u);""===p.trim()||"="===p;){if("="===p){r=c;continue t}p=t.charAt(a-++u)}}else if(c===r){r=!1;continue}}return o";var f=function(t){var e=Eo.spaceIndex(t);if(-1===e)return{html:"",closing:"/"===t[t.length-2]};var i="/"===(t=Eo.trim(t.slice(e+1,-1)))[t.length-1];return i&&(t=Eo.trim(t.slice(0,-1))),{html:t,closing:i}}(c),g=i[d],v=To(f.html,(function(t,e){var i=-1!==Eo.indexOf(g,t),n=s(d,t,e,i);return Mo(n)?i?(e=a(d,t,e,h))?t+'="'+e+'"':t:Mo(n=r(d,t,e,i))?void 0:n:n}));return c="<"+d,v&&(c+=" "+v),f.closing&&(c+=" /"),c+=">"}return Mo(m=o(d,c,p))?l(c):m}),l);return d&&(c=d.remove(c)),c};var Io=Oo;!function(t,e){var i=In,n=mo,o=Io;function s(t,e){return new o(e).process(t)}(e=t.exports=s).filterXSS=s,e.FilterXSS=o,function(){for(var t in i)e[t]=i[t];for(var o in n)e[o]=n[o]}(),"undefined"!=typeof window&&(window.filterXSS=t.exports),"undefined"!=typeof self&&"undefined"!=typeof DedicatedWorkerGlobalScope&&self instanceof DedicatedWorkerGlobalScope&&(self.filterXSS=t.exports)}(On,On.exports);var Ao=On.exports,Po=null; +/** + * vis-timeline and vis-graph2d + * https://visjs.github.io/vis-timeline/ + * + * Create a fully customizable, interactive timeline with items and ranges. + * + * @version 7.7.0 + * @date 2022-07-10T21:34:08.601Z + * + * @copyright (c) 2011-2017 Almende B.V, http://almende.com + * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs + * + * @license + * vis.js is dual licensed under both + * + * 1. The Apache 2.0 License + * http://www.apache.org/licenses/LICENSE-2.0 + * + * and + * + * 2. The MIT License + * http://opensource.org/licenses/MIT + * + * vis.js may be distributed under either license. + */ +var No="undefined"!=typeof window&&window.moment||Mn;function Fo(t){if(!t)return!1;let e=t.idProp??t._idProp;return!!e&&function(t,e){return"object"==typeof e&&null!==e&&t===e.idProp&&"function"==typeof e.forEach&&"function"==typeof e.get&&"function"==typeof e.getDataSet&&"function"==typeof e.getIds&&"number"==typeof e.length&&"function"==typeof e.map&&"function"==typeof e.off&&"function"==typeof e.on&&"function"==typeof e.stream&&function(t,e){return"object"==typeof e&&null!==e&&t===e.idProp&&"function"==typeof e.add&&"function"==typeof e.clear&&"function"==typeof e.distinct&&"function"==typeof e.forEach&&"function"==typeof e.get&&"function"==typeof e.getDataSet&&"function"==typeof e.getIds&&"number"==typeof e.length&&"function"==typeof e.map&&"function"==typeof e.max&&"function"==typeof e.min&&"function"==typeof e.off&&"function"==typeof e.on&&"function"==typeof e.remove&&"function"==typeof e.setOptions&&"function"==typeof e.stream&&"function"==typeof e.update&&"function"==typeof e.updateOnly}(t,e.getDataSet())}(e,t)}const Ro=/^\/?Date\((-?\d+)/i,Lo=/^\d+$/;function jo(t,e){let i;if(void 0!==t){if(null===t)return null;if(!e)return t;if("string"!=typeof e&&!(e instanceof String))throw new Error("Type must be a string");switch(e){case"boolean":case"Boolean":return Boolean(t);case"number":case"Number":return pi(t)&&!isNaN(Date.parse(t))?Mn(t).valueOf():Number(t.valueOf());case"string":case"String":return String(t);case"Date":try{return jo(t,"Moment").toDate()}catch(i){throw i instanceof TypeError?new TypeError("Cannot convert object of type "+yi(t)+" to type "+e):i}case"Moment":if(ui(t))return Mn(t);if(t instanceof Date)return Mn(t.valueOf());if(Mn.isMoment(t))return Mn(t);if(pi(t))return i=Ro.exec(t),i?Mn(Number(i[1])):(i=Lo.exec(t),Mn(i?Number(t):t));throw new TypeError("Cannot convert object of type "+yi(t)+" to type "+e);case"ISODate":if(ui(t))return new Date(t);if(t instanceof Date)return t.toISOString();if(Mn.isMoment(t))return t.toDate().toISOString();if(pi(t))return i=Ro.exec(t),i?new Date(Number(i[1])).toISOString():Mn(t).format();throw new Error("Cannot convert object of type "+yi(t)+" to type ISODate");case"ASPDate":if(ui(t))return"/Date("+t+")/";if(t instanceof Date||Mn.isMoment(t))return"/Date("+t.valueOf()+")/";if(pi(t)){let e;return i=Ro.exec(t),e=i?new Date(Number(i[1])).valueOf():new Date(t).valueOf(),"/Date("+e+")/"}throw new Error("Cannot convert object of type "+yi(t)+" to type ASPDate");default:throw new Error(`Unknown type ${e}`)}}}function Yo(t,e={start:"Date",end:"Date"}){const i=t._idProp,n=new Dn({fieldId:i}),o=(s=t,new bn(s)).map((t=>Object.keys(t).reduce(((i,n)=>(i[n]=jo(t[n],e[n]),i)),{}))).to(n); +/** + * vis-data + * http://visjs.org/ + * + * Manage unstructured data using DataSet. Add, update, and remove data, and listen for changes in the data. + * + * @version 7.1.4 + * @date 2022-03-15T15:23:59.245Z + * + * @copyright (c) 2011-2017 Almende B.V, http://almende.com + * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs + * + * @license + * vis.js is dual licensed under both + * + * 1. The Apache 2.0 License + * http://www.apache.org/licenses/LICENSE-2.0 + * + * and + * + * 2. The MIT License + * http://opensource.org/licenses/MIT + * + * vis.js may be distributed under either license. + */ +var s;return o.all().start(),{add:(...e)=>t.getDataSet().add(...e),remove:(...e)=>t.getDataSet().remove(...e),update:(...e)=>t.getDataSet().update(...e),updateOnly:(...e)=>t.getDataSet().updateOnly(...e),clear:(...e)=>t.getDataSet().clear(...e),forEach:n.forEach.bind(n),get:n.get.bind(n),getIds:n.getIds.bind(n),off:n.off.bind(n),on:n.on.bind(n),get length(){return n.length},idProp:i,type:e,rawDS:t,coercedDS:n,dispose:()=>o.stop()}}const Ho=t=>{const e=new Ao.FilterXSS(t);return t=>e.process(t)},zo=t=>t;let Bo=Ho();const Wo={...Ki,convert:jo,setupXSSProtection:t=>{t&&(!0===t.disabled?(Bo=zo,console.warn("You disabled XSS protection for vis-Timeline. I sure hope you know what you're doing!")):t.filterOptions&&(Bo=Ho(t.filterOptions)))}};Object.defineProperty(Wo,"xss",{get:function(){return Bo}});class Go{constructor(t,e){this.options=null,this.props=null}setOptions(t){t&&Wo.extend(this.options,t)}redraw(){return!1}destroy(){}_isResized(){const t=this.props._previousWidth!==this.props.width||this.props._previousHeight!==this.props.height;return this.props._previousWidth=this.props.width,this.props._previousHeight=this.props.height,t}}function Vo(t,e,i){if(i&&!Array.isArray(i))return Vo(t,e,[i]);if(e.hiddenDates=[],i&&1==Array.isArray(i)){for(let n=0;nt.start-e.start))}}function Uo(t,e,i){if(i&&!Array.isArray(i))return Uo(t,e,[i]);if(i&&void 0!==e.domProps.centerContainer.width){Vo(t,e,i);const n=t(e.range.start),o=t(e.range.end),s=(e.range.end-e.range.start)/e.domProps.centerContainer.width;for(let r=0;r=4*s){let t=0;const s=o.clone();switch(i[r].repeat){case"daily":a.day()!=l.day()&&(t=1),a.dayOfYear(n.dayOfYear()),a.year(n.year()),a.subtract(7,"days"),l.dayOfYear(n.dayOfYear()),l.year(n.year()),l.subtract(7-t,"days"),s.add(1,"weeks");break;case"weekly":{const t=l.diff(a,"days"),e=a.day();a.date(n.date()),a.month(n.month()),a.year(n.year()),l=a.clone(),a.day(e),l.day(e),l.add(t,"days"),a.subtract(1,"weeks"),l.subtract(1,"weeks"),s.add(1,"weeks");break}case"monthly":a.month()!=l.month()&&(t=1),a.month(n.month()),a.year(n.year()),a.subtract(1,"months"),l.month(n.month()),l.year(n.year()),l.subtract(1,"months"),l.add(t,"months"),s.add(1,"months");break;case"yearly":a.year()!=l.year()&&(t=1),a.year(n.year()),a.subtract(1,"years"),l.year(n.year()),l.subtract(1,"years"),l.add(t,"years"),s.add(1,"years");break;default:return void console.log("Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:",i[r].repeat)}for(;a=e[n].start&&e[t].end<=e[n].end?e[t].remove=!0:e[t].start>=e[n].start&&e[t].start<=e[n].end?(e[n].end=e[t].end,e[t].remove=!0):e[t].end>=e[n].start&&e[t].end<=e[n].end&&(e[n].start=e[t].start,e[t].remove=!0));for(n=0;nt.start-e.start))}(e);const r=Jo(e.range.start,e.hiddenDates),a=Jo(e.range.end,e.hiddenDates);let l=e.range.start,h=e.range.end;1==r.hidden&&(l=1==e.range.startToFront?r.startDate-1:r.endDate+1),1==a.hidden&&(h=1==e.range.endToFront?a.startDate-1:a.endDate+1),1!=r.hidden&&1!=a.hidden||e.range._applyRange(l,h)}}function $o(t,e,i){let n;if(0==t.body.hiddenDates.length)return n=t.range.conversion(i),(e.valueOf()-n.offset)*n.scale;{const o=Jo(e,t.body.hiddenDates);1==o.hidden&&(e=o.startDate);const s=Xo(t.body.hiddenDates,t.range.start,t.range.end);if(e=e&&r<=i&&(n+=r-s)}return n}(t.body.hiddenDates,e,n.offset);return e=t.options.moment(e).toDate().valueOf(),e+=o,-(n.offset-e.valueOf())*n.scale}if(e>t.range.end){const o={start:t.range.start,end:e};return e=Ko(t.options.moment,t.body.hiddenDates,o,e),n=t.range.conversion(i,s),(e.valueOf()-n.offset)*n.scale}return e=Ko(t.options.moment,t.body.hiddenDates,t.range,e),n=t.range.conversion(i,s),(e.valueOf()-n.offset)*n.scale}}function qo(t,e,i){if(0==t.body.hiddenDates.length){const n=t.range.conversion(i);return new Date(e/n.scale+n.offset)}{const n=Xo(t.body.hiddenDates,t.range.start,t.range.end),o=(t.range.end-t.range.start-n)*e/i,s=function(t,e,i){let n=0,o=0,s=e.start;for(let r=0;r=e.start&&l=i)break;n+=l-a}}return n}(t.body.hiddenDates,t.range,o);return new Date(s+o+t.range.start)}}function Xo(t,e,i){let n=0;for(let o=0;o=e&&r=i.start&&r=r&&(o+=r-s)}return o}function Qo(t,e,i,n){const o=Jo(e,t);return 1==o.hidden?i<0?1==n?o.startDate-(o.endDate-e)-1:o.startDate-1:1==n?o.endDate+(e-o.startDate)+1:o.endDate+1:e}function Jo(t,e){for(let o=0;o=i&&t1e3&&(i=1e3),t.body.dom.rollingModeBtn.style.visibility="hidden",t.currentTimeTimer=setTimeout(e,i)}()}stopRolling(){void 0!==this.currentTimeTimer&&(clearTimeout(this.currentTimeTimer),this.rolling=!1,this.body.dom.rollingModeBtn.style.visibility="visible")}setRange(t,e,i,n,o){i||(i={}),!0!==i.byUser&&(i.byUser=!1);const s=this,r=null!=t?Wo.convert(t,"Date").valueOf():null,a=null!=e?Wo.convert(e,"Date").valueOf():null;if(this._cancelAnimation(),this.millisecondsPerPixelCache=void 0,i.animation){const t=this.start,e=this.end,h="object"==typeof i.animation&&"duration"in i.animation?i.animation.duration:500,d="object"==typeof i.animation&&"easingFunction"in i.animation?i.animation.easingFunction:"easeInOutQuad",c=Wo.easingFunctions[d];if(!c)throw new Error(`Unknown easing function ${JSON.stringify(d)}. Choose from: ${Object.keys(Wo.easingFunctions).join(", ")}`);const u=Date.now();let p=!1;const m=()=>{if(!s.props.touch.dragging){const d=Date.now()-u,f=c(d/h),g=d>h,v=g||null===r?r:t+(r-t)*f,y=g||null===a?a:e+(a-e)*f;l=s._applyRange(v,y),Uo(s.options.moment,s.body,s.options.hiddenDates),p=p||l;const b={start:new Date(s.start),end:new Date(s.end),byUser:i.byUser,event:i.event};if(o&&o(f,l,g),l&&s.body.emitter.emit("rangechange",b),g){if(p&&(s.body.emitter.emit("rangechanged",b),n))return n()}else s.animationTimer=setTimeout(m,20)}};return m()}var l=this._applyRange(r,a);if(Uo(this.options.moment,this.body,this.options.hiddenDates),l){const t={start:new Date(this.start),end:new Date(this.end),byUser:i.byUser,event:i.event};if(this.body.emitter.emit("rangechange",t),clearTimeout(s.timeoutID),s.timeoutID=setTimeout((()=>{s.body.emitter.emit("rangechanged",t)}),200),n)return n()}}getMillisecondsPerPixel(){return void 0===this.millisecondsPerPixelCache&&(this.millisecondsPerPixelCache=(this.end-this.start)/this.body.dom.center.clientWidth),this.millisecondsPerPixelCache}_cancelAnimation(){this.animationTimer&&(clearTimeout(this.animationTimer),this.animationTimer=null)}_applyRange(t,e){let i=null!=t?Wo.convert(t,"Date").valueOf():this.start,n=null!=e?Wo.convert(e,"Date").valueOf():this.end;const o=null!=this.options.max?Wo.convert(this.options.max,"Date").valueOf():null,s=null!=this.options.min?Wo.convert(this.options.min,"Date").valueOf():null;let r;if(isNaN(i)||null===i)throw new Error(`Invalid start "${t}"`);if(isNaN(n)||null===n)throw new Error(`Invalid end "${e}"`);if(no&&(n=o)),null!==o&&n>o&&(r=n-o,i-=r,n-=r,null!=s&&i=this.start-e&&n<=this.end?(i=this.start,n=this.end):(r=t-(n-i),i-=r/2,n+=r/2)}}if(null!==this.options.zoomMax){let t=parseFloat(this.options.zoomMax);t<0&&(t=0),n-i>t&&(this.end-this.start===t&&ithis.end?(i=this.start,n=this.end):(r=n-i-t,i+=r/2,n-=r/2))}const a=this.start!=i||this.end!=n;return i>=this.start&&i<=this.end||n>=this.start&&n<=this.end||this.start>=i&&this.start<=n||this.end>=i&&this.end<=n||this.body.emitter.emit("checkRangedItems"),this.start=i,this.end=n,a}getRange(){return{start:this.start,end:this.end}}conversion(t,e){return ts.conversion(this.start,this.end,t,e)}static conversion(t,e,i,n){return void 0===n&&(n=0),0!=i&&e-t!=0?{offset:t,scale:i/(e-t-n)}:{offset:0,scale:1}}_onDragStart(t){this.deltaDifference=0,this.previousDelta=0,this.options.moveable&&this._isInsideRange(t)&&this.props.touch.allowDragging&&(this.stopRolling(),this.props.touch.start=this.start,this.props.touch.end=this.end,this.props.touch.dragging=!0,this.body.dom.root&&(this.body.dom.root.style.cursor="move"))}_onDrag(t){if(!t)return;if(!this.props.touch.dragging)return;if(!this.options.moveable)return;if(!this.props.touch.allowDragging)return;const e=this.options.direction;es(e);let i="horizontal"==e?t.deltaX:t.deltaY;i-=this.deltaDifference;let n=this.props.touch.end-this.props.touch.start;n-=Xo(this.body.hiddenDates,this.start,this.end);const o="horizontal"==e?this.body.domProps.center.width:this.body.domProps.center.height;let s;s=this.options.rtl?i/o*n:-i/o*n;const r=this.props.touch.start+s,a=this.props.touch.end+s,l=Qo(this.body.hiddenDates,r,this.previousDelta-i,!0),h=Qo(this.body.hiddenDates,a,this.previousDelta-i,!0);if(l!=r||h!=a)return this.deltaDifference+=i,this.props.touch.start=l,this.props.touch.end=h,void this._onDrag(t);this.previousDelta=i,this._applyRange(r,a);const d=new Date(this.start),c=new Date(this.end);this.body.emitter.emit("rangechange",{start:d,end:c,byUser:!0,event:t}),this.body.emitter.emit("panmove")}_onDragEnd(t){this.props.touch.dragging&&this.options.moveable&&this.props.touch.allowDragging&&(this.props.touch.dragging=!1,this.body.dom.root&&(this.body.dom.root.style.cursor="auto"),this.body.emitter.emit("rangechanged",{start:new Date(this.start),end:new Date(this.end),byUser:!0,event:t}))}_onMouseWheel(t){let e=0;if(t.wheelDelta?e=t.wheelDelta/120:t.detail?e=-t.detail/3:t.deltaY&&(e=-t.deltaY/3),!(this.options.zoomKey&&!t[this.options.zoomKey]&&this.options.zoomable||!this.options.zoomable&&this.options.moveable)&&this.options.zoomable&&this.options.moveable&&this._isInsideRange(t)&&e){const i=this.options.zoomFriction||5;let n,o;if(n=e<0?1-e/i:1/(1+e/i),this.rolling){const t=this.options.rollingMode&&this.options.rollingMode.offset||.5;o=this.start+(this.end-this.start)*t}else{const e=this.getPointer({x:t.clientX,y:t.clientY},this.body.dom.center);o=this._pointerToDate(e)}this.zoom(n,o,e,t),t.preventDefault()}}_onTouch(t){this.props.touch.start=this.start,this.props.touch.end=this.end,this.props.touch.allowDragging=!0,this.props.touch.center=null,this.props.touch.centerDate=null,this.scaleOffset=0,this.deltaDifference=0,Wo.preventDefault(t)}_onPinch(t){if(!this.options.zoomable||!this.options.moveable)return;Wo.preventDefault(t),this.props.touch.allowDragging=!1,this.props.touch.center||(this.props.touch.center=this.getPointer(t.center,this.body.dom.center),this.props.touch.centerDate=this._pointerToDate(this.props.touch.center)),this.stopRolling();const e=1/(t.scale+this.scaleOffset),i=this.props.touch.centerDate,n=Xo(this.body.hiddenDates,this.start,this.end),o=Zo(this.options.moment,this.body.hiddenDates,this,i),s=n-o;let r=i-o+(this.props.touch.start-(i-o))*e,a=i+s+(this.props.touch.end-(i+s))*e;this.startToFront=1-e<=0,this.endToFront=e-1<=0;const l=Qo(this.body.hiddenDates,r,1-e,!0),h=Qo(this.body.hiddenDates,a,e-1,!0);l==r&&h==a||(this.props.touch.start=l,this.props.touch.end=h,this.scaleOffset=1-t.scale,r=l,a=h);const d={animation:!1,byUser:!0,event:t};this.setRange(r,a,d),this.startToFront=!1,this.endToFront=!0}_isInsideRange(t){const e=t.center?t.center.x:t.clientX,i=this.body.dom.centerContainer.getBoundingClientRect(),n=this.options.rtl?e-i.left:i.right-e,o=this.body.util.toTime(n);return o>=this.start&&o<=this.end}_pointerToDate(t){let e;const i=this.options.direction;if(es(i),"horizontal"==i)return this.body.util.toTime(t.x).valueOf();{const i=this.body.domProps.center.height;return e=this.conversion(i),t.y/e.scale+e.offset}}getPointer(t,e){const i=e.getBoundingClientRect();return this.options.rtl?{x:i.right-t.x,y:t.y-i.top}:{x:t.x-i.left,y:t.y-i.top}}zoom(t,e,i,n){null==e&&(e=(this.start+this.end)/2);const o=Xo(this.body.hiddenDates,this.start,this.end),s=Zo(this.options.moment,this.body.hiddenDates,this,e),r=o-s;let a=e-s+(this.start-(e-s))*t,l=e+r+(this.end-(e+r))*t;this.startToFront=!(i>0),this.endToFront=!(-i>0);const h=Qo(this.body.hiddenDates,a,i,!0),d=Qo(this.body.hiddenDates,l,-i,!0);h==a&&d==l||(a=h,l=d);const c={animation:!1,byUser:!0,event:n};this.setRange(a,l,c),this.startToFront=!1,this.endToFront=!0}move(t){const e=this.end-this.start,i=this.start+e*t,n=this.end+e*t;this.start=i,this.end=n}moveTo(t){const e=(this.start+this.end)/2-t,i=this.start-e,n=this.end-e;this.setRange(i,n,{animation:!1,byUser:!0,event:null})}}function es(t){if("horizontal"!=t&&"vertical"!=t)throw new TypeError(`Unknown direction "${t}". Choose "horizontal" or "vertical".`)}let is;if("undefined"!=typeof window){is=function t(e,i){var n=i||{preventDefault:!1};if(e.Manager){var o=e,s=function(e,i){var s=Object.create(n);return i&&o.assign(s,i),t(new o(e,s),s)};return o.assign(s,o),s.Manager=function(e,i){var s=Object.create(n);return i&&o.assign(s,i),t(new o.Manager(e,s),s)},s}var r=Object.create(e),a=e.element;function l(t){return t.match(/[^ ]+/g)}function h(t){if("hammer.input"!==t.type){if(t.srcEvent._handled||(t.srcEvent._handled={}),t.srcEvent._handled[t.type])return;t.srcEvent._handled[t.type]=!0}var e=!1;t.stopPropagation=function(){e=!0};var i=t.srcEvent.stopPropagation.bind(t.srcEvent);"function"==typeof i&&(t.srcEvent.stopPropagation=function(){i(),t.stopPropagation()}),t.firstTarget=Po;for(var n=Po;n&&!e;){var o=n.hammer;if(o)for(var s,r=0;r0?r._handlers[t]=n:(e.off(t,h),delete r._handlers[t]))})),r},r.emit=function(t,i){Po=i.target,e.emit(t,i)},r.destroy=function(){var t=e.element.hammer,i=t.indexOf(r);-1!==i&&t.splice(i,1),t.length||delete e.element.hammer,r._handlers={},e.destroy()},r}(window.Hammer||Qe,{preventDefault:"mouse"})}else is=()=>function(){const t=()=>{};return{on:t,off:t,destroy:t,emit:t,get:e=>({set:t})}}();var ns=is;function os(t,e){e.inputHandler=function(t){t.isFirst&&e(t)},t.on("hammer.input",e.inputHandler)}class ss{constructor(t,e,i,n,o){this.moment=o&&o.moment||No,this.options=o||{},this.current=this.moment(),this._start=this.moment(),this._end=this.moment(),this.autoScale=!0,this.scale="day",this.step=1,this.setRange(t,e,i),this.switchedDay=!1,this.switchedMonth=!1,this.switchedYear=!1,Array.isArray(n)?this.hiddenDates=n:this.hiddenDates=null!=n?[n]:[],this.format=ss.FORMAT}setMoment(t){this.moment=t,this.current=this.moment(this.current.valueOf()),this._start=this.moment(this._start.valueOf()),this._end=this.moment(this._end.valueOf())}setFormat(t){const e=Wo.deepExtend({},ss.FORMAT);this.format=Wo.deepExtend(e,t)}setRange(t,e,i){if(!(t instanceof Date&&e instanceof Date))throw"No legal start or end date in method setRange";this._start=null!=t?this.moment(t.valueOf()):Date.now(),this._end=null!=e?this.moment(e.valueOf()):Date.now(),this.autoScale&&this.setMinimumStep(i)}start(){this.current=this._start.clone(),this.roundToMinor()}roundToMinor(){switch("week"==this.scale&&this.current.weekday(0),this.scale){case"year":this.current.year(this.step*Math.floor(this.current.year()/this.step)),this.current.month(0);case"month":this.current.date(1);case"week":case"day":case"weekday":this.current.hours(0);case"hour":this.current.minutes(0);case"minute":this.current.seconds(0);case"second":this.current.milliseconds(0)}if(1!=this.step){let t=this.current.clone();switch(this.scale){case"millisecond":this.current.subtract(this.current.milliseconds()%this.step,"milliseconds");break;case"second":this.current.subtract(this.current.seconds()%this.step,"seconds");break;case"minute":this.current.subtract(this.current.minutes()%this.step,"minutes");break;case"hour":this.current.subtract(this.current.hours()%this.step,"hours");break;case"weekday":case"day":this.current.subtract((this.current.date()-1)%this.step,"day");break;case"week":this.current.subtract(this.current.week()%this.step,"week");break;case"month":this.current.subtract(this.current.month()%this.step,"month");break;case"year":this.current.subtract(this.current.year()%this.step,"year")}t.isSame(this.current)||(this.current=this.moment(Qo(this.hiddenDates,this.current.valueOf(),-1,!0)))}}hasNext(){return this.current.valueOf()<=this._end.valueOf()}next(){const t=this.current.valueOf();switch(this.scale){case"millisecond":this.current.add(this.step,"millisecond");break;case"second":this.current.add(this.step,"second");break;case"minute":this.current.add(this.step,"minute");break;case"hour":this.current.add(this.step,"hour"),this.current.month()<6?this.current.subtract(this.current.hours()%this.step,"hour"):this.current.hours()%this.step!=0&&this.current.add(this.step-this.current.hours()%this.step,"hour");break;case"weekday":case"day":this.current.add(this.step,"day");break;case"week":if(0!==this.current.weekday())this.current.weekday(0),this.current.add(this.step,"week");else if(!1===this.options.showMajorLabels)this.current.add(this.step,"week");else{const t=this.current.clone();t.add(1,"week"),t.isSame(this.current,"month")?this.current.add(this.step,"week"):(this.current.add(this.step,"week"),this.current.date(1))}break;case"month":this.current.add(this.step,"month");break;case"year":this.current.add(this.step,"year")}if(1!=this.step)switch(this.scale){case"millisecond":this.current.milliseconds()>0&&this.current.milliseconds()0&&this.current.seconds()0&&this.current.minutes()0&&this.current.hours()=i&&o0?t.step:1,this.autoScale=!1)}setAutoScale(t){this.autoScale=t}setMinimumStep(t){if(null==t)return;const e=31104e6,i=2592e6,n=864e5,o=36e5,s=6e4,r=1e3;1e3*e>t&&(this.scale="year",this.step=1e3),500*e>t&&(this.scale="year",this.step=500),100*e>t&&(this.scale="year",this.step=100),50*e>t&&(this.scale="year",this.step=50),10*e>t&&(this.scale="year",this.step=10),5*e>t&&(this.scale="year",this.step=5),e>t&&(this.scale="year",this.step=1),7776e6>t&&(this.scale="month",this.step=3),i>t&&(this.scale="month",this.step=1),6048e5>t&&this.options.showWeekScale&&(this.scale="week",this.step=1),1728e5>t&&(this.scale="day",this.step=2),n>t&&(this.scale="day",this.step=1),432e5>t&&(this.scale="weekday",this.step=1),144e5>t&&(this.scale="hour",this.step=4),o>t&&(this.scale="hour",this.step=1),9e5>t&&(this.scale="minute",this.step=15),6e5>t&&(this.scale="minute",this.step=10),3e5>t&&(this.scale="minute",this.step=5),s>t&&(this.scale="minute",this.step=1),15e3>t&&(this.scale="second",this.step=15),1e4>t&&(this.scale="second",this.step=10),5e3>t&&(this.scale="second",this.step=5),r>t&&(this.scale="second",this.step=1),200>t&&(this.scale="millisecond",this.step=200),100>t&&(this.scale="millisecond",this.step=100),50>t&&(this.scale="millisecond",this.step=50),10>t&&(this.scale="millisecond",this.step=10),5>t&&(this.scale="millisecond",this.step=5),1>t&&(this.scale="millisecond",this.step=1)}static snap(t,e,i){const n=No(t);if("year"==e){const t=n.year()+Math.round(n.month()/12);n.year(Math.round(t/i)*i),n.month(0),n.date(0),n.hours(0),n.minutes(0),n.seconds(0),n.milliseconds(0)}else if("month"==e)n.date()>15?(n.date(1),n.add(1,"month")):n.date(1),n.hours(0),n.minutes(0),n.seconds(0),n.milliseconds(0);else if("week"==e)n.weekday()>2?(n.weekday(0),n.add(1,"week")):n.weekday(0),n.hours(0),n.minutes(0),n.seconds(0),n.milliseconds(0);else if("day"==e){switch(i){case 5:case 2:n.hours(24*Math.round(n.hours()/24));break;default:n.hours(12*Math.round(n.hours()/12))}n.minutes(0),n.seconds(0),n.milliseconds(0)}else if("weekday"==e){switch(i){case 5:case 2:n.hours(12*Math.round(n.hours()/12));break;default:n.hours(6*Math.round(n.hours()/6))}n.minutes(0),n.seconds(0),n.milliseconds(0)}else if("hour"==e){if(4===i)n.minutes(60*Math.round(n.minutes()/60));else n.minutes(30*Math.round(n.minutes()/30));n.seconds(0),n.milliseconds(0)}else if("minute"==e){switch(i){case 15:case 10:n.minutes(5*Math.round(n.minutes()/5)),n.seconds(0);break;case 5:n.seconds(60*Math.round(n.seconds()/60));break;default:n.seconds(30*Math.round(n.seconds()/30))}n.milliseconds(0)}else if("second"==e)switch(i){case 15:case 10:n.seconds(5*Math.round(n.seconds()/5)),n.milliseconds(0);break;case 5:n.milliseconds(1e3*Math.round(n.milliseconds()/1e3));break;default:n.milliseconds(500*Math.round(n.milliseconds()/500))}else if("millisecond"==e){const t=i>5?i/2:1;n.milliseconds(Math.round(n.milliseconds()/t)*t)}return n}isMajor(){if(1==this.switchedYear)switch(this.scale){case"year":case"month":case"week":case"weekday":case"day":case"hour":case"minute":case"second":case"millisecond":return!0;default:return!1}else if(1==this.switchedMonth)switch(this.scale){case"week":case"weekday":case"day":case"hour":case"minute":case"second":case"millisecond":return!0;default:return!1}else if(1==this.switchedDay)switch(this.scale){case"millisecond":case"second":case"minute":case"hour":return!0;default:return!1}const t=this.moment(this.current);switch(this.scale){case"millisecond":return 0==t.milliseconds();case"second":return 0==t.seconds();case"minute":return 0==t.hours()&&0==t.minutes();case"hour":return 0==t.hours();case"weekday":case"day":return this.options.showWeekScale?1==t.isoWeekday():1==t.date();case"week":return 1==t.date();case"month":return 0==t.month();default:return!1}}getLabelMinor(t){if(null==t&&(t=this.current),t instanceof Date&&(t=this.moment(t)),"function"==typeof this.format.minorLabels)return this.format.minorLabels(t,this.scale,this.step);const e=this.format.minorLabels[this.scale];return"week"===this.scale&&1===t.date()&&0!==t.weekday()?"":e&&e.length>0?this.moment(t).format(e):""}getLabelMajor(t){if(null==t&&(t=this.current),t instanceof Date&&(t=this.moment(t)),"function"==typeof this.format.majorLabels)return this.format.majorLabels(t,this.scale,this.step);const e=this.format.majorLabels[this.scale];return e&&e.length>0?this.moment(t).format(e):""}getClassName(){const t=this.moment,e=this.moment(this.current),i=e.locale?e.locale("en"):e.lang("en"),n=this.step,o=[];function s(t){return t/n%2==0?" vis-even":" vis-odd"}function r(e){return e.isSame(Date.now(),"day")?" vis-today":e.isSame(t().add(1,"day"),"day")?" vis-tomorrow":e.isSame(t().add(-1,"day"),"day")?" vis-yesterday":""}function a(t){return t.isSame(Date.now(),"week")?" vis-current-week":""}function l(t){return t.isSame(Date.now(),"month")?" vis-current-month":""}switch(this.scale){case"millisecond":o.push(r(i)),o.push(s(i.milliseconds()));break;case"second":o.push(r(i)),o.push(s(i.seconds()));break;case"minute":o.push(r(i)),o.push(s(i.minutes()));break;case"hour":o.push(`vis-h${i.hours()}${4==this.step?"-h"+(i.hours()+4):""}`),o.push(r(i)),o.push(s(i.hours()));break;case"weekday":o.push(`vis-${i.format("dddd").toLowerCase()}`),o.push(r(i)),o.push(a(i)),o.push(s(i.date()));break;case"day":o.push(`vis-day${i.date()}`),o.push(`vis-${i.format("MMMM").toLowerCase()}`),o.push(r(i)),o.push(l(i)),o.push(this.step<=2?r(i):""),o.push(this.step<=2?`vis-${i.format("dddd").toLowerCase()}`:""),o.push(s(i.date()-1));break;case"week":o.push(`vis-week${i.format("w")}`),o.push(a(i)),o.push(s(i.week()));break;case"month":o.push(`vis-${i.format("MMMM").toLowerCase()}`),o.push(l(i)),o.push(s(i.month()));break;case"year":o.push(`vis-year${i.year()}`),o.push(function(t){return t.isSame(Date.now(),"year")?" vis-current-year":""}(i)),o.push(s(i.year()))}return o.filter(String).join(" ")}}ss.FORMAT={minorLabels:{millisecond:"SSS",second:"s",minute:"HH:mm",hour:"HH:mm",weekday:"ddd D",day:"D",week:"w",month:"MMM",year:"YYYY"},majorLabels:{millisecond:"HH:mm:ss",second:"D MMMM HH:mm",minute:"ddd D MMMM",hour:"ddd D MMMM",weekday:"MMMM YYYY",day:"MMMM YYYY",week:"MMMM YYYY",month:"YYYY",year:""}};class rs extends Go{constructor(t,e){super(),this.dom={foreground:null,lines:[],majorTexts:[],minorTexts:[],redundant:{lines:[],majorTexts:[],minorTexts:[]}},this.props={range:{start:0,end:0,minimumStep:0},lineTop:0},this.defaultOptions={orientation:{axis:"bottom"},showMinorLabels:!0,showMajorLabels:!0,showWeekScale:!1,maxMinorChars:7,format:Wo.extend({},ss.FORMAT),moment:No,timeAxis:null},this.options=Wo.extend({},this.defaultOptions),this.body=t,this._create(),this.setOptions(e)}setOptions(t){t&&(Wo.selectiveExtend(["showMinorLabels","showMajorLabels","showWeekScale","maxMinorChars","hiddenDates","timeAxis","moment","rtl"],this.options,t),Wo.selectiveDeepExtend(["format"],this.options,t),"orientation"in t&&("string"==typeof t.orientation?this.options.orientation.axis=t.orientation:"object"==typeof t.orientation&&"axis"in t.orientation&&(this.options.orientation.axis=t.orientation.axis)),"locale"in t&&("function"==typeof No.locale?No.locale(t.locale):No.lang(t.locale)))}_create(){this.dom.foreground=document.createElement("div"),this.dom.background=document.createElement("div"),this.dom.foreground.className="vis-time-axis vis-foreground",this.dom.background.className="vis-time-axis vis-background"}destroy(){this.dom.foreground.parentNode&&this.dom.foreground.parentNode.removeChild(this.dom.foreground),this.dom.background.parentNode&&this.dom.background.parentNode.removeChild(this.dom.background),this.body=null}redraw(){const t=this.props,e=this.dom.foreground,i=this.dom.background,n="top"==this.options.orientation.axis?this.body.dom.top:this.body.dom.bottom,o=e.parentNode!==n;this._calculateCharSize();const s=this.options.showMinorLabels&&"none"!==this.options.orientation.axis,r=this.options.showMajorLabels&&"none"!==this.options.orientation.axis;t.minorLabelHeight=s?t.minorCharHeight:0,t.majorLabelHeight=r?t.majorCharHeight:0,t.height=t.minorLabelHeight+t.majorLabelHeight,t.width=e.offsetWidth,t.minorLineHeight=this.body.domProps.root.height-t.majorLabelHeight-("top"==this.options.orientation.axis?this.body.domProps.bottom.height:this.body.domProps.top.height),t.minorLineWidth=1,t.majorLineHeight=t.minorLineHeight+t.majorLabelHeight,t.majorLineWidth=1;const a=e.nextSibling,l=i.nextSibling;return e.parentNode&&e.parentNode.removeChild(e),i.parentNode&&i.parentNode.removeChild(i),e.style.height=`${this.props.height}px`,this._repaintLabels(),a?n.insertBefore(e,a):n.appendChild(e),l?this.body.dom.backgroundVertical.insertBefore(i,l):this.body.dom.backgroundVertical.appendChild(i),this._isResized()||o}_repaintLabels(){const t=this.options.orientation.axis,e=Wo.convert(this.body.range.start,"Number"),i=Wo.convert(this.body.range.end,"Number"),n=this.body.util.toTime((this.props.minorCharWidth||10)*this.options.maxMinorChars).valueOf();let o=n-Zo(this.options.moment,this.body.hiddenDates,this.body.range,n);o-=this.body.util.toTime(0).valueOf();const s=new ss(new Date(e),new Date(i),o,this.body.hiddenDates,this.options);s.setMoment(this.options.moment),this.options.format&&s.setFormat(this.options.format),this.options.timeAxis&&s.setScale(this.options.timeAxis),this.step=s;const r=this.dom;let a,l,h,d,c,u;r.redundant.lines=r.lines,r.redundant.majorTexts=r.majorTexts,r.redundant.minorTexts=r.minorTexts,r.lines=[],r.majorTexts=[],r.minorTexts=[];let p,m,f,g=0,v=0;const y=1e3;let b;for(s.start(),l=s.getCurrent(),d=this.body.util.toScreen(l);s.hasNext()&&v=.4*p;if(this.options.showMinorLabels&&u){var w=this._repaintMinorText(h,s.getLabelMinor(a),t,b);w.style.width=`${g}px`}c&&this.options.showMajorLabels?(h>0&&(null==f&&(f=h),w=this._repaintMajorText(h,s.getLabelMajor(a),t,b)),m=this._repaintMajorLine(h,g,t,b)):u?m=this._repaintMinorLine(h,g,t,b):m&&(m.style.width=`${parseInt(m.style.width)+g}px`)}if(v!==y||as||(console.warn("Something is wrong with the Timeline scale. Limited drawing of grid lines to 1000 lines."),as=!0),this.options.showMajorLabels){const e=this.body.util.toTime(0),i=s.getLabelMajor(e),n=i.length*(this.props.majorCharWidth||10)+10;(null==f||n{for(;t.length;){const e=t.pop();e&&e.parentNode&&e.parentNode.removeChild(e)}}))}_repaintMinorText(t,e,i,n){let o=this.dom.redundant.minorTexts.shift();if(!o){const t=document.createTextNode("");o=document.createElement("div"),o.appendChild(t),this.dom.foreground.appendChild(o)}this.dom.minorTexts.push(o),o.innerHTML=Wo.xss(e);let s="top"==i?this.props.majorLabelHeight:0;return this._setXY(o,t,s),o.className=`vis-text vis-minor ${n}`,o}_repaintMajorText(t,e,i,n){let o=this.dom.redundant.majorTexts.shift();if(!o){const t=document.createElement("div");o=document.createElement("div"),o.appendChild(t),this.dom.foreground.appendChild(o)}o.childNodes[0].innerHTML=Wo.xss(e),o.className=`vis-text vis-major ${n}`;let s="top"==i?0:this.props.minorLabelHeight;return this._setXY(o,t,s),this.dom.majorTexts.push(o),o}_setXY(t,e,i){const n=this.options.rtl?-1*e:e;t.style.transform=`translate(${n}px, ${i}px)`}_repaintMinorLine(t,e,i,n){let o=this.dom.redundant.lines.shift();o||(o=document.createElement("div"),this.dom.background.appendChild(o)),this.dom.lines.push(o);const s=this.props;o.style.width=`${e}px`,o.style.height=`${s.minorLineHeight}px`;let r="top"==i?s.majorLabelHeight:this.body.domProps.top.height,a=t-s.minorLineWidth/2;return this._setXY(o,a,r),o.className=`vis-grid ${this.options.rtl?"vis-vertical-rtl":"vis-vertical"} vis-minor ${n}`,o}_repaintMajorLine(t,e,i,n){let o=this.dom.redundant.lines.shift();o||(o=document.createElement("div"),this.dom.background.appendChild(o)),this.dom.lines.push(o);const s=this.props;o.style.width=`${e}px`,o.style.height=`${s.majorLineHeight}px`;let r="top"==i?0:this.body.domProps.top.height,a=t-s.majorLineWidth/2;return this._setXY(o,a,r),o.className=`vis-grid ${this.options.rtl?"vis-vertical-rtl":"vis-vertical"} vis-major ${n}`,o}_calculateCharSize(){this.dom.measureCharMinor||(this.dom.measureCharMinor=document.createElement("DIV"),this.dom.measureCharMinor.className="vis-text vis-minor vis-measure",this.dom.measureCharMinor.style.position="absolute",this.dom.measureCharMinor.appendChild(document.createTextNode("0")),this.dom.foreground.appendChild(this.dom.measureCharMinor)),this.props.minorCharHeight=this.dom.measureCharMinor.clientHeight,this.props.minorCharWidth=this.dom.measureCharMinor.clientWidth,this.dom.measureCharMajor||(this.dom.measureCharMajor=document.createElement("DIV"),this.dom.measureCharMajor.className="vis-text vis-major vis-measure",this.dom.measureCharMajor.style.position="absolute",this.dom.measureCharMajor.appendChild(document.createTextNode("0")),this.dom.foreground.appendChild(this.dom.measureCharMajor)),this.props.majorCharHeight=this.dom.measureCharMajor.clientHeight,this.props.majorCharWidth=this.dom.measureCharMajor.clientWidth}}var as=!1;function ls(t){this.active=!1,this.dom={container:t},this.dom.overlay=document.createElement("div"),this.dom.overlay.className="vis-overlay",this.dom.container.appendChild(this.dom.overlay),this.hammer=ns(this.dom.overlay),this.hammer.on("tap",this._onTapOverlay.bind(this));var e=this;["tap","doubletap","press","pinch","pan","panstart","panmove","panend"].forEach((function(t){e.hammer.on(t,(function(t){t.stopPropagation()}))})),document&&document.body&&(this.onClick=function(i){(function(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1})(i.target,t)||e.deactivate()},document.body.addEventListener("click",this.onClick)),void 0!==this.keycharm&&this.keycharm.destroy(),this.keycharm=function(t){var e,i=t&&t.preventDefault||!1,n=t&&t.container||window,o={},s={keydown:{},keyup:{}},r={};for(e=97;e<=122;e++)r[String.fromCharCode(e)]={code:e-97+65,shift:!1};for(e=65;e<=90;e++)r[String.fromCharCode(e)]={code:e,shift:!0};for(e=0;e<=9;e++)r[""+e]={code:48+e,shift:!1};for(e=1;e<=12;e++)r["F"+e]={code:111+e,shift:!1};for(e=0;e<=9;e++)r["num"+e]={code:96+e,shift:!1};r["num*"]={code:106,shift:!1},r["num+"]={code:107,shift:!1},r["num-"]={code:109,shift:!1},r["num/"]={code:111,shift:!1},r["num."]={code:110,shift:!1},r.left={code:37,shift:!1},r.up={code:38,shift:!1},r.right={code:39,shift:!1},r.down={code:40,shift:!1},r.space={code:32,shift:!1},r.enter={code:13,shift:!1},r.shift={code:16,shift:void 0},r.esc={code:27,shift:!1},r.backspace={code:8,shift:!1},r.tab={code:9,shift:!1},r.ctrl={code:17,shift:!1},r.alt={code:18,shift:!1},r.delete={code:46,shift:!1},r.pageup={code:33,shift:!1},r.pagedown={code:34,shift:!1},r["="]={code:187,shift:!1},r["-"]={code:189,shift:!1},r["]"]={code:221,shift:!1},r["["]={code:219,shift:!1};var a=function(t){h(t,"keydown")},l=function(t){h(t,"keyup")},h=function(t,e){if(void 0!==s[e][t.keyCode]){for(var n=s[e][t.keyCode],o=0;o{this.options.locales[t]=Wo.extend({},i,this.options.locales[t])})),e&&null!=e.time?this.customTime=e.time:this.customTime=new Date,this.eventParams={},this._create()}setOptions(t){t&&Wo.selectiveExtend(["moment","locale","locales","id","title","rtl","snap"],this.options,t)}_create(){const t=document.createElement("div");t["custom-time"]=this,t.className=`vis-custom-time ${this.options.id||""}`,t.style.position="absolute",t.style.top="0px",t.style.height="100%",this.bar=t;const e=document.createElement("div");function i(t){this.body.range._onMouseWheel(t)}e.style.position="relative",e.style.top="0px",this.options.rtl?e.style.right="-10px":e.style.left="-10px",e.style.height="100%",e.style.width="20px",e.addEventListener?(e.addEventListener("mousewheel",i.bind(this),!1),e.addEventListener("DOMMouseScroll",i.bind(this),!1)):e.attachEvent("onmousewheel",i.bind(this)),t.appendChild(e),this.hammer=new ns(e),this.hammer.on("panstart",this._onDragStart.bind(this)),this.hammer.on("panmove",this._onDrag.bind(this)),this.hammer.on("panend",this._onDragEnd.bind(this)),this.hammer.get("pan").set({threshold:5,direction:ns.DIRECTION_ALL}),this.hammer.get("press").set({time:1e4})}destroy(){this.hide(),this.hammer.destroy(),this.hammer=null,this.body=null}redraw(){const t=this.body.dom.backgroundVertical;this.bar.parentNode!=t&&(this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar),t.appendChild(this.bar));const e=this.body.util.toScreen(this.customTime);let i=this.options.locales[this.options.locale];i||(this.warned||(console.warn(`WARNING: options.locales['${this.options.locale}'] not found. See https://visjs.github.io/vis-timeline/docs/timeline/#Localization`),this.warned=!0),i=this.options.locales.en);let n=this.options.title;return void 0===n?(n=`${i.time}: ${this.options.moment(this.customTime).format("dddd, MMMM Do YYYY, H:mm:ss")}`,n=n.charAt(0).toUpperCase()+n.substring(1)):"function"==typeof n&&(n=n.call(this,this.customTime)),this.options.rtl?this.bar.style.right=`${e}px`:this.bar.style.left=`${e}px`,this.bar.title=n,!1}hide(){this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar)}setCustomTime(t){this.customTime=Wo.convert(t,"Date"),this.redraw()}getCustomTime(){return new Date(this.customTime.valueOf())}setCustomMarker(t,e){const i=document.createElement("div");i.className="vis-custom-time-marker",i.innerHTML=Wo.xss(t),i.style.position="absolute",e&&(i.setAttribute("contenteditable","true"),i.addEventListener("pointerdown",(function(){i.focus()})),i.addEventListener("input",this._onMarkerChange.bind(this)),i.title=t,i.addEventListener("blur",function(t){this.title!=t.target.innerHTML&&(this._onMarkerChanged(t),this.title=t.target.innerHTML)}.bind(this))),this.bar.appendChild(i)}setCustomTitle(t){this.options.title=t}_onDragStart(t){this.eventParams.dragging=!0,this.eventParams.customTime=this.customTime,t.stopPropagation()}_onDrag(t){if(!this.eventParams.dragging)return;let e=this.options.rtl?-1*t.deltaX:t.deltaX;const i=this.body.util.toScreen(this.eventParams.customTime)+e,n=this.body.util.toTime(i),o=this.body.util.getScale(),s=this.body.util.getStep(),r=this.options.snap,a=r?r(n,o,s):n;this.setCustomTime(a),this.body.emitter.emit("timechange",{id:this.options.id,time:new Date(this.customTime.valueOf()),event:t}),t.stopPropagation()}_onDragEnd(t){this.eventParams.dragging&&(this.body.emitter.emit("timechanged",{id:this.options.id,time:new Date(this.customTime.valueOf()),event:t}),t.stopPropagation())}_onMarkerChange(t){this.body.emitter.emit("markerchange",{id:this.options.id,title:t.target.innerHTML,event:t}),t.stopPropagation()}_onMarkerChanged(t){this.body.emitter.emit("markerchanged",{id:this.options.id,title:t.target.innerHTML,event:t}),t.stopPropagation()}static customTimeFromTarget(t){let e=t.target;for(;e;){if(e.hasOwnProperty("custom-time"))return e["custom-time"];e=e.parentNode}return null}}class Cs{_create(t){this.dom={},this.dom.container=t,this.dom.container.style.position="relative",this.dom.root=document.createElement("div"),this.dom.background=document.createElement("div"),this.dom.backgroundVertical=document.createElement("div"),this.dom.backgroundHorizontal=document.createElement("div"),this.dom.centerContainer=document.createElement("div"),this.dom.leftContainer=document.createElement("div"),this.dom.rightContainer=document.createElement("div"),this.dom.center=document.createElement("div"),this.dom.left=document.createElement("div"),this.dom.right=document.createElement("div"),this.dom.top=document.createElement("div"),this.dom.bottom=document.createElement("div"),this.dom.shadowTop=document.createElement("div"),this.dom.shadowBottom=document.createElement("div"),this.dom.shadowTopLeft=document.createElement("div"),this.dom.shadowBottomLeft=document.createElement("div"),this.dom.shadowTopRight=document.createElement("div"),this.dom.shadowBottomRight=document.createElement("div"),this.dom.rollingModeBtn=document.createElement("div"),this.dom.loadingScreen=document.createElement("div"),this.dom.root.className="vis-timeline",this.dom.background.className="vis-panel vis-background",this.dom.backgroundVertical.className="vis-panel vis-background vis-vertical",this.dom.backgroundHorizontal.className="vis-panel vis-background vis-horizontal",this.dom.centerContainer.className="vis-panel vis-center",this.dom.leftContainer.className="vis-panel vis-left",this.dom.rightContainer.className="vis-panel vis-right",this.dom.top.className="vis-panel vis-top",this.dom.bottom.className="vis-panel vis-bottom",this.dom.left.className="vis-content",this.dom.center.className="vis-content",this.dom.right.className="vis-content",this.dom.shadowTop.className="vis-shadow vis-top",this.dom.shadowBottom.className="vis-shadow vis-bottom",this.dom.shadowTopLeft.className="vis-shadow vis-top",this.dom.shadowBottomLeft.className="vis-shadow vis-bottom",this.dom.shadowTopRight.className="vis-shadow vis-top",this.dom.shadowBottomRight.className="vis-shadow vis-bottom",this.dom.rollingModeBtn.className="vis-rolling-mode-btn",this.dom.loadingScreen.className="vis-loading-screen",this.dom.root.appendChild(this.dom.background),this.dom.root.appendChild(this.dom.backgroundVertical),this.dom.root.appendChild(this.dom.backgroundHorizontal),this.dom.root.appendChild(this.dom.centerContainer),this.dom.root.appendChild(this.dom.leftContainer),this.dom.root.appendChild(this.dom.rightContainer),this.dom.root.appendChild(this.dom.top),this.dom.root.appendChild(this.dom.bottom),this.dom.root.appendChild(this.dom.rollingModeBtn),this.dom.centerContainer.appendChild(this.dom.center),this.dom.leftContainer.appendChild(this.dom.left),this.dom.rightContainer.appendChild(this.dom.right),this.dom.centerContainer.appendChild(this.dom.shadowTop),this.dom.centerContainer.appendChild(this.dom.shadowBottom),this.dom.leftContainer.appendChild(this.dom.shadowTopLeft),this.dom.leftContainer.appendChild(this.dom.shadowBottomLeft),this.dom.rightContainer.appendChild(this.dom.shadowTopRight),this.dom.rightContainer.appendChild(this.dom.shadowBottomRight),this.props={root:{},background:{},centerContainer:{},leftContainer:{},rightContainer:{},center:{},left:{},right:{},top:{},bottom:{},border:{},scrollTop:0,scrollTopMin:0},this.on("rangechange",(()=>{!0===this.initialDrawDone&&this._redraw()})),this.on("rangechanged",(()=>{this.initialRangeChangeDone||(this.initialRangeChangeDone=!0)})),this.on("touch",this._onTouch.bind(this)),this.on("panmove",this._onDrag.bind(this));const e=this;this._origRedraw=this._redraw.bind(this),this._redraw=Wo.throttle(this._origRedraw),this.on("_change",(t=>{e.itemSet&&e.itemSet.initialItemSetDrawn&&t&&1==t.queue?e._redraw():e._origRedraw()})),this.hammer=new ns(this.dom.root);const i=this.hammer.get("pinch").set({enable:!0});i&&function(t){t.getTouchAction=function(){return["pan-y"]}}(i),this.hammer.get("pan").set({threshold:5,direction:ns.DIRECTION_ALL}),this.timelineListeners={};var n,o;function s(t){this.isActive()&&this.emit("mousewheel",t);let e=0,i=0;if("detail"in t&&(i=-1*t.detail),"wheelDelta"in t&&(i=t.wheelDelta),"wheelDeltaY"in t&&(i=t.wheelDeltaY),"wheelDeltaX"in t&&(e=-1*t.wheelDeltaX),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=-1*i,i=0),"deltaY"in t&&(i=-1*t.deltaY),"deltaX"in t&&(e=t.deltaX),t.deltaMode&&(1===t.deltaMode?(e*=40,i*=40):(e*=40,i*=800)),this.options.preferZoom){if(!this.options.zoomKey||t[this.options.zoomKey])return}else if(this.options.zoomKey&&t[this.options.zoomKey])return;if(this.options.verticalScroll||this.options.horizontalScroll)if(this.options.verticalScroll&&Math.abs(i)>=Math.abs(e)){const e=this.props.scrollTop,n=e+i;if(this.isActive()){this._setScrollTop(n)!==e&&(this._redraw(),this.emit("scroll",t),t.preventDefault())}}else if(this.options.horizontalScroll){const n=(Math.abs(e)>=Math.abs(i)?e:i)/120*(this.range.end-this.range.start)/20,o=this.range.start+n,s=this.range.end+n,r={animation:!1,byUser:!0,event:t};this.range.setRange(o,s,r),t.preventDefault()}}["tap","doubletap","press","pinch","pan","panstart","panmove","panend"].forEach((t=>{const i=i=>{e.isActive()&&e.emit(t,i)};e.hammer.on(t,i),e.timelineListeners[t]=i})),os(this.hammer,(t=>{e.emit("touch",t)})),n=this.hammer,(o=t=>{e.emit("release",t)}).inputHandler=function(t){t.isFinal&&o(t)},n.on("hammer.input",o.inputHandler);const r="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":this.dom.centerContainer.addEventListener?"DOMMouseScroll":"onmousewheel";function a(t){if(e.options.verticalScroll&&(t.preventDefault(),e.isActive())){const i=-t.target.scrollTop;e._setScrollTop(i),e._redraw(),e.emit("scrollSide",t)}}this.dom.top.addEventListener,this.dom.bottom.addEventListener,this.dom.centerContainer.addEventListener(r,s.bind(this),!1),this.dom.top.addEventListener(r,s.bind(this),!1),this.dom.bottom.addEventListener(r,s.bind(this),!1),this.dom.left.parentNode.addEventListener("scroll",a.bind(this)),this.dom.right.parentNode.addEventListener("scroll",a.bind(this));let l=!1;if(this.dom.center.addEventListener("dragover",function(t){if(t.preventDefault&&(e.emit("dragover",e.getEventProperties(t)),t.preventDefault()),t.target.className.indexOf("timeline")>-1&&!l)return t.dataTransfer.dropEffect="move",l=!0,!1}.bind(this),!1),this.dom.center.addEventListener("drop",function(t){t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation();try{var i=JSON.parse(t.dataTransfer.getData("text"));if(!i||!i.content)return}catch(t){return!1}return l=!1,t.center={x:t.clientX,y:t.clientY},"item"!==i.target?e.itemSet._onAddItem(t):e.itemSet._onDropObjectOnItem(t),e.emit("drop",e.getEventProperties(t)),!1}.bind(this),!1),this.customTimes=[],this.touch={},this.redrawCount=0,this.initialDrawDone=!1,this.initialRangeChangeDone=!1,!t)throw new Error("No container provided");t.appendChild(this.dom.root),t.appendChild(this.dom.loadingScreen)}setOptions(t){if(t){const e=["width","height","minHeight","maxHeight","autoResize","start","end","clickToUse","dataAttributes","hiddenDates","locale","locales","moment","preferZoom","rtl","zoomKey","horizontalScroll","verticalScroll","longSelectPressTime","snap"];if(Wo.selectiveExtend(e,this.options,t),this.dom.rollingModeBtn.style.visibility="hidden",this.options.rtl&&(this.dom.container.style.direction="rtl",this.dom.backgroundVertical.className="vis-panel vis-background vis-vertical-rtl"),this.options.verticalScroll&&(this.options.rtl?this.dom.rightContainer.className="vis-panel vis-right vis-vertical-scroll":this.dom.leftContainer.className="vis-panel vis-left vis-vertical-scroll"),"object"!=typeof this.options.orientation&&(this.options.orientation={item:void 0,axis:void 0}),"orientation"in t&&("string"==typeof t.orientation?this.options.orientation={item:t.orientation,axis:t.orientation}:"object"==typeof t.orientation&&("item"in t.orientation&&(this.options.orientation.item=t.orientation.item),"axis"in t.orientation&&(this.options.orientation.axis=t.orientation.axis))),"both"===this.options.orientation.axis){if(!this.timeAxis2){const t=this.timeAxis2=new rs(this.body);t.setOptions=e=>{const i=e?Wo.extend({},e):{};i.orientation="top",rs.prototype.setOptions.call(t,i)},this.components.push(t)}}else if(this.timeAxis2){const t=this.components.indexOf(this.timeAxis2);-1!==t&&this.components.splice(t,1),this.timeAxis2.destroy(),this.timeAxis2=null}"function"==typeof t.drawPoints&&(t.drawPoints={onRender:t.drawPoints}),"hiddenDates"in this.options&&Vo(this.options.moment,this.body,this.options.hiddenDates),"clickToUse"in t&&(t.clickToUse?this.activator||(this.activator=new ls(this.dom.root)):this.activator&&(this.activator.destroy(),delete this.activator)),this._initAutoResize()}if(this.components.forEach((e=>e.setOptions(t))),"configure"in t){this.configurator||(this.configurator=this._createConfigurator()),this.configurator.setOptions(t.configure);const e=Wo.deepExtend({},this.options);this.components.forEach((t=>{Wo.deepExtend(e,t.options)})),this.configurator.setModuleOptions({global:e})}this._redraw()}isActive(){return!this.activator||this.activator.active}destroy(){this.setItems(null),this.setGroups(null),this.off(),this._stopAutoResize(),this.dom.root.parentNode&&this.dom.root.parentNode.removeChild(this.dom.root),this.dom=null,this.activator&&(this.activator.destroy(),delete this.activator);for(const t in this.timelineListeners)this.timelineListeners.hasOwnProperty(t)&&delete this.timelineListeners[t];this.timelineListeners=null,this.hammer&&this.hammer.destroy(),this.hammer=null,this.components.forEach((t=>t.destroy())),this.body=null}setCustomTime(t,e){const i=this.customTimes.filter((t=>e===t.options.id));if(0===i.length)throw new Error(`No custom time bar found with id ${JSON.stringify(e)}`);i.length>0&&i[0].setCustomTime(t)}getCustomTime(t){const e=this.customTimes.filter((e=>e.options.id===t));if(0===e.length)throw new Error(`No custom time bar found with id ${JSON.stringify(t)}`);return e[0].getCustomTime()}setCustomTimeMarker(t,e,i){const n=this.customTimes.filter((t=>t.options.id===e));if(0===n.length)throw new Error(`No custom time bar found with id ${JSON.stringify(e)}`);n.length>0&&n[0].setCustomMarker(t,i)}setCustomTimeTitle(t,e){const i=this.customTimes.filter((t=>t.options.id===e));if(0===i.length)throw new Error(`No custom time bar found with id ${JSON.stringify(e)}`);if(i.length>0)return i[0].setCustomTitle(t)}getEventProperties(t){return{event:t}}addCustomTime(t,e){const i=void 0!==t?Wo.convert(t,"Date"):new Date,n=this.customTimes.some((t=>t.options.id===e));if(n)throw new Error(`A custom time with id ${JSON.stringify(e)} already exists`);const o=new Ds(this.body,Wo.extend({},this.options,{time:i,id:e,snap:this.itemSet?this.itemSet.options.snap:this.options.snap}));return this.customTimes.push(o),this.components.push(o),this._redraw(),e}removeCustomTime(t){const e=this.customTimes.filter((e=>e.options.id===t));if(0===e.length)throw new Error(`No custom time bar found with id ${JSON.stringify(t)}`);e.forEach((t=>{this.customTimes.splice(this.customTimes.indexOf(t),1),this.components.splice(this.components.indexOf(t),1),t.destroy()}))}getVisibleItems(){return this.itemSet&&this.itemSet.getVisibleItems()||[]}getItemsAtCurrentTime(t){return this.time=t,this.itemSet&&this.itemSet.getItemsAtCurrentTime(this.time)||[]}getVisibleGroups(){return this.itemSet&&this.itemSet.getVisibleGroups()||[]}fit(t,e){const i=this.getDataRange();if(null===i.min&&null===i.max)return;const n=i.max-i.min,o=new Date(i.min.valueOf()-.01*n),s=new Date(i.max.valueOf()+.01*n),r=!t||void 0===t.animation||t.animation;this.range.setRange(o,s,{animation:r},e)}getDataRange(){throw new Error("Cannot invoke abstract method getDataRange")}setWindow(t,e,i,n){let o,s;"function"==typeof arguments[2]&&(n=arguments[2],i={}),1==arguments.length?(s=arguments[0],o=void 0===s.animation||s.animation,this.range.setRange(s.start,s.end,{animation:o})):2==arguments.length&&"function"==typeof arguments[1]?(s=arguments[0],n=arguments[1],o=void 0===s.animation||s.animation,this.range.setRange(s.start,s.end,{animation:o},n)):(o=!i||void 0===i.animation||i.animation,this.range.setRange(t,e,{animation:o},n))}moveTo(t,e,i){"function"==typeof arguments[1]&&(i=arguments[1],e={});const n=this.range.end-this.range.start,o=Wo.convert(t,"Date").valueOf(),s=o-n/2,r=o+n/2,a=!e||void 0===e.animation||e.animation;this.range.setRange(s,r,{animation:a},i)}getWindow(){const t=this.range.getRange();return{start:new Date(t.start),end:new Date(t.end)}}zoomIn(t,e,i){if(!t||t<0||t>1)return;"function"==typeof arguments[1]&&(i=arguments[1],e={});const n=this.getWindow(),o=n.start.valueOf(),s=n.end.valueOf(),r=s-o,a=(r-r/(1+t))/2,l=o+a,h=s-a;this.setWindow(l,h,e,i)}zoomOut(t,e,i){if(!t||t<0||t>1)return;"function"==typeof arguments[1]&&(i=arguments[1],e={});const n=this.getWindow(),o=n.start.valueOf(),s=n.end.valueOf(),r=s-o,a=o-r*t/2,l=s+r*t/2;this.setWindow(a,l,e,i)}redraw(){this._redraw()}_redraw(){this.redrawCount++;const t=this.dom;if(!t||!t.container||0==t.root.offsetWidth)return;let e=!1;const i=this.options,n=this.props;Uo(this.options.moment,this.body,this.options.hiddenDates),"top"==i.orientation?(Wo.addClassName(t.root,"vis-top"),Wo.removeClassName(t.root,"vis-bottom")):(Wo.removeClassName(t.root,"vis-top"),Wo.addClassName(t.root,"vis-bottom")),i.rtl?(Wo.addClassName(t.root,"vis-rtl"),Wo.removeClassName(t.root,"vis-ltr")):(Wo.addClassName(t.root,"vis-ltr"),Wo.removeClassName(t.root,"vis-rtl")),t.root.style.maxHeight=Wo.option.asSize(i.maxHeight,""),t.root.style.minHeight=Wo.option.asSize(i.minHeight,""),t.root.style.width=Wo.option.asSize(i.width,"");const o=t.root.offsetWidth;n.border.left=1,n.border.right=1,n.border.top=1,n.border.bottom=1,n.center.height=t.center.offsetHeight,n.left.height=t.left.offsetHeight,n.right.height=t.right.offsetHeight,n.top.height=t.top.clientHeight||-n.border.top,n.bottom.height=Math.round(t.bottom.getBoundingClientRect().height)||t.bottom.clientHeight||-n.border.bottom;const s=Math.max(n.left.height,n.center.height,n.right.height),r=n.top.height+s+n.bottom.height+n.border.top+n.border.bottom;t.root.style.height=Wo.option.asSize(i.height,`${r}px`),n.root.height=t.root.offsetHeight,n.background.height=n.root.height;const a=n.root.height-n.top.height-n.bottom.height;n.centerContainer.height=a,n.leftContainer.height=a,n.rightContainer.height=n.leftContainer.height,n.root.width=o,n.background.width=n.root.width,this.initialDrawDone||(n.scrollbarWidth=Wo.getScrollBarWidth());const l=t.leftContainer.clientWidth,h=t.rightContainer.clientWidth;i.verticalScroll?i.rtl?(n.left.width=l||-n.border.left,n.right.width=h+n.scrollbarWidth||-n.border.right):(n.left.width=l+n.scrollbarWidth||-n.border.left,n.right.width=h||-n.border.right):(n.left.width=l||-n.border.left,n.right.width=h||-n.border.right),this._setDOM();let d=this._updateScrollTop();"top"!=i.orientation.item&&(d+=Math.max(n.centerContainer.height-n.center.height-n.border.top-n.border.bottom,0)),t.center.style.transform=`translateY(${d}px)`;const c=0==n.scrollTop?"hidden":"",u=n.scrollTop==n.scrollTopMin?"hidden":"";t.shadowTop.style.visibility=c,t.shadowBottom.style.visibility=u,t.shadowTopLeft.style.visibility=c,t.shadowBottomLeft.style.visibility=u,t.shadowTopRight.style.visibility=c,t.shadowBottomRight.style.visibility=u,i.verticalScroll&&(t.rightContainer.className="vis-panel vis-right vis-vertical-scroll",t.leftContainer.className="vis-panel vis-left vis-vertical-scroll",t.shadowTopRight.style.visibility="hidden",t.shadowBottomRight.style.visibility="hidden",t.shadowTopLeft.style.visibility="hidden",t.shadowBottomLeft.style.visibility="hidden",t.left.style.top="0px",t.right.style.top="0px"),(!i.verticalScroll||n.center.heightn.centerContainer.height;this.hammer.get("pan").set({direction:p?ns.DIRECTION_ALL:ns.DIRECTION_HORIZONTAL}),this.hammer.get("press").set({time:this.options.longSelectPressTime}),this.components.forEach((t=>{e=t.redraw()||e}));if(e){if(this.redrawCount<5)return void this.body.emitter.emit("_change");console.log("WARNING: infinite loop in redraw?")}else this.redrawCount=0;this.body.emitter.emit("changed")}_setDOM(){const t=this.props,e=this.dom;t.leftContainer.width=t.left.width,t.rightContainer.width=t.right.width;const i=t.root.width-t.left.width-t.right.width;t.center.width=i,t.centerContainer.width=i,t.top.width=i,t.bottom.width=i,e.background.style.height=`${t.background.height}px`,e.backgroundVertical.style.height=`${t.background.height}px`,e.backgroundHorizontal.style.height=`${t.centerContainer.height}px`,e.centerContainer.style.height=`${t.centerContainer.height}px`,e.leftContainer.style.height=`${t.leftContainer.height}px`,e.rightContainer.style.height=`${t.rightContainer.height}px`,e.background.style.width=`${t.background.width}px`,e.backgroundVertical.style.width=`${t.centerContainer.width}px`,e.backgroundHorizontal.style.width=`${t.background.width}px`,e.centerContainer.style.width=`${t.center.width}px`,e.top.style.width=`${t.top.width}px`,e.bottom.style.width=`${t.bottom.width}px`,e.background.style.left="0",e.background.style.top="0",e.backgroundVertical.style.left=`${t.left.width+t.border.left}px`,e.backgroundVertical.style.top="0",e.backgroundHorizontal.style.left="0",e.backgroundHorizontal.style.top=`${t.top.height}px`,e.centerContainer.style.left=`${t.left.width}px`,e.centerContainer.style.top=`${t.top.height}px`,e.leftContainer.style.left="0",e.leftContainer.style.top=`${t.top.height}px`,e.rightContainer.style.left=`${t.left.width+t.center.width}px`,e.rightContainer.style.top=`${t.top.height}px`,e.top.style.left=`${t.left.width}px`,e.top.style.top="0",e.bottom.style.left=`${t.left.width}px`,e.bottom.style.top=`${t.top.height+t.centerContainer.height}px`,e.center.style.left="0",e.left.style.left="0",e.right.style.left="0"}setCurrentTime(t){if(!this.currentTime)throw new Error("Option showCurrentTime must be true");this.currentTime.setCurrentTime(t)}getCurrentTime(){if(!this.currentTime)throw new Error("Option showCurrentTime must be true");return this.currentTime.getCurrentTime()}_toTime(t){return qo(this,t,this.props.center.width)}_toGlobalTime(t){return qo(this,t,this.props.root.width)}_toScreen(t){return $o(this,t,this.props.center.width)}_toGlobalScreen(t){return $o(this,t,this.props.root.width)}_initAutoResize(){1==this.options.autoResize?this._startAutoResize():this._stopAutoResize()}_startAutoResize(){const t=this;this._stopAutoResize(),this._onResize=()=>{if(1==t.options.autoResize){if(t.dom.root){const e=t.dom.root.offsetHeight,i=t.dom.root.offsetWidth;i==t.props.lastWidth&&e==t.props.lastHeight||(t.props.lastWidth=i,t.props.lastHeight=e,t.props.scrollbarWidth=Wo.getScrollBarWidth(),t.body.emitter.emit("_change"))}}else t._stopAutoResize()},Wo.addEventListener(window,"resize",this._onResize),t.dom.root&&(t.props.lastWidth=t.dom.root.offsetWidth,t.props.lastHeight=t.dom.root.offsetHeight),this.watchTimer=setInterval(this._onResize,1e3)}_stopAutoResize(){this.watchTimer&&(clearInterval(this.watchTimer),this.watchTimer=void 0),this._onResize&&(Wo.removeEventListener(window,"resize",this._onResize),this._onResize=null)}_onTouch(t){this.touch.allowDragging=!0,this.touch.initialScrollTop=this.props.scrollTop}_onPinch(t){this.touch.allowDragging=!1}_onDrag(t){if(!t)return;if(!this.touch.allowDragging)return;const e=t.deltaY,i=this._getScrollTop(),n=this._setScrollTop(this.touch.initialScrollTop+e);this.options.verticalScroll&&(this.dom.left.parentNode.scrollTop=-this.props.scrollTop,this.dom.right.parentNode.scrollTop=-this.props.scrollTop),n!=i&&this.emit("verticalDrag")}_setScrollTop(t){return this.props.scrollTop=t,this._updateScrollTop(),this.props.scrollTop}_updateScrollTop(){const t=Math.min(this.props.centerContainer.height-this.props.border.top-this.props.border.bottom-this.props.center.height,0);return t!=this.props.scrollTopMin&&("top"!=this.options.orientation.item&&(this.props.scrollTop+=t-this.props.scrollTopMin),this.props.scrollTopMin=t),this.props.scrollTop>0&&(this.props.scrollTop=0),this.props.scrollTop{this.options.locales[t]=Wo.extend({},i,this.options.locales[t])})),this.offset=0,this._create()}_create(){const t=document.createElement("div");t.className="vis-current-time",t.style.position="absolute",t.style.top="0px",t.style.height="100%",this.bar=t}destroy(){this.options.showCurrentTime=!1,this.redraw(),this.body=null}setOptions(t){t&&Wo.selectiveExtend(["rtl","showCurrentTime","alignCurrentTime","moment","locale","locales"],this.options,t)}redraw(){if(this.options.showCurrentTime){const t=this.body.dom.backgroundVertical;this.bar.parentNode!=t&&(this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar),t.appendChild(this.bar),this.start());let e=this.options.moment(Date.now()+this.offset);this.options.alignCurrentTime&&(e=e.startOf(this.options.alignCurrentTime));const i=this.body.util.toScreen(e);let n=this.options.locales[this.options.locale];n||(this.warned||(console.warn(`WARNING: options.locales['${this.options.locale}'] not found. See https://visjs.github.io/vis-timeline/docs/timeline/#Localization`),this.warned=!0),n=this.options.locales.en);let o=`${n.current} ${n.time}: ${e.format("dddd, MMMM Do YYYY, H:mm:ss")}`;o=o.charAt(0).toUpperCase()+o.substring(1),this.options.rtl?this.bar.style.transform=`translateX(${-1*i}px)`:this.bar.style.transform=`translateX(${i}px)`,this.bar.title=o}else this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar),this.stop();return!1}start(){const t=this;!function e(){t.stop();let i=1/t.body.range.conversion(t.body.domProps.center.width).scale/10;i<30&&(i=30),i>1e3&&(i=1e3),t.redraw(),t.body.emitter.emit("currentTimeTick"),t.currentTimeTimer=setTimeout(e,i)}()}stop(){void 0!==this.currentTimeTimer&&(clearTimeout(this.currentTimeTimer),delete this.currentTimeTimer)}setCurrentTime(t){const e=Wo.convert(t,"Date").valueOf(),i=Date.now();this.offset=e-i,this.redraw()}getCurrentTime(){return new Date(Date.now()+this.offset)}}const Ts=.001;function Es(t,e,i,n){return null===As(t,e.item,!1,(t=>t.stack&&(i||null===t.top)),(t=>t.stack),(t=>e.axis),n)}function Ms(t,e,i){const n=As(t,e.item,!1,(t=>t.stack),(t=>!0),(t=>t.baseTop));i.height=n-i.top+.5*e.item.vertical}function Os(t,e,i,n){for(let o=0;ot.index>e.index?1:t.index!0),(t=>!0),(t=>0));for(let n=0;ni[t].index&&(i[s].top+=i[t].height);const o=t[s];for(let t=0;tt.start,l=t=>t.end;if(!i){const i=!(!t[0]||!t[0].options.rtl);a=i?t=>t.right:t=>t.left,l=t=>a(t)+t.width+e.horizontal}const h=[],d=[];let c=null,u=0;for(const e of t)if(n(e))h.push(e);else if(o(e)){const t=a(e);null!==c&&ta(e)-Ts>t),u),d.splice(u,0,e),u++}c=null;let p=null;u=0;let m=0,f=0,g=0;for(;h.length>0;){const t=h.shift();t.top=s(t);const i=a(t),n=l(t);null!==c&&iinn&&(f=Ns(d,(t=>n+Ts>=a(t)),m,horizontalOVerlapEndIndex)+1);const w=d.slice(m,f).filter((t=>ia(t))).sort(((t,e)=>t.top-e.top));for(let i=0;iy.top&&(t.top=n.top+n.height+e.vertical)}o(t)&&(u=Ps(d,(t=>a(t)-Ts>i),u),d.splice(u,0,t),u++);const _=t.top+t.height;if(_>g&&(g=_),r&&r())return null}var v,y,b;return g}function Ps(t,e,i){i||(i=0);const n=t.slice(i).findIndex(e);return-1===n?t.length:n+i}function Ns(t,e,n,o){for(n||(n=0),o||(o=t.length),i=o-1;i>=n;i--)if(e(t[i]))return i;return n-1}const Fs="__background__";class Rs{constructor(t,e,i){if(this.groupId=t,this.subgroups={},this.subgroupStack={},this.subgroupStackAll=!1,this.subgroupVisibility={},this.doInnerStack=!1,this.shouldBailStackItems=!1,this.subgroupIndex=0,this.subgroupOrderer=e&&e.subgroupOrder,this.itemSet=i,this.isVisible=null,this.stackDirty=!0,this._disposeCallbacks=[],e&&e.nestedGroups&&(this.nestedGroups=e.nestedGroups,0==e.showNested?this.showNested=!1:this.showNested=!0),e&&e.subgroupStack)if("boolean"==typeof e.subgroupStack)this.doInnerStack=e.subgroupStack,this.subgroupStackAll=e.subgroupStack;else for(const t in e.subgroupStack)this.subgroupStack[t]=e.subgroupStack[t],this.doInnerStack=this.doInnerStack||e.subgroupStack[t];e&&e.heightMode?this.heightMode=e.heightMode:this.heightMode=i.options.groupHeightMode,this.nestedInGroup=null,this.dom={},this.props={label:{width:0,height:0}},this.className=null,this.items={},this.visibleItems=[],this.itemsInRange=[],this.orderedItems={byStart:[],byEnd:[]},this.checkRangedItems=!1;const n=()=>{this.checkRangedItems=!0};this.itemSet.body.emitter.on("checkRangedItems",n),this._disposeCallbacks.push((()=>{this.itemSet.body.emitter.off("checkRangedItems",n)})),this._create(),this.setData(e)}_create(){const t=document.createElement("div");this.itemSet.options.groupEditable.order?t.className="vis-label draggable":t.className="vis-label",this.dom.label=t;const e=document.createElement("div");e.className="vis-inner",t.appendChild(e),this.dom.inner=e;const i=document.createElement("div");i.className="vis-group",i["vis-group"]=this,this.dom.foreground=i,this.dom.background=document.createElement("div"),this.dom.background.className="vis-group",this.dom.axis=document.createElement("div"),this.dom.axis.className="vis-group",this.dom.marker=document.createElement("div"),this.dom.marker.style.visibility="hidden",this.dom.marker.style.position="absolute",this.dom.marker.innerHTML="",this.dom.background.appendChild(this.dom.marker)}setData(t){if(this.itemSet.groupTouchParams.isDragging)return;let e,i;if(t&&t.subgroupVisibility)for(const e in t.subgroupVisibility)this.subgroupVisibility[e]=t.subgroupVisibility[e];if(this.itemSet.options&&this.itemSet.options.groupTemplate?(i=this.itemSet.options.groupTemplate.bind(this),e=i(t,this.dom.inner)):e=t&&t.content,e instanceof Element){for(;this.dom.inner.firstChild;)this.dom.inner.removeChild(this.dom.inner.firstChild);this.dom.inner.appendChild(e)}else e instanceof Object&&e.isReactComponent||(e instanceof Object?i(t,this.dom.inner):this.dom.inner.innerHTML=null!=e?Wo.xss(e):Wo.xss(this.groupId||""));this.dom.label.title=t&&t.title||"",this.dom.inner.firstChild?Wo.removeClassName(this.dom.inner,"vis-hidden"):Wo.addClassName(this.dom.inner,"vis-hidden"),t&&t.nestedGroups?(this.nestedGroups&&this.nestedGroups==t.nestedGroups||(this.nestedGroups=t.nestedGroups),void 0===t.showNested&&void 0!==this.showNested||(0==t.showNested?this.showNested=!1:this.showNested=!0),Wo.addClassName(this.dom.label,"vis-nesting-group"),this.showNested?(Wo.removeClassName(this.dom.label,"collapsed"),Wo.addClassName(this.dom.label,"expanded")):(Wo.removeClassName(this.dom.label,"expanded"),Wo.addClassName(this.dom.label,"collapsed"))):this.nestedGroups&&(this.nestedGroups=null,Wo.removeClassName(this.dom.label,"collapsed"),Wo.removeClassName(this.dom.label,"expanded"),Wo.removeClassName(this.dom.label,"vis-nesting-group")),t&&(t.treeLevel||t.nestedInGroup)?(Wo.addClassName(this.dom.label,"vis-nested-group"),t.treeLevel?Wo.addClassName(this.dom.label,"vis-group-level-"+t.treeLevel):Wo.addClassName(this.dom.label,"vis-group-level-unknown-but-gte1")):Wo.addClassName(this.dom.label,"vis-group-level-0");const n=t&&t.className||null;n!=this.className&&(this.className&&(Wo.removeClassName(this.dom.label,this.className),Wo.removeClassName(this.dom.foreground,this.className),Wo.removeClassName(this.dom.background,this.className),Wo.removeClassName(this.dom.axis,this.className)),Wo.addClassName(this.dom.label,n),Wo.addClassName(this.dom.foreground,n),Wo.addClassName(this.dom.background,n),Wo.addClassName(this.dom.axis,n),this.className=n),this.style&&(Wo.removeCssText(this.dom.label,this.style),this.style=null),t&&t.style&&(Wo.addCssText(this.dom.label,t.style),this.style=t.style)}getLabelWidth(){return this.props.label.width}_didMarkerHeightChange(){const t=this.dom.marker.clientHeight;if(t!=this.lastMarkerHeight){this.lastMarkerHeight=t;const e={};let i=0;Wo.forEach(this.items,((t,n)=>{if(t.dirty=!0,t.displayed){const o=!0;e[n]=t.redraw(o),i=e[n].length}}));if(i>0)for(let t=0;t{e[t]()}));return!0}return!1}_calculateGroupSizeAndPosition(){const{offsetTop:t,offsetLeft:e,offsetWidth:i}=this.dom.foreground;this.top=t,this.right=e,this.width=i}_shouldBailItemsRedraw(){const t=this,e=this.itemSet.options.onTimeout,i={relativeBailingTime:this.itemSet.itemsSettingTime,bailTimeMs:e&&e.timeoutMs,userBailFunction:e&&e.callback,shouldBailStackItems:this.shouldBailStackItems};let n=null;if(!this.itemSet.initialDrawDone){if(i.shouldBailStackItems)return!0;Math.abs(Date.now()-new Date(i.relativeBailingTime))>i.bailTimeMs&&(i.userBailFunction&&null==this.itemSet.userContinueNotBail?i.userBailFunction((e=>{t.itemSet.userContinueNotBail=e,n=!e})):n=0==t.itemSet.userContinueNotBail)}return n}_redrawItems(t,e,i,n){if(t||this.stackDirty||this.isVisible&&!e){const t={byEnd:this.orderedItems.byEnd.filter((t=>!t.isCluster)),byStart:this.orderedItems.byStart.filter((t=>!t.isCluster))},e={byEnd:[...new Set(this.orderedItems.byEnd.map((t=>t.cluster)).filter((t=>!!t)))],byStart:[...new Set(this.orderedItems.byStart.map((t=>t.cluster)).filter((t=>!!t)))]},o=()=>[...this._updateItemsInRange(t,this.visibleItems.filter((t=>!t.isCluster)),n),...this._updateClustersInRange(e,this.visibleItems.filter((t=>t.isCluster)),n)],s=t=>{let e={};for(const i in this.subgroups){const n=this.visibleItems.filter((t=>t.data.subgroup===i));e[i]=t?n.sort(((e,i)=>t(e.data,i.data))):n}return e};if("function"==typeof this.itemSet.options.order){const t=this;if(this.doInnerStack&&this.itemSet.options.stackSubgroups){Is(s(this.itemSet.options.order),i,this.subgroups),this.visibleItems=o(),this._updateSubGroupHeights(i)}else{this.visibleItems=o(),this._updateSubGroupHeights(i);const e=this.visibleItems.slice().filter((t=>t.isCluster||!t.isCluster&&!t.cluster)).sort(((e,i)=>t.itemSet.options.order(e.data,i.data)));this.shouldBailStackItems=Es(e,i,!0,this._shouldBailItemsRedraw.bind(this))}}else if(this.visibleItems=o(),this._updateSubGroupHeights(i),this.itemSet.options.stack)if(this.doInnerStack&&this.itemSet.options.stackSubgroups){Is(s(),i,this.subgroups)}else this.shouldBailStackItems=Es(this.visibleItems,i,!0,this._shouldBailItemsRedraw.bind(this));else Os(this.visibleItems,i,this.subgroups,this.itemSet.options.stackSubgroups);for(let t=0;t{t.cluster&&t.displayed&&t.hide()})),this.shouldBailStackItems&&this.itemSet.body.emitter.emit("destroyTimeline"),this.stackDirty=!1}}_didResize(t,e){t=Wo.updateProperty(this,"height",e)||t;const i=this.dom.inner.clientWidth,n=this.dom.inner.clientHeight;return t=Wo.updateProperty(this.props.label,"width",i)||t,t=Wo.updateProperty(this.props.label,"height",n)||t}_applyGroupHeight(t){this.dom.background.style.height=`${t}px`,this.dom.foreground.style.height=`${t}px`,this.dom.label.style.height=`${t}px`}_updateItemsVerticalPosition(t){for(let e=0,i=this.visibleItems.length;e{i=this._didMarkerHeightChange.call(this)||i},this._updateSubGroupHeights.bind(this,e),this._calculateGroupSizeAndPosition.bind(this),()=>{this.isVisible=this._isGroupVisible.bind(this)(t,e)},()=>{this._redrawItems.bind(this)(i,s,e,t)},this._updateSubgroupsSizes.bind(this),()=>{r=this._calculateHeight.bind(this)(e)},this._calculateGroupSizeAndPosition.bind(this),()=>{o=this._didResize.bind(this)(o,r)},()=>{this._applyGroupHeight.bind(this)(r)},()=>{this._updateItemsVerticalPosition.bind(this)(e)},(()=>(!this.isVisible&&this.height&&(o=!1),o)).bind(this)];if(n)return a;{let t;return a.forEach((e=>{t=e()})),t}}_updateSubGroupHeights(t){if(Object.keys(this.subgroups).length>0){const e=this;this._resetSubgroups(),Wo.forEach(this.visibleItems,(i=>{void 0!==i.data.subgroup&&(e.subgroups[i.data.subgroup].height=Math.max(e.subgroups[i.data.subgroup].height,i.height+t.item.vertical),e.subgroups[i.data.subgroup].visible=void 0===this.subgroupVisibility[i.data.subgroup]||Boolean(this.subgroupVisibility[i.data.subgroup]))}))}}_isGroupVisible(t,e){return this.top<=t.body.domProps.centerContainer.height-t.body.domProps.scrollTop+e.axis&&this.top+this.height+e.axis>=-t.body.domProps.scrollTop}_calculateHeight(t){let e,i;if(i="fixed"===this.heightMode?Wo.toArray(this.items):this.visibleItems,i.length>0){let n=i[0].top,o=i[0].top+i[0].height;if(Wo.forEach(i,(t=>{n=Math.min(n,t.top),o=Math.max(o,t.top+t.height)})),n>t.axis){const e=n-t.axis;o-=e,Wo.forEach(i,(t=>{t.top-=e}))}e=Math.ceil(o+t.item.vertical/2),"fitItems"!==this.heightMode&&(e=Math.max(e,this.props.label.height))}else e=this.props.label.height;return e}show(){this.dom.label.parentNode||this.itemSet.dom.labelSet.appendChild(this.dom.label),this.dom.foreground.parentNode||this.itemSet.dom.foreground.appendChild(this.dom.foreground),this.dom.background.parentNode||this.itemSet.dom.background.appendChild(this.dom.background),this.dom.axis.parentNode||this.itemSet.dom.axis.appendChild(this.dom.axis)}hide(){const t=this.dom.label;t.parentNode&&t.parentNode.removeChild(t);const e=this.dom.foreground;e.parentNode&&e.parentNode.removeChild(e);const i=this.dom.background;i.parentNode&&i.parentNode.removeChild(i);const n=this.dom.axis;n.parentNode&&n.parentNode.removeChild(n)}add(t){if(this.items[t.id]=t,t.setParent(this),this.stackDirty=!0,void 0!==t.data.subgroup&&(this._addToSubgroup(t),this.orderSubgroups()),!this.visibleItems.includes(t)){const e=this.itemSet.body.range;this._checkIfVisible(t,this.visibleItems,e)}}_addToSubgroup(t,e=t.data.subgroup){null!=e&&void 0===this.subgroups[e]&&(this.subgroups[e]={height:0,top:0,start:t.data.start,end:t.data.end||t.data.start,visible:!1,index:this.subgroupIndex,items:[],stack:this.subgroupStackAll||this.subgroupStack[e]||!1},this.subgroupIndex++),new Date(t.data.start)new Date(this.subgroups[e].end)&&(this.subgroups[e].end=i),this.subgroups[e].items.push(t)}_updateSubgroupsSizes(){const t=this;if(t.subgroups)for(const e in t.subgroups){const i=t.subgroups[e].items[0].data.end||t.subgroups[e].items[0].data.start;let n=t.subgroups[e].items[0].data.start,o=i-1;t.subgroups[e].items.forEach((t=>{new Date(t.data.start)new Date(o)&&(o=e)})),t.subgroups[e].start=n,t.subgroups[e].end=new Date(o-1)}}orderSubgroups(){if(void 0!==this.subgroupOrderer){const t=[];if("string"==typeof this.subgroupOrderer){for(const e in this.subgroups)t.push({subgroup:e,sortField:this.subgroups[e].items[0].data[this.subgroupOrderer]});t.sort(((t,e)=>t.sortField-e.sortField))}else if("function"==typeof this.subgroupOrderer){for(const e in this.subgroups)t.push(this.subgroups[e].items[0].data);t.sort(this.subgroupOrderer)}if(t.length>0)for(let e=0;e=0&&(i.items.splice(n,1),i.items.length?this._updateSubgroupsSizes():delete this.subgroups[e])}}}removeFromDataSet(t){this.itemSet.removeItem(t.id)}order(){const t=Wo.toArray(this.items),e=[],i=[];for(let n=0;nt.data.start-e.data.start)),function(t){t.sort(((t,e)=>("end"in t.data?t.data.end:t.data.start)-("end"in e.data?e.data.end:e.data.start)))}(this.orderedItems.byEnd)}_updateItemsInRange(t,e,i){const n=[],o={};if(!this.isVisible&&this.groupId!=Fs){for(let t=0;t{const{start:e,end:i}=t;return i0)for(let t=0;ttt.data.startl)),1==this.checkRangedItems){this.checkRangedItems=!1;for(let e=0;et.data.endl))}const c={};let u=0;for(let t=0;t0)for(let t=0;t{e[t]()}));for(let t=0;t=0;s--){let t=e[s];if(o(t))break;t.isCluster&&!t.hasItems()||t.cluster||void 0===n[t.id]&&(n[t.id]=!0,i.push(t))}for(let s=t+1;s0)for(let t=0;t0)for(var a=0;a{this.options.locales[t]=Wo.extend({},n,this.options.locales[t])})),this.selected=!1,this.displayed=!1,this.groupShowing=!0,this.selectable=i&&i.selectable||!1,this.dirty=!0,this.top=null,this.right=null,this.left=null,this.width=null,this.height=null,this.setSelectability(t),this.editable=null,this._updateEditStatus()}select(){this.selectable&&(this.selected=!0,this.dirty=!0,this.displayed&&this.redraw())}unselect(){this.selected=!1,this.dirty=!0,this.displayed&&this.redraw()}setData(t){null!=t.group&&this.data.group!=t.group&&null!=this.parent&&this.parent.itemSet._moveToGroup(this,t.group),this.setSelectability(t),this.parent&&(this.parent.stackDirty=!0);null!=t.subgroup&&this.data.subgroup!=t.subgroup&&null!=this.parent&&this.parent.changeSubgroup(this,this.data.subgroup,t.subgroup),this.data=t,this._updateEditStatus(),this.dirty=!0,this.displayed&&this.redraw()}setSelectability(t){t&&(this.selectable=void 0===t.selectable||Boolean(t.selectable))}setParent(t){this.displayed?(this.hide(),this.parent=t,this.parent&&this.show()):this.parent=t}isVisible(t){return!1}show(){return!1}hide(){return!1}redraw(){}repositionX(){}repositionY(){}_repaintDragCenter(){if(this.selected&&this.editable.updateTime&&!this.dom.dragCenter){const t=this,e=document.createElement("div");e.className="vis-drag-center",e.dragCenterItem=this,this.hammerDragCenter=new ns(e),this.hammerDragCenter.on("tap",(e=>{t.parent.itemSet.body.emitter.emit("click",{event:e,item:t.id})})),this.hammerDragCenter.on("doubletap",(e=>{e.stopPropagation(),t.parent.itemSet._onUpdateItem(t),t.parent.itemSet.body.emitter.emit("doubleClick",{event:e,item:t.id})})),this.hammerDragCenter.on("panstart",(e=>{e.stopPropagation(),t.parent.itemSet._onDragStart(e)})),this.hammerDragCenter.on("panmove",t.parent.itemSet._onDrag.bind(t.parent.itemSet)),this.hammerDragCenter.on("panend",t.parent.itemSet._onDragEnd.bind(t.parent.itemSet)),this.hammerDragCenter.get("press").set({time:1e4}),this.dom.box?this.dom.dragLeft?this.dom.box.insertBefore(e,this.dom.dragLeft):this.dom.box.appendChild(e):this.dom.point&&this.dom.point.appendChild(e),this.dom.dragCenter=e}else!this.selected&&this.dom.dragCenter&&(this.dom.dragCenter.parentNode&&this.dom.dragCenter.parentNode.removeChild(this.dom.dragCenter),this.dom.dragCenter=null,this.hammerDragCenter&&(this.hammerDragCenter.destroy(),this.hammerDragCenter=null))}_repaintDeleteButton(t){const e=(this.options.editable.overrideItems||null==this.editable)&&this.options.editable.remove||!this.options.editable.overrideItems&&null!=this.editable&&this.editable.remove;if(this.selected&&e&&!this.dom.deleteButton){const e=this,i=document.createElement("div");this.options.rtl?i.className="vis-delete-rtl":i.className="vis-delete";let n=this.options.locales[this.options.locale];n||(this.warned||(console.warn(`WARNING: options.locales['${this.options.locale}'] not found. See https://visjs.github.io/vis-timeline/docs/timeline/#Localization`),this.warned=!0),n=this.options.locales.en),i.title=n.deleteSelected,this.hammerDeleteButton=new ns(i).on("tap",(t=>{t.stopPropagation(),e.parent.removeFromDataSet(e)})),t.appendChild(i),this.dom.deleteButton=i}else this.selected&&e||!this.dom.deleteButton||(this.dom.deleteButton.parentNode&&this.dom.deleteButton.parentNode.removeChild(this.dom.deleteButton),this.dom.deleteButton=null,this.hammerDeleteButton&&(this.hammerDeleteButton.destroy(),this.hammerDeleteButton=null))}_repaintOnItemUpdateTimeTooltip(t){if(!this.options.tooltipOnItemUpdateTime)return;const e=(this.options.editable.updateTime||!0===this.data.editable)&&!1!==this.data.editable;if(this.selected&&e&&!this.dom.onItemUpdateTimeTooltip){const e=document.createElement("div");e.className="vis-onUpdateTime-tooltip",t.appendChild(e),this.dom.onItemUpdateTimeTooltip=e}else!this.selected&&this.dom.onItemUpdateTimeTooltip&&(this.dom.onItemUpdateTimeTooltip.parentNode&&this.dom.onItemUpdateTimeTooltip.parentNode.removeChild(this.dom.onItemUpdateTimeTooltip),this.dom.onItemUpdateTimeTooltip=null);if(this.dom.onItemUpdateTimeTooltip){this.dom.onItemUpdateTimeTooltip.style.visibility=this.parent.itemSet.touchParams.itemIsDragging?"visible":"hidden",this.dom.onItemUpdateTimeTooltip.style.transform="translateX(-50%)",this.dom.onItemUpdateTimeTooltip.style.left="50%";const t=50,e=this.parent.itemSet.body.domProps.scrollTop;let i;i="top"==this.options.orientation.item?this.top:this.parent.height-this.top-this.height;let n,o;i+this.parent.top-t<-e?(this.dom.onItemUpdateTimeTooltip.style.bottom="",this.dom.onItemUpdateTimeTooltip.style.top=`${this.height+2}px`):(this.dom.onItemUpdateTimeTooltip.style.top="",this.dom.onItemUpdateTimeTooltip.style.bottom=`${this.height+2}px`),this.options.tooltipOnItemUpdateTime&&this.options.tooltipOnItemUpdateTime.template?(o=this.options.tooltipOnItemUpdateTime.template.bind(this),n=o(this.data)):(n=`start: ${No(this.data.start).format("MM/DD/YYYY hh:mm")}`,this.data.end&&(n+=`
end: ${No(this.data.end).format("MM/DD/YYYY hh:mm")}`)),this.dom.onItemUpdateTimeTooltip.innerHTML=Wo.xss(n)}}_getItemData(){return this.parent.itemSet.itemsData.get(this.id)}_updateContents(t){let e,i,n,o,s;const r=this._getItemData(),a=(this.dom.box||this.dom.point).getElementsByClassName("vis-item-visible-frame")[0];if(this.options.visibleFrameTemplate?(s=this.options.visibleFrameTemplate.bind(this),o=Wo.xss(s(r,a))):o="",a)if(o instanceof Object&&!(o instanceof Element))s(r,a);else if(i=this._contentToString(this.itemVisibleFrameContent)!==this._contentToString(o),i){if(o instanceof Element)a.innerHTML="",a.appendChild(o);else if(null!=o)a.innerHTML=Wo.xss(o);else if("background"!=this.data.type||void 0!==this.data.content)throw new Error(`Property "content" missing in item ${this.id}`);this.itemVisibleFrameContent=o}if(this.options.template?(n=this.options.template.bind(this),e=n(r,t,this.data)):e=this.data.content,e instanceof Object&&!(e instanceof Element))n(r,t);else if(i=this._contentToString(this.content)!==this._contentToString(e),i){if(e instanceof Element)t.innerHTML="",t.appendChild(e);else if(null!=e)t.innerHTML=Wo.xss(e);else if("background"!=this.data.type||void 0!==this.data.content)throw new Error(`Property "content" missing in item ${this.id}`);this.content=e}}_updateDataAttributes(t){if(this.options.dataAttributes&&this.options.dataAttributes.length>0){let e=[];if(Array.isArray(this.options.dataAttributes))e=this.options.dataAttributes;else{if("all"!=this.options.dataAttributes)return;e=Object.keys(this.data)}for(const i of e){const e=this.data[i];null!=e?t.setAttribute(`data-${i}`,e):t.removeAttribute(`data-${i}`)}}}_updateStyle(t){this.style&&(Wo.removeCssText(t,this.style),this.style=null),this.data.style&&(Wo.addCssText(t,this.data.style),this.style=this.data.style)}_contentToString(t){return"string"==typeof t?t:t&&"outerHTML"in t?t.outerHTML:t}_updateEditStatus(){this.options&&("boolean"==typeof this.options.editable?this.editable={updateTime:this.options.editable,updateGroup:this.options.editable,remove:this.options.editable}:"object"==typeof this.options.editable&&(this.editable={},Wo.selectiveExtend(["updateTime","updateGroup","remove"],this.editable,this.options.editable))),this.options&&this.options.editable&&!0===this.options.editable.overrideItems||this.data&&("boolean"==typeof this.data.editable?this.editable={updateTime:this.data.editable,updateGroup:this.data.editable,remove:this.data.editable}:"object"==typeof this.data.editable&&(this.editable={},Wo.selectiveExtend(["updateTime","updateGroup","remove"],this.editable,this.data.editable)))}getWidthLeft(){return 0}getWidthRight(){return 0}getTitle(){if(this.options.tooltip&&this.options.tooltip.template){return this.options.tooltip.template.bind(this)(this._getItemData(),this.data)}return this.data.title}}js.prototype.stack=!0;class Ys extends js{constructor(t,e,i){if(super(t,e,i),this.props={content:{width:0}},this.overflow=!1,t){if(null==t.start)throw new Error(`Property "start" missing in item ${t.id}`);if(null==t.end)throw new Error(`Property "end" missing in item ${t.id}`)}}isVisible(t){return!this.cluster&&(this.data.startt.start)}_createDomElement(){this.dom||(this.dom={},this.dom.box=document.createElement("div"),this.dom.frame=document.createElement("div"),this.dom.frame.className="vis-item-overflow",this.dom.box.appendChild(this.dom.frame),this.dom.visibleFrame=document.createElement("div"),this.dom.visibleFrame.className="vis-item-visible-frame",this.dom.box.appendChild(this.dom.visibleFrame),this.dom.content=document.createElement("div"),this.dom.content.className="vis-item-content",this.dom.frame.appendChild(this.dom.content),this.dom.box["vis-item"]=this,this.dirty=!0)}_appendDomElement(){if(!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!this.dom.box.parentNode){const t=this.parent.dom.foreground;if(!t)throw new Error("Cannot redraw item: parent has no foreground container element");t.appendChild(this.dom.box)}this.displayed=!0}_updateDirtyDomComponents(){if(this.dirty){this._updateContents(this.dom.content),this._updateDataAttributes(this.dom.box),this._updateStyle(this.dom.box);const t=this.editable.updateTime||this.editable.updateGroup,e=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"")+(t?" vis-editable":" vis-readonly");this.dom.box.className=this.baseClassName+e,this.dom.content.style.maxWidth="none"}}_getDomComponentsSizes(){return this.overflow="hidden"!==window.getComputedStyle(this.dom.frame).overflow,this.whiteSpace="nowrap"!==window.getComputedStyle(this.dom.content).whiteSpace,{content:{width:this.dom.content.offsetWidth},box:{height:this.dom.box.offsetHeight}}}_updateDomComponentsSizes(t){this.props.content.width=t.content.width,this.height=t.box.height,this.dom.content.style.maxWidth="",this.dirty=!1}_repaintDomAdditionals(){this._repaintOnItemUpdateTimeTooltip(this.dom.box),this._repaintDeleteButton(this.dom.box),this._repaintDragCenter(),this._repaintDragLeft(),this._repaintDragRight()}redraw(t){let e;const i=[this._createDomElement.bind(this),this._appendDomElement.bind(this),this._updateDirtyDomComponents.bind(this),()=>{this.dirty&&(e=this._getDomComponentsSizes.bind(this)())},()=>{this.dirty&&this._updateDomComponentsSizes.bind(this)(e)},this._repaintDomAdditionals.bind(this)];if(t)return i;{let t;return i.forEach((e=>{t=e()})),t}}show(t){if(!this.displayed)return this.redraw(t)}hide(){if(this.displayed){const t=this.dom.box;t.parentNode&&t.parentNode.removeChild(t),this.displayed=!1}}repositionX(t){const e=this.parent.width;let i=this.conversion.toScreen(this.data.start),n=this.conversion.toScreen(this.data.end);const o=void 0===this.data.align?this.options.align:this.data.align;let s,r;!1===this.data.limitSize||void 0!==t&&!0!==t||(i<-e&&(i=-e),n>2*e&&(n=2*e));const a=Math.max(Math.round(1e3*(n-i))/1e3,1);switch(this.overflow?(this.options.rtl?this.right=i:this.left=i,this.width=a+this.props.content.width,r=this.props.content.width):(this.options.rtl?this.right=i:this.left=i,this.width=a,r=Math.min(n-i,this.props.content.width)),this.options.rtl?this.dom.box.style.transform=`translateX(${-1*this.right}px)`:this.dom.box.style.transform=`translateX(${this.left}px)`,this.dom.box.style.width=`${a}px`,this.whiteSpace&&(this.height=this.dom.box.offsetHeight),o){case"left":this.dom.content.style.transform="translateX(0)";break;case"right":if(this.options.rtl){const t=-1*Math.max(a-r,0);this.dom.content.style.transform=`translateX(${t}px)`}else this.dom.content.style.transform=`translateX(${Math.max(a-r,0)}px)`;break;case"center":if(this.options.rtl){const t=-1*Math.max((a-r)/2,0);this.dom.content.style.transform=`translateX(${t}px)`}else this.dom.content.style.transform=`translateX(${Math.max((a-r)/2,0)}px)`;break;default:if(s=this.overflow?n>0?Math.max(-i,0):-r:i<0?-i:0,this.options.rtl){const t=-1*s;this.dom.content.style.transform=`translateX(${t}px)`}else this.dom.content.style.transform=`translateX(${s}px)`}}repositionY(){const t=this.options.orientation.item,e=this.dom.box;e.style.top="top"==t?`${this.top}px`:this.parent.height-this.top-this.height+"px"}_repaintDragLeft(){if((this.selected||this.options.itemsAlwaysDraggable.range)&&this.editable.updateTime&&!this.dom.dragLeft){const t=document.createElement("div");t.className="vis-drag-left",t.dragLeftItem=this,this.dom.box.appendChild(t),this.dom.dragLeft=t}else this.selected||this.options.itemsAlwaysDraggable.range||!this.dom.dragLeft||(this.dom.dragLeft.parentNode&&this.dom.dragLeft.parentNode.removeChild(this.dom.dragLeft),this.dom.dragLeft=null)}_repaintDragRight(){if((this.selected||this.options.itemsAlwaysDraggable.range)&&this.editable.updateTime&&!this.dom.dragRight){const t=document.createElement("div");t.className="vis-drag-right",t.dragRightItem=this,this.dom.box.appendChild(t),this.dom.dragRight=t}else this.selected||this.options.itemsAlwaysDraggable.range||!this.dom.dragRight||(this.dom.dragRight.parentNode&&this.dom.dragRight.parentNode.removeChild(this.dom.dragRight),this.dom.dragRight=null)}}Ys.prototype.baseClassName="vis-item vis-range";class Hs extends js{constructor(t,e,i){if(super(t,e,i),this.props={content:{width:0}},this.overflow=!1,t){if(null==t.start)throw new Error(`Property "start" missing in item ${t.id}`);if(null==t.end)throw new Error(`Property "end" missing in item ${t.id}`)}}isVisible(t){return this.data.startt.start}_createDomElement(){this.dom||(this.dom={},this.dom.box=document.createElement("div"),this.dom.frame=document.createElement("div"),this.dom.frame.className="vis-item-overflow",this.dom.box.appendChild(this.dom.frame),this.dom.content=document.createElement("div"),this.dom.content.className="vis-item-content",this.dom.frame.appendChild(this.dom.content),this.dirty=!0)}_appendDomElement(){if(!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!this.dom.box.parentNode){const t=this.parent.dom.background;if(!t)throw new Error("Cannot redraw item: parent has no background container element");t.appendChild(this.dom.box)}this.displayed=!0}_updateDirtyDomComponents(){if(this.dirty){this._updateContents(this.dom.content),this._updateDataAttributes(this.dom.content),this._updateStyle(this.dom.box);const t=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"");this.dom.box.className=this.baseClassName+t}}_getDomComponentsSizes(){return this.overflow="hidden"!==window.getComputedStyle(this.dom.content).overflow,{content:{width:this.dom.content.offsetWidth}}}_updateDomComponentsSizes(t){this.props.content.width=t.content.width,this.height=0,this.dirty=!1}_repaintDomAdditionals(){}redraw(t){let e;const i=[this._createDomElement.bind(this),this._appendDomElement.bind(this),this._updateDirtyDomComponents.bind(this),()=>{this.dirty&&(e=this._getDomComponentsSizes.bind(this)())},()=>{this.dirty&&this._updateDomComponentsSizes.bind(this)(e)},this._repaintDomAdditionals.bind(this)];if(t)return i;{let t;return i.forEach((e=>{t=e()})),t}}repositionY(t){let e;const i=this.options.orientation.item;if(void 0!==this.data.subgroup){const t=this.data.subgroup;this.dom.box.style.height=`${this.parent.subgroups[t].height}px`,this.dom.box.style.top="top"==i?`${this.parent.top+this.parent.subgroups[t].top}px`:this.parent.top+this.parent.height-this.parent.subgroups[t].top-this.parent.subgroups[t].height+"px",this.dom.box.style.bottom=""}else this.parent instanceof Ls?(e=Math.max(this.parent.height,this.parent.itemSet.body.domProps.center.height,this.parent.itemSet.body.domProps.centerContainer.height),this.dom.box.style.bottom="bottom"==i?"0":"",this.dom.box.style.top="top"==i?"0":""):(e=this.parent.height,this.dom.box.style.top=`${this.parent.top}px`,this.dom.box.style.bottom="");this.dom.box.style.height=`${e}px`}}Hs.prototype.baseClassName="vis-item vis-background",Hs.prototype.stack=!1,Hs.prototype.show=Ys.prototype.show,Hs.prototype.hide=Ys.prototype.hide,Hs.prototype.repositionX=Ys.prototype.repositionX;class zs{constructor(t,e){this.container=t,this.overflowMethod=e||"cap",this.x=0,this.y=0,this.padding=5,this.hidden=!1,this.frame=document.createElement("div"),this.frame.className="vis-tooltip",this.container.appendChild(this.frame)}setPosition(t,e){this.x=parseInt(t),this.y=parseInt(e)}setText(t){t instanceof Element?(this.frame.innerHTML="",this.frame.appendChild(t)):this.frame.innerHTML=Wo.xss(t)}show(t){if(void 0===t&&(t=!0),!0===t){var e=this.frame.clientHeight,i=this.frame.clientWidth,n=this.frame.parentNode.clientHeight,o=this.frame.parentNode.clientWidth,s=0,r=0;if("flip"==this.overflowMethod||"none"==this.overflowMethod){let t=!1,n=!0;"flip"==this.overflowMethod&&(this.y-eo-this.padding&&(t=!0)),s=t?this.x-i:this.x,r=n?this.y-e:this.y}else(r=this.y-e)+e+this.padding>n&&(r=n-e-this.padding),ro&&(s=o-i-this.padding),st.start&&this.hasItems()}getData(){return{isCluster:!0,id:this.id,items:this.data.items||[],data:this.data}}redraw(t){var e,i,n=[this._createDomElement.bind(this),this._appendDomElement.bind(this),this._updateDirtyDomComponents.bind(this),function(){this.dirty&&(e=this._getDomComponentsSizes())}.bind(this),function(){this.dirty&&this._updateDomComponentsSizes.bind(this)(e)}.bind(this),this._repaintDomAdditionals.bind(this)];return t?n:(n.forEach((function(t){i=t()})),i)}show(){this.displayed||this.redraw()}hide(){if(this.displayed){var t=this.dom;t.box.parentNode&&t.box.parentNode.removeChild(t.box),this.options.showStipes&&(t.line.parentNode&&t.line.parentNode.removeChild(t.line),t.dot.parentNode&&t.dot.parentNode.removeChild(t.dot)),this.displayed=!1}}repositionX(){let t=this.conversion.toScreen(this.data.start),e=this.data.end?this.conversion.toScreen(this.data.end):0;if(e)this.repositionXWithRanges(t,e);else{let e=void 0===this.data.align?this.options.align:this.data.align;this.repositionXWithoutRanges(t,e)}this.options.showStipes&&(this.dom.line.style.display=this._isStipeVisible()?"block":"none",this.dom.dot.style.display=this._isStipeVisible()?"block":"none",this._isStipeVisible()&&this.repositionStype(t,e))}repositionStype(t,e){this.dom.line.style.display="block",this.dom.dot.style.display="block";const i=this.dom.line.offsetWidth,n=this.dom.dot.offsetWidth;if(e){const o=i+t+(e-t)/2,s=o-n/2,r=this.options.rtl?-1*o:o,a=this.options.rtl?-1*s:s;this.dom.line.style.transform=`translateX(${r}px)`,this.dom.dot.style.transform=`translateX(${a}px)`}else{const e=this.options.rtl?-1*t:t,i=this.options.rtl?-1*(t-n/2):t-n/2;this.dom.line.style.transform=`translateX(${e}px)`,this.dom.dot.style.transform=`translateX(${i}px)`}}repositionXWithoutRanges(t,e){"right"==e?this.options.rtl?(this.right=t-this.width,this.dom.box.style.right=this.right+"px"):(this.left=t-this.width,this.dom.box.style.left=this.left+"px"):"left"==e?this.options.rtl?(this.right=t,this.dom.box.style.right=this.right+"px"):(this.left=t,this.dom.box.style.left=this.left+"px"):this.options.rtl?(this.right=t-this.width/2,this.dom.box.style.right=this.right+"px"):(this.left=t-this.width/2,this.dom.box.style.left=this.left+"px")}repositionXWithRanges(t,e){let i=Math.round(Math.max(e-t+.5,1));this.options.rtl?this.right=t:this.left=t,this.width=Math.max(i,this.minWidth||0),this.options.rtl?this.dom.box.style.right=this.right+"px":this.dom.box.style.left=this.left+"px",this.dom.box.style.width=i+"px"}repositionY(){var t=this.options.orientation.item,e=this.dom.box;if(e.style.top="top"==t?(this.top||0)+"px":(this.parent.height-this.top-this.height||0)+"px",this.options.showStipes){if("top"==t)this.dom.line.style.top="0",this.dom.line.style.height=this.parent.top+this.top+1+"px",this.dom.line.style.bottom="";else{var i=this.parent.itemSet.props.height,n=i-this.parent.top-this.parent.height+this.top;this.dom.line.style.top=i-n+"px",this.dom.line.style.bottom="0"}this.dom.dot.style.top=-this.dom.dot.offsetHeight/2+"px"}}getWidthLeft(){return this.width/2}getWidthRight(){return this.width/2}move(){this.repositionX(),this.repositionY()}attach(){for(let t of this.data.uiItems)t.cluster=this;this.data.items=this.data.uiItems.map((t=>t.data)),this.attached=!0,this.dirty=!0}detach(t=!1){if(this.hasItems()){for(let t of this.data.uiItems)delete t.cluster;this.attached=!1,t&&this.group&&(this.group.remove(this),this.group=null),this.data.items=[],this.dirty=!0}}_onDoubleClick(){this._fit()}_setupRange(){const t=this.data.uiItems.map((t=>({start:t.data.start.valueOf(),end:t.data.end?t.data.end.valueOf():t.data.start.valueOf()})));this.data.min=Math.min(...t.map((t=>Math.min(t.start,t.end||t.start)))),this.data.max=Math.max(...t.map((t=>Math.max(t.start,t.end||t.start))));const e=this.data.uiItems.map((t=>t.center)).reduce(((t,e)=>t+e),0)/this.data.uiItems.length;this.data.uiItems.some((t=>t.data.end))?(this.data.start=new Date(this.data.min),this.data.end=new Date(this.data.max)):(this.data.start=new Date(e),this.data.end=null)}_getUiItems(){return this.data.uiItems&&this.data.uiItems.length?this.data.uiItems.filter((t=>t.cluster===this)):[]}_createDomElement(){this.dom||(this.dom={},this.dom.box=document.createElement("DIV"),this.dom.content=document.createElement("DIV"),this.dom.content.className="vis-item-content",this.dom.box.appendChild(this.dom.content),this.options.showStipes&&(this.dom.line=document.createElement("DIV"),this.dom.line.className="vis-cluster-line",this.dom.line.style.display="none",this.dom.dot=document.createElement("DIV"),this.dom.dot.className="vis-cluster-dot",this.dom.dot.style.display="none"),this.options.fitOnDoubleClick&&(this.dom.box.ondblclick=Bs.prototype._onDoubleClick.bind(this)),this.dom.box["vis-item"]=this,this.dirty=!0)}_appendDomElement(){if(!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!this.dom.box.parentNode){const t=this.parent.dom.foreground;if(!t)throw new Error("Cannot redraw item: parent has no foreground container element");t.appendChild(this.dom.box)}const t=this.parent.dom.background;if(this.options.showStipes){if(!this.dom.line.parentNode){if(!t)throw new Error("Cannot redraw item: parent has no background container element");t.appendChild(this.dom.line)}if(!this.dom.dot.parentNode){var e=this.parent.dom.axis;if(!t)throw new Error("Cannot redraw item: parent has no axis container element");e.appendChild(this.dom.dot)}}this.displayed=!0}_updateDirtyDomComponents(){if(this.dirty){this._updateContents(this.dom.content),this._updateDataAttributes(this.dom.box),this._updateStyle(this.dom.box);const t=this.baseClassName+" "+(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"")+" vis-readonly";this.dom.box.className="vis-item "+t,this.options.showStipes&&(this.dom.line.className="vis-item vis-cluster-line "+(this.selected?" vis-selected":""),this.dom.dot.className="vis-item vis-cluster-dot "+(this.selected?" vis-selected":"")),this.data.end&&(this.dom.content.style.maxWidth="none")}}_getDomComponentsSizes(){const t={previous:{right:this.dom.box.style.right,left:this.dom.box.style.left},box:{width:this.dom.box.offsetWidth,height:this.dom.box.offsetHeight}};return this.options.showStipes&&(t.dot={height:this.dom.dot.offsetHeight,width:this.dom.dot.offsetWidth},t.line={width:this.dom.line.offsetWidth}),t}_updateDomComponentsSizes(t){this.options.rtl?this.dom.box.style.right="0px":this.dom.box.style.left="0px",this.data.end?this.minWidth=t.box.width:this.width=t.box.width,this.height=t.box.height,this.options.rtl?this.dom.box.style.right=t.previous.right:this.dom.box.style.left=t.previous.left,this.dirty=!1}_repaintDomAdditionals(){this._repaintOnItemUpdateTimeTooltip(this.dom.box)}_isStipeVisible(){return this.minWidth>=this.width||!this.data.end}_getFitRange(){const t=.05*(this.data.max-this.data.min)/2;return{fitStart:this.data.min-t,fitEnd:this.data.max+t}}_fit(){if(this.emitter){const{fitStart:t,fitEnd:e}=this._getFitRange(),i={start:new Date(t),end:new Date(e),animation:!0};this.emitter.emit("fit",i)}}_getItemData(){return this.data}}Bs.prototype.baseClassName="vis-item vis-range vis-cluster";const Ws="__ungrouped__";class Gs{constructor(t){this.itemSet=t,this.groups={},this.cache={},this.cache[-1]=[]}createClusterItem(t,e,i){return new Bs(t,e,i)}setItems(t,e){this.items=t||[],this.dataChanged=!0,this.applyOnChangedLevel=!1,e&&e.applyOnChangedLevel&&(this.applyOnChangedLevel=e.applyOnChangedLevel)}updateData(){this.dataChanged=!0,this.applyOnChangedLevel=!1}getClusters(t,e,i){let{maxItems:n,clusterCriteria:o}="boolean"==typeof i?{}:i;o||(o=()=>!0),n=n||1;let s=-1,r=0;if(e>0){if(e>=1)return[];s=Math.abs(Math.round(Math.log(100/e)/Math.log(2))),r=Math.abs(Math.pow(2,s))}if(this.dataChanged){const t=s!=this.cacheLevel;(!this.applyOnChangedLevel||t)&&(this._dropLevelsCache(),this._filterData())}this.cacheLevel=s;let a=this.cache[s];if(!a){a=[];for(let e in this.groups)if(this.groups.hasOwnProperty(e)){const s=this.groups[e],l=s.length;let h=0;for(;h=0&&e.center-s[d].center=0&&e.center-a[u].centern){const r=l-n+1,d=[];let c=h;for(;d.lengtht.center-e.center));this.dataChanged=!1}_getClusterForItems(t,e,i,n){const o=(i||[]).map((t=>({cluster:t,itemsIds:new Set(t.data.uiItems.map((t=>t.id)))})));let s;if(o.length)for(let e of o)if(e.itemsIds.size===t.length&&t.every((t=>e.itemsIds.has(t.id)))){s=e.cluster;break}if(s)return s.setUiItems(t),s.group!==e&&(s.group&&s.group.remove(s),e&&(e.add(s),s.group=e)),s;let r=n.titleTemplate||"";const a={toScreen:this.itemSet.body.util.toScreen,toTime:this.itemSet.body.util.toTime},l=r.replace(/{count}/,t.length),h='
'+t.length+"
",d=Object.assign({},n,this.itemSet.options),c={content:h,title:l,group:e,uiItems:t,eventEmitter:this.itemSet.body.emitter,range:this.itemSet.body.range};return s=this.createClusterItem(c,a,d),e&&(e.add(s),s.group=e),s.attach(),s}_dropLevelsCache(){this.cache={},this.cacheLevel=-1,this.cache[this.cacheLevel]=[]}}const Vs="__ungrouped__",Us="__background__";class $s extends Go{constructor(t,e){super(),this.body=t,this.defaultOptions={type:null,orientation:{item:"bottom"},align:"auto",stack:!0,stackSubgroups:!0,groupOrderSwap(t,e,i){const n=e.order;e.order=t.order,t.order=n},groupOrder:"order",selectable:!0,multiselect:!1,longSelectPressTime:251,itemsAlwaysDraggable:{item:!1,range:!1},editable:{updateTime:!1,updateGroup:!1,add:!1,remove:!1,overrideItems:!1},groupEditable:{order:!1,add:!1,remove:!1},snap:ss.snap,onDropObjectOnItem(t,e,i){i(e)},onAdd(t,e){e(t)},onUpdate(t,e){e(t)},onMove(t,e){e(t)},onRemove(t,e){e(t)},onMoving(t,e){e(t)},onAddGroup(t,e){e(t)},onMoveGroup(t,e){e(t)},onRemoveGroup(t,e){e(t)},margin:{item:{horizontal:10,vertical:10},axis:20},showTooltips:!0,tooltip:{followMouse:!1,overflowMethod:"flip",delay:500},tooltipOnItemUpdateTime:!1},this.options=Wo.extend({},this.defaultOptions),this.options.rtl=e.rtl,this.options.onTimeout=e.onTimeout,this.conversion={toScreen:t.util.toScreen,toTime:t.util.toTime},this.dom={},this.props={},this.hammer=null;const i=this;this.itemsData=null,this.groupsData=null,this.itemsSettingTime=null,this.initialItemSetDrawn=!1,this.userContinueNotBail=null,this.sequentialSelection=!1,this.itemListeners={add(t,e,n){i._onAdd(e.items),i.options.cluster&&i.clusterGenerator.setItems(i.items,{applyOnChangedLevel:!1}),i.redraw()},update(t,e,n){i._onUpdate(e.items),i.options.cluster&&i.clusterGenerator.setItems(i.items,{applyOnChangedLevel:!1}),i.redraw()},remove(t,e,n){i._onRemove(e.items),i.options.cluster&&i.clusterGenerator.setItems(i.items,{applyOnChangedLevel:!1}),i.redraw()}},this.groupListeners={add(t,e,n){if(i._onAddGroups(e.items),i.groupsData&&i.groupsData.length>0){const t=i.groupsData.getDataSet();t.get().forEach((e=>{if(e.nestedGroups){0!=e.showNested&&(e.showNested=!0);let i=[];e.nestedGroups.forEach((n=>{const o=t.get(n);o&&(o.nestedInGroup=e.id,0==e.showNested&&(o.visible=!1),i=i.concat(o))})),t.update(i,n)}}))}},update(t,e,n){i._onUpdateGroups(e.items)},remove(t,e,n){i._onRemoveGroups(e.items)}},this.items={},this.groups={},this.groupIds=[],this.selection=[],this.popup=null,this.popupTimer=null,this.touchParams={},this.groupTouchParams={group:null,isDragging:!1},this._create(),this.setOptions(e),this.clusters=[]}_create(){const t=document.createElement("div");t.className="vis-itemset",t["vis-itemset"]=this,this.dom.frame=t;const e=document.createElement("div");e.className="vis-background",t.appendChild(e),this.dom.background=e;const i=document.createElement("div");i.className="vis-foreground",t.appendChild(i),this.dom.foreground=i;const n=document.createElement("div");n.className="vis-axis",this.dom.axis=n;const o=document.createElement("div");o.className="vis-labelset",this.dom.labelSet=o,this._updateUngrouped();const s=new Ls(Us,null,this);s.show(),this.groups[Us]=s,this.hammer=new ns(this.body.dom.centerContainer),this.hammer.on("hammer.input",(t=>{t.isFirst&&this._onTouch(t)})),this.hammer.on("panstart",this._onDragStart.bind(this)),this.hammer.on("panmove",this._onDrag.bind(this)),this.hammer.on("panend",this._onDragEnd.bind(this)),this.hammer.get("pan").set({threshold:5,direction:ns.ALL}),this.hammer.get("press").set({time:1e4}),this.hammer.on("tap",this._onSelectItem.bind(this)),this.hammer.on("press",this._onMultiSelectItem.bind(this)),this.hammer.get("press").set({time:1e4}),this.hammer.on("doubletap",this._onAddItem.bind(this)),this.options.rtl?this.groupHammer=new ns(this.body.dom.rightContainer):this.groupHammer=new ns(this.body.dom.leftContainer),this.groupHammer.on("tap",this._onGroupClick.bind(this)),this.groupHammer.on("panstart",this._onGroupDragStart.bind(this)),this.groupHammer.on("panmove",this._onGroupDrag.bind(this)),this.groupHammer.on("panend",this._onGroupDragEnd.bind(this)),this.groupHammer.get("pan").set({threshold:5,direction:ns.DIRECTION_VERTICAL}),this.body.dom.centerContainer.addEventListener("mouseover",this._onMouseOver.bind(this)),this.body.dom.centerContainer.addEventListener("mouseout",this._onMouseOut.bind(this)),this.body.dom.centerContainer.addEventListener("mousemove",this._onMouseMove.bind(this)),this.body.dom.centerContainer.addEventListener("contextmenu",this._onDragEnd.bind(this)),this.body.dom.centerContainer.addEventListener("mousewheel",this._onMouseWheel.bind(this)),this.show()}setOptions(t){if(t){const e=["type","rtl","align","order","stack","stackSubgroups","selectable","multiselect","sequentialSelection","multiselectPerGroup","longSelectPressTime","groupOrder","dataAttributes","template","groupTemplate","visibleFrameTemplate","hide","snap","groupOrderSwap","showTooltips","tooltip","tooltipOnItemUpdateTime","groupHeightMode","onTimeout"];Wo.selectiveExtend(e,this.options,t),"itemsAlwaysDraggable"in t&&("boolean"==typeof t.itemsAlwaysDraggable?(this.options.itemsAlwaysDraggable.item=t.itemsAlwaysDraggable,this.options.itemsAlwaysDraggable.range=!1):"object"==typeof t.itemsAlwaysDraggable&&(Wo.selectiveExtend(["item","range"],this.options.itemsAlwaysDraggable,t.itemsAlwaysDraggable),this.options.itemsAlwaysDraggable.item||(this.options.itemsAlwaysDraggable.range=!1))),"sequentialSelection"in t&&"boolean"==typeof t.sequentialSelection&&(this.options.sequentialSelection=t.sequentialSelection),"orientation"in t&&("string"==typeof t.orientation?this.options.orientation.item="top"===t.orientation?"top":"bottom":"object"==typeof t.orientation&&"item"in t.orientation&&(this.options.orientation.item=t.orientation.item)),"margin"in t&&("number"==typeof t.margin?(this.options.margin.axis=t.margin,this.options.margin.item.horizontal=t.margin,this.options.margin.item.vertical=t.margin):"object"==typeof t.margin&&(Wo.selectiveExtend(["axis"],this.options.margin,t.margin),"item"in t.margin&&("number"==typeof t.margin.item?(this.options.margin.item.horizontal=t.margin.item,this.options.margin.item.vertical=t.margin.item):"object"==typeof t.margin.item&&Wo.selectiveExtend(["horizontal","vertical"],this.options.margin.item,t.margin.item)))),["locale","locales"].forEach((e=>{e in t&&(this.options[e]=t[e])})),"editable"in t&&("boolean"==typeof t.editable?(this.options.editable.updateTime=t.editable,this.options.editable.updateGroup=t.editable,this.options.editable.add=t.editable,this.options.editable.remove=t.editable,this.options.editable.overrideItems=!1):"object"==typeof t.editable&&Wo.selectiveExtend(["updateTime","updateGroup","add","remove","overrideItems"],this.options.editable,t.editable)),"groupEditable"in t&&("boolean"==typeof t.groupEditable?(this.options.groupEditable.order=t.groupEditable,this.options.groupEditable.add=t.groupEditable,this.options.groupEditable.remove=t.groupEditable):"object"==typeof t.groupEditable&&Wo.selectiveExtend(["order","add","remove"],this.options.groupEditable,t.groupEditable));["onDropObjectOnItem","onAdd","onUpdate","onRemove","onMove","onMoving","onAddGroup","onMoveGroup","onRemoveGroup"].forEach((e=>{const i=t[e];if(i){if("function"!=typeof i)throw new Error(`option ${e} must be a function ${e}(item, callback)`);this.options[e]=i}})),t.cluster?(Object.assign(this.options,{cluster:t.cluster}),this.clusterGenerator||(this.clusterGenerator=new Gs(this)),this.clusterGenerator.setItems(this.items,{applyOnChangedLevel:!1}),this.markDirty({refreshItems:!0,restackGroups:!0}),this.redraw()):this.clusterGenerator?(this._detachAllClusters(),this.clusters=[],this.clusterGenerator=null,this.options.cluster=void 0,this.markDirty({refreshItems:!0,restackGroups:!0}),this.redraw()):this.markDirty()}}markDirty(t){this.groupIds=[],t&&(t.refreshItems&&Wo.forEach(this.items,(t=>{t.dirty=!0,t.displayed&&t.redraw()})),t.restackGroups&&Wo.forEach(this.groups,((t,e)=>{e!==Us&&(t.stackDirty=!0)})))}destroy(){this.clearPopupTimer(),this.hide(),this.setItems(null),this.setGroups(null),this.hammer&&this.hammer.destroy(),this.groupHammer&&this.groupHammer.destroy(),this.hammer=null,this.body=null,this.conversion=null}hide(){this.dom.frame.parentNode&&this.dom.frame.parentNode.removeChild(this.dom.frame),this.dom.axis.parentNode&&this.dom.axis.parentNode.removeChild(this.dom.axis),this.dom.labelSet.parentNode&&this.dom.labelSet.parentNode.removeChild(this.dom.labelSet)}show(){this.dom.frame.parentNode||this.body.dom.center.appendChild(this.dom.frame),this.dom.axis.parentNode||this.body.dom.backgroundVertical.appendChild(this.dom.axis),this.dom.labelSet.parentNode||(this.options.rtl?this.body.dom.right.appendChild(this.dom.labelSet):this.body.dom.left.appendChild(this.dom.labelSet))}setPopupTimer(t){if(this.clearPopupTimer(),t){const e=this.options.tooltip.delay||"number"==typeof this.options.tooltip.delay?this.options.tooltip.delay:500;this.popupTimer=setTimeout((function(){t.show()}),e)}}clearPopupTimer(){null!=this.popupTimer&&(clearTimeout(this.popupTimer),this.popupTimer=null)}setSelection(t){null==t&&(t=[]),Array.isArray(t)||(t=[t]);const e=this.selection.filter((e=>-1===t.indexOf(e)));for(let t of e){const e=this.getItemById(t);e&&e.unselect()}this.selection=[...t];for(let e of t){const t=this.getItemById(e);t&&t.select()}}getSelection(){return this.selection.concat([])}getVisibleItems(){const t=this.body.range.getRange();let e,i;this.options.rtl?(e=this.body.util.toScreen(t.start),i=this.body.util.toScreen(t.end)):(i=this.body.util.toScreen(t.start),e=this.body.util.toScreen(t.end));const n=[];for(const t in this.groups)if(this.groups.hasOwnProperty(t)){const o=this.groups[t],s=o.isVisible?o.visibleItems:[];for(const t of s)this.options.rtl?t.righte&&n.push(t.id):t.lefti&&n.push(t.id)}return n}getItemsAtCurrentTime(t){let e,i;this.options.rtl?(e=this.body.util.toScreen(t),i=this.body.util.toScreen(t)):(i=this.body.util.toScreen(t),e=this.body.util.toScreen(t));const n=[];for(const t in this.groups)if(this.groups.hasOwnProperty(t)){const o=this.groups[t],s=o.isVisible?o.visibleItems:[];for(const t of s)this.options.rtl?t.righte&&n.push(t.id):t.lefti&&n.push(t.id)}return n}getVisibleGroups(){const t=[];for(const e in this.groups)if(this.groups.hasOwnProperty(e)){this.groups[e].isVisible&&t.push(e)}return t}getItemById(t){return this.items[t]||this.clusters.find((e=>e.id===t))}_deselect(t){const e=this.selection;for(let i=0,n=e.length;i{if(i===Us)return;const n=t==p?m:f;y[i]=t.redraw(e,n,u,!0),b=y[i].length}));if(b>0){const t={};for(let e=0;e{t[n]=i[e]()}));Wo.forEach(this.groups,((e,i)=>{if(i===Us)return;const n=t[i];s=n||s,g+=e.height})),g=Math.max(g,v)}return g=Math.max(g,v),r.style.height=i(g),this.props.width=r.offsetWidth,this.props.height=g,this.dom.axis.style.top=i("top"==o?this.body.domProps.top.height+this.body.domProps.border.top:this.body.domProps.top.height+this.body.domProps.centerContainer.height),this.options.rtl?this.dom.axis.style.right="0":this.dom.axis.style.left="0",this.hammer.get("press").set({time:this.options.longSelectPressTime}),this.initialItemSetDrawn=!0,s=this._isResized()||s,s}_firstGroup(){const t="top"==this.options.orientation.item?0:this.groupIds.length-1,e=this.groupIds[t];return this.groups[e]||this.groups[Vs]||null}_updateUngrouped(){let t,e,i=this.groups[Vs];if(this.groupsData){if(i)for(e in i.dispose(),delete this.groups[Vs],this.items)if(this.items.hasOwnProperty(e)){t=this.items[e],t.parent&&t.parent.remove(t);const i=this.getGroupId(t.data),n=this.groups[i];n&&n.add(t)||t.hide()}}else if(!i){const n=null,o=null;for(e in i=new Rs(n,o,this),this.groups[Vs]=i,this.items)this.items.hasOwnProperty(e)&&(t=this.items[e],i.add(t));i.show()}}getLabelSet(){return this.dom.labelSet}setItems(t){this.itemsSettingTime=new Date;const e=this;let i;const n=this.itemsData;if(t){if(!Fo(t))throw new TypeError("Data must implement the interface of DataSet or DataView");this.itemsData=Yo(t)}else this.itemsData=null;if(n&&(Wo.forEach(this.itemListeners,((t,e)=>{n.off(e,t)})),n.dispose(),i=n.getIds(),this._onRemove(i)),this.itemsData){const t=this.id;Wo.forEach(this.itemListeners,((i,n)=>{e.itemsData.on(n,i,t)})),i=this.itemsData.getIds(),this._onAdd(i),this._updateUngrouped()}this.body.emitter.emit("_change",{queue:!0})}getItems(){return null!=this.itemsData?this.itemsData.rawDS:null}setGroups(t){const e=this;let i;if(this.groupsData&&(Wo.forEach(this.groupListeners,((t,i)=>{e.groupsData.off(i,t)})),i=this.groupsData.getIds(),this.groupsData=null,this._onRemoveGroups(i)),t){if(!Fo(t))throw new TypeError("Data must implement the interface of DataSet or DataView");this.groupsData=t}else this.groupsData=null;if(this.groupsData){const t=this.groupsData.getDataSet();t.get().forEach((e=>{e.nestedGroups&&e.nestedGroups.forEach((i=>{const n=t.get(i);n.nestedInGroup=e.id,0==e.showNested&&(n.visible=!1),t.update(n)}))}));const n=this.id;Wo.forEach(this.groupListeners,((t,i)=>{e.groupsData.on(i,t,n)})),i=this.groupsData.getIds(),this._onAddGroups(i)}this._updateUngrouped(),this._order(),this.options.cluster&&(this.clusterGenerator.updateData(),this._clusterItems(),this.markDirty({refreshItems:!0,restackGroups:!0})),this.body.emitter.emit("_change",{queue:!0})}getGroups(){return this.groupsData}removeItem(t){const e=this.itemsData.get(t);e&&this.options.onRemove(e,(e=>{e&&this.itemsData.remove(t)}))}_getType(t){return t.type||this.options.type||(t.end?"range":"box")}getGroupId(t){return"background"==this._getType(t)&&null==t.group?Us:this.groupsData?t.group:Vs}_onUpdate(t){const e=this;t.forEach((t=>{const i=e.itemsData.get(t);let n=e.items[t];const o=i?e._getType(i):null,s=$s.types[o];let r;if(n&&(s&&n instanceof s?e._updateItem(n,i):(r=n.selected,e._removeItem(n),n=null)),!n&&i){if(!s)throw new TypeError(`Unknown item type "${o}"`);n=new s(i,e.conversion,e.options),n.id=t,e._addItem(n),r&&(this.selection.push(t),n.select())}})),this._order(),this.options.cluster&&(this.clusterGenerator.setItems(this.items,{applyOnChangedLevel:!1}),this._clusterItems()),this.body.emitter.emit("_change",{queue:!0})}_onRemove(t){let e=0;const i=this;t.forEach((t=>{const n=i.items[t];n&&(e++,i._removeItem(n))})),e&&(this._order(),this.body.emitter.emit("_change",{queue:!0}))}_order(){Wo.forEach(this.groups,(t=>{t.order()}))}_onUpdateGroups(t){this._onAddGroups(t)}_onAddGroups(t){const e=this;t.forEach((t=>{const i=e.groupsData.get(t);let n=e.groups[t];if(n)n.setData(i);else{if(t==Vs||t==Us)throw new Error(`Illegal group id. ${t} is a reserved id.`);const o=Object.create(e.options);Wo.extend(o,{height:null}),n=new Rs(t,i,e),e.groups[t]=n;for(const i in e.items)if(e.items.hasOwnProperty(i)){const o=e.items[i];o.data.group==t&&n.add(o)}n.order(),n.show()}})),this.body.emitter.emit("_change",{queue:!0})}_onRemoveGroups(t){t.forEach((t=>{const e=this.groups[t];e&&(e.dispose(),delete this.groups[t])})),this.options.cluster&&(this.clusterGenerator.updateData(),this._clusterItems()),this.markDirty({restackGroups:!!this.options.cluster}),this.body.emitter.emit("_change",{queue:!0})}_orderGroups(){if(this.groupsData){let t=this.groupsData.getIds({order:this.options.groupOrder});t=this._orderNestedGroups(t);const e=!Wo.equalArray(t,this.groupIds);if(e){const e=this.groups;t.forEach((t=>{e[t].hide()})),t.forEach((t=>{e[t].show()})),this.groupIds=t}return e}return!1}_orderNestedGroups(t){return function t(e,i){let n=[];return i.forEach((i=>{n.push(i);if(e.groupsData.get(i).nestedGroups){const o=e.groupsData.get({filter:t=>t.nestedInGroup==i,order:e.options.groupOrder}).map((t=>t.id));n=n.concat(t(e,o))}})),n}(this,t.filter((t=>!this.groupsData.get(t).nestedInGroup)))}_addItem(t){this.items[t.id]=t;const e=this.getGroupId(t.data),i=this.groups[e];i?i&&i.data&&i.data.showNested&&(t.groupShowing=!0):t.groupShowing=!1,i&&i.add(t)}_updateItem(t,e){t.setData(e);const i=this.getGroupId(t.data),n=this.groups[i];n?n&&n.data&&n.data.showNested&&(t.groupShowing=!0):t.groupShowing=!1}_removeItem(t){t.hide(),delete this.items[t.id];const e=this.selection.indexOf(t.id);-1!=e&&this.selection.splice(e,1),t.parent&&t.parent.remove(t),null!=this.popup&&this.popup.hide()}_constructByEndArray(t){const e=[];for(let i=0;i{const o=i.items[e],s=i._getGroupIndex(o.data.group);return{item:o,initialX:t.center.x,groupOffset:n-s,data:this._cloneItemData(o.data)}}))}t.stopPropagation()}else this.options.editable.add&&(t.srcEvent.ctrlKey||t.srcEvent.metaKey)&&this._onDragStartAddItem(t)}_onDragStartAddItem(t){const e=this.options.snap||null,i=this.dom.frame.getBoundingClientRect(),n=this.options.rtl?i.right-t.center.x+10:t.center.x-i.left-10,o=this.body.util.toTime(n),s=this.body.util.getScale(),r=this.body.util.getStep(),a=e?e(o,s,r):o,l={type:"range",start:a,end:a,content:"new item"},h=fn();l[this.itemsData.idProp]=h;const d=this.groupFromTarget(t);d&&(l.group=d.groupId);const c=new Ys(l,this.conversion,this.options);c.id=h,c.data=this._cloneItemData(l),this._addItem(c),this.touchParams.selectedItem=c;const u={item:c,initialX:t.center.x,data:c.data};this.options.rtl?u.dragLeft=!0:u.dragRight=!0,this.touchParams.itemProps=[u],t.stopPropagation()}_onDrag(t){if(null!=this.popup&&this.options.showTooltips&&!this.popup.hidden){const e=this.body.dom.centerContainer,i=e.getBoundingClientRect();this.popup.setPosition(t.center.x-i.left+e.offsetLeft,t.center.y-i.top+e.offsetTop),this.popup.show()}if(this.touchParams.itemProps){t.stopPropagation();const e=this,i=this.options.snap||null,n=this.body.dom.root.offsetLeft,o=this.options.rtl?n+this.body.domProps.right.width:n+this.body.domProps.left.width,s=this.body.util.getScale(),r=this.body.util.getStep(),a=this.touchParams.selectedItem,l=(this.options.editable.overrideItems||null==a.editable)&&this.options.editable.updateGroup||!this.options.editable.overrideItems&&null!=a.editable&&a.editable.updateGroup;let h=null;if(l&&a&&null!=a.data.group){const i=e.groupFromTarget(t);i&&(h=this._getGroupIndex(i.groupId))}this.touchParams.itemProps.forEach((n=>{const d=e.body.util.toTime(t.center.x-o),c=e.body.util.toTime(n.initialX-o);let u,p,m,f,g;u=this.options.rtl?-(d-c):d-c;let v=this._cloneItemData(n.item.data);if(null!=n.item.editable&&!n.item.editable.updateTime&&!n.item.editable.updateGroup&&!e.options.editable.overrideItems)return;if((this.options.editable.overrideItems||null==a.editable)&&this.options.editable.updateTime||!this.options.editable.overrideItems&&null!=a.editable&&a.editable.updateTime)if(n.dragLeft)this.options.rtl?null!=v.end&&(m=Wo.convert(n.data.end,"Date"),g=new Date(m.valueOf()+u),v.end=i?i(g,s,r):g):null!=v.start&&(p=Wo.convert(n.data.start,"Date"),f=new Date(p.valueOf()+u),v.start=i?i(f,s,r):f);else if(n.dragRight)this.options.rtl?null!=v.start&&(p=Wo.convert(n.data.start,"Date"),f=new Date(p.valueOf()+u),v.start=i?i(f,s,r):f):null!=v.end&&(m=Wo.convert(n.data.end,"Date"),g=new Date(m.valueOf()+u),v.end=i?i(g,s,r):g);else if(null!=v.start)if(p=Wo.convert(n.data.start,"Date").valueOf(),f=new Date(p+u),null!=v.end){m=Wo.convert(n.data.end,"Date");const t=m.valueOf()-p.valueOf();v.start=i?i(f,s,r):f,v.end=new Date(v.start.valueOf()+t)}else v.start=i?i(f,s,r):f;if(l&&!n.dragLeft&&!n.dragRight&&null!=h&&null!=v.group){let t=h-n.groupOffset;t=Math.max(0,t),t=Math.min(e.groupIds.length-1,t),v.group=e.groupIds[t]}v=this._cloneItemData(v),e.options.onMoving(v,(t=>{t&&n.item.setData(this._cloneItemData(t,"Date"))}))})),this.body.emitter.emit("_change")}}_moveToGroup(t,e){const i=this.groups[e];if(i&&i.groupId!=t.data.group){const e=t.parent;e.remove(t),e.order(),t.data.group=i.groupId,i.add(t),i.order()}}_onDragEnd(t){if(this.touchParams.itemIsDragging=!1,this.touchParams.itemProps){t.stopPropagation();const e=this,i=this.touchParams.itemProps;this.touchParams.itemProps=null,i.forEach((t=>{const i=t.item.id;if(null!=e.itemsData.get(i)){const n=this._cloneItemData(t.item.data);e.options.onMove(n,(n=>{n?(n[this.itemsData.idProp]=i,this.itemsData.update(n)):(t.item.setData(t.data),e.body.emitter.emit("_change"))}))}else e.options.onAdd(t.item.data,(i=>{e._removeItem(t.item),i&&e.itemsData.add(i),e.body.emitter.emit("_change")}))}))}}_onGroupClick(t){const e=this.groupFromTarget(t);setTimeout((()=>{this.toggleGroupShowNested(e)}),1)}toggleGroupShowNested(t,e){if(!t||!t.nestedGroups)return;const i=this.groupsData.getDataSet();t.showNested=null!=e?!!e:!t.showNested;let n=i.get(t.groupId);n.showNested=t.showNested;let o=t.nestedGroups,s=o;for(;s.length>0;){let t=s;s=[];for(let e=0;e0&&(o=o.concat(s))}let r=i.get(o).map((function(t){return null==t.visible&&(t.visible=!0),t.visible=!!n.showNested,t}));i.update(r.concat(n)),n.showNested?(Wo.removeClassName(t.dom.label,"collapsed"),Wo.addClassName(t.dom.label,"expanded")):(Wo.removeClassName(t.dom.label,"expanded"),Wo.addClassName(t.dom.label,"collapsed"))}toggleGroupDragClassName(t){t.dom.label.classList.toggle("vis-group-is-dragging"),t.dom.foreground.classList.toggle("vis-group-is-dragging")}_onGroupDragStart(t){this.groupTouchParams.isDragging||this.options.groupEditable.order&&(this.groupTouchParams.group=this.groupFromTarget(t),this.groupTouchParams.group&&(t.stopPropagation(),this.groupTouchParams.isDragging=!0,this.toggleGroupDragClassName(this.groupTouchParams.group),this.groupTouchParams.originalOrder=this.groupsData.getIds({order:this.options.groupOrder})))}_onGroupDrag(t){if(this.options.groupEditable.order&&this.groupTouchParams.group){t.stopPropagation();const e=this.groupsData.getDataSet(),i=this.groupFromTarget(t);if(i&&i.height!=this.groupTouchParams.group.height){const e=i.topn)return}}if(i&&i!=this.groupTouchParams.group){const t=e.get(i.groupId),n=e.get(this.groupTouchParams.group.groupId);n&&t&&(this.options.groupOrderSwap(n,t,e),e.update(n),e.update(t));const o=e.getIds({order:this.options.groupOrder});if(!Wo.equalArray(o,this.groupTouchParams.originalOrder)){const t=this.groupTouchParams.originalOrder,i=this.groupTouchParams.group.groupId,n=Math.min(t.length,o.length);let s=0,r=0,a=0;for(;s=n)break;if(o[s+r]==i)r=1;else if(t[s+a]==i)a=1;else{const i=o.indexOf(t[s+a]),n=e.get(o[s+r]),l=e.get(t[s+a]);this.options.groupOrderSwap(n,l,e),e.update(n),e.update(l);const h=o[s+r];o[s+r]=t[s+a],o[i]=h,s++}}}}}}_onGroupDragEnd(t){if(this.groupTouchParams.isDragging=!1,this.options.groupEditable.order&&this.groupTouchParams.group){t.stopPropagation();const e=this,i=e.groupTouchParams.group.groupId,n=e.groupsData.getDataSet(),o=Wo.extend({},n.get(i));e.options.onMoveGroup(o,(t=>{if(t)t[n._idProp]=i,n.update(t);else{const t=n.getIds({order:e.options.groupOrder});if(!Wo.equalArray(t,e.groupTouchParams.originalOrder)){const i=e.groupTouchParams.originalOrder,o=Math.min(i.length,t.length);let s=0;for(;s=o)break;const r=t.indexOf(i[s]),a=n.get(t[s]),l=n.get(i[s]);e.options.groupOrderSwap(a,l,n),n.update(a),n.update(l);const h=t[s];t[s]=i[s],t[r]=h,s++}}}})),e.body.emitter.emit("groupDragged",{groupId:i}),this.toggleGroupDragClassName(this.groupTouchParams.group),this.groupTouchParams.group=null}}_onSelectItem(t){if(!this.options.selectable)return;const e=t.srcEvent&&(t.srcEvent.ctrlKey||t.srcEvent.metaKey),i=t.srcEvent&&t.srcEvent.shiftKey;if(e||i)return void this._onMultiSelectItem(t);const n=this.getSelection(),o=this.itemFromTarget(t),s=o&&o.selectable?[o.id]:[];this.setSelection(s);const r=this.getSelection();(r.length>0||n.length>0)&&this.body.emitter.emit("select",{items:r,event:t})}_onMouseOver(t){const e=this.itemFromTarget(t);if(!e)return;if(e===this.itemFromRelatedTarget(t))return;const i=e.getTitle();if(this.options.showTooltips&&i){null==this.popup&&(this.popup=new zs(this.body.dom.root,this.options.tooltip.overflowMethod||"flip")),this.popup.setText(i);const e=this.body.dom.centerContainer,n=e.getBoundingClientRect();this.popup.setPosition(t.clientX-n.left+e.offsetLeft,t.clientY-n.top+e.offsetTop),this.setPopupTimer(this.popup)}else this.clearPopupTimer(),null!=this.popup&&this.popup.hide();this.body.emitter.emit("itemover",{item:e.id,event:t})}_onMouseOut(t){const e=this.itemFromTarget(t);if(!e)return;e!==this.itemFromRelatedTarget(t)&&(this.clearPopupTimer(),null!=this.popup&&this.popup.hide(),this.body.emitter.emit("itemout",{item:e.id,event:t}))}_onMouseMove(t){if(this.itemFromTarget(t)&&(null!=this.popupTimer&&this.setPopupTimer(this.popup),this.options.showTooltips&&this.options.tooltip.followMouse&&this.popup&&!this.popup.hidden)){const e=this.body.dom.centerContainer,i=e.getBoundingClientRect();this.popup.setPosition(t.clientX-i.left+e.offsetLeft,t.clientY-i.top+e.offsetTop),this.popup.show()}}_onMouseWheel(t){this.touchParams.itemIsDragging&&this._onDragEnd(t)}_onUpdateItem(t){if(!this.options.selectable)return;if(!this.options.editable.updateTime&&!this.options.editable.updateGroup)return;const e=this;if(t){const i=e.itemsData.get(t.id);this.options.onUpdate(i,(t=>{t&&e.itemsData.update(t)}))}}_onDropObjectOnItem(t){const e=this.itemFromTarget(t),i=JSON.parse(t.dataTransfer.getData("text"));this.options.onDropObjectOnItem(i,e)}_onAddItem(t){if(!this.options.selectable)return;if(!this.options.editable.add)return;const e=this,i=this.options.snap||null,n=this.dom.frame.getBoundingClientRect(),o=this.options.rtl?n.right-t.center.x:t.center.x-n.left,s=this.body.util.toTime(o),r=this.body.util.getScale(),a=this.body.util.getStep();let l,h;"drop"==t.type?(h=JSON.parse(t.dataTransfer.getData("text")),h.content=h.content?h.content:"new item",h.start=h.start?h.start:i?i(s,r,a):s,h.type=h.type||"box",h[this.itemsData.idProp]=h.id||fn(),"range"!=h.type||h.end||(l=this.body.util.toTime(o+this.props.width/5),h.end=i?i(l,r,a):l)):(h={start:i?i(s,r,a):s,content:"new item"},h[this.itemsData.idProp]=fn(),"range"===this.options.type&&(l=this.body.util.toTime(o+this.props.width/5),h.end=i?i(l,r,a):l));const d=this.groupFromTarget(t);d&&(h.group=d.groupId),h=this._cloneItemData(h),this.options.onAdd(h,(i=>{i&&(e.itemsData.add(i),"drop"==t.type&&e.setSelection([i.id]))}))}_onMultiSelectItem(t){if(!this.options.selectable)return;const e=this.itemFromTarget(t);if(e){let i=this.options.multiselect?this.getSelection():[];if((t.srcEvent&&t.srcEvent.shiftKey||!1||this.options.sequentialSelection)&&this.options.multiselect){const t=this.itemsData.get(e.id).group;let n;this.options.multiselectPerGroup&&i.length>0&&(n=this.itemsData.get(i[0]).group),this.options.multiselectPerGroup&&null!=n&&n!=t||i.push(e.id);const o=$s._getItemRange(this.itemsData.get(i));if(!this.options.multiselectPerGroup||n==t){i=[];for(const t in this.items)if(this.items.hasOwnProperty(t)){const e=this.items[t],s=e.data.start,r=void 0!==e.data.end?e.data.end:s;!(s>=o.min&&r<=o.max)||this.options.multiselectPerGroup&&n!=this.itemsData.get(e.id).group||e instanceof Hs||i.push(e.id)}}}else{const t=i.indexOf(e.id);-1==t?i.push(e.id):i.splice(t,1)}const n=i.filter((t=>this.getItemById(t).selectable));this.setSelection(n),this.body.emitter.emit("select",{items:this.getSelection(),event:t})}}static _getItemRange(t){let e=null,i=null;return t.forEach((t=>{(null==i||t.starte)&&(e=t.end):(null==e||t.start>e)&&(e=t.start)})),{min:i,max:e}}itemFromElement(t){let e=t;for(;e;){if(e.hasOwnProperty("vis-item"))return e["vis-item"];e=e.parentNode}return null}itemFromTarget(t){return this.itemFromElement(t.target)}itemFromRelatedTarget(t){return this.itemFromElement(t.relatedTarget)}groupFromTarget(t){const e=t.center?t.center.y:t.clientY;let i=this.groupIds;i.length<=0&&this.groupsData&&(i=this.groupsData.getIds({order:this.options.groupOrder}));for(let t=0;t=r.top&&er.top)return o}else if(0===t&&et.id))),i=this.clusters.filter((t=>!e.has(t.id)));let n=!1;for(let t of i){const e=this.selection.indexOf(t.id);-1!==e&&(t.unselect(),this.selection.splice(e,1),n=!0)}if(n){const t=this.getSelection();this.body.emitter.emit("select",{items:t,event:event})}}this.clusters=t||[]}}$s.types={background:Hs,box:class extends js{constructor(t,e,i){if(super(t,e,i),this.props={dot:{width:0,height:0},line:{width:0,height:0}},t&&null==t.start)throw new Error(`Property "start" missing in item ${t}`)}isVisible(t){if(this.cluster)return!1;let e;const i=this.data.align||this.options.align,n=this.width*t.getMillisecondsPerPixel();return e="right"==i?this.data.start.getTime()>t.start&&this.data.start.getTime()-nt.start&&this.data.start.getTime()t.start&&this.data.start.getTime()-n/2{this.dirty&&(e=this._getDomComponentsSizes())},()=>{this.dirty&&this._updateDomComponentsSizes.bind(this)(e)},this._repaintDomAdditionals.bind(this)];if(t)return i;{let t;return i.forEach((e=>{t=e()})),t}}show(t){if(!this.displayed)return this.redraw(t)}hide(){if(this.displayed){const t=this.dom;t.box.remove?t.box.remove():t.box.parentNode&&t.box.parentNode.removeChild(t.box),t.line.remove?t.line.remove():t.line.parentNode&&t.line.parentNode.removeChild(t.line),t.dot.remove?t.dot.remove():t.dot.parentNode&&t.dot.parentNode.removeChild(t.dot),this.displayed=!1}}repositionXY(){const t=this.options.rtl,e=(t,e,i,n=!1)=>{if(void 0===e&&void 0===i)return;const o=n?-1*e:e;t.style.transform=void 0!==i?void 0!==e?`translate(${o}px, ${i}px)`:`translateY(${i}px)`:`translateX(${o}px)`};e(this.dom.box,this.boxX,this.boxY,t),e(this.dom.dot,this.dotX,this.dotY,t),e(this.dom.line,this.lineX,this.lineY,t)}repositionX(){const t=this.conversion.toScreen(this.data.start),e=void 0===this.data.align?this.options.align:this.data.align,i=this.props.line.width,n=this.props.dot.width;"right"==e?(this.boxX=t-this.width,this.lineX=t-i,this.dotX=t-i/2-n/2):"left"==e?(this.boxX=t,this.lineX=t,this.dotX=t+i/2-n/2):(this.boxX=t-this.width/2,this.lineX=this.options.rtl?t-i:t-i/2,this.dotX=t-n/2),this.options.rtl?this.right=this.boxX:this.left=this.boxX,this.repositionXY()}repositionY(){const t=this.options.orientation.item,e=this.dom.line.style;if("top"==t){const t=this.parent.top+this.top+1;this.boxY=this.top||0,e.height=`${t}px`,e.bottom="",e.top="0"}else{const t=this.parent.itemSet.props.height-this.parent.top-this.parent.height+this.top;this.boxY=this.parent.height-this.top-(this.height||0),e.height=`${t}px`,e.top="",e.bottom="0"}this.dotY=-this.props.dot.height/2,this.repositionXY()}getWidthLeft(){return this.width/2}getWidthRight(){return this.width/2}},range:Ys,point:class extends js{constructor(t,e,i){if(super(t,e,i),this.props={dot:{top:0,width:0,height:0},content:{height:0,marginLeft:0,marginRight:0}},t&&null==t.start)throw new Error(`Property "start" missing in item ${t}`)}isVisible(t){if(this.cluster)return!1;const e=this.width*t.getMillisecondsPerPixel();return this.data.start.getTime()+e>t.start&&this.data.start{this.dirty&&(e=this._getDomComponentsSizes())},()=>{this.dirty&&this._updateDomComponentsSizes.bind(this)(e)},this._repaintDomAdditionals.bind(this)];if(t)return i;{let t;return i.forEach((e=>{t=e()})),t}}repositionXY(){const t=this.options.rtl;((t,e,i,n=!1)=>{if(void 0===e&&void 0===i)return;const o=n?-1*e:e;t.style.transform=void 0!==i?void 0!==e?`translate(${o}px, ${i}px)`:`translateY(${i}px)`:`translateX(${o}px)`})(this.dom.point,this.pointX,this.pointY,t)}show(t){if(!this.displayed)return this.redraw(t)}hide(){this.displayed&&(this.dom.point.parentNode&&this.dom.point.parentNode.removeChild(this.dom.point),this.displayed=!1)}repositionX(){const t=this.conversion.toScreen(this.data.start);this.pointX=t,this.options.rtl?this.right=t-this.props.dot.width:this.left=t-this.props.dot.width,this.repositionXY()}repositionY(){const t=this.options.orientation.item;this.pointY="top"==t?this.top:this.parent.height-this.top-this.height,this.repositionXY()}getWidthLeft(){return this.props.dot.width}getWidthRight(){return this.props.dot.width}}},$s.prototype._onAdd=$s.prototype._onUpdate;let qs,Xs=!1,Ks="background: #FFeeee; color: #dd0000";class Zs{constructor(){}static validate(t,e,i){Xs=!1,qs=e;let n=e;return void 0!==i&&(n=e[i]),Zs.parse(t,n,[]),Xs}static parse(t,e,i){for(let n in t)t.hasOwnProperty(n)&&Zs.check(n,t,e,i)}static check(t,e,i,n){if(void 0===i[t]&&void 0===i.__any__)return void Zs.getSuggestion(t,i,n);let o=t,s=!0;void 0===i[t]&&void 0!==i.__any__&&(o="__any__",s="object"===Zs.getType(e[t]));let r=i[o];s&&void 0!==r.__type__&&(r=r.__type__),Zs.checkFields(t,e,i,o,r,n)}static checkFields(t,e,i,n,o,s){let r=function(e){console.log("%c"+e+Zs.printLocation(s,t),Ks)},a=Zs.getType(e[t]),l=o[a];void 0!==l?"array"===Zs.getType(l)&&-1===l.indexOf(e[t])?(r('Invalid option detected in "'+t+'". Allowed values are:'+Zs.print(l)+' not "'+e[t]+'". '),Xs=!0):"object"===a&&"__any__"!==n&&(s=Wo.copyAndExtendArray(s,t),Zs.parse(e[t],i[n],s)):void 0===o.any&&(r('Invalid type received for "'+t+'". Expected: '+Zs.print(Object.keys(o))+". Received ["+a+'] "'+e[t]+'"'),Xs=!0)}static getType(t){var e=typeof t;return"object"===e?null===t?"null":t instanceof Boolean?"boolean":t instanceof Number?"number":t instanceof String?"string":Array.isArray(t)?"array":t instanceof Date?"date":void 0!==t.nodeType?"dom":!0===t._isAMomentObject?"moment":"object":"number"===e?"number":"boolean"===e?"boolean":"string"===e?"string":void 0===e?"undefined":e}static getSuggestion(t,e,i){let n,o=Zs.findInOptions(t,e,i,!1),s=Zs.findInOptions(t,qs,[],!0);n=void 0!==o.indexMatch?" in "+Zs.printLocation(o.path,t,"")+'Perhaps it was incomplete? Did you mean: "'+o.indexMatch+'"?\n\n':s.distance<=4&&o.distance>s.distance?" in "+Zs.printLocation(o.path,t,"")+"Perhaps it was misplaced? Matching option found at: "+Zs.printLocation(s.path,s.closestMatch,""):o.distance<=8?'. Did you mean "'+o.closestMatch+'"?'+Zs.printLocation(o.path,t):". Did you mean one of these: "+Zs.print(Object.keys(e))+Zs.printLocation(i,t),console.log('%cUnknown option detected: "'+t+'"'+n,Ks),Xs=!0}static findInOptions(t,e,i,n=!1){let o,s=1e9,r="",a=[],l=t.toLowerCase();for(let h in e){let d;if(void 0!==e[h].__type__&&!0===n){let n=Zs.findInOptions(t,e[h],Wo.copyAndExtendArray(i,h));s>n.distance&&(r=n.closestMatch,a=n.path,s=n.distance,o=n.indexMatch)}else-1!==h.toLowerCase().indexOf(l)&&(o=h),d=Zs.levenshteinDistance(t,h),s>d&&(r=h,a=Wo.copyArray(i),s=d)}return{closestMatch:r,path:a,distance:s,indexMatch:o}}static printLocation(t,e,i="Problem value found at: \n"){let n="\n\n"+i+"options = {\n";for(let e=0;e{},this.closeCallback=()=>{},this._create()}insertTo(t){void 0!==this.hammer&&(this.hammer.destroy(),this.hammer=void 0),this.container=t,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}setUpdateCallback(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker update callback is not a function.");this.updateCallback=t}setCloseCallback(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker closing callback is not a function.");this.closeCallback=t}_isColorString(t){if("string"==typeof t)return ar[t]}setColor(t,e=!0){if("none"===t)return;let i;var n=this._isColorString(t);if(void 0!==n&&(t=n),!0===Wo.isString(t)){if(!0===Wo.isValidRGB(t)){let e=t.substr(4).substr(0,t.length-5).split(",");i={r:e[0],g:e[1],b:e[2],a:1}}else if(!0===Wo.isValidRGBA(t)){let e=t.substr(5).substr(0,t.length-6).split(",");i={r:e[0],g:e[1],b:e[2],a:e[3]}}else if(!0===Wo.isValidHex(t)){let e=Wo.hexToRGB(t);i={r:e.r,g:e.g,b:e.b,a:1}}}else if(t instanceof Object&&void 0!==t.r&&void 0!==t.g&&void 0!==t.b){let e=void 0!==t.a?t.a:"1.0";i={r:t.r,g:t.g,b:t.b,a:e}}if(void 0===i)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+JSON.stringify(t));this._setColor(i,e)}show(){void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}_hide(t=!0){!0===t&&(this.previousColor=Wo.extend({},this.color)),!0===this.applied&&this.updateCallback(this.initialColor),this.frame.style.display="none",setTimeout((()=>{void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0)}),0)}_save(){this.updateCallback(this.color),this.applied=!1,this._hide()}_apply(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}_loadLast(){void 0!==this.previousColor?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}_setColor(t,e=!0){!0===e&&(this.initialColor=Wo.extend({},t)),this.color=t;let i=Wo.RGBToHSV(t.r,t.g,t.b),n=2*Math.PI,o=this.r*i.s,s=this.centerCoordinates.x+o*Math.sin(n*i.h),r=this.centerCoordinates.y+o*Math.cos(n*i.h);this.colorPickerSelector.style.left=s-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=r-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(t)}_setOpacity(t){this.color.a=t/100,this._updatePicker(this.color)}_setBrightness(t){let e=Wo.RGBToHSV(this.color.r,this.color.g,this.color.b);e.v=t/100;let i=Wo.HSVToRGB(e.h,e.s,e.v);i.a=this.color.a,this.color=i,this._updatePicker()}_updatePicker(t=this.color){let e=Wo.RGBToHSV(t.r,t.g,t.b),i=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1)),i.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);let n=this.colorPickerCanvas.clientWidth,o=this.colorPickerCanvas.clientHeight;i.clearRect(0,0,n,o),i.putImageData(this.hueCircle,0,0),i.fillStyle="rgba(0,0,0,"+(1-e.v)+")",i.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),i.fill(),this.brightnessRange.value=100*e.v,this.opacityRange.value=100*t.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}_setSize(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}_create(){if(this.frame=document.createElement("div"),this.frame.className="vis-color-picker",this.colorPickerDiv=document.createElement("div"),this.colorPickerSelector=document.createElement("div"),this.colorPickerSelector.className="vis-selector",this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement("canvas"),this.colorPickerDiv.appendChild(this.colorPickerCanvas),this.colorPickerCanvas.getContext){let t=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{let t=document.createElement("DIV");t.style.color="red",t.style.fontWeight="bold",t.style.padding="10px",t.innerHTML="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(t)}this.colorPickerDiv.className="vis-color",this.opacityDiv=document.createElement("div"),this.opacityDiv.className="vis-opacity",this.brightnessDiv=document.createElement("div"),this.brightnessDiv.className="vis-brightness",this.arrowDiv=document.createElement("div"),this.arrowDiv.className="vis-arrow",this.opacityRange=document.createElement("input");try{this.opacityRange.type="range",this.opacityRange.min="0",this.opacityRange.max="100"}catch(t){}this.opacityRange.value="100",this.opacityRange.className="vis-range",this.brightnessRange=document.createElement("input");try{this.brightnessRange.type="range",this.brightnessRange.min="0",this.brightnessRange.max="100"}catch(t){}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);var t=this;this.opacityRange.onchange=function(){t._setOpacity(this.value)},this.opacityRange.oninput=function(){t._setOpacity(this.value)},this.brightnessRange.onchange=function(){t._setBrightness(this.value)},this.brightnessRange.oninput=function(){t._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerHTML="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerHTML="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerHTML="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerHTML="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerHTML="cancel",this.cancelButton.onclick=this._hide.bind(this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerHTML="apply",this.applyButton.onclick=this._apply.bind(this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerHTML="save",this.saveButton.onclick=this._save.bind(this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerHTML="load last",this.loadButton.onclick=this._loadLast.bind(this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}_bindHammer(){this.drag={},this.pinch={},this.hammer=new ns(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),os(this.hammer,(t=>{this._moveSelector(t)})),this.hammer.on("tap",(t=>{this._moveSelector(t)})),this.hammer.on("panstart",(t=>{this._moveSelector(t)})),this.hammer.on("panmove",(t=>{this._moveSelector(t)})),this.hammer.on("panend",(t=>{this._moveSelector(t)}))}_generateHueCircle(){if(!1===this.generated){let t=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)),t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);let e,i,n,o,s=this.colorPickerCanvas.clientWidth,r=this.colorPickerCanvas.clientHeight;t.clearRect(0,0,s,r),this.centerCoordinates={x:.5*s,y:.5*r},this.r=.49*s;let a,l=2*Math.PI/360,h=1/360,d=1/this.r;for(n=0;n<360;n++)for(o=0;o0&&this._makeItem([]),this._makeHeader(n),this._handleObject(this.configureOptions[n],[n])),e++);this._makeButton(),this._push()}_push(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(var t=0;t{i.appendChild(t)})),this.domElements.push(i),this.domElements.length}return 0}_makeHeader(t){let e=document.createElement("div");e.className="vis-configuration vis-config-header",e.innerHTML=Wo.xss(t),this._makeItem([],e)}_makeLabel(t,e,i=!1){let n=document.createElement("div");return n.className="vis-configuration vis-config-label vis-config-s"+e.length,n.innerHTML=!0===i?Wo.xss(""+t+":"):Wo.xss(t+":"),n}_makeDropdown(t,e,i){let n=document.createElement("select");n.className="vis-configuration vis-config-select";let o=0;void 0!==e&&-1!==t.indexOf(e)&&(o=t.indexOf(e));for(let e=0;es&&1!==s&&(a.max=Math.ceil(e*t),h=a.max,l="range increased"),a.value=e}else a.value=n;let d=document.createElement("input");d.className="vis-configuration vis-config-rangeinput",d.value=Number(a.value);var c=this;a.onchange=function(){d.value=this.value,c._update(Number(this.value),i)},a.oninput=function(){d.value=this.value};let u=this._makeLabel(i[i.length-1],i),p=this._makeItem(i,u,a,d);""!==l&&this.popupHistory[p]!==h&&(this.popupHistory[p]=h,this._setupPopup(l,p))}_makeButton(){if(!0===this.options.showButton){let t=document.createElement("div");t.className="vis-configuration vis-config-button",t.innerHTML="generate options",t.onclick=()=>{this._printOptions()},t.onmouseover=()=>{t.className="vis-configuration vis-config-button hover"},t.onmouseout=()=>{t.className="vis-configuration vis-config-button"},this.optionsContainer=document.createElement("div"),this.optionsContainer.className="vis-configuration vis-config-option-container",this.domElements.push(this.optionsContainer),this.domElements.push(t)}}_setupPopup(t,e){if(!0===this.initialized&&!0===this.allowCreation&&this.popupCounter{this._removePopup()},this.popupCounter+=1,this.popupDiv={html:i,index:e}}}_removePopup(){void 0!==this.popupDiv.html&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}_showPopupIfNeeded(){if(void 0!==this.popupDiv.html){let t=this.domElements[this.popupDiv.index].getBoundingClientRect();this.popupDiv.html.style.left=t.left+"px",this.popupDiv.html.style.top=t.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=setTimeout((()=>{this.popupDiv.html.style.opacity=0}),1500),this.popupDiv.deleteTimeout=setTimeout((()=>{this._removePopup()}),1800)}}_makeCheckbox(t,e,i){var n=document.createElement("input");n.type="checkbox",n.className="vis-configuration vis-config-checkbox",n.checked=t,void 0!==e&&(n.checked=e,e!==t&&("object"==typeof t?e!==t.enabled&&this.changedOptions.push({path:i,value:e}):this.changedOptions.push({path:i,value:e})));let o=this;n.onchange=function(){o._update(this.checked,i)};let s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,n)}_makeTextInput(t,e,i){var n=document.createElement("input");n.type="text",n.className="vis-configuration vis-config-text",n.value=e,e!==t&&this.changedOptions.push({path:i,value:e});let o=this;n.onchange=function(){o._update(this.value,i)};let s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,n)}_makeColorField(t,e,i){let n=t[1],o=document.createElement("div");"none"!==(e=void 0===e?n:e)?(o.className="vis-configuration vis-config-colorBlock",o.style.backgroundColor=e):o.className="vis-configuration vis-config-colorBlock none",e=void 0===e?n:e,o.onclick=()=>{this._showColorPicker(e,o,i)};let s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,o)}_showColorPicker(t,e,i){e.onclick=function(){},this.colorPicker.insertTo(e),this.colorPicker.show(),this.colorPicker.setColor(t),this.colorPicker.setUpdateCallback((t=>{let n="rgba("+t.r+","+t.g+","+t.b+","+t.a+")";e.style.backgroundColor=n,this._update(n,i)})),this.colorPicker.setCloseCallback((()=>{e.onclick=()=>{this._showColorPicker(t,e,i)}}))}_handleObject(t,e=[],i=!1){let n=!1,o=this.options.filter,s=!1;for(let r in t)if(t.hasOwnProperty(r)){n=!0;let a=t[r],l=Wo.copyAndExtendArray(e,r);if("function"==typeof o&&(n=o(r,e),!1===n&&!Array.isArray(a)&&"string"!=typeof a&&"boolean"!=typeof a&&a instanceof Object&&(this.allowCreation=!1,n=this._handleObject(a,l,!0),this.allowCreation=!1===i)),!1!==n){s=!0;let t=this._getValue(l);if(Array.isArray(a))this._handleArray(a,t,l);else if("string"==typeof a)this._makeTextInput(a,t,l);else if("boolean"==typeof a)this._makeCheckbox(a,t,l);else if(a instanceof Object){let t=!0;if(-1!==e.indexOf("physics")&&this.moduleOptions.physics.solver!==r&&(t=!1),!0===t)if(void 0!==a.enabled){let t=Wo.copyAndExtendArray(l,"enabled"),e=this._getValue(t);if(!0===e){let t=this._makeLabel(r,l,!0);this._makeItem(l,t),s=this._handleObject(a,l)||s}else this._makeCheckbox(a,e,l)}else{let t=this._makeLabel(r,l,!0);this._makeItem(l,t),s=this._handleObject(a,l)||s}}else console.error("dont know how to handle",a,r,l)}}return s}_handleArray(t,e,i){"string"==typeof t[0]&&"color"===t[0]?(this._makeColorField(t,e,i),t[1]!==e&&this.changedOptions.push({path:i,value:e})):"string"==typeof t[0]?(this._makeDropdown(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:e})):"number"==typeof t[0]&&(this._makeRange(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:Number(e)}))}_update(t,e){let i=this._constructOptions(t,e);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",i),this.initialized=!0,this.parent.setOptions(i)}_constructOptions(t,e,i={}){let n=i;t="false"!==(t="true"===t||t)&&t;for(let i=0;ivar options = "+JSON.stringify(t,null,2)+""}getOptions(){let t={};for(var e=0;eo.timeAxis.step.scale,getStep:()=>o.timeAxis.step.step,toScreen:o._toScreen.bind(o),toGlobalScreen:o._toGlobalScreen.bind(o),toTime:o._toTime.bind(o),toGlobalTime:o._toGlobalTime.bind(o)}},this.range=new ts(this.body,this.options),this.components.push(this.range),this.body.range=this.range,this.timeAxis=new rs(this.body,this.options),this.timeAxis2=null,this.components.push(this.timeAxis),this.currentTime=new Ss(this.body,this.options),this.components.push(this.currentTime),this.itemSet=new $s(this.body,this.options),this.components.push(this.itemSet),this.itemsData=null,this.groupsData=null,this.dom.root.onclick=t=>{r("click",t)},this.dom.root.ondblclick=t=>{r("doubleClick",t)},this.dom.root.oncontextmenu=t=>{r("contextmenu",t)},this.dom.root.onmouseover=t=>{r("mouseOver",t)},window.PointerEvent?(this.dom.root.onpointerdown=t=>{r("mouseDown",t)},this.dom.root.onpointermove=t=>{r("mouseMove",t)},this.dom.root.onpointerup=t=>{r("mouseUp",t)}):(this.dom.root.onmousemove=t=>{r("mouseMove",t)},this.dom.root.onmousedown=t=>{r("mouseDown",t)},this.dom.root.onmouseup=t=>{r("mouseUp",t)}),this.initialFitDone=!1,this.on("changed",(()=>{if(null!=o.itemsData){if(!o.initialFitDone&&!o.options.rollingMode)if(o.initialFitDone=!0,null!=o.options.start||null!=o.options.end){if(null==o.options.start||null==o.options.end)var t=o.getItemRange();const e=null!=o.options.start?o.options.start:t.min,i=null!=o.options.end?o.options.end:t.max;o.setWindow(e,i,{animation:!1})}else o.fit({animation:!1});o.initialDrawDone||!o.initialRangeChangeDone&&(o.options.start||o.options.end)&&!o.options.rollingMode||(o.initialDrawDone=!0,o.itemSet.initialDrawDone=!0,o.dom.root.style.visibility="visible",o.dom.loadingScreen.parentNode.removeChild(o.dom.loadingScreen),o.options.onInitialDrawComplete&&setTimeout((()=>o.options.onInitialDrawComplete()),0))}})),this.on("destroyTimeline",(()=>{o.destroy()})),n&&this.setOptions(n),this.body.emitter.on("fit",(t=>{this._onFit(t),this.redraw()})),i&&this.setGroups(i),e&&this.setItems(e),this._redraw()}_createConfigurator(){return new hr(this,this.dom.container,rr)}redraw(){this.itemSet&&this.itemSet.markDirty({refreshItems:!0}),this._redraw()}setOptions(t){if(!0===Zs.validate(t,sr)&&console.log("%cErrors have been found in the supplied options object.",Ks),Cs.prototype.setOptions.call(this,t),"type"in t&&t.type!==this.options.type){this.options.type=t.type;const e=this.itemsData;if(e){const t=this.getSelection();this.setItems(null),this.setItems(e.rawDS),this.setSelection(t)}}}setItems(t){let e;this.itemsDone=!1,e=t?Fo(t)?Yo(t):Yo(new Dn(t)):null,this.itemsData&&this.itemsData.dispose(),this.itemsData=e,this.itemSet&&this.itemSet.setItems(null!=e?e.rawDS:null)}setGroups(t){let e;const i=t=>!1!==t.visible;t?(Array.isArray(t)&&(t=new Dn(t)),e=new Cn(t,{filter:i})):e=null,null!=this.groupsData&&"function"==typeof this.groupsData.setData&&this.groupsData.setData(null),this.groupsData=e,this.itemSet.setGroups(e)}setData(t){t&&t.groups&&this.setGroups(t.groups),t&&t.items&&this.setItems(t.items)}setSelection(t,e){this.itemSet&&this.itemSet.setSelection(t),e&&e.focus&&this.focus(t,e)}getSelection(){return this.itemSet&&this.itemSet.getSelection()||[]}focus(t,e){if(!this.itemsData||null==t)return;const i=Array.isArray(t)?t:[t],n=this.itemsData.get(i);let o=null,s=null;if(n.forEach((t=>{const e=t.start.valueOf(),i="end"in t?t.end.valueOf():t.start.valueOf();(null===o||es)&&(s=i)})),null!==o&&null!==s){const t=this,n=this.itemSet.items[i[0]];let r=-1*this._getScrollTop(),a=null;const l=(e,i,o)=>{const s=pr(t,n);if(!1===s)return;if(a||(a=s),a.itemTop==s.itemTop&&!a.shouldScroll)return;a.itemTop!=s.itemTop&&s.shouldScroll&&(a=s,r=-1*t._getScrollTop());const l=r,h=a.scrollOffset,d=o?h:l+(h-l)*e;t._setScrollTop(-d),i||t._redraw()},h=()=>{const e=pr(t,n);e.shouldScroll&&e.itemTop!=a.itemTop&&(t._setScrollTop(-e.scrollOffset),t._redraw())},d=()=>{h(),setTimeout(h,100)},c=!e||void 0===e.zoom||e.zoom,u=(o+s)/2,p=c?1.1*(s-o):Math.max(this.range.end-this.range.start,1.1*(s-o)),m=!e||void 0===e.animation||e.animation;m||(a={shouldScroll:!1,scrollOffset:-1,itemTop:-1}),this.range.setRange(u-p/2,u+p/2,{animation:m},d,l)}}fit(t,e){const i=!t||void 0===t.animation||t.animation;let n;1===this.itemsData.length&&void 0===this.itemsData.get()[0].end?(n=this.getDataRange(),this.moveTo(n.min.valueOf(),{animation:i},e)):(n=this.getItemRange(),this.range.setRange(n.min,n.max,{animation:i},e))}getItemRange(){const t=this.getDataRange();let e=null!==t.min?t.min.valueOf():null,i=null!==t.max?t.max.valueOf():null,n=null,o=null;if(null!=e&&null!=i){let t=i-e;t<=0&&(t=10);const s=t/this.props.center.width,r={};let a=0;Wo.forEach(this.itemSet.items,((t,e)=>{if(t.groupShowing){const i=!0;r[e]=t.redraw(i),a=r[e].length}}));if(a>0)for(let t=0;t{e[t]()}));if(Wo.forEach(this.itemSet.items,(t=>{const r=cr(t),a=ur(t);let l,h;this.options.rtl?(l=r-(t.getWidthRight()+10)*s,h=a+(t.getWidthLeft()+10)*s):(l=r-(t.getWidthLeft()+10)*s,h=a+(t.getWidthRight()+10)*s),li&&(i=h,o=t)})),n&&o){const s=n.getWidthLeft()+10,r=o.getWidthRight()+10,a=this.props.center.width-s-r;a>0&&(this.options.rtl?(e=cr(n)-r*t/a,i=ur(o)+s*t/a):(e=cr(n)-s*t/a,i=ur(o)+r*t/a))}}return{min:null!=e?new Date(e):null,max:null!=i?new Date(i):null}}getDataRange(){let t=null,e=null;return this.itemsData&&this.itemsData.forEach((i=>{const n=Wo.convert(i.start,"Date").valueOf(),o=Wo.convert(null!=i.end?i.end:i.start,"Date").valueOf();(null===t||ne)&&(e=o)})),{min:null!=t?new Date(t):null,max:null!=e?new Date(e):null}}getEventProperties(t){const e=t.center?t.center.x:t.clientX,i=t.center?t.center.y:t.clientY,n=this.dom.centerContainer.getBoundingClientRect(),o=this.options.rtl?n.right-e:e-n.left,s=i-n.top,r=this.itemSet.itemFromTarget(t),a=this.itemSet.groupFromTarget(t),l=Ds.customTimeFromTarget(t),h=this.itemSet.options.snap||null,d=this.body.util.getScale(),c=this.body.util.getStep(),u=this._toTime(o),p=h?h(u,d,c):u,m=Wo.getTarget(t);let f=null;return null!=r?f="item":null!=l?f="custom-time":Wo.hasParent(m,this.timeAxis.dom.foreground)||this.timeAxis2&&Wo.hasParent(m,this.timeAxis2.dom.foreground)?f="axis":Wo.hasParent(m,this.itemSet.dom.labelSet)?f="group-label":Wo.hasParent(m,this.currentTime.bar)?f="current-time":Wo.hasParent(m,this.dom.center)&&(f="background"),{event:t,item:r?r.id:null,isCluster:!!r&&!!r.isCluster,items:r?r.items||[]:null,group:a?a.groupId:null,customTime:l?l.options.id:null,what:f,pageX:t.srcEvent?t.srcEvent.pageX:t.pageX,pageY:t.srcEvent?t.srcEvent.pageY:t.pageY,x:o,y:s,time:u,snappedTime:p}}toggleRollingMode(){this.range.rolling?this.range.stopRolling():(null==this.options.rollingMode&&this.setOptions(this.options),this.range.startRolling())}_redraw(){Cs.prototype._redraw.call(this)}_onFit(t){const{start:e,end:i,animation:n}=t;i?this.range.setRange(e,i,{animation:n}):this.moveTo(e.valueOf(),{animation:n})}}function cr(t){return Wo.convert(t.data.start,"Date").valueOf()}function ur(t){const e=null!=t.data.end?t.data.end:t.data.start;return Wo.convert(e,"Date").valueOf()}function pr(t,e){if(!e.parent)return!1;const i=t.options.rtl?t.props.rightContainer.height:t.props.leftContainer.height,n=t.props.center.height,o=e.parent;let s=o.top,r=!0;const a=t.timeAxis.options.orientation.axis,l=()=>"bottom"==a?o.height-e.top-e.height:e.top,h=-1*t._getScrollTop(),d=s+l(),c=e.height;return dh+i?s+=l()+c-i+t.itemSet.options.margin.item.vertical:r=!1,s=Math.min(s,n-i),{shouldScroll:r,scrollOffset:s,itemTop:d}}function mr(t){for(var e in t)t.hasOwnProperty(e)&&(t[e].redundant=t[e].used,t[e].used=[])}function fr(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e].redundant){for(var i=0;i0?(n=e[t].redundant[0],e[t].redundant.shift()):(n=document.createElementNS("http://www.w3.org/2000/svg",t),i.appendChild(n)):(n=document.createElementNS("http://www.w3.org/2000/svg",t),e[t]={used:[],redundant:[]},i.appendChild(n)),e[t].used.push(n),n}function vr(t,e,i,n){var o;return e.hasOwnProperty(t)?e[t].redundant.length>0?(o=e[t].redundant[0],e[t].redundant.shift()):(o=document.createElement(t),void 0!==n?i.insertBefore(o,n):i.appendChild(o)):(o=document.createElement(t),e[t]={used:[],redundant:[]},void 0!==n?i.insertBefore(o,n):i.appendChild(o)),e[t].used.push(o),o}function yr(t,e,i,n,o,s){var r;if("circle"==i.style?((r=gr("circle",n,o)).setAttributeNS(null,"cx",t),r.setAttributeNS(null,"cy",e),r.setAttributeNS(null,"r",.5*i.size)):((r=gr("rect",n,o)).setAttributeNS(null,"x",t-.5*i.size),r.setAttributeNS(null,"y",e-.5*i.size),r.setAttributeNS(null,"width",i.size),r.setAttributeNS(null,"height",i.size)),void 0!==i.styles&&r.setAttributeNS(null,"style",i.styles),r.setAttributeNS(null,"class",i.className+" vis-point"),s){var a=gr("text",n,o);s.xOffset&&(t+=s.xOffset),s.yOffset&&(e+=s.yOffset),s.content&&(a.textContent=s.content),s.className&&a.setAttributeNS(null,"class",s.className+" vis-label"),a.setAttributeNS(null,"x",t),a.setAttributeNS(null,"y",e)}return r}function br(t,e,i,n,o,s,r,a){if(0!=n){n<0&&(e-=n*=-1);var l=gr("rect",s,r);l.setAttributeNS(null,"x",t-.5*i),l.setAttributeNS(null,"y",e),l.setAttributeNS(null,"width",i),l.setAttributeNS(null,"height",n),l.setAttributeNS(null,"class",o),a&&l.setAttributeNS(null,"style",a)}}class wr{constructor(t,e,i,n,o,s,r=!1,a=!1){if(this.majorSteps=[1,2,5,10],this.minorSteps=[.25,.5,1,2],this.customLines=null,this.containerHeight=o,this.majorCharHeight=s,this._start=t,this._end=e,this.scale=1,this.minorStepIdx=-1,this.magnitudefactor=1,this.determineScale(),this.zeroAlign=r,this.autoScaleStart=i,this.autoScaleEnd=n,this.formattingFunction=a,i||n){const t=this,e=e=>{const i=e-e%(t.magnitudefactor*t.minorSteps[t.minorStepIdx]);return e%(t.magnitudefactor*t.minorSteps[t.minorStepIdx])>t.magnitudefactor*t.minorSteps[t.minorStepIdx]*.5?i+t.magnitudefactor*t.minorSteps[t.minorStepIdx]:i};i&&(this._start-=2*this.magnitudefactor*this.minorSteps[this.minorStepIdx],this._start=e(this._start)),n&&(this._end+=this.magnitudefactor*this.minorSteps[this.minorStepIdx],this._end=e(this._end)),this.determineScale()}}setCharHeight(t){this.majorCharHeight=t}setHeight(t){this.containerHeight=t}determineScale(){const t=this._end-this._start;this.scale=this.containerHeight/t;const e=this.majorCharHeight/this.scale,i=t>0?Math.round(Math.log(t)/Math.LN10):0;this.minorStepIdx=-1,this.magnitudefactor=Math.pow(10,i);let n=0;i<0&&(n=i);let o=!1;for(let t=n;Math.abs(t)<=Math.abs(i);t++){this.magnitudefactor=Math.pow(10,t);for(let t=0;t=e){o=!0,this.minorStepIdx=t;break}}if(!0===o)break}}is_major(t){return t%(this.magnitudefactor*this.majorSteps[this.minorStepIdx])==0}getStep(){return this.magnitudefactor*this.minorSteps[this.minorStepIdx]}getFirstMajor(){const t=this.magnitudefactor*this.majorSteps[this.minorStepIdx];return this.convertValue(this._start+(t-this._start%t)%t)}formatValue(t){let e=t.toPrecision(5);return"function"==typeof this.formattingFunction&&(e=this.formattingFunction(t)),"number"==typeof e?`${e}`:"string"==typeof e?e:t.toPrecision(5)}getLines(){const t=[],e=this.getStep(),i=(e-this._start%e)%e;for(let n=this._start+i;this._end-n>1e-5;n+=e)n!=this._start&&t.push({major:this.is_major(n),y:this.convertValue(n),val:this.formatValue(n)});return t}followScale(t){const e=this.minorStepIdx,i=this._start,n=this._end,o=this,s=()=>{o.magnitudefactor*=2},r=()=>{o.magnitudefactor/=2};t.minorStepIdx<=1&&this.minorStepIdx<=1||t.minorStepIdx>1&&this.minorStepIdx>1||(t.minorStepIdxn+1e-5)r(),h=!1;else{if(!this.autoScaleStart&&this._start=0)){r(),h=!1;continue}console.warn("Can't adhere to given 'min' range, due to zeroalign")}this.autoScaleStart&&this.autoScaleEnd&&e`${parseFloat(t.toPrecision(3))}`,title:{text:void 0,style:void 0}},right:{range:{min:void 0,max:void 0},format:t=>`${parseFloat(t.toPrecision(3))}`,title:{text:void 0,style:void 0}}},this.linegraphOptions=n,this.linegraphSVG=i,this.props={},this.DOMelements={lines:{},labels:{},title:{}},this.dom={},this.scale=void 0,this.range={start:0,end:0},this.options=Wo.extend({},this.defaultOptions),this.conversionFactor=1,this.setOptions(e),this.width=Number(`${this.options.width}`.replace("px","")),this.minWidth=this.width,this.height=this.linegraphSVG.getBoundingClientRect().height,this.hidden=!1,this.stepPixels=25,this.zeroCrossing=-1,this.amountOfSteps=-1,this.lineOffset=0,this.master=!0,this.masterAxis=null,this.svgElements={},this.iconsRemoved=!1,this.groups={},this.amountOfGroups=0,this._create(),null==this.scale&&this._redrawLabels(),this.framework={svg:this.svg,svgElements:this.svgElements,options:this.options,groups:this.groups};const o=this;this.body.emitter.on("verticalDrag",(()=>{o.dom.lineContainer.style.top=`${o.body.domProps.scrollTop}px`}))}addGroup(t,e){this.groups.hasOwnProperty(t)||(this.groups[t]=e),this.amountOfGroups+=1}updateGroup(t,e){this.groups.hasOwnProperty(t)||(this.amountOfGroups+=1),this.groups[t]=e}removeGroup(t){this.groups.hasOwnProperty(t)&&(delete this.groups[t],this.amountOfGroups-=1)}setOptions(t){if(t){let e=!1;this.options.orientation!=t.orientation&&void 0!==t.orientation&&(e=!0);const i=["orientation","showMinorLabels","showMajorLabels","icons","majorLinesOffset","minorLinesOffset","labelOffsetX","labelOffsetY","iconWidth","width","visible","left","right","alignZeros"];Wo.selectiveDeepExtend(i,this.options,t),this.minWidth=Number(`${this.options.width}`.replace("px","")),!0===e&&this.dom.frame&&(this.hide(),this.show())}}_create(){this.dom.frame=document.createElement("div"),this.dom.frame.style.width=this.options.width,this.dom.frame.style.height=this.height,this.dom.lineContainer=document.createElement("div"),this.dom.lineContainer.style.width="100%",this.dom.lineContainer.style.height=this.height,this.dom.lineContainer.style.position="relative",this.dom.lineContainer.style.visibility="visible",this.dom.lineContainer.style.display="block",this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.svg.style.position="absolute",this.svg.style.top="0px",this.svg.style.height="100%",this.svg.style.width="100%",this.svg.style.display="block",this.dom.frame.appendChild(this.svg)}_redrawGroupIcons(){let t;mr(this.svgElements);const e=this.options.iconWidth;let i=11.5;t="left"===this.options.orientation?4:this.width-e-4;const n=Object.keys(this.groups);n.sort(((t,e)=>t{const i=t.y,n=t.major;this.options.showMinorLabels&&!1===n&&this._redrawLabel(i-2,t.val,e,"vis-y-axis vis-minor",this.props.minorCharHeight),n&&i>=0&&this._redrawLabel(i-2,t.val,e,"vis-y-axis vis-major",this.props.majorCharHeight),!0===this.master&&(n?this._redrawLine(i,e,"vis-grid vis-horizontal vis-major",this.options.majorLinesOffset,this.props.majorLineWidth):this._redrawLine(i,e,"vis-grid vis-horizontal vis-minor",this.options.minorLinesOffset,this.props.minorLineWidth))}));let s=0;void 0!==this.options[e].title&&void 0!==this.options[e].title.text&&(s=this.props.titleCharHeight);const r=!0===this.options.icons?Math.max(this.options.iconWidth,s)+this.options.labelOffsetX+15:s+this.options.labelOffsetX+15;return this.maxLabelSize>this.width-r&&!0===this.options.visible?(this.width=this.maxLabelSize+r,this.options.width=`${this.width}px`,fr(this.DOMelements.lines),fr(this.DOMelements.labels),this.redraw(),t=!0):this.maxLabelSizethis.minWidth?(this.width=Math.max(this.minWidth,this.maxLabelSize+r),this.options.width=`${this.width}px`,fr(this.DOMelements.lines),fr(this.DOMelements.labels),this.redraw(),t=!0):(fr(this.DOMelements.lines),fr(this.DOMelements.labels),t=!1),t}convertValue(t){return this.scale.convertValue(t)}screenToValue(t){return this.scale.screenToValue(t)}_redrawLabel(t,e,i,n,o){const s=vr("div",this.DOMelements.labels,this.dom.frame);s.className=n,s.innerHTML=Wo.xss(e),"left"===i?(s.style.left=`-${this.options.labelOffsetX}px`,s.style.textAlign="right"):(s.style.right=`-${this.options.labelOffsetX}px`,s.style.textAlign="left"),s.style.top=`${t-.5*o+this.options.labelOffsetY}px`,e+="";const r=Math.max(this.props.majorCharWidth,this.props.minorCharWidth);this.maxLabelSize0&&(i=Math.min(i,Math.abs(e[n-1].screen_x-e[n].screen_x))),0===i&&(void 0===t[e[n].screen_x]&&(t[e[n].screen_x]={amount:0,resolved:0,accumulatedPositive:0,accumulatedNegative:0}),t[e[n].screen_x].amount+=1)},Dr._getSafeDrawData=function(t,e,i){var n,o;return t0?(n=t0){t.sort((function(t,e){return t.screen_x===e.screen_x?t.groupIde[s].screen_y?e[s].screen_y:n,o=ot[r].accumulatedNegative?t[r].accumulatedNegative:n)>t[r].accumulatedPositive?t[r].accumulatedPositive:n,o=(o=o0){return 1==e.options.interpolation.enabled?Cr._catmullRom(t,e):Cr._linear(t)}},Cr.drawIcon=function(t,e,i,n,o,s){var r,a,l=.5*o,h=gr("rect",s.svgElements,s.svg);(h.setAttributeNS(null,"x",e),h.setAttributeNS(null,"y",i-l),h.setAttributeNS(null,"width",n),h.setAttributeNS(null,"height",2*l),h.setAttributeNS(null,"class","vis-outline"),(r=gr("path",s.svgElements,s.svg)).setAttributeNS(null,"class",t.className),void 0!==t.style&&r.setAttributeNS(null,"style",t.style),r.setAttributeNS(null,"d","M"+e+","+i+" L"+(e+n)+","+i),1==t.options.shaded.enabled&&(a=gr("path",s.svgElements,s.svg),"top"==t.options.shaded.orientation?a.setAttributeNS(null,"d","M"+e+", "+(i-l)+"L"+e+","+i+" L"+(e+n)+","+i+" L"+(e+n)+","+(i-l)):a.setAttributeNS(null,"d","M"+e+","+i+" L"+e+","+(i+l)+" L"+(e+n)+","+(i+l)+"L"+(e+n)+","+i),a.setAttributeNS(null,"class",t.className+" vis-icon-fill"),void 0!==t.options.shaded.style&&""!==t.options.shaded.style&&a.setAttributeNS(null,"style",t.options.shaded.style)),1==t.options.drawPoints.enabled)&&yr(e+.5*n,i,{style:t.options.drawPoints.style,styles:t.options.drawPoints.styles,size:t.options.drawPoints.size,className:t.className},s.svgElements,s.svg)},Cr.drawShading=function(t,e,i,n){if(1==e.options.shaded.enabled){var o,s=Number(n.svg.style.height.replace("px","")),r=gr("path",n.svgElements,n.svg),a="L";1==e.options.interpolation.enabled&&(a="C");var l=0;l="top"==e.options.shaded.orientation?0:"bottom"==e.options.shaded.orientation?s:Math.min(Math.max(0,e.zeroPosition),s),o="group"==e.options.shaded.orientation&&null!=i&&null!=i?"M"+t[0][0]+","+t[0][1]+" "+this.serializePath(t,a,!1)+" L"+i[i.length-1][0]+","+i[i.length-1][1]+" "+this.serializePath(i,a,!0)+i[0][0]+","+i[0][1]+" Z":"M"+t[0][0]+","+t[0][1]+" "+this.serializePath(t,a,!1)+" V"+l+" H"+t[0][0]+" Z",r.setAttributeNS(null,"class",e.className+" vis-fill"),void 0!==e.options.shaded.style&&r.setAttributeNS(null,"style",e.options.shaded.style),r.setAttributeNS(null,"d",o)}},Cr.draw=function(t,e,i){if(null!=t&&null!=t){var n=gr("path",i.svgElements,i.svg);n.setAttributeNS(null,"class",e.className),void 0!==e.style&&n.setAttributeNS(null,"style",e.style);var o="L";1==e.options.interpolation.enabled&&(o="C"),n.setAttributeNS(null,"d","M"+t[0][0]+","+t[0][1]+" "+this.serializePath(t,o,!1))}},Cr.serializePath=function(t,e,i){if(t.length<2)return"";var n,o=e;if(i)for(n=t.length-2;n>0;n--)o+=t[n][0]+","+t[n][1]+" ";else for(n=1;n0&&(m=1/m),(f=3*g*(g+v))>0&&(f=1/f),a={screen_x:(-b*n.screen_x+u*o.screen_x+w*s.screen_x)*m,screen_y:(-b*n.screen_y+u*o.screen_y+w*s.screen_y)*m},l={screen_x:(y*o.screen_x+p*s.screen_x-b*r.screen_x)*f,screen_y:(y*o.screen_y+p*s.screen_y-b*r.screen_y)*f},0==a.screen_x&&0==a.screen_y&&(a=o),0==l.screen_x&&0==l.screen_y&&(l=s),x.push([a.screen_x,a.screen_y]),x.push([l.screen_x,l.screen_y]),x.push([s.screen_x,s.screen_y]);return x},Cr._linear=function(t){for(var e=[],i=0;ie.x?1:-1}))):this.itemsData=[]},Sr.prototype.getItems=function(){return this.itemsData},Sr.prototype.setZeroPosition=function(t){this.zeroPosition=t},Sr.prototype.setOptions=function(t){if(void 0!==t){Wo.selectiveDeepExtend(["sampling","style","sort","yAxisOrientation","barChart","zIndex","excludeFromStacking","excludeFromLegend"],this.options,t),"function"==typeof t.drawPoints&&(t.drawPoints={onRender:t.drawPoints}),Wo.mergeOptions(this.options,t,"interpolation"),Wo.mergeOptions(this.options,t,"drawPoints"),Wo.mergeOptions(this.options,t,"shaded"),t.interpolation&&"object"==typeof t.interpolation&&t.interpolation.parametrization&&("uniform"==t.interpolation.parametrization?this.options.interpolation.alpha=0:"chordal"==t.interpolation.parametrization?this.options.interpolation.alpha=1:(this.options.interpolation.parametrization="centripetal",this.options.interpolation.alpha=.5))}},Sr.prototype.update=function(t){this.group=t,this.content=t.content||"graph",this.className=t.className||this.className||"vis-graph-group"+this.groupsUsingDefaultStyles[0]%10,this.visible=void 0===t.visible||t.visible,this.style=t.style,this.setOptions(t.options)},Sr.prototype.getLegend=function(t,e,i,n,o){null!=i&&null!=i||(i={svg:document.createElementNS("http://www.w3.org/2000/svg","svg"),svgElements:{},options:this.options,groups:[this]});switch(null!=n&&null!=n||(n=0),null!=o&&null!=o||(o=.5*e),this.options.style){case"line":Cr.drawIcon(this,n,o,t,e,i);break;case"points":case"point":xr.drawIcon(this,n,o,t,e,i);break;case"bar":Dr.drawIcon(this,n,o,t,e,i)}return{icon:i.svg,label:this.content,orientation:this.options.yAxisOrientation}},Sr.prototype.getYRange=function(t){for(var e=t[0].y,i=t[0].y,n=0;nt[n].y?t[n].y:e,i=i");this.dom.textArea.innerHTML=Wo.xss(s),this.dom.textArea.style.lineHeight=.75*this.options.iconSize+this.options.iconSpacing+"px"}},Tr.prototype.drawLegendIcons=function(){if(this.dom.frame.parentNode){var t=Object.keys(this.groups);t.sort((function(t,e){return t0){var r={};for(this._getRelevantData(s,r,n,o),this._applySampling(s,r),e=0;e0)switch(t.options.style){case"line":l.hasOwnProperty(s[e])||(l[s[e]]=Cr.calcPath(r[s[e]],t)),Cr.draw(l[s[e]],t,this.framework);case"point":case"points":"point"!=t.options.style&&"points"!=t.options.style&&1!=t.options.drawPoints.enabled||xr.draw(r[s[e]],t,this.framework)}}}return fr(this.svgElements),!1},Mr.prototype._stack=function(t,e){var i,n,o,s,r;i=0;for(var a=0;at[a].x){r=e[l],s=0==l?r:e[l-1],i=l;break}}void 0===r&&(s=e[e.length-1],r=e[e.length-1]),n=r.x-s.x,o=r.y-s.y,t[a].y=0==n?t[a].orginalY+r.y:t[a].orginalY+o/n*(t[a].x-s.x)+s.y}},Mr.prototype._getRelevantData=function(t,e,i,n){var o,s,r,a;if(t.length>0)for(s=0;s0)for(var i=0;i0){var o,s=n.length,r=s/(this.body.util.toGlobalScreen(n[n.length-1].x)-this.body.util.toGlobalScreen(n[0].x));o=Math.min(Math.ceil(.2*s),Math.max(1,Math.round(r)));for(var a=new Array(s),l=0;l0){for(s=0;s0&&(o=this.groups[t[s]],!0===r.stack&&"bar"===r.style?"left"===r.yAxisOrientation?a=a.concat(n):l=l.concat(n):i[t[s]]=o.getYRange(n,t[s]));Dr.getStackedYRange(a,i,t,"__barStackLeft","left"),Dr.getStackedYRange(l,i,t,"__barStackRight","right")}},Mr.prototype._updateYAxis=function(t,e){var i,n,o=!1,s=!1,r=!1,a=1e9,l=1e9,h=-1e9,d=-1e9;if(t.length>0){for(var c=0;ci?i:a,h=hi?i:l,d=ds.timeAxis.step.scale,getStep:()=>s.timeAxis.step.step,toScreen:s._toScreen.bind(s),toGlobalScreen:s._toGlobalScreen.bind(s),toTime:s._toTime.bind(s),toGlobalTime:s._toGlobalTime.bind(s)}},this.range=new ts(this.body),this.components.push(this.range),this.body.range=this.range,this.timeAxis=new rs(this.body),this.components.push(this.timeAxis),this.currentTime=new Ss(this.body),this.components.push(this.currentTime),this.linegraph=new Mr(this.body),this.components.push(this.linegraph),this.itemsData=null,this.groupsData=null,this.on("tap",(function(t){s.emit("click",s.getEventProperties(t))})),this.on("doubletap",(function(t){s.emit("doubleClick",s.getEventProperties(t))})),this.dom.root.oncontextmenu=function(t){s.emit("contextmenu",s.getEventProperties(t))},this.initialFitDone=!1,this.on("changed",(function(){if(null!=s.itemsData){if(!s.initialFitDone&&!s.options.rollingMode)if(s.initialFitDone=!0,null!=s.options.start||null!=s.options.end){if(null==s.options.start||null==s.options.end)var t=s.getItemRange();var e=null!=s.options.start?s.options.start:t.min,i=null!=s.options.end?s.options.end:t.max;s.setWindow(e,i,{animation:!1})}else s.fit({animation:!1});s.initialDrawDone||!s.initialRangeChangeDone&&(s.options.start||s.options.end)&&!s.options.rollingMode||(s.initialDrawDone=!0,s.dom.root.style.visibility="visible",s.dom.loadingScreen.parentNode.removeChild(s.dom.loadingScreen),s.options.onInitialDrawComplete&&setTimeout((()=>s.options.onInitialDrawComplete()),0))}})),n&&this.setOptions(n),i&&this.setGroups(i),e&&this.setItems(e),this._redraw()}jr.prototype=new Cs,jr.prototype.setOptions=function(t){!0===Zs.validate(t,Rr)&&console.log("%cErrors have been found in the supplied options object.",Ks),Cs.prototype.setOptions.call(this,t)},jr.prototype.setItems=function(t){var e,i=null==this.itemsData;if(e=t?Fo(t)?Yo(t):Yo(new Dn(t)):null,this.itemsData&&this.itemsData.dispose(),this.itemsData=e,this.linegraph&&this.linegraph.setItems(null!=e?e.rawDS:null),i)if(null!=this.options.start||null!=this.options.end){var n=null!=this.options.start?this.options.start:null,o=null!=this.options.end?this.options.end:null;this.setWindow(n,o,{animation:!1})}else this.fit({animation:!1})},jr.prototype.setGroups=function(t){var e;e=t?Fo(t)?t:new Dn(t):null,this.groupsData=e,this.linegraph.setGroups(e)},jr.prototype.getLegend=function(t,e,i){return void 0===e&&(e=15),void 0===i&&(i=15),void 0!==this.linegraph.groups[t]?this.linegraph.groups[t].getLegend(e,i):"cannot find group:'"+t+"'"},jr.prototype.isGroupVisible=function(t){return void 0!==this.linegraph.groups[t]&&(this.linegraph.groups[t].visible&&(void 0===this.linegraph.options.groups.visibility[t]||1==this.linegraph.options.groups.visibility[t]))},jr.prototype.getDataRange=function(){var t=null,e=null;for(var i in this.linegraph.groups)if(this.linegraph.groups.hasOwnProperty(i)&&1==this.linegraph.groups[i].visible)for(var n=0;ns?s:t,e=null==e||e0&&h.push(d.screenToValue(o)),!c.hidden&&this.itemsData.length>0&&h.push(c.screenToValue(o)),{event:t,customTime:r?r.options.id:null,what:l,pageX:t.srcEvent?t.srcEvent.pageX:t.pageX,pageY:t.srcEvent?t.srcEvent.pageY:t.pageY,x:n,y:o,time:s,value:h}},jr.prototype._createConfigurator=function(){return new hr(this,this.dom.container,Lr)};const Yr=function(){try{return navigator?navigator.languages&&navigator.languages.length?navigator.languages:navigator.userLanguage||navigator.language||navigator.browserLanguage||"en":"en"}catch(t){return"en"}}();Mn.locale(Yr);var Hr={exports:{}};!function(t){function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==B?B:"undefined"!=typeof self?self:{},n={exports:{}},o=function(t){return t&&t.Math==Math&&t},s=o("object"==typeof globalThis&&globalThis)||o("object"==typeof window&&window)||o("object"==typeof self&&self)||o("object"==typeof i&&i)||function(){return this}()||Function("return this")(),r=function(t){try{return!!t()}catch(t){return!0}},a=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),l=a,h=Function.prototype,d=h.apply,c=h.call,u="object"==typeof Reflect&&Reflect.apply||(l?c.bind(d):function(){return c.apply(d,arguments)}),p=a,m=Function.prototype,f=m.bind,g=m.call,v=p&&f.bind(g,g),y=p?function(t){return t&&v(t)}:function(t){return t&&function(){return g.apply(t,arguments)}},b=function(t){return"function"==typeof t},w={},_=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),x=a,k=Function.prototype.call,D=x?k.bind(k):function(){return k.apply(k,arguments)},C={},S={}.propertyIsEnumerable,T=Object.getOwnPropertyDescriptor,E=T&&!S.call({1:2},1);C.f=E?function(t){var e=T(this,t);return!!e&&e.enumerable}:S;var M,O,I=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},A=y,P=A({}.toString),N=A("".slice),F=function(t){return N(P(t),8,-1)},R=y,L=r,j=F,Y=s.Object,H=R("".split),z=L((function(){return!Y("z").propertyIsEnumerable(0)}))?function(t){return"String"==j(t)?H(t,""):Y(t)}:Y,W=s.TypeError,G=function(t){if(null==t)throw W("Can't call method on "+t);return t},V=z,U=G,$=function(t){return V(U(t))},q=b,X=function(t){return"object"==typeof t?null!==t:q(t)},K={},Z=K,Q=s,J=b,tt=function(t){return J(t)?t:void 0},et=function(t,e){return arguments.length<2?tt(Z[t])||tt(Q[t]):Z[t]&&Z[t][e]||Q[t]&&Q[t][e]},it=y({}.isPrototypeOf),nt=et("navigator","userAgent")||"",ot=s,st=nt,rt=ot.process,at=ot.Deno,lt=rt&&rt.versions||at&&at.version,ht=lt&<.v8;ht&&(O=(M=ht.split("."))[0]>0&&M[0]<4?1:+(M[0]+M[1])),!O&&st&&(!(M=st.match(/Edge\/(\d+)/))||M[1]>=74)&&(M=st.match(/Chrome\/(\d+)/))&&(O=+M[1]);var dt=O,ct=dt,ut=r,pt=!!Object.getOwnPropertySymbols&&!ut((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&ct&&ct<41})),mt=pt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,ft=et,gt=b,vt=it,yt=mt,bt=s.Object,wt=yt?function(t){return"symbol"==typeof t}:function(t){var e=ft("Symbol");return gt(e)&&vt(e.prototype,bt(t))},_t=s.String,xt=function(t){try{return _t(t)}catch(t){return"Object"}},kt=b,Dt=xt,Ct=s.TypeError,St=function(t){if(kt(t))return t;throw Ct(Dt(t)+" is not a function")},Tt=St,Et=function(t,e){var i=t[e];return null==i?void 0:Tt(i)},Mt=D,Ot=b,It=X,At=s.TypeError,Pt={exports:{}},Nt=s,Ft=Object.defineProperty,Rt=function(t,e){try{Ft(Nt,t,{value:e,configurable:!0,writable:!0})}catch(i){Nt[t]=e}return e},Lt="__core-js_shared__",jt=s[Lt]||Rt(Lt,{}),Yt=jt;(Pt.exports=function(t,e){return Yt[t]||(Yt[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.21.1",mode:"pure",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Ht=G,zt=s.Object,Bt=function(t){return zt(Ht(t))},Wt=Bt,Gt=y({}.hasOwnProperty),Vt=Object.hasOwn||function(t,e){return Gt(Wt(t),e)},Ut=y,$t=0,qt=Math.random(),Xt=Ut(1..toString),Kt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Xt(++$t+qt,36)},Zt=s,Qt=Pt.exports,Jt=Vt,te=Kt,ee=pt,ie=mt,ne=Qt("wks"),oe=Zt.Symbol,se=oe&&oe.for,re=ie?oe:oe&&oe.withoutSetter||te,ae=function(t){if(!Jt(ne,t)||!ee&&"string"!=typeof ne[t]){var e="Symbol."+t;ee&&Jt(oe,t)?ne[t]=oe[t]:ne[t]=ie&&se?se(e):re(e)}return ne[t]},le=D,he=X,de=wt,ce=Et,ue=function(t,e){var i,n;if("string"===e&&Ot(i=t.toString)&&!It(n=Mt(i,t)))return n;if(Ot(i=t.valueOf)&&!It(n=Mt(i,t)))return n;if("string"!==e&&Ot(i=t.toString)&&!It(n=Mt(i,t)))return n;throw At("Can't convert object to primitive value")},pe=ae,me=s.TypeError,fe=pe("toPrimitive"),ge=function(t,e){if(!he(t)||de(t))return t;var i,n=ce(t,fe);if(n){if(void 0===e&&(e="default"),i=le(n,t,e),!he(i)||de(i))return i;throw me("Can't convert object to primitive value")}return void 0===e&&(e="number"),ue(t,e)},ve=wt,ye=function(t){var e=ge(t,"string");return ve(e)?e:e+""},be=X,we=s.document,_e=be(we)&&be(we.createElement),xe=function(t){return _e?we.createElement(t):{}},ke=xe,De=!_&&!r((function(){return 7!=Object.defineProperty(ke("div"),"a",{get:function(){return 7}}).a})),Ce=_,Se=D,Te=C,Ee=I,Me=$,Oe=ye,Ie=Vt,Ae=De,Pe=Object.getOwnPropertyDescriptor;w.f=Ce?Pe:function(t,e){if(t=Me(t),e=Oe(e),Ae)try{return Pe(t,e)}catch(t){}if(Ie(t,e))return Ee(!Se(Te.f,t,e),t[e])};var Ne=r,Fe=b,Re=/#|\.prototype\./,Le=function(t,e){var i=Ye[je(t)];return i==ze||i!=He&&(Fe(e)?Ne(e):!!e)},je=Le.normalize=function(t){return String(t).replace(Re,".").toLowerCase()},Ye=Le.data={},He=Le.NATIVE="N",ze=Le.POLYFILL="P",Be=Le,We=St,Ge=a,Ve=y(y.bind),Ue=function(t,e){return We(t),void 0===e?t:Ge?Ve(t,e):function(){return t.apply(e,arguments)}},$e={},qe=_&&r((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Xe=s,Ke=X,Ze=Xe.String,Qe=Xe.TypeError,Je=function(t){if(Ke(t))return t;throw Qe(Ze(t)+" is not an object")},ti=_,ei=De,ii=qe,ni=Je,oi=ye,si=s.TypeError,ri=Object.defineProperty,ai=Object.getOwnPropertyDescriptor,li="enumerable",hi="configurable",di="writable";$e.f=ti?ii?function(t,e,i){if(ni(t),e=oi(e),ni(i),"function"==typeof t&&"prototype"===e&&"value"in i&&di in i&&!i.writable){var n=ai(t,e);n&&n.writable&&(t[e]=i.value,i={configurable:hi in i?i.configurable:n.configurable,enumerable:li in i?i.enumerable:n.enumerable,writable:!1})}return ri(t,e,i)}:ri:function(t,e,i){if(ni(t),e=oi(e),ni(i),ei)try{return ri(t,e,i)}catch(t){}if("get"in i||"set"in i)throw si("Accessors not supported");return"value"in i&&(t[e]=i.value),t};var ci=$e,ui=I,pi=_?function(t,e,i){return ci.f(t,e,ui(1,i))}:function(t,e,i){return t[e]=i,t},mi=s,fi=u,gi=y,vi=b,yi=w.f,bi=Be,wi=K,_i=Ue,xi=pi,ki=Vt,Di=function(t){var e=function(i,n,o){if(this instanceof e){switch(arguments.length){case 0:return new t;case 1:return new t(i);case 2:return new t(i,n)}return new t(i,n,o)}return fi(t,this,arguments)};return e.prototype=t.prototype,e},Ci=function(t,e){var i,n,o,s,r,a,l,h,d=t.target,c=t.global,u=t.stat,p=t.proto,m=c?mi:u?mi[d]:(mi[d]||{}).prototype,f=c?wi:wi[d]||xi(wi,d,{})[d],g=f.prototype;for(o in e)i=!bi(c?o:d+(u?".":"#")+o,t.forced)&&m&&ki(m,o),r=f[o],i&&(a=t.noTargetGet?(h=yi(m,o))&&h.value:m[o]),s=i&&a?a:e[o],i&&typeof r==typeof s||(l=t.bind&&i?_i(s,mi):t.wrap&&i?Di(s):p&&vi(s)?gi(s):s,(t.sham||s&&s.sham||r&&r.sham)&&xi(l,"sham",!0),xi(f,o,l),p&&(ki(wi,n=d+"Prototype")||xi(wi,n,{}),xi(wi[n],o,s),t.real&&g&&!g[o]&&xi(g,o,s)))},Si=Ci,Ti=_,Ei=$e.f;Si({target:"Object",stat:!0,forced:Object.defineProperty!==Ei,sham:!Ti},{defineProperty:Ei});var Mi=K.Object,Oi=n.exports=function(t,e,i){return Mi.defineProperty(t,e,i)};Mi.defineProperty.sham&&(Oi.sham=!0);var Ii=n.exports,Ai=Ii;function Pi(t,e){for(var i=0;i0?sn:on)(e)},an=rn,ln=Math.min,hn=function(t){return t>0?ln(an(t),9007199254740991):0},dn=function(t){return hn(t.length)},cn=St,un=Bt,pn=z,mn=dn,fn=s.TypeError,gn=function(t){return function(e,i,n,o){cn(i);var s=un(e),r=pn(s),a=mn(s),l=t?a-1:0,h=t?-1:1;if(n<2)for(;;){if(l in r){o=r[l],l+=h;break}if(l+=h,t?l<0:a<=l)throw fn("Reduce of empty array with no initial value")}for(;t?l>=0:a>l;l+=h)l in r&&(o=i(o,r[l],l,s));return o}},vn={left:gn(!1),right:gn(!0)},yn=r,bn=function(t,e){var i=[][t];return!!i&&yn((function(){i.call(null,e||function(){return 1},1)}))},wn="process"==F(s.process),_n=vn.left,xn=dt,kn=wn;Ci({target:"Array",proto:!0,forced:!bn("reduce")||!kn&&xn>79&&xn<83},{reduce:function(t){var e=arguments.length;return _n(this,t,e,e>1?arguments[1]:void 0)}});var Dn=Zi("Array").reduce,Cn=it,Sn=Dn,Tn=Array.prototype,En=function(t){var e=t.reduce;return t===Tn||Cn(Tn,t)&&e===Tn.reduce?Sn:e},Mn=F,On=Array.isArray||function(t){return"Array"==Mn(t)},In={};In[ae("toStringTag")]="z";var An="[object z]"===String(In),Pn=s,Nn=An,Fn=b,Rn=F,Ln=ae("toStringTag"),jn=Pn.Object,Yn="Arguments"==Rn(function(){return arguments}()),Hn=Nn?Rn:function(t){var e,i,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=function(t,e){try{return t[e]}catch(t){}}(e=jn(t),Ln))?i:Yn?Rn(e):"Object"==(n=Rn(e))&&Fn(e.callee)?"Arguments":n},zn=b,Bn=jt,Wn=y(Function.toString);zn(Bn.inspectSource)||(Bn.inspectSource=function(t){return Wn(t)});var Gn=Bn.inspectSource,Vn=y,Un=r,$n=b,qn=Hn,Xn=Gn,Kn=function(){},Zn=[],Qn=et("Reflect","construct"),Jn=/^\s*(?:class|function)\b/,to=Vn(Jn.exec),eo=!Jn.exec(Kn),io=function(t){if(!$n(t))return!1;try{return Qn(Kn,Zn,t),!0}catch(t){return!1}},no=function(t){if(!$n(t))return!1;switch(qn(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return eo||!!to(Jn,Xn(t))}catch(t){return!0}};no.sham=!0;var oo=!Qn||Un((function(){var t;return io(io.call)||!io(Object)||!io((function(){t=!0}))||t}))?no:io,so=s,ro=On,ao=oo,lo=X,ho=ae("species"),co=so.Array,uo=function(t){var e;return ro(t)&&(e=t.constructor,(ao(e)&&(e===co||ro(e.prototype))||lo(e)&&null===(e=e[ho]))&&(e=void 0)),void 0===e?co:e},po=function(t,e){return new(uo(t))(0===e?0:e)},mo=Ue,fo=z,go=Bt,vo=dn,yo=po,bo=y([].push),wo=function(t){var e=1==t,i=2==t,n=3==t,o=4==t,s=6==t,r=7==t,a=5==t||s;return function(l,h,d,c){for(var u,p,m=go(l),f=fo(m),g=mo(h,d),v=vo(f),y=0,b=c||yo,w=e?b(l,v):i||r?b(l,0):void 0;v>y;y++)if((a||y in f)&&(p=g(u=f[y],y,m),t))if(e)w[y]=p;else if(p)switch(t){case 3:return!0;case 5:return u;case 6:return y;case 2:bo(w,u)}else switch(t){case 4:return!1;case 7:bo(w,u)}return s?-1:n||o?o:w}},_o={forEach:wo(0),map:wo(1),filter:wo(2),some:wo(3),every:wo(4),find:wo(5),findIndex:wo(6),filterReject:wo(7)},xo=r,ko=dt,Do=ae("species"),Co=function(t){return ko>=51||!xo((function(){var e=[];return(e.constructor={})[Do]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},So=_o.filter;Ci({target:"Array",proto:!0,forced:!Co("filter")},{filter:function(t){return So(this,t,arguments.length>1?arguments[1]:void 0)}});var To=Zi("Array").filter,Eo=it,Mo=To,Oo=Array.prototype,Io=function(t){var e=t.filter;return t===Oo||Eo(Oo,t)&&e===Oo.filter?Mo:e},Ao=_o.map;Ci({target:"Array",proto:!0,forced:!Co("map")},{map:function(t){return Ao(this,t,arguments.length>1?arguments[1]:void 0)}});var Po=Zi("Array").map,No=it,Fo=Po,Ro=Array.prototype,Lo=function(t){var e=t.map;return t===Ro||No(Ro,t)&&e===Ro.map?Fo:e},jo=On,Yo=dn,Ho=Ue,zo=s.TypeError,Bo=function(t,e,i,n,o,s,r,a){for(var l,h,d=o,c=0,u=!!r&&Ho(r,a);c0&&jo(l))h=Yo(l),d=Bo(t,e,l,h,d,s-1)-1;else{if(d>=9007199254740991)throw zo("Exceed the acceptable array length");t[d]=l}d++}c++}return d},Wo=Bo,Go=St,Vo=Bt,Uo=dn,$o=po;Ci({target:"Array",proto:!0},{flatMap:function(t){var e,i=Vo(this),n=Uo(i);return Go(t),(e=$o(i,0)).length=Wo(e,i,i,n,0,1,t,arguments.length>1?arguments[1]:void 0),e}});var qo,Xo,Ko,Zo=Zi("Array").flatMap,Qo=it,Jo=Zo,ts=Array.prototype,es=function(t){var e=t.flatMap;return t===ts||Qo(ts,t)&&e===ts.flatMap?Jo:e},is=function(){function t(i,n,o){var s,r,a;e(this,t),Fi(this,"_source",void 0),Fi(this,"_transformers",void 0),Fi(this,"_target",void 0),Fi(this,"_listeners",{add:nn(s=this._add).call(s,this),remove:nn(r=this._remove).call(r,this),update:nn(a=this._update).call(a,this)}),this._source=i,this._transformers=n,this._target=o}return Ni(t,[{key:"all",value:function(){return this._target.update(this._transformItems(this._source.get())),this}},{key:"start",value:function(){return this._source.on("add",this._listeners.add),this._source.on("remove",this._listeners.remove),this._source.on("update",this._listeners.update),this}},{key:"stop",value:function(){return this._source.off("add",this._listeners.add),this._source.off("remove",this._listeners.remove),this._source.off("update",this._listeners.update),this}},{key:"_transformItems",value:function(t){var e;return En(e=this._transformers).call(e,(function(t,e){return e(t)}),t)}},{key:"_add",value:function(t,e){null!=e&&this._target.add(this._transformItems(this._source.get(e.items)))}},{key:"_update",value:function(t,e){null!=e&&this._target.update(this._transformItems(this._source.get(e.items)))}},{key:"_remove",value:function(t,e){null!=e&&this._target.remove(this._transformItems(e.oldData))}}]),t}(),ns=function(){function t(i){e(this,t),Fi(this,"_source",void 0),Fi(this,"_transformers",[]),this._source=i}return Ni(t,[{key:"filter",value:function(t){return this._transformers.push((function(e){return Io(e).call(e,t)})),this}},{key:"map",value:function(t){return this._transformers.push((function(e){return Lo(e).call(e,t)})),this}},{key:"flatMap",value:function(t){return this._transformers.push((function(e){return es(e).call(e,t)})),this}},{key:"to",value:function(t){return new is(this._source,this._transformers,t)}}]),t}(),os=Hn,ss=s.String,rs=function(t){if("Symbol"===os(t))throw TypeError("Cannot convert a Symbol value to a string");return ss(t)},as=y,ls=rn,hs=rs,ds=G,cs=as("".charAt),us=as("".charCodeAt),ps=as("".slice),ms=function(t){return function(e,i){var n,o,s=hs(ds(e)),r=ls(i),a=s.length;return r<0||r>=a?t?"":void 0:(n=us(s,r))<55296||n>56319||r+1===a||(o=us(s,r+1))<56320||o>57343?t?cs(s,r):n:t?ps(s,r,r+2):o-56320+(n-55296<<10)+65536}},fs={codeAt:ms(!1),charAt:ms(!0)},gs=b,vs=Gn,ys=s.WeakMap,bs=gs(ys)&&/native code/.test(vs(ys)),ws=Pt.exports,_s=Kt,xs=ws("keys"),ks=function(t){return xs[t]||(xs[t]=_s(t))},Ds={},Cs=bs,Ss=s,Ts=y,Es=X,Ms=pi,Os=Vt,Is=jt,As=ks,Ps=Ds,Ns="Object already initialized",Fs=Ss.TypeError,Rs=Ss.WeakMap;if(Cs||Is.state){var Ls=Is.state||(Is.state=new Rs),js=Ts(Ls.get),Ys=Ts(Ls.has),Hs=Ts(Ls.set);qo=function(t,e){if(Ys(Ls,t))throw new Fs(Ns);return e.facade=t,Hs(Ls,t,e),e},Xo=function(t){return js(Ls,t)||{}},Ko=function(t){return Ys(Ls,t)}}else{var zs=As("state");Ps[zs]=!0,qo=function(t,e){if(Os(t,zs))throw new Fs(Ns);return e.facade=t,Ms(t,zs,e),e},Xo=function(t){return Os(t,zs)?t[zs]:{}},Ko=function(t){return Os(t,zs)}}var Bs={set:qo,get:Xo,has:Ko,enforce:function(t){return Ko(t)?Xo(t):qo(t,{})},getterFor:function(t){return function(e){var i;if(!Es(e)||(i=Xo(e)).type!==t)throw Fs("Incompatible receiver, "+t+" required");return i}}},Ws=_,Gs=Vt,Vs=Function.prototype,Us=Ws&&Object.getOwnPropertyDescriptor,$s=Gs(Vs,"name"),qs={EXISTS:$s,PROPER:$s&&"something"===function(){}.name,CONFIGURABLE:$s&&(!Ws||Ws&&Us(Vs,"name").configurable)},Xs={},Ks=rn,Zs=Math.max,Qs=Math.min,Js=function(t,e){var i=Ks(t);return i<0?Zs(i+e,0):Qs(i,e)},tr=$,er=Js,ir=dn,nr=function(t){return function(e,i,n){var o,s=tr(e),r=ir(s),a=er(n,r);if(t&&i!=i){for(;r>a;)if((o=s[a++])!=o)return!0}else for(;r>a;a++)if((t||a in s)&&s[a]===i)return t||a||0;return!t&&-1}},or={includes:nr(!0),indexOf:nr(!1)},sr=Vt,rr=$,ar=or.indexOf,lr=Ds,hr=y([].push),dr=function(t,e){var i,n=rr(t),o=0,s=[];for(i in n)!sr(lr,i)&&sr(n,i)&&hr(s,i);for(;e.length>o;)sr(n,i=e[o++])&&(~ar(s,i)||hr(s,i));return s},cr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ur=dr,pr=cr,mr=Object.keys||function(t){return ur(t,pr)},fr=_,gr=qe,vr=$e,yr=Je,br=$,wr=mr;Xs.f=fr&&!gr?Object.defineProperties:function(t,e){yr(t);for(var i,n=br(e),o=wr(e),s=o.length,r=0;s>r;)vr.f(t,i=o[r++],n[i]);return t};var _r,xr=et("document","documentElement"),kr=Je,Dr=Xs,Cr=cr,Sr=Ds,Tr=xr,Er=xe,Mr=ks("IE_PROTO"),Or=function(){},Ir=function(t){return"