1"use strict";(globalThis.__LOADABLE_LOADED_CHUNKS__=globalThis.__LOADABLE_LOADED_CHUNKS__||[]).push([[2808],{62650(e,t,i){i.r(t),i.d(t,{default:()=>ee});var n={};i.r(n),i.d(n,{CURRENT_LOCATION_ID:()=>O,GeocoderAttribution:()=>K,default:()=>U});var o={};i.r(o),i.d(o,{CURRENT_LOCATION_ID:()=>z,GeocoderAttribution:()=>J,default:()=>$});var s=i(65043),r=i(98139),c=i.n(r),a=i(93950),l=i.n(a),d=i(63775),h=i(92174),u=i(83831);const p="LocationAutocompleteInput_root__P1ovG",g="LocationAutocompleteInput_icon__f-F0V",m="LocationAutocompleteInput_iconSvg__uTJlN",f="LocationAutocompleteInput_iconSvgGroup__UyK4b",w="LocationAutocompleteInput_iconSpinner__ODGWz",P="LocationAutocompleteInput_input__+5l0M",x="LocationAutocompleteInput_predictionsRoot__lR3E0",_="LocationAutocompleteInput_predictionsRootGoogle__T0BCK",v="LocationAutocompleteInput_predictionsRootMapbox__Xdsld",I="LocationAutocompleteInput_poweredByGoogle__3Hwy8",S="LocationAutocompleteInput_predictions__caeqM marketplaceBodyFontStyles",L="LocationAutocompleteInput_highlighted__J-WBN",b="LocationAutocompleteInput_listItemBlackText__2wffJ",y="LocationAutocompleteInput_listItemWhiteText__bPfHd",A="LocationAutocompleteInput_currentLocation__0L622 p",T="LocationAutocompleteInput_currentLocationIcon__57FqY",N="LocationAutocompleteInput_invert__rR4MW";var C=i(70579);const D=e=>(0,C.jsx)("svg",{className:m,width:"21",height:"22",viewBox:"0 0 21 22",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":e.ariaLabel,children:(0,C.jsxs)("g",{className:f,transform:"matrix(-1 0 0 1 20 1)",strokeWidth:"2",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,C.jsx)("path",{d:"M13 14l5.241 5.241"}),(0,C.jsx)("circle",{cx:"7.5",cy:"7.5",r:"7.5"})]})}),k=()=>(0,C.jsx)("svg",{className:T,width:"12",height:"12",xmlns:"http://www.w3.org/2000/svg",children:(0,C.jsx)("path",{d:"M11.9269636.07279915c-.0779984-.0770013-.1959959-.0950016-.2924939-.04400074L.13470842 6.02889945c-.10199788.05300089-.15499678.16900284-.12749735.28100473.02799942.11150188.12799734.1900032.24299496.1900032h5.249891v5.25008842c0 .1150019.07899836.2160036.19049604.2430041C5.71009267 11.998 5.73059224 12 5.75009184 12c.0914981 0 .1779963-.0505009.22199539-.1345023L11.9719627.36530407c.0499989-.09650162.0319993-.21500362-.0449991-.29250492",fillRule:"evenodd"})});var M=i(55346),E=i(63690);const{LatLng:j,LatLngBounds:B}=M.gK,O="current-location",R={address:500,country:2e3,region:2e3,postcode:2e3,district:2e3,place:2e3,locality:2e3,neighborhood:2e3,poi:2e3,"poi.landmark":2e3},G=(e,t)=>{if(!e)return null;const i=new window.mapboxgl.LngLat(e.lng,e.lat).toBounds(t);return new B(new j(i.getNorth(),i.getEast()),new j(i.getSouth(),i.getWest()))},F=e=>e&&Array.isArray(e.center)&&2===e.center.length?new j(e.center[1],e.center[0]):null,H=e=>{if(e){if(Array.isArray(e.bbox)&&4===e.bbox.length)return new B(new j(e.bbox[3],e.bbox[2]),new j(e.bbox[1],e.bbox[0]));{const t=Array.isArray(e.place_type)&&e.place_type[0],i=t&&R[t]||500;return G(F(e),i)}}return null},K=()=>null;const U=class{getClient(){if(!("undefined"!==typeof window&&window.mapboxgl&&window.mapboxSdk))throw new Error("Mapbox libraries are required for GeocoderMapbox");if(!window.mapboxgl.accessToken)throw new Error("Mapbox access token is not yet available");return this._client||(this._client=window.mapboxSdk({accessToken:window.mapboxgl.accessToken})),this._client}getPlacePredictions(e,t,i){const n=t?{countries:t}:{};return this.getClient().geocoding.forwardGeocode({query:e,limit:5,...n,language:[i]}).send().then(t=>({search:e,predictions:t.body.features}))}getPredictionId(e){return e.id}getPredictionAddress(e){return e.predictionPlace?e.predictionPlace.address:e.place_name}getPlaceDetails(e,t){return this.getPredictionId(e)===O?(0,E.hI)().then(e=>({address:"",origin:e,bounds:G(e,t)})):e.predictionPlace?Promise.resolve(e.predictionPlace):Promise.resolve({address:this.getPredictionAddress(e),origin:F(e),bounds:H(e)})}};var W=i(17985);const z="current-location",J=e=>{const{rootClassName:t,className:i,useDarkText:n}=e,o=c()(t||I,i,{[N]:n});return(0,C.jsx)("div",{className:o})};const $=class{constructor(){this.sessionToken=null}getSessionToken(){return this.sessionToken=this.sessionToken||new window.google.maps.places.AutocompleteSessionToken,this.sessionToken}
1getPlacePredictions(e,t){const i=t?{includedRegionCodes:t}:{};return W.wJ(e,this.getSessionToken(),i).then(t=>({search:e,predictions:t.predictions}))}getPredictionId(e){return e.predictionPlace?e.id:e.placePrediction.placeId}getPredictionAddress(e){return e.predictionPlace?e.predictionPlace.address:e.placePrediction.text.text}getPlaceDetails(e,t){return this.getPredictionId(e)===z?(0,E.hI)().then(e=>({address:"",origin:e,bounds:W.JR(e,t)})):e.predictionPlace?Promise.resolve(e.predictionPlace):W.ag(this.getPredictionId(e)).then(e=>(this.sessionToken=null,e))}},q="down",Q=e=>{const t=e&&e.changedTouches?e.changedTouches[0]:null;return t?{x:t.screenX,y:t.screenY}:null},X=e=>"googleMaps"===e?o:n,Y=e=>{const{id:t,rootClassName:i,className:n,useDarkText:o,children:s,predictions:r,currentLocationId:a,geocoder:l,isGoogleMapsInUse:d,highlightedIndex:u,onSelectStart:p,onSelectMove:g,onSelectEnd:m}=e;if(0===r.length)return null;const f=d?_:v,w=c()(i||x,f,n);return(0,C.jsxs)("div",{className:w,id:t,children:[(0,C.jsx)("ul",{className:S,role:"listbox",children:r.map((e,t)=>{const i=t===u,n=l.getPredictionId(e);return(0,C.jsx)("li",{className:c()(i?L:null,o?b:y),id:n,role:"option",onTouchStart:e=>{e.preventDefault(),p(Q(e.nativeEvent))},onMouseDown:e=>{e.preventDefault(),p()},onTouchMove:e=>{e.preventDefault(),g(Q(e.nativeEvent))},onTouchEnd:t=>{t.preventDefault(),m(e)},onMouseUp:t=>{t.preventDefault(),m(e)},children:n===a?(0,C.jsxs)("span",{className:A,children:[(0,C.jsx)(k,{}),(0,C.jsx)(h.sA,{id:"LocationAutocompleteInput.currentLocation"})]}):l.getPredictionAddress(e)},n)})}),s]})},V=e=>{const t=e.input.value||{},{search:i="",predictions:n=[],selectedPlace:o=null}=t;return{search:i,predictions:n,selectedPlace:o}};class Z extends s.Component{constructor(e){super(e),this._isMounted=!1,this.state={inputHasFocus:!1,selectionInProgress:!1,touchStartedFrom:null,highlightedIndex:-1,fetchingPlaceDetails:!1,fetchingPredictions:!1},this.input=null,this.shortQueryTimeout=null,this.getGeocoder=this.getGeocoder.bind(this),this.currentPredictions=this.currentPredictions.bind(this),this.changeHighlight=this.changeHighlight.bind(this),this.selectPrediction=this.selectPrediction.bind(this),this.selectItemIfNoneSelected=this.selectItemIfNoneSelected.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onChange=this.onChange.bind(this),this.handleOnBlur=this.handleOnBlur.bind(this),this.handlePredictionsSelectStart=this.handlePredictionsSelectStart.bind(this),this.handlePredictionsSelectMove=this.handlePredictionsSelectMove.bind(this),this.handlePredictionsSelectEnd=this.handlePredictionsSelectEnd.bind(this),this.finalizeSelection=this.finalizeSelection.bind(this),this.predict=l()(this.predict.bind(this),300,{leading:!0})}componentDidMount(){this._isMounted=!0}componentWillUnmount(){window.clearTimeout(this.shortQueryTimeout),this._isMounted=!1}getGeocoder(){const e=X(this.props.config.maps.mapProvider).default;return this._geocoder||(this._geocoder=new e),this._geocoder}currentPredictions(){const{search:e,predictions:t}=V(this.props),{useDefaultPredictions:i=!0,config:n}=this.props,o=t&&t.length>0,s=!e&&!o&&i,r=X(n.maps.mapProvider),c=(n.maps.search.suggestCurrentLocation?[{id:r.CURRENT_LOCATION_ID,predictionPlace:{}}]:[]).concat(n.maps.search.defaults);return s?c:t}onKeyDown(e){if(38===e.keyCode)e.preventDefault(),this.changeHighlight("up");else if(40===e.keyCode)e.preventDefault(),this.changeHighlight(q);else if(13===e.keyCode){const{selectedPlace:i}=V(this.props);var t;if(!i)e.preventDefault(),e.stopPropagation(),this.selectItemIfNoneSelected(),null===(t=this.input)||void 0===t||t.blur()}else 9===e.keyCode?e.shiftKey||this.selectItemIfNoneSelected():27===e.keyCode&&this.input&&this.input.blur()}onChange(e){const t=this.props.input.onChange,i=this.currentPredictions(),n=e.target.value;t({search:n,predictions:n?i:[],selectedPlace:null}),this.setState({highlightedIndex:-1}),n&&(n.length>=3?(this.shortQueryTimeout&&window.clearTimeout(this.shortQueryTimeout),this.predict(n)):this.shortQueryTimeout=window.setTimeout(()=>{this.predict(n)},1e3))}changeHighlight(e){this.setState((t,i)=>{const n=this.currentPredictions(),o=t.highlightedIndex;let s=o;return"up"===e?s=0===o?0:o-1:e===q&&(s=o+1),s<0?s=-1:s>=n.length&&(s=n.length-1),{highlightedIndex:s}})}selectPrediction(e){var t;const i=null===(t=this.props.config.maps)||void 0===t||null===(t=t.search)||void 0===t?void 0:t.currentLocationBoundsDistance;this.props.input.onChange({...this.props.input,selectedPlace:null}),this.setState({fetchingPlaceDetails:!0}),this.getGeocoder().getPlaceDetails(e,i).then(e=>{this._isMounted&&(this.setState({fetchingPlaceDetails:!1}),this.props.input.onChange({search:e.address,predictions:[],selectedPlace:e}))}).catch(e=>{this.setState({fetchingPlaceDetails:!1}),console.error(e),this.props.input.onChange({...this.props.input.value,selectedPlace:null})})}selectItemIfNoneSelected(){if(this.state.fetchingPredictions)return;const{search:e,selectedPlace:t}=V(this.props),i=this.currentPredictions();if(!t)if(i&&i.length>0){const e=X(this.props.config.maps.mapProvider);if(-1===this.state.highlightedIndex&&1===i.length&&i[0].id===e.CURRENT_LOCATION_ID)return;const t=-1!==this.state.highlightedIndex?this.state.highlightedIndex:0;this.selectPrediction(i[t])}else this.predict(e)}predict(e){const t=this.props.config,i=this.props.input.onChange;return this.setState({fetchingPredictions:!0}),this.getGeocoder().getPlacePredictions(e,t.maps.search.countryLimit,t.localization.locale).then(e=>{const{search:t}=V(this.props);this.setState({fetchingPredictions:!1}),e.search===t&&i({search:e.search,predictions:e.predictions,selectedPlace:null})}).catch(e=>{this.setState({fetchingPredictions:!1}),console.error(e);const t=V(this.props);i({...t,selectedPlace:null})})}finalizeSelection(){this.setState({inputHasFocus:!1,highlightedIndex:-1}),this.props.input.onBlur(V(this.props))}handleOnBlur(){this.props.closeOnBlur&&!this.state.selectionInProgress&&this.finalizeSelection()}handlePredictionsSelectStart(e){this.setState({selectionInProgress:!0,touchStartedFrom:e,isSwipe:!1})}handlePredictionsSelectMove(e){this.setState(t=>{const i=t.touchStartedFrom;return{selectionInProgress:!1,isSwipe:!!!!i&&Math.abs(i.y-e.y)>5}})}handlePredictionsSelectEnd(e){let t=!1;this.setState(e=>(e.isSwipe||(t=!0),{selectionInProgress:!1,touchStartedFrom:null,isSwipe:!1}),()=>{t&&(this.selectPrediction(e),this.finalizeSelection())})}render(){var e;const{autoFocus:t,rootClassName:i,className:n,useDarkText:o,iconClassName:s,CustomIcon:r,inputClassName:a,predictionsClassName:l,predictionsAttributionClassName:d,validClassName:h,placeholder:m="",input:f,meta:x,inputRef:_,disabled:v,config:I,intl:S,id:L,submitButton:b,ariaLabel:y}=this.props,{name:A,onFocus:T}=f,{search:N}=V(this.props),{touched:k,valid:M}=x||{},E=M&&k,j=this.currentPredictions(),B=y?{"aria-label":y}:{},O=c()(i||p,n),R=c()(s||g),G=c()(a||P,{[h]:E}
1),F=c()(l),H=this.state.inputHasFocus,K=X(I.maps.mapProvider),U=K.GeocoderAttribution,W="function"===typeof _?{ref:e=>{this.input=e,_&&_(e)}}:_?{ref:_}:{},z=`${L}.predictions`;return(0,C.jsxs)("div",{className:O,children:[(0,C.jsx)("div",{className:R,children:this.state.fetchingPlaceDetails?(0,C.jsx)(u.X1,{className:w}):r?(0,C.jsx)(r,{}):b?(0,C.jsx)(b,{}):(0,C.jsx)(D,{ariaLabel:S.formatMessage({id:"LocationAutocompleteInput.screenreader.search"})})}),(0,C.jsx)("input",{className:G,type:"search",autoComplete:"off",autoFocus:t,placeholder:m,name:A,id:L,value:N,disabled:v||this.state.fetchingPlaceDetails,onFocus:e=>{this.setState({inputHasFocus:!0}),T(e)},onBlur:this.handleOnBlur,onChange:this.onChange,onKeyDown:this.onKeyDown,...W,title:N,"data-testid":"location-search",...B,role:"combobox","aria-autocomplete":"list","aria-expanded":H,"aria-controls":z,"aria-activedescendant":null===(e=j[this.state.highlightedIndex])||void 0===e?void 0:e.id}),H?(0,C.jsx)(Y,{id:z,rootClassName:F,useDarkText:o,predictions:j,currentLocationId:K.CURRENT_LOCATION_ID,isGoogleMapsInUse:"googleMaps"===I.maps.mapProvider,geocoder:this.getGeocoder(),highlightedIndex:this.state.highlightedIndex,onSelectStart:this.handlePredictionsSelectStart,onSelectMove:this.handlePredictionsSelectMove,onSelectEnd:this.handlePredictionsSelectEnd,children:(0,C.jsx)(U,{className:d,useDarkText:o})}):null]})}}const ee=e=>{const t=(0,d._r)(),i=(0,h.tz)();return(0,C.jsx)(Z,{config:t,intl:i,...e})}},17985(e,t,i){var n=i(55346);const{LatLng:o,LatLngBounds:s}=n.gK,r=e=>e&&e.location?new o(e.location.lat(),e.location.lng()):null,c=e=>{if(e&&e.viewport){const t=e.viewport.getNorthEast(),i=e.viewport.getSouthWest
1();return new s(new o(t.lat(),t.lng()),new o(i.lat(),i.lng()))}return null};i.d(t,["$q",0,(e,t,i)=>{const n=(e,t)=>new t(e.lat,e.lng),o=(e,t)=>new t(new window.google.maps.LatLng(e.ne.lat,e.ne.lng),new window.google.maps.LatLng(e.sw.lat,e.sw.lng)),s=(e,t,i)=>e instanceof t?e:i(e,t);if(i.bounds){return((e,t,i)=>{const n=e.fromLatLngToDivPixel(i.getNorthEast()),o=e.fromLatLngToDivPixel(i.getSouthWest());return n&&o?{left:`${o.x+t.x}px`,top:`${n.y+t.y}px`,width:n.x-o.x-t.x+"px",height:o.y-n.y-t.y+"px"}:{left:"-9999px",top:"-9999px"}})(e,t,s(i.bounds,window.google.maps.LatLngBounds,o))}return((e,t,i)=>{const n=e.fromLatLngToDivPixel(i);if(n){const{x:e,y:i}=n;return{left:`${e+t.x}px`,top:`${i+t.y}px`}}return{left:"-9999px",top:"-9999px"}})(e,t,s(i.position,window.google.maps.LatLng,n))},"JR",0,(e,t)=>{const i=new window.google.maps.Circle({center:new window.google.maps.LatLng(e.lat,e.lng),radius:t}).getBounds(),n=i.getNorthEast(),r=i.getSouthWest();return new s(new o(n.lat(),n.lng()),new o(r.lat(),r.lng()))},"ag",0,async e=>{try{const t=await new window.google.maps.places.Place({id:e}),i=["addressComponents","formattedAddress","viewport","id","location"];return await t.fetchFields({fields:i}),{address:t.formattedAddress,origin:r(t),bounds:c(t)}}catch(t){return t}},"m",0,(e,t)=>{const{getPixelPositionOffset:i}=t;return"function"===typeof i?i(e.offsetWidth,e.offsetHeight):{}},"wJ",0,async(e,t,i)=>{try{const n={input:e,...i,...t?{sessionToken:t}:{}},{suggestions:o}=await google.maps.places.AutocompleteSuggestion.fetchAutocompleteSuggestions(n);return{search:e,predictions:o||[]}}catch(n){return n}}])}}]); 2//# sourceMappingURL=LocationAutocompleteInputImpl.24651469.chunk.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.