1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2656],{16100:(e,t,n)=>{n.d(t,{R:()=>o});var r=n(82666);function o(e,t){let[n,,o]=(0,r.M)("recentlyViewedLots",[]);n.length&&!e.length&&(t(n.map(e=>Number(e.lotUniqueId))),o())}},34731:(e,t,n)=>{n.d(t,{a:()=>o});var r=n(35365);async function o(e,t){let n=new URL("/api/departments/v1/",e);t&&(n.search=new URLSearchParams(Object.entries(t).filter(e=>{let[,t]=e;return void 0!==t}).map(e=>{let[t,n]=e;return[t,n.toString()]})).toString());try{return(await r.SP.get(n.toString(),{baseURL:e})).data}catch(e){return null}}},62656:(e,t,n)=>{n.r(t),n.d(t,{DynamicHomePageComponents:()=>Z});var r=n(6029),o=n(31287),l=n(82666),i=n(82281),a=n.n(i),c=n(55729),d=n(34731),s=n(74636),p=n(31520),u=n(7612),m=n(38829),g=n(16520),h=n(19357),f=n(98638),x=n(63283),w=n(47947);let y=h.Ay.ol.withConfig({componentId:"sc-eacc6dd3-0"})(["display:grid;gap:10px;margin-top:20px;margin-bottom:30px;","{grid-template-columns:1fr;margin-top:25px;}","{grid-template-columns:1fr 1fr;margin-top:25px;}","{grid-template-columns:1fr 1fr 1fr;gap:12px;margin-top:35px;}"],e=>{let{theme:t}=e;return t.media.up.xs},e=>{let{theme:t}=e;return t.media.up.lg},e=>{let{theme:t}=e;return t.media.up.xl}),v=h.Ay.div.withConfig({componentId:"sc-eacc6dd3-1"})(["border:1px solid transparent;border-radius:2px;background:",";display:grid;grid-template-columns:max-content 1fr;align-items:center;gap:6px;padding:6px;position:relative;isolation:isolate;","{gap:12px;}"],e=>{let{theme:t}=e;return t.colours.grey[15]},e=>{let{theme:t}=e;return t.media.up.xl}),b=h.Ay.div.withConfig({componentId:"sc-eacc6dd3-2"})(["display:grid;place-items:center;position:relative;width:48px;height:48px;*{grid-column:1/-1;grid-row:1/-1;}"]),j=(0,h.Ay)(x.M).withConfig({componentId:"sc-eacc6dd3-3"})(["border-radius:2px;object-fit:cover;"]),C=(0,h.Ay)(w.r).withConfig({componentId:"sc-eacc6dd3-4"})(["&:hover{text-decoration:none;}"]),I=h.Ay.div.withConfig({componentId:"sc-eacc6dd3-5"})(["display:flex;"]),A=(0,h.Ay)(s.nB).withConfig({componentId:"sc-eacc6dd3-6"})(["overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;"]),k=(0,h.Ay)(s.nB).withConfig({componentId:"sc-eacc6dd3-7"})(["margin-left:5px;"]),S=(0,h.Ay)(f.L).withConfig({componentId:"sc-eacc6dd3-8"})(["color:",";"],e=>{let{theme:t}=e;return t.colours.primary.black}),L=h.Ay.div.withConfig({componentId:"sc-eacc6dd3-9"})(["justify-self:center;"]),_=JSON.parse('{"sl_translate":"sl_all","homepage.discover.title":"Discover more","homepage.discover.showAll":"Show all","homepage.discover.categories":"categories"}'),{publicRuntimeConfig:R}=a()(),{text:V}=(0,u.r)(_),N=(e,t)=>e.lotCount>t.lotCount?-1:1;function M(){var e;let[t,n]=(0,c.useState)(null),[o,l]=(0,c.useState)(!1),{data:i,isFetched:a}=(0,g.Qo)({startingPage:0,filters:{chronology:"future",excludeWithdrawn:!0,per_page:0,facet_by:"department.code"},enabled:!0}),u=null==i||null==(e=i.pages[0])?void 0:e.facet_counts,h=(0,c.useMemo)(()=>{var e;return null==(e=(0,m.c7)(u))?void 0:e["department.code"]},[u]);return(0,c.useEffect)(()=>{a&&h&&(0,d.a)(R.WEB_API_URL,{codes:Object.keys(h),fields:["interestImage","departmentName"]}).then(e=>{n(((null==e?void 0:e.map(e=>({...e,lotCount:h[e.department]})))||[]).sort(N))})},[a,h]),h&&(null==t?void 0:t.length)?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.DZ,{$level:3,as:"h2",children:V("homepage.discover.title")}),(0,r.jsx)(y,{children:t.slice(0,o?t.length:Math.min(15,t.length)).map((e,t)=>{let{lotCount:n,departmentName:o,interestImage:l}=e;return(0,r.jsx)(O,{departmentName:o,imageUrl:(null==l?void 0:l.url)&&"".concat(l.url,"&width=96"),lotCount:n},"initially-shown-".concat(t))})}),!o&&t.length>15&&(0,r.jsx)(L,{children:(0,r.jsxs)(S,{variant:"label",size:"L",onClick:()=>l(!0),children:[V("homepage.discover.showAll"),(0,r.jsx)(p.A,{children:V("homepage.discover.categories")})]})})]}):null}let O=e=>{let{departmentName:t,imageUrl:n,lotCount:o}=e;return(0,r.jsx)("li",{"aria-label":"".concat(t," (").concat(o,")"),children:(0,r.jsx)(C,{href:"/search/?departments=".concat(encodeURIComponent(t),"#lot-search-results"),children:(0,r.jsxs)(v,{children:[(0,r.jsx)(b,{children:(0,r.jsx)(j,{fill:!0,src:n||"",alt:""})}),(0,r.jsxs)(I,{children:[(0,r.jsx)(A,{$level:"M",children:t}),(0,r.jsxs)(k,{$level:"M",children:["(",o,")"]})]})]})})})};var U=n(77225),D=n(18226);let E=h.Ay.div.withConfig({componentId:"sc-c76e31eb-0"})(["padding-top:70px;margin-bottom:30px;",""],e=>{let{theme:t}=e;return(0,h.AH)(["","{display:flex;justify-content:space-between;}"],t.media.up.md)}),P=(0,h.Ay)(s.DZ).withConfig({componentId:"sc-c76e31eb-1"})(["margin-bottom:20px;"]),B=(0,h.Ay)(D.Y).withConfig({componentId:"sc-c76e31eb-2"})([""]),F=(0,h.Ay)(U.h).withConfig({componentId:"sc-c76e31eb-3"})(["margin-bottom:70px;","{width:100%;","}"],B,e=>{let{theme:t}=e;return(0,h.AH)(["","{width:275px;}"],t.media.up.md)}),J=JSON.parse('{"sl_translate":"sl_all","homepage.recentlyViewed.title":"Recently viewed","homepage.recentlyViewed.clear":"Clear"}'),{text:H}=(0,u.r)(J),$=e=>{let{recentlyViewedLots:t,setRecentlyViewLotIds:n}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(E,{children:[(0,r.jsx)(P,{$level:3,as:"h2",children:H("homepage.recentlyViewed.title")}),(0,r.jsx)(f.L,{variant:"label",onClick:()=>n([]),children:H("homepage.recentlyViewed.clear")})]}),(0,r.jsx)(F,{fullWidthItems:"mobileOnly",alignment:"baseline",isDesktopOnly:!0,children:t.map(e=>(0,r.jsx)(B,{isShowingLotId:!1,isFollowButtonDisplayed:!1,lot:e,lotTracking:{category:"Home Page - Recently Viewed Lots"},showBidding:!1},"".concat(e.lotUniqueId,"-recentlyViewedLot")))})]})};var q=n(16100),W=n(72921);let Z=()=>{let[e,t]=(0,l.M)("recentlyViewedLotIds",[]);(0,q.R)(e,t);let{data:n}=(0,g.tJ)({lotUniqueIds:e,keepPreviousData:!1}
1),i=null==n?void 0:n.filter(Boolean);return(0,r.jsxs)(r.Fragment,{children:[i&&!!i.length&&(0,r.jsx)(o.o,{background:"white",verticalSpacing:"top-only",children:(0,r.jsx)($,{recentlyViewedLots:i.map(e=>(0,W.d)(e)),setRecentlyViewLotIds:t})}),(0,r.jsx)(o.o,{children:(0,r.jsx)(M,{})})]})}},82666:(e,t,n)=>{n.d(t,{M:()=>l});var r=n(55729);function o(e){let t=(0,r.useRef)(e);return(0,r.useLayoutEffect)(()=>{t.current=e},[e]),(0,r.useCallback)(function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.current(...n)},[t])}function l(e,t){let n="bonhams-web_"+e,l=(0,r.useCallback)(()=>{try{let e=window.localStorage.getItem(n);return e?function(e){try{return"undefined"===e?void 0:JSON.parse(e)}catch(t){console.warn("parsing error on",{value:e});return}}(e):t}catch(e){return t}},[t,n]),[i,a]=(0,r.useState)(l),c=o(e=>{try{let t=e instanceof Function?e(i):e;window.localStorage.setItem(n,JSON.stringify(t)),a(t)}catch(e){console.warn("Error setting localStorage key â".concat(n,"â:"),e)}}),d=o(()=>window.localStorage.removeItem(n));return(0,r.useEffect)(()=>{a(l())},[]),[i,c,d]}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.