!function(o){if(o("#dokan-geolocation-product-location").length){var a,n,t,e;o("#_dokan_geolocation_use_store_settings").on("change",(function(){o("#dokan-geolocation-product-location-no-store-settings").toggleClass("dokan-hide"),o("#dokan-geolocation-product-location").toggleClass("dokan-hide")}));var l=o("#dokan-geolocation-product-location").find(".locate-icon");navigator.geolocation?l.on("click",(function(){navigator.geolocation.getCurrentPosition((function(o){g(o.coords.latitude,o.coords.longitude)}))})):l.addClass("dokan-hide"),function(){var l=o('[name="_dokan_geolocation_product_dokan_geo_latitude"]').val(),d=o('[name="_dokan_geolocation_product_dokan_geo_longitude"]').val(),c=o("#dokan-geolocation-product-location-map");t=o("#_dokan_geolocation_product_location");var i=new google.maps.LatLng(l,d);a=new google.maps.Map(c.get(0),{center:i,zoom:13,mapTypeId:google.maps.MapTypeId.ROADMAP}),n=new google.maps.Marker({position:i,map:a,draggable:!0}),e=new google.maps.Geocoder;var r=new google.maps.places.Autocomplete(t.get(0));r.addListener("place_changed",(function(){var o=r.getPlace(),a=o.geometry.location;g(a.lat(),a.lng(),o.formatted_address)})),a.addListener("click",(function(o){g(o.latLng.lat(),o.latLng.lng())})),n.addListener("dragend",(function(o){g(o.latLng.lat(),o.latLng.lng())}))}()}function g(l,g,d){o('[name="_dokan_geolocation_product_dokan_geo_latitude"]').val(l),o('[name="_dokan_geolocation_product_dokan_geo_longitude"]').val(g);var c=new google.maps.LatLng(l,g);a.setCenter(c),n.setPosition(c),d||e.geocode({location:{lat:l,lng:g}},(function(o,a){"OK"===a&&t.val(o[0].formatted_address)}))}}(jQuery);