@corva/ui 0.25.0-6 → 0.26.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLI/components/App/App.js +1 -1
- package/CLI/hocs/withAppDataProviderHOC.js +1 -1
- package/CLI/hocs/withGridLayoutHOC/withGridLayoutHOC.js +1 -1
- package/CLI/hocs/withPDFLayoutHOC.js +1 -1
- package/CLI/hocs/withReactRouterHOC.js +1 -1
- package/CLI/screens/OAuthCallbackScreen/index.js +1 -1
- package/clients/api/apiCore.js +1 -1
- package/clients/clientStorage/core.js +1 -1
- package/components/Annotations/AnnotationsContext.js +1 -1
- package/components/Annotations/components/AnnotationsList/components/AddAnnotationForm/index.js +1 -1
- package/components/Annotations/components/AnnotationsList/components/AnnotationComments/index.js +1 -1
- package/components/AssetEditor/effects/index.js +1 -1
- package/components/Attachment/index.js +1 -1
- package/components/BICOffsetPickerDialog/components/WellSection/AutoCompleteAssetSearch/AutoCompleteAssetSearch.js +1 -1
- package/components/BICOffsetPickerDialog/components/WellSection/AutoCompleteAssetSearch/utils/apiCalls.js +1 -1
- package/components/BICOffsetPickerDialog/components/WellSection/index.js +1 -1
- package/components/BICOffsetPickerDialog/index.js +1 -1
- package/components/Breadcrumbs/index.js +1 -1
- package/components/CollapsableSidebar.js +1 -1
- package/components/Comment/index.js +1 -1
- package/components/CommentInput/index.js +1 -1
- package/components/DevCenter/AppHeader/AppHeader.js +1 -1
- package/components/DevCenter/AppHeader/PadMode.js +1 -1
- package/components/DevCenter/AppSideBar/AppSideBar.js +1 -1
- package/components/DevCenter/AppsDataProvider/effects/dataResolvers.js +1 -1
- package/components/DevCenter/AppsDataProvider/effects/useAppsData.js +1 -1
- package/components/DevCenter/AppsDataProvider/effects/utils.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/RemoveAppButton.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/effects/useAnnotationsData.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/effects/useAppMaximized.js +1 -1
- package/components/FileUploadIconButton.js +1 -1
- package/components/FilesLoader/FilesLoader.js +1 -1
- package/components/HeaderLayout/HeaderLayout.js +1 -1
- package/components/HeaderLayout/utils.js +1 -1
- package/components/InfiniteList/index.js +1 -1
- package/components/Notifications/NotificationsContainer.js +1 -1
- package/components/OffsetWellPickerV2/components/Table/index.js +1 -1
- package/components/OffsetWellPickerV2/constants.js +1 -1
- package/components/OffsetWellPickerV2/effects/index.js +1 -1
- package/components/OffsetWellPickerV2/utils/apiCalls.js +1 -1
- package/components/PadModeSelect/PadModeSelect.js +1 -1
- package/components/PadOffsetsPicker/OffsetAssetChip.js +1 -0
- package/components/PadOffsetsPicker/OffsetAssetsListExpander.js +1 -0
- package/components/PadOffsetsPicker/PadOffsetsPicker.js +1 -0
- package/components/PadOffsetsPicker/StagesSelector.js +1 -0
- package/components/PadOffsetsPicker/index.js +1 -0
- package/components/ParameterCharts/AddEditTrack.js +1 -1
- package/components/ParameterCharts/components/Track.js +1 -1
- package/components/ParameterCharts/components/TrackSettings.js +1 -1
- package/components/PostPreviewDialog/index.js +1 -1
- package/components/SlateFormattedText/SlateFormattedText.js +1 -1
- package/components/Template/TemplateSharingDialog/ChipSelector.js +1 -1
- package/components/VirtualizedTable/VirtualizedTable.js +1 -1
- package/components/WellSummary/WellSummaryItemValue.js +1 -1
- package/components/WellSummary/effects/useWellSummaryData.js +1 -1
- package/components/index.js +1 -1
- package/constants/index.js +1 -1
- package/package.json +2 -1
- package/utils/DrillstringUtils.js +1 -1
- package/utils/FluidCheckUtils.js +1 -1
- package/utils/casing/conversion.js +1 -1
- package/utils/casing/validation.js +1 -1
- package/utils/completion.js +1 -1
- package/utils/dashboardReports.js +1 -1
- package/utils/devcenter.js +1 -1
- package/utils/index.js +1 -1
- package/utils/lasParser.js +1 -1
- package/utils/main.js +1 -1
- package/utils/torqueAndHookloadUtils.js +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{makeStyles as l,Tooltip as i,Chip as t}from"@material-ui/core";import{string as o,func as r,bool as a}from"prop-types";import{Clear as n}from"@material-ui/icons";var c=l({chipRoot:{height:"20px",margin:"4px"},chipDeleteIcon:{fontSize:"14px"}}),d=function(l){var o=l.children,r=l.handleDelete,a=l.handleClick,d=l.disabled,p=l.tooltipText,s=c();return e(i,{title:p,disableFocusListener:d,disableHoverListener:d,disableTouchListener:d,children:e(t,{"data-not-migrated-MuiChip":!0,color:"primary",label:o,size:"small",classes:{root:s.chipRoot,deleteIcon:s.chipDeleteIcon},deleteIcon:e(n,{}),onDelete:r,onClick:a,clickable:!d})})};d.propTypes={children:o.isRequired,handleDelete:r,handleClick:r,disabled:a,tooltipText:o},d.defaultProps={handleDelete:null,handleClick:null,disabled:!1,tooltipText:""};export default d;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as e,jsx as i}from"react/jsx-runtime";import{Button as r}from"@material-ui/core";import{number as o,bool as t,func as s}from"prop-types";import{ArrowDropUp as a,ArrowDropDown as l}from"@material-ui/icons";var d=function(o){var t=o.offsetCount,s=o.handleClick,d=o.isExpanded;return e(r,{onClick:s,size:"small",disabled:0===t,children:["Offset Wells (",t,")",i(d?a:l,{})]})};d.propTypes={offsetCount:o.isRequired,isExpanded:t.isRequired,handleClick:s.isRequired};export default d;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/toConsumableArray";import{isEmpty as n,get as r}from"lodash";import{jsxs as a,jsx as i}from"react/jsx-runtime";import{makeStyles as s,Fab as c,Dialog as l,DialogTitle as o,DialogContent as d,FormControl as u,InputLabel as f,Select as p,MenuItem as m,Checkbox as h,ListItemText as S,DialogActions as g,Button as E}from"@material-ui/core";import{useMemo as I,useEffect as b}from"react";import{getPads as C}from"../../clients/jsonApi/index.js";import _ from"prop-types";import{Add as D}from"@material-ui/icons";import O from"jsona";import P from"use-tiny-state-machine";function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function W(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?y(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var v=new O,w=s({fabSmallBtn:{width:24,height:24,minHeight:24,margin:"0 6px 0 1px"},fabSmallBtnIcon:{width:20,height:20},dialogPaper:{width:"75%",maxWidth:420}});var L={id:"requests",initial:"idle",context:{padsData:[],wellsData:[],lastStage:[],error:null,companyId:0},states:{idle:{on:{FETCH_PADS:{target:"pending",action:function(e){var t=e.dispatch,a=e.context;C({fields:["pad.name","pad.wells"],sort:"name",per_page:1e3,company:a.companyId}).then((function(e){return v.deserialize(e)})).then((function(e){return e.filter((function(e){return!n(r(e,"wells"))}))})).then((function(e){return t("PADS_REQUEST_SUCCESS",e)})).catch((function(e){return t("FAILURE",e)}))}}}},pending:{on:{PADS_REQUEST_SUCCESS:{target:"success",beforeStateChange:function(e,t){return(0,e.updateContext)((function(e){return W(W({},e),{},{padsData:t})}))}},FAILURE:{target:"failure",beforeStateChange:function(e,t){throw new Error(t.message)}}}},success:{on:{FETCH_WELLS:{target:"success",action:function(e,t){(0,e.dispatch)("WELLS_REQUEST_SUCCESS",t.reduce((function(e,t){return e.concat(t.wells)}),[]))}},WELLS_REQUEST_SUCCESS:{target:"success",beforeStateChange:function(e,t){return(0,e.updateContext)((function(e){return W(W({},e),{},{wellsData:t})}))}}}}}},x={id:"dialog",initial:"closed",context:{selectedPadIds:[],selectedWellIds:[]},states:{closed:{on:{OPEN_DIALOG:{target:"open",beforeStateChange:function(e,n){var r=e.updateContext,a=n.currentWellIds,i=n.padsData,s=[];return a&&a.size>0&&i.forEach((function(e){e.wells.forEach((function(t){a.includes(t.asset_id)&&!s.includes(e.id)&&s.push(e.id)}))})),r((function(e){return W(W({},e),{},{selectedPadIds:[].concat(s),selectedWellIds:t(a)})}))}}}},open:{on:{CLOSE_DIALOG:{target:"closed",beforeStateChange:function(e){return(0,e.updateContext)((function(e){return W(W({},e),{},{selectedPadIds:[],selectedWellIds:[]})}))}},SET_PAD_ID:{target:"open",beforeStateChange:function(e,t){var n=e.updateContext,r=t.selectedPadIds,a=t.currentWellIds,i=t.padsData,s=[];return a&&a.size>0&&i.forEach((function(e){e.wells.forEach((function(t){r.includes(e.id)&&a.includes(t.asset_id)&&s.push(t.asset_id)}))})),n((function(e){return W(W({},e),{},{selectedPadIds:r,selectedWellIds:[].concat(s)})}))}},SET_WELL_ID:{target:"open",beforeStateChange:function(e,t){return(0,e.updateContext)((function(e){return W(W({},e),{},{selectedWellIds:t})}))}}}}}},j=function(e){var r=e.onSave,s=e.currentOffsetSetting,C=e.assets,_=e.companyId,O=w(),y=P(L),W=y.state,v=y.dispatch,j=y.context,A=P(x),T=A.state,k=A.dispatch,R=A.context,U=I((function(){return 0===s.size&&C?C.map((function(e){return e.id})):s.map((function(e){return e.selectedWellId}))}),[s,C]),F=function(){return k("CLOSE_DIALOG")},q=R.selectedPadIds,z=R.selectedWellIds;return b((function(){j.companyId=_,v("FETCH_PADS")}),[]),b((function(){if(!n(q)){var e=j.padsData.filter((function(e){return q.includes(e.id)}));v("FETCH_WELLS",e)}}),[q]),a("div",{children:[i(c,{size:"small",color:"primary",classes:{sizeSmall:O.fabSmallBtn},onClick:function(){return k("OPEN_DIALOG",{currentWellIds:U,padsData:j.padsData})},disabled:"success"!==W,children:i(D,{className:O.fabSmallBtnIcon})}),"success"===W&&a(l,{open:"open"===T,onBackdropClick:F,classes:{paper:O.dialogPaper},children:[i(o,{children:"Offset Wells"}),a(d,{children:[a(u,{margin:"normal",fullWidth:!0,required:!0,children:[i(f,{htmlFor:"pad-select",shrink:!n(q),children:"Pad"}),i(p,{multiple:!0,inputProps:{name:"pads",id:"pad-select"},value:q,onChange:function(e){return k("SET_PAD_ID",{selectedPadIds:e.target.value,currentWellIds:U,padsData:j.padsData})},renderValue:function(e){return"".concat(e.length," selected")},children:j.padsData.map((function(e){return a(m,{value:e.id,children:[i(h,{checked:q.includes(e.id)}),i(S,{primary:e.name})]},e.id)}))})]}),a(u,{margin:"normal",disabled:n(q),fullWidth:!0,required:!0,children:[i(f,{htmlFor:"wells",shrink:!n(z),children:"Well"}),i(p,{multiple:!0,inputProps:{name:"wells",id:"well-select"},value:z,onChange:function(e){return k("SET_WELL_ID",e.target.value)},renderValue:function(e){return"".concat(e.length," selected")},children:j.wellsData.map((function(e){var t=U.includes(e.asset_id);return a(m,{value:e.asset_id,disabled:t,children:[i(h,{checked:z.includes(e.asset_id)}),i(S,{primary:e.name})]},e.id)}))})]})]}),a(g,{children:[i(E,{onClick:F,children:"Cancel"}),i(E,{variant:"contained",color:"primary",disabled:n(z),onClick:function(){var e=j.wellsData.filter((function(e){return z.includes(e.asset_id)})).map((function(e){return{selectedWellId:Number(e.asset_id),selectedWellName:e.name,selectedWellStatus:e.status,selectedStages:[],stages:{}}})),n=s.filter((function(t){return!e.find((function(e){return e.selectedWellId===t.selectedWellId}))}));n=[].concat(t(n),t(e)),F(),r(n)},children:"Save"})]})]})]})};j.propTypes={currentOffsetSetting:_.arrayOf(_.shape({})).isRequired,onSave:_.func.isRequired,companyId:_.string.isRequired,assets:_.arrayOf(_.shape({})).isRequired};export default j;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import{isNull as t,noop as n,range as r,get as a,isEmpty as i,last as l}from"lodash";import{jsxs as o,Fragment as c,jsx as s}from"react/jsx-runtime";import{makeStyles as d,Dialog as u,DialogTitle as g,DialogContent as p,Grid as f,FormControl as S,InputLabel as h,Select as m,MenuItem as E,Checkbox as b,ListItemText as v,Typography as C,FormLabel as D,RadioGroup as O,FormControlLabel as T,Radio as L,DialogActions as y,Button as _}from"@material-ui/core";import{useEffect as W}from"react";import{getAppStorage as w}from"../../clients/jsonApi/index.js";import{func as j,shape as N,number as I,string as P,oneOf as x}from"prop-types";import A from"use-tiny-state-machine";import k from"./OffsetAssetChip.js";function G(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function q(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?G(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):G(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var F=d({dialogPaper:{width:"75%",maxWidth:420}});var H={id:"stages",initial:"idle",context:{lastStageNumber:null,error:null},states:{idle:{on:{FETCH_STAGES:{target:"pending",action:function(e,t){var n=e.dispatch;w("corva","completion.wits",t,{limit:1,sort:"{timestamp:-1}"}).then((function(e){return i(e)?null:a(l(e),"stage_number",null)})).then((function(e){return n("SUCCESS",e)})).catch((function(e){throw new Error(e.message)}))}}}},pending:{on:{SUCCESS:{target:"success",beforeStateChange:function(e,t){return(0,e.updateContext)((function(e){return q(q({},e),{},{lastStageNumber:t})}))}},FAILURE:{target:"failure",beforeStateChange:function(e,t){throw new Error(t.message)}}}}}},R=function(i){var l,d,w,j,N=i.onSave,I=i.onDelete,P=i.offset,x=F(),G=A(H),R=G.state,U=G.dispatch,Y=G.context,B=A((d=(l=P).stages,w=void 0===d?{}:d,{id:"dialog",initial:"closed",context:{selectedStages:void 0===(j=l.selectedStages)?[]:j,stagesData:w},states:{closed:{on:{OPEN_DIALOG:{target:"open"}}},open:{on:{CLOSE_DIALOG:{target:"closed"},SET_SELECTED_STAGES:{target:"open",beforeStateChange:function(t,n){return(0,t.updateContext)((function(t){return q(q({},t),{},{selectedStages:n,stagesData:n.reduce((function(t,n){return q(q({},t),{},e({},n,{lineStyle:"dotted",lineWidth:2}))}),{})})}))}},SET_SELECTED_LINE_STYLE:{target:"open",beforeStateChange:function(t,n){var r=t.updateContext,a=n.stage,i=n.selectedLineStyle;return r((function(t){return q(q({},t),{},{stagesData:q(q({},t.stagesData),{},e({},a,q(q({},t.stagesData[a]),{},{lineStyle:i})))})}))}},SET_SELECTED_LINE_WIDTH:{target:"open",beforeStateChange:function(t,n){var r=t.updateContext,a=n.stage,i=n.selectedLineWidth;return r((function(t){return q(q({},t),{},{stagesData:q(q({},t.stagesData),{},e({},a,q(q({},t.stagesData[a]),{},{lineWidth:Number(i)})))})}))}}}}}})),V=B.state,z=B.dispatch,J=B.context,K=function(e){return function(t){return z("SET_SELECTED_LINE_STYLE",{stage:e,selectedLineStyle:t.target.value})}},M=function(e){return function(t){return z("SET_SELECTED_LINE_WIDTH",{stage:e,selectedLineWidth:t.target.value})}},Q=function(){return z("CLOSE_DIALOG")},X=P.selectedWellId;W((function(){U("FETCH_STAGES",X)}),[]);var Z=t(Y.lastStageNumber);return o(c,{children:[s(k,{handleDelete:I,handleClick:Z?n:function(){return z("OPEN_DIALOG")},disabled:Z,tooltipText:"Edit stages for ".concat(P.selectedWellName),children:P.selectedWellName},P.selectedWellId),"success"===R&&o(u,{open:"open"===V,onBackdropClick:Q,classes:{paper:x.dialogPaper},children:[s(g,{children:"Offset Well Stages"}),s(p,{children:o(f,{container:!0,direction:"column",spacing:16,children:[s(f,{item:!0,children:o(S,{margin:"normal",fullWidth:!0,required:!0,children:[s(h,{htmlFor:"stages-multi-select",children:"Stages"}),s(m,{inputProps:{name:"stages",id:"stages-multi-select"},value:J.selectedStages,renderValue:function(e){return"".concat(e.length," stages selected")},onChange:function(e){return z("SET_SELECTED_STAGES",e.target.value)},multiple:!0,children:r(1,Y.lastStageNumber+1).map((function(e){return o(E,{value:e,children:[s(b,{checked:J.selectedStages.includes(e)}),s(v,{primary:e})]},e)}))})]})}),J.selectedStages.sort((function(e,t){return e-t})).map((function(e){return o(f,{item:!0,children:[o(C,{variant:"subtitle1",children:["Stage ",e]}),o(S,{component:"fieldset",children:[s(D,{component:"legend",required:!0,children:"Line Style"}),o(O,{name:"line-style",value:a(J,["stagesData",e,"lineStyle"],"dotted"),onChange:K(e),row:!0,children:[s(T,{value:"dotted",control:s(L,{}),label:"Dotted"}),s(T,{value:"dashed",control:s(L,{}),label:"Dashed"}),s(T,{value:"solid",control:s(L,{}),label:"Solid"})]})]}),o(S,{component:"fieldset",children:[s(D,{component:"legend",required:!0,children:"Line Width"}),o(O,{name:"line-width",value:String(a(J,["stagesData",e,"lineWidth"],"2")),onChange:M(e),row:!0,children:[s(T,{value:String(1),control:s(L,{}),label:"Thin"}),s(T,{value:String(2),control:s(L,{}),label:"Normal"}),s(T,{value:String(4),control:s(L,{}),label:"Thick"})]})]})]},e)}))]})}),o(y,{children:[s(_,{onClick:Q,children:"Cancel"}),s(_,{variant:"contained",color:"primary",onClick:function(){var e=q(q({},P),{},{stages:J.stagesData,selectedStages:J.selectedStages});Q(),N(e)},children:"Save"})]})]})]})};R.propTypes={onSave:j.isRequired,onDelete:j.isRequired,offset:N({selectedWellId:I,selectedWellName:P,selectedWellStatus:x(["active","idle","complete","paused","unknown"])}).isRequired};export default R;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{default as PadOffsetsPicker}from"./PadOffsetsPicker.js";export{default as OffsetAssetChip}from"./OffsetAssetChip.js";export{default as OffsetAssetsListExpander}from"./OffsetAssetsListExpander.js";export{default as StagesSelector}from"./StagesSelector.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/
|
|
1
|
+
import t from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/toConsumableArray";import r from"@babel/runtime/helpers/slicedToArray";import{jsxs as n,Fragment as i,jsx as o}from"react/jsx-runtime";import{withStyles as s,Button as c}from"@material-ui/core";import{useState as a,useEffect as p}from"react";import l from"uuid/v1";import m from"prop-types";import u from"../Modal/index.js";import{DEFAULT_TRACK_SETTINGS as d,SETTINGS_KEY as f}from"./constants.js";import g from"./components/TrackSettings.js";import b from"./components/SingleChannelTrackSettings.js";import"./AddEditTrack.css.js";function y(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 h(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?y(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var O=function(s){var m=s.children,f=s.classes,y=s.id,O=s.settings,j=s.onSettingsChange,k=s.settingsKey,v=s.mapping,C=s.multipleAssets,S=a(!1),P=r(S,2),T=P[0],A=P[1],D=a(d),q=r(D,2),w=q[0],R=q[1],E=function(e,r){R(h(h({},w),{},t({},e,r)))};p((function(){var t=y?O[k].find((function(t){return t.id===y})):d;R(t)}),[O,k,y]);return n(i,{children:[o("div",{className:f.link,onClick:y?function(){return A(!0)}:function(){j(h(h({},O),{},t({},k,[].concat(e(O&&O[k]||[]),[h(h({},w),{},{id:l()})])))),R(d)},children:m}),o(u,{open:T,title:"Track Settings",actions:n("div",{className:"c-pc-track-setting-actions",children:[y&&o(c,{className:f.button,color:"primary",onClick:function(){var e=O[k].filter((function(t){return t.id!==y}));j(h(h({},O),{},t({},k,e))),A(!1)},children:"Delete Track"}),o(c,{"data-testid":"".concat("DC_AddEditTrack","_cancel"),className:f.button,color:"primary",onClick:function(){var t=y?O[k].find((function(t){return t.id===y})):d;R(t),A(!1)},children:"Cancel"}),o(c,{"data-testid":"".concat("DC_AddEditTrack","_save"),className:f.button,variant:"contained",color:"primary",onClick:function(){var e=O[k].map((function(t){return t.id===y?w:t}));j(h(h({},O),{},t({},k,e))),A(!1)},children:"Save"})]}),children:C?o(b,{trackSettings:w,onChange:E,mapping:v}):o(g,{settings:w,onChange:E,mapping:v})})]})};O.propTypes={settingsKey:m.string,multipleAssets:m.bool,settings:m.shape({}),onSettingsChange:m.func.isRequired,children:m.element.isRequired,id:m.string,mapping:m.arrayOf(m.shape({name:m.string.isRequired,key:m.string.isRequired}).isRequired).isRequired},O.defaultProps={id:"",settingsKey:f,settings:{},multipleAssets:!1};var j=s({link:{cursor:"pointer"},button:{fontSize:14,marginLeft:20}})(O);export default j;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import r from"@babel/runtime/helpers/defineProperty";import
|
|
1
|
+
import r from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/toConsumableArray";import{range as e}from"lodash";import{jsx as n,Fragment as i,jsxs as o}from"react/jsx-runtime";import{useContext as a,useRef as c,useMemo as s}from"react";import m from"uuid";import p from"prop-types";import u from"classnames";import{DEFAULT_TRACK_SETTINGS as f}from"../constants.js";import d from"../AddEditTrack.js";import l from"../SettingsContext.js";import g from"../DataContext.js";import b from"./TraceHeader.js";import h from"./ChartContainer.js";import j from"./Track.css.js";function y(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.push.apply(e,n)}return e}function v(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?y(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))}))}return t}var O=function(p){var y,O=p.id,P=p.index,x=a(l),C=x.horizontal,k=x.settingsKey,S=x.settings,w=x.onSettingsChange,D=x.maxTracesCount,T=x.multipleAssets,A=a(g).mapping,E=c(),N=s((function(){return O?S[k].find((function(r){return r.id===O})):f}),[O,S,k]),z=function(t){var e=S[k].map((function(r){return O===r.id?v(v({},r),{},{traces:r.traces&&r.traces.filter((function(r){return r.id!==t}))}):r}));w(v(v({},S),{},r({},k,e)))},K=function(e){var n=[];n=e.id?N.traces.map((function(r){return r.id===e.id?e:r})):[].concat(t(N.traces),[v(v({},e),{},{id:m()})]);var i=S[k].map((function(r){return O===r.id?v(v({},r),{},{traces:n}):r}));w(v(v({},S),{},r({},k,i)))},q=function(){E.current.click()},H=s((function(){if(!T)return N.name;var r=A.find((function(r){var t,e;return r.key===(null===(t=N.traces)||void 0===t||null===(e=t[0])||void 0===e?void 0:e.key)}));return r?r.name:N.name}),[N.traces,N.name,T]);return n(i,{children:o("div",{className:u(j.container,(y={},r(y,j.horizontal,C),r(y,j.vertical,!C),y)),children:[n(d,{mapping:A,settings:S,onSettingsChange:w,settingsKey:k,id:O,multipleAssets:T,children:n("div",{className:j.header,ref:E,children:n("div",{className:j.title,children:H})})}),!T&&e(D).map((function(r){return n(b,{index:r,traceSettings:N.traces[r],onDelete:z,mapping:A,onChange:K,openTrackSettings:q},N.traces[r]?N.traces[r].id:r)})),n(h,{traces:N.traces,trackIndex:P})]})})};O.propTypes={id:p.string,index:p.number.isRequired},O.defaultProps={id:""};export default O;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/slicedToArray";import{jsxs as n,jsx as i}from"react/jsx-runtime";import{withStyles as a,Grid as o,FormControl as c,TextField as s,IconButton as l,Button as m}from"@material-ui/core";import{useState as u}from"react";import p from"uuid";import d from"prop-types";import f from"../../Modal/index.js";import{MAX_TRACE_COUNT as h,DEFAULT_TRACE_SETTINGS as g}from"../constants.js";import v from"@material-ui/icons/NavigateNext";import b from"@material-ui/icons/Add";import y from"../../ColorPicker/ColorPicker.js";import k from"./TraceSelect.js";import N from"./TraceSettings.js";import O from"./TrackSettings.css.js";function j(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function C(r){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j(Object(n),!0).forEach((function(t){e(r,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}))}return r}var T=function(a){var d=a.settings,j=d.name,T=d.traces,P=a.onChange,S=a.classes,q=a.mapping,w=u(!1),D=t(w,2),R=D[0],B=D[1],x=u(),A=t(x,2),E=A[0],I=A[1],z=T&&T.length>h,L=function(){var e=T.map((function(e){return e.id===E.id?E:e}));P("traces",e),B(!1)};return n(o,{className:S.container,children:[i(c,{className:S.input,children:i(s,{label:"Track Name",value:j,className:S.input,onChange:function(e){var r=e.target.value;return P("name",r)}})}),i("div",{className:O.title,children:"Traces: "}),T&&!!T.length&&i("div",{className:O.tracesContainer,children:T.map((function(r,t){var a=r.id,o=r.key,c=r.color;return n("div",{className:O.tracesItem,children:[i(k,{value:o,onChange:function(e){return function(e,r){var t=T.map((function(t){var n=q.find((function(e){var t=e.key;return r===t}));return t.id===e?C(C({},t),n):t}));P("traces",t)}(a,e)},mapping:q}),i("div",{className:O.colorPicker,children:i(y,{value:c,onChange:function(r){return function(r,t,n){var i=T.map((function(i){return i.id===r?C(C({},i),{},e({},t,n)):i}));P("traces",i)}(a,"color",r)},hideLabel:!0,buttonClassName:S.picker})}),i(l,{onClick:function(){return function(e){I(T[e]),B(!0)}(t)},className:S.navBtn,children:i(v,{fontSize:"small",className:S.navIcon})})]},a)}))}),!z&&n(m,{color:"primary",onClick:function(){T&&T.length?P("traces",[].concat(r(T),[C({id:p()},g)])):P("traces",[C({id:p()},g)])},children:[i(b,{}),i("span",{children:"Add Trace"})]}),i(f,{open:R,title:n("div",{className:O.modalTitle,children:[n("span",{className:O.trackTitle,onClick:L,children:["Track Settings /"," "]}),E&&E.name||"Empty Trace"]}),actions:n("div",{className:O.actions,children:[i(m,{className:S.button,color:"primary",onClick:function(){var e=T.filter((function(e){return e.id!==E.id}));P("traces",e),B(!1)},children:"Delete Trace"}),i(m,{className:S.button,color:"primary",onClick:function(){return B(!1)},children:"Cancel"}),i(m,{className:S.button,variant:"contained",color:"primary",onClick:L,children:"Save"})]}),children:i(N,{traceSettings:E,onChange:function(r,t){I(C(C({},E),{},e({},r,t)))},mapping:q})})]})};T.propTypes={settings:d.shape({name:d.string.isRequired,traces:d.arrayOf(d.shape({}))}).isRequired,onChange:d.func.isRequired,classes:d.shape({}).isRequired,mapping:d.arrayOf(d.shape({name:d.string.isRequired,key:d.string.isRequired}).isRequired).isRequired};var P=a((function(e){return{container:{paddingTop:20,minWidth:300},input:{width:200},picker:{width:36,minWidth:36,height:24},navBtn:{position:"absolute",right:-10,top:"50%",transform:"translate(0, -50%)"},navIcon:{color:"#BDBDBD"},button:{fontSize:14,marginLeft:20}}}))(T);export default P;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/classCallCheck";import i from"@
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/classCallCheck";import i from"@material-ui/core/colors/grey";import{isNativeDetected as o}from"../../utils/mobileDetect.js";import l from"@babel/runtime/helpers/createClass";import{jsx as r,jsxs as a}from"react/jsx-runtime";import{Dialog as n}from"@material-ui/core";import{createRef as s,PureComponent as c}from"react";import p from"prop-types";import{withStyles as d}from"@material-ui/core/styles";import m from"@babel/runtime/helpers/assertThisInitialized";import f from"@babel/runtime/helpers/inherits";import h from"@babel/runtime/helpers/possibleConstructorReturn";import u from"@babel/runtime/helpers/getPrototypeOf";import g from"@material-ui/core/Button";import U from"@material-ui/core/Typography";import v from"../UserMention/index.js";import N from"../EmojiIconButton.js";import y from"file-extension";import F from"image-extensions";import b from"@material-ui/core/Paper";import S from"@material-ui/core/DialogActions";import C from"@material-ui/core/DialogContent";import D from"@material-ui/core/DialogTitle";import x from"@material-ui/core/Input";import E from"@material-ui/core/RootRef";import R from"@material-ui/icons/Delete";import P from"../FileTypeIcon.js";import w from"../FailedFileUploading.js";import B from"./styles.css.js";import I from"../FileUploadIconButton.js";function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=u(e);if(t){var l=u(this).constructor;i=Reflect.construct(o,arguments,l)}else i=o.apply(this,arguments);return h(this,i)}}var j="PostPreviewDialog",T=i[200],z=i[300],q=i[400],M=function(e){return a(b,{className:e.classes.messageWrapper,children:[r(x,{"data-testid":"".concat(j,"_messageInput"),inputRef:e.inputEl,inputComponent:v,inputProps:{onChange:e.handleMessageChange,companyId:e.companyId,suggestionsPortalHost:e.rootRef.current},placeholder:"Add a message about the file...",fullWidth:!0,disableUnderline:!0,multiline:!0,rows:"3",className:e.classes.textFieldRoot,value:e.comment,onKeyDown:e.handleKeyDown}),a("div",{className:B.cPostPreviewDialogMessageAdditionalFieldsWrapper,children:[r("div",{children:e.additionalFields}),a("div",{className:B.cPostPreviewDialogMessageActionFields,children:[!e.fileUrl&&r(I,{htmlColor:i[400],openPreviewDialogOnUpload:!1,disableRipple:!0,onFinish:e.handleFileUpload,onError:e.handleFileUploadingError,inputId:"preview-dialog-file-upload"}),r(N,{handleSelectEmoji:e.handleSelectEmoji,emojiIconClassName:e.classes.additionalActionButton,htmlColor:i[400],disableRipple:!0})]})]})]})},W=function(e){var t=y(e.fileName),i=F.includes(t);return a("div",i?{children:[a("div",{className:B.cPostPreviewDialogFileName,children:[r(U,{"data-testid":"".concat(j,"_fileName"),variant:"subtitle2",noWrap:!0,gutterBottom:!0,children:e.fileName}),r(R,{"data-testid":"".concat(j,"_deleteButton"),color:"action",onClick:e.handleFileDelete,className:e.classes.deleteButton})]}),r("div",{className:B.cPostPreviewDialogFileImageFileWrapper,style:{backgroundColor:T,border:"1px solid ".concat(z)},children:r("img",{"data-testid":"".concat(j,"_previewImage"),className:B.cPostPreviewDialogFileImage,src:e.fileUrl,alt:"Uploaded file"})})]}:{className:B.cPostPreviewDialogFileDownload,style:{backgroundColor:T,border:"1px solid ".concat(q)},children:[r(P,{fileName:e.fileName}),a("div",{className:B.cPostPreviewDialogFileDownloadText,children:[r(U,{"data-testid":"".concat(j,"_fileName"),variant:"subtitle2",noWrap:!0,children:e.fileName}),r(R,{"data-testid":"".concat(j,"_deleteButton"),color:"action",onClick:e.handleFileDelete,className:e.classes.deleteButton})]})]})},_=function(i){f(p,c);var o=k(p);function p(i){var l;return t(this,p),l=o.call(this,i),e(m(l),"focusOnInput",(function(){return l.inputEl.current.focus()})),e(m(l),"handleKeyDown",(function(e){"Enter"===e.key&&l.handleShare()})),e(m(l),"handleMessageChange",(function(e){return l.setState({comment:e})})),e(m(l),"handleSelectEmoji",(function(e){return l.setState((function(t){var i=t.comment;return{comment:"".concat(i).concat(e.native)}}))})),e(m(l),"handleShare",(function(){l.props.handleShare(l.state.comment,l.state.fileUrl,l.state.fileSize)})),e(m(l),"handleFileDelete",(function(){l.setState({fileUrl:"",fileSize:null,fileName:""})})),e(m(l),"handleFileUpload",(function(e,t,i){l.setState({fileUrl:e,fileName:t,fileSize:i,fileUploadingError:null})})),e(m(l),"handleFileUploadingError",(function(e){l.setState({fileUrl:null,fileName:null,fileSize:null,fileUploadingError:e})})),l.state={comment:i.message,fileUrl:i.fileUrl,fileSize:i.fileSize,fileName:i.fileName,fileUploadingError:null},l.inputEl=s(),l.rootRef=s(),l}return l(p,[{key:"componentDidUpdate",value:function(e){!e.open&&this.props.open&&!this.state.comment&&this.props.message&&this.setState({comment:this.props.message}),this.props.fileUrl===e.fileUrl&&this.props.fileSize===e.fileSize&&this.props.fileName===e.fileName||this.setState({fileUrl:this.props.fileUrl,fileSize:this.props.fileSize,fileName:this.props.fileName})}},{key:"render",value:function(){return r(E,{rootRef:this.rootRef,children:a(n,{fullScreen:this.props.isNative,open:this.props.open,onClose:this.props.handleClose,onBackdropClick:this.props.handleClose,onEntered:this.focusOnInput,children:[r(D,{children:this.props.title}),a(C,{classes:{root:!this.props.isNative&&this.props.classes.dialogContentRoot},children:[r(M,{inputEl:this.inputEl,comment:this.state.comment,handleMessageChange:this.handleMessageChange,handleKeyDown:this.handleKeyDown,handleFileUpload:this.handleFileUpload,handleSelectEmoji:this.handleSelectEmoji,handleFileUploadingError:this.handleFileUploadingError,additionalFields:this.props.additionalFields,fileUrl:this.state.fileUrl,classes:this.props.classes,companyId:this.props.companyId,rootRef:this.rootRef}),this.state.fileUploadingError&&r(w,{errorMessage:this.state.fileUploadingError,className:this.props.classes.fileUploadingError}),this.state.fileUrl&&r(W,{fileName:this.state.fileName,fileUrl:this.state.fileUrl,handleFileDelete:this.handleFileDelete,handleFileUploadingError:this.handleFileUploadingError,classes:this.props.classes})]}),a(S,{className:this.props.classes.dialogActions,children:[r(g,{"data-testid":"".concat(j,"_cancelButton"),color:"primary",onClick:this.props.handleClose,children:this.props.cancelButtonText}),r(g,{"data-testid":"".concat(j,"_okButton"),color:"primary",variant:"contained",disabled:!this.state.fileUrl&&!this.state.comment||!this.props.requiredFields.every(Boolean),onClick:this.handleShare,children:this.props.okButtonText})]})]})})}}]),p}();_.propTypes={title:p.string,open:p.bool.isRequired,fileUrl:p.string,fileName:p.string,fileSize:p.number,handleShare:p.func.isRequired,handleClose:p.func.isRequired,classes:p.shape({}).isRequired,isNative:p.bool.isRequired,additionalFields:p.arrayOf(p.node),requiredFields:p.arrayOf(p.string),message:p.string,companyId:p.number,okButtonText:p.string,cancelButtonText:p.string},_.defaultProps={title:"Share a file",fileUrl:"",fileName:"",fileSize:null,additionalFields:[],requiredFields:[],message:"",companyId:null,okButtonText:"Post",cancelButtonText:"Cancel",isNative:o};var A=d((function(e){return{dialogContentRoot:{minWidth:500},textFieldRoot:{marginBottom:20},textInput:{paddingTop:2},messageWrapper:{border:"0",boxShadow:"inset 0 0 0 1px rgba(0, 0, 0, 0.23)",padding:"18.5px 14px","&:hover":{boxShadow:"inset 0 0 0 1px ".concat(e.palette.common.black)},"&:focus-within":{boxShadow:"inset 0 0 0 2px ".concat(e.palette.primary.main)}},dialogActions:{padding:"0 24px 24px",margin:0},deleteButton:{cursor:"pointer"},fileUploadingError:{marginTop:10}}}))(_);export default A;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"@babel/runtime/helpers/defineProperty";import
|
|
1
|
+
import t from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/toConsumableArray";import{every as r}from"lodash";import{jsx as n,jsxs as a}from"react/jsx-runtime";import{useMemo as o,useCallback as i}from"react";import l from"prop-types";import{withReact as c,Slate as p,Editable as s}from"slate-react";import{createEditor as d}from"slate";import{Element as f,Leaf as u}from"./RenderElements.js";import{slateFormattingTextUtils as m}from"./utils.js";function O(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 S(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?O(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var x=function(t){var l,O=t.text,x=t.textsList,y=t.defaultText,b=t.defaultRenderingTextNode,g=t.locator,h="".concat(g,"_slateText"),T=o((function(){return c(d())}),[]),j=i((function(t){return n(f,S({},t))}),[]),N=i((function(t){return n(u,S({},t))}),[]),v=o((function(){var t=m.getValidSlateJSON(O),n=t.isTextValidSlateJSON,a=t.parsedJSON;if(x.length){var o=x.map((function(t){return m.getValidSlateJSON(t)}));n=r(o,(function(t){return t.isTextValidSlateJSON})),a=m.getDefaultParagraphObjectEmpty(),n&&o.forEach((function(t){var r,n=t.parsedJSON;m.isSlateTextEmpty(n)||(a[0].children=(r=a[0].children).concat.apply(r,e(n.map((function(t){return t.children})))));a[0].children=a[0].children.concat({text:"\n"})}))}var i=n&&m.isSlateTextEmpty(a);return{isValidSlateJSON:n,parsedSlateJSON:a,isEmptySlateJSON:i}}),[O,String(x)]),J=v.isValidSlateJSON,E=v.parsedSlateJSON,P=v.isEmptySlateJSON,V=m.getFormattedText({isValid:J,isEmpty:P,text:O,parsedText:E,defaultText:y});return l=x.length>0?x.map((function(t){return a("span",{"data-testid":"".concat(h,"_listItem"),children:[t,n("br",{})]},t)})):J&&P||!b?V:b,J&&!P?n(p,{editor:T,value:V,children:n(s,{"data-testid":"".concat(h,"_editable"),renderElement:j,renderLeaf:N,readOnly:!0})}):l};x.propTypes={text:l.string,textsList:l.arrayOf(l.string),defaultText:l.oneOfType([l.string,l.node]),defaultRenderingTextNode:l.node,locator:l.string},x.defaultProps={text:"",textsList:[],defaultText:"",defaultRenderingTextNode:void 0,locator:"SlateFormattedText"};export default x;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/classCallCheck";import
|
|
1
|
+
import t from"@babel/runtime/helpers/defineProperty";import{get as e,isEmpty as r}from"lodash";import n from"@babel/runtime/helpers/classCallCheck";import i from"@babel/runtime/helpers/createClass";import{jsx as s,jsxs as o}from"react/jsx-runtime";import{Chip as a,TextField as l,FormControl as c,FormHelperText as p,List as m,ListItem as u,ListItemText as d,withStyles as f}from"@material-ui/core";import{PureComponent as h}from"react";import I from"prop-types";import b from"classnames";import g from"@babel/runtime/helpers/assertThisInitialized";import y from"@babel/runtime/helpers/inherits";import v from"@babel/runtime/helpers/possibleConstructorReturn";import w from"@babel/runtime/helpers/getPrototypeOf";import{Autocomplete as O}from"@material-ui/lab";import"./ChipSelector.css.js";function R(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 S(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?R(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function x(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=w(t);if(e){var i=w(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v(this,r)}}var C=new RegExp("^new.*$"),N=function(f){y(v,h);var I=x(v);function v(r){var i;return n(this,v),i=I.call(this,r),t(g(i),"formatItem",(function(t){return{text:i.props.chipFormatter(t),id:e(t,"id"),persistent:e(t,"persistent",!1)}})),t(g(i),"handleChange",(function(t,e){var r=i.formattedSelectedItems,n=new Set(r.map((function(t){return t.id}))),s=new Set(e.map((function(t){return t.id}))),o=e.filter((function(t){return!n.has(t.id)})),a=r.filter((function(t){return!s.has(t.id)&&!t.persistent})).map((function(t){return t.id}));o.forEach(i.handleRequestAdd),a.forEach(i.handleRequestDelete)})),t(g(i),"handleRequestAdd",(function(t){var r=t.id,n=t.text;i.props.allowAddNewItems?i.itemWithSameNameExists(n)?i.setState({isError:!0}):i.props.onAddNew({id:"new".concat(n),name:n}):i.listedItems.find((function(t){return e(t,"id")===r}))?i.props.onAdd(r):i.setState({isError:!0})})),t(g(i),"handleRequestDelete",(function(t){i.props.allowAddNewItems&&C.test(t)?i.props.onRemoveNew(t):i.props.onRemove(t)})),t(g(i),"handleUpdateInput",(function(){i.state.isError&&i.setState({isError:!1})})),t(g(i),"getOptionLabel",(function(t){return t.text})),t(g(i),"renderTags",(function(t,e){return t.map((function(t,r){return s(a,S(S({"data-not-migrated-MuiChip":!0,label:i.getOptionLabel(t)},e({index:r})),{},{onDelete:t.persistent?null:function(){return i.handleRequestDelete(t.id)}}))}))})),t(g(i),"renderInput",(function(t){return s(l,S(S({},t),{},{variant:"standard",placeholder:i.props.hintText}))})),t(g(i),"itemWithSameNameExists",(function(t){return i.props.items.concat(i.props.newItems).map(i.formatItem).find((function(r){return e(r,"text")===t}))})),i.state={isError:!1},i}return i(v,[{key:"componentDidUpdate",value:function(t){var e=t.selectedItems;this.props.selectedItems!==e&&this.setState({isError:!1})}},{key:"render",value:function(){var t=this.state.isError?this.props.errorText:"",e=this.props.classes;return o("div",{children:[o(c,{className:e.formControl,error:!!t,fullWidth:!0,children:[s(O,{"data-testid":"generic_chipInput",multiple:!0,fullWidth:!0,id:"chip-selector",classes:{inputRoot:e.inputRoot},value:this.formattedSelectedItems,onChange:this.handleChange,onInputChange:this.handleUpdateInput,options:this.formattedListedItems,getOptionLabel:this.getOptionLabel,renderInput:this.renderInput,renderTags:this.renderTags}),s(p,{children:t})]}),s("div",{className:"c-chip-select-component__list-title",children:s("em",{children:this.props.listTitle})}),s(m,{className:b(this.props.listClasses,this.props.classes.listStyle),children:r(this.listedItems)?s("div",{className:"c-chip-select-component__empty-list",children:s("p",{"data-testid":"".concat("chipSelector","_emptyLabel"),children:"List is empty"})}):this.itemList})]})}},{key:"itemList",get:function(){var t=this;return this.listedItems.map((function(r){return s(u,{"data-testid":"".concat("chipSelector","_item_").concat(t.props.listItemFormatter(r)),button:!0,divider:!0,onClick:function(){return t.props.onAdd(e(r,"id"))},children:s(d,{children:t.props.listItemFormatter(r)})},e(r,"id"))}))}},{key:"listedItems",get:function(){var t=this;return this.props.items.filter((function(r){return!t.props.selectedItems.has(e(r,"id"))}))}},{key:"selectedItems",get:function(){var t=this;return this.props.items.filter((function(r){return t.props.selectedItems.has(e(r,"id"))})).concat(this.props.allowAddNewItems?this.props.newItems:[])}},{key:"formattedSelectedItems",get:function(){return this.selectedItems.map(this.formatItem)}},{key:"formattedListedItems",get:function(){return this.listedItems.map(this.formatItem)}}]),v}();N.propTypes={items:I.arrayOf(I.shape({})).isRequired,selectedItems:I.shape([]).isRequired,newItems:I.arrayOf(I.shape({})),onAdd:I.func.isRequired,onRemove:I.func.isRequired,allowAddNewItems:I.bool,onAddNew:I.func,onRemoveNew:I.func,chipFormatter:I.func,listItemFormatter:I.func,classes:I.string,listClasses:I.string,hintText:I.string,errorText:I.string,listTitle:I.string},N.defaultProps={allowAddNewItems:!1,chipFormatter:function(t){return t.toString()},listItemFormatter:function(t){return t.toString()},classes:"c-chip-select-component__container",listClasses:"c-chip-select-component__list",hintText:null,errorText:"You can not add not existing item",listTitle:"All items",onAddNew:null,onRemoveNew:null,newItems:null};var A=f({listStyle:{borderColor:"grey",overflow:"auto"},formControl:{marginBottom:8},inputRoot:{paddingBottom:"8px !important"}})(N);export default A;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import{getUnitDisplay as
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/toConsumableArray";import{getUnitDisplay as r}from"../../utils/convert.js";import{jsx as n,Fragment as i,jsxs as o}from"react/jsx-runtime";import{withStyles as a,IconButton as l,Typography as s,Tooltip as u}from"@material-ui/core";import{useMemo as c,useEffect as d}from"react";import f from"prop-types";import m from"classnames";import{Settings as h,Sort as p,ArrowUpward as b,ArrowDownward as g}from"@material-ui/icons";import{Table as y,Column as w,SortDirection as S}from"react-virtualized";function R(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 x(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?R(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function O(e,t){var n=e.find((function(e){return e.key===t}))||{},i=n.unitType,o=n.customUnit;return o?"(".concat(o,")"):i?"(".concat(r(i),")"):""}function v(e,t){return(e.find((function(e){return e.key===t}))||{}).headerLabelClassName||""}function C(e,t){return(e.find((function(e){return e.key===t}))||{}).headerLabelUnitClassName||""}function z(r){var a=r.columns,f=r.data,R=r.useColumnSetting,z=r.useFixedColumnWidth,_=r.onOpenSettingDlg,j=r.classes,k=r.width,D=r.height,T=r.headerHeight,q=r.rowHeight,N=r.showTopSettingIcon,I=r.customMuiStyles,L=r.isTopSettingIconShownAlways,P=r.CustomCellRenderer,H=r.customRowStyle,B=r.sort,A=r.sortBy,W=r.sortDirection,E=x(x({},j),I),F=c((function(){return{label:"",key:"setting",width:R?25:0}}),[R]),K=c((function(){return a.filter((function(e){return e.show}))}),[a]),V=c((function(){return R?[].concat(t(K),[F]):K}),[K,R,F]),M=c((function(){if(k<=0)return{};var t=e({},F.key,F.width),r=[];return K.filter((function(e){return Number.isFinite(e.width)})).forEach((function(e){t[e.key]=e.width-1,r.push(e.width-1)})),K.filter((function(e){return!Number.isFinite(e.width)})).forEach((function(e){var n=r.reduce((function(e,t){return e+t}),0),i=Math.floor((k-n-F.width)/(K.length-r.length)),o=e.minWidth||65,a=i<o?o:i;t[e.key]=a-1,r.push(a-1)})),t}),[k,K,F]),G=c((function(){return Object.values(M).reduce((function(e,t){return e+t}),0)}),[M]),U=L||G-12.5>=k;d((function(){N(U)}),[U]);var Z=function(e){var t=e.label,r=e.dataKey,i=A||W||B;return r===F.key?U?null:n(l,{size:"small","aria-label":"customize columns",className:E.settingIcon,onClick:_,children:n(h,{fontSize:"inherit"})}):o(s,{variant:"body2",className:m(E.headerLabel,v(a,r)),children:[t," ",n("span",{className:m(E.unitLabel,C(a,r)),children:O(a,r)}),i&&r!==A&&n(u,{title:"Sort A-Z",children:n(p,{fontSize:"small",className:j.sortIcon})}),i&&r===A&&(W===S.ASC?n(b,{fontSize:"small",className:j.sortIcon}):n(g,{fontSize:"small",className:j.sortIcon}))]})},J=function(e){var t=e.dataKey,r=e.rowData;return P?n(P,{columnKey:t,value:r[t]}):n(s,{variant:"body2",className:E.cellData,children:r[t]})};return n(i,{children:n(y,{width:z?G:k,height:D,headerHeight:T,rowClassName:function(t){var r=t.index;return m(e({},E.oddRow,r%2==1))},rowHeight:q,rowCount:f.length,rowGetter:function(e){var t=e.index;return f[t]},rowStyle:H||{},className:E.table,sort:B,sortBy:A,sortDirection:W,children:V.map((function(e){return n(w,{width:M[e.key]||0,dataKey:e.key,label:e.label,headerRenderer:Z,cellRenderer:J},e.key)}))})})}z.propTypes={columns:f.arrayOf(f.shape({})).isRequired,data:f.arrayOf(f.shape({})).isRequired,useColumnSetting:f.bool.isRequired,useFixedColumnWidth:f.bool.isRequired,headerHeight:f.number.isRequired,rowHeight:f.number.isRequired,width:f.number.isRequired,height:f.number.isRequired,onOpenSettingDlg:f.func.isRequired,showTopSettingIcon:f.func.isRequired,sort:f.func,sortBy:f.string,sortDirection:f.string,classes:f.shape({}).isRequired,customMuiStyles:f.shape({table:f.string,oddRow:f.string,headerLabel:f.string,cellData:f.string,unitLabel:f.string,settingIcon:f.string}).isRequired,isTopSettingIconShownAlways:f.bool.isRequired,CustomCellRenderer:f.func,customRowStyle:f.func},z.defaultProps={CustomCellRenderer:null,customRowStyle:null,sort:null,sortBy:null,sortDirection:null};var _=a((function(e){return{table:{"& .ReactVirtualized__Table__headerRow":{textTransform:"none",borderBottom:e.isLightTheme?"1px solid rgba(224, 224, 224, 1)":"1px solid rgba(81, 81, 81, 1)"},"& .ReactVirtualized__Table__row":{borderBottom:e.isLightTheme?"1px solid rgba(224, 224, 224, 1)":"1px solid rgba(81, 81, 81, 1)"},"& .ReactVirtualized__Table__Grid":{outline:"none"},"& .ReactVirtualized__Table__headerColumn":{outline:"none"}},oddRow:{backgroundColor:e.isLightTheme?"rgba(189, 189, 189, 0.1)":"#303030"},headerLabel:{lineHeight:"14px",fontSize:"12px",fontStyle:"normal",letterSpacing:"-0.25px",display:"flex",alignItems:"center",flexWrap:"wrap"},cellData:{lineHeight:"14px",fontSize:"12px",fontWeight:"normal",fontStyle:"normal",letterSpacing:"0.15px"},unitLabel:{fontSize:"10px",opacity:.5},settingIcon:{padding:"3px",fontSize:"20px"},sortIcon:{fontSize:"16px"}}}))(z);export default _;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import a from"moment";import{upperFirst as t}from"lodash";import{convertValue as r,getUnitDisplay as n}from"../../utils/convert.js";import"../../constants/goals.js";import"../../constants/
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import"../../constants/completion.js";import a from"moment";import"../../constants/alerts.js";import{upperFirst as t}from"lodash";import{convertValue as r,getUnitDisplay as n}from"../../utils/convert.js";import"../../constants/goals.js";import"../../constants/segment.js";import"../../constants/apps.js";import"../../constants/drillstring.js";import{DRILLING_WELL_SUMMARY as i,COMPLETION_WELL_SUMMARY as l,DRILLOUT_WELL_SUMMARY as s}from"../../constants/wellSummary.js";import"../../utils/drillstring/conversion.js";import{getBHASchematic as c}from"../../utils/drillstring/schematic.js";import{orDash as o}from"../../utils/formatting.js";import m from"../../utils/main.js";import{jsxs as d,jsx as p,Fragment as u}from"react/jsx-runtime";import{makeStyles as h,Typography as f}from"@material-ui/core";import g from"prop-types";import y from"classnames";import v from"../Drillstring/BHASchematic.js";import"../Drillstring/BHAComponentIcon.js";import"../Drillstring/BHATable/index.js";import"../Drillstring/BHAComponentDetail/index.js";var N="/static/media/6684df900ff63f28b07f9c505fb7a66e.svg",k=h({value:{fontSize:"14px",fontWeight:500},valueSuffix:{color:"#9E9E9E"},hasLeftMargin:{marginLeft:4},bhaRoot:{display:"flex",alignItems:"center"},bhaIdRoot:{backgroundColor:"#2196F3",borderRadius:"50%",marginRight:"8px",display:"flex",alignItems:"center",justifyContent:"center"},realBhaRoot:{width:"16px",height:"16px"},bhaIdLabel:{fontWeight:500,fontSize:"12px"},dummyBhaIdLabel:{paddingLeft:"4px",paddingRight:"4px"},bhaActiveIndicator:{fontSize:"12px",padding:"4px",fontWeight:500},nptRoot:{display:"flex",alignItems:"center"},rectIndicator:{width:"8px",height:"8px",backgroundColor:"#D32F2F",borderRadius:"2px",marginRight:"8px"},stageActual:{fontSize:"16px"},stagePercent:{color:"#9E9E9E",marginLeft:"4px"},fluidProppantType:{color:"#9E9E9E"},valueWrapper:{display:"flex",alignItems:"center"},rightImg:{marginRight:"4px"},centerImg:{marginLeft:"4px",marginRight:"4px"},rotate:{transform:"rotate(180deg)"},profileRoot:{display:"flex",alignItems:"flex-start"},profile:{width:"20px",height:"20px",borderRadius:"50%",fontSize:"10px",display:"flex",alignItems:"center",justifyContent:"center",marginRight:"8px",backgroundSize:"20px 20px",backgroundRepeat:"no-repeat",backgroundPosition:"center"},plugsIcon:{marginLeft:-8}});function b(h){var g=h.item,b=h.summaryData,I=k();if(!b)return null;if(g.key===i.HOLE_DEPTH.key){var x=g.dataGetter(b).holeDepth;return Number.isFinite(x)?d("div",{className:I.valueWrapper,children:[p("img",{src:N,alt:"hole_depth",className:I.centerImg}),d("span",{className:y(I.value,I.hasLeftMargin),children:[Math.floor(x),"’"]})]}):"-"}if(g.key===i.BIT_HOLE_DEPTH.key){var T=g.dataGetter(b),R=T.bitDepth,A=T.holeDepth;return[R,A].every(Number.isFinite)?d("div",{className:I.valueWrapper,children:[p("img",{src:"/static/media/fa2667bad3591deb178e99b521571578.svg",alt:"bit_depth",className:I.rightImg}),d("span",{className:I.value,children:[Math.floor(R),"’ / "]}),p("img",{src:N,alt:"hole_depth",className:I.centerImg}),d("span",{className:I.value,children:[Math.floor(A),"’"]})]}):"-"}if(g.key===i.DIVERGENCE.key){var E=g.dataGetter(b),S=E.distance,D=E.ahead,G=E.right;return[S,D,G].every(Number.isFinite)?d("div",{className:I.valueWrapper,children:[p("span",{className:I.value,children:"".concat(r(S,"length","ft")," ").concat(n("length"))}),p("img",{src:"/static/media/53cecdbd86f03352bda956fca25b537d.svg",alt:"up_arrow",className:y(I.centerImg,e({},I.rotate,D<0))}),p("span",{className:I.value,children:"".concat(Math.abs(r(D,"length","ft"))," ").concat(n("length")," ").concat(D>0?"Ahead":"Behind")}),p("img",{src:"/static/media/d32edb0ff9a69145d2c7917855263251.svg",alt:"left_arrow",className:y(I.centerImg,e({},I.rotate,G>0))}),p("span",{className:I.value,children:"".concat(Math.abs(r(G,"length","ft"))," ").concat(n("length")," ").concat(G>0?"Right":"Left")})]}):"-"}if(g.key===i.LAST_ACTIVE.key||g.key===l.LAST_ACTIVE.key){var L=g.dataGetter(b).timestamp;return p(f,{className:I.value,children:L?a.unix(L).format("MM/DD/YYYY HH:mm"):"-"})}if(g.key===i.CURRENT_ACTIVITY.key||g.key===l.CURRENT_ACTIVITY.key){var _=g.dataGetter(b).activityName;return p(f,{className:I.value,children:o(t(_||"-"))})}if(g.key===i.PHASE.key){var C=g.dataGetter(b).phaseName;return p(f,{className:I.value,children:o(C)})}if(g.key===i.HOLE_SECTION.key){var P=g.dataGetter(b).sectionName;return p(f,{className:I.value,children:o(P)})}if([i.MUD.key,s.MUD.key].includes(g.key)){var j=g.dataGetter(b),H=j.mudType,M=j.mudDensity;return p(f,{className:I.value,children:H||M?d(u,{children:[H&&"".concat(H,", "),M&&"".concat(r(M,"density","ppg")," ").concat(n("density"))]}):"-"})}if(g.key===i.NPT.key||g.key===l.NPT.key){var O=g.dataGetter(b),B=O.nptType,Y=O.startTime,F=O.endTime;return B&&Y&&F?d("div",{className:I.nptRoot,children:[p("div",{className:I.rectIndicator}),d(f,{className:I.value,children:[t(B),": ",((F-Y)/3600).fixFloat(1)," hr"]})]}):"-"}if(g.key===i.OPERATIONS_SUMMARY.key||g.key===l.OPERATIONS_SUMMARY.key){var U=g.dataGetter(b),W=U.dateTime,w=U.summary;return d(f,{className:I.value,children:[W?a.unix(W).format("MM/DD/YYYY HH:mm"):"-",p("br",{}),w]})}if(g.key===l.STAGE.key){var V=g.dataGetter(b),z=V.planned,q=V.actual;return q&&z?d(f,{className:I.value,children:[p("span",{className:I.stageActual,children:q}),p("span",{children:"/"}),p("span",{children:z}),d("span",{className:I.stagePercent,children:["Stg ",Math.floor(q/z*100)," %"]})]}):"-"}if(g.key===l.FLUIDS.key){var J=g.dataGetter(b).fluids;return p("div",{children:0===J.length?"-":J.map((function(e){var a=e.type,t=e.amount,i=e.unit;return d(f,{className:I.value,children:[d("span",{className:I.fluidProppantType,children:[a," - "]}),p("span",{children:"".concat(r(t,"oil",i)," ").concat(n("oil"))})]},"".concat(a,"_").concat(t))}))})}if(g.key===l.PROPPANTS.key){var K=g.dataGetter(b).proppants;return p("div",{children:0===K.length?"-":K.map((function(e){var a=e.type,t=e.amount,i=e.unit;return d(f,{className:I.value,children:[d("span",{className:I.fluidProppantType,children:[a," - "]}),p("span",{children:"".concat(r(t,"mass",i)," ").concat(n("mass"))})]},"".concat(a,"_").concat(t))}))})}if(g.key===i.ALERT.key||g.key===l.ALERT.key){var Q=g.dataGetter(b).decisionPath;return p(f,{className:I.value,children:o(Q)})}if(g.key===i.ANNOTATION.key||g.key===l.ANNOTATION.key){var X=g.dataGetter(b),Z=X.firstName,$=X.lastName,ee=X.profilePhoto,ae=X.content,te="".concat(Z," ").concat($),re="".concat((Z||"").charAt(0)).concat(($||"").charAt(0));return ae?d("div",{className:I.profileRoot,children:[p("div",{className:I.profile,style:{backgroundColor:"#".concat(m.getColorFromString(te)),backgroundImage:"url(".concat(ee,")")},children:ee?null:re}),p(f,{className:I.value,children:ae})]}):"-"}if([i.BHA.key,s.BHA.key].includes(g.key)){var ne=s.BHA.key===g.key,ie=g.dataGetter(b),le=ie.bhaId,se=ie.components,ce=le&&String(le)||"-",oe=le&&c(se||[],ne)||[];return d("div",{className:I.bhaRoot,children:[p("div",{className:y(I.bhaIdRoot,e({},I.realBhaRoot,!ce.includes("."))),children:p(f,{className:y(I.bhaIdLabel,e({},I.dummyBhaIdLabel,ce.includes("."))),children:ce})}),p(v,{schematic:oe,containerHeight:20,containerWidth:120})]})}if(g.key===i.CASING.key){var me=g.dataGetter(b).outerDiameter;return me?p(f,{className:I.value,children:"".concat(r(me,"shortLength")," ").concat(n("shortLength"))}):null}if(g.key===i.BHA_COUNT.key){var de=g.dataGetter(b).count;return p(f,{className:I.value,children:o(de)})}if(g.key===l.STAGES_DESIGN.key){var pe=g.dataGetter(b).totalNumberOfStages;return Number.isFinite(pe)?d(f,{className:I.value,children:["-/",pe," ",p("span",{className:I.valueSuffix,children:"Stg"})]}):"-"}if(g.key===l.PLUGS_DRILLED_COUNT.key){var ue=g.dataGetter(b).plugsDrilledCount;return Number.isFinite(ue)?d("div",{className:I.valueWrapper,children:[p("img",{src:"/static/media/b0c8b3ba66c35ef3128cc93c5c538060.svg",alt:"drillout",className:I.plugsIcon}),p("span",{className:y(I.value,I.hasLeftMargin),children:ue})]}):"-"}if("development"===process.env.NODE_ENV)throw new Error("".concat(g.key," wasn't handled in WellSummaryItemValue. Returning null"));return null}b.propTypes={item:g.shape({key:g.string,label:g.string,icon:g.node,dataGetter:g.func}).isRequired,summaryData:g.shape({}).isRequired};export default b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"@babel/runtime/helpers/defineProperty";import{get as r,sortBy as e,omit as n}from"lodash";import a from"@babel/runtime/helpers/slicedToArray";import
|
|
1
|
+
import t from"@babel/runtime/helpers/defineProperty";import"../../../constants/completion.js";import"../../../constants/alerts.js";import{get as r,sortBy as e,omit as n}from"lodash";import a from"@babel/runtime/helpers/slicedToArray";import"../../../constants/goals.js";import"../../../constants/segment.js";import"../../../constants/apps.js";import"../../../constants/drillstring.js";import{DRILLING_WELL_SUMMARY as s,COMPLETION_WELL_SUMMARY as c,DRILLOUT_WELL_SUMMARY as i}from"../../../constants/wellSummary.js";import{RIG_ACTIVITY_COLORS as o}from"../../../constants/rigActivity.js";import u from"@babel/runtime/regenerator";import p from"@babel/runtime/helpers/asyncToGenerator";import{useState as l,useEffect as f}from"react";import{getAppStorage as m}from"../../../clients/jsonApi/index.js";function h(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function d(r){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?h(Object(n),!0).forEach((function(e){t(r,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(n,t))}))}return r}function v(t){return b.apply(this,arguments)}function b(){return(b=p(u.mark((function t(e){var n,a;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.all(e.map(function(){var t=p(u.mark((function t(e){var n;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,m("corva","activities.summary-continuous",e,{fields:["data.activities","data.start_timestamp","data.end_timestamp"].join(","),limit:1,query:"{timestamp#lte#".concat(Math.floor(Date.now()/1e3),"}"),sort:"{timestamp:-1}"});case 3:return n=t.sent,t.abrupt("return",(r(n,"0.data.activities")||[]).map((function(t){return d(d({},t),{},{duration:(t.day||0)+(t.night||0),color:o[t.name]})})));case 7:t.prev=7,t.t0=t.catch(0),console.error(t.t0);case 10:return t.abrupt("return",[]);case 11:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(r){return t.apply(this,arguments)}}()));case 2:return n=t.sent,a={},n.forEach((function(t,r){a[e[r]]=t})),t.abrupt("return",a);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function y(t,r,e,n){return g.apply(this,arguments)}function g(){return(g=p(u.mark((function t(a,s,c,i){var o,p;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,m("corva",s,a,{aggregate:JSON.stringify([{$match:{asset_id:a,timestamp:{$lte:c,$gte:c-86400}}},{$project:{_id:-1,stage_number:1,data:1,timestamp:1}},{$group:{_id:"$stage_number",timestamp:{$first:"$timestamp"},stage_number:{$last:"$stage_number"},first_data:{$first:"$data"},last_data:{$last:"$data"}}}])});case 3:return o=t.sent,p=0,e(o,"timestamp").forEach((function(t,e){if(0===e){var a=n(r(t,"first_data"),i),s=n(r(t,"last_data"),i);Object.keys(s).forEach((function(t){p+=s[t]-(a[t]||0)}))}else{var c=n(r(t,"last_data"),i);Object.keys(c).forEach((function(t){p+=c[t]}))}})),t.abrupt("return",p);case 9:t.prev=9,t.t0=t.catch(0),console.error(t.t0);case 12:return t.abrupt("return",0);case 13:case"end":return t.stop()}}),t,null,[[0,9]])})))).apply(this,arguments)}function w(t){return j.apply(this,arguments)}function j(){return(j=p(u.mark((function t(e){var n,s;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.all(e.map(function(){var t=p(u.mark((function t(e){var n,s,c,i,o,p,l,f,h,d,v;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.t0=Promise,t.next=4,m("corva","completion.wits",e,{limit:1,fields:"timestamp"});case 4:return t.t1=t.sent,t.next=7,m("corva","wireline.wits",e,{limit:1,fields:"timestamp"});case 7:return t.t2=t.sent,t.t3=[t.t1,t.t2],t.next=11,t.t0.all.call(t.t0,t.t3);case 11:if(n=t.sent,s=a(n,2),c=s[0],i=s[1],o=r(c,"0.timestamp"),p=r(i,"0.timestamp"),l=null,o&&p?l=o>p?o:p:o?l=o:p&&(l=p),l){t.next=21;break}return t.abrupt("return",[]);case 21:return t.next=23,Promise.all([y(e,"completion.activity.summary-stage",l,["activities"]),y(e,"wireline.activity.summary-stage",l,["durations"])]);case 23:return f=t.sent,h=a(f,2),d=h[0],v=h[1],t.abrupt("return",[{name:"frac",duration:d,color:"#7177FF"},{name:"wireline",duration:v,color:"#FF9C00"}]);case 30:t.prev=30,t.t4=t.catch(0),console.error(t.t4);case 33:return t.abrupt("return",[]);case 34:case"end":return t.stop()}}),t,null,[[0,30]])})));return function(r){return t.apply(this,arguments)}}()));case 2:return n=t.sent,s={},n.forEach((function(t,r){s[e[r]]=t})),t.abrupt("return",s);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function x(t,r){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=l(!0),o=a(n,2),h=o[0],b=o[1],y=l({}),g=a(y,2),j=g[0],x=g[1],O=l(!0),_=a(O,2),$=_[0],k=_[1],P=l({}),E=a(P,2),S=E[0],D=E[1],F="drilling"===r;return f((function(){function n(){return(n=p(u.mark((function r(){var n,a,o,p,l,f,h;return u.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=(e||Object.values(F?s:d(d({},c),i))).filter((function(t){return t.dataSource&&t.dataSource.length})),a=[],n.forEach((function(t){t.dataSource.forEach((function(t){var r=t.provider,e=t.collection,n=t.fields;r&&e&&n&&n.length?n.forEach((function(t){return a.push("".concat(r,"#").concat(e,".").concat(t))})):e&&a.push(e)}))})),r.prev=3,o={asset_id:{$in:t}},p=a.reduce((function(t,r){return t[r]=1,t}),{asset_id:1}),l={aggregate:JSON.stringify([{$match:o},{$project:p}])},r.next=9,m("corva","well_cache",null,l);case 9:f=r.sent,h={},f.forEach((function(t){var r=t.asset_id;h[r]=t})),x(h),r.next=18;break;case 15:r.prev=15,r.t0=r.catch(3),console.error(r.t0);case 18:b(!1);case 19:case"end":return r.stop()}}),r,null,[[3,15]])})))).apply(this,arguments)}function a(){return(a=p(u.mark((function e(){var n;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,"drilling"!==r){e.next=7;break}return e.next=4,v(t);case 4:e.t0=e.sent,e.next=10;break;case 7:return e.next=9,w(t);case 9:e.t0=e.sent;case 10:n=e.t0,D(n),e.next=17;break;case 14:e.prev=14,e.t1=e.catch(0),console.error(e.t1);case 17:k(!1);case 18:case"end":return e.stop()}}),e,null,[[0,14]])})))).apply(this,arguments)}b(!0),k(!0),function(){n.apply(this,arguments)}(),function(){a.apply(this,arguments)}()}),[]),[h||$,j,S]}export{x as useWellSummaryData};
|
package/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"@babel/runtime/helpers/defineProperty";import"react/jsx-runtime";import"react";import"@babel/runtime/helpers/objectWithoutProperties";export{default as Modal}from"./Modal/index.js";export{default as IconMenu}from"./IconMenu/index.js";export{default as StyledMenuItem}from"./StyledMenuItem/index.js";export{default as LoadingIndicator}from"./LoadingIndicator/LoadingIndicator.js";export{default as Tooltip}from"./Tooltip.js";export{default as Avatar}from"./Avatar/index.js";export{AnnotationsProvider,useAnnotationsDispatch,useAnnotationsState}from"./Annotations/AnnotationsContext.js";import"./DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"react-router";import"./DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";export{default as ConfirmationDialog}from"./ConfirmationDialog.js";export{default as AnnotationsList}from"./Annotations/components/AnnotationsList/index.js";export{default as LastAnnotation}from"./Annotations/components/LastAnnotation/index.js";export{default as PadModeSelect}from"./PadModeSelect/PadModeSelect.js";export{default as AppHeader}from"./DevCenter/AppHeader/AppHeader.js";export{default as AppSideBar}from"./DevCenter/AppSideBar/AppSideBar.js";export{default as AppsDataProvider}from"./DevCenter/AppsDataProvider/AppsDataProvider.js";export{default as InternalErrorView}from"./ErrorBoundary/InternalErrorView/InternalErrorView.js";export{default as ErrorBoundary}from"./ErrorBoundary/ErrorBoundary.js";import*as e from"./Typography.js";export{e as Typography};import"./ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";export{Element,Leaf}from"./SlateFormattedText/RenderElements.js";export{slateFormattingTextUtils}from"./SlateFormattedText/utils.js";export{default as SlateFormattedText}from"./SlateFormattedText/SlateFormattedText.js";export{default as AppSettingsDialog}from"./DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";export{default as DevCenterAppContainer}from"./DevCenter/DevCenterAppContainer/DevCenterAppContainer.js";export{default as NavigationBar}from"./DevCenter/NavigationBar/NavigationBar.js";export{default as SideBar}from"./DevCenter/SideBar/SideBar.js";export{default as TruncatedText}from"./TruncatedText/index.js";export{default as SingleAssetEditor}from"./AssetEditor/SingleAssetEditor.js";export{default as AssetEditorAutocomplete,default as SingleAssetEditorAutocomplete}from"./AssetEditor/AssetEditorAutocomplete.js";export{default as AppSettingsAssetEditor}from"./AssetEditor/index.js";export{default as AppVersionsSelect}from"./AppVersionsSelect/AppVersionsSelect.js";export{default as CollapsableSidebar}from"./CollapsableSidebar.js";export{default as DateTimePicker}from"./DateTimePicker/index.js";export{default as DatePicker}from"./DatePicker/index.js";export{default as ColorPicker}from"./ColorPicker/ColorPicker.js";export{default as AddEditTrack}from"./ParameterCharts/AddEditTrack.js";export{default as ParameterCharts}from"./ParameterCharts/ParameterCharts.js";export{default as ChartActionsList}from"./ChartActionsList/ChartActionsList.js";export{default as ColorEditor}from"./SettingEditors/ColorEditor/index.js";export{default as StyledDropdownEditor}from"./SettingEditors/DropdownEditor/index.js";export{default as RadioEditor}from"./SettingEditors/RadioEditor/index.js";export{default as SwitchControl}from"./SwitchControl/index.js";export{default as RangeSlider}from"./RangeSlider/RangeSlider.js";import*as t from"./Login/index.js";export{t as Login};export{default as Breadcrumbs}from"./Breadcrumbs/index.js";export{default as VirtualizedTable}from"./VirtualizedTable/index.js";export{default as EmptyView}from"./EmptyView/index.js";export{default as EmptyAppView}from"./EmptyView/EmptyAppView/index.js";export{default as Button}from"./Button/index.js";export{default as MenuItem}from"./MenuItem/index.js";export{default as ContextMenuItem}from"./ContextMenuItem/index.js";export{default as FolderMenuItem}from"./FolderMenuItem/index.js";export{default as EditableItem}from"./EditableItem/EditableItem/index.js";export{default as EditableItemWithBadge}from"./EditableItem/EditableItemWithBadge/index.js";export{default as Checkbox}from"./Checkbox/index.js";export{default as FolderMenuItemWithLinks}from"./FolderMenuItemWithLinks/index.js";export{default as IconButton}from"./IconButton/index.js";export{default as Chip}from"./Chip/index.js";export{default as Counter}from"./Counter/index.js";export{default as AnchorsList}from"./AnchorsList/AnchorsList.js";export{default as Select}from"./Select/index.js";export{default as Tabs}from"./Tabs/Tabs.js";export{default as Tab}from"./Tabs/Tab.js";export{default as BHASchematic}from"./Drillstring/BHASchematic.js";export{default as BHAComponentIcon}from"./Drillstring/BHAComponentIcon.js";export{default as BHATable}from"./Drillstring/BHATable/index.js";export{default as BHAComponentDetail}from"./Drillstring/BHAComponentDetail/index.js";export{default as CasingComponentIcon}from"./Casing/CasingComponentIcon.js";export{default as CasingTable}from"./Casing/CasingTable/index.js";import*as r from"./WellSummary/index.js";export{r as WellSummary};export{default as BICOffsetPickerDialog}from"./BICOffsetPickerDialog/index.js";export{default as OffsetWellPickerV2}from"./OffsetWellPickerV2/OffsetWellPickerDialog.js";export{default as Notifications}from"./Notifications/Notifications.js";export{default as NotificationsContainer}from"./Notifications/NotificationsContainer.js";export{default as TextLink}from"./TextLink/index.js";export{default as TemplatePopover}from"./Template/TemplatePopover/index.js";export{default as PinnableFilters}from"./PinnableFilters/PinnableFilters.js";export{default as HeaderLayout}from"./HeaderLayout/HeaderLayout.js";export{default as TableSortLabel}from"./Table/TableSortLabel/TableSortLabel.js";export{default as TableToolbar}from"./Table/TableToolbar/TableToolbar.js";export{default as PriceInput}from"./PriceInput/PriceInput.js";export{default as LabelsCounter}from"./LabelsCounter/LabelsCounter.js";export{default as Step}from"./Stepper/Step.js";export{default as StepsWrapper}from"./Stepper/StepsWrapper.js";export{default as Stepper}from"./Stepper/Stepper.js";export{default as CommentIcon}from"./Comment/CommentIcon/index.js";export{default as FilesLoader}from"./FilesLoader/FilesLoader.js";
|
|
1
|
+
import"@babel/runtime/helpers/defineProperty";import"react/jsx-runtime";import"react";import"@babel/runtime/helpers/objectWithoutProperties";export{default as Modal}from"./Modal/index.js";export{default as IconMenu}from"./IconMenu/index.js";export{default as StyledMenuItem}from"./StyledMenuItem/index.js";export{default as LoadingIndicator}from"./LoadingIndicator/LoadingIndicator.js";export{default as Tooltip}from"./Tooltip.js";export{default as Avatar}from"./Avatar/index.js";export{AnnotationsProvider,useAnnotationsDispatch,useAnnotationsState}from"./Annotations/AnnotationsContext.js";import"./DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"react-router";import"./DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";export{default as ConfirmationDialog}from"./ConfirmationDialog.js";export{default as AnnotationsList}from"./Annotations/components/AnnotationsList/index.js";export{default as LastAnnotation}from"./Annotations/components/LastAnnotation/index.js";export{default as PadModeSelect}from"./PadModeSelect/PadModeSelect.js";export{default as AppHeader}from"./DevCenter/AppHeader/AppHeader.js";export{default as AppSideBar}from"./DevCenter/AppSideBar/AppSideBar.js";export{default as AppsDataProvider}from"./DevCenter/AppsDataProvider/AppsDataProvider.js";export{default as InternalErrorView}from"./ErrorBoundary/InternalErrorView/InternalErrorView.js";export{default as ErrorBoundary}from"./ErrorBoundary/ErrorBoundary.js";import*as e from"./Typography.js";export{e as Typography};import"./ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";export{Element,Leaf}from"./SlateFormattedText/RenderElements.js";export{slateFormattingTextUtils}from"./SlateFormattedText/utils.js";export{default as SlateFormattedText}from"./SlateFormattedText/SlateFormattedText.js";export{default as AppSettingsDialog}from"./DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";export{default as DevCenterAppContainer}from"./DevCenter/DevCenterAppContainer/DevCenterAppContainer.js";export{default as NavigationBar}from"./DevCenter/NavigationBar/NavigationBar.js";export{default as SideBar}from"./DevCenter/SideBar/SideBar.js";export{default as TruncatedText}from"./TruncatedText/index.js";export{default as SingleAssetEditor}from"./AssetEditor/SingleAssetEditor.js";export{default as AssetEditorAutocomplete,default as SingleAssetEditorAutocomplete}from"./AssetEditor/AssetEditorAutocomplete.js";export{default as AppSettingsAssetEditor}from"./AssetEditor/index.js";export{default as AppVersionsSelect}from"./AppVersionsSelect/AppVersionsSelect.js";export{default as CollapsableSidebar}from"./CollapsableSidebar.js";export{default as DateTimePicker}from"./DateTimePicker/index.js";export{default as DatePicker}from"./DatePicker/index.js";export{default as ColorPicker}from"./ColorPicker/ColorPicker.js";export{default as AddEditTrack}from"./ParameterCharts/AddEditTrack.js";export{default as ParameterCharts}from"./ParameterCharts/ParameterCharts.js";export{default as ChartActionsList}from"./ChartActionsList/ChartActionsList.js";export{default as ColorEditor}from"./SettingEditors/ColorEditor/index.js";export{default as StyledDropdownEditor}from"./SettingEditors/DropdownEditor/index.js";export{default as RadioEditor}from"./SettingEditors/RadioEditor/index.js";export{default as SwitchControl}from"./SwitchControl/index.js";export{default as RangeSlider}from"./RangeSlider/RangeSlider.js";import*as t from"./Login/index.js";export{t as Login};export{default as Breadcrumbs}from"./Breadcrumbs/index.js";export{default as VirtualizedTable}from"./VirtualizedTable/index.js";export{default as EmptyView}from"./EmptyView/index.js";export{default as EmptyAppView}from"./EmptyView/EmptyAppView/index.js";export{default as Button}from"./Button/index.js";export{default as MenuItem}from"./MenuItem/index.js";export{default as ContextMenuItem}from"./ContextMenuItem/index.js";export{default as FolderMenuItem}from"./FolderMenuItem/index.js";export{default as EditableItem}from"./EditableItem/EditableItem/index.js";export{default as EditableItemWithBadge}from"./EditableItem/EditableItemWithBadge/index.js";export{default as Checkbox}from"./Checkbox/index.js";export{default as FolderMenuItemWithLinks}from"./FolderMenuItemWithLinks/index.js";export{default as IconButton}from"./IconButton/index.js";export{default as Chip}from"./Chip/index.js";export{default as Counter}from"./Counter/index.js";export{default as AnchorsList}from"./AnchorsList/AnchorsList.js";export{default as Select}from"./Select/index.js";export{default as Tabs}from"./Tabs/Tabs.js";export{default as Tab}from"./Tabs/Tab.js";export{default as BHASchematic}from"./Drillstring/BHASchematic.js";export{default as BHAComponentIcon}from"./Drillstring/BHAComponentIcon.js";export{default as BHATable}from"./Drillstring/BHATable/index.js";export{default as BHAComponentDetail}from"./Drillstring/BHAComponentDetail/index.js";export{default as CasingComponentIcon}from"./Casing/CasingComponentIcon.js";export{default as CasingTable}from"./Casing/CasingTable/index.js";import*as r from"./WellSummary/index.js";export{r as WellSummary};export{default as BICOffsetPickerDialog}from"./BICOffsetPickerDialog/index.js";export{default as OffsetWellPickerV2}from"./OffsetWellPickerV2/OffsetWellPickerDialog.js";export{default as Notifications}from"./Notifications/Notifications.js";export{default as NotificationsContainer}from"./Notifications/NotificationsContainer.js";export{default as TextLink}from"./TextLink/index.js";export{default as TemplatePopover}from"./Template/TemplatePopover/index.js";export{default as PinnableFilters}from"./PinnableFilters/PinnableFilters.js";export{default as HeaderLayout}from"./HeaderLayout/HeaderLayout.js";import*as o from"./PadOffsetsPicker/index.js";export{o as PadOffsetsPicker};export{default as TableSortLabel}from"./Table/TableSortLabel/TableSortLabel.js";export{default as TableToolbar}from"./Table/TableToolbar/TableToolbar.js";export{default as PriceInput}from"./PriceInput/PriceInput.js";export{default as LabelsCounter}from"./LabelsCounter/LabelsCounter.js";export{default as Step}from"./Stepper/Step.js";export{default as StepsWrapper}from"./Stepper/StepsWrapper.js";export{default as Stepper}from"./Stepper/Stepper.js";export{default as CommentIcon}from"./Comment/CommentIcon/index.js";export{default as FilesLoader}from"./FilesLoader/FilesLoader.js";
|
package/constants/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as r from"./
|
|
1
|
+
import*as r from"./completion.js";export{r as completion};import*as o from"./alerts.js";export{o as alerts};export{DEV_CENTER_CLI_APP_ID}from"./devcenter.js";import*as s from"./goals.js";export{s as goals};export{ASSET_TYPES}from"./assetTypes.js";import*as t from"./segment.js";export{t as segment};import*as e from"./apps.js";export{e as apps};import*as m from"./drillstring.js";export{m as drillstring};export{COMPLETION_WELL_SUMMARY,DRILLING_WELL_SUMMARY,DRILLOUT_WELL_SUMMARY}from"./wellSummary.js";export{RIG_ACTIVITY_COLORS}from"./rigActivity.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@corva/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0-0",
|
|
4
4
|
"description": "Shared components/utils for Corva ui projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"corva-ui"
|
|
@@ -153,6 +153,7 @@
|
|
|
153
153
|
"style-loader": "1.0.0",
|
|
154
154
|
"svg-url-loader": "6.0.0",
|
|
155
155
|
"terser-webpack-plugin": "4.2.3",
|
|
156
|
+
"use-tiny-state-machine": "^0.0.2",
|
|
156
157
|
"uuid": "3.4.0",
|
|
157
158
|
"video-extensions": "1.1.0",
|
|
158
159
|
"webpack": "4.41.5",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import t from"lodash/set";import r from"lodash/get";import i from"moment";import{getUnitPreference as s,convertValue as o,getUnitDisplay as n}from"./convert.js";function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function l(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?a(Object(i),!0).forEach((function(r){e(t,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):a(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function _(e){return null==e||""===e}function h(e,t,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=i.isMinInclusive,o=void 0===s||s,n=parseFloat(e);return!Number.isNaN(n)&&(!(o&&n<t||!o&&n<=t)&&!(r&&n>r))}function g(e,t,r){var i=s("shortLength"),n=e,a=t;"in"!==i&&(n=o(e,"shortLength",i,"in"),a=o(t,"shortLength",i,"in"));var l=2.673*(a*a-n*n),_="in"!==i?o(l,"massPerLength","lb-ft"):l;return r>=.5*_&&r<=1.5*_}function d(e){var t=e.toJS().data,r=t.id,s=t.start_timestamp_str,a=t.start_depth,l=t.components,_=n("shortLength"),d=n("length"),m={general:{},components:{},specificErrors:{}},u=l.filter((function(e){return"bit"===e.family})),f=u.length>0?u[0].size:null,b=l.filter((function(e){return"mwd"===e.family&&e.has_gamma_sensor})),p=!1;if(isValueEmpty(r)&&(m.id="It should not be empty.",p=!0),s&&!i(new Date(s)).isValid()&&(p=!0,m.start_timestamp="Invalid Date."),Number.isFinite(a)){var v=o(0,"length","ft"),z=o(55e3,"length","ft"),w=o(1,"length","ft");(a<=v||a>z)&&(p=!0,m.start_depth="Should be a positive number ".concat(v.toFixed(2),"~").concat(z.toFixed(2)," (").concat(d,")")),a===w&&(p=!0,m.start_depth="Should not be equal to ".concat(w," (").concat(d,")"))}else p=!0,m.start_depth="It should not be empty.";for(var L=0;L<l.length;L+=1){var y=void 0,x=void 0,F=void 0,j=void 0,I=void 0,O=void 0,V=void 0,E=void 0,q=void 0,k=void 0,D=void 0,P=void 0,S=void 0,N=void 0,R=void 0,T=l[L],B={};switch(T.family){case"ct":y=o(0,"shortLength","in"),F=o(100,"shortLength","in"),x=o(1,"shortLength","in"),j=o(100,"shortLength","in"),N=o(0,"shortLength","in"),R=o(500,"shortLength","in"),V=o(0,"length","ft");break;case"dp":case"hwdp":y=o(1,"shortLength","in"),F=o(7,"shortLength","in"),x=o(2,"shortLength","in"),j=o(8,"shortLength","in"),E=o(1,"shortLength","in"),q=o(7,"shortLength","in"),k=o(2,"shortLength","in"),D=o(10,"shortLength","in"),V=o(0,"length","ft");break;case"dc":y=o(.5,"shortLength","in"),F=o(7,"shortLength","in"),x=o(2,"shortLength","in"),j=o(13,"shortLength","in"),V=o(0,"length","ft");break;case"stabilizer":y=o(0,"shortLength","in"),F=o(100,"shortLength","in"),x=o(1,"shortLength","in"),j=o(100,"shortLength","in"),V=o(0,"length","ft");break;case"pdm":x=o(2,"shortLength","in"),j=o(15,"shortLength","in"),y=o(0,"shortLength","in"),F=o(12,"shortLength","in"),V=o(4,"length","ft"),S=0;break;case"mwd":case"agitator":case"rss":x=o(2,"shortLength","in"),j=o(13,"shortLength","in"),y=o(0,"shortLength","in"),F=o(12,"shortLength","in"),V=o(1,"length","ft"),P=0;break;case"ur":y=o(0,"shortLength","in"),F=o(50,"shortLength","in"),x=o(1,"shortLength","in"),j=o(50,"shortLength","in"),I=o(1,"shortLength","in"),O=o(50,"shortLength","in");break;case"bit":break;default:y=o(0,"shortLength","in"),F=o(100,"shortLength","in"),x=o(1,"shortLength","in"),j=o(100,"shortLength","in"),V=o(0,"length","ft")}if(isValueEmpty(y)||isValueEmpty(x)||(h(T.inner_diameter,y,F)||(B.inner_diameter="".concat(y.toFixed(1),"~").concat(F.toFixed(1)," (").concat(_,")"),p=!0),h(T.outer_diameter,x,j)||(B.outer_diameter="".concat(x.toFixed(1),"~").concat(j.toFixed(1)," (").concat(_,")"),p=!0),h(T.inner_diameter,y,F)&&h(T.outer_diameter,x,j)&&!h(T.inner_diameter,y,T.outer_diameter)&&(B.outer_diameter="O.D > I.D",p=!0),!B.outer_diameter&&f&&+T.outer_diameter+o(.1,"shortLength","in")>f&&(B.outer_diameter=" O.D + 0.1 < Bit Size",p=!0),h(T.linear_weight,0)||(B.linear_weight="Invalid value",p=!0),"dp"!==T.family&&"hwdp"!==T.family&&"dc"!==T.family&&"ct"!==T.family&&"ur"!==T.family||B.inner_diameter||B.outer_diameter||B.linear_weight||g(T.inner_diameter,T.outer_diameter,T.linear_weight)||(B.linear_weight="Invalid range",p=!0)),"ur"===T.family&&(h(T.ur_opened_od,I,O)?T.ur_opened_od<f&&(B.ur_opened_od="Max O.D (Opened) >= Bit Size",p=!0):(B.ur_opened_od="".concat(I.toFixed(1),"~").concat(O.toFixed(1)," (").concat(_,")"),p=!0)),isValueEmpty(E)||isValueEmpty(k)||(h(T.inner_diameter_tooljoint,E,q)||(B.inner_diameter_tooljoint="".concat(E.toFixed(1),"~").concat(q.toFixed(1)," (").concat(_,")"),p=!0),h(T.outer_diameter_tooljoint,k,D)||(B.outer_diameter_tooljoint="".concat(k.toFixed(1),"~").concat(D.toFixed(1)," (").concat(_,")"),p=!0),h(T.outer_diameter_tooljoint,T.outer_diameter,D)||(B.outer_diameter_tooljoint="Tool Joint O.D >= O.D",p=!0)),isValueEmpty(V)||h(T.length,V)||(B.length="Invalid value",p=!0),isValueEmpty(T.length_tooljoint)||isValueEmpty(T.component_length)||+T.length_tooljoint>+T.component_length&&(B.length_tooljoint="Tool Joint Length < Component Length",p=!0),T.off_bottom_pressure_loss&&T.off_bottom_pressure_loss.length>0){B.off_bottom_pressure_loss={};for(var J=0;J<T.off_bottom_pressure_loss.length;J+=1){var M=T.off_bottom_pressure_loss[J];B.off_bottom_pressure_loss[J]={},isValueEmpty(M.flow_rate)&&(B.off_bottom_pressure_loss[J].flow_rate="flow rate is required.",p=!0),isValueEmpty(M.pressure_loss)&&(B.off_bottom_pressure_loss[J].pressure_loss="pressure loss is required.",p=!0),isValueEmpty(S)||h(M.pressure_loss,S,null,{isMinInclusive:!1})||(B.off_bottom_pressure_loss[J].pressure_loss="Invalid range",p=!0)}}if(T.pressure_loss&&T.pressure_loss.length>0){B.pressure_loss={};for(var C=0;C<T.pressure_loss.length;C+=1){var A=T.pressure_loss[C];B.pressure_loss[C]={},isValueEmpty(A.flow_rate)&&(B.pressure_loss[C].flow_rate="flow rate is required.",p=!0),isValueEmpty(A.pressure_loss)&&(B.pressure_loss[C].pressure_loss="pressure loss is required.",p=!0),isValueEmpty(P)||h(A.pressure_loss,P,null,{isMinInclusive:!1})||(B.pressure_loss[C].pressure_loss="Invalid range",p=!0)}}if(T.has_stabilizer&&T.stabilizer){var G=o(0,"shortLength","in"),H=o(100,"shortLength","in"),K=o(1,"shortLength","in"),Q=o(100,"shortLength","in"),U=o(0,"length","ft");h(T.stabilizer.inner_diameter,G,H)&&h(T.stabilizer.outer_diameter,K,Q)&&!h(T.stabilizer.inner_diameter,y,T.stabilizer.outer_diameter)&&(B.stabilizer_outer_diameter="O.D > I.D",p=!0),h(T.stabilizer.inner_diameter,G,H)||(B.stabilizer_inner_diameter="".concat(G.toFixed(1),"~").concat(H.toFixed(1)," (").concat(_,")"),p=!0),h(T.stabilizer.outer_diameter,K,Q)||(B.stabilizer_outer_diameter="".concat(K.toFixed(1),"~").concat(Q.toFixed(1)," (").concat(_,")"),p=!0),isValueEmpty(U)||h(T.stabilizer.length,U)||(B.stabilizer_length="Invalid value",p=!0),isValueEmpty(T.stabilizer.linear_weight)&&(B.stabilizer_linear_weight="Invalid value",p=!0),!B.stabilizer_outer_diameter&&f&&+T.stabilizer.outer_diameter+o(.1,"shortLength","in")>f&&(B.stabilizer_outer_diameter=" O.D + 0.1 < Bit Size",p=!0)}if("ct"===T.family&&(h(T.reel_diameter,N,R)||(B.reel_diameter="".concat(N.toFixed(1),"~").concat(R.toFixed(1)," (").concat(_,")"),p=!0)),"bit"===T.family){var W=c(1,"shortLength","in"),X=W*W*0,Y=W*W*20;h(T.tfa,X,Y)||(B.tfa="TFA must be ".concat(X.toFixed(2),"~").concat(20..toFixed(2)),p=!0)}if("rss"===T.family&&(h(T.flow_loss_percentage,0,10)||(B.flow_loss_percentage="It must be ".concat(0,"~").concat(10),p=!0)),"mwd"===T.family&&(b.length>1?(B.gamma_sensor_to_bit_distance="Only 1 gamma sensor allowed. Currently ".concat(b.length),p=!0):T.has_gamma_sensor&&!Number.isFinite(T.gamma_sensor_to_bit_distance)&&(B.gamma_sensor_to_bit_distance="This field is required.",p=!0),T.has_survey_sensor&&!Number.isFinite(T.bit_to_survey_distance)?(B.bit_to_survey_distance="This field is required.",p=!0):T.has_survey_sensor&&T.bit_to_survey_distance<=0?(B.bit_to_survey_distance="Should be a positive number.",p=!0):T.has_survey_sensor&&T.bit_to_survey_distance>150&&(B.bit_to_survey_distance="Should be less then 150.",p=!0),T.has_directional_sensor&&!Number.isFinite(T.directional_sensor_to_bit_distance)?(B.directional_sensor_to_bit_distance="This field is required.",p=!0):T.has_directional_sensor&&T.directional_sensor_to_bit_distance<=0?(B.directional_sensor_to_bit_distance="Should be a positive number.",p=!0):T.has_directional_sensor&&T.directional_sensor_to_bit_distance>150&&(B.directional_sensor_to_bit_distance="Should be less then 150.",p=!0)),"pdm"===T.family){var Z=void 0,$=void 0;h(T.number_rotor_lobes,1,10)||(B.number_rotor_lobes="It must be ".concat(1,"~").concat(10),p=!0),h(T.number_stator_lobes,2,10)||(B.number_stator_lobes="It must be ".concat(2,"~").concat(10),p=!0),h(T.rpg,0,10)||(B.rpg="It must be ".concat(0,"~").concat(10),p=!0),Z=o(0,"force","klbf"),$=o(200,"force","klbf"),isValueEmpty(T.max_weight_on_bit)||h(T.max_weight_on_bit,Z,$)||(B.max_weight_on_bit="It must be ".concat($.toFixed(2),"~").concat($.toFixed(2)),p=!0),Z=o(0,"volumeFlowRate","gal/min"),$=o(2500,"volumeFlowRate","gal/min"),h(T.min_standard_flowrate,Z,$)||(B.min_standard_flowrate="It must be ".concat(Z.toFixed(2),"~").concat($.toFixed(2)),p=!0),h(T.max_standard_flowrate,Z,$)||(B.max_standard_flowrate="It must be ".concat(Z.toFixed(2),"~").concat($.toFixed(2)),p=!0),Z=o(0,"pressure","psi"),$=o(3e3,"pressure","psi"),h(T.max_operating_differential_pressure,Z,$)||(B.max_operating_differential_pressure="It must be ".concat(Z.toFixed(2),"~").concat($.toFixed(2)),p=!0),Z=o(0,"torque","ft-klbf"),$=o(40,"torque","ft-klbf"),h(T.torque_at_max_operating_differential_pressure,Z,$)||(B.torque_at_max_operating_differential_pressure="It must be ".concat(Z.toFixed(2),"~").concat($.toFixed(2)),p=!0),h(T.flow_loss_percentage,0,20)||(B.flow_loss_percentage="It must be ".concat(0,"~").concat(20),p=!0)}m.components[T.id]=B}return 1!==u.length&&(m.general.bit_count='Number of "BIT" components is invalid.',p=!0),1===u.length&&"bit"!==l[l.length-1].family&&"bit"!==l[0].family&&(m.general.bit_position='"BIT" category should be on the bottom of the list.',p=!0),p?m:null}function m(e){var s=r(e,["data","components"]);"bit"===r(s,[0,"family"])&&(s=s.reverse().map((function(e,t){return l(l({},e),{},{order:t})})),e=t(e,["data","components"],s));var o=e.toJS().data,n=o.start_timestamp_str&&i(new Date(o.start_timestamp_str));return n&&n.isValid()&&(o.start_timestamp=n.unix()),delete o.start_timestamp_str,o.start_depth=u(o.start_depth,"length","ft"),o.components=o.components.map((function(e){var t=Object.assign({},e);if(t.inner_diameter=u(t.inner_diameter,"shortLength","in"),t.outer_diameter=u(t.outer_diameter,"shortLength","in",4),t.linear_weight=u(t.linear_weight,"massPerLength","lb-ft"),t.weight=u(t.weight,"mass","lb"),t.length=u(t.length,"length","ft"),t.component_length=u(t.component_length,"length","ft"),t.outer_diameter_tooljoint=u(t.outer_diameter_tooljoint,"shortLength","in"),t.inner_diameter_tooljoint=u(t.inner_diameter_tooljoint,"shortLength","in"),t.length_tooljoint=u(t.length_tooljoint,"length","ft"),"bit"===t.family||"ur"===t.family){var r=u(1,"shortLength","in");if(t.size=u(t.size,"shortLength","in",3),t.nozzle_sizes&&t.nozzle_sizes.length>0)for(var i=0;i<t.nozzle_sizes.length;i+=1){var s=t.nozzle_sizes[i];s.size=1!==r?32*u(s.size,"shortLength","in"):s.size}t.tfa=1!==r?t.tfa*(r*r):t.tfa}if("pdm"===t.family){if(t.max_weight_on_bit=u(t.max_weight_on_bit,"force","klbf"),t.min_standard_flowrate=u(t.min_standard_flowrate,"volumeFlowRate","gal/min"),t.max_standard_flowrate=u(t.max_standard_flowrate,"volumeFlowRate","gal/min"),t.max_operating_differential_pressure=u(t.max_operating_differential_pressure,"pressure","psi"),t.torque_at_max_operating_differential_pressure=u(t.torque_at_max_operating_differential_pressure,"torque","ft-klbf",3),t.rpg=u(t.rpg,"revolutionPerVolume","rpg"),t.off_bottom_pressure_loss&&t.off_bottom_pressure_loss.length>0)for(var o=0;o<t.off_bottom_pressure_loss.length;o+=1){var n=t.off_bottom_pressure_loss[o];n.flow_rate=u(n.flow_rate,"volumeFlowRate","gal/min"),n.pressure_loss=u(n.pressure_loss,"pressure","psi")}t.has_stabilizer||delete t.stabilizer,t.stabilizer&&(t.stabilizer.inner_diameter=t.stabilizer.inner_diameter&&u(t.stabilizer.inner_diameter,"shortLength","in"),t.stabilizer.outer_diameter=t.stabilizer.outer_diameter&&u(t.stabilizer.outer_diameter,"shortLength","in"),t.stabilizer.linear_weight=t.stabilizer.linear_weight&&u(t.stabilizer.linear_weight,"massPerLength","lb-ft"),t.stabilizer.weight=t.stabilizer.weight&&u(t.stabilizer.weight,"mass","lb"),t.stabilizer.length=t.length&&u(t.stabilizer.length,"length","ft"),t.stabilizer.gauge_od=t.stabilizer.gauge_od&&u(t.stabilizer.gauge_od,"shortLength","in"),t.stabilizer.gauge_length=t.stabilizer.gauge_length&&u(t.stabilizer.gauge_length,"shortLength","in"),t.stabilizer.blade_width=t.stabilizer.blade_width&&u(t.stabilizer.blade_width,"shortLength","in"),t.stabilizer.stab_centerpoint_to_bit=t.stabilizer.stab_centerpoint_to_bit&&u(t.stabilizer.stab_centerpoint_to_bit,"length","ft"))}if("stabilizer"===t.family&&(t.gauge_od=u(t.gauge_od,"shortLength","in"),t.gauge_length=u(t.gauge_length,"shortLength","in"),t.blade_width=u(t.blade_width,"shortLength","in")),("mwd"===t.family||"rss"===t.family||"agitator"===t.family)&&t.pressure_loss&&t.pressure_loss.length>0)for(var a=0;a<t.pressure_loss.length;a+=1){var l=t.pressure_loss[a];l.flow_rate=u(l.flow_rate,"volumeFlowRate","gal/min"),l.pressure_loss=u(l.pressure_loss,"pressure","psi")}return"bit"!==t.family&&delete t.bit_type,!t.has_gamma_sensor&&Number.isFinite(t.gamma_sensor_to_bit_distance)&&delete t.gamma_sensor_to_bit_distance,!t.has_survey_sensor&&Number.isFinite(t.bit_to_survey_distance)&&delete t.bit_to_survey_distance,!t.has_directional_sensor&&Number.isFinite(t.directional_sensor_to_bit_distance)&&delete t.directional_sensor_to_bit_distance,delete t.c_length,t})),l(l({},e),{},{data:o})}function u(e,t,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2;return null==e?null:t&&r?parseFloat(o(e,t,s(t),r,i)):parseFloat(e)}function f(e){var t=e.toJS().data,r=t.components;if(t.start_depth=c(t.start_depth,"length","ft"),r.length>0)if("bit"===r[0].family){r[0].c_length=r[0].length||0;for(var i=1;i<r.length;i+=1)r[i].c_length=parseFloat(r[i-1].c_length)+parseFloat(r[i].length||0)}else{var s=r.length-1;r[s].c_length=r[s].length||0;for(var o=s-1;o>=0;o-=1)r[o].c_length=parseFloat(r[o+1].c_length)+parseFloat(r[o].length||0)}for(var n=0;n<r.length;n+=1){var a=r[n];if(a.inner_diameter=c(a.inner_diameter,"shortLength","in"),a.outer_diameter=c(a.outer_diameter,"shortLength","in",4),a.linear_weight=c(a.linear_weight,"massPerLength","lb-ft"),a.weight=c(a.weight,"mass","lb"),a.length=c(a.length,"length","ft"),a.component_length=c(a.component_length,"length","ft"),a.outer_diameter_tooljoint=c(a.outer_diameter_tooljoint,"shortLength","in"),a.inner_diameter_tooljoint=c(a.inner_diameter_tooljoint,"shortLength","in"),a.length_tooljoint=c(a.length_tooljoint,"length","ft"),a.c_length=c(a.c_length,"length","ft"),a.gamma_sensor_to_bit_distance=c(a.gamma_sensor_to_bit_distance,"length","ft"),"bit"===a.family||"ur"===a.family){var _=c(1,"shortLength","in");if(a.size=c(a.size,"shortLength","in"),a.nozzle_sizes&&a.nozzle_sizes.length>0)for(var h=0;h<a.nozzle_sizes.length;h+=1){var g=a.nozzle_sizes[h];g.size=1!==_?c(g.size,"shortLength","in")/32:g.size}a.tfa=1!==_?a.tfa*(_*_):a.tfa}if("pdm"===a.family){if(a.max_weight_on_bit=c(a.max_weight_on_bit,"force","klbf"),a.min_standard_flowrate=c(a.min_standard_flowrate,"volumeFlowRate","gal/min"),a.max_standard_flowrate=c(a.max_standard_flowrate,"volumeFlowRate","gal/min"),a.max_operating_differential_pressure=c(a.max_operating_differential_pressure,"pressure","psi"),a.torque_at_max_operating_differential_pressure=c(a.torque_at_max_operating_differential_pressure,"torque","ft-klbf",3),a.off_bottom_pressure_loss&&a.off_bottom_pressure_loss.length>0)for(var d=0;d<a.off_bottom_pressure_loss.length;d+=1){var m=a.off_bottom_pressure_loss[d];m.flow_rate=c(m.flow_rate,"volumeFlowRate","gal/min"),m.pressure_loss=c(m.pressure_loss,"pressure","psi")}a.rpg=c(a.rpg,"revolutionPerVolume","rpg"),a.has_stabilizer&&a.stabilizer&&(a.stabilizer.inner_diameter=c(a.stabilizer.inner_diameter,"shortLength","in"),a.stabilizer.outer_diameter=c(a.stabilizer.outer_diameter,"shortLength","in"),a.stabilizer.linear_weight=c(a.stabilizer.linear_weight,"massPerLength","lb-ft"),a.stabilizer.weight=c(a.stabilizer.weight,"mass","lb"),a.stabilizer.length=c(a.stabilizer.length,"length","ft"),a.stabilizer.gauge_od=c(a.stabilizer.gauge_od,"shortLength","in"),a.stabilizer.gauge_length=c(a.stabilizer.gauge_length,"shortLength","in"),a.stabilizer.blade_width=c(a.stabilizer.blade_width,"shortLength","in"),a.stabilizer.stab_centerpoint_to_bit=c(a.stabilizer.stab_centerpoint_to_bit,"length","ft"))}if("stabilizer"===a.family&&(a.gauge_od=c(a.gauge_od,"shortLength","in"),a.gauge_length=c(a.gauge_length,"shortLength","in"),a.blade_width=c(a.blade_width,"shortLength","in")),("mwd"===a.family||"rss"===a.family||"agitator"===a.family)&&a.pressure_loss&&a.pressure_loss.length>0)for(var u=0;u<a.pressure_loss.length;u+=1){var f=a.pressure_loss[u];f.flow_rate=c(f.flow_rate,"volumeFlowRate","gal/min"),f.pressure_loss=c(f.pressure_loss,"pressure","psi")}}return l(l({},e),{},{data:t})}function c(e,t,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2;return 0===e||e?t&&r?o(e,t,r,null,i):e:null}export{m as convertRecordBackToImperialUnit,f as convertRecordtoPrefUnit,u as ctoi,c as ctop,g as isValidLinearWeight,h as isValidNumber,_ as sValueEmpty,d as validate};
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import t from"moment";import{getUnitPreference as r,convertValue as i,getUnitDisplay as s}from"./convert.js";import o from"lodash/get";import n from"lodash/set";function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function l(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?a(Object(i),!0).forEach((function(r){e(t,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):a(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function _(e){return null==e||""===e}function h(e,t,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=i.isMinInclusive,o=void 0===s||s,n=parseFloat(e);return!Number.isNaN(n)&&(!(o&&n<t||!o&&n<=t)&&!(r&&n>r))}function g(e,t,s){var o=r("shortLength"),n=e,a=t;"in"!==o&&(n=i(e,"shortLength",o,"in"),a=i(t,"shortLength",o,"in"));var l=2.673*(a*a-n*n),_="in"!==o?i(l,"massPerLength","lb-ft"):l;return s>=.5*_&&s<=1.5*_}function d(e){var r=e.toJS().data,o=r.id,n=r.start_timestamp_str,a=r.start_depth,l=r.components,_=s("shortLength"),d=s("length"),m={general:{},components:{},specificErrors:{}},u=l.filter((function(e){return"bit"===e.family})),f=u.length>0?u[0].size:null,b=l.filter((function(e){return"mwd"===e.family&&e.has_gamma_sensor})),p=!1;if(isValueEmpty(o)&&(m.id="It should not be empty.",p=!0),n&&!t(new Date(n)).isValid()&&(p=!0,m.start_timestamp="Invalid Date."),Number.isFinite(a)){var v=i(0,"length","ft"),z=i(55e3,"length","ft"),w=i(1,"length","ft");(a<=v||a>z)&&(p=!0,m.start_depth="Should be a positive number ".concat(v.toFixed(2),"~").concat(z.toFixed(2)," (").concat(d,")")),a===w&&(p=!0,m.start_depth="Should not be equal to ".concat(w," (").concat(d,")"))}else p=!0,m.start_depth="It should not be empty.";for(var L=0;L<l.length;L+=1){var y=void 0,x=void 0,F=void 0,j=void 0,I=void 0,O=void 0,V=void 0,E=void 0,q=void 0,k=void 0,D=void 0,P=void 0,S=void 0,N=void 0,R=void 0,T=l[L],B={};switch(T.family){case"ct":y=i(0,"shortLength","in"),F=i(100,"shortLength","in"),x=i(1,"shortLength","in"),j=i(100,"shortLength","in"),N=i(0,"shortLength","in"),R=i(500,"shortLength","in"),V=i(0,"length","ft");break;case"dp":case"hwdp":y=i(1,"shortLength","in"),F=i(7,"shortLength","in"),x=i(2,"shortLength","in"),j=i(8,"shortLength","in"),E=i(1,"shortLength","in"),q=i(7,"shortLength","in"),k=i(2,"shortLength","in"),D=i(10,"shortLength","in"),V=i(0,"length","ft");break;case"dc":y=i(.5,"shortLength","in"),F=i(7,"shortLength","in"),x=i(2,"shortLength","in"),j=i(13,"shortLength","in"),V=i(0,"length","ft");break;case"stabilizer":y=i(0,"shortLength","in"),F=i(100,"shortLength","in"),x=i(1,"shortLength","in"),j=i(100,"shortLength","in"),V=i(0,"length","ft");break;case"pdm":x=i(2,"shortLength","in"),j=i(15,"shortLength","in"),y=i(0,"shortLength","in"),F=i(12,"shortLength","in"),V=i(4,"length","ft"),S=0;break;case"mwd":case"agitator":case"rss":x=i(2,"shortLength","in"),j=i(13,"shortLength","in"),y=i(0,"shortLength","in"),F=i(12,"shortLength","in"),V=i(1,"length","ft"),P=0;break;case"ur":y=i(0,"shortLength","in"),F=i(50,"shortLength","in"),x=i(1,"shortLength","in"),j=i(50,"shortLength","in"),I=i(1,"shortLength","in"),O=i(50,"shortLength","in");break;case"bit":break;default:y=i(0,"shortLength","in"),F=i(100,"shortLength","in"),x=i(1,"shortLength","in"),j=i(100,"shortLength","in"),V=i(0,"length","ft")}if(isValueEmpty(y)||isValueEmpty(x)||(h(T.inner_diameter,y,F)||(B.inner_diameter="".concat(y.toFixed(1),"~").concat(F.toFixed(1)," (").concat(_,")"),p=!0),h(T.outer_diameter,x,j)||(B.outer_diameter="".concat(x.toFixed(1),"~").concat(j.toFixed(1)," (").concat(_,")"),p=!0),h(T.inner_diameter,y,F)&&h(T.outer_diameter,x,j)&&!h(T.inner_diameter,y,T.outer_diameter)&&(B.outer_diameter="O.D > I.D",p=!0),!B.outer_diameter&&f&&+T.outer_diameter+i(.1,"shortLength","in")>f&&(B.outer_diameter=" O.D + 0.1 < Bit Size",p=!0),h(T.linear_weight,0)||(B.linear_weight="Invalid value",p=!0),"dp"!==T.family&&"hwdp"!==T.family&&"dc"!==T.family&&"ct"!==T.family&&"ur"!==T.family||B.inner_diameter||B.outer_diameter||B.linear_weight||g(T.inner_diameter,T.outer_diameter,T.linear_weight)||(B.linear_weight="Invalid range",p=!0)),"ur"===T.family&&(h(T.ur_opened_od,I,O)?T.ur_opened_od<f&&(B.ur_opened_od="Max O.D (Opened) >= Bit Size",p=!0):(B.ur_opened_od="".concat(I.toFixed(1),"~").concat(O.toFixed(1)," (").concat(_,")"),p=!0)),isValueEmpty(E)||isValueEmpty(k)||(h(T.inner_diameter_tooljoint,E,q)||(B.inner_diameter_tooljoint="".concat(E.toFixed(1),"~").concat(q.toFixed(1)," (").concat(_,")"),p=!0),h(T.outer_diameter_tooljoint,k,D)||(B.outer_diameter_tooljoint="".concat(k.toFixed(1),"~").concat(D.toFixed(1)," (").concat(_,")"),p=!0),h(T.outer_diameter_tooljoint,T.outer_diameter,D)||(B.outer_diameter_tooljoint="Tool Joint O.D >= O.D",p=!0)),isValueEmpty(V)||h(T.length,V)||(B.length="Invalid value",p=!0),isValueEmpty(T.length_tooljoint)||isValueEmpty(T.component_length)||+T.length_tooljoint>+T.component_length&&(B.length_tooljoint="Tool Joint Length < Component Length",p=!0),T.off_bottom_pressure_loss&&T.off_bottom_pressure_loss.length>0){B.off_bottom_pressure_loss={};for(var J=0;J<T.off_bottom_pressure_loss.length;J+=1){var M=T.off_bottom_pressure_loss[J];B.off_bottom_pressure_loss[J]={},isValueEmpty(M.flow_rate)&&(B.off_bottom_pressure_loss[J].flow_rate="flow rate is required.",p=!0),isValueEmpty(M.pressure_loss)&&(B.off_bottom_pressure_loss[J].pressure_loss="pressure loss is required.",p=!0),isValueEmpty(S)||h(M.pressure_loss,S,null,{isMinInclusive:!1})||(B.off_bottom_pressure_loss[J].pressure_loss="Invalid range",p=!0)}}if(T.pressure_loss&&T.pressure_loss.length>0){B.pressure_loss={};for(var C=0;C<T.pressure_loss.length;C+=1){var A=T.pressure_loss[C];B.pressure_loss[C]={},isValueEmpty(A.flow_rate)&&(B.pressure_loss[C].flow_rate="flow rate is required.",p=!0),isValueEmpty(A.pressure_loss)&&(B.pressure_loss[C].pressure_loss="pressure loss is required.",p=!0),isValueEmpty(P)||h(A.pressure_loss,P,null,{isMinInclusive:!1})||(B.pressure_loss[C].pressure_loss="Invalid range",p=!0)}}if(T.has_stabilizer&&T.stabilizer){var G=i(0,"shortLength","in"),H=i(100,"shortLength","in"),K=i(1,"shortLength","in"),Q=i(100,"shortLength","in"),U=i(0,"length","ft");h(T.stabilizer.inner_diameter,G,H)&&h(T.stabilizer.outer_diameter,K,Q)&&!h(T.stabilizer.inner_diameter,y,T.stabilizer.outer_diameter)&&(B.stabilizer_outer_diameter="O.D > I.D",p=!0),h(T.stabilizer.inner_diameter,G,H)||(B.stabilizer_inner_diameter="".concat(G.toFixed(1),"~").concat(H.toFixed(1)," (").concat(_,")"),p=!0),h(T.stabilizer.outer_diameter,K,Q)||(B.stabilizer_outer_diameter="".concat(K.toFixed(1),"~").concat(Q.toFixed(1)," (").concat(_,")"),p=!0),isValueEmpty(U)||h(T.stabilizer.length,U)||(B.stabilizer_length="Invalid value",p=!0),isValueEmpty(T.stabilizer.linear_weight)&&(B.stabilizer_linear_weight="Invalid value",p=!0),!B.stabilizer_outer_diameter&&f&&+T.stabilizer.outer_diameter+i(.1,"shortLength","in")>f&&(B.stabilizer_outer_diameter=" O.D + 0.1 < Bit Size",p=!0)}if("ct"===T.family&&(h(T.reel_diameter,N,R)||(B.reel_diameter="".concat(N.toFixed(1),"~").concat(R.toFixed(1)," (").concat(_,")"),p=!0)),"bit"===T.family){var W=c(1,"shortLength","in"),X=W*W*0,Y=W*W*20;h(T.tfa,X,Y)||(B.tfa="TFA must be ".concat(X.toFixed(2),"~").concat(20..toFixed(2)),p=!0)}if("rss"===T.family&&(h(T.flow_loss_percentage,0,10)||(B.flow_loss_percentage="It must be ".concat(0,"~").concat(10),p=!0)),"mwd"===T.family&&(b.length>1?(B.gamma_sensor_to_bit_distance="Only 1 gamma sensor allowed. Currently ".concat(b.length),p=!0):T.has_gamma_sensor&&!Number.isFinite(T.gamma_sensor_to_bit_distance)&&(B.gamma_sensor_to_bit_distance="This field is required.",p=!0),T.has_survey_sensor&&!Number.isFinite(T.bit_to_survey_distance)?(B.bit_to_survey_distance="This field is required.",p=!0):T.has_survey_sensor&&T.bit_to_survey_distance<=0?(B.bit_to_survey_distance="Should be a positive number.",p=!0):T.has_survey_sensor&&T.bit_to_survey_distance>150&&(B.bit_to_survey_distance="Should be less then 150.",p=!0),T.has_directional_sensor&&!Number.isFinite(T.directional_sensor_to_bit_distance)?(B.directional_sensor_to_bit_distance="This field is required.",p=!0):T.has_directional_sensor&&T.directional_sensor_to_bit_distance<=0?(B.directional_sensor_to_bit_distance="Should be a positive number.",p=!0):T.has_directional_sensor&&T.directional_sensor_to_bit_distance>150&&(B.directional_sensor_to_bit_distance="Should be less then 150.",p=!0)),"pdm"===T.family){var Z=void 0,$=void 0;h(T.number_rotor_lobes,1,10)||(B.number_rotor_lobes="It must be ".concat(1,"~").concat(10),p=!0),h(T.number_stator_lobes,2,10)||(B.number_stator_lobes="It must be ".concat(2,"~").concat(10),p=!0),h(T.rpg,0,10)||(B.rpg="It must be ".concat(0,"~").concat(10),p=!0),Z=i(0,"force","klbf"),$=i(200,"force","klbf"),isValueEmpty(T.max_weight_on_bit)||h(T.max_weight_on_bit,Z,$)||(B.max_weight_on_bit="It must be ".concat($.toFixed(2),"~").concat($.toFixed(2)),p=!0),Z=i(0,"volumeFlowRate","gal/min"),$=i(2500,"volumeFlowRate","gal/min"),h(T.min_standard_flowrate,Z,$)||(B.min_standard_flowrate="It must be ".concat(Z.toFixed(2),"~").concat($.toFixed(2)),p=!0),h(T.max_standard_flowrate,Z,$)||(B.max_standard_flowrate="It must be ".concat(Z.toFixed(2),"~").concat($.toFixed(2)),p=!0),Z=i(0,"pressure","psi"),$=i(3e3,"pressure","psi"),h(T.max_operating_differential_pressure,Z,$)||(B.max_operating_differential_pressure="It must be ".concat(Z.toFixed(2),"~").concat($.toFixed(2)),p=!0),Z=i(0,"torque","ft-klbf"),$=i(40,"torque","ft-klbf"),h(T.torque_at_max_operating_differential_pressure,Z,$)||(B.torque_at_max_operating_differential_pressure="It must be ".concat(Z.toFixed(2),"~").concat($.toFixed(2)),p=!0),h(T.flow_loss_percentage,0,20)||(B.flow_loss_percentage="It must be ".concat(0,"~").concat(20),p=!0)}m.components[T.id]=B}return 1!==u.length&&(m.general.bit_count='Number of "BIT" components is invalid.',p=!0),1===u.length&&"bit"!==l[l.length-1].family&&"bit"!==l[0].family&&(m.general.bit_position='"BIT" category should be on the bottom of the list.',p=!0),p?m:null}function m(e){var r=o(e,["data","components"]);"bit"===o(r,[0,"family"])&&(r=r.reverse().map((function(e,t){return l(l({},e),{},{order:t})})),e=n(e,["data","components"],r));var i=e.toJS().data,s=i.start_timestamp_str&&t(new Date(i.start_timestamp_str));return s&&s.isValid()&&(i.start_timestamp=s.unix()),delete i.start_timestamp_str,i.start_depth=u(i.start_depth,"length","ft"),i.components=i.components.map((function(e){var t=Object.assign({},e);if(t.inner_diameter=u(t.inner_diameter,"shortLength","in"),t.outer_diameter=u(t.outer_diameter,"shortLength","in",4),t.linear_weight=u(t.linear_weight,"massPerLength","lb-ft"),t.weight=u(t.weight,"mass","lb"),t.length=u(t.length,"length","ft"),t.component_length=u(t.component_length,"length","ft"),t.outer_diameter_tooljoint=u(t.outer_diameter_tooljoint,"shortLength","in"),t.inner_diameter_tooljoint=u(t.inner_diameter_tooljoint,"shortLength","in"),t.length_tooljoint=u(t.length_tooljoint,"length","ft"),"bit"===t.family||"ur"===t.family){var r=u(1,"shortLength","in");if(t.size=u(t.size,"shortLength","in",3),t.nozzle_sizes&&t.nozzle_sizes.length>0)for(var i=0;i<t.nozzle_sizes.length;i+=1){var s=t.nozzle_sizes[i];s.size=1!==r?32*u(s.size,"shortLength","in"):s.size}t.tfa=1!==r?t.tfa*(r*r):t.tfa}if("pdm"===t.family){if(t.max_weight_on_bit=u(t.max_weight_on_bit,"force","klbf"),t.min_standard_flowrate=u(t.min_standard_flowrate,"volumeFlowRate","gal/min"),t.max_standard_flowrate=u(t.max_standard_flowrate,"volumeFlowRate","gal/min"),t.max_operating_differential_pressure=u(t.max_operating_differential_pressure,"pressure","psi"),t.torque_at_max_operating_differential_pressure=u(t.torque_at_max_operating_differential_pressure,"torque","ft-klbf",3),t.rpg=u(t.rpg,"revolutionPerVolume","rpg"),t.off_bottom_pressure_loss&&t.off_bottom_pressure_loss.length>0)for(var o=0;o<t.off_bottom_pressure_loss.length;o+=1){var n=t.off_bottom_pressure_loss[o];n.flow_rate=u(n.flow_rate,"volumeFlowRate","gal/min"),n.pressure_loss=u(n.pressure_loss,"pressure","psi")}t.has_stabilizer||delete t.stabilizer,t.stabilizer&&(t.stabilizer.inner_diameter=t.stabilizer.inner_diameter&&u(t.stabilizer.inner_diameter,"shortLength","in"),t.stabilizer.outer_diameter=t.stabilizer.outer_diameter&&u(t.stabilizer.outer_diameter,"shortLength","in"),t.stabilizer.linear_weight=t.stabilizer.linear_weight&&u(t.stabilizer.linear_weight,"massPerLength","lb-ft"),t.stabilizer.weight=t.stabilizer.weight&&u(t.stabilizer.weight,"mass","lb"),t.stabilizer.length=t.length&&u(t.stabilizer.length,"length","ft"),t.stabilizer.gauge_od=t.stabilizer.gauge_od&&u(t.stabilizer.gauge_od,"shortLength","in"),t.stabilizer.gauge_length=t.stabilizer.gauge_length&&u(t.stabilizer.gauge_length,"shortLength","in"),t.stabilizer.blade_width=t.stabilizer.blade_width&&u(t.stabilizer.blade_width,"shortLength","in"),t.stabilizer.stab_centerpoint_to_bit=t.stabilizer.stab_centerpoint_to_bit&&u(t.stabilizer.stab_centerpoint_to_bit,"length","ft"))}if("stabilizer"===t.family&&(t.gauge_od=u(t.gauge_od,"shortLength","in"),t.gauge_length=u(t.gauge_length,"shortLength","in"),t.blade_width=u(t.blade_width,"shortLength","in")),("mwd"===t.family||"rss"===t.family||"agitator"===t.family)&&t.pressure_loss&&t.pressure_loss.length>0)for(var a=0;a<t.pressure_loss.length;a+=1){var l=t.pressure_loss[a];l.flow_rate=u(l.flow_rate,"volumeFlowRate","gal/min"),l.pressure_loss=u(l.pressure_loss,"pressure","psi")}return"bit"!==t.family&&delete t.bit_type,!t.has_gamma_sensor&&Number.isFinite(t.gamma_sensor_to_bit_distance)&&delete t.gamma_sensor_to_bit_distance,!t.has_survey_sensor&&Number.isFinite(t.bit_to_survey_distance)&&delete t.bit_to_survey_distance,!t.has_directional_sensor&&Number.isFinite(t.directional_sensor_to_bit_distance)&&delete t.directional_sensor_to_bit_distance,delete t.c_length,t})),l(l({},e),{},{data:i})}function u(e,t,s){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2;return null==e?null:t&&s?parseFloat(i(e,t,r(t),s,o)):parseFloat(e)}function f(e){var t=e.toJS().data,r=t.components;if(t.start_depth=c(t.start_depth,"length","ft"),r.length>0)if("bit"===r[0].family){r[0].c_length=r[0].length||0;for(var i=1;i<r.length;i+=1)r[i].c_length=parseFloat(r[i-1].c_length)+parseFloat(r[i].length||0)}else{var s=r.length-1;r[s].c_length=r[s].length||0;for(var o=s-1;o>=0;o-=1)r[o].c_length=parseFloat(r[o+1].c_length)+parseFloat(r[o].length||0)}for(var n=0;n<r.length;n+=1){var a=r[n];if(a.inner_diameter=c(a.inner_diameter,"shortLength","in"),a.outer_diameter=c(a.outer_diameter,"shortLength","in",4),a.linear_weight=c(a.linear_weight,"massPerLength","lb-ft"),a.weight=c(a.weight,"mass","lb"),a.length=c(a.length,"length","ft"),a.component_length=c(a.component_length,"length","ft"),a.outer_diameter_tooljoint=c(a.outer_diameter_tooljoint,"shortLength","in"),a.inner_diameter_tooljoint=c(a.inner_diameter_tooljoint,"shortLength","in"),a.length_tooljoint=c(a.length_tooljoint,"length","ft"),a.c_length=c(a.c_length,"length","ft"),a.gamma_sensor_to_bit_distance=c(a.gamma_sensor_to_bit_distance,"length","ft"),"bit"===a.family||"ur"===a.family){var _=c(1,"shortLength","in");if(a.size=c(a.size,"shortLength","in"),a.nozzle_sizes&&a.nozzle_sizes.length>0)for(var h=0;h<a.nozzle_sizes.length;h+=1){var g=a.nozzle_sizes[h];g.size=1!==_?c(g.size,"shortLength","in")/32:g.size}a.tfa=1!==_?a.tfa*(_*_):a.tfa}if("pdm"===a.family){if(a.max_weight_on_bit=c(a.max_weight_on_bit,"force","klbf"),a.min_standard_flowrate=c(a.min_standard_flowrate,"volumeFlowRate","gal/min"),a.max_standard_flowrate=c(a.max_standard_flowrate,"volumeFlowRate","gal/min"),a.max_operating_differential_pressure=c(a.max_operating_differential_pressure,"pressure","psi"),a.torque_at_max_operating_differential_pressure=c(a.torque_at_max_operating_differential_pressure,"torque","ft-klbf",3),a.off_bottom_pressure_loss&&a.off_bottom_pressure_loss.length>0)for(var d=0;d<a.off_bottom_pressure_loss.length;d+=1){var m=a.off_bottom_pressure_loss[d];m.flow_rate=c(m.flow_rate,"volumeFlowRate","gal/min"),m.pressure_loss=c(m.pressure_loss,"pressure","psi")}a.rpg=c(a.rpg,"revolutionPerVolume","rpg"),a.has_stabilizer&&a.stabilizer&&(a.stabilizer.inner_diameter=c(a.stabilizer.inner_diameter,"shortLength","in"),a.stabilizer.outer_diameter=c(a.stabilizer.outer_diameter,"shortLength","in"),a.stabilizer.linear_weight=c(a.stabilizer.linear_weight,"massPerLength","lb-ft"),a.stabilizer.weight=c(a.stabilizer.weight,"mass","lb"),a.stabilizer.length=c(a.stabilizer.length,"length","ft"),a.stabilizer.gauge_od=c(a.stabilizer.gauge_od,"shortLength","in"),a.stabilizer.gauge_length=c(a.stabilizer.gauge_length,"shortLength","in"),a.stabilizer.blade_width=c(a.stabilizer.blade_width,"shortLength","in"),a.stabilizer.stab_centerpoint_to_bit=c(a.stabilizer.stab_centerpoint_to_bit,"length","ft"))}if("stabilizer"===a.family&&(a.gauge_od=c(a.gauge_od,"shortLength","in"),a.gauge_length=c(a.gauge_length,"shortLength","in"),a.blade_width=c(a.blade_width,"shortLength","in")),("mwd"===a.family||"rss"===a.family||"agitator"===a.family)&&a.pressure_loss&&a.pressure_loss.length>0)for(var u=0;u<a.pressure_loss.length;u+=1){var f=a.pressure_loss[u];f.flow_rate=c(f.flow_rate,"volumeFlowRate","gal/min"),f.pressure_loss=c(f.pressure_loss,"pressure","psi")}}return l(l({},e),{},{data:t})}function c(e,t,r){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2;return 0===e||e?t&&r?i(e,t,r,null,s):e:null}export{m as convertRecordBackToImperialUnit,f as convertRecordtoPrefUnit,u as ctoi,c as ctop,g as isValidLinearWeight,h as isValidNumber,_ as sValueEmpty,d as validate};
|
package/utils/FluidCheckUtils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"@babel/runtime/helpers/defineProperty";import i from"
|
|
1
|
+
import t from"@babel/runtime/helpers/defineProperty";import i from"moment";import{convertValue as r,getUnitPreference as e}from"./convert.js";import s from"lodash/get";import a from"lodash/isNumber";function n(t,i){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);i&&(e=e.filter((function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),r.push.apply(r,e)}return r}function o(i){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?n(Object(e),!0).forEach((function(r){t(i,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):n(Object(e)).forEach((function(t){Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(e,t))}))}return i}function d(t){return 0!==t&&!t}function p(t,i,r,e){return this.isValueEmpty(t)?!!e:a(t)&&t>i&&t<r}function c(t,i,e){return a(t)?i&&e?parseFloat(r(t,i,e)):parseFloat(t):null}function u(t,i,s){return a(t)?i&&s?r(t,i,e(i),s):parseFloat(t):null}function l(t){var i=this.ctop(s(t,["data","mud_density"]),"density","ppg"),r=this.ctop(s(t,["data","depth"]),"length","ft"),e=this.ctop(s(t,["data","viscosity","yp"]),"yp","hsf");return o(o({},t),{},{data:o(o({},t.data),{},{mud_density:i,depth:r,viscosity:o(o({},t.data.viscosity),{},{yp:e})})})}function y(t){var i=this.ctoi(s(t,["data","mud_density"]),"density","ppg"),r=this.ctoi(s(t,["data","depth"]),"length","ft"),e=this.ctoi(s(t,["data","viscosity","yp"]),"yp","hsf");return o(o({},t),{},{data:o(o({},t.data),{},{mud_density:i,depth:r,viscosity:o(o({},t.data.viscosity),{},{yp:e}),date_str:null})})}function h(t){var r=t.data,e=r.date_str,s=r.mud_density,a=r.viscosity,n=a.pv,o=a.yp,d=a.rpm_readings,p=!1,c={viscosity:{rpm_readings:[]}};e&&!i(new Date(e)).isValid()&&(p=!0,c.date="Invalid Date.");var u=this.ctop(5,"density","ppg"),l=this.ctop(20,"density","ppg");this.isValueValid(s,u,l,!1)||(p=!0,c.mud_density="It should be ".concat(u," ~ ").concat(l)),(this.isValueEmpty(n)||this.isValueEmpty(o))&&d.length<2&&(p=!0,c.viscosity.rpm_readings_required="At least 2 paris of rpm and dial_reading required."),this.isValueValid(n,0,200,!c.viscosity.rpm_readings_required)||(p=!0,c.viscosity.pv="It should be 0~200"),this.isValueValid(o,0,200,!c.viscosity.rpm_readings_required)||(p=!0,c.viscosity.yp="It should be 0~200");for(var y=[],h=0;h<d.length;h+=1){c.viscosity.rpm_readings[h]={};var m=c.viscosity.rpm_readings[h];this.isValueValid(d[h].rpm,0,1e3)||(p=!0,m.rpm="It should be 0~1000"),this.isValueValid(d[h].dial_reading,0,300)||(p=!0,m.dial_reading="It should be 0~300"),-1!==y.indexOf(d[h].rpm)&&(p=!0,m.rpm="Duplicated RPM value"),y.push(d[h].rpm),d[h].originalIndex=h}var f=d.sort((function(t,i){return t.rpm-i.rpm}));return f.forEach((function(t,i){var r=c.viscosity.rpm_readings[t.originalIndex];f[i-1]&&t.dial_reading<f[i-1].dial_reading&&(p=!0,r.dial_reading="Dial Readings should be in increasing order")})),{hasErrors:p,errors:c}}export{y as convertToImperialUnit,l as convertToPrefUnit,u as ctoi,c as ctop,d as isValueEmpty,p as isValueValid,h as validate};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import{
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import{COMPONENT_FAMILIES as t}from"../../constants/casing.js";import{convertValue as r}from"../convert.js";function n(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 i(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?n(Object(i),!0).forEach((function(r){e(t,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function o(e){var r=t.find((function(t){return t.type===e}));return r?r.name:""}function c(e){for(var t=[],n=0,c=0;c<e.length;c+=1){var a=e[c],f=i(i({},a),{},{family_name:o(a.family),inner_diameter:r(a.inner_diameter,"shortLength","in"),outer_diameter:r(a.outer_diameter,"shortLength","in"),linear_weight:r(a.linear_weight,"massPerLength","lb-ft"),weight:r(a.linear_weight,"mass","lb"),length:r(a.linear_weight,"length","ft")});n+=f.length,f.cum_length=n,t.push(f)}return t}export{c as convertComponents,o as getFamilyName};
|