PageSourceSearch

https://www.wegmans.com/_next/static/chunks/2z-is4mz3s1ir.js

js wegmans.com collected 2026-10-01 10:12:12 UTC 26,980 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,419590,t=>{"use strict";var e=t.i(843476),i=t.i(32177),a=t.i(343794);t.s(["AIChatAdditionalInfo",0,function({appearance:t="default",children:r,icon:n,className:o}){return(0,e.jsxs)("div",{className:(0,a.default)("component--ai-chat-additional-info",{"appearance--outlined":"outlined"===t},o),children:[(0,e.jsx)("div",{className:"ai-chat-additional-info-icon-container",children:(0,e.jsx)("span",{"aria-hidden":!n||void 0,className:"ai-chat-additional-info-icon",children:n??(0,e.jsx)(i.default,{className:"ai-chat-additional-info-icon-image",height:12,width:12})})}),(0,e.jsx)("span",{className:"ai-chat-additional-info-text",children:r})]})}])},923110,t=>{"use strict";var e=t.i(843476),i=t.i(529346);t.i(908743);var a=t.i(905644),r=t.i(382261),n=t.i(293711),o=t.i(264810),l=t.i(965342),c=t.i(462463),s=t.i(381040),u=t.i(512705),d=t.i(613368),p=t.i(784028),y=t.i(140478),m=t.i(44350),h=t.i(909081),f=t.i(872770),g=t.i(340775),b=t.i(692690),v=t.i(849476),I=t.i(394315),C=t.i(206795),k=t.i(826516),A=t.i(885287),S=t.i(888669),N=t.i(254517),T=t.i(761229),x=t.i(543489),D=t.i(343794),P=t.i(657688),_=t.i(522016),B=t.i(271645);let{log:E,logError:w}=(0,T.createLogger)("components:AIChatBundleProductItem");t.s(["default",0,function({product:t,onAuthRequired:T,isEditing:q=!1,isDisabled:j=!1,isControlsOpen:R=!1,onEditingChange:L,onControlsToggle:O,responseId:F,position:U,alcoholDialogProps:V,isAlcoholDialogRequired:M=!1,setAlcoholPopupTermsAccepted:W,shouldDisplayItemTag:$=!1,shouldDisplayMyItemsBadge:z=!1,shouldDisplayMayNotAvailableBadge:K=!1,onProductClick:Q,className:H,eventComponent:G,eventPosition:X}){let Z,J,Y,[tt,te]=(0,B.useState)(!1),[ti,ta]=(0,B.useState)(!1),{isAuthenticated:tr}=(0,B.use)(h.AuthContext),{triggerAddProductToCart:tn}=(0,d.useAddProductToCart)(),{triggerUpdateProductQuantityForCarts:to}=(0,y.useUpdateProductQuantityForCarts)(),{triggerRemoveItem:tl}=(0,p.useRemoveItemFromCart)(),{recordAddToCartInteraction:tc}=(0,u.useAIChatInteractions)(),ts=(0,g.useCartsStore)(t=>t.isBusy),tu=(0,g.useCartsStore)(t=>t.getCartItemQuantity),td=(0,g.useCartsStore)(t=>t.increment),tp=(0,g.useCartsStore)(t=>t.decrement),ty=(0,g.useCartsStore)(t=>t.setProductsToRemove),tm=(0,g.useCartsStore)(t=>t.addProductToCart),th=(0,v.useShoppingContextStore)(t=>t.shoppingMethod),tf=(0,b.useCustomerStore)(t=>t.customer),tg=(0,f.useAIChatStore)(f.selectHasBeenTracked),tb=(0,f.useAIChatStore)(f.selectTrackInteraction),tv=(0,B.useRef)(!1),tI=(0,B.useRef)(null),tC=(0,B.useRef)(null),tk=(0,m.useDebounce)((0,B.useCallback)(()=>{to()},[to]),600),tA=t.skuId??t.productId??"",tS=tA?tu(tA):0,tN=tS>0,tT=(0,N.isIwsProduct)(t),tx=M&&tT,{productName:tD,imageUrl:tP,imageAlt:t_,displayPackSize:tB,recommendedQuantity:tE,productDetailUrl:tw,showRecommendedTag:tq}=function(t){let{productName:e,image:i,skuId:a,productId:r,packSize:n,isSoldByWeight:o,onlineApproxUnitWeight:l,bundleQuantity:c,originalData:s}=t,u=i?.src??"/images/noimage.png",d=i?.alt??e??"Product image",p=s?.pack_size??s?.size??n??(o&&l?`~${l} lb`:null),y=c??1;"number"==typeof s?.add_quantity?y=s.add_quantity:"string"==typeof s?.add_quantity&&(y=Number.parseInt(s.add_quantity,10));let m=null;return a?m=`/shop/product/${a}`:r&&(m=`/shop/product/${r}`),{productName:e,imageUrl:u,imageAlt:d,displayPackSize:p,recommendedQuantity:y,productDetailUrl:m,showRecommendedTag:y>1}}(t),{skuId:tj}=t;(0,B.useEffect)(()=>{!ts&&q&&L?.(!1)},[ts,q,L]),(0,B.useEffect)(()=>{let t=tv.current,e=!ts;if(t&&e){let t=tC.current;if(t&&(tC.current=null,tu(t.sku)>t.previousCartQuantity&&(0,A.fireAnalyticsTrackingEvent)("addToCart",{event:{action:"add to cart",eventName:"addToCart",location:{component:t.eventComponent,position:t.eventPosition,variant:"none"}},product:[{department:t.department,location:t.eventPosition,price:t.price,productAction:"view",quantity:t.quantity,sku:t.sku}],store:{cartType:t.shoppingMethod}},"AIChatBundleProductItem")),tI.current&&F&&null!=U){let t=tI.current;tc({responseId:t.responseId,position:t.position,sku:t.sku,interactionType:"BUNDLE_SINGLE_ADD_TO_CART"}).then(e=>{e&&E("Analytics tracked for individual bundle product add",{responseId:t.responseId,position:t.position,sku:t.sku})}).catch(e=>{w("Failed to track analytics for individual bundle product add",{error:e,sku:t.sku})}).finally(()=>{tI.current=null})}}tv.current=ts},[ts,F,U,tc,tu]);let tR=(0,B.useCallback)(async()=>
1{if(!tt&&!ts){E("Adding product to cart",{skuId:tj,productName:tD,quantity:tE});try{let e,i;te(!0);let a=tu(tA),r=(e=t.skuId??t.productId??t.productID??"",{bottleDeposit:(i=(0,S.transformProductDataIntoCartData)({...t,productId:e},tE)).bottleDeposit,category:i.category,categoryId:i.categoryId,digitalCouponsOffers:i.digitalCouponsOffers,ebtEligible:i.ebtEligible,fulfillmentTypes:i.fulfillmentTypes,isAlcoholic:i.isAlcoholic,isAvailable:i.isAvailable??!0,isSoldAtStore:i.isSoldAtStore??!0,isSoldByWeight:i.isSoldByWeight,loyaltyDeliveryDiscount:t.loyaltyDeliveryDiscount,loyaltyInstoreDiscount:t.loyaltyInstoreDiscount,max:i.max,onlineApproxUnitWeight:i.onlineApproxUnitWeight,onlineSellByUnit:i.onlineSellByUnit,planogram:i.planogram,productId:i.skuID,standalonePrice:i.standalonePrice,step:tE,upc:i.upc});tm(r),tn(),G&&(tC.current={sku:tA,quantity:tE,department:(0,k.getBundleProductDepartment)(t),price:(0,k.getBundleDisplayedPrice)({product:t,shoppingMethod:th,isUserAuthenticated:tr}),eventComponent:G,eventPosition:X??"none",shoppingMethod:th,previousCartQuantity:a}),E("Product added successfully",{skuId:tj}),F&&null!=U&&tj&&(tI.current={sku:tj,responseId:F,position:U})}catch(t){E("Failed to add product",{skuId:tj,error:t}),t instanceof Error&&t.message.includes("Authentication required")&&T()}finally{te(!1)}}},[tm,tn,tu,tt,ts,T,t,tA,tD,tE,F,U,tj,G,X,tr,th]),tL=(0,B.useCallback)(async t=>
1{if(t.preventDefault(),t.stopPropagation(),!tt&&!ts){if(tx&&!tN)return void ta(!0);await tR()}},[tR,tt,ts,tN,tx]),tO=(0,B.useCallback)(async t=>{t.preventDefault(),t.stopPropagation(),ts||!tA||j||(L?.(!0),E("Incrementing product quantity",{skuId:tA}),td({productId:tA,isAlcoholic:tT}),tk())},[td,ts,j,L,tT,tA,tk]),tF=(0,B.useCallback)(async t=>{t.preventDefault(),t.stopPropagation(),ts||!tA||tS<=1||j||(L?.(!0),E("Decrementing product quantity",{skuId:tA}),tp({productId:tA,isAlcoholic:tT}),tk())},[tp,ts,j,L,tT,tA,tS,tk]),tU=(0,B.useCallback)(async t=>{if(t.preventDefault(),t.stopPropagation(),ts||!tA||j)return;L?.(!0),E("Removing product from cart",{skuId:tA});let e=g.useCartsStore.getState().getCartItemById(tA);if(e){let t=g.useCartsStore.getState().carts.find(t=>t.lineItems.some(t=>t.sku===tA));t&&(ty({cartId:t.id,lineItemId:e.id,sku:tA}),tl())}},[ts,j,L,tA,ty,tl]),tV=(0,B.useCallback)(()=>{if(!F||null==U||!tf?.key)return;let e=(0,k.getProductSku)(t);if(!e)return;let i=(0,C.getCooklistUserId)(tf.key);if(!i)return;let a=(0,I.createInteractionKey)(F,U,e,"VIEW_DETAIL");tg(a)||(0,s.createApiResponseInteraction)({apiResponseId:F,position:U,interactionType:"VIEW_DETAIL",userId:i,retailerProductSku:e}).then(t=>{t&&tb(a)}).catch(t=>{E("Failed to track view detail",{error:t})})},[F,U,tf?.key,t,tg,tb]),tM=!1===t.isAvailable&&(!0===t.isSoldAtStore||K),[tW,t$]=(0,B.useState)(!1),{refs:tz,floatingStyles:tK,context:tQ}=(0,x.useFloating)({onOpenChange:t$,open:tW}),tH=(0,x.useHover)(tQ),tG=(0,x.useFocus)(tQ),{getReferenceProps:tX,getFloatingProps:tZ}=(0,x.useInteractions)([tH,tG]),tJ=(0,B.useCallback)(t=>{t.preventDefault(),t.stopPropagation(),O?.()},[O]);return(0,e.jsxs)("div",{className:(0,D.default)("component--ai-chat-bundle-product-item",H),children:[tx&&(0,e.jsx)(n.default,{...V??{},isOpen:ti,onClose:()=>ta(!1),onOpen:()=>ta(!0),onSubmit:()=>{W?.(),ta(!1),tR()}}),(0,e.jsxs)("div",{className:"ai-chat-product-bundle-card-product-image-wrapper",children:[z&&(0,e.jsx)("div",{className:"my-items-tag",children:(0,e.jsx)(o.default,{text:"My Items"})}),(Z=(0,e.jsx)("div",{className:"ai-chat-product-bundle-card-product-image",children:(0,e.jsx)(P.default,{unoptimized:!0,alt:t_,className:(0,D.default)("ai-chat-product-bundle-card-product-image-content",{"tw:opacity-50":tM}),height:120,src:tP,width:120})}),Q?(0,e.jsx)("button",{"aria-label":`View ${tD} details`,className:"ai-chat-product-bundle-card-product-button",type:"button",onClick:()=>{tV(),Q(t)},children:Z}):tw?(0,e.jsx)(_.default,{"aria-label":`View ${tD} details`,className:"ai-chat-product-bundle-card-product-link",href:tw,onClick:tV,children:Z}):Z),tM&&(0,e.jsxs)("span",{className:"may-not-be-available-badge",ref:tz.setReference,...tX(),children:[c.MAY_NOT_AVAILABLE_TEXT,tW&&(0,e.jsx)("div",{"aria-hidden":"true",className:"may-not-be-available-tooltip",ref:tz.setFloating,...tZ(),style:{...tK,zIndex:10},children:(0,e.jsx)(i.default,{})})]}),(()=>{if(tN){let t=ts||j;return R?(0,e.jsxs)("div",{className:"ai-chat-product-bundle-card-product-quantity-control is-open",children:[(0,e.jsx)("button",{"aria-label":tS>1?`Decrease quantity of ${tD}`:`Remove ${tD} from cart`,className:"ai-chat-product-bundle-card-quantity-button ai-chat-product-bundle-card-quantity-button--remove",disabled:t,type:"button",onClick:t=>{tS>1?tF(t):tU(t)},children:tS>1?(0,e.jsx)(r.Remove,{style:{fontSize:"16px"}}):(0,e.jsx)(a.Delete,{style:{fontSize:"16px"}})}),(0,e.jsx)("button",{"aria-label":`Current quantity: ${tS}. Click to close quantity controls`,className:"ai-chat-product-bundle-card-quantity-value-button",type:"button",onClick:tJ,children:(0,e.jsx)("span",{className:"ai-chat-product-bundle-card-quantity-value",children:tS})}),(0,e.jsx)("button",{"aria-label":`Add more ${tD} to cart`,className:"ai-chat-product-bundle-card-quantity-button ai-chat-product-bundle-card-quantity-button--add",disabled:t,type:"button",onClick:tO,children:(0,e.jsx)("span",{className:"ai-chat-product-bundle-card-button-plus",children:"+"})})]}):(0,e.jsx)("button",{"aria-label":`Current quantity: ${tS}. Click to open quantity controls`,className:"ai-chat-product-bundle-card-quantity-badge",type:"button",onClick:tJ,children:(0,e.jsx)("span",{className:"ai-chat-product-bundle-card-quantity-badge-number",children:tS})})}let t=`Add ${tD} to cart${tE>1?` (${tE} items)`:""}`;return(0,e.jsx)("button",{"aria-label":t,className:(0,D.default)("ai-chat-product-bundle-card-product-add-button",{"is-adding":tt}),disabled:tt||ts||j,type:"button",onClick:tL,children:tt?(0,e.jsx)("span",{className:"ai-chat-product-bundle-card-button-loading",children:"..."}):(0,e.jsx)("span",{className:"ai-chat-product-bundle-card-button-plus",children:"+"})})})()]}),$&&(t.isNewItem||t.isHotZone)&&(0,e.jsx)("span",{className:"item-tag",children:t.isNewItem?c.NEW_ITEM_BADGE_TEXT:c.HOT_ZONE_ITEM_BADGE_TEXT}),(J=(0,e.jsx)("h3",{className:"ai-chat-product-bundle-card-product-title",children:tD}),Y={digitalCouponsOffers:t.digitalCouponsOffers,loyaltyDeliveryDiscount:t.loyaltyDeliveryDiscount,loyaltyInstoreDiscount:t.loyaltyInstoreDiscount,discountType:t.discountType,isSoldByWeight:t.isSoldByWeight,isUserAuthenticated:tr,onlineSellByUnit:t.onlineSellByUnit,packSize:t.packSize,price_delivery:t.price_delivery,price_deliveryLoyalty:t.price_deliveryLoyalty,price_inStore:t.price_inStore,price_inStoreLoyalty:t.price_inStoreLoyalty,shoppingMethod:th},(0,e.jsxs)("div",{className:"ai-chat-product-bundle-card-product-details",children:[Q?(0,e.jsx)("button",{"aria-label":`View ${tD} details`,className:"ai-chat-product-bundle-card-product-button",type:"button",onClick:()=>{tV(),Q(t)},children:J}):tw?(0,e.jsx)(_.default,{"aria-label":`View ${tD} details`,className:"ai-chat-product-bundle-card-product-link",href:tw,onClick:tV,children:J}):J,tB&&(0,e.jsx)("p",{className:"ai-chat-product-bundle-card-product-pack-size",children:tB}),(0,e.jsx)("div",{className:"ai-chat-product-bundle-card-product-price-row",children:(0,e.jsx)(l.default,{appearance:"tile",...Y})}),tq&&(0,e.jsxs)("div",{className:"ai-chat-product-bundle-card-product-quantity-tag",children:[tE," recommended"]})]}))]})}],923110)},854115,t=>{"use strict";var e=t.i(843476);t.s(["default",0,function({className:t="",color:i="currentColor",height:a=24,width:r=24,strokeWidth:n="2",viewBox:o="0 0 24 24"}){return(0,e.jsxs)("svg",{className:t,"data-testid":"IconAiChatBundleCardInfo",fill:"none",height:a,stroke:i,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:n,viewBox:o,width:r,xmlns:"http://www.w3.org/2000/svg",children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,e.jsx)("line",{x1:"12",x2:"12",y1:"16",y2:"16"}),(0,e.jsx)("line",{x1:"12",x2:"12",y1:"12",y2:"8"})]})}])},101513,826516,397214,t=>{"use strict";var e=t.i(500932),i=t.i(512705),a=t.i(335073),r=t.i(849476),n=t.i(740927),o=t.i(139808),l=r,c=t.i(254517);let s=t=>{let e,i=t.originalData,a=i?.retailer_product_sku;return"string"==typeof a?e=a:"number"==typeof a&&(e=String(a)),e??t.skuId??t.productId??""},u=t=>{let e=t.originalData?.add_quantity;return"number"==typeof e?e:"string"==typeof e?Number.parseInt(e,10):t.bundleQuantity??1},d=({product:t,shoppingMethod:e=l.ShoppingMethodEnum.delivery,isUserAuthenticated:i=!0})=>{let{bestPrice:a}=(0,o.getPrices)({digitalCouponsOffers:t.digitalCouponsOffers,loyaltyDeliveryDiscount:t.loyaltyDeliveryDiscount,loyaltyInstoreDiscount:t.loyaltyInstoreDiscount,discountType:t.discountType,isUserAuthenticated:i,price_delivery:t.price_delivery,price_deliveryLoyalty:t.price_deliveryLoyalty,price_inStore:t.price_inStore,price_inStoreLoyalty:t.price_inStoreLoyalty,shoppingMethod:e}),r=a.price;if(null==r||""===r)return;let n=Number(r);return Number.isFinite(n)?n:void 0},p=t=>t.category?.[0]?.name??void 0,y=t=>{if(!(t.skuId??t.productId))return!1;let e=u(t);return!!Number.isFinite(e)&&!(e<=0)&&(0,c.isProductPurchasable)(t)};t.s(["calculateBundleTotalPrice",0,(t,e=l.ShoppingMethodEnum.delivery)=>t.reduce((t,i)=>{let a=i.originalData,r=a?.add_quantity??1,n=Number.isFinite(Number(r))&&Number(r)>0?Number(r):1,o=i.price_inStore?.amount,c=i.price_delivery?.amount,s=i.price_deliveryLoyalty?.amount,u=i.price,d=0;return(e===l.ShoppingMethodEnum.delivery||e===l.ShoppingMethodEnum.pickup)&&c?d=Number(c):o?d=Number(o):s?d=Number(s):u?d=Number(u):a?.price!=null?d=Number(a.price):a?.discount_price!=null&&(d=Number(a.discount_price)),t+d*n},0),"getBundleDisplayedPrice",0,d,"getBundleProductDepartment",0,p,"getBundleProductQuantity",0,u,"getProductSku",0,s,"getRecommendedQuantity",0,t=>{let e=t.originalData,i=Number(e?.add_quantity??0);return Number.isFinite(i)&&i>1?i:null},"isBundleProductEligible",0,y],826516);var m=t.i(761229),h=t.i(271645),f=t.i(901879);let{log:g,logError:b}=(0,m.createLogger)("hooks:useBundleCartOperations");function v(t){return null!=t}function I(t){return t instanceof Error?t:Error(String(t))}function C(t){return t.sku}function k(t){return[t.skuId??t.productId,t]}function A(t){return t.shoppingMethod}t.s(["useBundleCartOperations",0,function(t){let o,l,s,u,y,m,S,N,T,x,D,P,_,B,E=(0,e.c)(37);E[0]!==t?(o=void 0===t?{}:t,E[0]=t,E[1]=o):o=E[1];let w=o,[q,j]=(0,h.useState)("idle"),[R,L]=(0,h.useState)(null);E[2]===Symbol.for("react.memo_cache_sentinel")?(l=[],E[2]=l):l=E[2];let[O,F]=(0,h.useState)(l);E[3]===Symbol.for("react.memo_cache_sentinel")?(s={},E[3]=s):s=E[3];let[U,V]=(0,h.useState)(s),{addProductsToCart:M,isLoading:W}=(0,a.useAddProductsToCartBulk)(),$=(0,r.useShoppingContextStore)(A),{openAlcoholWarningDialog:z}=(0,f.useProductAlcoholDialog)(),{recordAddToCartInteractionMulti:K}=(0,i.useAIChatInteractions)(),{onAuthRequired:Q,responseId:H,position:G}=w,X=null!=H&&null!=G;t:{if("delivery"===$){u="delivery";break t}if("instore"===$){u="instore";break t}u="pickup"}let Z=u;E[4]!==Q?(y=t=>{b("Failed to add products to cart",{error:t}),L(Error(t)),j("error"),(t.includes("Authentication required")||t.includes("Please log in"))&&Q?.()},E[4]=Q,E[5]=y):y=E[5];let J=y;E[6]!==$||E[7]!==X?(m=(t,e)=>{if(!X)return;let i=new Map(t.map(k)),a=e.map((t,e)=>{var a;let r=i.get(t.sku);return{productAction:(a={sku:t.sku,price:r?d({product:r,shoppingMethod:$}):void 0,department:r?p(r):void 0,positionIndex:e+1,quantity:t.quantity,productAction:"Add All products to Cart"}).productAction,sku:a.sku,price:a.price,department:a.department,location:"ai chat",positionIndex:a.positionIndex,quantity:a.quantity}});0!==a.length&&(0,n.fireAIChatBundleAddToCart)({products:a})}
1,E[6]=$,E[7]=X,E[8]=m):m=E[8];let Y=m;E[9]!==z?(S=t=>{let{onClose:e,onSubmit:i}=t;return new Promise((t,a)=>{z({onSubmit:async()=>{try{await i(),t()}catch(t){a(I(t))}},onClose:async()=>{if(e)try{await e(),t()}catch(t){a(I(t))}}})})},E[9]=z,E[10]=S):S=E[10];let tt=S;E[11]!==G||E[12]!==K||E[13]!==H?(N=t=>{null!=H&&null!=G&&0!==t.length&&K({responseId:H,position:G,skus:t,interactionType:"BUNDLE_BULK_ADD_TO_CART"}).catch(e=>{b("Failed to track bundle bulk interaction",{error:e,skuCount:t.length})})},E[11]=G,E[12]=K,E[13]=H,E[14]=N):N=E[14];let te=N;E[15]===Symbol.for("react.memo_cache_sentinel")?(T=t=>{let e=t instanceof Error?t.message:"Failed to add products to cart. Please check your connection and try again.";(b("Failed to add products to cart",{error:t}),t instanceof Error&&(t.message.includes("network")||t.message.includes("fetch")||t.message.includes("offline")||t.message.includes("timeout")))?L(Error("Network error. Please check your connection and try again.")):L(Error(e)),j("error")},E[15]=T):T=E[15];let ti=T;E[16]!==M||E[17]!==Y||E[18]!==Z||E[19]!==J||E[20]!==te?(x=async(t,e)=>{let i,a,{shouldSkipAvailabilityCheck:r,isRetry:n}=void 0===e?{}:e,o=void 0!==r&&r;if(0===t.length)return void g("No products to add");j("loading"),L(null),F(t),V({shouldSkipAvailabilityCheck:o}),g("Adding all products to cart",{count:t.length});let l=t.map(t=>(function(t,e=!1){let i=t.bundleQuantity??1;"number"==typeof t.originalData?.add_quantity?i=t.originalData.add_quantity:"string"==typeof t.originalData?.add_quantity&&(i=Number.parseInt(t.originalData.add_quantity,10));let a=t.skuId??t.productId;return a?!Number.isFinite(i)||i<=0?(g("Skipping bundle product with invalid quantity",{sku:a,quantity:i}),null):e||(0,c.isProductPurchasable)(t)?{sku:a,quantity:i,bottleDeposit:t.bottleDeposit,categories:t.categories,category:t.category,digitalCouponsOffers:t.digitalCouponsOffers,ebtEligible:t.ebtEligible,fulfilmentType:t.fulfilmentType,fulfillmentTypes:t.fulfillmentTypes,soldByVendor:t.soldByVendor,isAvailable:t.isAvailable,isSoldAtStore:t.isSoldAtStore,isSoldByWeight:t.isSoldByWeight,loyaltyDeliveryDiscount:t.loyaltyDeliveryDiscount,loyaltyInstoreDiscount:t.loyaltyInstoreDiscount,max:t.max,onlineApproxUnitWeight:t.onlineApproxUnitWeight,onlineSellByUnit:t.onlineSellByUnit,planogram:t.planogram,upc:t.upc}:(g("Skipping unavailable bundle product",{sku:a}),null):(g("Skipping bundle product without SKU",{skuId:t.skuId,productId:t.productId}),null)})(t,o)).filter(v);if(0===l.length){L(Error("No available products to add")),j("error");return}let s=(a=new Map,l.forEach(t=>{let e=a.get(t.sku);e?a.set(t.sku,{...e,quantity:e.quantity+t.quantity}):a.set(t.sku,t)}),Array.from(a.values()));try{i=await M({products:s,fulfillmentType:Z,verifyInCart:!0})}catch(t){ti(t);return}i?.success?(j("success"),void 0!==n&&n||Y(t,s),te(s.map(C))):J(i?.error??"Failed to add products to cart")},E[16]=M,E[17]=Y,E[18]=Z,E[19]=J,E[20]=te,E[21]=x):x=E[21];let ta=x;E[22]!==ta?(D=async(t,e)=>{let i=void 0===e?{}:e,{shouldSkipAvailabilityCheck:a}=i,r=void 0!==a&&a,n=t.filter(t=>!(0,c.isIwsProduct)(t)&&(r||!1!==t.isAvailable));if(0===n.length){L(Error("No non-alcohol products available to add to cart")),j("error");return}await ta(n,i)},E[22]=ta,E[23]=D):D=E[23];let tr=D;E[24]!==ta||E[25]!==tr||E[26]!==tt?(P=async(t,e)=>{let i=void 0===e?{}:e;t.some(c.isIwsProduct)?await tt({onSubmit:()=>ta(t,i),onClose:()=>tr(t,i)}):await ta(t,i)},E[24]=ta,E[25]=tr,E[26]=tt,E[27]=P):P=E[27];let tn=P;E[28]!==tn||E[29]!==U||E[30]!==O?(_=()=>{L(null),O.length>0&&tn(O,{...U,isRetry:!0})},E[28]=tn,E[29]=U,E[30]=O,E[31]=_):_=E[31];let to=_,tl=W?"loading":q;return E[32]!==tn||E[33]!==R||E[34]!==to||E[35]!==tl?(B={addAllToCart:tn,handleRetry:to,status:tl,error:R,retry:to},E[32]=tn,E[33]=R,E[34]=to,E[35]=tl,E[36]=B):B=E[36],B}],101513);var S=t.i(340775);function N(t){return t.carts}function T(t){return t.productsToRemove}function x(t){if(!s(t))return!1;let e=u(t);return Number.isFinite(e)&&e>0}function D(t){return y(t)}t.s(["useBundleCartTracking",0,(t,i)=>{let a,r,n,o,l,c,d=(0,e.c)(24);d[0]!==i?(a=void 0===i?{}:i,d[0]=i,d[1]=a):a=d[1];let{shouldSkipAvailabilityCheck:p}=a,y=void 0!==p&&p,m=(0,S.useCartsStore)(N),h=(0,S.useCartsStore)(T);d[2]!==m||d[3]!==h?(r=(t,e)=>{let i=void 0===e?1:e;return!h.some(e=>e.sku===t)&&m.some(e=>[...e.lineItems,...e.unavailableItems??[]].some(e=>e.sku===t&&(e.quantity??0)>=i))},d[2]=m,d[3]=h,d[4]=r):r=d[4];let f=r;if(d[5]!==f||d[6]!==t||d[7]!==y){t:{let e,i=y?t.filter(x):t.filter(D);if(0===i.length){n=!1;break t}d[9]!==f?(e=t=>{let e=s(t);return!!e&&f(e,u(t))},d[9]=f,d[10]=e):e=d[10],n=i.every(e)}d[5]=f,d[6]=t,d[7]=y,d[8]=n}else n=d[8];let g=n;e:{let e;if(g){o=!1;break e}if(d[11]!==f||d[12]!==t){let i;d[14]!==f?(i=t=>{let e=s(t);return!!e&&f(e)},d[14]=f,d[15]=i):i=d[15],e=t.some(i),d[11]=f,d[12]=t,d[13]=e}else e=d[13];o=e}let b=o;d[16]!==f||d[17]!==t?(l=()=>t.filter(t=>{let e=s(t);return!!e&&!f(e,u(t))}),d[16]=f,d[17]=t,d[18]=l):l=d[18];let v=l;return d[19]!==v||d[20]!==b||d[21]!==g||d[22]!==f?(c={isProductInCart:f,isAddedToCart:g,hasSomeInCart:b,getMissingProducts:v},d[19]=v,d[20]=b,d[21]=g,d[22]=f,d[23]=c):c=d[23],c}],397214)},335073,254517,t=>{"use strict";var e=t.i(271645),i=t.i(613368),a=t.i(340775),r=t.i(394315);let{log:n,logError:o}=(0,t.i(761229).createLogger)("useAddProductsToCartBulk");
1function l(t){return!!t.soldByVendor}t.s(["useAddProductsToCartBulk",0,function(){let[t,l]=(0,e.useState)(!1),c=(0,a.useCartsStore)(t=>t.addProductToCart),{addToCart:s}=(0,i.useAddProductToCart)();return{addProductsToCart:(0,e.useCallback)(async t=>{let{products:e,fulfillmentType:i,verifyInCart:u=!1}=t;if(!e||0===e.length)return{success:!1,error:"No products provided"};l(!0);try{n("Adding products to cart",{productCount:e.length,fulfillmentType:i,verifyInCart:u});let t=e.map(t=>{let{sku:e}=t;if(!e)throw Error(`Product missing identifier: ${JSON.stringify(t)}`);let i=Number.isFinite(t.quantity)?t.quantity:1,a=t.categories,r=t.category,n=Array.isArray(r)?r:void 0,o=n?.find(t=>t?.level==="lvl0")??n?.[0],l=a?.lvl0??o?.name??("string"==typeof r?r:void 0)??"",c=t.categoryId??o?.key??(n?n.find(t=>t.name===l)?.key:void 0),s=t.fulfillmentTypes??t.fulfilmentType;return{bottleDeposit:t.bottleDeposit,category:l,categoryId:null==c?"":String(c),digitalCouponsOffers:t.digitalCouponsOffers??[],ebtEligible:!!t.ebtEligible,fulfillmentTypes:s,isAlcoholItem:!!t.soldByVendor,isAlcoholic:!!t.soldByVendor,isAvailable:t.isAvailable??!0,isSoldAtStore:t.isSoldAtStore??!0,isSoldByWeight:t.isSoldByWeight,loyaltyDeliveryDiscount:t.loyaltyDeliveryDiscount,loyaltyInstoreDiscount:t.loyaltyInstoreDiscount,max:t.max??99,onlineApproxUnitWeight:t.onlineApproxUnitWeight??0,onlineSellByUnit:t.onlineSellByUnit,planogram:t.planogram,productId:e,soldByVendor:t.soldByVendor??null,standalonePrice:"number"==typeof t.standalonePrice?t.standalonePrice:0,step:i,upc:t.upc}});for(let e of t)c({...e,step:e.step??1});await s();let l=null,d=[];if(u){let e=t.map(t=>t.productId).filter(Boolean),i=a.useCartsStore.getState().carts;if((l=(0,r.verifyCartItems)(i,e)).added.length>0&&(d=l.added.map(t=>{let e=t.sku||"",i=t.cartItemId,a=t.totalValue;return{retailerProductSku:e,...i&&{retailerShoppingCartItemId:i},...void 0!==a&&{totalValue:a}}})),!l?.allAdded){let t=e.filter(t=>!l?.added.some(e=>e.sku===t));return o("Some products were not added to cart",{missingSkus:t,expectedCount:e.length,addedCount:l?.added.length??0}),{success:!1,error:"Failed to add items to cart. Please try again.",addedItems:d}}}else d=t.map(t=>({retailerProductSku:t.productId||""}));return n("Products added to cart successfully",{productCount:e.length,verified:u,addedItemsCount:d.length}),{success:!0,addedItems:d}}catch(t){return o("Failed to add products to cart",{error:t}),{success:!1,error:t instanceof Error?t.message:"Failed to add products to cart"}}finally{l(!1)}},[c,s]),isLoading:t}}],335073),t.s(["isIwsProduct",0,l,"isProductPurchasable",0,function(t){return!!l(t)||!1!==t.isAvailable&&!1!==t.isSoldAtStore},"isRecipeItemAnIwsProduct",0,function(t){return!!t.product?.soldByVendor||!!t.product?.product?.storeLocationInventory?.soldByVendor||!!t.product?.storeLocationInventory?.soldByVendor}],254517)},740927,t=>{"use strict";var e=t.i(885287);let i="ai chat",a="ai chat modal",r="ai chat action card",n="ai chat custom recipe card";t.s(["fireAIChatActionCardAddToCart",0,function(t){let a=[{productAction:"add to cart",sku:t.sku,price:t.price,department:t.department,quantity:t.quantity,location:r}];return(0,e.fireAnalyticsTrackingEvent)("addToCart",{event:{eventName:"addToCart",action:"add to cart",location:{position:r,component:i}},product:a},"AIChat:ActionCard")},"fireAIChatBundleAddToCart",0,function(t){return(0,e.fireAnalyticsTrackingEvent)("addToCart",{event:{eventName:"addToCart",action:"add to cart",location:{position:i,component:i}},product:t.products},"AIChat:Bundle")},"fireAIChatCustomRecipeSave",0,function(t){let a={eventName:i,action:"ai chat : custom recipe save",location:{position:n,variant:t.variant}};return(0,e.fireAnalyticsTrackingEvent)("trackAction",{event:a,customRecipe:{sourceKey:t.sourceKey,responseId:t.responseId,versionStatus:t.versionStatus,canonicalRecipeId:t.canonicalRecipeId}},"AIChat:CustomRecipeSave")},"fireAIChatCustomRecipeView",0,function(t){return(0,e.fireAnalyticsTrackingEvent)("trackAction",{event:{eventName:i,action:"ai chat : custom recipe view",location:{position:n}},customRecipe:{sourceKey:t.sourceKey,canonicalRecipeId:t.canonicalRecipeId}},"AIChat:CustomRecipeView")},"fireAIChatModalClose",0,function(){return(0,e.fireAnalyticsTrackingEvent)("trackAction",{event:{eventName:i,action:"ai chat : modal close",location:{position:a}}},"AIChat")},"fireAIChatModalOpen",0,function(t){return(0,e.fireAnalyticsTrackingEvent)("trackAction",{event:{eventName:i,action:"ai chat : modal open",location:{position:"deep_link"===t?"deep link":"ai chat button",variant:t}}},"AIChat")},"fireAIChatNewChat",0,function(){return(0,e.fireAnalyticsTrackingEvent)("trackAction",{event:{eventName:i,action:"ai chat : new chat",location:{position:a}}},"AIChat")},"fireAIChatRecipeAddToCart",0,function(t){let i={listType:"recipe",listAction:"add to cart",listName:t.listName,listID:t.listID,listSize:t.listSize,listTags:t.listTags};return(0,e.fireAnalyticsTrackingEvent)("addToCart",{event:{eventName:"addToCart",action:"add to cart",location:{position:r,component:"ReviewIngredientsModal"}},list:i,product:t.products},"AIChat:Recipe")},"fireAIChatSendMessage",0,function(t){return(0,e.fireAnalyticsTrackingEvent)("trackAction",{event:{eventName:i,action:"ai chat : send message",location:{position:a,variant:t}}},"AIChat")}])}]);

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.