"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("../convert.js"),r=require("../../constants/casing.js");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(e);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){o.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function c(e){var t=r.COMPONENT_FAMILIES.find((function(t){return t.type===e}));return t?t.name:""}exports.convertComponents=function(e){for(var r=[],n=0,o=0;o<e.length;o+=1){var i=e[o],u=a(a({},i),{},{family_name:c(i.family),inner_diameter:t.convertValue(i.inner_diameter,"shortLength","in"),outer_diameter:t.convertValue(i.outer_diameter,"shortLength","in"),linear_weight:t.convertValue(i.linear_weight,"massPerLength","lb-ft"),weight:t.convertValue(i.linear_weight,"mass","lb"),length:t.convertValue(i.linear_weight,"length","ft")});n+=u.length,u.cum_length=n,r.push(u)}return r},exports.getFamilyName=c;
