1import{r as m}from"./react-0e2a0c96.js";import{bR as N,bS as U,bT as C,bU as w,q as H,h as L,C as V,d as Y,aV as y,H as B,bV as h,x as W,bW as E}from"./index-878ce38c.js";var $=Object.prototype,x=$.hasOwnProperty,G=N(function(e,c,n){x.call(e,n)?e[n].push(c):U(e,n,[c])});const j=G;function q(e,c){var n={};return c=C(c),w(e,function(d,r,b){U(n,r,c(d,r,b))}),n}var A=(e=>(e[e.LESS_IS_MORE=1]="LESS_IS_MORE",e[e.THREE_IN_ONE=2]="THREE_IN_ONE",e[e.MYSTERY_TOPUP=3]="MYSTERY_TOPUP",e[e.NEW_USER_ATTAINMENT=4]="NEW_USER_ATTAINMENT",e[e.CUMULATIVE_TOPUP_SITE=5]="CUMULATIVE_TOPUP_SITE",e[e.GACHA=6]="GACHA",e))(A||{});const z=e=>{const{region:c,lang:n}=H(),d=L(),r=d.role,b=V("md"),i=m.useMemo(()=>{const s=(r==null?void 0:r.event_img)||[],t=E();return s.filter(o=>t<o.end_time)},[r]),l=m.useMemo(()=>q(j(i,"event_type"),s=>s[0]),[i]),{init:I}=Y(),{data:p}=y(I&&!d.isLoading&&!r&&e?"/shop/event/ongoing_events?app_id=".concat(e.app_id,"®ion=").concat(c):null,async s=>{const t=await B.get(s),{events:o}=t.data,_=E();return o.filter(a=>_<a.end_time).map(a=>({...a,mshop_site:h(a.event_type,e==null?void 0:e.app_id)}))}),P=m.useMemo(()=>i.map(s=>{var t,o,_,a,u,g;return{eventId:s.event_id,img:b?(_=(o=(t=s.event_images_by_language)==null?void 0:t[n])==null?void 0:o.banner_pc)!=null?_:s.event_banner_pc:(g=(u=(a=s.event_images_by_language)==null?void 0:a[n])==null?void 0:u.banner_mb)!=null?g:s.event_banner_mb,href:s.mshop_site}}),[i,b,n]),T=m.useMemo(()=>(r?i:p!=null?p:[]).filter(t=>t.special_event).map(t=>{var _,a,u;const o=t.special_event;return{eventId:t.event_id,description:o.description[n],img:(u=(a=(_=t.event_images_by_language)==null?void 0:_[n])==null?void 0:a.special_ev)!=null?u:o.img_revamp,href:t.mshop_site,endTime:o.show_end_time?t.end_time:void 0}}),[r,i,p,n]),[v,M]=W("closed_events",{}),f=m.useMemo(()=>{var _,a,u;const s=g=>"".concat(g.event_id),t=E(),o=i.find(g=>{const S=v[s(g)];return!S||t>S+1800});if(o)return{eventId:o.event_id,type:"image",redirectUrl:o.mshop_site,url:(u=(a=(_=o.event_images_by_language)==null?void 0:_[n])==null?void 0:a.popup_pc)!=null?u:o.event_popup,target:"_blank",onClose:()=>M({...v,[s(o)]:t})}},[i,n,v,M]),O=m.useMemo(()=>{const s=l[A.MYSTERY_TOPUP];return{bonusPct:(s==null?void 0:s.percentage_bonus)||0}},[l]),R=m.useMemo(()=>{var t;const s=l[A.GACHA];return s&&{site:h(s.event_type,e==null?void 0:e.app_id),message:(t=s.gacha_messages)==null?void 0:t[n]}},[l,e,n]);return{data:i,byType:l,banners:P,special:T,onloadBillboard:f,mysteryTopup:O,gacha:R}};export{A as E,z as u};
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.