react-google-places-autocomplete
Advanced tools
Comparing version 1.3.1 to 1.4.0
@@ -7,2 +7,4 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
@@ -18,4 +20,8 @@ | ||
var _utils = require('../utils'); | ||
var _debounce = require('../utils/debounce'); | ||
var _debounce2 = _interopRequireDefault(_debounce); | ||
var _customPropTypes = require('../utils/customPropTypes'); | ||
require('./index.css'); | ||
@@ -25,2 +31,4 @@ | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -40,7 +48,16 @@ | ||
_this.fetchSuggestions = (0, _utils.debounce)(function (value) { | ||
_this.fetchSuggestions = (0, _debounce2.default)(function (value) { | ||
var autocompletionRequest = _this.props.autocompletionRequest; | ||
var bounds = undefined; | ||
if (autocompletionRequest.bounds) { | ||
bounds = new (Function.prototype.bind.apply(google.maps.LatLngBounds, [null].concat(_toConsumableArray(autocompletionRequest.bounds))))(); | ||
} | ||
_this.setState({ loading: true }); | ||
_this.placesService.getPlacePredictions({ | ||
_this.placesService.getPlacePredictions(_extends({}, autocompletionRequest, { | ||
bounds: bounds, | ||
input: value | ||
}, _this.fetchSuggestionsCallback); | ||
}), _this.fetchSuggestionsCallback); | ||
}, _this.props.debounce); | ||
@@ -58,8 +75,8 @@ | ||
_this.changeActiveSuggestion = _this.changeActiveSuggestion.bind(_this); | ||
_this.changeValue = _this.changeValue.bind(_this); | ||
_this.changeActiveSuggestion = _this.changeActiveSuggestion.bind(_this); | ||
_this.clearSuggestions = _this.clearSuggestions.bind(_this); | ||
_this.fetchSuggestionsCallback = _this.fetchSuggestionsCallback.bind(_this); | ||
_this.handleClick = _this.handleClick.bind(_this); | ||
_this.handleKeyDown = _this.handleKeyDown.bind(_this); | ||
_this.handleOnBlur = _this.handleOnBlur.bind(_this); | ||
_this.initalizeService = _this.initializeService.bind(_this); | ||
@@ -76,4 +93,10 @@ _this.onSuggestionSelect = _this.onSuggestionSelect.bind(_this); | ||
this.initalizeService(); | ||
document.addEventListener('click', this.handleClick); | ||
} | ||
}, { | ||
key: 'componentWillUnmount', | ||
value: function componentWillUnmount() { | ||
document.removeEventListener('click', this.handleClick); | ||
} | ||
}, { | ||
key: 'componentWillReceiveProps', | ||
@@ -86,2 +109,9 @@ value: function componentWillReceiveProps(nextProps) { | ||
}, { | ||
key: 'handleClick', | ||
value: function handleClick(ev) { | ||
if (!ev.target.id.includes('google-places-autocomplete')) { | ||
this.clearSuggestions(); | ||
} | ||
} | ||
}, { | ||
key: 'changeValue', | ||
@@ -121,2 +151,3 @@ value: function changeValue(value) { | ||
this.placesService = new window.google.maps.places.AutocompleteService(); | ||
window.coso = this.placesService; | ||
this.setState({ | ||
@@ -142,5 +173,4 @@ placesServiceStatus: window.google.maps.places.PlacesServiceStatus.OK | ||
autoComplete: 'off', | ||
id: 'google-places-autcomplete-input', | ||
id: 'google-places-autocomplete-input', | ||
value: value, | ||
onBlur: this.handleOnBlur, | ||
onChange: function onChange(_ref) { | ||
@@ -160,3 +190,2 @@ var target = _ref.target; | ||
id: 'google-places-autocomplete-input', | ||
onBlur: this.handleOnBlur, | ||
onChange: function onChange(_ref2) { | ||
@@ -258,2 +287,3 @@ var target = _ref2.target; | ||
}); | ||
onSelect(suggestion); | ||
@@ -305,22 +335,2 @@ } | ||
}, { | ||
key: 'handleOnBlur', | ||
value: function handleOnBlur(ev) { | ||
if (ev.target.id.includes('google-places-autocomplete')) { | ||
return; | ||
} | ||
var _state3 = this.state, | ||
hasSelected = _state3.hasSelected, | ||
value = _state3.value, | ||
onSelect = this.props.onSelect; | ||
if (hasSelected) { | ||
return; | ||
} | ||
this.clearSuggestions(); | ||
onSelect({ description: value }); | ||
} | ||
}, { | ||
key: 'clearSuggestions', | ||
@@ -391,2 +401,3 @@ value: function clearSuggestions() { | ||
GooglePlacesAutocomplete.propTypes = { | ||
autocompletionRequest: _customPropTypes.autocompletionRequestType, | ||
debounce: _propTypes2.default.number, | ||
@@ -401,14 +412,8 @@ initialValue: _propTypes2.default.string, | ||
renderSuggestions: _propTypes2.default.func, | ||
suggestionsClassNames: _propTypes2.default.shape({ | ||
container: _propTypes2.default.string, | ||
suggestion: _propTypes2.default.string, | ||
suggestionActive: _propTypes2.default.string | ||
}), | ||
suggestionsStyles: _propTypes2.default.shape({ | ||
container: _propTypes2.default.object, | ||
suggestion: _propTypes2.default.object | ||
}) | ||
suggestionsClassNames: _customPropTypes.suggestionClassNamesType, | ||
suggestionsStyles: _customPropTypes.suggestionStylesType | ||
}; | ||
GooglePlacesAutocomplete.defaultProps = { | ||
autocompletionRequest: {}, | ||
debounce: 300, | ||
@@ -415,0 +420,0 @@ initialValue: '', |
@@ -1,3 +0,3 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ReactGooglePlacesAutocomplete=t():e.ReactGooglePlacesAutocomplete=t()}(window,function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=n(1),i=(o=r)&&o.__esModule?o:{default:o};t.default=i.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=n(2),i=s(r),u=s(n(5)),a=n(8);function s(e){return e&&e.__esModule?e:{default:e}}n(9);var l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.fetchSuggestions=(0,a.debounce)(function(e){n.setState({loading:!0}),n.placesService.getPlacePredictions({input:e},n.fetchSuggestionsCallback)},n.props.debounce),n.state={activeSuggestion:null,hasSelected:!1,loading:!1,placesServiceStatus:null,suggestions:[],value:e.initialValue},n.changeValue=n.changeValue.bind(n),n.changeActiveSuggestion=n.changeActiveSuggestion.bind(n),n.clearSuggestions=n.clearSuggestions.bind(n),n.fetchSuggestionsCallback=n.fetchSuggestionsCallback.bind(n),n.handleKeyDown=n.handleKeyDown.bind(n),n.handleOnBlur=n.handleOnBlur.bind(n),n.initalizeService=n.initializeService.bind(n),n.onSuggestionSelect=n.onSuggestionSelect.bind(n),n.renderInput=n.renderInput.bind(n),n.renderSuggestions=n.renderSuggestions.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.Component),o(t,[{key:"componentDidMount",value:function(){this.initalizeService()}},{key:"componentWillReceiveProps",value:function(e){e.initialValue&&this.setState({value:e.initialValue})}},{key:"changeValue",value:function(e){this.setState({value:e}),e.length>0?this.fetchSuggestions(e):this.setState({suggestions:[]})}},{key:"initializeService",value:function(){var e=this;return window.google?window.google.maps.places?(this.placesService=new window.google.maps.places.AutocompleteService,void this.setState({placesServiceStatus:window.google.maps.places.PlacesServiceStatus.OK})):(console.error("[react-google-places-autocomplete]: Google maps places script not loaded"),void setTimeout(function(){e.initializeService()},1e3)):(console.error("[react-google-places-autocomplete]: Google script not loaded"),void setTimeout(function(){e.initalizeService()},1e3))}},{key:"renderInput",value:function(){var e=this,t=this.state.value,n=this.props,o=n.inputClassName,r=n.inputStyle,u=n.placeholder,a=n.renderInput;return a?a({autoComplete:"off",id:"google-places-autcomplete-input",value:t,onBlur:this.handleOnBlur,onChange:function(t){var n=t.target;return e.changeValue(n.value)},onKeyDown:this.handleKeyDown,type:"text",placeholder:u}):i.default.createElement("input",{autoComplete:"off",className:o||"google-places-autocomplete__input",id:"google-places-autocomplete-input",onBlur:this.handleOnBlur,onChange:function(t){var n=t.target;return e.changeValue(n.value)},onKeyDown:this.handleKeyDown,placeholder:u,style:r,type:"text",value:t})}},{key:"renderSuggestions",value:function(){var e=this,t=this.state,n=t.activeSuggestion,o=t.suggestions,r=this.props,u=r.renderSuggestions,a=r.suggestionsClassNames,s=r.suggestionsStyles;return 0===o.length?null:u?u(n,o,this.onSuggestionsSelect):i.default.createElement("div",{id:"google-places-suggestions-container",className:a.container||"google-places-autocomplete__suggestions-container",style:s.container},o.map(function(t,o){return i.default.createElement("div",{id:"google-places-autocomplete-suggestion--"+o,key:t.id,className:(a.suggestion||"google-places-autocomplete__suggestion")+" "+(n===o?a.suggestionActive||"google-places-autocomplete__suggestion--active":""),style:s.suggestion,onClick:function(n){return e.onSuggestionSelect(t,n)},role:"presentation"},t.description)}))}},{key:"renderLoader",value:function(){var e=this.props.loader;return e||i.default.createElement("div",{className:"google-places-autocomplete__suggestions-container"},i.default.createElement("div",{className:"google-places-autcomplete__suggestions"},"Loading..."))}},{key:"onSuggestionSelect",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;t&&t.stopPropagation();var n=this.props.onSelect;this.setState({activeSuggestion:null,hasSelected:!0,suggestions:[],value:e.description}),n(e)}},{key:"fetchSuggestionsCallback",value:function(e,t){this.state.placesServiceStatus;this.setState({hasSelected:!1,loading:!1,suggestions:e||[]})}},{key:"handleKeyDown",value:function(e){var t=this.state,n=t.activeSuggestion,o=t.suggestions;switch(e.key){case"Enter":e.preventDefault(),null!==n&&this.onSuggestionSelect(o[n]);break;case"ArrowDown":this.changeActiveSuggestion(1);break;case"ArrowUp":this.changeActiveSuggestion(-1);break;case"Escape":this.clearSuggestions()}}},{key:"handleOnBlur",value:function(e){if(!e.target.id.includes("google-places-autocomplete")){var t=this.state,n=t.hasSelected,o=t.value,r=this.props.onSelect;n||(this.clearSuggestions(),r({description:o}))}}},{key:"clearSuggestions",value:function(){this.setState({activeSuggestion:null,hasSelected:!1,suggestions:[]})}},{key:"changeActiveSuggestion",value:function(e){if(0!==this.state.suggestions.length)switch(e){case 1:this.setState(function(e){var t=e.activeSuggestion,n=e.suggestions;return null===t||t===n.length-1?{activeSuggestion:0}:{activeSuggestion:t+1}});break;case-1:this.setState(function(e){var t=e.activeSuggestion,n=e.suggestions;return t?{activeSuggestion:t-1}:{activeSuggestion:n.length-1}})}}},{key:"render",value:function(){var e=this.state.loading;return i.default.createElement("div",{className:"google-places-autocomplete"},this.renderInput(),e?this.renderLoader():this.renderSuggestions())}}]),t}();l.propTypes={debounce:u.default.number,initialValue:u.default.string,inputClassName:u.default.string,inputStyle:u.default.object,loader:u.default.node,onSelect:u.default.func,placeholder:u.default.string,renderInput:u.default.func,renderSuggestions:u.default.func,suggestionsClassNames:u.default.shape({container:u.default.string,suggestion:u.default.string,suggestionActive:u.default.string}),suggestionsStyles:u.default.shape({container:u.default.object,suggestion:u.default.object})},l.defaultProps={debounce:300,initialValue:"",inputClassName:"",inputStyle:{},loader:null,onSelect:function(){},placeholder:"Address",renderInput:void 0,renderSuggestions:void 0,suggestionsClassNames:{container:"",suggestion:"",suggestionActive:""},suggestionsStyles:{container:{},suggestion:{}}},t.default=l},function(e,t,n){"use strict";e.exports=n(3)},function(e,t,n){"use strict"; | ||
/** @license React v16.8.1 | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ReactGooglePlacesAutocomplete=t():e.ReactGooglePlacesAutocomplete=t()}(window,function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){e.exports=n(6)()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=n(2),i=(o=r)&&o.__esModule?o:{default:o};t.default=i.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=n(3),a=c(i),u=c(n(0)),s=c(n(8)),l=n(9);function c(e){return e&&e.__esModule?e:{default:e}}n(10);var f=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.fetchSuggestions=(0,s.default)(function(e){var t=n.props.autocompletionRequest,r=void 0;t.bounds&&(r=new(Function.prototype.bind.apply(google.maps.LatLngBounds,[null].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(t.bounds))))),n.setState({loading:!0}),n.placesService.getPlacePredictions(o({},t,{bounds:r,input:e}),n.fetchSuggestionsCallback)},n.props.debounce),n.state={activeSuggestion:null,hasSelected:!1,loading:!1,placesServiceStatus:null,suggestions:[],value:e.initialValue},n.changeActiveSuggestion=n.changeActiveSuggestion.bind(n),n.changeValue=n.changeValue.bind(n),n.clearSuggestions=n.clearSuggestions.bind(n),n.fetchSuggestionsCallback=n.fetchSuggestionsCallback.bind(n),n.handleClick=n.handleClick.bind(n),n.handleKeyDown=n.handleKeyDown.bind(n),n.initalizeService=n.initializeService.bind(n),n.onSuggestionSelect=n.onSuggestionSelect.bind(n),n.renderInput=n.renderInput.bind(n),n.renderSuggestions=n.renderSuggestions.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.Component),r(t,[{key:"componentDidMount",value:function(){this.initalizeService(),document.addEventListener("click",this.handleClick)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("click",this.handleClick)}},{key:"componentWillReceiveProps",value:function(e){e.initialValue&&this.setState({value:e.initialValue})}},{key:"handleClick",value:function(e){e.target.id.includes("google-places-autocomplete")||this.clearSuggestions()}},{key:"changeValue",value:function(e){this.setState({value:e}),e.length>0?this.fetchSuggestions(e):this.setState({suggestions:[]})}},{key:"initializeService",value:function(){var e=this;return window.google?window.google.maps.places?(this.placesService=new window.google.maps.places.AutocompleteService,window.coso=this.placesService,void this.setState({placesServiceStatus:window.google.maps.places.PlacesServiceStatus.OK})):(console.error("[react-google-places-autocomplete]: Google maps places script not loaded"),void setTimeout(function(){e.initializeService()},1e3)):(console.error("[react-google-places-autocomplete]: Google script not loaded"),void setTimeout(function(){e.initalizeService()},1e3))}},{key:"renderInput",value:function(){var e=this,t=this.state.value,n=this.props,o=n.inputClassName,r=n.inputStyle,i=n.placeholder,u=n.renderInput;return u?u({autoComplete:"off",id:"google-places-autocomplete-input",value:t,onChange:function(t){var n=t.target;return e.changeValue(n.value)},onKeyDown:this.handleKeyDown,type:"text",placeholder:i}):a.default.createElement("input",{autoComplete:"off",className:o||"google-places-autocomplete__input",id:"google-places-autocomplete-input",onChange:function(t){var n=t.target;return e.changeValue(n.value)},onKeyDown:this.handleKeyDown,placeholder:i,style:r,type:"text",value:t})}},{key:"renderSuggestions",value:function(){var e=this,t=this.state,n=t.activeSuggestion,o=t.suggestions,r=this.props,i=r.renderSuggestions,u=r.suggestionsClassNames,s=r.suggestionsStyles;return 0===o.length?null:i?i(n,o,this.onSuggestionsSelect):a.default.createElement("div",{id:"google-places-suggestions-container",className:u.container||"google-places-autocomplete__suggestions-container",style:s.container},o.map(function(t,o){return a.default.createElement("div",{id:"google-places-autocomplete-suggestion--"+o,key:t.id,className:(u.suggestion||"google-places-autocomplete__suggestion")+" "+(n===o?u.suggestionActive||"google-places-autocomplete__suggestion--active":""),style:s.suggestion,onClick:function(n){return e.onSuggestionSelect(t,n)},role:"presentation"},t.description)}))}},{key:"renderLoader",value:function(){var e=this.props.loader;return e||a.default.createElement("div",{className:"google-places-autocomplete__suggestions-container"},a.default.createElement("div",{className:"google-places-autcomplete__suggestions"},"Loading..."))}},{key:"onSuggestionSelect",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;t&&t.stopPropagation();var n=this.props.onSelect;this.setState({activeSuggestion:null,hasSelected:!0,suggestions:[],value:e.description}),n(e)}},{key:"fetchSuggestionsCallback",value:function(e,t){this.state.placesServiceStatus;this.setState({hasSelected:!1,loading:!1,suggestions:e||[]})}},{key:"handleKeyDown",value:function(e){var t=this.state,n=t.activeSuggestion,o=t.suggestions;switch(e.key){case"Enter":e.preventDefault(),null!==n&&this.onSuggestionSelect(o[n]);break;case"ArrowDown":this.changeActiveSuggestion(1);break;case"ArrowUp":this.changeActiveSuggestion(-1);break;case"Escape":this.clearSuggestions()}}},{key:"clearSuggestions",value:function(){this.setState({activeSuggestion:null,hasSelected:!1,suggestions:[]})}},{key:"changeActiveSuggestion",value:function(e){if(0!==this.state.suggestions.length)switch(e){case 1:this.setState(function(e){var t=e.activeSuggestion,n=e.suggestions;return null===t||t===n.length-1?{activeSuggestion:0}:{activeSuggestion:t+1}});break;case-1:this.setState(function(e){var t=e.activeSuggestion,n=e.suggestions;return t?{activeSuggestion:t-1}:{activeSuggestion:n.length-1}})}}},{key:"render",value:function(){var e=this.state.loading;return a.default.createElement("div",{className:"google-places-autocomplete"},this.renderInput(),e?this.renderLoader():this.renderSuggestions())}}]),t}();f.propTypes={autocompletionRequest:l.autocompletionRequestType,debounce:u.default.number,initialValue:u.default.string,inputClassName:u.default.string,inputStyle:u.default.object,loader:u.default.node,onSelect:u.default.func,placeholder:u.default.string,renderInput:u.default.func,renderSuggestions:u.default.func,suggestionsClassNames:l.suggestionClassNamesType,suggestionsStyles:l.suggestionStylesType},f.defaultProps={autocompletionRequest:{},debounce:300,initialValue:"",inputClassName:"",inputStyle:{},loader:null,onSelect:function(){},placeholder:"Address",renderInput:void 0,renderSuggestions:void 0,suggestionsClassNames:{container:"",suggestion:"",suggestionActive:""},suggestionsStyles:{container:{},suggestion:{}}},t.default=f},function(e,t,n){"use strict";e.exports=n(4)},function(e,t,n){"use strict"; | ||
/** @license React v16.7.0 | ||
* react.production.min.js | ||
@@ -9,3 +9,3 @@ * | ||
* LICENSE file in the root directory of this source tree. | ||
*/var o=n(4),r="function"==typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,u=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,l=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,f=r?Symbol.for("react.context"):60110,p=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,g=r?Symbol.for("react.suspense"):60113,v=r?Symbol.for("react.memo"):60115,h=r?Symbol.for("react.lazy"):60116,y="function"==typeof Symbol&&Symbol.iterator;function m(e){for(var t=arguments.length-1,n="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=0;o<t;o++)n+="&args[]="+encodeURIComponent(arguments[o+1]);!function(e,t,n,o,r,i,u,a){if(!e){if(e=void 0,void 0===t)e=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[n,o,r,i,u,a],l=0;(e=Error(t.replace(/%s/g,function(){return s[l++]}))).name="Invariant Violation"}throw e.framesToPop=1,e}}(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S={};function _(e,t,n){this.props=e,this.context=t,this.refs=S,this.updater=n||b}function w(){}function O(e,t,n){this.props=e,this.context=t,this.refs=S,this.updater=n||b}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&m("85"),this.updater.enqueueSetState(this,e,t,"setState")},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},w.prototype=_.prototype;var j=O.prototype=new w;j.constructor=O,o(j,_.prototype),j.isPureReactComponent=!0;var x={current:null},k={current:null},C=Object.prototype.hasOwnProperty,P={key:!0,ref:!0,__self:!0,__source:!0};function E(e,t,n){var o=void 0,r={},u=null,a=null;if(null!=t)for(o in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(u=""+t.key),t)C.call(t,o)&&!P.hasOwnProperty(o)&&(r[o]=t[o]);var s=arguments.length-2;if(1===s)r.children=n;else if(1<s){for(var l=Array(s),c=0;c<s;c++)l[c]=arguments[c+2];r.children=l}if(e&&e.defaultProps)for(o in s=e.defaultProps)void 0===r[o]&&(r[o]=s[o]);return{$$typeof:i,type:e,key:u,ref:a,props:r,_owner:k.current}}function R(e){return"object"==typeof e&&null!==e&&e.$$typeof===i}var A=/\/+/g,T=[];function U(e,t,n,o){if(T.length){var r=T.pop();return r.result=e,r.keyPrefix=t,r.func=n,r.context=o,r.count=0,r}return{result:e,keyPrefix:t,func:n,context:o,count:0}}function I(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>T.length&&T.push(e)}function L(e,t,n){return null==e?0:function e(t,n,o,r){var a=typeof t;"undefined"!==a&&"boolean"!==a||(t=null);var s=!1;if(null===t)s=!0;else switch(a){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case i:case u:s=!0}}if(s)return o(r,t,""===n?"."+M(t,0):n),1;if(s=0,n=""===n?".":n+":",Array.isArray(t))for(var l=0;l<t.length;l++){var c=n+M(a=t[l],l);s+=e(a,c,o,r)}else if(c=null===t||"object"!=typeof t?null:"function"==typeof(c=y&&t[y]||t["@@iterator"])?c:null,"function"==typeof c)for(t=c.call(t),l=0;!(a=t.next()).done;)s+=e(a=a.value,c=n+M(a,l++),o,r);else"object"===a&&m("31","[object Object]"==(o=""+t)?"object with keys {"+Object.keys(t).join(", ")+"}":o,"");return s}(e,"",t,n)}function M(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}(e.key):t.toString(36)}function $(e,t){e.func.call(e.context,t,e.count++)}function N(e,t,n){var o=e.result,r=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?B(e,o,n,function(e){return e}):null!=e&&(R(e)&&(e=function(e,t){return{$$typeof:i,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,r+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(A,"$&/")+"/")+n)),o.push(e))}function B(e,t,n,o,r){var i="";null!=n&&(i=(""+n).replace(A,"$&/")+"/"),L(e,N,t=U(t,i,o,r)),I(t)}function D(){var e=x.current;return null===e&&m("307"),e}var V={Children:{map:function(e,t,n){if(null==e)return e;var o=[];return B(e,o,null,t,n),o},forEach:function(e,t,n){if(null==e)return e;L(e,$,t=U(null,null,t,n)),I(t)},count:function(e){return L(e,function(){return null},null)},toArray:function(e){var t=[];return B(e,t,null,function(e){return e}),t},only:function(e){return R(e)||m("143"),e}},createRef:function(){return{current:null}},Component:_,PureComponent:O,createContext:function(e,t){return void 0===t&&(t=null),(e={$$typeof:f,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:c,_context:e},e.Consumer=e},forwardRef:function(e){return{$$typeof:d,render:e}},lazy:function(e){return{$$typeof:h,_ctor:e,_status:-1,_result:null}},memo:function(e,t){return{$$typeof:v,type:e,compare:void 0===t?null:t}},useCallback:function(e,t){return D().useCallback(e,t)},useContext:function(e,t){return D().useContext(e,t)},useEffect:function(e,t){return D().useEffect(e,t)},useImperativeHandle:function(e,t,n){return D().useImperativeHandle(e,t,n)},useDebugValue:function(){},useLayoutEffect:function(e,t){return D().useLayoutEffect(e,t)},useMemo:function(e,t){return D().useMemo(e,t)},useReducer:function(e,t,n){return D().useReducer(e,t,n)},useRef:function(e){return D().useRef(e)},useState:function(e){return D().useState(e)},Fragment:a,StrictMode:s,Suspense:g,createElement:E,cloneElement:function(e,t,n){null==e&&m("267",e);var r=void 0,u=o({},e.props),a=e.key,s=e.ref,l=e._owner;if(null!=t){void 0!==t.ref&&(s=t.ref,l=k.current),void 0!==t.key&&(a=""+t.key);var c=void 0;for(r in e.type&&e.type.defaultProps&&(c=e.type.defaultProps),t)C.call(t,r)&&!P.hasOwnProperty(r)&&(u[r]=void 0===t[r]&&void 0!==c?c[r]:t[r])}if(1===(r=arguments.length-2))u.children=n;else if(1<r){c=Array(r);for(var f=0;f<r;f++)c[f]=arguments[f+2];u.children=c}return{$$typeof:i,type:e.type,key:a,ref:s,props:u,_owner:l}},createFactory:function(e){var t=E.bind(null,e);return t.type=e,t},isValidElement:R,version:"16.8.1",unstable_ConcurrentMode:p,unstable_Profiler:l,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentDispatcher:x,ReactCurrentOwner:k,assign:o}},q={default:V},z=q&&V||q;e.exports=z.default||z},function(e,t,n){"use strict"; | ||
*/var o=n(5),r="function"==typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,a=r?Symbol.for("react.portal"):60106,u=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,l=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,f=r?Symbol.for("react.context"):60110,p=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,g=r?Symbol.for("react.suspense"):60113,y=r?Symbol.for("react.memo"):60115,v=r?Symbol.for("react.lazy"):60116,h="function"==typeof Symbol&&Symbol.iterator;function m(e){for(var t=arguments.length-1,n="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=0;o<t;o++)n+="&args[]="+encodeURIComponent(arguments[o+1]);!function(e,t,n,o,r,i,a,u){if(!e){if(e=void 0,void 0===t)e=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[n,o,r,i,a,u],l=0;(e=Error(t.replace(/%s/g,function(){return s[l++]}))).name="Invariant Violation"}throw e.framesToPop=1,e}}(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S={};function w(e,t,n){this.props=e,this.context=t,this.refs=S,this.updater=n||b}function _(){}function O(e,t,n){this.props=e,this.context=t,this.refs=S,this.updater=n||b}w.prototype.isReactComponent={},w.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&m("85"),this.updater.enqueueSetState(this,e,t,"setState")},w.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},_.prototype=w.prototype;var j=O.prototype=new _;j.constructor=O,o(j,w.prototype),j.isPureReactComponent=!0;var k={current:null,currentDispatcher:null},x=Object.prototype.hasOwnProperty,C={key:!0,ref:!0,__self:!0,__source:!0};function P(e,t,n){var o=void 0,r={},a=null,u=null;if(null!=t)for(o in void 0!==t.ref&&(u=t.ref),void 0!==t.key&&(a=""+t.key),t)x.call(t,o)&&!C.hasOwnProperty(o)&&(r[o]=t[o]);var s=arguments.length-2;if(1===s)r.children=n;else if(1<s){for(var l=Array(s),c=0;c<s;c++)l[c]=arguments[c+2];r.children=l}if(e&&e.defaultProps)for(o in s=e.defaultProps)void 0===r[o]&&(r[o]=s[o]);return{$$typeof:i,type:e,key:a,ref:u,props:r,_owner:k.current}}function E(e){return"object"==typeof e&&null!==e&&e.$$typeof===i}var R=/\/+/g,T=[];function A(e,t,n,o){if(T.length){var r=T.pop();return r.result=e,r.keyPrefix=t,r.func=n,r.context=o,r.count=0,r}return{result:e,keyPrefix:t,func:n,context:o,count:0}}function U(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>T.length&&T.push(e)}function N(e,t,n){return null==e?0:function e(t,n,o,r){var u=typeof t;"undefined"!==u&&"boolean"!==u||(t=null);var s=!1;if(null===t)s=!0;else switch(u){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case i:case a:s=!0}}if(s)return o(r,t,""===n?"."+I(t,0):n),1;if(s=0,n=""===n?".":n+":",Array.isArray(t))for(var l=0;l<t.length;l++){var c=n+I(u=t[l],l);s+=e(u,c,o,r)}else if(c=null===t||"object"!=typeof t?null:"function"==typeof(c=h&&t[h]||t["@@iterator"])?c:null,"function"==typeof c)for(t=c.call(t),l=0;!(u=t.next()).done;)s+=e(u=u.value,c=n+I(u,l++),o,r);else"object"===u&&m("31","[object Object]"==(o=""+t)?"object with keys {"+Object.keys(t).join(", ")+"}":o,"");return s}(e,"",t,n)}function I(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}(e.key):t.toString(36)}function L(e,t){e.func.call(e.context,t,e.count++)}function M(e,t,n){var o=e.result,r=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?$(e,o,n,function(e){return e}):null!=e&&(E(e)&&(e=function(e,t){return{$$typeof:i,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,r+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(R,"$&/")+"/")+n)),o.push(e))}function $(e,t,n,o,r){var i="";null!=n&&(i=(""+n).replace(R,"$&/")+"/"),N(e,M,t=A(t,i,o,r)),U(t)}var D={Children:{map:function(e,t,n){if(null==e)return e;var o=[];return $(e,o,null,t,n),o},forEach:function(e,t,n){if(null==e)return e;N(e,L,t=A(null,null,t,n)),U(t)},count:function(e){return N(e,function(){return null},null)},toArray:function(e){var t=[];return $(e,t,null,function(e){return e}),t},only:function(e){return E(e)||m("143"),e}},createRef:function(){return{current:null}},Component:w,PureComponent:O,createContext:function(e,t){return void 0===t&&(t=null),(e={$$typeof:f,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:c,_context:e},e.Consumer=e},forwardRef:function(e){return{$$typeof:d,render:e}},lazy:function(e){return{$$typeof:v,_ctor:e,_status:-1,_result:null}},memo:function(e,t){return{$$typeof:y,type:e,compare:void 0===t?null:t}},Fragment:u,StrictMode:s,Suspense:g,createElement:P,cloneElement:function(e,t,n){null==e&&m("267",e);var r=void 0,a=o({},e.props),u=e.key,s=e.ref,l=e._owner;if(null!=t){void 0!==t.ref&&(s=t.ref,l=k.current),void 0!==t.key&&(u=""+t.key);var c=void 0;for(r in e.type&&e.type.defaultProps&&(c=e.type.defaultProps),t)x.call(t,r)&&!C.hasOwnProperty(r)&&(a[r]=void 0===t[r]&&void 0!==c?c[r]:t[r])}if(1===(r=arguments.length-2))a.children=n;else if(1<r){c=Array(r);for(var f=0;f<r;f++)c[f]=arguments[f+2];a.children=c}return{$$typeof:i,type:e.type,key:u,ref:s,props:a,_owner:l}},createFactory:function(e){var t=P.bind(null,e);return t.type=e,t},isValidElement:E,version:"16.7.0",unstable_ConcurrentMode:p,unstable_Profiler:l,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:k,assign:o}},q={default:D},V=q&&D||q;e.exports=V.default||V},function(e,t,n){"use strict"; | ||
/* | ||
@@ -15,3 +15,3 @@ object-assign | ||
@license MIT | ||
*/var o=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,u,a=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),s=1;s<arguments.length;s++){for(var l in n=Object(arguments[s]))r.call(n,l)&&(a[l]=n[l]);if(o){u=o(n);for(var c=0;c<u.length;c++)i.call(n,u[c])&&(a[u[c]]=n[u[c]])}}return a}},function(e,t,n){e.exports=n(6)()},function(e,t,n){"use strict";var o=n(7);function r(){}e.exports=function(){function e(e,t,n,r,i,u){if(u!==o){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.debounce=function(e,t){var n=void 0,o=void 0;return function(){var r=this,i=arguments;return clearTimeout(n),!(n=setTimeout(function(){n=null,o=e.apply(r,i)},t))&&(o=e.apply(r,i)),o}}},function(e,t,n){var o=n(10);"string"==typeof o&&(o=[[e.i,o,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(12)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){(e.exports=n(11)(!1)).push([e.i,".google-places-autocomplete {\n width: 100%;\n position: relative;\n}\n\n.google-places-autocomplete__input {\n width: calc(100% - 20px);\n padding: 10px;\n border: none;\n margin-bottom: 2px;\n box-shadow: 0 1px 16px 0 rgba(0, 0, 0, 0.09);\n}\n\n.google-places-autocomplete__input:active,\n.google-places-autocomplete__input:focus,\n.google-places-autocomplete__input:hover {\n outline: none;\n border: none;\n}\n\n.google-places-autocomplete__suggestions-container {\n background: white;\n border-radius: 0 0 5px 5px;\n color: black;\n position: absolute;\n width: 100%;\n z-index: 2;\n box-shadow: 0 1px 16px 0 rgba(0, 0, 0, 0.09);\n}\n\n.google-places-autocomplete__suggestion {\n font-size: 1rem;\n text-align: left;\n padding: 10px;\n}\n\n.google-places-autocomplete__suggestion--active {\n background: #e0e3e7;\n}\n",""])},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=function(e,t){var n=e[1]||"",o=e[3];if(!o)return n;if(t&&"function"==typeof btoa){var r=(u=o,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(u))))+" */"),i=o.sources.map(function(e){return"/*# sourceURL="+o.sourceRoot+e+" */"});return[n].concat(i).concat([r]).join("\n")}var u;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var o={},r=0;r<this.length;r++){var i=this[r][0];null!=i&&(o[i]=!0)}for(r=0;r<e.length;r++){var u=e[r];null!=u[0]&&o[u[0]]||(n&&!u[2]?u[2]=n:n&&(u[2]="("+u[2]+") and ("+n+")"),t.push(u))}},t}},function(e,t,n){var o,r,i={},u=(o=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===r&&(r=o.apply(this,arguments)),r}),a=function(e){var t={};return function(e,n){if("function"==typeof e)return e();if(void 0===t[e]){var o=function(e,t){return t?t.querySelector(e):document.querySelector(e)}.call(this,e,n);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(e){o=null}t[e]=o}return t[e]}}(),s=null,l=0,c=[],f=n(13);function p(e,t){for(var n=0;n<e.length;n++){var o=e[n],r=i[o.id];if(r){r.refs++;for(var u=0;u<r.parts.length;u++)r.parts[u](o.parts[u]);for(;u<o.parts.length;u++)r.parts.push(m(o.parts[u],t))}else{var a=[];for(u=0;u<o.parts.length;u++)a.push(m(o.parts[u],t));i[o.id]={id:o.id,refs:1,parts:a}}}}function d(e,t){for(var n=[],o={},r=0;r<e.length;r++){var i=e[r],u=t.base?i[0]+t.base:i[0],a={css:i[1],media:i[2],sourceMap:i[3]};o[u]?o[u].parts.push(a):n.push(o[u]={id:u,parts:[a]})}return n}function g(e,t){var n=a(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var o=c[c.length-1];if("top"===e.insertAt)o?o.nextSibling?n.insertBefore(t,o.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),c.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var r=a(e.insertAt.before,n);n.insertBefore(t,r)}}function v(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=c.indexOf(e);t>=0&&c.splice(t,1)}function h(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var o=function(){0;return n.nc}();o&&(e.attrs.nonce=o)}return y(t,e.attrs),g(e,t),t}function y(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function m(e,t){var n,o,r,i;if(t.transform&&e.css){if(!(i="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=i}if(t.singleton){var u=l++;n=s||(s=h(t)),o=_.bind(null,n,u,!1),r=_.bind(null,n,u,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",y(t,e.attrs),g(e,t),t}(t),o=function(e,t,n){var o=n.css,r=n.sourceMap,i=void 0===t.convertToAbsoluteUrls&&r;(t.convertToAbsoluteUrls||i)&&(o=f(o));r&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var u=new Blob([o],{type:"text/css"}),a=e.href;e.href=URL.createObjectURL(u),a&&URL.revokeObjectURL(a)}.bind(null,n,t),r=function(){v(n),n.href&&URL.revokeObjectURL(n.href)}):(n=h(t),o=function(e,t){var n=t.css,o=t.media;o&&e.setAttribute("media",o);if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),r=function(){v(n)});return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else r()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=u()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=d(e,t);return p(n,t),function(e){for(var o=[],r=0;r<n.length;r++){var u=n[r];(a=i[u.id]).refs--,o.push(a)}e&&p(d(e,t),t);for(r=0;r<o.length;r++){var a;if(0===(a=o[r]).refs){for(var s=0;s<a.parts.length;s++)a.parts[s]();delete i[a.id]}}}};var b,S=(b=[],function(e,t){return b[e]=t,b.filter(Boolean).join("\n")});function _(e,t,n,o){var r=n?"":o.css;if(e.styleSheet)e.styleSheet.cssText=S(t,r);else{var i=document.createTextNode(r),u=e.childNodes;u[t]&&e.removeChild(u[t]),u.length?e.insertBefore(i,u[t]):e.appendChild(i)}}},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,o=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var r,i=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?e:(r=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:o+i.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")})}}])}); | ||
*/var o=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,u=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),s=1;s<arguments.length;s++){for(var l in n=Object(arguments[s]))r.call(n,l)&&(u[l]=n[l]);if(o){a=o(n);for(var c=0;c<a.length;c++)i.call(n,a[c])&&(u[a[c]]=n[a[c]])}}return u}},function(e,t,n){"use strict";var o=n(7);function r(){}e.exports=function(){function e(e,t,n,r,i,a){if(a!==o){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e,t){var n=void 0,o=void 0;return function(){var r=this,i=arguments;return clearTimeout(n),!(n=setTimeout(function(){n=null,o=e.apply(r,i)},t))&&(o=e.apply(r,i)),o}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.suggestionStylesType=t.suggestionClassNamesType=t.autocompletionRequestType=void 0;var o,r=n(0),i=(o=r)&&o.__esModule?o:{default:o};var a=i.default.shape({country:i.default.oneOfType([i.default.string,i.default.arrayOf(i.default.string)])}),u=i.default.shape({lat:i.default.number,lng:i.default.number});t.autocompletionRequestType=i.default.shape({bounds:function(e,t,n){var o=e[t];return Array.isArray(o)&&2===o.length&&o.every(function(e){return 2===Object.keys(e).length&&e.hasOwnProperty("lat")&&e.hasOwnProperty("lng")&&Number.isInteger(e.lat)&&Number.isInteger(e.lng)})?null:new Error("Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},componentRestrictions:a,location:u,offset:i.default.number,radius:i.default.number,types:i.default.arrayOf(i.default.string)}),t.suggestionClassNamesType=i.default.shape({container:i.default.string,suggestion:i.default.string,suggestionActive:i.default.string}),t.suggestionStylesType=i.default.shape({container:i.default.object,suggestion:i.default.object})},function(e,t,n){var o=n(11);"string"==typeof o&&(o=[[e.i,o,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(13)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){(e.exports=n(12)(!1)).push([e.i,".google-places-autocomplete {\n width: 100%;\n position: relative;\n}\n\n.google-places-autocomplete__input {\n width: calc(100% - 20px);\n padding: 10px;\n border: none;\n margin-bottom: 2px;\n box-shadow: 0 1px 16px 0 rgba(0, 0, 0, 0.09);\n}\n\n.google-places-autocomplete__input:active,\n.google-places-autocomplete__input:focus,\n.google-places-autocomplete__input:hover {\n outline: none;\n border: none;\n}\n\n.google-places-autocomplete__suggestions-container {\n background: white;\n border-radius: 0 0 5px 5px;\n color: black;\n position: absolute;\n width: 100%;\n z-index: 2;\n box-shadow: 0 1px 16px 0 rgba(0, 0, 0, 0.09);\n}\n\n.google-places-autocomplete__suggestion {\n font-size: 1rem;\n text-align: left;\n padding: 10px;\n}\n\n.google-places-autocomplete__suggestion--active {\n background: #e0e3e7;\n}\n",""])},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=function(e,t){var n=e[1]||"",o=e[3];if(!o)return n;if(t&&"function"==typeof btoa){var r=(a=o,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),i=o.sources.map(function(e){return"/*# sourceURL="+o.sourceRoot+e+" */"});return[n].concat(i).concat([r]).join("\n")}var a;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var o={},r=0;r<this.length;r++){var i=this[r][0];null!=i&&(o[i]=!0)}for(r=0;r<e.length;r++){var a=e[r];null!=a[0]&&o[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(e,t,n){var o,r,i={},a=(o=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===r&&(r=o.apply(this,arguments)),r}),u=function(e){var t={};return function(e,n){if("function"==typeof e)return e();if(void 0===t[e]){var o=function(e,t){return t?t.querySelector(e):document.querySelector(e)}.call(this,e,n);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(e){o=null}t[e]=o}return t[e]}}(),s=null,l=0,c=[],f=n(14);function p(e,t){for(var n=0;n<e.length;n++){var o=e[n],r=i[o.id];if(r){r.refs++;for(var a=0;a<r.parts.length;a++)r.parts[a](o.parts[a]);for(;a<o.parts.length;a++)r.parts.push(m(o.parts[a],t))}else{var u=[];for(a=0;a<o.parts.length;a++)u.push(m(o.parts[a],t));i[o.id]={id:o.id,refs:1,parts:u}}}}function d(e,t){for(var n=[],o={},r=0;r<e.length;r++){var i=e[r],a=t.base?i[0]+t.base:i[0],u={css:i[1],media:i[2],sourceMap:i[3]};o[a]?o[a].parts.push(u):n.push(o[a]={id:a,parts:[u]})}return n}function g(e,t){var n=u(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var o=c[c.length-1];if("top"===e.insertAt)o?o.nextSibling?n.insertBefore(t,o.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),c.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var r=u(e.insertAt.before,n);n.insertBefore(t,r)}}function y(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=c.indexOf(e);t>=0&&c.splice(t,1)}function v(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var o=function(){0;return n.nc}();o&&(e.attrs.nonce=o)}return h(t,e.attrs),g(e,t),t}function h(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function m(e,t){var n,o,r,i;if(t.transform&&e.css){if(!(i="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=i}if(t.singleton){var a=l++;n=s||(s=v(t)),o=w.bind(null,n,a,!1),r=w.bind(null,n,a,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",h(t,e.attrs),g(e,t),t}(t),o=function(e,t,n){var o=n.css,r=n.sourceMap,i=void 0===t.convertToAbsoluteUrls&&r;(t.convertToAbsoluteUrls||i)&&(o=f(o));r&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var a=new Blob([o],{type:"text/css"}),u=e.href;e.href=URL.createObjectURL(a),u&&URL.revokeObjectURL(u)}.bind(null,n,t),r=function(){y(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(t),o=function(e,t){var n=t.css,o=t.media;o&&e.setAttribute("media",o);if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),r=function(){y(n)});return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else r()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=a()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=d(e,t);return p(n,t),function(e){for(var o=[],r=0;r<n.length;r++){var a=n[r];(u=i[a.id]).refs--,o.push(u)}e&&p(d(e,t),t);for(r=0;r<o.length;r++){var u;if(0===(u=o[r]).refs){for(var s=0;s<u.parts.length;s++)u.parts[s]();delete i[u.id]}}}};var b,S=(b=[],function(e,t){return b[e]=t,b.filter(Boolean).join("\n")});function w(e,t,n,o){var r=n?"":o.css;if(e.styleSheet)e.styleSheet.cssText=S(t,r);else{var i=document.createTextNode(r),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,o=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var r,i=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?e:(r=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:o+i.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")})}}])}); | ||
//# sourceMappingURL=index.umd.js.map |
@@ -1,3 +0,3 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ReactGooglePlacesAutocomplete=t():e.ReactGooglePlacesAutocomplete=t()}(window,function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=n(1),i=(o=r)&&o.__esModule?o:{default:o};t.default=i.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=n(2),i=s(r),u=s(n(5)),a=n(8);function s(e){return e&&e.__esModule?e:{default:e}}n(9);var l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.fetchSuggestions=(0,a.debounce)(function(e){n.setState({loading:!0}),n.placesService.getPlacePredictions({input:e},n.fetchSuggestionsCallback)},n.props.debounce),n.state={activeSuggestion:null,hasSelected:!1,loading:!1,placesServiceStatus:null,suggestions:[],value:e.initialValue},n.changeValue=n.changeValue.bind(n),n.changeActiveSuggestion=n.changeActiveSuggestion.bind(n),n.clearSuggestions=n.clearSuggestions.bind(n),n.fetchSuggestionsCallback=n.fetchSuggestionsCallback.bind(n),n.handleKeyDown=n.handleKeyDown.bind(n),n.handleOnBlur=n.handleOnBlur.bind(n),n.initalizeService=n.initializeService.bind(n),n.onSuggestionSelect=n.onSuggestionSelect.bind(n),n.renderInput=n.renderInput.bind(n),n.renderSuggestions=n.renderSuggestions.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.Component),o(t,[{key:"componentDidMount",value:function(){this.initalizeService()}},{key:"componentWillReceiveProps",value:function(e){e.initialValue&&this.setState({value:e.initialValue})}},{key:"changeValue",value:function(e){this.setState({value:e}),e.length>0?this.fetchSuggestions(e):this.setState({suggestions:[]})}},{key:"initializeService",value:function(){var e=this;return window.google?window.google.maps.places?(this.placesService=new window.google.maps.places.AutocompleteService,void this.setState({placesServiceStatus:window.google.maps.places.PlacesServiceStatus.OK})):(console.error("[react-google-places-autocomplete]: Google maps places script not loaded"),void setTimeout(function(){e.initializeService()},1e3)):(console.error("[react-google-places-autocomplete]: Google script not loaded"),void setTimeout(function(){e.initalizeService()},1e3))}},{key:"renderInput",value:function(){var e=this,t=this.state.value,n=this.props,o=n.inputClassName,r=n.inputStyle,u=n.placeholder,a=n.renderInput;return a?a({autoComplete:"off",id:"google-places-autcomplete-input",value:t,onBlur:this.handleOnBlur,onChange:function(t){var n=t.target;return e.changeValue(n.value)},onKeyDown:this.handleKeyDown,type:"text",placeholder:u}):i.default.createElement("input",{autoComplete:"off",className:o||"google-places-autocomplete__input",id:"google-places-autocomplete-input",onBlur:this.handleOnBlur,onChange:function(t){var n=t.target;return e.changeValue(n.value)},onKeyDown:this.handleKeyDown,placeholder:u,style:r,type:"text",value:t})}},{key:"renderSuggestions",value:function(){var e=this,t=this.state,n=t.activeSuggestion,o=t.suggestions,r=this.props,u=r.renderSuggestions,a=r.suggestionsClassNames,s=r.suggestionsStyles;return 0===o.length?null:u?u(n,o,this.onSuggestionsSelect):i.default.createElement("div",{id:"google-places-suggestions-container",className:a.container||"google-places-autocomplete__suggestions-container",style:s.container},o.map(function(t,o){return i.default.createElement("div",{id:"google-places-autocomplete-suggestion--"+o,key:t.id,className:(a.suggestion||"google-places-autocomplete__suggestion")+" "+(n===o?a.suggestionActive||"google-places-autocomplete__suggestion--active":""),style:s.suggestion,onClick:function(n){return e.onSuggestionSelect(t,n)},role:"presentation"},t.description)}))}},{key:"renderLoader",value:function(){var e=this.props.loader;return e||i.default.createElement("div",{className:"google-places-autocomplete__suggestions-container"},i.default.createElement("div",{className:"google-places-autcomplete__suggestions"},"Loading..."))}},{key:"onSuggestionSelect",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;t&&t.stopPropagation();var n=this.props.onSelect;this.setState({activeSuggestion:null,hasSelected:!0,suggestions:[],value:e.description}),n(e)}},{key:"fetchSuggestionsCallback",value:function(e,t){this.state.placesServiceStatus;this.setState({hasSelected:!1,loading:!1,suggestions:e||[]})}},{key:"handleKeyDown",value:function(e){var t=this.state,n=t.activeSuggestion,o=t.suggestions;switch(e.key){case"Enter":e.preventDefault(),null!==n&&this.onSuggestionSelect(o[n]);break;case"ArrowDown":this.changeActiveSuggestion(1);break;case"ArrowUp":this.changeActiveSuggestion(-1);break;case"Escape":this.clearSuggestions()}}},{key:"handleOnBlur",value:function(e){if(!e.target.id.includes("google-places-autocomplete")){var t=this.state,n=t.hasSelected,o=t.value,r=this.props.onSelect;n||(this.clearSuggestions(),r({description:o}))}}},{key:"clearSuggestions",value:function(){this.setState({activeSuggestion:null,hasSelected:!1,suggestions:[]})}},{key:"changeActiveSuggestion",value:function(e){if(0!==this.state.suggestions.length)switch(e){case 1:this.setState(function(e){var t=e.activeSuggestion,n=e.suggestions;return null===t||t===n.length-1?{activeSuggestion:0}:{activeSuggestion:t+1}});break;case-1:this.setState(function(e){var t=e.activeSuggestion,n=e.suggestions;return t?{activeSuggestion:t-1}:{activeSuggestion:n.length-1}})}}},{key:"render",value:function(){var e=this.state.loading;return i.default.createElement("div",{className:"google-places-autocomplete"},this.renderInput(),e?this.renderLoader():this.renderSuggestions())}}]),t}();l.propTypes={debounce:u.default.number,initialValue:u.default.string,inputClassName:u.default.string,inputStyle:u.default.object,loader:u.default.node,onSelect:u.default.func,placeholder:u.default.string,renderInput:u.default.func,renderSuggestions:u.default.func,suggestionsClassNames:u.default.shape({container:u.default.string,suggestion:u.default.string,suggestionActive:u.default.string}),suggestionsStyles:u.default.shape({container:u.default.object,suggestion:u.default.object})},l.defaultProps={debounce:300,initialValue:"",inputClassName:"",inputStyle:{},loader:null,onSelect:function(){},placeholder:"Address",renderInput:void 0,renderSuggestions:void 0,suggestionsClassNames:{container:"",suggestion:"",suggestionActive:""},suggestionsStyles:{container:{},suggestion:{}}},t.default=l},function(e,t,n){"use strict";e.exports=n(3)},function(e,t,n){"use strict"; | ||
/** @license React v16.8.1 | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ReactGooglePlacesAutocomplete=t():e.ReactGooglePlacesAutocomplete=t()}(window,function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){e.exports=n(6)()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=n(2),i=(o=r)&&o.__esModule?o:{default:o};t.default=i.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=n(3),a=c(i),u=c(n(0)),s=c(n(8)),l=n(9);function c(e){return e&&e.__esModule?e:{default:e}}n(10);var f=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.fetchSuggestions=(0,s.default)(function(e){var t=n.props.autocompletionRequest,r=void 0;t.bounds&&(r=new(Function.prototype.bind.apply(google.maps.LatLngBounds,[null].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(t.bounds))))),n.setState({loading:!0}),n.placesService.getPlacePredictions(o({},t,{bounds:r,input:e}),n.fetchSuggestionsCallback)},n.props.debounce),n.state={activeSuggestion:null,hasSelected:!1,loading:!1,placesServiceStatus:null,suggestions:[],value:e.initialValue},n.changeActiveSuggestion=n.changeActiveSuggestion.bind(n),n.changeValue=n.changeValue.bind(n),n.clearSuggestions=n.clearSuggestions.bind(n),n.fetchSuggestionsCallback=n.fetchSuggestionsCallback.bind(n),n.handleClick=n.handleClick.bind(n),n.handleKeyDown=n.handleKeyDown.bind(n),n.initalizeService=n.initializeService.bind(n),n.onSuggestionSelect=n.onSuggestionSelect.bind(n),n.renderInput=n.renderInput.bind(n),n.renderSuggestions=n.renderSuggestions.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.Component),r(t,[{key:"componentDidMount",value:function(){this.initalizeService(),document.addEventListener("click",this.handleClick)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("click",this.handleClick)}},{key:"componentWillReceiveProps",value:function(e){e.initialValue&&this.setState({value:e.initialValue})}},{key:"handleClick",value:function(e){e.target.id.includes("google-places-autocomplete")||this.clearSuggestions()}},{key:"changeValue",value:function(e){this.setState({value:e}),e.length>0?this.fetchSuggestions(e):this.setState({suggestions:[]})}},{key:"initializeService",value:function(){var e=this;return window.google?window.google.maps.places?(this.placesService=new window.google.maps.places.AutocompleteService,window.coso=this.placesService,void this.setState({placesServiceStatus:window.google.maps.places.PlacesServiceStatus.OK})):(console.error("[react-google-places-autocomplete]: Google maps places script not loaded"),void setTimeout(function(){e.initializeService()},1e3)):(console.error("[react-google-places-autocomplete]: Google script not loaded"),void setTimeout(function(){e.initalizeService()},1e3))}},{key:"renderInput",value:function(){var e=this,t=this.state.value,n=this.props,o=n.inputClassName,r=n.inputStyle,i=n.placeholder,u=n.renderInput;return u?u({autoComplete:"off",id:"google-places-autocomplete-input",value:t,onChange:function(t){var n=t.target;return e.changeValue(n.value)},onKeyDown:this.handleKeyDown,type:"text",placeholder:i}):a.default.createElement("input",{autoComplete:"off",className:o||"google-places-autocomplete__input",id:"google-places-autocomplete-input",onChange:function(t){var n=t.target;return e.changeValue(n.value)},onKeyDown:this.handleKeyDown,placeholder:i,style:r,type:"text",value:t})}},{key:"renderSuggestions",value:function(){var e=this,t=this.state,n=t.activeSuggestion,o=t.suggestions,r=this.props,i=r.renderSuggestions,u=r.suggestionsClassNames,s=r.suggestionsStyles;return 0===o.length?null:i?i(n,o,this.onSuggestionsSelect):a.default.createElement("div",{id:"google-places-suggestions-container",className:u.container||"google-places-autocomplete__suggestions-container",style:s.container},o.map(function(t,o){return a.default.createElement("div",{id:"google-places-autocomplete-suggestion--"+o,key:t.id,className:(u.suggestion||"google-places-autocomplete__suggestion")+" "+(n===o?u.suggestionActive||"google-places-autocomplete__suggestion--active":""),style:s.suggestion,onClick:function(n){return e.onSuggestionSelect(t,n)},role:"presentation"},t.description)}))}},{key:"renderLoader",value:function(){var e=this.props.loader;return e||a.default.createElement("div",{className:"google-places-autocomplete__suggestions-container"},a.default.createElement("div",{className:"google-places-autcomplete__suggestions"},"Loading..."))}},{key:"onSuggestionSelect",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;t&&t.stopPropagation();var n=this.props.onSelect;this.setState({activeSuggestion:null,hasSelected:!0,suggestions:[],value:e.description}),n(e)}},{key:"fetchSuggestionsCallback",value:function(e,t){this.state.placesServiceStatus;this.setState({hasSelected:!1,loading:!1,suggestions:e||[]})}},{key:"handleKeyDown",value:function(e){var t=this.state,n=t.activeSuggestion,o=t.suggestions;switch(e.key){case"Enter":e.preventDefault(),null!==n&&this.onSuggestionSelect(o[n]);break;case"ArrowDown":this.changeActiveSuggestion(1);break;case"ArrowUp":this.changeActiveSuggestion(-1);break;case"Escape":this.clearSuggestions()}}},{key:"clearSuggestions",value:function(){this.setState({activeSuggestion:null,hasSelected:!1,suggestions:[]})}},{key:"changeActiveSuggestion",value:function(e){if(0!==this.state.suggestions.length)switch(e){case 1:this.setState(function(e){var t=e.activeSuggestion,n=e.suggestions;return null===t||t===n.length-1?{activeSuggestion:0}:{activeSuggestion:t+1}});break;case-1:this.setState(function(e){var t=e.activeSuggestion,n=e.suggestions;return t?{activeSuggestion:t-1}:{activeSuggestion:n.length-1}})}}},{key:"render",value:function(){var e=this.state.loading;return a.default.createElement("div",{className:"google-places-autocomplete"},this.renderInput(),e?this.renderLoader():this.renderSuggestions())}}]),t}();f.propTypes={autocompletionRequest:l.autocompletionRequestType,debounce:u.default.number,initialValue:u.default.string,inputClassName:u.default.string,inputStyle:u.default.object,loader:u.default.node,onSelect:u.default.func,placeholder:u.default.string,renderInput:u.default.func,renderSuggestions:u.default.func,suggestionsClassNames:l.suggestionClassNamesType,suggestionsStyles:l.suggestionStylesType},f.defaultProps={autocompletionRequest:{},debounce:300,initialValue:"",inputClassName:"",inputStyle:{},loader:null,onSelect:function(){},placeholder:"Address",renderInput:void 0,renderSuggestions:void 0,suggestionsClassNames:{container:"",suggestion:"",suggestionActive:""},suggestionsStyles:{container:{},suggestion:{}}},t.default=f},function(e,t,n){"use strict";e.exports=n(4)},function(e,t,n){"use strict"; | ||
/** @license React v16.7.0 | ||
* react.production.min.js | ||
@@ -9,3 +9,3 @@ * | ||
* LICENSE file in the root directory of this source tree. | ||
*/var o=n(4),r="function"==typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,u=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,l=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,f=r?Symbol.for("react.context"):60110,p=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,g=r?Symbol.for("react.suspense"):60113,v=r?Symbol.for("react.memo"):60115,h=r?Symbol.for("react.lazy"):60116,y="function"==typeof Symbol&&Symbol.iterator;function m(e){for(var t=arguments.length-1,n="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=0;o<t;o++)n+="&args[]="+encodeURIComponent(arguments[o+1]);!function(e,t,n,o,r,i,u,a){if(!e){if(e=void 0,void 0===t)e=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[n,o,r,i,u,a],l=0;(e=Error(t.replace(/%s/g,function(){return s[l++]}))).name="Invariant Violation"}throw e.framesToPop=1,e}}(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S={};function _(e,t,n){this.props=e,this.context=t,this.refs=S,this.updater=n||b}function w(){}function O(e,t,n){this.props=e,this.context=t,this.refs=S,this.updater=n||b}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&m("85"),this.updater.enqueueSetState(this,e,t,"setState")},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},w.prototype=_.prototype;var j=O.prototype=new w;j.constructor=O,o(j,_.prototype),j.isPureReactComponent=!0;var x={current:null},k={current:null},C=Object.prototype.hasOwnProperty,P={key:!0,ref:!0,__self:!0,__source:!0};function E(e,t,n){var o=void 0,r={},u=null,a=null;if(null!=t)for(o in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(u=""+t.key),t)C.call(t,o)&&!P.hasOwnProperty(o)&&(r[o]=t[o]);var s=arguments.length-2;if(1===s)r.children=n;else if(1<s){for(var l=Array(s),c=0;c<s;c++)l[c]=arguments[c+2];r.children=l}if(e&&e.defaultProps)for(o in s=e.defaultProps)void 0===r[o]&&(r[o]=s[o]);return{$$typeof:i,type:e,key:u,ref:a,props:r,_owner:k.current}}function R(e){return"object"==typeof e&&null!==e&&e.$$typeof===i}var A=/\/+/g,T=[];function U(e,t,n,o){if(T.length){var r=T.pop();return r.result=e,r.keyPrefix=t,r.func=n,r.context=o,r.count=0,r}return{result:e,keyPrefix:t,func:n,context:o,count:0}}function I(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>T.length&&T.push(e)}function L(e,t,n){return null==e?0:function e(t,n,o,r){var a=typeof t;"undefined"!==a&&"boolean"!==a||(t=null);var s=!1;if(null===t)s=!0;else switch(a){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case i:case u:s=!0}}if(s)return o(r,t,""===n?"."+M(t,0):n),1;if(s=0,n=""===n?".":n+":",Array.isArray(t))for(var l=0;l<t.length;l++){var c=n+M(a=t[l],l);s+=e(a,c,o,r)}else if(c=null===t||"object"!=typeof t?null:"function"==typeof(c=y&&t[y]||t["@@iterator"])?c:null,"function"==typeof c)for(t=c.call(t),l=0;!(a=t.next()).done;)s+=e(a=a.value,c=n+M(a,l++),o,r);else"object"===a&&m("31","[object Object]"==(o=""+t)?"object with keys {"+Object.keys(t).join(", ")+"}":o,"");return s}(e,"",t,n)}function M(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}(e.key):t.toString(36)}function $(e,t){e.func.call(e.context,t,e.count++)}function N(e,t,n){var o=e.result,r=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?B(e,o,n,function(e){return e}):null!=e&&(R(e)&&(e=function(e,t){return{$$typeof:i,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,r+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(A,"$&/")+"/")+n)),o.push(e))}function B(e,t,n,o,r){var i="";null!=n&&(i=(""+n).replace(A,"$&/")+"/"),L(e,N,t=U(t,i,o,r)),I(t)}function D(){var e=x.current;return null===e&&m("307"),e}var V={Children:{map:function(e,t,n){if(null==e)return e;var o=[];return B(e,o,null,t,n),o},forEach:function(e,t,n){if(null==e)return e;L(e,$,t=U(null,null,t,n)),I(t)},count:function(e){return L(e,function(){return null},null)},toArray:function(e){var t=[];return B(e,t,null,function(e){return e}),t},only:function(e){return R(e)||m("143"),e}},createRef:function(){return{current:null}},Component:_,PureComponent:O,createContext:function(e,t){return void 0===t&&(t=null),(e={$$typeof:f,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:c,_context:e},e.Consumer=e},forwardRef:function(e){return{$$typeof:d,render:e}},lazy:function(e){return{$$typeof:h,_ctor:e,_status:-1,_result:null}},memo:function(e,t){return{$$typeof:v,type:e,compare:void 0===t?null:t}},useCallback:function(e,t){return D().useCallback(e,t)},useContext:function(e,t){return D().useContext(e,t)},useEffect:function(e,t){return D().useEffect(e,t)},useImperativeHandle:function(e,t,n){return D().useImperativeHandle(e,t,n)},useDebugValue:function(){},useLayoutEffect:function(e,t){return D().useLayoutEffect(e,t)},useMemo:function(e,t){return D().useMemo(e,t)},useReducer:function(e,t,n){return D().useReducer(e,t,n)},useRef:function(e){return D().useRef(e)},useState:function(e){return D().useState(e)},Fragment:a,StrictMode:s,Suspense:g,createElement:E,cloneElement:function(e,t,n){null==e&&m("267",e);var r=void 0,u=o({},e.props),a=e.key,s=e.ref,l=e._owner;if(null!=t){void 0!==t.ref&&(s=t.ref,l=k.current),void 0!==t.key&&(a=""+t.key);var c=void 0;for(r in e.type&&e.type.defaultProps&&(c=e.type.defaultProps),t)C.call(t,r)&&!P.hasOwnProperty(r)&&(u[r]=void 0===t[r]&&void 0!==c?c[r]:t[r])}if(1===(r=arguments.length-2))u.children=n;else if(1<r){c=Array(r);for(var f=0;f<r;f++)c[f]=arguments[f+2];u.children=c}return{$$typeof:i,type:e.type,key:a,ref:s,props:u,_owner:l}},createFactory:function(e){var t=E.bind(null,e);return t.type=e,t},isValidElement:R,version:"16.8.1",unstable_ConcurrentMode:p,unstable_Profiler:l,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentDispatcher:x,ReactCurrentOwner:k,assign:o}},q={default:V},z=q&&V||q;e.exports=z.default||z},function(e,t,n){"use strict"; | ||
*/var o=n(5),r="function"==typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,a=r?Symbol.for("react.portal"):60106,u=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,l=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,f=r?Symbol.for("react.context"):60110,p=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,g=r?Symbol.for("react.suspense"):60113,y=r?Symbol.for("react.memo"):60115,v=r?Symbol.for("react.lazy"):60116,h="function"==typeof Symbol&&Symbol.iterator;function m(e){for(var t=arguments.length-1,n="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=0;o<t;o++)n+="&args[]="+encodeURIComponent(arguments[o+1]);!function(e,t,n,o,r,i,a,u){if(!e){if(e=void 0,void 0===t)e=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[n,o,r,i,a,u],l=0;(e=Error(t.replace(/%s/g,function(){return s[l++]}))).name="Invariant Violation"}throw e.framesToPop=1,e}}(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S={};function w(e,t,n){this.props=e,this.context=t,this.refs=S,this.updater=n||b}function _(){}function O(e,t,n){this.props=e,this.context=t,this.refs=S,this.updater=n||b}w.prototype.isReactComponent={},w.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&m("85"),this.updater.enqueueSetState(this,e,t,"setState")},w.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},_.prototype=w.prototype;var j=O.prototype=new _;j.constructor=O,o(j,w.prototype),j.isPureReactComponent=!0;var k={current:null,currentDispatcher:null},x=Object.prototype.hasOwnProperty,C={key:!0,ref:!0,__self:!0,__source:!0};function P(e,t,n){var o=void 0,r={},a=null,u=null;if(null!=t)for(o in void 0!==t.ref&&(u=t.ref),void 0!==t.key&&(a=""+t.key),t)x.call(t,o)&&!C.hasOwnProperty(o)&&(r[o]=t[o]);var s=arguments.length-2;if(1===s)r.children=n;else if(1<s){for(var l=Array(s),c=0;c<s;c++)l[c]=arguments[c+2];r.children=l}if(e&&e.defaultProps)for(o in s=e.defaultProps)void 0===r[o]&&(r[o]=s[o]);return{$$typeof:i,type:e,key:a,ref:u,props:r,_owner:k.current}}function E(e){return"object"==typeof e&&null!==e&&e.$$typeof===i}var R=/\/+/g,T=[];function A(e,t,n,o){if(T.length){var r=T.pop();return r.result=e,r.keyPrefix=t,r.func=n,r.context=o,r.count=0,r}return{result:e,keyPrefix:t,func:n,context:o,count:0}}function U(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>T.length&&T.push(e)}function N(e,t,n){return null==e?0:function e(t,n,o,r){var u=typeof t;"undefined"!==u&&"boolean"!==u||(t=null);var s=!1;if(null===t)s=!0;else switch(u){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case i:case a:s=!0}}if(s)return o(r,t,""===n?"."+I(t,0):n),1;if(s=0,n=""===n?".":n+":",Array.isArray(t))for(var l=0;l<t.length;l++){var c=n+I(u=t[l],l);s+=e(u,c,o,r)}else if(c=null===t||"object"!=typeof t?null:"function"==typeof(c=h&&t[h]||t["@@iterator"])?c:null,"function"==typeof c)for(t=c.call(t),l=0;!(u=t.next()).done;)s+=e(u=u.value,c=n+I(u,l++),o,r);else"object"===u&&m("31","[object Object]"==(o=""+t)?"object with keys {"+Object.keys(t).join(", ")+"}":o,"");return s}(e,"",t,n)}function I(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}(e.key):t.toString(36)}function L(e,t){e.func.call(e.context,t,e.count++)}function M(e,t,n){var o=e.result,r=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?$(e,o,n,function(e){return e}):null!=e&&(E(e)&&(e=function(e,t){return{$$typeof:i,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,r+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(R,"$&/")+"/")+n)),o.push(e))}function $(e,t,n,o,r){var i="";null!=n&&(i=(""+n).replace(R,"$&/")+"/"),N(e,M,t=A(t,i,o,r)),U(t)}var D={Children:{map:function(e,t,n){if(null==e)return e;var o=[];return $(e,o,null,t,n),o},forEach:function(e,t,n){if(null==e)return e;N(e,L,t=A(null,null,t,n)),U(t)},count:function(e){return N(e,function(){return null},null)},toArray:function(e){var t=[];return $(e,t,null,function(e){return e}),t},only:function(e){return E(e)||m("143"),e}},createRef:function(){return{current:null}},Component:w,PureComponent:O,createContext:function(e,t){return void 0===t&&(t=null),(e={$$typeof:f,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:c,_context:e},e.Consumer=e},forwardRef:function(e){return{$$typeof:d,render:e}},lazy:function(e){return{$$typeof:v,_ctor:e,_status:-1,_result:null}},memo:function(e,t){return{$$typeof:y,type:e,compare:void 0===t?null:t}},Fragment:u,StrictMode:s,Suspense:g,createElement:P,cloneElement:function(e,t,n){null==e&&m("267",e);var r=void 0,a=o({},e.props),u=e.key,s=e.ref,l=e._owner;if(null!=t){void 0!==t.ref&&(s=t.ref,l=k.current),void 0!==t.key&&(u=""+t.key);var c=void 0;for(r in e.type&&e.type.defaultProps&&(c=e.type.defaultProps),t)x.call(t,r)&&!C.hasOwnProperty(r)&&(a[r]=void 0===t[r]&&void 0!==c?c[r]:t[r])}if(1===(r=arguments.length-2))a.children=n;else if(1<r){c=Array(r);for(var f=0;f<r;f++)c[f]=arguments[f+2];a.children=c}return{$$typeof:i,type:e.type,key:u,ref:s,props:a,_owner:l}},createFactory:function(e){var t=P.bind(null,e);return t.type=e,t},isValidElement:E,version:"16.7.0",unstable_ConcurrentMode:p,unstable_Profiler:l,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:k,assign:o}},q={default:D},V=q&&D||q;e.exports=V.default||V},function(e,t,n){"use strict"; | ||
/* | ||
@@ -15,3 +15,3 @@ object-assign | ||
@license MIT | ||
*/var o=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,u,a=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),s=1;s<arguments.length;s++){for(var l in n=Object(arguments[s]))r.call(n,l)&&(a[l]=n[l]);if(o){u=o(n);for(var c=0;c<u.length;c++)i.call(n,u[c])&&(a[u[c]]=n[u[c]])}}return a}},function(e,t,n){e.exports=n(6)()},function(e,t,n){"use strict";var o=n(7);function r(){}e.exports=function(){function e(e,t,n,r,i,u){if(u!==o){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.debounce=function(e,t){var n=void 0,o=void 0;return function(){var r=this,i=arguments;return clearTimeout(n),!(n=setTimeout(function(){n=null,o=e.apply(r,i)},t))&&(o=e.apply(r,i)),o}}},function(e,t,n){var o=n(10);"string"==typeof o&&(o=[[e.i,o,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(12)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){(e.exports=n(11)(!1)).push([e.i,".google-places-autocomplete {\n width: 100%;\n position: relative;\n}\n\n.google-places-autocomplete__input {\n width: calc(100% - 20px);\n padding: 10px;\n border: none;\n margin-bottom: 2px;\n box-shadow: 0 1px 16px 0 rgba(0, 0, 0, 0.09);\n}\n\n.google-places-autocomplete__input:active,\n.google-places-autocomplete__input:focus,\n.google-places-autocomplete__input:hover {\n outline: none;\n border: none;\n}\n\n.google-places-autocomplete__suggestions-container {\n background: white;\n border-radius: 0 0 5px 5px;\n color: black;\n position: absolute;\n width: 100%;\n z-index: 2;\n box-shadow: 0 1px 16px 0 rgba(0, 0, 0, 0.09);\n}\n\n.google-places-autocomplete__suggestion {\n font-size: 1rem;\n text-align: left;\n padding: 10px;\n}\n\n.google-places-autocomplete__suggestion--active {\n background: #e0e3e7;\n}\n",""])},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=function(e,t){var n=e[1]||"",o=e[3];if(!o)return n;if(t&&"function"==typeof btoa){var r=(u=o,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(u))))+" */"),i=o.sources.map(function(e){return"/*# sourceURL="+o.sourceRoot+e+" */"});return[n].concat(i).concat([r]).join("\n")}var u;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var o={},r=0;r<this.length;r++){var i=this[r][0];null!=i&&(o[i]=!0)}for(r=0;r<e.length;r++){var u=e[r];null!=u[0]&&o[u[0]]||(n&&!u[2]?u[2]=n:n&&(u[2]="("+u[2]+") and ("+n+")"),t.push(u))}},t}},function(e,t,n){var o,r,i={},u=(o=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===r&&(r=o.apply(this,arguments)),r}),a=function(e){var t={};return function(e,n){if("function"==typeof e)return e();if(void 0===t[e]){var o=function(e,t){return t?t.querySelector(e):document.querySelector(e)}.call(this,e,n);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(e){o=null}t[e]=o}return t[e]}}(),s=null,l=0,c=[],f=n(13);function p(e,t){for(var n=0;n<e.length;n++){var o=e[n],r=i[o.id];if(r){r.refs++;for(var u=0;u<r.parts.length;u++)r.parts[u](o.parts[u]);for(;u<o.parts.length;u++)r.parts.push(m(o.parts[u],t))}else{var a=[];for(u=0;u<o.parts.length;u++)a.push(m(o.parts[u],t));i[o.id]={id:o.id,refs:1,parts:a}}}}function d(e,t){for(var n=[],o={},r=0;r<e.length;r++){var i=e[r],u=t.base?i[0]+t.base:i[0],a={css:i[1],media:i[2],sourceMap:i[3]};o[u]?o[u].parts.push(a):n.push(o[u]={id:u,parts:[a]})}return n}function g(e,t){var n=a(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var o=c[c.length-1];if("top"===e.insertAt)o?o.nextSibling?n.insertBefore(t,o.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),c.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var r=a(e.insertAt.before,n);n.insertBefore(t,r)}}function v(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=c.indexOf(e);t>=0&&c.splice(t,1)}function h(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var o=function(){0;return n.nc}();o&&(e.attrs.nonce=o)}return y(t,e.attrs),g(e,t),t}function y(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function m(e,t){var n,o,r,i;if(t.transform&&e.css){if(!(i="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=i}if(t.singleton){var u=l++;n=s||(s=h(t)),o=_.bind(null,n,u,!1),r=_.bind(null,n,u,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",y(t,e.attrs),g(e,t),t}(t),o=function(e,t,n){var o=n.css,r=n.sourceMap,i=void 0===t.convertToAbsoluteUrls&&r;(t.convertToAbsoluteUrls||i)&&(o=f(o));r&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var u=new Blob([o],{type:"text/css"}),a=e.href;e.href=URL.createObjectURL(u),a&&URL.revokeObjectURL(a)}.bind(null,n,t),r=function(){v(n),n.href&&URL.revokeObjectURL(n.href)}):(n=h(t),o=function(e,t){var n=t.css,o=t.media;o&&e.setAttribute("media",o);if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),r=function(){v(n)});return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else r()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=u()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=d(e,t);return p(n,t),function(e){for(var o=[],r=0;r<n.length;r++){var u=n[r];(a=i[u.id]).refs--,o.push(a)}e&&p(d(e,t),t);for(r=0;r<o.length;r++){var a;if(0===(a=o[r]).refs){for(var s=0;s<a.parts.length;s++)a.parts[s]();delete i[a.id]}}}};var b,S=(b=[],function(e,t){return b[e]=t,b.filter(Boolean).join("\n")});function _(e,t,n,o){var r=n?"":o.css;if(e.styleSheet)e.styleSheet.cssText=S(t,r);else{var i=document.createTextNode(r),u=e.childNodes;u[t]&&e.removeChild(u[t]),u.length?e.insertBefore(i,u[t]):e.appendChild(i)}}},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,o=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var r,i=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?e:(r=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:o+i.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")})}}])}); | ||
*/var o=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,u=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),s=1;s<arguments.length;s++){for(var l in n=Object(arguments[s]))r.call(n,l)&&(u[l]=n[l]);if(o){a=o(n);for(var c=0;c<a.length;c++)i.call(n,a[c])&&(u[a[c]]=n[a[c]])}}return u}},function(e,t,n){"use strict";var o=n(7);function r(){}e.exports=function(){function e(e,t,n,r,i,a){if(a!==o){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e,t){var n=void 0,o=void 0;return function(){var r=this,i=arguments;return clearTimeout(n),!(n=setTimeout(function(){n=null,o=e.apply(r,i)},t))&&(o=e.apply(r,i)),o}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.suggestionStylesType=t.suggestionClassNamesType=t.autocompletionRequestType=void 0;var o,r=n(0),i=(o=r)&&o.__esModule?o:{default:o};var a=i.default.shape({country:i.default.oneOfType([i.default.string,i.default.arrayOf(i.default.string)])}),u=i.default.shape({lat:i.default.number,lng:i.default.number});t.autocompletionRequestType=i.default.shape({bounds:function(e,t,n){var o=e[t];return Array.isArray(o)&&2===o.length&&o.every(function(e){return 2===Object.keys(e).length&&e.hasOwnProperty("lat")&&e.hasOwnProperty("lng")&&Number.isInteger(e.lat)&&Number.isInteger(e.lng)})?null:new Error("Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},componentRestrictions:a,location:u,offset:i.default.number,radius:i.default.number,types:i.default.arrayOf(i.default.string)}),t.suggestionClassNamesType=i.default.shape({container:i.default.string,suggestion:i.default.string,suggestionActive:i.default.string}),t.suggestionStylesType=i.default.shape({container:i.default.object,suggestion:i.default.object})},function(e,t,n){var o=n(11);"string"==typeof o&&(o=[[e.i,o,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(13)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){(e.exports=n(12)(!1)).push([e.i,".google-places-autocomplete {\n width: 100%;\n position: relative;\n}\n\n.google-places-autocomplete__input {\n width: calc(100% - 20px);\n padding: 10px;\n border: none;\n margin-bottom: 2px;\n box-shadow: 0 1px 16px 0 rgba(0, 0, 0, 0.09);\n}\n\n.google-places-autocomplete__input:active,\n.google-places-autocomplete__input:focus,\n.google-places-autocomplete__input:hover {\n outline: none;\n border: none;\n}\n\n.google-places-autocomplete__suggestions-container {\n background: white;\n border-radius: 0 0 5px 5px;\n color: black;\n position: absolute;\n width: 100%;\n z-index: 2;\n box-shadow: 0 1px 16px 0 rgba(0, 0, 0, 0.09);\n}\n\n.google-places-autocomplete__suggestion {\n font-size: 1rem;\n text-align: left;\n padding: 10px;\n}\n\n.google-places-autocomplete__suggestion--active {\n background: #e0e3e7;\n}\n",""])},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=function(e,t){var n=e[1]||"",o=e[3];if(!o)return n;if(t&&"function"==typeof btoa){var r=(a=o,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),i=o.sources.map(function(e){return"/*# sourceURL="+o.sourceRoot+e+" */"});return[n].concat(i).concat([r]).join("\n")}var a;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var o={},r=0;r<this.length;r++){var i=this[r][0];null!=i&&(o[i]=!0)}for(r=0;r<e.length;r++){var a=e[r];null!=a[0]&&o[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(e,t,n){var o,r,i={},a=(o=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===r&&(r=o.apply(this,arguments)),r}),u=function(e){var t={};return function(e,n){if("function"==typeof e)return e();if(void 0===t[e]){var o=function(e,t){return t?t.querySelector(e):document.querySelector(e)}.call(this,e,n);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(e){o=null}t[e]=o}return t[e]}}(),s=null,l=0,c=[],f=n(14);function p(e,t){for(var n=0;n<e.length;n++){var o=e[n],r=i[o.id];if(r){r.refs++;for(var a=0;a<r.parts.length;a++)r.parts[a](o.parts[a]);for(;a<o.parts.length;a++)r.parts.push(m(o.parts[a],t))}else{var u=[];for(a=0;a<o.parts.length;a++)u.push(m(o.parts[a],t));i[o.id]={id:o.id,refs:1,parts:u}}}}function d(e,t){for(var n=[],o={},r=0;r<e.length;r++){var i=e[r],a=t.base?i[0]+t.base:i[0],u={css:i[1],media:i[2],sourceMap:i[3]};o[a]?o[a].parts.push(u):n.push(o[a]={id:a,parts:[u]})}return n}function g(e,t){var n=u(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var o=c[c.length-1];if("top"===e.insertAt)o?o.nextSibling?n.insertBefore(t,o.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),c.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var r=u(e.insertAt.before,n);n.insertBefore(t,r)}}function y(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=c.indexOf(e);t>=0&&c.splice(t,1)}function v(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var o=function(){0;return n.nc}();o&&(e.attrs.nonce=o)}return h(t,e.attrs),g(e,t),t}function h(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function m(e,t){var n,o,r,i;if(t.transform&&e.css){if(!(i="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=i}if(t.singleton){var a=l++;n=s||(s=v(t)),o=w.bind(null,n,a,!1),r=w.bind(null,n,a,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",h(t,e.attrs),g(e,t),t}(t),o=function(e,t,n){var o=n.css,r=n.sourceMap,i=void 0===t.convertToAbsoluteUrls&&r;(t.convertToAbsoluteUrls||i)&&(o=f(o));r&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var a=new Blob([o],{type:"text/css"}),u=e.href;e.href=URL.createObjectURL(a),u&&URL.revokeObjectURL(u)}.bind(null,n,t),r=function(){y(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(t),o=function(e,t){var n=t.css,o=t.media;o&&e.setAttribute("media",o);if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),r=function(){y(n)});return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else r()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=a()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=d(e,t);return p(n,t),function(e){for(var o=[],r=0;r<n.length;r++){var a=n[r];(u=i[a.id]).refs--,o.push(u)}e&&p(d(e,t),t);for(r=0;r<o.length;r++){var u;if(0===(u=o[r]).refs){for(var s=0;s<u.parts.length;s++)u.parts[s]();delete i[u.id]}}}};var b,S=(b=[],function(e,t){return b[e]=t,b.filter(Boolean).join("\n")});function w(e,t,n,o){var r=n?"":o.css;if(e.styleSheet)e.styleSheet.cssText=S(t,r);else{var i=document.createTextNode(r),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,o=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var r,i=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?e:(r=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:o+i.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")})}}])}); | ||
//# sourceMappingURL=index.umd.min.js.map |
{ | ||
"name": "react-google-places-autocomplete", | ||
"version": "1.3.1", | ||
"version": "1.4.0", | ||
"description": "Google places autocomplete input for ReactJS.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -39,2 +39,3 @@ # React Google Places Autocomplete | ||
|-----------------------|----------|----------|------------| | ||
| autocompletionRequest | object | | {} | | ||
| debounce | number | | 300 | | ||
@@ -53,2 +54,57 @@ | initialValue | string | | '' | | ||
### autocompletionRequest | ||
Autocompletion request object to add restrictions to the search. Let's see the shape this prop can take: | ||
```js | ||
autocompletionRequest = { | ||
bounds: Array<LatLng>, | ||
componentRestrictions: { | ||
country: String | Array<String> | ||
}, | ||
location: LatLng, | ||
offset: Number, | ||
radius: Number, | ||
types: Array<String>, | ||
} | ||
``` | ||
Where: | ||
- `LatLng` is an object like `{ lat: Number, lng: Number }`. | ||
- bounds is an array of lenght 2, where the first value is the south west coordinate and the last one is the north east coordinate. | ||
- country is one from [ISO 3166-1 Alpha-2 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). For example, 'us', 'ca', or 'uy'. You can provide a single one, or an array of up to five country code strings. | ||
Eaxmples: | ||
```js | ||
... | ||
<GooglePlacesAutocomplete | ||
autocompletionRequest={{ | ||
bounds: [ | ||
{ lat: 50, lng: 50 }, | ||
{ lat: 100, lng: 100 } | ||
], | ||
}} | ||
/> | ||
... | ||
``` | ||
```js | ||
... | ||
<GooglePlacesAutocomplete | ||
autocompletionRequest={{ | ||
componentRestrictions: { | ||
country: ['us', 'ca', 'uy'], | ||
} | ||
}} | ||
/> | ||
... | ||
``` | ||
Note: for more information check [google documentation](https://developers.google.com/maps/documentation/javascript/reference/places-autocomplete-service#AutocompletionRequest). | ||
### debounce | ||
@@ -55,0 +111,0 @@ |
import React, { Component } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { debounce } from '../utils'; | ||
import debounce from '../utils/debounce'; | ||
import { | ||
autocompletionRequestType, | ||
suggestionClassNamesType, | ||
suggestionStylesType, | ||
} from '../utils/customPropTypes'; | ||
import './index.css'; | ||
@@ -8,5 +13,14 @@ | ||
fetchSuggestions = debounce((value) => { | ||
const { autocompletionRequest } = this.props; | ||
let bounds = undefined; | ||
if (autocompletionRequest.bounds) { | ||
bounds = new google.maps.LatLngBounds(...autocompletionRequest.bounds); | ||
} | ||
this.setState({ loading: true }); | ||
this.placesService.getPlacePredictions( | ||
{ | ||
...autocompletionRequest, | ||
bounds, | ||
input: value, | ||
@@ -30,8 +44,8 @@ }, | ||
this.changeActiveSuggestion = this.changeActiveSuggestion.bind(this); | ||
this.changeValue = this.changeValue.bind(this); | ||
this.changeActiveSuggestion = this.changeActiveSuggestion.bind(this); | ||
this.clearSuggestions = this.clearSuggestions.bind(this); | ||
this.fetchSuggestionsCallback = this.fetchSuggestionsCallback.bind(this); | ||
this.handleClick = this.handleClick.bind(this); | ||
this.handleKeyDown = this.handleKeyDown.bind(this); | ||
this.handleOnBlur = this.handleOnBlur.bind(this); | ||
this.initalizeService = this.initializeService.bind(this); | ||
@@ -45,4 +59,9 @@ this.onSuggestionSelect = this.onSuggestionSelect.bind(this); | ||
this.initalizeService(); | ||
document.addEventListener('click', this.handleClick); | ||
} | ||
componentWillUnmount() { | ||
document.removeEventListener('click', this.handleClick); | ||
} | ||
componentWillReceiveProps(nextProps) { | ||
@@ -54,2 +73,8 @@ if (nextProps.initialValue) { | ||
handleClick(ev) { | ||
if (!ev.target.id.includes('google-places-autocomplete')) { | ||
this.clearSuggestions(); | ||
} | ||
} | ||
changeValue(value) { | ||
@@ -81,2 +106,3 @@ this.setState({ value }); | ||
this.placesService = new window.google.maps.places.AutocompleteService(); | ||
window.coso = this.placesService; | ||
this.setState({ | ||
@@ -103,5 +129,4 @@ placesServiceStatus: window.google.maps.places.PlacesServiceStatus.OK, | ||
autoComplete: 'off', | ||
id: 'google-places-autcomplete-input', | ||
id: 'google-places-autocomplete-input', | ||
value, | ||
onBlur: this.handleOnBlur, | ||
onChange: ({ target }) => this.changeValue(target.value), | ||
@@ -119,3 +144,2 @@ onKeyDown: this.handleKeyDown, | ||
id="google-places-autocomplete-input" | ||
onBlur={this.handleOnBlur} | ||
onChange={({ target }) => this.changeValue(target.value)} | ||
@@ -213,2 +237,3 @@ onKeyDown={this.handleKeyDown} | ||
}); | ||
onSelect(suggestion); | ||
@@ -254,25 +279,2 @@ } | ||
handleOnBlur(ev) { | ||
if (ev.target.id.includes('google-places-autocomplete')) { | ||
return; | ||
} | ||
const { | ||
state: { | ||
hasSelected, | ||
value, | ||
}, | ||
props: { | ||
onSelect, | ||
}, | ||
} = this; | ||
if (hasSelected) { | ||
return; | ||
} | ||
this.clearSuggestions(); | ||
onSelect({ description: value }); | ||
} | ||
clearSuggestions() { | ||
@@ -335,2 +337,3 @@ this.setState({ | ||
GooglePlacesAutocomplete.propTypes = { | ||
autocompletionRequest: autocompletionRequestType, | ||
debounce: PropTypes.number, | ||
@@ -345,14 +348,8 @@ initialValue: PropTypes.string, | ||
renderSuggestions: PropTypes.func, | ||
suggestionsClassNames: PropTypes.shape({ | ||
container: PropTypes.string, | ||
suggestion: PropTypes.string, | ||
suggestionActive: PropTypes.string, | ||
}), | ||
suggestionsStyles: PropTypes.shape({ | ||
container: PropTypes.object, | ||
suggestion: PropTypes.object, | ||
}), | ||
suggestionsClassNames: suggestionClassNamesType, | ||
suggestionsStyles: suggestionStylesType, | ||
}; | ||
GooglePlacesAutocomplete.defaultProps = { | ||
autocompletionRequest: {}, | ||
debounce: 300, | ||
@@ -359,0 +356,0 @@ initialValue: '', |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
459991
21
1122
254