import r from"@babel/runtime/helpers/defineProperty";import{memo as e}from"react";import i from"prop-types";import{makeStyles as o,Dialog as t,DialogTitle as n,Typography as s,DialogContent as a,DialogActions as l,Button as p}from"@material-ui/core";import{Close as c,ArrowBackIos as m}from"@material-ui/icons";import"./DrillPipe/Browser.js";import d from"./DrillPipe/Editor.js";import"./Agitator/Browser.js";import f from"./Agitator/Editor.js";import"./Bit/Browser.js";import u from"./Bit/Editor.js";import"./DrillCollar/Browser.js";import b from"./DrillCollar/Editor.js";import"./Jar/Browser.js";import g from"./Jar/Editor.js";import"./Lwd/Browser.js";import h from"./Lwd/Editor.js";import"./Mwd/Browser.js";import j from"./Mwd/Editor.js";import"./Pdm/Browser.js";import w from"./Pdm/Editor.js";import"./Rss/Browser.js";import y from"./Rss/Editor.js";import"./Stabilizer/Browser.js";import x from"./Stabilizer/Editor.js";import"./Sub/Browser.js";import v from"./Sub/Editor.js";import"./Ur/Browser.js";import C from"./Ur/Editor.js";import{COMPONENT_FAMILIES as O}from"../../../../constants/drillstring.js";import{jsxs as B,jsx as E}from"react/jsx-runtime";function S(r,e){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),i.push.apply(i,o)}return i}function M(e){for(var i=1;i<arguments.length;i++){var o=null!=arguments[i]?arguments[i]:{};i%2?S(Object(o),!0).forEach((function(i){r(e,i,o[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):S(Object(o)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))}))}return e}var D=o((function(r){return{paper:{background:r.isLightTheme?r.palette.primary.text1:r.palette.background.b5},dialogTitle:{padding:"12px 0",borderBottom:"1px solid ".concat(r.palette.background.b7)},titleWrapper:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px"},title:{fontSize:"20px",fontWeight:400},closeIcon:{color:r.palette.primary.text6,"&:hover":{color:r.palette.primary.text1}},dialogContent:{padding:"0px 0px 0px 16px",flexDirection:"column",height:"100%",width:"100%",position:"relative"},dialogActions:{padding:"8px 16px",justifyContent:"space-between"},contentView:{display:"flex",height:"100%"},componentListView:{height:"100%",flex:1,overflowY:"auto",paddingRight:"16px"},bottomGradient:{position:"absolute",height:"16px",left:0,right:0,bottom:0,background:"linear-gradient(180deg, rgba(33, 33, 33, 0) 0%, ".concat(r.palette.background.b5," 100%)")}}}));function P(r){var e=r.component,i=r.isDraft,o=r.error,S=r.onChange,P=r.onUseSuggestion,k=r.onCancel,R=r.onSave,N=r.onClose,q={component:e,isDraft:i,error:o,onChange:S,onUseSuggestion:P,onCancel:k,onSave:R},U=D(),L=e.family;return B(t,{open:!0,onBackdropClick:N,onEscapeKeyDown:N,maxWidth:"xs",fullWidth:!0,fullScreen:!0,classes:{paper:U.paper},children:[E(n,{className:U.dialogTitle,children:B("div",{className:U.titleWrapper,children:[E(s,{className:U.title,children:function(r){if(!r)return"—";var e=O.drilling.find((function(e){return e.type===r}));return(null==e?void 0:e.name)||r.toUpperCase()}(L)}),E(c,{onClick:N,className:U.closeIcon})]})}),E(a,{className:U.dialogContent,children:B("div",{className:U.contentView,children:[B("div",{className:U.componentListView,children:[("dp"===L||"hwdp"===L)&&E(d,M(M({},q),{},{isMobile:!0})),"stabilizer"===L&&E(x,M(M({},q),{},{isMobile:!0})),"dc"===L&&E(b,M(M({},q),{},{isMobile:!0})),"jar"===L&&E(g,M(M({},q),{},{isMobile:!0})),"sub"===L&&E(v,M(M({},q),{},{isMobile:!0})),"mwd"===L&&E(j,M(M({},q),{},{isMobile:!0})),"agitator"===L&&E(f,M(M({},q),{},{isMobile:!0})),"rss"===L&&E(y,M(M({},q),{},{isMobile:!0})),"pdm"===L&&E(w,M(M({},q),{},{isMobile:!0})),"bit"===L&&E(u,M(M({},q),{},{isMobile:!0})),"lwd"===L&&E(h,M(M({},q),{},{isMobile:!0})),"ur"===L&&E(C,M(M({},q),{},{isMobile:!0}))]}),E("div",{className:U.bottomGradient})]})}),B(l,{className:U.dialogActions,children:[E(p,{startIcon:E(m,{}),onClick:N}),B("div",{children:[E(p,{color:"primary",style:{marginRight:"12px"},onClick:N,children:"Cancel"}),E(p,{variant:"contained",color:"primary",onClick:R,children:"Save"})]})]})]})}P.propTypes={component:i.shape({family:i.string}).isRequired,isDraft:i.bool.isRequired,error:i.shape({}).isRequired,onChange:i.func.isRequired,onUseSuggestion:i.func.isRequired,onCancel:i.func.isRequired,onSave:i.func.isRequired,onClose:i.func.isRequired};var k=e(P);export{k as default};
