{"version":3,"file":"todo_auto_verification_controller-C7c93E99.js","sources":["../../app/assets/javascript/controllers/verification_documents/todo_auto_verification_controller.js"],"sourcesContent":["import { Controller } from \"@hotwired/stimulus\";\n\nexport default class extends Controller {\n static targets = [\"processing\", \"timedOut\"];\n static values = { timeout: Number }\n\n connect() {\n const end = new Date(this.timeoutValue * 1000);\n const timeLeft = end - new Date();\n\n if (timeLeft > 0) {\n this.processing();\n this.timeoutId = setTimeout(this.timedOut, timeLeft);\n } else {\n this.timedOut();\n }\n }\n\n disconnect() {\n if (this.timeoutId) {\n clearTimeout(this.timeoutId);\n }\n }\n\n processing = () => {\n this.processingTarget.classList.remove(\"hidden\");\n this.processingTarget.classList.add(\"flex\");\n\n this.timedOutTarget.classList.add(\"hidden\");\n this.timedOutTarget.classList.remove(\"flex\");\n }\n\n timedOut = () => {\n this.processingTarget.classList.add(\"hidden\");\n this.processingTarget.classList.remove(\"flex\");\n\n this.timedOutTarget.classList.remove(\"hidden\");\n this.timedOutTarget.classList.add(\"flex\");\n }\n}\n"],"names":["todo_auto_verification_controller","Controller","__publicField","timeLeft"],"mappings":"kSAEe,MAAKA,UAASC,CAAW,CAAzB,kCAsBbC,EAAA,kBAAa,IAAM,CACjB,KAAK,iBAAiB,UAAU,OAAO,QAAQ,EAC/C,KAAK,iBAAiB,UAAU,IAAI,MAAM,EAE1C,KAAK,eAAe,UAAU,IAAI,QAAQ,EAC1C,KAAK,eAAe,UAAU,OAAO,MAAM,CAC/C,GAEEA,EAAA,gBAAW,IAAM,CACf,KAAK,iBAAiB,UAAU,IAAI,QAAQ,EAC5C,KAAK,iBAAiB,UAAU,OAAO,MAAM,EAE7C,KAAK,eAAe,UAAU,OAAO,QAAQ,EAC7C,KAAK,eAAe,UAAU,IAAI,MAAM,CAC5C,GAhCE,SAAU,CAER,MAAMC,EADM,IAAI,KAAK,KAAK,aAAe,GAAI,EACtB,IAAI,KAEvBA,EAAW,GACb,KAAK,WAAY,EACjB,KAAK,UAAY,WAAW,KAAK,SAAUA,CAAQ,GAEnD,KAAK,SAAU,CAErB,CAEE,YAAa,CACP,KAAK,WACP,aAAa,KAAK,SAAS,CAEjC,CAiBA,CApCED,EADkBF,EACX,UAAU,CAAC,aAAc,UAAU,GAC1CE,EAFkBF,EAEX,SAAS,CAAE,QAAS,MAAM"}