1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5734],{14538:function(e,n,t){t.d(n,{N:function(){return a}});var o=t(40048);let l=(e,n)=>(0,o.U2)("companyservices/".concat(e),{...n,apiVersion:"v1"});var r=t(32351);let a=e=>{let{data:n,error:t,isFetching:o,isSuccess:a,refetch:c,isLoading:u}=(0,r.z)({queryKey:["GET_STORE_LIST_ORDER_TYPES",e],queryFn:()=>l(e),staleTime:1/0,enabled:!!e&&"0"!==e&&0!==e});return{data:n,error:t,isFetching:o,isSuccess:a,refetch:c,isLoading:u}}},70751:function(e,n,t){t.d(n,{No:function(){return i},aM:function(){return a},lC:function(){return u},wk:function(){return c},wp:function(){return s}});var o=t(40048),l=t(48129),r=t(54887);let a=async function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all",t=arguments.length>2?arguments[2]:void 0,r=(0,o.U2)("branches/".concat(e).concat(n?"?excludeFields="+n:""),t),a=(0,o.U2)("branches/".concat(e,"/statuses"),t),[c,u]=await Promise.all([r,a]);return{...c?(0,l.NB)(c):c,branchStatuses:u||[]}},c=async(e,n)=>{var t;let a=await (0,o.U2)("branches?".concat(r.Z.stringify(e)),n);return null!==(t=null==a?void 0:a.map(e=>(0,l.NB)(e)))&&void 0!==t?t:a},u=(e,n)=>(0,o.U2)("branches/search?".concat(r.Z.stringify(e)),n),s=(e,n)=>(0,o.U2)("branches/".concat(e,"/statuses"),n),i=e=>{var n;let t=(null===(n=e.branchStatuses)||void 0===n?void 0:n.map(e=>e.orderType))||[];return e.services.filter(e=>t.includes(e.orderType))}},23405:function(e,n,t){t.d(n,{n:function(){return o}});let o=async e=>{var n,t;return(null===(t=window.google)||void 0===t?void 0:null===(n=t.maps)||void 0===n?void 0:n.Geocoder)?new Promise(n=>{let t=new window.google.maps.Geocoder;if(e.address){let o={address:e.address};e.country&&(o.componentRestrictions={country:e.country}),t.geocode(o,(e,t)=>{t===window.google.maps.GeocoderStatus.OK&&e&&e.length>0?n(e[0]):(console.error("Geocode failed:",t),n(null))})}else if(e.latlng){let[o,l]=e.latlng.split(",").map(Number);if(isNaN(o)||isNaN(l)){console.warn("Invalid coordinates provided:",e.latlng),n(null);return}t.geocode({location:{lat:o,lng:l}},(e,t)=>{t===window.google.maps.GeocoderStatus.OK&&e&&e.length>0?n(e[0]):(console.error("Geocode failed:",t),n(null))})}else console.warn("Either address or latlng must be provided"),n(null)}):(console.warn("Google Maps API is not loaded"),null)}},12443:function(e,n,t){t.d(n,{l:function(){return c}});var o=t(67294),l=t(22230),r=t(50820),a=t(14640);function c(e){let{onPredictionResolved:n}=e,t=(0,r.Z)(e=>e.company),c=(0,a.useLocale)(),[u,s]=(0,o.useState)(""),[i,d]=(0,o.useState)([]),[g,f]=(0,o.useState)(""),v=(0,o.useMemo)(()=>{var e;return null!==(e=null==t?void 0:t.companyLocale.country)&&void 0!==e?e:"GB"},[t]),p=(0,o.useCallback)(e=>{s(e)},[]),w=(0,o.useCallback)(e=>{s(e)},[]),m=(0,o.useCallback)(()=>{s(""),d([])},[]),y=(0,o.useCallback)(e=>{window.google&&""!==e&&new window.google.maps.places.AutocompleteService().getPlacePredictions({input:e,region:v,componentRestrictions:{country:v},language:c},(e,n)=>{n===window.google.maps.places.PlacesServiceStatus.OK&&e&&d(e)})},[v,c]),I=(0,o.useCallback)((e,t)=>{let o=i.find(e=>e.place_id===t.key);window.google&&o&&new window.google.maps.Geocoder().geocode({placeId:o.place_id,language:c},(e,t)=>{if(t===window.google.maps.GeocoderStatus.OK&&e&&e.length>0){let t={lat:e[0].geometry.location.lat(),lng:e[0].geometry.location.lng()};null==n||n(t,e[0].address_components,e[0].formatted_address)}})},[i,n,c]);return(0,l.Z)(()=>f(u),300,[u]),(0,o.useEffect)(()=>{y(g)},[g]),{address:u,predictions:i,onSearchAddressValueChange:p,onPredictionSelect:I,setAddressValue:w,resetAddress:m}}},85790:function(e,n,t){t.d(n,{l:function(){return r}});var o=t(67294),l=t(23405);function r(){let[e,n]=(0,o.useState)(null),[t,r]=(0,o.useState)(null),[a,c]=(0,o.useState)(null),u=(0,o.useCallback)(async(e,n)=>{let t=await (0,l.n)({latlng:"".concat(e,",").concat(n)});t&&c(t)},[]);return{positionMap:e,positionMarker:t,geocoderSelected:a,onMapClick:(0,o.useCallback)(e=>{var n,t,o,l;let a=null!==(o=null===(n=e.latLng)||void 0===n?void 0:n.lat())&&void 0!==o?o:0,c=null!==(l=null===(t=e.latLng)||void 0===t?void 0:t.lng())&&void 0!==l?l:0;r({lat:a,lng:c}
1),u(a,c)},[u]),updatePosition:(0,o.useCallback)(e=>{n(e),r(e),u(e.lat,e.lng)},[u]),setPositionMap:n}}},2175:function(e,n,t){t.d(n,{g:function(){return c}});var o=t(67294),l=t(84976),r=t(50820),a=t(66340);function c(){let e=(0,r.Z)(e=>e.company),n=(0,o.useMemo)(()=>{var n;return null!==(n=null==e?void 0:e.workFlowSettings)&&void 0!==n?n:[]},[e]),t=(0,o.useMemo)(()=>n.find(e=>e.channel===l.$.WEB||e.channel===l.$.ALL),[n]),c=(0,o.useMemo)(()=>{var e,n;return null==t?void 0:null===(n=t.workFlowSettingParams)||void 0===n?void 0:null===(e=n.find(e=>"store_search_map_service"===e.key))||void 0===e?void 0:e.value},[t]);return{searchMode:(0,o.useMemo)(()=>{if(c===a.r4.ZIPCODE2_NO_GEO)return"postcode";switch(null==e?void 0:e.deliveryZoneType){case a.$z.ZIPCODE:case a.$z.ZIPCODE2:case a.$z.STORELISTING_ZIPCODE2:return"postcode";default:return"address"}},[c,null==e?void 0:e.deliveryZoneType]),storeSearchMapService:c}}},84976:function(e,n,t){var o,l;t.d(n,{$:function(){return o},g:function(){return r}}),(l=o||(o={})).ALL="ALL",l.WEB="WEB",l.IOS="IOS",l.ANDROID="ANDROID",l.ANDROID_EPOS="ANDROID_EPOS";let r={ALL:0,WEB:1,IOS:2,ANDROID:3,ANDROID_EPOS:4}},48129:function(e,n,t){t.d(n,{NB:function(){return s},qb:function(){return u}});let o=["client_secret_key","secret_api_key","eposNowAPIAccessKey"],l=()=>void 0,r=new Map([["branchIntegrations",()=>[]],["paymentMethodIntegrations",l],["companyIntegrations",l],["paymentMethodIntegrationParams",e=>Array.isArray(e)?e.filter(e=>!o.includes(null==e?void 0:e.key)):e]]);[...r.keys()];let a=(e,n)=>{let t=r.get(e);return t?t(n):n},c=e=>JSON.parse(JSON.stringify(e),a),u=e=>c(e),s=e=>c(e)},21943:function(e,n,t){t.d(n,{CP:function(){return a},uF:function(){return u},vS:function(){return c},vg:function(){return s}});var o=t(66340);let l=/^([A-Z]{1,2}\d{1,2}[A-Z]?)\s*(\d[A-Z]{2})$/i,r=/^([A-Z]\d[A-Z])\s*(\d[A-Z]\d)$/i;function a(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GB",t=e.trim().toUpperCase(),o="CA"===n?r:"GB"===n?l:null,a=o?t.match(o):null;return a?"".concat(a[1]," ").concat(a[2]):t}function c(e,n){return"longitude:".concat(n,"|latitude:").concat(e)}function u(e){return"zipcode:".concat(e)}function s(e){let{deliveryZoneType:n,country:t="GB",postCode:a,latitude:c,longitude:u,city:s,area:i}=e;switch(n){case o.$z.ZIPCODE:return"/stores/".concat(encodeURIComponent((null!=a?a:"").trim()));case o.$z.ZIPCODE2:case o.$z.STORELISTING_ZIPCODE2:{let e=function(e,n){let t=e.trim().match("CA"===n?r:l);if(t){let e=t[1],n=t[2].charAt(0);return"".concat(e,"-").concat(n).toLowerCase()}return e.replace(/\s/g,"").toLowerCase()}(null!=a?a:"",t);return"/stores/".concat(e)}case o.$z.RADIUS_MILES:case o.$z.RADIUS_KILOMETRES:case o.$z.POLYGON:case o.$z.CITYPOLYGON:return"/stores/geolocationaddress?latitude=".concat(c,"&longitude=").concat(u);case o.$z.CITYAREA:return"/stores/".concat((null!=s?s:"").toLowerCase(),"/").concat((null!=i?i:"").toLowerCase());default:return"/stores"}}}}]);
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.