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

2 lines
7.9 KiB
JavaScript
Raw Normal View History

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