| 1 |
var initPasswordStrengthHelper=function(){"use strict";return function(e=null,t=""){(e?[e]:Object.keys(window.bf_globals||{})).forEach(e=>{const i=bfSelect(`#form-${e}`),l=window.bf_globals?.[e]?.fields;i&&l&&Object.keys(l).filter(e=>!l[e].parentFieldKey&&l[e].valid?.validations&&Object.keys(l[e].valid.validations).length>0).forEach(s=>{if("undefined"!=typeof checkRepeatedField&&checkRepeatedField(s,bf_globals[e])&&!t)return;const a=l[s],r=`${t} .${s}-fld-wrp`,c=`${r} input`,n=`${r} .${s}-hlp-txt`,o=e=>{const t=i.querySelector(n);if(!t||!a.helperTxt)return;const l=e.value||"",s=a.valid?.validations||{},r=e=>new RegExp(e.split("$_bf_$").join("\\")),c=e=>e?'<span style="color: green;">✔</span>':'<span style="color: red;">✖</span>';let o=a.helperTxt;Object.keys(s).forEach(e=>{switch(e){case"digit":o=o.replace("${isNumberExistIcn}",c(r(s.digit).test(l)));break;case"lower":o=o.replace("${isLowercaseExistIcn}",c(r(s.lower).test(l)));break;case"upper":o=o.replace("${isUppercaseExistIcn}",c(r(s.upper).test(l)));break;case"special":o=o.replace("${isSpecialExistIcn}",c(r(s.special).test(l)));break;case"limit":{const e=s.limit.mn||0,t=s.limit.mx||1/0;o=o.replace("${isLimitValidIcn}",c(l.length>=e&&l.length<=t));break}}}),t.innerHTML=o};i.querySelectorAll(c).forEach(e=>{e.addEventListener("input",e=>o(e.target)),o(e)})})})}}(); |