katoikia-app/web-ui/web-react/node_modules/.cache/babel-loader/722c00411172f08870afedb1d6b...

1 line
96 KiB
JSON

{"ast":null,"code":"import React, { Component } from 'react';\nimport { Button } from 'primereact/button';\nimport { Messages } from 'primereact/messages';\nimport { ProgressBar } from 'primereact/progressbar';\nimport { DomHandler, classNames, IconUtils, ObjectUtils } from 'primereact/utils';\nimport { Ripple } from 'primereact/ripple';\nimport { localeOption } from 'primereact/api';\n\nfunction _arrayLikeToArray$1(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray$1(arr);\n}\n\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\n\nfunction _unsupportedIterableToArray$1(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray$1(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread();\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n\n if (!it) {\n if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n\n var F = function F() {};\n\n return {\n s: F,\n n: function n() {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n },\n e: function e(_e) {\n throw _e;\n },\n f: F\n };\n }\n\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n\n var normalCompletion = true,\n didErr = false,\n err;\n return {\n s: function s() {\n it = it.call(o);\n },\n n: function n() {\n var step = it.next();\n normalCompletion = step.done;\n return step;\n },\n e: function e(_e2) {\n didErr = true;\n err = _e2;\n },\n f: function f() {\n try {\n if (!normalCompletion && it[\"return\"] != null) it[\"return\"]();\n } finally {\n if (didErr) throw err;\n }\n }\n };\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nvar FileUpload = /*#__PURE__*/function (_Component) {\n _inherits(FileUpload, _Component);\n\n var _super = _createSuper(FileUpload);\n\n function FileUpload(props) {\n var _this;\n\n _classCallCheck(this, FileUpload);\n\n _this = _super.call(this, props);\n _this.state = {\n files: [],\n msgs: [],\n focused: false,\n progress: 0\n };\n _this.choose = _this.choose.bind(_assertThisInitialized(_this));\n _this.upload = _this.upload.bind(_assertThisInitialized(_this));\n _this.clear = _this.clear.bind(_assertThisInitialized(_this));\n _this.onFileSelect = _this.onFileSelect.bind(_assertThisInitialized(_this));\n _this.onDragEnter = _this.onDragEnter.bind(_assertThisInitialized(_this));\n _this.onDragOver = _this.onDragOver.bind(_assertThisInitialized(_this));\n _this.onDragLeave = _this.onDragLeave.bind(_assertThisInitialized(_this));\n _this.onDrop = _this.onDrop.bind(_assertThisInitialized(_this));\n _this.onKeyDown = _this.onKeyDown.bind(_assertThisInitialized(_this));\n _this.onFocus = _this.onFocus.bind(_assertThisInitialized(_this));\n _this.onBlur = _this.onBlur.bind(_assertThisInitialized(_this));\n _this.onSimpleUploaderClick = _this.onSimpleUploaderClick.bind(_assertThisInitialized(_this));\n _this.duplicateIEEvent = false;\n return _this;\n }\n\n _createClass(FileUpload, [{\n key: \"hasFiles\",\n value: function hasFiles() {\n return this.state.files && this.state.files.length > 0;\n }\n }, {\n key: \"isImage\",\n value: function isImage(file) {\n return /^image\\//.test(file.type);\n }\n }, {\n key: \"chooseDisabled\",\n value: function chooseDisabled() {\n return this.props.disabled || this.props.fileLimit && this.props.fileLimit <= this.state.files.length + this.uploadedFileCount;\n }\n }, {\n key: \"uploadDisabled\",\n value: function uploadDisabled() {\n return this.props.disabled || !this.hasFiles();\n }\n }, {\n key: \"cancelDisabled\",\n value: function cancelDisabled() {\n return this.props.disabled || !this.hasFiles();\n }\n }, {\n key: \"chooseButtonLabel\",\n value: function chooseButtonLabel() {\n return this.props.chooseLabel || this.props.chooseOptions.label || localeOption('choose');\n }\n }, {\n key: \"uploadButtonLabel\",\n value: function uploadButtonLabel() {\n return this.props.uploadLabel || this.props.uploadOptions.label || localeOption('upload');\n }\n }, {\n key: \"cancelButtonLabel\",\n value: function cancelButtonLabel() {\n return this.props.cancelLabel || this.props.cancelOptions.label || localeOption('cancel');\n }\n }, {\n key: \"remove\",\n value: function remove(event, index) {\n this.clearInputElement();\n\n var currentFiles = _toConsumableArray(this.state.files);\n\n var removedFile = this.state.files[index];\n currentFiles.splice(index, 1);\n this.setState({\n files: currentFiles\n });\n\n if (this.props.onRemove) {\n this.props.onRemove({\n originalEvent: event,\n file: removedFile\n });\n }\n }\n }, {\n key: \"clearInputElement\",\n value: function clearInputElement() {\n if (this.fileInput) {\n this.fileInput.value = '';\n }\n }\n }, {\n key: \"clearIEInput\",\n value: function clearIEInput() {\n if (this.fileInput) {\n this.duplicateIEEvent = true; //IE11 fix to prevent onFileChange trigger again\n\n this.fileInput.value = '';\n }\n }\n }, {\n key: \"formatSize\",\n value: function formatSize(bytes) {\n if (bytes === 0) {\n return '0 B';\n }\n\n var k = 1000,\n dm = 3,\n sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],\n i = Math.floor(Math.log(bytes) / Math.log(k));\n return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];\n }\n }, {\n key: \"onFileSelect\",\n value: function onFileSelect(event) {\n var _this2 = this;\n\n if (event.type !== 'drop' && this.isIE11() && this.duplicateIEEvent) {\n this.duplicateIEEvent = false;\n return;\n }\n\n this.setState({\n msgs: []\n });\n this.files = this.state.files ? _toConsumableArray(this.state.files) : [];\n var files = event.dataTransfer ? event.dataTransfer.files : event.target.files;\n\n for (var i = 0; i < files.length; i++) {\n var file = files[i];\n\n if (!this.isFileSelected(file)) {\n if (this.validate(file)) {\n if (this.isImage(file)) {\n file.objectURL = window.URL.createObjectURL(file);\n }\n\n this.files.push(file);\n }\n }\n }\n\n this.setState({\n files: this.files\n }, function () {\n if (_this2.hasFiles() && _this2.props.auto) {\n _this2.upload();\n }\n });\n\n if (this.props.onSelect) {\n this.props.onSelect({\n originalEvent: event,\n files: files\n });\n }\n\n if (event.type !== 'drop' && this.isIE11()) {\n this.clearIEInput();\n } else {\n this.clearInputElement();\n }\n\n if (this.props.mode === 'basic' && this.files.length > 0) {\n this.fileInput.style.display = 'none';\n }\n }\n }, {\n key: \"isFileSelected\",\n value: function isFileSelected(file) {\n var _iterator = _createForOfIteratorHelper(this.state.files),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var sFile = _step.value;\n if (sFile.name + sFile.type + sFile.size === file.name + file.type + file.size) return true;\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return false;\n }\n }, {\n key: \"isIE11\",\n value: function isIE11() {\n return !!window['MSInputMethodContext'] && !!document['documentMode'];\n }\n }, {\n key: \"validate\",\n value: function validate(file) {\n if (this.props.maxFileSize && file.size > this.props.maxFileSize) {\n var message = {\n severity: 'error',\n summary: this.props.invalidFileSizeMessageSummary.replace('{0}', file.name),\n detail: this.props.invalidFileSizeMessageDetail.replace('{0}', this.formatSize(this.props.maxFileSize))\n };\n\n if (this.props.mode === 'advanced') {\n this.messagesUI.show(message);\n }\n\n if (this.props.onValidationFail) {\n this.props.onValidationFail(file);\n }\n\n return false;\n }\n\n return true;\n }\n }, {\n key: \"upload\",\n value: function upload() {\n var _this3 = this;\n\n if (this.props.customUpload) {\n if (this.props.fileLimit) {\n this.uploadedFileCount += this.state.files.length;\n }\n\n if (this.props.uploadHandler) {\n this.props.uploadHandler({\n files: this.state.files,\n options: {\n clear: this.clear,\n props: this.props\n }\n });\n }\n } else {\n this.setState({\n msgs: []\n });\n var xhr = new XMLHttpRequest();\n var formData = new FormData();\n\n if (this.props.onBeforeUpload) {\n this.props.onBeforeUpload({\n 'xhr': xhr,\n 'formData': formData\n });\n }\n\n var _iterator2 = _createForOfIteratorHelper(this.state.files),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var file = _step2.value;\n formData.append(this.props.name, file, file.name);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n xhr.upload.addEventListener('progress', function (event) {\n if (event.lengthComputable) {\n _this3.setState({\n progress: Math.round(event.loaded * 100 / event.total)\n }, function () {\n if (_this3.props.onProgress) {\n _this3.props.onProgress({\n originalEvent: event,\n progress: _this3.state.progress\n });\n }\n });\n }\n });\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4) {\n _this3.setState({\n progress: 0\n });\n\n if (xhr.status >= 200 && xhr.status < 300) {\n if (_this3.props.fileLimit) {\n _this3.uploadedFileCount += _this3.state.files.length;\n }\n\n if (_this3.props.onUpload) {\n _this3.props.onUpload({\n xhr: xhr,\n files: _this3.state.files\n });\n }\n } else {\n if (_this3.props.onError) {\n _this3.props.onError({\n xhr: xhr,\n files: _this3.state.files\n });\n }\n }\n\n _this3.clear();\n }\n };\n\n xhr.open('POST', this.props.url, true);\n\n if (this.props.onBeforeSend) {\n this.props.onBeforeSend({\n 'xhr': xhr,\n 'formData': formData\n });\n }\n\n xhr.withCredentials = this.props.withCredentials;\n xhr.send(formData);\n }\n }\n }, {\n key: \"clear\",\n value: function clear() {\n this.setState({\n files: []\n });\n\n if (this.props.onClear) {\n this.props.onClear();\n }\n\n this.clearInputElement();\n }\n }, {\n key: \"choose\",\n value: function choose() {\n this.fileInput.click();\n }\n }, {\n key: \"onFocus\",\n value: function onFocus() {\n this.setState({\n focused: true\n });\n }\n }, {\n key: \"onBlur\",\n value: function onBlur() {\n this.setState({\n focused: false\n });\n }\n }, {\n key: \"onKeyDown\",\n value: function onKeyDown(event) {\n if (event.which === 13) {\n // enter\n this.choose();\n }\n }\n }, {\n key: \"onDragEnter\",\n value: function onDragEnter(event) {\n if (!this.props.disabled) {\n event.dataTransfer.dropEffect = \"copy\";\n event.stopPropagation();\n event.preventDefault();\n }\n }\n }, {\n key: \"onDragOver\",\n value: function onDragOver(event) {\n if (!this.props.disabled) {\n event.dataTransfer.dropEffect = \"copy\";\n DomHandler.addClass(this.content, 'p-fileupload-highlight');\n event.stopPropagation();\n event.preventDefault();\n }\n }\n }, {\n key: \"onDragLeave\",\n value: function onDragLeave(event) {\n if (!this.props.disabled) {\n event.dataTransfer.dropEffect = \"copy\";\n DomHandler.removeClass(this.content, 'p-fileupload-highlight');\n }\n }\n }, {\n key: \"onDrop\",\n value: function onDrop(event) {\n if (!this.props.disabled) {\n DomHandler.removeClass(this.content, 'p-fileupload-highlight');\n event.stopPropagation();\n event.preventDefault();\n var files = event.dataTransfer ? event.dataTransfer.files : event.target.files;\n var allowDrop = this.props.multiple || files && files.length === 0;\n\n if (allowDrop) {\n this.onFileSelect(event);\n }\n }\n }\n }, {\n key: \"onSimpleUploaderClick\",\n value: function onSimpleUploaderClick() {\n if (this.hasFiles()) {\n this.upload();\n } else {\n this.fileInput.click();\n }\n }\n }, {\n key: \"renderChooseButton\",\n value: function renderChooseButton() {\n var _this4 = this;\n\n var _this$props$chooseOpt = this.props.chooseOptions,\n className = _this$props$chooseOpt.className,\n style = _this$props$chooseOpt.style,\n icon = _this$props$chooseOpt.icon,\n iconOnly = _this$props$chooseOpt.iconOnly;\n var chooseClassName = classNames('p-button p-fileupload-choose p-component', {\n 'p-disabled': this.props.disabled,\n 'p-focus': this.state.focused,\n 'p-button-icon-only': iconOnly\n }, className);\n var labelClassName = 'p-button-label p-clickable';\n var label = iconOnly ? /*#__PURE__*/React.createElement(\"span\", {\n className: labelClassName,\n dangerouslySetInnerHTML: {\n __html: \"&nbsp;\"\n }\n }) : /*#__PURE__*/React.createElement(\"span\", {\n className: labelClassName\n }, this.chooseButtonLabel());\n return /*#__PURE__*/React.createElement(\"span\", {\n className: chooseClassName,\n style: style,\n onClick: this.choose,\n onKeyDown: this.onKeyDown,\n onFocus: this.onFocus,\n onBlur: this.onBlur,\n tabIndex: 0\n }, /*#__PURE__*/React.createElement(\"input\", {\n ref: function ref(el) {\n return _this4.fileInput = el;\n },\n type: \"file\",\n onChange: this.onFileSelect,\n multiple: this.props.multiple,\n accept: this.props.accept,\n disabled: this.chooseDisabled()\n }), IconUtils.getJSXIcon(icon || 'pi pi-fw pi-plus', {\n className: 'p-button-icon p-button-icon-left p-clickable'\n }, {\n props: this.props\n }), label, /*#__PURE__*/React.createElement(Ripple, null));\n }\n }, {\n key: \"renderFile\",\n value: function renderFile(file, index) {\n var _this5 = this;\n\n var preview = this.isImage(file) ? /*#__PURE__*/React.createElement(\"div\", null, /*#__PURE__*/React.createElement(\"img\", {\n alt: file.name,\n role: \"presentation\",\n src: file.objectURL,\n width: this.props.previewWidth\n })) : null;\n var fileName = /*#__PURE__*/React.createElement(\"div\", {\n className: \"p-fileupload-filename\"\n }, file.name);\n var size = /*#__PURE__*/React.createElement(\"div\", null, this.formatSize(file.size));\n var removeButton = /*#__PURE__*/React.createElement(\"div\", null, /*#__PURE__*/React.createElement(Button, {\n type: \"button\",\n icon: \"pi pi-times\",\n onClick: function onClick(e) {\n return _this5.remove(e, index);\n }\n }));\n var content = /*#__PURE__*/React.createElement(React.Fragment, null, preview, fileName, size, removeButton);\n\n if (this.props.itemTemplate) {\n var defaultContentOptions = {\n onRemove: function onRemove(event) {\n return _this5.remove(event, index);\n },\n previewElement: preview,\n fileNameElement: fileName,\n sizeElement: size,\n removeElement: removeButton,\n formatSize: this.formatSize(file.size),\n files: this.state.files,\n index: index,\n element: content,\n props: this.props\n };\n content = ObjectUtils.getJSXElement(this.props.itemTemplate, file, defaultContentOptions);\n }\n\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"p-fileupload-row\",\n key: file.name + file.type + file.size\n }, content);\n }\n }, {\n key: \"renderFiles\",\n value: function renderFiles() {\n var _this6 = this;\n\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"p-fileupload-files\"\n }, this.state.files.map(function (file, index) {\n return _this6.renderFile(file, index);\n }));\n }\n }, {\n key: \"renderEmptyContent\",\n value: function renderEmptyContent() {\n if (this.props.emptyTemplate && !this.hasFiles()) {\n return ObjectUtils.getJSXElement(this.props.emptyTemplate, this.props);\n }\n\n return null;\n }\n }, {\n key: \"renderProgressBarContent\",\n value: function renderProgressBarContent() {\n if (this.props.progressBarTemplate) {\n return ObjectUtils.getJSXElement(this.props.progressBarTemplate, this.props);\n }\n\n return /*#__PURE__*/React.createElement(ProgressBar, {\n value: this.state.progress,\n showValue: false\n });\n }\n }, {\n key: \"renderAdvanced\",\n value: function renderAdvanced() {\n var _this7 = this;\n\n var className = classNames('p-fileupload p-fileupload-advanced p-component', this.props.className);\n var headerClassName = classNames('p-fileupload-buttonbar', this.props.headerClassName);\n var contentClassName = classNames('p-fileupload-content', this.props.contentClassName);\n var uploadButton, cancelButton, filesList, progressBar;\n var chooseButton = this.renderChooseButton();\n var emptyContent = this.renderEmptyContent();\n\n if (!this.props.auto) {\n var uploadOptions = this.props.uploadOptions;\n var cancelOptions = this.props.cancelOptions;\n var uploadLabel = !uploadOptions.iconOnly ? this.uploadButtonLabel() : '';\n var cancelLabel = !cancelOptions.iconOnly ? this.cancelButtonLabel() : '';\n uploadButton = /*#__PURE__*/React.createElement(Button, {\n type: \"button\",\n label: uploadLabel,\n icon: uploadOptions.icon || 'pi pi-upload',\n onClick: this.upload,\n disabled: this.uploadDisabled(),\n style: uploadOptions.style,\n className: uploadOptions.className\n });\n cancelButton = /*#__PURE__*/React.createElement(Button, {\n type: \"button\",\n label: cancelLabel,\n icon: cancelOptions.icon || 'pi pi-times',\n onClick: this.clear,\n disabled: this.cancelDisabled(),\n style: cancelOptions.style,\n className: cancelOptions.className\n });\n }\n\n if (this.hasFiles()) {\n filesList = this.renderFiles();\n progressBar = this.renderProgressBarContent();\n }\n\n var header = /*#__PURE__*/React.createElement(\"div\", {\n className: headerClassName,\n style: this.props.headerStyle\n }, chooseButton, uploadButton, cancelButton);\n\n if (this.props.headerTemplate) {\n var defaultContentOptions = {\n className: headerClassName,\n chooseButton: chooseButton,\n uploadButton: uploadButton,\n cancelButton: cancelButton,\n element: header,\n props: this.props\n };\n header = ObjectUtils.getJSXElement(this.props.headerTemplate, defaultContentOptions);\n }\n\n return /*#__PURE__*/React.createElement(\"div\", {\n id: this.props.id,\n className: className,\n style: this.props.style\n }, header, /*#__PURE__*/React.createElement(\"div\", {\n ref: function ref(el) {\n _this7.content = el;\n },\n className: contentClassName,\n style: this.props.contentStyle,\n onDragEnter: this.onDragEnter,\n onDragOver: this.onDragOver,\n onDragLeave: this.onDragLeave,\n onDrop: this.onDrop\n }, progressBar, /*#__PURE__*/React.createElement(Messages, {\n ref: function ref(el) {\n return _this7.messagesUI = el;\n }\n }), filesList, emptyContent));\n }\n }, {\n key: \"renderBasic\",\n value: function renderBasic() {\n var _this8 = this;\n\n var hasFiles = this.hasFiles();\n var chooseOptions = this.props.chooseOptions;\n var className = classNames('p-fileupload p-fileupload-basic p-component', this.props.className);\n var buttonClassName = classNames('p-button p-component p-fileupload-choose', {\n 'p-fileupload-choose-selected': hasFiles,\n 'p-disabled': this.props.disabled,\n 'p-focus': this.state.focused\n }, chooseOptions.className);\n var chooseIcon = chooseOptions.icon || classNames({\n 'pi pi-plus': !chooseOptions.icon && (!hasFiles || this.props.auto),\n 'pi pi-upload': !chooseOptions.icon && hasFiles && !this.props.auto\n });\n var labelClassName = 'p-button-label p-clickable';\n var chooseLabel = chooseOptions.iconOnly ? /*#__PURE__*/React.createElement(\"span\", {\n className: labelClassName,\n dangerouslySetInnerHTML: {\n __html: \"&nbsp;\"\n }\n }) : /*#__PURE__*/React.createElement(\"span\", {\n className: labelClassName\n }, this.chooseButtonLabel());\n var label = this.props.auto ? chooseLabel : /*#__PURE__*/React.createElement(\"span\", {\n className: labelClassName\n }, hasFiles ? this.state.files[0].name : chooseLabel);\n var icon = IconUtils.getJSXIcon(chooseIcon, {\n className: 'p-button-icon p-button-icon-left'\n }, {\n props: this.props,\n hasFiles: hasFiles\n });\n return /*#__PURE__*/React.createElement(\"div\", {\n className: className,\n style: this.props.style\n }, /*#__PURE__*/React.createElement(Messages, {\n ref: function ref(el) {\n return _this8.messagesUI = el;\n }\n }), /*#__PURE__*/React.createElement(\"span\", {\n className: buttonClassName,\n style: chooseOptions.style,\n onMouseUp: this.onSimpleUploaderClick,\n onKeyDown: this.onKeyDown,\n onFocus: this.onFocus,\n onBlur: this.onBlur,\n tabIndex: 0\n }, icon, label, !hasFiles && /*#__PURE__*/React.createElement(\"input\", {\n ref: function ref(el) {\n return _this8.fileInput = el;\n },\n type: \"file\",\n accept: this.props.accept,\n multiple: this.props.multiple,\n disabled: this.props.disabled,\n onChange: this.onFileSelect\n }), /*#__PURE__*/React.createElement(Ripple, null)));\n }\n }, {\n key: \"render\",\n value: function render() {\n if (this.props.mode === 'advanced') return this.renderAdvanced();else if (this.props.mode === 'basic') return this.renderBasic();\n }\n }]);\n\n return FileUpload;\n}(Component);\n\n_defineProperty(FileUpload, \"defaultProps\", {\n id: null,\n name: null,\n url: null,\n mode: 'advanced',\n multiple: false,\n accept: null,\n disabled: false,\n auto: false,\n maxFileSize: null,\n invalidFileSizeMessageSummary: '{0}: Invalid file size, ',\n invalidFileSizeMessageDetail: 'maximum upload size is {0}.',\n style: null,\n className: null,\n widthCredentials: false,\n previewWidth: 50,\n chooseLabel: null,\n uploadLabel: null,\n cancelLabel: null,\n chooseOptions: {\n label: null,\n icon: null,\n iconOnly: false,\n className: null,\n style: null\n },\n uploadOptions: {\n label: null,\n icon: null,\n iconOnly: false,\n className: null,\n style: null\n },\n cancelOptions: {\n label: null,\n icon: null,\n iconOnly: false,\n className: null,\n style: null\n },\n customUpload: false,\n headerClassName: null,\n headerStyle: null,\n contentClassName: null,\n contentStyle: null,\n headerTemplate: null,\n itemTemplate: null,\n emptyTemplate: null,\n progressBarTemplate: null,\n onBeforeUpload: null,\n onBeforeSend: null,\n onUpload: null,\n onError: null,\n onClear: null,\n onSelect: null,\n onProgress: null,\n onValidationFail: null,\n uploadHandler: null,\n onRemove: null\n});\n\nexport { FileUpload };","map":{"version":3,"names":["React","Component","Button","Messages","ProgressBar","DomHandler","classNames","IconUtils","ObjectUtils","Ripple","localeOption","_arrayLikeToArray$1","arr","len","length","i","arr2","Array","_arrayWithoutHoles","isArray","_iterableToArray","iter","Symbol","iterator","from","_unsupportedIterableToArray$1","o","minLen","n","Object","prototype","toString","call","slice","constructor","name","test","_nonIterableSpread","TypeError","_toConsumableArray","_classCallCheck","instance","Constructor","_defineProperties","target","props","descriptor","enumerable","configurable","writable","defineProperty","key","_createClass","protoProps","staticProps","_assertThisInitialized","self","ReferenceError","_setPrototypeOf","p","setPrototypeOf","__proto__","_inherits","subClass","superClass","create","value","_typeof","obj","_possibleConstructorReturn","_getPrototypeOf","getPrototypeOf","_defineProperty","_createForOfIteratorHelper","allowArrayLike","it","_unsupportedIterableToArray","F","s","done","e","_e","f","normalCompletion","didErr","err","step","next","_e2","_arrayLikeToArray","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","result","NewTarget","Reflect","construct","arguments","apply","sham","Proxy","Boolean","valueOf","FileUpload","_Component","_super","_this","state","files","msgs","focused","progress","choose","bind","upload","clear","onFileSelect","onDragEnter","onDragOver","onDragLeave","onDrop","onKeyDown","onFocus","onBlur","onSimpleUploaderClick","duplicateIEEvent","hasFiles","isImage","file","type","chooseDisabled","disabled","fileLimit","uploadedFileCount","uploadDisabled","cancelDisabled","chooseButtonLabel","chooseLabel","chooseOptions","label","uploadButtonLabel","uploadLabel","uploadOptions","cancelButtonLabel","cancelLabel","cancelOptions","remove","event","index","clearInputElement","currentFiles","removedFile","splice","setState","onRemove","originalEvent","fileInput","clearIEInput","formatSize","bytes","k","dm","sizes","Math","floor","log","parseFloat","pow","toFixed","_this2","isIE11","dataTransfer","isFileSelected","validate","objectURL","window","URL","createObjectURL","push","auto","onSelect","mode","style","display","_iterator","_step","sFile","size","document","maxFileSize","message","severity","summary","invalidFileSizeMessageSummary","replace","detail","invalidFileSizeMessageDetail","messagesUI","show","onValidationFail","_this3","customUpload","uploadHandler","options","xhr","XMLHttpRequest","formData","FormData","onBeforeUpload","_iterator2","_step2","append","addEventListener","lengthComputable","round","loaded","total","onProgress","onreadystatechange","readyState","status","onUpload","onError","open","url","onBeforeSend","withCredentials","send","onClear","click","which","dropEffect","stopPropagation","preventDefault","addClass","content","removeClass","allowDrop","multiple","renderChooseButton","_this4","_this$props$chooseOpt","className","icon","iconOnly","chooseClassName","labelClassName","createElement","dangerouslySetInnerHTML","__html","onClick","tabIndex","ref","el","onChange","accept","getJSXIcon","renderFile","_this5","preview","alt","role","src","width","previewWidth","fileName","removeButton","Fragment","itemTemplate","defaultContentOptions","previewElement","fileNameElement","sizeElement","removeElement","element","getJSXElement","renderFiles","_this6","map","renderEmptyContent","emptyTemplate","renderProgressBarContent","progressBarTemplate","showValue","renderAdvanced","_this7","headerClassName","contentClassName","uploadButton","cancelButton","filesList","progressBar","chooseButton","emptyContent","header","headerStyle","headerTemplate","id","contentStyle","renderBasic","_this8","buttonClassName","chooseIcon","onMouseUp","render","widthCredentials"],"sources":["/Users/paolasanchez/Desktop/Pry4/Katoikia/katoikia-app/web-ui/sakai-react/node_modules/primereact/fileupload/fileupload.esm.js"],"sourcesContent":["import React, { Component } from 'react';\nimport { Button } from 'primereact/button';\nimport { Messages } from 'primereact/messages';\nimport { ProgressBar } from 'primereact/progressbar';\nimport { DomHandler, classNames, IconUtils, ObjectUtils } from 'primereact/utils';\nimport { Ripple } from 'primereact/ripple';\nimport { localeOption } from 'primereact/api';\n\nfunction _arrayLikeToArray$1(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray$1(arr);\n}\n\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\n\nfunction _unsupportedIterableToArray$1(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray$1(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread();\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nvar FileUpload = /*#__PURE__*/function (_Component) {\n _inherits(FileUpload, _Component);\n\n var _super = _createSuper(FileUpload);\n\n function FileUpload(props) {\n var _this;\n\n _classCallCheck(this, FileUpload);\n\n _this = _super.call(this, props);\n _this.state = {\n files: [],\n msgs: [],\n focused: false,\n progress: 0\n };\n _this.choose = _this.choose.bind(_assertThisInitialized(_this));\n _this.upload = _this.upload.bind(_assertThisInitialized(_this));\n _this.clear = _this.clear.bind(_assertThisInitialized(_this));\n _this.onFileSelect = _this.onFileSelect.bind(_assertThisInitialized(_this));\n _this.onDragEnter = _this.onDragEnter.bind(_assertThisInitialized(_this));\n _this.onDragOver = _this.onDragOver.bind(_assertThisInitialized(_this));\n _this.onDragLeave = _this.onDragLeave.bind(_assertThisInitialized(_this));\n _this.onDrop = _this.onDrop.bind(_assertThisInitialized(_this));\n _this.onKeyDown = _this.onKeyDown.bind(_assertThisInitialized(_this));\n _this.onFocus = _this.onFocus.bind(_assertThisInitialized(_this));\n _this.onBlur = _this.onBlur.bind(_assertThisInitialized(_this));\n _this.onSimpleUploaderClick = _this.onSimpleUploaderClick.bind(_assertThisInitialized(_this));\n _this.duplicateIEEvent = false;\n return _this;\n }\n\n _createClass(FileUpload, [{\n key: \"hasFiles\",\n value: function hasFiles() {\n return this.state.files && this.state.files.length > 0;\n }\n }, {\n key: \"isImage\",\n value: function isImage(file) {\n return /^image\\//.test(file.type);\n }\n }, {\n key: \"chooseDisabled\",\n value: function chooseDisabled() {\n return this.props.disabled || this.props.fileLimit && this.props.fileLimit <= this.state.files.length + this.uploadedFileCount;\n }\n }, {\n key: \"uploadDisabled\",\n value: function uploadDisabled() {\n return this.props.disabled || !this.hasFiles();\n }\n }, {\n key: \"cancelDisabled\",\n value: function cancelDisabled() {\n return this.props.disabled || !this.hasFiles();\n }\n }, {\n key: \"chooseButtonLabel\",\n value: function chooseButtonLabel() {\n return this.props.chooseLabel || this.props.chooseOptions.label || localeOption('choose');\n }\n }, {\n key: \"uploadButtonLabel\",\n value: function uploadButtonLabel() {\n return this.props.uploadLabel || this.props.uploadOptions.label || localeOption('upload');\n }\n }, {\n key: \"cancelButtonLabel\",\n value: function cancelButtonLabel() {\n return this.props.cancelLabel || this.props.cancelOptions.label || localeOption('cancel');\n }\n }, {\n key: \"remove\",\n value: function remove(event, index) {\n this.clearInputElement();\n\n var currentFiles = _toConsumableArray(this.state.files);\n\n var removedFile = this.state.files[index];\n currentFiles.splice(index, 1);\n this.setState({\n files: currentFiles\n });\n\n if (this.props.onRemove) {\n this.props.onRemove({\n originalEvent: event,\n file: removedFile\n });\n }\n }\n }, {\n key: \"clearInputElement\",\n value: function clearInputElement() {\n if (this.fileInput) {\n this.fileInput.value = '';\n }\n }\n }, {\n key: \"clearIEInput\",\n value: function clearIEInput() {\n if (this.fileInput) {\n this.duplicateIEEvent = true; //IE11 fix to prevent onFileChange trigger again\n\n this.fileInput.value = '';\n }\n }\n }, {\n key: \"formatSize\",\n value: function formatSize(bytes) {\n if (bytes === 0) {\n return '0 B';\n }\n\n var k = 1000,\n dm = 3,\n sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],\n i = Math.floor(Math.log(bytes) / Math.log(k));\n return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];\n }\n }, {\n key: \"onFileSelect\",\n value: function onFileSelect(event) {\n var _this2 = this;\n\n if (event.type !== 'drop' && this.isIE11() && this.duplicateIEEvent) {\n this.duplicateIEEvent = false;\n return;\n }\n\n this.setState({\n msgs: []\n });\n this.files = this.state.files ? _toConsumableArray(this.state.files) : [];\n var files = event.dataTransfer ? event.dataTransfer.files : event.target.files;\n\n for (var i = 0; i < files.length; i++) {\n var file = files[i];\n\n if (!this.isFileSelected(file)) {\n if (this.validate(file)) {\n if (this.isImage(file)) {\n file.objectURL = window.URL.createObjectURL(file);\n }\n\n this.files.push(file);\n }\n }\n }\n\n this.setState({\n files: this.files\n }, function () {\n if (_this2.hasFiles() && _this2.props.auto) {\n _this2.upload();\n }\n });\n\n if (this.props.onSelect) {\n this.props.onSelect({\n originalEvent: event,\n files: files\n });\n }\n\n if (event.type !== 'drop' && this.isIE11()) {\n this.clearIEInput();\n } else {\n this.clearInputElement();\n }\n\n if (this.props.mode === 'basic' && this.files.length > 0) {\n this.fileInput.style.display = 'none';\n }\n }\n }, {\n key: \"isFileSelected\",\n value: function isFileSelected(file) {\n var _iterator = _createForOfIteratorHelper(this.state.files),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var sFile = _step.value;\n if (sFile.name + sFile.type + sFile.size === file.name + file.type + file.size) return true;\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return false;\n }\n }, {\n key: \"isIE11\",\n value: function isIE11() {\n return !!window['MSInputMethodContext'] && !!document['documentMode'];\n }\n }, {\n key: \"validate\",\n value: function validate(file) {\n if (this.props.maxFileSize && file.size > this.props.maxFileSize) {\n var message = {\n severity: 'error',\n summary: this.props.invalidFileSizeMessageSummary.replace('{0}', file.name),\n detail: this.props.invalidFileSizeMessageDetail.replace('{0}', this.formatSize(this.props.maxFileSize))\n };\n\n if (this.props.mode === 'advanced') {\n this.messagesUI.show(message);\n }\n\n if (this.props.onValidationFail) {\n this.props.onValidationFail(file);\n }\n\n return false;\n }\n\n return true;\n }\n }, {\n key: \"upload\",\n value: function upload() {\n var _this3 = this;\n\n if (this.props.customUpload) {\n if (this.props.fileLimit) {\n this.uploadedFileCount += this.state.files.length;\n }\n\n if (this.props.uploadHandler) {\n this.props.uploadHandler({\n files: this.state.files,\n options: {\n clear: this.clear,\n props: this.props\n }\n });\n }\n } else {\n this.setState({\n msgs: []\n });\n var xhr = new XMLHttpRequest();\n var formData = new FormData();\n\n if (this.props.onBeforeUpload) {\n this.props.onBeforeUpload({\n 'xhr': xhr,\n 'formData': formData\n });\n }\n\n var _iterator2 = _createForOfIteratorHelper(this.state.files),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var file = _step2.value;\n formData.append(this.props.name, file, file.name);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n xhr.upload.addEventListener('progress', function (event) {\n if (event.lengthComputable) {\n _this3.setState({\n progress: Math.round(event.loaded * 100 / event.total)\n }, function () {\n if (_this3.props.onProgress) {\n _this3.props.onProgress({\n originalEvent: event,\n progress: _this3.state.progress\n });\n }\n });\n }\n });\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4) {\n _this3.setState({\n progress: 0\n });\n\n if (xhr.status >= 200 && xhr.status < 300) {\n if (_this3.props.fileLimit) {\n _this3.uploadedFileCount += _this3.state.files.length;\n }\n\n if (_this3.props.onUpload) {\n _this3.props.onUpload({\n xhr: xhr,\n files: _this3.state.files\n });\n }\n } else {\n if (_this3.props.onError) {\n _this3.props.onError({\n xhr: xhr,\n files: _this3.state.files\n });\n }\n }\n\n _this3.clear();\n }\n };\n\n xhr.open('POST', this.props.url, true);\n\n if (this.props.onBeforeSend) {\n this.props.onBeforeSend({\n 'xhr': xhr,\n 'formData': formData\n });\n }\n\n xhr.withCredentials = this.props.withCredentials;\n xhr.send(formData);\n }\n }\n }, {\n key: \"clear\",\n value: function clear() {\n this.setState({\n files: []\n });\n\n if (this.props.onClear) {\n this.props.onClear();\n }\n\n this.clearInputElement();\n }\n }, {\n key: \"choose\",\n value: function choose() {\n this.fileInput.click();\n }\n }, {\n key: \"onFocus\",\n value: function onFocus() {\n this.setState({\n focused: true\n });\n }\n }, {\n key: \"onBlur\",\n value: function onBlur() {\n this.setState({\n focused: false\n });\n }\n }, {\n key: \"onKeyDown\",\n value: function onKeyDown(event) {\n if (event.which === 13) {\n // enter\n this.choose();\n }\n }\n }, {\n key: \"onDragEnter\",\n value: function onDragEnter(event) {\n if (!this.props.disabled) {\n event.dataTransfer.dropEffect = \"copy\";\n event.stopPropagation();\n event.preventDefault();\n }\n }\n }, {\n key: \"onDragOver\",\n value: function onDragOver(event) {\n if (!this.props.disabled) {\n event.dataTransfer.dropEffect = \"copy\";\n DomHandler.addClass(this.content, 'p-fileupload-highlight');\n event.stopPropagation();\n event.preventDefault();\n }\n }\n }, {\n key: \"onDragLeave\",\n value: function onDragLeave(event) {\n if (!this.props.disabled) {\n event.dataTransfer.dropEffect = \"copy\";\n DomHandler.removeClass(this.content, 'p-fileupload-highlight');\n }\n }\n }, {\n key: \"onDrop\",\n value: function onDrop(event) {\n if (!this.props.disabled) {\n DomHandler.removeClass(this.content, 'p-fileupload-highlight');\n event.stopPropagation();\n event.preventDefault();\n var files = event.dataTransfer ? event.dataTransfer.files : event.target.files;\n var allowDrop = this.props.multiple || files && files.length === 0;\n\n if (allowDrop) {\n this.onFileSelect(event);\n }\n }\n }\n }, {\n key: \"onSimpleUploaderClick\",\n value: function onSimpleUploaderClick() {\n if (this.hasFiles()) {\n this.upload();\n } else {\n this.fileInput.click();\n }\n }\n }, {\n key: \"renderChooseButton\",\n value: function renderChooseButton() {\n var _this4 = this;\n\n var _this$props$chooseOpt = this.props.chooseOptions,\n className = _this$props$chooseOpt.className,\n style = _this$props$chooseOpt.style,\n icon = _this$props$chooseOpt.icon,\n iconOnly = _this$props$chooseOpt.iconOnly;\n var chooseClassName = classNames('p-button p-fileupload-choose p-component', {\n 'p-disabled': this.props.disabled,\n 'p-focus': this.state.focused,\n 'p-button-icon-only': iconOnly\n }, className);\n var labelClassName = 'p-button-label p-clickable';\n var label = iconOnly ? /*#__PURE__*/React.createElement(\"span\", {\n className: labelClassName,\n dangerouslySetInnerHTML: {\n __html: \"&nbsp;\"\n }\n }) : /*#__PURE__*/React.createElement(\"span\", {\n className: labelClassName\n }, this.chooseButtonLabel());\n return /*#__PURE__*/React.createElement(\"span\", {\n className: chooseClassName,\n style: style,\n onClick: this.choose,\n onKeyDown: this.onKeyDown,\n onFocus: this.onFocus,\n onBlur: this.onBlur,\n tabIndex: 0\n }, /*#__PURE__*/React.createElement(\"input\", {\n ref: function ref(el) {\n return _this4.fileInput = el;\n },\n type: \"file\",\n onChange: this.onFileSelect,\n multiple: this.props.multiple,\n accept: this.props.accept,\n disabled: this.chooseDisabled()\n }), IconUtils.getJSXIcon(icon || 'pi pi-fw pi-plus', {\n className: 'p-button-icon p-button-icon-left p-clickable'\n }, {\n props: this.props\n }), label, /*#__PURE__*/React.createElement(Ripple, null));\n }\n }, {\n key: \"renderFile\",\n value: function renderFile(file, index) {\n var _this5 = this;\n\n var preview = this.isImage(file) ? /*#__PURE__*/React.createElement(\"div\", null, /*#__PURE__*/React.createElement(\"img\", {\n alt: file.name,\n role: \"presentation\",\n src: file.objectURL,\n width: this.props.previewWidth\n })) : null;\n var fileName = /*#__PURE__*/React.createElement(\"div\", {\n className: \"p-fileupload-filename\"\n }, file.name);\n var size = /*#__PURE__*/React.createElement(\"div\", null, this.formatSize(file.size));\n var removeButton = /*#__PURE__*/React.createElement(\"div\", null, /*#__PURE__*/React.createElement(Button, {\n type: \"button\",\n icon: \"pi pi-times\",\n onClick: function onClick(e) {\n return _this5.remove(e, index);\n }\n }));\n var content = /*#__PURE__*/React.createElement(React.Fragment, null, preview, fileName, size, removeButton);\n\n if (this.props.itemTemplate) {\n var defaultContentOptions = {\n onRemove: function onRemove(event) {\n return _this5.remove(event, index);\n },\n previewElement: preview,\n fileNameElement: fileName,\n sizeElement: size,\n removeElement: removeButton,\n formatSize: this.formatSize(file.size),\n files: this.state.files,\n index: index,\n element: content,\n props: this.props\n };\n content = ObjectUtils.getJSXElement(this.props.itemTemplate, file, defaultContentOptions);\n }\n\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"p-fileupload-row\",\n key: file.name + file.type + file.size\n }, content);\n }\n }, {\n key: \"renderFiles\",\n value: function renderFiles() {\n var _this6 = this;\n\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"p-fileupload-files\"\n }, this.state.files.map(function (file, index) {\n return _this6.renderFile(file, index);\n }));\n }\n }, {\n key: \"renderEmptyContent\",\n value: function renderEmptyContent() {\n if (this.props.emptyTemplate && !this.hasFiles()) {\n return ObjectUtils.getJSXElement(this.props.emptyTemplate, this.props);\n }\n\n return null;\n }\n }, {\n key: \"renderProgressBarContent\",\n value: function renderProgressBarContent() {\n if (this.props.progressBarTemplate) {\n return ObjectUtils.getJSXElement(this.props.progressBarTemplate, this.props);\n }\n\n return /*#__PURE__*/React.createElement(ProgressBar, {\n value: this.state.progress,\n showValue: false\n });\n }\n }, {\n key: \"renderAdvanced\",\n value: function renderAdvanced() {\n var _this7 = this;\n\n var className = classNames('p-fileupload p-fileupload-advanced p-component', this.props.className);\n var headerClassName = classNames('p-fileupload-buttonbar', this.props.headerClassName);\n var contentClassName = classNames('p-fileupload-content', this.props.contentClassName);\n var uploadButton, cancelButton, filesList, progressBar;\n var chooseButton = this.renderChooseButton();\n var emptyContent = this.renderEmptyContent();\n\n if (!this.props.auto) {\n var uploadOptions = this.props.uploadOptions;\n var cancelOptions = this.props.cancelOptions;\n var uploadLabel = !uploadOptions.iconOnly ? this.uploadButtonLabel() : '';\n var cancelLabel = !cancelOptions.iconOnly ? this.cancelButtonLabel() : '';\n uploadButton = /*#__PURE__*/React.createElement(Button, {\n type: \"button\",\n label: uploadLabel,\n icon: uploadOptions.icon || 'pi pi-upload',\n onClick: this.upload,\n disabled: this.uploadDisabled(),\n style: uploadOptions.style,\n className: uploadOptions.className\n });\n cancelButton = /*#__PURE__*/React.createElement(Button, {\n type: \"button\",\n label: cancelLabel,\n icon: cancelOptions.icon || 'pi pi-times',\n onClick: this.clear,\n disabled: this.cancelDisabled(),\n style: cancelOptions.style,\n className: cancelOptions.className\n });\n }\n\n if (this.hasFiles()) {\n filesList = this.renderFiles();\n progressBar = this.renderProgressBarContent();\n }\n\n var header = /*#__PURE__*/React.createElement(\"div\", {\n className: headerClassName,\n style: this.props.headerStyle\n }, chooseButton, uploadButton, cancelButton);\n\n if (this.props.headerTemplate) {\n var defaultContentOptions = {\n className: headerClassName,\n chooseButton: chooseButton,\n uploadButton: uploadButton,\n cancelButton: cancelButton,\n element: header,\n props: this.props\n };\n header = ObjectUtils.getJSXElement(this.props.headerTemplate, defaultContentOptions);\n }\n\n return /*#__PURE__*/React.createElement(\"div\", {\n id: this.props.id,\n className: className,\n style: this.props.style\n }, header, /*#__PURE__*/React.createElement(\"div\", {\n ref: function ref(el) {\n _this7.content = el;\n },\n className: contentClassName,\n style: this.props.contentStyle,\n onDragEnter: this.onDragEnter,\n onDragOver: this.onDragOver,\n onDragLeave: this.onDragLeave,\n onDrop: this.onDrop\n }, progressBar, /*#__PURE__*/React.createElement(Messages, {\n ref: function ref(el) {\n return _this7.messagesUI = el;\n }\n }), filesList, emptyContent));\n }\n }, {\n key: \"renderBasic\",\n value: function renderBasic() {\n var _this8 = this;\n\n var hasFiles = this.hasFiles();\n var chooseOptions = this.props.chooseOptions;\n var className = classNames('p-fileupload p-fileupload-basic p-component', this.props.className);\n var buttonClassName = classNames('p-button p-component p-fileupload-choose', {\n 'p-fileupload-choose-selected': hasFiles,\n 'p-disabled': this.props.disabled,\n 'p-focus': this.state.focused\n }, chooseOptions.className);\n var chooseIcon = chooseOptions.icon || classNames({\n 'pi pi-plus': !chooseOptions.icon && (!hasFiles || this.props.auto),\n 'pi pi-upload': !chooseOptions.icon && hasFiles && !this.props.auto\n });\n var labelClassName = 'p-button-label p-clickable';\n var chooseLabel = chooseOptions.iconOnly ? /*#__PURE__*/React.createElement(\"span\", {\n className: labelClassName,\n dangerouslySetInnerHTML: {\n __html: \"&nbsp;\"\n }\n }) : /*#__PURE__*/React.createElement(\"span\", {\n className: labelClassName\n }, this.chooseButtonLabel());\n var label = this.props.auto ? chooseLabel : /*#__PURE__*/React.createElement(\"span\", {\n className: labelClassName\n }, hasFiles ? this.state.files[0].name : chooseLabel);\n var icon = IconUtils.getJSXIcon(chooseIcon, {\n className: 'p-button-icon p-button-icon-left'\n }, {\n props: this.props,\n hasFiles: hasFiles\n });\n return /*#__PURE__*/React.createElement(\"div\", {\n className: className,\n style: this.props.style\n }, /*#__PURE__*/React.createElement(Messages, {\n ref: function ref(el) {\n return _this8.messagesUI = el;\n }\n }), /*#__PURE__*/React.createElement(\"span\", {\n className: buttonClassName,\n style: chooseOptions.style,\n onMouseUp: this.onSimpleUploaderClick,\n onKeyDown: this.onKeyDown,\n onFocus: this.onFocus,\n onBlur: this.onBlur,\n tabIndex: 0\n }, icon, label, !hasFiles && /*#__PURE__*/React.createElement(\"input\", {\n ref: function ref(el) {\n return _this8.fileInput = el;\n },\n type: \"file\",\n accept: this.props.accept,\n multiple: this.props.multiple,\n disabled: this.props.disabled,\n onChange: this.onFileSelect\n }), /*#__PURE__*/React.createElement(Ripple, null)));\n }\n }, {\n key: \"render\",\n value: function render() {\n if (this.props.mode === 'advanced') return this.renderAdvanced();else if (this.props.mode === 'basic') return this.renderBasic();\n }\n }]);\n\n return FileUpload;\n}(Component);\n\n_defineProperty(FileUpload, \"defaultProps\", {\n id: null,\n name: null,\n url: null,\n mode: 'advanced',\n multiple: false,\n accept: null,\n disabled: false,\n auto: false,\n maxFileSize: null,\n invalidFileSizeMessageSummary: '{0}: Invalid file size, ',\n invalidFileSizeMessageDetail: 'maximum upload size is {0}.',\n style: null,\n className: null,\n widthCredentials: false,\n previewWidth: 50,\n chooseLabel: null,\n uploadLabel: null,\n cancelLabel: null,\n chooseOptions: {\n label: null,\n icon: null,\n iconOnly: false,\n className: null,\n style: null\n },\n uploadOptions: {\n label: null,\n icon: null,\n iconOnly: false,\n className: null,\n style: null\n },\n cancelOptions: {\n label: null,\n icon: null,\n iconOnly: false,\n className: null,\n style: null\n },\n customUpload: false,\n headerClassName: null,\n headerStyle: null,\n contentClassName: null,\n contentStyle: null,\n headerTemplate: null,\n itemTemplate: null,\n emptyTemplate: null,\n progressBarTemplate: null,\n onBeforeUpload: null,\n onBeforeSend: null,\n onUpload: null,\n onError: null,\n onClear: null,\n onSelect: null,\n onProgress: null,\n onValidationFail: null,\n uploadHandler: null,\n onRemove: null\n});\n\nexport { FileUpload };\n"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,S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