1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[190],{48132:function(e,t,r){r.d(t,{L:function(){return W}});var n=r(52322),o=r(2784),i=r(43036),a=r(5288),l=r(80684),s=r(8782),c=r(43580),d=r(97421),u=r(46956),f=r(30686);let p=c.ZP.li.withConfig({componentId:"sc-cf399775-0"})(["padding:17px 15px;display:flex;flex-direction:column;gap:8px;border-radius:","px;border:1px solid ",";background-color:",";list-style-type:none;min-width:265px;scroll-snap-align:start;width:auto;@media (min-width:768px){margin:0;width:33.3333%;","}&:last-of-type{margin-right:0;}"],e=>e.theme.global.border_radius,e=>e.theme.global.primary_border_color,e=>e.theme.location_card.background_color,e=>{let{$visibleDesktopCards:t}=e;return 2==t&&"\n min-width: 45%\n "}),h=c.ZP.header.withConfig({componentId:"sc-cf399775-1"})(["display:flex;justify-content:space-between;"]),g=c.ZP.h3.withConfig({componentId:"sc-cf399775-2"})(e=>{let{theme:t}=e;return{margin:0,fontSize:"14px",fontWeight:"800",lineHeight:"21px",color:t.buttons.primary_button_background_color}}),b=c.ZP.span.withConfig({componentId:"sc-cf399775-3"})(e=>{let{theme:t}=e;return{backgroundColor:t.buttons.primary_button_background_color,borderRadius:"".concat(t.buttons.primary_button_border_radius,"px"),fontSize:"11px",padding:"3px 10px",whiteSpace:"nowrap",display:"flex",justifyContent:"center",alignItems:"center",...(0,u.l)(t.buttons.primary_font,["font_family","font_weight","color"],{color:e=>"revert"===e||null===e?(0,f.F)(s.XV)(t.buttons.primary_button_background_color):e})}}),m=c.ZP.span.withConfig({componentId:"sc-cf399775-4"})(e=>{let{theme:t}=e;return{display:"block",fontSize:"13px",...(0,u.l)(t.location_card.secondary_font,["font_family","color","line_height"])}}),v=c.ZP.p.withConfig({componentId:"sc-cf399775-5"})(e=>{let{theme:t}=e;return{margin:0,fontSize:"13px",opacity:.7,...(0,u.l)(t.location_card.secondary_font,["font_family","color","line_height"]),"@supports (-webkit-line-clamp: 2)":{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"}}}),x=(0,c.ZP)(d.Db).withConfig({componentId:"sc-cf399775-6"})(["margin-top:auto;width:100%;"]);var y=r(23314),_=r(59047),w=r(22427),j=r(16251);let k=e=>{var t;let{orderDetails:r,showReorderReceipt:o,visibleDesktopCards:i}=e,s=_.NX[r.order_data.basket.conveyance_type.type]||l.P8.PICKUP;return(0,n.jsxs)(p,{$visibleDesktopCards:i,children:[(0,n.jsxs)(h,{children:[(0,n.jsx)(g,{children:(0,j.p6)(r.order_data.order.ordered_at,y.z.SHORT_WRITTEN_DATE)}),(0,n.jsx)(b,{children:s})]}),(0,n.jsx)(m,{children:null===(t=r.store_location)||void 0===t?void 0:t.label}),(0,n.jsx)(v,{children:(0,w.Mf)(r.order_data.basket.basket_items)}),(0,n.jsx)(x,{$buttonTheme:"primary",$submitting:!1,onClick:()=>{o(r)},"aria-label":"Reorder order #".concat(r.order_data.order.order_number),children:(0,n.jsx)(a.Z,{accessor:"reorders.reorder_cta"})})]})};var C=r(39097),E=r.n(C);let L=c.ZP.div.withConfig({componentId:"sc-1b749798-0"})([""," flex-grow:var(--reorder-view-all-container__flex-grow);margin:0 0 0 auto;text-align:right;"],e=>{let{expand:t}=e;return"\n --reorder-view-all-container__flex-grow: ".concat(t?"1":"auto",";\n ")}),Z=c.ZP.a.withConfig({componentId:"sc-1b749798-1"})(e=>{let{theme:t}=e;return{textDecoration:"underline",fontSize:"14px",lineHeight:"24px",color:t.buttons.primary_button_background_color}});var P=r(90736);let z=e=>{let{expand:t}=e;return(0,n.jsx)(L,{expand:t,children:(0,n.jsx)(E(),{href:P.xM.ORDER_HISTORY,passHref:!0,legacyBehavior:!0,children:(0,n.jsx)(Z,{children:(0,n.jsx)(a.Z,{accessor:"reorders.view_all_past_orders_cta"})})})})};var I=r(124),S=r(80295),R=r(75470),D=r(15066),M=r(45694);let W=e=>{let{locationID:t,ordersToDisplay:r=3,collapsible:l=!0,showIcon:s=!0,visibleDesktopCards:c}=e,d=(0,R.v9)(e=>e.app.me.pastOrders),u=(0,R.v9)(e=>e.app.basket.orderCompleted),f=(0,R.I0)(),[p,h]=(0,o.useState)(!1),[g,b]=(0,o.useState)(!1),[m,v]=(0,o.useState)(!0),[x,y]=(0,o.useState)(!1),_=(0,o.useRef)(null),w=(0,o.useRef)(null),j=(0,o.useRef)(null),C=(0,M.WJ)(d,t).slice(0,r);(0,o.useEffect)(()=>{let e=w.current;if(!e)return;let t=!1,r=0,n=0,o=o=>{t=!0,r=o.pageX,n=e.scrollLeft},i=o=>{t&&(o.preventDefault(),e.scrollLeft=n-(o.pageX-r))},a=()=>{t=!1},l=e=>{e.preventDefault()};return e.addEventListener("mousedown",o),e.addEventListener("mousemove",i),e.addEventListener("mouseup",a),e.addEventListener("mouseleave",a),e.addEventListener("dragstart",l),()=>{e.removeEventListener("mousedown",o),e.removeEventListener("mousemove",i),e.removeEventListener("mouseup",a),e.removeEventListener("mouseleave",a),e.removeEventListener("dragstart",l)}},[C.length]),(0,o.useEffect)(()=>{let e;let t=w.current;if(!t)return;let r=()=>{let e=t.scrollWidth-t.clientWidth;b(e>1),v(t.scrollLeft<=1),y(t.scrollLeft>=e-1)};return r(),t.addEventListener("scroll",r,{passive:!0}
1),"undefined"!=typeof ResizeObserver?((e=new ResizeObserver(r)).observe(t),t.children[1]&&e.observe(t.children[1])):window.addEventListener("resize",r),()=>{t.removeEventListener("scroll",r),window.removeEventListener("resize",r),null==e||e.disconnect()}},[C.length]),(0,o.useEffect)(()=>{let e=w.current;if(!e)return;let t=()=>{let t=j.current;null!==t&&1>=Math.abs(e.scrollLeft-t)&&(j.current=null)},r=()=>{j.current=null};return e.addEventListener("scroll",t,{passive:!0}),e.addEventListener("scrollend",r),()=>{e.removeEventListener("scroll",t),e.removeEventListener("scrollend",r)}},[C.length]),(0,o.useEffect)(()=>{u&&f(D.default.fetchMePastOrders())},[u]);let E=e=>{var t;let r=w.current;if(!r)return;let n=r.children[1],o=window.getComputedStyle(r),i=parseFloat(o.columnGap||o.gap||"0")||0,a=n?n.getBoundingClientRect().width:0,l=a>0?a+i:.8*r.clientWidth,s=r.scrollWidth-r.clientWidth,c=Math.max(0,Math.min((null!==(t=j.current)&&void 0!==t?t:r.scrollLeft)+e*l,s));j.current=c,r.scrollTo({left:c,behavior:"smooth"})},L=e=>{f(D.default.fetchMeOrderDetailsSuccess(e)),f(D.default.toggleReorderReceipt(!0))},Z=()=>{h(!p)};if(!C.length)return null;let P="recent-orders";return(0,n.jsxs)("div",{ref:_,className:"koala__ui-reorders-container-div",children:[(0,n.jsxs)(S.K,{overrides:{margin:"var(--size-4) 0"},children:[s&&(0,n.jsx)(i.Y8,{title:"History icon"}),(0,n.jsx)(a.Z,{tag:i.rS,accessor:"reorders.recent_orders_title"}),(0,n.jsx)(z,{expand:l}),l&&(0,n.jsx)(i.SR,{onClick:()=>Z(),invert:p,"aria-expanded":!p,"aria-controls":P,id:"controls-".concat(P)})]}),g&&!p&&(0,n.jsxs)(i.Dj,{role:"group","aria-label":"Recent orders navigation",children:[(0,n.jsx)(i.QW,{type:"button",$back:!0,onClick:()=>!m&&E(-1),"aria-disabled":m,"aria-controls":P,"aria-label":"Previous orders",children:(0,n.jsx)(I.Z.Caret,{title:"Previous orders","aria-hidden":"true"})}),(0,n.jsx)(i.QW,{type:"button",onClick:()=>!x&&E(1),"aria-disabled":x,"aria-controls":P,"aria-label":"Next orders",children:(0,n.jsx)(I.Z.Caret,{title:"Next orders","aria-hidden":"true"})})]}),(0,n.jsx)(i.xd,{collapse:p,role:"region",tabIndex:-1,id:P,children:(0,n.jsxs)(i.ck,{ref:w,style:{cursor:"grab"},children:[(0,n.jsx)(i.b$,{}),C.map((e,t)=>(0,n.jsx)(k,{orderDetails:e,showReorderReceipt:L,visibleDesktopCards:c},"".concat(e.id,"-").concat(t))),(0,n.jsx)(i.b$,{})]})})]})}},43036:function(e,t,r){r.d(t,{b$:function(){return p},SR:function(){return f},xd:function(){return s},Y8:function(){return u},Dj:function(){return h},rS:function(){return d},ck:function(){return c},QW:function(){return g}});var n=r(43580),o=r(36525),i=r(46956),a=r(52322);let l="0.35s",s=n.ZP.div.withConfig({componentId:"sc-2880b0fd-0"})(["max-height:300px;transition:max-height "," ease-in-out,visibility 0s 0s;",""],l,e=>{let{collapse:t}=e;return t&&"\n max-height: 0px;\n visibility: hidden;\n transition: max-height ".concat(l," ease-in-out, visibility 0s ").concat(l,";\n ")}),c=n.ZP.ul.withConfig({componentId:"sc-2880b0fd-1"})(["display:flex;flex-direction:row;gap:var(--size-2);margin:0 var(--neg-size-5) 0 var(--neg-size-5);padding:0;overflow-x:auto;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{-webkit-appearance:none;display:none;height:0;width:0;}"]),d=n.ZP.h2.withConfig({componentId:"sc-2880b0fd-2"})(e=>{let{theme:t}=e;return{margin:0,...(0,i.l)(t.location_search.tertiary_font,["font_family","font_size"]),color:"".concat(t.buttons.primary_button_background_color,"!important")}}),u=(0,n.ZP)(e=>{let{title:t,width:r,height:n,...o}=e;return(0,a.jsxs)("svg",{...o,width:null!=r?r:"24",height:null!=n?n:"24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,a.jsx)("title",{children:null!=t?t:"Exclamation Circle"}),(0,a.jsx)("path",{d:"M12.925 2.843a9.096 9.096 0 0 0-8.769 6.845l-.609-.921a.832.832 0 1 0-1.389.915l1.832 2.776a.902.902 0 0 0 .528.354c.217.043.443 0 .629-.121l2.747-1.85a.832.832 0 1 0-.928-1.382l-1.25.843a7.416 7.416 0 1 1 7.21 9.19 7.402 7.402 0 0 1-6.062-3.182.833.833 0 1 0-1.365.952A9.058 9.058 0 0 0 22 12a9.127 9.127 0 0 0-9.073-9.157Z",fill:"currentColor"}),(0,a.jsx)("path",{d:"M12.842 6.963a.833.833 0 0 0-.832.833V12c.003.22.09.43.244.588l2.497 2.52a.844.844 0 0 0 1.177.006.832.832 0 0 0 .005-1.177l-2.258-2.28V7.797a.833.833 0 0 0-.833-.833Z",fill:"currentColor"})]})}).withConfig({componentId:"sc-2880b0fd-3"})(["color:",";margin-right:5px;"],e=>{let{theme:t}=e;return t.buttons.primary_button_background_color}),f=n.ZP.button.withConfig({componentId:"sc-2880b0fd-4"})(["margin-left:8px;background-color:transparent;border:none;cursor:pointer;padding:var(--size-1);position:relative;&::after{content:'';display:block;position:relative;height:","px;border-bottom:1.5px solid ",";border-right:1.5px solid ",";transform:rotate(225deg) translateX(-25%) translateY(-25%);transition:transform "," ease-in-out;width:","px;","}"],o.jl.XS,e=>e.theme.global.primary_active_color,e=>e.theme.global.primary_active_color,l,o.jl.XS,e=>{let{invert:t}=e;return t&&"\n transform: rotate(45deg);\n "}),p=n.ZP.li.withConfig({componentId:"sc-2880b0fd-5"})(["flex:0 0 var(--size-3);height:var(--size-5);list-style-type:none;width:var(--size-3);"]),h=n.ZP.div.withConfig({componentId:"sc-2880b0fd-6"})(["display:flex;justify-content:flex-end;
1gap:var(--size-1);margin:0 0 var(--size-2);"]),g=n.ZP.button.withConfig({componentId:"sc-2880b0fd-7"})(["all:unset;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;padding:var(--size-1);border-radius:4px;cursor:pointer;color:",";transition:background-color 0.2s ease,opacity 0.2s ease;svg{display:block;","}&:hover:not([aria-disabled='true']){background-color:rgba(0,0,0,0.08);}&:focus-visible{outline:2px solid ",";outline-offset:2px;}&[aria-disabled='true']{cursor:default;opacity:0.2;background-color:transparent;}"],e=>{let{theme:t}=e;return t.buttons.primary_button_background_color},e=>{let{$back:t}=e;return t&&"transform: rotate(180deg);"},e=>{let{theme:t}=e;return t.global.primary_active_color})},78914:function(e,t,r){function n(e){return e.state.isPaused}function o(e){return"success"===e.state.status}function i(e,t={}){let r=[],i=[];if(!1!==t.dehydrateMutations){let o=t.shouldDehydrateMutation||n;e.getMutationCache().getAll().forEach(e=>{o(e)&&r.push({mutationKey:e.options.mutationKey,state:e.state})})}if(!1!==t.dehydrateQueries){let r=t.shouldDehydrateQuery||o;e.getQueryCache().getAll().forEach(e=>{r(e)&&i.push({state:e.state,queryKey:e.queryKey,queryHash:e.queryHash})})}return{mutations:r,queries:i}}function a(e,t,r){if("object"!=typeof t||null===t)return;let n=e.getMutationCache(),o=e.getQueryCache(),i=t.mutations||[],a=t.queries||[];i.forEach(t=>{var o;n.build(e,{...null==r?void 0:null==(o=r.defaultOptions)?void 0:o.mutations,mutationKey:t.mutationKey},t.state)}),a.forEach(t=>{var n;let i=o.get(t.queryHash),a={...t.state,fetchStatus:"idle"};if(i){i.state.dataUpdatedAt<a.dataUpdatedAt&&i.setState(a);return}o.build(e,{...null==r?void 0:null==(n=r.defaultOptions)?void 0:n.queries,queryKey:t.queryKey,queryHash:t.queryHash},a)})}r.d(t,{D:function(){return i},ZB:function(){return a}})},55464:function(e,t,r){r.d(t,{p:function(){return a}});var n=r(2784),o=r(78914),i=r(55830);let a=({children:e,options:t,state:r})=>(!function(e,t={}){let r=(0,i.NL)({context:t.context}),a=n.useRef(t);a.current=t,n.useMemo(()=>{e&&(0,o.ZB)(r,e,a.current)},[r,e])}(r,t),e)}}]); 2//# sourceMappingURL=190-162b6ce773e512ee.js.map
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.