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

2 lines
3.9 KiB
JavaScript

import{S as t,i as n,a as o,b as e,s as i,e as m,n as a,d as s,c as r,o as c,f as l,t as g,g as p,h,j as u,k as d,l as f,m as b,p as x}from"./index-ce8c147b.js";import{w as j}from"./index-f2dbf8ff.js";import{communities as v,addMarkersCommunities as w}from"../../../../../../../../../js/communities.js";import{loadLocaleContent as k,getLocale as y}from"../../../../../../../../../js/libraries/serverTools.js";import"../../../../../../../../../js/components/map-component.js";function z(t,n,o){const e=t.slice();return e[6]=n[o],e}function D(t){let n,o,i,m,a,r,c,j,w,k,y,D,O,R,T,A,C,H,L,M,N=t[0].heading+"",S=t[0].p1+"",_=t[0].subheading1+"",q=t[0].subheading2+"",B=v,F=[];for(let n=0;n<B.length;n+=1)F[n]=E(z(t,B,n));return{c(){n=l("div"),o=l("div"),i=l("h1"),m=g(N),a=p(),r=l("img"),j=p(),w=l("p"),k=g(S),y=p(),D=l("h3"),O=g(_),R=p(),T=l("map-component"),C=p(),H=l("h4"),L=g(q),M=p();for(let t=0;t<F.length;t+=1)F[t].c();h(r,"id","communities-img"),u(r.src,c="/img/common/communities.svg")||h(r,"src","/img/common/communities.svg"),h(r,"alt","communities"),d(T,"id","map"),d(T,"callback",A=t[5]),h(o,"id","text-container"),h(n,"id","container")},m(t,s){e(t,n,s),f(n,o),f(o,i),f(i,m),f(o,a),f(o,r),f(o,j),f(o,w),f(w,k),f(o,y),f(o,D),f(D,O),f(o,R),f(o,T),f(o,C),f(o,H),f(H,L),f(o,M);for(let t=0;t<F.length;t+=1)F[t].m(o,null)},p(t,n){if(1&n&&N!==(N=t[0].heading+"")&&b(m,N),1&n&&S!==(S=t[0].p1+"")&&b(k,S),1&n&&_!==(_=t[0].subheading1+"")&&b(O,_),1&n&&A!==(A=t[5])&&d(T,"callback",A),1&n&&q!==(q=t[0].subheading2+"")&&b(L,q),5&n){let e;for(B=v,e=0;e<B.length;e+=1){const i=z(t,B,e);F[e]?F[e].p(i,n):(F[e]=E(i),F[e].c(),F[e].m(o,null))}for(;e<F.length;e+=1)F[e].d(1);F.length=B.length}},d(t){t&&s(n),x(F,t)}}}function E(t){let n,o,i,m,a,r,c,u,d,x,j,v,w,k,y,z,D,E,O,R,T,A,C,H,L,M,N=t[0].location+"",S=t[6].location[0][t[2][0]]+"",_=t[0].status+"",q=t[6].status[t[2][0]]+"",B=t[0].members+"",F=t[6].members+"",G=t[0].contact+"",I=t[6].contact[1][t[2][0]]+"";return{c(){n=l("div"),o=l("p"),i=l("b"),m=g(N),a=g(": "),r=g(S),c=p(),u=l("p"),d=l("b"),x=g(_),j=g(": "),v=g(q),w=p(),k=l("p"),y=l("b"),z=g(B),D=g(": "),E=g(F),O=p(),R=l("p"),T=l("b"),A=g(G),C=g(": "),H=l("a"),L=g(I),M=p(),h(H,"href",t[6].contact[0]),h(H,"target",";_blank;"),h(H,"rel","noreferrer"),h(n,"class","location-info")},m(t,s){e(t,n,s),f(n,o),f(o,i),f(i,m),f(i,a),f(o,r),f(n,c),f(n,u),f(u,d),f(d,x),f(d,j),f(u,v),f(n,w),f(n,k),f(k,y),f(y,z),f(y,D),f(k,E),f(n,O),f(n,R),f(R,T),f(T,A),f(T,C),f(R,H),f(H,L),f(n,M)},p(t,n){1&n&&N!==(N=t[0].location+"")&&b(m,N),1&n&&_!==(_=t[0].status+"")&&b(x,_),1&n&&B!==(B=t[0].members+"")&&b(z,B),1&n&&G!==(G=t[0].contact+"")&&b(A,G)},d(t){t&&s(n)}}}function O(t){let n,o=0!=Object.keys(t[0]).length,i=o&&D(t);return{c(){i&&i.c(),n=m(),this.c=a},m(t,o){i&&i.m(t,o),e(t,n,o)},p(t,[e]){1&e&&(o=0!=Object.keys(t[0]).length),o?i?i.p(t,e):(i=D(t),i.c(),i.m(n.parentNode,n)):i&&(i.d(1),i=null)},i:a,o:a,d(t){i&&i.d(t),t&&s(n)}}}function R(t,n,o){let e,i,m=[],a=j({});function s(t,n,o){let e=t([51.505,-.09],3);w(e,n,o)}r(t,a,(t=>o(0,e=t))),k(a,"communities-component",i,(t=>y(m,t))),c((()=>{}));return[e,i,m,a,s,t=>s(t,e,m)]}class T extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';#communities-img{position:absolute;width:11.5rem;left:50%;transform:translate(-50%);z-index:0;opacity:0.2}#text-container>:nth-child(3){margin-top:8rem}h4{margin-bottom:2rem}.location-info{position:relative;margin-bottom:2rem}.location-info p{margin-bottom:0}a{color:#DD1C1A}#map{--height:30rem;--width:100%;--margin-bottom:3rem}#text-container{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>div>p{margin-bottom:1rem}#container p{text-align:justify}</style>",n(this,{target:this.shadowRoot,props:o(this.attributes),customElement:!0},R,O,i,{},null),t&&t.target&&e(t.target,this,t.anchor)}}customElements.define("communities-component",T);export{T as default};