import{r as d,j as e,L as N,o as f}from"./vendor-react-C630P38J.js";import{p as h,t as v,r as j,L as P,c as S,f as k,d as I,q as l}from"./vendor-fxts-IS4CCBC4.js";import{S as T,G as E,b as L}from"./vendor-swiper-CwUwDtZu.js";import{u as w,t as g,E as A,L as R,h as b}from"./feature-order-CyMOR5ND.js";import"./vendor-utils-Cb1MAKRV.js";import{P as m}from"./index-CiAMQUDP.js";import{u as y,a as C}from"./useProductSectionProductList-cRfRDZxK.js";import"./vendor-query-BjC2S-sR.js";import"./vendor-overlay-B61Jbn6n.js";import"./vendor-i18n-D_F5k183.js";import"./vendor-rhf-CXRF5ML7.js";import"./vendor-zod-BNDLCzeL.js";import"./vendor-runtime-BrGgGswE.js";import"./vendor-hooks-D-WB61cZ.js";import"./vendor-cookie-BFUm5jHE.js";import"./vendor-state-BxLZOG0B.js";import"./vendor-form-ui-C6F7344s.js";import"./vendor-date-XKm2J5pk.js";import"./index-Cqr0ypdb.js";import"./vendor-meta-D6H5T8-B.js";var D="rfk8ee0",_="rfk8ee1",V="rfk8ee2",G="rfk8ee3",O="rfk8ee4",M="rfk8ee5",W="rfk8ee6",z="rfk8ee7",B="rfk8ee8",q="rfk8ee9",F="rfk8eea",H="rfk8eeb";const U="MAIN_",xe=()=>{const{isMobile:a}=w(),{data:i}=y(),n=d.useMemo(()=>h(i,I("sections"),k(r=>r.sectionId.startsWith(U)),S(r=>r.sectionNo),P,j(2),v),[i]);return l(i)?null:e.jsx("section",{className:D,children:e.jsx("div",{className:_,children:e.jsx("div",{className:V,children:n.map(r=>e.jsx(X,{sectionId:r.sectionId,sectionNo:r.sectionNo,title:r.sectionName,promotionText:r.promotionText,isMobile:a},`product-section-${r.sectionId}`))})})})},X=({sectionId:a,sectionNo:i,title:n,promotionText:r,isMobile:c})=>{const{data:t,isLoading:p}=C({sectionId:a,searchParams:{by:"ADMIN_SETTING",soldout:!0,saleStatus:"RESERVATION_AND_ONSALE",pageNumber:1,pageSize:8,hasTotalCount:!0,hasOptionValues:!1,includeStopProduct:!1,direction:"DESC"}}),o=d.useMemo(()=>{var s;return((s=t==null?void 0:t.products)==null?void 0:s.map(x=>g(x)))??[]},[t==null?void 0:t.products]),u=o.length>=5?2:1;return l(o)?null:e.jsxs("div",{className:G,children:[e.jsxs("div",{className:O,children:[e.jsx("h2",{className:M,children:n}),e.jsxs("div",{className:W,children:[e.jsx("p",{className:z,children:r}),e.jsxs(N,{className:B,to:f(b.SECTION.DETAIL,{sectionNo:String(i)}),children:[e.jsx("span",{children:"더보기"}),e.jsx(A,{size:16,strokeWidth:2})]})]})]}),e.jsx(R,{isLoading:p,children:c?e.jsx(T,{className:F,modules:[E],slidesPerView:2.3,spaceBetween:5,grid:{rows:u,fill:"row"},children:o.map(s=>e.jsx(L,{className:H,children:e.jsx(m,{isMobile:c,...s,isVisiblePromotionText:!0,reviewRating:void 0})},s.productNo))}):e.jsx("div",{className:q,children:o.map(s=>e.jsx(m,{...s,isMobile:c,isVisiblePromotionText:!0,reviewRating:void 0},s.productNo))})})]})};export{xe as default};