System.register(["./file-validation.util.cjs.js","../types/file-upload.enums.cjs.js"],function(_export,_context){"use strict";var t,s,i;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}return{setters:[function(_fileValidationUtilCjsJs){t=_fileValidationUtilCjsJs.p;},function(_typesFileUploadEnumsCjsJs){s=_typesFileUploadEnumsCjsJs.F;}],execute:function execute(){_export("D",i=/*#__PURE__*/function(){function i(){_classCallCheck(this,i);this.currentState=s.DEFAULT;}return _createClass(i,[{key:"setErrorMessage",value:function setErrorMessage(t){this.errorMessageCallback=t;}},{key:"setIsDisabled",value:function setIsDisabled(t){this.isDisabledCallback=t;}},{key:"setValuesInDragHandler",value:function setValuesInDragHandler(t){this.currentState=t;}},{key:"onFileDrop",value:function onFileDrop(t){this.fileDropCallback=t;}},{key:"onStateChange",value:function onStateChange(t){this.stateChangeCallback=t;}},{key:"setState",value:function setState(t){var _this$isDisabledCallb,_this$stateChangeCall;this.currentState===s.DISABLED||((_this$isDisabledCallb=this.isDisabledCallback)===null||_this$isDisabledCallb===void 0?void 0:_this$isDisabledCallb.call(this))||(this.currentState=t,(_this$stateChangeCall=this.stateChangeCallback)===null||_this$stateChangeCall===void 0?void 0:_this$stateChangeCall.call(this,t));}},{key:"dragEnter",value:function dragEnter(_i){var _this$isDisabledCallb2;t(_i),this.currentState===s.DISABLED||((_this$isDisabledCallb2=this.isDisabledCallback)===null||_this$isDisabledCallb2===void 0?void 0:_this$isDisabledCallb2.call(this))||this.setState(s.DRAG);}},{key:"dragLeave",value:function dragLeave(_i2){var _this$isDisabledCallb3;t(_i2),this.currentState===s.DISABLED||((_this$isDisabledCallb3=this.isDisabledCallback)===null||_this$isDisabledCallb3===void 0?void 0:_this$isDisabledCallb3.call(this))||this.setState(s.DEFAULT);}},{key:"dragOver",value:function dragOver(_i3){var _this$isDisabledCallb4;t(_i3),this.currentState!==s.DISABLED&&((_this$isDisabledCallb4=this.isDisabledCallback)===null||_this$isDisabledCallb4===void 0?void 0:_this$isDisabledCallb4.call(this));}},{key:"drop",value:function drop(_i4){var _this$isDisabledCallb5;t(_i4),this.currentState===s.DISABLED||((_this$isDisabledCallb5=this.isDisabledCallback)===null||_this$isDisabledCallb5===void 0?void 0:_this$isDisabledCallb5.call(this))||(this.setState(s.DEFAULT),this.handleFiles(_i4));}},{key:"handleDocumentDrop",value:function handleDocumentDrop(_i5){t(_i5),this.currentState!==s.DISABLED&&this.setState(s.DEFAULT);}},{key:"preventDragOver",value:function preventDragOver(s){t(s);}},{key:"preventDrop",value:function preventDrop(s){t(s);}},{key:"handleFiles",value:function handleFiles(_i6){var _this$isDisabledCallb6;if(t(_i6),this.currentState===s.DISABLED||(_this$isDisabledCallb6=this.isDisabledCallback)!==null&&_this$isDisabledCallb6!==void 0&&_this$isDisabledCallb6.call(this))return;var e=null;if("dataTransfer"in _i6&&_i6.dataTransfer&&(e=_i6.dataTransfer.files),!e&&_i6.target instanceof HTMLInputElement&&(e=_i6.target.files),e&&e.length>0){var _this$fileDropCallbac;var _t=Array.from(e);(_this$fileDropCallbac=this.fileDropCallback)===null||_this$fileDropCallbac===void 0||_this$fileDropCallbac.call(this,_t);}_i6.target instanceof HTMLInputElement&&(_i6.target.value="");}}]);}());}};});
//# sourceMappingURL=drag-drop.util.cjs.js.map
