import{b as r}from"./index-3fevySbJ.js";import{i as h}from"./index-kIfVvmeP.js";const c=["en"];function n(t,s){const a=h("aliases");if(t.query.locale&&c.includes(t.query.locale))s({path:`en${t.path}`});else{const e=t.fullPath.slice(1).split("/"),l=e[1]||e[0]||"",i=a?.reverseEnDictionary[l],o=a?.enDictionary[l];c.includes(e[0]||"")?a&&i?s({path:`/${e[0]}/${i+(e.length>2?`/${e.slice(2).join("/")}`:"")}`}):s():a&&o?s({path:`/${o}${e.length>2?`/${e.slice(2).join("/")}`:""}`}):s()}}const u=r(({router:t})=>{t.beforeEach((s,a,e)=>{s.matched.some(l=>l.meta.requiresAuth)&&localStorage.getItem("jwt")==null?e({name:"login"}):n(s,e)})});export{u as default};