{"version":3,"sources":["webpack:///./app/javascript/responseTemplates/responseTemplates.js","webpack:///./app/javascript/packs/responseTemplates.js"],"names":["toggleTemplateTypeButton","form","e","targetType","target","dataset","activeType","classList","toggle","getElementsByClassName","addClickListeners","responsesContainer","parentCommentId","id","includes","insertButtons","Array","from","moderatorSubmitButtons","forEach","button","addEventListener","event","content","textArea","querySelector","value","confirm","dispatchEvent","Event","focus","responseTemplateId","parentId","commentableId","preventDefault","document","getElementById","fetch","method","headers","Accept","window","csrfToken","body","JSON","stringify","response_template","comment","body_markdown","commentable_id","commentable_type","parent_id","then","response","json","status","location","pathname","path","alert","error","fetchResponseTemplates","typeOf","formId","dataContainer","innerHTML","length","map","obj","title","join","buildHTML","parentElement","openButtonCallback","dataFetched","containerHidden","contains","copyData","loadData","userData","moderator_for_tags","personalTemplateButton","modTemplateButton","remove","topLevelData","childElementCount","once","prepareHeaderButtons","add","observeForReplyClick","observer","MutationObserver","mutations","addedNodes","filter","node","nodeName","hasListener","prepareOpenButton","commentTree","observe","childList","subtree","disconnect","InstantClick","on","loadResponseTemplates","userStatus","showLoginModal"],"mappings":"2FAIA,SAASA,EAAyBC,EAAMC,GACtC,IAAQC,EAAeD,EAAEE,OAAOC,QAAxBF,WACFG,EAA4B,aAAfH,EAA4B,YAAc,WAC7DD,EAAEE,OAAOG,UAAUC,OAAO,UAC1BP,EACGQ,uBADH,UAC6BH,EAD7B,qBAC2D,GACxDC,UAAUC,OAAO,UACpBP,EACGQ,uBADH,UAC6BN,EAD7B,yBAC+D,GAC5DI,UAAUC,OAAO,UACpBP,EACGQ,uBADH,UAC6BH,EAD7B,yBAC+D,GAC5DC,UAAUC,OAAO,U,OAgGtB,SAASE,EAAkBT,GACzB,IAAMU,EAAqBV,EAAKQ,uBAC9B,gCACA,GACIG,EACQ,gBAAZX,EAAKY,KAAyBZ,EAAKY,GAAGC,SAAS,gBAC3CC,EAAgBC,MAAMC,KAC1BN,EAAmBF,uBAAuB,2BAEtCS,EAAyBF,MAAM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AAuB,6BAA6B,UADvD,SAEIY,iBACA,QAEAuF,iBAsBFnB,KCxUJhD,OAAO+D,aAAaC,GAAG,UAAU,WAC/BC,OAGFA,M","file":"js/responseTemplates-d6eeebff799b08a17f6f.chunk.js","sourcesContent":["/* eslint-disable no-alert */\n/* eslint-disable no-restricted-globals */\n/* global showLoginModal */\n\nfunction toggleTemplateTypeButton(form, e) {\n const { targetType } = e.target.dataset;\n const activeType = targetType === 'personal' ? 'moderator' : 'personal';\n e.target.classList.toggle('active');\n form\n .getElementsByClassName(`${activeType}-template-button`)[0]\n .classList.toggle('active');\n form\n .getElementsByClassName(`${targetType}-responses-container`)[0]\n .classList.toggle('hidden');\n form\n .getElementsByClassName(`${activeType}-responses-container`)[0]\n .classList.toggle('hidden');\n}\n\nconst noResponsesHTML = `\n
🤔... It looks like you don't have any templates yet.
\n${obj.content}
\n${obj.content}
\n