Liferay.Loader.define("item-selector-taglib@5.3.11/item_selector_uploader/js/utils/sendFile",["module","exports","require"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function sendFile({file:e,fileFieldName:t,onProgress:n=noop,onSuccess:r=noop,onError:s=noop,url:o}){const a=new FormData,d=new XMLHttpRequest;return d.upload.addEventListener("progress",(e=>{n(Math.round(100*e.loaded/e.total))})),d.addEventListener("readystatechange",(()=>{if(4===d.readyState){const e=function parse(e){let t;try{t=JSON.parse(e.responseText)}catch(n){t=e.responseText}return t}(d);n(null),d.status>=200&&d.status<300?r(e):s(e)}})),a.append(t,e),d.open("POST",o),d.send(a),d};const noop=()=>{}}}));
//# sourceMappingURL=sendFile.js.map