{"version":3,"sources":["webpack:///./app/javascript/packs/pw-popover.js"],"names":["tpl","score","warning","hasLength","hasNumber","hasLowerAndUppercase","$","each","i","element","options","html","content","placement","trigger","$element","popover","on","e","pw","currentTarget","value","result","zxcvbn","data","dataset","feedback","length","test"],"mappings":"wFAAA,wCAEMA,EAAM,SAACC,EAAOC,EAASC,EAAWC,EAAWC,GAAvC,wDAC4BJ,EAD5B,4GAIOE,GAAa,eAJpB,yDAKOE,GAAwB,eAL/B,oEAMOD,GAAa,eANpB,6DASVH,GAAS,GAAT,qDAEkCA,EAAQ,EAAI,kCAAoC,4BAFlF,+DAIIC,EAAO,oDACHA,EADG,mBAJX,cATU,iBAqBZI,EAAE,qBACCC,MAAK,SAACC,EAAGC,GACR,IAAMC,EAAU,CACdC,MAAM,EACNC,QAASZ,EAAI,GAAG,GAAO,GAAO,GAC9Ba,UAAW,SACXC,QAAS,SAELC,EAAWT,EAAEG,GAChBO,QAAQN,GAEXK,EACGE,GAAG,SAAS,SAACC,GACZ,IAAMC,EAAKD,EAAEE,cAAcC,MACrBC,EAASC,IAAOJ,GAEtBJ,EAASS,KAAK,cAAcf,QAAQgB,QAAQb,QAAUZ,EAAIsB,EAAOrB,MAC/DqB,EAAOI,SAASxB,QAChBiB,EAAGQ,QAAU,EACb,QAAQC,KAAKT,GACb,QAAQS,KAAKT,IAAO,QAAQS,KAAKT,IAEnCJ,EAASC,QAAQ,e","file":"js/4-91b13db41b93946bf300.chunk.js","sourcesContent":["import zxcvbn from 'zxcvbn';\n\nconst tpl = (score, warning, hasLength, hasNumber, hasLowerAndUppercase) => `\n
\n

Your password must contain:

\n \n
\n${score >= 0 && `\n
\n
${score < 3 ? 'Your password could be stronger' : 'That\\'s a strong password!'}
\n
\n ${warning ? `
\n ${warning}\n
` : ``}\n
\n`}\n
\n `;\n\n$('[data-pw-popover]')\n .each((i, element) => {\n const options = {\n html: true,\n content: tpl(0, false, false, false),\n placement: 'bottom',\n trigger: 'focus'\n };\n const $element = $(element)\n .popover(options);\n\n $element\n .on('keyup', (e) => {\n const pw = e.currentTarget.value;\n const result = zxcvbn(pw);\n\n $element.data('bs.popover').element.dataset.content = tpl(result.score,\n result.feedback.warning,\n pw.length >= 8,\n /[0-9]/.test(pw),\n /[a-z]/.test(pw) && /[A-Z]/.test(pw)\n );\n $element.popover('show');\n });\n });\n"],"sourceRoot":""}