1import b from"./CUsQ5_4I.js";import k from"./C666d358.js";import y from"./DHu45RgR.js";import C from"./DCEUJu9Z.js";import T from"./C9yiaWcE.js";import{_ as S,c as d,j as x,a as n,b as w,w as _,e as c,t as l,d as f,F as I,n as R,Y as A,A as E,o as m}from"./C_VzGqEg.js";import{u as v}from"./SLKFLf4j.js";import{s as D}from"./CclBFLue.js";import"./DWfGYNrX.js";import"./YpzxG479.js";import"./NUoIgR6R.js";import"./DrwGJLjZ.js";import"./BDVHwxPm.js";import"./BHKnQFBo.js";import"./C-9dbQSY.js";import"./C4fTG6EF.js";import"./CIfc6IQW.js";import"./BSy4JHtP.js";import"./DKeVZpFc.js";import"./DY4SgOtO.js";import"./BA3S9Qb4.js";import"./CkEu89z3.js";import"./B3iim-KL.js";import"./BXUykJ2C.js";import"./Chyz3EDp.js";import"./2h_uk5DF.js";import"./8JGrCZUO.js";import"./Bw2cPcki.js";import"./BDmGCnhJ.js";import"./BuQBOjcE.js";import"./s3_Otaqs.js";import"./B-yGqZyG.js";import"./LfmN3RZR.js";import"./CY0PcdZl.js";import"./ZwuLzPRm.js";import"./BjYxkQw3.js";import"./Dj2vd1FS.js";import"./Cz7YsKok.js";import"./B0hBdtTj.js";import"./CqXCemgF.js";import"./DLPSkQwF.js";import"./BEsDnUJP.js";import"./BXbTEqmD.js";import"./JB-VHAAP.js";import"./C1G0POQs.js";import"./Bc1rArTd.js";import"./alWqIy3s.js";import"./Crr0GwaG.js";import"./XKaySTwn.js";import"./CtcVRfPe.js";import"./BmVA1Fhd.js";import"./B5UfoBF-.js";import"./C9R0TS7U.js";import"./BXGXhy4c.js";import"./BFCiwhB7.js";import"./aOjMXEfI.js";import"./BoBHCbwg.js";import"./GmToSYe4.js";import"./qd73kTeZ.js";import"./Bqsy2Yht.js";import"./B8KuNCeR.js";import"./CEvt6g13.js";import"./C7KChRbo.js";import"./CsxoMG-j.js";import"./cCsmyXn7.js";import"./pvNInfal.js";import"./DNtRt3-K.js";import"./CTtN8_V5.js";import"./C-UI_2aN.js";import"./JR_dtwf4.js";import"./DL61D00e.js";const F=""+new URL("green-shield-with-gradient.BE-5rUkf.svg",import.meta.url).href,M={name:"SweepstakesCard",components:{Button:T,Favicon:k,Badge:y,Tooltip:C,SkeletonCard:b},props:{casinoSlug:{type:String,default:""},customTimer:{type:Object,default:null},description:{type:String,default:""},animated:{type:Boolean,default:!0}},data(){return{timeRemaining:null,countdownInterval:null,isMobile:!1,isTablet:!1}},computed:{greenShieldWithGradientUrl:()=>F,partnerData(){return(v().partnersBySlug||{})[this.casinoSlug]||null},partnerAttributes(){return this.partnerData?.phoenix?.attributes||{}},offerAttributes(){return this.partnerAttributes?.toplistOffer?.attributes||{}},partnerName(){return this.partnerData?.phoenix?.name||"Casino"},partnerLogo(){const t=this.$config.public.PHOENIX_IMAGE_SERVER,e=this.partnerData?.favicon?.dark||null;return e?`${t}${e}?w=96&h=96&fm=avif`:null},isExclusive(){return(this.offerAttributes?.titlePreview||"").toUpperCase().includes("EXCLUSIVE:")},partnerOffer(){return(this.offerAttributes?.titlePreview||"").replace(/EXCLUSIVE:\s*/gi,"").trim()},bonusCode(){return this.offerAttributes?.bonusCode||""},bonusValidFor(){return this.offerAttributes?.bonusValidFor||null},notActive(){return this.partnerData?.supplement?.notActive},afflink(){const t=this.offerAttributes?.afflinkProxy||null;return t&&!this.notActive?`${E().public.PHOENIX_AFFLINK_SERVER}${t}`:""},favIconSize(){return this.isMobile?"xs":this.isTablet?"sm":"md"},tnc(){return this.offerAttributes?.tnc||null},totalClaims(){const t=new Date,e=400,i=this.casinoSlug?.length||0,o=i%2===0?i*3*-1:i*2,a=this.partnerName?.length||0,s=t.getMonth()+t.getDate()+a+o,r=1440*60,u=t.getHours()*60*60,p=t.getMinutes()*60,h=u+p;return Math.round(h*e/r)+s},totalClaimsText(){return{used:this.$t("sweepstakesCard.used"),count:this.totalClaims,times:this.$t("sweepstakesCard.times")}},hasTimer(){return!!(this.customTimer||this.bonusValidFor)}},setup(t){const{pending:e}=A(`sweepstakes-card-${t.casinoSlug}`,async()=>(t.casinoSlug&&await v().fetchCasinosBySlug({casinoSlugs:t.casinoSlug}),null),{watch:[()=>t.casinoSlug]});return{pending:e}},mounted(){if(this.handleResize(),window.addEventListener("resize",this.handleResize),this.customTimer){const t=this.getTargetTimeFromCustomTimer(this.customTimer);t&&this.startCountdownWithTarget(t)}else this.bonusValidFor&&this.startCountdown(this.bonusValidFor)},watch:{casinoSlug:{handler(){this.countdownInterval&&(clearInterval(this.countdownInterval),this.timeRemaining=null)}},bonusValidFor:{handler(t){this.customTimer||t&&(this.countdownInterval&&clearInterval(this.countdownInterval),this.startCountdown(t))}},customTimer:{handler(t){if(this.countdownInterval&&(clearInterval(this.countdownInterval),this.timeRemaining=null),t){const e=this.getTargetTimeFromCustomTimer(t);e&&this.startCountdownWithTarget(e)}},deep:!0}},beforeUnmount(){this.countdownInterval&&clearInterval(this.countdownInterval),window.removeEventListener("resize",this.handleResize)},methods:{handleResize(){this.isTablet=window.innerWidth<769,this.isMobile=window.innerWidth<450},parseTimeString(t){const e=/(\d+)\s*(second|minute|hour|day|week|month|year)s?/i,i=t.match(e);if(!i)return null;const o=parseInt(i[1]),a=i[2].toLowerCase();let r=Date.now();
1switch(a){case"second":r+=o*1e3;break;case"minute":r+=o*60*1e3;break;case"hour":r+=o*60*60*1e3;break;case"day":r+=o*24*60*60*1e3;break;case"week":r+=o*7*24*60*60*1e3;break;case"month":r+=o*30*24*60*60*1e3;break;case"year":r+=o*365*24*60*60*1e3;break}return r},startCountdown(t){const e=this.parseTimeString(t);this.startCountdownWithTarget(e)},getTargetTimeFromCustomTimer(t){if(!t)return null;const e=t.duration||{},i=Number(e.days||0),o=Number(e.hours||0),a=Number(e.minutes||0),s=Number(e.seconds||0),r=(((i*24+o)*60+a)*60+s)*1e3;return Date.now()+r},startCountdownWithTarget(t){if(!t){this.timeRemaining=null;return}this.countdownInterval&&clearInterval(this.countdownInterval),this.updateCountdown(t),this.countdownInterval=D(()=>{this.updateCountdown(t)},1e3)},updateCountdown(t){const e=Date.now(),i=t-e;if(i<=0){this.timeRemaining={days:0,hours:0,minutes:0,seconds:0},this.countdownInterval&&clearInterval(this.countdownInterval);return}const o=Math.ceil(i/1e3),a=1440*60,s=3600,r=60,u=Math.floor(o/a),p=Math.floor(o%a/s),h=Math.floor(o%s/r),g=o%r;this.timeRemaining={days:u,hours:p,minutes:h,seconds:g}},formatTimeUnit(t){return t.toString().padStart(2,"0")}}},z={key:1,class:"flex flex-col h-full gap-md md:gap-lg"},B={class:"p-md md:p-lg flex flex-col gap-sm md:gap-md rounded-ui-lg background-elevation-2"},N={key:0,class:"flex gap-sm md:gap-md items-center sm:items-start"},P={key:0,class:"flex flex-col gap-2xs"},U={class:"text-foreground-2 text-sm md:text-md leading-md font-bold"},L={class:"text-foreground-3 text-3xs leading-120"},V={class:"text-foreground-3 text-3xs leading-120 underline cursor-pointer"},O={key:1,class:"flex items-center justify-center gap-xs md:gap-md px-md md:px-2xl py-sm sm:ml-[72px] md:ml-0 border-sm border-solid color-stroke-2 rounded-button background-elevation-3 w-auto max-w-[300px] md:max-w-none md:w-full"},j={key:0,class:"flex items-center justify-center gap-xs md:gap-md w-full","aria-hidden":"true"},W={key:0,class:"flex items-center gap-xs flex-shrink-0"},G={class:"flex items-center justify-center flex-shrink-0"},H=["src"],X={class:"text-foreground-success text-2xs leading-120"},K={class:"flex justify-center gap-2xs flex-shrink min-w-0"},Y={key:0,class:"flex flex-col items-center min-w-0"},q={class:"text-foreground-1 text-sm font-bold leading-sm"},J={class:"text-foreground-3 text-2xs leading-sm"},Q={key:1,class:"text-foreground-2 leading-2xs"},Z={class:"flex flex-col items-center min-w-0"},$={class:"text-foreground-1 text-sm font-bold leading-sm"},tt={class:"text-foreground-3 text-2xs leading-sm"},et={class:"flex flex-col items-center min-w-0"},st={class:"text-foreground-1 text-sm font-bold leading-sm"},nt={class:"text-foreground-3 text-2xs leading-sm"},ot={class:"flex flex-col items-center min-w-0"},it={class:"text-foreground-1 text-sm font-bold leading-sm"},rt={class:"text-foreground-3 text-2xs leading-sm"},at={class:"px-md md:px-lg pb-md md:pb-lg"};function lt(t,e,i,o,a,s){const r=b,u=k,p=y,h=C,g=T;return m(),d("div",{class:R(["sweepstakes-card w-full md:w-[395px] rounded-xl text-left",{"sweepstakes-card-animated":i.animated,"border-sm color-stroke-2":!i.animated}])},[o.pending?(m(),x(r,{key:0,content:{height:330}})):(m(),d("div",z,[n("div",B,[s.partnerLogo?(m(),d("div",N,[n("div",null,[w(u,{size:s.favIconSize,"image-path":s.partnerLogo,"image-name":`${s.partnerName} ${t.$t("sweepstakesCard.logo")}`,blur:"#26286D",type:"circular"},null,8,["size","image-path","image-name"])]),s.partnerOffer?(m(),d("div",P,[s.isExclusive?(m(),x(p,{key:0,color:"success",theme:"reverted",size:"sm",class:"px-xs py-3xs w-fit"},{default:_(()=>[f(l(t.$t("sweepstakesCard.exclusive")),1)]),_:1})):c("",!0),n("p",U,l(s.partnerOffer),1),n("p",L,[f(l(i.description)+" ",1),s.tnc?(m(),x(h,{key:0,content:s.tnc,class:"inline"},{default:_(()=>[n("span",V,l(t.$t("sweepstakesCard.viewTnc")),1)]),_:1},8,["content"])):c("",!0)])])):c("",!0)])):c("",!0),s.hasTimer?(m(),d("div",O,[a.timeRemaining?(m(),d(I,{key:1},[s.totalClaims?(m(),d("div",W,[n("div",G,[n("img",{src:s.greenShieldWithGradientUrl,width:"24",height:"24",alt:"","aria-hidden":"true",role:"img",loading:"lazy",decoding:"async"},null,8,H)]),n("p",X,[f(l(s.totalClaimsText.used)+" ",1),e[1]||(e[1]=n("br",null,null,-1)),f(" "+l(s.totalClaimsText.count)+" "+l(s.totalClaimsText.times),1)])])):c("",!0),e[4]||(e[4]=n("div",{class:"h-8 border-r-sm color-stroke-2"},null,-1)),n("div",K,[a.timeRemaining.days>0?(m(),d("div",Y,[n("span",q,l(a.timeRemaining.days),1),n("span",J,l(t.$t("sweepstakesCard.days")),1)])):c("",!0),a.timeRemaining.days>0?(m(),d("span",Q,":")):c("",!0),n("div",Z,[n("span",$,l(s.formatTimeUnit(a.timeRemaining.hours)),1),n("span",tt,l(t.$t("sweepstakesCard.hours")),1)]),e[2]||(e[2]=n("span",{class:"text-foreground-2 leading-2xs"},":",-1)),n("div",et,[n("span",st,l(s.formatTimeUnit(a.timeRemaining.minutes)),1),n("span",nt,l(t.$t("sweepstakesCard.min")),1)]),e[3]||(e[3]=n("span",{class:"text-foreground-2 leading-2xs"},":",-1)),n("div",ot,[n("span",it,l(s.formatTimeUnit(a.timeRemaining.seconds)),1),n("span",rt,l(t.$t("sweepstakesCard.sec")),1)])])],64)):(m(),d("div",j,[...e[0]||(e[0]=[n("div",{class:"h-8 w-24 rounded-ui-sm bg-skeleton
1skeleton-animation animate-skeleton-animation-big background-elevation-2"},null,-1),n("div",{class:"h-8 w-32 rounded-ui-sm bg-skeleton skeleton-animation animate-skeleton-animation-big background-elevation-2"},null,-1)])]))])):c("",!0)]),n("div",at,[w(g,{tag:"a",variant:"primary",size:"MD",href:s.afflink,rel:"noopener noreferrer nofollow",target:"_blank",class:"w-full",disabled:!s.afflink},{default:_(()=>[f(l(t.$t("sweepstakesCard.claimSweepsCoins")),1)]),_:1},8,["href","disabled"])])]))],2)}const Se=Object.assign(S(M,[["render",lt],["__scopeId","data-v-1654bb88"]]),{__name:"SweepstakesCard"});export{Se 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.