import{W as E,L as F,_ as N,k as z,P as V,o as $,a as Y,c as l,l as d,ac as Z,b as i,t as q,q as x,v as k,D as p,Y as H,m as b,r as n,an as J,S as L,u as K,J as W,j as u,F as O,x as Q,n as X,y as ee}from"./index-CIAVq8iD-1776148658686.js";import{c as re}from"./appConnector-B5Pbaops-1776148658686.js";import{g as te}from"./imagePaths-Bi1Bwe4Z-1776148658686.js";import{p as oe}from"./imagePreloader-C_QM-Nv8-1776148658686.js";import{a as ae}from"./toast-aIWCznBB-1776148658686.js";import{B as R}from"./BackgroundLayer-DJYogygx-1776148658686.js";import{i as se}from"./itemCenter-DveKthYv-1776148658686.js";import{m as ie}from"./MaskLayer-CMaJd7Gb-1776148658686.js";const ne=async g=>{try{return await F(`/task/check/in/list/award?activityType=${g}`)}catch(t){throw console.error("Failed to get login rewards:",t),console.error("error:"+t.response.errorMsg),t}},ce=async g=>{try{return await E("/task/check/in/receive",g)}catch(t){throw console.error("Failed to post receive login reward:",t),console.error("error:"+t.response.errorMsg),t}},le={class:"fullPage"},de={key:0,class:"loading-container"},ue={style:{width:"100vw","min-height":"100vh",overflow:"hidden",position:"relative"}},ge={style:{position:"relative","z-index":"2",margin:"85vw 0 10vw"}},ve=["src"],me=["src"],pe={__name:"index",setup(g){const t=n(!0),{t:I,locale:ye}=z();K(),W();const S=V(),A=L(()=>S.selectedLang?.type||"en"),r=e=>te("Activities/LoginReward/",e),a=e=>A.value==="ar"?`${e}_ar`:e,v=n({}),s=n(0),y=n(0),m=n(!1),B=e=>{if(e>s.value-1)return e<6?r("itemLock"):r("itemBigLock");if(e<s.value-1)return e<6?r(a("itemReceived")):r(a("itemBigReceived"));if(e==s.value-1&&m.value)return e<6?r(a("itemReceived")):r(a("itemBigReceived"))},w=n(!1),C=L(()=>w.value),f=(e=!0)=>{w.value=!1},D=e=>[{gridArea:"1/1"},{gridArea:"1/2"},{gridArea:"1/3"},{gridArea:"2/1"},{gridArea:"2/2"},{gridArea:"2/3"},{gridRow:"3",gridColumn:"1 / -1"}][e],h=async()=>{const e=await ne("DAILY_REGISTER_AZIZI");e.status&&e.body&&(v.value=e.body?.rewards?.[0]||{},y.value=e.body?.days||0,s.value=e.body?.currentDay||0,console.log("currentDay.value:",s.value),y.value==s.value?m.value=!0:m.value=!1)},P=async()=>{let e={id:v.value.rule.id,resourceGroupId:v.value.rule.resourceGroupId,dailyKey:"1"};try{const o=await ce(e);o.status&&o.body&&h()}catch(o){ae(o.errorMsg)}},G=async()=>{await Promise.all([h()])},T=async()=>{const e=[r("bg1"),r("bg2"),r("bg3"),r("rewards"),r(a("ruleInfo")),r("itemLock"),r("itemBigLock"),r(a("itemReceived")),r(a("itemBigReceived"))];await oe(e)},U=async()=>{try{await Promise.all([G(),T()])}catch(e){console.error("预加载过程中发生错误:",e)}finally{t.value=!1}},M=async()=>{await re(()=>{U()})};return $(()=>{M()}),Y(()=>{}),(e,o)=>{const j=Z,_=J("smart-img");return u(),l("div",le,[t.value?(u(),l("div",de,[d(R,{backgroundImages:[r("bg1"),r("bg2"),r("bg3")]},null,8,["backgroundImages"]),d(j),i("p",null,q(x(I)("loading"))+"...",1)])):k("",!0),p(i("div",ue,[d(R,{backgroundImages:[r("bg1"),r("bg2"),r("bg3")]},null,8,["backgroundImages"]),i("div",ge,[d(se,{style:{"min-height":"136.33vw"},imgUrl:r("rewards"),contentStyle:`
              padding: 21.5vw 6.5vw 12vw;
          
              display: grid;
              grid-template-columns: repeat(3, 1fr);
              grid-template-rows: repeat(3, 1fr);
              gap: 10.5vw 2.5vw;
              
              direction: ltr;
              `},{default:b(()=>[(u(!0),l(O,null,Q(v.value?.propsGroup?.activityRewardProps,(we,c)=>(u(),l("div",{key:c,style:X([{"align-self":"stretch",position:"relative"},[D(c)]]),onClick:o[1]||(o[1]=fe=>P())},[c!=s.value-1||c==s.value-1&&m.value?(u(),l("div",{key:0,style:{position:"absolute",inset:"0","z-index":"2"},onClick:o[0]||(o[0]=ee(()=>{},["stop"]))},[p(i("img",{src:B(c),alt:"",style:{width:"100%",height:"100%",display:"block","object-fit":"cover"}},null,8,ve),[[_]])])):k("",!0)],4))),128))]),_:1},8,["imgUrl"]),p(i("img",{src:r(a("ruleInfo")),alt:"",style:{width:"100%",display:"block","object-fit":"cover"}},null,8,me),[[_]])]),d(ie,{maskLayerShow:C.value,onClick:f},{default:b(()=>[i("div",{style:{width:"100vw",height:"100vh",display:"flex","justify-content":"center","align-items":"center"},onClick:f})]),_:1},8,["maskLayerShow"])],512),[[H,!t.value]])])}}},Ae=N(pe,[["__scopeId","data-v-92ee615b"]]);export{Ae as default};
