import{m as n,v as s,ab as l,t as d,bE as z,$ as fe,Y as we,r as c,k as $,jI as V,j as e,bF as G,b as ye,ai as Se,T as je,a7 as R,cG as te,c4 as ve,d as q,g as Y,al as W,jJ as K,E as Q,jK as Z,jw as Ee,ah as ne,y as Me,bx as ie,by as oe,aC as Ne,G as H,u as Te,h as re,jL as ke,c8 as X,P as J,jM as _e,a8 as se,jN as L,b$ as Ie,ao as ae,ad as Pe,i as Le,jO as De,jP as Ae,N as le,aq as Be,jQ as Oe,z as Re,S as $e}from"./index-E0AVXOTn.js";import{e as U}from"./every-BvSgYTEb.js";import{P as Fe}from"./index-Dq8xrBOI.js";import{u as Ve}from"./uniq-D_biwgiI.js";import{u as Ue,a as ze}from"./useEvent-BXRcVznK.js";import"./uniqBy-DN1049mB.js";const Ge=n.div(["display:flex;flex-direction:column;align-items:center;width:100%;gap:24px;","{gap:36px;}"],s.SM),We=n.h3(["",";color:",";text-align:center;width:100%;","{",";}"],l.heading_semibold,d.black,s.SM,l.title1_semibold),He=n.ul(["display:flex;flex-direction:column;width:100%;gap:8px;","{max-width:800px;margin:0 auto;display:flex;justify-content:center;align-items:center;","}"],s.SM,({$isMultipleItem:t})=>t&&z(["display:grid;grid-template-columns:repeat(2,1fr);gap:24px;"])),Ke=n.li(["width:100%;max-width:385px;"]),qe=n(we)(["width:100%;height:52px;border-radius:8px;",";&:disabled{background-color:",";color:",";cursor:not-allowed;}"],l.heading_bold,d.gray10,d.gray60),Ye=n.button(["display:flex;align-items:center;gap:4px;padding:8px 12px;",";color:",`;&::after{content:'';display:inline-block;width:12px;height:12px;background-image:url("data:svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 4L6 8L10 4' stroke='%23777472' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:center;transition:transform 0.2s ease-in-out;`,"}"],l.caption_regular,d.gray70,({$isOpen:t})=>t&&z(["transform:rotate(180deg);"])),Qe=n(fe.div)(["width:100%;overflow:hidden;background-color:",";border-radius:8px;"],d.gray10),Ze=n.div(["padding:16px;",";color:",";white-space:pre-wrap;line-height:1.6;ul{list-style:disc;padding-left:20px;}"],l.caption_regular,d.gray70),k={Container:Ge,Title:We,List:He,ListItem:Ke,AllCouponDownloadButton:qe,ToggleButton:Ye,GuideContentsContainer:Qe,GuideContents:Ze},Xe=t=>c.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},c.createElement("path",{d:"M21.5306 7.28055L9.53055 19.2806C9.4609 19.3503 9.37818 19.4056 9.28713 19.4433C9.19609 19.4811 9.09849 19.5005 8.99993 19.5005C8.90137 19.5005 8.80377 19.4811 8.71272 19.4433C8.62168 19.4056 8.53896 19.3503 8.4693 19.2806L3.2193 14.0306C3.07857 13.8898 2.99951 13.699 2.99951 13.4999C2.99951 13.3009 3.07857 13.11 3.2193 12.9693C3.36003 12.8286 3.55091 12.7495 3.74993 12.7495C3.94895 12.7495 4.13982 12.8286 4.28055 12.9693L8.99993 17.6896L20.4693 6.2193C20.61 6.07857 20.8009 5.99951 20.9999 5.99951C21.199 5.99951 21.3898 6.07857 21.5306 6.2193C21.6713 6.36003 21.7503 6.55091 21.7503 6.74993C21.7503 6.94895 21.6713 7.13982 21.5306 7.28055Z",fill:"#777472"})),Je=t=>c.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},c.createElement("path",{d:"M4.71938 11.0306C4.57864 10.8899 4.49958 10.699 4.49958 10.5C4.49958 10.301 4.57864 10.1101 4.71938 9.96937C4.86011 9.82864 5.05098 9.74958 5.25 9.74958C5.44902 9.74958 5.63989 9.82864 5.78062 9.96937L11.25 15.4397V3C11.25 2.80109 11.329 2.61032 11.4697 2.46967C11.6103 2.32902 11.8011 2.25 12 2.25C12.1989 2.25 12.3897 2.32902 12.5303 2.46967C12.671 2.61032 12.75 2.80109 12.75 3V15.4397L18.2194 9.96937C18.2891 9.89969 18.3718 9.84442 18.4628 9.8067C18.5539 9.76899 18.6515 9.74958 18.75 9.74958C18.8485 9.74958 18.9461 9.76899 19.0372 9.8067C19.1282 9.84442 19.2109 9.89969 19.2806 9.96937C19.3503 10.0391 19.4056 10.1218 19.4433 10.2128C19.481 10.3039 19.5004 10.4015 19.5004 10.5C19.5004 10.5985 19.481 10.6961 19.4433 10.7872C19.4056 10.8782 19.3503 10.9609 19.2806 11.0306L12.5306 17.7806C12.461 17.8504 12.3783 17.9057 12.2872 17.9434C12.1962 17.9812 12.0986 18.0006 12 18.0006C11.9014 18.0006 11.8038 17.9812 11.7128 17.9434C11.6217 17.9057 11.539 17.8504 11.4694 17.7806L4.71938 11.0306ZM20.25 19.5H3.75C3.55109 19.5 3.36032 19.579 3.21967 19.7197C3.07902 19.8603 3 20.0511 3 20.25C3 20.4489 3.07902 20.6397 3.21967 20.7803C3.36032 20.921 3.55109 21 3.75 21H20.25C20.4489 21 20.6397 20.921 20.7803 20.7803C20.921 20.6397 21 20.4489 21 20.25C21 20.0511 20.921 19.8603 20.7803 19.7197C20.6397 19.579 20.4489 19.5 20.25 19.5Z",fill:"#777472"})),et=t=>c.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},c.createElement("path",{d:"M4.71938 11.0306C4.57864 10.8899 4.49958 10.699 4.49958 10.5C4.49958 10.301 4.57864 10.1101 4.71938 9.96937C4.86011 9.82864 5.05098 9.74958 5.25 9.74958C5.44902 9.74958 5.63989 9.82864 5.78062 9.96937L11.25 15.4397V3C11.25 2.80109 11.329 2.61032 11.4697 2.46967C11.6103 2.32902 11.8011 2.25 12 2.25C12.1989 2.25 12.3897 2.32902 12.5303 2.46967C12.671 2.61032 12.75 2.80109 12.75 3V15.4397L18.2194 9.96937C18.2891 9.89969 18.3718 9.84442 18.4628 9.8067C18.5539 9.76899 18.6515 9.74958 18.75 9.74958C18.8485 9.74958 18.9461 9.76899 19.0372 9.8067C19.1282 9.84442 19.2109 9.89969 19.2806 9.96937C19.3503 10.0391 19.4056 10.1218 19.4433 10.2128C19.481 10.3039 19.5004 10.4015 19.5004 10.5C19.5004 10.5985 19.481 10.6961 19.4433 10.7872C19.4056 10.8782 19.3503 10.9609 19.2806 11.0306L12.5306 17.7806C12.461 17.8504 12.3783 17.9057 12.2872 17.9434C12.1962 17.9812 12.0986 18.0006 12 18.0006C11.9014 18.0006 11.8038 17.9812 11.7128 17.9434C11.6217 17.9057 11.539 17.8504 11.4694 17.7806L4.71938 11.0306ZM20.25 19.5H3.75C3.55109 19.5 3.36032 19.579 3.21967 19.7197C3.07902 19.8603 3 20.0511 3 20.25C3 20.4489 3.07902 20.6397 3.21967 20.7803C3.36032 20.921 3.55109 21 3.75 21H20.25C20.4489 21 20.6397 20.921 20.7803 20.7803C20.921 20.6397 21 20.4489 21 20.25C21 20.0511 20.921 19.8603 20.7803 19.7197C20.6397 19.579 20.4489 19.5 20.25 19.5Z",fill:"black"})),tt=n.div(["position:relative;display:flex;align-items:center;width:100%;min-height:72px;background-color:",";border-radius:16px;text-align:left;overflow:hidden;&::before,&::after{content:'';position:absolute;top:50%;transform:translateY(-50%);width:20px;height:20px;background-color:",";border-radius:50%;}&::before{left:-10px;}&::after{right:-10px;}","{min-height:100px;}"],d.gray20,d.white,s.SM),nt=n.div(["flex:1 1 auto;display:flex;flex-direction:column;justify-content:center;padding:16px 20px;","{padding:25px 20px;}"],s.SM),it=n.p(["",";color:",";margin-bottom:4px;","{margin-bottom:2px;}"],l.title2_semibold,d.primary,s.SM),ot=n.p(["",";color:",";margin-bottom:4px;"],l.body1_bold,d.black),rt=n.span(["",";color:",";","{",";}"],l.caption_regular,d.gray70,s.SM,l.body2_regular),st=n.div(["position:relative;align-self:stretch;width:1px;background-image:linear-gradient( to bottom,"," 60%,transparent 60% );background-size:1px 12px;background-repeat:repeat-y;"],d.gray50),at=n.div(["min-width:75px;button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;width:100%;height:100%;padding:16px 20px;",";&:disabled{",";cursor:not-allowed;color:",";}","{gap:4px;}}"],l.label_small_badge,l.label_icon_caption,d.gray60,s.SM),lt=n.div(["display:flex;align-items:center;justify-content:center;width:24px;height:24px;svg{width:100%;height:100%;}"]),dt=n.span(["text-align:center;"]),w={Card:tt,Left:nt,Title:it,Name:ot,Discount:rt,Divider:st,Right:at,IconWrapper:lt,StatusText:dt},ct=({coupon:t,onCouponDownloadClick:a,variant:b="product"})=>{const{t:p}=$(),r=t.couponStatus.totalIssuableCnt===0,y=!r&&(t.couponStatus.issuableCnt===0||!t.downloadable),j=!r&&!y,C=c.useMemo(()=>t.discountInfo.freeDelivery?p("무료배송"):t.discountInfo.fixedAmt?V(t.discountInfo.discountAmt).format():p("{{amount}}%",{amount:t.discountInfo.discountRate}),[t.discountInfo,p]),x=c.useMemo(()=>{if(t.useConstraint.minSalePrice>0){const o=t.discountInfo.fixedAmt?t.discountInfo.discountAmt:t.discountInfo.maxDiscountAmt;return p("{{minPrice}}이상 구매시 최대 {{maxDiscount}} 할인",{minPrice:V(t.useConstraint.minSalePrice).format(),maxDiscount:V(o).format()})}return p("{{maxDiscount}} 할인",{maxDiscount:V(t.discountInfo.maxDiscountAmt).format()})},[t.useConstraint.minSalePrice,t.discountInfo,p]),u=c.useMemo(()=>r?e.jsxs(e.Fragment,{children:[e.jsx(w.IconWrapper,{children:e.jsx(Je,{})}),e.jsx(w.StatusText,{children:p("수량 소진")})]}):y?e.jsxs(e.Fragment,{children:[e.jsx(w.IconWrapper,{children:e.jsx(Xe,{})}),e.jsx(w.StatusText,{children:p("발급 완료")})]}):e.jsxs(e.Fragment,{children:[e.jsx(w.IconWrapper,{children:e.jsx(et,{})}),e.jsx(w.StatusText,{children:p("쿠폰 받기")})]}),[r,y,p]),v=()=>{j&&a(t.couponNo)};return e.jsxs(w.Card,{$variant:b,children:[e.jsx(w.Left,{children:e.jsxs(G,{gap:"4px",children:[e.jsx(w.Title,{children:p("{{amount}}",{amount:C})}),e.jsx(w.Name,{children:t.couponName}),b!=="event"&&e.jsx(w.Discount,{children:x})]})}),b!=="mypage"&&e.jsxs(e.Fragment,{children:[e.jsx(w.Divider,{}),e.jsx(w.Right,{children:e.jsx("button",{disabled:!j,onClick:v,children:u})})]})]})},pt=({couponInfo:t,eventNo:a,productNo:b,title:p,showTitle:r=!1,showAllDownloadButton:y=!1,showNotice:j=!1,onSuccessAll:C,variant:x})=>{const{t:u}=$(),{openDialog:v,openAsyncDialog:o,openLoginDialog:m}=ye(),i=Se(),[g,E]=c.useState(!1),{issue:{mutate:M},issueByEventNo:{mutate:D,isPending:A},issueByProductNo:{mutate:I,isPending:N}}=je(),xe=c.useMemo(()=>t.coupons.length>0,[t]),me=c.useMemo(()=>R(t.coupons,U(f=>f.downloadable)),[t]),ge=c.useMemo(()=>{const f=te("coupons",t);return U(P=>Me().isAfter(P.dateInfo.issueEndYmdt),f)?u("쿠폰 발급 기간 종료"):U(P=>P.couponStatus.issuableCnt===0,f)?u("쿠폰 수량 소진"):U(P=>!P.downloadable,f)?u("쿠폰 받기 완료"):u("쿠폰 모두 받기")},[t,u]),he=c.useMemo(()=>x||(a?"event":"product"),[x,a,b]),be=f=>{if(!q()){m();return}M({couponNo:f},{onSuccess:async({data:T})=>{await o({message:u("{{couponName}} 쿠폰을 발급받았습니다.",{couponName:T.couponName})}),i.invalidateQueries({predicate:S=>W(S.queryKey[0],[...K.all,...Q.all,...Z.all]),refetchType:"all"})},onError:T=>{var S;v({message:Y(T)?(S=T.response)==null?void 0:S.data.message:u("알 수 없는 오류가 발생했습니다.")})}})},Ce=()=>{if(!q()){m();return}const f=async({data:S})=>{const B=S.issuedCoupons.length>0,P=S.issueFailCoupons.length>0;await o({message:u(B?"쿠폰이 발급됐어요.
마이페이지 > 쿠폰에서 확인하세요.":"쿠폰 발급에 실패했습니다."),description:P?`
${R(S.issueFailCoupons,ne(F=>`- ${F.failMessage} (쿠폰번호: ${F.couponNo})
`),Ee(""))}
`:""}),i.invalidateQueries({predicate:F=>W(F.queryKey[0],[...K.all,...Q.all,...Z.all]),refetchType:"all"}),C&&C()},T=S=>{var B;v({message:Y(S)?(B=S.response)==null?void 0:B.data.message:u("알 수 없는 오류가 발생했습니다.")})};if(a){D({eventNo:a},{onSuccess:f,onError:T});return}if(b){I({productNo:b},{onSuccess:f,onError:T});return}};return xe?e.jsxs(k.Container,{children:[r&&p&&e.jsx(k.Title,{children:p}),e.jsx(k.List,{$isMultipleItem:t.coupons.length>1,children:t.coupons.map(f=>e.jsx(k.ListItem,{children:e.jsx(ct,{coupon:f,onCouponDownloadClick:be,variant:he})},f.couponNo))}),y&&e.jsx(k.AllCouponDownloadButton,{onClick:Ce,disabled:!me||A||N,children:ge}),j&&t.guideImageUrl&&e.jsxs(G,{align:"center",style:{width:"100%"},children:[e.jsx(k.ToggleButton,{$isOpen:g,onClick:()=>{E(f=>!f)},children:u("쿠폰 유의사항 보기")}),e.jsx(ve,{children:g&&e.jsx(k.GuideContentsContainer,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeInOut"},children:e.jsx(k.GuideContents,{dangerouslySetInnerHTML:{__html:t.guideImageUrl}})})})]})]}):null},ut=n.section(["display:flex;flex-direction:column;gap:12px;padding:24px 20px 0;border-top:8px solid ",";","{align-items:flex-start;gap:20px;border-top:none;padding:0 20px 120px;}"],d.gray20,s.SM),xt=n.h2(["",";","{display:flex;justify-content:space-between;align-items:center;width:100%;",";}"],l.title2_semibold,s.SM,l.title1_semibold),mt=n.button(["display:flex;justify-content:center;align-items:center;gap:2px;"," color:",";svg{transform:translateY(-1px);}"],l.body1_regular,d.gray80),de=n(ie)(["width:calc(100% + 40px);margin-left:-20px;padding:0 20px;"]),ce=n(oe)(["cursor:pointer;display:flex;flex-direction:column;gap:12px;height:auto;"]);de.displayName="Swiper";ce.displayName="SwiperSlide";const gt=n.ul(["display:grid;grid-template-columns:repeat(4,1fr);gap:24px;"]),ht=n.li(["cursor:pointer;display:flex;flex-direction:column;gap:16px;height:auto;"]),bt=n.div(["position:relative;width:100%;aspect-ratio:1 / 1;border-radius:4px;overflow:hidden;background-color:",";flex-shrink:0;img{width:100%;height:100%;object-fit:cover;}","{border-radius:8px;}"],d.gray10,s.SM),Ct=n.div(["display:flex;flex-direction:column;gap:4px;","{gap:8px;}"],s.SM),ft=n.p(["",";color:",";display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;","{",";}"],l.body1_medium,d.black,s.SM,l.heading_semibold),wt=n.p(["",";color:",";display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;","{",";}"],l.body2_regular,d.gray80,s.SM,l.body1_regular),yt=n.span(["align-self:flex-start;min-height:19px;padding:2px 6px;border-radius:25px;background-color:",";",";color:",";","{padding:4px 10px;",";}"],d.gray20,l.label_small_badge,d.gray80,s.SM,l.label_big_badge),St=n(Ne)(["display:flex;align-items:center;justify-content:center;gap:4px;margin-top:12px;width:100%;height:52px;background-color:",";border:1px solid ",";border-radius:8px;",";color:",";svg{width:16px;height:16px;}","{max-width:480px;margin:0 auto;}"],d.white,d.gray50,l.headline2_semibold,d.black,s.SM),jt=n.div(["width:100%;"]),h={Container:ut,Title:xt,DesktopMoreButton:mt,SwiperEventList:de,SwiperEventItem:ce,EventList:gt,EventItem:ht,ThumbnailWrapper:bt,InfoBox:Ct,EventName:ft,EventDescription:wt,CurrentEventBadge:yt,MoreButton:St,Pagination:jt},vt=({currentEventNo:t})=>{const{t:a}=$(),{isMobile:b}=H(),p=Te(),[r,y]=re(),C={page:{size:b?10:4,number:Number(r.get("pageNumber"))||1},order:{by:r.get("by")??"REGISTER_DATE",direction:r.get("direction")??"DESC"},eventYn:"N"},{data:x}=ke({searchParams:C}),u=i=>p(`${J.EVENTS.MAIN}/${i}`),v=()=>p(J.EVENTS.MAIN),o={slidesPerView:1.8,spaceBetween:12},m=c.useMemo(()=>((x==null?void 0:x.totalCount)??0)-1,[x]);return m===0?null:e.jsxs(h.Container,{children:[e.jsxs(h.Title,{children:[a("다른 기획전 보기"),!b&&e.jsxs(h.DesktopMoreButton,{onClick:()=>v(),children:[e.jsx("span",{children:a("기획전 더보기")}),e.jsx(X,{})]})]}),b?e.jsxs(e.Fragment,{children:[e.jsx(h.SwiperEventList,{...o,children:x==null?void 0:x.contents.map(i=>{const g=i.eventNo===t;return e.jsxs(h.SwiperEventItem,{onClick:()=>u(i.eventNo),children:[e.jsx(h.ThumbnailWrapper,{children:e.jsx("img",{src:i.mobileimageUrl||i.pcImageUrl,alt:i.label,loading:"lazy"})}),e.jsxs(h.InfoBox,{children:[e.jsx(h.EventName,{dangerouslySetInnerHTML:{__html:i.label}}),e.jsx(h.EventDescription,{dangerouslySetInnerHTML:{__html:i.promotionText||""}})]}),g&&e.jsx(h.CurrentEventBadge,{children:a("현재 기획전")})]},i.eventNo)})}),e.jsxs(h.MoreButton,{onClick:v,children:[e.jsx("span",{children:a("기획전 더보기")}),e.jsx(X,{})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(h.EventList,{children:x==null?void 0:x.contents.map(i=>{const g=i.eventNo===t;return e.jsxs(h.EventItem,{onClick:()=>u(i.eventNo),children:[e.jsx(h.ThumbnailWrapper,{children:e.jsx("img",{src:i.mobileimageUrl||i.pcImageUrl,alt:i.label,loading:"lazy"})}),e.jsxs(h.InfoBox,{children:[e.jsx(h.EventName,{children:i.label}),e.jsx(h.EventDescription,{children:i.promotionText})]}),g&&e.jsx(h.CurrentEventBadge,{children:a("현재 기획전")})]},i.eventNo)})}),e.jsx(h.Pagination,{children:e.jsx(Fe,{type:"extend",totalCount:m,currentPage:C.page.number,pageSize:C.page.size,onPageClick:i=>{const g=window.scrollY;y(E=>({...Object.fromEntries(E),pageNumber:i.toString()}),{replace:!0}),requestAnimationFrame(()=>{window.scrollTo({top:g})}),y(E=>({...Object.fromEntries(E),pageNumber:i.toString()}))}})})]})]})},Et=n.div(["display:flex;flex-direction:column;gap:12px;","{gap:24px;}"],s.SM);n.h3(["",";","{",";}"],l.article_bold,s.SM,l.title2_semibold);const Mt=n.ul(["width:100%;margin:0 auto;max-width:1400px;display:grid;grid-template-columns:repeat( ",",minmax(0,1fr) );grid-row-gap:40px;grid-column-gap:20px;align-items:stretch;& > li{height:100%;box-sizing:border-box;}","{max-width:100%;grid-template-columns:repeat( ",",minmax(0,1fr) );}"],({$columnsRepeatCount:t})=>t||5,s.SM,({$columnsRepeatCount:t})=>t||2),ee={Container:Et,ProductList:Mt},Nt=c.forwardRef(({sectionNo:t,eventNo:a,eventKey:b,setSectionList:p},r)=>{const[y]=re(),j=y.get("preview")==="true",{isMobile:C}=H(),{data:x}=_e({eventKey:b}),u=Ue({queries:L.DEFAULT_PAGE_NUMBER_LIST.map(o=>{const m={pageNumber:o,pageSize:L.DEFAULT_PAGE_SIZE,order:"ADMIN_SETTING",saleStatus:"RESERVATION_AND_ONSALE",includeStopProduct:!0,...j&&{preview:j}};return{queryKey:K.productSection(a,t,m),queryFn:async()=>{const{data:i}=await De.getEventProductDisplaySection(a,t,m);return i}}}),combine:o=>({sectionNo:o[0].data.sectionNo,productCount:o.reduce((m,{data:i})=>m+i.products.length,0),data:o.flatMap(({data:m})=>m.products),isLoading:o.some(({isLoading:m})=>m)})});c.useEffect(()=>{u&&u.data.length!==0&&p(o=>R([...o,u.sectionNo],Ve,se))},[u]);const v=c.useMemo(()=>x?R(x,te("section"),ae(o=>o.sectionNo===t),Ie,o=>C?(o==null?void 0:o.mobilePerRow)||L.MOBILE_PER_ROW:(o==null?void 0:o.pcPerRow)||L.PC_PER_ROW):C?L.MOBILE_PER_ROW:L.PC_PER_ROW,[x,C,t]);return u.productCount===0?e.jsx(e.Fragment,{}):e.jsx(ee.Container,{id:`${t}`,ref:r,children:e.jsx(ee.ProductList,{$columnsRepeatCount:v,children:u.data.map(o=>e.jsx("li",{children:e.jsx(Pe,{liked:o.liked,likeCount:o.likeCount,isSoldOut:o.isSoldOut,productName:o.productName,productNo:o.productNo,brandName:Le(o.brandNameKo)?"":`${o.brandNameKo}`,reviewRating:o.reviewRating,totalReviewCount:o.totalReviewCount,imageUrls:o.imageUrls,salePrice:o.salePrice,immediateDiscountAmt:o.immediateDiscountAmt,couponDiscountAmt:o.couponDiscountAmt,additionDiscountAmt:o.additionDiscountAmt,stickerInfos:o.stickerInfos,brandNo:o.brandNo,customProperties:o.customProperties.map(m=>({propName:m.propertyName,propType:m.propertyType,propValue:m.propertyValue,propNo:m.propertyNo,propValueNo:m.propertyValueNo,isMultipleSelection:!1}))},o.productNo)},`${t}-${o.productNo}`))})})}),Tt=n.div(["width:100%;max-width:1980px;margin:0 auto;img{display:block;margin:0 auto;width:auto;max-width:100%;object-fit:cover;}"]),kt=n.div([""]),_t=n.div(["& *{display:revert;"," line-height:170%;letter-spacing:-0.013em;}& b{display:inline-block !important;font-weight:600 !important;}"],Ae.pretendard),O={TopContainer:Tt,ImageContent:kt,Content:_t},It=({label:t,top:a})=>{const{t:b}=$(),{isMobile:p}=H();return e.jsxs(O.TopContainer,{children:[p?e.jsxs(e.Fragment,{children:[a.mobile.type==="FILE"&&a.mobile.url!==""&&e.jsx(O.ImageContent,{children:e.jsx("img",{src:a.mobile.url,alt:t})}),a.mobile.type==="HTML"&&e.jsx(O.Content,{dangerouslySetInnerHTML:{__html:a.mobile.url}})]}):e.jsxs(e.Fragment,{children:[a.pc.type==="FILE"&&a.pc.url!==""&&e.jsx(O.ImageContent,{children:e.jsx("img",{src:a.pc.url,alt:t})}),a.pc.type==="HTML"&&e.jsx(O.Content,{dangerouslySetInnerHTML:{__html:a.pc.url}})]}),(p&&!a.mobile.url||!p&&!a.pc.url)&&e.jsx(le,{style:{height:"50vh"},text:b("상세 내용이 없습니다.")})]})},Pt=c.memo(It),Lt=n.section(["width:100%;"]),Dt=n.div(["width:100%;margin:0 auto;","{max-width:1200px;}","{max-width:1440px;}"],s.SM,s.XXL),At=n.div(["padding:0 20px;"]);n.header(["display:flex;flex-direction:column;gap:12px;margin:0;padding:16px 0 12px;width:100%;border-bottom:1px solid ",";border-top:2px solid ",";margin-bottom:20px;","{padding:20px 0;margin-bottom:50px;}"],d.gray,d.black,s.SM);n.h1(["",";","{",";}"],l.body1_bold,s.SM,l.heading_bold);n.p(["",";color:",";> span{line-height:1.6;}","{",";> span{line-height:1.8;}}"],l.caption_regular,d.darkGray,s.SM,l.body1_regular);n.section(["padding:50px 0 20px;border-bottom:1px solid ",";","{padding:30px 0;}"],d.gray,s.SM);n.div(["img{display:block;width:100%;max-width:100%;}","{img{width:auto;margin:0 auto;}}"],s.SM);n.div(["img{display:block !important;max-width:100% !important;margin:0 auto !important;}"]);n.section([""]);n.div([""]);n.h2(["padding:30px 0 15px;",";text-align:center;","{padding:50px 0 20px;",";}"],l.body1_medium,s.SM,l.article_text);n.div(["display:flex;flex-wrap:wrap;justify-content:space-between;gap:30px 10px;> div{width:calc(50% - 5px);}> div > div:first-child > img{width:100%;max-width:100%;aspect-ratio:1 / 1;object-fit:contain;}","{justify-content:flex-start;gap:80px 40px;> div{width:calc((100% - 120px) / 4);}}"],s.SM);n.div([""]);const Bt=n.div(["display:flex;flex-direction:column;gap:60px;padding:0 20px;","{gap:60px;}"],s.SM),Ot=n.nav(["position:sticky;top:var(--header-top);z-index:10;width:calc(100% + 40px);margin-left:-20px;margin-bottom:20px;background-color:",";border-bottom:1px solid ",";","{width:calc(100vw - (var(--scrollbar-width) / 2));margin-left:calc(50% - 50vw);margin-bottom:60px;}"],d.white,d.gray20,s.SM),Rt=n.div(["width:100%;margin:0 auto;","{padding:0 20px;max-width:1200px;}","{max-width:1440px;}"],s.SM,s.XXL),pe=n(ie)(["width:100%;padding:0 20px;> div{width:fit-content;}","{padding:0;.swiper-wrapper{margin:0 auto;}}"],s.SM),ue=n(oe)(["width:auto;box-sizing:border-box;position:relative;button{width:100%;padding:16px 2px 12px;position:relative;color:",";"," "," ","{padding:16px 0 12px;"," ","}}"],d.gray60,l.headline1_regular,({$isSelected:t})=>t&&z(["color:",";"," border-bottom:2px solid ",";"],d.black,l.headline2_medium,d.black),s.SM,l.heading_semibold,({$isSelected:t})=>t&&z(["&::after{bottom:0;}"]));pe.displayName="SwiperWrapper";ue.displayName="SwiperSlide";const _={CouponContainer:At,EventContainer:Lt,EventInnerSection:Dt,ProductsContainer:Bt,StickyTab:Ot,TabListInner:Rt,TabList:pe,TabItem:ue},Wt=()=>{const{t}=$(),{isMobile:a}=H(),p=Be().eventKey,{data:r}=ze({eventKey:p,searchParams:{includeNonMemberCoupon:!0},options:{select:i=>(i==null?void 0:i.eventYn)==="N"?i:void 0}}),y=c.useMemo(()=>r?r.coupon.coupons.length>0:!1,[r]),j=c.useRef(new Map),[C,x]=c.useState([]),u=c.useMemo(()=>r?R(r.section,ne(i=>({label:i.label,sectionNo:i.sectionNo})),ae(i=>W(i.sectionNo,C)),se):[],[r,C]),v=({sectionTabList:i,activeSectionNo:g,onTabClick:E})=>{const[M,D]=c.useState(),A={slidesPerView:"auto",spaceBetween:a?12:18},I=c.useMemo(()=>i.findIndex(N=>N.sectionNo===g),[i,g]);return c.useEffect(()=>{M&&I!==-1&&M.slideTo(I)},[M,I]),e.jsx(_.StickyTab,{"aria-label":"기획전 섹션 메뉴",children:e.jsx(_.TabListInner,{children:e.jsx(_.TabList,{...A,onSwiper:D,role:"tablist",children:i.map(N=>e.jsx(_.TabItem,{role:"presentation",$isSelected:g===N.sectionNo,children:e.jsx("button",{role:"tab","aria-selected":g===N.sectionNo,onClick:()=>{E(N.sectionNo)},children:e.jsx("span",{children:N.label})})},N.sectionNo))})})})},o=Oe(),m=c.useCallback(i=>{const g=j.current.get(`${i}`);if(!g)return;const M=parseFloat(getComputedStyle(document.body).getPropertyValue("--header-top")||"0"),D=g.getBoundingClientRect(),A=window.scrollY,I=D.top+A-M;o==null||o.scrollTo(I)},[]);return r?e.jsx(_.EventContainer,{children:e.jsxs(G,{gap:a?"60px":"90px",children:[r==null?void 0:r.orders.map(i=>i==="TOP"?e.jsx(Pt,{label:r.label,top:r.top},"TOP"):null),e.jsx(_.EventInnerSection,{children:e.jsxs(G,{gap:a?"60px":"90px",children:[r==null?void 0:r.orders.map(i=>i==="COUPONS"&&y?e.jsx(_.CouponContainer,{children:e.jsx(pt,{couponInfo:r.coupon,eventNo:r.eventNo,title:t("한 번 더 할인! 기획전 쿠폰 받기"),showTitle:!1})},"COUPONS"):i==="SECTIONS"&&!Re(r.section)?e.jsx(_.ProductsContainer,{children:r.section.map(({sectionNo:g})=>{const E=W(g,C);return e.jsxs("div",{style:{display:E?"block":"none"},ref:M=>{M&&j.current.set(`${g}`,M)},children:[u.length>0&&e.jsx(v,{sectionTabList:u,activeSectionNo:g,onTabClick:m}),e.jsx($e,{children:e.jsx(Nt,{eventKey:p,eventNo:r.eventNo,sectionNo:g,setSectionList:x})})]},g)})},"SECTIONS"):null),e.jsx(vt,{currentEventNo:r.eventNo})]})})]})}):e.jsx(le,{text:t("존재하지 않는 기획전입니다.")})};export{Wt as default};