import{f as e,u as s,a,c as r,h as o,E as t,P as n}from"./souav-BTAG2baT.js";import{u as i}from"./vendor-DDSBhOmW.js";import{ag as l,r as v,c as d,q as p,x as u,a4 as c,a3 as m,a5 as j,ad as f,v as x,bf as g,aW as h}from"./vendor-BXdGExd0.js";import{h as w}from"./vendor-BJZ6tUoe.js";import"./vendor-CDxkAdJH.js";import"./vendor-Cv8m7sE6.js";import"./vendor-BCo6x5W8.js";import"./vendor-bo_0oRCG.js";import"./vendor-CB_mu4eO.js";import"./vendor-Dos3PyFQ.js";import"./vendor-Dwl46Tfs.js";import"./vendor-DN37M9Hi.js";import"./vendor-BHR_E30J.js";import"./vendor-DzK633Zd.js";import"./vendor-CfyHAoLP.js";import"./vendor-Dm4oB1Pn.js";import"./vendor-DBhUxCDU.js";const k={key:0,class:"fixed inset-0 z-50 bg-[#0E0F12/30] flex items-center justify-center"},b={key:0,class:"absolute top-4 right-[10px] z-50 cursor-pointer"},y={class:"px-[10px] py-[2px] rounded-[15px] bg-black/50 backdrop-blur-sm"},I=l({__name:"index",emits:["ppw-close"],setup(l,{emit:I}){const C=e(),L=i(),S=s(),T=I,q=()=>{T("ppw-close")},z=v(!1),A=v(5);let B=null;const E=d(()=>{var e;return null==(e=S.signInAdvList)?void 0:e[0]}),U=()=>{B&&(clearInterval(B),B=null)},_=()=>{E.value.jumpScheme&&r.openUrlBlank(E.value.jumpScheme)},F=async()=>{if(!(A.value>0))try{const e=await o.finishTask({taskId:"sign-in"}),{code:s,msg:a,data:r}=e;if(q(),s==t.Success&&(null==r?void 0:r.reward)){L.reqTaskList(),C.refreshUserInfo();const e={reward:r.reward,title:"签到成功"};n.open("CoinReward",{props:e,transition:"slide-fade"})}else w(a)}catch(e){}};return p(()=>{const e=S.signInAdvList.length;z.value=!!e,z.value?(U(),A.value=E.value.duration||5,B=window.setInterval(()=>{A.value--,A.value<=0&&(U(),A.value=0)},1e3)):setTimeout(()=>{q()},1e3)}),u(()=>{U()}),(e,s)=>z.value?(h(),c("div",k,[j("div",{onClick:_,class:"w-full h-full cursor-pointer relative"},[f(a,{src:x(E).img},null,8,["src"])]),A.value>=0?(h(),c("div",b,[j("div",y,[j("span",{class:"text-[14px] text-white select-none",onClick:F},g(A.value>0?`${A.value}s后领取奖励`:"领取奖励")+" 关闭广告 ",1)])])):m("",!0)])):m("",!0)}});export{I as default};
