1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./2.15.1-uk-ProductCollectionStockMessage-B5IjFR4p.js","./2.15.1-uk-runtime-core.esm-bundler-CM7kzQMe.js","./2.15.1-uk-branch-DFfaj8Fv.js","./2.15.1-uk-nuxt-B44lAuBn.js","./2.15.1-uk-virtual_nuxt_.nuxt_nuxt.config-COOAzfWh.js","./2.15.1-uk-app-CcyXOmf1.js","./2.15.1-uk-error-CbVqhP4U.js","./2.15.1-uk-dist-DWnlDZDm.js","./2.15.1-uk-defu-4HdYzoiL.js","./2.15.1-uk-virtual_nuxt_.nuxt_paths-BfapzCFg.js","./2.15.1-uk-nuxt-link-oEP8h8AQ.js","./2.15.1-uk-utils-14IiBAv4.js","./2.15.1-uk-runtime-dom.esm-bundler-GujwpO3G.js","./2.15.1-uk-preload-helper-BUDLPX_m.js","./2.15.1-uk-client-only-Dzis2lI4.js","./2.15.1-uk-pinia-CuYYfE7D.js","./2.15.1-uk-ecomApi-BH1IJ28G.js","./2.15.1-uk-logger-B0C-TRr1.js","./2.15.1-uk-cookies-Cw-sBCGe.js","./2.15.1-uk-useToast-B1vYAmED.js","./2.15.1-uk-formValidators-CJocExSc.js","./2.15.1-uk-schemas-ByHr85x2.js","./2.15.1-uk-compat-DpwAWVwd.js","./2.15.1-uk-stringsTransformations-B1Wy6Ssu.js","./2.15.1-uk-vue-i18n-DdD6VHSI.js","./2.15.1-uk-stock-Dz3Y2ZBL.js","./2.15.1-uk-gift-card-plain-NH7kHq_M.js","./2.15.1-uk-trolley-BADzxSLc.js","./2.15.1-uk-rolldown-runtime-CXHxssQy.js","./2.15.1-uk-thresholds-BtZjMQh8.js","./2.15.1-uk-useTrolley-DK2b6lAs.js","./2.15.1-uk-useApi-D6EUM14F.js","./2.15.1-uk-giftCard-YMHufN4o.js","./2.15.1-uk-tracking-BZh_7iQC.js","./2.15.1-uk-product-BAAPWkl7.js","./2.15.1-uk-objectHelpers-DQIfupeX.js","./2.15.1-uk-tracking-BlKk-Kui.js","./2.15.1-uk-useStock-wazyJGWE.js","./2.15.1-uk-ProductDeliveryStockMessage-R2lp90SO.js","./2.15.1-uk-productHelpers-DnVFpiZF.js","./2.15.1-uk-productAttributes-ZJJpVf-6.js","./2.15.1-uk-ExternalLink-DfIu0xh9.js"])))=>i.map(i=>d[i]); 2import{n as te}from"./2.15.1-uk-rolldown-runtime-CXHxssQy.js";import{s as oe}from"./2.15.1-uk-nuxt-B44lAuBn.js";import{$t as v,At as i,K as r,S as ae,St as le,Xt as u,b as h,d as m,dt as $,f as g,m as w,p as d,st as ne,u as a,ut as k,x as D}from"./2.15.1-uk-runtime-core.esm-bundler-CM7kzQMe.js";import{u as L}from"./2.15.1-uk-runtime-dom.esm-bundler-GujwpO3G.js";import"./2.15.1-uk-app-CcyXOmf1.js";import{t as T}from"./2.15.1-uk-preload-helper-BUDLPX_m.js";import{t as B}from"./2.15.1-uk-DefaultButton-RizmfMUX.js";import{t as M}from"./2.15.1-uk-ProductQuantity-B8WYMMc6.js";import{t as ie}from"./2.15.1-uk-useAddToCart-BVuByKhS.js";var se={key:0,class:"flex mb-2 quantity-location-wrapper"},re={class:"@[145px]:inline hidden"},de={class:"@[145px]:hidden inline"},ue={class:"font-semibold leading-none text-center"},ce={class:"message-qty-wrapper"},pe={class:"font-semibold leading-none text-left capitalize"},ye=ae({__name:"ProductAddToTrolley",props:{product:{},quantity:{default:1},largeSize:{type:Boolean,default:!1},showQuantity:{type:Boolean,default:!1},showIcon:{type:Boolean,default:!0},showMessaging:{type:Boolean,default:!0},horizontalOrientation:{type:Boolean,default:!1},pdpLayout:{type:Boolean,default:!1},pdpAltLayout:{type:Boolean,default:!1},jumpToDeliveryInformation:{type:Boolean,default:!1},pdpDeliveryMessages:{default:null},index:{default:0}},emits:["addToCartButtonClicked","added","error","hasFocus","quantityChange","jumpToDeliveryInformationClicked","showDropshipModal"],setup(t,{emit:P}){const j=D(()=>T(()=>import("./2.15.1-uk-ProductCollectionStockMessage-B5IjFR4p.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37]),import.meta.url)),F=D(()=>T(()=>import("./2.15.1-uk-ProductDeliveryStockMessage-R2lp90SO.js"),__vite__mapDeps([38,1,39,40,24,25,15,26,9,7,27,28,3,4,6,8,5,10,11,12,13,14,16,29,17,18,30,31,2,19,20,21,22,23,32,33,34,35,36,37]),import.meta.url)),O=D(()=>T(()=>import("./2.15.1-uk-ExternalLink-DfIu0xh9.js").then(e=>e.n),__vite__mapDeps([41,28,1]),import.meta.url)),o=t,l=P,E=oe(),z=a(()=>E.public.toolstationCdnURL||"https://cdn.toolstation.com"),I=a(()=>`${z.value}/icons/collection_web.svg`),Q=a(()=>`${z.value}/icons/delivery_web.svg`),x=a(()=>String(o.product?.code||o.product?.pid||"")),S=a(()=>o.product?.channel===3),V=a(()=>o.product?.channel===1),N=a(()=>o.product?.channel===2),c=le(o.quantity);ne(()=>o.quantity,e=>{c.value=e});const R=a(()=>({name:o.product?.name||o.product?.title||"",image:o.product?.image||"",price:o.product?.prices?.raw?.gross?.toString()||""})),{isLoading:U,isModalVisible:H,isDeliveryDisabled:q,isCollectionDisabled:J,showStockNearbyButton:C,openCollectionModal:K,addForDelivery:X,addForCollection:G}
2=ie({productCode:x,quantity:c,isDropship:S,productDetails:R,product:a(()=>o.product),index:a(()=>o.index),pdpLayout:a(()=>o.pdpLayout),category:a(()=>{})}),f=a(()=>U.value&&!H.value),p=a(()=>!S.value&&!V.value),y=a(()=>!N.value),W=a(()=>o.horizontalOrientation?"grid grid-cols-1 mt-2 md:grid-cols-2 md:gap-8 items-end":o.pdpAltLayout?`grid grid-cols-2 w-full ${p.value&&y.value?"md:w-[300px]":"md:w-[150px]"} gap-2 items-center`:"grid grid-cols-1 gap-2");function b(e){if(!o.showIcon)return"";const n="w-auto",s="absolute left-5";return e==="collection"?o.largeSize?`${n} -mt-[3px] ${s} h-[20px]`:`${n} -mt-[1px] ${s} h-[12px]`:e==="delivery"?o.largeSize?`${n} -mt-[3px] ${s} h-[20px]`:`${n} -mt-[3px] ${s} h-[14px]`:""}function Y(){l("addToCartButtonClicked",{buttonType:"openCollectionModal"}),K()}async function Z(){l("addToCartButtonClicked",{buttonType:"collection"});const e=await G();e!==null&&(e.success?l("added",{productCode:e.productCode,quantity:e.quantity,channel:e.channel}):e.error&&l("error",{message:e.error}))}async function _(){l("addToCartButtonClicked",{buttonType:"delivery"});const e=await X();e.success?l("added",{productCode:e.productCode,quantity:e.quantity,channel:e.channel}):e.error&&l("error",{message:e.error})}function ee(e){e?.preventDefault?.(),l("jumpToDeliveryInformationClicked"),l("showDropshipModal")}function A(e){c.value=e,l("quantityChange",e)}return(e,n)=>(r(),w("div",{class:u(W.value)},[p.value?(r(),w("div",{key:0,class:u(["flex flex-col w-full",[{"col-span-2":!y.value}]])},[t.showQuantity?(r(),w("div",se,[h(M,{class:"w-full justify-between",product:t.product,"starting-quantity":c.value,"compute-min-quantity-from-attrs":"",onQuantityChange:A},null,8,["product","starting-quantity"])])):d("",!0),$(h(B,{"data-testid":"add-to-trolley-stock-nearby-button",class:u(["flex relative @container",[t.largeSize?"h-[56px]":"h-[40px]",{"mb-0":!y.value&&!t.showIcon},{"modal_sm:max-w-[364px] lg:w-full":t.pdpLayout}]]),variant:"primary","icon-classes":b("collection"),size:t.largeSize?"md":"small","with-icon":t.showIcon?I.value:"",disabled:f.value,onClick:Y},{default:k(()=>[m("span",re,v(e.$t("search.stockNearby")),1),m("span",de,v(e.$t("search.stockNearbyShort")),1)]),_:1},8,["class","icon-classes","size","with-icon","disabled"]),[[L,i(C)]]),$(h(B,{"data-testid":"add-to-trolley-collection-button","aria-label":"add to trolley collection button",class:u(["flex relative justify-center items-center",[t.largeSize?"h-[56px]":"h-[40px]",{"mb-0":!y.value&&!t.showIcon},{"modal_sm:max-w-[364px] lg:w-full":t.pdpLayout}]]),disabled:i(J)||f.value,variant:"tertiary","icon-classes":b("collection"),size:t.largeSize?"md":"small","with-icon":t.showIcon?I.value:"",onClick:Z,onHasFocus:n[0]||(n[0]=s=>l("hasFocus",s))},{default:k(()=>[m("span",ue,v(e.$t("search.collection")),1)]),_:1},8,["class","disabled","icon-classes","size","with-icon"]),[[L,!i(C)]]),t.showMessaging&&!i(C)?(r(),g(i(j),{key:1,"product-code":x.value,class:"mt-2 mb-1 text-[14px] leading-none"},null,8,["product-code"])):d("",!0)],2)):d("",!0),y.value?(r(),w("div",{key:1,class:u(["flex flex-col w-full",[{"col-span-2":!p.value}]])},[m("div",ce,[!p.value&&t.showQuantity?(r(),g(M,{key:0,class:"w-full justify-between",product:t.product,"starting-quantity":c.value,"compute-min-quantity-from-attrs":"",onQuantityChange:A},null,8,["product","starting-quantity"])):d("",!0)]),h(B,{"data-testid":"add-to-trolley-delivery-button","aria-label":"add to trolley delivery button",class:u(["relative flex items-center justify-center add-to-trolley-delivery-button",[t.largeSize?"h-[56px]":"h-[40px]",{"justify-start":t.pdpAltLayout},{"mt-0":!p.value&&!t.showIcon},{"modal_sm:max-w-[364px] lg:w-full":t.pdpLayout}]]),disabled:i(q)||f.value,hover:!(i(q)||f.value),variant:"tertiary",size:t.largeSize?"md":"small","icon-classes":b("delivery"),"with-icon":t.showIcon?Q.value:"",onClick:_,onHasFocus:n[1]||(n[1]=s=>l("hasFocus",s))},{default:k(()=>[m("span",pe,v(e.$t("delivery")),1)]),_:1},8,["class","disabled","hover","size","icon-classes","with-icon"]),t.showMessaging?(r(),g(i(F),{key:0,product:t.product,"product-code":x.value,"pdp-layout":t.pdpLayout,"pdp-delivery-messages":t.pdpDeliveryMessages,class:"mt-2"},null,8,["product","product-code","pdp-layout","pdp-delivery-messages"])):d("",!0),t.jumpToDeliveryInformation?(r(),g(i(O),{key:1,classes:"text-blue text-[14px] underline","link-text":e.$t("directship-more-info"),url:"#deliverydetails",onClickAction:ee},null,8,["link-text"])):d("",!0)],2)):d("",!0)],2))}}),De=te({default:()=>me}),me=Object.assign(ye,{__name:"ProductDetailActionsProductAddToTrolley"});export{De as n,me as t};
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.