{"version":3,"file":"notify_module-1dfz32NM.js","sources":["../../../app/javascript/entrypoints/notify_module.js"],"sourcesContent":["export default {\n errorAlert: function(e){\n // e = Ajaxresponseの要素(JSONparse化済み)\n let errorMessage = this.setupToStringMessages(e.response.data.message)\n $('.js-messages').html(errorMessage);\n },\n successAlert: function(response_message){\n var fixed_message = '処理に成功しました'\n if (response_message) {\n fixed_message = response_message\n }\n $('.js-messages').html(\n '
' +\n '' +\n fixed_message +\n '
'\n );\n },\n errorModalAlert: function(e){\n // e = Ajaxresponseの要素(JSONparse化済み)\n let errorMessage = this.setupToStringMessages(e.response.data.message)\n $('.js-modal-messages').html(errorMessage);\n },\n successModalAlert: function(response_message){\n var fixed_message = '処理に成功しました'\n if (response_message) {\n fixed_message = response_message\n }\n $('.js-modal-messages').html(\n '
' +\n '' +\n fixed_message +\n '
'\n );\n },\n clearModalAlert: function () { \n $('.js-modal-messages').html('')\n },\n\n // responseType:ArrayBuffer & utf-8\n errorAlertWithArrayBuffer: function(e){\n let dataView = new DataView(e.response.data);\n let decoder = new TextDecoder('utf8');\n let obj = JSON.parse(decoder.decode(dataView));\n let errorMessage = this.setupToStringMessages(obj['message'])\n $('.js-messages').html(errorMessage);\n },\n\n // HTMLを組み立てるメソッド\n errorMessageHtml: function(message) {\n return ('
' +\n '' +\n message +\n '
')\n },\n // responseMessageがStringArray別に処理してHTML文字列で返す\n setupToStringMessages: function(responseMessage) {\n var message = '';\n if(Array.isArray(responseMessage)){\n let self = this\n responseMessage.forEach(function(msg) {\n message += self.errorMessageHtml(msg);\n })\n } else {\n message = this.errorMessageHtml(responseMessage);\n }\n return message\n }\n};\n"],"names":["notifyModule","errorMessage","response_message","fixed_message","dataView","decoder","obj","message","responseMessage","self","msg"],"mappings":"AAAA,MAAeA,EAAA,CACb,WAAY,SAAS,EAAE,CAErB,IAAIC,EAAe,KAAK,sBAAsB,EAAE,SAAS,KAAK,OAAO,EACrE,EAAE,cAAc,EAAE,KAAKA,CAAY,CACpC,EACD,aAAc,SAASC,EAAiB,CACtC,IAAIC,EAAgB,YAChBD,IACFC,EAAgBD,GAElB,EAAE,cAAc,EAAE,KAChB,+LAIAC,EACA,QACN,CACG,EACD,gBAAiB,SAAS,EAAE,CAE1B,IAAIF,EAAe,KAAK,sBAAsB,EAAE,SAAS,KAAK,OAAO,EACrE,EAAE,oBAAoB,EAAE,KAAKA,CAAY,CAC1C,EACD,kBAAmB,SAASC,EAAiB,CAC3C,IAAIC,EAAgB,YAChBD,IACFC,EAAgBD,GAElB,EAAE,oBAAoB,EAAE,KACtB,+LAIAC,EACA,QACN,CACG,EACD,gBAAiB,UAAY,CAC3B,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAChC,EAGD,0BAA2B,SAAS,EAAE,CACpC,IAAIC,EAAW,IAAI,SAAS,EAAE,SAAS,IAAI,EACvCC,EAAU,IAAI,YAAY,MAAM,EAChCC,EAAM,KAAK,MAAMD,EAAQ,OAAOD,CAAQ,CAAC,EACzCH,EAAe,KAAK,sBAAsBK,EAAI,OAAU,EAC5D,EAAE,cAAc,EAAE,KAAKL,CAAY,CACpC,EAGD,iBAAkB,SAASM,EAAS,CAClC,MAAQ,8LAINA,EACA,QACH,EAED,sBAAuB,SAASC,EAAiB,CAC/C,IAAID,EAAU,GACd,GAAG,MAAM,QAAQC,CAAe,EAAE,CAChC,IAAIC,EAAO,KACXD,EAAgB,QAAQ,SAASE,EAAK,CACpCH,GAAWE,EAAK,iBAAiBC,CAAG,CAC5C,CAAO,CACP,MACMH,EAAU,KAAK,iBAAiBC,CAAe,EAEjD,OAAOD,CACR,CACH"}