1import{b as K,_ as J,a as W}from"./iCyLM4LW.js";import{v as O,f as g,a as r,b as s,H as R,h as e,p as y,t as b,d as j,au as B,av as S,aw as T,r as f,ax as F,K as H,ay as L,o as M,c as $,g as x,q as I,B as A,az as N,x as X,G as D,A as Y,aA as Z,e as P,w as ee,P as te,F as se,I as ie,a9 as V,J as E,n as oe}from"./zGN25SIG.js";import{C as le}from"./qF8I_tPr.js";import"./BmwrrxPv.js";import"./CTTOQ1fF.js";const ne={},ae={class:"relative w-full text-[#0A0425] text-[16px] font-bold py-3 rounded-full border border-[#ECCA77] bg-[linear-gradient(to_right,#966B2A_0%,#FCDD9A_50%,#8B6832_100%)]"},ue=["src"],re=["src"];function ce(a,v){return r(),g("button",ae,[s("img",{src:("getPublicUrl"in a?a.getPublicUrl:e(y))("/images/uquiz/bg-btn-l.svg"),class:"absolute w-[35%] h-full top-0 left-0 object-contain object-left-top"},null,8,ue),s("img",{src:("getPublicUrl"in a?a.getPublicUrl:e(y))("/images/uquiz/bg-btn-r.svg"),class:"absolute w-[35%] h-full bottom-0 right-0 object-contain object-left-bottom"},null,8,re),R(" "+b(a.$t("btn.loadMore")),1)])}const de=Object.assign(O(ne,[["render",ce]]),{__name:"UquizHistoryLoadMore"}),me=j({__name:"UquizHistoryDetailDialog",props:B({quiz:{}},{modelValue:{},modelModifiers:{}}),emits:B(["opened","confirm","cancel","claim"],["update:modelValue"]),setup(a,{emit:v}){const i=S(a,"modelValue"),c=v,l=T(document.body),{isRevealed:d,reveal:_,cancel:t,onReveal:m,onConfirm:w,onCancel:h}=L(),z=f(0),p=F(z,{duration:300,transition:[.75,0,.25,1]});H(i,o=>{o&&(_(),l.value=!0)});function C(){z.value=0,setTimeout(()=>{t(),i.value=!1,l.value=!1},300)}function n(){c("claim")}return M(()=>{m(()=>{z.value=1,c("opened")}),w(()=>{c("confirm"),i.value=!1}),h(()=>{c("cancel"),i.value=!1})}),(o,u)=>{const U=K;return r(),$(N,{to:"body"},[e(d)?(r(),g("div",{key:0,style:I({opacity:e(p)}),class:"fixed flex justify-center items-end top-0 right-0 h-screen w-screen bg-black bg-opacity-50",onClick:C},[s("div",{class:A([{"overflow-auto":e(p)===1},"flex w-screen max-w-[436px] max-h-screen"]),onClick:u[0]||(u[0]=k=>k.stopPropagation())},[o.quiz?(r(),$(U,{key:0,quiz:o.quiz,"is-history":"",class:A([e(z)&&e(p)>.2?"translate-y-0":"translate-y-full","transition-transform"]),onClose:C,onClaim:n},null,8,["quiz","class"])):x("",!0)],2)],4)):x("",!0)])}}}),fe=Object.assign(me,{__name:"UquizHistoryDetailDialog"}),ge=X("/images/uquiz/uquiz-title.svg"),pe=["src"],be={class:"flex justify-center items-center w-[48px]"},ve=["src"],_e=["src"],ze={class:"flex flex-col flex-1 pl-2"},ye={class:"text-[8px] text-[#FBDEB2]"},he={class:"text-[14px] text-[#FBDEB2] font-bold"},qe={class:"flex flex-1"},xe={class:"flex flex-1 flex-col"},we={class:"text-[12px] text-[#FBDEB2] font-thin"},Ce={class:"text-[12px] text-white font-thin"},Ue={class:"flex items-end w-[100px]"},$e=["src"],ke=j({__name:"UquizHistoryItem",props:{quiz:{}},emits:["action"],setup(a,{emit:v}){const i=v,c=D(()=>a.quiz.quizChoices.reduce((t,m)=>(t[m.type]=m,t),{})),l=D(()=>a.quiz.quizChoices.find(t=>t.isCorrectChoice)?._id===a.quiz.quizUserAnswer.quizChoice),d=D(()=>!!a.quiz.myReward),_=D(()=>a.quiz.myReward&&a.quiz.myReward.claimedAt);return(t,m)=>(r(),g("div",{class:A([{"bg-win":e(d)},"relative flex p-2 w-full mb-4 rounded-lg border border-[#555555] bg-default"])},[e(d)?(r(),g("img",{key:0,src:("getPublicUrl"in t?t.getPublicUrl:e(y))("/images/uquiz/icn-quiz-win.svg"),class:"absolute size-[40px] top-0 left-0"},null,8,pe)):x("",!0),s("div",be,[e(l)?(r(),g("img",{key:0,src:("getPublicUrl"in t?t.getPublicUrl:e(y))("/images/uquiz/icn-quiz-correct.svg"),class:"size-[32px] object-contain"},null,8,ve)):(r(),g("img",{key:1,src:("getPublicUrl"in t?t.getPublicUrl:e(y))("/images/uquiz/icn-quiz-incorrect.svg"),class:"size-[32px] object-contain"},null,8,_e))]),s("div",ze,[s("div",ye,b(t.quiz.leagueName),1),s("div",he,b(e(c).BLUE_TEAM?.name)+" vs "+b(e(c).RED_TEAM?.name),1),s("div",qe,[s("div",xe,[s("div",we,b(e(Y)(t.quiz.matchDate).format("D MMM HH:mm")),1),s("div",Ce,b(e(d)?t.$t("uquiz.history.win"):e(l)?t.$t("uquiz.history.correct"):t.$t("uquiz.history.lose")),1)]),s("div",Ue,[s("button",{class:"flex justify-center items-center w-full rounded-lg text-[#47361E] text-[12px] h-[26px] bg-btn",onClick:m[0]||(m[0]=w=>i("action"))},[e(d)?(r(),g("img",{key:0,src:("getPublicUrl"in t?t.getPublicUrl:e(y))("/images/uquiz/icn-quiz-redeem.svg"),class:"size-[12px] mr-1"},null,8,$e)):x("",!0),R(" "+b(e(d)?e(_)?t.$t("uquiz.history.btn.redeemed"):t.$t("uquiz.history.btn.redeem"):t.$t("uquiz.history.btn.view")),1)])])])])],2))}}),De=Object.assign(O(ke,[["__scopeId","data-v-7ffa270e"]]),{__name:"UquizHistoryItem"}),Pe={class:"relative flex flex-col items-center rounded-[12px] w-full h-full p-6 pt-0 bg-[linear-gradient(0deg,#171516_0%,#61615F_100%)]"},Be=["src"],je={class:"text-white text-[16px] font-semibold -mt-3 mb-2"},Ae={class:"text-[#E3BB72] text-[14px] text-center w-full mb-6"},Re={class:"flex w-full"},He=["src"],Me=["src"],Ve=j({__name:"UquizClaimSuccessDialog",props:B({amount:{}},{modelValue:{},modelModifiers:{}}),emits:B(["opened","confirm","cancel"],["update:modelValue"]),setup(a,{emit:v}){const i=S(a,"modelValue"),c=v,l=T(document.body),{isRevealed:d,reveal:_,confirm:t,cancel:m,onReveal:w,onConfirm:h,onCancel:z}=L(),p=f(0),C=F(p,{duration:300,transition:[.75,0,.25,1]});H(i,u=>{u&&(_(),l.value=!0)});function n(){p.value=0,setTimeout(()=>{t(),i.value=!1,l.value=!1},300)}function o(){p.value=0,setTimeout(()=>{m(),i.value=!1,l.value=!1},300)}return M(()=>{w(()=>{p.value=1,c("opened")}),h(()=>{c("confirm"),i.value=!1}),z(()=>{c("cancel"),i.value=!1})}),(u,U)=>(r(),$(N,{to:"body"},[e(d)?(r(),g("div",{key:0,style:I({opacity:e(C)}),class:"fixed flex justify-center items-center top-0 right-0 h-screen w-screen bg-black bg-opacity-50",onClick:o},[s("div",{class:"flex rounded-[13px] w-[calc(100vw-16px)] min-w-[300px] max-w-[386px] p-[1px] bg-[linear-gradient(135deg,rgba(247,199,151,0.3)_0%,#FBDEB2_50%,rgba(247,199,151,0.3)_100%)]",onClick:U[0]||(U[0]=k=>k.stopPropagation())},[s("div",Pe,[s("img",{src:("getPublicUrl"in u?u.getPublicUrl:e(y))("/images/uquiz/icn-quiz-redeem-ucoin.svg"),class:"size-[200px] object-contain -mt-[100px]"},null,8,Be),s("div",je,b(u.$t("uquiz.history.redeem.title")),1),s("div",Ae,b(u.$t("uquiz.history.redeem.description",{amount:u.amount})),1),s("div",Re,[s("button",{class:"relative w-full text-[#0A0425] text-[16px] font-bold py-3 rounded-2xl border border-[#
1ECCA77] bg-[linear-gradient(to_right,#966B2A_0%,#FCDD9A_50%,#8B6832_100%)]",onClick:n},[s("img",{src:("getPublicUrl"in u?u.getPublicUrl:e(y))("/images/uquiz/bg-btn-l.svg"),class:"absolute w-[35%] h-full top-0 left-0 object-contain object-left-top"},null,8,He),s("img",{src:("getPublicUrl"in u?u.getPublicUrl:e(y))("/images/uquiz/bg-btn-r.svg"),class:"absolute w-[35%] h-full bottom-0 right-0 object-contain object-left-bottom"},null,8,Me),R(" "+b(u.$t("btn.OK")),1)])])])])],4)):x("",!0)]))}}),Ee=Object.assign(Ve,{__name:"UquizClaimSuccessDialog"}),Oe={class:"bg-black"},Se={class:"flex flex-col p-4 min-h-[calc(100vh-179px)]"},Te={key:1,class:"flex justify-center"},Fe={class:"w-[200px]"},Je=j({__name:"history",setup(a){const v=Z(),i=f([]),c=f(!1),l=f(),d=f(-1),_=f(!1),t=f(1),m=f(50),w=f(0),h=f(!1);async function z(){const n=await E.uquizUserGetHistoryQuiz(t.value,m.value);n.succ?(i.value=[...i.value||[],...n.data?.rows||[]],w.value=n.data?.total||0):v.error(n.msg,{timeout:2e3})}async function p(n,o){c.value=!0,l.value=n,d.value=o}async function C(){if(_.value||(_.value=!0,!l.value||l.value.myReward.claimedAt))return;const n=await E.uquizUserClaimReward(l.value.myReward._id);if(n.succ){if(l.value&&(l.value.myReward=n.data?.reward),d.value>=0){const o=i.value[d.value];o&&(o.myReward=n.data?.reward)}await oe().refreshBalance(),h.value=!0}else v.error(n.msg,{timeout:2e3});_.value=!1}return H(t,()=>{z()}),M(()=>{z()}),(n,o)=>{const u=J,U=W,k=de,Q=fe;return r(),g("div",Oe,[P(le,{"menu-link":e(te).HOME},{title:ee(()=>o[3]||(o[3]=[s("img",{src:ge},null,-1)])),_:1},8,["menu-link"]),P(u,{"active-tab":"history"}),s("div",Se,[e(i)?.length===0?(r(),$(U,{key:0,title:n.$t("uquiz.history.empty.title"),description:n.$t("uquiz.history.empty.description")},null,8,["title","description"])):x("",!0),(r(!0),g(se,null,ie(e(i),(q,G)=>(r(),$(De,{key:q._id,quiz:q,onAction:Le=>p(q,G)},null,8,["quiz","onAction"]))),128)),e(i)&&e(i)?.length<e(w)?(r(),g("div",Te,[s("div",Fe,[P(k,{onClick:o[0]||(o[0]=q=>t.value++)})])])):x("",!0)]),P(Q,{modelValue:e(c),"onUpdate:modelValue":o[1]||(o[1]=q=>V(c)?c.value=q:null),quiz:e(l),onClaim:C},null,8,["modelValue","quiz"]),e(l)?.myReward?.data.amount?(r(),$(Ee,{key:0,modelValue:e(h),"onUpdate:modelValue":o[2]||(o[2]=q=>V(h)?h.value=q:null),amount:e(l)?.myReward.data.amount||0},null,8,["modelValue","amount"])):x("",!0)])}}});export{Je as default};
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.