Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ace-de/eua-google-places-client

Package Overview
Dependencies
Maintainers
0
Versions
218
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ace-de/eua-google-places-client - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

2

dist/index.esm.js

@@ -1,2 +0,2 @@

function t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function e(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?t(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function r(){r=function(){return e};var t,e={},n=Object.prototype,o=n.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,i=Object.create(o.prototype),c=new N(n||[]);return a(i,"_invoke",{value:T(t,r,c)}),i}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var h="suspendedStart",d="suspendedYield",y="executing",v="completed",g={};function m(){}function w(){}function b(){}var _={};l(_,c,(function(){return this}));var E=Object.getPrototypeOf,O=E&&E(E(C([])));O&&O!==n&&o.call(O,c)&&(_=O);var P=b.prototype=m.prototype=Object.create(_);function S(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(n,a,i,c){var u=p(t[n],t,a);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==typeof l&&o.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(l).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}var n;a(this,"_invoke",{value:function(t,o){function a(){return new e((function(e,n){r(t,o,e,n)}))}return n=n?n.then(a,a):a()}})}function T(e,r,n){var o=h;return function(a,i){if(o===y)throw new Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=L(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var s=p(e,r,n);if("normal"===s.type){if(o=n.done?v:d,s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=v,n.method="throw",n.arg=s.arg)}}}function L(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,L(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=p(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function C(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function r(){for(;++n<e.length;)if(o.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(typeof e+" is not iterable")}return w.prototype=b,a(P,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:w,configurable:!0}),w.displayName=l(b,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,s,"GeneratorFunction")),t.prototype=Object.create(P),t},e.awrap=function(t){return{__await:t}},S(A.prototype),l(A.prototype,u,(function(){return this})),e.AsyncIterator=A,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new A(f(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},S(P),l(P,s,"Generator"),l(P,c,(function(){return this})),l(P,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=C,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(R),!e)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=o.call(i,"catchLoc"),s=o.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;R(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function n(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function o(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(s){return void r(s)}c.done?e(u):Promise.resolve(u).then(n,o)}function a(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var i=t.apply(e,r);function c(t){o(i,n,a,c,u,"next",t)}function u(t){o(i,n,a,c,u,"throw",t)}c(void 0)}))}}function i(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,n(o.key),o)}}function c(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t,e,r){return(e=n(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function l(t){return"string"===typeof t&&s.test(t)}for(var f=[],p=0;p<256;++p)f.push((p+256).toString(16).substr(1));function h(t,e,r,n){switch(t){case 0:return e&r^~e&n;case 1:case 3:return e^r^n;case 2:return e&r^e&n^r&n}}function d(t,e){return t<<e|t>>>32-e}var y=function(t,e,r){function n(t,n,o,a){if("string"===typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e}(t)),"string"===typeof n&&(n=function(t){if(!l(t))throw TypeError("Invalid UUID");var e,r=new Uint8Array(16);return r[0]=(e=parseInt(t.slice(0,8),16))>>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=255&e,r[4]=(e=parseInt(t.slice(9,13),16))>>>8,r[5]=255&e,r[6]=(e=parseInt(t.slice(14,18),16))>>>8,r[7]=255&e,r[8]=(e=parseInt(t.slice(19,23),16))>>>8,r[9]=255&e,r[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,r[11]=e/4294967296&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=255&e,r}(n)),16!==n.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var i=new Uint8Array(16+t.length);if(i.set(n),i.set(t,n.length),(i=r(i))[6]=15&i[6]|e,i[8]=63&i[8]|128,o){a=a||0;for(var c=0;c<16;++c)o[a+c]=i[c];return o}return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(f[t[e+0]]+f[t[e+1]]+f[t[e+2]]+f[t[e+3]]+"-"+f[t[e+4]]+f[t[e+5]]+"-"+f[t[e+6]]+f[t[e+7]]+"-"+f[t[e+8]]+f[t[e+9]]+"-"+f[t[e+10]]+f[t[e+11]]+f[t[e+12]]+f[t[e+13]]+f[t[e+14]]+f[t[e+15]]).toLowerCase();if(!l(r))throw TypeError("Stringified UUID is invalid");return r}(i)}try{n.name=t}catch(o){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}("v5",80,(function(t){var e=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"===typeof t){var n=unescape(encodeURIComponent(t));t=[];for(var o=0;o<n.length;++o)t.push(n.charCodeAt(o))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);for(var a=t.length/4+2,i=Math.ceil(a/16),c=new Array(i),u=0;u<i;++u){for(var s=new Uint32Array(16),l=0;l<16;++l)s[l]=t[64*u+4*l]<<24|t[64*u+4*l+1]<<16|t[64*u+4*l+2]<<8|t[64*u+4*l+3];c[u]=s}c[i-1][14]=8*(t.length-1)/Math.pow(2,32),c[i-1][14]=Math.floor(c[i-1][14]),c[i-1][15]=8*(t.length-1)&4294967295;for(var f=0;f<i;++f){for(var p=new Uint32Array(80),y=0;y<16;++y)p[y]=c[f][y];for(var v=16;v<80;++v)p[v]=d(p[v-3]^p[v-8]^p[v-14]^p[v-16],1);for(var g=r[0],m=r[1],w=r[2],b=r[3],_=r[4],E=0;E<80;++E){var O=Math.floor(E/20),P=d(g,5)+h(O,m,w,b)+_+e[O]+p[E]>>>0;_=b,b=w,w=d(m,30)>>>0,m=g,g=P}r[0]=r[0]+g>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+w>>>0,r[3]=r[3]+b>>>0,r[4]=r[4]+_>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]})),v=y,g="9ad1c8c2-539a-4d52-9640-4f59254ba745",m=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.place_details,n=t.geometry;return e(e(e({locationId:t.id,id:t.id,locationType:null,type:null,street:"",city:"",postCode:"",country:"",countryCode:"",locationName:t.name||"",name:t.name||"",establishmentType:t.types||[],addressType:""},"object"===typeof n&&{longitude:n.location?n.location.lng():"",latitude:n.location?n.location.lat():""}),r&&"object"===typeof r&&{phoneNo:r.international_phone_number||"",openingHours:r.opening_hours||null,website:r.website||"",formattedAddress:r.formatted_address}),{},{businessStatus:t.business_status,placeId:t.place_id})},w=c((function t(){var n=this,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.initializeGooglePlacesService=function(){return new Promise((function(t,e){var r=n.serviceParameters.apiKey,o=document.createElement("script");o.src="https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places&key=".concat(r,"&callback=Function.prototype"),o.addEventListener("load",(function(){return t(window.google)})),o.addEventListener("error",(function(t){return e(t)})),document.head.appendChild(o)})).then((function(){var t=document.createElement("div");t.setAttribute("id","googlePlacesMap"),document.body.appendChild(t);var e=new window.google.maps.Map(document.getElementById("googlePlacesMap"),{center:{lat:53.5584898,lng:9.7873983},zoom:13});return new window.google.maps.places.PlacesService(e)}))},this.searchPlaces=function(){var t=a(r().mark((function t(o){var a,i,c,u,s,l,f,p,h,d;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.placesServicePromise;case 2:return a=t.sent,i=o.searchQuery,c=o.latitude,u=o.longitude,s=o.viewport,l=o.placeTypes,f=void 0===l?[]:l,p=o.locationRadius,h=void 0===p?3e4:p,d=s?new window.google.maps.LatLngBounds({lat:s.southwest.latitude,lng:s.southwest.longitude},{lat:s.northeast.latitude,lng:s.northeast.longitude}):null,t.abrupt("return",new Promise((function(t,r){var o=i?function(t,e){return a.textSearch(t,e)}:function(t,e){return a.nearbySearch(t,e)};o(e(e(e(e({},!!i&&{query:i}),!!s&&{location:{lat:c,lng:u}}),s?{bounds:d}:{radius:h}),{},{type:f}),(function(e,o){if(o===window.google.maps.places.PlacesServiceStatus.OK||o===window.google.maps.places.PlacesServiceStatus.ZERO_RESULTS)if(o!==window.google.maps.places.PlacesServiceStatus.ZERO_RESULTS){var a=e.map((function(t){var e="".concat(t.geometry.location.lng()).concat(t.geometry.location.lat());return t.id="".concat(v(e,g),"--").concat(v(t.place_id,g)),t})).slice(0,10);Promise.all(a.map((function(t){return n.getPlaceDetails(t.id,t.place_id,["formatted_address","international_phone_number","opening_hours","utc_offset_minutes","types","place_id","website"])}))).then((function(e){var r=a.map((function(t){var r=e.find((function(e){return e.id===t.id}));return t.place_details=r.placeDetails,t}));t(r)})).catch((function(t){r(t)}))}else t([]);else r(o)}))})).catch((function(t){return{status:t}})).then((function(t){return{googlePlaceDTOs:t.map((function(t){return m(t)}))}})));case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.getPlaceDetails=function(){var t=a(r().mark((function t(e,o){var a,i,c=arguments;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=c.length>2&&void 0!==c[2]?c[2]:[],t.next=3,n.placesServicePromise;case 3:return i=t.sent,t.abrupt("return",new Promise((function(t,e){i.getDetails({placeId:o,fields:a},(function(r,n){return n===window.google.maps.places.PlacesServiceStatus.OK&&r?t(r):e(n)}))})).then((function(t){return{id:e,placeDetails:t}})).catch((function(t){return{id:e,placeDetails:null}})));case 5:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),this.serviceParameters=e({},o),this.placesServicePromise=this.initializeGooglePlacesService(),{searchPlaces:this.searchPlaces,getPlaceDetails:this.getPlaceDetails}})),b={ACCOUNTING:"accounting",AIRPORT:"airport",ATM:"atm",BANK:"bank",BICYCLE_STORE:"bicycle_store",BUS_STATION:"bus_station",CAR_DEALER:"car_dealer",CAR_RENTAL:"car_rental",CAR_REPAIR:"car_repair",CAR_WASH:"car_wash",CEMETERY:"cemetery",CITY_HALL:"city_hall",COURTHOUSE:"courthouse",DOCTOR:"doctor",DRUGSTORE:"drugstore",ELECTRICIAN:"electrician",FUNERAL_HOME:"funeral_home",GAS_STATION:"gas_station",HOSPITAL:"hospital",INSURANCE_AGENCY:"insurance_agency",LAWYER:"lawyer",LIGHT_RAIL_STATION:"light_rail_station",LOCAL_GOVERNMENT_OFFICE:"local_government_office",LOCKSMITH:"locksmith",LODGING:"lodging",MOVING_COMPANY:"moving_company",PARKING:"parking",PHARMACY:"pharmacy",PHYSIOTHERAPIST:"physiotherapist",PLUMBER:"plumber",POLICE:"police",POST_OFFICE:"post_office",RV_PARK:"rv_park",STORAGE:"storage",STORE:"store",SUBWAY_STATION:"subway_station",TAXI_STAND:"taxi_stand",TRAIN_STATION:"train_station",TRANSIT_STATION:"transit_station",VETERINARY_CARE:"veterinary_care"};export{w as GooglePlacesClient,b as placeTypes};
function t(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function e(e){return function(){var r=this,n=arguments;return new Promise((function(o,a){var i=e.apply(r,n);function c(e){t(i,o,a,c,u,"next",e)}function u(e){t(i,o,a,c,u,"throw",e)}c(void 0)}))}}function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}}function n(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function o(t,e,r){return(e=u(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?a(Object(r),!0).forEach((function(e){o(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function c(){c=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var a=e&&e.prototype instanceof m?e:m,i=Object.create(a.prototype),c=new N(n||[]);return o(i,"_invoke",{value:T(t,r,c)}),i}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var h="suspendedStart",d="suspendedYield",y="executing",v="completed",g={};function m(){}function w(){}function b(){}var _={};l(_,i,(function(){return this}));var E=Object.getPrototypeOf,O=E&&E(E(C([])));O&&O!==r&&n.call(O,i)&&(_=O);var P=b.prototype=m.prototype=Object.create(_);function S(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(o,a,i,c){var u=p(t[o],t,a);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(l).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function T(e,r,n){var o=h;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=L(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var s=p(e,r,n);if("normal"===s.type){if(o=n.done?v:d,s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=v,n.method="throw",n.arg=s.arg)}}}function L(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,L(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=p(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function C(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(typeof e+" is not iterable")}return w.prototype=b,o(P,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:w,configurable:!0}),w.displayName=l(b,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,s,"GeneratorFunction")),t.prototype=Object.create(P),t},e.awrap=function(t){return{__await:t}},S(A.prototype),l(A.prototype,u,(function(){return this})),e.AsyncIterator=A,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new A(f(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},S(P),l(P,s,"Generator"),l(P,i,(function(){return this})),l(P,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=C,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(R),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;R(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function u(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}var s=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function l(t){return"string"===typeof t&&s.test(t)}for(var f=[],p=0;p<256;++p)f.push((p+256).toString(16).substr(1));function h(t,e,r,n){switch(t){case 0:return e&r^~e&n;case 1:case 3:return e^r^n;case 2:return e&r^e&n^r&n}}function d(t,e){return t<<e|t>>>32-e}var y=function(t,e,r){function n(t,n,o,a){if("string"===typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e}(t)),"string"===typeof n&&(n=function(t){if(!l(t))throw TypeError("Invalid UUID");var e,r=new Uint8Array(16);return r[0]=(e=parseInt(t.slice(0,8),16))>>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=255&e,r[4]=(e=parseInt(t.slice(9,13),16))>>>8,r[5]=255&e,r[6]=(e=parseInt(t.slice(14,18),16))>>>8,r[7]=255&e,r[8]=(e=parseInt(t.slice(19,23),16))>>>8,r[9]=255&e,r[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,r[11]=e/4294967296&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=255&e,r}(n)),16!==n.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var i=new Uint8Array(16+t.length);if(i.set(n),i.set(t,n.length),(i=r(i))[6]=15&i[6]|e,i[8]=63&i[8]|128,o){a=a||0;for(var c=0;c<16;++c)o[a+c]=i[c];return o}return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(f[t[e+0]]+f[t[e+1]]+f[t[e+2]]+f[t[e+3]]+"-"+f[t[e+4]]+f[t[e+5]]+"-"+f[t[e+6]]+f[t[e+7]]+"-"+f[t[e+8]]+f[t[e+9]]+"-"+f[t[e+10]]+f[t[e+11]]+f[t[e+12]]+f[t[e+13]]+f[t[e+14]]+f[t[e+15]]).toLowerCase();if(!l(r))throw TypeError("Stringified UUID is invalid");return r}(i)}try{n.name=t}catch(o){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}("v5",80,(function(t){var e=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"===typeof t){var n=unescape(encodeURIComponent(t));t=[];for(var o=0;o<n.length;++o)t.push(n.charCodeAt(o))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);for(var a=t.length/4+2,i=Math.ceil(a/16),c=new Array(i),u=0;u<i;++u){for(var s=new Uint32Array(16),l=0;l<16;++l)s[l]=t[64*u+4*l]<<24|t[64*u+4*l+1]<<16|t[64*u+4*l+2]<<8|t[64*u+4*l+3];c[u]=s}c[i-1][14]=8*(t.length-1)/Math.pow(2,32),c[i-1][14]=Math.floor(c[i-1][14]),c[i-1][15]=8*(t.length-1)&4294967295;for(var f=0;f<i;++f){for(var p=new Uint32Array(80),y=0;y<16;++y)p[y]=c[f][y];for(var v=16;v<80;++v)p[v]=d(p[v-3]^p[v-8]^p[v-14]^p[v-16],1);for(var g=r[0],m=r[1],w=r[2],b=r[3],_=r[4],E=0;E<80;++E){var O=Math.floor(E/20),P=d(g,5)+h(O,m,w,b)+_+e[O]+p[E]>>>0;_=b,b=w,w=d(m,30)>>>0,m=g,g=P}r[0]=r[0]+g>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+w>>>0,r[3]=r[3]+b>>>0,r[4]=r[4]+_>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]})),v=y,g="9ad1c8c2-539a-4d52-9640-4f59254ba745",m=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.place_details,r=t.geometry;return i(i(i({locationId:t.id,id:t.id,locationType:null,type:null,street:"",city:"",postCode:"",country:"",countryCode:"",locationName:t.name||"",name:t.name||"",establishmentType:t.types||[],addressType:""},"object"===typeof r&&{longitude:r.location?r.location.lng():"",latitude:r.location?r.location.lat():""}),e&&"object"===typeof e&&{phoneNo:e.international_phone_number||"",openingHours:e.opening_hours||null,website:e.website||"",formattedAddress:e.formatted_address}),{},{businessStatus:t.business_status,placeId:t.place_id})},w=n((function t(){var r=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.initializeGooglePlacesService=function(){return new Promise((function(t,e){var n=r.serviceParameters.apiKey,o=document.createElement("script");o.src="https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places&key=".concat(n,"&callback=Function.prototype"),o.addEventListener("load",(function(){return t(window.google)})),o.addEventListener("error",(function(t){return e(t)})),document.head.appendChild(o)})).then((function(){var t=document.createElement("div");t.setAttribute("id","googlePlacesMap"),document.body.appendChild(t);var e=new window.google.maps.Map(document.getElementById("googlePlacesMap"),{center:{lat:53.5584898,lng:9.7873983},zoom:13});return new window.google.maps.places.PlacesService(e)}))},this.searchPlaces=function(){var t=e(c().mark((function t(e){var n,o,a,u,s,l,f,p,h,d;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.placesServicePromise;case 2:return n=t.sent,o=e.searchQuery,a=e.latitude,u=e.longitude,s=e.viewport,l=e.placeTypes,f=void 0===l?[]:l,p=e.locationRadius,h=void 0===p?3e4:p,d=s?new window.google.maps.LatLngBounds({lat:s.southwest.latitude,lng:s.southwest.longitude},{lat:s.northeast.latitude,lng:s.northeast.longitude}):null,t.abrupt("return",new Promise((function(t,e){var c=o?function(t,e){return n.textSearch(t,e)}:function(t,e){return n.nearbySearch(t,e)};c(i(i(i(i({},!!o&&{query:o}),!!s&&{location:{lat:a,lng:u}}),s?{bounds:d}:{radius:h}),{},{type:f}),(function(n,o){if(o===window.google.maps.places.PlacesServiceStatus.OK||o===window.google.maps.places.PlacesServiceStatus.ZERO_RESULTS)if(o!==window.google.maps.places.PlacesServiceStatus.ZERO_RESULTS){var a=n.map((function(t){var e="".concat(t.geometry.location.lng()).concat(t.geometry.location.lat());return t.id="".concat(v(e,g),"--").concat(v(t.place_id,g)),t})).slice(0,10);Promise.all(a.map((function(t){return r.getPlaceDetails(t.id,t.place_id,["formatted_address","international_phone_number","opening_hours","utc_offset_minutes","types","place_id","website"])}))).then((function(e){var r=a.map((function(t){var r=e.find((function(e){return e.id===t.id}));return t.place_details=r.placeDetails,t}));t(r)})).catch((function(t){e(t)}))}else t([]);else e(o)}))})).catch((function(t){return{status:t}})).then((function(t){return{googlePlaceDTOs:t.map((function(t){return m(t)}))}})));case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.getPlaceDetails=function(){var t=e(c().mark((function t(e,n){var o,a,i=arguments;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=i.length>2&&void 0!==i[2]?i[2]:[],t.next=3,r.placesServicePromise;case 3:return a=t.sent,t.abrupt("return",new Promise((function(t,e){a.getDetails({placeId:n,fields:o},(function(r,n){return n===window.google.maps.places.PlacesServiceStatus.OK&&r?t(r):e(n)}))})).then((function(t){return{id:e,placeDetails:t}})).catch((function(t){return{id:e,placeDetails:null}})));case 5:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),this.serviceParameters=i({},n),this.placesServicePromise=this.initializeGooglePlacesService(),{searchPlaces:this.searchPlaces,getPlaceDetails:this.getPlaceDetails}})),b={ACCOUNTING:"accounting",AIRPORT:"airport",ATM:"atm",BANK:"bank",BICYCLE_STORE:"bicycle_store",BUS_STATION:"bus_station",CAR_DEALER:"car_dealer",CAR_RENTAL:"car_rental",CAR_REPAIR:"car_repair",CAR_WASH:"car_wash",CEMETERY:"cemetery",CITY_HALL:"city_hall",COURTHOUSE:"courthouse",DOCTOR:"doctor",DRUGSTORE:"drugstore",ELECTRICIAN:"electrician",FUNERAL_HOME:"funeral_home",GAS_STATION:"gas_station",HOSPITAL:"hospital",INSURANCE_AGENCY:"insurance_agency",LAWYER:"lawyer",LIGHT_RAIL_STATION:"light_rail_station",LOCAL_GOVERNMENT_OFFICE:"local_government_office",LOCKSMITH:"locksmith",LODGING:"lodging",MOVING_COMPANY:"moving_company",PARKING:"parking",PHARMACY:"pharmacy",PHYSIOTHERAPIST:"physiotherapist",PLUMBER:"plumber",POLICE:"police",POST_OFFICE:"post_office",RV_PARK:"rv_park",STORAGE:"storage",STORE:"store",SUBWAY_STATION:"subway_station",TAXI_STAND:"taxi_stand",TRAIN_STATION:"train_station",TRANSIT_STATION:"transit_station",VETERINARY_CARE:"veterinary_care"};export{w as GooglePlacesClient,b as placeTypes};
//# sourceMappingURL=index.esm.js.map

@@ -1,2 +0,2 @@

"use strict";function t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function e(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?t(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function r(){r=function(){return e};var t,e={},n=Object.prototype,o=n.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,i=Object.create(o.prototype),c=new N(n||[]);return a(i,"_invoke",{value:A(t,r,c)}),i}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var h="suspendedStart",d="suspendedYield",y="executing",v="completed",g={};function m(){}function w(){}function b(){}var _={};l(_,c,(function(){return this}));var E=Object.getPrototypeOf,O=E&&E(E(C([])));O&&O!==n&&o.call(O,c)&&(_=O);var P=b.prototype=m.prototype=Object.create(_);function S(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function r(n,a,i,c){var u=p(t[n],t,a);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==typeof l&&o.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(l).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}var n;a(this,"_invoke",{value:function(t,o){function a(){return new e((function(e,n){r(t,o,e,n)}))}return n=n?n.then(a,a):a()}})}function A(e,r,n){var o=h;return function(a,i){if(o===y)throw new Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=L(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var s=p(e,r,n);if("normal"===s.type){if(o=n.done?v:d,s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=v,n.method="throw",n.arg=s.arg)}}}function L(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,L(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=p(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function C(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function r(){for(;++n<e.length;)if(o.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(typeof e+" is not iterable")}return w.prototype=b,a(P,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:w,configurable:!0}),w.displayName=l(b,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,s,"GeneratorFunction")),t.prototype=Object.create(P),t},e.awrap=function(t){return{__await:t}},S(T.prototype),l(T.prototype,u,(function(){return this})),e.AsyncIterator=T,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new T(f(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},S(P),l(P,s,"Generator"),l(P,c,(function(){return this})),l(P,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=C,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(R),!e)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=o.call(i,"catchLoc"),s=o.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;R(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function n(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function o(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(s){return void r(s)}c.done?e(u):Promise.resolve(u).then(n,o)}function a(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var i=t.apply(e,r);function c(t){o(i,n,a,c,u,"next",t)}function u(t){o(i,n,a,c,u,"throw",t)}c(void 0)}))}}function i(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,n(o.key),o)}}function c(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t,e,r){return(e=n(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function l(t){return"string"===typeof t&&s.test(t)}for(var f=[],p=0;p<256;++p)f.push((p+256).toString(16).substr(1));function h(t,e,r,n){switch(t){case 0:return e&r^~e&n;case 1:case 3:return e^r^n;case 2:return e&r^e&n^r&n}}function d(t,e){return t<<e|t>>>32-e}var y=function(t,e,r){function n(t,n,o,a){if("string"===typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e}(t)),"string"===typeof n&&(n=function(t){if(!l(t))throw TypeError("Invalid UUID");var e,r=new Uint8Array(16);return r[0]=(e=parseInt(t.slice(0,8),16))>>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=255&e,r[4]=(e=parseInt(t.slice(9,13),16))>>>8,r[5]=255&e,r[6]=(e=parseInt(t.slice(14,18),16))>>>8,r[7]=255&e,r[8]=(e=parseInt(t.slice(19,23),16))>>>8,r[9]=255&e,r[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,r[11]=e/4294967296&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=255&e,r}(n)),16!==n.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var i=new Uint8Array(16+t.length);if(i.set(n),i.set(t,n.length),(i=r(i))[6]=15&i[6]|e,i[8]=63&i[8]|128,o){a=a||0;for(var c=0;c<16;++c)o[a+c]=i[c];return o}return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(f[t[e+0]]+f[t[e+1]]+f[t[e+2]]+f[t[e+3]]+"-"+f[t[e+4]]+f[t[e+5]]+"-"+f[t[e+6]]+f[t[e+7]]+"-"+f[t[e+8]]+f[t[e+9]]+"-"+f[t[e+10]]+f[t[e+11]]+f[t[e+12]]+f[t[e+13]]+f[t[e+14]]+f[t[e+15]]).toLowerCase();if(!l(r))throw TypeError("Stringified UUID is invalid");return r}(i)}try{n.name=t}catch(o){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}("v5",80,(function(t){var e=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"===typeof t){var n=unescape(encodeURIComponent(t));t=[];for(var o=0;o<n.length;++o)t.push(n.charCodeAt(o))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);for(var a=t.length/4+2,i=Math.ceil(a/16),c=new Array(i),u=0;u<i;++u){for(var s=new Uint32Array(16),l=0;l<16;++l)s[l]=t[64*u+4*l]<<24|t[64*u+4*l+1]<<16|t[64*u+4*l+2]<<8|t[64*u+4*l+3];c[u]=s}c[i-1][14]=8*(t.length-1)/Math.pow(2,32),c[i-1][14]=Math.floor(c[i-1][14]),c[i-1][15]=8*(t.length-1)&4294967295;for(var f=0;f<i;++f){for(var p=new Uint32Array(80),y=0;y<16;++y)p[y]=c[f][y];for(var v=16;v<80;++v)p[v]=d(p[v-3]^p[v-8]^p[v-14]^p[v-16],1);for(var g=r[0],m=r[1],w=r[2],b=r[3],_=r[4],E=0;E<80;++E){var O=Math.floor(E/20),P=d(g,5)+h(O,m,w,b)+_+e[O]+p[E]>>>0;_=b,b=w,w=d(m,30)>>>0,m=g,g=P}r[0]=r[0]+g>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+w>>>0,r[3]=r[3]+b>>>0,r[4]=r[4]+_>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]})),v=y,g="9ad1c8c2-539a-4d52-9640-4f59254ba745",m=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.place_details,n=t.geometry;return e(e(e({locationId:t.id,id:t.id,locationType:null,type:null,street:"",city:"",postCode:"",country:"",countryCode:"",locationName:t.name||"",name:t.name||"",establishmentType:t.types||[],addressType:""},"object"===typeof n&&{longitude:n.location?n.location.lng():"",latitude:n.location?n.location.lat():""}),r&&"object"===typeof r&&{phoneNo:r.international_phone_number||"",openingHours:r.opening_hours||null,website:r.website||"",formattedAddress:r.formatted_address}),{},{businessStatus:t.business_status,placeId:t.place_id})},w=c((function t(){var n=this,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.initializeGooglePlacesService=function(){return new Promise((function(t,e){var r=n.serviceParameters.apiKey,o=document.createElement("script");o.src="https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places&key=".concat(r,"&callback=Function.prototype"),o.addEventListener("load",(function(){return t(window.google)})),o.addEventListener("error",(function(t){return e(t)})),document.head.appendChild(o)})).then((function(){var t=document.createElement("div");t.setAttribute("id","googlePlacesMap"),document.body.appendChild(t);var e=new window.google.maps.Map(document.getElementById("googlePlacesMap"),{center:{lat:53.5584898,lng:9.7873983},zoom:13});return new window.google.maps.places.PlacesService(e)}))},this.searchPlaces=function(){var t=a(r().mark((function t(o){var a,i,c,u,s,l,f,p,h,d;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.placesServicePromise;case 2:return a=t.sent,i=o.searchQuery,c=o.latitude,u=o.longitude,s=o.viewport,l=o.placeTypes,f=void 0===l?[]:l,p=o.locationRadius,h=void 0===p?3e4:p,d=s?new window.google.maps.LatLngBounds({lat:s.southwest.latitude,lng:s.southwest.longitude},{lat:s.northeast.latitude,lng:s.northeast.longitude}):null,t.abrupt("return",new Promise((function(t,r){var o=i?function(t,e){return a.textSearch(t,e)}:function(t,e){return a.nearbySearch(t,e)};o(e(e(e(e({},!!i&&{query:i}),!!s&&{location:{lat:c,lng:u}}),s?{bounds:d}:{radius:h}),{},{type:f}),(function(e,o){if(o===window.google.maps.places.PlacesServiceStatus.OK||o===window.google.maps.places.PlacesServiceStatus.ZERO_RESULTS)if(o!==window.google.maps.places.PlacesServiceStatus.ZERO_RESULTS){var a=e.map((function(t){var e="".concat(t.geometry.location.lng()).concat(t.geometry.location.lat());return t.id="".concat(v(e,g),"--").concat(v(t.place_id,g)),t})).slice(0,10);Promise.all(a.map((function(t){return n.getPlaceDetails(t.id,t.place_id,["formatted_address","international_phone_number","opening_hours","utc_offset_minutes","types","place_id","website"])}))).then((function(e){var r=a.map((function(t){var r=e.find((function(e){return e.id===t.id}));return t.place_details=r.placeDetails,t}));t(r)})).catch((function(t){r(t)}))}else t([]);else r(o)}))})).catch((function(t){return{status:t}})).then((function(t){return{googlePlaceDTOs:t.map((function(t){return m(t)}))}})));case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.getPlaceDetails=function(){var t=a(r().mark((function t(e,o){var a,i,c=arguments;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=c.length>2&&void 0!==c[2]?c[2]:[],t.next=3,n.placesServicePromise;case 3:return i=t.sent,t.abrupt("return",new Promise((function(t,e){i.getDetails({placeId:o,fields:a},(function(r,n){return n===window.google.maps.places.PlacesServiceStatus.OK&&r?t(r):e(n)}))})).then((function(t){return{id:e,placeDetails:t}})).catch((function(t){return{id:e,placeDetails:null}})));case 5:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),this.serviceParameters=e({},o),this.placesServicePromise=this.initializeGooglePlacesService(),{searchPlaces:this.searchPlaces,getPlaceDetails:this.getPlaceDetails}}));exports.GooglePlacesClient=w,exports.placeTypes={ACCOUNTING:"accounting",AIRPORT:"airport",ATM:"atm",BANK:"bank",BICYCLE_STORE:"bicycle_store",BUS_STATION:"bus_station",CAR_DEALER:"car_dealer",CAR_RENTAL:"car_rental",CAR_REPAIR:"car_repair",CAR_WASH:"car_wash",CEMETERY:"cemetery",CITY_HALL:"city_hall",COURTHOUSE:"courthouse",DOCTOR:"doctor",DRUGSTORE:"drugstore",ELECTRICIAN:"electrician",FUNERAL_HOME:"funeral_home",GAS_STATION:"gas_station",HOSPITAL:"hospital",INSURANCE_AGENCY:"insurance_agency",LAWYER:"lawyer",LIGHT_RAIL_STATION:"light_rail_station",LOCAL_GOVERNMENT_OFFICE:"local_government_office",LOCKSMITH:"locksmith",LODGING:"lodging",MOVING_COMPANY:"moving_company",PARKING:"parking",PHARMACY:"pharmacy",PHYSIOTHERAPIST:"physiotherapist",PLUMBER:"plumber",POLICE:"police",POST_OFFICE:"post_office",RV_PARK:"rv_park",STORAGE:"storage",STORE:"store",SUBWAY_STATION:"subway_station",TAXI_STAND:"taxi_stand",TRAIN_STATION:"train_station",TRANSIT_STATION:"transit_station",VETERINARY_CARE:"veterinary_care"};
"use strict";function t(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function e(e){return function(){var r=this,n=arguments;return new Promise((function(o,a){var i=e.apply(r,n);function c(e){t(i,o,a,c,u,"next",e)}function u(e){t(i,o,a,c,u,"throw",e)}c(void 0)}))}}function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}}function n(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function o(t,e,r){return(e=u(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?a(Object(r),!0).forEach((function(e){o(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function c(){c=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var a=e&&e.prototype instanceof m?e:m,i=Object.create(a.prototype),c=new N(n||[]);return o(i,"_invoke",{value:A(t,r,c)}),i}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var h="suspendedStart",d="suspendedYield",y="executing",v="completed",g={};function m(){}function w(){}function b(){}var _={};l(_,i,(function(){return this}));var E=Object.getPrototypeOf,O=E&&E(E(C([])));O&&O!==r&&n.call(O,i)&&(_=O);var P=b.prototype=m.prototype=Object.create(_);function S(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function r(o,a,i,c){var u=p(t[o],t,a);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(l).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function A(e,r,n){var o=h;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=L(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var s=p(e,r,n);if("normal"===s.type){if(o=n.done?v:d,s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=v,n.method="throw",n.arg=s.arg)}}}function L(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,L(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=p(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function C(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(typeof e+" is not iterable")}return w.prototype=b,o(P,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:w,configurable:!0}),w.displayName=l(b,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,s,"GeneratorFunction")),t.prototype=Object.create(P),t},e.awrap=function(t){return{__await:t}},S(T.prototype),l(T.prototype,u,(function(){return this})),e.AsyncIterator=T,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new T(f(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},S(P),l(P,s,"Generator"),l(P,i,(function(){return this})),l(P,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=C,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(R),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;R(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function u(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}var s=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function l(t){return"string"===typeof t&&s.test(t)}for(var f=[],p=0;p<256;++p)f.push((p+256).toString(16).substr(1));function h(t,e,r,n){switch(t){case 0:return e&r^~e&n;case 1:case 3:return e^r^n;case 2:return e&r^e&n^r&n}}function d(t,e){return t<<e|t>>>32-e}var y=function(t,e,r){function n(t,n,o,a){if("string"===typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e}(t)),"string"===typeof n&&(n=function(t){if(!l(t))throw TypeError("Invalid UUID");var e,r=new Uint8Array(16);return r[0]=(e=parseInt(t.slice(0,8),16))>>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=255&e,r[4]=(e=parseInt(t.slice(9,13),16))>>>8,r[5]=255&e,r[6]=(e=parseInt(t.slice(14,18),16))>>>8,r[7]=255&e,r[8]=(e=parseInt(t.slice(19,23),16))>>>8,r[9]=255&e,r[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,r[11]=e/4294967296&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=255&e,r}(n)),16!==n.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var i=new Uint8Array(16+t.length);if(i.set(n),i.set(t,n.length),(i=r(i))[6]=15&i[6]|e,i[8]=63&i[8]|128,o){a=a||0;for(var c=0;c<16;++c)o[a+c]=i[c];return o}return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(f[t[e+0]]+f[t[e+1]]+f[t[e+2]]+f[t[e+3]]+"-"+f[t[e+4]]+f[t[e+5]]+"-"+f[t[e+6]]+f[t[e+7]]+"-"+f[t[e+8]]+f[t[e+9]]+"-"+f[t[e+10]]+f[t[e+11]]+f[t[e+12]]+f[t[e+13]]+f[t[e+14]]+f[t[e+15]]).toLowerCase();if(!l(r))throw TypeError("Stringified UUID is invalid");return r}(i)}try{n.name=t}catch(o){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}("v5",80,(function(t){var e=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"===typeof t){var n=unescape(encodeURIComponent(t));t=[];for(var o=0;o<n.length;++o)t.push(n.charCodeAt(o))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);for(var a=t.length/4+2,i=Math.ceil(a/16),c=new Array(i),u=0;u<i;++u){for(var s=new Uint32Array(16),l=0;l<16;++l)s[l]=t[64*u+4*l]<<24|t[64*u+4*l+1]<<16|t[64*u+4*l+2]<<8|t[64*u+4*l+3];c[u]=s}c[i-1][14]=8*(t.length-1)/Math.pow(2,32),c[i-1][14]=Math.floor(c[i-1][14]),c[i-1][15]=8*(t.length-1)&4294967295;for(var f=0;f<i;++f){for(var p=new Uint32Array(80),y=0;y<16;++y)p[y]=c[f][y];for(var v=16;v<80;++v)p[v]=d(p[v-3]^p[v-8]^p[v-14]^p[v-16],1);for(var g=r[0],m=r[1],w=r[2],b=r[3],_=r[4],E=0;E<80;++E){var O=Math.floor(E/20),P=d(g,5)+h(O,m,w,b)+_+e[O]+p[E]>>>0;_=b,b=w,w=d(m,30)>>>0,m=g,g=P}r[0]=r[0]+g>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+w>>>0,r[3]=r[3]+b>>>0,r[4]=r[4]+_>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]})),v=y,g="9ad1c8c2-539a-4d52-9640-4f59254ba745",m=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.place_details,r=t.geometry;return i(i(i({locationId:t.id,id:t.id,locationType:null,type:null,street:"",city:"",postCode:"",country:"",countryCode:"",locationName:t.name||"",name:t.name||"",establishmentType:t.types||[],addressType:""},"object"===typeof r&&{longitude:r.location?r.location.lng():"",latitude:r.location?r.location.lat():""}),e&&"object"===typeof e&&{phoneNo:e.international_phone_number||"",openingHours:e.opening_hours||null,website:e.website||"",formattedAddress:e.formatted_address}),{},{businessStatus:t.business_status,placeId:t.place_id})},w=n((function t(){var r=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.initializeGooglePlacesService=function(){return new Promise((function(t,e){var n=r.serviceParameters.apiKey,o=document.createElement("script");o.src="https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places&key=".concat(n,"&callback=Function.prototype"),o.addEventListener("load",(function(){return t(window.google)})),o.addEventListener("error",(function(t){return e(t)})),document.head.appendChild(o)})).then((function(){var t=document.createElement("div");t.setAttribute("id","googlePlacesMap"),document.body.appendChild(t);var e=new window.google.maps.Map(document.getElementById("googlePlacesMap"),{center:{lat:53.5584898,lng:9.7873983},zoom:13});return new window.google.maps.places.PlacesService(e)}))},this.searchPlaces=function(){var t=e(c().mark((function t(e){var n,o,a,u,s,l,f,p,h,d;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.placesServicePromise;case 2:return n=t.sent,o=e.searchQuery,a=e.latitude,u=e.longitude,s=e.viewport,l=e.placeTypes,f=void 0===l?[]:l,p=e.locationRadius,h=void 0===p?3e4:p,d=s?new window.google.maps.LatLngBounds({lat:s.southwest.latitude,lng:s.southwest.longitude},{lat:s.northeast.latitude,lng:s.northeast.longitude}):null,t.abrupt("return",new Promise((function(t,e){var c=o?function(t,e){return n.textSearch(t,e)}:function(t,e){return n.nearbySearch(t,e)};c(i(i(i(i({},!!o&&{query:o}),!!s&&{location:{lat:a,lng:u}}),s?{bounds:d}:{radius:h}),{},{type:f}),(function(n,o){if(o===window.google.maps.places.PlacesServiceStatus.OK||o===window.google.maps.places.PlacesServiceStatus.ZERO_RESULTS)if(o!==window.google.maps.places.PlacesServiceStatus.ZERO_RESULTS){var a=n.map((function(t){var e="".concat(t.geometry.location.lng()).concat(t.geometry.location.lat());return t.id="".concat(v(e,g),"--").concat(v(t.place_id,g)),t})).slice(0,10);Promise.all(a.map((function(t){return r.getPlaceDetails(t.id,t.place_id,["formatted_address","international_phone_number","opening_hours","utc_offset_minutes","types","place_id","website"])}))).then((function(e){var r=a.map((function(t){var r=e.find((function(e){return e.id===t.id}));return t.place_details=r.placeDetails,t}));t(r)})).catch((function(t){e(t)}))}else t([]);else e(o)}))})).catch((function(t){return{status:t}})).then((function(t){return{googlePlaceDTOs:t.map((function(t){return m(t)}))}})));case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.getPlaceDetails=function(){var t=e(c().mark((function t(e,n){var o,a,i=arguments;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=i.length>2&&void 0!==i[2]?i[2]:[],t.next=3,r.placesServicePromise;case 3:return a=t.sent,t.abrupt("return",new Promise((function(t,e){a.getDetails({placeId:n,fields:o},(function(r,n){return n===window.google.maps.places.PlacesServiceStatus.OK&&r?t(r):e(n)}))})).then((function(t){return{id:e,placeDetails:t}})).catch((function(t){return{id:e,placeDetails:null}})));case 5:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),this.serviceParameters=i({},n),this.placesServicePromise=this.initializeGooglePlacesService(),{searchPlaces:this.searchPlaces,getPlaceDetails:this.getPlaceDetails}}));exports.GooglePlacesClient=w,exports.placeTypes={ACCOUNTING:"accounting",AIRPORT:"airport",ATM:"atm",BANK:"bank",BICYCLE_STORE:"bicycle_store",BUS_STATION:"bus_station",CAR_DEALER:"car_dealer",CAR_RENTAL:"car_rental",CAR_REPAIR:"car_repair",CAR_WASH:"car_wash",CEMETERY:"cemetery",CITY_HALL:"city_hall",COURTHOUSE:"courthouse",DOCTOR:"doctor",DRUGSTORE:"drugstore",ELECTRICIAN:"electrician",FUNERAL_HOME:"funeral_home",GAS_STATION:"gas_station",HOSPITAL:"hospital",INSURANCE_AGENCY:"insurance_agency",LAWYER:"lawyer",LIGHT_RAIL_STATION:"light_rail_station",LOCAL_GOVERNMENT_OFFICE:"local_government_office",LOCKSMITH:"locksmith",LODGING:"lodging",MOVING_COMPANY:"moving_company",PARKING:"parking",PHARMACY:"pharmacy",PHYSIOTHERAPIST:"physiotherapist",PLUMBER:"plumber",POLICE:"police",POST_OFFICE:"post_office",RV_PARK:"rv_park",STORAGE:"storage",STORE:"store",SUBWAY_STATION:"subway_station",TAXI_STAND:"taxi_stand",TRAIN_STATION:"train_station",TRANSIT_STATION:"transit_station",VETERINARY_CARE:"veterinary_care"};
//# sourceMappingURL=index.js.map
{
"name": "@ace-de/eua-google-places-client",
"version": "2.0.1",
"version": "2.0.2",
"description": "EUA Google Places client",

@@ -33,3 +33,3 @@ "author": "Computer Rock",

},
"gitHead": "78ac00a1ac41aace4f5dc45b96b0fe6a0d11db28"
"gitHead": "a9f78f4e0ea8e88d822dfe4b81ecb0827a451a80"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc