1import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-DwGratHY.js";import{t as n}from"./useTranslation-DD-Qfdbo.js";import{ar as r}from"./src-CjL3dUA4.js";import{t as i}from"./eye-DhksdYtq.js";import{t as a}from"./x-Cc3mq-6Q.js";import{t as o}from"./jsx-runtime-B74pBk57.js";import{t as s}from"./Input-DvzD40SF.js";import{y as c}from"./index-Cx81tCfw.js";var l=r(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),u=e(t()),d=o(),f=[{regex:/.{8,}/,key:`minLength`},{regex:/[0-9]/,key:`number`},{regex:/[a-z]/,key:`lowercase`},{regex:/[A-Z]/,key:`uppercase`}],p=(e,t)=>f.map(n=>({met:n.regex.test(e),text:t(`passwordComplexity.requirements.${n.key}`)})),m=e=>f.every(t=>t.regex.test(e)),h=e=>e===0?`bg-border`:e<=1?`bg-red-500`:e<=2?`bg-orange-500`:e===3?`bg-amber-500`:`bg-emerald-500`,g=e=>{let{value:t=``,onChange:r,...o}=e,{t:f}=n(`common`),[m,g]=(0,u.useState)(!1),_=()=>g(e=>!e),v=p(t,f),y=(0,u.useMemo)(()=>v.filter(e=>e.met).length,[v]);return(0,d.jsxs)(`div`,{children:[(0,d.jsxs)(`div`,{className:`relative`,children:[(0,d.jsx)(s,{...o,className:`pe-9 w-full`,placeholder:f(`passwordComplexity.placeholder`),type:m?`text`:`password`,value:t,onChange:r}),(0,d.jsx)(`button`,{className:`text-icon-disabled-offset hover:text-icon-tertiary focus-visible:border-ring focus-visible:ring-ring/50 absolute inset-y-0 end-0 flex h-full w-9 items-center justify-center rounded-e-md transition-[color,box-shadow] outline-none focus:z-10 focus-visible:ring-[3px] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,type:`button`,onClick:_,"aria-label":f(m?`passwordComplexity.aria.hidePassword`:`passwordComplexity.aria.showPassword`),"aria-pressed":m,"aria-controls":`password`,children:m?(0,d.jsx)(l,{size:16,"aria-hidden":`true`}):(0,d.jsx)(i,{size:16,"aria-hidden":`true`})})]}),(0,d.jsx)(`div`,{className:`bg-highlight mt-3 mb-4 h-1 w-full overflow-hidden rounded-full`,role:`progressbar`,"aria-valuenow":y,"aria-valuemin":0,"aria-valuemax":4,"aria-label":f(`passwordComplexity.aria.passwordStrength`),children:(0,d.jsx)(`div`,{className:`h-full ${h(y)} transition-all duration-500 ease-out`,style:{width:`${y/4*100}%`}})}),(0,d.jsx)(`p`,{className:`text-foreground mb-3 text-sm font-normal leading-6`,children:f(`passwordComplexity.mustContain`)}),(0,d.jsx)(`ul`,{className:`flex flex-col gap-1.5`,"aria-label":f(`passwordComplexity.aria.passwordRequirements`),children:v.map((e,t)=>(0,d.jsxs)(`li`,{className:`flex items-center gap-2`,children:[e.met?(0,d.jsx)(c,{size:16,className:`text-emerald-500`,"aria-hidden":`true`}):(0,d.jsx)(a,{size:16,className:`text-icon-tertiary`,"aria-hidden":`true`}),(0,d.jsxs)(`span`,{className:`text-sm ${e.met?`text-emerald-600`:`text-icon-tertiary`}`,children:[e.text,(0,d.jsx)(`span`,{className:`sr-only`,children:e.met?` - ${f(`passwordComplexity.aria.requirementMet`)}`:` - ${f(`passwordComplexity.aria.requirementNotMet`)}`})]})]},t))})]})};export{m as n,g as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.