import{_ as I,k as t,r,g as b,a_ as k,o as $,h as N,p as c,v as _,n as i,A as y,z as S,i as w,L as z}from"./entry.ef385e01.js";const P={class:"progressbar__indicator"},L={__name:"GroupBuyProgressBar",props:{max:{type:Number,required:!0},value:{type:Number,default:0}},setup(p){const n=p,h=t(()=>Math.min(n.value,n.max)),v=r(null),a=r(0),u=()=>{var e;a.value=(e=v.value)==null?void 0:e.clientWidth},s=r(0),x=t(()=>(s.value=n.value/n.max,{"--progress-percent":`${s.value*100}%`})),o=t(()=>a.value*s.value),f=r(null),d=t(()=>{var e;return((e=f.value)==null?void 0:e.clientWidth)||0}),B=t(()=>{const e={};return o.value>d.value/2?(e.left=`calc(${s.value*100}% - ${d.value/2}px)`,o.value+d.value>a.value&&(e.left="auto",e.right="0")):e.left="0",e}),m=r(null),g=t(()=>{var e;return((e=m.value)==null?void 0:e.clientWidth)||0}),E=t(()=>{const e={},l=g.value/2;return o.value<l?e.left="0":o.value>a.value-l?e.left=`calc(100% - ${g.value/16}rem)`:e.left=`calc(${s.value*100}% - ${l/16}rem)`,e});return b(()=>{u(),window.addEventListener("resize",u)}),k(()=>{window.removeEventListener("resize",u)}),(e,l)=>{const W=z;return $(),N("div",{ref_key:"progressbarElement",ref:v,class:"progressbar",style:_(i(x))},[c("div",P,[c("div",{ref_key:"progressInfoElement",ref:f,class:"progressbar__info",style:_(i(B))},[c("strong",null,y(i(h)),1),S(" / "+y(p.max)+"개 구매중 ",1)],4),c("span",{ref_key:"indicatorIconElement",ref:m,class:"indicator-icon",style:_(i(E))},[w(W,{name:"indicator",class:"icon"})],4)])],4)}}},G=I(L,[["__scopeId","data-v-001d434a"]]);export{G as _};
