From 56389522d87e95c0505ed7756697d79251eb6610 Mon Sep 17 00:00:00 2001 From: Elwin Date: Wed, 3 Jan 2024 17:15:47 +0100 Subject: [PATCH] Bugfix/27 v100 alpha built in pop up missing close button (#32) * #27 - Header in popup with config * #27 - Updated readme --- dist/fr24_card.js | 2 +- readme.md | 71 ++++++++++++++++++++-------- src/javascript/config/config.js | 7 ++- src/javascript/helpers/popup.js | 35 ++++++++------ src/javascript/helpers/tags/table.js | 9 ++-- 5 files changed, 84 insertions(+), 40 deletions(-) diff --git a/dist/fr24_card.js b/dist/fr24_card.js index b6613c6..fe6f7d4 100644 --- a/dist/fr24_card.js +++ b/dist/fr24_card.js @@ -1 +1 @@ -"use strict";const t=window,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),n=new WeakMap;let i=class{constructor(t,e,n){if(this._$cssResult$=!0,n!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=n.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&n.set(s,t))}return t}toString(){return this.cssText}};const r=(t,...e)=>{const n=1===t.length?t[0]:e.reduce(((e,s,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.")})(s)+t[n+1]),t[0]);return new i(n,t,s)},o=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new i("string"==typeof t?t:t+"",void 0,s))(e)})(t):t;var a;const l=window,c=l.trustedTypes,h=c?c.emptyScript:"",u=l.reactiveElementPolyfillSupport,d={toAttribute(t,e){switch(e){case Boolean:t=t?h:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},_=(t,e)=>e!==t&&(e==e||t==t),p={attribute:!0,type:String,converter:d,reflect:!1,hasChanged:_};let g=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,s)=>{const n=this._$Ep(s,e);void 0!==n&&(this._$Ev.set(n,s),t.push(n))})),t}static createProperty(t,e=p){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const s="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,s,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){return{get(){return this[e]},set(n){const i=this[t];this[e]=n,this.requestUpdate(t,i,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||p}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 s of e)this.createProperty(s,t[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(o(t))}else void 0!==t&&e.push(o(t));return e}static _$Ep(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"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,s;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(s=t.hostConnected)||void 0===s||s.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 s;const n=null!==(s=this.shadowRoot)&&void 0!==s?s:this.attachShadow(this.constructor.shadowRootOptions);return((s,n)=>{e?s.adoptedStyleSheets=n.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):n.forEach((e=>{const n=document.createElement("style"),i=t.litNonce;void 0!==i&&n.setAttribute("nonce",i),n.textContent=e.cssText,s.appendChild(n)}))})(n,this.constructor.elementStyles),n}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,s){this._$AK(t,s)}_$EO(t,e,s=p){var n;const i=this.constructor._$Ep(t,s);if(void 0!==i&&!0===s.reflect){const r=(void 0!==(null===(n=s.converter)||void 0===n?void 0:n.toAttribute)?s.converter:d).toAttribute(e,s.type);this._$El=t,null==r?this.removeAttribute(i):this.setAttribute(i,r),this._$El=null}}_$AK(t,e){var s;const n=this.constructor,i=n._$Ev.get(t);if(void 0!==i&&this._$El!==i){const t=n.getPropertyOptions(i),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(s=t.converter)||void 0===s?void 0:s.fromAttribute)?t.converter:d;this._$El=i,this[i]=r.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,s){let n=!0;void 0!==t&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||_)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===s.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,s))):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 s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),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(s)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(s)}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){}};var f;g.finalized=!0,g.elementProperties=new Map,g.elementStyles=[],g.shadowRootOptions={mode:"open"},null==u||u({ReactiveElement:g}),(null!==(a=l.reactiveElementVersions)&&void 0!==a?a:l.reactiveElementVersions=[]).push("1.5.0");const y=window,v=y.trustedTypes,b=v?v.createPolicy("lit-html",{createHTML:t=>t}):void 0,m=`lit$${(Math.random()+"").slice(9)}$`,w="?"+m,$=`<${w}>`,A=document,S=(t="")=>A.createComment(t),E=t=>null===t||"object"!=typeof t&&"function"!=typeof t,x=Array.isArray,k=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,C=/-->/g,N=/>/g,M=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),O=/'/g,P=/"/g,R=/^(?:script|style|textarea|title)$/i,T=(t=>(e,...s)=>({_$litType$:t,strings:e,values:s}))(1),U=Symbol.for("lit-noChange"),W=Symbol.for("lit-nothing"),L=new WeakMap,I=A.createTreeWalker(A,129,null,!1),z=(t,e)=>{const s=t.length-1,n=[];let i,r=2===e?"":"",o=k;for(let e=0;e"===l[0]?(o=null!=i?i:k,c=-1):void 0===l[1]?c=-2:(c=o.lastIndex-l[2].length,a=l[1],o=void 0===l[3]?M:'"'===l[3]?P:O):o===P||o===O?o=M:o===C||o===N?o=k:(o=M,i=void 0);const u=o===M&&t[e+1].startsWith("/>")?" ":"";r+=o===k?s+$:c>=0?(n.push(a),s.slice(0,c)+"$lit$"+s.slice(c)+m+u):s+m+(-2===c?(n.push(void 0),e):u)}const a=r+(t[s]||"")+(2===e?"":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==b?b.createHTML(a):a,n]};class B{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let i=0,r=0;const o=t.length-1,a=this.parts,[l,c]=z(t,e);if(this.el=B.createElement(l,s),I.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=I.nextNode())&&a.length0){n.textContent=v?v.emptyScript:"";for(let s=0;sx(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this.g(t)}O(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==W&&E(this._$AH)?this._$AA.nextSibling.data=t:this.T(A.createTextNode(t)),this._$AH=t}$(t){var e;const{values:s,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=B.createElement(n.h,this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.p(s);else{const t=new class{constructor(t,e){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var e;const{el:{content:s},parts:n}=this._$AD,i=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:A).importNode(s,!0);I.currentNode=i;let r=I.nextNode(),o=0,a=0,l=n[0];for(;void 0!==l;){if(o===l.index){let e;2===l.type?e=new H(r,r.nextSibling,this,t):1===l.type?e=new l.ctor(r,l.name,l.strings,this,t):6===l.type&&(e=new K(r,this,t)),this.u.push(e),l=n[++a]}o!==(null==l?void 0:l.index)&&(r=I.nextNode(),o++)}return i}p(t){let e=0;for(const s of this.u)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}(i,this),e=t.v(this.options);t.p(s),this.T(e),this._$AH=t}}_$AC(t){let e=L.get(t.strings);return void 0===e&&L.set(t.strings,e=new B(t)),e}k(t){x(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new H(this.O(S()),this.O(S()),this,this.options)):s=e[n],s._$AI(i),n++;n2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=W}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){const i=this.strings;let r=!1;if(void 0===i)t=D(this,t,e,0),r=!E(t)||t!==this._$AH&&t!==U,r&&(this._$AH=t);else{const n=t;let o,a;for(t=i[0],o=0;o{var n,i;const r=null!==(n=null==s?void 0:s.renderBefore)&&void 0!==n?n:e;let o=r._$litPart$;if(void 0===o){const t=null!==(i=null==s?void 0:s.renderBefore)&&void 0!==i?i:null;r._$litPart$=o=new H(e.insertBefore(S(),t),t,void 0,null!=s?s:{})}return o._$AI(t),o})(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 U}}Q.finalized=!0,Q._$litElement$=!0,null===(q=globalThis.litElementHydrateSupport)||void 0===q||q.call(globalThis,{LitElement:Q});const X=globalThis.litElementPolyfillSupport;null==X||X({LitElement:Q}),(null!==(Y=globalThis.litElementVersions)&&void 0!==Y?Y:globalThis.litElementVersions=[]).push("3.2.2");class tt{constructor(){this.path=this.getPath()}getPath=function(){const t=document.querySelector('script[src*="fr24_card.js"]').getAttribute("src");return t.substring(0,t.lastIndexOf("/")+1)}}class et{constructor(){this.setRanges()}setRanges=function(){this.ranges=[{start:7340032,end:7344127,country:"Afghanistan",iso_3166_1:"AF"},{start:5246976,end:5247999,country:"Albania",iso_3166_1:"AL"},{start:655360,end:688127,country:"Algeria",iso_3166_1:"DZ"},{start:589824,end:593919,country:"Angola",iso_3166_1:"AO"},{start:827392,end:828415,country:"Antigua and Barbuda",iso_3166_1:"AG"},{start:14680064,end:14942207,country:"Argentina",iso_3166_1:"AR"},{start:6291456,end:6292479,country:"Armenia",iso_3166_1:"AM"},{start:8126464,end:8388607,country:"Australia",iso_3166_1:"AU"},{start:4456448,end:4489215,country:"Austria",iso_3166_1:"AT"},{start:6293504,end:6294527,country:"Azerbaijan",iso_3166_1:"AZ"},{start:688128,end:692223,country:"Bahamas",iso_3166_1:"BS"},{start:8994816,end:8998911,country:"Bahrain",iso_3166_1:"BH"},{start:7348224,end:7352319,country:"Bangladesh",iso_3166_1:"BD"},{start:696320,end:697343,country:"Barbados",iso_3166_1:"BB"},{start:5308416,end:5309439,country:"Belarus",iso_3166_1:"BY"},{start:4489216,end:4521983,country:"Belgium",iso_3166_1:"BE"},{start:700416,end:701439,country:"Belize",iso_3166_1:"BZ"},{start:606208,end:607231,country:"Benin",iso_3166_1:"BJ"},{start:6815744,end:6816767,country:"Bhutan",iso_3166_1:"BT"},{start:15286272,end:15290367,country:"Bolivia",iso_3166_1:"BO"},{start:5320704,end:5321727,country:"Bosnia and Herzegovina",iso_3166_1:"BA"},{start:196608,end:197631,country:"Botswana",iso_3166_1:"BW"},{start:14942208,end:15204351,country:"Brazil",iso_3166_1:"BR"},{start:8998912,end:8999935,country:"Brunei Darussalam",iso_3166_1:"BN"},{start:4521984,end:4554751,country:"Bulgaria",iso_3166_1:"BG"},{start:638976,end:643071,country:"Burkina Faso",iso_3166_1:"BF"},{start:204800,end:208895,country:"Burundi",iso_3166_1:"BI"},{start:7397376,end:7401471,country:"Cambodia",iso_3166_1:"KH"},{start:212992,end:217087,country:"Cameroon",iso_3166_1:"CM"},{start:12582912,end:12845055,country:"Canada",iso_3166_1:"CA"},{start:614400,end:615423,country:"Cape Verde",iso_3166_1:"CV"},{start:442368,end:446463,country:"Central African Republic",iso_3166_1:"CF"},{start:540672,end:544767,country:"Chad",iso_3166_1:"TD"},{start:15204352,end:15208447,country:"Chile",iso_3166_1:"CL"},{start:7864320,end:8126463,country:"China",iso_3166_1:"CN"},{start:704512,end:708607,country:"Colombia",iso_3166_1:"CO"},{start:217088,end:218111,country:"Comoros",iso_3166_1:"KM"},{start:221184,end:225279,country:"Congo",iso_3166_1:"CG"},{start:9441280,end:9442303,country:"Cook Islands",iso_3166_1:"CK"},{start:712704,end:716799,country:"Costa Rica",iso_3166_1:"CR"},{start:229376,end:233471,country:"Cote d'Ivoire",iso_3166_1:"CI"},{start:5250048,end:5251071,country:"Croatia",iso_3166_1:"HR"},{start:720896,end:724991,country:"Cuba",iso_3166_1:"CU"},{start:5013504,end:5014527,country:"Cyprus",iso_3166_1:"CY"},{start:4816896,end:4849663,country:"Czech Republic",iso_3166_1:"CZ"},{start:7471104,end:7503871,country:"Democratic People's Republic of Korea",iso_3166_1:"KP"},{start:573440,end:577535,country:"Democratic Republic of the Congo",iso_3166_1:"CD"},{start:4554752,end:4587519,country:"Denmark",iso_3166_1:"DK"},{start:622592,end:623615,country:"Djibouti",iso_3166_1:"DJ"},{start:802816,end:806911,country:"Dominican Republic",iso_3166_1:"DO"},{start:15220736,end:15224831,country:"Ecuador",iso_3166_1:"EC"},{start:65536,end:98303,country:"Egypt",iso_3166_1:"EG"},{start:729088,end:733183,country:"El Salvador",iso_3166_1:"SV"},{start:270336,end:274431,country:"Equatorial Guinea",iso_3166_1:"GQ"},{start:2105344,end:2106367,country:"Eritrea",iso_3166_1:"ER"},{start:5312512,end:5313535,country:"Estonia",iso_3166_1:"EE"},{start:262144,end:266239,country:"Ethiopia",iso_3166_1:"ET"},{start:13139968,end:13144063,country:"Fiji",iso_3166_1:"FJ"},{start:4587520,end:4620287,country:"Finland",iso_3166_1:"FI"},{start:3670016,end:3932159,country:"France",iso_3166_1:"FR"},{start:253952,end:258047,country:"Gabon",iso_3166_1:"GA"},{start:630784,end:634879,country:"Gambia",iso_3166_1:"GM"},{start:5324800,end:5325823,country:"Georgia",iso_3166_1:"GE"},{start:3932160,end:4194303,country:"Germany",iso_3166_1:"DE"},{start:278528,end:282623,country:"Ghana",iso_3166_1:"GH"},{start:4620288,end:4653055,country:"Greece",iso_3166_1:"GR"},{start:835584,end:836607,country:"Grenada",iso_3166_1:"GD"},{start:737280,end:741375,country:"Guatemala",iso_3166_1:"GT"},{start:286720,end:290815,country:"Guinea",iso_3166_1:"GN"},{start:294912,end:295935,country:"Guinea-Bissau",iso_3166_1:"GW"},{start:745472,end:749567,country:"Guyana",iso_3166_1:"GY"},{start:753664,end:757759,country:"Haiti",iso_3166_1:"HT"},{start:761856,end:765951,country:"Honduras",iso_3166_1:"HN"},{start:4653056,end:4685823,country:"Hungary",iso_3166_1:"HU"},{start:5029888,end:5033983,country:"Iceland",iso_3166_1:"IS"},{start:8388608,end:8650751,country:"India",iso_3166_1:"IN"},{start:9043968,end:9076735,country:"Indonesia",iso_3166_1:"ID"},{start:7536640,end:7569407,country:"Iran, Islamic Republic of",iso_3166_1:"IR"},{start:7503872,end:7536639,country:"Iraq",iso_3166_1:"IQ"},{start:5021696,end:5025791,country:"Ireland",iso_3166_1:"IE"},{start:7569408,end:7602175,country:"Israel",iso_3166_1:"IL"},{start:3145728,end:3407871,country:"Italy",iso_3166_1:"IT"},{start:778240,end:782335,country:"Jamaica",iso_3166_1:"JM"},{start:8650752,end:8912895,country:"Japan",iso_3166_1:"JP"},{start:7602176,end:7634943,country:"Jordan",iso_3166_1:"JO"},{start:6828032,end:6829055,country:"Kazakhstan",iso_3166_1:"KZ"},{start:311296,end:315391,country:"Kenya",iso_3166_1:"KE"},{start:13164544,end:13165567,country:"Kiribati",iso_3166_1:"KI"},{start:7364608,end:7368703,country:"Kuwait",iso_3166_1:"KW"},{start:6295552,end:6296575,country:"Kyrgyzstan",iso_3166_1:"KG"},{start:7372800,end:7376895,country:"Lao People's Democratic Republic",iso_3166_1:"LA"},{start:5254144,end:5255167,country:"Latvia",iso_3166_1:"LV"},{start:7634944,end:7667711,country:"Lebanon",iso_3166_1:"LB"},{start:303104,end:304127,country:"Lesotho",iso_3166_1:"LS"},{start:327680,end:331775,country:"Liberia",iso_3166_1:"LR"},{start:98304,end:131071,country:"Libyan Arab Jamahiriya",iso_3166_1:"LY"},{start:5258240,end:5259263,country:"Lithuania",iso_3166_1:"LT"},{start:5046272,end:5047295,country:"Luxembourg",iso_3166_1:"LU"},{start:344064,end:348159,country:"Madagascar",iso_3166_1:"MG"},{start:360448,end:364543,country:"Malawi",iso_3166_1:"MW"},{start:7667712,end:7700479,country:"Malaysia",iso_3166_1:"MY"},{start:368640,end:369663,country:"Maldives",iso_3166_1:"MV"},{start:376832,end:380927,country:"Mali",iso_3166_1:"ML"},{start:5054464,end:5055487,country:"Malta",iso_3166_1:"MT"},{start:9437184,end:9438207,country:"Marshall Islands",iso_3166_1:"MH"},{start:385024,end:386047,country:"Mauritania",iso_3166_1:"MR"},{start:393216,end:394239,country:"Mauritius",iso_3166_1:"MU"},{start:851968,end:884735,country:"Mexico",iso_3166_1:"MX"},{start:6819840,end:6820863,country:"Micronesia, Federated States of",iso_3166_1:"FM"},{start:5062656,end:5063679,country:"Monaco",iso_3166_1:"MC"},{start:6823936,end:6824959,country:"Mongolia",iso_3166_1:"MN"},{start:5332992,end:5334015,country:"Montenegro",iso_3166_1:"ME"},{start:131072,end:163839,country:"Morocco",iso_3166_1:"MA"},{start:24576,end:28671,country:"Mozambique",iso_3166_1:"MZ"},{start:7356416,end:7360511,country:"Myanmar",iso_3166_1:"MM"},{start:2101248,end:2102271,country:"Namibia",iso_3166_1:"NA"},{start:13148160,end:13149183,country:"Nauru",iso_3166_1:"NR"},{start:7380992,end:7385087,country:"Nepal",iso_3166_1:"NP"},{start:4718592,end:4751359,country:"Netherlands, Kingdom of the",iso_3166_1:"NL"},{start:13107200,end:13139967,country:"New Zealand",iso_3166_1:"NZ"},{start:786432,end:790527,country:"Nicaragua",iso_3166_1:"NI"},{start:401408,end:405503,country:"Niger",iso_3166_1:"NE"},{start:409600,end:413695,country:"Nigeria",iso_3166_1:"NG"},{start:4685824,end:4718591,country:"Norway",iso_3166_1:"NO"},{start:7389184,end:7390207,country:"Oman",iso_3166_1:"OM"},{start:7733248,end:7766015,country:"Pakistan",iso_3166_1:"PK"},{start:6832128,end:6833151,country:"Palau",iso_3166_1:"PW"},{start:794624,end:798719,country:"Panama",iso_3166_1:"PA"},{start:9011200,end:9015295,country:"Papua New Guinea",iso_3166_1:"PG"},{start:15237120,end:15241215,country:"Paraguay",iso_3166_1:"PY"},{start:15253504,end:15257599,country:"Peru",iso_3166_1:"PE"},{start:7700480,end:7733247,country:"Philippines",iso_3166_1:"PH"},{start:4751360,end:4784127,country:"Poland",iso_3166_1:"PL"},{start:4784128,end:4816895,country:"Portugal",iso_3166_1:"PT"},{start:434176,end:435199,country:"Qatar",iso_3166_1:"QA"},{start:7438336,end:7471103,country:"Republic of Korea",iso_3166_1:"KR"},{start:5262336,end:5263359,country:"Republic of Moldova",iso_3166_1:"MD"},{start:4849664,end:4882431,country:"Romania",iso_3166_1:"RO"},{start:1048576,end:2097151,country:"Russian Federation",iso_3166_1:"RU"},{start:450560,end:454655,country:"Rwanda",iso_3166_1:"RW"},{start:13156352,end:13157375,country:"Saint Lucia",iso_3166_1:"LC"},{start:770048,end:771071,country:"Saint Vincent and the Grenadines",iso_3166_1:"VC"},{start:9445376,end:9446399,country:"Samoa",iso_3166_1:"WS"},{start:5242880,end:5243903,country:"San Marino",iso_3166_1:"SM"},{start:647168,end:648191,country:"Sao Tome and Principe",iso_3166_1:"ST"},{start:7405568,end:7438335,country:"Saudi Arabia",iso_3166_1:"SA"},{start:458752,end:462847,country:"Senegal",iso_3166_1:"SN"},{start:4980736,end:5013503,country:"Serbia",iso_3166_1:"RS"},{start:475136,end:476159,country:"Seychelles",iso_3166_1:"SC"},{start:483328,end:484351,country:"Sierra Leone",iso_3166_1:"SL"},{start:7766016,end:7798783,country:"Singapore",iso_3166_1:"SG"},{start:5266432,end:5267455,country:"Slovakia",iso_3166_1:"SK"},{start:5270528,end:5271551,country:"Slovenia",iso_3166_1:"SI"},{start:9007104,end:9008127,country:"Solomon Islands",iso_3166_1:"SB"},{start:491520,end:495615,country:"Somalia",iso_3166_1:"SO"},{start:32768,end:65535,country:"South Africa",iso_3166_1:"ZA"},{start:3407872,end:3670015,country:"Spain",iso_3166_1:"ES"},{start:7798784,end:7831551,country:"Sri Lanka",iso_3166_1:"LK"},{start:507904,end:511999,country:"Sudan",iso_3166_1:"SD"},{start:819200,end:823295,country:"Suriname",iso_3166_1:"SR"},{start:499712,end:500735,country:"Swaziland",iso_3166_1:"SZ"},{start:4882432,end:4915199,country:"Sweden",iso_3166_1:"SE"},{start:4915200,end:4947967,country:"Switzerland",iso_3166_1:"CH"},{start:7831552,end:7864319,country:"Syrian Arab Republic",iso_3166_1:"SY"},{start:5328896,end:5329919,country:"Tajikistan",iso_3166_1:"TJ"},{start:8912896,end:8945663,country:"Thailand",iso_3166_1:"TH"},{start:5316608,end:5317631,country:"North Macedonia",iso_3166_1:"MK"},{start:557056,end:561151,country:"Togo",iso_3166_1:"TG"},{start:13160448,end:13161471,country:"Tonga",iso_3166_1:"TO"},{start:811008,end:815103,country:"Trinidad and Tobago",iso_3166_1:"TT"},{start:163840,end:196607,country:"Tunisia",iso_3166_1:"TN"},{start:4947968,end:4980735,country:"Turkey",iso_3166_1:"TR"},{start:6297600,end:6298623,country:"Turkmenistan",iso_3166_1:"TM"},{start:425984,end:430079,country:"Uganda",iso_3166_1:"UG"},{start:5275648,end:5308415,country:"Ukraine",iso_3166_1:"UA"},{start:9003008,end:9007103,country:"United Arab Emirates",iso_3166_1:"AE"},{start:4194304,end:4456447,country:"United Kingdom",iso_3166_1:"GB"},{start:524288,end:528383,country:"United Republic of Tanzania",iso_3166_1:"TZ"},{start:10485760,end:11534335,country:"United States",iso_3166_1:"US"},{start:15269888,end:15273983,country:"Uruguay",iso_3166_1:"UY"},{start:5274624,end:5275647,country:"Uzbekistan",iso_3166_1:"UZ"},{start:13172736,end:13173759,country:"Vanuatu",iso_3166_1:"VU"},{start:884736,end:917503,country:"Venezuela",iso_3166_1:"VE"},{start:8945664,end:8978431,country:"Viet Nam",iso_3166_1:"VN"},{start:8978432,end:8982527,country:"Yemen",iso_3166_1:"YE"},{start:565248,end:569343,country:"Zambia",iso_3166_1:"ZM"},{start:16384,end:17407,country:"Zimbabwe",iso_3166_1:"ZW"},{start:15728640,end:15761407,country:"ICAO (temporary assignments)",iso_3166_1:null},{start:9015296,end:9016319,country:"ICAO (special use)",iso_3166_1:null},{start:15765504,end:15766527,country:"ICAO (special use)",iso_3166_1:null},{start:2097152,end:2621439,country:"Unassigned (AFI region)",iso_3166_1:null},{start:2621440,end:2686975,country:"Unassigned (SAM region)",iso_3166_1:null},{start:5242880,end:6291455,country:"Unassigned (EUR / NAT regions)",iso_3166_1:null},{start:6291456,end:6815743,country:"Unassigned (MID region)",iso_3166_1:null},{start:6815744,end:7340031,country:"Unassigned (ASIA region)",iso_3166_1:null},{start:9437184,end:10485759,country:"Unassigned (NAM / PAC regions)",iso_3166_1:null},{start:11534336,end:12582911,country:"Unassigned (reserved for future use)",iso_3166_1:null},{start:15466496,end:15728639,country:"Unassigned (CAR region)",iso_3166_1:null},{start:13631488,end:14680063,country:"Unassigned (reserved for future use)",iso_3166_1:null},{start:15728640,end:16777215,country:"Unassigned (reserved for future use)",iso_3166_1:null}]};find=function(t){let e=+("0x"+t);for(let t=0;t=this.ranges[t].start&&e<=this.ranges[t].end)return this.ranges[t];return null}}class st{constructor(){this.limitedAlphabet="ABCDEFGHJKLMNPQRSTUVWXYZ",this.fullAlphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ",this.strideMappings=[{start:32785,s1:676,s2:26,prefix:"ZS-"},{start:3735552,s1:1024,s2:32,prefix:"F-G"},{start:3768320,s1:1024,s2:32,prefix:"F-H"},{start:3949601,s1:1024,s2:32,prefix:"D-A",first:"AAA",last:"OZZ"},{start:3932161,s1:676,s2:26,prefix:"D-A",first:"PAA",last:"ZZZ"},{start:3965985,s1:1024,s2:32,prefix:"D-B",first:"AAA",last:"OZZ"},{start:3940353,s1:676,s2:26,prefix:"D-B",first:"PAA",last:"ZZZ"},{start:3981312,s1:676,s2:26,prefix:"D-C"},{start:3998888,s1:676,s2:26,prefix:"D-E"},{start:4016464,s1:676,s2:26,prefix:"D-F"},{start:4034040,s1:676,s2:26,prefix:"D-G"},{start:4051616,s1:676,s2:26,prefix:"D-H"},{start:4069192,s1:676,s2:26,prefix:"D-I"},{start:4490273,s1:1024,s2:32,prefix:"OO-"},{start:4555809,s1:1024,s2:32,prefix:"OY-"},{start:4587520,s1:676,s2:26,prefix:"OH-"},{start:4621345,s1:1024,s2:32,prefix:"SX-"},{start:4785185,s1:1024,s2:32,prefix:"CS-"},{start:4850721,s1:1024,s2:32,prefix:"YR-"},{start:4949025,s1:1024,s2:32,prefix:"TC-"},{start:7603233,s1:1024,s2:32,prefix:"JY-"},{start:7734305,s1:1024,s2:32,prefix:"AP-"},{start:7767073,s1:1024,s2:32,prefix:"9V-"},{start:7832609,s1:1024,s2:32,prefix:"YK-"},{start:8126464,s1:1296,s2:36,prefix:"VH-"},{start:12582913,s1:676,s2:26,prefix:"C-F"},{start:12600489,s1:676,s2:26,prefix:"C-G"},{start:14684225,s1:4096,s2:64,prefix:"LV-"}],this.numericMappings=[{start:1310720,first:0,count:1e5,template:"RA-00000"},{start:721896,first:1e3,count:1e3,template:"CU-T0000"}];for(let t=0;ts.end)continue;let n=t-s.start+s.offset,i=Math.floor(n/s.s1);n%=s.s1;let r=Math.floor(n/s.s2);n%=s.s2;let o=n;if(!(i<0||i>=s.alphabet.length||r<0||r>=s.alphabet.length||o<0||o>=s.alphabet.length))return s.prefix+s.alphabet.charAt(i)+s.alphabet.charAt(r)+s.alphabet.charAt(o)}return null};numericReg=function(t){let e;for(e=0;es.end)continue;let n=t-s.start+s.first+"";return s.template.substring(0,s.template.length-n.length)+n}};nLetters=function(t){return 0==t?"":(--t,this.limitedAlphabet.charAt(Math.floor(t/25))+this.nLetter(t%25))};nLetter=function(t){return 0==t?"":(--t,this.limitedAlphabet.charAt(t))};nReg=function(t){let e=t-10485761;if(e<0||e>=915399)return null;let s="N"+(Math.floor(e/101711)+1);return e%=101711,e<=600?s+this.nLetters(e):(e-=601,s+=Math.floor(e/10111),e%=10111,e<=600?s+this.nLetters(e):(e-=601,s+=Math.floor(e/951),e%=951,e<=600?s+this.nLetters(e):(e-=601,s+=Math.floor(e/35).toFixed(0),e%=35,e<=24?s+this.nLetter(e):(e-=25,s+e.toFixed(0)))))};hlReg=function(t){return t>=7453184&&t<=7454617?"HL"+(t-7453184+29184).toString(16):t>=7454720&&t<=7454873?"HL"+(t-7454720+32768).toString(16):t>=7455232&&t<=7455385?"HL"+(t-7455232+33280).toString(16):null};jaReg=function(t){let e=t-8650752;if(e<0||e>=229840)return null;let s="JA",n=Math.floor(e/22984);if(n<0||n>9)return null;s+=n,e%=22984;let i=Math.floor(e/916);if(i<0||i>9)return null;if(s+=i,e%=916,e<340){return s+=Math.floor(e/34),e%=34,e<10?s+e:(e-=10,s+this.limitedAlphabet.charAt(e))}e-=340;let r=Math.floor(e/24);return s+this.limitedAlphabet.charAt(r)+this.limitedAlphabet.charAt(e%24)}}class nt{constructor(){this.country=new et,this.registration=new st}}var it,rt;function ot(){return(ot=Object.assign||function(t){for(var e=1;e-1?t.split(".")[1].length:0;s.minimumFractionDigits=n,s.maximumFractionDigits=n}return s},ct=["closed","locked","off"],ht=function(t,e,s,n){n=n||{},s=null==s?{}:s;var i=new Event(e,{bubbles:void 0===n.bubbles||n.bubbles,cancelable:Boolean(n.cancelable),composed:void 0===n.composed||n.composed});return i.detail=s,t.dispatchEvent(i),i},ut=function(t){ht(window,"haptic",t)},dt=function(t,e,s,n,i){var r;if(i&&s.double_tap_action?r=s.double_tap_action:n&&s.hold_action?r=s.hold_action:!n&&s.tap_action&&(r=s.tap_action),r||(r={action:"more-info"}),!r.confirmation||r.confirmation.exemptions&&r.confirmation.exemptions.some((function(t){return t.user===e.user.id}))||confirm(r.confirmation.text||"Are you sure you want to "+r.action+"?"))switch(r.action){case"more-info":(r.entity||s.entity||s.camera_image)&&(ht(t,"hass-more-info",{entityId:r.entity?r.entity:s.entity?s.entity:s.camera_image}),r.haptic&&ut(r.haptic));break;case"navigate":r.navigation_path&&(function(t,e,s){void 0===s&&(s=!1),s?history.replaceState(null,"",e):history.pushState(null,"",e),ht(window,"location-changed",{replace:s})}(0,r.navigation_path),r.haptic&&ut(r.haptic));break;case"url":r.url_path&&window.open(r.url_path),r.haptic&&ut(r.haptic);break;case"toggle":s.entity&&(function(t,e){(function(t,e,s){void 0===s&&(s=!0);var n,i=function(t){return t.substr(0,t.indexOf("."))}(e),r="group"===i?"homeassistant":i;switch(i){case"lock":n=s?"unlock":"lock";break;case"cover":n=s?"open_cover":"close_cover";break;default:n=s?"turn_on":"turn_off"}t.callService(r,n,{entity_id:e})})(t,e,ct.includes(t.states[e].state))}(e,s.entity),r.haptic&&ut(r.haptic));break;case"call-service":if(!r.service)return;var o=r.service.split(".",2),a=o[0],l=o[1],c=ot({},r.service_data);"entity"===c.entity_id&&(c.entity_id=s.entity),e.callService(a,l,c,r.target),r.haptic&&ut(r.haptic);break;case"fire-dom-event":ht(t,"ll-custom",r),r.haptic&&ut(r.haptic)}};class _t{constructor(t,e,s,n){this.config=e,this.lang=n;const i=new tt;this._path=i.getPath(),this.hex=t.hex.toUpperCase(),this.icon="mdi:airplane",this.flight=t.flight??null,this.squawk=t.squawk??null,this.altitude=t.altitude??t.alt_baro??null,this.speed=t.speed??t.gs??null,this.track=t.track??null,this.vert_rate=t.vert_rate??t.baro_rate??null,this.lat=t.lat??null,this.lon=t.lon??null,this.seen=t.seen??100,this.aircraft_type=t.t??null;const r=new nt,o=r.country.find(this.hex);this.flag=null!==o&&null!==o.iso_3166_1?`${this._path}images/flags/${o.iso_3166_1.toLowerCase()}.svg`:null,this.country=null!==o?o.country:null;if(void 0!==t.r&&""!==t.r)this.registration=t.r;else{const t=r.registration.lookup(this.hex);this.registration=t}this.distance=s.isSetUp()?s.calculate(this.lat,this.lon):null,this.setIcon(),this.setUnits()}setIcon=function(){this.vert_rate<0?this.icon="mdi:airplane-landing":this.vert_rate>0&&(this.icon="mdi:airplane-takeoff")};setUnits=function(){if("metric"===this.config.units)!0===this.config.larger_units?this.units={altitude:"km",distance:"km",speed:"km/h"}:this.units={altitude:"m",distance:"m",speed:"m/s"},this.units.age="s",!0!==this.config.track_in_text&&(this.units.track="°");else this.units={altitude:"ft",distance:"NM",speed:"kt",track:"°",age:"s"},!0!==this.config.track_in_text&&(this.units.track="°")};value=function(t,e){let s=this,n=this.units[t]??null;switch(t){case"icon":return``;case"flag":return null!==s.flag?`${s.country}`:"";case"icao":return s.hex;case"age":let i=s.seen??"";return""!==i&&e&&(i+=" "+n),i;case"speed":let r=s.speed??"";if(""!==r){if("metric"===this.config.units)r=this.config.larger_units?at(Math.round(1.852*r)):at(Math.round(.514444444*r));r=at(r),e&&(r+=" "+n)}return r;case"altitude":let o=s.altitude??"";if(""!==o){if("metric"===this.config.units)o=this.config.larger_units?Math.round(.3048*o/1e3*10)/10:Math.round(.3048*o);o=at(o),e&&(o+=" "+n)}return o;case"track":let a=s.track??"";return""!==a&&(!0===this.config.track_in_text?a=this.trackAsText(a,e):e&&(a+=""+n)),a;case"registration":return null===s.registration?this.lang.content.table.data.not_available:s.registration;default:let l=s[t]??"";return""!==l&&"number"==typeof l&&(l=at(l)),e&&""!==l&&null!==n&&(l+=" "+n),l}};altitudeAsColor=function(t){let e="EC5B13",s="EC5B13",n=.5;if(t>1e3&&t<=2e3?(s="EC7C13",n=.001*(t-1e3)):t>2e3&&t<=4e3?(e="EC7C13",s="ECC813",n=5e-4*(t-2e3)):t>4e3&&t<=6e3?(e="ECC813",s="BEDF13",n=5e-4*(t-4e3)):t>6e3&&t<=8e3?(e="BEDF13",s="40EC44",n=5e-4*(t-6e3)):t>8e3&&t<=1e4?(e="40EC44",s="11E276",n=5e-4*(t-8e3)):t>1e4&&t<=2e4?(e="11E276",s="13BBDE",n=1e-4*(t-1e4)):t>2e4&&t<=3e4?(e="13BBDE",s="241FEC",n=1e-4*(t-2e4)):t>3e4&&t<=4e4?(e="241FEC",s="EB13EC",n=1e-4*(t-3e4)):t>4e4&&(e="EB13EC",s="EB13EC"),e===s)return e;e=e.match(/.{1,2}/g).map((t=>parseInt(t,16)*(1-n))),s=s.match(/.{1,2}/g).map((t=>parseInt(t,16)*n));let i=[0,1,2].map((t=>Math.min(Math.round(e[t]+s[t]),255))),r=i.reduce(((t,e)=>(t<<8)+e),0).toString(16).padStart(6,"0");return"#"+r};trackAsText=function(t,e){let s="n";return t>=11.25&&t<=33.75?s="nne":t>=33.75&&t<=56.25?s="ne":t>=56.25&&t<=78.75?s="ene":t>=78.75&&t<=101.25?s="e":t>=101.25&&t<=123.75?s="ese":t>=123.75&&t<=146.25?s="se":t>=146.25&&t<=168.75?s="sse":t>=168.75&&t<=191.25?s="s":t>=191.25&&t<=213.75?s="ssw":t>=213.75&&t<=236.25?s="sw":t>=236.25&&t<=258.75?s="wsw":t>=258.75&&t<=281.25?s="w":t>=281.25&&t<=303.75?s="wnw":t>=303.75&&t<=326.25?s="nw":t>=326.25&&t<=348.75&&(s="nnw"),e?this.lang.content.track.long[s]:this.lang.content.track.short[s]}}var pt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},gt={},ft=pt&&pt.__spreadArrays||function(){for(var t=0,e=0,s=arguments.length;e{if(!this.merged.availableColumns.hasOwnProperty(e))throw new Error("Column '"+e+"' does not exist");t+=this.merged.availableColumns[e].weight})),t>15&&(this.error="Too many columns defined")}else this.error="Order '"+this.merged.order+"' is not supported";else this.error="Unit '"+this.merged.units+"' is not supported";else this.error="You need to define and entity";return""===this.error}}class wt{constructor(t,e){this.config=t,this.zone=t.zone,this.units=t.units,this.hass=e,null!==this.zone&&this.getCoordinatesOfZone()}isSetUp=function(){return this.hasOwnProperty("lat")&&this.hasOwnProperty("lon")};getCoordinatesOfZone=function(){let t=this.hass.states[this.zone];void 0!==t&&(this.lat=t.attributes.latitude,this.lon=t.attributes.longitude,this.config.distance=!0)};calculate=function(t,e){if(null===t||null===e)return"";if(t===this.lat&&e===this.lon)return 0;let s=this.lat*(Math.PI/180),n=t*(Math.PI/180),i=n-s,r=(e-this.lon)*(Math.PI/180),o=12742142*Math.asin(Math.sqrt(Math.sin(i/2)*Math.sin(i/2)+Math.cos(s)*Math.cos(n)*Math.sin(r/2)*Math.sin(r/2)));switch(o=Math.round(o),this.units){case"metric":this.config.larger_units&&(o=Math.round(o/1e3*10)/10);break;case"default":o=Math.round(.000539956803*o*10)/10}return o}}var $t={table:{head:{icao:"ICAO Code",country:"Land",registration:"Registration",flight:"Flug",squawk:"Squawk",altitude:"Höhe",speed:"Geschwindigkeit",distance:"Entfernung",track:"Richtung",age:"Letzte Nachricht",aircraft_type:"Typ"},data:{not_available:"N/V",none:"Keine Flugzeuge erkannt!",undefined:"Die konfigurierte Entität enthält keine Daten!"}},popup:{table:{head:{property:"Eigenschaft",value:"Wert"}}},track:{short:{n:"N",nne:"NNO",ne:"NO",ene:"ONO",e:"O",ese:"OSO",se:"SO",sse:"SSO",s:"S",ssw:"SSW",sw:"SW",wsw:"WSW",w:"W",wnw:"WNW",nw:"NW",nnw:"NNW"},long:{n:"Nord",nne:"Nord-Nord-Ost",ne:"Nord-Ost",ene:"Ost-Nord-Ost",e:"Ost",ese:"Ost-Süd-Ost",se:"Süd-Ost",sse:"Süd-Süd-Ost",s:"Süd",ssw:"Süd-Süd-West",sw:"Süd-West",wsw:"West-Süd-West",w:"West",wnw:"West-Nord-West",nw:"Nord-West",nnw:"Nord-Nord-West"}}},At={table:{head:{icao:"ICAO Code",country:"Country",registration:"Registration",flight:"Flight",squawk:"Squawk",altitude:"Altitude",speed:"Speed",distance:"Distance",track:"Track",age:"Last message",aircraft_type:"Type"},data:{not_available:"N/A",none:"No aircrafts detected!",undefined:"The configurated entity doesn't contain data!"}},popup:{table:{head:{property:"Property",value:"Value"}}},track:{short:{n:"N",nne:"NNE",ne:"NE",ene:"ENE",e:"E",ese:"ESE",se:"SE",sse:"SSE",s:"S",ssw:"SSW",sw:"SW",wsw:"WSW",w:"W",wnw:"WNW",nw:"NW",nnw:"NNW"},long:{n:"North",nne:"North-northeast",ne:"Northeast",ene:"East-northeast",e:"East",ese:"East-southeast",se:"Southeast",sse:"South-southeast",s:"South",ssw:"South-southwest",sw:"Southwest",wsw:"West-southwest",w:"West",wnw:"West-northwest",nw:"Northwest",nnw:"North-northwest"}}},St={table:{head:{icao:"ICAO-tunnus",country:"Maa",registration:"Rekisteröinti",flight:"Lento",squawk:"Tunniste",altitude:"Korkeus",speed:"Nopeus",distance:"Etäisyys",track:"Lentorata",age:"Viimeisin viesti",aircraft_type:"Tyyppi"},data:{not_available:"Ei saatavilla",none:"Ei havaittuja lentoaluksia!",undefined:"Määritys ei sisällä dataa!"}},popup:{table:{head:{property:"Kenttä",value:"Arvo"}}},track:{short:{n:"N",nne:"NNE",ne:"NE",ene:"ENE",e:"E",ese:"ESE",se:"SE",sse:"SSE",s:"S",ssw:"SSW",sw:"SW",wsw:"WSW",w:"W",wnw:"WNW",nw:"NW",nnw:"NNW"},long:{n:"Pohjoinen",nne:"Pohjoiskoillinen",ne:"Koillinen",ene:"Itäkoillinen",e:"Itä",ese:"Itäkaakko",se:"Kaakko",sse:"Eteläkaakko",s:"Etelä",ssw:"Etelälounas",sw:"Lounas",wsw:"Länsilounas",w:"Länsi",wnw:"Länsiluode",nw:"Luode",nnw:"Pohjoisluode"}}},Et={table:{head:{icao:"ICAO code",country:"Land",registration:"Registratie",flight:"Vlucht",squawk:"Squawk",altitude:"Hoogte",speed:"Snelheid",distance:"Afstand",track:"Richting",age:"Laatste bericht",aircraft_type:"Type"},data:{not_available:"Nb",none:"Geen vliegtuigen gedetecteerd!",undefined:"De ingestelde entiteit bevat geen data!"}},popup:{table:{head:{property:"Eigenschap",value:"Waarde"}}},track:{short:{n:"N",nne:"NNO",ne:"NO",ene:"ONO",e:"O",ese:"OZO",se:"ZO",sse:"ZZO",s:"Z",ssw:"ZZW",sw:"ZW",wsw:"WZW",w:"W",wnw:"WNW",nw:"NW",nnw:"NNW"},long:{n:"Noord",nne:"Noordnoordoost",ne:"Noordoost",ene:"Oostnoordoost",e:"Oost",ese:"Oostzuidoost",se:"Zuidoost",sse:"Zuidzuidoost",s:"Zuid",ssw:"Zuidzuidwest",sw:"Zuidwest",wsw:"Westzuidwest",w:"West",wnw:"Westnoordwest",nw:"Noordwest",nnw:"Noordnoordwest"}}},xt={table:{head:{icao:"Kod ICAO",country:"Kraj",registration:"Rejestracja",flight:"Lot",squawk:"Squawk",altitude:"Wysokość",speed:"Prędkość",distance:"Dystans",track:"Kierunek",age:"Ostatnia wiadomość",aircraft_type:"Typ"},data:{not_available:"N/D",none:"Brak wykrytych statków powietrznych!",undefined:"Skonfigurowany obiekt nie zawiera danych!"}},popup:{table:{head:{property:"Właściwość",value:"Wartość"}}},track:{short:{n:"N",nne:"NNE",ne:"NE",ene:"ENE",e:"E",ese:"ESE",se:"SE",sse:"SSE",s:"S",ssw:"SSW",sw:"SW",wsw:"WSW",w:"W",wnw:"WNW",nw:"NW",nnw:"NNW"},long:{n:"Północ",nne:"Północ-północny wschód",ne:"Północny wschód",ene:"Wschód-północny wschód",e:"Wschód",ese:"Wschód-południowy wschód",se:"Południowy wschód",sse:"Południowy-południowy wschód",s:"Południe",ssw:"Południowy-południowy zachód",sw:"Południowy zachód",wsw:"Zachód-południowy zachód",w:"Zachód",wnw:"Zachód-północny zachód",nw:"Północny zachód",nnw:"Północ-północny zachód"}}},kt={table:{head:{icao:"ICAO naslov",country:"Država",registration:"Registracija",flight:"Št. leta",squawk:"Squawk",altitude:"Višina",speed:"Hitrost",distance:"Razdalja",track:"Smer",age:"Zaznano pred",aircraft_type:"Vrsta"},data:{not_available:"N/A",none:"Ni zaznanih letal!",undefined:"Konfigurirana entiteta ne vsebuje podatkov!"}},popup:{table:{head:{property:"Karakteristika",value:"Vrednost"}}},track:{short:{n:"S",nne:"SSV",ne:"SV",ene:"VSV",e:"V",ese:"VJV",se:"JV",sse:"JJV",s:"J",ssw:"JJZ",sw:"JZ",wsw:"ZJZ",w:"Z",wnw:"ZSZ",nw:"SZ",nnw:"SSZ"},long:{n:"sever",nne:"sever-severovzhod",ne:"severovzhod",ene:"vzhod-severovzhod",e:"vzhod",ese:"vzhod-jugovzhod",se:"jugovzhod",sse:"jug-jugovzhod",s:"jug",ssw:"jug-jugozahod",sw:"jugozahod",wsw:"zahod-jugozahod",w:"zahod",wnw:"zahod-severozahod",nw:"severozahod",nnw:"sever-severozahod"}}};class Ct{constructor(t,e){this.config=t,this.hass=e,this.content=At,this.setLang()}setLang=function(){if(null===this.config.lang&&(this.config.lang=this.hass.language),"en"!==this.config.lang)switch(this.config.lang){case"de":this.content=$t;break;case"fi":this.content=St;break;case"nl":this.content=Et;break;case"pl":this.content=xt;break;case"sl":this.content=kt}}}function*Nt(t,e){if(void 0!==t){let s=0;for(const n of t)yield e(n,s++)}}const Mt=2;class Ot{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}class Pt extends Ot{constructor(t){if(super(t),this.it=W,t.type!==Mt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===W||null==t)return this._t=void 0,this.it=t;if(t===U)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}Pt.directiveName="unsafeHTML",Pt.resultType=1;const Rt=(t=>(...e)=>({_$litDirective$:t,values:e}))(Pt);class Tt{urlAdbsExchange="https://globe.adsbexchange.com/?icao=%hex%";urlFlightAware="https://flightaware.com/live/modes/%hex%/redirect";urlFlightRadar24="https://www.flightradar24.com/%flight%";urlOpenskyNetwork="https://opensky-network.org/aircraft-profile?icao24=%hex%";urlPlaneFinder="https://planefinder.net/flight/%flight%";constructor(t,e){this.config=t,this.hass=e}getUrl=function(t,e){void 0===e&&(e=this.config.default_provider);let s=null;switch(e){case"adsbexchange":s=this.urlAdbsExchange;break;case"flightaware":s=this.urlFlightAware;break;case"flightradar24":s=this.urlFlightRadar24;break;case"opensky_network":s=this.urlOpenskyNetwork;break;case"plane_finder":s=this.urlPlaneFinder}return null!==s&&(s=s.replace("%hex%",t.hex).replace("%flight%",t.flight)),s};getImage=function(t){const e=new tt;return this.path=e.getPath(),`${this.path}images/providers/${this.config.inverted_logo?"dark":"light"}/${t}.png`}}class Ut{constructor(t,e,s,n,i){this.hass=t,this.config=e,this.lang=s,this.row=n,this.aircraft=i,this.show()}show=function(){const t=this;fetch("https://api.planespotters.net/pub/photos/hex/"+this.aircraft.hex,{cache:"no-store",headers:{"Content-Type":"text/json"}}).then((t=>t.text())).then((function(e){let s,n=JSON.parse(e),i="",r=t.aircraft.registration||t.aircraft.flight||t.aircraft.hex;if(s=t.aircraft.registration&&t.aircraft.flight||t.aircraft.hex,n.photos.length>0){let t=n.photos[0].thumbnail_large.src,e=n.photos[0].link,s=n.photos[0].photographer;i+=`![${r} - © ${s}](${t} "${r} - © ${s}")`,i+=`© [${s}](${e})\n\n`}i+="## ",t.aircraft.flag&&(i+=``),i+=`${r} - ${s}${t.aircraft.value("icon",!0)}\n`,i+=`|${t.lang.popup.table.head.property}|${t.lang.popup.table.head.value}|\n|:-|-:|\n`,Object.keys(bt).forEach((e=>{let s=bt[e],n=t.aircraft.value(e,!0);s.popup&&""!==n&&(i+=`|${t.lang.table.head[e]}|${n}|\n`)})),i+="\n";let o=new Tt(t.config,t.hass);for(const e in t.config.providers)t.config.providers[e]&&(i+=`* [![${e}](${o.getImage(e)} "${e}")](${o.getUrl(t.aircraft,e)})\n`);const a=t.config.colors.popup_bg??"var(--card-background-color)",l=t.config.colors.popup_text??t.config.colors.table_text??"var(--primary-color)",c=t.config.colors.popup_text??t.config.colors.table_text??"var(--primary-color)",h=t.config.colors.popup_table_head_bg??t.config.colors.table_head_bg??"var(--primary-color)",u=t.config.colors.popup_table_head_text??t.config.colors.table_head_text??"var(--app-header-text-color, white)",d=t.config.colors.popup_text??t.config.colors.table_text??"var(--primary-text-color)",_=t.config.colors.popup_table_even_row_bg??t.config.colors.table_even_row_bg??"var(--primary-background-color)",p=t.config.colors.popup_table_even_row_text??t.config.colors.table_even_row_text??"var(--primary-text-color)";dt(t.row,t.hass,{tap_action:{action:"fire-dom-event",browser_mod:{service:"browser_mod.popup",data:{hide_header:!0,style:`--mdc-theme-surface:${a};`,content:{type:"markdown",content:i,card_mod:{style:{".":`ha-card.type-markdown{border:none;}ha-markdown{background:${a};}ha-markdown a{color:${c}};ha-markdown.no-header{padding-top:0 !important;}`,"ha-markdown$":`img{width:100%}img + span{color:${l};font-size:10px;}img + span a{color:${l}}h2{display:flex;justify-content:space-between;color:${l};}h2 img{width:auto;height:.8em;margin:0 10px 0 0;display:inline-block;vertical-align:baseline;}table{width:100%;border-spacing:0;border-collapse:collapse;}table tr th, table tr td{padding:4px;}table tr th{background-color:${h};color:${u};}table tr{color:${d};}table tr:nth-child(even){background-color:${_};color:${p};}ul{list-style-type:none;padding:0;display:flex;justify-content:space-between;}ul li{display:inline-block;}ul li img{height:24px;width:auto;}`}}}}}}})}))}}customElements.define("fr24-table",class extends Q{static get properties(){return{hass:{type:Object},config:{type:Object},aircrafts:{type:Array},lang:{type:Object}}}constructor(){super(),this.clickService={timer:void 0,target:void 0}}render(){let t=[];this.config.columns.forEach((e=>{let s=bt[e];if(!1===s.show)return;let n=this.lang.table.head[e]??"";t.push({value:n,styles:s.styles??[]})}));let e=[];if(!0===this.config.units_in_table){let t=this.aircrafts[0];this.config.columns.forEach((s=>{let n=bt[s];if(!1===n.show)return;let i=t.units[s]??"";e.push({value:i,styles:n.styles??[]})}))}let s=[],n=0;for(let t of this.aircrafts){let e=[];this.config.columns.forEach((s=>{let n=bt[s];!1!==n.show&&e.push({value:t.value(s),html:n.html??!1,styles:n.styles??[]})}));let i={};if(this.config.popup&&(i.hex=t.hex),s.push({cells:e,attrs:i}),n++,Number.isInteger(this.config.limit)&&this.config.limit===n)break}return T`${Nt(t,(t=>T``))}${e.length>0?T`${Nt(e,(t=>T``))}`:""}${Nt(s,(t=>T`${Nt(t.cells,(t=>T``))}`))}
${t.value}
${t.value}
${t.html?T`${Rt(t.value)}`:T`${t.value}`}
`}_handleClick(t){if(this.clickService.target=t.target.closest("tr"),!1===this.config.default_provider&&!0===this.config.popup)return this._handleSingleClick();this.clickService.timer?(clearTimeout(this.clickService.timer),this.clickService.timer=void 0,this.config.default_provider&&this._handleDoubleClick()):this.clickService.timer=setTimeout((()=>{this.clickService.timer=void 0,this.config.popup&&this._handleSingleClick()}),this.config.dbl_click_speed)}_handleSingleClick(t){let e=this.clickService.target;if(e){let t=e.getAttribute("data-hex"),s=this.aircrafts.find((e=>e.hex===t));null!==s&&new Ut(this.hass,this.config,this.lang,e,s)}}_handleDoubleClick(t){let e=this.clickService.target;if(e){let t=e.getAttribute("data-hex"),s=this.aircrafts.find((e=>e.hex===t)),n=new Tt(this.config,this.hass);dt(e,this.hass,{tap_action:{action:"url",url_path:n.getUrl(s)}})}}static get styles(){return r`table{width:100%;border-spacing:0;border-collapse:collapse}table tr td,table tr th{padding:4px;text-align:left}table tr td.align-right,table tr th.align-right{text-align:right}table tr td.width-s,table tr th.width-s{width:20px}table tr th{background-color:var(--fr24-table-head-bg);color:var(--fr24-table-head-text)}table tr td img{width:20px}table thead tr td{background-color:var(--fr24-table-units-bg);color:var(--fr24-table-units-text)}table tbody tr td{color:var(--fr24-table-text)}table tbody tr:nth-child(even){background-color:var(--fr24-table-even-row-bg)}table tbody tr:nth-child(even) td{color:var(--fr24-table-even-row-text)}table tbody tr[data-hex]:not([data-hex=""]){cursor:pointer}`}});customElements.define("fr24-warning",class extends Q{static get properties(){return{config:{type:Object},message:{type:String}}}constructor(){super()}render(){return T`
${this.message}
`}static get styles(){return r`div{padding:4px;background-color:var(--fr24-warning-bg);color:var(--fr24-warning-text);text-align:center}`}}),window.customCards=window.customCards||[],window.customCards.push({type:"fr24-card",name:"Flight Radar card",description:"Card that shows the tracked flights",preview:!1}),window.fr24db=[];customElements.define("fr24-card",class extends Q{static get properties(){return{hass:{},config:{}}}render(){if(this._isStateUndefined=!1,this._distance=new wt(this.config,this.hass),this._lang=new Ct(this.config,this.hass),this.config.entity){this._parseAircrafts();let t=null;return this._isStateUndefined?t=this._lang.content.table.data.undefined:this._aircrafts.length<1&&(t=this._lang.content.table.data.none),null!==t?T`
`:T`
`}return T`Entity not set`}setConfig(t){const e=new tt;if(this._path=e.getPath(),0===window.fr24db.length){const t=document.createElement("script");t.setAttribute("async",""),t.setAttribute("type","text/javascript"),t.setAttribute("src",this._path+"fr24_database.js"),document.head.appendChild(t)}let s=new mt(t);if(!s.validate())throw new Error(s.error);this.config=s.get()}getCardSize(){return Number.isInteger(this.config.limit)?this.config.limit+5:100}static getStubConfig(){return{entity:"sensor.fr24_aircraft"}}_parseAircrafts(){const t=this;if(this._aircrafts=[],void 0===this.hass.states[this.config.entity])return void(this._isStateUndefined=!0);const e=this.hass.states[this.config.entity].attributes[this.config.attribute];this.config.availableColumns.distance.show=!1,!0===this.config.distance&&(this.config.availableColumns.distance.show=!0),e.forEach((t=>{let e=new _t(t,this.config,this._distance,this._lang),s=!0;if(!1!==this.config.hide.old_messages&&e.seen>30&&(s=!1),!1!==this.config.hide.ground_vehicles&&"ground"===e.altitude&&(s=!1),this.config.hide.empty.length>0)for(let t=0;t1&&(this._aircrafts.sort((function(e,s){let n=t.config.sort||"altitude",i=e[n],r=s[n];return i===r?0:null===i||""===i?1:null===r||""===r||i{const n=1===t.length?t[0]:e.reduce(((e,s,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.")})(s)+t[n+1]),t[0]);return new i(n,t,s)},o=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new i("string"==typeof t?t:t+"",void 0,s))(e)})(t):t;var a;const l=window,c=l.trustedTypes,h=c?c.emptyScript:"",d=l.reactiveElementPolyfillSupport,u={toAttribute(t,e){switch(e){case Boolean:t=t?h:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},_=(t,e)=>e!==t&&(e==e||t==t),p={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:_};let g=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,s)=>{const n=this._$Ep(s,e);void 0!==n&&(this._$Ev.set(n,s),t.push(n))})),t}static createProperty(t,e=p){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const s="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,s,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){return{get(){return this[e]},set(n){const i=this[t];this[e]=n,this.requestUpdate(t,i,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||p}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 s of e)this.createProperty(s,t[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(o(t))}else void 0!==t&&e.push(o(t));return e}static _$Ep(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"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,s;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(s=t.hostConnected)||void 0===s||s.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 s;const n=null!==(s=this.shadowRoot)&&void 0!==s?s:this.attachShadow(this.constructor.shadowRootOptions);return((s,n)=>{e?s.adoptedStyleSheets=n.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):n.forEach((e=>{const n=document.createElement("style"),i=t.litNonce;void 0!==i&&n.setAttribute("nonce",i),n.textContent=e.cssText,s.appendChild(n)}))})(n,this.constructor.elementStyles),n}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,s){this._$AK(t,s)}_$EO(t,e,s=p){var n;const i=this.constructor._$Ep(t,s);if(void 0!==i&&!0===s.reflect){const r=(void 0!==(null===(n=s.converter)||void 0===n?void 0:n.toAttribute)?s.converter:u).toAttribute(e,s.type);this._$El=t,null==r?this.removeAttribute(i):this.setAttribute(i,r),this._$El=null}}_$AK(t,e){var s;const n=this.constructor,i=n._$Ev.get(t);if(void 0!==i&&this._$El!==i){const t=n.getPropertyOptions(i),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(s=t.converter)||void 0===s?void 0:s.fromAttribute)?t.converter:u;this._$El=i,this[i]=r.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,s){let n=!0;void 0!==t&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||_)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===s.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,s))):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 s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),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(s)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(s)}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){}};var f;g.finalized=!0,g.elementProperties=new Map,g.elementStyles=[],g.shadowRootOptions={mode:"open"},null==d||d({ReactiveElement:g}),(null!==(a=l.reactiveElementVersions)&&void 0!==a?a:l.reactiveElementVersions=[]).push("1.5.0");const y=window,b=y.trustedTypes,v=b?b.createPolicy("lit-html",{createHTML:t=>t}):void 0,m=`lit$${(Math.random()+"").slice(9)}$`,w="?"+m,$=`<${w}>`,A=document,S=(t="")=>A.createComment(t),E=t=>null===t||"object"!=typeof t&&"function"!=typeof t,x=Array.isArray,k=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,C=/-->/g,N=/>/g,M=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),O=/'/g,P=/"/g,R=/^(?:script|style|textarea|title)$/i,T=(t=>(e,...s)=>({_$litType$:t,strings:e,values:s}))(1),U=Symbol.for("lit-noChange"),W=Symbol.for("lit-nothing"),L=new WeakMap,I=A.createTreeWalker(A,129,null,!1),z=(t,e)=>{const s=t.length-1,n=[];let i,r=2===e?"":"",o=k;for(let e=0;e"===l[0]?(o=null!=i?i:k,c=-1):void 0===l[1]?c=-2:(c=o.lastIndex-l[2].length,a=l[1],o=void 0===l[3]?M:'"'===l[3]?P:O):o===P||o===O?o=M:o===C||o===N?o=k:(o=M,i=void 0);const d=o===M&&t[e+1].startsWith("/>")?" ":"";r+=o===k?s+$:c>=0?(n.push(a),s.slice(0,c)+"$lit$"+s.slice(c)+m+d):s+m+(-2===c?(n.push(void 0),e):d)}const a=r+(t[s]||"")+(2===e?"":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==v?v.createHTML(a):a,n]};class B{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let i=0,r=0;const o=t.length-1,a=this.parts,[l,c]=z(t,e);if(this.el=B.createElement(l,s),I.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=I.nextNode())&&a.length0){n.textContent=b?b.emptyScript:"";for(let s=0;sx(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this.g(t)}O(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==W&&E(this._$AH)?this._$AA.nextSibling.data=t:this.T(A.createTextNode(t)),this._$AH=t}$(t){var e;const{values:s,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=B.createElement(n.h,this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.p(s);else{const t=new class{constructor(t,e){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var e;const{el:{content:s},parts:n}=this._$AD,i=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:A).importNode(s,!0);I.currentNode=i;let r=I.nextNode(),o=0,a=0,l=n[0];for(;void 0!==l;){if(o===l.index){let e;2===l.type?e=new H(r,r.nextSibling,this,t):1===l.type?e=new l.ctor(r,l.name,l.strings,this,t):6===l.type&&(e=new K(r,this,t)),this.u.push(e),l=n[++a]}o!==(null==l?void 0:l.index)&&(r=I.nextNode(),o++)}return i}p(t){let e=0;for(const s of this.u)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}(i,this),e=t.v(this.options);t.p(s),this.T(e),this._$AH=t}}_$AC(t){let e=L.get(t.strings);return void 0===e&&L.set(t.strings,e=new B(t)),e}k(t){x(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new H(this.O(S()),this.O(S()),this,this.options)):s=e[n],s._$AI(i),n++;n2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=W}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){const i=this.strings;let r=!1;if(void 0===i)t=D(this,t,e,0),r=!E(t)||t!==this._$AH&&t!==U,r&&(this._$AH=t);else{const n=t;let o,a;for(t=i[0],o=0;o{var n,i;const r=null!==(n=null==s?void 0:s.renderBefore)&&void 0!==n?n:e;let o=r._$litPart$;if(void 0===o){const t=null!==(i=null==s?void 0:s.renderBefore)&&void 0!==i?i:null;r._$litPart$=o=new H(e.insertBefore(S(),t),t,void 0,null!=s?s:{})}return o._$AI(t),o})(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 U}}Q.finalized=!0,Q._$litElement$=!0,null===(q=globalThis.litElementHydrateSupport)||void 0===q||q.call(globalThis,{LitElement:Q});const X=globalThis.litElementPolyfillSupport;null==X||X({LitElement:Q}),(null!==(Y=globalThis.litElementVersions)&&void 0!==Y?Y:globalThis.litElementVersions=[]).push("3.2.2");class tt{constructor(){this.path=this.getPath()}getPath=function(){const t=document.querySelector('script[src*="fr24_card.js"]').getAttribute("src");return t.substring(0,t.lastIndexOf("/")+1)}}class et{constructor(){this.setRanges()}setRanges=function(){this.ranges=[{start:7340032,end:7344127,country:"Afghanistan",iso_3166_1:"AF"},{start:5246976,end:5247999,country:"Albania",iso_3166_1:"AL"},{start:655360,end:688127,country:"Algeria",iso_3166_1:"DZ"},{start:589824,end:593919,country:"Angola",iso_3166_1:"AO"},{start:827392,end:828415,country:"Antigua and Barbuda",iso_3166_1:"AG"},{start:14680064,end:14942207,country:"Argentina",iso_3166_1:"AR"},{start:6291456,end:6292479,country:"Armenia",iso_3166_1:"AM"},{start:8126464,end:8388607,country:"Australia",iso_3166_1:"AU"},{start:4456448,end:4489215,country:"Austria",iso_3166_1:"AT"},{start:6293504,end:6294527,country:"Azerbaijan",iso_3166_1:"AZ"},{start:688128,end:692223,country:"Bahamas",iso_3166_1:"BS"},{start:8994816,end:8998911,country:"Bahrain",iso_3166_1:"BH"},{start:7348224,end:7352319,country:"Bangladesh",iso_3166_1:"BD"},{start:696320,end:697343,country:"Barbados",iso_3166_1:"BB"},{start:5308416,end:5309439,country:"Belarus",iso_3166_1:"BY"},{start:4489216,end:4521983,country:"Belgium",iso_3166_1:"BE"},{start:700416,end:701439,country:"Belize",iso_3166_1:"BZ"},{start:606208,end:607231,country:"Benin",iso_3166_1:"BJ"},{start:6815744,end:6816767,country:"Bhutan",iso_3166_1:"BT"},{start:15286272,end:15290367,country:"Bolivia",iso_3166_1:"BO"},{start:5320704,end:5321727,country:"Bosnia and Herzegovina",iso_3166_1:"BA"},{start:196608,end:197631,country:"Botswana",iso_3166_1:"BW"},{start:14942208,end:15204351,country:"Brazil",iso_3166_1:"BR"},{start:8998912,end:8999935,country:"Brunei Darussalam",iso_3166_1:"BN"},{start:4521984,end:4554751,country:"Bulgaria",iso_3166_1:"BG"},{start:638976,end:643071,country:"Burkina Faso",iso_3166_1:"BF"},{start:204800,end:208895,country:"Burundi",iso_3166_1:"BI"},{start:7397376,end:7401471,country:"Cambodia",iso_3166_1:"KH"},{start:212992,end:217087,country:"Cameroon",iso_3166_1:"CM"},{start:12582912,end:12845055,country:"Canada",iso_3166_1:"CA"},{start:614400,end:615423,country:"Cape Verde",iso_3166_1:"CV"},{start:442368,end:446463,country:"Central African Republic",iso_3166_1:"CF"},{start:540672,end:544767,country:"Chad",iso_3166_1:"TD"},{start:15204352,end:15208447,country:"Chile",iso_3166_1:"CL"},{start:7864320,end:8126463,country:"China",iso_3166_1:"CN"},{start:704512,end:708607,country:"Colombia",iso_3166_1:"CO"},{start:217088,end:218111,country:"Comoros",iso_3166_1:"KM"},{start:221184,end:225279,country:"Congo",iso_3166_1:"CG"},{start:9441280,end:9442303,country:"Cook Islands",iso_3166_1:"CK"},{start:712704,end:716799,country:"Costa Rica",iso_3166_1:"CR"},{start:229376,end:233471,country:"Cote d'Ivoire",iso_3166_1:"CI"},{start:5250048,end:5251071,country:"Croatia",iso_3166_1:"HR"},{start:720896,end:724991,country:"Cuba",iso_3166_1:"CU"},{start:5013504,end:5014527,country:"Cyprus",iso_3166_1:"CY"},{start:4816896,end:4849663,country:"Czech Republic",iso_3166_1:"CZ"},{start:7471104,end:7503871,country:"Democratic People's Republic of Korea",iso_3166_1:"KP"},{start:573440,end:577535,country:"Democratic Republic of the Congo",iso_3166_1:"CD"},{start:4554752,end:4587519,country:"Denmark",iso_3166_1:"DK"},{start:622592,end:623615,country:"Djibouti",iso_3166_1:"DJ"},{start:802816,end:806911,country:"Dominican Republic",iso_3166_1:"DO"},{start:15220736,end:15224831,country:"Ecuador",iso_3166_1:"EC"},{start:65536,end:98303,country:"Egypt",iso_3166_1:"EG"},{start:729088,end:733183,country:"El Salvador",iso_3166_1:"SV"},{start:270336,end:274431,country:"Equatorial Guinea",iso_3166_1:"GQ"},{start:2105344,end:2106367,country:"Eritrea",iso_3166_1:"ER"},{start:5312512,end:5313535,country:"Estonia",iso_3166_1:"EE"},{start:262144,end:266239,country:"Ethiopia",iso_3166_1:"ET"},{start:13139968,end:13144063,country:"Fiji",iso_3166_1:"FJ"},{start:4587520,end:4620287,country:"Finland",iso_3166_1:"FI"},{start:3670016,end:3932159,country:"France",iso_3166_1:"FR"},{start:253952,end:258047,country:"Gabon",iso_3166_1:"GA"},{start:630784,end:634879,country:"Gambia",iso_3166_1:"GM"},{start:5324800,end:5325823,country:"Georgia",iso_3166_1:"GE"},{start:3932160,end:4194303,country:"Germany",iso_3166_1:"DE"},{start:278528,end:282623,country:"Ghana",iso_3166_1:"GH"},{start:4620288,end:4653055,country:"Greece",iso_3166_1:"GR"},{start:835584,end:836607,country:"Grenada",iso_3166_1:"GD"},{start:737280,end:741375,country:"Guatemala",iso_3166_1:"GT"},{start:286720,end:290815,country:"Guinea",iso_3166_1:"GN"},{start:294912,end:295935,country:"Guinea-Bissau",iso_3166_1:"GW"},{start:745472,end:749567,country:"Guyana",iso_3166_1:"GY"},{start:753664,end:757759,country:"Haiti",iso_3166_1:"HT"},{start:761856,end:765951,country:"Honduras",iso_3166_1:"HN"},{start:4653056,end:4685823,country:"Hungary",iso_3166_1:"HU"},{start:5029888,end:5033983,country:"Iceland",iso_3166_1:"IS"},{start:8388608,end:8650751,country:"India",iso_3166_1:"IN"},{start:9043968,end:9076735,country:"Indonesia",iso_3166_1:"ID"},{start:7536640,end:7569407,country:"Iran, Islamic Republic of",iso_3166_1:"IR"},{start:7503872,end:7536639,country:"Iraq",iso_3166_1:"IQ"},{start:5021696,end:5025791,country:"Ireland",iso_3166_1:"IE"},{start:7569408,end:7602175,country:"Israel",iso_3166_1:"IL"},{start:3145728,end:3407871,country:"Italy",iso_3166_1:"IT"},{start:778240,end:782335,country:"Jamaica",iso_3166_1:"JM"},{start:8650752,end:8912895,country:"Japan",iso_3166_1:"JP"},{start:7602176,end:7634943,country:"Jordan",iso_3166_1:"JO"},{start:6828032,end:6829055,country:"Kazakhstan",iso_3166_1:"KZ"},{start:311296,end:315391,country:"Kenya",iso_3166_1:"KE"},{start:13164544,end:13165567,country:"Kiribati",iso_3166_1:"KI"},{start:7364608,end:7368703,country:"Kuwait",iso_3166_1:"KW"},{start:6295552,end:6296575,country:"Kyrgyzstan",iso_3166_1:"KG"},{start:7372800,end:7376895,country:"Lao People's Democratic Republic",iso_3166_1:"LA"},{start:5254144,end:5255167,country:"Latvia",iso_3166_1:"LV"},{start:7634944,end:7667711,country:"Lebanon",iso_3166_1:"LB"},{start:303104,end:304127,country:"Lesotho",iso_3166_1:"LS"},{start:327680,end:331775,country:"Liberia",iso_3166_1:"LR"},{start:98304,end:131071,country:"Libyan Arab Jamahiriya",iso_3166_1:"LY"},{start:5258240,end:5259263,country:"Lithuania",iso_3166_1:"LT"},{start:5046272,end:5047295,country:"Luxembourg",iso_3166_1:"LU"},{start:344064,end:348159,country:"Madagascar",iso_3166_1:"MG"},{start:360448,end:364543,country:"Malawi",iso_3166_1:"MW"},{start:7667712,end:7700479,country:"Malaysia",iso_3166_1:"MY"},{start:368640,end:369663,country:"Maldives",iso_3166_1:"MV"},{start:376832,end:380927,country:"Mali",iso_3166_1:"ML"},{start:5054464,end:5055487,country:"Malta",iso_3166_1:"MT"},{start:9437184,end:9438207,country:"Marshall Islands",iso_3166_1:"MH"},{start:385024,end:386047,country:"Mauritania",iso_3166_1:"MR"},{start:393216,end:394239,country:"Mauritius",iso_3166_1:"MU"},{start:851968,end:884735,country:"Mexico",iso_3166_1:"MX"},{start:6819840,end:6820863,country:"Micronesia, Federated States of",iso_3166_1:"FM"},{start:5062656,end:5063679,country:"Monaco",iso_3166_1:"MC"},{start:6823936,end:6824959,country:"Mongolia",iso_3166_1:"MN"},{start:5332992,end:5334015,country:"Montenegro",iso_3166_1:"ME"},{start:131072,end:163839,country:"Morocco",iso_3166_1:"MA"},{start:24576,end:28671,country:"Mozambique",iso_3166_1:"MZ"},{start:7356416,end:7360511,country:"Myanmar",iso_3166_1:"MM"},{start:2101248,end:2102271,country:"Namibia",iso_3166_1:"NA"},{start:13148160,end:13149183,country:"Nauru",iso_3166_1:"NR"},{start:7380992,end:7385087,country:"Nepal",iso_3166_1:"NP"},{start:4718592,end:4751359,country:"Netherlands, Kingdom of the",iso_3166_1:"NL"},{start:13107200,end:13139967,country:"New Zealand",iso_3166_1:"NZ"},{start:786432,end:790527,country:"Nicaragua",iso_3166_1:"NI"},{start:401408,end:405503,country:"Niger",iso_3166_1:"NE"},{start:409600,end:413695,country:"Nigeria",iso_3166_1:"NG"},{start:4685824,end:4718591,country:"Norway",iso_3166_1:"NO"},{start:7389184,end:7390207,country:"Oman",iso_3166_1:"OM"},{start:7733248,end:7766015,country:"Pakistan",iso_3166_1:"PK"},{start:6832128,end:6833151,country:"Palau",iso_3166_1:"PW"},{start:794624,end:798719,country:"Panama",iso_3166_1:"PA"},{start:9011200,end:9015295,country:"Papua New Guinea",iso_3166_1:"PG"},{start:15237120,end:15241215,country:"Paraguay",iso_3166_1:"PY"},{start:15253504,end:15257599,country:"Peru",iso_3166_1:"PE"},{start:7700480,end:7733247,country:"Philippines",iso_3166_1:"PH"},{start:4751360,end:4784127,country:"Poland",iso_3166_1:"PL"},{start:4784128,end:4816895,country:"Portugal",iso_3166_1:"PT"},{start:434176,end:435199,country:"Qatar",iso_3166_1:"QA"},{start:7438336,end:7471103,country:"Republic of Korea",iso_3166_1:"KR"},{start:5262336,end:5263359,country:"Republic of Moldova",iso_3166_1:"MD"},{start:4849664,end:4882431,country:"Romania",iso_3166_1:"RO"},{start:1048576,end:2097151,country:"Russian Federation",iso_3166_1:"RU"},{start:450560,end:454655,country:"Rwanda",iso_3166_1:"RW"},{start:13156352,end:13157375,country:"Saint Lucia",iso_3166_1:"LC"},{start:770048,end:771071,country:"Saint Vincent and the Grenadines",iso_3166_1:"VC"},{start:9445376,end:9446399,country:"Samoa",iso_3166_1:"WS"},{start:5242880,end:5243903,country:"San Marino",iso_3166_1:"SM"},{start:647168,end:648191,country:"Sao Tome and Principe",iso_3166_1:"ST"},{start:7405568,end:7438335,country:"Saudi Arabia",iso_3166_1:"SA"},{start:458752,end:462847,country:"Senegal",iso_3166_1:"SN"},{start:4980736,end:5013503,country:"Serbia",iso_3166_1:"RS"},{start:475136,end:476159,country:"Seychelles",iso_3166_1:"SC"},{start:483328,end:484351,country:"Sierra Leone",iso_3166_1:"SL"},{start:7766016,end:7798783,country:"Singapore",iso_3166_1:"SG"},{start:5266432,end:5267455,country:"Slovakia",iso_3166_1:"SK"},{start:5270528,end:5271551,country:"Slovenia",iso_3166_1:"SI"},{start:9007104,end:9008127,country:"Solomon Islands",iso_3166_1:"SB"},{start:491520,end:495615,country:"Somalia",iso_3166_1:"SO"},{start:32768,end:65535,country:"South Africa",iso_3166_1:"ZA"},{start:3407872,end:3670015,country:"Spain",iso_3166_1:"ES"},{start:7798784,end:7831551,country:"Sri Lanka",iso_3166_1:"LK"},{start:507904,end:511999,country:"Sudan",iso_3166_1:"SD"},{start:819200,end:823295,country:"Suriname",iso_3166_1:"SR"},{start:499712,end:500735,country:"Swaziland",iso_3166_1:"SZ"},{start:4882432,end:4915199,country:"Sweden",iso_3166_1:"SE"},{start:4915200,end:4947967,country:"Switzerland",iso_3166_1:"CH"},{start:7831552,end:7864319,country:"Syrian Arab Republic",iso_3166_1:"SY"},{start:5328896,end:5329919,country:"Tajikistan",iso_3166_1:"TJ"},{start:8912896,end:8945663,country:"Thailand",iso_3166_1:"TH"},{start:5316608,end:5317631,country:"North Macedonia",iso_3166_1:"MK"},{start:557056,end:561151,country:"Togo",iso_3166_1:"TG"},{start:13160448,end:13161471,country:"Tonga",iso_3166_1:"TO"},{start:811008,end:815103,country:"Trinidad and Tobago",iso_3166_1:"TT"},{start:163840,end:196607,country:"Tunisia",iso_3166_1:"TN"},{start:4947968,end:4980735,country:"Turkey",iso_3166_1:"TR"},{start:6297600,end:6298623,country:"Turkmenistan",iso_3166_1:"TM"},{start:425984,end:430079,country:"Uganda",iso_3166_1:"UG"},{start:5275648,end:5308415,country:"Ukraine",iso_3166_1:"UA"},{start:9003008,end:9007103,country:"United Arab Emirates",iso_3166_1:"AE"},{start:4194304,end:4456447,country:"United Kingdom",iso_3166_1:"GB"},{start:524288,end:528383,country:"United Republic of Tanzania",iso_3166_1:"TZ"},{start:10485760,end:11534335,country:"United States",iso_3166_1:"US"},{start:15269888,end:15273983,country:"Uruguay",iso_3166_1:"UY"},{start:5274624,end:5275647,country:"Uzbekistan",iso_3166_1:"UZ"},{start:13172736,end:13173759,country:"Vanuatu",iso_3166_1:"VU"},{start:884736,end:917503,country:"Venezuela",iso_3166_1:"VE"},{start:8945664,end:8978431,country:"Viet Nam",iso_3166_1:"VN"},{start:8978432,end:8982527,country:"Yemen",iso_3166_1:"YE"},{start:565248,end:569343,country:"Zambia",iso_3166_1:"ZM"},{start:16384,end:17407,country:"Zimbabwe",iso_3166_1:"ZW"},{start:15728640,end:15761407,country:"ICAO (temporary assignments)",iso_3166_1:null},{start:9015296,end:9016319,country:"ICAO (special use)",iso_3166_1:null},{start:15765504,end:15766527,country:"ICAO (special use)",iso_3166_1:null},{start:2097152,end:2621439,country:"Unassigned (AFI region)",iso_3166_1:null},{start:2621440,end:2686975,country:"Unassigned (SAM region)",iso_3166_1:null},{start:5242880,end:6291455,country:"Unassigned (EUR / NAT regions)",iso_3166_1:null},{start:6291456,end:6815743,country:"Unassigned (MID region)",iso_3166_1:null},{start:6815744,end:7340031,country:"Unassigned (ASIA region)",iso_3166_1:null},{start:9437184,end:10485759,country:"Unassigned (NAM / PAC regions)",iso_3166_1:null},{start:11534336,end:12582911,country:"Unassigned (reserved for future use)",iso_3166_1:null},{start:15466496,end:15728639,country:"Unassigned (CAR region)",iso_3166_1:null},{start:13631488,end:14680063,country:"Unassigned (reserved for future use)",iso_3166_1:null},{start:15728640,end:16777215,country:"Unassigned (reserved for future use)",iso_3166_1:null}]};find=function(t){let e=+("0x"+t);for(let t=0;t=this.ranges[t].start&&e<=this.ranges[t].end)return this.ranges[t];return null}}class st{constructor(){this.limitedAlphabet="ABCDEFGHJKLMNPQRSTUVWXYZ",this.fullAlphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ",this.strideMappings=[{start:32785,s1:676,s2:26,prefix:"ZS-"},{start:3735552,s1:1024,s2:32,prefix:"F-G"},{start:3768320,s1:1024,s2:32,prefix:"F-H"},{start:3949601,s1:1024,s2:32,prefix:"D-A",first:"AAA",last:"OZZ"},{start:3932161,s1:676,s2:26,prefix:"D-A",first:"PAA",last:"ZZZ"},{start:3965985,s1:1024,s2:32,prefix:"D-B",first:"AAA",last:"OZZ"},{start:3940353,s1:676,s2:26,prefix:"D-B",first:"PAA",last:"ZZZ"},{start:3981312,s1:676,s2:26,prefix:"D-C"},{start:3998888,s1:676,s2:26,prefix:"D-E"},{start:4016464,s1:676,s2:26,prefix:"D-F"},{start:4034040,s1:676,s2:26,prefix:"D-G"},{start:4051616,s1:676,s2:26,prefix:"D-H"},{start:4069192,s1:676,s2:26,prefix:"D-I"},{start:4490273,s1:1024,s2:32,prefix:"OO-"},{start:4555809,s1:1024,s2:32,prefix:"OY-"},{start:4587520,s1:676,s2:26,prefix:"OH-"},{start:4621345,s1:1024,s2:32,prefix:"SX-"},{start:4785185,s1:1024,s2:32,prefix:"CS-"},{start:4850721,s1:1024,s2:32,prefix:"YR-"},{start:4949025,s1:1024,s2:32,prefix:"TC-"},{start:7603233,s1:1024,s2:32,prefix:"JY-"},{start:7734305,s1:1024,s2:32,prefix:"AP-"},{start:7767073,s1:1024,s2:32,prefix:"9V-"},{start:7832609,s1:1024,s2:32,prefix:"YK-"},{start:8126464,s1:1296,s2:36,prefix:"VH-"},{start:12582913,s1:676,s2:26,prefix:"C-F"},{start:12600489,s1:676,s2:26,prefix:"C-G"},{start:14684225,s1:4096,s2:64,prefix:"LV-"}],this.numericMappings=[{start:1310720,first:0,count:1e5,template:"RA-00000"},{start:721896,first:1e3,count:1e3,template:"CU-T0000"}];for(let t=0;ts.end)continue;let n=t-s.start+s.offset,i=Math.floor(n/s.s1);n%=s.s1;let r=Math.floor(n/s.s2);n%=s.s2;let o=n;if(!(i<0||i>=s.alphabet.length||r<0||r>=s.alphabet.length||o<0||o>=s.alphabet.length))return s.prefix+s.alphabet.charAt(i)+s.alphabet.charAt(r)+s.alphabet.charAt(o)}return null};numericReg=function(t){let e;for(e=0;es.end)continue;let n=t-s.start+s.first+"";return s.template.substring(0,s.template.length-n.length)+n}};nLetters=function(t){return 0==t?"":(--t,this.limitedAlphabet.charAt(Math.floor(t/25))+this.nLetter(t%25))};nLetter=function(t){return 0==t?"":(--t,this.limitedAlphabet.charAt(t))};nReg=function(t){let e=t-10485761;if(e<0||e>=915399)return null;let s="N"+(Math.floor(e/101711)+1);return e%=101711,e<=600?s+this.nLetters(e):(e-=601,s+=Math.floor(e/10111),e%=10111,e<=600?s+this.nLetters(e):(e-=601,s+=Math.floor(e/951),e%=951,e<=600?s+this.nLetters(e):(e-=601,s+=Math.floor(e/35).toFixed(0),e%=35,e<=24?s+this.nLetter(e):(e-=25,s+e.toFixed(0)))))};hlReg=function(t){return t>=7453184&&t<=7454617?"HL"+(t-7453184+29184).toString(16):t>=7454720&&t<=7454873?"HL"+(t-7454720+32768).toString(16):t>=7455232&&t<=7455385?"HL"+(t-7455232+33280).toString(16):null};jaReg=function(t){let e=t-8650752;if(e<0||e>=229840)return null;let s="JA",n=Math.floor(e/22984);if(n<0||n>9)return null;s+=n,e%=22984;let i=Math.floor(e/916);if(i<0||i>9)return null;if(s+=i,e%=916,e<340){return s+=Math.floor(e/34),e%=34,e<10?s+e:(e-=10,s+this.limitedAlphabet.charAt(e))}e-=340;let r=Math.floor(e/24);return s+this.limitedAlphabet.charAt(r)+this.limitedAlphabet.charAt(e%24)}}class nt{constructor(){this.country=new et,this.registration=new st}}var it,rt;function ot(){return(ot=Object.assign||function(t){for(var e=1;e-1?t.split(".")[1].length:0;s.minimumFractionDigits=n,s.maximumFractionDigits=n}return s},ct=["closed","locked","off"],ht=function(t,e,s,n){n=n||{},s=null==s?{}:s;var i=new Event(e,{bubbles:void 0===n.bubbles||n.bubbles,cancelable:Boolean(n.cancelable),composed:void 0===n.composed||n.composed});return i.detail=s,t.dispatchEvent(i),i},dt=function(t){ht(window,"haptic",t)},ut=function(t,e,s,n,i){var r;if(i&&s.double_tap_action?r=s.double_tap_action:n&&s.hold_action?r=s.hold_action:!n&&s.tap_action&&(r=s.tap_action),r||(r={action:"more-info"}),!r.confirmation||r.confirmation.exemptions&&r.confirmation.exemptions.some((function(t){return t.user===e.user.id}))||confirm(r.confirmation.text||"Are you sure you want to "+r.action+"?"))switch(r.action){case"more-info":(r.entity||s.entity||s.camera_image)&&(ht(t,"hass-more-info",{entityId:r.entity?r.entity:s.entity?s.entity:s.camera_image}),r.haptic&&dt(r.haptic));break;case"navigate":r.navigation_path&&(function(t,e,s){void 0===s&&(s=!1),s?history.replaceState(null,"",e):history.pushState(null,"",e),ht(window,"location-changed",{replace:s})}(0,r.navigation_path),r.haptic&&dt(r.haptic));break;case"url":r.url_path&&window.open(r.url_path),r.haptic&&dt(r.haptic);break;case"toggle":s.entity&&(function(t,e){(function(t,e,s){void 0===s&&(s=!0);var n,i=function(t){return t.substr(0,t.indexOf("."))}(e),r="group"===i?"homeassistant":i;switch(i){case"lock":n=s?"unlock":"lock";break;case"cover":n=s?"open_cover":"close_cover";break;default:n=s?"turn_on":"turn_off"}t.callService(r,n,{entity_id:e})})(t,e,ct.includes(t.states[e].state))}(e,s.entity),r.haptic&&dt(r.haptic));break;case"call-service":if(!r.service)return;var o=r.service.split(".",2),a=o[0],l=o[1],c=ot({},r.service_data);"entity"===c.entity_id&&(c.entity_id=s.entity),e.callService(a,l,c,r.target),r.haptic&&dt(r.haptic);break;case"fire-dom-event":ht(t,"ll-custom",r),r.haptic&&dt(r.haptic)}};class _t{constructor(t,e,s,n){this.config=e,this.lang=n;const i=new tt;this._path=i.getPath(),this.hex=t.hex.toUpperCase(),this.icon="mdi:airplane",this.flight=t.flight??null,this.squawk=t.squawk??null,this.altitude=t.altitude??t.alt_baro??null,this.speed=t.speed??t.gs??null,this.track=t.track??null,this.vert_rate=t.vert_rate??t.baro_rate??null,this.lat=t.lat??null,this.lon=t.lon??null,this.seen=t.seen??100,this.aircraft_type=t.t??null;const r=new nt,o=r.country.find(this.hex);this.flag=null!==o&&null!==o.iso_3166_1?`${this._path}images/flags/${o.iso_3166_1.toLowerCase()}.svg`:null,this.country=null!==o?o.country:null;if(void 0!==t.r&&""!==t.r)this.registration=t.r;else{const t=r.registration.lookup(this.hex);this.registration=t}this.distance=s.isSetUp()?s.calculate(this.lat,this.lon):null,this.setIcon(),this.setUnits()}setIcon=function(){this.vert_rate<0?this.icon="mdi:airplane-landing":this.vert_rate>0&&(this.icon="mdi:airplane-takeoff")};setUnits=function(){if("metric"===this.config.units)!0===this.config.larger_units?this.units={altitude:"km",distance:"km",speed:"km/h"}:this.units={altitude:"m",distance:"m",speed:"m/s"},this.units.age="s",!0!==this.config.track_in_text&&(this.units.track="°");else this.units={altitude:"ft",distance:"NM",speed:"kt",track:"°",age:"s"},!0!==this.config.track_in_text&&(this.units.track="°")};value=function(t,e){let s=this,n=this.units[t]??null;switch(t){case"icon":return``;case"flag":return null!==s.flag?`${s.country}`:"";case"icao":return s.hex;case"age":let i=s.seen??"";return""!==i&&e&&(i+=" "+n),i;case"speed":let r=s.speed??"";if(""!==r){if("metric"===this.config.units)r=this.config.larger_units?at(Math.round(1.852*r)):at(Math.round(.514444444*r));r=at(r),e&&(r+=" "+n)}return r;case"altitude":let o=s.altitude??"";if(""!==o){if("metric"===this.config.units)o=this.config.larger_units?Math.round(.3048*o/1e3*10)/10:Math.round(.3048*o);o=at(o),e&&(o+=" "+n)}return o;case"track":let a=s.track??"";return""!==a&&(!0===this.config.track_in_text?a=this.trackAsText(a,e):e&&(a+=""+n)),a;case"registration":return null===s.registration?this.lang.content.table.data.not_available:s.registration;default:let l=s[t]??"";return""!==l&&"number"==typeof l&&(l=at(l)),e&&""!==l&&null!==n&&(l+=" "+n),l}};altitudeAsColor=function(t){let e="EC5B13",s="EC5B13",n=.5;if(t>1e3&&t<=2e3?(s="EC7C13",n=.001*(t-1e3)):t>2e3&&t<=4e3?(e="EC7C13",s="ECC813",n=5e-4*(t-2e3)):t>4e3&&t<=6e3?(e="ECC813",s="BEDF13",n=5e-4*(t-4e3)):t>6e3&&t<=8e3?(e="BEDF13",s="40EC44",n=5e-4*(t-6e3)):t>8e3&&t<=1e4?(e="40EC44",s="11E276",n=5e-4*(t-8e3)):t>1e4&&t<=2e4?(e="11E276",s="13BBDE",n=1e-4*(t-1e4)):t>2e4&&t<=3e4?(e="13BBDE",s="241FEC",n=1e-4*(t-2e4)):t>3e4&&t<=4e4?(e="241FEC",s="EB13EC",n=1e-4*(t-3e4)):t>4e4&&(e="EB13EC",s="EB13EC"),e===s)return e;e=e.match(/.{1,2}/g).map((t=>parseInt(t,16)*(1-n))),s=s.match(/.{1,2}/g).map((t=>parseInt(t,16)*n));let i=[0,1,2].map((t=>Math.min(Math.round(e[t]+s[t]),255))),r=i.reduce(((t,e)=>(t<<8)+e),0).toString(16).padStart(6,"0");return"#"+r};trackAsText=function(t,e){let s="n";return t>=11.25&&t<=33.75?s="nne":t>=33.75&&t<=56.25?s="ne":t>=56.25&&t<=78.75?s="ene":t>=78.75&&t<=101.25?s="e":t>=101.25&&t<=123.75?s="ese":t>=123.75&&t<=146.25?s="se":t>=146.25&&t<=168.75?s="sse":t>=168.75&&t<=191.25?s="s":t>=191.25&&t<=213.75?s="ssw":t>=213.75&&t<=236.25?s="sw":t>=236.25&&t<=258.75?s="wsw":t>=258.75&&t<=281.25?s="w":t>=281.25&&t<=303.75?s="wnw":t>=303.75&&t<=326.25?s="nw":t>=326.25&&t<=348.75&&(s="nnw"),e?this.lang.content.track.long[s]:this.lang.content.track.short[s]}}var pt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},gt={},ft=pt&&pt.__spreadArrays||function(){for(var t=0,e=0,s=arguments.length;e{if(!this.merged.availableColumns.hasOwnProperty(e))throw new Error("Column '"+e+"' does not exist");t+=this.merged.availableColumns[e].weight})),t>15&&(this.error="Too many columns defined")}else this.error="Order '"+this.merged.order+"' is not supported";else this.error="Unit '"+this.merged.units+"' is not supported";else this.error="You need to define and entity";return""===this.error}}class wt{constructor(t,e){this.config=t,this.zone=t.zone,this.units=t.units,this.hass=e,null!==this.zone&&this.getCoordinatesOfZone()}isSetUp=function(){return this.hasOwnProperty("lat")&&this.hasOwnProperty("lon")};getCoordinatesOfZone=function(){let t=this.hass.states[this.zone];void 0!==t&&(this.lat=t.attributes.latitude,this.lon=t.attributes.longitude,this.config.distance=!0)};calculate=function(t,e){if(null===t||null===e)return"";if(t===this.lat&&e===this.lon)return 0;let s=this.lat*(Math.PI/180),n=t*(Math.PI/180),i=n-s,r=(e-this.lon)*(Math.PI/180),o=12742142*Math.asin(Math.sqrt(Math.sin(i/2)*Math.sin(i/2)+Math.cos(s)*Math.cos(n)*Math.sin(r/2)*Math.sin(r/2)));switch(o=Math.round(o),this.units){case"metric":this.config.larger_units&&(o=Math.round(o/1e3*10)/10);break;case"default":o=Math.round(.000539956803*o*10)/10}return o}}var $t={table:{head:{icao:"ICAO Code",country:"Land",registration:"Registration",flight:"Flug",squawk:"Squawk",altitude:"Höhe",speed:"Geschwindigkeit",distance:"Entfernung",track:"Richtung",age:"Letzte Nachricht",aircraft_type:"Typ"},data:{not_available:"N/V",none:"Keine Flugzeuge erkannt!",undefined:"Die konfigurierte Entität enthält keine Daten!"}},popup:{table:{head:{property:"Eigenschaft",value:"Wert"}}},track:{short:{n:"N",nne:"NNO",ne:"NO",ene:"ONO",e:"O",ese:"OSO",se:"SO",sse:"SSO",s:"S",ssw:"SSW",sw:"SW",wsw:"WSW",w:"W",wnw:"WNW",nw:"NW",nnw:"NNW"},long:{n:"Nord",nne:"Nord-Nord-Ost",ne:"Nord-Ost",ene:"Ost-Nord-Ost",e:"Ost",ese:"Ost-Süd-Ost",se:"Süd-Ost",sse:"Süd-Süd-Ost",s:"Süd",ssw:"Süd-Süd-West",sw:"Süd-West",wsw:"West-Süd-West",w:"West",wnw:"West-Nord-West",nw:"Nord-West",nnw:"Nord-Nord-West"}}},At={table:{head:{icao:"ICAO Code",country:"Country",registration:"Registration",flight:"Flight",squawk:"Squawk",altitude:"Altitude",speed:"Speed",distance:"Distance",track:"Track",age:"Last message",aircraft_type:"Type"},data:{not_available:"N/A",none:"No aircrafts detected!",undefined:"The configurated entity doesn't contain data!"}},popup:{table:{head:{property:"Property",value:"Value"}}},track:{short:{n:"N",nne:"NNE",ne:"NE",ene:"ENE",e:"E",ese:"ESE",se:"SE",sse:"SSE",s:"S",ssw:"SSW",sw:"SW",wsw:"WSW",w:"W",wnw:"WNW",nw:"NW",nnw:"NNW"},long:{n:"North",nne:"North-northeast",ne:"Northeast",ene:"East-northeast",e:"East",ese:"East-southeast",se:"Southeast",sse:"South-southeast",s:"South",ssw:"South-southwest",sw:"Southwest",wsw:"West-southwest",w:"West",wnw:"West-northwest",nw:"Northwest",nnw:"North-northwest"}}},St={table:{head:{icao:"ICAO-tunnus",country:"Maa",registration:"Rekisteröinti",flight:"Lento",squawk:"Tunniste",altitude:"Korkeus",speed:"Nopeus",distance:"Etäisyys",track:"Lentorata",age:"Viimeisin viesti",aircraft_type:"Tyyppi"},data:{not_available:"Ei saatavilla",none:"Ei havaittuja lentoaluksia!",undefined:"Määritys ei sisällä dataa!"}},popup:{table:{head:{property:"Kenttä",value:"Arvo"}}},track:{short:{n:"N",nne:"NNE",ne:"NE",ene:"ENE",e:"E",ese:"ESE",se:"SE",sse:"SSE",s:"S",ssw:"SSW",sw:"SW",wsw:"WSW",w:"W",wnw:"WNW",nw:"NW",nnw:"NNW"},long:{n:"Pohjoinen",nne:"Pohjoiskoillinen",ne:"Koillinen",ene:"Itäkoillinen",e:"Itä",ese:"Itäkaakko",se:"Kaakko",sse:"Eteläkaakko",s:"Etelä",ssw:"Etelälounas",sw:"Lounas",wsw:"Länsilounas",w:"Länsi",wnw:"Länsiluode",nw:"Luode",nnw:"Pohjoisluode"}}},Et={table:{head:{icao:"ICAO code",country:"Land",registration:"Registratie",flight:"Vlucht",squawk:"Squawk",altitude:"Hoogte",speed:"Snelheid",distance:"Afstand",track:"Richting",age:"Laatste bericht",aircraft_type:"Type"},data:{not_available:"Nb",none:"Geen vliegtuigen gedetecteerd!",undefined:"De ingestelde entiteit bevat geen data!"}},popup:{table:{head:{property:"Eigenschap",value:"Waarde"}}},track:{short:{n:"N",nne:"NNO",ne:"NO",ene:"ONO",e:"O",ese:"OZO",se:"ZO",sse:"ZZO",s:"Z",ssw:"ZZW",sw:"ZW",wsw:"WZW",w:"W",wnw:"WNW",nw:"NW",nnw:"NNW"},long:{n:"Noord",nne:"Noordnoordoost",ne:"Noordoost",ene:"Oostnoordoost",e:"Oost",ese:"Oostzuidoost",se:"Zuidoost",sse:"Zuidzuidoost",s:"Zuid",ssw:"Zuidzuidwest",sw:"Zuidwest",wsw:"Westzuidwest",w:"West",wnw:"Westnoordwest",nw:"Noordwest",nnw:"Noordnoordwest"}}},xt={table:{head:{icao:"Kod ICAO",country:"Kraj",registration:"Rejestracja",flight:"Lot",squawk:"Squawk",altitude:"Wysokość",speed:"Prędkość",distance:"Dystans",track:"Kierunek",age:"Ostatnia wiadomość",aircraft_type:"Typ"},data:{not_available:"N/D",none:"Brak wykrytych statków powietrznych!",undefined:"Skonfigurowany obiekt nie zawiera danych!"}},popup:{table:{head:{property:"Właściwość",value:"Wartość"}}},track:{short:{n:"N",nne:"NNE",ne:"NE",ene:"ENE",e:"E",ese:"ESE",se:"SE",sse:"SSE",s:"S",ssw:"SSW",sw:"SW",wsw:"WSW",w:"W",wnw:"WNW",nw:"NW",nnw:"NNW"},long:{n:"Północ",nne:"Północ-północny wschód",ne:"Północny wschód",ene:"Wschód-północny wschód",e:"Wschód",ese:"Wschód-południowy wschód",se:"Południowy wschód",sse:"Południowy-południowy wschód",s:"Południe",ssw:"Południowy-południowy zachód",sw:"Południowy zachód",wsw:"Zachód-południowy zachód",w:"Zachód",wnw:"Zachód-północny zachód",nw:"Północny zachód",nnw:"Północ-północny zachód"}}},kt={table:{head:{icao:"ICAO naslov",country:"Država",registration:"Registracija",flight:"Št. leta",squawk:"Squawk",altitude:"Višina",speed:"Hitrost",distance:"Razdalja",track:"Smer",age:"Zaznano pred",aircraft_type:"Vrsta"},data:{not_available:"N/A",none:"Ni zaznanih letal!",undefined:"Konfigurirana entiteta ne vsebuje podatkov!"}},popup:{table:{head:{property:"Karakteristika",value:"Vrednost"}}},track:{short:{n:"S",nne:"SSV",ne:"SV",ene:"VSV",e:"V",ese:"VJV",se:"JV",sse:"JJV",s:"J",ssw:"JJZ",sw:"JZ",wsw:"ZJZ",w:"Z",wnw:"ZSZ",nw:"SZ",nnw:"SSZ"},long:{n:"sever",nne:"sever-severovzhod",ne:"severovzhod",ene:"vzhod-severovzhod",e:"vzhod",ese:"vzhod-jugovzhod",se:"jugovzhod",sse:"jug-jugovzhod",s:"jug",ssw:"jug-jugozahod",sw:"jugozahod",wsw:"zahod-jugozahod",w:"zahod",wnw:"zahod-severozahod",nw:"severozahod",nnw:"sever-severozahod"}}};class Ct{constructor(t,e){this.config=t,this.hass=e,this.content=At,this.setLang()}setLang=function(){if(null===this.config.lang&&(this.config.lang=this.hass.language),"en"!==this.config.lang)switch(this.config.lang){case"de":this.content=$t;break;case"fi":this.content=St;break;case"nl":this.content=Et;break;case"pl":this.content=xt;break;case"sl":this.content=kt}}}function*Nt(t,e){if(void 0!==t){let s=0;for(const n of t)yield e(n,s++)}}const Mt=2;class Ot{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}class Pt extends Ot{constructor(t){if(super(t),this.it=W,t.type!==Mt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===W||null==t)return this._t=void 0,this.it=t;if(t===U)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}Pt.directiveName="unsafeHTML",Pt.resultType=1;const Rt=(t=>(...e)=>({_$litDirective$:t,values:e}))(Pt);class Tt{urlAdbsExchange="https://globe.adsbexchange.com/?icao=%hex%";urlFlightAware="https://flightaware.com/live/modes/%hex%/redirect";urlFlightRadar24="https://www.flightradar24.com/%flight%";urlOpenskyNetwork="https://opensky-network.org/aircraft-profile?icao24=%hex%";urlPlaneFinder="https://planefinder.net/flight/%flight%";constructor(t,e){this.config=t,this.hass=e}getUrl=function(t,e){void 0===e&&(e=this.config.default_provider);let s=null;switch(e){case"adsbexchange":s=this.urlAdbsExchange;break;case"flightaware":s=this.urlFlightAware;break;case"flightradar24":s=this.urlFlightRadar24;break;case"opensky_network":s=this.urlOpenskyNetwork;break;case"plane_finder":s=this.urlPlaneFinder}return null!==s&&(s=s.replace("%hex%",t.hex).replace("%flight%",t.flight)),s};getImage=function(t){const e=new tt;return this.path=e.getPath(),`${this.path}images/providers/${this.config.inverted_logo?"dark":"light"}/${t}.png`}}class Ut{constructor(t,e,s,n,i){this.hass=t,this.config=e,this.lang=s,this.row=n,this.aircraft=i,this.show()}show=function(){const t=this;fetch("https://api.planespotters.net/pub/photos/hex/"+this.aircraft.hex,{cache:"no-store",headers:{"Content-Type":"text/json"}}).then((t=>t.text())).then((function(e){let s,n=JSON.parse(e),i="",r=t.aircraft.registration||t.aircraft.flight||t.aircraft.hex;if(s=t.aircraft.registration&&t.aircraft.flight||t.aircraft.hex,n.photos.length>0){let t=n.photos[0].thumbnail_large.src,e=n.photos[0].link,s=n.photos[0].photographer;i+=`![${r} - © ${s}](${t} "${r} - © ${s}")`,i+=`© [${s}](${e})\n\n`}i+="## ",t.aircraft.flag&&(i+=``),i+=`${r} - ${s}${t.aircraft.value("icon",!0)}\n`,i+=`|${t.lang.popup.table.head.property}|${t.lang.popup.table.head.value}|\n|:-|-:|\n`,Object.keys(vt).forEach((e=>{let s=vt[e],n=t.aircraft.value(e,!0);s.popup&&""!==n&&(i+=`|${t.lang.table.head[e]}|${n}|\n`)})),i+="\n";let o=new Tt(t.config,t.hass);for(const e in t.config.providers)t.config.providers[e]&&(i+=`* [![${e}](${o.getImage(e)} "${e}")](${o.getUrl(t.aircraft,e)})\n`);const a=t.config.colors.popup_bg??"var(--card-background-color)",l=t.config.colors.popup_text??t.config.colors.table_text??"var(--primary-color)",c=t.config.colors.popup_text??t.config.colors.table_text??"var(--primary-color)",h=t.config.colors.popup_table_head_bg??t.config.colors.table_head_bg??"var(--primary-color)",d=t.config.colors.popup_table_head_text??t.config.colors.table_head_text??"var(--app-header-text-color, white)",u=t.config.colors.popup_text??t.config.colors.table_text??"var(--primary-text-color)",_=t.config.colors.popup_table_even_row_bg??t.config.colors.table_even_row_bg??"var(--primary-background-color)",p=t.config.colors.popup_table_even_row_text??t.config.colors.table_even_row_text??"var(--primary-text-color)";let g={hide_header:!1===t.config.popup.header,style:`--mdc-theme-surface:${a};`,content:{type:"markdown",content:i,card_mod:{style:{".":`ha-card.type-markdown{border:none;}ha-markdown{background:${a};}ha-markdown a{color:${c}};ha-markdown.no-header{padding-top:0 !important;}`,"ha-markdown$":`img{width:100%}img + span{color:${l};font-size:10px;}img + span a{color:${l}}h2{display:flex;justify-content:space-between;color:${l};}h2 img{width:auto;height:.8em;margin:0 10px 0 0;display:inline-block;vertical-align:baseline;}table{width:100%;border-spacing:0;border-collapse:collapse;}table tr th, table tr td{padding:4px;}table tr th{background-color:${h};color:${d};}table tr{color:${u};}table tr:nth-child(even){background-color:${_};color:${p};}ul{list-style-type:none;padding:0;display:flex;justify-content:space-between;}ul li{display:inline-block;}ul li img{height:24px;width:auto;}`}}}};!0===t.config.popup.header&&(g.title=r),ut(t.row,t.hass,{tap_action:{action:"fire-dom-event",browser_mod:{service:"browser_mod.popup",data:g}}})}))}}customElements.define("fr24-table",class extends Q{static get properties(){return{hass:{type:Object},config:{type:Object},aircrafts:{type:Array},lang:{type:Object}}}constructor(){super(),this.clickService={timer:void 0,target:void 0}}render(){let t=[];this.config.columns.forEach((e=>{let s=vt[e];if(!1===s.show)return;let n=this.lang.table.head[e]??"";t.push({value:n,styles:s.styles??[]})}));let e=[];if(!0===this.config.units_in_table){let t=this.aircrafts[0];this.config.columns.forEach((s=>{let n=vt[s];if(!1===n.show)return;let i=t.units[s]??"";e.push({value:i,styles:n.styles??[]})}))}let s=[],n=0;for(let t of this.aircrafts){let e=[];this.config.columns.forEach((s=>{let n=vt[s];!1!==n.show&&e.push({value:t.value(s),html:n.html??!1,styles:n.styles??[]})}));let i={};if(this.config.popup.enabled&&(i.hex=t.hex),s.push({cells:e,attrs:i}),n++,Number.isInteger(this.config.limit)&&this.config.limit===n)break}return T`${Nt(t,(t=>T``))}${e.length>0?T`${Nt(e,(t=>T``))}`:""}${Nt(s,(t=>T`${Nt(t.cells,(t=>T``))}`))}
${t.value}
${t.value}
${t.html?T`${Rt(t.value)}`:T`${t.value}`}
`}_handleClick(t){if(this.clickService.target=t.target.closest("tr"),!1===this.config.default_provider&&!0===this.config.popup.enabled)return this._handleSingleClick();this.clickService.timer?(clearTimeout(this.clickService.timer),this.clickService.timer=void 0,this.config.default_provider&&this._handleDoubleClick()):this.clickService.timer=setTimeout((()=>{this.clickService.timer=void 0,this.config.popup.enabled&&this._handleSingleClick()}),this.config.dbl_click_speed)}_handleSingleClick(t){let e=this.clickService.target;if(e){let t=e.getAttribute("data-hex"),s=this.aircrafts.find((e=>e.hex===t));null!==s&&new Ut(this.hass,this.config,this.lang,e,s)}}_handleDoubleClick(t){let e=this.clickService.target;if(e){let t=e.getAttribute("data-hex"),s=this.aircrafts.find((e=>e.hex===t)),n=new Tt(this.config,this.hass);ut(e,this.hass,{tap_action:{action:"url",url_path:n.getUrl(s)}})}}static get styles(){return r`table{width:100%;border-spacing:0;border-collapse:collapse}table tr td,table tr th{padding:4px;text-align:left}table tr td.align-right,table tr th.align-right{text-align:right}table tr td.width-s,table tr th.width-s{width:20px}table tr th{background-color:var(--fr24-table-head-bg);color:var(--fr24-table-head-text)}table tr td img{width:20px}table thead tr td{background-color:var(--fr24-table-units-bg);color:var(--fr24-table-units-text)}table tbody tr td{color:var(--fr24-table-text)}table tbody tr:nth-child(even){background-color:var(--fr24-table-even-row-bg)}table tbody tr:nth-child(even) td{color:var(--fr24-table-even-row-text)}table tbody tr[data-hex]:not([data-hex=""]){cursor:pointer}`}});customElements.define("fr24-warning",class extends Q{static get properties(){return{config:{type:Object},message:{type:String}}}constructor(){super()}render(){return T`
${this.message}
`}static get styles(){return r`div{padding:4px;background-color:var(--fr24-warning-bg);color:var(--fr24-warning-text);text-align:center}`}}),window.customCards=window.customCards||[],window.customCards.push({type:"fr24-card",name:"Flight Radar card",description:"Card that shows the tracked flights",preview:!1}),window.fr24db=[];customElements.define("fr24-card",class extends Q{static get properties(){return{hass:{},config:{}}}render(){if(this._isStateUndefined=!1,this._distance=new wt(this.config,this.hass),this._lang=new Ct(this.config,this.hass),this.config.entity){this._parseAircrafts();let t=null;return this._isStateUndefined?t=this._lang.content.table.data.undefined:this._aircrafts.length<1&&(t=this._lang.content.table.data.none),null!==t?T`
`:T`
`}return T`Entity not set`}setConfig(t){const e=new tt;if(this._path=e.getPath(),0===window.fr24db.length){const t=document.createElement("script");t.setAttribute("async",""),t.setAttribute("type","text/javascript"),t.setAttribute("src",this._path+"fr24_database.js"),document.head.appendChild(t)}let s=new mt(t);if(!s.validate())throw new Error(s.error);this.config=s.get()}getCardSize(){return Number.isInteger(this.config.limit)?this.config.limit+5:100}static getStubConfig(){return{entity:"sensor.fr24_aircraft"}}_parseAircrafts(){const t=this;if(this._aircrafts=[],void 0===this.hass.states[this.config.entity])return void(this._isStateUndefined=!0);const e=this.hass.states[this.config.entity].attributes[this.config.attribute];this.config.availableColumns.distance.show=!1,!0===this.config.distance&&(this.config.availableColumns.distance.show=!0),e.forEach((t=>{let e=new _t(t,this.config,this._distance,this._lang),s=!0;if(!1!==this.config.hide.old_messages&&e.seen>30&&(s=!1),!1!==this.config.hide.ground_vehicles&&"ground"===e.altitude&&(s=!1),this.config.hide.empty.length>0)for(let t=0;t1&&(this._aircrafts.sort((function(e,s){let n=t.config.sort||"altitude",i=e[n],r=s[n];return i===r?0:null===i||""===i?1:null===r||""===r||i
![Example of the popup][img_popup] | -| `providers` | `object` | | | Holds an object with all the external providers that should be added to the footer of the popup. To enable the provider add the key of the provider as key in this object and use `true` as value. See [Providers](#providers). | -| `sort` | `string` | `altitude` | Any column, see [columns](#columns) | The data in the table is by default sorted on the altitude, with this option you can set a different column, for example `flight`. | -| `title` | `string` | `null` | | Title of the card. | -| `track_in_text` | `boolean` | `false` | `true`, `false` | By default the reported track of the aircraft is displayd in degrees `°`. With this option set to `true` the track is displayed in text. When displayed in text, it's an abbreviation in the table and full text in the popup. | -| `units_in_table` | `boolean` | `false` | `true`, `false` | When this option is set to `true`, the table header will be appended with a second row containing the units.

![Units in the table header][img_units] | -| `units` | `string` | `default` | `default`, `metric` | Sets the units for the values. The `default` units are as they are returned by Dump1090 (`ft` for altitude, `NM` for distance, `kt` for speed). When using `metric` the value and units are converted (`m` for altitude and distance, `m/s` for speed). | -| `zone` | `string` | `null` | Any sensor that is a zone, example `zone.home` | The distance between Home Assistant and the reported position of the aircraft is calculated using the position of a zone. If you don't set a `zone` the data doesn't have the distance. | +| Option | Type | Default | Accepted | Description | +| :----------------- | :-------- | :----------------------------------------------------------------------------- | :------------------------------------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `attribute` | `string` | `aircraft` | An attribute of the sensor | By default the card will read the aircrafts from the sensors `aircraft` attribute. If your sensor uses a different attribute, change this value to the name of your attribute. | +| `colors` | `object` | | | Used to overwrite the default color scheme of the card. See [Colors](#colors). | +| `columns` | `array` | `["flag", "registration", "flight", "altitude", "speed", "distance", "track"]` | Array with any of the columns, see [Columns](#columns) | Array containing the columns to show in the table. The data of the other columns is available in the popup, if that is enabled. Too many columns will break your Dashboard, so the card will give a warning if too many columns are added. | +| `dbl_click_speed` | `integer` | `250` | | Time in which a double click needs to be completed, else the click will be treated as single click. The single click will open the popup, the double click will open a new browser page with the flight details on the default external provider, see `default_provider`. | +| `default_provider` | `string` | `flightradar24` | Any external provider (see [providers](#providers)), or `false`. | The external provider that is opened when a double click is registered. use `false` to disable the double click. | +| `hide` | `object` | | | Used to configure which data is hidden. See [Hide](#hide). | +| `inverted_logo` | `boolean` | `false` | `true`, `false` | The default logo's are suitable for light backgrounds, used in the default color scheme of Home Assistant. If you used the [colors](#colors) to create a dark mode of the card, you can set this variable to `true` to use logo's suitable for a dark background. The logo's are used in the popup, see `providers`. | +| `lang` | `string` | `null` | Any supported language, see the [lang folder](src/javascript/lang/) | Sets the display language of the data. By default the `hass` object of your browser will be used to set the language. If that language is not available, English will be used. The registered country is always in English. | +| `larger_units` | `boolean` | `false` | `true`, `false` | When using `metric` units, and this option set to `true`, the units are converted to `km` for altitude and distance and `km/h` for speed. | +| `limit` | `number` | `null` | A positive integer | Used to limit the number of results in the table. | +| `order` | `string` | `asc` | `asc`, `desc` | Sort order of the data. Ascending (`asc`, smallest value first) or descending (`desc`, largest value first). | +| `popup` | `object` | | | Enables or disables the popup. The popup requires both [browser_mod][browser_mod] and [card-mod][card_mod]. The popup can be opened by clicking on a row and contains more data of the aircraft, including a photo of the aircraft provided by [Planespotters.net][planespotters]. See [Popup](#popup). | +| `providers` | `object` | | | Holds an object with all the external providers that should be added to the footer of the popup. To enable the provider add the key of the provider as key in this object and use `true` as value. See [Providers](#providers). | +| `sort` | `string` | `altitude` | Any column, see [columns](#columns) | The data in the table is by default sorted on the altitude, with this option you can set a different column, for example `flight`. | +| `title` | `string` | `null` | | Title of the card. | +| `track_in_text` | `boolean` | `false` | `true`, `false` | By default the reported track of the aircraft is displayd in degrees `°`. With this option set to `true` the track is displayed in text. When displayed in text, it's an abbreviation in the table and full text in the popup. | +| `units_in_table` | `boolean` | `false` | `true`, `false` | When this option is set to `true`, the table header will be appended with a second row containing the units.

![Units in the table header][img_units] | +| `units` | `string` | `default` | `default`, `metric` | Sets the units for the values. The `default` units are as they are returned by Dump1090 (`ft` for altitude, `NM` for distance, `kt` for speed). When using `metric` the value and units are converted (`m` for altitude and distance, `m/s` for speed). | +| `zone` | `string` | `null` | Any sensor that is a zone, example `zone.home` | The distance between Home Assistant and the reported position of the aircraft is calculated using the position of a zone. If you don't set a `zone` the data doesn't have the distance. | ## Colors @@ -184,6 +185,34 @@ The icon of an aircraft is based on the value of two elements in the aircraft da ![Example of the icons][img_icons] +## Popup +> [!WARNING] +> Before version 1.0.0 of this card the config `popup` was a boolean. In version 1.0.0 `popup` is replaced by an object. +> Update your card config. + +The card supports a popup when you click on a row in the table. The popup displays all data of the aircraft, including a photo of the aircraft provided by [Planespotters.net][planespotters]. + +To enable the popup in the card use the following example: + +```yaml +type: custom:fr24-card +entity: sensor.fr24_aircraft +popup: + enabled: true +``` + +By default the popup hides the header of the markdown card that is opened. The header contains the title of the card and a button to close the card. The button is not needed to close the popup, you can do that by clicking outside of the popup. If you want to display the header of the card you can do that with the `header` key. See the following example: + +```yaml +type: custom:fr24-card +entity: sensor.fr24_aircraft +popup: + enabled: true + header: true +``` + +![Example of the popup][img_popup] + ## Providers The card links to external providers that might use your data. The external providers are visible on two places: diff --git a/src/javascript/config/config.js b/src/javascript/config/config.js index 32d4871..6c06426 100644 --- a/src/javascript/config/config.js +++ b/src/javascript/config/config.js @@ -31,7 +31,10 @@ export default class Config { larger_units: false, limit: null, order: "asc", - popup: false, + popup: { + enabled: false, + header: false, + }, providers: { adsbexchange: false, flightaware: false, @@ -104,6 +107,8 @@ export default class Config { // Check for entity, unit, order if (!this.merged.entity) { this.error = "You need to define and entity"; + } else if (typeof this.merged.popup !== "object") { + this.error = "Config of popup should be an object"; } else if (!["default", "metric"].includes(this.merged.units)) { this.error = "Unit '" + this.merged.units + "' is not supported"; } else if (!["asc", "desc"].includes(this.merged.order)) { diff --git a/src/javascript/helpers/popup.js b/src/javascript/helpers/popup.js index ee6c8a6..cc8b1d2 100644 --- a/src/javascript/helpers/popup.js +++ b/src/javascript/helpers/popup.js @@ -119,26 +119,33 @@ export default class Popup { popup.config.colors.table_even_row_text ?? "var(--primary-text-color)"; + // Data for the popup + let browserModData = { + hide_header: popup.config.popup.header === false, + style: `--mdc-theme-surface:${colorPopupBackground};`, + content: { + type: "markdown", + content: content, + card_mod: { + style: { + ".": `ha-card.type-markdown{border:none;}ha-markdown{background:${colorPopupBackground};}ha-markdown a{color:${colorPopupMarkDownLink}};ha-markdown.no-header{padding-top:0 !important;}`, + "ha-markdown$": `img{width:100%}img + span{color:${colorPopupMarkDownText};font-size:10px;}img + span a{color:${colorPopupMarkDownText}}h2{display:flex;justify-content:space-between;color:${colorPopupMarkDownText};}h2 img{width:auto;height:.8em;margin:0 10px 0 0;display:inline-block;vertical-align:baseline;}table{width:100%;border-spacing:0;border-collapse:collapse;}table tr th, table tr td{padding:4px;}table tr th{background-color:${colorPopupTableHeadBackground};color:${colorPopupTableHeadText};}table tr{color:${colorPopupTableRowText};}table tr:nth-child(even){background-color:${colorPopupTableRowEvenBackground};color:${colorPopupTableRowEvenText};}ul{list-style-type:none;padding:0;display:flex;justify-content:space-between;}ul li{display:inline-block;}ul li img{height:24px;width:auto;}`, + }, + }, + }, + }; + + if (popup.config.popup.header === true) { + browserModData.title = title; + } + // Open popup using browser_mod handleClick(popup.row, popup.hass, { tap_action: { action: "fire-dom-event", browser_mod: { service: "browser_mod.popup", - data: { - hide_header: true, - style: `--mdc-theme-surface:${colorPopupBackground};`, - content: { - type: "markdown", - content: content, - card_mod: { - style: { - ".": `ha-card.type-markdown{border:none;}ha-markdown{background:${colorPopupBackground};}ha-markdown a{color:${colorPopupMarkDownLink}};ha-markdown.no-header{padding-top:0 !important;}`, - "ha-markdown$": `img{width:100%}img + span{color:${colorPopupMarkDownText};font-size:10px;}img + span a{color:${colorPopupMarkDownText}}h2{display:flex;justify-content:space-between;color:${colorPopupMarkDownText};}h2 img{width:auto;height:.8em;margin:0 10px 0 0;display:inline-block;vertical-align:baseline;}table{width:100%;border-spacing:0;border-collapse:collapse;}table tr th, table tr td{padding:4px;}table tr th{background-color:${colorPopupTableHeadBackground};color:${colorPopupTableHeadText};}table tr{color:${colorPopupTableRowText};}table tr:nth-child(even){background-color:${colorPopupTableRowEvenBackground};color:${colorPopupTableRowEvenText};}ul{list-style-type:none;padding:0;display:flex;justify-content:space-between;}ul li{display:inline-block;}ul li img{height:24px;width:auto;}`, - }, - }, - }, - }, + data: browserModData, }, }, }); diff --git a/src/javascript/helpers/tags/table.js b/src/javascript/helpers/tags/table.js index fa39930..446a777 100644 --- a/src/javascript/helpers/tags/table.js +++ b/src/javascript/helpers/tags/table.js @@ -99,7 +99,7 @@ export class Table extends LitElement { // Attributes of the row let attrs = {}; - if (this.config.popup) { + if (this.config.popup.enabled) { attrs.hex = aircraft.hex; } @@ -214,7 +214,10 @@ export class Table extends LitElement { _handleClick(event) { this.clickService.target = event.target.closest("tr"); - if (this.config.default_provider === false && this.config.popup === true) { + if ( + this.config.default_provider === false && + this.config.popup.enabled === true + ) { // No single or double click return this._handleSingleClick(); } @@ -230,7 +233,7 @@ export class Table extends LitElement { this.clickService.timer = setTimeout(() => { this.clickService.timer = undefined; - if (this.config.popup) { + if (this.config.popup.enabled) { this._handleSingleClick(); } }, this.config.dbl_click_speed);