"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8867],{75445:function(e,t,l){l.d(t,{Z:function(){return P}});var r=l(828),n=l(10972),i=l(52379),s=l.n(i),a=l(97176),c=l(43838),o=c.jU?a.useLayoutEffect:a.useEffect,u={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};var d=c.jU&&"undefined"!==typeof window.ResizeObserver?function(){var e=(0,a.useState)(null),t=e[0],l=e[1],r=(0,a.useState)(u),n=r[0],i=r[1],s=(0,a.useMemo)((function(){return new window.ResizeObserver((function(e){if(e[0]){var t=e[0].contentRect,l=t.x,r=t.y,n=t.width,s=t.height,a=t.top,c=t.left,o=t.bottom,u=t.right;i({x:l,y:r,width:n,height:s,top:a,left:c,bottom:o,right:u})}}))}),[]);return o((function(){if(t)return s.observe(t),function(){s.disconnect()}}),[t]),[l,n]}:function(){return[c.ZT,u]},f=l(57851),h=l(26042),m=function(e){var t=e.merchant,l=e.width,r=e.height;return(0,n.jsx)("a",{href:t.internalClickUrl,rel:"noopener noreferrer",target:"_blank",className:"mt-1 rounded-md",children:(0,n.jsx)("div",{className:"inline-flex shrink-0 overflow-hidden rounded-md bg-gradient-1 bg-cover bg-center p-2 text-black/[0.8] flex-center",style:(0,h.Z)({},l?{width:l}:{},r?{height:r}:{}),children:(0,n.jsx)("p",{className:"w-full break-words text-center text-buttons-lg font-bold",children:t.name})},t.id)})},x=l(33085),p=l(55688),w=l(74058),v=l.n(w),g=l(32010),j=l(99826),b=l(64804),N=l(29381),y=l(70569),k=l(31146),C=l(14538),M=function(e){var t=e.collection,l=e.className,r=e.width,i=e.height,c=e.aspectRatio,o=e.hideTimestamp,u=(0,g.useRouter)(),d=(0,a.useMemo)((function(){return(0,n.jsx)("div",{className:"absolute bottom-5 right-4 flex max-w-full justify-end gap-2 opacity-0 group-focus-within:opacity-100 group-hover:opacity-100",children:(0,n.jsx)(y.Z,{sharable:t,above:!0})})}),[t]),m=(0,a.useMemo)((function(){return(0,n.jsxs)("div",{className:"mt-2 flex w-full flex-1 flex-row items-start justify-start gap-2 overflow-hidden px-3",style:(0,h.Z)({},r?{width:r}:{}),children:[(t.visibility===j.u2U.Private||t.giftable)&&(0,n.jsxs)("div",{className:"mr-1 flex flex-row items-center gap-1",children:[t.visibility===j.u2U.Private&&(0,n.jsx)("div",{className:"relative h-4 w-4",children:(0,n.jsx)(s(),{alt:"private",src:x.mB,layout:"fill",priority:!0})}),t.giftable&&(0,n.jsx)("div",{className:"relative h-4 w-4",children:(0,n.jsx)(s(),{alt:"giftable",src:x.Og,layout:"fill",priority:!0})})]}),(0,n.jsxs)("div",{className:"flex w-full max-w-full flex-col",children:[(0,n.jsx)("p",{className:"flex max-h-10 w-full max-w-full flex-row truncate whitespace-normal text-body-sm font-medium",children:t.name}),"/users/[username]"!==u.route&&(0,n.jsxs)("p",{className:"text-body-sm text-grey",children:[(0,n.jsx)("span",{children:"by "}),(0,n.jsx)(v(),{href:t.user.path,passHref:!0,shallow:!0,children:(0,n.jsx)("a",{className:"underline",children:(0,n.jsx)(k.Z,{user:t.user})})})]}),!o&&(0,n.jsx)("div",{className:"rounded-full",children:(0,n.jsx)("p",{className:"text-body-sm text-light-grey",children:"".concat((0,N.VG)(t.updatedAt))})})]})]})}),[t,o,u.route,r]);return(0,n.jsxs)(C.Z,{className:l,children:[(0,n.jsxs)("div",{className:(0,f.m)("group relative h-80"),style:(0,h.Z)({},r?{width:r}:{},i?{height:i}:{},c?{aspectRatio:c}:{}),children:[(0,n.jsx)(v(),{href:t.path,className:"h-full w-full",shallow:!0,children:(0,n.jsx)("a",{className:"h-full w-full cursor-pointer",children:(0,n.jsx)("div",{className:"relative h-full w-full rounded-lg bg-black/5",children:(0,n.jsx)(s(),{src:t.previewProducts.length>0?(0,N.Kc)(t.previewProducts[0]):b.uT,unoptimized:!0,className:"rounded-lg object-cover",layout:"fill",alt:"Gradient"})})})}),d]}),m]})},Z=(0,a.memo)(M),_=l(81333),R=l(83267),E=l(49676),P=function(e){var t=e.pageName,l=e.items,i=e.columnCount,c=e.itemAspect,o=e.title,u=e.emptyTitle,h=e.columnCountBreakPoints,w=e.hideHeader,v=e.expandable,g=e.forceExpand,j=e.noHorizontalPadding,b=e.headerBreak,N=e.maxWidth,y=e.hideTimestamp,k=e.viewAllClicked,C=e.featuredItem,M=e.featuredItemClicked,P=e.loading,T=e.loadingCount,A=e.headerLayout,B=(0,a.useRef)(null),O=(0,a.useState)(!1),S=O[0],U=O[1],z=(0,R.f)(),H=z.breakpoint,L=z.screenWidth,V=(0,r.Z)(d(),2),F=V[0],G=V[1].width,I=(0,a.useMemo)((function(){return N?Math.min(G,N):G}),[N,G]),W=(0,a.useMemo)((function(){return g||S}),[g,S]),K=(0,a.useMemo)((function(){if(j)return 0;switch(H){case"none":return 16;case"sm":return 40;default:return 64}}),[H,j]),q=(0,a.useMemo)((function(){return["none","sm"].includes(H)?16:24}),[H]),D=(0,a.useMemo)((function(){var e=null;if(h){var t=Object.keys(h);if(t.sort((function(e,t){return+e-+t})),t.forEach((function(t){L<+t&&(e=e||h[+t])})),!e){var l=t[t.length-1];e=h[+l]}return e}return i||3}),[L,i,h]),J=(0,a.useMemo)((function(){return(I-2*K-q*(D-1))/D}),[K,q,D,I]),Q=(0,a.useMemo)((function(){return J*(c||.75)}),[J,c]),X=function(e){var t,l;"left"===e?null===(t=B.current)||void 0===t||t.scrollBy({behavior:"smooth",left:-(J+q)}):null===(l=B.current)||void 0===l||l.scrollBy({behavior:"smooth",left:J+q})};return(0,n.jsxs)("div",{className:"flex w-full flex-col",ref:F,children:[!w&&(0,n.jsxs)("div",{className:(0,f.m)("mt-8 flex flex-row gap-6 px-4 sm:px-10 md:px-16",j&&"!px-0"),children:[(0,n.jsx)("div",{className:(0,f.m)("text-h4"),children:o}),l.length>D&&v&&(0,n.jsx)("button",{className:"shrink-0 text-buttons-md underline",onClick:function(){U((function(e){return!e}))},children:"View All"}),"compact"!==A?(0,n.jsx)("div",{className:"w-full"}):null,!W&&l.length>D&&v&&(0,n.jsxs)("div",{className:"flex flex-row gap-3",children:[(0,n.jsx)("button",{className:"h-9 w-9 rounded-full border border-beige flex-center",onClick:function(){X("left")},children:(0,n.jsx)("div",{className:"relative h-5 w-5 flex-center",children:(0,n.jsx)(s(),{src:x.gl,alt:"left arrow icon",layout:"fill"})})}),(0,n.jsx)("button",{className:"h-9 w-9 rounded-full border border-beige flex-center",onClick:function(){X("right")},children:(0,n.jsx)("div",{className:"relative h-5 w-5 flex-center",children:(0,n.jsx)(s(),{src:x.CH,alt:"right arrow icon",layout:"fill"})})})]}),!v&&(0,n.jsx)("button",{className:"shrink-0 text-buttons-md underline",onClick:function(){null===k||void 0===k||k()},children:"View All"})]}),b&&(0,n.jsx)("hr",{className:"mt-4 h-px w-full bg-black"}),P?(0,n.jsx)("div",{ref:B,className:(0,f.m)("relative mt-6 flex w-full flex-row gap-4 overflow-x-auto px-4 pb-4 sm:px-10 md:gap-6 md:px-16",W?" flex-wrap":"",j&&"!px-0"),children:new Array(T).fill(0).map((function(e,t){return(0,n.jsx)(E.O.Box,{style:{width:J,height:Q}},t)}))}):l.length>0?(0,n.jsxs)("div",{ref:B,className:(0,f.m)("relative mt-6 flex w-full flex-row gap-4 overflow-x-auto px-4 pb-4 sm:px-10 md:gap-6 md:px-16",W?" flex-wrap":"",j&&"!px-0"),children:[C?(0,n.jsx)(p.Z,{collage:C,height:Q,width:Q*(5/7),hideCreator:!0,hideSharing:!0,onClick:function(){null===M||void 0===M||M()},isFeatured:!0}):null,l.map((function(e){return"Collection"===e.__typename?(0,n.jsx)(Z,{width:J,height:Q,aspectRatio:1.33,collection:e,hideTimestamp:y},e.id):"SavedProduct"===e.__typename?(0,n.jsx)(_.Z,{width:J,height:Q,product:e,pageName:t},e.id):"Merchant"===e.__typename?(0,n.jsx)(m,{merchant:e,width:J,height:Q},e.id):(0,n.jsx)(n.Fragment,{})}))]}):(0,n.jsx)("div",{className:"mt-6 h-40 w-full px-4 pb-4 flex-center sm:px-10 md:px-16",children:(0,n.jsx)("p",{className:"w-fit rounded-xxs bg-cream px-4 py-2",children:u||"Empty..."})})]})}},59377:function(e,t,l){l.d(t,{Z:function(){return i}});var r=l(10972),n=(l(97176),l(82336)),i=function(){return(0,r.jsx)("div",{role:"status",className:"w-full p-8 flex-center",children:(0,r.jsxs)("div",{className:"rounded-sm bg-black/5 p-6 text-center flex-center",children:[(0,r.jsx)("div",{className:"scale-150",children:(0,r.jsx)(n.T,{className:"mx-auto fill-redorange text-black/15"})}),(0,r.jsx)("p",{className:"mt-4 text-eyebrows",children:"Loading more..."})]})})}}}]);