(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[779,4356],{1683:e=>{e.exports={container:"OrderStatusItem_container__uSDuW",flex:"OrderStatusItem_flex__NUpTw",padding:"OrderStatusItem_padding__zcZm8",productOverview:"OrderStatusItem_productOverview__iPccj",orderStatusBody:"OrderStatusItem_orderStatusBody__IwZUZ",orderStatuses:"OrderStatusItem_orderStatuses__ceLDH",orderStatus:"OrderStatusItem_orderStatus__hn6Nd",statusesContainer:"OrderStatusItem_statusesContainer__KaIMH",status:"OrderStatusItem_status__TGsjt",svg:"OrderStatusItem_svg__BLqqF",active:"OrderStatusItem_active__2VtxR",failed:"OrderStatusItem_failed__Dd2_O",completed:"OrderStatusItem_completed__WSYQz",statusText:"OrderStatusItem_statusText___EWdI","status--failed":"OrderStatusItem_status--failed__bn2Zs","status--warning":"OrderStatusItem_status--warning__jkhlc","status--pending":"OrderStatusItem_status--pending__fRYru","status--success":"OrderStatusItem_status--success__lMkUP",productLink:"OrderStatusItem_productLink__XcFtE"}},3397:e=>{e.exports={container:"EmptyItem_container__I6yOE"}},4629:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});var r=s(37876),a=s(17564),n=s(89099),i=s(19666),d=s(94666);let l=e=>{let{price:t,showFree:s=!0,...l}=e,{t:c}=(0,i.B)(),{locale:u}=(0,n.useRouter)(),o=parseFloat(String(t)),_=(0,d.RC)(u),m=Math.abs(o).toLocaleString(_,{minimumFractionDigits:2,maximumFractionDigits:2});return 0===o&&s?(0,r.jsx)("span",{...l,children:c(a.Pd.Free)}):(0,r.jsxs)("span",{...l,children:[o<0?"-":"",(0,d.$g)(m,u)]})}},8430:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var r,a=s(14232);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t{"use strict";s.r(t),s.d(t,{__N_SSG:()=>V,default:()=>D});var r=s(47117),a=s(37876),n=s(14232),i=s(23970),d=s(65629),l=s(64440),c=s(51642),u=s(1683),o=s.n(u),_=s(70609),m=s(2764),p=s(58103),h=s.n(p),v=s(89375),f=s(96294),x=s(19666),g=s(17564),j=s(4629);let O=n.memo(e=>{let{t}=(0,x.B)(),{linkToProduct:s,childItems:r,displayName:u}=(0,i.b9)(e.items,e.product_meta||[],e.is_imported),p=(0,l.A)((0,_._U)(e.created_at),"d MMM yyyy",{locale:c.A}),{increment_id:O}=e,N=i.jB[e.status]||e.status,w=(0,n.useMemo)(()=>{switch(e.status){case i.nW.identity_check:case i.nW.pending_payment:return"warning";case i.nW.canceled:case i.nW.refused:case i.nW.declined:case i.nW.closed:case i.nW.identity_check_failed:case i.nW.fraud:case i.nW.paypal_canceled_reversal:case i.nW.paypal_reversed:return"failed";default:return"default"}},[e.status]),y=(0,n.useMemo)(()=>{if(e.isVirtual&&e.status===i.nW.complete)return"status--success";switch(e.status){case i.nW.identity_check:case i.nW.pending_payment:return"status--warning";case i.nW.delivered:return"status--success";case i.nW.canceled:case i.nW.refused:case i.nW.declined:case i.nW.closed:case i.nW.fraud:case i.nW.identity_check_failed:case i.nW.paypal_canceled_reversal:case i.nW.paypal_reversed:return"status--failed";default:return"status--pending"}},[e.status]),S=(0,f.Qh)(e.status),I=e.isVirtual?null:(0,f.Xc)(e.is_imported,e.state,e.status);return(0,a.jsx)("div",{children:(0,a.jsx)(d.A,{asDiv:!0,className:o().productLink,href:"/customer/orders/".concat(e.entity_id),prefetch:!1,children:(0,a.jsx)(m.g,{padding:!1,color:w,children:(0,a.jsxs)(v.A,{image:e.displayImage,displayName:u,childItems:r,linkToProduct:s,subTitle:(0,a.jsx)("p",{children:(0,a.jsx)(j.A,{price:e.grandTotal})}),showShadow:!1,showBorder:!1,children:[(0,a.jsxs)("div",{className:o().orderStatuses,children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h5",{children:t(g.tV.OrderNo)}),(0,a.jsx)(d.A,{href:"/customer/orders/".concat(e.entity_id),prefetch:!1,children:(0,a.jsxs)("p",{children:["#",O]})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h5",{children:t(g.tV.OrderDate)}),(0,a.jsx)("p",{children:p})]}),(0,a.jsx)("div",{className:h()(o().flex,o().orderStatusContainer),children:(0,a.jsxs)("div",{children:[(0,a.jsx)("h5",{children:t(g.tV.OrderStatus)}),(0,a.jsxs)("div",{className:h()(o().orderStatus,o()[y]),children:[S,(0,a.jsx)("p",{children:N})]})]})})]}),I&&(0,a.jsx)("div",{className:o().statusesContainer,children:I.map(e=>(0,a.jsxs)("div",{className:h()(o().status,e.isComplete&&!e.isFailed&&o().completed,e.isComplete&&e.isFailed&&o().failed),children:[(0,a.jsx)("div",{className:o().svg,children:e.icon}),(0,a.jsx)("div",{className:o().statusText,children:t(e.status)})]},e.status))})]})})})})});var N=s(23839),w=s(67382),y=s.n(w),S=s(13540),I=s(61261),b=s(53025);let A=()=>!0;function P(e){let{t}=(0,x.B)();return 0===e.orders.length?(0,a.jsx)(b.F,{title:t(g.tV.NoOrdersFound),description:t(g.tV.NoPendingOrders),buttonText:t(g.Pd.SearchTreatments),link:"/treatments"}):(0,a.jsxs)("div",{className:y().orderItemsInner,children:[e.orders.map(e=>{var t,s,r;let d=(0,i.Ti)(e),l=e.extension_attributes||{},c=l.product_meta,u=e.status===i.nW.identity_check,o=!!(l.review_info&&l.review_info.identity_check_pending),_=c.find(e=>2===e.medical_product_type),m=null!=(s=e.items.find(e=>e.item_id===(null==_?void 0:_.item_id)))?s:(0,I.A)(e.items),p=null!=(r=null==m||null==(t=m.extension_attributes)?void 0:t.product_small_image)?r:"";return(0,a.jsxs)(n.Fragment,{children:[u&&(0,a.jsx)(N.l,{resultPending:o,orderId:e.entity_id}),(0,a.jsx)(O,{state:e.state,status:e.status,entity_id:e.entity_id,created_at:e.created_at,increment_id:e.increment_id,shipping_description:(0,i.$2)(e.shipping_description||""),is_imported:d,product_meta:c,items:e.items.filter(d?A:i.GX),grandTotal:e.grand_total,displayImage:p,isVirtual:e.is_virtual})]},e.entity_id)}),(0,a.jsx)(S.t,{product:null})]})}var W=s(35946),k=s(78753),C=s(33886);function B(e){var t,s,r,a,n,i,d,l,c;return{orders:null!=(i=null==(t=e.account)?void 0:t.orders)?i:[],pages:Math.ceil(((null==(s=e.account)?void 0:s.totalOrders)||0)/C.Eo),orderMessages:null!=(d=null==(r=e.account)?void 0:r.orderMessages)?d:[],status:null!=(l=null==(a=e.account)?void 0:a.status)?l:null,reorderStatus:null!=(c=null==(n=e.account)?void 0:n.reorderStatus)?c:null}}var E=s(48091),F=s(61221),T=s(56399),M=s(36997);let R=()=>{let{state:e,reorder:t,setPage:s,page:r}=function(){let e=(0,W.wA)(),[t,s]=(0,n.useState)(1),r=(0,n.useCallback)(t=>{e((0,k.nl)(k.Xw.ReorderByName,t))},[e]);return(0,n.useEffect)(()=>{e((0,k.nl)(k.Xw.FetchOrders,t))},[e,t]),{state:(0,W.d4)(B,W.bN),reorder:r,setPage:s,page:t}}(),{status:d,orders:l,orderMessages:c,reorderStatus:u}=e,o=(0,n.useMemo)(()=>(0,i.my)(l),[l]);return(0,a.jsxs)("div",{"data-test-id":"OrdersPage",children:[d===T.t3.Pending&&(0,a.jsx)("div",{style:{minHeight:"200px",position:"relative"},children:(0,a.jsx)(E.a,{alignment:"center"})}),d===T.t3.Error&&(0,a.jsx)(F.B2,{messages:c}),d===T.t3.Success&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(P,{orders:o,reorder:t,pending:u===T.t3.Pending}),(0,a.jsx)(M.dK,{currentRefinement:r,nbPages:e.pages,refine:s})]})]})};R.Layout=r.Ay;var V=!0;let D=R},13540:(e,t,s)=>{"use strict";s.d(t,{t:()=>o});var r=s(37876),a=s(37393),n=s(42942),i=s.n(n),d=s(92271),l=s(4629),c=s(17564),u=s(19666);let o=e=>{let{product:t}=e;if(!t)return null;let{t:s}=(0,u.B)();return(0,r.jsxs)("div",{className:i().container,children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:i().offerAvailable,children:[(0,r.jsx)(d.A,{}),(0,r.jsx)("p",{children:s(c.Pd.NewOfferAvailable)})]}),(0,r.jsx)("h4",{className:i().heading,children:t.name}),(0,r.jsx)("p",{className:i().description,children:t.description}),(0,r.jsxs)("div",{className:i().ctaSection,children:[(0,r.jsxs)("div",{className:i().pricing,children:[(0,r.jsx)("p",{className:i().newPrice,children:(0,r.jsx)(l.A,{price:t.newPrice})}),(0,r.jsxs)("p",{className:i().oldPrice,children:[s(c.Pd.Was),"\xa0",(0,r.jsx)(l.A,{price:t.oldPrice})]})]}),(0,r.jsx)(a.A,{className:i().cta,variant:"primary-light",children:s(c.Pd.ViewProduct)})]})]}),(0,r.jsx)("div",{className:i().imageContainer,children:(0,r.jsx)("img",{src:t.image})})]})}},23839:(e,t,s)=>{"use strict";s.d(t,{l:()=>_});var r=s(37876),a=s(56399),n=s(8430),i=s(23813),d=s(61221),l=s(87611),c=s.n(l),u=s(19666),o=s(17564);let _=e=>{let{t}=(0,u.B)(),s=e.resultPending?a.Go.Warning:a.Go.Success,l=t(e.resultPending?o.tV.ResultPending:o.tV.ResultNotPending);return(0,r.jsx)(d.Do,{size:"small",type:s,icon:(0,r.jsx)(n.A,{style:{color:"white"}}),content:(0,r.jsxs)("div",{className:c().identityBanner,children:[(0,r.jsx)("p",{children:l}),e.resultPending&&(0,r.jsx)("div",{className:c().identityBannerCta,children:(0,r.jsx)(i.v,{variant:"trans-outline",size:"small",to:"/customer/identity-check/".concat(e.orderId),children:t(o.tV.IdentityCheckResolveOrder)})})]})})}},26261:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/customer/orders",function(){return s(8667)}])},36997:(e,t,s)=>{"use strict";s.d(t,{_8:()=>u,dK:()=>c});var r=s(37876);s(14232);var a=s(76042),n=s(58103),i=s.n(n),d=s(28665),l=s.n(d);let c=e=>e.nbPages>0?(0,r.jsx)("div",{className:l().paginationContainer,children:(0,r.jsx)("ul",{className:l().pagination,children:Array(e.nbPages).fill(null).slice(0,10).map((t,s)=>{let a=s+1;return(0,r.jsx)("li",{className:l().paginationItem,children:(0,r.jsx)("button",{type:"button",className:i()({[l().button]:!0,[l().buttonActive]:e.currentRefinement===a}),onClick:t=>{t.preventDefault(),e.refine(a)},children:a})},s)})})}):null,u=()=>{let e=(0,a.W)(),t=e.currentRefinement+1;return(0,r.jsx)(c,{...e,currentRefinement:t,refine:t=>e.refine(t-1)})}},42942:e=>{e.exports={container:"OrdersNewOfferAvailable_container__tUuTd",offerAvailable:"OrdersNewOfferAvailable_offerAvailable__FsmvS",heading:"OrdersNewOfferAvailable_heading__1Au8o",description:"OrdersNewOfferAvailable_description__a5uYQ",pricing:"OrdersNewOfferAvailable_pricing__acWA2",newPrice:"OrdersNewOfferAvailable_newPrice__VEQsD",oldPrice:"OrdersNewOfferAvailable_oldPrice__NLJo4",cta:"OrdersNewOfferAvailable_cta__ETRt9",imageContainer:"OrdersNewOfferAvailable_imageContainer__lBFrU",image:"OrdersNewOfferAvailable_image__OvpB0",ctaSection:"OrdersNewOfferAvailable_ctaSection__jkyNX"}},53025:(e,t,s)=>{"use strict";s.d(t,{F:()=>d});var r=s(37876),a=s(23813),n=s(3397),i=s.n(n);let d=e=>{let{buttonText:t,description:s,link:n,title:d,showButton:l=!0}=e;return(0,r.jsxs)("div",{className:i().container,children:[(0,r.jsx)("h4",{children:d}),(0,r.jsx)("p",{children:s}),l&&n&&t&&(0,r.jsx)(a.v,{to:n,variant:"primary-light",children:t})]})}},67382:e=>{e.exports={orderItemsInner:"OrderItemsInner_orderItemsInner__8Dqrf"}}},e=>{e.O(0,[7978,8242,4440,633,3977,9771,6042,1618,7925,1859,9581,772,4950,3970,1624,636,6593,8792],()=>e(e.s=26261)),_N_E=e.O()}]);