PageSourceSearch

https://www.sonicdrivein.com/_next/static/chunks/8575-d3136899fc702bd4.js

js sonicdrivein.com collected 2026-09-24 08:56:03 UTC 15,374 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8575],{38563:function(e,t,r){r.d(t,{r5:function(){return l},tJ:function(){return o},yj:function(){return n}});var i=r(57343);let n={Sun:i.zN2.Sunday,Mon:i.zN2.Monday,Tue:i.zN2.Tuesday,Wed:i.zN2.Wednesday,Thu:i.zN2.Thursday,Fri:i.zN2.Friday,Sat:i.zN2.Saturday};i.Aej.Wifi,i.Aej.BlazingRewards,i.Aej.GoLocation,i.Aej.ExpressLocation,i.Aej.UfcViewing,i.Aej.Delivery,i.Aej.DriveIn,i.Aej.DriveThru,i.Aej.OnlineOrdering,i.Aej.Stall,i.Aej.Patio,i.Aej.MobileExpress,i.Aej.CarryOut,i.tzv.DriveThrough,i.tzv.MobileExpress,i.tzv.Patio,i.tzv.Stall,i.tzv.CarryOut;let l="/locations",o=["FLS_LOCATION_NOT_FOUND","FLS_NO_PICKUP_LOCATIONS_FOUND"]},14653:function(e,t,r){r.d(t,{KJ:function(){return u},VD:function(){return o},_U:function(){return c},d9:function(){return a},eJ:function(){return s}});var i,n,l=r(72517);let o=l.default.Order.RECENT_ORDERS_TOAST_MESSAGE_ALL_ITEMS_UNAVAILABLE;l.default.Order.RECENT_ORDERS_TOAST_MESSAGE_ITEMS_NOT_IN_THE_MENU;let a=l.default.Order.RECENT_ORDERS_PRODUCT_NOT_FOUND||"Unknown Product",u=null!==(n=null===(i=l.default.Order)||void 0===i?void 0:i.REORDER_AUTO_STORE_TOAST)&&void 0!==n?n:"Ordering from {{locationName}}",s="hasProductsNotInMenu",c="hasSelectionsNotInMenu"},29783:function(e,t,r){var i=r(67294),n=r(91886),l=r(65504),o=r(71621),a=r(56494),u=r(92753),s=r(5901),c=r(63744),d=r(14653);t.Z=e=>{let{actions:{getProduct:t,getModifier:r,getProductGroupById:f,getModifierGroupById:p,getModifiersFromModifierGroup:v},isNationalMenu:y}=(0,o.Z)(),{availableItems:{categories:m}}=(0,a.Z)(),h=(0,i.useCallback)(function(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i={};for(let a of e){var o;let e=(0,l.V)("productGroups",a.productGroupId),u=r&&!a.productGroupId;if(!i[e]){u&&(i[(0,l.V)("products",a.productId)]={...t(a.productId),isDefault:!0});let r=f(a.productGroupId);if(!r)continue;i[e]={...r,childRefs:[]}}let s=t(a.productId);if(!s)continue;let c=(null===(o=a.selections)||void 0===o?void 0:o.length)?h(a.selections):{},d=a.action===n.rU7.Add;i[e].childRefs.push({...s,selected:d,quantity:{selected:Number(a.quantity)||1},ingredientRefs:c})}return i},[f,t]),A=(0,i.useCallback)(e=>{let t={};for(let o of e){var i,n;let e=(0,l.V)("modifierGroups",o.modifierGroupId);if(!t[e]){let r=p(o.modifierGroupId);if(!r){console.warn("Modifier group not found: ".concat(o.modifierGroupId));continue}t[e]={...r,childRefs:[]}}let a=v(o.modifierGroupId),u=r(o.modifierId);u&&t[e].childRefs.push({...u,isDefault:null!==(n=null===(i=a.find(e=>e.id===o.modifierId))||void 0===i?void 0:i.isDefault)&&void 0!==n?n:u.isDefault,selected:!0,quantity:{selected:1}})}return t},[p,r,v]),I=(0,i.useCallback)(e=>e.selections&&Array.isArray(e.selections)&&e.selections.length>0,[]),R=(0,i.useCallback)(e=>e.some(e=>I(e)),[I]),E=(0,i.useCallback)(e=>{let r={unavailableRootItems:[],availableItems:[],unavailableItems:[],notInTheMenuItems:[],migratedWithIssuesItems:[],itemWithAllUnavailableSelections:[]},i=e=>{let r=t(e.productId);return y||(null==r?void 0:r.isAvailable)===!0},l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.some(e=>!t(e.productId)||l((null==e?void 0:e.selections)||[]))};for(let o of e){if(o.conversionStatus===n.nc1.Failure){r.migratedWithIssuesItems.push(o);continue}let e=t(o.productId);if(!e){r.notInTheMenuItems.push(o);continue}l(o.selections)&&r.notInTheMenuItems.push(o);let a=y||e.isAvailable;a||r.unavailableRootItems.push(o);let{allUnavailable:u,hasUnavailable:s}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce((e,t)=>{let r=!i(t);return{allUnavailable:e.allUnavailable&&r,hasUnavailable:e.hasUnavailable||r}},{allUnavailable:!0,hasUnavailable:!1})}(o.selections);a&&!s?r.availableItems.push(o):(r.unavailableItems.push(o),u&&r.itemWithAllUnavailableSelections.push(o))}let o=r.unavailableItems.length>0,a=0===r.availableItems.length&&r.itemWithAllUnavailableSelections.length===e.length||r.unavailableRootItems.length===e.length,u=r.notInTheMenuItems.length>0,s=r.migratedWithIssuesItems.length>0;return{...r,hasUnavailableItems:o,allItemsUnavailable:a,hasNotInMenuItems:u,hasOrderMigrationIssues:s}},[t,y]),T=(0,i.useCallback)((r,i)=>{let n=t(r.productId);if(!n)return console.warn("Product not found: ".concat(r.productId)),null;let l=(0,c.Sx)(n.groupIds),{category:o,subcategory:a}=(0,c.Rr)(l,m)||{},{selections:u=[],modifiers:d=[]}=r,f=h(u,(0,s.s)(n)),p=A(d),v=Number(r.quantity)||1;return{...n,quantity:{selected:v},ingredientRefs:f,modifierGroupRefs:p,isReorder:!0,index:i+1,listName:e||void 0,category:o||void 0,subcategory:a||void 0}},[t,h,A,e]),b=(0,i.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.map((e,r)=>T(e,r+t)).filter(e=>null!==e)},[T]),_=(0,i.useCallback)(e=>{let t=R(e),r=e=>{let r;return r=0+(e.price||0)*(Number(e.quantity)||1),e.modifiers&&Array.isArray(e.modifiers)&&(r+=e.modifiers.reduce((e,t)=>
1e+(t.price||0),0)),t&&e.selections&&Array.isArray(e.selections)&&(r+=_(e.selections)),r},i=e.reduce((e,t)=>e+r(t),0);return(0,u.h)(i)},[R]),g=(0,i.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=0;return e.offers&&Array.isArray(e.offers)&&(r+=e.offers.reduce((e,t)=>e+(Number(t.discountAmount)||0),0)),e.certificates&&Array.isArray(e.certificates)&&(r+=e.certificates.reduce((e,t)=>e+(Number(t.discountAmount)||0),0)),t&&e.selections&&Array.isArray(e.selections)&&(r+=e.selections.reduce((e,r)=>e+g(r,t),0)),r},[]),O=(0,i.useCallback)(e=>{let t=0,r="appliedOffers"in e?e.appliedOffers:e.offers;r&&Array.isArray(r)&&(t+=r.reduce((e,t)=>e+(Number(t.discountAmount)||0),0));let i="appliedCertificates"in e?e.appliedCertificates:e.certificates;if(i&&Array.isArray(i)&&(t+=i.reduce((e,t)=>e+(Number(t.discountAmount)||0),0)),e.selections&&Array.isArray(e.selections)){let r=R(e.selections);t+=e.selections.reduce((e,t)=>e+g(t,r),0)}return(0,u.h)(t)},[g,R]),C=(0,i.useCallback)(e=>{if(e.offers&&Array.isArray(e.offers)&&e.offers.length>0)return!0;let t=e=>e.some(e=>!!(e.offers&&Array.isArray(e.offers))&&e.offers.length>0||!!(e.selections&&Array.isArray(e.selections))&&t(e.selections));return!!(e.selections&&Array.isArray(e.selections))&&t(e.selections)},[]),N=(0,i.useCallback)(e=>{if(e.certificates&&Array.isArray(e.certificates)&&e.certificates.length>0)return!0;let t=e=>e.some(e=>!!(e.certificates&&Array.isArray(e.certificates))&&e.certificates.length>0||!!(e.selections&&Array.isArray(e.selections))&&t(e.selections));return!!(e.selections&&Array.isArray(e.selections))&&t(e.selections)},[]),S=(0,i.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{addedSelections:e.filter(e=>e.action===n.rU7.Add).map(e=>{var i;let n;let{productId:l}=e,o=t(l);if(!o)return{name:e.description||d.d9,quantity:1,productId:l,price:e.price||0,offers:e.offers,certificates:e.certificates};let a=((null==e?void 0:e.modifiers)||[]).map(t=>{let i=r(t.productId||t.modifierId);return{name:(null==i?void 0:i.displayName)||t.displayName||t.description,quantity:1,productId:l,price:t.price,offers:e.offers,certificates:e.certificates}});return(null==e?void 0:null===(i=e.selections)||void 0===i?void 0:i.length)&&(n=S(e.selections)),{name:(null==o?void 0:o.displayName)||e.description,quantity:+e.quantity,productId:l,price:e.price,modifiers:a.filter(e=>!!e.name),selections:n,offers:e.offers,certificates:e.certificates}}).filter(e=>null!==e),removedSelections:e.filter(e=>e.action===n.rU7.Remove).map(e=>{let{productId:r}=e,i=t(r);if(!i)return null;let n=((null==e?void 0:e.modifiers)||[]).map(e=>({name:e.displayName,quantity:1,productId:r,price:e.price})),l=+e.quantity;return{minQuantity:l,maxQuantity:l,name:(null==i?void 0:i.displayName)||e.description,defaultQuantity:l,productId:r,price:e.price,modifiers:n}}).filter(e=>null!==e),hasSubSelections:R(e)}},[t,R]);return{buildOrderSelections:S,mapAddToBagItem:T,mapOrderItemsToBagPayload:b,validateProductAvailability:E,buildIngredientRefs:h,buildModifierGroupRefs:A,calculateTotalSelectionPrice:_,calculateSelectionDiscount:g,calculateTotalOrderItemDiscountPrice:O,checkHasSubSelections:R,hasNestedSelections:I,hasOffersApplied:C,hasCertificatesApplied:N}}},48575:function(e,t,r){r.d(t,{P:function(){return X}});var i=r(11163),n=r(67294),l=r(72517),o=r(73658),a=r(23630),u=r(89359),s=r(71621),c=r(92250),d=r(56494),f=r(27439),p=r(57148),v=r(23616),y=r(65359),m=r(40647),h=r(64491),A=r(12405),I=r(63744),R=r(87586),E=r(10074),T=r(33148),b=r(65504),_=r(80839),g=r(42005),O=r(9118),C=r(31508),N=r(64583),S=r(79328),D=r(33896);let U=()=>{let e=(0,i.useRouter)(),t=(0,n.useRef)(null),r=(0,n.useRef)(!1);return(0,n.useCallback)((i,n)=>{t.current=null!=n?n:null,r.current=!1;let l=()=>{r.current=!0},o=i=>{if(t.current&&r.current){let n=t.current;t.current=null,r.current=!1,e.events.off("routeChangeStart",l),e.events.off("routeChangeComplete",o),null==n||n(i)}},a=()=>{t.current&&(t.current=null,r.current=!1,e.events.off("routeChangeStart",l),e.events.off("routeChangeComplete",o),e.events.off("routeChangeError",a))};e.events.on("routeChangeStart",l),e.events.on("routeChangeComplete",o),e.events.on("routeChangeError",a),e.replace(i.url,i.as,i.options)},[e])};var k=r(14653),M=r(29783),L=r(57343),w=r(32951),Z=r(87042),q=r(5656),x=r
1(38563),G=r(44241),j=r(12461),P=r(42759),z=r(65454),V=r(58503),W=r(83404),F=r(53158),B=r(32249);let Q="success-checkmark",J=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e4;return{message:e,autoHideDuration:r,data:{variant:"overlay",centerText:!0,showIcon:!0,icon:Q},presentation:{presentationType:p.R.overlayAlert,message:e,callsToAction:{primary:{text:t,action:x.r5,type:"primary",isExternal:!1}}}}},K=()=>{var e,t;let r=(0,i.useRouter)(),{handleLocationSet:o}=(0,P.Z)(),{actions:{enqueueSuccess:a}}=(0,c.Z)(),{isDesktop:u}=(0,B.E)(),[s]=(0,V.Ym)(z.hy.AUTO_SELECT_REORDER_LOCATION),d=null!==(t=null==s?void 0:s.enabled)&&void 0!==t&&t,[f]=(0,V.Ym)(z.hy.REORDER_AUTO_STORE_TOAST_TIMEOUT),p=null==f?void 0:null===(e=f.variables)||void 0===e?void 0:e.timeoutValue,v="number"==typeof p?p:1e4,{configuration:{isOAEnabled:y}}=(0,F.m)(),{trackReorderAutoStoreSelect:m,trackReorderAutoStoreFallback:h}=(0,W.Z)(),{pendingReorder:A,autoSelectedStore:I,actions:{setPendingReorder:R,clearPendingReorder:E,setAutoSelectedStore:T}}=(0,q.Z)();return{tryAutoSelectLocation:(0,n.useCallback)(async(e,t)=>{var i,n,s,c,f,p,A,I;let E=null===(n=e.fulfillment)||void 0===n?void 0:null===(i=n.location)||void 0===i?void 0:i.id,b=(null===(s=e.fulfillment)||void 0===s?void 0:s.type)==="DELIVERY",_=e.orderStatus===L.Nrh.Cancelled;if(!d)return!1;if(!E||b||_)return h(),r.push("".concat(x.r5,"?reorderid=").concat(e.id)),!0;try{let i=await (0,j.Z)({locationId:E}),n=(0,Z.gv)(i,void 0,!0,!0);if(!(0,w.Y)(y,i,null!==(A=null==n?void 0:n.isOpen)&&void 0!==A&&A))return h(),r.push("".concat(x.r5,"?reorderid=").concat(e.id)),!0;o(i),T(i);let s=(0,G._)(k.KJ,{locationName:null!==(I=null==i?void 0:null===(f=i.contactDetails)||void 0===f?void 0:null===(c=f.address)||void 0===c?void 0:c.line1)&&void 0!==I?I:""}),d=(null===(p=l.default.Location)||void 0===p?void 0:p.SMART_STORE_CHANGE_LINK_TEXT)||"Change";return u?a(J(s,d,v)):N.f.show({toastText:s,variant:"success",icon:Q,timeout:v,linkText:d,onLinkClicked:()=>r.push(x.r5)}),m(),R({order:e,orderIndex:t}),!0}catch(t){return h(),r.push("".concat(x.r5,"?reorderid=").concat(e.id)),!0}},[d,y,u,v,o,r,a,m,h,T,R]),pendingReorder:A,autoSelectedStore:I,clearPendingReorder:E}},Y={MENU:"/menu",BAG:"/bag",LOCATIONS:"/locations"},{Product:{MAX_QTY_REACHED:H}}=l.default,X=e=>{let{bagEntries:t,entriesMarkedAsRemoved:r,actions:{addDefaultToBag:l}}=(0,o.Z)(),{actions:{getProduct:L},loading:w}=(0,s.Z)(),{actions:{getTotalCalories:Z}}=(0,a.i)(),{transformFavoriteItemRequestToTallyItem:q}=(0,D.Z)(),{availableItems:{categories:x},getOperationalRootProduct:G}=(0,d.Z)(),j=(0,i.useRouter)(),{isCurrentLocationOAAvailable:P,currentLocation:z}=(0,f.Z)(),{validateProductAvailability:V}=(0,M.Z)(e),W=(0,v.TL)(),{actions:{enqueueError:F}}=(0,c.Z)(),B=U(),{tryAutoSelectLocation:Q,pendingReorder:J,clearPendingReorder:X}=K(),$=(0,n.useRef)(!1),{isAuthenticated:ee}=(0,E.Z)(),{configuration:{isMParticleEnabled:et}}=(0,u.Z)(),{toast:er}=(0,S.E)(),ei=(0,n.useCallback)(e=>V(e.products),[V]),en=(0,n.useCallback)(function(i){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,{availableItems:o,allItemsUnavailable:a}=ei(i),u=o.filter(e=>{var t;let r=null!==(t=L(G(e.productId)||e.productId))&&void 0!==t?t:L(e.productId);return!r||!(0,R.s2)(r)}),s=null;if(!0===a&&(s=k.VD),a||0===u.length){B({url:Y.MENU,options:{shallow:!1}},e=>{e.includes(Y.MENU)&&s&&(N.f.hide(),F({presentation:{presentationType:p.R.toast,superTitle:"",details:"",title:"",message:s},closeByDefault:!0}))});return}let c=0,d=!1,f=new Map;if(u.forEach((i,o)=>{var a,u,s,p,v,y,m,R,E;let _=L(i.productId),g=(0,b.I)(Object.keys((null==_?void 0:_.ingredientRefs)||{}).find(e=>(0,T.NQ)(e))),O=q({...i,isReorder:!0,listName:e,orderIndex:n,index:n+o+1,selections:null==i?void 0:null===(a=i.selections)||void 0===a?void 0:a.map(e=>e.productId===g?{...e,productGroupId:void 0}:e)},{remapProductGroupIds:!0}),C=Z(O),N=G(i.productId)||i.productId,S=L(N),D=null!==(y=null!==(v=null==S?void 0:S.id)&&void 0!==v?v:null==_?void 0:_.id)&&void 0!==y?y:N,U=null!==(m=f.get(D))&&void 0!==m?m:(0,h.D)(t,r,D);if((0,A.U)({bagEntries:t,entriesMarkedAsRemoved:r,currentLocation:z,productId:D,maxQuantity:null!==(R=null==S?void 0:null===(u=S.quantity)||void 0===u?void 0:u.max)&&void 0!==R?R:null==_?void 0:null===(s=_.quantity)||void 0===s?void 0:s.max,currentProductQuantityInBag:U,quantity:O.quantity})){d=!0;return}
1if(f.set(D,U+(null!==(E=null===(p=O.quantity)||void 0===p?void 0:p.selected)&&void 0!==E?E:1)),!S){l({...O,totalCalories:C}),c++;return}let k=(0,I.Sx)(S.groupIds,S.categoryId),M=(0,I.Rr)(k,x);l({...O,displayName:(null==S?void 0:S.displayName)||O.displayName||"",totalCalories:C,category:null==M?void 0:M.category,subcategory:null==M?void 0:M.subcategory}),c++}),d&&er.show({toastText:H||y.hB,variant:"error",icon:"informational"}),0===c)return;let{reorderid:v,...E}=j.query;B({url:{pathname:j.pathname,query:E},as:void 0,options:{shallow:!0}},()=>{e===m.vd?(W({type:_.aw,payload:{order_interaction:_.OZ.REORDER_RECENT_ORDERS,order_placement:m.vd}}),et&&W({type:C.bp.MPARTICLE_START_ORDER,payload:{orderInteraction:g.Ik,userType:(0,O.n)(ee)}})):e===m.ve?(W({type:_.aw,payload:{order_interaction:_.OZ.REORDER_RECENT_ORDERS,order_placement:m.ve}}),et&&W({type:C.bp.MPARTICLE_START_ORDER,payload:{orderInteraction:g.ow,userType:(0,O.n)(ee)}})):e===m.lU&&(W({type:_.aw,payload:{order_interaction:_.OZ.REORDER_RECENT_ORDERS,order_placement:m.lU}}),et&&W({type:C.bp.MPARTICLE_START_ORDER,payload:{orderInteraction:g.vs,userType:(0,O.n)(ee)}})),j.push(Y.BAG)})},[ei,B,F,l,j,e,W,x,G,L,q,Z,ee,z,t,r,et,er]);return(0,n.useEffect)(()=>{J&&P&&!w&&$.current&&($.current=!1,X(),en(J.order,J.orderIndex))},[J,P,w,en,X]),{handleReorder:(0,n.useCallback)(async(t,r)=>{if(P){en(t,r);return}if(await Q(t,r)){$.current=!0;return}let i=new URLSearchParams({reorderid:t.id});e&&i.set("listName",e),j.push("".concat(Y.LOCATIONS,"?").concat(i.toString()))},[en,P,Q,j,e]),executeReorderWithLocationAndMenu:en}}}}]);
2//# sourceMappingURL=8575-d3136899fc702bd4.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.