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

2 lines
4.9 KiB
JavaScript

import{S as t,i as o,a as n,b as e,s as m,e as r,n as c,d as a,c as i,o as s,f as l,t as u,g as p,h as g,j as h,k as d,l as f,m as b,p as x}from"./index-4348483d.js";import{w as j}from"./index-71440b21.js";import{addMarkersCommunes as v,communesByCountry as w}from"../../../../../../../../../js/communes.js";import{loadLocaleContent as y}from"../../../../../../../../../js/libraries/serverTools.js";import"../../../../../../../../../js/components/map-component.js";function k(t,o,n){const e=t.slice();return e[7]=o[n][0],e[8]=o[n][1],e}function z(t,o,n){const e=t.slice();return e[11]=o[n],e}function D(t){let o,n,m,r,c,i,s,j,v,y,z,D,E,O,R,T,A,C=t[1].communes+"",H=t[1].p1+"",L=t[1].subheading1+"",M=Object.entries(w),S=[];for(let o=0;o<M.length;o+=1)S[o]=N(k(t,M,o));return{c(){o=l("div"),n=l("div"),m=l("h1"),r=u(C),c=p(),i=l("img"),j=p(),v=l("p"),y=u(H),z=p(),D=l("h3"),E=u(L),O=p(),R=l("map-component"),A=p();for(let t=0;t<S.length;t+=1)S[t].c();g(i,"id","commune-img"),h(i.src,s="/img/common/commune.svg")||g(i,"src","/img/common/commune.svg"),g(i,"alt","commune"),d(R,"id","map"),d(R,"callback",T=t[6]),g(n,"id","text-container"),g(o,"id","container")},m(t,a){e(t,o,a),f(o,n),f(n,m),f(m,r),f(n,c),f(n,i),f(n,j),f(n,v),f(v,y),f(n,z),f(n,D),f(D,E),f(n,O),f(n,R),f(n,A);for(let t=0;t<S.length;t+=1)S[t].m(n,null)},p(t,o){if(2&o&&C!==(C=t[1].communes+"")&&b(r,C),2&o&&H!==(H=t[1].p1+"")&&b(y,H),2&o&&L!==(L=t[1].subheading1+"")&&b(E,L),2&o&&T!==(T=t[6])&&d(R,"callback",T),2&o){let e;for(M=Object.entries(w),e=0;e<M.length;e+=1){const m=k(t,M,e);S[e]?S[e].p(m,o):(S[e]=N(m),S[e].c(),S[e].m(n,null))}for(;e<S.length;e+=1)S[e].d(1);S.length=M.length}},d(t){t&&a(o),x(S,t)}}}function E(t){let o,n,m,r,c,i,s,h,d,x,j,v,w,y,k,z,D,E,N,O,R,T,A,C,H,L=t[1].location+"",M=t[1][t[11].location[0][0]]+(""==t[11].location[0][1]?"":", "+t[1][t[11].location[0][1]]),S=t[1].status+"",_=t[1][t[11].status]+"",q=t[1].members+"",B=t[11].members+"",F=t[1].contact+"",G=t[1][t[11].contact[1]]+"";return{c(){o=l("div"),n=l("p"),m=l("b"),r=u(L),c=u(": "),i=u(M),s=p(),h=l("p"),d=l("b"),x=u(S),j=u(": "),v=u(_),w=p(),y=l("p"),k=l("b"),z=u(q),D=u(": "),E=u(B),N=p(),O=l("p"),R=l("b"),T=u(F),A=u(": "),C=l("a"),H=u(G),g(C,"href",t[11].contact[0]),g(C,"target",";_blank;"),g(C,"rel","noreferrer"),g(o,"class","location-info")},m(t,a){e(t,o,a),f(o,n),f(n,m),f(m,r),f(m,c),f(n,i),f(o,s),f(o,h),f(h,d),f(d,x),f(d,j),f(h,v),f(o,w),f(o,y),f(y,k),f(k,z),f(k,D),f(y,E),f(o,N),f(o,O),f(O,R),f(R,T),f(R,A),f(O,C),f(C,H)},p(t,o){2&o&&L!==(L=t[1].location+"")&&b(r,L),2&o&&M!==(M=t[1][t[11].location[0][0]]+(""==t[11].location[0][1]?"":", "+t[1][t[11].location[0][1]]))&&b(i,M),2&o&&S!==(S=t[1].status+"")&&b(x,S),2&o&&_!==(_=t[1][t[11].status]+"")&&b(v,_),2&o&&q!==(q=t[1].members+"")&&b(z,q),2&o&&F!==(F=t[1].contact+"")&&b(T,F),2&o&&G!==(G=t[1][t[11].contact[1]]+"")&&b(H,G)},d(t){t&&a(o)}}}function N(t){let o,n,m,r,c,i=t[1][t[7]]+"",s=t[8],h=[];for(let o=0;o<s.length;o+=1)h[o]=E(z(t,s,o));return{c(){o=l("h4"),n=u(i),m=p(),r=l("div");for(let t=0;t<h.length;t+=1)h[t].c();c=p(),g(o,"class","country-name"),g(r,"class","country-block")},m(t,a){e(t,o,a),f(o,n),e(t,m,a),e(t,r,a);for(let t=0;t<h.length;t+=1)h[t].m(r,null);f(r,c)},p(t,o){if(2&o&&i!==(i=t[1][t[7]]+"")&&b(n,i),2&o){let n;for(s=t[8],n=0;n<s.length;n+=1){const e=z(t,s,n);h[n]?h[n].p(e,o):(h[n]=E(e),h[n].c(),h[n].m(r,c))}for(;n<h.length;n+=1)h[n].d(1);h.length=s.length}},d(t){t&&a(o),t&&a(m),t&&a(r),x(h,t)}}}function O(t){let o,n=2==t[0]&&D(t);return{c(){n&&n.c(),o=r()},m(t,m){n&&n.m(t,m),e(t,o,m)},p(t,e){2==t[0]?n?n.p(t,e):(n=D(t),n.c(),n.m(o.parentNode,o)):n&&(n.d(1),n=null)},d(t){n&&n.d(t),t&&a(o)}}}function R(t){let o,n=t[0],i=O(t);return{c(){i.c(),o=r(),this.c=c},m(t,n){i.m(t,n),e(t,o,n)},p(t,[e]){1&e&&m(n,n=t[0])?(i.d(1),i=O(t),i.c(),i.m(o.parentNode,o)):i.p(t,e)},i:c,o:c,d(t){t&&a(o),i.d(t)}}}function T(t,o,n){let e,m,r=j(0);i(t,r,(t=>n(0,e=t)));let c=j({});i(t,c,(t=>n(1,m=t))),y(c,"countries",r);let a=y(c,"communes-component",r);function l(t,o){let n=t([22,0],2);v(n,o)}s((()=>{}));return[e,m,r,c,a,l,t=>l(t,m)]}class A extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';#commune-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}.country-name{margin-bottom:0.5rem}.country-block{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>",o(this,{target:this.shadowRoot,props:n(this.attributes),customElement:!0},T,R,m,{},null),t&&t.target&&e(t.target,this,t.anchor)}}customElements.define("communes-component",A);export{A as default};