site-libsoc/Server/public/js/components/groups-component.js

2 lines
4.8 KiB
JavaScript

import{S as t,i as o,a as n,b as e,s as r,e as i,n as m,d as a,c as s,o as c,f as l,t as p,g,h as u,j as d,k as h,l as f,m as b,p as j}from"./index-4348483d.js";import{w as x}from"./index-71440b21.js";import{addMarkersGroups as v,translate as w,groupsByCountry as y}from"../../../../../../../../../js/groups.js";import{loadLocaleContent as k}from"../../../../../../../../../js/libraries/serverTools.js";import"../../../../../../../../../js/components/map-component.js";function z(t,o,n){const e=t.slice();return e[9]=o[n][0],e[10]=o[n][1],e}function D(t,o,n){const e=t.slice();return e[13]=o[n],e}function E(t){let o,n,r,i,m,s,c,x,v,w,k,D,E,N,R,T,A,C,H,L,M=t[0].groups+"",S=t[0].p1+"",_=t[0].subheading1+"",q=t[0]["map-prompt"]+"",B=Object.entries(y),F=[];for(let o=0;o<B.length;o+=1)F[o]=O(z(t,B,o));return{c(){o=l("div"),n=l("div"),r=l("h1"),i=p(M),m=g(),s=l("img"),x=g(),v=l("p"),w=p(S),k=g(),D=l("h3"),E=p(_),N=g(),R=l("map-component"),A=g(),C=l("p"),H=p(q),L=g();for(let t=0;t<F.length;t+=1)F[t].c();u(s,"id","groups-img"),d(s.src,c="/img/common/groups.svg")||u(s,"src","/img/common/groups.svg"),u(s,"alt","groups"),u(v,"class","description"),h(R,"id","map"),h(R,"callback",T=t[8]),u(C,"id","add-prompt"),u(n,"id","text-container"),u(o,"id","container")},m(t,a){e(t,o,a),f(o,n),f(n,r),f(r,i),f(n,m),f(n,s),f(n,x),f(n,v),f(v,w),f(n,k),f(n,D),f(D,E),f(n,N),f(n,R),f(n,A),f(n,C),f(C,H),f(n,L);for(let t=0;t<F.length;t+=1)F[t].m(n,null)},p(t,o){if(1&o&&M!==(M=t[0].groups+"")&&b(i,M),1&o&&S!==(S=t[0].p1+"")&&b(w,S),1&o&&_!==(_=t[0].subheading1+"")&&b(E,_),1&o&&T!==(T=t[8])&&h(R,"callback",T),1&o&&q!==(q=t[0]["map-prompt"]+"")&&b(H,q),193&o){let e;for(B=Object.entries(y),e=0;e<B.length;e+=1){const r=z(t,B,e);F[e]?F[e].p(r,o):(F[e]=O(r),F[e].c(),F[e].m(n,null))}for(;e<F.length;e+=1)F[e].d(1);F.length=B.length}},d(t){t&&a(o),j(F,t)}}}function N(t){let o,n,r,i,m,s,c,d,h,j,x,v,w,y,k,z,D,E,N,O=t[0].location+"",R=t[7](t[13])+"",T=t[0].members+"",A=t[13].members+"",C=t[0].contact+"",H=t[0][t[13].contact[1]]+"";return{c(){o=l("div"),n=l("p"),r=l("b"),i=p(O),m=p(": "),s=p(R),c=g(),d=l("p"),h=l("b"),j=p(T),x=p(": "),v=p(A),w=g(),y=l("p"),k=l("b"),z=p(C),D=p(": "),E=l("a"),N=p(H),u(E,"href",t[13].contact[0]),u(E,"target",";_blank;"),u(E,"rel","noreferrer"),u(o,"class","location-info")},m(t,a){e(t,o,a),f(o,n),f(n,r),f(r,i),f(r,m),f(n,s),f(o,c),f(o,d),f(d,h),f(h,j),f(h,x),f(d,v),f(o,w),f(o,y),f(y,k),f(k,z),f(k,D),f(y,E),f(E,N)},p(t,o){1&o&&O!==(O=t[0].location+"")&&b(i,O),1&o&&T!==(T=t[0].members+"")&&b(j,T),1&o&&C!==(C=t[0].contact+"")&&b(z,C),1&o&&H!==(H=t[0][t[13].contact[1]]+"")&&b(N,H)},d(t){t&&a(o)}}}function O(t){let o,n,r,i,m,s=t[6](t[9])+"",c=t[10],d=[];for(let o=0;o<c.length;o+=1)d[o]=N(D(t,c,o));return{c(){o=l("h4"),n=p(s),r=g(),i=l("div");for(let t=0;t<d.length;t+=1)d[t].c();m=g(),u(o,"class","country-name"),u(i,"class","country-block")},m(t,a){e(t,o,a),f(o,n),e(t,r,a),e(t,i,a);for(let t=0;t<d.length;t+=1)d[t].m(i,null);f(i,m)},p(t,o){if(129&o){let n;for(c=t[10],n=0;n<c.length;n+=1){const e=D(t,c,n);d[n]?d[n].p(e,o):(d[n]=N(e),d[n].c(),d[n].m(i,m))}for(;n<d.length;n+=1)d[n].d(1);d.length=c.length}},d(t){t&&a(o),t&&a(r),t&&a(i),j(d,t)}}}function R(t){let o,n=2==t[1]&&E(t);return{c(){n&&n.c(),o=i()},m(t,r){n&&n.m(t,r),e(t,o,r)},p(t,e){2==t[1]?n?n.p(t,e):(n=E(t),n.c(),n.m(o.parentNode,o)):n&&(n.d(1),n=null)},d(t){n&&n.d(t),t&&a(o)}}}function T(t){let o,n=t[1],s=R(t);return{c(){s.c(),o=i(),this.c=m},m(t,n){s.m(t,n),e(t,o,n)},p(t,[e]){2&e&&r(n,n=t[1])?(s.d(1),s=R(t),s.c(),s.m(o.parentNode,o)):s.p(t,e)},i:m,o:m,d(t){t&&a(o),s.d(t)}}}function A(t,o,n){let e,r,i=x(0);s(t,i,(t=>n(1,r=t)));let m=x({});s(t,m,(t=>n(0,e=t)));let a=k(m,"groups-component",i);function l(t,o,n){let e=t([22,0],2);v(e,o,n)}k(m,"countries",i),c((()=>{}));return[e,r,i,m,a,l,function(t){return"en"==a?t:w(e,t)},function(t){return t.location[0].map((t=>"en"==a?t:w(e,t))).join(", ")},t=>l(t,e,a)]}class C 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},A,T,r,{},null),t&&t.target&&e(t.target,this,t.anchor)}}customElements.define("groups-component",C);export{C as default};