PageSourceSearch

https://mytattoohub.com.br/static/js/LocationAutocompleteInputImpl.6a3967dd.chunk.js

js mytattoohub.com.br collected 2026-09-24 14:10:26 UTC 15,924 bytes, 2 lines download raw bytes

1"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[863],{21866:(e,t,i)=>{i.r(t),i.d(t,{default:()=>j});var o={};i.r(o),i.d(o,{CURRENT_LOCATION_ID:()=>_,GeocoderAttribution:()=>I,default:()=>D});var n={};i.r(n),i.d(n,{CURRENT_LOCATION_ID:()=>T,GeocoderAttribution:()=>C,default:()=>A});var s=i(72791),r=i(41418),c=i.n(r),l=i(48573),a=i.n(l),d=i(6639),h=i(29305),u=i(69765);const p={root:"LocationAutocompleteInput_root__P1ovG",icon:"LocationAutocompleteInput_icon__f-F0V",iconSvg:"LocationAutocompleteInput_iconSvg__uTJlN",iconSvgGroup:"LocationAutocompleteInput_iconSvgGroup__UyK4b",iconSpinner:"LocationAutocompleteInput_iconSpinner__ODGWz",input:"LocationAutocompleteInput_input__+5l0M",predictionsRoot:"LocationAutocompleteInput_predictionsRoot__lR3E0",predictionsRootGoogle:"LocationAutocompleteInput_predictionsRootGoogle__T0BCK",predictionsRootMapbox:"LocationAutocompleteInput_predictionsRootMapbox__Xdsld",poweredByGoogle:"LocationAutocompleteInput_poweredByGoogle__3Hwy8",predictions:"LocationAutocompleteInput_predictions__caeqM marketplaceBodyFontStyles",highlighted:"LocationAutocompleteInput_highlighted__J-WBN",currentLocation:"LocationAutocompleteInput_currentLocation__0L622 p",currentLocationIcon:"LocationAutocompleteInput_currentLocationIcon__57FqY"};var g=i(80184);const m=()=>(0,g.jsx)("svg",{className:p.iconSvg,width:"21",height:"22",viewBox:"0 0 21 22",xmlns:"http://www.w3.org/2000/svg",children:(0,g.jsxs)("g",{className:p.iconSvgGroup,transform:"matrix(-1 0 0 1 20 1)",strokeWidth:"2",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,g.jsx)("path",{d:"M13 14l5.241 5.241"}),(0,g.jsx)("circle",{cx:"7.5",cy:"7.5",r:"7.5"})]})}),w=()=>(0,g.jsx)("svg",{className:p.currentLocationIcon,width:"12",height:"12",xmlns:"http://www.w3.org/2000/svg",children:(0,g.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",fill:"#FFF",fillRule:"evenodd"})});var f=i(66319),P=i(721);const{LatLng:x,LatLngBounds:v}=f.types,_="current-location",S={address:500,country:2e3,region:2e3,postcode:2e3,district:2e3,place:2e3,locality:2e3,neighborhood:2e3,poi:2e3,"poi.landmark":2e3},L=(e,t)=>{if(!e)return null;const i=new window.mapboxgl.LngLat(e.lng,e.lat).toBounds(t);return new v(new x(i.getNorth(),i.getEast()),new x(i.getSouth(),i.getWest()))},y=e=>e&&Array.isArray(e.center)&&2===e.center.length?new x(e.center[1],e.center[0]):null,b=e=>{if(e){if(Array.isArray(e.bbox)&&4===e.bbox.length)return new v(new x(e.bbox[3],e.bbox[2]),new x(e.bbox[1],e.bbox[0]));{const t=Array.isArray(e.place_type)&&e.place_type[0],i=t&&S[t]||500;return L(y(e),i)}}return null},I=()=>null;const D=class{getClient(){var e,t;if(!("undefined"!==typeof window&&window.mapboxgl&&window.mapboxSdk))throw new Error("Mapbox libraries are required for GeocoderMapbox");return!this._client&&null!==(e=window)&&void 0!==e&&null!==(t=e.mapboxgl)&&void 0!==t&&t.accessToken&&(this._client=window.mapboxSdk({accessToken:window.mapboxgl.accessToken})),this._client}getPlacePredictions(e,t,i){const o=t?{countries:t}:{};return this.getClient().geocoding.forwardGeocode({query:e,limit:5,...o,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)===_?(0,P.kO)().then((e=>({address:"",origin:e,bounds:L(e,t)}))):e.predictionPlace?Promise.resolve(e.predictionPlace):Promise.resolve({address:this.getPredictionAddress(e),origin:y(e),bounds:b(e)})}};var N=i(90193);const T="current-location",C=e=>{const{rootClassName:t,className:i}=e,o=c()(t||p.poweredByGoogle,i);return(0,g.jsx)("div",{className:o})};const A=class{constructor(){this.sessionToken=null}getSessionToken(){return this.sessionToken=this.sessionToken||new window.google.maps.places.AutocompleteSessionToken,this.sessionToken}getPlacePredictions(e,t){const i=t?{componentRestrictions:{country:t}}:{};
1return N.ek(e,this.getSessionToken(),i).then((t=>({search:e,predictions:t.predictions})))}getPredictionId(e){return e.predictionPlace?e.id:e.place_id}getPredictionAddress(e){return e.predictionPlace?e.predictionPlace.address:e.description}getPlaceDetails(e,t){return this.getPredictionId(e)===T?(0,P.kO)().then((e=>({address:"",origin:e,bounds:N.xX(e,t)}))):e.predictionPlace?Promise.resolve(e.predictionPlace):N.eD(e.place_id,this.getSessionToken()).then((e=>(this.sessionToken=null,e)))}},{LatLng:M,LatLngBounds:k}=f.types,F="down",O=e=>{const t=e&&e.changedTouches?e.changedTouches[0]:null;return t?{x:t.screenX,y:t.screenY}:null},E=e=>"googleMaps"===e?n:o,R=e=>{const{rootClassName:t,className:i,useDarkText:o,children:n,predictions:s,currentLocationId:r,geocoder:l,isGoogleMapsInUse:a,highlightedIndex:d,onSelectStart:u,onSelectMove:m,onSelectEnd:f}=e;if(0===s.length)return null;const P=a?p.predictionsRootGoogle:p.predictionsRootMapbox,x=c()(t||p.predictionsRoot,P,i);return(0,g.jsxs)("div",{className:x,children:[(0,g.jsx)("ul",{className:p.predictions,children:s.map(((e,t)=>{const i=t===d,n=l.getPredictionId(e);return(0,g.jsx)("li",{className:c()(i?p.highlighted:null,o?p.listItemBlackText:p.listItemWhiteText),onTouchStart:e=>{e.preventDefault(),u(O(e.nativeEvent))},onMouseDown:e=>{e.preventDefault(),u()},onTouchMove:e=>{e.preventDefault(),m(O(e.nativeEvent))},onTouchEnd:t=>{t.preventDefault(),f(e)},onMouseUp:t=>{t.preventDefault(),f(e)},children:n===r?(0,g.jsxs)("span",{className:p.currentLocation,children:[(0,g.jsx)(w,{}),(0,g.jsx)(h._H,{id:"LocationAutocompleteInput.currentLocation"})]}):l.getPredictionAddress(e)},n)}))}),n]})},B=e=>{const t=e.input.value||{},{search:i="",predictions:o=[],selectedPlace:n=null}=t;return{search:i,predictions:o,selectedPlace:n}};class G extends s.Component{constructor(e){var t;super(e),t=this,this.toFixed6=e=>Number(e.toFixed(6)),this.boundsFromOriginRadius=function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;if(null===e||void 0===e||!e.origin)return null===e||void 0===e?void 0:e.bounds;const{lat:o,lng:n}=e.origin,s=i/111,r=i/(111*Math.cos(o*Math.PI/180)),c=new M(t.toFixed6(Math.min(90,o+s)),t.toFixed6(Math.min(180,n+r))),l=new M(t.toFixed6(Math.max(-90,o-s)),t.toFixed6(Math.max(-180,n-r)));return new k(c,l)},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.boundsFromOriginRadius=this.boundsFromOriginRadius.bind(this),this.toFixed6=this.toFixed6.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=a()(this.predict.bind(this),300,{leading:!0})}componentDidMount(){this._isMounted=!0}componentWillUnmount(){window.clearTimeout(this.shortQueryTimeout),this._isMounted=!1}getGeocoder(){const e=E(this.props.config.maps.mapProvider).default;return this._geocoder||(this._geocoder=new e),this._geocoder}currentPredictions(){const{search:e,predictions:t}=B(this.props),{useDefaultPredictions:i=!0,config:o}=this.props,n=t&&t.length>0,s=!e&&!n&&i,r=E(o.maps.mapProvider),c=(o.maps.search.suggestCurrentLocation?[{id:r.CURRENT_LOCATION_ID,predictionPlace:{}}]:[]).concat(o.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(F);else if(13===e.keyCode){const{selectedPlace:i}=B(this.props);var t;if(!i)e.preventDefault(),e.stopPropagation(),this.selectItemIfNoneSelected(),null===(t=this.input)||void 0===t||t.blur()}else if(9===e.keyCode){var i;this.selectItemIfNoneSelected(),null===(i=this.input)||void 0===i||i.blur()}
1else 27===e.keyCode&&this.input&&this.input.blur()}onChange(e){const t=this.props.input.onChange,i=this.currentPredictions(),o=e.target.value;t({search:o,predictions:o?i:[],selectedPlace:null}),this.setState({highlightedIndex:-1}),o&&(o.length>=3?(this.shortQueryTimeout&&window.clearTimeout(this.shortQueryTimeout),this.predict(o)):this.shortQueryTimeout=window.setTimeout((()=>{this.predict(o)}),1e3))}changeHighlight(e){this.setState(((t,i)=>{const o=this.currentPredictions(),n=t.highlightedIndex;let s=n;return"up"===e?s=0===n?0:n-1:e===F&&(s=n+1),s<0?s=-1:s>=o.length&&(s=o.length-1),{highlightedIndex:s}}))}selectPrediction(e){var t,i;const o=null===(t=this.props.config.maps)||void 0===t||null===(i=t.search)||void 0===i?void 0:i.currentLocationBoundsDistance;this.props.input.onChange({...this.props.input,selectedPlace:null}),this.setState({fetchingPlaceDetails:!0}),this.getGeocoder().getPlaceDetails(e,o).then((t=>{if(!this._isMounted)return;let i="";if("googleMaps"===this.props.config.maps.mapProvider){const e=(t.addressComponents||[]).find((e=>e.types.includes("locality")||e.types.includes("administrative_area_level_2")));i=e?e.long_name:""}else{var o;const t=e.context||[],n=t.find((e=>e.id.startsWith("place.")))||t.find((e=>e.id.startsWith("region.")))||t.find((e=>e.id.startsWith("country.")));i=n?n.text:null!==e&&void 0!==e&&null!==(o=e.id)&&void 0!==o&&o.startsWith("country.")?null===e||void 0===e?void 0:e.place_name:""}const n=this.boundsFromOriginRadius(t,10);this.setState({fetchingPlaceDetails:!1}),this.props.input.onChange({search:t.address,predictions:[],selectedPlace:{...t,bounds:n,city:i}})})).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}=B(this.props),i=this.currentPredictions();if(!t)if(i&&i.length>0){const e=-1!==this.state.highlightedIndex?this.state.highlightedIndex:0;this.selectPrediction(i[e])}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}=B(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=B(this.props);i({...t,selectedPlace:null})}))}finalizeSelection(){this.setState({inputHasFocus:!1,highlightedIndex:-1}),this.props.input.onBlur(B(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(){const{autoFocus:e,rootClassName:t,className:i,useDarkText:o,iconClassName:n,CustomIcon:s,inputClassName:r,predictionsClassName:l,predictionsAttributionClassName:a,validClassName:d,placeholder:h="",input:w,meta:f,inputRef:P,disabled:x,config:v}=this.props,{name:_,onFocus:S}=w,{search:L}=B(this.props),{touched:y,valid:b}=f||{},I=b&&y,D=this.currentPredictions(),N=c()(t||p.root,i),T=c()(n||p.icon),C=c()(r||p.input,{[d]:I}),A=c()(l),M=this.state.inputHasFocus,k=E(v.maps.mapProvider),F=k.GeocoderAttribution,O="function"===typeof P?{ref:e=>{this.input=e,P&&P(e)}}:P?{ref:P}:{};return(0,g.jsxs)("div",{className:N,children:[(0,g.jsx)("div",{className:T,children:this.state.fetchingPlaceDetails?(0,g.jsx)(u.vM,{className:p.iconSpinner}):s?(0,g.jsx)(s,{}):(0,g.jsx)(m,{})}),(0,g.jsx)("input",{className:C,type:"search",autoComplete:"off",autoFocus:e,placeholder:h,name:_,value:L,disabled:x||this.state.fetchingPlaceDetails,onFocus:e=>{this.setState({inputHasFocus:!0}),S(e)},onBlur:this.handleOnBlur,onChange:this.onChange,onKeyDown:this.onKeyDown,...O,title:L,"data-testid":"location-search"}),M?(0,g.jsx)(R,{rootClassName:A,useDarkText:o,predictions:D,currentLocationId:k.CURRENT_LOCATION_ID,isGoogleMapsInUse:"googleMaps"===v.maps.mapProvider,geocoder:this.getGeocoder(),highlightedIndex:this.state.highlightedIndex,onSelectStart:this.handlePredictionsSelectStart,onSelectMove:this.handlePredictionsSelectMove,onSelectEnd:this.handlePredictionsSelectEnd,children:(0,g.jsx)(F,{className:a,useDarkText:o})}):null]})}}const j=e=>{const t=(0,d.mX)();return(0,g.jsx)(G,{config:t,...e})}},90193:(e,t,i)=>{i.d(t,{Js:()=>h,Kl:()=>u,eD:()=>l,ek:()=>a,xX:()=>d});var o=i(66319);const{LatLng:n,LatLngBounds:s}=o.types,r=e=>e&&e.geometry&&e.geometry.location?new n(e.geometry.location.lat(),e.geometry.location.lng()):null,c=e=>{if(e&&e.geometry&&e.geometry.viewport){const t=e.geometry.viewport.getNorthEast(),i=e.geometry.viewport.getSouthWest
1();return new s(new n(t.lat(),t.lng()),new n(i.lat(),i.lng()))}return null},l=(e,t)=>new Promise(((i,o)=>{const n=window.google.maps.places.PlacesServiceStatus,s=document.createElement("div"),l=new window.google.maps.places.PlacesService(s),a=t?{sessionToken:t}:{};l.getDetails({placeId:e,fields:["address_component","formatted_address","geometry","place_id"],...a},((t,s)=>{s!==n.OK?o(new Error(`Could not get details for place id "${e}", error status was "${s}"`)):i({address:t.formatted_address,origin:r(t),bounds:c(t)})}))})),a=(e,t,i)=>new Promise(((o,n)=>{const s=new window.google.maps.places.AutocompleteService,r=t?{sessionToken:t}:{};s.getPlacePredictions({input:e,...r,...i},((t,i)=>{if((e=>{const{OK:t,ZERO_RESULTS:i}=window.google.maps.places.PlacesServiceStatus;return e===t||e===i})(i)){o({search:e,predictions:t||[]})}else n(new Error(`Prediction service status not OK: ${i}`))}))})),d=(e,t)=>{const i=new window.google.maps.Circle({center:new window.google.maps.LatLng(e.lat,e.lng),radius:t}).getBounds(),o=i.getNorthEast(),r=i.getSouthWest
1();return new s(new n(o.lat(),o.lng()),new n(r.lat(),r.lng()))},h=(e,t)=>{const{getPixelPositionOffset:i}=t;return"function"===typeof i?i(e.offsetWidth,e.offsetHeight):{}},u=(e,t,i)=>{const o=(e,t)=>new t(e.lat,e.lng),n=(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 o=e.fromLatLngToDivPixel(i.getNorthEast()),n=e.fromLatLngToDivPixel(i.getSouthWest());return o&&n?{left:`${n.x+t.x}px`,top:`${o.y+t.y}px`,width:o.x-n.x-t.x+"px",height:n.y-o.y-t.y+"px"}:{left:"-9999px",top:"-9999px"}})(e,t,s(i.bounds,window.google.maps.LatLngBounds,n))}return((e,t,i)=>{const o=e.fromLatLngToDivPixel(i);if(o){const{x:e,y:i}=o;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,o))}}}]);
2//# sourceMappingURL=LocationAutocompleteInputImpl.6a3967dd.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.