@corva/ui 0.72.0-0 → 0.72.0-2

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),i=require("react"),o=require("@material-ui/core"),n=require("re-resizable"),r=require("react-sizeme"),a=require("classnames"),l=require("lodash"),d=require("../shared/useThrottledCallback.js"),u=require("./Handle.js"),s=require("react/jsx-runtime");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=h(e),m=h(t),f=h(n),v=h(a);function g(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,o)}return i}function p(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?g(Object(i),!0).forEach((function(t){c.default(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):g(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var b=function(e){var t,o,n=e.min,r=e.max,a=e.value,l=e.size,h=e.orientation,g=e.valueFormatter,b=e.displayFormatter,y=e.editableHandles,j=e.onChange,z=e.onStop,H=e.reversed,B=e.handlePosition,L=e.handleClasses,C=e.minimal,O=x(),k=i.useRef(null),E=i.useRef(null),F=i.useState(g(null==a?void 0:a.at(0))),S=m.default(F,2),R=S[0],P=S[1],q=i.useState(g(null==a?void 0:a.at(1))),M=m.default(q,2),T=M[0],D=M[1],I=i.useRef(null),N=i.useState(!1),W=m.default(N,2),A=W[0],$=W[1];i.useEffect((function(){I.current||(P(Math.min(g(null==a?void 0:a.at(0)),g(null==a?void 0:a.at(1)))),D(Math.max(g(null==a?void 0:a.at(0)),g(null==a?void 0:a.at(1)))))}),[null==a?void 0:a.at(0),null==a?void 0:a.at(1)]),i.useEffect((function(){if("horizontal"===h){var e=l.width/(r-n)*(R-n),t=l.width/(r-n)*(r-T);k.current.updateSize({width:H?t:e,height:l.height}),E.current.updateSize({width:H?e:t,height:l.height})}else if("vertical"===h){var i=l.height/(r-n)*(R-n),o=l.height/(r-n)*(r-T);k.current.updateSize({width:l.width,height:H?o:i}),E.current.updateSize({width:l.width,height:H?i:o})}}),[n,r,R,T,l.width,l.height,h]),i.useEffect((function(){return A?(document.addEventListener("mousemove",G),document.addEventListener("mouseup",J),document.addEventListener("touchmove",K),document.addEventListener("touchend",Q)):(document.removeEventListener("mousemove",G),document.removeEventListener("mouseup",J),document.removeEventListener("touchmove",K),document.removeEventListener("touchend",Q)),function(){document.removeEventListener("mousemove",G),document.removeEventListener("mouseup",J),document.removeEventListener("touchmove",K),document.removeEventListener("touchend",Q)}}),[A]);var X=d.useThrottledCallback((function(e,t,i){I.current="onResize Event";var o,a,d=i.clientWidth,u=i.clientHeight;"right"===t?H?a=g(r-d/l.width*(r-n)):o=g(n+d/l.width*(r-n)):"left"===t?H?o=g(n+d/l.width*(r-n)):a=g(r-d/l.width*(r-n)):"bottom"===t?H?a=g(r-u/l.height*(r-n)):o=g(n+u/l.height*(r-n)):"top"===t&&(H?o=g(n+u/l.height*(r-n)):a=g(r-u/l.height*(r-n))),o=Math.min(o,T),a=Math.max(a,R),P((function(e){return o||e})),D((function(e){return a||e})),j([o||R,a||T])})),Y=d.useThrottledCallback((function(){I.current=null,z()})),Z=function(e,t){I.current={xPos:e,yPos:t,head:R,tail:T}},_=function(e,t){if(I.current){var i;"horizontal"===h?i=(I.current.xPos-e)/l.width*(r-n):"vertical"===h&&(i=(I.current.yPos-t)/l.height*(r-n));var o,a,d=I.current.head-i*(H?-1:1),u=I.current.tail-i*(H?-1:1),s=I.current.tail-I.current.head;d<=n?(o=n,a=n+s):u>=r?(o=r-s,a=r):(o=d,a=u),o=g(o),a=g(a),P(o),D(a),j([o,a])}},G=d.useThrottledCallback((function(e){_(e.clientX,e.clientY)})),J=d.useThrottledCallback((function(){I.current=null,$(!1)})),K=d.useThrottledCallback((function(e){_(e.touches[0].pageX,e.touches[0].pageY)})),Q=d.useThrottledCallback((function(){I.current=null,$(!1)})),U=d.useThrottledCallback((function(e){P(e),j([e,T])})),V=d.useThrottledCallback((function(e){D(e),j([R,e])})),ee=i.useMemo((function(){return(T-R)/(r-n)*("vertical"===h?l.height:l.width)<30}),[n,r,R,T]),te=function(e){var t={min:n,max:T,value:R,onChange:U},i={min:R,max:r,value:T,onChange:V};return"head"===e?s.jsx(u.Handle,p({placement:"head",readOnly:!y,displayFormatter:b,orientation:h,classes:L,minimal:C},H?i:t)):"tail"===e?s.jsx(u.Handle,p({placement:"tail",readOnly:!y,displayFormatter:b,orientation:h,classes:L,minimal:C},H?t:i)):null};return s.jsx("div",{className:O.rootWrapper,children:s.jsxs("div",{className:v.default(O.root,(t={},c.default(t,O.horizontalRoot,"horizontal"===h),c.default(t,O.verticalRoot,"vertical"===h),c.default(t,O.minimal,C),t)),children:[s.jsx(f.default,{ref:k,minHeight:0,minWidth:0,enable:{right:"horizontal"===h,bottom:"vertical"===h},handleComponent:{right:function(){return te("head")},bottom:function(){return te("head")}},onResize:X,onResizeStop:Y}),s.jsx("div",{className:O.body,"data-testid":"slider-body",onMouseDown:function(e){Z(e.clientX,e.clientY),$(!0)},onTouchStart:function(e){Z(e.touches[0].pageX,e.touches[0].pageY),$(!0)},children:ee?s.jsx("div",{className:v.default((o={},c.default(o,O.horizontalBodyHandle,"horizontal"===h),c.default(o,O.verticalBodyHandle,"vertical"===h),c.default(o,O.leftBodyHandle,"left"===B),c.default(o,O.rightBodyHandle,"right"===B),c.default(o,O.topBodyHandle,"top"===B),c.default(o,O.bottomBodyHandle,"bottom"===B),o)),children:s.jsx("div",{className:O.bodyHandle,children:s.jsx(w,{orientation:"vertical",minimal:C})})}):s.jsx("div",{className:O.bodyHandleIcon,children:s.jsx(w,{orientation:h,minimal:C})})}),s.jsx(f.default,{ref:E,minHeight:0,minWidth:0,enable:{left:"horizontal"===h,top:"vertical"===h},handleComponent:{left:function(){return te("tail")},top:function(){return te("tail")}},onResize:X,onResizeStop:Y})]})})};b.defaultProps={orientation:"horizontal",valueFormatter:Math.floor,displayFormatter:function(e){return e},onChange:l.noop,onStop:l.noop,reversed:!1,editableHandles:!0,handleClasses:{},minimal:!1};var y=r.withSize({monitorWidth:!0,monitorHeight:!0})(b),w=function(e){var t=e.orientation;return e.minimal?"horizontal"===t?s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"20",viewBox:"0 -2 16 16",fill:"none",children:s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.33333 4L4 4L4 12L5.33333 12L5.33333 4ZM8.66659 4L8.66659 12L7.33325 12L7.33325 4L8.66659 4ZM12.0001 4L12.0001 12L10.6667 12L10.6667 4L12.0001 4Z",fill:"white"})}):s.jsxs("svg",{width:"12",height:"7",viewBox:"0 0 12 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("rect",{width:"12",height:"1"}),s.jsx("rect",{y:"3",width:"12",height:"1"}),s.jsx("rect",{y:"6",width:"12",height:"1"})]}):"horizontal"===t?s.jsxs("svg",{width:"8",height:"13",viewBox:"0 0 8 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("rect",{x:"7.5",y:"0.5",width:"12",height:"1",transform:"rotate(90 7.5 0.5)"}),s.jsx("rect",{x:"4.5",y:"0.5",width:"12",height:"1",transform:"rotate(90 4.5 0.5)"}),s.jsx("rect",{x:"1.5",y:"0.5",width:"12",height:"1",transform:"rotate(90 1.5 0.5)"})]}):s.jsxs("svg",{width:"12",height:"7",viewBox:"0 0 12 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("rect",{width:"12",height:"1"}),s.jsx("rect",{y:"3",width:"12",height:"1"}),s.jsx("rect",{y:"6",width:"12",height:"1"})]})},x=o.makeStyles((function(e){return{rootWrapper:{position:"relative",width:"100%",height:"100%",zIndex:100},root:{position:"absolute",width:"100%",height:"100%",zIndex:100,"&:hover:not($minimal) $body":{background:"#008BA366"},"&:hover $bodyHandle":{visibility:"visible"}},horizontalRoot:{display:"flex",alignItems:"center"},verticalRoot:{display:"flex",alignItems:"center",flexDirection:"column"},body:{position:"relative",flex:1,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",userSelect:"none",background:"#3B3B3B66",color:"#BDBDBD","& svg":{fill:"currentColor"},"&:hover":{cursor:"grab",background:"#008BA366",color:"#FFFFFF"},"&:active":{cursor:"grabbing"},"&:hover $bodyHandleIcon":{visibility:"visible"}},horizontalBodyHandle:{position:"absolute",bottom:-24},verticalBodyHandle:{position:"absolute",left:-24},leftBodyHandle:{position:"absolute",left:-24,right:"auto"},rightBodyHandle:{position:"absolute",right:-24,left:"auto"},topBodyHandle:{position:"absolute",top:-24,bottom:"auto"},bottomBodyHandle:{position:"absolute",bottom:-24,top:"auto"},bodyHandle:{width:24,height:24,borderRadius:"50%",background:"#03BCD4",color:"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",visibility:"hidden"},bodyHandleIcon:{visibility:"hidden"},minimal:{border:"1px solid ".concat(e.palette.background.b9),borderRadius:4,"& $body":{"&:hover":{background:"#008BA366"},margin:-1,width:"calc(100% + 2px)",height:"calc(100% + 2px)",backgroundColor:o.fade(e.palette.background.b7,.1),border:"1px solid ".concat(e.palette.primary.text9),borderRadius:4}}}}));exports.AdvancedSlider=b,exports.default=y;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),i=require("react"),o=require("@material-ui/core"),n=require("re-resizable"),r=require("react-sizeme"),a=require("classnames"),l=require("lodash"),d=require("../shared/useThrottledCallback.js"),h=require("./Handle.js"),s=require("react/jsx-runtime");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=u(e),m=u(t),f=u(a);function v(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,o)}return i}function p(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?v(Object(i),!0).forEach((function(t){c.default(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):v(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var g=function(e){var t,o,r=e.min,a=e.max,l=e.value,u=e.size,v=e.orientation,g=e.valueFormatter,b=e.displayFormatter,x=e.editableHandles,j=e.onChange,z=e.onStop,H=e.reversed,B=e.handlePosition,C=e.handleClasses,L=e.minimal,O=w(),k=i.useRef(null),R=i.useRef(null),F=i.useState([g(null==l?void 0:l.at(0)),g(null==l?void 0:l.at(1))]),S=m.default(F,2),P=S[0],E=S[1],M=i.useRef(null),q=i.useState(!1),T=m.default(q,2),D=T[0],I=T[1];i.useEffect((function(){if(!M.current){var e=[g(null==l?void 0:l.at(0)),g(null==l?void 0:l.at(1))],t=Math.min.apply(Math,e),i=Math.max.apply(Math,e);E([t,i])}}),[null==l?void 0:l.at(0),null==l?void 0:l.at(1)]);var N=m.default(P,2),W=N[0],A=N[1];i.useEffect((function(){if("horizontal"===v){var e=u.width/(a-r)*(W-r),t=u.width/(a-r)*(a-A);k.current.updateSize({width:H?t:e,height:u.height}),R.current.updateSize({width:H?e:t,height:u.height})}else if("vertical"===v){var i=u.height/(a-r)*(W-r),o=u.height/(a-r)*(a-A);k.current.updateSize({width:u.width,height:H?o:i}),R.current.updateSize({width:u.width,height:H?i:o})}}),[r,a,W,A,u.width,u.height,v]),i.useEffect((function(){var e=function(){document.removeEventListener("mousemove",_),document.removeEventListener("mouseup",G),document.removeEventListener("touchmove",J),document.removeEventListener("touchend",K)};return D?(document.addEventListener("mousemove",_),document.addEventListener("mouseup",G),document.addEventListener("touchmove",J),document.addEventListener("touchend",K)):(e(),z()),function(){e()}}),[D]);var $=d.useThrottledCallback((function(e,t,i){M.current="onResize Event";var o=i.clientWidth,n=i.clientHeight,l=W,d=A;"right"===t?H?d=g(a-o/u.width*(a-r)):l=g(r+o/u.width*(a-r)):"left"===t?H?l=g(r+o/u.width*(a-r)):d=g(a-o/u.width*(a-r)):"bottom"===t?H?d=g(a-n/u.height*(a-r)):l=g(r+n/u.height*(a-r)):"top"===t&&(H?l=g(r+n/u.height*(a-r)):d=g(a-n/u.height*(a-r))),l=Math.min(l,A),d=Math.max(d,W),E([l,d]),j([l,d])})),X=d.useThrottledCallback((function(){M.current=null,z()})),Y=function(e,t){M.current={xPos:e,yPos:t,head:W,tail:A}},Z=function(e,t){if(M.current){var i;"horizontal"===v?i=(M.current.xPos-e)/u.width*(a-r):"vertical"===v&&(i=(M.current.yPos-t)/u.height*(a-r));var o,n,l=M.current.head-i*(H?-1:1),d=M.current.tail-i*(H?-1:1),h=M.current.tail-M.current.head;l<=r?(o=r,n=r+h):d>=a?(o=a-h,n=a):(o=l,n=d),o=g(o),n=g(n),E([o,n]),j([o,n])}},_=d.useThrottledCallback((function(e){Z(e.clientX,e.clientY)})),G=d.useThrottledCallback((function(){M.current=null,I(!1)})),J=d.useThrottledCallback((function(e){Z(e.touches[0].pageX,e.touches[0].pageY)})),K=d.useThrottledCallback((function(){M.current=null,I(!1)})),Q=d.useThrottledCallback((function(e){E([e,A]),j([e,A])})),U=d.useThrottledCallback((function(e){E([W,e]),j([W,e])})),V=i.useMemo((function(){return(A-W)/(a-r)*("vertical"===v?u.height:u.width)<30}),[r,a,W,A]),ee=function(e){var t={min:r,max:A,value:W,onChange:Q},i={min:W,max:a,value:A,onChange:U};return"head"===e?s.jsx(h.Handle,p({placement:"head",readOnly:!x,displayFormatter:b,orientation:v,classes:C,minimal:L},H?i:t)):"tail"===e?s.jsx(h.Handle,p({placement:"tail",readOnly:!x,displayFormatter:b,orientation:v,classes:C,minimal:L},H?t:i)):null};return s.jsx("div",{className:O.rootWrapper,children:s.jsxs("div",{className:f.default(O.root,(t={},c.default(t,O.horizontalRoot,"horizontal"===v),c.default(t,O.verticalRoot,"vertical"===v),c.default(t,O.minimal,L),t)),children:[s.jsx(n.Resizable,{ref:k,minHeight:0,minWidth:0,enable:{right:"horizontal"===v,bottom:"vertical"===v},handleComponent:{right:ee("head"),bottom:ee("head")},onResize:$,onResizeStop:X}),s.jsx("div",{className:O.body,"data-testid":"slider-body",onMouseDown:function(e){Y(e.clientX,e.clientY),I(!0)},onTouchStart:function(e){Y(e.touches[0].pageX,e.touches[0].pageY),I(!0)},children:V?s.jsx("div",{className:f.default((o={},c.default(o,O.horizontalBodyHandle,"horizontal"===v),c.default(o,O.verticalBodyHandle,"vertical"===v),c.default(o,O.leftBodyHandle,"left"===B),c.default(o,O.rightBodyHandle,"right"===B),c.default(o,O.topBodyHandle,"top"===B),c.default(o,O.bottomBodyHandle,"bottom"===B),o)),children:s.jsx("div",{className:O.bodyHandle,children:s.jsx(y,{orientation:"vertical",minimal:L})})}):s.jsx("div",{className:O.bodyHandleIcon,children:s.jsx(y,{orientation:v,minimal:L})})}),s.jsx(n.Resizable,{ref:R,minHeight:0,minWidth:0,enable:{left:"horizontal"===v,top:"vertical"===v},handleComponent:{left:ee("tail"),top:ee("tail")},onResize:$,onResizeStop:X})]})})};g.defaultProps={orientation:"horizontal",valueFormatter:Math.floor,displayFormatter:function(e){return e},onChange:l.noop,onStop:l.noop,reversed:!1,editableHandles:!0,handleClasses:{},minimal:!1};var b=r.withSize({monitorWidth:!0,monitorHeight:!0})(g),y=function(e){var t=e.orientation;return e.minimal?"horizontal"===t?s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"20",viewBox:"0 -2 16 16",fill:"none",children:s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.33333 4L4 4L4 12L5.33333 12L5.33333 4ZM8.66659 4L8.66659 12L7.33325 12L7.33325 4L8.66659 4ZM12.0001 4L12.0001 12L10.6667 12L10.6667 4L12.0001 4Z",fill:"white"})}):s.jsxs("svg",{width:"12",height:"7",viewBox:"0 0 12 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("rect",{width:"12",height:"1"}),s.jsx("rect",{y:"3",width:"12",height:"1"}),s.jsx("rect",{y:"6",width:"12",height:"1"})]}):"horizontal"===t?s.jsxs("svg",{width:"8",height:"13",viewBox:"0 0 8 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("rect",{x:"7.5",y:"0.5",width:"12",height:"1",transform:"rotate(90 7.5 0.5)"}),s.jsx("rect",{x:"4.5",y:"0.5",width:"12",height:"1",transform:"rotate(90 4.5 0.5)"}),s.jsx("rect",{x:"1.5",y:"0.5",width:"12",height:"1",transform:"rotate(90 1.5 0.5)"})]}):s.jsxs("svg",{width:"12",height:"7",viewBox:"0 0 12 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("rect",{width:"12",height:"1"}),s.jsx("rect",{y:"3",width:"12",height:"1"}),s.jsx("rect",{y:"6",width:"12",height:"1"})]})},w=o.makeStyles((function(e){return{rootWrapper:{position:"relative",width:"100%",height:"100%",zIndex:100},root:{position:"absolute",width:"100%",height:"100%",zIndex:100,"&:hover:not($minimal) $body":{background:"#008BA366"},"&:hover $bodyHandle":{visibility:"visible"}},horizontalRoot:{display:"flex",alignItems:"center"},verticalRoot:{display:"flex",alignItems:"center",flexDirection:"column"},body:{position:"relative",flex:1,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",userSelect:"none",background:"#3B3B3B66",color:"#BDBDBD","& svg":{fill:"currentColor"},"&:hover":{cursor:"grab",background:"#008BA366",color:"#FFFFFF"},"&:active":{cursor:"grabbing"},"&:hover $bodyHandleIcon":{visibility:"visible"}},horizontalBodyHandle:{position:"absolute",bottom:-24},verticalBodyHandle:{position:"absolute",left:-24},leftBodyHandle:{position:"absolute",left:-24,right:"auto"},rightBodyHandle:{position:"absolute",right:-24,left:"auto"},topBodyHandle:{position:"absolute",top:-24,bottom:"auto"},bottomBodyHandle:{position:"absolute",bottom:-24,top:"auto"},bodyHandle:{width:24,height:24,borderRadius:"50%",background:"#03BCD4",color:"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",visibility:"hidden"},bodyHandleIcon:{visibility:"hidden"},minimal:{border:"1px solid ".concat(e.palette.background.b9),borderRadius:4,"& $body":{"&:hover":{background:"#008BA366"},margin:-1,width:"calc(100% + 2px)",height:"calc(100% + 2px)",backgroundColor:o.fade(e.palette.background.b7,.1),border:"1px solid ".concat(e.palette.primary.text9),borderRadius:4}}}}));exports.AdvancedSlider=g,exports.default=b;
@@ -1 +1 @@
1
- "use strict";var e=require('./../../ext-esm/tslib/tslib.es6.js'),t=require("react/jsx-runtime"),i=require("@material-ui/core"),a=require("prop-types"),l=require("classnames");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=r(a),o=r(l),s=function(e){var t=e.width,i=void 0===t?18:t,a=e.height,l=void 0===a?14:a,r=e.fill.replace("#","%23");return"<svg width='".concat(i,"' height='").concat(l,"' viewBox='0 0 18 14' fill='").concat(r,"' xmlns='http://www.w3.org/2000/svg'><path d='M6 11.1698L1.83 6.99984L0.410004 8.40984L6 13.9998L18 1.99984L16.59 0.589844L6 11.1698Z'/></svg>")},c=i.makeStyles((function(e){return{checked:{"&::before":{content:'url("data:image/svg+xml; utf8, '.concat(s({fill:e.palette.primary.main}),'")'),display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24,lineHeight:"24px",marginLeft:8,marginRight:"-4px",paddingTop:3},"&.Mui-disabled::before":{content:'url("data:image/svg+xml; utf8, '.concat(s({fill:e.palette.primary.text8}),'")')},"&.MuiChip-sizeSmall::before":{content:'url("data:image/svg+xml; utf8, '.concat(s({width:12,fill:e.palette.primary.main}),'")'),width:16,height:16},"&.MuiChip-sizeSmall.Mui-disabled::before":{content:'url("data:image/svg+xml; utf8, '.concat(s({width:12,fill:e.palette.primary.text8}),'")')},"&.MuiChip-root.MuiChip-clickable":{"& .MuiChip-label, & .MuiChip-deleteIcon, & .MuiChip-icon":{color:"#FFFFFF"}},"& .MuiChip-label:first-child":{marginLeft:"-4px"}},basic:{"&:not([data-not-migrated-MuiChip])":{"&.MuiChip-sizeSmall":{height:12,"& .MuiChip-label":{fontSize:10}},border:"none",textTransform:"uppercase",backgroundColor:e.palette.primary.main,padding:"0 8px",height:16,"& .MuiChip-label":{fontSize:12,fontWeight:500,lineHeight:"12px",letterSpacing:"1px",color:e.palette.background.b1,padding:0},"&:hover":{backgroundColor:e.palette.primary.main,"& .MuiChip-label":{color:e.palette.background.b1}}}}}})),d=function(a){var l,r=a.checked,n=a.classes,s=void 0===n?{}:n,d=a["data-testid"],p=c(),u=o.default(a.className,((l={})[p.basic]="basic"===a.variant,l));return r?t.jsx(i.Chip,e.__assign({"data-testid":d},a,{className:u,classes:e.__assign(e.__assign({},s),{root:o.default(s.root,p.checked)})})):t.jsx(i.Chip,e.__assign({"data-testid":d},a,{className:u}))},p={checked:n.default.bool,"data-testid":n.default.string};d.propTypes=p,d.defaultProps={checked:!1,"data-testid":"Chip"},module.exports=d;
1
+ "use strict";var e=require('./../../ext-esm/tslib/tslib.es6.js'),i=require("react/jsx-runtime"),t=require("@material-ui/core"),a=require("prop-types"),r=require("classnames");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=l(a),o=l(r),s=function(e){var i=e.width,t=void 0===i?18:i,a=e.height,r=void 0===a?14:a,l=e.fill.replace("#","%23");return"<svg width='".concat(t,"' height='").concat(r,"' viewBox='0 0 18 14' fill='").concat(l,"' xmlns='http://www.w3.org/2000/svg'><path d='M6 11.1698L1.83 6.99984L0.410004 8.40984L6 13.9998L18 1.99984L16.59 0.589844L6 11.1698Z'/></svg>")},c=t.makeStyles((function(e){return{checked:{"&::before":{content:'url("data:image/svg+xml; utf8, '.concat(s({fill:e.palette.primary.main}),'")'),display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24,lineHeight:"24px",marginLeft:8,marginRight:"-4px",paddingTop:3},"&.Mui-disabled::before":{content:'url("data:image/svg+xml; utf8, '.concat(s({fill:e.palette.primary.text8}),'")')},"&.MuiChip-sizeSmall::before":{content:'url("data:image/svg+xml; utf8, '.concat(s({width:12,fill:e.palette.primary.main}),'")'),width:16,height:16},"&.MuiChip-sizeSmall.Mui-disabled::before":{content:'url("data:image/svg+xml; utf8, '.concat(s({width:12,fill:e.palette.primary.text8}),'")')},"&.MuiChip-root.MuiChip-clickable":{"& .MuiChip-label, & .MuiChip-deleteIcon, & .MuiChip-icon":{color:"#FFFFFF"}},"& .MuiChip-label:first-child":{marginLeft:"-4px"}},basic:{"&:not([data-not-migrated-MuiChip])":{"&.MuiChip-sizeSmall":{height:12,"& .MuiChip-label":{fontSize:10}},border:"none",textTransform:"uppercase",backgroundColor:e.palette.primary.main,padding:"0 8px",height:16,"& .MuiChip-label":{fontSize:12,fontWeight:500,lineHeight:"12px",letterSpacing:"1px",color:e.palette.background.b1,padding:0},"&:hover":{backgroundColor:e.palette.primary.main,"& .MuiChip-label":{color:e.palette.background.b1}}}}}})),p=function(a){var r,l=a.checked,n=a.classes,s=void 0===n?{}:n,p=c(),u=o.default(a.className,((r={})[p.basic]="basic"===a.variant,r)),d="basic"===a.variant?"default":a.variant;return l?i.jsx(t.Chip,e.__assign({},a,{className:u,classes:e.__assign(e.__assign({},s),{root:o.default(s.root,p.checked)}),variant:d})):i.jsx(t.Chip,e.__assign({},a,{className:u,variant:d}))},u={checked:n.default.bool,"data-testid":n.default.string};p.propTypes=u,p.defaultProps={checked:!1,"data-testid":"Chip"},module.exports=p;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),a=require("react"),s=require("lodash"),n=require("prop-types"),r=require("classnames"),i=require("@material-ui/core");require("../../Annotations/components/AnnotationsList/index.js");var l=require("../../Annotations/components/LastAnnotation/index.js");require("../../Annotations/AnnotationsContext.js");var d=require("../../../constants/segment.js"),o=require("../../../constants/devcenter.js");require("../../../constants/goals.js"),require("../../../constants/alerts.js"),require("../../../constants/apps.js"),require("../../../constants/drillstring.js"),require("../../../constants/completion.js"),require("../../../constants/appPackages.js"),require("../../../constants/notifications.js"),require("../../../constants/feed.js"),require("../../../constants/bha.js"),require("../../../utils/env.js"),require("../../GradientManager/configuration/constants.js");var u=require("../../../utils/devcenter.js"),p=require("./VersionBadge.js"),c=require("./PadMode.js"),f=require("./utils.js"),m=require("../../AssetNameLabel/SecondaryAssetNameLabel.js"),g=require("../../AssetNameLabel/AssetNameLabel.js"),j=require("./PadIcon.js"),A=require("./AppHeader.css.js"),v=require("./AppHeaderStyles.js"),h=require("react/jsx-runtime");function b(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var y=b(e),x=b(t),S=b(n),q=b(r);function L(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,s)}return a}function N(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?L(Object(a),!0).forEach((function(t){y.default(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):L(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var P="DevCenter_AppHeader",_=function(e){return"/assets/".concat(null==e?void 0:e.asset_id)};function O(e){var t,n,r,c,b,y,S,L,O=e.app,I=e.appLastAnnotation,M=e.appSettings,w=e.badge,C=e.children,E=e.classes,T=e.coordinates,D=e.currentUser,W=e.fracFleet,k=e.isMaximized,F=e.logoSrc,H=e.onSettingChange,B=e.openAnnotationsList,R=e.primaryAssetStatusBadge,U=e.rig,V=e.showLastAnnotation,G=e.updateCurrentDashboardAppLastAnnotation,z=e.well,Y=e.wells,Z=e.PadModeComponent,J=a.useState(!1),K=x.default(J,2),Q=K[0],X=K[1],$=a.useRef(null),ee=null==T?void 0:T.pixelWidth;a.useEffect((function(){var e,t;X((null===(e=$.current)||void 0===e?void 0:e.scrollWidth)>(null===(t=$.current)||void 0===t?void 0:t.offsetWidth))}),[null===(t=$.current)||void 0===t?void 0:t.offsetWidth,ee]);var te=f.getAppDimension(ee),ae=u.getAppName(O),se=null==O||null===(n=O.package)||void 0===n||null===(r=n.manifest)||void 0===r||null===(c=r.application)||void 0===c?void 0:c.subtitle,ne=u.getAppSegment(O),re=ne===d.SEGMENTS.COMPLETION,ie=function(e){var t,a=e.appSettings,s=void 0===a?{}:a,n=e.well,r=e.rig,i=e.fracFleet,l=e.segment,o=l===d.SEGMENTS.DRILLING,u=l===d.SEGMENTS.COMPLETION,p=s.wellId,c=s.rigId,f=s.fracFleetId,m=s.padId,g=null==i||null===(t=i.pad_frac_fleets.find((function(e){return e.pad.id===(m||i.current_pad_id)})))||void 0===t?void 0:t.pad,j=o?p&&(null==n?void 0:n.name):null==g?void 0:g.name,A="/assets/types/pad/".concat(m||(null==i?void 0:i.current_pad_id)),v=o?null==r?void 0:r.name:null==i?void 0:i.name,h=!!(p||c||f),b=!1,y=o?v&&_(n):A;return u&&!h&&null!=n&&n.id&&null!=n&&n.name&&(b=!0,h=!0,y=_(n),v=n.name),{isPrimaryAssetStatusVisible:b,isPrimaryNameVisible:h,primaryAssetLink:y,primaryAssetName:v,secondaryAssetLink:o?_(n):"/assets/types/pad/".concat(m||(null==i?void 0:i.current_pad_id)),secondaryAssetName:j}}({appSettings:null==O?void 0:O.settings,well:z,rig:U,fracFleet:W,segment:ne}),le=ie.isPrimaryAssetStatusVisible,de=ie.isPrimaryNameVisible,oe=ie.primaryAssetLink,ue=ie.primaryAssetName,pe=ie.secondaryAssetLink,ce=ie.secondaryAssetName,fe=[f.APP_LAYOUT_SIZES.MEDIUM,f.APP_LAYOUT_SIZES.SMALL].includes(te),me=O&&O.id===o.DEV_CENTER_CLI_APP_ID,ge={fracFleet:W,wells:Y,well:z,onSettingChange:H,appSettings:M,disableActiveWellsInPadSelect:null==O||null===(b=O.package)||void 0===b||null===(y=b.manifest)||void 0===y||null===(S=y.application)||void 0===S||null===(L=S.ui)||void 0===L?void 0:L.disableActiveWellsInPadSelect},je=v.useStyles({isMobileSize:fe});return h.jsxs("div",{className:q.default(je.appHeaderWrapper,E.appHeader),children:[h.jsxs("div",{className:je.appHeaderContainer,children:[h.jsxs("div",{className:je.titleBlock,children:[h.jsxs("div",{className:E.appHeaderTitleWrapper,ref:$,children:[h.jsxs("div",{className:je.titleWrapper,children:[F&&h.jsxs(h.Fragment,{children:[h.jsx("img",{className:je.logo,src:F,alt:"company logo"}),h.jsx("div",{className:je.separateLine})]}),h.jsx(i.Tooltip,{title:Q?ae:"",placement:"bottom",children:h.jsx("h6",{"data-testid":"".concat(P,"_name"),className:je.title,children:ae})}),h.jsx(p.VersionBadge,{appPackage:null==O?void 0:O.package})]}),w]}),(!fe||F)&&se&&h.jsx("h6",{"data-testid":"".concat(P,"_subtitle"),className:je.subtitle,children:se})]}),O&&T&&h.jsxs("div",{className:q.default(A.controlsContainer,k&&A.appMaximized),children:[!fe&&h.jsxs(h.Fragment,{children:[re&&h.jsx(Z,N({},ge)),C]}),h.jsxs("div",{className:A.assetLabels,children:[ce&&h.jsx(m.SecondaryAssetNameLabel,{assetName:ce,coordinatesPixelWidth:ee,dataTestId:"".concat(P,"_secondaryAsset"),href:!me&&pe,icon:re&&h.jsx(j.PadIcon,{}),isColored:!re||O.settings.padId&&O.settings.padId!==W.current_pad_id}),de&&h.jsx(g.AssetNameLabel,{assetName:ue,coordinatesPixelWidth:ee,dataTestId:"".concat(P,"_primaryAsset"),href:!me&&(oe||"/feed"),statusBadge:le&&R})]})]}),V&&I&&h.jsx(l,{annotation:I,appId:s.get(O,["app","id"]),currentUser:D,dashboardAppId:O.id,openAnnotationsList:B,updateCurrentDashboardAppLastAnnotation:G})]}),fe&&se&&!F&&h.jsx("h6",{"data-testid":"".concat(P,"_subtitle"),className:je.subtitle,children:se}),fe&&h.jsxs(i.Box,{display:"flex",alignItems:"center",mt:1,children:[re&&!z&&(Y||W)&&h.jsx("div",{className:A.padModeSelect,children:h.jsx(Z,N({},ge))}),C]})]})}O.propTypes={app:S.default.object.isRequired,badge:S.default.node,classes:S.default.shape({appHeader:S.default.string,appHeaderTitleWrapper:S.default.string}),showLastAnnotation:S.default.bool,currentUser:S.default.shape({}),appLastAnnotation:S.default.shape({}),updateCurrentDashboardAppLastAnnotation:S.default.func,openAnnotationsList:S.default.func,rig:S.default.shape({name:S.default.string,asset_id:S.default.number}),well:S.default.shape({name:S.default.string,asset_id:S.default.number}),fracFleet:S.default.shape({name:S.default.string,current_pad_id:S.default.number,pad_frac_fleets:S.default.arrayOf(S.default.shape({pad:S.default.shape({id:S.default.number.isRequired}).isRequired})).isRequired}),wells:S.default.arrayOf(S.default.shape({})),coordinates:S.default.shape({pixelWidth:S.default.number.isRequired}),isMaximized:S.default.bool,appSettings:S.default.shape({}),onSettingChange:S.default.func,children:S.default.arrayOf(S.default.node),logoSrc:S.default.string,primaryAssetStatusBadge:S.default.node,PadModeComponent:S.default.elementType},O.defaultProps={appLastAnnotation:null,appSettings:null,badge:null,children:null,classes:{},coordinates:void 0,currentUser:void 0,fracFleet:null,isMaximized:!1,logoSrc:null,onSettingChange:void 0,openAnnotationsList:void 0,rig:null,showLastAnnotation:!0,updateCurrentDashboardAppLastAnnotation:function(){},well:null,wells:null,primaryAssetStatusBadge:null,PadModeComponent:c},exports.PAGE_NAME=P,exports.default=O;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),a=require("react"),s=require("lodash"),n=require("prop-types"),r=require("classnames"),i=require("@material-ui/core");require("../../Annotations/components/AnnotationsList/index.js");var l=require("../../Annotations/components/LastAnnotation/index.js");require("../../Annotations/AnnotationsContext.js");var d=require("../../../constants/segment.js"),o=require("../../../constants/devcenter.js");require("../../../constants/goals.js"),require("../../../constants/alerts.js"),require("../../../constants/apps.js"),require("../../../constants/drillstring.js"),require("../../../constants/completion.js"),require("../../../constants/appPackages.js"),require("../../../constants/notifications.js"),require("../../../constants/feed.js"),require("../../../constants/bha.js"),require("../../../utils/env.js"),require("../../GradientManager/configuration/constants.js");var u=require("../../../utils/devcenter.js"),c=require("./VersionBadge.js"),p=require("./PadMode.js"),f=require("./utils.js"),m=require("../../AssetNameLabel/SecondaryAssetNameLabel.js"),g=require("../../AssetNameLabel/AssetNameLabel.js"),j=require("./PadIcon.js"),v=require("./AppHeader.css.js"),h=require("./AppHeaderStyles.js"),A=require("react/jsx-runtime");function b(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var y=b(e),x=b(t),S=b(n),q=b(r);function L(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,s)}return a}function N(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?L(Object(a),!0).forEach((function(t){y.default(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):L(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var P="DevCenter_AppHeader",_=function(e){return"/assets/".concat(null==e?void 0:e.asset_id)};function O(e){var t,n,r,p,b,y,S,L,O=e.app,I=e.appLastAnnotation,M=e.appSettings,w=e.badge,C=e.children,E=e.classes,T=e.coordinates,D=e.currentUser,W=e.fracFleet,k=e.isMaximized,B=e.logoSrc,F=e.onSettingChange,H=e.openAnnotationsList,R=e.primaryAssetStatusBadge,U=e.rig,V=e.showLastAnnotation,G=e.updateCurrentDashboardAppLastAnnotation,z=e.well,Y=e.wells,Z=e.PadModeComponent,J=e.activeWellName,K=a.useState(!1),Q=x.default(K,2),X=Q[0],$=Q[1],ee=a.useRef(null),te=null==T?void 0:T.pixelWidth;a.useEffect((function(){var e,t;$((null===(e=ee.current)||void 0===e?void 0:e.scrollWidth)>(null===(t=ee.current)||void 0===t?void 0:t.offsetWidth))}),[null===(t=ee.current)||void 0===t?void 0:t.offsetWidth,te]);var ae=f.getAppDimension(te),se=u.getAppName(O),ne=null==O||null===(n=O.package)||void 0===n||null===(r=n.manifest)||void 0===r||null===(p=r.application)||void 0===p?void 0:p.subtitle,re=u.getAppSegment(O),ie=re===d.SEGMENTS.COMPLETION,le=function(e){var t,a=e.appSettings,s=void 0===a?{}:a,n=e.well,r=e.rig,i=e.fracFleet,l=e.segment,o=l===d.SEGMENTS.DRILLING,u=l===d.SEGMENTS.COMPLETION,c=s.wellId,p=s.rigId,f=s.fracFleetId,m=s.padId,g=null==i||null===(t=i.pad_frac_fleets.find((function(e){return e.pad.id===(m||i.current_pad_id)})))||void 0===t?void 0:t.pad,j=o?c&&(null==n?void 0:n.name):null==g?void 0:g.name,v="/assets/types/pad/".concat(m||(null==i?void 0:i.current_pad_id)),h=o?null==r?void 0:r.name:null==i?void 0:i.name,A=!!(c||p||f),b=!1,y=o?h&&_(n):v;return u&&!A&&null!=n&&n.id&&null!=n&&n.name&&(b=!0,A=!0,y=_(n),h=n.name),{isPrimaryAssetStatusVisible:b,isPrimaryNameVisible:A,primaryAssetLink:y,primaryAssetName:h,secondaryAssetLink:o?_(n):"/assets/types/pad/".concat(m||(null==i?void 0:i.current_pad_id)),secondaryAssetName:j}}({appSettings:null==O?void 0:O.settings,well:z,rig:U,fracFleet:W,segment:re}),de=le.isPrimaryAssetStatusVisible,oe=le.isPrimaryNameVisible,ue=le.primaryAssetLink,ce=le.primaryAssetName,pe=le.secondaryAssetLink,fe=le.secondaryAssetName,me=[f.APP_LAYOUT_SIZES.MEDIUM,f.APP_LAYOUT_SIZES.SMALL].includes(ae),ge=O&&O.id===o.DEV_CENTER_CLI_APP_ID,je={fracFleet:W,wells:Y,well:z,onSettingChange:F,appSettings:M,disableActiveWellsInPadSelect:null==O||null===(b=O.package)||void 0===b||null===(y=b.manifest)||void 0===y||null===(S=y.application)||void 0===S||null===(L=S.ui)||void 0===L?void 0:L.disableActiveWellsInPadSelect},ve=h.useStyles({isMobileSize:me});return A.jsxs("div",{className:q.default(ve.appHeaderWrapper,E.appHeader),children:[A.jsxs("div",{className:ve.appHeaderContainer,children:[A.jsxs("div",{className:q.default(ve.titleBlock,E.titleBlock),children:[A.jsxs("div",{className:E.appHeaderTitleWrapper,ref:ee,children:[A.jsxs("div",{className:ve.titleWrapper,children:[B&&A.jsxs(A.Fragment,{children:[A.jsx("img",{className:ve.logo,src:B,alt:"company logo"}),A.jsx("div",{className:ve.separateLine})]}),A.jsx(i.Tooltip,{title:X?se:"",placement:"bottom",children:A.jsx("h6",{"data-testid":"".concat(P,"_name"),className:ve.title,children:se})}),A.jsx(c.VersionBadge,{appPackage:null==O?void 0:O.package})]}),w]}),(!me||B)&&ne&&A.jsx("h6",{"data-testid":"".concat(P,"_subtitle"),className:ve.subtitle,children:ne})]}),O&&T&&A.jsxs("div",{className:q.default(v.controlsContainer,k&&v.appMaximized),children:[!me&&A.jsxs(A.Fragment,{children:[ie&&J&&A.jsx(i.Typography,{variant:"caption",children:J}),ie&&A.jsx(Z,N({},je)),C]}),A.jsxs("div",{className:v.assetLabels,children:[fe&&A.jsx(m.SecondaryAssetNameLabel,{assetName:fe,coordinatesPixelWidth:te,dataTestId:"".concat(P,"_secondaryAsset"),href:!ge&&pe,icon:ie&&A.jsx(j.PadIcon,{}),isColored:!ie||O.settings.padId&&O.settings.padId!==W.current_pad_id}),oe&&A.jsx(g.AssetNameLabel,{assetName:ce,coordinatesPixelWidth:te,dataTestId:"".concat(P,"_primaryAsset"),href:!ge&&(ue||"/feed"),statusBadge:de&&R})]})]}),V&&I&&A.jsx(l,{annotation:I,appId:s.get(O,["app","id"]),currentUser:D,dashboardAppId:O.id,openAnnotationsList:H,updateCurrentDashboardAppLastAnnotation:G})]}),me&&ne&&!B&&A.jsx("h6",{"data-testid":"".concat(P,"_subtitle"),className:ve.subtitle,children:ne}),me&&A.jsxs(i.Box,{display:"flex",alignItems:"center",mt:1,children:[ie&&!z&&(Y||W)&&A.jsx("div",{className:v.padModeSelect,children:A.jsx(Z,N({},je))}),C]})]})}O.propTypes={app:S.default.object.isRequired,badge:S.default.node,classes:S.default.shape({appHeader:S.default.string,titleBlock:S.default.string,appHeaderTitleWrapper:S.default.string}),showLastAnnotation:S.default.bool,currentUser:S.default.shape({}),appLastAnnotation:S.default.shape({}),updateCurrentDashboardAppLastAnnotation:S.default.func,openAnnotationsList:S.default.func,rig:S.default.shape({name:S.default.string,asset_id:S.default.number}),well:S.default.shape({name:S.default.string,asset_id:S.default.number}),fracFleet:S.default.shape({name:S.default.string,current_pad_id:S.default.number,pad_frac_fleets:S.default.arrayOf(S.default.shape({pad:S.default.shape({id:S.default.number.isRequired}).isRequired})).isRequired}),wells:S.default.arrayOf(S.default.shape({})),coordinates:S.default.shape({pixelWidth:S.default.number.isRequired}),isMaximized:S.default.bool,appSettings:S.default.shape({}),onSettingChange:S.default.func,children:S.default.arrayOf(S.default.node),logoSrc:S.default.string,primaryAssetStatusBadge:S.default.node,PadModeComponent:S.default.elementType},O.defaultProps={appLastAnnotation:null,appSettings:null,badge:null,children:null,classes:{},coordinates:void 0,currentUser:void 0,fracFleet:null,isMaximized:!1,logoSrc:null,onSettingChange:void 0,openAnnotationsList:void 0,rig:null,showLastAnnotation:!0,updateCurrentDashboardAppLastAnnotation:function(){},well:null,wells:null,primaryAssetStatusBadge:null,PadModeComponent:p},exports.PAGE_NAME=P,exports.default=O;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@material-ui/core").makeStyles((function(e){return{appHeaderWrapper:{width:"100%",marginBottom:8},appHeaderContainer:{display:"flex"},titleBlock:{display:"flex",justifyContent:"center",flexDirection:"column",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",marginRight:16},titleWrapper:{display:"flex",alignItems:"center"},logo:{maxWidth:"130px",maxHeight:"40px"},separateLine:{width:"1px",height:"16px",backgroundColor:e.palette.primary.text9,borderRadius:"1px",margin:"auto 12px"},title:{margin:"0 8px 0 1px",fontSize:"18px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",lineHeight:"24px",zIndex:1e3,fontWeight:"bold"},subtitle:{color:"#888",margin:"0 0 0 1px",fontSize:"12px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontWeight:400,lineHeight:"16px"}}}));exports.useStyles=e;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@material-ui/core").makeStyles((function(e){return{appHeaderWrapper:{width:"100%",marginBottom:8},appHeaderContainer:{display:"flex",justifyContent:"space-between"},titleBlock:{display:"flex",justifyContent:"center",flexDirection:"column",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",marginRight:16},titleWrapper:{display:"flex",alignItems:"center"},logo:{maxWidth:"130px",maxHeight:"40px"},separateLine:{width:"1px",height:"16px",backgroundColor:e.palette.primary.text9,borderRadius:"1px",margin:"auto 12px"},title:{margin:"0 8px 0 1px",fontSize:"18px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",lineHeight:"24px",zIndex:1e3,fontWeight:"bold"},subtitle:{color:"#888",margin:"0 0 0 1px",fontSize:"12px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontWeight:400,lineHeight:"16px"}}}));exports.useStyles=e;
@@ -1 +1 @@
1
- "use strict";var e=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),n=require("@babel/runtime/regenerator"),u=require("react"),a=require("lodash"),s=require("../../../../utils/devcenter.js"),i=require("./utils.js"),c=require("./dataResolvers.js"),o=require("./constants.js");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=p(e),l=p(r),d=p(t),b=p(n);function h(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 g(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?h(Object(t),!0).forEach((function(r){l.default(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):h(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}module.exports=function(e){var r=e.apps,t=e.dashboardAssetId,n=u.useState({}),p=d.default(n,2),l=p[0],h=p[1],y=u.useRef(),v=u.useRef({}),A=u.useRef({wellsById:{},rigsById:{},fracFleetsById:{},deprecatedAssetData:{}}),O=r.filter((function(e){var r=a.get(e,["app","ui_settings","multi_rig"]);return s.isDevCenterApp(e)&&!r})).map((function(e){return g(g({},e),{},{appHash:i.getAppHash(e)})})),j=function(e){return h((function(r){return a.mapValues(r,(function(r){var t=e[r.id]||{};return g(g(g({},r),t),{},{isLoading:!1})}))}))},m=function(e){A.current=a.merge(A.current,e)};return u.useEffect(f.default(b.default.mark((function e(){var r,n,u,s;return b.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Object.values(l),O.length||r.length){e.next=3;break}return e.abrupt("return");case 3:if(!(O.length<r.length)){e.next=8;break}return n=a.keyBy(O,"id"),u=r.find((function(e){return!n[e.id]})).id,h((function(e){return a.omit(e,u)})),e.abrupt("return");case 8:return s=O.filter((function(e){return!l[e.id]||l[e.id].hash!==e.hash})),h((function(e){return g(g({},e),i.getInitialAppsDataState(s))})),e.t0=j,e.next=13,c.resolveAppsData({apps:O,dashboardAssetId:t,cache:A,updateCache:m});case 13:e.t1=e.sent,(0,e.t0)(e.t1);case 15:case"end":return e.stop()}}),e)}))),[String(O.map((function(e){return e.appHash}))),t]),v.current={apps:O,dashboardAssetId:t,cache:A,updateCache:m},u.useEffect((function(){return y.current=setInterval((function(){c.resolveAppsData(g(g({},v.current),{},{requests:[o.APPS_DATA_REQUESTS.FRAC_FLEET_WELLS,o.APPS_DATA_REQUESTS.PAD_WELLS]})).then(j)}),3e5),function(){return clearInterval(y.current)}}),[]),l};
1
+ "use strict";var e=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),n=require("@babel/runtime/regenerator"),u=require("react"),a=require("lodash"),s=require("../../../../utils/devcenter.js"),i=require("./utils.js"),c=require("./dataResolvers.js"),o=require("./constants.js");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=p(e),l=p(r),d=p(t),b=p(n);function h(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 g(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?h(Object(t),!0).forEach((function(r){l.default(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):h(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}module.exports=function(e){var r=e.apps,t=e.dashboardAssetId,n=u.useState({}),p=d.default(n,2),l=p[0],h=p[1],y=u.useRef(),v=u.useRef({}),A=u.useRef({wellsById:{},rigsById:{},fracFleetsById:{},deprecatedAssetData:{}}),O=r.reduce((function(e,r){var t=a.get(r,["app","ui_settings","multi_rig"]);return s.isDevCenterApp(r)&&!t&&e.push(g(g({},r),{},{appHash:i.getAppHash(r)})),e}),[]),j=function(e){return h((function(r){return a.mapValues(r,(function(r){var t=e[r.id]||{};return g(g(g({},r),t),{},{isLoading:!1})}))}))},m=function(e){A.current=a.merge(A.current,e)};return u.useEffect(f.default(b.default.mark((function e(){var r,n,u,s;return b.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Object.values(l),O.length||r.length){e.next=3;break}return e.abrupt("return");case 3:if(!(O.length<r.length)){e.next=8;break}return n=a.keyBy(O,"id"),u=r.find((function(e){return!n[e.id]})).id,h((function(e){return a.omit(e,u)})),e.abrupt("return");case 8:return s=O.filter((function(e){return!l[e.id]||l[e.id].appHash!==e.appHash})),h((function(e){return g(g({},e),i.getInitialAppsDataState(s))})),e.t0=j,e.next=13,c.resolveAppsData({apps:O,dashboardAssetId:t,cache:A,updateCache:m});case 13:e.t1=e.sent,(0,e.t0)(e.t1);case 15:case"end":return e.stop()}}),e)}))),[String(O.map((function(e){return e.appHash}))),t]),v.current={apps:O,dashboardAssetId:t,cache:A,updateCache:m},u.useEffect((function(){return y.current=setInterval((function(){c.resolveAppsData(g(g({},v.current),{},{requests:[o.APPS_DATA_REQUESTS.FRAC_FLEET_WELLS,o.APPS_DATA_REQUESTS.PAD_WELLS]})).then(j)}),3e5),function(){return clearInterval(y.current)}}),[]),l};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/helpers/slicedToArray"),n=require("@babel/runtime/regenerator"),a=require("jsona"),s=require("lodash"),u=require("../../../../clients/jsonApi/index.js"),i=require("../../../../constants/devcenter.js");require("../../../../constants/goals.js"),require("../../../../constants/segment.js"),require("../../../../constants/alerts.js"),require("../../../../constants/apps.js"),require("../../../../constants/drillstring.js"),require("../../../../constants/completion.js"),require("../../../../constants/appPackages.js"),require("../../../../constants/notifications.js"),require("../../../../constants/feed.js"),require("../../../../constants/bha.js");var l=require("../../../../constants/assetTypes.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../../../../utils/env.js"),require("../../../GradientManager/configuration/constants.js");var p=c(e),o=c(t),f=c(r),d=c(n);function g(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 h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach((function(t){p.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var v=new(c(a).default),y=function(e,t){return+s.get(e,["settings",t])},b=function(e,t){return s.uniq(e.map((function(e){var t=f.default(e,2);return t[0],t[1]})).filter((function(e){return Number.isFinite(e)&&!t.includes(String(e))})))};function _(){return(_=o.default(d.default.mark((function e(t){return d.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.length){e.next=2;break}return e.abrupt("return",null);case 2:return e.prev=2,e.next=5,u.getWells({ids:t,fields:["well.name","well.settings","well.company","well.asset_id","well.last_active_at","well.id","well.rig","rig.name","rig.asset_id","company.id","well.status"]});case 5:return e.abrupt("return",e.sent);case 8:return e.prev=8,e.t0=e.catch(2),console.error(e.t0),e.abrupt("return",null);case 12:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}function w(){return(w=o.default(d.default.mark((function e(t){return d.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.length){e.next=2;break}return e.abrupt("return",null);case 2:return e.prev=2,e.next=5,u.getRigs({ids:t,fields:["rig.name","rig.settings","rig.asset_id","rig.active_well","rig.last_active_well","well.name","well.settings","well.company","well.asset_id","well.last_active_at","well.id","well.company.id"]});case 5:return e.abrupt("return",e.sent);case 8:return e.prev=8,e.t0=e.catch(2),console.error(e.t0),e.abrupt("return",null);case 12:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}function S(){return(S=o.default(d.default.mark((function e(t){return d.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.length){e.next=2;break}return e.abrupt("return",null);case 2:return e.prev=2,e.next=5,u.getResolvedAssets({assets:t});case 5:return e.abrupt("return",e.sent);case 8:return e.prev=8,e.t0=e.catch(2),console.error(e.t0),e.abrupt("return",null);case 12:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}var x=function(e,t){return{well:e&&h(h({},e.attributes),{},{id:e.id,companyId:s.get(e,"relationships.company.data.id")}),rig:{name:s.get(t,"attributes.name"),id:s.get(t,"id"),asset_id:s.get(t,"attributes.asset_id")}}};function m(){return(m=o.default(d.default.mark((function e(t){var r;return d.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.length){e.next=2;break}return e.abrupt("return",null);case 2:return e.prev=2,e.next=5,u.getFracFleets({ids:t,fields:["frac_fleet.name","frac_fleet.pads","frac_fleet.current_pad_id","frac_fleet.pad_frac_fleets"]});case 5:return r=e.sent,e.abrupt("return",r?v.deserialize(r):[]);case 9:return e.prev=9,e.t0=e.catch(2),console.error(e.t0),e.abrupt("return",[]);case 13:case"end":return e.stop()}}),e,null,[[2,9]])})))).apply(this,arguments)}function E(){return E=o.default(d.default.mark((function e(t,r){var n,a,l;return d.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.keyBy(r,"id"),a=t.map(function(){var e=o.default(d.default.mark((function e(t){var r,a,l,c,p,o;return d.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=f.default(t,2),a=r[0],l=r[1],c={fields:"all",frac_fleet_id:l},p=n[a],a===i.DEV_CENTER_CLI_APP_ID?c.app_key=s.get(p,["app","app_key"]):c.app_id=s.get(p,["app","id"]),e.prev=4,e.next=7,u.getFracFleetWells(c);case 7:return o=e.sent,e.abrupt("return",o?v.deserialize(o):[]);case 11:return e.prev=11,e.t0=e.catch(4),console.error(e.t0),e.abrupt("return",[]);case 15:case"end":return e.stop()}}),e,null,[[4,11]])})));return function(t){return e.apply(this,arguments)}}()),e.next=4,Promise.all(a);case 4:return l=e.sent,e.abrupt("return",l.reduce((function(e,r,n){return e[t[n][0]]=r,e}),{}));case 6:case"end":return e.stop()}}),e)}))),E.apply(this,arguments)}function j(){return j=o.default(d.default.mark((function e(t,r){var n,a,l;return d.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.keyBy(r,"id"),a=t.map(function(){var e=o.default(d.default.mark((function e(t){var r,a,l,c,p,o;return d.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=f.default(t,2),a=r[0],l=r[1],c={fields:"all"},p=n[a],a===i.DEV_CENTER_CLI_APP_ID?c.app_key=s.get(p,["app","app_key"]):c.app_id=s.get(p,["app","id"]),e.prev=4,e.next=7,u.getPadWells(l,c);case 7:return o=e.sent,e.abrupt("return",o?v.deserialize(o):[]);case 11:return e.prev=11,e.t0=e.catch(4),console.error(e.t0),e.abrupt("return",[]);case 15:case"end":return e.stop()}}),e,null,[[4,11]])})));return function(t){return e.apply(this,arguments)}}()),e.next=4,Promise.all(a);case 4:return l=e.sent,e.abrupt("return",l.reduce((function(e,r,n){return e[t[n][0]]=r,e}),{}));case 6:case"end":return e.stop()}}),e)}))),j.apply(this,arguments)}var P=function(e){return[e.id,y(e,l.ASSET_TYPES.well.id),y(e,l.ASSET_TYPES.rig.id),y(e,l.ASSET_TYPES.frac_fleet.id),y(e,l.ASSET_TYPES.pad.id),y(e,"deprecatedAssetId")].join("-")},A=function(e){return{id:e.id,rig:null,well:null,fracFleet:null,wells:null,isLoading:!0,appHash:P(e)}};exports.fetchAssetEntitiesByAssetIds=function(e){return S.apply(this,arguments)},exports.fetchFracFleetWells=function(e,t){return E.apply(this,arguments)},exports.fetchFracFleets=function(e){return m.apply(this,arguments)},exports.fetchPadWells=function(e,t){return j.apply(this,arguments)},exports.fetchRigs=function(e){return w.apply(this,arguments)},exports.fetchWells=function(e){return _.apply(this,arguments)},exports.getAppAssetSpecificTypeId=y,exports.getAppHash=P,exports.getAppsDataByFFs=function(e,t,r){return t||r?e.reduce((function(e,n){var a=f.default(n,2),s=a[0],u=a[1],i=null==t?void 0:t[u],l=null==r?void 0:r[s];return e[s]={fracFleet:i,wells:l},e}),{}):{}},exports.getAppsDataByPads=function(e,t){return e||t?e.reduce((function(e,r){var n=f.default(r,2),a=n[0];n[1];var s=null==t?void 0:t[a];return e[a]={wells:s},e}),{}):{}},exports.getAppsDataByRigs=function(e,t){return t&&!s.isEmpty(t)?e.reduce((function(e,r){var n=f.default(r,2),a=n[0],s=n[1],u=t[s];return e[a]=x(null==u?void 0:u.well,u),e}),{}):{}},exports.getAppsDataByWells=function(e,t){return t&&!s.isEmpty(t)?e.reduce((function(e,r){var n=f.default(r,2),a=n[0],s=n[1],u=t[s];return u?(e[a]=x(u,u.rig),e):e}),{}):{}},exports.getInitialAppData=A,exports.getInitialAppsDataState=function(e){return e.reduce((function(e,t){return h(h({},e),{},p.default({},t.id,A(t)))}),{})},exports.getUniqAssetIds=b,exports.isAppWithSettings=function(e){return Boolean(y(e,l.ASSET_TYPES.well.id)||y(e,l.ASSET_TYPES.rig.id)||y(e,l.ASSET_TYPES.frac_fleet.id)||y(e,l.ASSET_TYPES.pad.id))},exports.prepareDataForResolver=function(e,t){var r=[],n=[],a=[],s=[],u=[],i=[];e.forEach((function(e){var t=y(e,l.ASSET_TYPES.well.id),c=y(e,l.ASSET_TYPES.rig.id),p=y(e,l.ASSET_TYPES.frac_fleet.id),o=y(e,l.ASSET_TYPES.pad.id),f=e.id;i.push([f]),t?r.push([f,t]):c?n.push([f,c]):p&&(a.push([f,p]),o?u.push([f,o]):s.push([f,p]))}));var c=t.current,p=c.rigsById,o=c.wellsById,f=c.fracFleetsById,d=b(r,Object.keys(o)),g=b(n,Object.keys(p)),h=b(a,Object.keys(f));return{appsWellIds:r,appsRigIds:n,appsFracFleetIds:a,appsPadIds:u,appIds:i,appsFracFleetToFetchWellsIds:s,uniqueWellIds:d,uniqueRigIds:g,uniqueFFIds:h}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/helpers/slicedToArray"),n=require("@babel/runtime/regenerator"),a=require("jsona"),s=require("lodash"),u=require("../../../../clients/jsonApi/index.js"),i=require("../../../../constants/devcenter.js");require("../../../../constants/goals.js"),require("../../../../constants/segment.js"),require("../../../../constants/alerts.js"),require("../../../../constants/apps.js"),require("../../../../constants/drillstring.js"),require("../../../../constants/completion.js"),require("../../../../constants/appPackages.js"),require("../../../../constants/notifications.js"),require("../../../../constants/feed.js"),require("../../../../constants/bha.js");var l=require("../../../../constants/assetTypes.js");require("../../../../utils/env.js"),require("../../../GradientManager/configuration/constants.js");var c=require("../../../../utils/devcenter.js");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=p(e),f=p(t),d=p(r),g=p(n);function v(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 h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){o.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var y=new(p(a).default),b=function(e,t){return+s.get(e,["settings",t])},_=function(e,t){return s.uniq(e.map((function(e){var t=d.default(e,2);return t[0],t[1]})).filter((function(e){return Number.isFinite(e)&&!t.includes(String(e))})))};function w(){return(w=f.default(g.default.mark((function e(t){return g.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.length){e.next=2;break}return e.abrupt("return",null);case 2:return e.prev=2,e.next=5,u.getWells({ids:t,fields:["well.name","well.settings","well.company","well.asset_id","well.last_active_at","well.id","well.rig","rig.name","rig.asset_id","company.id","well.status"]});case 5:return e.abrupt("return",e.sent);case 8:return e.prev=8,e.t0=e.catch(2),console.error(e.t0),e.abrupt("return",null);case 12:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}function S(){return(S=f.default(g.default.mark((function e(t){return g.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.length){e.next=2;break}return e.abrupt("return",null);case 2:return e.prev=2,e.next=5,u.getRigs({ids:t,fields:["rig.name","rig.settings","rig.asset_id","rig.active_well","rig.last_active_well","well.name","well.settings","well.company","well.asset_id","well.last_active_at","well.id","well.company.id"]});case 5:return e.abrupt("return",e.sent);case 8:return e.prev=8,e.t0=e.catch(2),console.error(e.t0),e.abrupt("return",null);case 12:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}function m(){return(m=f.default(g.default.mark((function e(t){return g.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.length){e.next=2;break}return e.abrupt("return",null);case 2:return e.prev=2,e.next=5,u.getResolvedAssets({assets:t});case 5:return e.abrupt("return",e.sent);case 8:return e.prev=8,e.t0=e.catch(2),console.error(e.t0),e.abrupt("return",null);case 12:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}var x=function(e,t){return{well:e&&h(h({},e.attributes),{},{id:e.id,companyId:s.get(e,"relationships.company.data.id")}),rig:{name:s.get(t,"attributes.name"),id:s.get(t,"id"),asset_id:s.get(t,"attributes.asset_id")}}};function E(){return(E=f.default(g.default.mark((function e(t){var r;return g.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.length){e.next=2;break}return e.abrupt("return",null);case 2:return e.prev=2,e.next=5,u.getFracFleets({ids:t,fields:["frac_fleet.name","frac_fleet.pads","frac_fleet.current_pad_id","frac_fleet.pad_frac_fleets"]});case 5:return r=e.sent,e.abrupt("return",r?y.deserialize(r):[]);case 9:return e.prev=9,e.t0=e.catch(2),console.error(e.t0),e.abrupt("return",[]);case 13:case"end":return e.stop()}}),e,null,[[2,9]])})))).apply(this,arguments)}function j(){return j=f.default(g.default.mark((function e(t,r){var n,a,l;return g.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.keyBy(r,"id"),a=t.map(function(){var e=f.default(g.default.mark((function e(t){var r,a,l,c,p,o;return g.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=d.default(t,2),a=r[0],l=r[1],c={fields:"all",frac_fleet_id:l},p=n[a],a===i.DEV_CENTER_CLI_APP_ID?c.app_key=s.get(p,["app","app_key"]):c.app_id=s.get(p,["app","id"]),e.prev=4,e.next=7,u.getFracFleetWells(c);case 7:return o=e.sent,e.abrupt("return",o?y.deserialize(o):[]);case 11:return e.prev=11,e.t0=e.catch(4),console.error(e.t0),e.abrupt("return",[]);case 15:case"end":return e.stop()}}),e,null,[[4,11]])})));return function(t){return e.apply(this,arguments)}}()),e.next=4,Promise.all(a);case 4:return l=e.sent,e.abrupt("return",l.reduce((function(e,r,n){return e[t[n][0]]=r,e}),{}));case 6:case"end":return e.stop()}}),e)}))),j.apply(this,arguments)}function P(){return P=f.default(g.default.mark((function e(t,r){var n,a,l;return g.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.keyBy(r,"id"),a=t.map(function(){var e=f.default(g.default.mark((function e(t){var r,a,l,c,p,o;return g.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=d.default(t,2),a=r[0],l=r[1],c={fields:"all"},p=n[a],a===i.DEV_CENTER_CLI_APP_ID?c.app_key=s.get(p,["app","app_key"]):c.app_id=s.get(p,["app","id"]),e.prev=4,e.next=7,u.getPadWells(l,c);case 7:return o=e.sent,e.abrupt("return",o?y.deserialize(o):[]);case 11:return e.prev=11,e.t0=e.catch(4),console.error(e.t0),e.abrupt("return",[]);case 15:case"end":return e.stop()}}),e,null,[[4,11]])})));return function(t){return e.apply(this,arguments)}}()),e.next=4,Promise.all(a);case 4:return l=e.sent,e.abrupt("return",l.reduce((function(e,r,n){return e[t[n][0]]=r,e}),{}));case 6:case"end":return e.stop()}}),e)}))),P.apply(this,arguments)}var A=function(e){return[e.id,b(e,l.ASSET_TYPES.well.id),b(e,l.ASSET_TYPES.rig.id),b(e,l.ASSET_TYPES.frac_fleet.id),b(e,l.ASSET_TYPES.pad.id),b(e,"deprecatedAssetId"),c.getAppSegment(e)].join("-")},T=function(e){return{id:e.id,rig:null,well:null,fracFleet:null,wells:null,isLoading:!0,appHash:A(e)}};exports.fetchAssetEntitiesByAssetIds=function(e){return m.apply(this,arguments)},exports.fetchFracFleetWells=function(e,t){return j.apply(this,arguments)},exports.fetchFracFleets=function(e){return E.apply(this,arguments)},exports.fetchPadWells=function(e,t){return P.apply(this,arguments)},exports.fetchRigs=function(e){return S.apply(this,arguments)},exports.fetchWells=function(e){return w.apply(this,arguments)},exports.getAppAssetSpecificTypeId=b,exports.getAppHash=A,exports.getAppsDataByFFs=function(e,t,r){return t||r?e.reduce((function(e,n){var a=d.default(n,2),s=a[0],u=a[1],i=null==t?void 0:t[u],l=null==r?void 0:r[s];return e[s]={fracFleet:i,wells:l},e}),{}):{}},exports.getAppsDataByPads=function(e,t){return e||t?e.reduce((function(e,r){var n=d.default(r,2),a=n[0];n[1];var s=null==t?void 0:t[a];return e[a]={wells:s},e}),{}):{}},exports.getAppsDataByRigs=function(e,t){return t&&!s.isEmpty(t)?e.reduce((function(e,r){var n=d.default(r,2),a=n[0],s=n[1],u=t[s];return e[a]=x(null==u?void 0:u.well,u),e}),{}):{}},exports.getAppsDataByWells=function(e,t){return t&&!s.isEmpty(t)?e.reduce((function(e,r){var n=d.default(r,2),a=n[0],s=n[1],u=t[s];return u?(e[a]=x(u,u.rig),e):e}),{}):{}},exports.getInitialAppData=T,exports.getInitialAppsDataState=function(e){return e.reduce((function(e,t){return h(h({},e),{},o.default({},t.id,T(t)))}),{})},exports.getUniqAssetIds=_,exports.isAppWithSettings=function(e){return Boolean(b(e,l.ASSET_TYPES.well.id)||b(e,l.ASSET_TYPES.rig.id)||b(e,l.ASSET_TYPES.frac_fleet.id)||b(e,l.ASSET_TYPES.pad.id))},exports.prepareDataForResolver=function(e,t){var r=[],n=[],a=[],s=[],u=[],i=[];e.forEach((function(e){var t=b(e,l.ASSET_TYPES.well.id),c=b(e,l.ASSET_TYPES.rig.id),p=b(e,l.ASSET_TYPES.frac_fleet.id),o=b(e,l.ASSET_TYPES.pad.id),f=e.id;i.push([f]),t?r.push([f,t]):c?n.push([f,c]):p&&(a.push([f,p]),o?u.push([f,o]):s.push([f,p]))}));var c=t.current,p=c.rigsById,o=c.wellsById,f=c.fracFleetsById,d=_(r,Object.keys(o)),g=_(n,Object.keys(p)),v=_(a,Object.keys(f));return{appsWellIds:r,appsRigIds:n,appsFracFleetIds:a,appsPadIds:u,appIds:i,appsFracFleetToFetchWellsIds:s,uniqueWellIds:d,uniqueRigIds:g,uniqueFFIds:v}};
@@ -1 +1 @@
1
- {"version":3,"file":"AdvancedSlider.d.ts","sourceRoot":"","sources":["../../../src/components/AdvancedSlider/AdvancedSlider.js"],"names":[],"mappings":"AA2BO,wDAmVN;;;;;QAKmB,kDAAc"}
1
+ {"version":3,"file":"AdvancedSlider.d.ts","sourceRoot":"","sources":["../../../src/components/AdvancedSlider/AdvancedSlider.js"],"names":[],"mappings":"AA0BO,wDA0VN;;;;;QAKmB,kDAAc"}
@@ -1 +1 @@
1
- import t from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import{useRef as o,useState as i,useEffect as n,useMemo as r}from"react";import{makeStyles as a,fade as l}from"@material-ui/core";import d from"re-resizable";import{withSize as h}from"react-sizeme";import c from"classnames";import{noop as u}from"lodash";import{useThrottledCallback as s}from"../shared/useThrottledCallback.js";import{Handle as m}from"./Handle.js";import{jsx as v,jsxs as p}from"react/jsx-runtime";function g(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,i)}return o}function f(e){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?g(Object(i),!0).forEach((function(o){t(e,o,i[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):g(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var b=function(a){var l,h,u=a.min,g=a.max,b=a.value,y=a.size,z=a.orientation,B=a.valueFormatter,H=a.displayFormatter,L=a.editableHandles,O=a.onChange,F=a.onStop,j=a.reversed,E=a.handlePosition,P=a.handleClasses,C=a.minimal,R=x(),S=o(null),k=o(null),D=i(B(null==b?void 0:b.at(0))),I=e(D,2),M=I[0],N=I[1],W=i(B(null==b?void 0:b.at(1))),$=e(W,2),A=$[0],X=$[1],Y=o(null),T=i(!1),Z=e(T,2),q=Z[0],G=Z[1];n((function(){Y.current||(N(Math.min(B(null==b?void 0:b.at(0)),B(null==b?void 0:b.at(1)))),X(Math.max(B(null==b?void 0:b.at(0)),B(null==b?void 0:b.at(1)))))}),[null==b?void 0:b.at(0),null==b?void 0:b.at(1)]),n((function(){if("horizontal"===z){var t=y.width/(g-u)*(M-u),e=y.width/(g-u)*(g-A);S.current.updateSize({width:j?e:t,height:y.height}),k.current.updateSize({width:j?t:e,height:y.height})}else if("vertical"===z){var o=y.height/(g-u)*(M-u),i=y.height/(g-u)*(g-A);S.current.updateSize({width:y.width,height:j?i:o}),k.current.updateSize({width:y.width,height:j?o:i})}}),[u,g,M,A,y.width,y.height,z]),n((function(){return q?(document.addEventListener("mousemove",V),document.addEventListener("mouseup",_),document.addEventListener("touchmove",tt),document.addEventListener("touchend",et)):(document.removeEventListener("mousemove",V),document.removeEventListener("mouseup",_),document.removeEventListener("touchmove",tt),document.removeEventListener("touchend",et)),function(){document.removeEventListener("mousemove",V),document.removeEventListener("mouseup",_),document.removeEventListener("touchmove",tt),document.removeEventListener("touchend",et)}}),[q]);var J=s((function(t,e,o){Y.current="onResize Event";var i,n,r=o.clientWidth,a=o.clientHeight;"right"===e?j?n=B(g-r/y.width*(g-u)):i=B(u+r/y.width*(g-u)):"left"===e?j?i=B(u+r/y.width*(g-u)):n=B(g-r/y.width*(g-u)):"bottom"===e?j?n=B(g-a/y.height*(g-u)):i=B(u+a/y.height*(g-u)):"top"===e&&(j?i=B(u+a/y.height*(g-u)):n=B(g-a/y.height*(g-u))),i=Math.min(i,A),n=Math.max(n,M),N((function(t){return i||t})),X((function(t){return n||t})),O([i||M,n||A])})),K=s((function(){Y.current=null,F()})),Q=function(t,e){Y.current={xPos:t,yPos:e,head:M,tail:A}},U=function(t,e){if(Y.current){var o;"horizontal"===z?o=(Y.current.xPos-t)/y.width*(g-u):"vertical"===z&&(o=(Y.current.yPos-e)/y.height*(g-u));var i,n,r=Y.current.head-o*(j?-1:1),a=Y.current.tail-o*(j?-1:1),l=Y.current.tail-Y.current.head;r<=u?(i=u,n=u+l):a>=g?(i=g-l,n=g):(i=r,n=a),i=B(i),n=B(n),N(i),X(n),O([i,n])}},V=s((function(t){U(t.clientX,t.clientY)})),_=s((function(){Y.current=null,G(!1)})),tt=s((function(t){U(t.touches[0].pageX,t.touches[0].pageY)})),et=s((function(){Y.current=null,G(!1)})),ot=s((function(t){N(t),O([t,A])})),it=s((function(t){X(t),O([M,t])})),nt=r((function(){return(A-M)/(g-u)*("vertical"===z?y.height:y.width)<30}),[u,g,M,A]),rt=function(t){var e={min:u,max:A,value:M,onChange:ot},o={min:M,max:g,value:A,onChange:it};return"head"===t?v(m,f({placement:"head",readOnly:!L,displayFormatter:H,orientation:z,classes:P,minimal:C},j?o:e)):"tail"===t?v(m,f({placement:"tail",readOnly:!L,displayFormatter:H,orientation:z,classes:P,minimal:C},j?e:o)):null};return v("div",{className:R.rootWrapper,children:p("div",{className:c(R.root,(l={},t(l,R.horizontalRoot,"horizontal"===z),t(l,R.verticalRoot,"vertical"===z),t(l,R.minimal,C),l)),children:[v(d,{ref:S,minHeight:0,minWidth:0,enable:{right:"horizontal"===z,bottom:"vertical"===z},handleComponent:{right:function(){return rt("head")},bottom:function(){return rt("head")}},onResize:J,onResizeStop:K}),v("div",{className:R.body,"data-testid":"slider-body",onMouseDown:function(t){Q(t.clientX,t.clientY),G(!0)},onTouchStart:function(t){Q(t.touches[0].pageX,t.touches[0].pageY),G(!0)},children:v("div",nt?{className:c((h={},t(h,R.horizontalBodyHandle,"horizontal"===z),t(h,R.verticalBodyHandle,"vertical"===z),t(h,R.leftBodyHandle,"left"===E),t(h,R.rightBodyHandle,"right"===E),t(h,R.topBodyHandle,"top"===E),t(h,R.bottomBodyHandle,"bottom"===E),h)),children:v("div",{className:R.bodyHandle,children:v(w,{orientation:"vertical",minimal:C})})}:{className:R.bodyHandleIcon,children:v(w,{orientation:z,minimal:C})})}),v(d,{ref:k,minHeight:0,minWidth:0,enable:{left:"horizontal"===z,top:"vertical"===z},handleComponent:{left:function(){return rt("tail")},top:function(){return rt("tail")}},onResize:J,onResizeStop:K})]})})};b.defaultProps={orientation:"horizontal",valueFormatter:Math.floor,displayFormatter:function(t){return t},onChange:u,onStop:u,reversed:!1,editableHandles:!0,handleClasses:{},minimal:!1};var y=h({monitorWidth:!0,monitorHeight:!0})(b),w=function(t){var e=t.orientation;return t.minimal?"horizontal"===e?v("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"20",viewBox:"0 -2 16 16",fill:"none",children:v("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.33333 4L4 4L4 12L5.33333 12L5.33333 4ZM8.66659 4L8.66659 12L7.33325 12L7.33325 4L8.66659 4ZM12.0001 4L12.0001 12L10.6667 12L10.6667 4L12.0001 4Z",fill:"white"})}):p("svg",{width:"12",height:"7",viewBox:"0 0 12 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[v("rect",{width:"12",height:"1"}),v("rect",{y:"3",width:"12",height:"1"}),v("rect",{y:"6",width:"12",height:"1"})]}):p("svg","horizontal"===e?{width:"8",height:"13",viewBox:"0 0 8 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[v("rect",{x:"7.5",y:"0.5",width:"12",height:"1",transform:"rotate(90 7.5 0.5)"}),v("rect",{x:"4.5",y:"0.5",width:"12",height:"1",transform:"rotate(90 4.5 0.5)"}),v("rect",{x:"1.5",y:"0.5",width:"12",height:"1",transform:"rotate(90 1.5 0.5)"})]}:{width:"12",height:"7",viewBox:"0 0 12 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[v("rect",{width:"12",height:"1"}),v("rect",{y:"3",width:"12",height:"1"}),v("rect",{y:"6",width:"12",height:"1"})]})},x=a((function(t){return{rootWrapper:{position:"relative",width:"100%",height:"100%",zIndex:100},root:{position:"absolute",width:"100%",height:"100%",zIndex:100,"&:hover:not($minimal) $body":{background:"#008BA366"},"&:hover $bodyHandle":{visibility:"visible"}},horizontalRoot:{display:"flex",alignItems:"center"},verticalRoot:{display:"flex",alignItems:"center",flexDirection:"column"},body:{position:"relative",flex:1,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",userSelect:"none",background:"#3B3B3B66",color:"#BDBDBD","& svg":{fill:"currentColor"},"&:hover":{cursor:"grab",background:"#008BA366",color:"#FFFFFF"},"&:active":{cursor:"grabbing"},"&:hover $bodyHandleIcon":{visibility:"visible"}},horizontalBodyHandle:{position:"absolute",bottom:-24},verticalBodyHandle:{position:"absolute",left:-24},leftBodyHandle:{position:"absolute",left:-24,right:"auto"},rightBodyHandle:{position:"absolute",right:-24,left:"auto"},topBodyHandle:{position:"absolute",top:-24,bottom:"auto"},bottomBodyHandle:{position:"absolute",bottom:-24,top:"auto"},bodyHandle:{width:24,height:24,borderRadius:"50%",background:"#03BCD4",color:"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",visibility:"hidden"},bodyHandleIcon:{visibility:"hidden"},minimal:{border:"1px solid ".concat(t.palette.background.b9),borderRadius:4,"& $body":{"&:hover":{background:"#008BA366"},margin:-1,width:"calc(100% + 2px)",height:"calc(100% + 2px)",backgroundColor:l(t.palette.background.b7,.1),border:"1px solid ".concat(t.palette.primary.text9),borderRadius:4}}}}));export{b as AdvancedSlider,y as default};
1
+ import t from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import{useRef as i,useState as o,useEffect as n,useMemo as r}from"react";import{makeStyles as a,fade as l}from"@material-ui/core";import{Resizable as h}from"re-resizable";import{withSize as d}from"react-sizeme";import c from"classnames";import{noop as s}from"lodash";import{useThrottledCallback as u}from"../shared/useThrottledCallback.js";import{Handle as m}from"./Handle.js";import{jsx as p,jsxs as v}from"react/jsx-runtime";function g(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,o)}return i}function f(e){for(var i=1;i<arguments.length;i++){var o=null!=arguments[i]?arguments[i]:{};i%2?g(Object(o),!0).forEach((function(i){t(e,i,o[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):g(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}var b=function(a){var l,d,s=a.min,g=a.max,b=a.value,y=a.size,z=a.orientation,B=a.valueFormatter,H=a.displayFormatter,L=a.editableHandles,O=a.onChange,F=a.onStop,j=a.reversed,P=a.handlePosition,C=a.handleClasses,R=a.minimal,S=x(),E=i(null),M=i(null),k=o([B(null==b?void 0:b.at(0)),B(null==b?void 0:b.at(1))]),D=e(k,2),I=D[0],N=D[1],W=i(null),$=o(!1),A=e($,2),X=A[0],Y=A[1];n((function(){if(!W.current){var t=[B(null==b?void 0:b.at(0)),B(null==b?void 0:b.at(1))],e=Math.min.apply(Math,t),i=Math.max.apply(Math,t);N([e,i])}}),[null==b?void 0:b.at(0),null==b?void 0:b.at(1)]);var T=e(I,2),Z=T[0],q=T[1];n((function(){if("horizontal"===z){var t=y.width/(g-s)*(Z-s),e=y.width/(g-s)*(g-q);E.current.updateSize({width:j?e:t,height:y.height}),M.current.updateSize({width:j?t:e,height:y.height})}else if("vertical"===z){var i=y.height/(g-s)*(Z-s),o=y.height/(g-s)*(g-q);E.current.updateSize({width:y.width,height:j?o:i}),M.current.updateSize({width:y.width,height:j?i:o})}}),[s,g,Z,q,y.width,y.height,z]),n((function(){var t=function(){document.removeEventListener("mousemove",U),document.removeEventListener("mouseup",V),document.removeEventListener("touchmove",_),document.removeEventListener("touchend",tt)};return X?(document.addEventListener("mousemove",U),document.addEventListener("mouseup",V),document.addEventListener("touchmove",_),document.addEventListener("touchend",tt)):(t(),F()),function(){t()}}),[X]);var G=u((function(t,e,i){W.current="onResize Event";var o=i.clientWidth,n=i.clientHeight,r=Z,a=q;"right"===e?j?a=B(g-o/y.width*(g-s)):r=B(s+o/y.width*(g-s)):"left"===e?j?r=B(s+o/y.width*(g-s)):a=B(g-o/y.width*(g-s)):"bottom"===e?j?a=B(g-n/y.height*(g-s)):r=B(s+n/y.height*(g-s)):"top"===e&&(j?r=B(s+n/y.height*(g-s)):a=B(g-n/y.height*(g-s))),r=Math.min(r,q),a=Math.max(a,Z),N([r,a]),O([r,a])})),J=u((function(){W.current=null,F()})),K=function(t,e){W.current={xPos:t,yPos:e,head:Z,tail:q}},Q=function(t,e){if(W.current){var i;"horizontal"===z?i=(W.current.xPos-t)/y.width*(g-s):"vertical"===z&&(i=(W.current.yPos-e)/y.height*(g-s));var o,n,r=W.current.head-i*(j?-1:1),a=W.current.tail-i*(j?-1:1),l=W.current.tail-W.current.head;r<=s?(o=s,n=s+l):a>=g?(o=g-l,n=g):(o=r,n=a),o=B(o),n=B(n),N([o,n]),O([o,n])}},U=u((function(t){Q(t.clientX,t.clientY)})),V=u((function(){W.current=null,Y(!1)})),_=u((function(t){Q(t.touches[0].pageX,t.touches[0].pageY)})),tt=u((function(){W.current=null,Y(!1)})),et=u((function(t){N([t,q]),O([t,q])})),it=u((function(t){N([Z,t]),O([Z,t])})),ot=r((function(){return(q-Z)/(g-s)*("vertical"===z?y.height:y.width)<30}),[s,g,Z,q]),nt=function(t){var e={min:s,max:q,value:Z,onChange:et},i={min:Z,max:g,value:q,onChange:it};return"head"===t?p(m,f({placement:"head",readOnly:!L,displayFormatter:H,orientation:z,classes:C,minimal:R},j?i:e)):"tail"===t?p(m,f({placement:"tail",readOnly:!L,displayFormatter:H,orientation:z,classes:C,minimal:R},j?e:i)):null};return p("div",{className:S.rootWrapper,children:v("div",{className:c(S.root,(l={},t(l,S.horizontalRoot,"horizontal"===z),t(l,S.verticalRoot,"vertical"===z),t(l,S.minimal,R),l)),children:[p(h,{ref:E,minHeight:0,minWidth:0,enable:{right:"horizontal"===z,bottom:"vertical"===z},handleComponent:{right:nt("head"),bottom:nt("head")},onResize:G,onResizeStop:J}),p("div",{className:S.body,"data-testid":"slider-body",onMouseDown:function(t){K(t.clientX,t.clientY),Y(!0)},onTouchStart:function(t){K(t.touches[0].pageX,t.touches[0].pageY),Y(!0)},children:p("div",ot?{className:c((d={},t(d,S.horizontalBodyHandle,"horizontal"===z),t(d,S.verticalBodyHandle,"vertical"===z),t(d,S.leftBodyHandle,"left"===P),t(d,S.rightBodyHandle,"right"===P),t(d,S.topBodyHandle,"top"===P),t(d,S.bottomBodyHandle,"bottom"===P),d)),children:p("div",{className:S.bodyHandle,children:p(w,{orientation:"vertical",minimal:R})})}:{className:S.bodyHandleIcon,children:p(w,{orientation:z,minimal:R})})}),p(h,{ref:M,minHeight:0,minWidth:0,enable:{left:"horizontal"===z,top:"vertical"===z},handleComponent:{left:nt("tail"),top:nt("tail")},onResize:G,onResizeStop:J})]})})};b.defaultProps={orientation:"horizontal",valueFormatter:Math.floor,displayFormatter:function(t){return t},onChange:s,onStop:s,reversed:!1,editableHandles:!0,handleClasses:{},minimal:!1};var y=d({monitorWidth:!0,monitorHeight:!0})(b),w=function(t){var e=t.orientation;return t.minimal?"horizontal"===e?p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"20",viewBox:"0 -2 16 16",fill:"none",children:p("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.33333 4L4 4L4 12L5.33333 12L5.33333 4ZM8.66659 4L8.66659 12L7.33325 12L7.33325 4L8.66659 4ZM12.0001 4L12.0001 12L10.6667 12L10.6667 4L12.0001 4Z",fill:"white"})}):v("svg",{width:"12",height:"7",viewBox:"0 0 12 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[p("rect",{width:"12",height:"1"}),p("rect",{y:"3",width:"12",height:"1"}),p("rect",{y:"6",width:"12",height:"1"})]}):v("svg","horizontal"===e?{width:"8",height:"13",viewBox:"0 0 8 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[p("rect",{x:"7.5",y:"0.5",width:"12",height:"1",transform:"rotate(90 7.5 0.5)"}),p("rect",{x:"4.5",y:"0.5",width:"12",height:"1",transform:"rotate(90 4.5 0.5)"}),p("rect",{x:"1.5",y:"0.5",width:"12",height:"1",transform:"rotate(90 1.5 0.5)"})]}:{width:"12",height:"7",viewBox:"0 0 12 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[p("rect",{width:"12",height:"1"}),p("rect",{y:"3",width:"12",height:"1"}),p("rect",{y:"6",width:"12",height:"1"})]})},x=a((function(t){return{rootWrapper:{position:"relative",width:"100%",height:"100%",zIndex:100},root:{position:"absolute",width:"100%",height:"100%",zIndex:100,"&:hover:not($minimal) $body":{background:"#008BA366"},"&:hover $bodyHandle":{visibility:"visible"}},horizontalRoot:{display:"flex",alignItems:"center"},verticalRoot:{display:"flex",alignItems:"center",flexDirection:"column"},body:{position:"relative",flex:1,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",userSelect:"none",background:"#3B3B3B66",color:"#BDBDBD","& svg":{fill:"currentColor"},"&:hover":{cursor:"grab",background:"#008BA366",color:"#FFFFFF"},"&:active":{cursor:"grabbing"},"&:hover $bodyHandleIcon":{visibility:"visible"}},horizontalBodyHandle:{position:"absolute",bottom:-24},verticalBodyHandle:{position:"absolute",left:-24},leftBodyHandle:{position:"absolute",left:-24,right:"auto"},rightBodyHandle:{position:"absolute",right:-24,left:"auto"},topBodyHandle:{position:"absolute",top:-24,bottom:"auto"},bottomBodyHandle:{position:"absolute",bottom:-24,top:"auto"},bodyHandle:{width:24,height:24,borderRadius:"50%",background:"#03BCD4",color:"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",visibility:"hidden"},bodyHandleIcon:{visibility:"hidden"},minimal:{border:"1px solid ".concat(t.palette.background.b9),borderRadius:4,"& $body":{"&:hover":{background:"#008BA366"},margin:-1,width:"calc(100% + 2px)",height:"calc(100% + 2px)",backgroundColor:l(t.palette.background.b7,.1),border:"1px solid ".concat(t.palette.primary.text9),borderRadius:4}}}}));export{b as AdvancedSlider,y as default};
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAA+B,SAAS,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC3F,OAAO,SAAS,MAAM,YAAY,CAAC;AAoFnC,UAAU,SACR,SAAQ,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,EACnC,SAAS,CAAC,UAAU,CAAC,OAAO,aAAa,CAAC;IAC5C,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;CAC5C;AAED,QAAA,MAAM,IAAI;YAAW,SAAS,GAAG,WAAW;;;;;;;;;CAsB3C,CAAC;AAEF,QAAA,MAAM,aAAa;;;CAGlB,CAAC;AASF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAA+B,SAAS,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC3F,OAAO,SAAS,MAAM,YAAY,CAAC;AAoFnC,UAAU,SACR,SAAQ,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,EACnC,SAAS,CAAC,UAAU,CAAC,OAAO,aAAa,CAAC;IAC5C,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;CAC5C;AAED,QAAA,MAAM,IAAI;YAAW,SAAS,GAAG,WAAW;;;;;;;;;CAuB3C,CAAC;AAEF,QAAA,MAAM,aAAa;;;CAGlB,CAAC;AASF,eAAe,IAAI,CAAC"}
@@ -1 +1 @@
1
- import{__assign as t}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as e}from"react/jsx-runtime";import{makeStyles as i,Chip as a}from"@material-ui/core";import r from"prop-types";import l from"classnames";var o=function(t){var e=t.width,i=void 0===e?18:e,a=t.height,r=void 0===a?14:a,l=t.fill.replace("#","%23");return"<svg width='".concat(i,"' height='").concat(r,"' viewBox='0 0 18 14' fill='").concat(l,"' xmlns='http://www.w3.org/2000/svg'><path d='M6 11.1698L1.83 6.99984L0.410004 8.40984L6 13.9998L18 1.99984L16.59 0.589844L6 11.1698Z'/></svg>")},n=i((function(t){return{checked:{"&::before":{content:'url("data:image/svg+xml; utf8, '.concat(o({fill:t.palette.primary.main}),'")'),display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24,lineHeight:"24px",marginLeft:8,marginRight:"-4px",paddingTop:3},"&.Mui-disabled::before":{content:'url("data:image/svg+xml; utf8, '.concat(o({fill:t.palette.primary.text8}),'")')},"&.MuiChip-sizeSmall::before":{content:'url("data:image/svg+xml; utf8, '.concat(o({width:12,fill:t.palette.primary.main}),'")'),width:16,height:16},"&.MuiChip-sizeSmall.Mui-disabled::before":{content:'url("data:image/svg+xml; utf8, '.concat(o({width:12,fill:t.palette.primary.text8}),'")')},"&.MuiChip-root.MuiChip-clickable":{"& .MuiChip-label, & .MuiChip-deleteIcon, & .MuiChip-icon":{color:"#FFFFFF"}},"& .MuiChip-label:first-child":{marginLeft:"-4px"}},basic:{"&:not([data-not-migrated-MuiChip])":{"&.MuiChip-sizeSmall":{height:12,"& .MuiChip-label":{fontSize:10}},border:"none",textTransform:"uppercase",backgroundColor:t.palette.primary.main,padding:"0 8px",height:16,"& .MuiChip-label":{fontSize:12,fontWeight:500,lineHeight:"12px",letterSpacing:"1px",color:t.palette.background.b1,padding:0},"&:hover":{backgroundColor:t.palette.primary.main,"& .MuiChip-label":{color:t.palette.background.b1}}}}}})),c=function(i){var r,o=i.checked,c=i.classes,p=void 0===c?{}:c,s=i["data-testid"],d=n(),h=l(i.className,((r={})[d.basic]="basic"===i.variant,r));return e(a,t({"data-testid":s},i,o?{className:h,classes:t(t({},p),{root:l(p.root,d.checked)})}:{className:h}))},p={checked:r.bool,"data-testid":r.string};c.propTypes=p,c.defaultProps={checked:!1,"data-testid":"Chip"};export{c as default};
1
+ import{__assign as i}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as t}from"react/jsx-runtime";import{makeStyles as e,Chip as a}from"@material-ui/core";import r from"prop-types";import l from"classnames";var o=function(i){var t=i.width,e=void 0===t?18:t,a=i.height,r=void 0===a?14:a,l=i.fill.replace("#","%23");return"<svg width='".concat(e,"' height='").concat(r,"' viewBox='0 0 18 14' fill='").concat(l,"' xmlns='http://www.w3.org/2000/svg'><path d='M6 11.1698L1.83 6.99984L0.410004 8.40984L6 13.9998L18 1.99984L16.59 0.589844L6 11.1698Z'/></svg>")},n=e((function(i){return{checked:{"&::before":{content:'url("data:image/svg+xml; utf8, '.concat(o({fill:i.palette.primary.main}),'")'),display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24,lineHeight:"24px",marginLeft:8,marginRight:"-4px",paddingTop:3},"&.Mui-disabled::before":{content:'url("data:image/svg+xml; utf8, '.concat(o({fill:i.palette.primary.text8}),'")')},"&.MuiChip-sizeSmall::before":{content:'url("data:image/svg+xml; utf8, '.concat(o({width:12,fill:i.palette.primary.main}),'")'),width:16,height:16},"&.MuiChip-sizeSmall.Mui-disabled::before":{content:'url("data:image/svg+xml; utf8, '.concat(o({width:12,fill:i.palette.primary.text8}),'")')},"&.MuiChip-root.MuiChip-clickable":{"& .MuiChip-label, & .MuiChip-deleteIcon, & .MuiChip-icon":{color:"#FFFFFF"}},"& .MuiChip-label:first-child":{marginLeft:"-4px"}},basic:{"&:not([data-not-migrated-MuiChip])":{"&.MuiChip-sizeSmall":{height:12,"& .MuiChip-label":{fontSize:10}},border:"none",textTransform:"uppercase",backgroundColor:i.palette.primary.main,padding:"0 8px",height:16,"& .MuiChip-label":{fontSize:12,fontWeight:500,lineHeight:"12px",letterSpacing:"1px",color:i.palette.background.b1,padding:0},"&:hover":{backgroundColor:i.palette.primary.main,"& .MuiChip-label":{color:i.palette.background.b1}}}}}})),c=function(e){var r,o=e.checked,c=e.classes,p=void 0===c?{}:c,s=n(),d=l(e.className,((r={})[s.basic]="basic"===e.variant,r)),h="basic"===e.variant?"default":e.variant;return t(a,i({},e,o?{className:d,classes:i(i({},p),{root:l(p.root,s.checked)}),variant:h}:{className:d,variant:h}))},p={checked:r.bool,"data-testid":r.string};c.propTypes=p,c.defaultProps={checked:!1,"data-testid":"Chip"};export{c as default};
@@ -1,6 +1,6 @@
1
1
  export const PAGE_NAME: "DevCenter_AppHeader";
2
2
  export default AppHeader;
3
- declare function AppHeader({ app, appLastAnnotation, appSettings, badge, children, classes, coordinates, currentUser, fracFleet, isMaximized, logoSrc, onSettingChange, openAnnotationsList, primaryAssetStatusBadge, rig, showLastAnnotation, updateCurrentDashboardAppLastAnnotation, well, wells, PadModeComponent, }: {
3
+ declare function AppHeader({ app, appLastAnnotation, appSettings, badge, children, classes, coordinates, currentUser, fracFleet, isMaximized, logoSrc, onSettingChange, openAnnotationsList, primaryAssetStatusBadge, rig, showLastAnnotation, updateCurrentDashboardAppLastAnnotation, well, wells, PadModeComponent, activeWellName, }: {
4
4
  app: any;
5
5
  appLastAnnotation: any;
6
6
  appSettings: any;
@@ -21,6 +21,7 @@ declare function AppHeader({ app, appLastAnnotation, appSettings, badge, childre
21
21
  well: any;
22
22
  wells: any;
23
23
  PadModeComponent: any;
24
+ activeWellName: any;
24
25
  }): JSX.Element;
25
26
  declare namespace AppHeader {
26
27
  namespace propTypes {
@@ -28,6 +29,7 @@ declare namespace AppHeader {
28
29
  const badge: PropTypes.Requireable<PropTypes.ReactNodeLike>;
29
30
  const classes: PropTypes.Requireable<PropTypes.InferProps<{
30
31
  appHeader: PropTypes.Requireable<string>;
32
+ titleBlock: PropTypes.Requireable<string>;
31
33
  appHeaderTitleWrapper: PropTypes.Requireable<string>;
32
34
  }>>;
33
35
  const showLastAnnotation: PropTypes.Requireable<boolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"AppHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/DevCenter/AppHeader/AppHeader.js"],"names":[],"mappings":"AAuBA,8CAA+C;;AA4C/C;;;;;;;;;;;;;;;;;;;;;gBAwJC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA2D0C,kEAAQ"}
1
+ {"version":3,"file":"AppHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/DevCenter/AppHeader/AppHeader.js"],"names":[],"mappings":"AAuBA,8CAA+C;;AA4C/C;;;;;;;;;;;;;;;;;;;;;;gBA0JC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA4D0C,kEAAQ"}
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/slicedToArray";import{useState as a,useRef as n,useEffect as s}from"react";import{get as i}from"lodash";import r from"prop-types";import o from"classnames";import{Tooltip as l,Box as d}from"@material-ui/core";import"../../Annotations/components/AnnotationsList/index.js";import p from"../../Annotations/components/LastAnnotation/index.js";import"../../Annotations/AnnotationsContext.js";import{SEGMENTS as c}from"../../../constants/segment.js";import{DEV_CENTER_CLI_APP_ID as m}from"../../../constants/devcenter.js";import"../../../constants/goals.js";import"../../../constants/alerts.js";import"../../../constants/apps.js";import"../../../constants/drillstring.js";import"../../../constants/completion.js";import"../../../constants/appPackages.js";import"../../../constants/notifications.js";import"../../../constants/feed.js";import"../../../constants/bha.js";import"../../../utils/env.js";import"../../GradientManager/configuration/constants.js";import{getAppName as u,getAppSegment as f}from"../../../utils/devcenter.js";import{VersionBadge as g}from"./VersionBadge.js";import h from"./PadMode.js";import{APP_LAYOUT_SIZES as v,getAppDimension as b}from"./utils.js";import{SecondaryAssetNameLabel as A}from"../../AssetNameLabel/SecondaryAssetNameLabel.js";import{AssetNameLabel as y}from"../../AssetNameLabel/AssetNameLabel.js";import{PadIcon as j}from"./PadIcon.js";import L from"./AppHeader.css.js";import{useStyles as N}from"./AppHeaderStyles.js";import{jsxs as P,Fragment as S,jsx as O}from"react/jsx-runtime";function _(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function w(t){for(var a=1;a<arguments.length;a++){var n=null!=arguments[a]?arguments[a]:{};a%2?_(Object(n),!0).forEach((function(a){e(t,a,n[a])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var I="DevCenter_AppHeader",C=function(e){return"/assets/".concat(null==e?void 0:e.asset_id)};function M(e){var r,h,_,M,x,W,k,D,H=e.app,T=e.appLastAnnotation,F=e.appSettings,B=e.badge,R=e.children,q=e.classes,z=e.coordinates,E=e.currentUser,U=e.fracFleet,V=e.isMaximized,G=e.logoSrc,J=e.onSettingChange,K=e.openAnnotationsList,Q=e.primaryAssetStatusBadge,X=e.rig,Y=e.showLastAnnotation,Z=e.updateCurrentDashboardAppLastAnnotation,$=e.well,ee=e.wells,te=e.PadModeComponent,ae=a(!1),ne=t(ae,2),se=ne[0],ie=ne[1],re=n(null),oe=null==z?void 0:z.pixelWidth;s((function(){var e,t;ie((null===(e=re.current)||void 0===e?void 0:e.scrollWidth)>(null===(t=re.current)||void 0===t?void 0:t.offsetWidth))}),[null===(r=re.current)||void 0===r?void 0:r.offsetWidth,oe]);var le=b(oe),de=u(H),pe=null==H||null===(h=H.package)||void 0===h||null===(_=h.manifest)||void 0===_||null===(M=_.application)||void 0===M?void 0:M.subtitle,ce=f(H),me=ce===c.COMPLETION,ue=function(e){var t,a=e.appSettings,n=void 0===a?{}:a,s=e.well,i=e.rig,r=e.fracFleet,o=e.segment,l=o===c.DRILLING,d=o===c.COMPLETION,p=n.wellId,m=n.rigId,u=n.fracFleetId,f=n.padId,g=null==r||null===(t=r.pad_frac_fleets.find((function(e){return e.pad.id===(f||r.current_pad_id)})))||void 0===t?void 0:t.pad,h=l?p&&(null==s?void 0:s.name):null==g?void 0:g.name,v="/assets/types/pad/".concat(f||(null==r?void 0:r.current_pad_id)),b=l?null==i?void 0:i.name:null==r?void 0:r.name,A=!!(p||m||u),y=!1,j=l?b&&C(s):v;return d&&!A&&null!=s&&s.id&&null!=s&&s.name&&(y=!0,A=!0,j=C(s),b=s.name),{isPrimaryAssetStatusVisible:y,isPrimaryNameVisible:A,primaryAssetLink:j,primaryAssetName:b,secondaryAssetLink:l?C(s):"/assets/types/pad/".concat(f||(null==r?void 0:r.current_pad_id)),secondaryAssetName:h}}({appSettings:null==H?void 0:H.settings,well:$,rig:X,fracFleet:U,segment:ce}),fe=ue.isPrimaryAssetStatusVisible,ge=ue.isPrimaryNameVisible,he=ue.primaryAssetLink,ve=ue.primaryAssetName,be=ue.secondaryAssetLink,Ae=ue.secondaryAssetName,ye=[v.MEDIUM,v.SMALL].includes(le),je=H&&H.id===m,Le={fracFleet:U,wells:ee,well:$,onSettingChange:J,appSettings:F,disableActiveWellsInPadSelect:null==H||null===(x=H.package)||void 0===x||null===(W=x.manifest)||void 0===W||null===(k=W.application)||void 0===k||null===(D=k.ui)||void 0===D?void 0:D.disableActiveWellsInPadSelect},Ne=N({isMobileSize:ye});return P("div",{className:o(Ne.appHeaderWrapper,q.appHeader),children:[P("div",{className:Ne.appHeaderContainer,children:[P("div",{className:Ne.titleBlock,children:[P("div",{className:q.appHeaderTitleWrapper,ref:re,children:[P("div",{className:Ne.titleWrapper,children:[G&&P(S,{children:[O("img",{className:Ne.logo,src:G,alt:"company logo"}),O("div",{className:Ne.separateLine})]}),O(l,{title:se?de:"",placement:"bottom",children:O("h6",{"data-testid":"".concat(I,"_name"),className:Ne.title,children:de})}),O(g,{appPackage:null==H?void 0:H.package})]}),B]}),(!ye||G)&&pe&&O("h6",{"data-testid":"".concat(I,"_subtitle"),className:Ne.subtitle,children:pe})]}),H&&z&&P("div",{className:o(L.controlsContainer,V&&L.appMaximized),children:[!ye&&P(S,{children:[me&&O(te,w({},Le)),R]}),P("div",{className:L.assetLabels,children:[Ae&&O(A,{assetName:Ae,coordinatesPixelWidth:oe,dataTestId:"".concat(I,"_secondaryAsset"),href:!je&&be,icon:me&&O(j,{}),isColored:!me||H.settings.padId&&H.settings.padId!==U.current_pad_id}),ge&&O(y,{assetName:ve,coordinatesPixelWidth:oe,dataTestId:"".concat(I,"_primaryAsset"),href:!je&&(he||"/feed"),statusBadge:fe&&Q})]})]}),Y&&T&&O(p,{annotation:T,appId:i(H,["app","id"]),currentUser:E,dashboardAppId:H.id,openAnnotationsList:K,updateCurrentDashboardAppLastAnnotation:Z})]}),ye&&pe&&!G&&O("h6",{"data-testid":"".concat(I,"_subtitle"),className:Ne.subtitle,children:pe}),ye&&P(d,{display:"flex",alignItems:"center",mt:1,children:[me&&!$&&(ee||U)&&O("div",{className:L.padModeSelect,children:O(te,w({},Le))}),R]})]})}M.propTypes={app:r.object.isRequired,badge:r.node,classes:r.shape({appHeader:r.string,appHeaderTitleWrapper:r.string}),showLastAnnotation:r.bool,currentUser:r.shape({}),appLastAnnotation:r.shape({}),updateCurrentDashboardAppLastAnnotation:r.func,openAnnotationsList:r.func,rig:r.shape({name:r.string,asset_id:r.number}),well:r.shape({name:r.string,asset_id:r.number}),fracFleet:r.shape({name:r.string,current_pad_id:r.number,pad_frac_fleets:r.arrayOf(r.shape({pad:r.shape({id:r.number.isRequired}).isRequired})).isRequired}),wells:r.arrayOf(r.shape({})),coordinates:r.shape({pixelWidth:r.number.isRequired}),isMaximized:r.bool,appSettings:r.shape({}),onSettingChange:r.func,children:r.arrayOf(r.node),logoSrc:r.string,primaryAssetStatusBadge:r.node,PadModeComponent:r.elementType},M.defaultProps={appLastAnnotation:null,appSettings:null,badge:null,children:null,classes:{},coordinates:void 0,currentUser:void 0,fracFleet:null,isMaximized:!1,logoSrc:null,onSettingChange:void 0,openAnnotationsList:void 0,rig:null,showLastAnnotation:!0,updateCurrentDashboardAppLastAnnotation:function(){},well:null,wells:null,primaryAssetStatusBadge:null,PadModeComponent:h};export{I as PAGE_NAME,M as default};
1
+ import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/slicedToArray";import{useState as a,useRef as n,useEffect as s}from"react";import{get as i}from"lodash";import r from"prop-types";import o from"classnames";import{Tooltip as l,Typography as d,Box as p}from"@material-ui/core";import"../../Annotations/components/AnnotationsList/index.js";import c from"../../Annotations/components/LastAnnotation/index.js";import"../../Annotations/AnnotationsContext.js";import{SEGMENTS as m}from"../../../constants/segment.js";import{DEV_CENTER_CLI_APP_ID as u}from"../../../constants/devcenter.js";import"../../../constants/goals.js";import"../../../constants/alerts.js";import"../../../constants/apps.js";import"../../../constants/drillstring.js";import"../../../constants/completion.js";import"../../../constants/appPackages.js";import"../../../constants/notifications.js";import"../../../constants/feed.js";import"../../../constants/bha.js";import"../../../utils/env.js";import"../../GradientManager/configuration/constants.js";import{getAppName as f,getAppSegment as g}from"../../../utils/devcenter.js";import{VersionBadge as h}from"./VersionBadge.js";import v from"./PadMode.js";import{APP_LAYOUT_SIZES as b,getAppDimension as A}from"./utils.js";import{SecondaryAssetNameLabel as y}from"../../AssetNameLabel/SecondaryAssetNameLabel.js";import{AssetNameLabel as j}from"../../AssetNameLabel/AssetNameLabel.js";import{PadIcon as L}from"./PadIcon.js";import N from"./AppHeader.css.js";import{useStyles as P}from"./AppHeaderStyles.js";import{jsxs as S,Fragment as O,jsx as _}from"react/jsx-runtime";function w(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function I(t){for(var a=1;a<arguments.length;a++){var n=null!=arguments[a]?arguments[a]:{};a%2?w(Object(n),!0).forEach((function(a){e(t,a,n[a])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var C="DevCenter_AppHeader",M=function(e){return"/assets/".concat(null==e?void 0:e.asset_id)};function x(e){var r,v,w,x,W,k,D,H,T=e.app,B=e.appLastAnnotation,F=e.appSettings,R=e.badge,q=e.children,z=e.classes,E=e.coordinates,U=e.currentUser,V=e.fracFleet,G=e.isMaximized,J=e.logoSrc,K=e.onSettingChange,Q=e.openAnnotationsList,X=e.primaryAssetStatusBadge,Y=e.rig,Z=e.showLastAnnotation,$=e.updateCurrentDashboardAppLastAnnotation,ee=e.well,te=e.wells,ae=e.PadModeComponent,ne=e.activeWellName,se=a(!1),ie=t(se,2),re=ie[0],oe=ie[1],le=n(null),de=null==E?void 0:E.pixelWidth;s((function(){var e,t;oe((null===(e=le.current)||void 0===e?void 0:e.scrollWidth)>(null===(t=le.current)||void 0===t?void 0:t.offsetWidth))}),[null===(r=le.current)||void 0===r?void 0:r.offsetWidth,de]);var pe=A(de),ce=f(T),me=null==T||null===(v=T.package)||void 0===v||null===(w=v.manifest)||void 0===w||null===(x=w.application)||void 0===x?void 0:x.subtitle,ue=g(T),fe=ue===m.COMPLETION,ge=function(e){var t,a=e.appSettings,n=void 0===a?{}:a,s=e.well,i=e.rig,r=e.fracFleet,o=e.segment,l=o===m.DRILLING,d=o===m.COMPLETION,p=n.wellId,c=n.rigId,u=n.fracFleetId,f=n.padId,g=null==r||null===(t=r.pad_frac_fleets.find((function(e){return e.pad.id===(f||r.current_pad_id)})))||void 0===t?void 0:t.pad,h=l?p&&(null==s?void 0:s.name):null==g?void 0:g.name,v="/assets/types/pad/".concat(f||(null==r?void 0:r.current_pad_id)),b=l?null==i?void 0:i.name:null==r?void 0:r.name,A=!!(p||c||u),y=!1,j=l?b&&M(s):v;return d&&!A&&null!=s&&s.id&&null!=s&&s.name&&(y=!0,A=!0,j=M(s),b=s.name),{isPrimaryAssetStatusVisible:y,isPrimaryNameVisible:A,primaryAssetLink:j,primaryAssetName:b,secondaryAssetLink:l?M(s):"/assets/types/pad/".concat(f||(null==r?void 0:r.current_pad_id)),secondaryAssetName:h}}({appSettings:null==T?void 0:T.settings,well:ee,rig:Y,fracFleet:V,segment:ue}),he=ge.isPrimaryAssetStatusVisible,ve=ge.isPrimaryNameVisible,be=ge.primaryAssetLink,Ae=ge.primaryAssetName,ye=ge.secondaryAssetLink,je=ge.secondaryAssetName,Le=[b.MEDIUM,b.SMALL].includes(pe),Ne=T&&T.id===u,Pe={fracFleet:V,wells:te,well:ee,onSettingChange:K,appSettings:F,disableActiveWellsInPadSelect:null==T||null===(W=T.package)||void 0===W||null===(k=W.manifest)||void 0===k||null===(D=k.application)||void 0===D||null===(H=D.ui)||void 0===H?void 0:H.disableActiveWellsInPadSelect},Se=P({isMobileSize:Le});return S("div",{className:o(Se.appHeaderWrapper,z.appHeader),children:[S("div",{className:Se.appHeaderContainer,children:[S("div",{className:o(Se.titleBlock,z.titleBlock),children:[S("div",{className:z.appHeaderTitleWrapper,ref:le,children:[S("div",{className:Se.titleWrapper,children:[J&&S(O,{children:[_("img",{className:Se.logo,src:J,alt:"company logo"}),_("div",{className:Se.separateLine})]}),_(l,{title:re?ce:"",placement:"bottom",children:_("h6",{"data-testid":"".concat(C,"_name"),className:Se.title,children:ce})}),_(h,{appPackage:null==T?void 0:T.package})]}),R]}),(!Le||J)&&me&&_("h6",{"data-testid":"".concat(C,"_subtitle"),className:Se.subtitle,children:me})]}),T&&E&&S("div",{className:o(N.controlsContainer,G&&N.appMaximized),children:[!Le&&S(O,{children:[fe&&ne&&_(d,{variant:"caption",children:ne}),fe&&_(ae,I({},Pe)),q]}),S("div",{className:N.assetLabels,children:[je&&_(y,{assetName:je,coordinatesPixelWidth:de,dataTestId:"".concat(C,"_secondaryAsset"),href:!Ne&&ye,icon:fe&&_(L,{}),isColored:!fe||T.settings.padId&&T.settings.padId!==V.current_pad_id}),ve&&_(j,{assetName:Ae,coordinatesPixelWidth:de,dataTestId:"".concat(C,"_primaryAsset"),href:!Ne&&(be||"/feed"),statusBadge:he&&X})]})]}),Z&&B&&_(c,{annotation:B,appId:i(T,["app","id"]),currentUser:U,dashboardAppId:T.id,openAnnotationsList:Q,updateCurrentDashboardAppLastAnnotation:$})]}),Le&&me&&!J&&_("h6",{"data-testid":"".concat(C,"_subtitle"),className:Se.subtitle,children:me}),Le&&S(p,{display:"flex",alignItems:"center",mt:1,children:[fe&&!ee&&(te||V)&&_("div",{className:N.padModeSelect,children:_(ae,I({},Pe))}),q]})]})}x.propTypes={app:r.object.isRequired,badge:r.node,classes:r.shape({appHeader:r.string,titleBlock:r.string,appHeaderTitleWrapper:r.string}),showLastAnnotation:r.bool,currentUser:r.shape({}),appLastAnnotation:r.shape({}),updateCurrentDashboardAppLastAnnotation:r.func,openAnnotationsList:r.func,rig:r.shape({name:r.string,asset_id:r.number}),well:r.shape({name:r.string,asset_id:r.number}),fracFleet:r.shape({name:r.string,current_pad_id:r.number,pad_frac_fleets:r.arrayOf(r.shape({pad:r.shape({id:r.number.isRequired}).isRequired})).isRequired}),wells:r.arrayOf(r.shape({})),coordinates:r.shape({pixelWidth:r.number.isRequired}),isMaximized:r.bool,appSettings:r.shape({}),onSettingChange:r.func,children:r.arrayOf(r.node),logoSrc:r.string,primaryAssetStatusBadge:r.node,PadModeComponent:r.elementType},x.defaultProps={appLastAnnotation:null,appSettings:null,badge:null,children:null,classes:{},coordinates:void 0,currentUser:void 0,fracFleet:null,isMaximized:!1,logoSrc:null,onSettingChange:void 0,openAnnotationsList:void 0,rig:null,showLastAnnotation:!0,updateCurrentDashboardAppLastAnnotation:function(){},well:null,wells:null,primaryAssetStatusBadge:null,PadModeComponent:v};export{C as PAGE_NAME,x as default};
@@ -1 +1 @@
1
- import{makeStyles as e}from"@material-ui/core";var t=e((function(e){return{appHeaderWrapper:{width:"100%",marginBottom:8},appHeaderContainer:{display:"flex"},titleBlock:{display:"flex",justifyContent:"center",flexDirection:"column",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",marginRight:16},titleWrapper:{display:"flex",alignItems:"center"},logo:{maxWidth:"130px",maxHeight:"40px"},separateLine:{width:"1px",height:"16px",backgroundColor:e.palette.primary.text9,borderRadius:"1px",margin:"auto 12px"},title:{margin:"0 8px 0 1px",fontSize:"18px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",lineHeight:"24px",zIndex:1e3,fontWeight:"bold"},subtitle:{color:"#888",margin:"0 0 0 1px",fontSize:"12px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontWeight:400,lineHeight:"16px"}}}));export{t as useStyles};
1
+ import{makeStyles as e}from"@material-ui/core";var t=e((function(e){return{appHeaderWrapper:{width:"100%",marginBottom:8},appHeaderContainer:{display:"flex",justifyContent:"space-between"},titleBlock:{display:"flex",justifyContent:"center",flexDirection:"column",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",marginRight:16},titleWrapper:{display:"flex",alignItems:"center"},logo:{maxWidth:"130px",maxHeight:"40px"},separateLine:{width:"1px",height:"16px",backgroundColor:e.palette.primary.text9,borderRadius:"1px",margin:"auto 12px"},title:{margin:"0 8px 0 1px",fontSize:"18px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",lineHeight:"24px",zIndex:1e3,fontWeight:"bold"},subtitle:{color:"#888",margin:"0 0 0 1px",fontSize:"12px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontWeight:400,lineHeight:"16px"}}}));export{t as useStyles};
@@ -1 +1 @@
1
- {"version":3,"file":"useAppsData.d.ts","sourceRoot":"","sources":["../../../../../src/components/DevCenter/AppsDataProvider/effects/useAppsData.js"],"names":[],"mappings":";AAYA;;;OAyEC"}
1
+ {"version":3,"file":"useAppsData.d.ts","sourceRoot":"","sources":["../../../../../src/components/DevCenter/AppsDataProvider/effects/useAppsData.js"],"names":[],"mappings":";AAYA;;;OA2EC"}
@@ -1 +1 @@
1
- import r from"@babel/runtime/helpers/asyncToGenerator";import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/slicedToArray";import n from"@babel/runtime/regenerator";import{useState as o,useRef as a,useEffect as i}from"react";import{get as u,keyBy as c,omit as s,mapValues as p,merge as f}from"lodash";import{isDevCenterApp as l}from"../../../../utils/devcenter.js";import{getAppHash as d,getInitialAppsDataState as m}from"./utils.js";import{resolveAppsData as b}from"./dataResolvers.js";import{APPS_DATA_REQUESTS as h}from"./constants.js";function O(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function g(r){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){e(r,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}))}return r}function y(e){var O=e.apps,y=e.dashboardAssetId,j=o({}),v=t(j,2),P=v[0],w=v[1],I=a(),A=a({}),D=a({wellsById:{},rigsById:{},fracFleetsById:{},deprecatedAssetData:{}}),E=O.filter((function(r){var e=u(r,["app","ui_settings","multi_rig"]);return l(r)&&!e})).map((function(r){return g(g({},r),{},{appHash:d(r)})})),L=function(r){return w((function(e){return p(e,(function(e){var t=r[e.id]||{};return g(g(g({},e),t),{},{isLoading:!1})}))}))},x=function(r){D.current=f(D.current,r)};return i(r(n.mark((function r(){var e,t,o,a;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e=Object.values(P),E.length||e.length){r.next=3;break}return r.abrupt("return");case 3:if(!(E.length<e.length)){r.next=8;break}return t=c(E,"id"),o=e.find((function(r){return!t[r.id]})).id,w((function(r){return s(r,o)})),r.abrupt("return");case 8:return a=E.filter((function(r){return!P[r.id]||P[r.id].hash!==r.hash})),w((function(r){return g(g({},r),m(a))})),r.t0=L,r.next=13,b({apps:E,dashboardAssetId:y,cache:D,updateCache:x});case 13:r.t1=r.sent,(0,r.t0)(r.t1);case 15:case"end":return r.stop()}}),r)}))),[String(E.map((function(r){return r.appHash}))),y]),A.current={apps:E,dashboardAssetId:y,cache:D,updateCache:x},i((function(){return I.current=setInterval((function(){b(g(g({},A.current),{},{requests:[h.FRAC_FLEET_WELLS,h.PAD_WELLS]})).then(L)}),3e5),function(){return clearInterval(I.current)}}),[]),P}export{y as default};
1
+ import r from"@babel/runtime/helpers/asyncToGenerator";import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/slicedToArray";import n from"@babel/runtime/regenerator";import{useState as a,useRef as o,useEffect as u}from"react";import{get as c,keyBy as i,omit as s,mapValues as p,merge as f}from"lodash";import{isDevCenterApp as d}from"../../../../utils/devcenter.js";import{getAppHash as l,getInitialAppsDataState as b}from"./utils.js";import{resolveAppsData as m}from"./dataResolvers.js";import{APPS_DATA_REQUESTS as h}from"./constants.js";function O(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function g(r){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){e(r,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}))}return r}function y(e){var O=e.apps,y=e.dashboardAssetId,j=a({}),v=t(j,2),P=v[0],w=v[1],I=o(),A=o({}),D=o({wellsById:{},rigsById:{},fracFleetsById:{},deprecatedAssetData:{}}),E=O.reduce((function(r,e){var t=c(e,["app","ui_settings","multi_rig"]);return d(e)&&!t&&r.push(g(g({},e),{},{appHash:l(e)})),r}),[]),L=function(r){return w((function(e){return p(e,(function(e){var t=r[e.id]||{};return g(g(g({},e),t),{},{isLoading:!1})}))}))},x=function(r){D.current=f(D.current,r)};return u(r(n.mark((function r(){var e,t,a,o;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e=Object.values(P),E.length||e.length){r.next=3;break}return r.abrupt("return");case 3:if(!(E.length<e.length)){r.next=8;break}return t=i(E,"id"),a=e.find((function(r){return!t[r.id]})).id,w((function(r){return s(r,a)})),r.abrupt("return");case 8:return o=E.filter((function(r){return!P[r.id]||P[r.id].appHash!==r.appHash})),w((function(r){return g(g({},r),b(o))})),r.t0=L,r.next=13,m({apps:E,dashboardAssetId:y,cache:D,updateCache:x});case 13:r.t1=r.sent,(0,r.t0)(r.t1);case 15:case"end":return r.stop()}}),r)}))),[String(E.map((function(r){return r.appHash}))),y]),A.current={apps:E,dashboardAssetId:y,cache:D,updateCache:x},u((function(){return I.current=setInterval((function(){m(g(g({},A.current),{},{requests:[h.FRAC_FLEET_WELLS,h.PAD_WELLS]})).then(L)}),3e5),function(){return clearInterval(I.current)}}),[]),P}export{y as default};
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/DevCenter/AppsDataProvider/effects/utils.js"],"names":[],"mappings":"AAyBA,mDAyBC;AAED,kDAyBC;AAED,0EAWC;AAmED,+FAkBC;AAED,6EAwBC;AAED,wEAwBC;AAnNM,yEAAkF;AAElF,2EAKJ;AAmFI,0EAUC;AAED,uEAQC;AAED,6FAaC;AAED,2EAYC;AA0ED,6CAQM;AAEN,qDAMJ;AAEI;;;;;;;;EAQL;AAEK,wDAOJ;AAEI;;;;;;;;;;EAiDN"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/DevCenter/AppsDataProvider/effects/utils.js"],"names":[],"mappings":"AA0BA,mDAyBC;AAED,kDAyBC;AAED,0EAWC;AAmED,+FAkBC;AAED,6EAwBC;AAED,wEAwBC;AAnNM,yEAAkF;AAElF,2EAKJ;AAmFI,0EAUC;AAED,uEAQC;AAED,6FAaC;AAED,2EAYC;AA0ED,6CASM;AAEN,qDAMJ;AAEI;;;;;;;;EAQL;AAEK,wDAOJ;AAEI;;;;;;;;;;EAiDN"}
@@ -1 +1 @@
1
- import r from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/slicedToArray";import n from"@babel/runtime/regenerator";import a from"jsona";import{get as s,isEmpty as i,keyBy as u,uniq as c}from"lodash";import{getWells as o,getRigs as l,getFracFleets as p,getFracFleetWells as f,getPadWells as d,getResolvedAssets as m}from"../../../../clients/jsonApi/index.js";import{DEV_CENTER_CLI_APP_ID as v}from"../../../../constants/devcenter.js";import"../../../../constants/goals.js";import"../../../../constants/segment.js";import"../../../../constants/alerts.js";import"../../../../constants/apps.js";import"../../../../constants/drillstring.js";import"../../../../constants/completion.js";import"../../../../constants/appPackages.js";import"../../../../constants/notifications.js";import"../../../../constants/feed.js";import"../../../../constants/bha.js";import{ASSET_TYPES as b}from"../../../../constants/assetTypes.js";import"../../../../utils/env.js";import"../../../GradientManager/configuration/constants.js";function h(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}var y=new a,g=function(r,e){return+s(r,["settings",e])},j=function(r,e){return c(r.map((function(r){var e=t(r,2);return e[0],e[1]})).filter((function(r){return Number.isFinite(r)&&!e.includes(String(r))})))};function _(r){return x.apply(this,arguments)}function x(){return(x=e(n.mark((function r(e){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e.length){r.next=2;break}return r.abrupt("return",null);case 2:return r.prev=2,r.next=5,o({ids:e,fields:["well.name","well.settings","well.company","well.asset_id","well.last_active_at","well.id","well.rig","rig.name","rig.asset_id","company.id","well.status"]});case 5:return r.abrupt("return",r.sent);case 8:return r.prev=8,r.t0=r.catch(2),console.error(r.t0),r.abrupt("return",null);case 12:case"end":return r.stop()}}),r,null,[[2,8]])})))).apply(this,arguments)}function k(r){return O.apply(this,arguments)}function O(){return(O=e(n.mark((function r(e){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e.length){r.next=2;break}return r.abrupt("return",null);case 2:return r.prev=2,r.next=5,l({ids:e,fields:["rig.name","rig.settings","rig.asset_id","rig.active_well","rig.last_active_well","well.name","well.settings","well.company","well.asset_id","well.last_active_at","well.id","well.company.id"]});case 5:return r.abrupt("return",r.sent);case 8:return r.prev=8,r.t0=r.catch(2),console.error(r.t0),r.abrupt("return",null);case 12:case"end":return r.stop()}}),r,null,[[2,8]])})))).apply(this,arguments)}function I(r){return P.apply(this,arguments)}function P(){return(P=e(n.mark((function r(e){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e.length){r.next=2;break}return r.abrupt("return",null);case 2:return r.prev=2,r.next=5,m({assets:e});case 5:return r.abrupt("return",r.sent);case 8:return r.prev=8,r.t0=r.catch(2),console.error(r.t0),r.abrupt("return",null);case 12:case"end":return r.stop()}}),r,null,[[2,8]])})))).apply(this,arguments)}var F=function(r,e){return{well:r&&w(w({},r.attributes),{},{id:r.id,companyId:s(r,"relationships.company.data.id")}),rig:{name:s(e,"attributes.name"),id:s(e,"id"),asset_id:s(e,"attributes.asset_id")}}},B=function(r,e){return e&&!i(e)?r.reduce((function(r,n){var a=t(n,2),s=a[0],i=a[1],u=e[i];return u?(r[s]=F(u,u.rig),r):r}),{}):{}},D=function(r,e){return e&&!i(e)?r.reduce((function(r,n){var a=t(n,2),s=a[0],i=a[1],u=e[i];return r[s]=F(null==u?void 0:u.well,u),r}),{}):{}},T=function(r,e,n){return e||n?r.reduce((function(r,a){var s=t(a,2),i=s[0],u=s[1],c=null==e?void 0:e[u],o=null==n?void 0:n[i];return r[i]={fracFleet:c,wells:o},r}),{}):{}},q=function(r,e){return r||e?r.reduce((function(r,n){var a=t(n,2),s=a[0];a[1];var i=null==e?void 0:e[s];return r[s]={wells:i},r}),{}):{}};function z(r){return A.apply(this,arguments)}function A(){return(A=e(n.mark((function r(e){var t;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e.length){r.next=2;break}return r.abrupt("return",null);case 2:return r.prev=2,r.next=5,p({ids:e,fields:["frac_fleet.name","frac_fleet.pads","frac_fleet.current_pad_id","frac_fleet.pad_frac_fleets"]});case 5:return t=r.sent,r.abrupt("return",t?y.deserialize(t):[]);case 9:return r.prev=9,r.t0=r.catch(2),console.error(r.t0),r.abrupt("return",[]);case 13:case"end":return r.stop()}}),r,null,[[2,9]])})))).apply(this,arguments)}function E(r,e){return S.apply(this,arguments)}function S(){return S=e(n.mark((function r(a,i){var c,o,l;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return c=u(i,"id"),o=a.map(function(){var r=e(n.mark((function r(e){var a,i,u,o,l,p;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return a=t(e,2),i=a[0],u=a[1],o={fields:"all",frac_fleet_id:u},l=c[i],i===v?o.app_key=s(l,["app","app_key"]):o.app_id=s(l,["app","id"]),r.prev=4,r.next=7,f(o);case 7:return p=r.sent,r.abrupt("return",p?y.deserialize(p):[]);case 11:return r.prev=11,r.t0=r.catch(4),console.error(r.t0),r.abrupt("return",[]);case 15:case"end":return r.stop()}}),r,null,[[4,11]])})));return function(e){return r.apply(this,arguments)}}()),r.next=4,Promise.all(o);case 4:return l=r.sent,r.abrupt("return",l.reduce((function(r,e,t){return r[a[t][0]]=e,r}),{}));case 6:case"end":return r.stop()}}),r)}))),S.apply(this,arguments)}function W(r,e){return G.apply(this,arguments)}function G(){return G=e(n.mark((function r(a,i){var c,o,l;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return c=u(i,"id"),o=a.map(function(){var r=e(n.mark((function r(e){var a,i,u,o,l,p;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return a=t(e,2),i=a[0],u=a[1],o={fields:"all"},l=c[i],i===v?o.app_key=s(l,["app","app_key"]):o.app_id=s(l,["app","id"]),r.prev=4,r.next=7,d(u,o);case 7:return p=r.sent,r.abrupt("return",p?y.deserialize(p):[]);case 11:return r.prev=11,r.t0=r.catch(4),console.error(r.t0),r.abrupt("return",[]);case 15:case"end":return r.stop()}}),r,null,[[4,11]])})));return function(e){return r.apply(this,arguments)}}()),r.next=4,Promise.all(o);case 4:return l=r.sent,r.abrupt("return",l.reduce((function(r,e,t){return r[a[t][0]]=e,r}),{}));case 6:case"end":return r.stop()}}),r)}))),G.apply(this,arguments)}var R=function(r){return[r.id,g(r,b.well.id),g(r,b.rig.id),g(r,b.frac_fleet.id),g(r,b.pad.id),g(r,"deprecatedAssetId")].join("-")},H=function(r){return Boolean(g(r,b.well.id)||g(r,b.rig.id)||g(r,b.frac_fleet.id)||g(r,b.pad.id))},L=function(r){return{id:r.id,rig:null,well:null,fracFleet:null,wells:null,isLoading:!0,appHash:R(r)}},M=function(e){return e.reduce((function(e,t){return w(w({},e),{},r({},t.id,L(t)))}),{})},N=function(r,e){var t=[],n=[],a=[],s=[],i=[],u=[];r.forEach((function(r){var e=g(r,b.well.id),c=g(r,b.rig.id),o=g(r,b.frac_fleet.id),l=g(r,b.pad.id),p=r.id;u.push([p]),e?t.push([p,e]):c?n.push([p,c]):o&&(a.push([p,o]),l?i.push([p,l]):s.push([p,o]))}));var c=e.current,o=c.rigsById,l=c.wellsById,p=c.fracFleetsById,f=j(t,Object.keys(l)),d=j(n,Object.keys(o)),m=j(a,Object.keys(p));return{appsWellIds:t,appsRigIds:n,appsFracFleetIds:a,appsPadIds:i,appIds:u,appsFracFleetToFetchWellsIds:s,uniqueWellIds:f,uniqueRigIds:d,uniqueFFIds:m}};export{I as fetchAssetEntitiesByAssetIds,E as fetchFracFleetWells,z as fetchFracFleets,W as fetchPadWells,k as fetchRigs,_ as fetchWells,g as getAppAssetSpecificTypeId,R as getAppHash,T as getAppsDataByFFs,q as getAppsDataByPads,D as getAppsDataByRigs,B as getAppsDataByWells,L as getInitialAppData,M as getInitialAppsDataState,j as getUniqAssetIds,H as isAppWithSettings,N as prepareDataForResolver};
1
+ import r from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/slicedToArray";import n from"@babel/runtime/regenerator";import a from"jsona";import{get as s,isEmpty as i,keyBy as u,uniq as c}from"lodash";import{getWells as o,getRigs as l,getFracFleets as p,getFracFleetWells as f,getPadWells as d,getResolvedAssets as m}from"../../../../clients/jsonApi/index.js";import{DEV_CENTER_CLI_APP_ID as v}from"../../../../constants/devcenter.js";import"../../../../constants/goals.js";import"../../../../constants/segment.js";import"../../../../constants/alerts.js";import"../../../../constants/apps.js";import"../../../../constants/drillstring.js";import"../../../../constants/completion.js";import"../../../../constants/appPackages.js";import"../../../../constants/notifications.js";import"../../../../constants/feed.js";import"../../../../constants/bha.js";import{ASSET_TYPES as b}from"../../../../constants/assetTypes.js";import"../../../../utils/env.js";import"../../../GradientManager/configuration/constants.js";import{getAppSegment as h}from"../../../../utils/devcenter.js";function w(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}var g=new a,j=function(r,e){return+s(r,["settings",e])},_=function(r,e){return c(r.map((function(r){var e=t(r,2);return e[0],e[1]})).filter((function(r){return Number.isFinite(r)&&!e.includes(String(r))})))};function x(r){return k.apply(this,arguments)}function k(){return(k=e(n.mark((function r(e){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e.length){r.next=2;break}return r.abrupt("return",null);case 2:return r.prev=2,r.next=5,o({ids:e,fields:["well.name","well.settings","well.company","well.asset_id","well.last_active_at","well.id","well.rig","rig.name","rig.asset_id","company.id","well.status"]});case 5:return r.abrupt("return",r.sent);case 8:return r.prev=8,r.t0=r.catch(2),console.error(r.t0),r.abrupt("return",null);case 12:case"end":return r.stop()}}),r,null,[[2,8]])})))).apply(this,arguments)}function O(r){return I.apply(this,arguments)}function I(){return(I=e(n.mark((function r(e){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e.length){r.next=2;break}return r.abrupt("return",null);case 2:return r.prev=2,r.next=5,l({ids:e,fields:["rig.name","rig.settings","rig.asset_id","rig.active_well","rig.last_active_well","well.name","well.settings","well.company","well.asset_id","well.last_active_at","well.id","well.company.id"]});case 5:return r.abrupt("return",r.sent);case 8:return r.prev=8,r.t0=r.catch(2),console.error(r.t0),r.abrupt("return",null);case 12:case"end":return r.stop()}}),r,null,[[2,8]])})))).apply(this,arguments)}function P(r){return F.apply(this,arguments)}function F(){return(F=e(n.mark((function r(e){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e.length){r.next=2;break}return r.abrupt("return",null);case 2:return r.prev=2,r.next=5,m({assets:e});case 5:return r.abrupt("return",r.sent);case 8:return r.prev=8,r.t0=r.catch(2),console.error(r.t0),r.abrupt("return",null);case 12:case"end":return r.stop()}}),r,null,[[2,8]])})))).apply(this,arguments)}var B=function(r,e){return{well:r&&y(y({},r.attributes),{},{id:r.id,companyId:s(r,"relationships.company.data.id")}),rig:{name:s(e,"attributes.name"),id:s(e,"id"),asset_id:s(e,"attributes.asset_id")}}},D=function(r,e){return e&&!i(e)?r.reduce((function(r,n){var a=t(n,2),s=a[0],i=a[1],u=e[i];return u?(r[s]=B(u,u.rig),r):r}),{}):{}},T=function(r,e){return e&&!i(e)?r.reduce((function(r,n){var a=t(n,2),s=a[0],i=a[1],u=e[i];return r[s]=B(null==u?void 0:u.well,u),r}),{}):{}},q=function(r,e,n){return e||n?r.reduce((function(r,a){var s=t(a,2),i=s[0],u=s[1],c=null==e?void 0:e[u],o=null==n?void 0:n[i];return r[i]={fracFleet:c,wells:o},r}),{}):{}},z=function(r,e){return r||e?r.reduce((function(r,n){var a=t(n,2),s=a[0];a[1];var i=null==e?void 0:e[s];return r[s]={wells:i},r}),{}):{}};function A(r){return E.apply(this,arguments)}function E(){return(E=e(n.mark((function r(e){var t;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e.length){r.next=2;break}return r.abrupt("return",null);case 2:return r.prev=2,r.next=5,p({ids:e,fields:["frac_fleet.name","frac_fleet.pads","frac_fleet.current_pad_id","frac_fleet.pad_frac_fleets"]});case 5:return t=r.sent,r.abrupt("return",t?g.deserialize(t):[]);case 9:return r.prev=9,r.t0=r.catch(2),console.error(r.t0),r.abrupt("return",[]);case 13:case"end":return r.stop()}}),r,null,[[2,9]])})))).apply(this,arguments)}function S(r,e){return W.apply(this,arguments)}function W(){return W=e(n.mark((function r(a,i){var c,o,l;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return c=u(i,"id"),o=a.map(function(){var r=e(n.mark((function r(e){var a,i,u,o,l,p;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return a=t(e,2),i=a[0],u=a[1],o={fields:"all",frac_fleet_id:u},l=c[i],i===v?o.app_key=s(l,["app","app_key"]):o.app_id=s(l,["app","id"]),r.prev=4,r.next=7,f(o);case 7:return p=r.sent,r.abrupt("return",p?g.deserialize(p):[]);case 11:return r.prev=11,r.t0=r.catch(4),console.error(r.t0),r.abrupt("return",[]);case 15:case"end":return r.stop()}}),r,null,[[4,11]])})));return function(e){return r.apply(this,arguments)}}()),r.next=4,Promise.all(o);case 4:return l=r.sent,r.abrupt("return",l.reduce((function(r,e,t){return r[a[t][0]]=e,r}),{}));case 6:case"end":return r.stop()}}),r)}))),W.apply(this,arguments)}function G(r,e){return R.apply(this,arguments)}function R(){return R=e(n.mark((function r(a,i){var c,o,l;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return c=u(i,"id"),o=a.map(function(){var r=e(n.mark((function r(e){var a,i,u,o,l,p;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return a=t(e,2),i=a[0],u=a[1],o={fields:"all"},l=c[i],i===v?o.app_key=s(l,["app","app_key"]):o.app_id=s(l,["app","id"]),r.prev=4,r.next=7,d(u,o);case 7:return p=r.sent,r.abrupt("return",p?g.deserialize(p):[]);case 11:return r.prev=11,r.t0=r.catch(4),console.error(r.t0),r.abrupt("return",[]);case 15:case"end":return r.stop()}}),r,null,[[4,11]])})));return function(e){return r.apply(this,arguments)}}()),r.next=4,Promise.all(o);case 4:return l=r.sent,r.abrupt("return",l.reduce((function(r,e,t){return r[a[t][0]]=e,r}),{}));case 6:case"end":return r.stop()}}),r)}))),R.apply(this,arguments)}var H=function(r){return[r.id,j(r,b.well.id),j(r,b.rig.id),j(r,b.frac_fleet.id),j(r,b.pad.id),j(r,"deprecatedAssetId"),h(r)].join("-")},L=function(r){return Boolean(j(r,b.well.id)||j(r,b.rig.id)||j(r,b.frac_fleet.id)||j(r,b.pad.id))},M=function(r){return{id:r.id,rig:null,well:null,fracFleet:null,wells:null,isLoading:!0,appHash:H(r)}},N=function(e){return e.reduce((function(e,t){return y(y({},e),{},r({},t.id,M(t)))}),{})},C=function(r,e){var t=[],n=[],a=[],s=[],i=[],u=[];r.forEach((function(r){var e=j(r,b.well.id),c=j(r,b.rig.id),o=j(r,b.frac_fleet.id),l=j(r,b.pad.id),p=r.id;u.push([p]),e?t.push([p,e]):c?n.push([p,c]):o&&(a.push([p,o]),l?i.push([p,l]):s.push([p,o]))}));var c=e.current,o=c.rigsById,l=c.wellsById,p=c.fracFleetsById,f=_(t,Object.keys(l)),d=_(n,Object.keys(o)),m=_(a,Object.keys(p));return{appsWellIds:t,appsRigIds:n,appsFracFleetIds:a,appsPadIds:i,appIds:u,appsFracFleetToFetchWellsIds:s,uniqueWellIds:f,uniqueRigIds:d,uniqueFFIds:m}};export{P as fetchAssetEntitiesByAssetIds,S as fetchFracFleetWells,A as fetchFracFleets,G as fetchPadWells,O as fetchRigs,x as fetchWells,j as getAppAssetSpecificTypeId,H as getAppHash,q as getAppsDataByFFs,z as getAppsDataByPads,T as getAppsDataByRigs,D as getAppsDataByWells,M as getInitialAppData,N as getInitialAppsDataState,_ as getUniqAssetIds,L as isAppWithSettings,C as prepareDataForResolver};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "0.72.0-0",
3
+ "version": "0.72.0-2",
4
4
  "description": "Shared components/utils for Corva ui projects",
5
5
  "keywords": [
6
6
  "corva-ui"
@@ -95,7 +95,7 @@
95
95
  "chalk": "4.1.1",
96
96
  "chroma-js": "1.4.1",
97
97
  "classnames": "2.2.6",
98
- "corva-convert-units": "1.11.1",
98
+ "corva-convert-units": "1.12.0",
99
99
  "dotenv": "^10.0.0",
100
100
  "echarts": "^5.4.3",
101
101
  "echarts-for-react": "^3.0.2",
@@ -134,7 +134,7 @@
134
134
  "prettier": "^2.1.2",
135
135
  "prop-types": "15.7.2",
136
136
  "query-string": "4.3.4",
137
- "re-resizable": "4.11.0",
137
+ "re-resizable": "6.9.11",
138
138
  "react": "17.0.1",
139
139
  "react-color": "2.18.1",
140
140
  "react-cursor-position": "3.0.3",