"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),d=require("../../features/icons/NoShieldSecondaryIcon.cjs"),i=require("../../features/icons/ShieldPrimaryIcon.cjs"),u=require("../../features/icons/ShieldSecondaryIcon.cjs"),g=require("@chakra-ui/react"),s=require("react"),a=require("react-i18next");require("../Typography.cjs");const c=require("./context.cjs"),l=require("../typography.generated.cjs"),x=({...n})=>{const r=c.usePasswordStrengthIndicatorContext(),{t}=a.useTranslation(),e=s.useMemo(()=>r===null?null:r<3?{bgColor:"surface-danger-default",textColor:"text-danger",label:t("passwordStrengthIndicator.tooWeak"),icon:o.jsx(d,{w:4,h:4})}:r===3?{bgColor:"surface-success-default",textColor:"text-success",label:t("passwordStrengthIndicator.good"),icon:o.jsx(u,{w:4,h:4})}:{bgColor:"surface-success-default",textColor:"text-success",label:t("passwordStrengthIndicator.excellent"),icon:o.jsx(i,{w:4,h:4})},[r,t]);return e?o.jsxs(g.Flex,{px:2,py:1,bg:e.bgColor,color:e.textColor,rounded:"md",width:"fit-content",alignItems:"center",...n,children:[e.icon,o.jsx(l.L1Bold,{ml:1,children:e.label})]}):null},h=({...n})=>{const r=c.usePasswordStrengthIndicatorContext(),{t}=a.useTranslation(),e=s.useMemo(()=>{if(r===null)return{label:t("passwordStrengthIndicator.passwordMustContainAtLeast8Characters"),bgColor:"surface-transparent",textColor:"text-secondary"};if(r<3)return{label:t("passwordStrengthIndicator.thisIsAWweakPasswordTryAStrongerOne"),bgColor:"surface-danger-default",textColor:"text-danger-accessible"};if(r===3)return{label:t("passwordStrengthIndicator.makeYourPasswordStrongerWithAFewMoreCharacters"),bgColor:"surface-transparent",textColor:"text-secondary"}},[r,t]);return o.jsx(o.Fragment,{children:e&&o.jsx(l.L2Bold,{bg:e.bgColor,color:e.textColor,px:4,py:3,rounded:"md",...n,children:e.label})})};exports.PasswordStrengthIndicatorComment=h;exports.PasswordStrengthIndicatorLabel=x;
