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

2 lines
8.0 KiB
JavaScript

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.background="white",r):setTimeout((()=>{n(1,r.style.position="relative",r),n(1,r.style.background="",r),n(1,r.style.boxShadow="",r)}),510)},function(){"block"==a.style.display?n(2,a.style.display="none",a):n(2,a.style.display="block",a)},p,function(){if("ru"==h){let e=()=>{null==l?setTimeout(e,100):(window.innerWidth<1700&&window.innerWidth>1400||window.innerWidth<400)&&"100%"!=l.style.lineHeight?(n(3,l.style.lineHeight="120%",l),n(3,l.style.top="1rem",l),n(3,l.style.width="16rem",l)):(window.innerWidth>1700||window.innerWidth>400&&window.innerWidth<1400)&&"400%"!=l.style.lineHeight&&(n(3,l.style.lineHeight="400%",l),n(3,l.style.top="0rem",l),n(3,l.style.width="auto",l))};e(),addEventListener("resize",e)}},function(e){y[e?"unshift":"push"]((()=>{i=e,n(0,i)}))},function(e){y[e?"unshift":"push"]((()=>{l=e,n(3,l)}))},e=>p(e),function(e){y[e?"unshift":"push"]((()=>{a=e,n(2,a)}))},function(e){y[e?"unshift":"push"]((()=>{r=e,n(1,r)}))}]}class M extends e{constructor(e){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';#navbar{position:relative;top:0;width:min(100%,116rem);z-index:1000000000;height:5.26rem}#navbar *{font-family:var(--sans-serif, sans-serif)}#logo-container{display:flex;position:absolute;margin-left:1rem;height:100%;max-height:5.26rem;color:black;z-index:1;flex-direction:row;flex-wrap:nowrap;align-items:center}#navbar-logo{height:3.5rem;width:3.5rem;object-fit:contain;border-radius:10rem}#navbar-logo-text{position:relative;word-wrap:normal;height:100%;line-height:400%;font-size:1.4rem;color:#292222;font-family:var(--sans-serif, sans-serif);font-weight:400;padding-left:1.2rem}#nav{position:fixed;width:100%;height:100%;background-color:white;overflow:hidden;z-index:0}#menu a{display:block;padding:1.2rem;padding-top:1rem;padding-bottom:1rem;color:black;font-size:1.4rem}#menu a:hover{background-color:rgb(220, 220, 220)}#menu a:active{background-color:#f7aec0}#menu li{list-style-type:none}#nav{max-height:0}#hamb{position:absolute;cursor:pointer;right:0rem;padding:2.8rem 2rem;z-index:9999}#hamb-line{background:black;display:block;height:2px;position:relative;width:24px}#hamb-line::before,#hamb-line::after{background:black;content:'';display:block;height:100%;position:absolute;transition:all .2s ease-out;width:100%}#hamb-line::before{top:5px}#hamb-line::after{top:-5px}#side-menu{display:none}#side-menu:checked~nav{display:block;max-height:100%;padding-top:5.625rem}#side-menu:checked~#logo-container{position:fixed}#side-menu:checked~#hamb{position:fixed}#side-menu:checked~#logo-container{position:fixed}#side-menu:checked~#hamb #hamb-line{background:transparent}#side-menu:checked~#hamb #hamb-line::before{transform:rotate(-45deg);top:0}#side-menu:checked~#hamb #hamb-line::after{transform:rotate(45deg);top:0}#locales{position:relative}#locales button{width:100%;text-align:left;height:4rem}#locales button:hover{opacity:0.5}#locales-img{position:relative;top:0rem;height:2rem;margin-left:1.2rem}#locales-dropdown{position:absolute;display:none;top:5.6rem;right:1.8rem;border:#404040 solid 0.1rem;padding:1.4rem;background-color:white}#locales-dropdown button{display:block;font-family:var(--sans-serif,sans-serif);font-size:1.3rem;width:100%}#locales-dropdown button:hover{color:rgb(127, 127, 127)}#locales-dropdown>:first-child{padding-bottom:0.5rem}#locales-dropdown>:nth-child(2){padding-top:0.5rem}@media only screen and (min-width: 1400px){#navbar{position:relative;width:min(95%,116rem);left:50%;transform:translateX(-50%)}#nav{max-height:none;top:0;position:relative;float:right;width:fit-content;background-color:transparent;overflow:visible}#side-menu:checked~nav{padding-top:0}#menu li{float:left}#menu a:hover{background-color:transparent;color:rgb(127, 127, 127)}#menu a{padding:0.9rem;padding-top:1.9rem;padding-bottom:1.9rem}#hamb{display:none}#locales{position:relative;margin-right:1.8rem}#locales-img{top:0.9rem}#locales-dropdown{top:5,7rem}}</style>",t(this,{target:this.shadowRoot,props:n(this.attributes),customElement:!0},W,L,i,{},null),e&&e.target&&o(e.target,this,e.anchor)}}customElements.define("navbar-component",M);export{M as default};