@ace-de/eua-google-places-client
Advanced tools
Comparing version 0.4.1 to 0.4.2
@@ -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){a(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(t,e,r,n,o,a,i){try{var c=t[a](i),s=c.value}catch(u){return void r(u)}c.done?e(s):Promise.resolve(s).then(n,o)}function n(t){return function(){var e=this,n=arguments;return new Promise((function(o,a){var i=t.apply(e,n);function c(t){r(i,o,a,c,s,"next",t)}function s(t){r(i,o,a,c,s,"throw",t)}c(void 0)}))}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var i=function(t){var e={exports:{}};return t(e,e.exports),e.exports}((function(t){var e=function(t){var e,r=Object.prototype,n=r.hasOwnProperty,o="function"===typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(x){s=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,a=Object.create(o.prototype),i=new L(n||[]);return a._invoke=function(t,e,r){var n=f;return function(o,a){if(n===p)throw new Error("Generator is already running");if(n===v){if("throw"===o)throw a;return I()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var c=P(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var s=l(t,e,r);if("normal"===s.type){if(n=r.done?v:h,s.arg===d)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=v,r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(x){return{type:"throw",arg:x}}}t.wrap=u;var f="suspendedStart",h="suspendedYield",p="executing",v="completed",d={};function y(){}function g(){}function m(){}var w={};s(w,a,(function(){return this}));var _=Object.getPrototypeOf,E=_&&_(_(R([])));E&&E!==r&&n.call(E,a)&&(w=E);var b=m.prototype=y.prototype=Object.create(w);function O(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(o,a,i,c){var s=l(t[o],t,a);if("throw"!==s.type){var u=s.arg,f=u.value;return f&&"object"===typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){u.value=t,i(u)}),(function(t){return r("throw",t,i,c)}))}c(s.arg)}var o;this._invoke=function(t,n){function a(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(a,a):a()}}function P(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method))return d;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var o=l(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function S(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 T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function R(t){if(t){var r=t[a];if(r)return r.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}return{next:I}}function I(){return{value:e,done:!0}}return g.prototype=m,s(b,"constructor",m),s(m,"constructor",g),g.displayName=s(m,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,s(t,c,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},O(A.prototype),s(A.prototype,i,(function(){return this})),t.AsyncIterator=A,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new A(u(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},O(b),s(b,c,"Generator"),s(b,a,(function(){return this})),s(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=R,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!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 s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!u)throw new 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,d):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),d},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),T(r),d}},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;T(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),d}},t}(t.exports);try{regeneratorRuntime=e}catch(r){"object"===typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}})),c=i,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 u(t){return"string"===typeof t&&s.test(t)}for(var l=[],f=0;f<256;++f)l.push((f+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 p(t,e){return t<<e|t>>>32-e}var v=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(!u(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=(l[t[e+0]]+l[t[e+1]]+l[t[e+2]]+l[t[e+3]]+"-"+l[t[e+4]]+l[t[e+5]]+"-"+l[t[e+6]]+l[t[e+7]]+"-"+l[t[e+8]]+l[t[e+9]]+"-"+l[t[e+10]]+l[t[e+11]]+l[t[e+12]]+l[t[e+13]]+l[t[e+14]]+l[t[e+15]]).toLowerCase();if(!u(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),s=0;s<i;++s){for(var u=new Uint32Array(16),l=0;l<16;++l)u[l]=t[64*s+4*l]<<24|t[64*s+4*l+1]<<16|t[64*s+4*l+2]<<8|t[64*s+4*l+3];c[s]=u}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 v=new Uint32Array(80),d=0;d<16;++d)v[d]=c[f][d];for(var y=16;y<80;++y)v[y]=p(v[y-3]^v[y-8]^v[y-14]^v[y-16],1);for(var g=r[0],m=r[1],w=r[2],_=r[3],E=r[4],b=0;b<80;++b){var O=Math.floor(b/20),A=p(g,5)+h(O,m,w,_)+E+e[O]+v[b]>>>0;E=_,_=w,w=p(m,30)>>>0,m=g,g=A}r[0]=r[0]+g>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+w>>>0,r[3]=r[3]+_>>>0,r[4]=r[4]+E>>>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]]})),d=v,y="9ad1c8c2-539a-4d52-9640-4f59254ba745",g=function t(){var r=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(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),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=n(c.mark((function t(n){var o,a,i,s,u,l,f,h;return c.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.placesServicePromise;case 2:return o=t.sent,a=n.searchQuery,i=n.latitude,s=n.longitude,u=n.placeTypes,l=void 0===u?[]:u,f=n.locationRadius,h=void 0===f?3e4:f,t.abrupt("return",new Promise((function(t,n){var c=a?function(t,e){return o.textSearch(t,e)}:function(t,e){return o.nearbySearch(t,e)};c(e(e({},!!a&&{searchQuery:a}),{},{location:{lat:i,lng:s},radius:h,type:l}),(function(o,a){a!==window.google.maps.places.PlacesServiceStatus.OK&&a!==window.google.maps.places.PlacesServiceStatus.ZERO_RESULTS&&n(a),a===window.google.maps.places.PlacesServiceStatus.ZERO_RESULTS&&t([]);var i=o.map((function(t){var r="".concat(t.geometry.location.lng()).concat(t.geometry.location.lat());return e({id:d(r,y)},t)})).slice(0,10);Promise.all(i.map((function(t){return r.getPlaceDetails(t.id,t.place_id,["formatted_address","international_phone_number","opening_hours","types","place_id","website"])}))).then((function(r){var n=i.map((function(t){var n=r.find((function(e){return e.id===t.id}));return e(e({},t),{},{place_details:n.placeDetails})}));t(n)})).catch((function(t){n(t)}))}))})).then((function(t){return{googlePlaceDTOs:t}})));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.getPlaceDetails=function(){var t=n(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=e({},a),this.placesServicePromise=this.initializeGooglePlacesService(),{searchPlaces:this.searchPlaces,getPlaceDetails:this.getPlaceDetails}},m={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{g as GooglePlacesClient,m as placeTypes}; | ||
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){a(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(t,e,r,n,o,a,i){try{var c=t[a](i),s=c.value}catch(u){return void r(u)}c.done?e(s):Promise.resolve(s).then(n,o)}function n(t){return function(){var e=this,n=arguments;return new Promise((function(o,a){var i=t.apply(e,n);function c(t){r(i,o,a,c,s,"next",t)}function s(t){r(i,o,a,c,s,"throw",t)}c(void 0)}))}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var i=function(t){var e={exports:{}};return t(e,e.exports),e.exports}((function(t){var e=function(t){var e,r=Object.prototype,n=r.hasOwnProperty,o="function"===typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(x){s=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),i=new L(n||[]);return a._invoke=function(t,e,r){var n=f;return function(o,a){if(n===p)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw a;return R()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var c=T(i,r);if(c){if(c===y)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var s=l(t,e,r);if("normal"===s.type){if(n=r.done?d:h,s.arg===y)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=d,r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(x){return{type:"throw",arg:x}}}t.wrap=u;var f="suspendedStart",h="suspendedYield",p="executing",d="completed",y={};function v(){}function g(){}function m(){}var w={};s(w,a,(function(){return this}));var _=Object.getPrototypeOf,b=_&&_(_(I([])));b&&b!==r&&n.call(b,a)&&(w=b);var E=m.prototype=v.prototype=Object.create(w);function O(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(o,a,i,c){var s=l(t[o],t,a);if("throw"!==s.type){var u=s.arg,f=u.value;return f&&"object"===typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){u.value=t,i(u)}),(function(t){return r("throw",t,i,c)}))}c(s.arg)}var o;this._invoke=function(t,n){function a(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(a,a):a()}}function T(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,T(t,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var o=l(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function P(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 S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function I(t){if(t){var r=t[a];if(r)return r.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}return{next:R}}function R(){return{value:e,done:!0}}return g.prototype=m,s(E,"constructor",m),s(m,"constructor",g),g.displayName=s(m,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,s(t,c,"GeneratorFunction")),t.prototype=Object.create(E),t},t.awrap=function(t){return{__await:t}},O(A.prototype),s(A.prototype,i,(function(){return this})),t.AsyncIterator=A,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new A(u(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},O(E),s(E,c,"Generator"),s(E,a,(function(){return this})),s(E,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=I,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(S),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!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 s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!u)throw new 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,y):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),y},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),S(r),y}},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;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:I(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}(t.exports);try{regeneratorRuntime=e}catch(r){"object"===typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}})),c=i,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 u(t){return"string"===typeof t&&s.test(t)}for(var l=[],f=0;f<256;++f)l.push((f+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 p(t,e){return t<<e|t>>>32-e}var d=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(!u(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=(l[t[e+0]]+l[t[e+1]]+l[t[e+2]]+l[t[e+3]]+"-"+l[t[e+4]]+l[t[e+5]]+"-"+l[t[e+6]]+l[t[e+7]]+"-"+l[t[e+8]]+l[t[e+9]]+"-"+l[t[e+10]]+l[t[e+11]]+l[t[e+12]]+l[t[e+13]]+l[t[e+14]]+l[t[e+15]]).toLowerCase();if(!u(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),s=0;s<i;++s){for(var u=new Uint32Array(16),l=0;l<16;++l)u[l]=t[64*s+4*l]<<24|t[64*s+4*l+1]<<16|t[64*s+4*l+2]<<8|t[64*s+4*l+3];c[s]=u}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 d=new Uint32Array(80),y=0;y<16;++y)d[y]=c[f][y];for(var v=16;v<80;++v)d[v]=p(d[v-3]^d[v-8]^d[v-14]^d[v-16],1);for(var g=r[0],m=r[1],w=r[2],_=r[3],b=r[4],E=0;E<80;++E){var O=Math.floor(E/20),A=p(g,5)+h(O,m,w,_)+b+e[O]+d[E]>>>0;b=_,_=w,w=p(m,30)>>>0,m=g,g=A}r[0]=r[0]+g>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+w>>>0,r[3]=r[3]+_>>>0,r[4]=r[4]+b>>>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]]})),y=d,v="9ad1c8c2-539a-4d52-9640-4f59254ba745",g=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,locationType:null,street:"",city:"",postCode:"",country:"",countryCode:"",locationName: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})},m=function t(){var r=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(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),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=n(c.mark((function t(n){var o,a,i,s,u,l,f,h;return c.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.placesServicePromise;case 2:return o=t.sent,a=n.searchQuery,i=n.latitude,s=n.longitude,u=n.placeTypes,l=void 0===u?[]:u,f=n.locationRadius,h=void 0===f?3e4:f,t.abrupt("return",new Promise((function(t,n){var c=a?function(t,e){return o.textSearch(t,e)}:function(t,e){return o.nearbySearch(t,e)};c(e(e({},!!a&&{searchQuery:a}),{},{location:{lat:i,lng:s},radius:h,type:l}),(function(o,a){a!==window.google.maps.places.PlacesServiceStatus.OK&&a!==window.google.maps.places.PlacesServiceStatus.ZERO_RESULTS&&n(a),a===window.google.maps.places.PlacesServiceStatus.ZERO_RESULTS&&t([]);var i=o.map((function(t){var r="".concat(t.geometry.location.lng()).concat(t.geometry.location.lat());return e({id:y(r,v)},t)})).slice(0,10);Promise.all(i.map((function(t){return r.getPlaceDetails(t.id,t.place_id,["formatted_address","international_phone_number","opening_hours","types","place_id","website"])}))).then((function(r){var n=i.map((function(t){var n=r.find((function(e){return e.id===t.id}));return e(e({},t),{},{place_details:n.placeDetails})}));t(n)})).catch((function(t){n(t)}))}))})).then((function(t){return{googlePlaceDTOs:t.map((function(t){return g(t)}))}})));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.getPlaceDetails=function(){var t=n(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=e({},a),this.placesServicePromise=this.initializeGooglePlacesService(),{searchPlaces:this.searchPlaces,getPlaceDetails:this.getPlaceDetails}},w={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{m as GooglePlacesClient,w 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){a(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(t,e,r,n,o,a,i){try{var c=t[a](i),s=c.value}catch(u){return void r(u)}c.done?e(s):Promise.resolve(s).then(n,o)}function n(t){return function(){var e=this,n=arguments;return new Promise((function(o,a){var i=t.apply(e,n);function c(t){r(i,o,a,c,s,"next",t)}function s(t){r(i,o,a,c,s,"throw",t)}c(void 0)}))}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}Object.defineProperty(exports,"__esModule",{value:!0});var i=function(t){var e={exports:{}};return t(e,e.exports),e.exports}((function(t){var e=function(t){var e,r=Object.prototype,n=r.hasOwnProperty,o="function"===typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(x){s=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,a=Object.create(o.prototype),i=new L(n||[]);return a._invoke=function(t,e,r){var n=f;return function(o,a){if(n===p)throw new Error("Generator is already running");if(n===v){if("throw"===o)throw a;return I()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var c=A(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var s=l(t,e,r);if("normal"===s.type){if(n=r.done?v:h,s.arg===d)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=v,r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(x){return{type:"throw",arg:x}}}t.wrap=u;var f="suspendedStart",h="suspendedYield",p="executing",v="completed",d={};function y(){}function g(){}function m(){}var w={};s(w,a,(function(){return this}));var _=Object.getPrototypeOf,b=_&&_(_(R([])));b&&b!==r&&n.call(b,a)&&(w=b);var E=m.prototype=y.prototype=Object.create(w);function O(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function P(t,e){function r(o,a,i,c){var s=l(t[o],t,a);if("throw"!==s.type){var u=s.arg,f=u.value;return f&&"object"===typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){u.value=t,i(u)}),(function(t){return r("throw",t,i,c)}))}c(s.arg)}var o;this._invoke=function(t,n){function a(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(a,a):a()}}function A(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,A(t,r),"throw"===r.method))return d;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var o=l(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function S(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 T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function R(t){if(t){var r=t[a];if(r)return r.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}return{next:I}}function I(){return{value:e,done:!0}}return g.prototype=m,s(E,"constructor",m),s(m,"constructor",g),g.displayName=s(m,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,s(t,c,"GeneratorFunction")),t.prototype=Object.create(E),t},t.awrap=function(t){return{__await:t}},O(P.prototype),s(P.prototype,i,(function(){return this})),t.AsyncIterator=P,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new P(u(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},O(E),s(E,c,"Generator"),s(E,a,(function(){return this})),s(E,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=R,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!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 s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!u)throw new 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,d):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),d},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),T(r),d}},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;T(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),d}},t}(t.exports);try{regeneratorRuntime=e}catch(r){"object"===typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}})),c=i,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 u(t){return"string"===typeof t&&s.test(t)}for(var l=[],f=0;f<256;++f)l.push((f+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 p(t,e){return t<<e|t>>>32-e}var v=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(!u(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=(l[t[e+0]]+l[t[e+1]]+l[t[e+2]]+l[t[e+3]]+"-"+l[t[e+4]]+l[t[e+5]]+"-"+l[t[e+6]]+l[t[e+7]]+"-"+l[t[e+8]]+l[t[e+9]]+"-"+l[t[e+10]]+l[t[e+11]]+l[t[e+12]]+l[t[e+13]]+l[t[e+14]]+l[t[e+15]]).toLowerCase();if(!u(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),s=0;s<i;++s){for(var u=new Uint32Array(16),l=0;l<16;++l)u[l]=t[64*s+4*l]<<24|t[64*s+4*l+1]<<16|t[64*s+4*l+2]<<8|t[64*s+4*l+3];c[s]=u}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 v=new Uint32Array(80),d=0;d<16;++d)v[d]=c[f][d];for(var y=16;y<80;++y)v[y]=p(v[y-3]^v[y-8]^v[y-14]^v[y-16],1);for(var g=r[0],m=r[1],w=r[2],_=r[3],b=r[4],E=0;E<80;++E){var O=Math.floor(E/20),P=p(g,5)+h(O,m,w,_)+b+e[O]+v[E]>>>0;b=_,_=w,w=p(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]+_>>>0,r[4]=r[4]+b>>>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]]})),d=v,y="9ad1c8c2-539a-4d52-9640-4f59254ba745";exports.GooglePlacesClient=function t(){var r=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(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),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=n(c.mark((function t(n){var o,a,i,s,u,l,f,h;return c.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.placesServicePromise;case 2:return o=t.sent,a=n.searchQuery,i=n.latitude,s=n.longitude,u=n.placeTypes,l=void 0===u?[]:u,f=n.locationRadius,h=void 0===f?3e4:f,t.abrupt("return",new Promise((function(t,n){var c=a?function(t,e){return o.textSearch(t,e)}:function(t,e){return o.nearbySearch(t,e)};c(e(e({},!!a&&{searchQuery:a}),{},{location:{lat:i,lng:s},radius:h,type:l}),(function(o,a){a!==window.google.maps.places.PlacesServiceStatus.OK&&a!==window.google.maps.places.PlacesServiceStatus.ZERO_RESULTS&&n(a),a===window.google.maps.places.PlacesServiceStatus.ZERO_RESULTS&&t([]);var i=o.map((function(t){var r="".concat(t.geometry.location.lng()).concat(t.geometry.location.lat());return e({id:d(r,y)},t)})).slice(0,10);Promise.all(i.map((function(t){return r.getPlaceDetails(t.id,t.place_id,["formatted_address","international_phone_number","opening_hours","types","place_id","website"])}))).then((function(r){var n=i.map((function(t){var n=r.find((function(e){return e.id===t.id}));return e(e({},t),{},{place_details:n.placeDetails})}));t(n)})).catch((function(t){n(t)}))}))})).then((function(t){return{googlePlaceDTOs:t}})));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.getPlaceDetails=function(){var t=n(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=e({},a),this.placesServicePromise=this.initializeGooglePlacesService(),{searchPlaces:this.searchPlaces,getPlaceDetails:this.getPlaceDetails}},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){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){a(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(t,e,r,n,o,a,i){try{var c=t[a](i),s=c.value}catch(u){return void r(u)}c.done?e(s):Promise.resolve(s).then(n,o)}function n(t){return function(){var e=this,n=arguments;return new Promise((function(o,a){var i=t.apply(e,n);function c(t){r(i,o,a,c,s,"next",t)}function s(t){r(i,o,a,c,s,"throw",t)}c(void 0)}))}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}Object.defineProperty(exports,"__esModule",{value:!0});var i=function(t){var e={exports:{}};return t(e,e.exports),e.exports}((function(t){var e=function(t){var e,r=Object.prototype,n=r.hasOwnProperty,o="function"===typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(x){s=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),i=new L(n||[]);return a._invoke=function(t,e,r){var n=f;return function(o,a){if(n===h)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw a;return R()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var c=T(i,r);if(c){if(c===y)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var s=l(t,e,r);if("normal"===s.type){if(n=r.done?d:p,s.arg===y)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=d,r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(x){return{type:"throw",arg:x}}}t.wrap=u;var f="suspendedStart",p="suspendedYield",h="executing",d="completed",y={};function v(){}function g(){}function m(){}var w={};s(w,a,(function(){return this}));var _=Object.getPrototypeOf,b=_&&_(_(I([])));b&&b!==r&&n.call(b,a)&&(w=b);var E=m.prototype=v.prototype=Object.create(w);function O(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function P(t,e){function r(o,a,i,c){var s=l(t[o],t,a);if("throw"!==s.type){var u=s.arg,f=u.value;return f&&"object"===typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){u.value=t,i(u)}),(function(t){return r("throw",t,i,c)}))}c(s.arg)}var o;this._invoke=function(t,n){function a(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(a,a):a()}}function T(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,T(t,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var o=l(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function A(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 S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function I(t){if(t){var r=t[a];if(r)return r.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}return{next:R}}function R(){return{value:e,done:!0}}return g.prototype=m,s(E,"constructor",m),s(m,"constructor",g),g.displayName=s(m,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,s(t,c,"GeneratorFunction")),t.prototype=Object.create(E),t},t.awrap=function(t){return{__await:t}},O(P.prototype),s(P.prototype,i,(function(){return this})),t.AsyncIterator=P,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new P(u(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},O(E),s(E,c,"Generator"),s(E,a,(function(){return this})),s(E,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=I,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(S),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!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 s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!u)throw new 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,y):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),y},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),S(r),y}},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;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:I(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}(t.exports);try{regeneratorRuntime=e}catch(r){"object"===typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}})),c=i,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 u(t){return"string"===typeof t&&s.test(t)}for(var l=[],f=0;f<256;++f)l.push((f+256).toString(16).substr(1));function p(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 h(t,e){return t<<e|t>>>32-e}var d=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(!u(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=(l[t[e+0]]+l[t[e+1]]+l[t[e+2]]+l[t[e+3]]+"-"+l[t[e+4]]+l[t[e+5]]+"-"+l[t[e+6]]+l[t[e+7]]+"-"+l[t[e+8]]+l[t[e+9]]+"-"+l[t[e+10]]+l[t[e+11]]+l[t[e+12]]+l[t[e+13]]+l[t[e+14]]+l[t[e+15]]).toLowerCase();if(!u(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),s=0;s<i;++s){for(var u=new Uint32Array(16),l=0;l<16;++l)u[l]=t[64*s+4*l]<<24|t[64*s+4*l+1]<<16|t[64*s+4*l+2]<<8|t[64*s+4*l+3];c[s]=u}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 d=new Uint32Array(80),y=0;y<16;++y)d[y]=c[f][y];for(var v=16;v<80;++v)d[v]=h(d[v-3]^d[v-8]^d[v-14]^d[v-16],1);for(var g=r[0],m=r[1],w=r[2],_=r[3],b=r[4],E=0;E<80;++E){var O=Math.floor(E/20),P=h(g,5)+p(O,m,w,_)+b+e[O]+d[E]>>>0;b=_,_=w,w=h(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]+_>>>0,r[4]=r[4]+b>>>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]]})),y=d,v="9ad1c8c2-539a-4d52-9640-4f59254ba745",g=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,locationType:null,street:"",city:"",postCode:"",country:"",countryCode:"",locationName: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})};exports.GooglePlacesClient=function t(){var r=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(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),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=n(c.mark((function t(n){var o,a,i,s,u,l,f,p;return c.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.placesServicePromise;case 2:return o=t.sent,a=n.searchQuery,i=n.latitude,s=n.longitude,u=n.placeTypes,l=void 0===u?[]:u,f=n.locationRadius,p=void 0===f?3e4:f,t.abrupt("return",new Promise((function(t,n){var c=a?function(t,e){return o.textSearch(t,e)}:function(t,e){return o.nearbySearch(t,e)};c(e(e({},!!a&&{searchQuery:a}),{},{location:{lat:i,lng:s},radius:p,type:l}),(function(o,a){a!==window.google.maps.places.PlacesServiceStatus.OK&&a!==window.google.maps.places.PlacesServiceStatus.ZERO_RESULTS&&n(a),a===window.google.maps.places.PlacesServiceStatus.ZERO_RESULTS&&t([]);var i=o.map((function(t){var r="".concat(t.geometry.location.lng()).concat(t.geometry.location.lat());return e({id:y(r,v)},t)})).slice(0,10);Promise.all(i.map((function(t){return r.getPlaceDetails(t.id,t.place_id,["formatted_address","international_phone_number","opening_hours","types","place_id","website"])}))).then((function(r){var n=i.map((function(t){var n=r.find((function(e){return e.id===t.id}));return e(e({},t),{},{place_details:n.placeDetails})}));t(n)})).catch((function(t){n(t)}))}))})).then((function(t){return{googlePlaceDTOs:t.map((function(t){return g(t)}))}})));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.getPlaceDetails=function(){var t=n(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=e({},a),this.placesServicePromise=this.initializeGooglePlacesService(),{searchPlaces:this.searchPlaces,getPlaceDetails:this.getPlaceDetails}},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": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "EUA Google Places client", | ||
@@ -33,3 +33,3 @@ "author": "Computer Rock", | ||
}, | ||
"gitHead": "56469daee228d0ba4355f424307a6a76961973f6" | ||
"gitHead": "2de61653fb4e13039972b881f53a730b647fdf4c" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
153205
120
1