import{ad as useIntl,u as useSelector,j as jsxRuntimeExports,n as hidePanel}from"./js-core.esm4.js";import{u as useBasicInfoStyles}from"./js-core.esm96.js";import{i as imageUpload,T as TextField,H as InputLabel}from"./js-core.esm9.js";import{b as businessUnitOptionsGetter,s as selectOrgName,a as selectBusinessUnit,c as selectLogoPreviewImage,d as actions$3,e as actions,f as actions$2,p as panelId}from"./js-core.esm97.js";import{T as Typography,M as MemoizedFormattedMessage,j as FormControl,X as Select,e as MenuItem,B as Button}from"./js-core.esm7.js";import{B as Box}from"./js-core.esm8.js";import"./js-core.esm11.js";import{A as Add}from"./js-core.esm42.js";import{u as useDispatch}from"./js-core.esm12.js";import"./js-core.esm15.js";import"./js-core.esm16.js";import"./js-core.esm17.js";import"./js-core.esm18.js";var ImageUpload=imageUpload.jsx.ImageUpload,BasicInfo=function(){var e=useIntl(),s=useDispatch(),t=businessUnitOptionsGetter(e),a=useSelector(selectOrgName),i=useSelector(selectBusinessUnit),n=useSelector(selectLogoPreviewImage),o=useBasicInfoStyles().classes,r=a&&i;return jsxRuntimeExports.jsxs(Box,{"data-testid":"instance-admin-center.create-org.basic-info-tab",className:o.container,children:[jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Typography,{variant:"body1",className:o.title,children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"instance-admin-center.create-org.basic-info-title",defaultMessage:"Basic Information",description:"Basic Information title"})}),jsxRuntimeExports.jsx(Typography,{variant:"body2",className:o.description,children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"instance-admin-center.create-org.basic-info-description",defaultMessage:"Begin by adding the basic information for this Organization.",description:"Basic Information description"})}),jsxRuntimeExports.jsx(Typography,{variant:"body1",className:o.logoTitle,children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"instance-admin-center.create-org.logo-title",defaultMessage:"Organization Logo",description:"Organization Logo title"})}),jsxRuntimeExports.jsxs(Typography,{variant:"caption",children:[jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"instance-admin-center.create-org.recommended-label",defaultMessage:"Recommended",description:"Recommended label"}),": 250x250, JPEG or PNG"]}),jsxRuntimeExports.jsx(Box,{className:o.logoContainer,children:jsxRuntimeExports.jsx(ImageUpload,{getUrl:!0,image:n,handleChange:function(e){e.unsignedUrl?(s(actions$3.setOrgLogo(e.unsignedUrl)),s(actions$3.setLogoPreviewImage(e.getUrl))):(s(actions$3.setOrgLogo("")),s(actions$3.setLogoPreviewImage("")))},testId:"instance-admin-center.create-org.logo",fileTypes:"image/png, image/jpeg",uploadCustomIcon:jsxRuntimeExports.jsx(Add,{}),maxFileSize:15})}),jsxRuntimeExports.jsx(TextField,{className:o.input,label:a&&e.formatMessage({id:"basic-info.organization-name-label",defaultMessage:"Organization Name",description:"Organization label"}),placeholder:e.formatMessage({id:"basic-info.organization-name",defaultMessage:"Organization Name",description:"Organization placeholder"}),value:a||"",onChange:function(e){e=e.target.value;s(actions$3.setOrgName(e))},"data-testid":"instance-admin-center.create-org.basic-info.name"}),jsxRuntimeExports.jsxs(FormControl,{className:o.input,children:[jsxRuntimeExports.jsx(InputLabel,{className:o.placeholder,children:e.formatMessage({id:"basic-info.business-unit",defaultMessage:"Business Unit",description:"Select placeholder"})}),jsxRuntimeExports.jsx(Select,{value:i||"",onChange:function(e){e=e.target.value;s(actions$3.setBusinessUnit(e))},"data-testid":"instance-admin-center.create-org.basic-info.business-unit",children:t.map(function(e,s){return jsxRuntimeExports.jsx(MenuItem,{value:null==e?void 0:e.value,"data-testid":"select-option-".concat(s+1),children:null==e?void 0:e.label},e.id)})})]})]}),jsxRuntimeExports.jsxs(Box,{"data-testid":"instance-admin-center.create-org.basic-info.action-buttons",className:o.actionButtonsContainer,children:[jsxRuntimeExports.jsx(Button,{variant:"text",className:o.cancelButton,onClick:function(){s(hidePanel(panelId))},"data-testid":"cancel",children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"instance-admin-center.create-org.basic-info.cancel-btn",defaultMessage:"Cancel",description:"Cancel button label"})}),jsxRuntimeExports.jsx(Button,{variant:"contained",disabled:!r,onClick:function(){s(actions.setStepCompleted(1)),s(actions.setActiveStep(2)),s(actions$2.fetchDefaultPackagesStart())},"data-testid":"next",children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"instance-admin-center.create-org.basic-info.next-btn",defaultMessage:"Next",description:"Next button label"})})]})]})};export{BasicInfo as default};
