(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))e(n);new MutationObserver(n=>{for(const s of n)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&e(i)}).observe(document,{childList:!0,subtree:!0});function r(n){const s={};return n.integrity&&(s.integrity=n.integrity),n.referrerpolicy&&(s.referrerPolicy=n.referrerpolicy),n.crossorigin==="use-credentials"?s.credentials="include":n.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function e(n){if(n.ep)return;n.ep=!0;const s=r(n);fetch(n.href,s)}})();const p={setItem:(t,o)=>{try{localStorage.setItem(t,o)}catch(r){throw r}},getItem:t=>{try{return localStorage.getItem(t)}catch(o){throw o}}},y={en:"en",de:"de",fr:"fr",es:"es",it:"it",pt:"pt",ko:"ko","zh-tw":"zh-TW","zh-cn":"zh-Hans",ja:"ja",ar:"ar",th:"th",id:"id",ru:"ru",tr:"tr"},m={en:"en",fr:"fr",es:"es",ru:"ru",de:"de",ar:"ar","zh-tw":"zh-HK",th:"th",vi:"vi",id:"id",pt:"pt-all",ko:"ko",ja:"ja",tr:"tr",ms:"ms"},L={en:"en",de:"de",fr:"fr",es:"es",pt:"pt",tr:"tr",ru:"ru",it:"it",ja:"ja",ko:"ko",vi:"vi",th:"th",ar:"ar",id:"id","zh-tw":"zh-Hant","zh-cn":"zh-Hans",ms:"en"},w=function(){var r;let t=(r=location.pathname.split("/")[1])==null?void 0:r.toLowerCase();t&&m[t]?p.setItem("lang",t):t="";const o=(t||p.getItem("lang")||N()||"en").toLowerCase();return m[o]?o:"en"};function N(){let t=window.navigator.language;return t=t.substring(0,2),t==="zh"?"zh-tw":t}const S=w(),A=m[w()]||"en",a=(()=>{const t=new URLSearchParams(location.search);return window.Cmssdk.ENV==="test"&&t.get("env")==="test"?"test":"prod"})(),f="30029",k="10003",T="https://sg-community.playerinfinite.com",v="official_news_list",P="",g=t=>["dev","test"].includes(t)?P:T,M=t=>["dev","test"].includes(t)?k:f,c="29158",z="188938070",_="global",b="sg",H="b8828b216fcc56910b17d4b8d3e1838f",j=a!=="prod"?["DF-Home-Subscribe"]:["web"],x="https://forms.gle/ZrwxWgVkpsdsQEL46";window.Cmssdk.EnvController.getInstance().env="prod";let l="",d="";const C=A,G=function(){return l||(l=window.Cmssdk.initSdks({cms_config:{cms_areaid:_,cms_lang:C,cms_gameid:M(a),custom_cms_url:g(a)}}).cms_helper,l)},W=function(){return d||(d=new window.Cmssdk.initSdks({cms_config:{cms_areaid:_,cms_gameid:f,cms_lang:C,intl_gameid:c,custom_cms_url:g(a)}}).cms_helper,d)},U=window.Cmssdk.isMobile,F=window.Cmssdk.isEmail,V=new window.Cmssdk.Register({lang:L[S]||"en",area_id:_,cms_gameid:f,source_type:"pc_web",intl_game_id:c,host:g(a),useSmartlink:!0,custom_cms_url:g(a)}),K=new window.Cmssdk.IntlLogin({env:b,gameID:c,appID:H,config:{isMobile:window.Cmssdk.isMobile(),langType:y[S]||"en",renderMode:"modal",loginWithCode:{enable:!0,registerType:"auto"},procedureSwitch:{region:!0,adultStatus:!0,agreement:!0,registerPassword:"required"}}}),q=new window.Cmssdk.AccountHelper({game_id:c,area_id:b}),u=G();function O(){let t="";return/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)?t="IOS":/(Android)/i.test(navigator.userAgent)?t="Android":/macintosh|mac os x/i.test(navigator.userAgent)?t="Mac":t="PC",t}function E(t={}){return JSON.stringify(Object.assign({lang:A,url:location.href,client_type:O(),refer_url:document.referrer},t))}function I(t){const o=r=>r!=null;return Object.keys(t).forEach(r=>{o(t[r])||delete t[r]}),t}function R(t){var n,s;const{events:o,label:r,category:e}=t;try{r||e?(n=window.gtag)==null||n.call(window,"event",o,I({event_label:r,event_category:e})):(s=window.gtag)==null||s.call(window,"event",o)}catch(i){console.error(i)}}function D(t){return u.tlogReport({action:t.action,sub_action:t.sub_action,original_game_id:c,ext_content:E(t.ext_content)})}function h(t){const o={action:t.events,sub_action:"cm_click",ext_content:I({...t==null?void 0:t.optional_params,event_label:t==null?void 0:t.label,event_category:t==null?void 0:t.category})};return Promise.all([R(t),D(o)])}function B(t,o="cm_click",r={}){var e;(e=window.gtag)==null||e.call(window,"event",t),u==null||u.tlogReport({action:t,sub_action:o,original_game_id:c,ext_content:E(r)})}function J(t,o){try{const r=e=>{e==null||e.addEventListener("click",n=>{if((e==null?void 0:e.href.indexOf("javascript:"))===-1&&n.stopPropagation(),(e==null?void 0:e.tagName.toLowerCase())==="a"&&e.target!=="_blank"&&(e==null?void 0:e.href.indexOf("javascript:"))===-1){n.preventDefault(),n.stopPropagation();const s=e,{href:i}=s;h(o(e)).finally(()=>{location.href=i})}else h(o(e))})};if(typeof t=="string"){const e=document.querySelectorAll(t);e==null||e.forEach(n=>{r(n)})}else r(t)}catch(r){console.error(r)}}function Q(t){var n;const o=new URL(t),r=(n=o==null?void 0:o.hostname)==null?void 0:n.split("."),e=r[0]==="www"?r.slice(1):r;return e[e.length-2]||e[0]}export{m as C,a as E,c as I,x as N,S as P,L as S,W as a,h as b,B as c,j as d,V as e,z as f,G as g,F as h,q as i,J as j,U as k,K as l,Q as m,v as n,p as s};