import{h as t,f as e,r as s,H as o,g as i}from"./p-6b2342e0.js";import{s as r}from"./p-519a7d55.js";import{c as a,V as n,M as p,L as c,I as l}from"./p-6e1ab235.js";import{V as d,I as f}from"./p-4415ad28.js";import{V as m}from"./p-e1fbfd20.js";import{V as h}from"./p-e6adf829.js";import{f as j}from"./p-b7624ce4.js";import{f as u}from"./p-a528714c.js";import{O as v}from"./p-331a62d5.js";import{C as b}from"./p-2d0d575f.js";import"./p-593e0f80.js";import"./p-6a334573.js";import"./p-8b5d3a52.js";import"./p-b9386dd0.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-d884c644.js";import"./p-d5531d3c.js";import"./p-fc7ab79d.js";import"./p-49a2e141.js";import"./p-262ec334.js";import"./p-0c667d6a.js";import"./p-d27ae9ff.js";import"./p-18e8d9b7.js";import"./p-5a25014f.js";import"./p-2b5cf2b3.js";var g=function(t,e,s,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,s):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,s,o);else for(var n=t.length-1;n>=0;n--)(i=t[n])&&(a=(r<3?i(a):r>3?i(e,s,a):i(e,s))||a);return r>3&&a&&Object.defineProperty(e,s,a),a};class y extends n{render(){const e=m.getIconKey(this.country),s=h.hasIcon(e),o=j(this.size,"widthAndHeight"),i=`calc(${o} * 4 / 3)`;return s?t("vega-icon",{icon:e,size:this.size,style:{"--vega-icon-width":i}}):t("vega-skeleton",{type:"image",corners:"rounded-2",height:o,width:i})}}g([a()],y.prototype,"size",void 0),g([a()],y.prototype,"country",void 0);var R=function(t,e,s,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,s):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,s,o);else for(var n=t.length-1;n>=0;n--)(i=t[n])&&(a=(r<3?i(a):r>3?i(e,s,a):i(e,s))||a);return r>3&&a&&Object.defineProperty(e,s,a),a};class w extends n{constructor(){super(...arguments),this.isAcceptObserver=()=>!0,this.listenerCallback=()=>{e(this.host)}}componentWillLoad(){this.country&&(this.isFlagForCountryCodeLoaded(this.country)||this.registerObserver())}unRegisterObserver(){this.observer&&(b.unregister(u,this.observer),this.observer=null)}registerObserver(){this.observer=new v(this.isAcceptObserver.bind(this),this.listenerCallback.bind(this)),b.register(u,this.observer)}isFlagForCountryCodeLoaded(t){const e=m.getIconKey(t);return m.hasIcon(e)}}!async function(){try{const t=(await import("./p-3e258753.js")).CountryFlags;m.register(t),b.notify(u,{})}catch(t){c.error("Error loading flag module:",t)}}(),R([a()],w.prototype,"host",void 0),R([a()],w.prototype,"country",void 0),R([p("componentWillLoad")],w.prototype,"componentWillLoad",null),R([p("disconnectedCallback")],w.prototype,"unRegisterObserver",null);var O=function(t,e,s,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,s):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,s,o);else for(var n=t.length-1;n>=0;n--)(i=t[n])&&(a=(r<3?i(a):r>3?i(e,s,a):i(e,s))||a);return r>3&&a&&Object.defineProperty(e,s,a),a};const C=class{constructor(t){s(this,t),this.globalSlimmers={},this.renderer=new y,this.vegaFlagIconController=new w,this.vegaComponentUsageRuntimeMetricsSlimmer=new d,this.size="size-16"}render(){return r(t(o,null,this.renderer.render()),this.host)}get host(){return i(this)}};O([f()],C.prototype,"globalSlimmers",void 0),O([l()],C.prototype,"renderer",void 0),O([l()],C.prototype,"vegaFlagIconController",void 0),O([l()],C.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),C.style=":host{display:inline-block}:host vega-icon,:host vega-skeleton,:host svg{display:block;border-radius:2px}:host vega-icon{width:var(--vega-icon-width, 24px)}";export{C as vega_flag_icon}