From d58d3345d7fb38916d2a7b80be6541ca4091f2d6 Mon Sep 17 00:00:00 2001 From: Marco Kreeft Date: Mon, 16 Sep 2024 17:02:35 +0200 Subject: [PATCH] Correct nationality of Colapinto (#372) --- formulaone-card.js | 2 +- formulaone-card.js.gz | Bin 32792 -> 32847 bytes package.json | 2 +- src/utils.ts | 8 ++++++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/formulaone-card.js b/formulaone-card.js index 2daa9f2..bf11888 100644 --- a/formulaone-card.js +++ b/formulaone-card.js @@ -1,2 +1,2 @@ /*! For license information please see formulaone-card.js.LICENSE.txt */ -(()=>{"use strict";var t={898:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0});const n=i(313),r=i(11),o=i(194),s=i(382);class a extends r.LitElement{constructor(){super(...arguments),this.controlRenderers={[o.FormControlType.Dropdown]:s.renderDropdown,[o.FormControlType.Radio]:s.renderRadio,[o.FormControlType.Checkboxes]:s.renderCheckboxes,[o.FormControlType.EntityDropdown]:s.renderDropdown,[o.FormControlType.Switch]:s.renderSwitch,[o.FormControlType.Textbox]:s.renderTextbox,[o.FormControlType.Filler]:s.renderFiller}}setConfig(t){this._config=t}set hass(t){this._hass=t}renderForm(t){return r.html`
${t.map((t=>{const e=t.cssClass?`form-row ${t.cssClass}`:"form-row";return t.hidden?"":r.html`
${t.controls.map((t=>this.renderControl(t)))}
`}))}
`}renderControl(t){const e=this.controlRenderers[t.type];if(!e)throw new Error(`Unsupported control type: ${t.type}`);return e(this,t)}_valueChanged(t){if(!this._config||!this._hass)return;const e=t.target,i=t.detail;if("HA-CHECKBOX"===e.tagName){const t=this._config[e.configValue].indexOf(e.value);e.checked&&t<0?this._config[e.configValue]=[...this._config[e.configValue],e.value]:!e.checked&&t>-1&&(this._config[e.configValue]=[...this._config[e.configValue].slice(0,t),...this._config[e.configValue].slice(t+1)])}else if(e.configValue)if(e.configValue.indexOf(".")>-1){const[t,i]=e.configValue.split(".");this._config={...this._config,[t]:{...this._config[t],[i]:e.checked}}}else this._config={...this._config,[e.configValue]:void 0===e.checked&&(null==i?void 0:i.value)?e.checked||i.value:e.value||e.checked};(0,n.fireEvent)(this,"config-changed",{config:this._config},{bubbles:!0,composed:!0}),this.requestUpdate("_config")}static get styles(){return r.css`.form-row{margin-bottom:10px}.form-control{display:flex;align-items:center}ha-switch{padding:16px 6px}.side-by-side{display:flex;flex-flow:row wrap}.side-by-side>label{width:100%}.side-by-side>.form-control{width:49%;padding:2px}ha-textfield{width:100%}`}}e.default=a},194:(t,e)=>{var i;Object.defineProperty(e,"__esModule",{value:!0}),e.FormControlType=void 0,function(t){t.Dropdown="dropdown",t.Checkbox="checkbox",t.Checkboxes="checkboxes",t.Radio="radio",t.Switch="switch",t.Textbox="textbox",t.Filler="filler",t.EntityDropdown="entity-dropdown"}(i||(e.FormControlType=i={}))},382:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.renderCheckboxes=e.renderRadio=e.renderDropdown=e.renderSwitch=e.renderTextbox=e.renderEntityDropdown=e.renderFiller=void 0;const n=i(11),r=i(429);e.renderFiller=()=>n.html`
`,e.renderEntityDropdown=(t,e)=>{var i;return n.html`
`},e.renderTextbox=(t,e)=>{var i;return n.html`
`},e.renderSwitch=(t,e)=>n.html`
`,e.renderDropdown=(t,e)=>{var i;const o=null!==(i=e.items)&&void 0!==i?i:(0,r.getEntitiesByDomain)(t._hass,e.domain);return n.html`
`},e.renderRadio=(t,e)=>n.html`
${e.items.map((i=>n.html``))}
`,e.renderCheckboxes=(t,e)=>n.html` ${e.items.map((i=>{var r;return n.html`
`}))}`},429:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getDropdownOptionsFromEnum=e.formatList=e.getEntitiesByDeviceClass=e.getEntitiesByDomain=void 0,e.getEntitiesByDomain=(t,i)=>Object.keys(t.states).filter((t=>t.substr(0,t.indexOf("."))===i)).map((i=>(0,e.formatList)(i,t))),e.getEntitiesByDeviceClass=(t,i,n)=>Object.keys(t.states).filter((e=>e.substr(0,e.indexOf("."))===i&&t.states[e].attributes.device_class===n)).map((i=>(0,e.formatList)(i,t))),e.formatList=(t,e)=>({label:e.states[t].attributes.friendly_name,value:t}),e.getDropdownOptionsFromEnum=t=>{const e=[];for(const[i,n]of Object.entries(t))e.push({value:n,label:i});return e}},313:(t,e,i)=>{i.r(e),i.d(e,{DEFAULT_DOMAIN_ICON:()=>J,DEFAULT_PANEL:()=>X,DEFAULT_VIEW_ENTITY_ID:()=>at,DOMAINS_HIDE_MORE_INFO:()=>et,DOMAINS_MORE_INFO_NO_HISTORY:()=>it,DOMAINS_TOGGLE:()=>rt,DOMAINS_WITH_CARD:()=>Z,DOMAINS_WITH_MORE_INFO:()=>tt,NumberFormat:()=>n,STATES_OFF:()=>nt,TimeFormat:()=>r,UNIT_C:()=>ot,UNIT_F:()=>st,applyThemesOnElement:()=>L,computeCardSize:()=>H,computeDomain:()=>j,computeEntity:()=>U,computeRTL:()=>V,computeRTLDirection:()=>G,computeStateDisplay:()=>K,computeStateDomain:()=>B,createThing:()=>ut,debounce:()=>ht,domainIcon:()=>pt,evaluateFilter:()=>ft,fireEvent:()=>lt,fixedIcons:()=>mt,formatDate:()=>d,formatDateMonth:()=>y,formatDateMonthYear:()=>g,formatDateNumeric:()=>h,formatDateShort:()=>p,formatDateTime:()=>C,formatDateTimeNumeric:()=>E,formatDateTimeWithSeconds:()=>S,formatDateWeekday:()=>l,formatDateYear:()=>$,formatNumber:()=>Y,formatTime:()=>x,formatTimeWeekday:()=>P,formatTimeWithSeconds:()=>k,forwardHaptic:()=>gt,getLovelace:()=>Et,handleAction:()=>bt,handleActionConfig:()=>$t,handleClick:()=>wt,hasAction:()=>Ct,hasConfigOrEntityChanged:()=>At,hasDoubleClick:()=>St,isNumericState:()=>q,navigate:()=>vt,numberFormatToLocale:()=>z,relativeTime:()=>M,round:()=>W,stateIcon:()=>Rt,timerTimeRemaining:()=>F,toggleEntity:()=>_t,turnOnOffEntities:()=>Tt,turnOnOffEntity:()=>yt});var n,r,o,s=function(){return s=Object.assign||function(t){for(var e,i=1,n=arguments.length;i0)return{value:Math.round(h),unit:"year"};var m=12*h+d.getMonth()-u.getMonth();if(Math.round(Math.abs(m))>0)return{value:Math.round(m),unit:"month"};var p=r/604800;return{value:Math.round(p),unit:"week"}}(t,i);return n?function(t){return new Intl.RelativeTimeFormat(t.language,{numeric:"auto"})}(e).format(r.value,r.unit):Intl.NumberFormat(e.language,{style:"unit",unit:r.unit,unitDisplay:"long"}).format(Math.abs(r.value))};function F(t){var e,i=3600*(e=t.attributes.remaining.split(":").map(Number))[0]+60*e[1]+e[2];if("active"===t.state){var n=(new Date).getTime(),r=new Date(t.last_changed).getTime();i=Math.max(i-(n-r)/1e3,0)}return i}function I(){return(I=Object.assign||function(t){for(var e=1;e-1?t.split(".")[1].length:0;i.minimumFractionDigits=n,i.maximumFractionDigits=n}return i},K=function(t,e,i,n){var r=void 0!==n?n:e.state;if("unknown"===r||"unavailable"===r)return t("state.default."+r);if(q(e)){if("monetary"===e.attributes.device_class)try{return Y(r,i,{style:"currency",currency:e.attributes.unit_of_measurement})}catch(t){}return Y(r,i)+(e.attributes.unit_of_measurement?" "+e.attributes.unit_of_measurement:"")}var o=B(e);if("input_datetime"===o){var s;if(void 0===n)return e.attributes.has_date&&e.attributes.has_time?(s=new Date(e.attributes.year,e.attributes.month-1,e.attributes.day,e.attributes.hour,e.attributes.minute),C(s,i)):e.attributes.has_date?(s=new Date(e.attributes.year,e.attributes.month-1,e.attributes.day),d(s,i)):e.attributes.has_time?((s=new Date).setHours(e.attributes.hour,e.attributes.minute),x(s,i)):e.state;try{var a=n.split(" ");if(2===a.length)return C(new Date(a.join("T")),i);if(1===a.length){if(n.includes("-"))return d(new Date(n+"T00:00"),i);if(n.includes(":")){var l=new Date;return x(new Date(l.toISOString().split("T")[0]+"T"+n),i)}}return n}catch(t){return n}}return"humidifier"===o&&"on"===r&&e.attributes.humidity?e.attributes.humidity+" %":"counter"===o||"number"===o||"input_number"===o?Y(r,i):e.attributes.device_class&&t("component."+o+".state."+e.attributes.device_class+"."+r)||t("component."+o+".state._."+r)||r},J="mdi:bookmark",X="lovelace",Z=["climate","cover","configurator","input_select","input_number","input_text","lock","media_player","scene","script","timer","vacuum","water_heater","weblink"],tt=["alarm_control_panel","automation","camera","climate","configurator","cover","fan","group","history_graph","input_datetime","light","lock","media_player","script","sun","updater","vacuum","water_heater","weather"],et=["input_number","input_select","input_text","scene","weblink"],it=["camera","configurator","history_graph","scene"],nt=["closed","locked","off"],rt=new Set(["fan","input_boolean","light","switch","group","automation"]),ot="°C",st="°F",at="group.default_view",lt=function(t,e,i,n){n=n||{},i=null==i?{}:i;var r=new Event(e,{bubbles:void 0===n.bubbles||n.bubbles,cancelable:Boolean(n.cancelable),composed:void 0===n.composed||n.composed});return r.detail=i,t.dispatchEvent(r),r},ct=new Set(["call-service","divider","section","weblink","cast","select"]),dt={alert:"toggle",automation:"toggle",climate:"climate",cover:"cover",fan:"toggle",group:"group",input_boolean:"toggle",input_number:"input-number",input_select:"input-select",input_text:"input-text",light:"toggle",lock:"lock",media_player:"media-player",remote:"toggle",scene:"scene",script:"script",sensor:"sensor",timer:"timer",switch:"toggle",vacuum:"toggle",water_heater:"climate",input_datetime:"input-datetime"},ut=function(t,e){void 0===e&&(e=!1);var i=function(t,e){return n("hui-error-card",{type:"error",error:t,config:e})},n=function(t,e){var n=window.document.createElement(t);try{if(!n.setConfig)return;n.setConfig(e)}catch(n){return console.error(t,n),i(n.message,e)}return n};if(!t||"object"!=typeof t||!e&&!t.type)return i("No type defined",t);var r=t.type;if(r&&r.startsWith("custom:"))r=r.substr(7);else if(e)if(ct.has(r))r="hui-"+r+"-row";else{if(!t.entity)return i("Invalid config given.",t);var o=t.entity.split(".",1)[0];r="hui-"+(dt[o]||"text")+"-entity-row"}else r="hui-"+r+"-card";if(customElements.get(r))return n(r,t);var s=i("Custom element doesn't exist: "+t.type+".",t);s.style.display="None";var a=setTimeout((function(){s.style.display=""}),2e3);return customElements.whenDefined(t.type).then((function(){clearTimeout(a),lt(s,"ll-rebuild",{},s)})),s},ht=function(t,e,i){var n;return void 0===i&&(i=!1),function(){var r=[].slice.call(arguments),o=this,s=i&&!n;clearTimeout(n),n=setTimeout((function(){n=null,i||t.apply(o,r)}),e),s&&t.apply(o,r)}},mt={alert:"mdi:alert",automation:"mdi:playlist-play",calendar:"mdi:calendar",camera:"mdi:video",climate:"mdi:thermostat",configurator:"mdi:settings",conversation:"mdi:text-to-speech",device_tracker:"mdi:account",fan:"mdi:fan",group:"mdi:google-circles-communities",history_graph:"mdi:chart-line",homeassistant:"mdi:home-assistant",homekit:"mdi:home-automation",image_processing:"mdi:image-filter-frames",input_boolean:"mdi:drawing",input_datetime:"mdi:calendar-clock",input_number:"mdi:ray-vertex",input_select:"mdi:format-list-bulleted",input_text:"mdi:textbox",light:"mdi:lightbulb",mailbox:"mdi:mailbox",notify:"mdi:comment-alert",person:"mdi:account",plant:"mdi:flower",proximity:"mdi:apple-safari",remote:"mdi:remote",scene:"mdi:google-pages",script:"mdi:file-document",sensor:"mdi:eye",simple_alarm:"mdi:bell",sun:"mdi:white-balance-sunny",switch:"mdi:flash",timer:"mdi:timer",updater:"mdi:cloud-upload",vacuum:"mdi:robot-vacuum",water_heater:"mdi:thermometer",weblink:"mdi:open-in-new"};function pt(t,e){if(t in mt)return mt[t];switch(t){case"alarm_control_panel":switch(e){case"armed_home":return"mdi:bell-plus";case"armed_night":return"mdi:bell-sleep";case"disarmed":return"mdi:bell-outline";case"triggered":return"mdi:bell-ring";default:return"mdi:bell"}case"binary_sensor":return e&&"off"===e?"mdi:radiobox-blank":"mdi:checkbox-marked-circle";case"cover":return"closed"===e?"mdi:window-closed":"mdi:window-open";case"lock":return e&&"unlocked"===e?"mdi:lock-open":"mdi:lock";case"media_player":return e&&"off"!==e&&"idle"!==e?"mdi:cast-connected":"mdi:cast";case"zwave":switch(e){case"dead":return"mdi:emoticon-dead";case"sleeping":return"mdi:sleep";case"initializing":return"mdi:timer-sand";default:return"mdi:z-wave"}default:return console.warn("Unable to find icon for domain "+t+" ("+e+")"),"mdi:bookmark"}}var ft=function(t,e){var i=e.value||e,n=e.attribute?t.attributes[e.attribute]:t.state;switch(e.operator||"=="){case"==":return n===i;case"<=":return n<=i;case"<":return n=":return n>=i;case">":return n>i;case"!=":return n!==i;case"regex":return n.match(i);default:return!1}},gt=function(t){lt(window,"haptic",t)},vt=function(t,e,i){void 0===i&&(i=!1),i?history.replaceState(null,"",e):history.pushState(null,"",e),lt(window,"location-changed",{replace:i})},yt=function(t,e,i){void 0===i&&(i=!0);var n,r=j(e),o="group"===r?"homeassistant":r;switch(r){case"lock":n=i?"unlock":"lock";break;case"cover":n=i?"open_cover":"close_cover";break;default:n=i?"turn_on":"turn_off"}return t.callService(o,n,{entity_id:e})},_t=function(t,e){var i=nt.includes(t.states[e].state);return yt(t,e,i)},$t=function(t,e,i,n){if(n||(n={action:"more-info"}),!n.confirmation||n.confirmation.exemptions&&n.confirmation.exemptions.some((function(t){return t.user===e.user.id}))||(gt("warning"),confirm(n.confirmation.text||"Are you sure you want to "+n.action+"?")))switch(n.action){case"more-info":(i.entity||i.camera_image)&<(t,"hass-more-info",{entityId:i.entity?i.entity:i.camera_image});break;case"navigate":n.navigation_path&&vt(0,n.navigation_path);break;case"url":n.url_path&&window.open(n.url_path);break;case"toggle":i.entity&&(_t(e,i.entity),gt("success"));break;case"call-service":if(!n.service)return void gt("failure");var r=n.service.split(".",2);e.callService(r[0],r[1],n.service_data,n.target),gt("success");break;case"fire-dom-event":lt(t,"ll-custom",n)}},bt=function(t,e,i,n){var r;"double_tap"===n&&i.double_tap_action?r=i.double_tap_action:"hold"===n&&i.hold_action?r=i.hold_action:"tap"===n&&i.tap_action&&(r=i.tap_action),$t(t,e,i,r)},wt=function(t,e,i,n,r){var o;if(r&&i.double_tap_action?o=i.double_tap_action:n&&i.hold_action?o=i.hold_action:!n&&i.tap_action&&(o=i.tap_action),o||(o={action:"more-info"}),!o.confirmation||o.confirmation.exemptions&&o.confirmation.exemptions.some((function(t){return t.user===e.user.id}))||confirm(o.confirmation.text||"Are you sure you want to "+o.action+"?"))switch(o.action){case"more-info":(o.entity||i.entity||i.camera_image)&&(lt(t,"hass-more-info",{entityId:o.entity?o.entity:i.entity?i.entity:i.camera_image}),o.haptic&>(o.haptic));break;case"navigate":o.navigation_path&&(vt(0,o.navigation_path),o.haptic&>(o.haptic));break;case"url":o.url_path&&window.open(o.url_path),o.haptic&>(o.haptic);break;case"toggle":i.entity&&(_t(e,i.entity),o.haptic&>(o.haptic));break;case"call-service":if(!o.service)return;var s=o.service.split(".",2),a=s[0],l=s[1],c=I({},o.service_data);"entity"===c.entity_id&&(c.entity_id=i.entity),e.callService(a,l,c,o.target),o.haptic&>(o.haptic);break;case"fire-dom-event":lt(t,"ll-custom",o),o.haptic&>(o.haptic)}};function Ct(t){return void 0!==t&&"none"!==t.action}function At(t,e,i){if(e.has("config")||i)return!0;if(t.config.entity){var n=e.get("hass");return!n||n.states[t.config.entity]!==t.hass.states[t.config.entity]}return!1}function St(t){return void 0!==t&&"none"!==t.action}var Tt=function(t,e,i){void 0===i&&(i=!0);var n={};e.forEach((function(e){if(nt.includes(t.states[e].state)===i){var r=j(e),o=["cover","lock"].includes(r)?r:"homeassistant";o in n||(n[o]=[]),n[o].push(e)}})),Object.keys(n).forEach((function(e){var r;switch(e){case"lock":r=i?"unlock":"lock";break;case"cover":r=i?"open_cover":"close_cover";break;default:r=i?"turn_on":"turn_off"}t.callService(e,r,{entity_id:n[e]})}))},Et=function(){var t=document.querySelector("home-assistant");if(t=(t=(t=(t=(t=(t=(t=(t=t&&t.shadowRoot)&&t.querySelector("home-assistant-main"))&&t.shadowRoot)&&t.querySelector("app-drawer-layout partial-panel-resolver"))&&t.shadowRoot||t)&&t.querySelector("ha-panel-lovelace"))&&t.shadowRoot)&&t.querySelector("hui-root")){var e=t.lovelace;return e.current_view=t.___curView,e}return null},Dt={humidity:"mdi:water-percent",illuminance:"mdi:brightness-5",temperature:"mdi:thermometer",pressure:"mdi:gauge",power:"mdi:flash",signal_strength:"mdi:wifi"},xt={binary_sensor:function(t,e){var i="off"===t;switch(null==e?void 0:e.attributes.device_class){case"battery":return i?"mdi:battery":"mdi:battery-outline";case"battery_charging":return i?"mdi:battery":"mdi:battery-charging";case"cold":return i?"mdi:thermometer":"mdi:snowflake";case"connectivity":return i?"mdi:server-network-off":"mdi:server-network";case"door":return i?"mdi:door-closed":"mdi:door-open";case"garage_door":return i?"mdi:garage":"mdi:garage-open";case"power":case"plug":return i?"mdi:power-plug-off":"mdi:power-plug";case"gas":case"problem":case"safety":case"tamper":return i?"mdi:check-circle":"mdi:alert-circle";case"smoke":return i?"mdi:check-circle":"mdi:smoke";case"heat":return i?"mdi:thermometer":"mdi:fire";case"light":return i?"mdi:brightness-5":"mdi:brightness-7";case"lock":return i?"mdi:lock":"mdi:lock-open";case"moisture":return i?"mdi:water-off":"mdi:water";case"motion":return i?"mdi:walk":"mdi:run";case"occupancy":case"presence":return i?"mdi:home-outline":"mdi:home";case"opening":return i?"mdi:square":"mdi:square-outline";case"running":return i?"mdi:stop":"mdi:play";case"sound":return i?"mdi:music-note-off":"mdi:music-note";case"update":return i?"mdi:package":"mdi:package-up";case"vibration":return i?"mdi:crop-portrait":"mdi:vibrate";case"window":return i?"mdi:window-closed":"mdi:window-open";default:return i?"mdi:radiobox-blank":"mdi:checkbox-marked-circle"}},cover:function(t){var e="closed"!==t.state;switch(t.attributes.device_class){case"garage":return e?"mdi:garage-open":"mdi:garage";case"door":return e?"mdi:door-open":"mdi:door-closed";case"shutter":return e?"mdi:window-shutter-open":"mdi:window-shutter";case"blind":return e?"mdi:blinds-open":"mdi:blinds";case"window":return e?"mdi:window-open":"mdi:window-closed";default:return pt("cover",t.state)}},sensor:function(t){var e=t.attributes.device_class;if(e&&e in Dt)return Dt[e];if("battery"===e){var i=Number(t.state);if(isNaN(i))return"mdi:battery-unknown";var n=10*Math.round(i/10);return n>=100?"mdi:battery":n<=0?"mdi:battery-alert":"hass:battery-"+n}var r=t.attributes.unit_of_measurement;return"°C"===r||"°F"===r?"mdi:thermometer":pt("sensor")},input_datetime:function(t){return t.attributes.has_date?t.attributes.has_time?pt("input_datetime"):"mdi:calendar":"mdi:clock"}},Rt=function(t){if(!t)return"mdi:bookmark";if(t.attributes.icon)return t.attributes.icon;var e=j(t.entity_id);return e in xt?xt[e](t):pt(e,t.state)}},694:function(t,e){var i=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}l((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.ClientBase=void 0,e.ClientBase=class{GetData(t,e,n){return i(this,void 0,void 0,(function*(){const i=localStorage.getItem(t);if(i&&e){const t=JSON.parse(i),e=new Date;if(e.setHours(e.getHours()-n),new Date(t.created)>e)return JSON.parse(t.data)}const r=yield fetch(`${this.baseUrl}/${t}`,{headers:{Accept:"application/json"}});if(!r||!r.ok)return Promise.reject(r);const o=yield r.json(),s={data:JSON.stringify(o),created:new Date};return e&&localStorage.setItem(t,JSON.stringify(s)),o}))}}},470:function(t,e,i){var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}l((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const r=i(438),o=i(694);class s extends o.ClientBase{constructor(){super(...arguments),this.baseUrl="https://api.jolpi.ca/ergast/f1"}GetSchedule(t){return n(this,void 0,void 0,(function*(){return(yield this.GetData(`${t}.json`,!0,72)).MRData.RaceTable.Races}))}GetLastResult(){return n(this,void 0,void 0,(function*(){const t=(0,r.getRefreshTime)("current/last/results.json");return(yield this.GetData("current/last/results.json",!0,t)).MRData.RaceTable.Races[0]}))}GetDriverStandings(){return n(this,void 0,void 0,(function*(){const t=(0,r.getRefreshTime)("current/driverStandings.json");return(yield this.GetData("current/driverStandings.json",!0,t)).MRData.StandingsTable.StandingsLists[0].DriverStandings}))}GetConstructorStandings(){return n(this,void 0,void 0,(function*(){const t=(0,r.getRefreshTime)("current/constructorStandings.json");return(yield this.GetData("current/constructorStandings.json",!0,t)).MRData.StandingsTable.StandingsLists[0].ConstructorStandings}))}GetSprintResults(t,e){return n(this,void 0,void 0,(function*(){return(yield this.GetData(`${t}/${e}/sprint.json`,!1,0)).MRData.RaceTable}))}GetQualifyingResults(t,e){return n(this,void 0,void 0,(function*(){return(yield this.GetData(`${t}/${e}/qualifying.json`,!1,0)).MRData.RaceTable}))}GetResults(t,e){return n(this,void 0,void 0,(function*(){return(yield this.GetData(`${t}/${e}/results.json`,!1,0)).MRData.RaceTable}))}GetSeasons(){return n(this,void 0,void 0,(function*(){return(yield this.GetData("seasons.json?limit=200",!0,72)).MRData.SeasonTable.Seasons}))}GetSeasonRaces(t){return n(this,void 0,void 0,(function*(){return(yield this.GetData(`${t}.json`,!0,72)).MRData.RaceTable.Races}))}GetLastYearsResults(t){return n(this,void 0,void 0,(function*(){const e=(new Date).getFullYear()-1,i=(yield this.GetData(`${e}.json`,!0,72)).MRData.RaceTable.Races.findIndex((e=>e.Circuit.circuitName===t))+1;return(yield this.GetData(`${e}/${i}/results.json`,!1,0)).MRData.RaceTable.Races[0]}))}RefreshCache(){return n(this,void 0,void 0,(function*(){yield this.GetData("current.json",!0,0),yield this.GetData("current/last/results.json",!0,0),yield this.GetData("current/driverStandings.json",!0,0),yield this.GetData("current/constructorStandings.json",!0,0)}))}}e.default=s},661:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=class{GetImage(t){const e=localStorage.getItem(t);if(e){const t=JSON.parse(e),i=new Date;if(i.setHours(i.getHours()-672),new Date(t.created)>i)return t.data}return fetch(t).then((t=>t.blob())).then((e=>{const i=new FileReader;i.readAsDataURL(e),i.onloadend=function(){const e={data:i.result,created:new Date};return localStorage.setItem(t,JSON.stringify(e)),e.data}})),t}}},959:function(t,e,i){var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}l((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const r=i(694);class o extends r.ClientBase{constructor(){super(...arguments),this.baseUrl="https://restcountries.com/v2"}GetAll(){return n(this,void 0,void 0,(function*(){return yield this.GetData("all",!0,730)}))}GetCountriesFromLocalStorage(){const t=localStorage.getItem("all");if(t){const e=JSON.parse(t);return JSON.parse(e.data)}return[]}}e.default=o},267:function(t,e,i){var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}l((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const r=i(694);class o extends r.ClientBase{constructor(t,e){super(),this.unitGroup="metric",this.baseUrl="https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline",this.apiKey=t,this.unitGroup=null!=e?e:this.unitGroup}getWeatherData(t,e,i){return n(this,void 0,void 0,(function*(){const n=`${t},${e}/${i}?unitGroup=${this.unitGroup}&key=${this.apiKey}&contentType=json`;return yield this.GetData(n,!0,1)}))}}e.default=o},366:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BaseCard=void 0;const n=i(470),r=i(661),o=i(267);e.BaseCard=class{constructor(t){var e,i;this.config=t.config,this.client=new n.default,this.hass=t._hass,this.parent=t,this.weatherClient=new o.default(null!==(i=null===(e=this.config.weather_options)||void 0===e?void 0:e.api_key)&&void 0!==i?i:""),this.imageClient=new r.default}translation(t){return!this.config.translations||Object.keys(this.config.translations).indexOf(t)<0?this.defaultTranslations[t]:this.config.translations[t]}getProperties(){var t,e;const i=null===(t=this.parent.properties)||void 0===t?void 0:t.get("cardValues");return{races:null==i?void 0:i.races,selectedRace:null==i?void 0:i.selectedRace,selectedSeason:null==i?void 0:i.selectedSeason,selectedTabIndex:null!==(e=null==i?void 0:i.selectedTabIndex)&&void 0!==e?e:0}}getParentCardValues(){var t,e;const i=null!==(t=this.parent.properties)&&void 0!==t?t:new Map;return{properties:null!==(e=i.get("cardValues"))&&void 0!==e?e:{},cardValues:i}}}},169:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0});const n=i(639),r=i(557),o=i(438),s=i(366);class a extends s.BaseCard{constructor(t){super(t),this.defaultTranslations={constructor:"Constructor",points:"Pts",wins:"Wins"}}cardSize(){return 11}renderStandingRow(t){var e;return n.html`${t.position}${(null===(e=this.config.standings)||void 0===e?void 0:e.show_teamlogo)?n.html` `:""}${t.Constructor.name}${t.points}${t.wins}`}render(){return n.html`${(0,r.until)(this.client.GetConstructorStandings().then((t=>n.html`${(0,o.reduceArray)(t,this.config.row_limit).map((t=>this.renderStandingRow(t)))}
 ${this.translation("constructor")}${this.translation("points")}${this.translation("wins")}
`)).catch((()=>n.html`${(0,o.getApiErrorMessage)("standings")}`)),n.html`${(0,o.getApiLoadingMessage)()}`)}`}}e.default=a},849:function(t,e,i){var n=this&&this.__await||function(t){return this instanceof n?(this.v=t,this):new n(t)},r=this&&this.__asyncGenerator||function(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=i.apply(t,e||[]),s=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){o[t]&&(r[t]=function(e){return new Promise((function(i,n){s.push([t,e,i,n])>1||l(t,e)}))})}function l(t,e){try{(i=o[t](e)).value instanceof n?Promise.resolve(i.value.v).then(c,d):u(s[0][2],i)}catch(t){u(s[0][3],t)}var i}function c(t){l("next",t)}function d(t){l("throw",t)}function u(t,e){t(e),s.shift(),s.length&&l(s[0][0],s[0][1])}};Object.defineProperty(e,"__esModule",{value:!0});const o=i(639),s=i(557),a=i(438),l=i(366),c=i(810),d=i(313),u=i(22),h=i(241);class m extends l.BaseCard{constructor(t){var e;super(t),this.defaultTranslations={days:"d",hours:"h",minutes:"m",seconds:"s",endofseason:"Season is over. See you next year!",racenow:"We are racing!",date:"Date",practice1:"Practice 1",practice2:"Practice 2",practice3:"Practice 3",race:"Race",racename:"Race name",circuitname:"Circuit name",location:"Location",city:"City",racetime:"Race",sprint:"Sprint",qualifying:"Qualifying",until:"Until"},this.config.countdown_type=null!==(e=this.config.countdown_type)&&void 0!==e?e:h.CountdownType.Race}cardSize(){return this.config.show_raceinfo?12:6}renderHeader(t,e){return this.config.show_raceinfo?o.html`${(0,a.renderRaceInfo)(this,t,e)}
${(0,a.renderHeader)(this,t,!0)}
`:null}countDownTillDate(t){return r(this,arguments,(function*(){for(;t>new Date;){const e=(new Date).getTime(),i=t.getTime()-e,r=Math.floor(i/864e5),o=Math.floor(i%864e5/36e5),s=Math.floor(i%36e5/6e4),a=Math.floor(i%6e4/1e3);yield yield n(`${r}${this.translation("days")} ${o}${this.translation("hours")} ${s}${this.translation("minutes")} ${a}${this.translation("seconds")} `),yield n(new Promise((t=>setTimeout(t,1e3))))}yield yield n(this.translation("racenow"))}))}render(){const t=t=>{this.hass&&this.config.actions&&t.detail.action&&(0,a.clickHandler)(this.parent,this.config,this.hass,t)};return o.html`${(0,s.until)(this.client.GetSchedule((new Date).getFullYear()).then((e=>{var i,n;const{nextRace:r,raceDateTime:s,countdownType:l}=this.getNextEvent(e);if(!r)return(0,a.getEndOfSeasonMessage)(this.translation("endofseason"));const h=this.countDownTillDate(s),m=void 0!==this.config.actions;return o.html`${Array.isArray(this.config.countdown_type)&&this.config.countdown_type.length>1?o.html``:null}

   ${r.round} : ${r.raceName}

${(0,c.asyncReplace)(h)}

${this.translation("until")} ${this.translation(l.toLowerCase())}

${this.renderHeader(r,s)}`})).catch((()=>o.html`${(0,a.getApiErrorMessage)("next race")}`)),o.html`${(0,a.getApiLoadingMessage)()}`)}`}getNextEvent(t){var e;const i=t.filter((t=>{const e=new Date(t.date+"T"+t.time);return e.setHours(e.getHours()+3),e>=new Date}))[0];let n=null,r=this.config.countdown_type;if(i){const t=this.config.countdown_type,o=[{Date:new Date(i.FirstPractice.date+"T"+i.FirstPractice.time),Type:h.CountdownType.Practice1},{Date:new Date(i.SecondPractice.date+"T"+i.SecondPractice.time),Type:h.CountdownType.Practice2},{Date:i.ThirdPractice?new Date(i.ThirdPractice.date+"T"+i.ThirdPractice.time):null,Type:h.CountdownType.Practice3},{Date:i.Sprint?new Date(i.Sprint.date+"T"+i.Sprint.time):null,Type:h.CountdownType.Sprint},{Date:new Date(i.Qualifying.date+"T"+i.Qualifying.time),Type:h.CountdownType.Qualifying},{Date:new Date(i.date+"T"+i.time),Type:h.CountdownType.Race}].filter((t=>t.Date)).filter((t=>t.Date>new Date)).sort(((t,e)=>t.Date.getTime()-e.Date.getTime())).filter((e=>null==t?void 0:t.includes(e.Type)))[0];n=null==o?void 0:o.Date,r=null!==(e=null==o?void 0:o.Type)&&void 0!==e?e:r}return{nextRace:i,raceDateTime:n,countdownType:r}}}e.default=m},138:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0});const n=i(639),r=i(557),o=i(438),s=i(366);class a extends s.BaseCard{constructor(t){super(t),this.defaultTranslations={driver:"Driver",team:"Team",points:"Pts",wins:"Wins"}}cardSize(){return 12}renderStandingRow(t){var e,i;return n.html`${t.position}${(null===(e=this.config.standings)||void 0===e?void 0:e.show_flag)?n.html` `:""}${t.Driver.code}${(0,o.getDriverName)(t.Driver,this.config)}${(null===(i=this.config.standings)||void 0===i?void 0:i.show_team)?n.html`${(0,o.renderConstructorColumn)(this,t.Constructors[0])}`:""}${t.points}${t.wins}`}render(){return n.html`${(0,r.until)(this.client.GetDriverStandings().then((t=>{var e;return n.html`${(null===(e=this.config.standings)||void 0===e?void 0:e.show_team)?n.html``:""}${(0,o.reduceArray)(t,this.config.row_limit).map((t=>this.renderStandingRow(t)))}
 ${this.translation("driver")}${this.translation("team")}${this.translation("points")}${this.translation("wins")}
`})).catch((()=>n.html`${(0,o.getApiErrorMessage)("standings")}`)),n.html`${(0,o.getApiLoadingMessage)()}`)}`}}e.default=a},507:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0});const n=i(639),r=i(557),o=i(438),s=i(366);class a extends s.BaseCard{constructor(t){super(t),this.defaultTranslations={driver:"Driver",grid:"Grid",points:"Points",status:"Status"}}cardSize(){return 11}renderResultRow(t){return n.html`${t.position}${(0,o.getDriverName)(t.Driver,this.config)}${t.grid}${t.points}${t.status}`}render(){return n.html`${(0,r.until)(this.client.GetLastResult().then((t=>n.html`
${(0,o.renderHeader)(this,t)}
${(0,o.reduceArray)(t.Results,this.config.row_limit).map((t=>this.renderResultRow(t)))}
 ${this.translation("driver")}${this.translation("grid")}${this.translation("points")}${this.translation("status")}
`)).catch((()=>n.html`${(0,o.getApiErrorMessage)("last result")}`)),n.html`${(0,o.getApiLoadingMessage)()}`)}`}}e.default=a},840:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0});const n=i(639),r=i(557),o=i(438),s=i(366),a=i(300);class l extends s.BaseCard{constructor(){super(...arguments),this.defaultTranslations={date:"Date",practice1:"Practice 1",practice2:"Practice 2",practice3:"Practice 3",race:"Race",racename:"Race name",circuitname:"Circuit name",location:"Location",city:"City",racetime:"Race",sprint:"Sprint",qualifying:"Qualifying",endofseason:"Season is over. See you next year!"}}cardSize(){return 8}render(){return n.html`${(0,r.until)(this.client.GetSchedule((new Date).getFullYear()).then((t=>{const e=this.config.next_race_delay||0,i=t.filter((t=>{const i=new Date(t.date+"T"+t.time);return i.setHours(i.getHours()+e),i>=new Date}))[0];return i?n.html`${this.config.show_raceinfo?(0,o.renderRaceInfo)(this,i):this.config.only_show_date?n.html``:null}
${(0,o.renderHeader)(this,i)}

${(0,a.formatDateNumeric)(new Date(i.date+"T"+i.time),this.hass.locale,this.config.date_locale)}

`:(0,o.getEndOfSeasonMessage)(this.translation("endofseason"))})).catch((()=>n.html`${(0,o.getApiErrorMessage)("next race")}`)),n.html`${(0,o.getApiLoadingMessage)()}`)}`}}e.default=l},74:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0});const n=i(639),r=i(557),o=i(438),s=i(366);class a extends s.BaseCard{constructor(t){super(t),this.defaultTranslations={driver:"Driver",grid:"Grid",team:"Team",points:"Points",status:"Status",raceheader:"Race",seasonheader:"Season",selectseason:"Select season",selectrace:"Select race",noresults:"Please select a race thats already been run.",q1:"Q1",q2:"Q2",q3:"Q3"},this.icons={sprint:"mdi:flag-checkered",qualifying:"mdi:timer-outline",results:"mdi:trophy"},this.renderTabsHtml=(t,e,i)=>i?n.html`${t.filter((t=>t.content)).length>0?n.html``:n.html``}
${this.renderHeader(i)}
${t.filter((t=>!t.hide)).map((t=>n.html``))}
${t.filter((t=>!t.hide)).find(((t,i)=>i==e)).content}
${this.translation("noresults")}
`:n.html``}cardSize(){return 12}renderTabs(t){return[{title:"Results",icon:this.icon("results"),content:this.renderResults(t),order:this.tabOrder("results")},{title:"Qualifying",icon:this.icon("qualifying"),content:this.renderQualifying(t),order:this.tabOrder("qualifying")},{title:"Sprint",icon:this.icon("sprint"),content:this.renderSprint(t),hide:!(null==t?void 0:t.SprintResults),order:this.tabOrder("sprint")}].sort(((t,e)=>t.order-e.order))}renderSprint(t){var e;return(null==t?void 0:t.SprintResults)?n.html`${(null===(e=this.config.standings)||void 0===e?void 0:e.show_team)?n.html``:""}${(0,o.reduceArray)(t.SprintResults,this.config.row_limit).map((t=>this.renderResultRow(t,!1)))}
 ${this.translation("driver")}${this.translation("team")}${this.translation("grid")}${this.translation("points")}${this.translation("status")}
`:null}renderQualifying(t){var e;return(null==t?void 0:t.QualifyingResults)?n.html`${(null===(e=this.config.standings)||void 0===e?void 0:e.show_team)?n.html``:""}${(0,o.reduceArray)(t.QualifyingResults,this.config.row_limit).map((t=>this.renderQualifyingResultRow(t)))}
 ${this.translation("driver")}${this.translation("team")}${this.translation("q1")}${this.translation("q2")}${this.translation("q3")}
`:null}renderResults(t){var e,i;const r=null===(e=null==t?void 0:t.Results)||void 0===e?void 0:e.filter((t=>{var e;return"1"===(null===(e=t.FastestLap)||void 0===e?void 0:e.rank)}))[0];return(null==t?void 0:t.Results)?n.html`${(null===(i=this.config.standings)||void 0===i?void 0:i.show_team)?n.html``:""}${(0,o.reduceArray)(t.Results,this.config.row_limit).map((t=>this.renderResultRow(t,t.position===(null==r?void 0:r.position))))}${r?n.html``:""}
 ${this.translation("driver")}${this.translation("team")}${this.translation("grid")}${this.translation("points")}${this.translation("status")}
* Fastest lap: ${r.FastestLap.Time.time}
`:null}renderResultRow(t,e){var i,r;return n.html`${t.position}${(null===(i=this.config.standings)||void 0===i?void 0:i.show_flag)?n.html` `:""}${(0,o.getDriverName)(t.Driver,this.config)}${e?" *":""}${(null===(r=this.config.standings)||void 0===r?void 0:r.show_team)?n.html`${(0,o.renderConstructorColumn)(this,t.Constructor)}`:""}${t.grid}${t.points}${t.status}`}renderQualifyingResultRow(t){var e,i;return n.html`${t.position}${(null===(e=this.config.standings)||void 0===e?void 0:e.show_flag)?n.html` `:""}${(0,o.getDriverName)(t.Driver,this.config)}${(null===(i=this.config.standings)||void 0===i?void 0:i.show_team)?n.html`${(0,o.renderConstructorColumn)(this,t.Constructor)}`:""}${t.Q1}${t.Q2}${t.Q3}`}renderHeader(t){return null==t||parseInt(t.season)<2018?null:(0,o.renderHeader)(this,t)}render(){const{races:t,selectedRace:e,selectedSeason:i,selectedTabIndex:s}=this.getProperties();void 0===i&&this.getLastResult();const a=t=>{this.setRaces(t)},l=this.renderTabs(e);return n.html`
${this.translation("seasonheader")}
${(0,r.until)(this.client.GetSeasons().then((t=>{const e=t.reverse();return n.html``})).catch((()=>n.html`${(0,o.getApiErrorMessage)("seasons")}`)),n.html`${(0,o.getApiLoadingMessage)()}`)}
${this.translation("raceheader")}
${this.renderTabsHtml(l,s,e)}`}setSelectedRace(t){const e=parseInt(t.target.value),{properties:i,cardValues:n}=this.getParentCardValues();i.selectedRound=e;const r=i.selectedSeason;Promise.all([this.client.GetResults(r,e),this.client.GetQualifyingResults(r,e),this.client.GetSprintResults(r,e),this.client.GetSchedule(r)]).then((([t,r,o,s])=>{var a;let l=t.Races[0];l?(l.QualifyingResults=r.Races[0].QualifyingResults,l.SprintResults=null===(a=null==o?void 0:o.Races[0])||void 0===a?void 0:a.SprintResults,i.selectedSeason=l.season):l=s.filter((t=>parseInt(t.round)==e))[0],i.selectedRace=l,n.set("cardValues",i),this.parent.properties=n}))}setRaces(t){const e=t.target.value,{properties:i,cardValues:n}=this.getParentCardValues();this.client.GetSeasonRaces(parseInt(e)).then((t=>{i.selectedSeason=e,i.selectedRace=void 0,i.races=t,n.set("cardValues",i),this.parent.properties=n}))}getUpcomingRace(t,e){const i=e.filter((e=>{const i=new Date(e.date+"T"+e.time),n=new Date(e.Qualifying.date+"T"+e.Qualifying.time),r=e.Sprint?new Date(e.Sprint.date+"T"+e.Sprint.time):null;return i>=t&&n0?i[0]:null}getLastResult(){const t=new Date;Promise.all([this.client.GetSchedule(t.getFullYear()),this.client.GetLastResult()]).then((([e,i])=>{const n=this.getUpcomingRace(t,e);let r=(new Date).getFullYear(),o=null!==n?parseInt(n.round):0,s={};null!==n?(s=n,o=parseInt(s.round),r=parseInt(s.season)):(s=i,o=parseInt(i.round),r=parseInt(i.season)),Promise.all([this.client.GetQualifyingResults(r,o),this.client.GetSprintResults(r,o),this.client.GetSeasonRaces(r)]).then((([t,e,i])=>{var n;const{properties:o,cardValues:a}=this.getParentCardValues();s.QualifyingResults=t.Races[0].QualifyingResults,s.SprintResults=null===(n=e.Races[0])||void 0===n?void 0:n.SprintResults,o.races=i,o.selectedRace=s,o.selectedSeason=r.toString(),a.set("cardValues",o),this.parent.properties=a}))}))}setSelectedTabIndex(t){const{properties:e,cardValues:i}=this.getParentCardValues();e.selectedTabIndex=t,i.set("cardValues",e),this.parent.properties=i}icon(t){return!this.config.icons||Object.keys(this.config.icons).indexOf(t)<0?this.icons[t]:this.config.icons[t]}tabOrder(t){var e,i;const n=null!==(i=null===(e=this.config.tabs_order)||void 0===e?void 0:e.map((t=>t.toLowerCase())))&&void 0!==i?i:["results","qualifying","sprint"];return n.indexOf(t)}}e.default=a},465:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0});const n=i(313),r=i(639),o=i(557),s=i(300),a=i(241),l=i(438),c=i(366);class d extends c.BaseCard{constructor(t){super(t),this.defaultTranslations={date:"Date",race:"Race",time:"Time",location:"Location",endofseason:"Season is over. See you next year!"}}cardSize(){return 12}renderLocation(t){var e;const i=r.html`${(null===(e=this.config.standings)||void 0===e?void 0:e.show_flag)?r.html` `:""}${t.Location.locality}, ${t.Location.country}`;return this.config.location_clickable?r.html`${i}`:i}renderScheduleRow(t){const e=new Date(t.date+"T"+t.time),i=this.config.previous_race&&e${t.round}${t.Circuit.circuitName}${this.renderLocation(t.Circuit)}${(0,s.formatDate)(e,this.hass.locale,this.config.date_locale)}${(0,n.formatTime)(e,this.hass.locale)}`}render(){return r.html`${(0,o.until)(this.client.GetSchedule((new Date).getFullYear()).then((t=>{const e=this.config.previous_race===a.PreviousRaceDisplay.Hide?t.filter((t=>new Date(t.date+"T"+t.time)>=new Date)):t;return e.filter((t=>new Date(t.date+"T"+t.time)>=new Date))[0]?r.html`${(0,l.reduceArray)(e,this.config.row_limit).map((t=>this.renderScheduleRow(t)))}
 ${this.translation("race")}${this.translation("location")}${this.translation("date")}${this.translation("time")}
`:(0,l.getEndOfSeasonMessage)(this.translation("endofseason"))})).catch((()=>r.html`${(0,l.getApiErrorMessage)("schedule")}`)),r.html`${(0,l.getApiLoadingMessage)()}`)}`}}e.default=d},851:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CARD_EDITOR_NAME=e.CARD_NAME=void 0,e.CARD_NAME="formulaone-card",e.CARD_EDITOR_NAME=`${e.CARD_NAME}-editor`},22:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.actionHandler=e.actionHandlerBind=void 0;const n=i(395),r=i(313),o=i(11),s="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.maxTouchPoints>0;class a extends HTMLElement{constructor(){super(),this.holdTime=500,this.held=!1,this.ripple=document.createElement("mwc-ripple")}connectedCallback(){Object.assign(this.style,{position:"absolute",width:s?"100px":"50px",height:s?"100px":"50px",transform:"translate(-50%, -50%)",pointerEvents:"none",zIndex:"999"}),this.appendChild(this.ripple),this.ripple.primary=!0,["touchcancel","mouseout","mouseup","touchmove","mousewheel","wheel","scroll"].forEach((t=>{document.addEventListener(t,(()=>{clearTimeout(this.timer),this.stopAnimation(),this.timer=void 0}),{passive:!0})}))}bind(t,e){if(t.actionHandler)return;t.actionHandler=!0,t.addEventListener("contextmenu",(t=>{const e=t||window.event;return e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,e.returnValue=!1,!1}));const i=t=>{let e,i;this.held=!1,t.touches?(e=t.touches[0].pageX,i=t.touches[0].pageY):(e=t.pageX,i=t.pageY),this.timer=window.setTimeout((()=>{this.startAnimation(e,i),this.held=!0}),this.holdTime)},n=i=>{i.preventDefault(),["touchend","touchcancel"].includes(i.type)&&void 0===this.timer||(clearTimeout(this.timer),this.stopAnimation(),this.timer=void 0,this.held?(0,r.fireEvent)(t,"action",{action:"hold"}):e.hasDoubleClick?"click"===i.type&&i.detail<2||!this.dblClickTimeout?this.dblClickTimeout=window.setTimeout((()=>{this.dblClickTimeout=void 0,(0,r.fireEvent)(t,"action",{action:"tap"})}),250):(clearTimeout(this.dblClickTimeout),this.dblClickTimeout=void 0,(0,r.fireEvent)(t,"action",{action:"double_tap"})):(0,r.fireEvent)(t,"action",{action:"tap"}))};t.addEventListener("touchstart",i,{passive:!0}),t.addEventListener("touchend",n),t.addEventListener("touchcancel",n),t.addEventListener("mousedown",i,{passive:!0}),t.addEventListener("click",n),t.addEventListener("keyup",(t=>{13===t.keyCode&&n(t)}))}startAnimation(t,e){Object.assign(this.style,{left:`${t}px`,top:`${e}px`,display:null}),this.ripple.disabled=!1,this.ripple.active=!0,this.ripple.unbounded=!0}stopAnimation(){this.ripple.active=!1,this.ripple.disabled=!0,this.style.display="none"}}customElements.define("action-handler-formulaonecard",a),e.actionHandlerBind=(t,e)=>{const i=(()=>{const t=document.body;if(t.querySelector("action-handler-formulaonecard"))return t.querySelector("action-handler-formulaonecard");const e=document.createElement("action-handler-formulaonecard");return t.appendChild(e),e})();i&&i.bind(t,e)},e.actionHandler=(0,n.directive)(class extends n.Directive{update(t,[i]){return(0,e.actionHandlerBind)(t.element,i),o.noChange}render(t){}})},750:function(t,e,i){var n=this&&this.__decorate||function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.FormulaOneCardEditor=void 0;const r=i(639),o=i(851),s=i(241),a=i(898),l=i(194),c=i(429),d=i(11);let u=class extends a.default{render(){return this._hass&&this._config?this.renderForm([{controls:[{label:"Card Type (Required)",configValue:"card_type",type:l.FormControlType.Dropdown,items:(0,c.getDropdownOptionsFromEnum)(s.FormulaOneCardType)}]},{controls:[{label:"Title",configValue:"title",type:l.FormControlType.Textbox}]},{label:"Basic configuration",cssClass:"side-by-side",controls:[{label:"Use F1 font",configValue:"f1_font",type:l.FormControlType.Switch},{label:"Image clickable",configValue:"image_clickable",type:l.FormControlType.Switch},{label:"Show carnumber",configValue:"show_carnumber",type:l.FormControlType.Switch},{label:"Location clickable",configValue:"location_clickable",type:l.FormControlType.Switch},{label:"Show race information",configValue:"show_raceinfo",type:l.FormControlType.Switch},{label:"Hide track layout",configValue:"hide_tracklayout",type:l.FormControlType.Switch},{label:"Hide race dates and times",configValue:"hide_racedatetimes",type:l.FormControlType.Switch},{label:"Show last years result",configValue:"show_lastyears_result",type:l.FormControlType.Switch},{label:"Only show date",configValue:"only_show_date",type:l.FormControlType.Switch},{type:l.FormControlType.Filler},{label:"Row limit",configValue:"row_limit",type:l.FormControlType.Textbox},{label:"Date locale",configValue:"date_locale",type:l.FormControlType.Textbox}]},{label:"Countdown Type",hidden:this._config.card_type!==s.FormulaOneCardType.Countdown,cssClass:"side-by-side",controls:[{configValue:"countdown_type",type:l.FormControlType.Checkboxes,items:(0,c.getDropdownOptionsFromEnum)(s.CountdownType)}]},{hidden:this._config.card_type!==s.FormulaOneCardType.NextRace,controls:[{label:"Next race delay",configValue:"next_race_delay",type:l.FormControlType.Textbox}]},{hidden:this._config.card_type!==s.FormulaOneCardType.Schedule,controls:[{label:"Previous race",configValue:"previous_race",type:l.FormControlType.Dropdown,items:(0,c.getDropdownOptionsFromEnum)(s.PreviousRaceDisplay)}]},{label:"Standings",hidden:this._config.card_type!==s.FormulaOneCardType.ConstructorStandings&&this._config.card_type!==s.FormulaOneCardType.DriverStandings,cssClass:"side-by-side",controls:[{label:"Show team",configValue:"standings.show_team",type:l.FormControlType.Switch},{label:"Show flag",configValue:"standings.show_flag",type:l.FormControlType.Switch},{label:"Show teamlogo",configValue:"standings.show_teamlogo",type:l.FormControlType.Switch}]},{label:"Weather",hidden:this._config.card_type!==s.FormulaOneCardType.NextRace&&this._config.card_type!==s.FormulaOneCardType.Countdown,controls:[{label:"Show weather",configValue:"show_weather",type:l.FormControlType.Switch}]},{cssClass:"side-by-side",hidden:this._config.card_type!==s.FormulaOneCardType.NextRace&&this._config.card_type!==s.FormulaOneCardType.Countdown||!this._config.show_weather,controls:[{label:"API key",configValue:"weather_options.api_key",type:l.FormControlType.Textbox},{label:"Unit",configValue:"weather_options.unit",type:l.FormControlType.Dropdown,items:(0,c.getDropdownOptionsFromEnum)(s.WeatherUnit)},{label:"Show icon",configValue:"weather_options.show_icon",type:l.FormControlType.Switch},{label:"Show precipitation",configValue:"weather_options.show_precipitation",type:l.FormControlType.Switch},{label:"Show wind",configValue:"weather_options.show_wind",type:l.FormControlType.Switch},{label:"Show temperature",configValue:"weather_options.show_temperature",type:l.FormControlType.Switch},{label:"Show cloud coverage",configValue:"weather_options.show_cloud_cover",type:l.FormControlType.Switch},{label:"Show visibility",configValue:"weather_options.show_visibility",type:l.FormControlType.Switch}]},{label:"Tabs",hidden:this._config.card_type!==s.FormulaOneCardType.Results,controls:[{label:"Tabs order",configValue:"tabs_order",type:l.FormControlType.Textbox}]}]):r.html``}static get styles(){return d.css`.form-row{margin-bottom:10px}.form-control{display:flex;align-items:center}ha-switch{padding:16px 6px}.side-by-side{display:flex;flex-flow:row wrap}.side-by-side>label{width:100%}.side-by-side>.form-control{width:49%;padding:2px}ha-textfield{width:100%}.hidden{display:none}@media (max-width:600px){.side-by-side>.form-control{width:48%}}`}};u=n([(0,d.customElement)(o.CARD_EDITOR_NAME)],u),e.FormulaOneCardEditor=u},657:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.loadCustomFonts=void 0,e.loadCustomFonts=()=>{if(window&&document.fonts){const t=new FontFace("F1Bold","url(https://www.formula1.com/etc/designs/fom-website/fonts/F1Bold/Formula1-Bold.woff)");document.fonts.add(t),t.load()}}},148:function(t,e,i){var n=this&&this.__decorate||function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},r=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}l((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const o=i(147),s=i(15),a=i(241),l=i(110),c=i(438),d=i(657),u=i(278),h=i(169),m=i(138),p=i(465),f=i(840),g=i(507),v=i(849),y=i(74),_=i(959),$=i(851);console.info(`%c ${$.CARD_NAME.toUpperCase()} %c ${o.version}`,"color: cyan; background: black; font-weight: bold;","color: darkblue; background: white; font-weight: bold;"),window.customCards=window.customCards||[],window.customCards.push({type:"formulaone-card",name:"FormulaOne card",preview:!1,description:"Present the data of Formula One in a pretty way"});let b=class extends l.LitElement{set properties(t){this._cardValues=t,this.update(t)}get properties(){return this._cardValues}constructor(){super(),this.setCountryCache()}static getConfigElement(){return r(this,void 0,void 0,(function*(){return yield Promise.resolve().then((()=>i(750))),document.createElement($.CARD_EDITOR_NAME)}))}setConfig(t){(0,c.checkConfig)(t),this.config=Object.assign({},t)}setCountryCache(){(new _.default).GetAll().catch((()=>{this.warning="Country API is down, so flags are not available at the moment!",this.update(this._cardValues)}))}shouldUpdate(t){return(0,c.hasConfigOrCardValuesChanged)(this,t)}set hass(t){switch(this._hass=t,this.config.hass=t,this.config.card_type){case a.FormulaOneCardType.ConstructorStandings:this.card=new h.default(this);break;case a.FormulaOneCardType.DriverStandings:this.card=new m.default(this);break;case a.FormulaOneCardType.Schedule:this.card=new p.default(this);break;case a.FormulaOneCardType.NextRace:this.card=new f.default(this);break;case a.FormulaOneCardType.LastResult:this.card=new g.default(this);break;case a.FormulaOneCardType.Countdown:this.card=new v.default(this);break;case a.FormulaOneCardType.Results:this.card=new y.default(this)}}static get styles(){return(0,d.loadCustomFonts)(),u.styles}render(){if(!this._hass||!this.config)return l.html``;try{return l.html`${this.renderRefreshButton()} ${this.warning?l.html`${this.warning}`:""} ${this.config.title?l.html`

${this.config.title}

`:""} ${this.card.render()}
`}catch(t){return l.html`${t.toString()}`}}getCardSize(){return this.card.cardSize()}renderRefreshButton(){return this.config.show_refresh?l.html`
`:null}refreshCache(t){console.log("Refreshing cache..."),this.card.client.RefreshCache()}};n([(0,s.property)()],b.prototype,"_hass",void 0),n([(0,s.property)()],b.prototype,"config",void 0),n([(0,s.property)()],b.prototype,"card",void 0),n([(0,s.property)()],b.prototype,"warning",void 0),n([(0,s.property)()],b.prototype,"properties",null),b=n([(0,s.customElement)($.CARD_NAME)],b),e.default=b},198:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TimeFormat=e.NumberFormat=e.SECONDARY_INFO_VALUES=e.TIMESTAMP_FORMATS=e.ImageConstants=void 0,e.ImageConstants={FlagCDN:"https://flagcdn.com/w320/",TeamLogoCDN:"https://www.formula1.com/content/dam/fom-website/teams/",F1CDN:"https://www.formula1.com/content/dam/fom-website/2018-redesign-assets/"},e.TIMESTAMP_FORMATS=["relative","total","date","time","datetime"],e.SECONDARY_INFO_VALUES=["entity-id","last-changed","last-updated","last-triggered","position","tilt-position","brightness"],e.NumberFormat={language:"language",system:"system",comma_decimal:"comma_decimal",decimal_comma:"decimal_comma",space_comma:"space_comma",none:"none"},e.TimeFormat={language:"language",system:"system",am_pm:"12",twenty_four:"24"}},300:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatDateNumeric=e.formatDate=void 0,e.formatDate=(t,e,i)=>new Intl.DateTimeFormat(null!=i?i:e.language,{month:"2-digit",day:"2-digit"}).format(t),e.formatDateNumeric=(t,e,i)=>new Intl.DateTimeFormat(null!=i?i:e.language,{year:"2-digit",month:"2-digit",day:"2-digit"}).format(t)},141:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatDateTimeRaceInfo=e.formatDateTime=void 0;const n=i(975);e.formatDateTime=(t,e)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:(0,n.useAmPm)(e)?"numeric":"2-digit",minute:"2-digit",hour12:(0,n.useAmPm)(e)}).format(t),e.formatDateTimeRaceInfo=(t,e)=>new Intl.DateTimeFormat(e.language,{weekday:"short",hour:"2-digit",minute:"2-digit",hour12:(0,n.useAmPm)(e)}).format(t)},975:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.useAmPm=void 0;const n=i(198);e.useAmPm=t=>{if(t.time_format===n.TimeFormat.language||t.time_format===n.TimeFormat.system){const e=t.time_format===n.TimeFormat.language?t.language:void 0,i=(new Date).toLocaleString(e);return i.includes("AM")||i.includes("PM")}return t.time_format===n.TimeFormat.am_pm}},278:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.styles=void 0;const n=i(110);e.styles=n.css`table{width:100%;border-spacing:0;border-collapse:separate;padding:0 16px 16px}table.nopadding{padding:0;width:100%;border-spacing:0;border-collapse:separate}th{background-color:var(--table-row-alternative-background-color,#eee)}td,th{padding:5px;text-align:left}tr{color:var(--secondary-text-color)}tr:nth-child(even){background-color:var(--table-row-alternative-background-color,#eee)}.text-center{text-align:center}.width-40{width:40px}.width-50{width:50px}.width-60{width:60px}.hide{display:none}.strikethrough{text-decoration:line-through}.italic{font-style:italic}a{text-decoration:none;color:var(--secondary-text-color)}.constructor-logo{width:20px;margin:auto;display:block;float:left;background-color:#fff;border-radius:50%;margin-right:3px}.clickable{cursor:pointer}.formulaone-font{font-family:F1Bold}ha-icon{color:var(--secondary-text-color)}.transparent{background-color:transparent!important}.weather-info{padding:10px}.weather-info td{width:33%}.refresh-cache{position:absolute;right:10px;top:10px}`},241:(t,e)=>{var i,n,r,o;Object.defineProperty(e,"__esModule",{value:!0}),e.FormulaOneCardType=e.PreviousRaceDisplay=e.CountdownType=e.WeatherUnit=void 0,(o=e.WeatherUnit||(e.WeatherUnit={})).Metric="metric",o.MilesCelsius="uk",o.MilesFahrenheit="us",(r=e.CountdownType||(e.CountdownType={})).Race="race",r.Qualifying="qualifying",r.Practice1="practice1",r.Practice2="practice2",r.Practice3="practice3",r.Sprint="sprint",(n=e.PreviousRaceDisplay||(e.PreviousRaceDisplay={})).Strikethrough="strikethrough",n.Italic="italic",n.Hide="hide",(i=e.FormulaOneCardType||(e.FormulaOneCardType={})).DriverStandings="driver_standings",i.ConstructorStandings="constructor_standings",i.NextRace="next_race",i.Schedule="schedule",i.LastResult="last_result",i.Results="results",i.Countdown="countdown"},438:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.renderConstructorColumn=e.reduceArray=e.getRefreshTime=e.calculateWindDirection=e.renderWeatherInfo=e.renderLastYearsResults=e.renderRaceInfo=e.renderHeader=e.clickHandler=e.getEndOfSeasonMessage=e.getApiLoadingMessage=e.getApiErrorMessage=e.getDriverName=e.getCircuitName=e.getTeamImage=e.checkConfig=e.getCountryFlagByName=e.getCountryFlagByNationality=e.getCountries=e.hasConfigOrCardValuesChanged=void 0;const n=i(110),r=i(241),o=i(141),s=i(313),a=i(300),l=i(198),c=i(22),d=i(959),u=i(557);e.hasConfigOrCardValuesChanged=(t,e)=>{if(e.has("config"))return!0;const i=e.get("card");if(i&&i.parent)return i.parent.properties!==t.properties;const n=e.get("cardValues");return!!n&&n!=t.properties},e.getCountries=()=>(new d.default).GetCountriesFromLocalStorage(),e.getCountryFlagByNationality=(t,i)=>{const n=(0,e.getCountries)().filter((t=>t.demonym==i));return n.length>1?t.imageClient.GetImage(n.sort(((t,e)=>t.population>e.population?-1:1))[0].flags.png):t.imageClient.GetImage(n[0].flags.png)},e.getCountryFlagByName=(t,i)=>{const n=(0,e.getCountries)().filter((t=>{var e;return t.name==i||t.nativeName==i||(null===(e=t.altSpellings)||void 0===e?void 0:e.includes(i))}))[0];return t.imageClient.GetImage(n.flags.png)},e.checkConfig=t=>{if(void 0===t.card_type)throw new Error("Please define FormulaOne card type (card_type).")},e.getTeamImage=(t,e)=>{e=e.toLocaleLowerCase().replace("_","-");const i=[{teamName:"red-bull",corrected:"red-bull-racing"},{teamName:"alfa",corrected:"alfa-romeo"},{teamName:"haas",corrected:"haas-f1-team"},{teamName:"sauber",corrected:"kick-sauber"}].filter((t=>t.teamName==e));return i.length>0&&(e=i[0].corrected),t.imageClient.GetImage(`${l.ImageConstants.TeamLogoCDN}/2024/${e.toLowerCase()}-logo.png.transform/2col-retina/image.png`)},e.getCircuitName=t=>{let e=t.country.replace(" ","-");const i=[{countryDashed:"UAE",name:"Abu_Dhabi"},{countryDashed:"UK",name:"Great_Britain"},{countryDashed:"Monaco",name:"Monoco"},{countryDashed:"Azerbaijan",name:"Baku"},{countryDashed:"Saudi-Arabia",name:"Saudi_Arabia"}].filter((t=>t.countryDashed==e));return i.length>0&&(e=i[0].name),"USA"!=t.country&&"United States"!=t.country||"Austin"==t.locality||(e=t.locality.replace(" ","_")),"Italy"==t.country&&"Imola"==t.locality&&(e="Emilia_Romagna"),e},e.getDriverName=(t,e)=>{const i="VER"==t.code?1:t.permanentNumber;return`${t.givenName} ${t.familyName}${e.show_carnumber?` #${i}`:""}`},e.getApiErrorMessage=t=>n.html`
Error getting ${t}
`,e.getApiLoadingMessage=()=>n.html`
Loading...
`,e.getEndOfSeasonMessage=t=>n.html`
${t}
`,e.clickHandler=(t,e,i,n)=>{(0,s.handleAction)(t,i,e.actions,n.detail.action)},e.renderHeader=(t,i,o=!1)=>{var a,d;const u=(0,e.getCircuitName)(i.Circuit.Location),h=t.config.image_clickable||void 0!==t.config.actions,m=i.Circuit.url;t.config.image_clickable&&!t.config.actions&&(t.config.actions={tap_action:{action:"url",url_path:m}});const p=n.html``,f=n.html`

  ${i.round} : ${i.raceName}

`;return n.html`${t.config.card_type==r.FormulaOneCardType.Countdown?n.html``:f} ${t.config.hide_tracklayout?n.html``:p}
`},e.renderRaceInfo=(t,i,r)=>{var s;const l=t.config,c=t.hass;if(l.hide_racedatetimes)return n.html``;const d=l.show_weather&&void 0!==(null===(s=l.weather_options)||void 0===s?void 0:s.api_key)?t.weatherClient.getWeatherData(i.Circuit.Location.lat,i.Circuit.Location.long,`${i.date}T${i.time}`):Promise.resolve(null),h=l.show_lastyears_result?t.client.GetLastYearsResults(i.Circuit.circuitName):Promise.resolve(null),m=Promise.all([d,h]);return n.html`${(0,u.until)(m.then((([s,d])=>{const u=null==s?void 0:s.days[0],h=new Date(i.date+"T"+i.time),m=(0,e.renderWeatherInfo)(u,l,null!=r?r:h),p=(0,e.renderLastYearsResults)(l,d),f=(0,o.formatDateTimeRaceInfo)(new Date(i.FirstPractice.date+"T"+i.FirstPractice.time),c.locale),g=(0,o.formatDateTimeRaceInfo)(new Date(i.SecondPractice.date+"T"+i.SecondPractice.time),c.locale),v=void 0!==i.ThirdPractice?(0,o.formatDateTimeRaceInfo)(new Date(i.ThirdPractice.date+"T"+i.ThirdPractice.time),c.locale):"-",y=(0,o.formatDateTimeRaceInfo)(h,c.locale),_=(0,o.formatDateTimeRaceInfo)(new Date(i.Qualifying.date+"T"+i.Qualifying.time),c.locale),$=void 0!==i.Sprint?(0,o.formatDateTimeRaceInfo)(new Date(i.Sprint.date+"T"+i.Sprint.time),c.locale):"-";return n.html`${p}${m}${t.translation("date")}${(0,a.formatDateNumeric)(h,c.locale,l.date_locale)} ${t.translation("practice1")}${f}${t.translation("race")}${i.round} ${t.translation("practice2")}${g}${t.translation("racename")}${i.raceName} ${t.translation("practice3")}${v}${t.translation("circuitname")}${i.Circuit.circuitName} ${t.translation("qualifying")}${_}${t.translation("location")}${i.Circuit.Location.country} ${t.translation("sprint")}${$}${t.translation("city")}${i.Circuit.Location.locality} ${t.translation("racetime")}${y}`})))}`},e.renderLastYearsResults=(t,e)=>{var i,r;if(!e)return n.html``;const o=e.Results?e.Results[0]:null,s=null===(i=e.Results)||void 0===i?void 0:i.filter((t=>{var e;return"1"===(null===(e=t.FastestLap)||void 0===e?void 0:e.rank)}))[0];return n.html`

${new Date(e.date).getFullYear()}

${null==o?void 0:o.Driver.givenName} ${null==o?void 0:o.Driver.familyName} (${null==o?void 0:o.Constructor.name})

${null==s?void 0:s.Driver.givenName} ${null==s?void 0:s.Driver.familyName} (${null===(r=null==s?void 0:s.FastestLap)||void 0===r?void 0:r.Time.time})

 `},e.renderWeatherInfo=(t,i,o)=>{var s,a;if(!t)return n.html``;const l=(null===(s=i.weather_options)||void 0===s?void 0:s.unit)===r.WeatherUnit.Metric?"km/h":"mph",c=(null===(a=i.weather_options)||void 0===a?void 0:a.unit)===r.WeatherUnit.MilesFahrenheit?"°F":"°C",d=t.hours?t.hours[o.getHours()]:t;return n.html`
${(0,e.calculateWindDirection)(d.winddir)} ${d.windspeed} ${l}${d.precip} mm${d.precipprob}%
${d.cloudcover} %${d.temp} ${c}${d.feelslike} ${c}
 `},e.calculateWindDirection=t=>{const e=[{label:"N",range:[0,11.25]},{label:"NNE",range:[11.25,33.75]},{label:"NE",range:[33.75,56.25]},{label:"ENE",range:[56.25,78.75]},{label:"E",range:[78.75,101.25]},{label:"ESE",range:[101.25,123.75]},{label:"SE",range:[123.75,146.25]},{label:"SSE",range:[146.25,168.75]},{label:"S",range:[168.75,191.25]},{label:"SSW",range:[191.25,213.75]},{label:"SW",range:[213.75,236.25]},{label:"WSW",range:[236.25,258.75]},{label:"W",range:[258.75,281.25]},{label:"WNW",range:[281.25,303.75]},{label:"NW",range:[303.75,326.25]},{label:"NNW",range:[326.25,348.75]},{label:"N",range:[348.75,360]}];for(const{label:i,range:n}of e)if(t>=n[0]&&t<=n[1])return i},e.getRefreshTime=t=>{let e=24;const i=new Date,n=localStorage.getItem(`${i.getFullYear()}.json`);if(n){const r=JSON.parse(n),o=JSON.parse(r.data).MRData.RaceTable.Races.filter((t=>new Date(t.date).toLocaleDateString==i.toLocaleDateString));if(o.length>0){const i=o[0],n=new Date(i.date+"T"+i.time),r=localStorage.getItem(t);if(r){const t=JSON.parse(r);new Date(t.created)void 0===t?[]:e?t.slice(0,e):t,e.renderConstructorColumn=(t,i)=>n.html`${t.config.standings.show_teamlogo?n.html` `:""}${i.name}`},11:(t,e,i)=>{i.r(e),i.d(e,{CSSResult:()=>a,LitElement:()=>S,ReactiveElement:()=>$,UpdatingElement:()=>A,_$LE:()=>E,_$LH:()=>C._$LH,adoptStyles:()=>d,css:()=>c,customElement:()=>k,decorateProperty:()=>R,defaultConverter:()=>v,eventOptions:()=>M,getCompatibleStyle:()=>u,html:()=>C.html,legacyPrototypeMethod:()=>D,noChange:()=>C.noChange,notEqual:()=>y,nothing:()=>C.nothing,property:()=>P,query:()=>F,queryAll:()=>I,queryAssignedElements:()=>U,queryAssignedNodes:()=>V,queryAsync:()=>L,render:()=>C.render,standardPrototypeMethod:()=>x,state:()=>N,supportsAdoptingStyleSheets:()=>r,svg:()=>C.svg,unsafeCSS:()=>l});const n=window,r=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),s=new WeakMap;class a{constructor(t,e,i){if(this._$cssResult$=!0,i!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(r&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=s.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&s.set(e,t))}return t}toString(){return this.cssText}}const l=t=>new a("string"==typeof t?t:t+"",void 0,o),c=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[n+1]),t[0]);return new a(i,t,o)},d=(t,e)=>{r?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style"),r=n.litNonce;void 0!==r&&i.setAttribute("nonce",r),i.textContent=e.cssText,t.appendChild(i)}))},u=r?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return l(e)})(t):t;var h;const m=window,p=m.trustedTypes,f=p?p.emptyScript:"",g=m.reactiveElementPolyfillSupport,v={toAttribute(t,e){switch(e){case Boolean:t=t?f:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},y=(t,e)=>e!==t&&(e==e||t==t),_={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:y};class $ extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const n=this._$Ep(i,e);void 0!==n&&(this._$Ev.set(n,i),t.push(n))})),t}static createProperty(t,e=_){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,i,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(n){const r=this[t];this[e]=n,this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||_}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(u(t))}else void 0!==t&&e.push(u(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return d(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=_){var n;const r=this.constructor._$Ep(t,i);if(void 0!==r&&!0===i.reflect){const o=(void 0!==(null===(n=i.converter)||void 0===n?void 0:n.toAttribute)?i.converter:v).toAttribute(e,i.type);this._$El=t,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$El=null}}_$AK(t,e){var i;const n=this.constructor,r=n._$Ev.get(t);if(void 0!==r&&this._$El!==r){const t=n.getPropertyOptions(r),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:v;this._$El=r,this[r]=o.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,i){let n=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||y)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}$.finalized=!0,$.elementProperties=new Map,$.elementStyles=[],$.shadowRootOptions={mode:"open"},null==g||g({ReactiveElement:$}),(null!==(h=m.reactiveElementVersions)&&void 0!==h?h:m.reactiveElementVersions=[]).push("1.6.1");var b,w,C=i(639);const A=$;class S extends ${constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=(0,C.render)(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return C.noChange}}S.finalized=!0,S._$litElement$=!0,null===(b=globalThis.litElementHydrateSupport)||void 0===b||b.call(globalThis,{LitElement:S});const T=globalThis.litElementPolyfillSupport;null==T||T({LitElement:S});const E={_$AK:(t,e,i)=>{t._$AK(e,i)},_$AL:t=>t._$AL};(null!==(w=globalThis.litElementVersions)&&void 0!==w?w:globalThis.litElementVersions=[]).push("3.3.3");const D=(t,e,i)=>{Object.defineProperty(e,i,t)},x=(t,e)=>({kind:"method",placement:"prototype",key:e.key,descriptor:t}),R=({finisher:t,descriptor:e})=>(i,n)=>{var r;if(void 0===n){const n=null!==(r=i.originalKey)&&void 0!==r?r:i.key,o=null!=e?{kind:"method",placement:"prototype",key:n,descriptor:e(i.key)}:{...i,key:n};return null!=t&&(o.finisher=function(e){t(e,n)}),o}{const r=i.constructor;void 0!==e&&Object.defineProperty(i,n,e(n)),null==t||t(r,n)}},k=t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:i,elements:n}=e;return{kind:i,elements:n,finisher(e){customElements.define(t,e)}}})(t,e),O=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(i){i.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};function P(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):O(t,e)}function N(t){return P({...t,state:!0})}function M(t){return R({finisher:(e,i)=>{Object.assign(e.prototype[i],t)}})}function F(t,e){return R({descriptor:i=>{const n={get(){var e,i;return null!==(i=null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(t))&&void 0!==i?i:null},enumerable:!0,configurable:!0};if(e){const e="symbol"==typeof i?Symbol():"__"+i;n.get=function(){var i,n;return void 0===this[e]&&(this[e]=null!==(n=null===(i=this.renderRoot)||void 0===i?void 0:i.querySelector(t))&&void 0!==n?n:null),this[e]}}return n}})}function I(t){return R({descriptor:e=>({get(){var e,i;return null!==(i=null===(e=this.renderRoot)||void 0===e?void 0:e.querySelectorAll(t))&&void 0!==i?i:[]},enumerable:!0,configurable:!0})})}function L(t){return R({descriptor:e=>({async get(){var e;return await this.updateComplete,null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(t)},enumerable:!0,configurable:!0})})}var H;const j=null!=(null===(H=window.HTMLSlotElement)||void 0===H?void 0:H.prototype.assignedElements)?(t,e)=>t.assignedElements(e):(t,e)=>t.assignedNodes(e).filter((t=>t.nodeType===Node.ELEMENT_NODE));function U(t){const{slot:e,selector:i}=null!=t?t:{};return R({descriptor:n=>({get(){var n;const r="slot"+(e?`[name=${e}]`:":not([name])"),o=null===(n=this.renderRoot)||void 0===n?void 0:n.querySelector(r),s=null!=o?j(o,t):[];return i?s.filter((t=>t.matches(i))):s},enumerable:!0,configurable:!0})})}function V(t,e,i){let n,r=t;return"object"==typeof t?(r=t.slot,n=t):n={flatten:e},i?U({slot:r,flatten:e,selector:i}):R({descriptor:t=>({get(){var t,e;const i="slot"+(r?`[name=${r}]`:":not([name])"),o=null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector(i);return null!==(e=null==o?void 0:o.assignedNodes(n))&&void 0!==e?e:[]},enumerable:!0,configurable:!0})})}console.warn("The main 'lit-element' module entrypoint is deprecated. Please update your imports to use the 'lit' package: 'lit' and 'lit/decorators.ts' or import from 'lit-element/lit-element.ts'. See https://lit.dev/msg/deprecated-import-path for more information.")},557:(t,e,i)=>{i.r(e),i.d(e,{UntilDirective:()=>v,until:()=>y});var n=i(639);const{I:r}=n._$LH;class o{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}const s=(t,e)=>{var i,n;const r=t._$AN;if(void 0===r)return!1;for(const t of r)null===(n=(i=t)._$AO)||void 0===n||n.call(i,e,!1),s(t,e);return!0},a=t=>{let e,i;do{if(void 0===(e=t._$AM))break;i=e._$AN,i.delete(t),t=e}while(0===(null==i?void 0:i.size))},l=t=>{for(let e;e=t._$AM;t=e){let i=e._$AN;if(void 0===i)e._$AN=i=new Set;else if(i.has(t))break;i.add(t),u(e)}};function c(t){void 0!==this._$AN?(a(this),this._$AM=t,l(this)):this._$AM=t}function d(t,e=!1,i=0){const n=this._$AH,r=this._$AN;if(void 0!==r&&0!==r.size)if(e)if(Array.isArray(n))for(let t=i;t{var e,i,n,r;2==t.type&&(null!==(e=(n=t)._$AP)&&void 0!==e||(n._$AP=d),null!==(i=(r=t)._$AQ)&&void 0!==i||(r._$AQ=c))};class h extends o{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),l(this),this.isConnected=t._$AU}_$AO(t,e=!0){var i,n;t!==this.isConnected&&(this.isConnected=t,t?null===(i=this.reconnected)||void 0===i||i.call(this):null===(n=this.disconnected)||void 0===n||n.call(this)),e&&(s(this,t),a(this))}setValue(t){if((t=>void 0===this._$Ct.strings)())this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}class m{constructor(t){this.G=t}disconnect(){this.G=void 0}reconnect(t){this.G=t}deref(){return this.G}}class p{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){var t;null!==(t=this.Y)&&void 0!==t||(this.Y=new Promise((t=>this.Z=t)))}resume(){var t;null===(t=this.Z)||void 0===t||t.call(this),this.Y=this.Z=void 0}}const f=t=>!(t=>null===t||"object"!=typeof t&&"function"!=typeof t)(t)&&"function"==typeof t.then,g=1073741823;class v extends h{constructor(){super(...arguments),this._$C_t=g,this._$Cwt=[],this._$Cq=new m(this),this._$CK=new p}render(...t){var e;return null!==(e=t.find((t=>!f(t))))&&void 0!==e?e:n.noChange}update(t,e){const i=this._$Cwt;let r=i.length;this._$Cwt=e;const o=this._$Cq,s=this._$CK;this.isConnected||this.disconnected();for(let t=0;tthis._$C_t);t++){const n=e[t];if(!f(n))return this._$C_t=t,n;t{for(;s.get();)await s.get();const e=o.deref();if(void 0!==e){const i=e._$Cwt.indexOf(n);i>-1&&i({_$litDirective$:_,values:t}));var _},639:(t,e,i)=>{var n;i.r(e),i.d(e,{_$LH:()=>G,html:()=>S,noChange:()=>E,nothing:()=>D,render:()=>q,svg:()=>T});const r=window,o=r.trustedTypes,s=o?o.createPolicy("lit-html",{createHTML:t=>t}):void 0,a="$lit$",l=`lit$${(Math.random()+"").slice(9)}$`,c="?"+l,d=`<${c}>`,u=document,h=()=>u.createComment(""),m=t=>null===t||"object"!=typeof t&&"function"!=typeof t,p=Array.isArray,f=t=>p(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),g="[ \t\n\f\r]",v=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,y=/-->/g,_=/>/g,$=RegExp(`>|${g}(?:([^\\s"'>=/]+)(${g}*=${g}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),b=/'/g,w=/"/g,C=/^(?:script|style|textarea|title)$/i,A=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),S=A(1),T=A(2),E=Symbol.for("lit-noChange"),D=Symbol.for("lit-nothing"),x=new WeakMap,R=u.createTreeWalker(u,129,null,!1);function k(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s?s.createHTML(e):e}const O=(t,e)=>{const i=t.length-1,n=[];let r,o=2===e?"":"",s=v;for(let e=0;e"===u[0]?(s=null!=r?r:v,h=-1):void 0===u[1]?h=-2:(h=s.lastIndex-u[2].length,c=u[1],s=void 0===u[3]?$:'"'===u[3]?w:b):s===w||s===b?s=$:s===y||s===_?s=v:(s=$,r=void 0);const p=s===$&&t[e+1].startsWith("/>")?" ":"";o+=s===v?i+d:h>=0?(n.push(c),i.slice(0,h)+a+i.slice(h)+l+p):i+l+(-2===h?(n.push(void 0),e):p)}return[k(t,o+(t[i]||"")+(2===e?"":"")),n]};class P{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let r=0,s=0;const d=t.length-1,u=this.parts,[m,p]=O(t,e);if(this.el=P.createElement(m,i),R.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=R.nextNode())&&u.length0){n.textContent=o?o.emptyScript:"";for(let i=0;i2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=D}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,n){const r=this.strings;let o=!1;if(void 0===r)t=N(this,t,e,0),o=!m(t)||t!==this._$AH&&t!==E,o&&(this._$AH=t);else{const n=t;let s,a;for(t=r[0],s=0;s{var n,r;const o=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:e;let s=o._$litPart$;if(void 0===s){const t=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;o._$litPart$=s=new F(e.insertBefore(h(),t),t,void 0,null!=i?i:{})}return s._$AI(t),s}},15:(t,e,i)=>{i.r(e),i.d(e,{customElement:()=>n,eventOptions:()=>c,property:()=>a,query:()=>u,queryAll:()=>m,queryAssignedElements:()=>f,queryAssignedNodes:()=>g,queryAsync:()=>p,standardProperty:()=>s,state:()=>l});const n=t=>(e,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)};var r=i(548);const o={attribute:!0,type:String,converter:r.Ts,reflect:!1,hasChanged:r.Qu},s=(t=o,e,i)=>{const{kind:n,metadata:r}=i;let s=globalThis.litPropertyMetadata.get(r);if(void 0===s&&globalThis.litPropertyMetadata.set(r,s=new Map),s.set(i.name,t),"accessor"===n){const{name:n}=i;return{set(i){const r=e.get.call(this);e.set.call(this,i),this.requestUpdate(n,r,t)},init(e){return void 0!==e&&this.C(n,void 0,t),e}}}if("setter"===n){const{name:n}=i;return function(i){const r=this[n];e.call(this,i),this.requestUpdate(n,r,t)}}throw Error("Unsupported decorator location: "+n)};function a(t){return(e,i)=>"object"==typeof i?s(t,e,i):((t,e,i)=>{const n=e.hasOwnProperty(i);return e.constructor.createProperty(i,n?{...t,wrapped:!0}:t),n?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}function l(t){return a({...t,state:!0,attribute:!1})}function c(t){return(e,i)=>{const n="function"==typeof e?e:e[i];Object.assign(n,t)}}const d=(t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i);function u(t,e){return(i,n,r)=>{const o=e=>e.renderRoot?.querySelector(t)??null;if(e){const{get:t,set:e}="object"==typeof n?i:r??(()=>{const t=Symbol();return{get(){return this[t]},set(e){this[t]=e}}})();return d(i,n,{get(){let i=t.call(this);return void 0===i&&(i=o(this),(null!==i||this.hasUpdated)&&e.call(this,i)),i}})}return d(i,n,{get(){return o(this)}})}}let h;function m(t){return(e,i)=>d(e,i,{get(){return(this.renderRoot??(h??=document.createDocumentFragment())).querySelectorAll(t)}})}function p(t){return(e,i)=>d(e,i,{async get(){return await this.updateComplete,this.renderRoot?.querySelector(t)??null}})}function f(t){return(e,i)=>{const{slot:n,selector:r}=t??{},o="slot"+(n?`[name=${n}]`:":not([name])");return d(e,i,{get(){const e=this.renderRoot?.querySelector(o),i=e?.assignedElements(t)??[];return void 0===r?i:i.filter((t=>t.matches(r)))}})}}function g(t){return(e,i)=>{const{slot:n}=t??{},r="slot"+(n?`[name=${n}]`:":not([name])");return d(e,i,{get(){const e=this.renderRoot?.querySelector(r);return e?.assignedNodes(t)??[]}})}}},395:(t,e,i)=>{i.r(e),i.d(e,{Directive:()=>n.Xe,PartType:()=>n.pX,directive:()=>n.XM});var n=i(126)},810:(t,e,i)=>{i.r(e),i.d(e,{AsyncReplaceDirective:()=>f,asyncReplace:()=>g});var n=i(605);const{D:r}=n._$LH;var o=i(126);const s=(t,e)=>{const i=t._$AN;if(void 0===i)return!1;for(const t of i)t._$AO?.(e,!1),s(t,e);return!0},a=t=>{let e,i;do{if(void 0===(e=t._$AM))break;i=e._$AN,i.delete(t),t=e}while(0===i?.size)},l=t=>{for(let e;e=t._$AM;t=e){let i=e._$AN;if(void 0===i)e._$AN=i=new Set;else if(i.has(t))break;i.add(t),u(e)}};function c(t){void 0!==this._$AN?(a(this),this._$AM=t,l(this)):this._$AM=t}function d(t,e=!1,i=0){const n=this._$AH,r=this._$AN;if(void 0!==r&&0!==r.size)if(e)if(Array.isArray(n))for(let t=i;t{t.type==o.pX.CHILD&&(t._$AP??=d,t._$AQ??=c)};class h extends o.Xe{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),l(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(s(this,t),a(this))}setValue(t){if((t=>void 0===this._$Ct.strings)())this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}class m{constructor(t){this.G=t}disconnect(){this.G=void 0}reconnect(t){this.G=t}deref(){return this.G}}class p{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??=new Promise((t=>this.Z=t))}resume(){this.Z?.(),this.Y=this.Z=void 0}}class f extends h{constructor(){super(...arguments),this._$Cq=new m(this),this._$CK=new p}render(t,e){return n.Jb}update(t,[e,i]){if(this.isConnected||this.disconnected(),e===this._$CX)return;this._$CX=e;let r=0;const{_$Cq:o,_$CK:s}=this;return(async(t,e)=>{for await(const i of t)if(!1===await e(i))return})(e,(async t=>{for(;s.get();)await s.get();const n=o.deref();if(void 0!==n){if(n._$CX!==e)return!1;void 0!==i&&(t=i(t,r)),n.commitValue(t,r),r++}return!0})),n.Jb}commitValue(t,e){this.setValue(t)}disconnected(){this._$Cq.disconnect(),this._$CK.pause()}reconnected(){this._$Cq.reconnect(this),this._$CK.resume()}}const g=(0,o.XM)(f)},110:(t,e,i)=>{i.r(e),i.d(e,{CSSResult:()=>n.c3,LitElement:()=>o,ReactiveElement:()=>n.fl,_$LE:()=>a,_$LH:()=>r._$LH,adoptStyles:()=>n.ec,css:()=>n.iv,defaultConverter:()=>n.Ts,getCompatibleStyle:()=>n.i1,html:()=>r.dy,isServer:()=>l,noChange:()=>r.Jb,notEqual:()=>n.Qu,nothing:()=>r.Ld,render:()=>r.sY,supportsAdoptingStyleSheets:()=>n.FV,svg:()=>r.YP,unsafeCSS:()=>n.$m});var n=i(548),r=i(605);class o extends n.fl{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=(0,r.sY)(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return r.Jb}}o._$litElement$=!0,o.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:o});const s=globalThis.litElementPolyfillSupport;s?.({LitElement:o});const a={_$AK:(t,e,i)=>{t._$AK(e,i)},_$AL:t=>t._$AL};(globalThis.litElementVersions??=[]).push("4.0.2");const l=!1},548:(t,e,i)=>{i.d(e,{c3:()=>a,fl:()=>T,ec:()=>d,iv:()=>c,Ts:()=>C,i1:()=>u,Qu:()=>A,FV:()=>r,$m:()=>l});const n=globalThis,r=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),s=new WeakMap;class a{constructor(t,e,i){if(this._$cssResult$=!0,i!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(r&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=s.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&s.set(e,t))}return t}toString(){return this.cssText}}const l=t=>new a("string"==typeof t?t:t+"",void 0,o),c=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[n+1]),t[0]);return new a(i,t,o)},d=(t,e)=>{if(r)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const i of e){const e=document.createElement("style"),r=n.litNonce;void 0!==r&&e.setAttribute("nonce",r),e.textContent=i.cssText,t.appendChild(e)}},u=r?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return l(e)})(t):t,{is:h,defineProperty:m,getOwnPropertyDescriptor:p,getOwnPropertyNames:f,getOwnPropertySymbols:g,getPrototypeOf:v}=Object,y=globalThis,_=y.trustedTypes,$=_?_.emptyScript:"",b=y.reactiveElementPolyfillSupport,w=(t,e)=>t,C={toAttribute(t,e){switch(e){case Boolean:t=t?$:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},A=(t,e)=>!h(t,e),S={attribute:!0,type:String,converter:C,reflect:!1,hasChanged:A};Symbol.metadata??=Symbol("metadata"),y.litPropertyMetadata??=new WeakMap;class T extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=S){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),n=this.getPropertyDescriptor(t,i,e);void 0!==n&&m(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){const{get:n,set:r}=p(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return n?.call(this)},set(e){const o=n?.call(this);r.call(this,e),this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??S}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;const t=v(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){const t=this.properties,e=[...f(t),...g(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(u(t))}else void 0!==t&&e.push(u(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$Eg=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$ES(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$E_??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$E_?.delete(t)}_$ES(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return d(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$E_?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$E_?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e){const i=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,i);if(void 0!==n&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:C).toAttribute(e,i.type);this._$Em=t,null==r?this.removeAttribute(n):this.setAttribute(n,r),this._$Em=null}}_$AK(t,e){const i=this.constructor,n=i._$Eh.get(t);if(void 0!==n&&this._$Em!==n){const t=i.getPropertyOptions(n),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:C;this._$Em=n,this[n]=r.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,i,n=!1,r){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??A)(n?r:this[t],e))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$Eg=this._$EP())}C(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t)!0!==i.wrapped||this._$AL.has(e)||void 0===this[e]||this.C(e,this[e],i)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$E_?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$ET()}catch(e){throw t=!1,this._$ET(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$E_?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EO(t,this[t]))),this._$ET()}updated(t){}firstUpdated(t){}}T.elementStyles=[],T.shadowRootOptions={mode:"open"},T[w("elementProperties")]=new Map,T[w("finalized")]=new Map,b?.({ReactiveElement:T}),(y.reactiveElementVersions??=[]).push("2.0.2")},126:(t,e,i)=>{i.d(e,{XM:()=>r,Xe:()=>o,pX:()=>n});const n={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},r=t=>(...e)=>({_$litDirective$:t,values:e});class o{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}},605:(t,e,i)=>{i.d(e,{Jb:()=>T,Ld:()=>E,YP:()=>S,_$LH:()=>U,dy:()=>A,sY:()=>G});const n=globalThis,r=n.trustedTypes,o=r?r.createPolicy("lit-html",{createHTML:t=>t}):void 0,s="$lit$",a=`lit$${(Math.random()+"").slice(9)}$`,l="?"+a,c=`<${l}>`,d=document,u=()=>d.createComment(""),h=t=>null===t||"object"!=typeof t&&"function"!=typeof t,m=Array.isArray,p=t=>m(t)||"function"==typeof t?.[Symbol.iterator],f="[ \t\n\f\r]",g=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,y=/>/g,_=RegExp(`>|${f}(?:([^\\s"'>=/]+)(${f}*=${f}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),$=/'/g,b=/"/g,w=/^(?:script|style|textarea|title)$/i,C=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),A=C(1),S=C(2),T=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),D=new WeakMap,x=d.createTreeWalker(d,129);function R(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==o?o.createHTML(e):e}const k=(t,e)=>{const i=t.length-1,n=[];let r,o=2===e?"":"",l=g;for(let e=0;e"===u[0]?(l=r??g,h=-1):void 0===u[1]?h=-2:(h=l.lastIndex-u[2].length,d=u[1],l=void 0===u[3]?_:'"'===u[3]?b:$):l===b||l===$?l=_:l===v||l===y?l=g:(l=_,r=void 0);const p=l===_&&t[e+1].startsWith("/>")?" ":"";o+=l===g?i+c:h>=0?(n.push(d),i.slice(0,h)+s+i.slice(h)+a+p):i+a+(-2===h?e:p)}return[R(t,o+(t[i]||"")+(2===e?"":"")),n]};class O{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let o=0,c=0;const d=t.length-1,h=this.parts,[m,p]=k(t,e);if(this.el=O.createElement(m,i),x.currentNode=this.el.content,2===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=x.nextNode())&&h.length0){n.textContent=r?r.emptyScript:"";for(let i=0;i2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=E}_$AI(t,e=this,i,n){const r=this.strings;let o=!1;if(void 0===r)t=P(this,t,e,0),o=!h(t)||t!==this._$AH&&t!==T,o&&(this._$AH=t);else{const n=t;let s,a;for(t=r[0],s=0;s{const n=i?.renderBefore??e;let r=n._$litPart$;if(void 0===r){const t=i?.renderBefore??null;n._$litPart$=r=new M(e.insertBefore(u(),t),t,void 0,i??{})}return r._$AI(t),r}},147:t=>{t.exports=JSON.parse('{"name":"formulaone-card","version":"1.9.3","description":"Frontend card for Home Assistant to display Formula One data","main":"index.js","scripts":{"lint":"eslint src/**/*.ts","dev":"webpack -c webpack.config.js","build":"yarn lint && webpack -c webpack.config.js","test":"jest","coverage":"jest --coverage","workflow":"jest --coverage --json --outputFile=/home/runner/work/formulaone-card/formulaone-card/jest.results.json","prebuild":"copy git-hooks\\\\pre-commit .git\\\\hooks\\\\ && echo \'hook copied\'"},"repository":{"type":"git","url":"git+https://github.com/marcokreeft87/formulaone-card.git"},"keywords":[],"author":"","license":"ISC","bugs":{"url":"https://github.com/marcokreeft87/formulaone-card/issues"},"homepage":"https://github.com/marcokreeft87/formulaone-card#readme","devDependencies":{"@types/jest":"^29.5.3","@typescript-eslint/eslint-plugin":"^5.59.8","@typescript-eslint/parser":"^5.62.0","codecov":"^3.8.3","eslint":"^8.52.0","home-assistant-js-websocket":"^9.1.0","lit":"^3.0.2","lit-element":"^3.3.3","minify-html-literals-loader":"^1.1.1","typescript":"^4.9.5","webpack":"^5.89.0","webpack-cli":"^5.1.4"},"dependencies":{"@babel/plugin-transform-runtime":"^7.22.5","@babel/preset-env":"^7.23.8","@lit-labs/scoped-registry-mixin":"^1.0.1","@marcokreeft/ha-editor-formbuilder":"^2023.10.9","babel-jest":"^29.7.0","compression-webpack-plugin":"^10.0.0","custom-card-helpers":"^1.9.0","isomorphic-fetch":"^3.0.0","jest-environment-jsdom":"^29.6.2","jest-fetch-mock":"^3.0.3","jest-ts-auto-mock":"^2.1.0","minify-html-literals-loader":"^1.1.1","ts-auto-mock":"^3.6.4","ts-jest":"^29.1.1","ts-loader":"^9.5.1","ttypescript":"^1.5.15","yarn":"^1.22.21"}}')}},e={};function i(n){var r=e[n];if(void 0!==r)return r.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,i),o.exports}i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i(148)})(); \ No newline at end of file +(()=>{"use strict";var t={898:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0});const n=i(313),r=i(11),o=i(194),s=i(382);class a extends r.LitElement{constructor(){super(...arguments),this.controlRenderers={[o.FormControlType.Dropdown]:s.renderDropdown,[o.FormControlType.Radio]:s.renderRadio,[o.FormControlType.Checkboxes]:s.renderCheckboxes,[o.FormControlType.EntityDropdown]:s.renderDropdown,[o.FormControlType.Switch]:s.renderSwitch,[o.FormControlType.Textbox]:s.renderTextbox,[o.FormControlType.Filler]:s.renderFiller}}setConfig(t){this._config=t}set hass(t){this._hass=t}renderForm(t){return r.html`
${t.map((t=>{const e=t.cssClass?`form-row ${t.cssClass}`:"form-row";return t.hidden?"":r.html`
${t.controls.map((t=>this.renderControl(t)))}
`}))}
`}renderControl(t){const e=this.controlRenderers[t.type];if(!e)throw new Error(`Unsupported control type: ${t.type}`);return e(this,t)}_valueChanged(t){if(!this._config||!this._hass)return;const e=t.target,i=t.detail;if("HA-CHECKBOX"===e.tagName){const t=this._config[e.configValue].indexOf(e.value);e.checked&&t<0?this._config[e.configValue]=[...this._config[e.configValue],e.value]:!e.checked&&t>-1&&(this._config[e.configValue]=[...this._config[e.configValue].slice(0,t),...this._config[e.configValue].slice(t+1)])}else if(e.configValue)if(e.configValue.indexOf(".")>-1){const[t,i]=e.configValue.split(".");this._config={...this._config,[t]:{...this._config[t],[i]:e.checked}}}else this._config={...this._config,[e.configValue]:void 0===e.checked&&(null==i?void 0:i.value)?e.checked||i.value:e.value||e.checked};(0,n.fireEvent)(this,"config-changed",{config:this._config},{bubbles:!0,composed:!0}),this.requestUpdate("_config")}static get styles(){return r.css`.form-row{margin-bottom:10px}.form-control{display:flex;align-items:center}ha-switch{padding:16px 6px}.side-by-side{display:flex;flex-flow:row wrap}.side-by-side>label{width:100%}.side-by-side>.form-control{width:49%;padding:2px}ha-textfield{width:100%}`}}e.default=a},194:(t,e)=>{var i;Object.defineProperty(e,"__esModule",{value:!0}),e.FormControlType=void 0,function(t){t.Dropdown="dropdown",t.Checkbox="checkbox",t.Checkboxes="checkboxes",t.Radio="radio",t.Switch="switch",t.Textbox="textbox",t.Filler="filler",t.EntityDropdown="entity-dropdown"}(i||(e.FormControlType=i={}))},382:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.renderCheckboxes=e.renderRadio=e.renderDropdown=e.renderSwitch=e.renderTextbox=e.renderEntityDropdown=e.renderFiller=void 0;const n=i(11),r=i(429);e.renderFiller=()=>n.html`
`,e.renderEntityDropdown=(t,e)=>{var i;return n.html`
`},e.renderTextbox=(t,e)=>{var i;return n.html`
`},e.renderSwitch=(t,e)=>n.html`
`,e.renderDropdown=(t,e)=>{var i;const o=null!==(i=e.items)&&void 0!==i?i:(0,r.getEntitiesByDomain)(t._hass,e.domain);return n.html`
`},e.renderRadio=(t,e)=>n.html`
${e.items.map((i=>n.html``))}
`,e.renderCheckboxes=(t,e)=>n.html` ${e.items.map((i=>{var r;return n.html`
`}))}`},429:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getDropdownOptionsFromEnum=e.formatList=e.getEntitiesByDeviceClass=e.getEntitiesByDomain=void 0,e.getEntitiesByDomain=(t,i)=>Object.keys(t.states).filter((t=>t.substr(0,t.indexOf("."))===i)).map((i=>(0,e.formatList)(i,t))),e.getEntitiesByDeviceClass=(t,i,n)=>Object.keys(t.states).filter((e=>e.substr(0,e.indexOf("."))===i&&t.states[e].attributes.device_class===n)).map((i=>(0,e.formatList)(i,t))),e.formatList=(t,e)=>({label:e.states[t].attributes.friendly_name,value:t}),e.getDropdownOptionsFromEnum=t=>{const e=[];for(const[i,n]of Object.entries(t))e.push({value:n,label:i});return e}},313:(t,e,i)=>{i.r(e),i.d(e,{DEFAULT_DOMAIN_ICON:()=>J,DEFAULT_PANEL:()=>X,DEFAULT_VIEW_ENTITY_ID:()=>at,DOMAINS_HIDE_MORE_INFO:()=>et,DOMAINS_MORE_INFO_NO_HISTORY:()=>it,DOMAINS_TOGGLE:()=>rt,DOMAINS_WITH_CARD:()=>Z,DOMAINS_WITH_MORE_INFO:()=>tt,NumberFormat:()=>n,STATES_OFF:()=>nt,TimeFormat:()=>r,UNIT_C:()=>ot,UNIT_F:()=>st,applyThemesOnElement:()=>L,computeCardSize:()=>H,computeDomain:()=>j,computeEntity:()=>U,computeRTL:()=>V,computeRTLDirection:()=>G,computeStateDisplay:()=>K,computeStateDomain:()=>B,createThing:()=>ut,debounce:()=>ht,domainIcon:()=>pt,evaluateFilter:()=>ft,fireEvent:()=>lt,fixedIcons:()=>mt,formatDate:()=>d,formatDateMonth:()=>y,formatDateMonthYear:()=>g,formatDateNumeric:()=>h,formatDateShort:()=>p,formatDateTime:()=>C,formatDateTimeNumeric:()=>E,formatDateTimeWithSeconds:()=>S,formatDateWeekday:()=>l,formatDateYear:()=>$,formatNumber:()=>Y,formatTime:()=>x,formatTimeWeekday:()=>P,formatTimeWithSeconds:()=>k,forwardHaptic:()=>gt,getLovelace:()=>Et,handleAction:()=>bt,handleActionConfig:()=>$t,handleClick:()=>wt,hasAction:()=>Ct,hasConfigOrEntityChanged:()=>At,hasDoubleClick:()=>St,isNumericState:()=>q,navigate:()=>vt,numberFormatToLocale:()=>z,relativeTime:()=>M,round:()=>W,stateIcon:()=>Rt,timerTimeRemaining:()=>F,toggleEntity:()=>_t,turnOnOffEntities:()=>Tt,turnOnOffEntity:()=>yt});var n,r,o,s=function(){return s=Object.assign||function(t){for(var e,i=1,n=arguments.length;i0)return{value:Math.round(h),unit:"year"};var m=12*h+d.getMonth()-u.getMonth();if(Math.round(Math.abs(m))>0)return{value:Math.round(m),unit:"month"};var p=r/604800;return{value:Math.round(p),unit:"week"}}(t,i);return n?function(t){return new Intl.RelativeTimeFormat(t.language,{numeric:"auto"})}(e).format(r.value,r.unit):Intl.NumberFormat(e.language,{style:"unit",unit:r.unit,unitDisplay:"long"}).format(Math.abs(r.value))};function F(t){var e,i=3600*(e=t.attributes.remaining.split(":").map(Number))[0]+60*e[1]+e[2];if("active"===t.state){var n=(new Date).getTime(),r=new Date(t.last_changed).getTime();i=Math.max(i-(n-r)/1e3,0)}return i}function I(){return(I=Object.assign||function(t){for(var e=1;e-1?t.split(".")[1].length:0;i.minimumFractionDigits=n,i.maximumFractionDigits=n}return i},K=function(t,e,i,n){var r=void 0!==n?n:e.state;if("unknown"===r||"unavailable"===r)return t("state.default."+r);if(q(e)){if("monetary"===e.attributes.device_class)try{return Y(r,i,{style:"currency",currency:e.attributes.unit_of_measurement})}catch(t){}return Y(r,i)+(e.attributes.unit_of_measurement?" "+e.attributes.unit_of_measurement:"")}var o=B(e);if("input_datetime"===o){var s;if(void 0===n)return e.attributes.has_date&&e.attributes.has_time?(s=new Date(e.attributes.year,e.attributes.month-1,e.attributes.day,e.attributes.hour,e.attributes.minute),C(s,i)):e.attributes.has_date?(s=new Date(e.attributes.year,e.attributes.month-1,e.attributes.day),d(s,i)):e.attributes.has_time?((s=new Date).setHours(e.attributes.hour,e.attributes.minute),x(s,i)):e.state;try{var a=n.split(" ");if(2===a.length)return C(new Date(a.join("T")),i);if(1===a.length){if(n.includes("-"))return d(new Date(n+"T00:00"),i);if(n.includes(":")){var l=new Date;return x(new Date(l.toISOString().split("T")[0]+"T"+n),i)}}return n}catch(t){return n}}return"humidifier"===o&&"on"===r&&e.attributes.humidity?e.attributes.humidity+" %":"counter"===o||"number"===o||"input_number"===o?Y(r,i):e.attributes.device_class&&t("component."+o+".state."+e.attributes.device_class+"."+r)||t("component."+o+".state._."+r)||r},J="mdi:bookmark",X="lovelace",Z=["climate","cover","configurator","input_select","input_number","input_text","lock","media_player","scene","script","timer","vacuum","water_heater","weblink"],tt=["alarm_control_panel","automation","camera","climate","configurator","cover","fan","group","history_graph","input_datetime","light","lock","media_player","script","sun","updater","vacuum","water_heater","weather"],et=["input_number","input_select","input_text","scene","weblink"],it=["camera","configurator","history_graph","scene"],nt=["closed","locked","off"],rt=new Set(["fan","input_boolean","light","switch","group","automation"]),ot="°C",st="°F",at="group.default_view",lt=function(t,e,i,n){n=n||{},i=null==i?{}:i;var r=new Event(e,{bubbles:void 0===n.bubbles||n.bubbles,cancelable:Boolean(n.cancelable),composed:void 0===n.composed||n.composed});return r.detail=i,t.dispatchEvent(r),r},ct=new Set(["call-service","divider","section","weblink","cast","select"]),dt={alert:"toggle",automation:"toggle",climate:"climate",cover:"cover",fan:"toggle",group:"group",input_boolean:"toggle",input_number:"input-number",input_select:"input-select",input_text:"input-text",light:"toggle",lock:"lock",media_player:"media-player",remote:"toggle",scene:"scene",script:"script",sensor:"sensor",timer:"timer",switch:"toggle",vacuum:"toggle",water_heater:"climate",input_datetime:"input-datetime"},ut=function(t,e){void 0===e&&(e=!1);var i=function(t,e){return n("hui-error-card",{type:"error",error:t,config:e})},n=function(t,e){var n=window.document.createElement(t);try{if(!n.setConfig)return;n.setConfig(e)}catch(n){return console.error(t,n),i(n.message,e)}return n};if(!t||"object"!=typeof t||!e&&!t.type)return i("No type defined",t);var r=t.type;if(r&&r.startsWith("custom:"))r=r.substr(7);else if(e)if(ct.has(r))r="hui-"+r+"-row";else{if(!t.entity)return i("Invalid config given.",t);var o=t.entity.split(".",1)[0];r="hui-"+(dt[o]||"text")+"-entity-row"}else r="hui-"+r+"-card";if(customElements.get(r))return n(r,t);var s=i("Custom element doesn't exist: "+t.type+".",t);s.style.display="None";var a=setTimeout((function(){s.style.display=""}),2e3);return customElements.whenDefined(t.type).then((function(){clearTimeout(a),lt(s,"ll-rebuild",{},s)})),s},ht=function(t,e,i){var n;return void 0===i&&(i=!1),function(){var r=[].slice.call(arguments),o=this,s=i&&!n;clearTimeout(n),n=setTimeout((function(){n=null,i||t.apply(o,r)}),e),s&&t.apply(o,r)}},mt={alert:"mdi:alert",automation:"mdi:playlist-play",calendar:"mdi:calendar",camera:"mdi:video",climate:"mdi:thermostat",configurator:"mdi:settings",conversation:"mdi:text-to-speech",device_tracker:"mdi:account",fan:"mdi:fan",group:"mdi:google-circles-communities",history_graph:"mdi:chart-line",homeassistant:"mdi:home-assistant",homekit:"mdi:home-automation",image_processing:"mdi:image-filter-frames",input_boolean:"mdi:drawing",input_datetime:"mdi:calendar-clock",input_number:"mdi:ray-vertex",input_select:"mdi:format-list-bulleted",input_text:"mdi:textbox",light:"mdi:lightbulb",mailbox:"mdi:mailbox",notify:"mdi:comment-alert",person:"mdi:account",plant:"mdi:flower",proximity:"mdi:apple-safari",remote:"mdi:remote",scene:"mdi:google-pages",script:"mdi:file-document",sensor:"mdi:eye",simple_alarm:"mdi:bell",sun:"mdi:white-balance-sunny",switch:"mdi:flash",timer:"mdi:timer",updater:"mdi:cloud-upload",vacuum:"mdi:robot-vacuum",water_heater:"mdi:thermometer",weblink:"mdi:open-in-new"};function pt(t,e){if(t in mt)return mt[t];switch(t){case"alarm_control_panel":switch(e){case"armed_home":return"mdi:bell-plus";case"armed_night":return"mdi:bell-sleep";case"disarmed":return"mdi:bell-outline";case"triggered":return"mdi:bell-ring";default:return"mdi:bell"}case"binary_sensor":return e&&"off"===e?"mdi:radiobox-blank":"mdi:checkbox-marked-circle";case"cover":return"closed"===e?"mdi:window-closed":"mdi:window-open";case"lock":return e&&"unlocked"===e?"mdi:lock-open":"mdi:lock";case"media_player":return e&&"off"!==e&&"idle"!==e?"mdi:cast-connected":"mdi:cast";case"zwave":switch(e){case"dead":return"mdi:emoticon-dead";case"sleeping":return"mdi:sleep";case"initializing":return"mdi:timer-sand";default:return"mdi:z-wave"}default:return console.warn("Unable to find icon for domain "+t+" ("+e+")"),"mdi:bookmark"}}var ft=function(t,e){var i=e.value||e,n=e.attribute?t.attributes[e.attribute]:t.state;switch(e.operator||"=="){case"==":return n===i;case"<=":return n<=i;case"<":return n=":return n>=i;case">":return n>i;case"!=":return n!==i;case"regex":return n.match(i);default:return!1}},gt=function(t){lt(window,"haptic",t)},vt=function(t,e,i){void 0===i&&(i=!1),i?history.replaceState(null,"",e):history.pushState(null,"",e),lt(window,"location-changed",{replace:i})},yt=function(t,e,i){void 0===i&&(i=!0);var n,r=j(e),o="group"===r?"homeassistant":r;switch(r){case"lock":n=i?"unlock":"lock";break;case"cover":n=i?"open_cover":"close_cover";break;default:n=i?"turn_on":"turn_off"}return t.callService(o,n,{entity_id:e})},_t=function(t,e){var i=nt.includes(t.states[e].state);return yt(t,e,i)},$t=function(t,e,i,n){if(n||(n={action:"more-info"}),!n.confirmation||n.confirmation.exemptions&&n.confirmation.exemptions.some((function(t){return t.user===e.user.id}))||(gt("warning"),confirm(n.confirmation.text||"Are you sure you want to "+n.action+"?")))switch(n.action){case"more-info":(i.entity||i.camera_image)&<(t,"hass-more-info",{entityId:i.entity?i.entity:i.camera_image});break;case"navigate":n.navigation_path&&vt(0,n.navigation_path);break;case"url":n.url_path&&window.open(n.url_path);break;case"toggle":i.entity&&(_t(e,i.entity),gt("success"));break;case"call-service":if(!n.service)return void gt("failure");var r=n.service.split(".",2);e.callService(r[0],r[1],n.service_data,n.target),gt("success");break;case"fire-dom-event":lt(t,"ll-custom",n)}},bt=function(t,e,i,n){var r;"double_tap"===n&&i.double_tap_action?r=i.double_tap_action:"hold"===n&&i.hold_action?r=i.hold_action:"tap"===n&&i.tap_action&&(r=i.tap_action),$t(t,e,i,r)},wt=function(t,e,i,n,r){var o;if(r&&i.double_tap_action?o=i.double_tap_action:n&&i.hold_action?o=i.hold_action:!n&&i.tap_action&&(o=i.tap_action),o||(o={action:"more-info"}),!o.confirmation||o.confirmation.exemptions&&o.confirmation.exemptions.some((function(t){return t.user===e.user.id}))||confirm(o.confirmation.text||"Are you sure you want to "+o.action+"?"))switch(o.action){case"more-info":(o.entity||i.entity||i.camera_image)&&(lt(t,"hass-more-info",{entityId:o.entity?o.entity:i.entity?i.entity:i.camera_image}),o.haptic&>(o.haptic));break;case"navigate":o.navigation_path&&(vt(0,o.navigation_path),o.haptic&>(o.haptic));break;case"url":o.url_path&&window.open(o.url_path),o.haptic&>(o.haptic);break;case"toggle":i.entity&&(_t(e,i.entity),o.haptic&>(o.haptic));break;case"call-service":if(!o.service)return;var s=o.service.split(".",2),a=s[0],l=s[1],c=I({},o.service_data);"entity"===c.entity_id&&(c.entity_id=i.entity),e.callService(a,l,c,o.target),o.haptic&>(o.haptic);break;case"fire-dom-event":lt(t,"ll-custom",o),o.haptic&>(o.haptic)}};function Ct(t){return void 0!==t&&"none"!==t.action}function At(t,e,i){if(e.has("config")||i)return!0;if(t.config.entity){var n=e.get("hass");return!n||n.states[t.config.entity]!==t.hass.states[t.config.entity]}return!1}function St(t){return void 0!==t&&"none"!==t.action}var Tt=function(t,e,i){void 0===i&&(i=!0);var n={};e.forEach((function(e){if(nt.includes(t.states[e].state)===i){var r=j(e),o=["cover","lock"].includes(r)?r:"homeassistant";o in n||(n[o]=[]),n[o].push(e)}})),Object.keys(n).forEach((function(e){var r;switch(e){case"lock":r=i?"unlock":"lock";break;case"cover":r=i?"open_cover":"close_cover";break;default:r=i?"turn_on":"turn_off"}t.callService(e,r,{entity_id:n[e]})}))},Et=function(){var t=document.querySelector("home-assistant");if(t=(t=(t=(t=(t=(t=(t=(t=t&&t.shadowRoot)&&t.querySelector("home-assistant-main"))&&t.shadowRoot)&&t.querySelector("app-drawer-layout partial-panel-resolver"))&&t.shadowRoot||t)&&t.querySelector("ha-panel-lovelace"))&&t.shadowRoot)&&t.querySelector("hui-root")){var e=t.lovelace;return e.current_view=t.___curView,e}return null},Dt={humidity:"mdi:water-percent",illuminance:"mdi:brightness-5",temperature:"mdi:thermometer",pressure:"mdi:gauge",power:"mdi:flash",signal_strength:"mdi:wifi"},xt={binary_sensor:function(t,e){var i="off"===t;switch(null==e?void 0:e.attributes.device_class){case"battery":return i?"mdi:battery":"mdi:battery-outline";case"battery_charging":return i?"mdi:battery":"mdi:battery-charging";case"cold":return i?"mdi:thermometer":"mdi:snowflake";case"connectivity":return i?"mdi:server-network-off":"mdi:server-network";case"door":return i?"mdi:door-closed":"mdi:door-open";case"garage_door":return i?"mdi:garage":"mdi:garage-open";case"power":case"plug":return i?"mdi:power-plug-off":"mdi:power-plug";case"gas":case"problem":case"safety":case"tamper":return i?"mdi:check-circle":"mdi:alert-circle";case"smoke":return i?"mdi:check-circle":"mdi:smoke";case"heat":return i?"mdi:thermometer":"mdi:fire";case"light":return i?"mdi:brightness-5":"mdi:brightness-7";case"lock":return i?"mdi:lock":"mdi:lock-open";case"moisture":return i?"mdi:water-off":"mdi:water";case"motion":return i?"mdi:walk":"mdi:run";case"occupancy":case"presence":return i?"mdi:home-outline":"mdi:home";case"opening":return i?"mdi:square":"mdi:square-outline";case"running":return i?"mdi:stop":"mdi:play";case"sound":return i?"mdi:music-note-off":"mdi:music-note";case"update":return i?"mdi:package":"mdi:package-up";case"vibration":return i?"mdi:crop-portrait":"mdi:vibrate";case"window":return i?"mdi:window-closed":"mdi:window-open";default:return i?"mdi:radiobox-blank":"mdi:checkbox-marked-circle"}},cover:function(t){var e="closed"!==t.state;switch(t.attributes.device_class){case"garage":return e?"mdi:garage-open":"mdi:garage";case"door":return e?"mdi:door-open":"mdi:door-closed";case"shutter":return e?"mdi:window-shutter-open":"mdi:window-shutter";case"blind":return e?"mdi:blinds-open":"mdi:blinds";case"window":return e?"mdi:window-open":"mdi:window-closed";default:return pt("cover",t.state)}},sensor:function(t){var e=t.attributes.device_class;if(e&&e in Dt)return Dt[e];if("battery"===e){var i=Number(t.state);if(isNaN(i))return"mdi:battery-unknown";var n=10*Math.round(i/10);return n>=100?"mdi:battery":n<=0?"mdi:battery-alert":"hass:battery-"+n}var r=t.attributes.unit_of_measurement;return"°C"===r||"°F"===r?"mdi:thermometer":pt("sensor")},input_datetime:function(t){return t.attributes.has_date?t.attributes.has_time?pt("input_datetime"):"mdi:calendar":"mdi:clock"}},Rt=function(t){if(!t)return"mdi:bookmark";if(t.attributes.icon)return t.attributes.icon;var e=j(t.entity_id);return e in xt?xt[e](t):pt(e,t.state)}},694:function(t,e){var i=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}l((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.ClientBase=void 0,e.ClientBase=class{GetData(t,e,n){return i(this,void 0,void 0,(function*(){const i=localStorage.getItem(t);if(i&&e){const t=JSON.parse(i),e=new Date;if(e.setHours(e.getHours()-n),new Date(t.created)>e)return JSON.parse(t.data)}const r=yield fetch(`${this.baseUrl}/${t}`,{headers:{Accept:"application/json"}});if(!r||!r.ok)return Promise.reject(r);const o=yield r.json(),s={data:JSON.stringify(o),created:new Date};return e&&localStorage.setItem(t,JSON.stringify(s)),o}))}}},470:function(t,e,i){var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}l((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const r=i(438),o=i(694);class s extends o.ClientBase{constructor(){super(...arguments),this.baseUrl="https://api.jolpi.ca/ergast/f1"}GetSchedule(t){return n(this,void 0,void 0,(function*(){return(yield this.GetData(`${t}.json`,!0,72)).MRData.RaceTable.Races}))}GetLastResult(){return n(this,void 0,void 0,(function*(){const t=(0,r.getRefreshTime)("current/last/results.json");return(yield this.GetData("current/last/results.json",!0,t)).MRData.RaceTable.Races[0]}))}GetDriverStandings(){return n(this,void 0,void 0,(function*(){const t=(0,r.getRefreshTime)("current/driverStandings.json");return(yield this.GetData("current/driverStandings.json",!0,t)).MRData.StandingsTable.StandingsLists[0].DriverStandings}))}GetConstructorStandings(){return n(this,void 0,void 0,(function*(){const t=(0,r.getRefreshTime)("current/constructorStandings.json");return(yield this.GetData("current/constructorStandings.json",!0,t)).MRData.StandingsTable.StandingsLists[0].ConstructorStandings}))}GetSprintResults(t,e){return n(this,void 0,void 0,(function*(){return(yield this.GetData(`${t}/${e}/sprint.json`,!1,0)).MRData.RaceTable}))}GetQualifyingResults(t,e){return n(this,void 0,void 0,(function*(){return(yield this.GetData(`${t}/${e}/qualifying.json`,!1,0)).MRData.RaceTable}))}GetResults(t,e){return n(this,void 0,void 0,(function*(){return(yield this.GetData(`${t}/${e}/results.json`,!1,0)).MRData.RaceTable}))}GetSeasons(){return n(this,void 0,void 0,(function*(){return(yield this.GetData("seasons.json?limit=200",!0,72)).MRData.SeasonTable.Seasons}))}GetSeasonRaces(t){return n(this,void 0,void 0,(function*(){return(yield this.GetData(`${t}.json`,!0,72)).MRData.RaceTable.Races}))}GetLastYearsResults(t){return n(this,void 0,void 0,(function*(){const e=(new Date).getFullYear()-1,i=(yield this.GetData(`${e}.json`,!0,72)).MRData.RaceTable.Races.findIndex((e=>e.Circuit.circuitName===t))+1;return(yield this.GetData(`${e}/${i}/results.json`,!1,0)).MRData.RaceTable.Races[0]}))}RefreshCache(){return n(this,void 0,void 0,(function*(){yield this.GetData("current.json",!0,0),yield this.GetData("current/last/results.json",!0,0),yield this.GetData("current/driverStandings.json",!0,0),yield this.GetData("current/constructorStandings.json",!0,0)}))}}e.default=s},661:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=class{GetImage(t){const e=localStorage.getItem(t);if(e){const t=JSON.parse(e),i=new Date;if(i.setHours(i.getHours()-672),new Date(t.created)>i)return t.data}return fetch(t).then((t=>t.blob())).then((e=>{const i=new FileReader;i.readAsDataURL(e),i.onloadend=function(){const e={data:i.result,created:new Date};return localStorage.setItem(t,JSON.stringify(e)),e.data}})),t}}},959:function(t,e,i){var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}l((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const r=i(694);class o extends r.ClientBase{constructor(){super(...arguments),this.baseUrl="https://restcountries.com/v2"}GetAll(){return n(this,void 0,void 0,(function*(){return yield this.GetData("all",!0,730)}))}GetCountriesFromLocalStorage(){const t=localStorage.getItem("all");if(t){const e=JSON.parse(t);return JSON.parse(e.data)}return[]}}e.default=o},267:function(t,e,i){var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}l((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const r=i(694);class o extends r.ClientBase{constructor(t,e){super(),this.unitGroup="metric",this.baseUrl="https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline",this.apiKey=t,this.unitGroup=null!=e?e:this.unitGroup}getWeatherData(t,e,i){return n(this,void 0,void 0,(function*(){const n=`${t},${e}/${i}?unitGroup=${this.unitGroup}&key=${this.apiKey}&contentType=json`;return yield this.GetData(n,!0,1)}))}}e.default=o},366:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BaseCard=void 0;const n=i(470),r=i(661),o=i(267);e.BaseCard=class{constructor(t){var e,i;this.config=t.config,this.client=new n.default,this.hass=t._hass,this.parent=t,this.weatherClient=new o.default(null!==(i=null===(e=this.config.weather_options)||void 0===e?void 0:e.api_key)&&void 0!==i?i:""),this.imageClient=new r.default}translation(t){return!this.config.translations||Object.keys(this.config.translations).indexOf(t)<0?this.defaultTranslations[t]:this.config.translations[t]}getProperties(){var t,e;const i=null===(t=this.parent.properties)||void 0===t?void 0:t.get("cardValues");return{races:null==i?void 0:i.races,selectedRace:null==i?void 0:i.selectedRace,selectedSeason:null==i?void 0:i.selectedSeason,selectedTabIndex:null!==(e=null==i?void 0:i.selectedTabIndex)&&void 0!==e?e:0}}getParentCardValues(){var t,e;const i=null!==(t=this.parent.properties)&&void 0!==t?t:new Map;return{properties:null!==(e=i.get("cardValues"))&&void 0!==e?e:{},cardValues:i}}}},169:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0});const n=i(639),r=i(557),o=i(438),s=i(366);class a extends s.BaseCard{constructor(t){super(t),this.defaultTranslations={constructor:"Constructor",points:"Pts",wins:"Wins"}}cardSize(){return 11}renderStandingRow(t){var e;return n.html`${t.position}${(null===(e=this.config.standings)||void 0===e?void 0:e.show_teamlogo)?n.html` `:""}${t.Constructor.name}${t.points}${t.wins}`}render(){return n.html`${(0,r.until)(this.client.GetConstructorStandings().then((t=>n.html`${(0,o.reduceArray)(t,this.config.row_limit).map((t=>this.renderStandingRow(t)))}
 ${this.translation("constructor")}${this.translation("points")}${this.translation("wins")}
`)).catch((()=>n.html`${(0,o.getApiErrorMessage)("standings")}`)),n.html`${(0,o.getApiLoadingMessage)()}`)}`}}e.default=a},849:function(t,e,i){var n=this&&this.__await||function(t){return this instanceof n?(this.v=t,this):new n(t)},r=this&&this.__asyncGenerator||function(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=i.apply(t,e||[]),s=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){o[t]&&(r[t]=function(e){return new Promise((function(i,n){s.push([t,e,i,n])>1||l(t,e)}))})}function l(t,e){try{(i=o[t](e)).value instanceof n?Promise.resolve(i.value.v).then(c,d):u(s[0][2],i)}catch(t){u(s[0][3],t)}var i}function c(t){l("next",t)}function d(t){l("throw",t)}function u(t,e){t(e),s.shift(),s.length&&l(s[0][0],s[0][1])}};Object.defineProperty(e,"__esModule",{value:!0});const o=i(639),s=i(557),a=i(438),l=i(366),c=i(810),d=i(313),u=i(22),h=i(241);class m extends l.BaseCard{constructor(t){var e;super(t),this.defaultTranslations={days:"d",hours:"h",minutes:"m",seconds:"s",endofseason:"Season is over. See you next year!",racenow:"We are racing!",date:"Date",practice1:"Practice 1",practice2:"Practice 2",practice3:"Practice 3",race:"Race",racename:"Race name",circuitname:"Circuit name",location:"Location",city:"City",racetime:"Race",sprint:"Sprint",qualifying:"Qualifying",until:"Until"},this.config.countdown_type=null!==(e=this.config.countdown_type)&&void 0!==e?e:h.CountdownType.Race}cardSize(){return this.config.show_raceinfo?12:6}renderHeader(t,e){return this.config.show_raceinfo?o.html`${(0,a.renderRaceInfo)(this,t,e)}
${(0,a.renderHeader)(this,t,!0)}
`:null}countDownTillDate(t){return r(this,arguments,(function*(){for(;t>new Date;){const e=(new Date).getTime(),i=t.getTime()-e,r=Math.floor(i/864e5),o=Math.floor(i%864e5/36e5),s=Math.floor(i%36e5/6e4),a=Math.floor(i%6e4/1e3);yield yield n(`${r}${this.translation("days")} ${o}${this.translation("hours")} ${s}${this.translation("minutes")} ${a}${this.translation("seconds")} `),yield n(new Promise((t=>setTimeout(t,1e3))))}yield yield n(this.translation("racenow"))}))}render(){const t=t=>{this.hass&&this.config.actions&&t.detail.action&&(0,a.clickHandler)(this.parent,this.config,this.hass,t)};return o.html`${(0,s.until)(this.client.GetSchedule((new Date).getFullYear()).then((e=>{var i,n;const{nextRace:r,raceDateTime:s,countdownType:l}=this.getNextEvent(e);if(!r)return(0,a.getEndOfSeasonMessage)(this.translation("endofseason"));const h=this.countDownTillDate(s),m=void 0!==this.config.actions;return o.html`${Array.isArray(this.config.countdown_type)&&this.config.countdown_type.length>1?o.html``:null}

   ${r.round} : ${r.raceName}

${(0,c.asyncReplace)(h)}

${this.translation("until")} ${this.translation(l.toLowerCase())}

${this.renderHeader(r,s)}`})).catch((()=>o.html`${(0,a.getApiErrorMessage)("next race")}`)),o.html`${(0,a.getApiLoadingMessage)()}`)}`}getNextEvent(t){var e;const i=t.filter((t=>{const e=new Date(t.date+"T"+t.time);return e.setHours(e.getHours()+3),e>=new Date}))[0];let n=null,r=this.config.countdown_type;if(i){const t=this.config.countdown_type,o=[{Date:new Date(i.FirstPractice.date+"T"+i.FirstPractice.time),Type:h.CountdownType.Practice1},{Date:new Date(i.SecondPractice.date+"T"+i.SecondPractice.time),Type:h.CountdownType.Practice2},{Date:i.ThirdPractice?new Date(i.ThirdPractice.date+"T"+i.ThirdPractice.time):null,Type:h.CountdownType.Practice3},{Date:i.Sprint?new Date(i.Sprint.date+"T"+i.Sprint.time):null,Type:h.CountdownType.Sprint},{Date:new Date(i.Qualifying.date+"T"+i.Qualifying.time),Type:h.CountdownType.Qualifying},{Date:new Date(i.date+"T"+i.time),Type:h.CountdownType.Race}].filter((t=>t.Date)).filter((t=>t.Date>new Date)).sort(((t,e)=>t.Date.getTime()-e.Date.getTime())).filter((e=>null==t?void 0:t.includes(e.Type)))[0];n=null==o?void 0:o.Date,r=null!==(e=null==o?void 0:o.Type)&&void 0!==e?e:r}return{nextRace:i,raceDateTime:n,countdownType:r}}}e.default=m},138:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0});const n=i(639),r=i(557),o=i(438),s=i(366);class a extends s.BaseCard{constructor(t){super(t),this.defaultTranslations={driver:"Driver",team:"Team",points:"Pts",wins:"Wins"}}cardSize(){return 12}renderStandingRow(t){var e,i;return n.html`${t.position}${(null===(e=this.config.standings)||void 0===e?void 0:e.show_flag)?n.html` `:""}${t.Driver.code}${(0,o.getDriverName)(t.Driver,this.config)}${(null===(i=this.config.standings)||void 0===i?void 0:i.show_team)?n.html`${(0,o.renderConstructorColumn)(this,t.Constructors[0])}`:""}${t.points}${t.wins}`}render(){return n.html`${(0,r.until)(this.client.GetDriverStandings().then((t=>{var e;return n.html`${(null===(e=this.config.standings)||void 0===e?void 0:e.show_team)?n.html``:""}${(0,o.reduceArray)(t,this.config.row_limit).map((t=>this.renderStandingRow(t)))}
 ${this.translation("driver")}${this.translation("team")}${this.translation("points")}${this.translation("wins")}
`})).catch((()=>n.html`${(0,o.getApiErrorMessage)("standings")}`)),n.html`${(0,o.getApiLoadingMessage)()}`)}`}}e.default=a},507:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0});const n=i(639),r=i(557),o=i(438),s=i(366);class a extends s.BaseCard{constructor(t){super(t),this.defaultTranslations={driver:"Driver",grid:"Grid",points:"Points",status:"Status"}}cardSize(){return 11}renderResultRow(t){return n.html`${t.position}${(0,o.getDriverName)(t.Driver,this.config)}${t.grid}${t.points}${t.status}`}render(){return n.html`${(0,r.until)(this.client.GetLastResult().then((t=>n.html`
${(0,o.renderHeader)(this,t)}
${(0,o.reduceArray)(t.Results,this.config.row_limit).map((t=>this.renderResultRow(t)))}
 ${this.translation("driver")}${this.translation("grid")}${this.translation("points")}${this.translation("status")}
`)).catch((()=>n.html`${(0,o.getApiErrorMessage)("last result")}`)),n.html`${(0,o.getApiLoadingMessage)()}`)}`}}e.default=a},840:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0});const n=i(639),r=i(557),o=i(438),s=i(366),a=i(300);class l extends s.BaseCard{constructor(){super(...arguments),this.defaultTranslations={date:"Date",practice1:"Practice 1",practice2:"Practice 2",practice3:"Practice 3",race:"Race",racename:"Race name",circuitname:"Circuit name",location:"Location",city:"City",racetime:"Race",sprint:"Sprint",qualifying:"Qualifying",endofseason:"Season is over. See you next year!"}}cardSize(){return 8}render(){return n.html`${(0,r.until)(this.client.GetSchedule((new Date).getFullYear()).then((t=>{const e=this.config.next_race_delay||0,i=t.filter((t=>{const i=new Date(t.date+"T"+t.time);return i.setHours(i.getHours()+e),i>=new Date}))[0];return i?n.html`${this.config.show_raceinfo?(0,o.renderRaceInfo)(this,i):this.config.only_show_date?n.html``:null}
${(0,o.renderHeader)(this,i)}

${(0,a.formatDateNumeric)(new Date(i.date+"T"+i.time),this.hass.locale,this.config.date_locale)}

`:(0,o.getEndOfSeasonMessage)(this.translation("endofseason"))})).catch((()=>n.html`${(0,o.getApiErrorMessage)("next race")}`)),n.html`${(0,o.getApiLoadingMessage)()}`)}`}}e.default=l},74:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0});const n=i(639),r=i(557),o=i(438),s=i(366);class a extends s.BaseCard{constructor(t){super(t),this.defaultTranslations={driver:"Driver",grid:"Grid",team:"Team",points:"Points",status:"Status",raceheader:"Race",seasonheader:"Season",selectseason:"Select season",selectrace:"Select race",noresults:"Please select a race thats already been run.",q1:"Q1",q2:"Q2",q3:"Q3"},this.icons={sprint:"mdi:flag-checkered",qualifying:"mdi:timer-outline",results:"mdi:trophy"},this.renderTabsHtml=(t,e,i)=>i?n.html`${t.filter((t=>t.content)).length>0?n.html``:n.html``}
${this.renderHeader(i)}
${t.filter((t=>!t.hide)).map((t=>n.html``))}
${t.filter((t=>!t.hide)).find(((t,i)=>i==e)).content}
${this.translation("noresults")}
`:n.html``}cardSize(){return 12}renderTabs(t){return[{title:"Results",icon:this.icon("results"),content:this.renderResults(t),order:this.tabOrder("results")},{title:"Qualifying",icon:this.icon("qualifying"),content:this.renderQualifying(t),order:this.tabOrder("qualifying")},{title:"Sprint",icon:this.icon("sprint"),content:this.renderSprint(t),hide:!(null==t?void 0:t.SprintResults),order:this.tabOrder("sprint")}].sort(((t,e)=>t.order-e.order))}renderSprint(t){var e;return(null==t?void 0:t.SprintResults)?n.html`${(null===(e=this.config.standings)||void 0===e?void 0:e.show_team)?n.html``:""}${(0,o.reduceArray)(t.SprintResults,this.config.row_limit).map((t=>this.renderResultRow(t,!1)))}
 ${this.translation("driver")}${this.translation("team")}${this.translation("grid")}${this.translation("points")}${this.translation("status")}
`:null}renderQualifying(t){var e;return(null==t?void 0:t.QualifyingResults)?n.html`${(null===(e=this.config.standings)||void 0===e?void 0:e.show_team)?n.html``:""}${(0,o.reduceArray)(t.QualifyingResults,this.config.row_limit).map((t=>this.renderQualifyingResultRow(t)))}
 ${this.translation("driver")}${this.translation("team")}${this.translation("q1")}${this.translation("q2")}${this.translation("q3")}
`:null}renderResults(t){var e,i;const r=null===(e=null==t?void 0:t.Results)||void 0===e?void 0:e.filter((t=>{var e;return"1"===(null===(e=t.FastestLap)||void 0===e?void 0:e.rank)}))[0];return(null==t?void 0:t.Results)?n.html`${(null===(i=this.config.standings)||void 0===i?void 0:i.show_team)?n.html``:""}${(0,o.reduceArray)(t.Results,this.config.row_limit).map((t=>this.renderResultRow(t,t.position===(null==r?void 0:r.position))))}${r?n.html``:""}
 ${this.translation("driver")}${this.translation("team")}${this.translation("grid")}${this.translation("points")}${this.translation("status")}
* Fastest lap: ${r.FastestLap.Time.time}
`:null}renderResultRow(t,e){var i,r;return n.html`${t.position}${(null===(i=this.config.standings)||void 0===i?void 0:i.show_flag)?n.html` `:""}${(0,o.getDriverName)(t.Driver,this.config)}${e?" *":""}${(null===(r=this.config.standings)||void 0===r?void 0:r.show_team)?n.html`${(0,o.renderConstructorColumn)(this,t.Constructor)}`:""}${t.grid}${t.points}${t.status}`}renderQualifyingResultRow(t){var e,i;return n.html`${t.position}${(null===(e=this.config.standings)||void 0===e?void 0:e.show_flag)?n.html` `:""}${(0,o.getDriverName)(t.Driver,this.config)}${(null===(i=this.config.standings)||void 0===i?void 0:i.show_team)?n.html`${(0,o.renderConstructorColumn)(this,t.Constructor)}`:""}${t.Q1}${t.Q2}${t.Q3}`}renderHeader(t){return null==t||parseInt(t.season)<2018?null:(0,o.renderHeader)(this,t)}render(){const{races:t,selectedRace:e,selectedSeason:i,selectedTabIndex:s}=this.getProperties();void 0===i&&this.getLastResult();const a=t=>{this.setRaces(t)},l=this.renderTabs(e);return n.html`
${this.translation("seasonheader")}
${(0,r.until)(this.client.GetSeasons().then((t=>{const e=t.reverse();return n.html``})).catch((()=>n.html`${(0,o.getApiErrorMessage)("seasons")}`)),n.html`${(0,o.getApiLoadingMessage)()}`)}
${this.translation("raceheader")}
${this.renderTabsHtml(l,s,e)}`}setSelectedRace(t){const e=parseInt(t.target.value),{properties:i,cardValues:n}=this.getParentCardValues();i.selectedRound=e;const r=i.selectedSeason;Promise.all([this.client.GetResults(r,e),this.client.GetQualifyingResults(r,e),this.client.GetSprintResults(r,e),this.client.GetSchedule(r)]).then((([t,r,o,s])=>{var a;let l=t.Races[0];l?(l.QualifyingResults=r.Races[0].QualifyingResults,l.SprintResults=null===(a=null==o?void 0:o.Races[0])||void 0===a?void 0:a.SprintResults,i.selectedSeason=l.season):l=s.filter((t=>parseInt(t.round)==e))[0],i.selectedRace=l,n.set("cardValues",i),this.parent.properties=n}))}setRaces(t){const e=t.target.value,{properties:i,cardValues:n}=this.getParentCardValues();this.client.GetSeasonRaces(parseInt(e)).then((t=>{i.selectedSeason=e,i.selectedRace=void 0,i.races=t,n.set("cardValues",i),this.parent.properties=n}))}getUpcomingRace(t,e){const i=e.filter((e=>{const i=new Date(e.date+"T"+e.time),n=new Date(e.Qualifying.date+"T"+e.Qualifying.time),r=e.Sprint?new Date(e.Sprint.date+"T"+e.Sprint.time):null;return i>=t&&n0?i[0]:null}getLastResult(){const t=new Date;Promise.all([this.client.GetSchedule(t.getFullYear()),this.client.GetLastResult()]).then((([e,i])=>{const n=this.getUpcomingRace(t,e);let r=(new Date).getFullYear(),o=null!==n?parseInt(n.round):0,s={};null!==n?(s=n,o=parseInt(s.round),r=parseInt(s.season)):(s=i,o=parseInt(i.round),r=parseInt(i.season)),Promise.all([this.client.GetQualifyingResults(r,o),this.client.GetSprintResults(r,o),this.client.GetSeasonRaces(r)]).then((([t,e,i])=>{var n;const{properties:o,cardValues:a}=this.getParentCardValues();s.QualifyingResults=t.Races[0].QualifyingResults,s.SprintResults=null===(n=e.Races[0])||void 0===n?void 0:n.SprintResults,o.races=i,o.selectedRace=s,o.selectedSeason=r.toString(),a.set("cardValues",o),this.parent.properties=a}))}))}setSelectedTabIndex(t){const{properties:e,cardValues:i}=this.getParentCardValues();e.selectedTabIndex=t,i.set("cardValues",e),this.parent.properties=i}icon(t){return!this.config.icons||Object.keys(this.config.icons).indexOf(t)<0?this.icons[t]:this.config.icons[t]}tabOrder(t){var e,i;const n=null!==(i=null===(e=this.config.tabs_order)||void 0===e?void 0:e.map((t=>t.toLowerCase())))&&void 0!==i?i:["results","qualifying","sprint"];return n.indexOf(t)}}e.default=a},465:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0});const n=i(313),r=i(639),o=i(557),s=i(300),a=i(241),l=i(438),c=i(366);class d extends c.BaseCard{constructor(t){super(t),this.defaultTranslations={date:"Date",race:"Race",time:"Time",location:"Location",endofseason:"Season is over. See you next year!"}}cardSize(){return 12}renderLocation(t){var e;const i=r.html`${(null===(e=this.config.standings)||void 0===e?void 0:e.show_flag)?r.html` `:""}${t.Location.locality}, ${t.Location.country}`;return this.config.location_clickable?r.html`${i}`:i}renderScheduleRow(t){const e=new Date(t.date+"T"+t.time),i=this.config.previous_race&&e${t.round}${t.Circuit.circuitName}${this.renderLocation(t.Circuit)}${(0,s.formatDate)(e,this.hass.locale,this.config.date_locale)}${(0,n.formatTime)(e,this.hass.locale)}`}render(){return r.html`${(0,o.until)(this.client.GetSchedule((new Date).getFullYear()).then((t=>{const e=this.config.previous_race===a.PreviousRaceDisplay.Hide?t.filter((t=>new Date(t.date+"T"+t.time)>=new Date)):t;return e.filter((t=>new Date(t.date+"T"+t.time)>=new Date))[0]?r.html`${(0,l.reduceArray)(e,this.config.row_limit).map((t=>this.renderScheduleRow(t)))}
 ${this.translation("race")}${this.translation("location")}${this.translation("date")}${this.translation("time")}
`:(0,l.getEndOfSeasonMessage)(this.translation("endofseason"))})).catch((()=>r.html`${(0,l.getApiErrorMessage)("schedule")}`)),r.html`${(0,l.getApiLoadingMessage)()}`)}`}}e.default=d},851:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CARD_EDITOR_NAME=e.CARD_NAME=void 0,e.CARD_NAME="formulaone-card",e.CARD_EDITOR_NAME=`${e.CARD_NAME}-editor`},22:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.actionHandler=e.actionHandlerBind=void 0;const n=i(395),r=i(313),o=i(11),s="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.maxTouchPoints>0;class a extends HTMLElement{constructor(){super(),this.holdTime=500,this.held=!1,this.ripple=document.createElement("mwc-ripple")}connectedCallback(){Object.assign(this.style,{position:"absolute",width:s?"100px":"50px",height:s?"100px":"50px",transform:"translate(-50%, -50%)",pointerEvents:"none",zIndex:"999"}),this.appendChild(this.ripple),this.ripple.primary=!0,["touchcancel","mouseout","mouseup","touchmove","mousewheel","wheel","scroll"].forEach((t=>{document.addEventListener(t,(()=>{clearTimeout(this.timer),this.stopAnimation(),this.timer=void 0}),{passive:!0})}))}bind(t,e){if(t.actionHandler)return;t.actionHandler=!0,t.addEventListener("contextmenu",(t=>{const e=t||window.event;return e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,e.returnValue=!1,!1}));const i=t=>{let e,i;this.held=!1,t.touches?(e=t.touches[0].pageX,i=t.touches[0].pageY):(e=t.pageX,i=t.pageY),this.timer=window.setTimeout((()=>{this.startAnimation(e,i),this.held=!0}),this.holdTime)},n=i=>{i.preventDefault(),["touchend","touchcancel"].includes(i.type)&&void 0===this.timer||(clearTimeout(this.timer),this.stopAnimation(),this.timer=void 0,this.held?(0,r.fireEvent)(t,"action",{action:"hold"}):e.hasDoubleClick?"click"===i.type&&i.detail<2||!this.dblClickTimeout?this.dblClickTimeout=window.setTimeout((()=>{this.dblClickTimeout=void 0,(0,r.fireEvent)(t,"action",{action:"tap"})}),250):(clearTimeout(this.dblClickTimeout),this.dblClickTimeout=void 0,(0,r.fireEvent)(t,"action",{action:"double_tap"})):(0,r.fireEvent)(t,"action",{action:"tap"}))};t.addEventListener("touchstart",i,{passive:!0}),t.addEventListener("touchend",n),t.addEventListener("touchcancel",n),t.addEventListener("mousedown",i,{passive:!0}),t.addEventListener("click",n),t.addEventListener("keyup",(t=>{13===t.keyCode&&n(t)}))}startAnimation(t,e){Object.assign(this.style,{left:`${t}px`,top:`${e}px`,display:null}),this.ripple.disabled=!1,this.ripple.active=!0,this.ripple.unbounded=!0}stopAnimation(){this.ripple.active=!1,this.ripple.disabled=!0,this.style.display="none"}}customElements.define("action-handler-formulaonecard",a),e.actionHandlerBind=(t,e)=>{const i=(()=>{const t=document.body;if(t.querySelector("action-handler-formulaonecard"))return t.querySelector("action-handler-formulaonecard");const e=document.createElement("action-handler-formulaonecard");return t.appendChild(e),e})();i&&i.bind(t,e)},e.actionHandler=(0,n.directive)(class extends n.Directive{update(t,[i]){return(0,e.actionHandlerBind)(t.element,i),o.noChange}render(t){}})},750:function(t,e,i){var n=this&&this.__decorate||function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.FormulaOneCardEditor=void 0;const r=i(639),o=i(851),s=i(241),a=i(898),l=i(194),c=i(429),d=i(11);let u=class extends a.default{render(){return this._hass&&this._config?this.renderForm([{controls:[{label:"Card Type (Required)",configValue:"card_type",type:l.FormControlType.Dropdown,items:(0,c.getDropdownOptionsFromEnum)(s.FormulaOneCardType)}]},{controls:[{label:"Title",configValue:"title",type:l.FormControlType.Textbox}]},{label:"Basic configuration",cssClass:"side-by-side",controls:[{label:"Use F1 font",configValue:"f1_font",type:l.FormControlType.Switch},{label:"Image clickable",configValue:"image_clickable",type:l.FormControlType.Switch},{label:"Show carnumber",configValue:"show_carnumber",type:l.FormControlType.Switch},{label:"Location clickable",configValue:"location_clickable",type:l.FormControlType.Switch},{label:"Show race information",configValue:"show_raceinfo",type:l.FormControlType.Switch},{label:"Hide track layout",configValue:"hide_tracklayout",type:l.FormControlType.Switch},{label:"Hide race dates and times",configValue:"hide_racedatetimes",type:l.FormControlType.Switch},{label:"Show last years result",configValue:"show_lastyears_result",type:l.FormControlType.Switch},{label:"Only show date",configValue:"only_show_date",type:l.FormControlType.Switch},{type:l.FormControlType.Filler},{label:"Row limit",configValue:"row_limit",type:l.FormControlType.Textbox},{label:"Date locale",configValue:"date_locale",type:l.FormControlType.Textbox}]},{label:"Countdown Type",hidden:this._config.card_type!==s.FormulaOneCardType.Countdown,cssClass:"side-by-side",controls:[{configValue:"countdown_type",type:l.FormControlType.Checkboxes,items:(0,c.getDropdownOptionsFromEnum)(s.CountdownType)}]},{hidden:this._config.card_type!==s.FormulaOneCardType.NextRace,controls:[{label:"Next race delay",configValue:"next_race_delay",type:l.FormControlType.Textbox}]},{hidden:this._config.card_type!==s.FormulaOneCardType.Schedule,controls:[{label:"Previous race",configValue:"previous_race",type:l.FormControlType.Dropdown,items:(0,c.getDropdownOptionsFromEnum)(s.PreviousRaceDisplay)}]},{label:"Standings",hidden:this._config.card_type!==s.FormulaOneCardType.ConstructorStandings&&this._config.card_type!==s.FormulaOneCardType.DriverStandings,cssClass:"side-by-side",controls:[{label:"Show team",configValue:"standings.show_team",type:l.FormControlType.Switch},{label:"Show flag",configValue:"standings.show_flag",type:l.FormControlType.Switch},{label:"Show teamlogo",configValue:"standings.show_teamlogo",type:l.FormControlType.Switch}]},{label:"Weather",hidden:this._config.card_type!==s.FormulaOneCardType.NextRace&&this._config.card_type!==s.FormulaOneCardType.Countdown,controls:[{label:"Show weather",configValue:"show_weather",type:l.FormControlType.Switch}]},{cssClass:"side-by-side",hidden:this._config.card_type!==s.FormulaOneCardType.NextRace&&this._config.card_type!==s.FormulaOneCardType.Countdown||!this._config.show_weather,controls:[{label:"API key",configValue:"weather_options.api_key",type:l.FormControlType.Textbox},{label:"Unit",configValue:"weather_options.unit",type:l.FormControlType.Dropdown,items:(0,c.getDropdownOptionsFromEnum)(s.WeatherUnit)},{label:"Show icon",configValue:"weather_options.show_icon",type:l.FormControlType.Switch},{label:"Show precipitation",configValue:"weather_options.show_precipitation",type:l.FormControlType.Switch},{label:"Show wind",configValue:"weather_options.show_wind",type:l.FormControlType.Switch},{label:"Show temperature",configValue:"weather_options.show_temperature",type:l.FormControlType.Switch},{label:"Show cloud coverage",configValue:"weather_options.show_cloud_cover",type:l.FormControlType.Switch},{label:"Show visibility",configValue:"weather_options.show_visibility",type:l.FormControlType.Switch}]},{label:"Tabs",hidden:this._config.card_type!==s.FormulaOneCardType.Results,controls:[{label:"Tabs order",configValue:"tabs_order",type:l.FormControlType.Textbox}]}]):r.html``}static get styles(){return d.css`.form-row{margin-bottom:10px}.form-control{display:flex;align-items:center}ha-switch{padding:16px 6px}.side-by-side{display:flex;flex-flow:row wrap}.side-by-side>label{width:100%}.side-by-side>.form-control{width:49%;padding:2px}ha-textfield{width:100%}.hidden{display:none}@media (max-width:600px){.side-by-side>.form-control{width:48%}}`}};u=n([(0,d.customElement)(o.CARD_EDITOR_NAME)],u),e.FormulaOneCardEditor=u},657:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.loadCustomFonts=void 0,e.loadCustomFonts=()=>{if(window&&document.fonts){const t=new FontFace("F1Bold","url(https://www.formula1.com/etc/designs/fom-website/fonts/F1Bold/Formula1-Bold.woff)");document.fonts.add(t),t.load()}}},148:function(t,e,i){var n=this&&this.__decorate||function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},r=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}l((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const o=i(147),s=i(15),a=i(241),l=i(110),c=i(438),d=i(657),u=i(278),h=i(169),m=i(138),p=i(465),f=i(840),g=i(507),v=i(849),y=i(74),_=i(959),$=i(851);console.info(`%c ${$.CARD_NAME.toUpperCase()} %c ${o.version}`,"color: cyan; background: black; font-weight: bold;","color: darkblue; background: white; font-weight: bold;"),window.customCards=window.customCards||[],window.customCards.push({type:"formulaone-card",name:"FormulaOne card",preview:!1,description:"Present the data of Formula One in a pretty way"});let b=class extends l.LitElement{set properties(t){this._cardValues=t,this.update(t)}get properties(){return this._cardValues}constructor(){super(),this.setCountryCache()}static getConfigElement(){return r(this,void 0,void 0,(function*(){return yield Promise.resolve().then((()=>i(750))),document.createElement($.CARD_EDITOR_NAME)}))}setConfig(t){(0,c.checkConfig)(t),this.config=Object.assign({},t)}setCountryCache(){(new _.default).GetAll().catch((()=>{this.warning="Country API is down, so flags are not available at the moment!",this.update(this._cardValues)}))}shouldUpdate(t){return(0,c.hasConfigOrCardValuesChanged)(this,t)}set hass(t){switch(this._hass=t,this.config.hass=t,this.config.card_type){case a.FormulaOneCardType.ConstructorStandings:this.card=new h.default(this);break;case a.FormulaOneCardType.DriverStandings:this.card=new m.default(this);break;case a.FormulaOneCardType.Schedule:this.card=new p.default(this);break;case a.FormulaOneCardType.NextRace:this.card=new f.default(this);break;case a.FormulaOneCardType.LastResult:this.card=new g.default(this);break;case a.FormulaOneCardType.Countdown:this.card=new v.default(this);break;case a.FormulaOneCardType.Results:this.card=new y.default(this)}}static get styles(){return(0,d.loadCustomFonts)(),u.styles}render(){if(!this._hass||!this.config)return l.html``;try{return l.html`${this.renderRefreshButton()} ${this.warning?l.html`${this.warning}`:""} ${this.config.title?l.html`

${this.config.title}

`:""} ${this.card.render()}
`}catch(t){return l.html`${t.toString()}`}}getCardSize(){return this.card.cardSize()}renderRefreshButton(){return this.config.show_refresh?l.html`
`:null}refreshCache(t){console.log("Refreshing cache..."),this.card.client.RefreshCache()}};n([(0,s.property)()],b.prototype,"_hass",void 0),n([(0,s.property)()],b.prototype,"config",void 0),n([(0,s.property)()],b.prototype,"card",void 0),n([(0,s.property)()],b.prototype,"warning",void 0),n([(0,s.property)()],b.prototype,"properties",null),b=n([(0,s.customElement)($.CARD_NAME)],b),e.default=b},198:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TimeFormat=e.NumberFormat=e.SECONDARY_INFO_VALUES=e.TIMESTAMP_FORMATS=e.ImageConstants=void 0,e.ImageConstants={FlagCDN:"https://flagcdn.com/w320/",TeamLogoCDN:"https://www.formula1.com/content/dam/fom-website/teams/",F1CDN:"https://www.formula1.com/content/dam/fom-website/2018-redesign-assets/"},e.TIMESTAMP_FORMATS=["relative","total","date","time","datetime"],e.SECONDARY_INFO_VALUES=["entity-id","last-changed","last-updated","last-triggered","position","tilt-position","brightness"],e.NumberFormat={language:"language",system:"system",comma_decimal:"comma_decimal",decimal_comma:"decimal_comma",space_comma:"space_comma",none:"none"},e.TimeFormat={language:"language",system:"system",am_pm:"12",twenty_four:"24"}},300:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatDateNumeric=e.formatDate=void 0,e.formatDate=(t,e,i)=>new Intl.DateTimeFormat(null!=i?i:e.language,{month:"2-digit",day:"2-digit"}).format(t),e.formatDateNumeric=(t,e,i)=>new Intl.DateTimeFormat(null!=i?i:e.language,{year:"2-digit",month:"2-digit",day:"2-digit"}).format(t)},141:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatDateTimeRaceInfo=e.formatDateTime=void 0;const n=i(975);e.formatDateTime=(t,e)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:(0,n.useAmPm)(e)?"numeric":"2-digit",minute:"2-digit",hour12:(0,n.useAmPm)(e)}).format(t),e.formatDateTimeRaceInfo=(t,e)=>new Intl.DateTimeFormat(e.language,{weekday:"short",hour:"2-digit",minute:"2-digit",hour12:(0,n.useAmPm)(e)}).format(t)},975:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.useAmPm=void 0;const n=i(198);e.useAmPm=t=>{if(t.time_format===n.TimeFormat.language||t.time_format===n.TimeFormat.system){const e=t.time_format===n.TimeFormat.language?t.language:void 0,i=(new Date).toLocaleString(e);return i.includes("AM")||i.includes("PM")}return t.time_format===n.TimeFormat.am_pm}},278:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.styles=void 0;const n=i(110);e.styles=n.css`table{width:100%;border-spacing:0;border-collapse:separate;padding:0 16px 16px}table.nopadding{padding:0;width:100%;border-spacing:0;border-collapse:separate}th{background-color:var(--table-row-alternative-background-color,#eee)}td,th{padding:5px;text-align:left}tr{color:var(--secondary-text-color)}tr:nth-child(even){background-color:var(--table-row-alternative-background-color,#eee)}.text-center{text-align:center}.width-40{width:40px}.width-50{width:50px}.width-60{width:60px}.hide{display:none}.strikethrough{text-decoration:line-through}.italic{font-style:italic}a{text-decoration:none;color:var(--secondary-text-color)}.constructor-logo{width:20px;margin:auto;display:block;float:left;background-color:#fff;border-radius:50%;margin-right:3px}.clickable{cursor:pointer}.formulaone-font{font-family:F1Bold}ha-icon{color:var(--secondary-text-color)}.transparent{background-color:transparent!important}.weather-info{padding:10px}.weather-info td{width:33%}.refresh-cache{position:absolute;right:10px;top:10px}`},241:(t,e)=>{var i,n,r,o;Object.defineProperty(e,"__esModule",{value:!0}),e.FormulaOneCardType=e.PreviousRaceDisplay=e.CountdownType=e.WeatherUnit=void 0,(o=e.WeatherUnit||(e.WeatherUnit={})).Metric="metric",o.MilesCelsius="uk",o.MilesFahrenheit="us",(r=e.CountdownType||(e.CountdownType={})).Race="race",r.Qualifying="qualifying",r.Practice1="practice1",r.Practice2="practice2",r.Practice3="practice3",r.Sprint="sprint",(n=e.PreviousRaceDisplay||(e.PreviousRaceDisplay={})).Strikethrough="strikethrough",n.Italic="italic",n.Hide="hide",(i=e.FormulaOneCardType||(e.FormulaOneCardType={})).DriverStandings="driver_standings",i.ConstructorStandings="constructor_standings",i.NextRace="next_race",i.Schedule="schedule",i.LastResult="last_result",i.Results="results",i.Countdown="countdown"},438:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.renderConstructorColumn=e.reduceArray=e.getRefreshTime=e.calculateWindDirection=e.renderWeatherInfo=e.renderLastYearsResults=e.renderRaceInfo=e.renderHeader=e.clickHandler=e.getEndOfSeasonMessage=e.getApiLoadingMessage=e.getApiErrorMessage=e.getDriverName=e.getCircuitName=e.getTeamImage=e.checkConfig=e.getCountryFlagByName=e.getCountryFlagByNationality=e.getCountries=e.hasConfigOrCardValuesChanged=void 0;const n=i(110),r=i(241),o=i(141),s=i(313),a=i(300),l=i(198),c=i(22),d=i(959),u=i(557);e.hasConfigOrCardValuesChanged=(t,e)=>{if(e.has("config"))return!0;const i=e.get("card");if(i&&i.parent)return i.parent.properties!==t.properties;const n=e.get("cardValues");return!!n&&n!=t.properties},e.getCountries=()=>(new d.default).GetCountriesFromLocalStorage(),e.getCountryFlagByNationality=(t,i)=>{const n=(0,e.getCountries)();i=i.trim();const r=[{demonym:"Argentinian",corrected:"Argentinean"}].filter((t=>t.demonym==i));r.length>0&&(i=r[0].corrected);const o=n.filter((t=>t.demonym==i));return o.length>1?t.imageClient.GetImage(o.sort(((t,e)=>t.population>e.population?-1:1))[0].flags.png):t.imageClient.GetImage(o[0].flags.png)},e.getCountryFlagByName=(t,i)=>{const n=(0,e.getCountries)().filter((t=>{var e;return t.name==i||t.nativeName==i||(null===(e=t.altSpellings)||void 0===e?void 0:e.includes(i))}))[0];return t.imageClient.GetImage(n.flags.png)},e.checkConfig=t=>{if(void 0===t.card_type)throw new Error("Please define FormulaOne card type (card_type).")},e.getTeamImage=(t,e)=>{e=e.toLocaleLowerCase().replace("_","-");const i=[{teamName:"red-bull",corrected:"red-bull-racing"},{teamName:"alfa",corrected:"alfa-romeo"},{teamName:"haas",corrected:"haas-f1-team"},{teamName:"sauber",corrected:"kick-sauber"}].filter((t=>t.teamName==e));return i.length>0&&(e=i[0].corrected),t.imageClient.GetImage(`${l.ImageConstants.TeamLogoCDN}/2024/${e.toLowerCase()}-logo.png.transform/2col-retina/image.png`)},e.getCircuitName=t=>{let e=t.country.replace(" ","-");const i=[{countryDashed:"UAE",name:"Abu_Dhabi"},{countryDashed:"UK",name:"Great_Britain"},{countryDashed:"Monaco",name:"Monoco"},{countryDashed:"Azerbaijan",name:"Baku"},{countryDashed:"Saudi-Arabia",name:"Saudi_Arabia"}].filter((t=>t.countryDashed==e));return i.length>0&&(e=i[0].name),"USA"!=t.country&&"United States"!=t.country||"Austin"==t.locality||(e=t.locality.replace(" ","_")),"Italy"==t.country&&"Imola"==t.locality&&(e="Emilia_Romagna"),e},e.getDriverName=(t,e)=>{const i="VER"==t.code?1:t.permanentNumber;return`${t.givenName} ${t.familyName}${e.show_carnumber?` #${i}`:""}`},e.getApiErrorMessage=t=>n.html`
Error getting ${t}
`,e.getApiLoadingMessage=()=>n.html`
Loading...
`,e.getEndOfSeasonMessage=t=>n.html`
${t}
`,e.clickHandler=(t,e,i,n)=>{(0,s.handleAction)(t,i,e.actions,n.detail.action)},e.renderHeader=(t,i,o=!1)=>{var a,d;const u=(0,e.getCircuitName)(i.Circuit.Location),h=t.config.image_clickable||void 0!==t.config.actions,m=i.Circuit.url;t.config.image_clickable&&!t.config.actions&&(t.config.actions={tap_action:{action:"url",url_path:m}});const p=n.html``,f=n.html`

  ${i.round} : ${i.raceName}

`;return n.html`${t.config.card_type==r.FormulaOneCardType.Countdown?n.html``:f} ${t.config.hide_tracklayout?n.html``:p}
`},e.renderRaceInfo=(t,i,r)=>{var s;const l=t.config,c=t.hass;if(l.hide_racedatetimes)return n.html``;const d=l.show_weather&&void 0!==(null===(s=l.weather_options)||void 0===s?void 0:s.api_key)?t.weatherClient.getWeatherData(i.Circuit.Location.lat,i.Circuit.Location.long,`${i.date}T${i.time}`):Promise.resolve(null),h=l.show_lastyears_result?t.client.GetLastYearsResults(i.Circuit.circuitName):Promise.resolve(null),m=Promise.all([d,h]);return n.html`${(0,u.until)(m.then((([s,d])=>{const u=null==s?void 0:s.days[0],h=new Date(i.date+"T"+i.time),m=(0,e.renderWeatherInfo)(u,l,null!=r?r:h),p=(0,e.renderLastYearsResults)(l,d),f=(0,o.formatDateTimeRaceInfo)(new Date(i.FirstPractice.date+"T"+i.FirstPractice.time),c.locale),g=(0,o.formatDateTimeRaceInfo)(new Date(i.SecondPractice.date+"T"+i.SecondPractice.time),c.locale),v=void 0!==i.ThirdPractice?(0,o.formatDateTimeRaceInfo)(new Date(i.ThirdPractice.date+"T"+i.ThirdPractice.time),c.locale):"-",y=(0,o.formatDateTimeRaceInfo)(h,c.locale),_=(0,o.formatDateTimeRaceInfo)(new Date(i.Qualifying.date+"T"+i.Qualifying.time),c.locale),$=void 0!==i.Sprint?(0,o.formatDateTimeRaceInfo)(new Date(i.Sprint.date+"T"+i.Sprint.time),c.locale):"-";return n.html`${p}${m}${t.translation("date")}${(0,a.formatDateNumeric)(h,c.locale,l.date_locale)} ${t.translation("practice1")}${f}${t.translation("race")}${i.round} ${t.translation("practice2")}${g}${t.translation("racename")}${i.raceName} ${t.translation("practice3")}${v}${t.translation("circuitname")}${i.Circuit.circuitName} ${t.translation("qualifying")}${_}${t.translation("location")}${i.Circuit.Location.country} ${t.translation("sprint")}${$}${t.translation("city")}${i.Circuit.Location.locality} ${t.translation("racetime")}${y}`})))}`},e.renderLastYearsResults=(t,e)=>{var i,r;if(!e)return n.html``;const o=e.Results?e.Results[0]:null,s=null===(i=e.Results)||void 0===i?void 0:i.filter((t=>{var e;return"1"===(null===(e=t.FastestLap)||void 0===e?void 0:e.rank)}))[0];return n.html`

${new Date(e.date).getFullYear()}

${null==o?void 0:o.Driver.givenName} ${null==o?void 0:o.Driver.familyName} (${null==o?void 0:o.Constructor.name})

${null==s?void 0:s.Driver.givenName} ${null==s?void 0:s.Driver.familyName} (${null===(r=null==s?void 0:s.FastestLap)||void 0===r?void 0:r.Time.time})

 `},e.renderWeatherInfo=(t,i,o)=>{var s,a;if(!t)return n.html``;const l=(null===(s=i.weather_options)||void 0===s?void 0:s.unit)===r.WeatherUnit.Metric?"km/h":"mph",c=(null===(a=i.weather_options)||void 0===a?void 0:a.unit)===r.WeatherUnit.MilesFahrenheit?"°F":"°C",d=t.hours?t.hours[o.getHours()]:t;return n.html`
${(0,e.calculateWindDirection)(d.winddir)} ${d.windspeed} ${l}${d.precip} mm${d.precipprob}%
${d.cloudcover} %${d.temp} ${c}${d.feelslike} ${c}
 `},e.calculateWindDirection=t=>{const e=[{label:"N",range:[0,11.25]},{label:"NNE",range:[11.25,33.75]},{label:"NE",range:[33.75,56.25]},{label:"ENE",range:[56.25,78.75]},{label:"E",range:[78.75,101.25]},{label:"ESE",range:[101.25,123.75]},{label:"SE",range:[123.75,146.25]},{label:"SSE",range:[146.25,168.75]},{label:"S",range:[168.75,191.25]},{label:"SSW",range:[191.25,213.75]},{label:"SW",range:[213.75,236.25]},{label:"WSW",range:[236.25,258.75]},{label:"W",range:[258.75,281.25]},{label:"WNW",range:[281.25,303.75]},{label:"NW",range:[303.75,326.25]},{label:"NNW",range:[326.25,348.75]},{label:"N",range:[348.75,360]}];for(const{label:i,range:n}of e)if(t>=n[0]&&t<=n[1])return i},e.getRefreshTime=t=>{let e=24;const i=new Date,n=localStorage.getItem(`${i.getFullYear()}.json`);if(n){const r=JSON.parse(n),o=JSON.parse(r.data).MRData.RaceTable.Races.filter((t=>new Date(t.date).toLocaleDateString==i.toLocaleDateString));if(o.length>0){const i=o[0],n=new Date(i.date+"T"+i.time),r=localStorage.getItem(t);if(r){const t=JSON.parse(r);new Date(t.created)void 0===t?[]:e?t.slice(0,e):t,e.renderConstructorColumn=(t,i)=>n.html`${t.config.standings.show_teamlogo?n.html` `:""}${i.name}`},11:(t,e,i)=>{i.r(e),i.d(e,{CSSResult:()=>a,LitElement:()=>S,ReactiveElement:()=>$,UpdatingElement:()=>A,_$LE:()=>E,_$LH:()=>C._$LH,adoptStyles:()=>d,css:()=>c,customElement:()=>k,decorateProperty:()=>R,defaultConverter:()=>v,eventOptions:()=>M,getCompatibleStyle:()=>u,html:()=>C.html,legacyPrototypeMethod:()=>D,noChange:()=>C.noChange,notEqual:()=>y,nothing:()=>C.nothing,property:()=>P,query:()=>F,queryAll:()=>I,queryAssignedElements:()=>U,queryAssignedNodes:()=>V,queryAsync:()=>L,render:()=>C.render,standardPrototypeMethod:()=>x,state:()=>N,supportsAdoptingStyleSheets:()=>r,svg:()=>C.svg,unsafeCSS:()=>l});const n=window,r=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),s=new WeakMap;class a{constructor(t,e,i){if(this._$cssResult$=!0,i!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(r&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=s.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&s.set(e,t))}return t}toString(){return this.cssText}}const l=t=>new a("string"==typeof t?t:t+"",void 0,o),c=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[n+1]),t[0]);return new a(i,t,o)},d=(t,e)=>{r?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style"),r=n.litNonce;void 0!==r&&i.setAttribute("nonce",r),i.textContent=e.cssText,t.appendChild(i)}))},u=r?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return l(e)})(t):t;var h;const m=window,p=m.trustedTypes,f=p?p.emptyScript:"",g=m.reactiveElementPolyfillSupport,v={toAttribute(t,e){switch(e){case Boolean:t=t?f:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},y=(t,e)=>e!==t&&(e==e||t==t),_={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:y};class $ extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const n=this._$Ep(i,e);void 0!==n&&(this._$Ev.set(n,i),t.push(n))})),t}static createProperty(t,e=_){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,i,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(n){const r=this[t];this[e]=n,this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||_}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(u(t))}else void 0!==t&&e.push(u(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return d(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=_){var n;const r=this.constructor._$Ep(t,i);if(void 0!==r&&!0===i.reflect){const o=(void 0!==(null===(n=i.converter)||void 0===n?void 0:n.toAttribute)?i.converter:v).toAttribute(e,i.type);this._$El=t,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$El=null}}_$AK(t,e){var i;const n=this.constructor,r=n._$Ev.get(t);if(void 0!==r&&this._$El!==r){const t=n.getPropertyOptions(r),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:v;this._$El=r,this[r]=o.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,i){let n=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||y)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}$.finalized=!0,$.elementProperties=new Map,$.elementStyles=[],$.shadowRootOptions={mode:"open"},null==g||g({ReactiveElement:$}),(null!==(h=m.reactiveElementVersions)&&void 0!==h?h:m.reactiveElementVersions=[]).push("1.6.1");var b,w,C=i(639);const A=$;class S extends ${constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=(0,C.render)(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return C.noChange}}S.finalized=!0,S._$litElement$=!0,null===(b=globalThis.litElementHydrateSupport)||void 0===b||b.call(globalThis,{LitElement:S});const T=globalThis.litElementPolyfillSupport;null==T||T({LitElement:S});const E={_$AK:(t,e,i)=>{t._$AK(e,i)},_$AL:t=>t._$AL};(null!==(w=globalThis.litElementVersions)&&void 0!==w?w:globalThis.litElementVersions=[]).push("3.3.3");const D=(t,e,i)=>{Object.defineProperty(e,i,t)},x=(t,e)=>({kind:"method",placement:"prototype",key:e.key,descriptor:t}),R=({finisher:t,descriptor:e})=>(i,n)=>{var r;if(void 0===n){const n=null!==(r=i.originalKey)&&void 0!==r?r:i.key,o=null!=e?{kind:"method",placement:"prototype",key:n,descriptor:e(i.key)}:{...i,key:n};return null!=t&&(o.finisher=function(e){t(e,n)}),o}{const r=i.constructor;void 0!==e&&Object.defineProperty(i,n,e(n)),null==t||t(r,n)}},k=t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:i,elements:n}=e;return{kind:i,elements:n,finisher(e){customElements.define(t,e)}}})(t,e),O=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(i){i.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};function P(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):O(t,e)}function N(t){return P({...t,state:!0})}function M(t){return R({finisher:(e,i)=>{Object.assign(e.prototype[i],t)}})}function F(t,e){return R({descriptor:i=>{const n={get(){var e,i;return null!==(i=null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(t))&&void 0!==i?i:null},enumerable:!0,configurable:!0};if(e){const e="symbol"==typeof i?Symbol():"__"+i;n.get=function(){var i,n;return void 0===this[e]&&(this[e]=null!==(n=null===(i=this.renderRoot)||void 0===i?void 0:i.querySelector(t))&&void 0!==n?n:null),this[e]}}return n}})}function I(t){return R({descriptor:e=>({get(){var e,i;return null!==(i=null===(e=this.renderRoot)||void 0===e?void 0:e.querySelectorAll(t))&&void 0!==i?i:[]},enumerable:!0,configurable:!0})})}function L(t){return R({descriptor:e=>({async get(){var e;return await this.updateComplete,null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(t)},enumerable:!0,configurable:!0})})}var H;const j=null!=(null===(H=window.HTMLSlotElement)||void 0===H?void 0:H.prototype.assignedElements)?(t,e)=>t.assignedElements(e):(t,e)=>t.assignedNodes(e).filter((t=>t.nodeType===Node.ELEMENT_NODE));function U(t){const{slot:e,selector:i}=null!=t?t:{};return R({descriptor:n=>({get(){var n;const r="slot"+(e?`[name=${e}]`:":not([name])"),o=null===(n=this.renderRoot)||void 0===n?void 0:n.querySelector(r),s=null!=o?j(o,t):[];return i?s.filter((t=>t.matches(i))):s},enumerable:!0,configurable:!0})})}function V(t,e,i){let n,r=t;return"object"==typeof t?(r=t.slot,n=t):n={flatten:e},i?U({slot:r,flatten:e,selector:i}):R({descriptor:t=>({get(){var t,e;const i="slot"+(r?`[name=${r}]`:":not([name])"),o=null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector(i);return null!==(e=null==o?void 0:o.assignedNodes(n))&&void 0!==e?e:[]},enumerable:!0,configurable:!0})})}console.warn("The main 'lit-element' module entrypoint is deprecated. Please update your imports to use the 'lit' package: 'lit' and 'lit/decorators.ts' or import from 'lit-element/lit-element.ts'. See https://lit.dev/msg/deprecated-import-path for more information.")},557:(t,e,i)=>{i.r(e),i.d(e,{UntilDirective:()=>v,until:()=>y});var n=i(639);const{I:r}=n._$LH;class o{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}const s=(t,e)=>{var i,n;const r=t._$AN;if(void 0===r)return!1;for(const t of r)null===(n=(i=t)._$AO)||void 0===n||n.call(i,e,!1),s(t,e);return!0},a=t=>{let e,i;do{if(void 0===(e=t._$AM))break;i=e._$AN,i.delete(t),t=e}while(0===(null==i?void 0:i.size))},l=t=>{for(let e;e=t._$AM;t=e){let i=e._$AN;if(void 0===i)e._$AN=i=new Set;else if(i.has(t))break;i.add(t),u(e)}};function c(t){void 0!==this._$AN?(a(this),this._$AM=t,l(this)):this._$AM=t}function d(t,e=!1,i=0){const n=this._$AH,r=this._$AN;if(void 0!==r&&0!==r.size)if(e)if(Array.isArray(n))for(let t=i;t{var e,i,n,r;2==t.type&&(null!==(e=(n=t)._$AP)&&void 0!==e||(n._$AP=d),null!==(i=(r=t)._$AQ)&&void 0!==i||(r._$AQ=c))};class h extends o{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),l(this),this.isConnected=t._$AU}_$AO(t,e=!0){var i,n;t!==this.isConnected&&(this.isConnected=t,t?null===(i=this.reconnected)||void 0===i||i.call(this):null===(n=this.disconnected)||void 0===n||n.call(this)),e&&(s(this,t),a(this))}setValue(t){if((t=>void 0===this._$Ct.strings)())this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}class m{constructor(t){this.G=t}disconnect(){this.G=void 0}reconnect(t){this.G=t}deref(){return this.G}}class p{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){var t;null!==(t=this.Y)&&void 0!==t||(this.Y=new Promise((t=>this.Z=t)))}resume(){var t;null===(t=this.Z)||void 0===t||t.call(this),this.Y=this.Z=void 0}}const f=t=>!(t=>null===t||"object"!=typeof t&&"function"!=typeof t)(t)&&"function"==typeof t.then,g=1073741823;class v extends h{constructor(){super(...arguments),this._$C_t=g,this._$Cwt=[],this._$Cq=new m(this),this._$CK=new p}render(...t){var e;return null!==(e=t.find((t=>!f(t))))&&void 0!==e?e:n.noChange}update(t,e){const i=this._$Cwt;let r=i.length;this._$Cwt=e;const o=this._$Cq,s=this._$CK;this.isConnected||this.disconnected();for(let t=0;tthis._$C_t);t++){const n=e[t];if(!f(n))return this._$C_t=t,n;t{for(;s.get();)await s.get();const e=o.deref();if(void 0!==e){const i=e._$Cwt.indexOf(n);i>-1&&i({_$litDirective$:_,values:t}));var _},639:(t,e,i)=>{var n;i.r(e),i.d(e,{_$LH:()=>G,html:()=>S,noChange:()=>E,nothing:()=>D,render:()=>q,svg:()=>T});const r=window,o=r.trustedTypes,s=o?o.createPolicy("lit-html",{createHTML:t=>t}):void 0,a="$lit$",l=`lit$${(Math.random()+"").slice(9)}$`,c="?"+l,d=`<${c}>`,u=document,h=()=>u.createComment(""),m=t=>null===t||"object"!=typeof t&&"function"!=typeof t,p=Array.isArray,f=t=>p(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),g="[ \t\n\f\r]",v=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,y=/-->/g,_=/>/g,$=RegExp(`>|${g}(?:([^\\s"'>=/]+)(${g}*=${g}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),b=/'/g,w=/"/g,C=/^(?:script|style|textarea|title)$/i,A=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),S=A(1),T=A(2),E=Symbol.for("lit-noChange"),D=Symbol.for("lit-nothing"),x=new WeakMap,R=u.createTreeWalker(u,129,null,!1);function k(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s?s.createHTML(e):e}const O=(t,e)=>{const i=t.length-1,n=[];let r,o=2===e?"":"",s=v;for(let e=0;e"===u[0]?(s=null!=r?r:v,h=-1):void 0===u[1]?h=-2:(h=s.lastIndex-u[2].length,c=u[1],s=void 0===u[3]?$:'"'===u[3]?w:b):s===w||s===b?s=$:s===y||s===_?s=v:(s=$,r=void 0);const p=s===$&&t[e+1].startsWith("/>")?" ":"";o+=s===v?i+d:h>=0?(n.push(c),i.slice(0,h)+a+i.slice(h)+l+p):i+l+(-2===h?(n.push(void 0),e):p)}return[k(t,o+(t[i]||"")+(2===e?"":"")),n]};class P{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let r=0,s=0;const d=t.length-1,u=this.parts,[m,p]=O(t,e);if(this.el=P.createElement(m,i),R.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=R.nextNode())&&u.length0){n.textContent=o?o.emptyScript:"";for(let i=0;i2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=D}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,n){const r=this.strings;let o=!1;if(void 0===r)t=N(this,t,e,0),o=!m(t)||t!==this._$AH&&t!==E,o&&(this._$AH=t);else{const n=t;let s,a;for(t=r[0],s=0;s{var n,r;const o=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:e;let s=o._$litPart$;if(void 0===s){const t=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;o._$litPart$=s=new F(e.insertBefore(h(),t),t,void 0,null!=i?i:{})}return s._$AI(t),s}},15:(t,e,i)=>{i.r(e),i.d(e,{customElement:()=>n,eventOptions:()=>c,property:()=>a,query:()=>u,queryAll:()=>m,queryAssignedElements:()=>f,queryAssignedNodes:()=>g,queryAsync:()=>p,standardProperty:()=>s,state:()=>l});const n=t=>(e,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)};var r=i(548);const o={attribute:!0,type:String,converter:r.Ts,reflect:!1,hasChanged:r.Qu},s=(t=o,e,i)=>{const{kind:n,metadata:r}=i;let s=globalThis.litPropertyMetadata.get(r);if(void 0===s&&globalThis.litPropertyMetadata.set(r,s=new Map),s.set(i.name,t),"accessor"===n){const{name:n}=i;return{set(i){const r=e.get.call(this);e.set.call(this,i),this.requestUpdate(n,r,t)},init(e){return void 0!==e&&this.C(n,void 0,t),e}}}if("setter"===n){const{name:n}=i;return function(i){const r=this[n];e.call(this,i),this.requestUpdate(n,r,t)}}throw Error("Unsupported decorator location: "+n)};function a(t){return(e,i)=>"object"==typeof i?s(t,e,i):((t,e,i)=>{const n=e.hasOwnProperty(i);return e.constructor.createProperty(i,n?{...t,wrapped:!0}:t),n?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}function l(t){return a({...t,state:!0,attribute:!1})}function c(t){return(e,i)=>{const n="function"==typeof e?e:e[i];Object.assign(n,t)}}const d=(t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i);function u(t,e){return(i,n,r)=>{const o=e=>e.renderRoot?.querySelector(t)??null;if(e){const{get:t,set:e}="object"==typeof n?i:r??(()=>{const t=Symbol();return{get(){return this[t]},set(e){this[t]=e}}})();return d(i,n,{get(){let i=t.call(this);return void 0===i&&(i=o(this),(null!==i||this.hasUpdated)&&e.call(this,i)),i}})}return d(i,n,{get(){return o(this)}})}}let h;function m(t){return(e,i)=>d(e,i,{get(){return(this.renderRoot??(h??=document.createDocumentFragment())).querySelectorAll(t)}})}function p(t){return(e,i)=>d(e,i,{async get(){return await this.updateComplete,this.renderRoot?.querySelector(t)??null}})}function f(t){return(e,i)=>{const{slot:n,selector:r}=t??{},o="slot"+(n?`[name=${n}]`:":not([name])");return d(e,i,{get(){const e=this.renderRoot?.querySelector(o),i=e?.assignedElements(t)??[];return void 0===r?i:i.filter((t=>t.matches(r)))}})}}function g(t){return(e,i)=>{const{slot:n}=t??{},r="slot"+(n?`[name=${n}]`:":not([name])");return d(e,i,{get(){const e=this.renderRoot?.querySelector(r);return e?.assignedNodes(t)??[]}})}}},395:(t,e,i)=>{i.r(e),i.d(e,{Directive:()=>n.Xe,PartType:()=>n.pX,directive:()=>n.XM});var n=i(126)},810:(t,e,i)=>{i.r(e),i.d(e,{AsyncReplaceDirective:()=>f,asyncReplace:()=>g});var n=i(605);const{D:r}=n._$LH;var o=i(126);const s=(t,e)=>{const i=t._$AN;if(void 0===i)return!1;for(const t of i)t._$AO?.(e,!1),s(t,e);return!0},a=t=>{let e,i;do{if(void 0===(e=t._$AM))break;i=e._$AN,i.delete(t),t=e}while(0===i?.size)},l=t=>{for(let e;e=t._$AM;t=e){let i=e._$AN;if(void 0===i)e._$AN=i=new Set;else if(i.has(t))break;i.add(t),u(e)}};function c(t){void 0!==this._$AN?(a(this),this._$AM=t,l(this)):this._$AM=t}function d(t,e=!1,i=0){const n=this._$AH,r=this._$AN;if(void 0!==r&&0!==r.size)if(e)if(Array.isArray(n))for(let t=i;t{t.type==o.pX.CHILD&&(t._$AP??=d,t._$AQ??=c)};class h extends o.Xe{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),l(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(s(this,t),a(this))}setValue(t){if((t=>void 0===this._$Ct.strings)())this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}class m{constructor(t){this.G=t}disconnect(){this.G=void 0}reconnect(t){this.G=t}deref(){return this.G}}class p{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??=new Promise((t=>this.Z=t))}resume(){this.Z?.(),this.Y=this.Z=void 0}}class f extends h{constructor(){super(...arguments),this._$Cq=new m(this),this._$CK=new p}render(t,e){return n.Jb}update(t,[e,i]){if(this.isConnected||this.disconnected(),e===this._$CX)return;this._$CX=e;let r=0;const{_$Cq:o,_$CK:s}=this;return(async(t,e)=>{for await(const i of t)if(!1===await e(i))return})(e,(async t=>{for(;s.get();)await s.get();const n=o.deref();if(void 0!==n){if(n._$CX!==e)return!1;void 0!==i&&(t=i(t,r)),n.commitValue(t,r),r++}return!0})),n.Jb}commitValue(t,e){this.setValue(t)}disconnected(){this._$Cq.disconnect(),this._$CK.pause()}reconnected(){this._$Cq.reconnect(this),this._$CK.resume()}}const g=(0,o.XM)(f)},110:(t,e,i)=>{i.r(e),i.d(e,{CSSResult:()=>n.c3,LitElement:()=>o,ReactiveElement:()=>n.fl,_$LE:()=>a,_$LH:()=>r._$LH,adoptStyles:()=>n.ec,css:()=>n.iv,defaultConverter:()=>n.Ts,getCompatibleStyle:()=>n.i1,html:()=>r.dy,isServer:()=>l,noChange:()=>r.Jb,notEqual:()=>n.Qu,nothing:()=>r.Ld,render:()=>r.sY,supportsAdoptingStyleSheets:()=>n.FV,svg:()=>r.YP,unsafeCSS:()=>n.$m});var n=i(548),r=i(605);class o extends n.fl{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=(0,r.sY)(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return r.Jb}}o._$litElement$=!0,o.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:o});const s=globalThis.litElementPolyfillSupport;s?.({LitElement:o});const a={_$AK:(t,e,i)=>{t._$AK(e,i)},_$AL:t=>t._$AL};(globalThis.litElementVersions??=[]).push("4.0.2");const l=!1},548:(t,e,i)=>{i.d(e,{c3:()=>a,fl:()=>T,ec:()=>d,iv:()=>c,Ts:()=>C,i1:()=>u,Qu:()=>A,FV:()=>r,$m:()=>l});const n=globalThis,r=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),s=new WeakMap;class a{constructor(t,e,i){if(this._$cssResult$=!0,i!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(r&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=s.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&s.set(e,t))}return t}toString(){return this.cssText}}const l=t=>new a("string"==typeof t?t:t+"",void 0,o),c=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[n+1]),t[0]);return new a(i,t,o)},d=(t,e)=>{if(r)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const i of e){const e=document.createElement("style"),r=n.litNonce;void 0!==r&&e.setAttribute("nonce",r),e.textContent=i.cssText,t.appendChild(e)}},u=r?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return l(e)})(t):t,{is:h,defineProperty:m,getOwnPropertyDescriptor:p,getOwnPropertyNames:f,getOwnPropertySymbols:g,getPrototypeOf:v}=Object,y=globalThis,_=y.trustedTypes,$=_?_.emptyScript:"",b=y.reactiveElementPolyfillSupport,w=(t,e)=>t,C={toAttribute(t,e){switch(e){case Boolean:t=t?$:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},A=(t,e)=>!h(t,e),S={attribute:!0,type:String,converter:C,reflect:!1,hasChanged:A};Symbol.metadata??=Symbol("metadata"),y.litPropertyMetadata??=new WeakMap;class T extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=S){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),n=this.getPropertyDescriptor(t,i,e);void 0!==n&&m(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){const{get:n,set:r}=p(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return n?.call(this)},set(e){const o=n?.call(this);r.call(this,e),this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??S}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;const t=v(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){const t=this.properties,e=[...f(t),...g(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(u(t))}else void 0!==t&&e.push(u(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$Eg=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$ES(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$E_??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$E_?.delete(t)}_$ES(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return d(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$E_?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$E_?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e){const i=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,i);if(void 0!==n&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:C).toAttribute(e,i.type);this._$Em=t,null==r?this.removeAttribute(n):this.setAttribute(n,r),this._$Em=null}}_$AK(t,e){const i=this.constructor,n=i._$Eh.get(t);if(void 0!==n&&this._$Em!==n){const t=i.getPropertyOptions(n),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:C;this._$Em=n,this[n]=r.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,i,n=!1,r){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??A)(n?r:this[t],e))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$Eg=this._$EP())}C(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t)!0!==i.wrapped||this._$AL.has(e)||void 0===this[e]||this.C(e,this[e],i)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$E_?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$ET()}catch(e){throw t=!1,this._$ET(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$E_?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EO(t,this[t]))),this._$ET()}updated(t){}firstUpdated(t){}}T.elementStyles=[],T.shadowRootOptions={mode:"open"},T[w("elementProperties")]=new Map,T[w("finalized")]=new Map,b?.({ReactiveElement:T}),(y.reactiveElementVersions??=[]).push("2.0.2")},126:(t,e,i)=>{i.d(e,{XM:()=>r,Xe:()=>o,pX:()=>n});const n={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},r=t=>(...e)=>({_$litDirective$:t,values:e});class o{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}},605:(t,e,i)=>{i.d(e,{Jb:()=>T,Ld:()=>E,YP:()=>S,_$LH:()=>U,dy:()=>A,sY:()=>G});const n=globalThis,r=n.trustedTypes,o=r?r.createPolicy("lit-html",{createHTML:t=>t}):void 0,s="$lit$",a=`lit$${(Math.random()+"").slice(9)}$`,l="?"+a,c=`<${l}>`,d=document,u=()=>d.createComment(""),h=t=>null===t||"object"!=typeof t&&"function"!=typeof t,m=Array.isArray,p=t=>m(t)||"function"==typeof t?.[Symbol.iterator],f="[ \t\n\f\r]",g=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,y=/>/g,_=RegExp(`>|${f}(?:([^\\s"'>=/]+)(${f}*=${f}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),$=/'/g,b=/"/g,w=/^(?:script|style|textarea|title)$/i,C=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),A=C(1),S=C(2),T=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),D=new WeakMap,x=d.createTreeWalker(d,129);function R(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==o?o.createHTML(e):e}const k=(t,e)=>{const i=t.length-1,n=[];let r,o=2===e?"":"",l=g;for(let e=0;e"===u[0]?(l=r??g,h=-1):void 0===u[1]?h=-2:(h=l.lastIndex-u[2].length,d=u[1],l=void 0===u[3]?_:'"'===u[3]?b:$):l===b||l===$?l=_:l===v||l===y?l=g:(l=_,r=void 0);const p=l===_&&t[e+1].startsWith("/>")?" ":"";o+=l===g?i+c:h>=0?(n.push(d),i.slice(0,h)+s+i.slice(h)+a+p):i+a+(-2===h?e:p)}return[R(t,o+(t[i]||"")+(2===e?"":"")),n]};class O{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let o=0,c=0;const d=t.length-1,h=this.parts,[m,p]=k(t,e);if(this.el=O.createElement(m,i),x.currentNode=this.el.content,2===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=x.nextNode())&&h.length0){n.textContent=r?r.emptyScript:"";for(let i=0;i2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=E}_$AI(t,e=this,i,n){const r=this.strings;let o=!1;if(void 0===r)t=P(this,t,e,0),o=!h(t)||t!==this._$AH&&t!==T,o&&(this._$AH=t);else{const n=t;let s,a;for(t=r[0],s=0;s{const n=i?.renderBefore??e;let r=n._$litPart$;if(void 0===r){const t=i?.renderBefore??null;n._$litPart$=r=new M(e.insertBefore(u(),t),t,void 0,i??{})}return r._$AI(t),r}},147:t=>{t.exports=JSON.parse('{"name":"formulaone-card","version":"1.9.3","description":"Frontend card for Home Assistant to display Formula One data","main":"index.js","scripts":{"lint":"eslint src/**/*.ts","dev":"webpack -c webpack.config.js","build":"yarn lint && webpack -c webpack.config.js","test":"jest","coverage":"jest --coverage","workflow":"jest --coverage --json --outputFile=/home/runner/work/formulaone-card/formulaone-card/jest.results.json","prebuild":"copy git-hooks\\\\pre-commit .git\\\\hooks\\\\ && echo \'hook copied\'"},"repository":{"type":"git","url":"git+https://github.com/marcokreeft87/formulaone-card.git"},"keywords":[],"author":"","license":"ISC","bugs":{"url":"https://github.com/marcokreeft87/formulaone-card/issues"},"homepage":"https://github.com/marcokreeft87/formulaone-card#readme","devDependencies":{"@types/jest":"^29.5.3","@typescript-eslint/eslint-plugin":"^5.59.8","@typescript-eslint/parser":"^5.62.0","codecov":"^3.8.3","eslint":"^8.52.0","home-assistant-js-websocket":"^9.1.0","lit":"^3.0.2","lit-element":"^3.3.3","minify-html-literals-loader":"^1.1.1","typescript":"^4.9.5","webpack":"^5.89.0","webpack-cli":"^5.1.4"},"dependencies":{"@babel/plugin-transform-runtime":"^7.22.5","@babel/preset-env":"^7.23.8","@lit-labs/scoped-registry-mixin":"^1.0.1","@marcokreeft/ha-editor-formbuilder":"^2023.10.9","babel-jest":"^29.7.0","compression-webpack-plugin":"^10.0.0","custom-card-helpers":"^1.9.0","isomorphic-fetch":"^3.0.0","jest-environment-jsdom":"^29.6.2","jest-fetch-mock":"^3.0.3","jest-ts-auto-mock":"^2.1.0","minify-html-literals-loader":"^1.1.1","ts-auto-mock":"^3.6.4","ts-jest":"^29.1.1","ts-loader":"^9.5.1","ttypescript":"^1.5.15","yarn":"^1.22.21"}}')}},e={};function i(n){var r=e[n];if(void 0!==r)return r.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,i),o.exports}i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i(148)})(); \ No newline at end of file diff --git a/formulaone-card.js.gz b/formulaone-card.js.gz index 8f0607ffdd592a8b1d4b547ddf48e634859dc97e..e380be692416a626f5b53ff2f27208b655ca9957 100644 GIT binary patch delta 14170 zcmV-gH>Jp!fCA5e0Ra*lh~Fu&zi&biPU0BG1-~kUSSN5QAhqM%6JP(1yH9 zXK_ZFfsA$KDB|D}&H6&?c0C>mu*S9RRFB5lbxr6;|0?FX4A7|J)VlS+eeUJWFcr&u zxl%3}j+ygu(i?;W^p+9eO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9jHGe5v7t6JN+j;IhVS9o@n34EzPn;*uooDrh**;8osi!;6HlsWMe*+@_ZP$6mTH%G^$us8(F9ic_ z`*O3jKc(#(dYQ(<&ys3F4BJ;U8&2eU!8>RYh8iSs1dG=Gl#b%5 z=)_aDq^t=0usx0WGQiin@>Q0${dpFvmpg(o)?M?`=ey2R=P`e-&4(&mQ~*1KJv6DN z1AmWUIe|6v2Rl2?PRGjgM-UWB$wC9A3T&Csh25Y{v?!zwJaM!MFfb@d7UG$^P$5>0 ztRD@y%oNK{Fy!Wue+Q`ekq1r@mJ2r?hMLg`q6S5Q6WbI=XmfJ|{><2)t1uZOyfEUd zAWqbUF6ICz>cp}U@x6*7D|r+MSr0RO6iDWaw6Nw8Z*5fgo^YRs%}wF^AmhN#{qgD^ xR?A|pm~yS77(76&9N|?TTNf8J6~*LdfJKwz!0tSLh8Tw9{|Co7#wior0RR+IXqf;2 diff --git a/package.json b/package.json index 594cd64..16accc9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "formulaone-card", - "version": "1.9.3", + "version": "1.9.4", "description": "Frontend card for Home Assistant to display Formula One data", "main": "index.js", "scripts": { diff --git a/src/utils.ts b/src/utils.ts index 525cf52..b114b40 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -37,6 +37,14 @@ export const getCountries = () => { export const getCountryFlagByNationality = (card: BaseCard, nationality: string) => { const countries = getCountries(); + + nationality = nationality.trim(); + const exceptions = [{ demonym: 'Argentinian', corrected: 'Argentinean'}]; + const exception = exceptions.filter(exception => exception.demonym == nationality); + if(exception.length > 0) + { + nationality = exception[0].corrected; + } const country = countries.filter(x => x.demonym == nationality); if(country.length > 1)