import{af as I,ar as v,aL as C,u as G,Q as N,r as T,i as U,j as e,c as j,k as S,L as r,U as i,bX as W,d as F,a6 as $,T as D,e as q,f as B,m as c,an as k,am as Q,a as H,G as d,bY as Y,Z as K,aq as z}from"../index.Crez7j-Y.bundle.js";import{M as V}from"./MyOrderAPIs.DZkd5slp.bundle.js";import{E as Z}from"./EmptyContent.BRQ9JwMr.bundle.js";const X=(s,t,n)=>{const{getOrderStatusCountAPI:o}=V(),x=I(v,l=>l.memberId),h=C(new Date).format("YYYY-MM-DD"),u=C(new Date).subtract(6,"months").format("YYYY-MM-DD"),m=h,p=I(v,l=>l.isLogin);return G({queryKey:N.getOrderStatusCountList(x,u,m),queryFn:()=>o(u,m),refetchOnWindowFocus:!1,enabled:p,...n})};var f={},J=U;Object.defineProperty(f,"__esModule",{value:!0});var a=f.default=void 0,ee=J(T()),ne=e;a=f.default=(0,ee.default)((0,ne.jsx)("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6z"}),"KeyboardArrowRight");function te(){return e.jsxs(j,{display:"flex",flexDirection:"column",sx:{"& a":{px:3,py:2,display:"flex",justifyContent:"space-between",borderBottom:"1px solid ".concat(S)}},children:[e.jsxs(r,{variant:"subtitle1",href:i.MYPAGE_PREVIOUS_ORDER_LIST,underline:"none",children:["이전 주문목록",e.jsx(a,{})]}),e.jsxs(r,{variant:"subtitle1",href:i.MYPAGE_MODIFY_MEMBER,underline:"none",children:["회원정보 수정",e.jsx(a,{})]}),e.jsxs(r,{variant:"subtitle1",href:i.MYPAGE_SHIPPING_LIST,underline:"none",children:["배송지 관리",e.jsx(a,{})]}),e.jsxs(r,{variant:"subtitle1",href:i.MYPAGE_INQUIRY_LIST,underline:"none",children:["1:1 문의",e.jsx(a,{})]}),e.jsxs(r,{variant:"subtitle1",href:i.PURCHASE_INQUIRY,underline:"none",children:["구매 문의",e.jsx(a,{})]}),e.jsxs(r,{variant:"subtitle1",href:i.MYPAGE_DELETE_MEMBER,underline:"none",children:["회원 탈퇴",e.jsx(a,{})]})]})}function se(){const{data:s}=W(),t=F.useMemo(()=>s==null?void 0:s.sort((n,o)=>o.recentlyViewedYmdt.localeCompare(n.recentlyViewedYmdt)),[s]);return e.jsxs(j,{mt:5,bgcolor:$,p:4,borderRadius:2,display:"flex",flexDirection:"column",gap:3,children:[e.jsx(D,{variant:"subtitle2",fontWeight:600,children:"최근 본 상품"}),e.jsxs(j,{children:[(t==null?void 0:t.length)===0&&e.jsx(Z,{text:"최근 본 상품이 없습니다.",height:"30vh"}),e.jsx(q,{spaceBetween:10,slidesPerView:4,children:t==null?void 0:t.map(n=>e.jsx(B,{style:{minWidth:c.마이페이지최근본상품},children:e.jsxs(r,{underline:"none",href:"".concat(i.PRODUCT_DETAIL,"?productNo=").concat(n.productNo),children:[e.jsx("img",{width:c.마이페이지최근본상품,height:c.마이페이지최근본상품,style:{border:"1px solid ".concat(S),borderRadius:8},src:"".concat(n.imageUrls[0],"?").concat(c.마이페이지최근본상품,"x").concat(c.마이페이지최근본상품),alt:n.productName}),e.jsx(k,{title:n.productName,children:e.jsx(D,{component:"p",variant:"body",noWrap:!0,fontWeight:500,children:n.productName})}),e.jsx(Q,{salePrice:n.salePrice,immediateDiscountAmt:n.immediateDiscountAmt,contentsIfPausing:n.contentsIfPausing,smallSize:!0})]})},n.productNo))})]})]})}function oe(){const{data:s,isPending:t}=X(),{depositWaitCnt:n=0,productPrepareCnt:o=0,payDoneCnt:x=0,deliveryPrepareCnt:h=0,deliveryIngCnt:y=0,deliveryDoneCnt:u=0,buyConfirmCnt:m=0,cancelProcessingCnt:p=0,cancelDoneCnt:l=0,returnProcessingCnt:_=0,returnDoneCnt:R=0,exchangeProcessingCnt:A=0,exchangeDoneCnt:w=0}=s!=null?s:{},g=n,b=o+x,M=h+y,P=u+m,E=p+l+_+R+A+w,{isMobile:O,isDesktop:L}=H();return e.jsxs(e.Fragment,{children:[L&&e.jsxs(e.Fragment,{children:[e.jsx(d,{desktop:12,component:"section",children:e.jsx(Y,{unpaidOrders:g,awaitingShipment:b,deliveryIng:M,completeShipment:P,cancelReturnExchange:E,isPending:t})}),e.jsx(d,{desktop:12,component:"section",children:e.jsx(se,{})})]}),O&&e.jsxs(K,{children:[e.jsx(d,{mobile:12,children:e.jsx(z,{title:"마이페이지"})}),e.jsx(d,{mobile:12,my:3,children:e.jsx(Y,{unpaidOrders:g,awaitingShipment:b,deliveryIng:M,completeShipment:P,cancelReturnExchange:E,isPending:t})}),e.jsx(d,{mobile:12,component:"section",children:e.jsx(te,{})})]})]})}export{oe as default};