const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["js/index-BFxIH3X4.js?v=1773287522785","js/index-BTglIPU2.js?v=1773287522785","js/vue-core-DJjvd5ZC.js?v=1773287522785","js/prismjs-BZPoR7_J.js?v=1773287522785","css/prismjs-D-3FhBe_.css?v=1773287522785","js/naive-ui--dJnpVcV.js?v=1773287522785","css/index-DEM1fxGq.css?v=1773287522785","js/pay-R5yitMsU.js?v=1773287522785","css/index-DnufsU4t.css?v=1773287522785"])))=>i.map(i=>d[i]);
import{k as S,a6 as N,$ as _,Z as y,L as V,S as r,_ as m,c as P,a8 as $,a0 as n,j as k,u as j,r as O,e as R,aa as q,ak as z,a3 as I}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{t as L,Q as w,c as B,aV as T,p as A,P as D,i as E}from"./index-BTglIPU2.js?v=1773287522785";import{u as M}from"./pay-R5yitMsU.js?v=1773287522785";import{az as G,o as x,aA as H}from"./naive-ui--dJnpVcV.js?v=1773287522785";const Q=S({__name:"index",props:{source:{type:Number,default:27}},setup(a){const{isPro:c}=N(L()),i=()=>{w({source:a.source})};return(t,u)=>(_(),y("div",{class:V(["pro-badge",{pro:r(c)}]),onClick:i},u[0]||(u[0]=[m("i",{class:"i-common:pro text-14px color-white"},null,-1),m("span",{class:"text"},"PRO",-1)]),2))}}),te=B(Q,[["__scopeId","data-v-2e4cedc1"]]);function v(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Object]"&&!j(a)}const F=S({__name:"time",props:{endtime:{default:0}},emits:["finish"],setup(a,{emit:c}){const i=a,t=c,u=P(()=>{const o=Date.now(),l=i.endtime*1e3;return Math.max(0,l-o)}),s=o=>o.toString().padStart(2,"0"),d=({hours:o,minutes:l,seconds:f})=>{let e,p,g,b;const h=Math.floor(o/24);return o=o%24,n("div",{class:"inline-flex items-center"},[h>0?n(x,{type:"error",size:"small",class:"px-2px h-20px",bordered:!1},v(e=s(h))?e:{default:()=>[e]}):"",h>0?n("span",{class:"mx-4px"},[k(":")]):"",n(x,{type:"error",size:"small",class:"px-2px h-20px",bordered:!1},v(p=s(o))?p:{default:()=>[p]}),n("span",{class:"mx-4px"},[k(":")]),n(x,{type:"error",size:"small",class:"px-2px h-20px",bordered:!1},v(g=s(l))?g:{default:()=>[g]}),n("span",{class:"mx-4px"},[k(":")]),n(x,{type:"error",size:"small",class:"px-2px h-20px",bordered:!1},v(b=s(f))?b:{default:()=>[b]})])},C=()=>{i.endtime>0&&t("finish")};return(o,l)=>{const f=G;return _(),$(f,{duration:r(u),render:d,"on-finish":C},null,8,["duration"])}}}),W={class:"text-pro"},Z={key:0,class:"font-bold"},J={key:1,class:"flex items-center"},K={class:"mr-6px"},U=S({__name:"index",props:{arrowPlacement:{type:String,default:"right"}},setup(a){const c=M(),{showCoupon:i,receiveCoupon:t}=N(c),{width:u}=T(),s=O([]),d=P(()=>s.value.length),C=P(()=>d.value===0?0:s.value[d.value-1].deduct_amount),o=R({quota:0,total:0,received:0}),l=()=>{if(t.value.status===1){A({width:400,bgColor:"transparent",data:{obtainId:t.value.obtain_id,endTime:t.value.end_time,couponQuota:o,couponList:s.value,onReceive:()=>{w({source:176})}},component:I(()=>D(()=>import("./index-BFxIH3X4.js?v=1773287522785"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))});return}else t.value.total>0&&w({source:176})};return(async()=>{const e=await c.getReceiveCoupon();E(e)&&(H(e.coupons,"deduct_amount"),s.value=e.coupons,e.package_quota&&(o.quota=e.package_quota.quota,o.total=e.package_quota.total,o.received=e.package_quota.total-e.package_quota.quota))})(),(e,p)=>r(i)?(_(),y("div",{key:0,class:V(["coupon-box",a.arrowPlacement]),onClick:l},[p[0]||(p[0]=m("div",{class:"coupon-logo"},null,-1)),m("div",W,[r(t).status===1?(_(),y("div",Z,q(r(u)>1500?e.$t("Component.Coupon.index_11",[r(C)]):e.$t("Component.Coupon.index_12",[r(d)])),1)):r(t).total>0?(_(),y("div",J,[m("span",K,q(e.$t("Component.Coupon.index_4")),1),n(F,{endtime:r(t).end_time},null,8,["endtime"])])):z("",!0)])],2)):z("",!0)}}),ae=B(U,[["__scopeId","data-v-f507497a"]]);export{ae as H,te as P};
