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

2 lines
3.9 KiB
JavaScript
Raw Normal View History

2023-07-12 05:42:33 +07:00
import{S as t,i as o,a as n,b as e,s as a,e as m,n as s,d as i,c as r,o as c,f as l,t as p,g,h as u,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{communes as v,addMarkersCommunes as w}from"../../../../../../../../../js/communes.js";import{loadLocaleContent as k}from"../../../../../../../../../js/libraries/serverTools.js";import"../../../../../../../../../js/components/map-component.js";function y(t,o,n){const e=t.slice();return e[6]=o[n],e}function z(t){let o,n,a,m,s,r,c,j,w,k,z,E,O,R,T,A,C,H=t[0].heading+"",L=t[0].p1+"",M=t[0].subheading1+"",N=v,S=[];for(let o=0;o<N.length;o+=1)S[o]=D(y(t,N,o));return{c(){o=l("div"),n=l("div"),a=l("h1"),m=p(H),s=g(),r=l("img"),j=g(),w=l("p"),k=p(L),z=g(),E=l("h3"),O=p(M),R=g(),T=l("map-component"),C=g();for(let t=0;t<S.length;t+=1)S[t].c();u(r,"id","commune-img"),h(r.src,c="/img/common/commune.svg")||u(r,"src","/img/common/commune.svg"),u(r,"alt","commune"),d(T,"id","map"),d(T,"callback",A=t[5]),u(n,"id","text-container"),u(o,"id","container")},m(t,i){e(t,o,i),f(o,n),f(n,a),f(a,m),f(n,s),f(n,r),f(n,j),f(n,w),f(w,k),f(n,z),f(n,E),f(E,O),f(n,R),f(n,T),f(n,C);for(let t=0;t<S.length;t+=1)S[t].m(n,null)},p(t,o){if(1&o&&H!==(H=t[0].heading+"")&&b(m,H),1&o&&L!==(L=t[0].p1+"")&&b(k,L),1&o&&M!==(M=t[0].subheading1+"")&&b(O,M),1&o&&A!==(A=t[5])&&d(T,"callback",A),1&o){let e;for(N=v,e=0;e<N.length;e+=1){const a=y(t,N,e);S[e]?S[e].p(a,o):(S[e]=D(a),S[e].c(),S[e].m(n,null))}for(;e<S.length;e+=1)S[e].d(1);S.length=N.length}},d(t){t&&i(o),x(S,t)}}}function D(t){let o,n,a,m,s,r,c,h,d,x,j,v,w,k,y,z,D,E,O,R,T,A,C,H,L,M,N=t[0].location+"",S=t[0][t[6].location[0]]+"",_=t[0].status+"",q=t[0][t[6].status]+"",B=t[0].members+"",F=t[6].members+"",G=t[0].contact+"",I=t[0][t[6].contact[1]]+"";return{c(){o=l("div"),n=l("p"),a=l("b"),m=p(N),s=p(": "),r=p(S),c=g(),h=l("p"),d=l("b"),x=p(_),j=p(": "),v=p(q),w=g(),k=l("p"),y=l("b"),z=p(B),D=p(": "),E=p(F),O=g(),R=l("p"),T=l("b"),A=p(G),C=p(": "),H=l("a"),L=p(I),M=g(),u(H,"href",t[6].contact[0]),u(H,"target",";_blank;"),u(H,"rel","noreferrer"),u(o,"class","location-info")},m(t,i){e(t,o,i),f(o,n),f(n,a),f(a,m),f(a,s),f(n,r),f(o,c),f(o,h),f(h,d),f(d,x),f(d,j),f(h,v),f(o,w),f(o,k),f(k,y),f(y,z),f(y,D),f(k,E),f(o,O),f(o,R),f(R,T),f(T,A),f(T,C),f(R,H),f(H,L),f(o,M)},p(t,o){1&o&&N!==(N=t[0].location+"")&&b(m,N),1&o&&S!==(S=t[0][t[6].location[0]]+"")&&b(r,S),1&o&&_!==(_=t[0].status+"")&&b(x,_),1&o&&q!==(q=t[0][t[6].status]+"")&&b(v,q),1&o&&B!==(B=t[0].members+"")&&b(z,B),1&o&&G!==(G=t[0].contact+"")&&b(A,G),1&o&&I!==(I=t[0][t[6].contact[1]]+"")&&b(L,I)},d(t){t&&i(o)}}}function E(t){let o,n=0!=Object.keys(t[0]).length,a=n&&z(t);return{c(){a&&a.c(),o=m(),this.c=s},m(t,n){a&&a.m(t,n),e(t,o,n)},p(t,[e]){1&e&&(n=0!=Object.keys(t[0]).length),n?a?a.p(t,e):(a=z(t),a.c(),a.m(o.parentNode,o)):a&&(a.d(1),a=null)},i:s,o:s,d(t){a&&a.d(t),t&&i(o)}}}function O(t,o,n){let e,a,m=j({});r(t,m,(t=>n(0,e=t)));let s=k(m,"communes-component",a);function i(t,o){let n=t([22,0],2);w(n,o)}c((()=>{}));return[e,a,m,s,i,t=>i(t,e)]}class R 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}.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},O,E,a,{},null),t&&t.target&&e(t.target,this,t.anchor)}}customElements.define("communes-component",R);export{R as default};