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

2 lines
8.0 KiB
JavaScript
Raw Normal View History

2023-07-20 04:57:20 +07:00
import{S as e,i as t,a as n,b as o,s as i,e as r,n as a,d as l,c as s,o as d,t as c,g as m,f as h,h as p,j as g,l as u,q as f,m as b,p as w,r as v,w as y}from"./index-4348483d.js";import{w as k}from"./index-71440b21.js";import{loadLocaleContent as x,locales as j}from"../../../../../../../../../js/libraries/serverTools.js";function H(e,t,n){const o=e.slice();return o[17]=t[n][0],o[18]=t[n][1],o}function z(e){let t,n,i,r,a,s,d,y,k,x,z,L,W,M,O,E,N,S,R,U,q,I,X,A,B,C,D,F,G,J,K,P,Q,V,Y,Z,$,_,ee,te,ne,oe,ie,re,ae,le,se,de,ce,me=e[11]()+"",he=e[4].orgName+"",pe=e[4].manifesto+"",ge=e[4].joinUs+"",ue=e[4].groups+"",fe=e[4].communes+"",be=e[4].cooperatives+"",we=e[4].parties+"",ve=e[4].partners+"",ye=Object.entries(j),ke=[];for(let t=0;t<ye.length;t+=1)ke[t]=T(H(e,ye,t));return{c(){t=c(me),n=m(),i=h("header"),r=h("input"),a=m(),s=h("label"),s.innerHTML='<span id="hamb-line"></span>',d=m(),y=h("a"),k=h("img"),z=m(),L=h("span"),W=m(),M=h("nav"),O=h("ul"),E=h("li"),N=h("a"),S=c(pe),R=m(),U=h("li"),q=h("a"),I=c(ge),X=m(),A=h("li"),B=h("a"),C=c(ue),D=m(),F=h("li"),G=h("a"),J=c(fe),K=m(),P=h("li"),Q=h("a"),V=c(be),Y=m(),Z=h("li"),$=h("a"),_=c(we),ee=m(),te=h("li"),ne=h("a"),oe=c(ve),ie=m(),re=h("li"),ae=h("button"),ae.innerHTML='<picture><source srcset="/img/common/globe.webp"/> \n <source srcset="/img/common/globe.png"/> \n <img id="locales-img" alt="globe"/></picture>',le=m(),se=h("div");for(let e=0;e<ke.length;e+=1)ke[e].c();p(r,"type","checkbox"),p(r,"id","side-menu"),p(s,"id","hamb"),p(s,"for","side-menu"),g(k.src,x="/img/common/flag.png")||p(k,"src","/img/common/flag.png"),p(k,"id","navbar-logo"),p(k,"alt","logo"),p(L,"id","navbar-logo-text"),p(y,"id","logo-container"),p(y,"href","/"+e[7]+"/"),p(N,"href","/"+e[7]+"/manifesto"),p(q,"href","/"+e[7]+"/join-us"),p(B,"href","/"+e[7]+"/groups"),p(G,"href","/"+e[7]+"/communes"),p(Q,"href","/"+e[7]+"/cooperatives"),p($,"href","/"+e[7]+"/parties"),p(ne,"href","/"+e[7]+"/partners"),p(re,"id","locales"),p(se,"id","locales-dropdown"),p(O,"id","menu"),p(M,"id","nav"),p(i,"id","navbar")},m(l,c){o(l,t,c),o(l,n,c),o(l,i,c),u(i,r),e[12](r),u(i,a),u(i,s),u(i,d),u(i,y),u(y,k),u(y,z),u(y,L),L.innerHTML=he,e[13](L),u(i,W),u(i,M),u(M,O),u(O,E),u(E,N),u(N,S),u(O,R),u(O,U),u(U,q),u(q,I),u(O,X),u(O,A),u(A,B),u(B,C),u(O,D),u(O,F),u(F,G),u(G,J),u(O,K),u(O,P),u(P,Q),u(Q,V),u(O,Y),u(O,Z),u(Z,$),u($,_),u(O,ee),u(O,te),u(te,ne),u(ne,oe),u(O,ie),u(O,re),u(re,ae),u(O,le),u(O,se);for(let e=0;e<ke.length;e+=1)ke[e].m(se,null);e[15](se),e[16](i),de||(ce=[f(r,"click",e[8]),f(ae,"click",e[9])],de=!0)},p(e,t){if(16&t&&he!==(he=e[4].orgName+"")&&(L.innerHTML=he),16&t&&pe!==(pe=e[4].manifesto+"")&&b(S,pe),16&t&&ge!==(ge=e[4].joinUs+"")&&b(I,ge),16&t&&ue!==(ue=e[4].groups+"")&&b(C,ue),16&t&&fe!==(fe=e[4].communes+"")&&b(J,fe),16&t&&be!==(be=e[4].cooperatives+"")&&b(V,be),16&t&&we!==(we=e[4].parties+"")&&b(_,we),16&t&&ve!==(ve=e[4].partners+"")&&b(oe,ve),1024&t){let n;for(ye=Object.entries(j),n=0;n<ye.length;n+=1){const o=H(e,ye,n);ke[n]?ke[n].p(o,t):(ke[n]=T(o),ke[n].c(),ke[n].m(se,null))}for(;n<ke.length;n+=1)ke[n].d(1);ke.length=ye.length}},d(o){o&&l(t),o&&l(n),o&&l(i),e[12](null),e[13](null),w(ke,o),e[15](null),e[16](null),de=!1,v(ce)}}}function T(e){let t,n,i,r,a=e[18]+"";function s(){return e[14](e[17])}return{c(){t=h("button"),n=c(a)},m(e,a){o(e,t,a),u(t,n),i||(r=f(t,"click",s),i=!0)},p(t,n){e=t},d(e){e&&l(t),i=!1,r()}}}function L(e){let t,n=0!=Object.keys(e[4]).length,i=n&&z(e);return{c(){i&&i.c(),t=r(),this.c=a},m(e,n){i&&i.m(e,n),o(e,t,n)},p(e,[o]){16&o&&(n=0!=Object.keys(e[4]).length),n?i?i.p(e,o):(i=z(e),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},i:a,o:a,d(e){i&&i.d(e),e&&l(t)}}}function W(e,t,n){let o,i,r,a,l,c=k(0),m=k({});s(e,m,(e=>n(4,o=e)));let h=x(m,"navbar-component",c);function p(e){localStorage.setItem("locale",e);let t=location.href.split("/"),n=Object.keys(j);t=t.filter((e=>!n.includes(e)));let o=t.slice(0,t.length-1).join("/")+"/"+e+"/"+t[t.length-1];location.href=o}d((()=>{}));return[i,r,a,l,o,c,m,h,function(){i.checked?n(1,r.style.