import{j as e,n as i,k as G,p as s}from"./index-BTX1XDcj.js";import{u as I}from"./useInfiniteScroll-60WbX7If.js";import{P as M}from"./PLPThumbCard-Bvr3vm3P.js";import{i as $}from"./vendor-q1sfVHxQ.js";const c=({isLoading:a,count:l=10})=>a?e.jsx("div",{className:"plp-grid",children:Array.from({length:l}).map((n,r)=>e.jsxs("div",{className:"flex flex-col items-start w-full",children:[e.jsx("div",{className:"w-full aspect-[4/5] bg-[#f7f7f7]"}),e.jsxs("div",{className:"flex flex-col items-start gap-[0.4rem] w-full pt-[1.6rem]",children:[e.jsx("div",{className:"w-[8rem] h-[1.1rem] bg-[#f0f0f0]"}),e.jsx("div",{className:"w-[12rem] h-[1.1rem] bg-[#f0f0f0]"}),e.jsx("div",{className:"w-[6rem] h-[1.1rem] bg-[#f0f0f0]"})]})]},r))}):null,A=()=>e.jsxs("div",{className:"flex items-center justify-center gap-[0.6rem] w-full py-[2.4rem]",children:[e.jsx("span",{className:"w-[0.6rem] h-[0.6rem] rounded-full bg-fig-text-secondary animate-bounce"}),e.jsx("span",{className:"w-[0.6rem] h-[0.6rem] rounded-full bg-fig-text-secondary animate-bounce [animation-delay:0.15s]"}),e.jsx("span",{className:"w-[0.6rem] h-[0.6rem] rounded-full bg-fig-text-secondary animate-bounce [animation-delay:0.3s]"})]}),O=()=>{const{t:a}=G("common");return e.jsx("p",{className:i("text-[1.2rem] leading-[1.8rem] text-fig-text-primary py-[2rem]"),children:a("noSearchResults")})},_=({products:a=[],onLoadMore:l,hasMore:n=!1,isLoading:r=!1,isFetchingNextPage:o=!1,gridClassName:f,onBrandClick:d})=>{const p=I({onLoadMore:l,hasMore:n,isLoading:r}),x=$(),t=r&&!o&&(a.length===0||x!=="POP");return e.jsxs("div",{className:"l-panel",children:[t&&e.jsx(c,{isLoading:!0}),!t&&a.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:i("plp-grid","items-start",f),children:a.map(({productNo:m,productName:u,brandName:g,brandNameEn:h,imageUrls:j,listImageUrls:b,salePrice:y,immediateDiscountAmt:N,additionDiscountAmt:v,isSoldOut:w,saleStatusType:P,liked:T,adult:L,frontDisplayYn:S,stickerLabels:k,promotionText:C,salePeriodType:R,saleStartYmdt:B,saleEndYmdt:E},F)=>S&&e.jsx(M,{productNo:m,productName:u,brandName:g,brandNameEn:h,imageUrls:j,listImageUrls:b,salePrice:y,immediateDiscountAmt:N,additionDiscountAmt:v,isSoldOut:w,saleStatusType:P,liked:T,adult:L,onBrandClick:d,stickerLabels:k,collabBrandName:C,salePeriodType:R,saleStartYmdt:B,saleEndYmdt:E},`${m}-${F}`))}),o&&e.jsx(A,{}),n&&e.jsx("div",{ref:p,"aria-hidden":!0,className:"h-[0.1rem] w-full"})]}),!t&&a.length===0&&e.jsx(O,{})]})};c.propTypes={isLoading:s.bool,count:s.number};_.propTypes={style:s.object,products:s.array,onLoadMore:s.func,hasMore:s.bool,isLoading:s.bool,isFetchingNextPage:s.bool,gridClassName:s.string,onBrandClick:s.func};export{_ as G};