import{S as t,i as n,a as o,b as e,s as r,e as a,n as c,d as i,c as m,o as s,h as l,t as p,j as u,k as d,w as f,x as g,l as h,y as b,p as j}from"./index-0d9f0c09.js";import{w as x}from"./index-1c123138.js";import{loadLocaleContent as y,getData as v}from"../../../../../../../../../js/libraries/serverTools.js";import{addMarkersEntries as w,translate as k}from"../../../../../../../../../js/libraries/mapTools.js";import{addTradeUnionPinContent as z}from"../../../../../../../../../js/mapFuncs.js";import"../../../../../../../../../js/components/map-component.js";function N(t,n,o){const e=t.slice();return e[12]=n[o][0],e[3]=n[o][1],e}function O(t,n,o){const e=t.slice();return e[15]=n[o],e}function T(t){let n,o,r,a,c,m,s,x,y,v,w,k,z,O,T,U,C,D,E,S,_=t[1].tradeUnions+"",A=t[1].p1+"",F=t[1].subheading1+"",G=t[1]["map-prompt"]+"",H=Object.entries(t[0]),J=[];for(let n=0;no(2,r=t)));let c,i,l=x({});m(t,l,(t=>o(1,e=t)));let p=y(l,"trade-unions-component",a);y(l,"countries",a);function u(t,n,o){let e=t([22,0],2);w(c,i,e,n,o,z,"violet",{enableCountryGrouping:!0})}v("/assets/trade-unions.json",(t=>{o(3,c=JSON.parse(t)),o(0,i={});for(let t of c){let n=t.country;null==t.contact&&(t.contact="https://discord.gg/Qk8KUk787z"),n in i?i[n].push(t):o(0,i[n]=[t],i)}a.update((t=>t+1))})),s((()=>{}));return[i,e,r,c,a,l,p,u,function(t){return"en"==p?t:k(e,t)},function(t){return[t.country,t.state,t.town].filter((t=>null!=t)).map((t=>"en"==p?t:k(e,t))).join(", ")},t=>u(t,e,p)]}class F extends t{constructor(t){super(),this.shadowRoot.innerHTML="",n(this,{target:this.shadowRoot,props:o(this.attributes),customElement:!0},A,_,r,{},null),t&&t.target&&e(t.target,this,t.anchor)}}customElements.define("trade-unions-component",F);export{F as default};