PageSourceSearch

https://www.backcomfort.com.sa/_next/static/chunks/pages/cart-0e35426effeda6b2.js

js backcomfort.com.sa collected 2026-10-09 01:40:31 UTC 12,536 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[442],{57294:(e,l,t)=>{"use strict";t.r(l),t.d(l,{__N_SSP:()=>H,default:()=>B});var s=t(37876),n=t(9946),a=t(90974);let i=e=>{let{total_segments:l,grand_total:t,t:n}=e;return(0,s.jsxs)("div",{className:"text-sm border border-t-0 sm:text-base",children:[null==l?void 0:l.map((e,l)=>{var t,i;return!["grand_total","shipping"].includes(null==e?void 0:e.code)&&(null==e?void 0:e.value)!==null&&(0,s.jsxs)("div",{className:"p-4 border-b flex items-center justify-between *:font-semibold ".concat((null==e?void 0:e.value)===0?"text-[#039A12]":"text-black"),children:[(0,s.jsx)("p",{className:"".concat((null==e?void 0:e.code)==="discount"?"text-[#039A12]":"text-black"),children:(null==e?void 0:e.code)==="discount"?n("Discount")+" "+n(null==e||null==(i=e.title)||null==(t=i.split(" "))?void 0:t.at(1)):n(null==e?void 0:e.title)}),(0,s.jsxs)("p",{className:"".concat((null==e?void 0:e.code)==="discount"?"text-[#039A12]":"text-black"," flex items-center gap-1"),children:[(null==e?void 0:e.value)||n("Free")," ",!!(null==e?void 0:e.value)&&(0,s.jsx)(a.A,{className:"size-3.5"})]})]},l)}),(0,s.jsxs)("div",{className:"p-4 flex items-center justify-between *:font-extrabold",children:[(0,s.jsx)("p",{children:n("Total")}),(0,s.jsxs)("p",{className:"flex items-center gap-1",children:[t," ",(0,s.jsx)(a.A,{className:"size-3.5"})]})]})]})},r=e=>(0,s.jsxs)("svg",{width:21,height:19,viewBox:"0 0 21 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,s.jsx)("path",{d:"M12.8357 17.7747H7.7017C3.05545 17.7747 1.07031 15.9621 1.07031 11.7198V7.03209C1.07031 2.78974 3.05545 0.977173 7.7017 0.977173H12.8357C17.4819 0.977173 19.4671 2.78974 19.4671 7.03209V11.7198C19.4671 15.9621 17.4819 17.7747 12.8357 17.7747ZM7.7017 2.14909C3.7571 2.14909 2.35381 3.43039 2.35381 7.03209V11.7198C2.35381 15.3215 3.7571 16.6028 7.7017 16.6028H12.8357C16.7803 16.6028 18.1836 15.3215 18.1836 11.7198V7.03209C18.1836 3.43039 16.7803 2.14909 12.8357 2.14909H7.7017Z",fill:"currentColor"}),(0,s.jsx)("path",{d:"M7.33101 12.5159C7.16844 12.5159 7.00586 12.4612 6.87751 12.344C6.62937 12.1174 6.62937 11.7424 6.87751 11.5158L12.4821 6.39844C12.7302 6.17187 13.141 6.17187 13.3891 6.39844C13.6372 6.62501 13.6372 7.00003 13.3891 7.2266L7.78451 12.344C7.65616 12.4612 7.49359 12.5159 7.33101 12.5159Z",fill:"currentColor"}),(0,s.jsx)("path",{d:"M7.6825 8.67955C6.74983 8.67955 5.98828 7.98423 5.98828 7.13264C5.98828 6.28104 6.74983 5.58569 7.6825 5.58569C8.61518 5.58569 9.3767 6.28104 9.3767 7.13264C9.3767 7.98423 8.61518 8.67955 7.6825 8.67955ZM7.6825 6.76543C7.46003 6.76543 7.27178 6.92951 7.27178 7.14046C7.27178 7.3514 7.45148 7.51545 7.6825 7.51545C7.91353 7.51545 8.09321 7.3514 8.09321 7.14046C8.09321 6.92951 7.90498 6.76543 7.6825 6.76543Z",fill:"currentColor"}),(0,s.jsx)("path",{d:"M13.2801 13.157C12.3475 13.157 11.5859 12.4616 11.5859 11.61C11.5859 10.7584 12.3475 10.0631 13.2801 10.0631C14.2128 10.0631 14.9744 10.7584 14.9744 11.61C14.9744 12.4616 14.2128 13.157 13.2801 13.157ZM13.2801 11.2429C13.0577 11.2429 12.8694 11.4069 12.8694 11.6178C12.8694 11.8288 13.0491 11.9929 13.2801 11.9929C13.5112 11.9929 13.6909 11.8288 13.6909 11.6178C13.6909 11.4069 13.5112 11.2429 13.2801 11.2429Z",fill:"currentColor"})]});var c=t(39919),o=t(84701),d=t(97685),u=t(14232),m=t(50223);let x=e=>{let{t:l,setActiveModal:t}=e,[n,a]=(0,u.useState)(!1),i=(0,u.useRef)();return(0,c.A)(i,()=>t(!1)),(0,s.jsxs)("div",{ref:i,className:"w-11/12 mx-auto sm:w-[480px] p-3 bg-white rounded-md max-h-[95vh] overflow-y-auto red-scroll",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between pb-2 border-b",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(r,{}),(0,s.jsx)("h2",{className:"font-bold sm:text-lg",children:l("Voucher")})]}),(0,s.jsx)("button",{onClick:()=>t(null),children:(0,s.jsx)(o.A,{className:"size-5"})})]}),(0,s.jsx)("p",{className:"my-3 font-semibold text-zinc-500",children:l("Enter the code to get the discount")}),(0,s.jsx)(m.l1,{onSubmit:()=>{a(!n),setTimeout(()=>{a(!n),d.default.success("Voucher Added Successfully"),t(null)},1500)},initialValues:{coupon:"",phone:""},children:(0,s.jsxs)(m.lV,{children:[(0,s.jsx)(m.D0,{name:"voucher",className:"block w-full px-3 py-2 border rounded-md outline-none",placeholder:l("Voucher")}),(0,s.jsx)(m.Kw,{name:"voucher",component:"p",className:"mt-1 text-sm text-red-600"}),(0,s.jsx)(m.D0,{name:"phone",className:"block w-full px-3 py-2 mt-3 border rounded-md outline-none",placeholder:l("Phone Number")}),(0,s.jsx)(m.Kw,{name:"phone",component:"p",className:"mt-1 text-sm text-red-600"}),(0,s.jsx)("button",{type:"submit",className:"flex items-center justify-center w-full h-10 py-2 mt-3 font-semibold text-white bg-red-600 rounded-md",children:n?(0,s.jsx)("span",{className:"border-t border-r border-white rounded-full animate-spin size-4"}):l("Send Code")})]})})]})};var p=t(68763),h=t(98232),v=t(89130),j=t(48230),f=t.n(j),g=t(69100),b=t(79489);let N=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return String(null!=e?e:"").replace(/<[^>]*>/g," ").replace(/&nbsp;/gi," ").replace(/\s+/g," ").trim()};
1var C=t(2153);let w=e=>{var l,t,n,i,r,c,o,d;let{info:u,refetchCart:m}=e,x=(0,g.cp)((0,g.f)(u)),p=null==u||null==(l=u.extension_attributes)?void 0:l.product_image,h=p?"".concat("https://media.backcomfort.com.sa/media","/catalog/product").concat(p):void 0,j=(e=>(Array.isArray(e)?e:[]).map(e=>{var l;return{label:String(null!=(l=null==e?void 0:e.label)?l:"").trim(),value:N(null==e?void 0:e.value)}}).filter(e=>e.value))(null==u||null==(t=u.extension_attributes)?void 0:t.selected_options);return(0,s.jsxs)("div",{className:"flex sm:items-center gap-1.5 p-1.5 sm:p-5 mb-3 border rounded-md sm:gap-7",children:[(0,s.jsx)(f(),{href:"/product/".concat(null==u||null==(n=u.extension_attributes)?void 0:n.parent_rewrite_url),children:(0,s.jsx)(v.A,{loading:"lazy",src:h,className:"object-contain rounded max-sm:h-24 max-sm:w-20 size-28 p-1.5",alt:"Cart Img!"})}),(0,s.jsxs)("div",{className:"flex flex-col justify-between flex-1 min-h-24 max-h-24 sm:min-h-28 sm:max-h-28",children:[(0,s.jsx)(f(),{href:"\n          /product/".concat((null==u||null==(i=u.extension_attributes)?void 0:i.parent_rewrite_url)||(null==u||null==(r=u.extension_attributes)?void 0:r.rewrite_url)||(null==u?void 0:u.rewrite_url)||""),className:"font-bold text-[12px] sm:text-lg sm:line-clamp-2 max-sm:mt-1.5",children:(null==u?void 0:u.name)||""}),j.length>0?(0,s.jsx)("ul",{className:"text-[10px] sm:text-xs text-zinc-500 leading-tight list-disc ps-4 space-y-0.5",children:j.map((e,l)=>(0,s.jsx)("li",{className:"line-clamp-1",children:e.value},l))}):(0,s.jsx)("p",{className:"hidden text-[11px] font-semibold text-zinc-500 sm:text-base",children:(null==u||null==(d=u.extension_attributes)||null==(o=d.category_names)||null==(c=o[0])?void 0:c.name)||""}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-1 sm:gap-4 max-sm:mb-1.5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 sm:gap-4",children:[(0,s.jsxs)("p",{className:"flex items-center gap-1 font-bold text-red-600 max-sm:text-xs sm:text-lg",children:[(0,b.g)((null==x?void 0:x.specialPrice)||(null==x?void 0:x.originalPrice))," ",(0,s.jsx)(a.A,{className:"size-3.5"})]}),(null==x?void 0:x.specialPrice)&&(0,s.jsxs)("p",{className:"flex items-center gap-1 line-through text-zinc-500 max-sm:text-xs sm:text-lg",children:[(0,b.g)(null==x?void 0:x.originalPrice)," ",(0,s.jsx)(a.A,{className:"size-3.5"})]})]}),(0,s.jsx)(C.A,{product:u,refetchCart:m})]})]})]})};var _=t(85202),y=t(24719),A=t(52333),k=t(89099),z=t(38248),S=t(38490),M=t(46572),P=t(80336),V=t(96715),E=t(84821),T=t(69193),Z=t(37427),F=t(2601),H=!0;let B=e=>{var l,t,a,r,c,o,d,m,j;let{cart:g,cartImage:b}=e,{t:N,i18n:{language:C}}=(0,M.Bd)("cart"),{push:H}=(0,k.useRouter)(),[B,D]=(0,u.useState)(g),{dispatch:I}=(0,Z._)();(0,u.useEffect)(()=>{var e;(null==B||null==(e=B.items)?void 0:e.length)>0&&(0,F.IT)(B)},[]);let[O,R]=(0,u.useState)(null),{handshake:X,mage:K,quote:L}=(0,z.getCookies)(),{mutate:W}=(0,A.u)("cart_page/".concat(C),async()=>await (0,S.Xl)(X,K,L),{revalidateOnFocus:!1,onSuccess:e=>{var l,t,s;(null==e||null==(l=e.data)?void 0:l.data)&&(I({type:"get_cart",payload:null==e||null==(t=e.data)?void 0:t.data}),D(null==e||null==(s=e.data)?void 0:s.data))}}),q=(null==B||null==(t=B.total_segments)||null==(l=t.find(e=>(null==e?void 0:e.code)==="grand_total"))?void 0:l.value)||0,G=(null==b||null==(a=b.image_url)?void 0:a.includes("https://"))?null==b?void 0:b.image_url:(null==b||null==(r=b.image_url)?void 0:r.startsWith("pub/media"))?"".concat("https://media.backcomfort.com.sa/media","/").concat(null==b||null==(c=b.image_url)?void 0:c.slice(9)):"".concat("https://media.backcomfort.com.sa/media","/").concat(null==b?void 0:b.image_url);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(V.A,{title:"en"===C?"My Cart":"عربة التسوق"}),(0,s.jsx)(P.A,{current:"en"===C?"My Cart":"عربة التسوق"}),(0,s.jsxs)("section",{className:"subMainSize mx-auto mt-4 ".concat((null==B||null==(o=B.items)?void 0:o.length)===0?"mb-16":"mb-4"," sm:my-8"),children:[(0,s.jsx)("h1",{className:"px-12 mb-3 text-base font-extrabold sm:text-2xl max-sm:px-4 sm:mb-8",children:N("MyCart")}),(0,s.jsx)(_.A,{button:N("Back To Home"),handleButtonClick:()=>H("/"),title:N("No Product In Cart"),description:N("NoProdCartDescription"),icon:(0,s.jsx)(p.A,{className:"w-64 h-72"}),fromCart:!0,isEmpty:(null==B||null==(d=B.items)?void 0:d.length)===0?null:null==B||null==(m
1=B.items)?void 0:m.length,children:(0,s.jsxs)("div",{className:"grid grid-cols-12 gap-2 px-12 max-sm:px-4 sm:gap-4",children:[(null==b?void 0:b.image_url)&&(0,s.jsx)("div",{className:"col-span-full ",children:(0,s.jsx)("div",{className:"flex items-center justify-center gap-1 sm:gap-4",children:(0,s.jsx)(f(),{href:(0,T.u)(null==b?void 0:b.url_key,null==b?void 0:b.type),className:"relative w-auto h-full overflow-hidden rounded-md",children:(0,s.jsx)(v.A,{src:G,loading:"lazy",className:"object-cover w-full h-auto transition-all duration-300 rounded-md cursor-pointer hover:scale-105",alt:"cart page"})})})}),(0,s.jsx)("div",{className:"col-span-full lg:col-span-8",children:null==B||null==(j=B.items)?void 0:j.map((e,l)=>(0,s.jsx)(w,{refetchCart:W,info:e,language:C},l))}),(0,s.jsxs)("div",{className:"col-span-full lg:col-span-4",children:[(0,s.jsx)(n.A,{couponCode:null==B?void 0:B.coupon_code,language:C,setActiveModal:R,t:N,refetchCart:W}),(0,s.jsx)(i,{total_segments:(null==B?void 0:B.total_segments)||[],grand_total:q,t:N}),(0,s.jsx)(f(),{href:"/checkout",className:"block w-full py-2 my-3 text-sm font-semibold text-center text-white bg-red-600 rounded-md sm:py-3 sm:text-base",children:N("Proceed to Checkout")}),(0,s.jsx)(E.A,{t:N,cartTotal:q})]})]})}),(0,s.jsx)(y.A,{show:O,isCenter:!0,children:"coupon"===O?(0,s.jsx)(h.A,{t:N,language:C,setActiveModal:R,refetchCart:W}):"voucher"===O?(0,s.jsx)(x,{t:N,setActiveModal:R}):null})]})]})}},69817:(e,l,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/cart",function(){return t(57294)}])},77328:(e,l,t)=>{e.exports=t(29269)},85202:(e,l,t)=>{"use strict";t.d(l,{A:()=>r});var s=t(37876),n=t(48230),a=t.n(n),i=t(89099);let r=e=>{let{children:l,isEmpty:t=!1,icon:n,title:r,description:c,button:o=null,handleButtonClick:d=null,fromCart:u,titleClassName:m,descriptionClassName:x}=e,{locale:p}=(0,i.useRouter)();return(0,s.jsx)("section",{className:t?void 0:"w-11/12 mx-auto py-4 sm:mt-28 sm:mb-52 flex items-center justify-center flex-col gap-2 sm:gap-7",children:t?l:(0,s.jsxs)(s.Fragment,{children:[n,r?(0,s.jsx)("h1",{className:"text-[15px] md:text-3xl font-semibold text-center ".concat(m),children:r}):null,c?(0,s.jsx)("p",{className:"text-center text-zinc-600 max-w-96 text-sm max-sm:my-1 ".concat(x),children:c}):null,u?(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("button",{onClick:d,className:"bg-red-600 text-white py-2 rounded-md w-36 sm:w-44 max-sm:text-[14px] text-center",children:o}),(0,s.jsx)(a(),{href:"/user/favourites",className:"bg-black text-white py-2 rounded-md w-36 sm:w-44 max-sm:text-[14px] text-center",children:"en"===p?"Add From Favourites":"الإضافة من المفضلة"})]}):o?(0,s.jsx)("button",{onClick:d,className:"bg-red-600 text-white py-1.5 sm:py-2 max-sm:text-[15px] rounded-md w-72 sm:w-80",children:o}):null]})})}}},e=>{e.O(0,[895,937,636,593,792],()=>e(e.s=69817)),_N_E=e.O()}]);
2//# sourceMappingURL=cart-0e35426effeda6b2.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.