PageSourceSearch

https://www.pizzahut.com.au/assets/UpsellCarousel-BB--25nz.js

js pizzahut.com.au collected 2026-09-24 20:34:19 UTC 5,946 bytes, 1 lines download raw bytes

1import{_ as b,ah as P,cf as w,B as n,m as C,ac as I,s as k,r as a,o as c,i as u,a as r,b as p,a4 as d,k as y,w as g,c as f,F as v,j as x,Y as A,$ as B}from"./bootstrap-CMUFuJo9.js";import{A as M}from"./AppImage-gzzDInBH.js";import{s as D}from"./screen-CZgknKNh.js";import O from"./WingsUpsellModal-Br7zf6EL.js";import{S as E,a as T}from"./vue-splide.esm-BRI-LkPi.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="e7527d2b-518b-49f9-8b26-c8b0a41d4a7f",e._sentryDebugIdIdentifier="sentry-dbid-e7527d2b-518b-49f9-8b26-c8b0a41d4a7f")}catch(i){}})();const F={name:"CarouselCardProduct",components:{AppImage:M,BButton:P},mixins:[D],props:{product:{type:Object,default:null}},emits:["showCarouselModal"],data(){return{selectedProductSize:this.product.sizes[0].sizeId}},computed:{isCustomisable(){return this.product.properties.IsCustomisable},isWings(){return this.product.productType.toLowerCase().includes("wings")},placeholderImage(){var e;return(e=window.Modernizr)!=null&&e.webp?"https://content.pizzahut.com.au/f/293203740241008/1800x1800/6bc20e554f/placeholder-bg.webp/m/500x280/filters:format(webp)":"https://content.pizzahut.com.au/f/293203740241008/1800x1800/24d8fb93d1/placeholder-bg.png/m/500x280/filters:format(jpg)"},computedProductImage(){const e=this.isMobileView?["250x0","filters:format(jpeg):quality(90):focal(80x200:420x300)"]:["500x280","filters:format(jpeg):quality(90):focal(80x200:420x300)"];return k(this.product.imageUrl,e)},computedProductName(){var e,s,i,l,o;return this.isWings?"WingStreet ".concat((o=(l=(i=(s=(e=this.product)==null?void 0:e.sizes)==null?void 0:s[0])==null?void 0:i.name)==null?void 0:l.split(" "))==null?void 0:o[0]," Pack"):this.product.name},computedProductEnergy(){return this.getSelectedEnergyBySize(this.selectedProductSize)},computedProductPrice(){return this.getSizeFromSizesArray(this.selectedProductSize).price}},methods:{...C(I,["triggerSpinner"]),setSpinner(){this.triggerSpinner({loading:this.loading,blocking:this.loading})},async handleCtaClick(){if(w(),this.isCustomisable&&this.isWings)return this.$emit("showCarouselModal",this.product);try{this.loading=!0,this.setSpinner();
1const e={basketItemParts:this.isCustomisable?this.computeBasketItemParts():[],productId:this.product.productId,quantity:1,discriminator:this.product.discriminator};await n.addBasketItem({basketItem:e,product:this.product,isAnUpsellProduct:!0}),await n.onAddBasketItemSuccess({basketItem:e,sizeName:this.getSizeFromSizesArray(this.selectedProductSize).name,product:{...this.product,computedPrice:this.computedProductPrice},isAnUpsellProduct:!0,trackData:{interactionElement:{method:"upsell-carousel"},productId:this.product.slug,quantity:1}})}catch(e){n.onAddBasketItemError({sizeName:this.getSizeFromSizesArray(this.selectedProductSize),product:this.product,error:e})}n.onAddBasketItemFinally({context:this}),this.setSpinner()},getSizeFromSizesArray(e){return this.product.sizes.filter(s=>s.sizeId===e)[0]},getSelectedEnergyBySize(e){return this.getSizeFromSizesArray(e).energy}}},U={class:"carousel-card-product"},N={class:"card-container"},j={class:"card-img-top-container"},W={class:"card-content"},q={class:"card-heading"},V={class:"card-title"},L={key:0,class:"card-subtitle"},H={class:"card-footer"},J={class:"card-cta"},Y={class:"card-cta-price"};function G(e,s,i,l,o,t){const m=a("app-image"),h=a("b-button");return c(),u("div",U,[r("div",N,[r("figure",j,[p(m,{src:t.computedProductImage,placeholder:t.placeholderImage,alt:i.product.name,"is-background":!0,lazy:!0,class:"card-img-top"},null,8,["src","placeholder","alt"])]),r("div",W,[r("div",q,[r("div",V,[r("h4",null,d(t.computedProductName),1)]),t.computedProductEnergy!=null?(c(),u("p",L,d(t.computedProductEnergy)+" kJ^ ",1)):y("",!0)]),r("div",H,[r("div",J,[p(h,{variant:"primary card-cta-primary-action-lg",size:"sm",onClick:t.handleCtaClick},{default:g(()=>[r("span",null,d(t.isCustomisable?"Customize":"Add"),1),r("p",Y,d(e.$filters.toCurrency(t.computedProductPrice)),1)]),_:1},8,["onClick"])])])])])])}const K=b(F,[["render",G],["__scopeId","data-v-ce2e8b37"]]),Q={name:"AppUpsellCarousel",components:{UpsellCarouselCard:K,WingsUpsellModal:O,Splide:T,SplideSlide:E},props:{upsell:{type:Object,default:null}},data(){return{splideOptions:{autoplay:!1,rewind:!0,arrows:!0,perPage:1,perMove:1,autoHeight:!0,speed:250,dragMinThreshold:30},modalOptions:{visible:!1,product:null}}},computed:{...A(B,["basketItems"]),showComponent(){var e;return(e=this.upsellProducts)==null?void 0:e.length},upsellTitle(){return this.upsell.popupDescription},upsellProducts(){return this.upsell.products.filter(e=>!this.basketItems.some(s=>s.productId===e.productId||s.productType.toLowerCase().includes("wing")&&e.productType===s.productType))},hasMultipleProducts(){return this.upsellProducts.length>1}},methods:{onShowModel(e){this.modalOptions.product=e,this.modalOptions.visible=!0},onDismiss(){this.modalOptions.product=null,this.modalOptions.visible=!1}}},R={key:0,class:"app-upsell-carousel"};function X(e,s,i,l,o,t){const m=a("upsell-carousel-card"),h=a("SplideSlide"),S=a("Splide"),z=a("wings-upsell-modal");return t.showComponent?(c(),u("section",R,[r("h4",null,d(t.upsellTitle),1),(c(),f(S,{ref:"splide",key:t.upsellProducts.length,options:{...o.splideOptions,arrows:t.hasMultipleProducts,draggable:t.hasMultipleProducts}},{default:g(()=>[(c(!0),u(v,null,x(t.upsellProducts,_=>(c(),f(h,{key:_.productId},{default:g(()=>[p(m,{product:_,onShowCarouselModal:t.onShowModel},null,8,["product","onShowCarouselModal"])]),_:2},1024))),128))]),_:1},8,["options"])),p(z,{visible:o.modalOptions.visible,product:o.modalOptions.product,onDismiss:t.onDismiss},null,8,["visible","product","onDismiss"])])):y("",!0)}const re=b(Q,[["render",X],["__scopeId","data-v-7ff1bba0"]]);export{re as default};

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.