
/* /dtg_auth_password_policy_signup/static/src/js/check_password.js */
odoo.define('@dtg_auth_password_policy_signup/js/check_password',['@dtg_auth_password_policy/js/check_password_mixin','@web/legacy/js/public/public_widget'],function(require){'use strict';let __exports={};const{checkPasswordMixin}=require('@dtg_auth_password_policy/js/check_password_mixin')
const publicWidget=require('@web/legacy/js/public/public_widget')[Symbol.for("default")];publicWidget.registry.passwordInput=publicWidget.Widget.extend({selector:'input[name="password"]',events:{'input':'_onInput',},_onInput:function(ev){const elPasswordInput=ev.currentTarget;elPasswordInput.setCustomValidity('');},});publicWidget.registry.signupSubmit=publicWidget.Widget.extend(checkPasswordMixin,{selector:'button[type="submit"]',events:{'click':'_onClickSubmit',},_onClickSubmit:function(e){e.preventDefault();const $passwordInput=$(e.currentTarget).closest('form').find('input[name="password"]');const elPasswordInput=$passwordInput[0];if(!elPasswordInput){let form=$(e.currentTarget).closest('form');form[0].submit();return;}
this._validatePassword(elPasswordInput);if(!elPasswordInput.checkValidity()){$passwordInput.focus();}else{let form=$(e.currentTarget).closest('form');form[0].submit();}}});return __exports;});