PageSourceSearch

https://global.redmagic.gg/cdn/shop/t/14/assets/customers-global-logout.min.js?v=21799034941405092511718696290

js redmagic.gg collected 2026-09-24 21:11:20 UTC 2,810 bytes, 2 lines download raw bytes

1"use strict";(()=>{var R=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var _=R((h,m)=>{(function(e,t){typeof h=="object"&&typeof m<"u"?m.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self,function(){var r=e.Cookies,f=e.Cookies=t();f.noConflict=function(){return e.Cookies=r,f}}())})(h,function(){"use strict";function e(i){for(var l=1;l<arguments.length;l++){var u=arguments[l];for(var d in u)i[d]=u[d]}return i}var t={read:function(i){return i.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(i){return encodeURIComponent(i).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function r(i,l){function u(o,c,n){if(!(typeof document>"u")){n=e({},l,n),typeof n.expires=="number"&&(n.expires=new Date(Date.now()+n.expires*864e5)),n.expires&&(n.expires=n.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),c=i.write(c,o);var a="";for(var s in n)!n[s]||(a+="; "+s,n[s]!==!0&&(a+="="+n[s].split(";")[0]));return document.cookie=o+"="+c+a}}function d(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var c=document.cookie?document.cookie.split("; "):[],n={},a=0;a<c.length;a++){var s=c[a].split("="),p=s.slice(1).join("=");p[0]==='"'&&(p=p.slice(1,-1));try{var g=t.read(s[0]);if(n[g]=i.read(p,g),o===g)break}catch{}}return o?n[o]:n}}return Object.create({set:u,get:d,remove:function(o,c){u(o,"",e({},c,{expires:-1}))},withAttributes:function(o){return r(this.converter,e({},this.attributes,o))},withConverter:function(o){return r(e({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(l)},converter:{value:Object.freeze(i)}})}var f=r(t,{path:"/"});return f})});var v=_();function k(){return v.get("login_token")}function w(){v.remove("login_token")}function C(){v.remove("mtp")}function y(){return new Promise((e,t)=>{fetch("/account/logout",{method:"GET",credentials:"same-origin"}).then(r=>{r.ok?e(r):t(new Error("Logout failed"))}).catch(r=>{t(r)})})}function U(){}U.prototype={constructor:U,init:function(){this.syncLoginStatus(),this.$logoutBtn=document.querySelectorAll(".as-logout-btn"),this.listenClick(),this.clearCookie()},syncLoginStatus(){if(document.querySelector("._as-login-flag")!=null&&document.body.dataset.template!=="page.redirect"){let e=k();Boolean(e)||y().then(()=>{location.reload()}).catch(()=>{window.location.href="/account/logout"})}},clearCookie:function(){window.self.location.href.includes("/account/logout")&&(w(),C(),localStorage.removeItem("user_identify_flag"))},listenClick:function(){this.$logoutBtn.length>0&&this.$logoutBtn.forEach(e=>{e.addEventListener("click",t=>{w(),C(),localStorage.removeItem("user_identify_flag"),window.location.href=e.dataset.href})})}};new U().init();})();
2/*! js-cookie v3.0.0 | MIT */

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.