PageSourceSearch

https://www.tastyeats.co.uk/_next/static/chunks/1130-43e5faab7b5a7106.js

js tastyeats.co.uk collected 2026-09-24 14:29:41 UTC 25,097 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1130],{22116:function(e,t,n){n.d(t,{E:function(){return j}});var l=n(85893),o=n(67294),i=n(87536),u=n(39544),r=n(76822),a=n(67936),d=n(11949),s=n(29620),c=n(87076),v=n(2516),p=n(10227),m=n(78021),f=n(26317),y=n(15397),g=n(1073),b=n(83847),h=n(5942),C=n(31658),x=n(81120),I=n(88923),T=n(70353),w=n.n(T);function j(e){var t,n,T,k,P;let{onClose:M,isLoading:E,product:L,keyId:D,menuProductPreview:O,validateBeforeAddCart:Z,bundleComponentMode:S}=e,{t:N}=(0,d.q)(),_=(0,r.sq)(),{formatCompanyCurrency:q}=(0,a.f)(),{methods:B,control:A,isLoading:G,quantity:F,total:U,originalTotal:R,hasDiscount:V,discount:Q,actionLabel:K,componentProducts:H,isComponentProductsLoading:z,allFreeQuantityMap:W,allOptionMap:J,onChange:Y,onSubmit:$}=(0,y.q)({onClose:M,validateBeforeAddCart:Z,isLoading:E,product:L,keyId:D,bundleComponentMode:S}),X=s.default.useBreakpoint().xl?420:330,ee=!!((null==L?void 0:L.productPhotoUrl)||(null==O?void 0:O.productPhotoUrl)),et=!!S,en=ee&&!et,el=null!==(k=null==L?void 0:null===(t=L.productCompositions)||void 0===t?void 0:t.filter(e=>e.active))&&void 0!==k?k:[],eo=null!==(P=null==L?void 0:null===(T=L.optionGroups)||void 0===T?void 0:null===(n=T.filter(e=>!!e.active))||void 0===n?void 0:n.length)&&void 0!==P?P:0,ei=_?375:640,{customizingComponent:eu,closeCustomizing:er,handleCustomizeComponent:ea,handleSaveComponentCustomization:ed,getCustomizingInitialSubItems:es}=(0,f.J)({methods:B,activeCompositions:el}),{bundleParentTotal:ec,bundleMultiplier:ev}=(0,o.useMemo)(()=>{var e,t,n;if(!eu)return{bundleParentTotal:0,bundleMultiplier:1};let{subItemIndex:l,component:o}=eu,i=(null!==(e=B.getValues("subItems.".concat(l,".subItems")))&&void 0!==e?e:[]).find(e=>e.entityId===o.id),u=null!==(t=null==i?void 0:i.quantity)&&void 0!==t?t:1,r=null!==(n=null==i?void 0:i.subItems)&&void 0!==n?n:[],a=(0,g.K_)(r,{freeQuantityMap:W,optionMap:J}),d=u*F;return{bundleParentTotal:U-a*d,bundleMultiplier:d}},[eu,B,W,J,U,F]);return(0,l.jsxs)(l.Fragment,{children:[eu&&(0,l.jsx)(j,{onClose:M,isLoading:!1,product:eu.componentProduct,validateBeforeAddCart:Z,bundleComponentMode:{onBack:er,onSave:ed,initialSubItems:es(),parentTotal:ec,multiplier:ev}}),(0,l.jsx)(c.Z,{className:"".concat(w().modal," ").concat(_?"pc-modal-compact":""),open:!eu,footer:null,onCancel:et?S.onBack:M,width:{xs:"100%",sm:"100%",md:ei,lg:ei,xl:ei,xxl:ei},height:634,closeIcon:!1,styles:{content:{padding:0,borderRadius:16,display:"flex",justifyContent:"center",alignItems:"center"},body:{width:"100%",borderRadius:16}},children:(0,l.jsx)(i.RV,{...B,children:(0,l.jsxs)("form",{onSubmit:$,children:[(0,l.jsx)(x.x,{isBundleComponentMode:et,bundleComponentMode:S,onClose:M,product:L,imageHeight:X,hasProductImage:ee}),(0,l.jsxs)(v.Z,{vertical:!0,className:w().content,children:[(0,l.jsxs)(p.Z,{children:[en?(0,l.jsx)(m.Z,{xs:24,lg:24,children:(0,l.jsx)(v.Z,{className:"".concat(ee?w().img:""),children:(0,l.jsx)(b.r,{product:L,menuProductPreview:O})})}):(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(m.Z,{xs:24,lg:24,children:(0,l.jsx)("div",{style:{height:24}})})}),(0,l.jsx)(m.Z,{xs:24,lg:24,children:(0,l.jsxs)(v.Z,{className:w().contentInner,vertical:!0,gap:16,children:[(0,l.jsx)(h.x,{product:L,menuProductPreview:O,hasDiscount:V,discount:Q}),(0,l.jsx)(C.f,{isLoading:E,product:L,isBundleComponentMode:et,activeCompositions:el,optionGroupOffset:eo,componentProducts:H,control:A,onCustomizeComponent:ea,t:N})]})})]}),(0,l.jsxs)(v.Z,{className:w().stickyFooter,gap:16,children:[!et&&(0,l.jsx)(u.l,{value:F,onChange:Y,isLoading:E,min:1}),(0,l.jsx)(I.M,{isCartLoading:G,actionLabel:K,isBundleComponentMode:et,total:U,hasDiscount:V,originalTotal:R,discount:Q,formatCompanyCurrency:q,isPriceLoading:z})]})]})]})})})]})}},67602:function(e,t,n){n.d(t,{w:function(){return a}});var l=n(40048),o=n(54887);let i=(e,t)=>{let{entityID:n,entityType:i,area:u,...r}=e;return(0,l.U2)("productmarketing/".concat(i,"/").concat(n,"/enrich/").concat(u,"?").concat(o.Z.stringify(r)),{apiVersion:"v1",...t})};var u=n(32351),r=n(66340);let a=(e,t)=>{let{data:n,error:l,isFetching:o,isSuccess:a,refetch:d,isLoading:s,status:c}=(0,u.z)({queryKey:["GET_PRODUCT_MARKETING_LIST",e],queryFn:()=>i(e),enabled:!!e.entityID&&e.entityID>0&&!!(null==t?void 0:t.enabled),...r.lb});return{status:c,data:n,error:l,isFetching:o,isSuccess:a,refetch:d,isLoading:s}}},26317:function(e,t,n){n.d(t,{J:function(){return i}});var l=n(67294),o=n(51906);function i(e){let{methods:t,activeCompositions:n}=e,[i,u]=(0,l.useState)(null);
1return{customizingComponent:i,handleCustomizeComponent:(e,t,l,o)=>{let i=n[e].components.findIndex(e=>e.id===l.id);u({component:l,componentProduct:o,subItemIndex:t,componentIndex:i})},handleSaveComponentCustomization:e=>{var n;if(!i)return;let{subItemIndex:l,componentIndex:r,component:a}=i,d="subItems.".concat(l,".subItems"),s=[...null!==(n=t.getValues(d))&&void 0!==n?n:[]],c=s.findIndex(e=>e.entityId===a.id);-1!==c?s[c]={...s[c],subItems:e}:s.splice(r,0,{entityId:a.id,entityType:o.py.BUNDLE_COMPONENT,instructions:null,price:a.price,quantity:1,subItems:e,id:0}),t.setValue(d,s),u(null)},getCustomizingInitialSubItems:()=>{var e,n;if(!i)return[];let{subItemIndex:l,component:o}=i,u=(null!==(e=t.getValues("subItems.".concat(l,".subItems")))&&void 0!==e?e:[]).find(e=>e.entityId===o.id);return null!==(n=null==u?void 0:u.subItems)&&void 0!==n?n:[]},closeCustomizing:()=>u(null)}}},89186:function(e,t,n){n.d(t,{D:function(){return k}});var l=n(67294),o=n(52140),i=n(11165),u=n(49578),r=n(22825),a=n(71164),d=n(70244),s=n(52675),c=n(89204),v=n(79585),p=n(73888),m=n(14640),f=n(67602),y=n(76822),g=n(96535),b=n(97454),h=n(67936),C=n(11949),x=n(97588),I=n(51906),T=n(76837),w=n(84368),j=n(1073);function k(e){let{selectedService:t,updateShoppingCart:n,showAuthModal:k,canShowProductMarketingModal:P=!1}=e,{status:M}=(0,i.T)(),{customer:E}=(0,c.Z)(e=>e),{branch:L}=(0,s.Z)(e=>e),D=(0,p.Z)(e=>e.shoppingCart),O=(0,m.useLocale)(),{mode:Z,isGuestCheckoutOnly:S,isResolved:N}=(0,u.D)();(0,a.t)();let _=(0,v.Z)(e=>e.isQrAccess),[q,B]=(0,l.useState)(!1),[A,G]=(0,l.useState)(!1),[F,U]=(0,l.useState)([]),{isRedirectingToCheckout:R,checkoutErrorContextHolder:V,executeCheckout:Q,executeGuestCheckout:K,executeCheckoutAfterAuth:H}=function(e){var t,n,o,i;let{selectedService:u,updateShoppingCart:r}=e,[a,d]=(0,l.useState)(!1),v=(0,y.bn)(),{t:m}=(0,C.q)(),{showError:f,contextHolder:k}=(0,g.C)(),{shoppingCart:P}=(0,p.Z)(e=>e),{branch:M}=(0,s.Z)(e=>e),{customer:E}=(0,c.Z)(e=>e),{getBranchAddress:L}=(0,b.v)(),{getCompanyCurrencySymbol:D}=(0,h.f)(),O=null!==(t=null==P?void 0:P.branchId)&&void 0!==t?t:0,Z=null!==(n=null==M?void 0:M.name)&&void 0!==n?n:"",S=L(null!=M?M:void 0),N=null!==(o=null==M?void 0:M.locationWebLogoUrl)&&void 0!==o?o:"",_={branchId:O.toString(),branchName:Z,branchAddress:S,branchImageUrl:N,orderType:null!==(i=null==u?void 0:u.orderType)&&void 0!==i?i:"",returnUrl:window.location.pathname},q=(0,l.useCallback)(e=>{var t,n;let l=null!==(n=null==P?void 0:null===(t=P.items)||void 0===t?void 0:t.reduce((e,t)=>e+(t.quantity||0),0))&&void 0!==n?n:0;(0,T.y)({event:x.s.BEGIN_CHECKOUT,content:"Begin Checkout",content_id:null==P?void 0:P.id,content_type:e,num_items:l,payment_info_available:0,currency:D(),total_price:null==P?void 0:P.total})},[P,D]),B=(0,l.useCallback)(e=>{if(v){v.goToCheckout("true"===e.isGuest);return}(0,w.E)("/checkout",e)},[v]),A=(0,l.useCallback)(async e=>{let t=null!=e?e:E,n={flow:I.Zw.CHECKOUT};t&&(n.customerId=t.id,n.shoppingCartAddress=(0,j.AO)(t,null==u?void 0:u.orderType),(0,j.XH)(void 0,void 0,t.id));let l=await (0,j.Mm)(r,n);if((null==t?void 0:t.id)&&!(null==l?void 0:l.customerId)){d(!1),f({title:m("label.warning"),content:m("error.checkout.session.failed"),okText:m("label.got.it")});return}q(null==u?void 0:u.orderType),d(!0),B(_)},[E,null==u?void 0:u.orderType,_,r,q,B]),G=(0,l.useCallback)(async e=>{var t;await r({flow:e,customerId:null},{flow:e}),d(!0);let n=null!==(t=null==u?void 0:u.orderType)&&void 0!==t?t:e===I.Zw.ONLINE_DELIVERY?"DELIVERY":"COLLECTION";q(n),B({..._,orderType:n,isGuest:"true"})},[null==u?void 0:u.orderType,r,_,q,B]),F=(0,l.useCallback)(async e=>{await A(e)},[A]);return{isRedirectingToCheckout:a,checkoutErrorContextHolder:k,executeCheckout:A,executeGuestCheckout:G,executeCheckoutAfterAuth:F}}({selectedService:t,updateShoppingCart:n}),{isModalOpen:z,handleOpenModal:W,handleCloseModal:J}=(0,r.X)(),Y=(0,l.useMemo)(()=>{var e;return{entityType:"BRANCH",entityID:null!==(e=null==L?void 0:L.id)&&void 0!==e?e:0,area:"checkout",orderType:null==t?void 0:t.orderType,lang:O,cartId:null==D?void 0:D.id}},[null==L?void 0:L.id,null==t?void 0:t.orderType,O,null==D?void 0:D.id]),{refetch:$,isFetching:X}=(0,f.w)(Y,{enabled:!1}),ee=(0,l.useCallback)(async()=>{let e=(0,o.ap)(null==t?void 0:t.orderType,_);e&&await K(e)},[null==t?void 0:t.orderType,_,K]),et=(0,l.useCallback)(()=>{B(!0),null==k||k()},[k]),en=(0,l.useCallback)(async e=>{q&&(B(!1),await H(e))},[q,H]),el=(0,l.useCallback)(async()=>"loggedIn"===M&&E?Q():S?ee():void et(),[M,E,Q,S,ee,et]),eo=(0,l.useCallback)(async()=>{try{var e;let t=await $();return(null!==(e=t.data)&&void 0!==e?e:[]).filter(e=>e.products.length>0)}catch(e){return[]}},[$]),ei=(0,l.useCallback)(async()=>
1{if(A||!P||!(null==L?void 0:L.id)){await el();return}let e=await eo();if(0===e.length){await el();return}U(e),W()},[A,P,null==L?void 0:L.id,eo,W,el]),eu=(0,l.useCallback)(()=>{J(),G(!0)},[J]),er=(0,l.useCallback)(async()=>{J(),await el()},[J,el]);return{onPlaceOrder:ei,onAuthCompleteCheckout:en,isRedirectingToCheckout:R,isFetchingProductMarketings:X,checkoutErrorContextHolder:V,onContinueAsGuest:Z===d.ON.GUEST_AND_ACCOUNT?ee:void 0,isCheckoutModeResolved:N,productMarketingModal:{isOpen:z,productMarketings:F,onClose:eu,onCheckout:er}}}},17840:function(e,t,n){n.d(t,{f:function(){return m}});var l=n(67294),o=n(90030),i=n(90619),u=n(14640),r=n(69588),a=n(85893),d=n(87076),s=n(11949),c=n(52675),v=n(28835),p=n(20357);function m(){let e=(0,u.useLocale)(),{selectedProductId:t,selectedKey:n,isOpenProductDetail:m,selectedMenuProductPreview:f,setSelectedProductId:y,setSelectedKey:g,setIsOpenProductDetail:b,setSelectedMenuProductPreview:h}=(0,o.Z)(e=>e),C=(0,i.Z)(e=>e.selectedService),x=(0,l.useMemo)(()=>({orderType:null==C?void 0:C.orderType,includePromotions:!0,lang:e,active:!0}),[null==C?void 0:C.orderType,e]),{data:I,isFetching:T,error:w}=(0,r.l$)(t,x),{contextHolder:j,validateBeforeAddCart:k}=function(){let{t:e}=(0,s.q)(),{branch:t}=(0,c.Z)(),{shoppingCart:n,removeCartByCartId:o,clearCart:i}=(0,p.$)(),{confirm:u,holder:r}=function(){let[e,t]=(0,l.useState)(null);return{confirm:e=>new Promise(n=>{let l=async()=>{t(e=>e?{...e,okLoading:!0,okButtonProps:{loading:!0},cancelButtonProps:{disabled:!0}}:e),e.onOk&&await e.onOk(),t(null),n(!0)},o=async()=>{e.onCancel&&await e.onCancel(),t(null),n(!1)};t({...e,open:!0,onOk:l,onCancel:o,okLoading:!1,okButtonProps:{loading:!1},cancelButtonProps:{disabled:!1}})}),holder:e?(0,a.jsx)(d.Z,{...e,open:e.open,okButtonProps:{loading:e.okLoading,...e.okButtonProps||{}},cancelButtonProps:{disabled:e.okLoading,...e.cancelButtonProps||{}},children:e.content}):null}}(),m=(0,l.useCallback)(()=>{let e=v.E.getItem(p.z.cartId),n=v.E.getItem(p.z.branchId);return e&&n&&parseInt(n)!==(null==t?void 0:t.id)&&parseInt(e)||null},[null==t?void 0:t.id]),f=(0,l.useCallback)((n,l)=>u({title:e("label.question.create.new.basket"),content:e("label.create.new.basket.content",[null==t?void 0:t.name]),centered:!0,okText:e("label.create.new.basket"),closable:!0,styles:{content:{width:"400px"}},onOk:n,onCancel:async()=>{await (null==l?void 0:l())}}),[null==t?void 0:t.name,u,e]);return{validateBeforeAddCart:(0,l.useCallback)(async e=>{let{onSuccess:l,onFailure:u}=e||{};if(!(null==t?void 0:t.id))return await (null==u?void 0:u()),!1;let r=n?null:m();return r?await f(async()=>{try{await o(r)}catch(e){console.error("Could not remove the stored cart of another branch:",e),i()}await (null==l?void 0:l())},u):n&&t.id!==n.branchId?await f(async()=>{await o(n.id),await (null==l?void 0:l())},u):(await (null==l?void 0:l()),!0)},[null==t?void 0:t.id,null==n?void 0:n.branchId,null==n?void 0:n.id,o,i,f,m]),contextHolder:r}}();return{product:I,isFetchingProduct:T,productError:w,selectedProductId:t,selectedKey:n,isOpenProductDetail:m,selectedMenuProductPreview:f,validateModalContextHolder:j,onOpenProductDetailModal:(0,l.useCallback)((e,t,n)=>{y(e),g(t),b(!0),h(n)},[]),onCloseProductDetail:(0,l.useCallback)(()=>{b(!1),y(void 0),g(void 0)},[]),validateBeforeAddCart:k}}},15397:function(e,t,n){n.d(t,{q:function(){return w}});var l=n(67294),o=n(87536),i=n(70885),u=n(67936),r=n(11949),a=n(97588),d=n(51906),s=n(76837),c=n(62515),v=n(73888),p=n(88773),m=n(78013),f=n(17671),y=n(1073),g=n(90619),b=n(14640),h=n(13470),C=n(88144);let x=(e,t)=>{var n;let l=null!==(n=null==e?void 0:e.map(e=>e.componentProductId))&&void 0!==n?n:[],{data:o,isLoading:i}=(0,C.a)({queryKey:["GET_BUNDLE_COMPONENT_PRODUCTS",l,t],queryFn:()=>Promise.all(l.map(e=>(0,h.h)(e,t))),enabled:l.length>0,gcTime:0,staleTime:0});return{data:o,isLoading:i}},I=[];var T=n(20357);function w(e){var t,n,h;let{onClose:C,validateBeforeAddCart:w,isLoading:j,product:k,keyId:P,bundleComponentMode:M}=e,{t:E}=(0,r.q)(),{getCompanyCurrencySymbol:L,formatCompanyCurrency:D}=(0,u.f)(),O=(0,o.cI)(),{control:Z,handleSubmit:S,reset:N,setValue:_,w
1atch:q}=O,B=(0,l.useRef)(!1),A=(0,l.useRef)(void 0),{isSameBranchCart:G,addUpdateItem:F,findCartItemByEntityId:U,isLoading:R,clearStoreErrors:V}=(0,T.$)(),{errors:Q}=(0,v.Z)(e=>e),{selectedMenu:K}=(0,c.Z)(e=>e),H=null!==(t=q("quantity"))&&void 0!==t?t:0,z=null!==(n=q("price"))&&void 0!==n?n:0,W=null!==(h=q("subItems"))&&void 0!==h?h:[],J=!!M,Y=(0,l.useMemo)(()=>{var e;let t={};return null==k||null===(e=k.optionGroups)||void 0===e||e.forEach(e=>{e.freeOptionsQuantity>0&&(t[e.id]=e.freeOptionsQuantity)}),t},[null==k?void 0:k.optionGroups]),$=(0,l.useMemo)(()=>{var e;let t=new Map;return null==k||null===(e=k.optionGroups)||void 0===e||e.forEach(e=>{var n;null===(n=e.options)||void 0===n||n.forEach(e=>{null!=e.id&&t.set(e.id,e)})}),t},[null==k?void 0:k.optionGroups]),X=(0,l.useMemo)(()=>{var e,t;return null!==(t=null==k?void 0:null===(e=k.productCompositions)||void 0===e?void 0:e.filter(e=>e.active))&&void 0!==t?t:[]},[null==k?void 0:k.productCompositions]),ee=(0,l.useRef)(X);ee.current=X;let{componentProducts:et,isComponentProductsLoading:en}=function(e){let{activeCompositions:t,bundleComponentMode:n}=e,o=(0,b.useLocale)(),i=(0,g.Z)(e=>e.selectedService),u=(0,l.useMemo)(()=>t.flatMap(e=>e.components),[t]),{data:r,isLoading:a}=x(n?void 0:u,(0,l.useMemo)(()=>({orderType:null==i?void 0:i.orderType,lang:o,active:!0}),[null==i?void 0:i.orderType,o]));return{componentProducts:null!=r?r:I,isComponentProductsLoading:a}}({activeCompositions:X,bundleComponentMode:M}),el=(0,l.useMemo)(()=>{let e={...Y};return et.forEach(t=>{var n;return function t(n){n.filter(e=>!!e.active).forEach(n=>{var l;n.freeOptionsQuantity>0&&(e[n.id]=n.freeOptionsQuantity),null===(l=n.options)||void 0===l||l.forEach(e=>{var n;(null===(n=e.optionGroups)||void 0===n?void 0:n.length)&&t(e.optionGroups)})})}(null!==(n=t.optionGroups)&&void 0!==n?n:[])}),e},[Y,et]),eo=(0,l.useMemo)(()=>{let e=new Map($);return et.forEach(t=>{var n;return function t(n){n.filter(e=>!!e.active).forEach(n=>{var l;null===(l=n.options)||void 0===l||l.forEach(n=>{var l;null!=n.id&&e.set(n.id,n),(null===(l=n.optionGroups)||void 0===l?void 0:l.length)&&t(n.optionGroups)})})}(null!==(n=t.optionGroups)&&void 0!==n?n:[])}),e},[$,et]),ei=(0,y.K_)(W,{freeQuantityMap:el,optionMap:eo}),eu=z+ei,er=H*eu,ea=null==k?void 0:k.discount,ed=(0,m.ud)(ea,eu),es=(0,m.cJ)(eu,H,ea),ec=(0,l.useMemo)(()=>{if(J){var e,t;return E("label.product.save",[D((null!==(e=null==M?void 0:M.parentTotal)&&void 0!==e?e:0)+ei*(null!==(t=null==M?void 0:M.multiplier)&&void 0!==t?t:1))])}return P?E("label.product.update.item"):E("label.product.add.item")},[J,null==M?void 0:M.parentTotal,null==M?void 0:M.multiplier,P,E,D,ei]),ev=S(async e=>{if(J){var t;M.onSave(null!==(t=e.subItems)&&void 0!==t?t:[]);return}let n={key:null!=P?P:(0,p.Z)(),...e};G||C(),await w({onSuccess:async()=>{let e=(0,y.Tj)(n);await F(e),(0,s.y)({event:a.s.ADD_TO_CART,content:"Add to Cart",content_id:String(null==k?void 0:k.id),content_type:"product",currency:L(),price:es})}}),G&&C()},e=>{let t=(0,y.Sk)(e);if(t){let e=document.querySelector('[name="'.concat(t,'"]'))||document.querySelector('[id="'.concat(t,'"]'));e&&e.scrollIntoView({behavior:"smooth",block:"center"})}});return(0,l.useEffect)(()=>{if(k){var e,t,n,l,o,i;if(P){let t=U(k.id,P);if(null==t?void 0:t.subItems){let n=(0,y.Ui)(t.subItems,k),l=(0,y._M)(n,el,eo),o=(0,y.pi)(l,null!==(e=k.productCompositions)&&void 0!==e?e:[]),i={...t,subItems:o};A.current!==P?(A.current=P,N(i)):_("subItems",o)}else A.current=P,N(null!=t?t:{});return}if(_("entityId",k.id),_("entityType","product"),_("quantity",1),_("price",k.price),_("discountedPrice",null!==(n=null===(t=k.discount)||void 0===t?void 0:t.priceAfterDiscount)&&void 0!==n?n:0),_("supportedOrderTypes",null==K?void 0:K.orderTypes.join(",")),J&&!B.current&&(B.current=!0,null==M?void 0:null===(l=M.initialSubItems)||void 0===l?void 0:l.length)){N({entityId:k.id,entityType:"product",quantity:1,price:k.price,discountedPrice:null!==(i=null===(o=k.discount)||void 0===o?void 0:o.priceAfterDiscount)&&void 0!==i?i:0,supportedOrderTypes:null==K?void 0:K.orderTypes.join(","),subItems:(0,y.Ui)(M.initialSubItems,k)});return}(function(e,t,n){var l,o,i;let u=null!==(i=null===(o=e.optionGroups)||void 0===o?void 0:null===(l=o.filter(e=>e.active))||void 0===l?void 0:l.length)&&void 0!==i?i:0;t.forEach((e,t)=>{let l=e.components.filter(e=>e.active&&e.defaultQuantity>0).map(e=>({entityId:e.id,entityType:d.py.BUNDLE_COMPONENT,instructions:null,price:e.price,quantity:e.defaultQuantity,subItems:[],id:0}));if(l.length>0){let o=new Map(e.components.map(e=>[e.id,e])),i=(0,f.K)(l,e.freeProductsQuantity||0,o),r=u+t;n("subItems.".concat(r,".entityId"),e.id),n("subItems.".concat(r,".entityType"),d.py.PRODUCT_COMPOSITION),n("subItems.".concat(r,".instructions"),null),n("subItems.".concat(r,".freeProductsQuantity"),e.freeProductsQuantity||0),n("subItems.".concat(r,".subItems"),i)}})})(k,ee.current,_),(0,s.y)({event:a.s.VIEW_ITEM})}},[P,K,k,N,_,U,el,eo,J]),(0,l.useEffect)(()=>
1{if(Q&&Q.length>0){var e;let t=Q[0],n=null===(e=t.arguments)||void 0===e?void 0:e.productCompositionId,l=n?'[id="composition-'.concat(n,'"]'):'[id="option-group-'.concat(t.optionGroupId,'"]'),o=document.querySelector(l);o&&o.scrollIntoView({behavior:"smooth",block:"start"})}},[Q]),(0,i.Z)(()=>V()),{methods:O,control:Z,isLoading:R||j,quantity:H,total:es,originalTotal:er,hasDiscount:ed,discount:ea,actionLabel:ec,componentProducts:et,isComponentProductsLoading:en,allFreeQuantityMap:el,allOptionMap:eo,onChange:e=>{_("quantity",null!=e?e:0)},onSubmit:ev}}},74635:function(e,t,n){n.d(t,{P:function(){return i}});var l=n(67294),o=n(90619);function i(e,t){let{selectedService:n,availableServices:i,setSelectedService:u,setAvailableServices:r}=(0,o.Z)(e=>e),a=(0,l.useCallback)(async e=>{var n;let l=null!==(n=i.find(t=>t.orderType===e))&&void 0!==n?n:null;(null==t?void 0:t.onServiceChange)?await t.onServiceChange(l):u(l)},[u,i]);return(0,l.useEffect)(()=>{r(e)},[e]),{selectedService:n,availableServices:i,onServiceSelected:a}}},13628:function(e,t,n){n.d(t,{v:function(){return i}});var l=n(67294),o=n(22230);function i(e){let{item:t,onUpdateQuantity:n}=e,[i,u]=(0,l.useState)(t.quantity),[r,a]=(0,l.useState)(i);return(0,l.useEffect)(()=>{u(t.quantity)},[t.quantity]),(0,l.useEffect)(()=>{r!==t.quantity&&n(t.id,r)},[r]),(0,o.Z)(()=>a(i),300,[i]),{quantity:i,onChange:e=>{u(null!=e?e:0)}}}},73488:function(e,t,n){n.d(t,{W:function(){return C}});var l=n(85893),o=n(15109),i=n(83663),u=n(10042),r=n(2516),a=n(97845);function d(e){let{label:t,value:n,isBold:o,isLoading:d,priceAfterDiscount:s}=e,{colorTextBase:c}=(0,u.F)(),v=!!s;return(0,l.jsxs)(r.Z,{justify:"space-between",style:{width:"100%"},children:[(0,l.jsx)(i.F,{level:5,style:{fontWeight:o?700:400,margin:0,lineHeight:1,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},children:t}),d?(0,l.jsx)(a.Z.Button,{active:!0,size:"small",className:"!w-[60px] !h-[16px]"}):(0,l.jsxs)(r.Z,{style:{minWidth:70,alignItems:v?"center":"flex-end",flexDirection:v?"row":"column"},gap:4,children:[v&&(0,l.jsx)(i.F,{level:5,className:"originalPrice",style:{fontWeight:o?700:400,margin:0,lineHeight:1,textAlign:"right"},children:n}),(0,l.jsx)(i.F,{level:5,className:v?"discountedPrice":"",style:{fontWeight:o?700:400,margin:0,color:c,lineHeight:1,textAlign:"right"},children:v?s:n})]})]})}var s=n(67936),c=n(5695),v=n(11949),p=n(22453),m=n(57307),f=n(18446),y=n.n(f),g=n(81763),b=n.n(g),h=n(92080);function C(e){var t,n,i,a,f,g,C;let{item:x,orderSummaryTip:I,notificationText:T,style:w,isLoading:j}=e,{t:k}=(0,v.q)(),{colorPrimaryText:P}=(0,u.F)(),{formatCompanyCurrency:M}=(0,s.f)(),{formatPromotionName:E,getFilteredPromotions:L}=(0,c.f)(),D=!["DELIVERY","CATERING"].includes(null!==(n=null==x?void 0:x.orderType)&&void 0!==n?n:""),O=L(null==x?void 0:x.discounts);return(0,l.jsxs)(r.Z,{vertical:!0,style:{width:"100%",padding:"16px",gap:"12px",...w},children:[O&&O.length>0&&O.map(e=>(0,l.jsx)(d,{label:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(p.Z,{style:{width:18,height:18,paddingRight:4}}),E(e)]}),value:"-".concat(M(e.discountAmount)),isLoading:j},e.promotionId)),!!(null==x?void 0:x.subTotal)&&(0,l.jsx)(d,{label:k("label.subtotal"),value:M(null!==(i=null==x?void 0:x.subTotal)&&void 0!==i?i:0),priceAfterDiscount:b()(null==x?void 0:x.subTotalAfterDiscount)&&!y()(x.subTotalAfterDiscount,null==x?void 0:x.subTotal)?M(null!==(a=null==x?void 0:x.subTotalAfterDiscount)&&void 0!==a?a:0):void 0,isLoading:j}),!!(null==x?void 0:x.serviceFee)&&(0,l.jsx)(d,{label:(0,l.jsxs)(r.Z,{gap:4,children:[(0,l.jsx)("span",{children:k("label.service.fee")}),x.serviceFeeContent&&(0,l.jsx)(o.N,{styles:{color:"#2378DC"},title:k("label.service.fee"),content:x.serviceFeeContent})]}),value:M(null!==(f=null==x?void 0:x.serviceFee)&&void 0!==f?f:0),isLoading:j}),!!(null==x?void 0:x.bagFee)&&(0,l.jsx)(d,{label:(0,l.jsxs)(r.Z,{gap:4,children:[(0,l.jsx)("span",{children:k("label.bag.fee")}),x.bagFee&&(0,l.jsx)(o.N,{styles:{color:"#2378DC"},title:k("label.bag.fee"),content:k("label.bag.fee.description")})]}),value:M(null!==(g=null==x?void 0:x.bagFee)&&void 0!==g?g:0),isLoading:j}),!!(null==x?void 0:x.orderDiscount)&&b()(null==x?void 0:x.orderDiscount)&&(0,l.jsx)(d,{label:k("label.discount"),value:M(-((null!==(C=null==x?void 0:x.orderDiscount)&&void 0!==C?C:0)
1*1)),isLoading:j}),!!(null==x?void 0:x.promoCodeDiscount)&&b()(null==x?void 0:x.promoCodeDiscount)&&(0,l.jsx)(d,{label:k("label.promocodediscount")+((null==x?void 0:x.promoCode)?" (".concat(null==x?void 0:x.promoCode,")"):""),value:M(-1*x.promoCodeDiscount),isLoading:j}),!!(null==x?void 0:x.voucherDiscount)&&b()(null==x?void 0:x.voucherDiscount)&&(0,l.jsx)(d,{label:k("label.voucherdiscount")+((null==x?void 0:x.voucherCode)?" (".concat(null==x?void 0:x.voucherCode,")"):""),value:M(-1*x.voucherDiscount),isLoading:j}),!!(null==x?void 0:x.surCharge)&&(0,l.jsx)(d,{label:k("label.card.fee"),value:M(x.surCharge),isLoading:j}),!!(null==x?void 0:x.deliveryCharge)&&(0,l.jsx)(d,{label:k("label.delivery.fee"),value:M(x.deliveryCharge),isLoading:j}),!!(null==x?void 0:x.customerOrderTaxes)&&x.customerOrderTaxes.map(e=>(0,l.jsx)(d,{label:e.taxLabel,value:M(e.taxAmount),isLoading:j},e.id)),D&&!!(null==x?void 0:x.tip)&&(0,l.jsx)(d,{label:k("order.details.tip"),value:M(x.tip),isLoading:j}),!!(null==x?void 0:x.driverTip)&&(0,l.jsx)(d,{label:k("label.drivertip"),value:M(x.driverTip),isLoading:j}),null==x?void 0:null===(t=x.shoppingCartTaxes)||void 0===t?void 0:t.map(e=>{let{chargeMode:t,taxLabel:n,taxAmount:o,taxRule:i,rate:u}=e,r=1===t?"":"(".concat(parseFloat((100*u).toFixed(10)),"%)"),a="".concat(n," ").concat(r),s=M(o),c="".concat(n,"-").concat(o,"-").concat(i);return(0,l.jsx)(d,{label:a,value:s,isLoading:j},c)}),!!(null==x?void 0:x.amount)&&(0,l.jsx)(d,{label:k("label.amount"),value:M(x.amount),isLoading:j}),I&&(0,l.jsx)(h.g,{styles:{paddingBottom:8},isLoading:I.isLoading,shoppingCart:I.shoppingCart,service:I.service,onTipChange:I.onTipChange,tipType:I.tipType,tipValue:I.tipValue}),b()(null==x?void 0:x.total)&&(null==x?void 0:x.total)>=0&&(0,l.jsx)(d,{isPrimary:!0,isBold:!0,label:k("label.total.capital").toUpperCase(),value:M(x.total),isLoading:j}),T&&(0,l.jsx)(m.Z,{message:T,style:{color:P,marginTop:12},type:"success"})]})}},90030:function(e,t,n){let l=(0,n(31993).U)(e=>({selectedProductId:void 0,selectedKey:void 0,isOpenProductDetail:!1,selectedMenuProductPreview:void 0,setSelectedProductId:t=>e({selectedProductId:t}),setSelectedKey:t=>e({selectedKey:t}),setIsOpenProductDetail:t=>e({isOpenProductDetail:t}),setSelectedMenuProductPreview:t=>e({selectedMenuProductPreview:t})}));t.Z=l},62515:function(e,t,n){let l=(0,n(31993).U)(e=>({selectedMenu:void 0,setSelectedMenu:t=>e({selectedMenu:t})}));t.Z=l}}]);

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.