{ "version": 3, "sources": ["../../javascript/entrypoints/antique-canvas-cart-errors-handling.js"], "sourcesContent": ["import { errorToast } from \"../warp/utilities/errors\"\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n const form = document.querySelector('form[data-remote=\"true\"]')\n\n if (form) {\n form.addEventListener(\"ajax:error\", (event) => {\n const [data, status, xhr] = event.detail\n\n if (status === \"Unprocessable Entity\") {\n const jsonData = JSON.parse(data)\n const message = jsonData.errors.base.join(\", \")\n errorToast(new Error(message))\n }\n })\n }\n})\n"], "mappings": "sGAEA,SAAS,iBAAiB,mBAAoB,IAAM,CAClD,IAAMA,EAAO,SAAS,cAAc,0BAA0B,EAE1DA,GACFA,EAAK,iBAAiB,aAAeC,GAAU,CAC7C,GAAM,CAACC,EAAMC,EAAQC,CAAG,EAAIH,EAAM,OAElC,GAAIE,IAAW,uBAAwB,CAErC,IAAME,EADW,KAAK,MAAMH,CAAI,EACP,OAAO,KAAK,KAAK,IAAI,EAC9CI,EAAW,IAAI,MAAMD,CAAO,CAAC,CAC/B,CACF,CAAC,CAEL,CAAC", "names": ["form", "event", "data", "status", "xhr", "message", "errorToast"] }