jQuery,Craft.TotpForm=Garnish.Base.extend({init:function(t,e,n){var a=t.querySelector("input.auth-totp-code"),i=t.querySelector("button.submit");this.addListener(a,"input",(function(e){6===a.value.length&&t.requestSubmit()})),this.addListener(t,"submit",(function(t){t.preventDefault(),i.classList.contains("loading")||(i.classList.add("loading"),Craft.cp.announce(Craft.t("app","Loading")),Craft.sendActionRequest("POST","auth/verify-totp",{data:{code:a.value}}).then((function(){e()})).catch((function(t){var e;n(null==t||null===(e=t.response)||void 0===e||null===(e=e.data)||void 0===e?void 0:e.message)})).finally((function(){i.classList.remove("loading")})))}))}},{METHOD:"craft\\auth\\methods\\TOTP"}),Craft.registerAuthFormHandler(Craft.TotpForm.METHOD,Craft.TotpForm);
//# sourceMappingURL=totp.js.map