"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),r=require("@babel/runtime/helpers/slicedToArray"),t=require("react"),o=require("../constants.js");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=n(e),u=n(r);function c(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function l(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?c(Object(t),!0).forEach((function(r){i.default(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):c(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}exports.useFlyToWell=function(e,r,n,i){t.useImperativeHandle(e,(function(){return{flyToWell:function(e){var t,c=r.current;if(c&&i){var f=n.find((function(r){return r.id===e}));if(null!=f&&null!==(t=f.topHole)&&void 0!==t&&t.coordinates){var a=u.default(f.topHole.coordinates,2),s=a[0],p=a[1],b=c.getZoom()<o.ClusterConfig.flyToZoom;c.easeTo(l(l({center:[p,s]},b&&{zoom:o.ClusterConfig.flyToZoom}),{},{duration:300}))}}}}}),[r,i,n])};
//# sourceMappingURL=useFlyToWell.js.map
