2 lines
5.6 KiB
JavaScript
2 lines
5.6 KiB
JavaScript
import{S as t,i as o,a as n,b as e,s as r,q as a,n as i,g as s,t as c,o as m,e as l,w as p,c as u,d as g,u as d,v as f,f as h,x as b,y as j}from"./index-6e99513e.js";import{w as x}from"./index-3db98739.js";import{loadLocaleContent as y,getData as w}from"../../../../../../../../../js/libraries/serverTools.js";import{addMarkersEntries as v,translate as k}from"../../../../../../../../../js/libraries/mapTools.js";import"../../../../../../../../../js/components/map-component.js";function z(t,o,n){const e=t.slice();return e[13]=o[n][0],e[3]=o[n][1],e}function N(t,o,n){const e=t.slice();return e[16]=o[n],e}function O(t){let o,n,r,a,i,c,m,x,y,w,v,k,N,O,T,E,R,S,_,q,A=t[1].groups+"",C=t[1].p1+"",G=t[1].subheading1+"",H=t[1]["map-prompt"]+"",J=Object.entries(t[0]),K=[];for(let o=0;o<J.length;o+=1)K[o]=D(z(t,J,o));return{c(){o=l("div"),n=l("div"),r=l("h1"),a=p(A),i=u(),c=l("img"),x=u(),y=l("p"),w=p(C),v=u(),k=l("h3"),N=p(G),O=u(),T=l("map-component"),R=u(),S=l("p"),_=p(H),q=u();for(let t=0;t<K.length;t+=1)K[t].c();g(c,"id","groups-img"),d(c.src,m="/img/common/groups.svg")||g(c,"src","/img/common/groups.svg"),g(c,"alt","groups"),g(y,"class","description"),f(T,"id","map"),f(T,"callback",E=t[10]),g(S,"id","add-prompt"),g(n,"id","text-container"),g(o,"id","container")},m(t,s){e(t,o,s),h(o,n),h(n,r),h(r,a),h(n,i),h(n,c),h(n,x),h(n,y),h(y,w),h(n,v),h(n,k),h(k,N),h(n,O),h(n,T),h(n,R),h(n,S),h(S,_),h(n,q);for(let t=0;t<K.length;t+=1)K[t].m(n,null)},p(t,o){if(2&o&&A!==(A=t[1].groups+"")&&b(a,A),2&o&&C!==(C=t[1].p1+"")&&b(w,C),2&o&&G!==(G=t[1].subheading1+"")&&b(N,G),2&o&&E!==(E=t[10])&&f(T,"callback",E),2&o&&H!==(H=t[1]["map-prompt"]+"")&&b(_,H),771&o){let e;for(J=Object.entries(t[0]),e=0;e<J.length;e+=1){const r=z(t,J,e);K[e]?K[e].p(r,o):(K[e]=D(r),K[e].c(),K[e].m(n,null))}for(;e<K.length;e+=1)K[e].d(1);K.length=J.length}},d(t){t&&s(o),j(K,t)}}}function T(t){let o,n,r,a,i,c,m,d,f,j,x,y,w,v,k,z,N,O,T,D,E=t[1].location+"",R=t[9](t[16])+"",S=t[1].members+"",_=t[16].members+"",q=t[1].contact+"",A=t[16].contact+"";return{c(){o=l("div"),n=l("p"),r=l("b"),a=p(E),i=p(": "),c=p(R),m=u(),d=l("p"),f=l("b"),j=p(S),x=p(": "),y=p(_),w=u(),v=l("p"),k=l("b"),z=p(q),N=p(": "),O=l("a"),T=p(A),g(O,"href",D=t[16].contact),g(O,"target",";_blank;"),g(O,"rel","noreferrer"),g(o,"class","location-info")},m(t,s){e(t,o,s),h(o,n),h(n,r),h(r,a),h(r,i),h(n,c),h(o,m),h(o,d),h(d,f),h(f,j),h(f,x),h(d,y),h(o,w),h(o,v),h(v,k),h(k,z),h(k,N),h(v,O),h(O,T)},p(t,o){2&o&&E!==(E=t[1].location+"")&&b(a,E),1&o&&R!==(R=t[9](t[16])+"")&&b(c,R),2&o&&S!==(S=t[1].members+"")&&b(j,S),1&o&&_!==(_=t[16].members+"")&&b(y,_),2&o&&q!==(q=t[1].contact+"")&&b(z,q),1&o&&A!==(A=t[16].contact+"")&&b(T,A),1&o&&D!==(D=t[16].contact)&&g(O,"href",D)},d(t){t&&s(o)}}}function D(t){let o,n,r,a,i,c=t[8](t[13])+"",m=t[3],d=[];for(let o=0;o<m.length;o+=1)d[o]=T(N(t,m,o));return{c(){o=l("h4"),n=p(c),r=u(),a=l("div");for(let t=0;t<d.length;t+=1)d[t].c();i=u(),g(o,"class","country-name"),g(a,"class","country-block")},m(t,s){e(t,o,s),h(o,n),e(t,r,s),e(t,a,s);for(let t=0;t<d.length;t+=1)d[t].m(a,null);h(a,i)},p(t,o){if(1&o&&c!==(c=t[8](t[13])+"")&&b(n,c),515&o){let n;for(m=t[3],n=0;n<m.length;n+=1){const e=N(t,m,n);d[n]?d[n].p(e,o):(d[n]=T(e),d[n].c(),d[n].m(a,i))}for(;n<d.length;n+=1)d[n].d(1);d.length=m.length}},d(t){t&&s(o),t&&s(r),t&&s(a),j(d,t)}}}function E(t){let o,n=3==t[2]&&O(t);return{c(){n&&n.c(),o=a()},m(t,r){n&&n.m(t,r),e(t,o,r)},p(t,e){3==t[2]?n?n.p(t,e):(n=O(t),n.c(),n.m(o.parentNode,o)):n&&(n.d(1),n=null)},d(t){n&&n.d(t),t&&s(o)}}}function R(t){let o,n=t[2],c=E(t);return{c(){c.c(),o=a(),this.c=i},m(t,n){c.m(t,n),e(t,o,n)},p(t,[e]){4&e&&r(n,n=t[2])?(c.d(1),c=E(t),c.c(),c.m(o.parentNode,o)):c.p(t,e)},i:i,o:i,d(t){t&&s(o),c.d(t)}}}function S(t,o,n){let e,r,a=x(0);c(t,a,(t=>n(2,r=t)));let i,s,l=x({});c(t,l,(t=>n(1,e=t)));let p=y(l,"groups-component",a);y(l,"countries",a);function u(t,o,n){let e,r="<b>"+o.Group+"</b><br>";for(let a of["location","members","contact"]){let i=o[a]+": ";if("contact"==a)r+=i+"<a href='"+t.contact+"' target='_blank' rel=noreferrer>"+t.contact+"</a>";else if("location"==a){let a,s=[t.country,t.state,t.town].filter((t=>null!=t&&null!=t));a="en"==n?s.map((t=>t)).join(", "):s.map((t=>k(o,t))).join(", "),r+=i+a+"<br>",e=[t.latitude,t.longitude]}else r+=i+t[a]+"<br>"}return{text:r,coordinates:e}}function g(t,o,n){let e=t([22,0],2);v(i,s,e,o,n,u,"green")}w("/assets/groups.json",(t=>{n(3,i=JSON.parse(t)),n(0,s={});for(let t of i){let o=t.country;null==t.contact&&(t.contact="https://discord.gg/Qk8KUk787z"),o in s?s[o].push(t):n(0,s[o]=[t],s)}a.update((t=>t+1))})),m((()=>{}));return[s,e,r,i,a,l,p,g,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=>g(t,e,p)]}class _ extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';.description{margin-bottom:1rem}#add-prompt{margin-bottom:2rem}#groups-img{position:absolute;width:14rem;left:50%;transform:translate(-50%);z-index:0;opacity:0.2}#text-container>:nth-child(3){margin-top:8rem}.country-name{margin-bottom:0.5rem}.country-block{margin-bottom:2rem}.location-info{margin-bottom:0.75rem}.location-info p{margin-bottom:0}a{color:#DD1C1A}#map{--height:30rem;--width:100%;--margin-bottom:0.5rem}#text-container{position:relative;max-width:calc(100vw - 4rem);margin:auto}h1{margin-bottom:1rem;font-size:2.2rem;text-align:center}h3{margin-bottom:1rem}#container{margin:auto;max-width:800px;margin-top:1rem;margin-bottom:4rem}#container p{text-align:justify}</style>",o(this,{target:this.shadowRoot,props:n(this.attributes),customElement:!0},S,R,r,{},null),t&&t.target&&e(t.target,this,t.anchor)}}customElements.define("partners-component",_);export{_ as default};
|