import{u as useSelector,r as reactExports,j as jsxRuntimeExports,B as Box,n as hidePanel}from"./js-core.esm4.js";import{S as Stack,ao as CustomColorInput,ap as ButtonPreview,j as Switch}from"./js-core.esm9.js";import{d as selectButtonColor,e as selectButtonTextColor,k as selectHideVeritoneBranding,S as SHARED_TEXT,i as actions,j as actions$2,C as CUSTOM_LOGIN_PANEL_ID}from"./js-core.esm102.js";import"./js-core.esm8.js";import{T as Typography,B as Button}from"./js-core.esm7.js";import{u as useDispatch}from"./js-core.esm12.js";function _array_like_to_array(t,e){(null==e||e>t.length)&&(e=t.length);for(var o=0,n=new Array(e);o<e;o++)n[o]=t[o];return n}function _array_with_holes(t){if(Array.isArray(t))return t}function _iterable_to_array_limit(t,e){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=o){var n,r,i=[],s=!0,a=!1;try{for(o=o.call(t);!(s=(n=o.next()).done)&&(i.push(n.value),!e||i.length!==e);s=!0);}catch(t){a=!0,r=t}finally{try{s||null==o.return||o.return()}finally{if(a)throw r}}return i}}function _non_iterable_rest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _sliced_to_array(t,e){return _array_with_holes(t)||_iterable_to_array_limit(t,e)||_unsupported_iterable_to_array(t,e)||_non_iterable_rest()}function _unsupported_iterable_to_array(t,e){var o;if(t)return"string"==typeof t?_array_like_to_array(t,e):"Map"===(o="Object"===(o=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:o)||"Set"===o?Array.from(o):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_array_like_to_array(t,e):void 0}var CustomLoginConfigurationStep=function(t){var t=t.isEditMode,e=useDispatch(),o=useSelector(selectButtonColor),n=useSelector(selectButtonTextColor),r=useSelector(selectHideVeritoneBranding),i=_sliced_to_array(reactExports.useState(!0),2),s=i[0],a=i[1],i=s;return jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"space-between"},children:[jsxRuntimeExports.jsxs(Stack,{direction:"column",gap:"20px",sx:{height:"90%",position:"relative",overflow:"auto"},children:[jsxRuntimeExports.jsxs(Box,{sx:{marginTop:"25px",marginBottom:"30px"},children:[jsxRuntimeExports.jsxs(Typography,{variant:"h3",sx:{fontWeight:600,fontSize:"16px",marginBottom:"5px"},children:[SHARED_TEXT.configurationStep.title()," *"]}),jsxRuntimeExports.jsx(Typography,{variant:"caption",sx:{fontWeight:400,fontSize:"14px"},children:SHARED_TEXT.configurationStep.description()}),jsxRuntimeExports.jsx(CustomColorInput,{isButtonColorRequired:!1,onReset:function(){return e(actions.resetButton())},buttonColor:o,buttonTextColor:n,onValidationCheck:function(t){return a(t)},onChangeButtonColor:function(t){return e(actions.setButtonColor(t))},onChangeTextColor:function(t){return e(actions.setButtonTextColor(t))}})]}),jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsx(ButtonPreview,{buttonColor:o,buttonTextColor:n})}),jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsxs(Stack,{children:[jsxRuntimeExports.jsx(Typography,{variant:"h3",sx:{fontWeight:600,fontSize:"16px",marginBottom:"5px"},children:SHARED_TEXT.configurationStep.hideVeritoneBrandingTitle()}),jsxRuntimeExports.jsxs(Stack,{direction:"row",children:[jsxRuntimeExports.jsx(Typography,{variant:"caption",sx:{fontWeight:400,fontSize:"14px"},children:SHARED_TEXT.configurationStep.hideVeritoneBrandingDescription()}),jsxRuntimeExports.jsx(Switch,{checked:r,onChange:function(){return e(actions.setHideVeritoneBranding(!r))}})]})]})})]}),jsxRuntimeExports.jsx(Footer,{onBack:function(){e(actions$2.setActiveStep(1))},onSave:function(){e(actions$2.updateLoginConfigStart()),e(hidePanel(CUSTOM_LOGIN_PANEL_ID))},isEditMode:t,isDisabled:!i})]})},Footer=function(t){var e=t.onBack,o=t.onSave,n=t.isEditMode,t=t.isDisabled,t=void 0!==t&&t;return jsxRuntimeExports.jsxs(Stack,{direction:"row",sx:{padding:"60px 0 30px 30px",display:"flex",justifyContent:"flex-end",height:"10%",alignItems:"center"},children:[jsxRuntimeExports.jsx(Button,{onClick:e,disabled:!1,variant:"text","data-testid":"admin-center-custom-login--back-btn",sx:{marginRight:"15px"},children:SHARED_TEXT.configurationStep.backBtn()}),jsxRuntimeExports.jsx(Button,{onClick:o,disabled:t,variant:"contained","data-testid":"admin-center-custom-login--create-btn",children:n?SHARED_TEXT.configurationStep.saveBtn():SHARED_TEXT.configurationStep.createBtn()})]})};export{CustomLoginConfigurationStep as default};
