account={init:function(){function a(n){let t=n+"=",r=decodeURIComponent(document.cookie),i=r.split(";");for(let n=0;n<i.length;n++){let r=i[n];while(r.charAt(0)==" ")r=r.substring(1);if(r.indexOf(t)==0)return r.substring(t.length,r.length)}return""}var e=document.getElementsByClassName("gg-config")[0],c=e.getAttribute("data-client"),l=e.getAttribute("data-login_uri"),s,f,t,i,h,r,n;let u=a("ui");if(u!=""&&u!="null"){var o=JSON.parse(u),t='<a href="javascript:;" class="gray-51 sign-out-btn lh-60 ml50" title="vtc.vn"> <img class="avatar-login loading" src="{{src}}" data-was-processed="true">{{name}}<\/a><a class="gray-51 cursor sign-out-btn"><\/a><div class="sign-out-txt hide" style="border: solid 1px #e5e5e5;position: absolute;top: 60px;/* right: 0; */right: 0;background: white;text-align:center;z-index: 1000;width: 250px;" class="login-div"> <i class="icon-up-dir" style=" position: absolute; top: -3px; right: 0px; font-size: 19px; color: #21252985; "><\/i> <div class="pd10 tl clearfix bold"> <div><div class="tc pb5" style="margin: 0 auto;display: table;"> <img src="{{src}}" alt="vtc.vn" class="h45 w45 radius-circle overflow img-use loading mr10" data-was-processed="true" style="display: inline;"> <a class=" lh-45 blue-vne " style=" vertical-align: text-bottom;">{{name}}<\/a> <\/div><a class="w-full gray-51 lh-45 ellipsis tc bg-gray-e5" href="/User/Logout?relUrl={{url}}" title="Đăng xuất">Đăng xuất<\/a><\/div><\/div> <\/div>',n=document.createElement("div"),v=o.Name,y=o.Avatar;t=t.replaceAll("{{name}}",v).replaceAll("{{src}}",y).replaceAll("{{url}}",encodeURIComponent(location.href));n.innerHTML=t;i=document.getElementsByClassName("login-div")[0];i.appendChild(n);s=document.getElementsByClassName("sign-out-btn")[0];f=document.getElementsByClassName("sign-out-txt")[0];s.addEventListener("click",function(){f.classList.toggle("hide")},!1);document.addEventListener("click",function(n){i.contains(n.target)||f.classList.add("hide")})}else t='<div id="" class="myvtc_taskbar myvtc_login_button fr" style="display:flex"> <a href="javascript:;" class="gray-51 login-click lh-60 ml50" title="Đăng nhập"> <svg id="User" viewBox="0 0 32 32" style="height: 22px; margin-bottom: -5px; margin-right: 10px; fill: #bdbdbd;"> <path d="M16 16c4.418 0 8-3.582 8-8s-3.582-8-8-8c-4.418 0-8 3.582-8 8s3.582 8 8 8z"><\/path> <path d="M32 26.4c0.003-0.766-0.214-1.516-0.627-2.161s-1.002-1.157-1.699-1.475c-4.312-1.876-8.972-2.818-13.674-2.764-4.702-0.054-9.362 0.888-13.674 2.764-0.696 0.318-1.286 0.83-1.699 1.475s-0.63 1.395-0.627 2.161v5.6h32v-5.6z"><\/path> <\/svg>Đăng nhập <\/a> <\/div>',n=document.createElement("div"),n.innerHTML=t,i=document.getElementsByClassName("login-div")[0],i.appendChild(n.firstChild),h=document.getElementsByClassName("login-click")[0],h.addEventListener("click",function(){var n=document.createElement("div"),t,i,r;n.classList.add("popup-border");t=document.createElement("div");t.classList.add("popup-body","popup-middle");t.innerHTML='<a class="close-popup-login cursor abs24" title="Đóng popup"><i class="icon-cancel-circle white font22"><\/i><\/a>';n.innerHTML="<div class='popup-overlay'><\/div>";i=document.createElement("iframe");i.classList.add("w600","h270","nobor");i.setAttribute("src","/dang-nhap?rel="+encodeURIComponent(location.href));t.append(i);n.append(t);document.body.appendChild(n);r=document.getElementsByClassName("close-popup-login")[0];r.addEventListener("click",function(){n.remove()},!1)},!1),r='<div id="g_id_onload" data-client_id="{{client}}" data-login_uri="{{login_uri}}" data-your_own_param_1_to_login="{{url}}"> <\/div>',r=r.replaceAll("{{client}}",c).replaceAll("{{url}}",encodeURIComponent(location.href)).replaceAll("{{login_uri}}",l),n=document.createElement("div"),n.innerHTML=r,document.getElementById("wrapper").appendChild(n.firstChild),account.addScripts("https://accounts.google.com/gsi/client",!1)},addScripts:function(n,t,i,r){var u=document.createElement("script");u.type=void 0===r?"text/javascript":r;u.src=n;u.async=t;u.onload=function(){u.setAttribute("loaded","loaded");"function"==typeof i&&i()};document.getElementsByTagName("head")[0].append(u)}};account.init()