{"version":3,"file":"background_information.js","mappings":"YAAA,SAASA,EAAwBC,EAAOC,GACtC,IAAMC,EAASC,SAASC,cAAc,yBAADC,OAA0BL,EAAK,YAC9DM,EAAiBH,SAASC,cAAc,yBAADC,OAA0BL,EAAK,qBACtEO,EAA4B,SAACC,GACjC,GAAIF,EAAgB,CAClB,IAAMG,EAAqBD,GAAqBP,EAChDK,EAAeI,UAAUC,OAAO,SAAUF,EAC5C,CACF,EAEIP,IACFA,EAAOU,iBAAiB,UAAU,SAACC,GACjCN,EAA0BM,EAAMC,OAAOC,MACzC,IAEAR,EAA0BL,EAAOa,OAErC,CAEAZ,SAASS,iBAAiB,mBAAmB,WAC3Cb,EAAwB,oBAAqB,eAC7CA,EAAwB,kBAAmB,QAC7C,G","sources":["webpack://soloentre/./app/javascript/background_information.js"],"sourcesContent":["function setupTextInputForSelect(field, targetSelectOptionValue) {\n const select = document.querySelector(`.questionnaire__other-${field}-select`);\n const inputContainer = document.querySelector(`.questionnaire__other-${field}-input-container`);\n const toggleTextInputVisibility = (selectOptionValue) => {\n if (inputContainer) {\n const hideInputContainer = selectOptionValue != targetSelectOptionValue;\n inputContainer.classList.toggle(\"d-none\", hideInputContainer);\n }\n };\n\n if (select) {\n select.addEventListener(\"change\", (event) => {\n toggleTextInputVisibility(event.target.value);\n });\n\n toggleTextInputVisibility(select.value);\n }\n}\n\ndocument.addEventListener(\"turbolinks:load\", () => {\n setupTextInputForSelect(\"educational-level\", \"level_other\");\n setupTextInputForSelect(\"respondent-role\", \"other\");\n});\n"],"names":["setupTextInputForSelect","field","targetSelectOptionValue","select","document","querySelector","concat","inputContainer","toggleTextInputVisibility","selectOptionValue","hideInputContainer","classList","toggle","addEventListener","event","target","value"],"sourceRoot":""}