1// cache: 2026-10-04 02:59:14 2let md = new MobileDetect(window.navigator.userAgent); 3let check_open_line = JSON.stringify(window.navigator.userAgent); 4if(check_open_line.indexOf('Line') > -1){ 5 let url = window.location.href; 6 if(url.indexOf('openExternalBrowser') == -1){ 7 (url.indexOf('?') > -1) ? url += '&openExternalBrowser=1' : url += '?openExternalBrowser=1'; 8 window.location.href = url; 9 } 10 11} 12var refs = ['member_ref', 'zean_ref', 'partner_ref']; 13var was_connected = false; 14 15window.sk = io.connect('/front', { 16 secure: true, 17 transports: ['websocket'], 18 upgrade: false, 19 reconnectionAttempts: 300, 20 reconnectionDelay: 1000, 21 reconnectionDelayMax: 5000, 22 randomizationFactor: 0.5, 23 query: {path: location.pathname}, 24}); 25sk 26 .on('connect', function () { 27 console.log('connected');//à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸à¹à¸à¸´à¸à¹à¸§à¸à¸£à¹ 28 $('.status-text').text(" connected"); 29 was_connected = true; 30 }) 31 .on('disconnect', function () { 32 console.log(' disconnected'); 33 $('.status-text').text(" disconnected"); 34 // toast.secondary('หลุà¸à¸à¸²à¸£à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸à¹à¸à¸´à¸à¹à¸§à¸à¸£à¹'); 35 // if (location.pathname !== '/login') { 36 // _conn = setTimeout(()=>location.replace('/login'), 6000); 37 // } 38 }) 39 .on('toast', (data)=> { 40 toast.info(data.msg, data.title) 41 }) 42 .on('modal', dt => { 43 Swal.fire(dt).then(() => { 44 if (dt.goto) return location.replace(dt.goto); 45 if (dt.eval) return eval(dt.eval); 46 if (dt.emit) return sk.emit(dt.emit, dt.emit_value); 47 }); 48 //alert(dt.title+dt.msg); 49 }) 50 .on('prompt', dt => { 51 Swal.fire({ 52 title: dt.title, 53 text: dt.msg, 54 type: dt.type, 55 // input: 'text', 56 //inputValue: inputValue, 57 showCancelButton: true, 58 }).then(r=>{ 59 console.log('eee', r); 60 if (!r.value) return; 61 if (dt.emit) return sk.emit(dt.emit, dt.emit_value); 62 }); 63 }) 64 .on('eval', dt => { 65 eval(dt); 66 }) 67; 68 69 70//à¸à¸³ instance à¹à¸à¹à¸à¸à¹à¸à¹à¸à¸ mixin สำหรัà¸à¸à¸¸à¸à¹ component 71window._V = { 72 el: '#app', 73 data() { 74 return { 75 socket: null, 76 sch: new URLSearchParams(window.location.search), 77 easy: null, 78 logged: null, 79 loginFm: {username: '', password: '', captcha: ''}, 80 user: {}, 81 user_return: null, 82 el: { 83 loginModal: null, 84 }, 85 device: { is_mobile: null, is_ios: null }, 86 loading: false, 87 version_control: HASH, 88 force_target:false, 89 game_theme:{ 90 type:1 91 }, 92 redirect_hold: false, 93 slot_formular:false, 94 mobile_menu_active:false, 95 language: { //obj for translate setup 96 isActive: false, 97 default:'', 98 btn_active:{ 99 th:false, 100 en:false, 101 zh:false, 102 my:false, 103 ml:false, 104 vi:false, 105 km:false 106 }, 107 translate:[] 108 } 109 } 110 }, 111 methods: { 112 async logout(force = false) { 113 if (!force) { 114 let r = await modal.confirm('', 'à¸à¸à¸à¸à¸²à¸à¸£à¸°à¸à¸'); 115 if (!r) return; 116 } 117 await this.easy.callApi('logout'); 118 location.replace('/'); // stay on the current domain (multi-domain: don't bounce to a fixed site_url) 119 }, 120 saveRef(){ 121 let $this = this; 122 let schObj = Object.fromEntries($this.sch); 123 const contain = Object.keys(schObj).some(o => { 124 return refs.includes(o); 125 }); 126 refs.forEach(o=>{ 127 if (contain) localStorage.removeItem(o); 128 if ($this.sch.has(o)) localStorage.setItem(o, $this.sch.get(o)); 129 }) 130 }, 131 refClear() {
132 refs.forEach(o=>{ 133 localStorage.removeItem(o); 134 }) 135 }, 136 openSideMenu(){ 137 console.log('open side menu!'); 138 this.mobile_menu_active = !this.mobile_menu_active; 139 }, 140 showModalChangeLang(){ 141 142 }, 143 saveParamCurrentLanguage(l = 'th'){ 144 let url = new URL(window.location); 145 url.searchParams.set('lang', l); 146 window.history.pushState({}, '', url); 147 }, 148 changeLanguage(lang = 'th'){ 149 // this.language.default = lang; 150 // Cookies.set('lang_default',lang, { expires: 1 }) 151 // this.saveParamCurrentLanguage(lang); 152 // window.location.reload(); 153 }, 154 async setupTranslate(){ 155 /*get config translate 156 - default languages 157 - active languages 158 */ 159 let res = await post('/api/language'); 160 if(!res.success) return console.log('ERR CONF TRANSLATE :',res.data); 161 if(res.success) { 162 let langDefault = Cookies.get('lang_default'); // check default language 163 if(!langDefault) Cookies.set('lang_default',res.data.default , { expires: 1 }); // if not found save default to cookie 164 165 this.language = res.data; 166 this.language.isActive = Object.values(this.language.btn_active).some(value => value === true); 167 this.language.default = Cookies.get('lang_default'); 168 if(res.data.session) this.language.default = res.data.session; 169 } 170 } 171 }, 172 computed:{ 173 isLogged(){ 174 return (this.logged !== null && (typeof this.logged == 'boolean') && this.logged); 175 }, 176 cntNotifyUnread(){ 177 if(!this.notify.data) { 178 return 0; 179 }else{ 180 return (this.notify.data).filter(i => i.saw == 0).length; 181 } 182 }, 183 getBankNameByBankId(){ 184 if(this.user.bank_id == 0) return '-'; 185 if(!this.user.bank_name) return '' 186 return this.user.bank_name; 187 } 188 }, 189 watch: {}, 190 beforeMount(){ 191 console.log('index.js beforeMount'); 192 }, 193 mounted() { 194 console.log('index.js vue mounted'); 195 }, 196 created(){ 197 let ua = navigator.userAgent.toLowerCase(); 198 this.isSafari = ua.indexOf('safari') > -1 ? ua.indexOf('chrome') == -1 : false; 199 200 let md = new MobileDetect(window.navigator.userAgent); 201 this.device = {is_mobile: md.mobile(), is_ios: md.is('iOS') || md.versionStr('iOS')}; 202 let $this = this; 203 // HOST = '{[ _CONFIG.api_host ]}'; <-- มาà¸à¸²à¸ views/_partial/the_script.twig 204 // this.easy = easyApi(HOST, { push_notify_service: true }); 205 // instance easyApi <-- à¸à¸µà¹à¸¡à¸²à¸à¸²à¸ script url "_CONFIG.api_host/easysv.js?v=.... " 206 //<script src="{[ _CONFIG.api_host ]}/easysv.js?v={[hash]}"></script> 207 // à¸à¸°à¸à¸¢à¸¹à¹à¹à¸à¹à¸à¸¥à¹ _layout.twig à¸à¸à¸à¸à¸¸à¸ theme line 129 208 // à¹à¸à¹à¸ à¹à¸ script à¸à¸²à¸à¸à¸°à¸ªà¸£à¹à¸²à¸ window.easyApi = {...} 209 210 this.easy = easyApi(HOST, { push_notify_service: true }); 211 window.ez = this.easy; 212 console.log('app mounted'); 213 this.easy 214 .on('connect', dt => { 215 $this.connected = true; 216 $this.loading = false; 217 }) 218 .on('disconnect', dt => { 219 $this.connected = false; 220 $this.loading = true; 221 }) 222 .on('ready', ()=>{ 223 console.log('READY'); 224 }) 225 .on('error', dt => { 226 227 }) 228 .on('login_status', async (logged) => { 229 $this.logged = logged; 230 // console.log('login status', logged); 231 // console.log('this.is_logout' , this.is_logout); 232 // console.log('this.redirect_hold',this.redirect_hold); 233 if(this.is_logout) return await $this.easy.callApi('logout'); 234 if (this.redirect_hold) return; 235 236 if (logged && location.pathname !== '/member') { 237 console.log('go member'); 238 location.replace('/member'); 239 } 240 if(logged) { 241 if(window.location.pathname === '/promotion') return window.location.href = '/member#/promotion'; 242 if (['/','/login','/register'].includes(window.location.pathname)) return window.location.href = '/member#'; 243 if (['/article', '/login', '/register'].some(path =>
243 window.location.pathname.startsWith(path))) { 244 $('#auth-wrapper').css('display','none'); 245 } 246 } 247 }) 248 .on('kick', async (data) => { 249 /* 250 à¹à¸¡à¸·à¹à¸ Server สัà¹à¸à¹à¸à¸°à¸¢à¸¹à¸ªà¸à¸à¸ หà¸à¹à¸²à¸à¹à¸²à¸à¸à¹à¸à¸à¸à¸³à¸à¸²à¸£à¸¥à¸ session à¸à¸à¸à¸¢à¸¹à¸ªà¸à¸´à¹à¸ 251 dt: {customer_id, type, title, text} 252 */ 253 return await $this.easy.callApi('logout'); 254 }) 255 .on('account_created', (data) => { 256 /* 257 à¹à¸¡à¸·à¹à¸ Gen ยูส game platform สำà¹à¸£à¹à¸ (à¸à¸²à¸à¹à¸£à¸) â session ยัà¸à¹à¸à¹à¹à¸à¹ à¹à¸à¹ reload à¹à¸à¸·à¹à¸à¸£à¸±à¸ mm_user à¹à¸«à¸¡à¹ 258 à¹à¸¡à¹à¸à¹à¸à¸ logout à¹à¸à¸£à¸²à¸° server à¹à¸¡à¹à¹à¸à¹à¸¥à¸ session 259 */ 260 location.reload(); 261 }) 262 .on('chat_response', ({customer_id, data}) => { 263 264 }) 265 .on('customer_data', data => { 266 $this.user = data; 267 $this.user.registerTime = humantime.full_th(data.created_at,true); 268 }) 269 .on('credit_push', dt => { 270 console.log('credit_push ! -->', dt); 271 if (!dt.success) return; 272 $this.credit = dt.data['total_credit']; 273 $this.latestDateUpdateCredit = moment().format('HH:mm:ss DD/MM/YYYY') 274 }) 275 .on('customer_req_info', dt => { 276 console.log('cus return !!!', dt); 277 if (dt.type === 'LOSS') $this.user_return = dt.success ? dt.data : dt.data; 278 }) 279 ; 280 281 setTimeout(()=>{ 282 (this.easy).canNotify().then((res)=>{ 283 if(res.success){ 284 //SHOW OUR NOTIFY 285 $('.notify-popup-wrapper').addClass('active'); 286 }else{ 287 288 } 289 }); 290 },1200); 291 292 $(document).on('click','.allow-notify',()=>{ 293 (this.easy).reqNotify().then((result)=>{}); 294 }); 295 296 this.saveRef(); 297 this.setupTranslate(); 298 } 299}; 300 301$(function() { 302 $(document).on('click','.close-notify,.not-allow-notify,.allow-notify',()=>{ 303 $('.notify-popup-wrapper').removeClass('active'); 304 }); 305});
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.