1import{f as h,j as i,k as l,l as n,I as p,C as m,B as _,y,O as f}from"./vue.esm-bundler-CNrQnXX7.min.js";import{s as g,a as v,b as A}from"./helpers-D8v1F4pF.min.js";const b={class:"account-dropdown"},C={key:0,class:"siu-remp-crm-auth__get-premium-link"},D=["href"],x={class:"siu-remp-crm-auth__account-settings-link"},L=["href"],S={key:1,id:"siu-show-purchased-articles",class:"siu-show-purchased-articles",tabindex:"0","aria-label":"Zakúpené Älánky"},M={key:2,id:"siu-show-saved-articles",class:"siu-show-saved-articles"},N={href:"/moje-clanky",tabindex:"0","aria-label":"Moje Älánky"},B={__name:"AccountDropdown",props:{purchasedArticlesCount:{type:Number,required:!0},savedArticlesCount:{type:Number,required:!0}},setup(o){const t=h(()=>`${window.localizeScriptArray.crmHost}/users/users/settings`),c=h(()=>window.localizeScriptArray.funnelLink||""),u=h(()=>c.value!==""&&!window.siu_remp_user_has_active_sub),k=a=>{const e=`${a}=`,r=document.cookie.split(";");for(let d=0;d<r.length;d++){let s=r[d];for(;s.charAt(0)===" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return s.substring(e.length,s.length)}return null},w=async()=>{const a=k("n_token");if(a)try{const e=await fetch(`${window.localizeScriptArray.crmHost}/api/v1/users/logout/`,{method:"POST",headers:{Authorization:`Bearer ${a}`}}).then(r=>r.json());e.status==="ok"?(g(),v(),A()):console.log(e.message)}catch(e){console.log(e)}window.location.reload(!0)};return(a,e)=>(i(),l("nav",b,[n("ul",null,[u.value?(i(),l("li",C,[n("a",{href:c.value,target:"_top",rel:"nofollow",tabindex:"0","aria-label":"ZÃskaÅ¥ PREMIUM"},"ZÃskaÅ¥ PREMIUM",8,D)])):p("",!0),n("li",x,[n("a",{href:t.value,target:"_top",tabindex:"0","aria-label":"Nastavenia"},"Nastavenia",8,L)]),o.purchasedArticlesCount>0?(i(),l("li",S," Zakúpené Älánky ("+m(o.purchasedArticlesCount)+") ",1)):p("",!0),o.savedArticlesCount>0?(i(),l("li",M,[n("a",N,"Moje Älánky ("+m(o.savedArticlesCount)+")",1)])):p("",!0),n("li",{class:"siu-remp-crm-auth__logout",tabindex:"0","aria-label":"OdhlásiÅ¥ sa",onClick:_(w,["prevent"]),onKeydown:y(w,["enter"])},e[0]||(e[0]=[n("span",null,"OdhlásiÅ¥ sa",-1)]),32)])]))}},I=o=>{const t=o.querySelector(".account-dropdown");if(t)t.classList.contains("account-dropdown--hidden")?t.classList.remove("account-dropdown--hidden"):t.classList.add("account-dropdown--hidden");else{const c=f({}).component("account-dropdown",B),u=o.querySelector(".siu-account-dropdown");c.mount(u)}},O=o=>{const t=o.querySelector(".account-dropdown");t&&t.classList.add("account-dropdown--hidden")};export{O as closeAccountDropdown,I as toggleAccountDropdown};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.