"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}Object.defineProperty(exports,"__esModule",{value:!0});var e,o,r=t(require("@babel/runtime/helpers/toConsumableArray"));exports.SortDirection=void 0,(e=exports.SortDirection||(exports.SortDirection={})).ASC="asc",e.DESC="desc",exports.SortBy=void 0,(o=exports.SortBy||(exports.SortBy={})).PAD="name",o.WELL="wellName",o.TVD="tvd",o.FORMATION="formation";exports.sortPads=function(t,e){return function(o,i){var l="",n="";if(t===exports.SortBy.TVD){var a=o.wells||[],s=i.wells||[];l=a.length?Math.min.apply(Math,r.default(a.map((function(t){return t.totalDepth})))):0,n=s.length?Math.min.apply(Math,r.default(s.map((function(t){return t.totalDepth})))):0}else if(t===exports.SortBy.FORMATION){var p,u,d=o.wells||[],f=i.wells||[];l=null===(p=d[0])||void 0===p?void 0:p.formation,n=null===(u=f[0])||void 0===u?void 0:u.formation}else if(t===exports.SortBy.WELL){var S,c,v=o.wells||[],m=i.wells||[];l=null===(S=v[0])||void 0===S?void 0:S.name,n=null===(c=m[0])||void 0===c?void 0:c.name}else l="string"==typeof o[t]?o[t]:"",n="string"==typeof i[t]?i[t]:"";return l=String(l),n=String(n),l||n?l?n?e===exports.SortDirection.ASC?l.localeCompare(n):n.localeCompare(l):e===exports.SortDirection.ASC?1:-1:e===exports.SortDirection.ASC?-1:1:0}};
//# sourceMappingURL=sortPads.js.map
