@ace-de/eua-google-places-client
Advanced tools
Comparing version 1.7.4 to 2.0.0-alpha.0
@@ -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){c(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){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,n.key,n)}}function i(t,e,r){return e&&a(t.prototype,e),r&&a(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s={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 g?e:g,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=A(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 g(){}function v(){}function m(){}var w={};s(w,a,(function(){return this}));var b=Object.getPrototypeOf,_=b&&b(b(I([])));_&&_!==r&&n.call(_,a)&&(w=_);var E=m.prototype=g.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 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 T(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(T,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 v.prototype=m,s(E,"constructor",m),s(m,"constructor",v),v.displayName=s(m,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===v||"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)}}(s);var u=s.exports,l=/^(?:[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 f(t){return"string"===typeof t&&l.test(t)}for(var p=[],h=0;h<256;++h)p.push((h+256).toString(16).substr(1));function d(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 y(t,e){return t<<e|t>>>32-e}var g=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(!f(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=(p[t[e+0]]+p[t[e+1]]+p[t[e+2]]+p[t[e+3]]+"-"+p[t[e+4]]+p[t[e+5]]+"-"+p[t[e+6]]+p[t[e+7]]+"-"+p[t[e+8]]+p[t[e+9]]+"-"+p[t[e+10]]+p[t[e+11]]+p[t[e+12]]+p[t[e+13]]+p[t[e+14]]+p[t[e+15]]).toLowerCase();if(!f(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 p=new Uint32Array(80),h=0;h<16;++h)p[h]=c[f][h];for(var g=16;g<80;++g)p[g]=y(p[g-3]^p[g-8]^p[g-14]^p[g-16],1);for(var v=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=y(v,5)+d(O,m,w,b)+_+e[O]+p[E]>>>0;_=b,b=w,w=y(m,30)>>>0,m=v,v=P}r[0]=r[0]+v>>>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=g,m="9ad1c8c2-539a-4d52-9640-4f59254ba745",w=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})},b=i((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,"&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=n(u.mark((function t(n){var o,a,i,c,s,l,f,p,h,d;return u.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,c=n.longitude,s=n.viewport,l=n.placeTypes,f=void 0===l?[]:l,p=n.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,n){var u=a?function(t,e){return o.textSearch(t,e)}:function(t,e){return o.nearbySearch(t,e)};u(e(e(e(e({},!!a&&{query:a}),!!s&&{location:{lat:i,lng:c}}),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,m),"--").concat(v(t.place_id,m)),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){n(t)}))}else t([]);else n(o)}))})).catch((function(t){return{status:t}})).then((function(t){return{googlePlaceDTOs:t.map((function(t){return w(t)}))}})));case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.getPlaceDetails=function(){var t=n(u.mark((function t(e,n){var o,a,i=arguments;return u.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}})),_={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{b as GooglePlacesClient,_ 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){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}; | ||
//# 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){c(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){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,n.key,n)}}function i(t,e,r){return e&&a(t.prototype,e),r&&a(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(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 s={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 g?e:g,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 g(){}function v(){}function m(){}var w={};s(w,a,(function(){return this}));var b=Object.getPrototypeOf,_=b&&b(b(I([])));_&&_!==r&&n.call(_,a)&&(w=_);var E=m.prototype=g.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 v.prototype=m,s(E,"constructor",m),s(m,"constructor",v),v.displayName=s(m,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===v||"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)}}(s);var u=s.exports,l=/^(?:[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 f(t){return"string"===typeof t&&l.test(t)}for(var p=[],h=0;h<256;++h)p.push((h+256).toString(16).substr(1));function d(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 y(t,e){return t<<e|t>>>32-e}var g=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(!f(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=(p[t[e+0]]+p[t[e+1]]+p[t[e+2]]+p[t[e+3]]+"-"+p[t[e+4]]+p[t[e+5]]+"-"+p[t[e+6]]+p[t[e+7]]+"-"+p[t[e+8]]+p[t[e+9]]+"-"+p[t[e+10]]+p[t[e+11]]+p[t[e+12]]+p[t[e+13]]+p[t[e+14]]+p[t[e+15]]).toLowerCase();if(!f(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 p=new Uint32Array(80),h=0;h<16;++h)p[h]=c[f][h];for(var g=16;g<80;++g)p[g]=y(p[g-3]^p[g-8]^p[g-14]^p[g-16],1);for(var v=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=y(v,5)+d(O,m,w,b)+_+e[O]+p[E]>>>0;_=b,b=w,w=y(m,30)>>>0,m=v,v=P}r[0]=r[0]+v>>>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=g,m="9ad1c8c2-539a-4d52-9640-4f59254ba745",w=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})},b=i((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,"&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=n(u.mark((function t(n){var o,a,i,c,s,l,f,p,h,d;return u.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,c=n.longitude,s=n.viewport,l=n.placeTypes,f=void 0===l?[]:l,p=n.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,n){var u=a?function(t,e){return o.textSearch(t,e)}:function(t,e){return o.nearbySearch(t,e)};u(e(e(e(e({},!!a&&{query:a}),!!s&&{location:{lat:i,lng:c}}),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,m),"--").concat(v(t.place_id,m)),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){n(t)}))}else t([]);else n(o)}))})).catch((function(t){return{status:t}})).then((function(t){return{googlePlaceDTOs:t.map((function(t){return w(t)}))}})));case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.getPlaceDetails=function(){var t=n(u.mark((function t(e,n){var o,a,i=arguments;return u.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.GooglePlacesClient=b,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){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"}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@ace-de/eua-google-places-client", | ||
"version": "1.7.4", | ||
"version": "2.0.0-alpha.0", | ||
"description": "EUA Google Places client", | ||
@@ -20,6 +20,6 @@ "author": "Computer Rock", | ||
"engines": { | ||
"node": ">=12" | ||
"node": ">=20" | ||
}, | ||
"devDependencies": { | ||
"@computerrock/rollup-monorepo-bundler": "^1.4.2" | ||
"@computerrock/rollup-monorepo-bundler": "^2.0.0-alpha.0" | ||
}, | ||
@@ -34,3 +34,3 @@ "dependencies": { | ||
}, | ||
"gitHead": "13a2bc0ac2b963694a5825707a38b74d0c041ced" | ||
"gitHead": "cb0ec03c00915d912fb11133ab4d8df3f35564af" | ||
} |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
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
128
91981
2