1import{Gt as e,K as o,R as a,S as t,V as s,W as i,Yt as r,_t as l,at as n,b as c,d,f as p,m as h,ot as f,p as u,r as m,u as _,wt as b,y as v}from"./BTeFyYUp.js";import{u as y}from"./CTwSm64d.js";import{m as S}from"./DueKVy1n.js";import{i as k,r as g}from"./BFoa-15C.js";import{t as P}from"./BL02hBxo.js";import{d as C,n as w,u as I}from"./C6dJxRFM2.js";import{t as x}from"./B89Cm64z2.js";import{t as L}from"./DgLP3hnZ2.js";import{t as j}from"./D-aP1igm.js";import{t as E}from"./BP6JXXd9.js";import{t as T}from"./Cx8u-s9o.js";import{t as O}from"./DGzOaCsY.js";import{t as $}from"./COOdLF5M.js";import{t as D}from"./HI9Zf9qr.js";import{t as M}from"./fCcpIH322.js";import{t as A}from"./DZ8S0lCE.js";import{t as B}from"./DJ4SC2FK.js";import{t as G}from"./BABaGlBc2.js";import{t as N}from"./CbB3so4Q2.js";import{m as W}from"./DQDFtFAb.js";import{r as F}from"./COMtVveT.js";import{t as Y}from"./YfVaXClJ.js";import{a as R,t as q}from"./bMC2kKot.js";import{t as z}from"./D7Ntl-gX.js";import{t as U}from"./CfngLH7t.js";import{t as H}from"./Bcbcz-qg.js";var K=t({name:"ParcelShopMoreInfo",components:{ETabs:N,ESpinner:j},props:{shop:{type:Object,required:!0}},data:()=>({activeTab:0,mapLoaded:!1}),computed:{tabs(){const e=[{title:"Map",dataGtmTrack:"tab-select map",id:"tab1",panelId:"psfinder-panel-map"},{title:"Opening",dataGtmTrack:"tab-select opening",id:"tab2",panelId:"psfinder-panel-opening"}];return this.hasFacilities&&e.push({title:"Facilities",dataGtmTrack:"tab-select facilities",id:"tab3",panelId:"psfinder-panel-facilities"}),e},hasFacilities(){return""!==this.shop?.facilities?.[0]}},methods:{updateTab(e){this.activeTab=e}}}),V={key:0,id:"psfinder-panel-map",class:"tabs__map",role:"tabpanel"},X={class:""},J={class:"tabs__map-spinner-container"},Q=["src"],Z={key:1,id:"psfinder-panel-opening",class:"tabs__opening-times",role:"tabpanel"},ee={class:"tabs__opening-times-list"},oe={class:"tabs__opening-times-list-text"},ae={class:"tabs__opening-times-list-text-day"},te={key:2,id:"psfinder-panel-facilities",class:"tabs__facilities",role:"tabpanel"},se={class:"tabs__facilities-list"};var ie=t({name:"ParcelShopInformation",components:{ELabel:$,EIcon:x,EButtonTertiary:O,DropOffMoreInfo:L(K,[["render",function(e,a,t,l,n,p){const _=o("ETabs"),b=o("ESpinner");return s(),h("div",null,[c(_,{class:"tabs",selected:e.activeTab,tabs:e.tabs,"test-id":"psf-moreinfo-tabs",onTabChange:e.updateTab},null,8,["selected","tabs","onTabChange"]),0===e.activeTab?(s(),h("div",V,[f(d("div",X,[d("div",J,[c(b,{size:"xl",class:"tabs__map-spinner"})])],512),[[y,!e.mapLoaded]]),f(d("img",{class:"tabs__map-image",alt:"A map showing the parcelshop location",src:e.shop.mapUrl,onLoad:a[0]||(a[0]=o=>e.mapLoaded=!0)},null,40,Q),[[y,e.mapLoaded]])])):u("",!0),1===e.activeTab?(s(),h("div",Z,[d("ul",ee,[(s(!0),h(m,null,i(e.shop.businessHours,e=>(s(),h("li",{key:e.dayOfWeek,class:"tabs__opening-times-list-item"},[d("div",oe,[d("span",ae,r(e.dayOfWeek),1),v(" "+r(e.openTime)+" - "+r(e.closeTime),1)])]))),128))])])):u("",!0),2===e.activeTab?(s(),h("div",te,[d("ul",se,[(s(!0),h(m,null,i(e.shop.facilities,e=>(s(),h("li",{key:e,class:"tabs__facilities-list-item"},r(e),1))),128))])])):u("",!0)])}],["__scopeId","data-v-92db3e7d"]]),EButtonSelect:G},props:{shop:{type:Object,required:!0},index:{type:Number,required:!0}},emits:["moreInfoClick","selectShop"],computed:{...k(R,{selectedLocationIndex:e=>e.selectedLocationIndex,selectedLocation:e=>e.selectedLocation,locations:e=>e.locations,singleParcelShop:e=>e.singleParcelShop,selectedLocationId:e=>e.selectedLocationId,clickedCard:e=>e.clickedCard}),...k(q,{oohPreference:e=>e.preferences?.oohPreference?.nodeId,editingOohPreference:e=>e.editingOohPreference}),displayAddress(){return`${this.shop.address?.line1}, ${this.shop.address?.postCode}`},isSelected(){return this.shop.parcelShopId===this.selectedLocationId},showParcelShopOption(){return this.isSelected||!this.selectedLocationId},shopDescription(){return this.shop?.description},moreInfoIcon(){return this.showMoreInfo?"chevron_circle_up":"chevron_circle_down"},phoneLink(){return`tel:${this.shop.phoneNumber}`},showMoreInfo(){return this.clickedCard===this.shop.parcelShopId}},mounted(){this.singleParcelShop&&this.setSelectedLocation(this.shop.parcelShopId,this.index)},methods:{...g(R,["setSelectedLocation","setClickedCard"]),...g(q,["
1setParcelShop"]),formattedDistance:e=>W(e,2),handleGetDirections(){const{description:e,address:o}=this.shop,a=encodeURI(`https://www.google.com/maps/search/?api=1&query=${e},${o.postCode},${o.line1}`);var t;t=a,window.open(t,"_blank","noopener,noreferrer")},moreInformationClick(){this.singleParcelShop||(this.shop.parcelShopId===this.clickedCard?this.setClickedCard():this.setClickedCard(this.shop.parcelShopId))},selectShop(){this.$emit("selectShop"),this.shop.parcelShopId===this.selectedLocationId?this.setSelectedLocation():this.setSelectedLocation(this.shop.parcelShopId,this.index)}}}),re={class:"drop-off__distance-container"},le={key:0,class:"drop-off__distance-pin-text drop-off__distance-pin-text--parcelshop","data-test-id":"pin-number"},ne={class:"drop-off__distance-text","data-test-id":"distance"},ce={class:"drop-off__description","data-test-id":"description"},de=["data-test-id"],pe={key:3,class:"drop-off__more-info"};var he=L(ie,[["render",function(a,t,i,l,f,m){const _=o("ELabel"),b=o("EIcon"),y=o("EButtonTertiary"),S=o("DropOffMoreInfo"),k=o("EButtonSelect");return a.showParcelShopOption?(s(),h("div",{key:0,class:e(["drop-off",[a.isSelected&&"drop-off--selected"]]),"data-test-id":"parcel-shop-info-wrapper"},[1!==a.index||a.singleParcelShop||a.oohPreference&&!a.editingOohPreference?u("",!0):(s(),p(_,{key:0,value:"Nearest ParcelShop",class:"drop-off__label drop-off__label--parcelshop","color-variant":"brand-01","data-test-id":"label"})),a.oohPreference&&!a.editingOohPreference?(s(),p(_,{key:1,value:"ParcelShop",class:"drop-off__label drop-off__label--parcelshop","color-variant":"brand-01","data-test-id":"label"})):(s(),h("div",{key:2,class:e(["drop-off__distance",{"drop-off__distance--single-parcelshop":a.singleParcelShop}])},[d("div",re,[c(b,{class:e(["drop-off__distance-pin",[a.singleParcelShop?"drop-off__distance-pin--single-parcelshop":"drop-off__distance-pin--parcelshop"]]),icon:"location_pin_filled",height:"24",width:"24"},null,8,["class"]),a.singleParcelShop?u("",!0):(s(),h("span",le,r(a.index),1))]),d("p",ne,r(a.formattedDistance(a.shop.distance))+" miles ",1)],2)),d("p",ce,r(a.shopDescription),1),d("p",{class:"drop-off__address","data-test-id":`psf-address-${a.index}`},r(a.displayAddress),9,de),c(y,{class:"drop-off__more-info-button--directions",variant:1,"icon-position":"left","aria-label":"Get directions",icon:"location",role:"link","data-test-id":`psf-get-directions-${a.index}`,"data-gtm-track":"a-get directions",onClick:a.handleGetDirections},{default:n(()=>[...t[0]||(t[0]=[v(" Get directions ",-1)])]),_:1},8,["data-test-id","onClick"]),d("div",null,[a.singleParcelShop?u("",!0):(s(),p(y,{key:0,class:e(["drop-off__more-info-button",a.isSelected&&"drop-off__more-info-button--selected"]),variant:1,"icon-position":"right","data-test-id":`more-information-${a.index}`,"aria-label":"Click to expand additional details","data-gtm-track":"btn-more information-"+(a.isSelected?"close":"open"),icon:a.moreInfoIcon,onClick:a.moreInformationClick},{default:n(()=>[...t[1]||(t[1]=[v(" More information ",-1)])]),_:1},8,["class","data-test-id","data-gtm-track","icon","onClick"]))]),a.showMoreInfo||a.singleParcelShop?(s(),h("div",pe,[c(S,{shop:a.shop},null,8,["shop"]),d("div",null,[c(y,{href:a.phoneLink,class:"drop-off__more-info-button",variant:1,"icon-position":"left",disabled:!a.shop.phoneNumber,icon:"phone",role:"link","data-test-id":`psf-phone-number-${a.index}`,"data-gtm-track":"a-call telephone number"},{default:n(()=>[v(r(a.shop.phoneNumber||"N/A"),1)]),_:1},8,["href","disabled","data-test-id"])])])):u("",!0),a.singleParcelShop?u("",!0):(s(),p(k,{key:4,"force-selected-state":a.isSelected,class:"drop-off__select","data-test-id":`psf-select-${a.index}`,"aria-label":"Click here to select parcelshop","custom-text":a.isSelected?"Selected":"Select",onClick:a.selectShop},null,8,["force-selected-state","data-test-id","custom-text","onClick"]))],2)):u("",!0)}],["__scopeId","data-v-fa7a5895"]]);var fe=L(t({components:{EModal:T},emits:["deleteParcelShop","closeConfirmation"],mounted(){C("Delete ParcelShop preference?")},methods:{deleteParcelShop(){this.$emit("deleteParcelShop")},closeModal(){this.$emit("closeConfirmation")}}}),[["render",function(e,a,t,i,r,l){const c=o("e-modal");return s(),p(c,{"is-open":!0,avatar:"alert_2",heading:"Are you sure?","button-primary":{text:"Confirm",icon:"chevron_right",iconPosition:"right"},"button-secondary":{text:"Cancel"},onClickButtonPrimary:e.deleteParcelShop,onClickButtonSecondary:e.closeModal,onClose:e.closeModal},{default:n(()=>[...a[0]||(a[0]=[d("p",null," Your ParcelShop preferences will be deleted from your account. We'll deliver your future parcels to your address. ",-1),d("p",null," This won't change the delivery location for any parcels currently in our network. ",-1)])]),_:1},8,["onClickButtonPrimary","onClickButtonSecondary","onClose"])}]]),ue={class:"parcelshop page-wrapper"},me={class:"parcelshop__title-wrapper"},_e={class:"parcelshop__title","data-test-id":"parcelshop-title"},be={key:0,class:"parcelshop__subtitle"},ve={key:0,class:"parcelshop__spinner-container"},ye={key:2,class:"parcelshop__button-wrapper--change-parcelshop"},Se={class:"parcelshop__info"},ke={class:"parcelshop__button-wrapper"},ge={class:"parcelshop__button-wrapper--tertiary"},Pe=L(t({__name:"parcelshop",setup(e){A({middleware:["auth-guard"],title:"ParcelShop deliveries",subtitle:"Ask us to automatically deliver your parcels to your preferred ParcelShop instead of your address.",backTo:P.Preferences,backLabel:"Preferences"});const o=S(),t=q(),f=R(),y=l(5),k=l(!1),g=l(!1),C=l(!1),L=l(!1),T=l(!1),$=_(()=>t.preferences?.homeAddress),G=_(()=>
1t.preferences?.oohPreference?.nodeId),N=_(()=>t.editingOohPreference),W=_(()=>t.isTrackDiversionFlow),K=_(()=>f.locations),V=_(()=>f.singleParcelShop),X=_(()=>f.selectedLocationId),J=_(()=>f.selectedLocation),Q=_(()=>y.value?K.value?.slice(0,y.value):K.value),Z=_(()=>V.value||k.value?"Parcel delivery location":"Select a ParcelShop"),ee=_(()=>V.value?"Your ParcelShop is based on the location of your address.":"Your ParcelShop options are based on the location of your address."),oe=_(()=>o.resolve({name:P.Preferences}).href);function ae(){y.value+=5}function te(){y.value-=5}function se(){f.setSelectedLocation()}function ie(){k.value=!k.value}function re(){f.setSelectedLocation(),k.value=!1}async function le(){w("OOH_PS_PREFERENCE_DELETED"),t.resetOohPreference(),await t.deleteOohPreference(),o.push({name:P.Preferences})}return a(async()=>{if(W.value&&(await t.setOohPreference(),T.value=!0),C.value=!0,t.setEditingOohPreference(!1),!$.value)try{await t.getUsersPreferences()}catch(e){}G.value?(await f.getSingleParcelShop(G.value),C.value=!1):(await f.getParcelShops($.value?.postCode??""),C.value=!1),V.value&&(k.value=!0,f.setSelectedLocation(K.value[0]?.parcelShopId??null,0))}),(e,o)=>(s(),p(Y,null,{default:n(()=>[d("div",ue,[d("div",null,[d("div",me,[d("h4",_e,r(b(Z)),1),!b(G)||b(N)?(s(),h("div",be,r(b(ee)),1)):u("",!0)]),b(C)?(s(),h("div",ve,[c(b(j),{size:"xl",class:"parcelshop__spinner"})])):b(K).length?(s(),p(b(D),{key:1},{default:n(()=>[d("div",null,[c(b(z),{class:"parcelshop__list","default-icon":"tick_circle","default-color":"brand-01","default-size":"16","list-array":[{text:"Delivery to a local shop at no extra cost."},{text:"Parcels held securely for up to 10 days."},{text:"Collect when it suits you."},{text:"Reduce your parcel's carbon footprint."}]})]),o[7]||(o[7]=d("div",{class:"parcelshop__divider"},null,-1)),d("div",null,[(s(!0),h(m,null,i(b(Q),(e,o)=>(s(),p(he,{key:`parcelshop-info-${o}`,index:o+1,shop:e,onSelectShop:ie},null,8,["index","shop"]))),128))]),b(y)<b(K).length&&!b(k)?(s(),p(b(O),{key:0,class:"parcelshop__show-more",icon:"no-icon","data-test-id":"button-show-more-parcelshops",onClick:ae},{default:n(()=>[...o[4]||(o[4]=[v(" Show more locations ",-1)])]),_:1})):u("",!0),b(y)>5&&!b(k)?(s(),p(b(O),{key:1,class:"parcelshop__show-less",icon:"no-icon","data-test-id":"button-show-less-parcelshops",onClick:te},{default:n(()=>[...o[5]||(o[5]=[v(" Show less locations ",-1)])]),_:1})):u("",!0),b(k)&&!b(V)?(s(),h("div",ye,[c(b(E),{class:"parcelshop__change-parcelshop",type:"secondary",icon:"no-icon","data-test-id":"button-change-parcelshop",onClick:re},{default:n(()=>[...o[6]||(o[6]=[v(" Change ParcelShop ",-1)])]),_:1})])):u("",!0)]),footer:n(()=>[d("div",Se,[c(b(x),{class:"parcelshop__info-icon",icon:"info",height:"16",width:"16"}),o[8]||(o[8]=d("p",{class:"parcelshop__info-text"}," You can change this preference at any time in your account. ",-1))])]),_:1})):(s(),p(b(B),{key:2,show:"true","error-text":"Sorry, there are no eligible ParcelShops in your area. We hope to make ParcelShop deliveries available for your address soon."})),c(b(M),{id:"account-parcelshop-which-parcels",class:"parcelshop__accordion","header-text":"Which parcels can be delivered to a ParcelShop?","data-test-id":"account-parcelshop-which-parcels-accordion"},{default:n(()=>[...o[9]||(o[9]=[d("p",null," We can automatically deliver a parcel to your preferred ParcelShop instead of your address if the parcel is eligible for ParcelShop deliveries. ",-1),d("p",null," Certain circumstances mean we may be unable to deliver to a ParcelShop - these parcels will still be delivered to your address. ",-1),d("p",null,[d("strong",null," A parcel can be delivered to your preferred ParcelShop if: ")],-1),d("ul",null,[d("li",null," Your retailer or sender allows us to change your delivery location "),d("li",null,"It's associated with your Evri account email address"),d("li",null," The delivery address matches the address on your Evri account "),d("li",null,"It doesn't exceed the size and weight restrictions"),d("li",null,"It doesn't contain unsuitable items e.g. Fresh food")],-1),d("p",null," To ensure we can apply your delivery preferences, place online orders using your Evri account email address. ",-1)])]),_:1}),d("div",ke,[d("div",ge,[b(G)&&!b(N)?(s(),p(b(O),{key:0,class:"parcelshop__button-tertiary",icon:"bin","icon-position":"left",onClick:o[0]||(o[0]=e=>L.value=!0)},{default:n(()=>[...o[10]||(o[10]=[v(" Delete ParcelShop ",-1)])]),_:1})):u("",!0),b(G)&&!b(N)?(s(),p(b(O),{key:1,class:"parcelshop__button-tertiary",icon:"pencil","icon-position":"left",onClick:o[1]||(o[1]=e=>
1async function(){t.setEditingOohPreference(!0),f.resetSelectedParcelShop(),k.value=!1,C.value=!0,await f.getParcelShops($.value?.postCode??""),C.value=!1}())},{default:n(()=>[...o[11]||(o[11]=[v(" Edit ParcelShop ",-1)])]),_:1})):u("",!0)]),c(b(E),{"custom-tag":F,href:b(oe),class:"parcelshop__button",type:"secondary",onClick:se},{default:n(()=>[...o[12]||(o[12]=[v(" Cancel ",-1)])]),_:1},8,["href"]),!b(G)||b(N)?(s(),p(b(E),{key:0,disabled:!b(X),"aria-label":"Confirm",class:"parcelshop__button","data-test-id":"confirm-button",onClick:o[2]||(o[2]=e=>async function(){t.setParcelShop({nodeId:J.value?.parcelShopId,enabled:!0}),await t.setOohPreference(),I(),g.value=!0}())},{icon:n(()=>[c(b(x),{key:"chevron_right",icon:"chevron_right"})]),default:n(()=>[o[13]||(o[13]=v(" Confirm ",-1))]),_:1},8,["disabled"])):u("",!0)])]),b(g)?(s(),p(H,{key:0})):u("",!0),b(L)?(s(),p(fe,{key:1,onDeleteParcelShop:le,onCloseConfirmation:o[3]||(o[3]=e=>L.value=!1)})):u("",!0),b(T)?(s(),p(U,{key:2,"data-test-id":"parcelshop-diversion-confirmation-modal"})):u("",!0)])]),_:1}))}}),[["__scopeId","data-v-b1390933"]]);export{Pe 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.