{"version":3,"file":"sendsafely.bundle.js","mappings":"qFAACA,OAAOC,eAAkBC,IACxBC,KAAOC,KACP,IAAIC,EAAYL,OAAOM,OAAO,IAAIJ,KAChCK,EAAaF,EAAUG,KAAK,eAC5BC,EAAUJ,EAAUG,KAAK,YACzBE,EAAYC,EAAE,IAAMF,GACpBG,EAAOP,EAAUQ,QAAQ,QAE3B,MAAMC,EAAS,IAAId,OAAOe,mBAAmBR,EAAYF,GACzDS,EAAOE,mBAAoB,EAC3BF,EAAOG,aAEPL,EAAK,GAAGM,aAAa,WAAY,IAEjCN,EAAK,GAAGO,iBAAiB,UAAU,SAAUC,GAC3CA,EAAEC,iBACFD,EAAEE,4BACGR,EAAOS,mBAAqB,GAC/BvB,OAAOwB,QAAQC,oBAAoBC,WAAWN,GAEhDN,EAAOa,iBACL,SAAUC,GACRlB,EAAUmB,IAAID,GACd5B,OAAOwB,QAAQC,oBAAoBC,WAAWN,EAChD,IACA,SAAUU,GACRC,QAAQC,IAAIF,EACd,GAEJ,GAAE,C","sources":["webpack:///../../Mvc/Kentico/Xperience/Components/FormComponents/SendSafely/UI/sendsafely.js"],"sourcesContent":["window.initSendSafely = (componentId) => {\r\n self = this;\r\n let $dropzone = window.jQuery(`#${componentId}`),\r\n dropzoneId = $dropzone.data(\"dropzone-id\"),\r\n valueId = $dropzone.data(\"value-id\"),\r\n formField = $(\"#\" + valueId),\r\n form = $dropzone.closest(\"form\");\r\n\r\n const widget = new window.SendSafelyDropzone(dropzoneId, $dropzone);\r\n widget.disableAutoSubmit = true;\r\n widget.initialize();\r\n\r\n form[0].setAttribute(\"onsubmit\", \"\");\r\n\r\n form[0].addEventListener(\"submit\", function (e) {\r\n e.preventDefault();\r\n e.stopImmediatePropagation();\r\n if (!widget.nbrOfFilesAttached > 0) {\r\n window.kentico.updatableFormHelper.submitForm(e);\r\n }\r\n widget.finalizePackage(\r\n function (url) {\r\n formField.val(url);\r\n window.kentico.updatableFormHelper.submitForm(e);\r\n },\r\n function (message) {\r\n console.log(message);\r\n }\r\n );\r\n });\r\n};\r\n"],"names":["window","initSendSafely","componentId","self","this","$dropzone","jQuery","dropzoneId","data","valueId","formField","$","form","closest","widget","SendSafelyDropzone","disableAutoSubmit","initialize","setAttribute","addEventListener","e","preventDefault","stopImmediatePropagation","nbrOfFilesAttached","kentico","updatableFormHelper","submitForm","finalizePackage","url","val","message","console","log"],"sourceRoot":""}