import * as __WEBPACK_EXTERNAL_MODULE__chakra_ui_react__ from "@chakra-ui/react";
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
import * as __WEBPACK_EXTERNAL_MODULE_react_icons_io__ from "react-icons/io";
const PasswordInput = ({ name, defaultShowPassword = false, showEyeIndicator = true, ...props })=>{
    const [show, setShow] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(defaultShowPassword);
    return /*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.InputGroup, null, /*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Input, {
        name: name,
        ...props,
        "data-testid": `${name}_field`,
        pr: "4.5rem",
        type: show ? 'text' : 'password'
    }), /*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.InputRightElement, {
        width: "4.5rem"
    }, showEyeIndicator ? /*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Icon, {
        "data-testid": "password-input-toggle",
        as: show ? __WEBPACK_EXTERNAL_MODULE_react_icons_io__.IoMdEyeOff : __WEBPACK_EXTERNAL_MODULE_react_icons_io__.IoMdEye,
        onClick: ()=>setShow(!show)
    }) : /*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Button, {
        "data-testid": "password-input-toggle",
        h: "1.75rem",
        size: "sm",
        variant: "ghost",
        onClick: ()=>setShow(!show)
    }, show ? 'Hide' : 'Show')));
};
/* ESM default export */ const PasswordInput_rslib_entry_ = PasswordInput;
export { PasswordInput_rslib_entry_ as default };
