{"version":3,"names":[],"mappings":"","sources":["vendor/bs-filestyle.js"],"sourcesContent":["/*!\r\n * bootstrap-fileinput v5.1.5\r\n * http://plugins.krajee.com/file-input\r\n *\r\n * Author: Kartik Visweswaran\r\n * Copyright: 2014 - 2021, Kartik Visweswaran, Krajee.com\r\n *\r\n * Licensed under the BSD-3-Clause\r\n * https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md\r\n */\r\n!function (e) {\r\n \"use strict\";\r\n \"function\" == typeof define && define.amd ? define([\"jquery\"], e) : \"object\" == typeof module && module.exports ? module.exports = e(require(\"jquery\")) : e(window.jQuery)\r\n}(function (L) {\r\n \"use strict\";\r\n var N, c;\r\n L.fn.fileinputLocales = {}, L.fn.fileinputThemes = {}, String.prototype.setTokens = function (e) {\r\n var t, i, a = this.toString();\r\n for (t in e) e.hasOwnProperty(t) && (i = new RegExp(\"{\" + t + \"}\", \"g\"), a = a.replace(i, e[t]));\r\n return a\r\n }, Array.prototype.flatMap || (Array.prototype.flatMap = function (e) {\r\n return [].concat(this.map(e))\r\n }), N = {\r\n FRAMES: \".kv-preview-thumb\",\r\n SORT_CSS: \"file-sortable\",\r\n INIT_FLAG: \"init-\",\r\n OBJECT_PARAMS: '\\n\\n\\n\\n\\n\\n',\r\n DEFAULT_PREVIEW: '
\\n{previewFileIcon}\\n
',\r\n MODAL_ID: \"kvFileinputModal\",\r\n MODAL_EVENTS: [\"show\", \"shown\", \"hide\", \"hidden\", \"loaded\"],\r\n logMessages: {\r\n ajaxError: \"{status}: {error}. Error Details: {text}.\",\r\n badDroppedFiles: \"Error scanning dropped files!\",\r\n badExifParser: \"Error loading the piexif.js library. {details}\",\r\n badInputType: 'The input \"type\" must be set to \"file\" for initializing the \"bootstrap-fileinput\" plugin.',\r\n exifWarning: 'To avoid this warning, either set \"autoOrientImage\" to \"false\" OR ensure you have loaded the \"piexif.js\" library correctly on your page before the \"fileinput.js\" script.',\r\n invalidChunkSize: 'Invalid upload chunk size: \"{chunkSize}\". Resumable uploads are disabled.',\r\n invalidThumb: 'Invalid thumb frame with id: \"{id}\".',\r\n noResumableSupport: \"The browser does not support resumable or chunk uploads.\",\r\n noUploadUrl: 'The \"uploadUrl\" is not set. Ajax uploads and resumable uploads have been disabled.',\r\n retryStatus: \"Retrying upload for chunk # {chunk} for {filename}... retry # {retry}.\",\r\n chunkQueueError: \"Could not push task to ajax pool for chunk index # {index}.\",\r\n resumableMaxRetriesReached: \"Maximum resumable ajax retries ({n}) reached.\",\r\n resumableRetryError: \"Could not retry the resumable request (try # {n})... aborting.\",\r\n resumableAborting: \"Aborting / cancelling the resumable request.\",\r\n resumableRequestError: \"Error processing resumable request. {msg}\"\r\n },\r\n objUrl: window.URL || window.webkitURL,\r\n now: function () {\r\n return (new Date).getTime()\r\n },\r\n round: function (e) {\r\n return e = parseFloat(e), isNaN(e) ? 0 : Math.floor(Math.round(e))\r\n },\r\n getArray: function (e) {\r\n for (var t = [], i = e && e.length || 0, a = 0; a < i; a++) t.push(e[a]);\r\n return t\r\n },\r\n getFileRelativePath: function (e) {\r\n return String(e.newPath || e.relativePath || e.webkitRelativePath || N.getFileName(e) || null)\r\n },\r\n getFileId: function (e, t) {\r\n var i = N.getFileRelativePath(e);\r\n return \"function\" == typeof t ? t(e) : e && i ? e.size + \"_\" + encodeURIComponent(i).replace(/%/g, \"_\") : null\r\n },\r\n getFrameSelector: function (e, t) {\r\n return '[id=\"' + e + '\"]' + (t = t || \"\")\r\n },\r\n getZoomSelector: function (e, t) {\r\n return N.getFrameSelector(\"zoom-\" + e, t)\r\n },\r\n getFrameElement: function (e, t, i) {\r\n return e.find(N.getFrameSelector(t, i))\r\n },\r\n getZoomElement: function (e, t, i) {\r\n return e.find(N.getZoomSelector(t, i))\r\n },\r\n getElapsed: function (e) {\r\n var t = e, i = \"\", a = {},\r\n r = {year: 31536e3, month: 2592e3, week: 604800, day: 86400, hour: 3600, minute: 60, second: 1};\r\n return N.getObjectKeys(r).forEach(function (e) {\r\n a[e] = Math.floor(t / r[e]), t -= a[e] * r[e]\r\n }), L.each(a, function (e, t) {\r\n 0 < t && (i += (i ? \" \" : \"\") + t + e.substring(0, 1))\r\n }), i\r\n },\r\n debounce: function (i, a) {\r\n var r;\r\n return function () {\r\n var e = arguments, t = this;\r\n clearTimeout(r), r = setTimeout(function () {\r\n i.apply(t, e)\r\n }, a)\r\n }\r\n },\r\n stopEvent: function (e) {\r\n e.stopPropagation(), e.preventDefault()\r\n },\r\n getFileName: function (e) {\r\n return e && (e.fileName || e.name) || \"\"\r\n },\r\n createObjectURL: function (e) {\r\n return N.objUrl && N.objUrl.createObjectURL && e ? N.objUrl.createObjectURL(e) : \"\"\r\n },\r\n revokeObjectURL: function (e) {\r\n N.objUrl && N.objUrl.revokeObjectURL && e && N.objUrl.revokeObjectURL(e)\r\n },\r\n compare: function (e, t, i) {\r\n return void 0 !== e && (i ? e === t : e.match(t))\r\n },\r\n isIE: function (e) {\r\n var t;\r\n return \"Microsoft Internet Explorer\" === navigator.appName && (10 === e ? new RegExp(\"msie\\\\s\" + e, \"i\").test(navigator.userAgent) : ((t = document.createElement(\"div\")).innerHTML = \"\\x3c!--[if IE \" + e + \"]> > 4) {\r\n case 0:\r\n case 1:\r\n case 2:\r\n case 3:\r\n case 4:\r\n case 5:\r\n case 6:\r\n case 7:\r\n n += String.fromCharCode(t);\r\n break;\r\n case 12:\r\n case 13:\r\n i = r[o++], n += String.fromCharCode((31 & t) << 6 | 63 & i);\r\n break;\r\n case 14:\r\n i = r[o++], a = r[o++], n += String.fromCharCode((15 & t) << 12 | (63 & i) << 6 | (63 & a) << 0)\r\n }\r\n return n\r\n },\r\n isHtml: function (e) {\r\n var t = document.createElement(\"div\");\r\n t.innerHTML = e;\r\n for (var i = t.childNodes, a = i.length; a--;) if (1 === i[a].nodeType) return !0;\r\n return !1\r\n },\r\n isSvg: function (e) {\r\n return e.match(/^\\s*<\\?xml/i) && (e.match(/\" + e + \"\" + t + \">\"))\r\n },\r\n uniqId: function () {\r\n return ((new Date).getTime() + Math.floor(Math.random() * Math.pow(10, 15))).toString(36)\r\n },\r\n cspBuffer: {\r\n CSP_ATTRIB: \"data-csp-01928735\", domElementsStyles: {}, stash: function (e) {\r\n var n = this, t = L.parseHTML(\"
\" + e + \"
\"), e = L(t);\r\n return e.find(\"[style]\").each(function (e, t) {\r\n var i = L(t), a = i[0].style, t = N.uniqId(), r = {};\r\n a && a.length && (L(a).each(function () {\r\n r[this] = a[this]\r\n }), n.domElementsStyles[t] = r, i.removeAttr(\"style\").attr(n.CSP_ATTRIB, t))\r\n }), e.filter(\"*\").removeAttr(\"style\"), (Object.values ? Object.values(t) : Object.keys(t).map(function (e) {\r\n return t[e]\r\n })).flatMap(function (e) {\r\n return e.innerHTML\r\n }).join(\"\")\r\n }, apply: function (e) {\r\n var a = this;\r\n L(e).find(\"[\" + a.CSP_ATTRIB + \"]\").each(function (e, t) {\r\n var i = L(t), t = i.attr(a.CSP_ATTRIB), t = a.domElementsStyles[t];\r\n t && i.css(t), i.removeAttr(a.CSP_ATTRIB)\r\n }), a.domElementsStyles = {}\r\n }\r\n },\r\n setHtml: function (e, t) {\r\n var i = N.cspBuffer;\r\n return e.html(i.stash(t)), i.apply(e), e\r\n },\r\n htmlEncode: function (e, t) {\r\n return void 0 === e ? t || null : e.replace(/&/g, \"&\").replace(//g, \">\").replace(/\"/g, \""\").replace(/'/g, \"'\")\r\n },\r\n replaceTags: function (e, t) {\r\n var i = e;\r\n return t && L.each(t, function (e, t) {\r\n \"function\" == typeof t && (t = t()), i = i.split(e).join(t)\r\n }), i\r\n },\r\n cleanMemory: function (e) {\r\n e = (e.is(\"img\") ? e : e.find(\"source\")).attr(\"src\");\r\n N.revokeObjectURL(e)\r\n },\r\n findFileName: function (e) {\r\n var t = e.lastIndexOf(\"/\");\r\n return -1 === t && (t = e.lastIndexOf(\"\\\\\")), e.split(e.substring(t, t + 1)).pop()\r\n },\r\n checkFullScreen: function () {\r\n return document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement\r\n },\r\n toggleFullScreen: function (e) {\r\n var t = document, i = t.documentElement, a = N.checkFullScreen();\r\n i && e && !a ? i.requestFullscreen ? i.requestFullscreen() : i.msRequestFullscreen ? i.msRequestFullscreen() : i.mozRequestFullScreen ? i.mozRequestFullScreen() : i.webkitRequestFullscreen && i.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : a && (t.exitFullscreen ? t.exitFullscreen() : t.msExitFullscreen ? t.msExitFullscreen() : t.mozCancelFullScreen ? t.mozCancelFullScreen() : t.webkitExitFullscreen && t.webkitExitFullscreen())\r\n },\r\n moveArray: function (e, t, i, a) {\r\n var r = L.extend(!0, [], e);\r\n if (a && r.reverse(), i >= r.length) for (var n = i - r.length; 1 + n--;) r.push(void 0);\r\n return r.splice(i, 0, r.splice(t, 1)[0]), a && r.reverse(), r\r\n },\r\n closeButton: function (e) {\r\n return ''\r\n },\r\n getRotation: function (e) {\r\n switch (e) {\r\n case 2:\r\n return \"rotateY(180deg)\";\r\n case 3:\r\n return \"rotate(180deg)\";\r\n case 4:\r\n return \"rotate(180deg) rotateY(180deg)\";\r\n case 5:\r\n return \"rotate(270deg) rotateY(180deg)\";\r\n case 6:\r\n return \"rotate(90deg)\";\r\n case 7:\r\n return \"rotate(90deg) rotateY(180deg)\";\r\n case 8:\r\n return \"rotate(270deg)\";\r\n default:\r\n return \"\"\r\n }\r\n },\r\n setTransform: function (e, t) {\r\n e && (e.style.transform = t, e.style.webkitTransform = t, e.style[\"-moz-transform\"] = t, e.style[\"-ms-transform\"] = t, e.style[\"-o-transform\"] = t)\r\n },\r\n getObjectKeys: function (e) {\r\n var t = [];\r\n return e && L.each(e, function (e) {\r\n t.push(e)\r\n }), t\r\n },\r\n getObjectSize: function (e) {\r\n return N.getObjectKeys(e).length\r\n },\r\n whenAll: function (e) {\r\n for (var t, i, a, r = [].slice, n = 1 === arguments.length && N.isArray(e) ? e : r.call(arguments), o = L.Deferred(), s = 0, l = n.length, d = l, c = i = a = Array(l), u = function (e, t, i) {\r\n return function () {\r\n i !== n && s++, o.notifyWith(t[e] = this, i[e] = r.call(arguments)), --d || o[(s ? \"reject\" : \"resolve\") + \"With\"](t, i)\r\n }\r\n }, p = 0; p < l; p++) (t = n[p]) && L.isFunction(t.promise) ? t.promise().done(u(p, a, n)).fail(u(p, c, i)) : (o.notifyWith(this, t), --d);\r\n return d || o.resolveWith(a, n), o.promise()\r\n }\r\n }, (c = function (e, t) {\r\n var i = this;\r\n i.$element = L(e), i.$parent = i.$element.parent(), i._validate() && (i.isPreviewable = N.hasFileAPISupport(), i.isIE9 = N.isIE(9), i.isIE10 = N.isIE(10), (i.isPreviewable || i.isIE9) && (i._init(t), i._listen()), i.$element.removeClass(\"file-loading\"))\r\n }).prototype = {\r\n constructor: c, _cleanup: function () {\r\n var e = this;\r\n e.reader = null, e.clearFileStack(), e.fileBatchCompleted = !0, e.isError = !1, e.isDuplicateError = !1, e.isPersistentError = !1, e.cancelling = !1, e.paused = !1, e.lastProgress = 0, e._initAjax()\r\n }, _isAborted: function () {\r\n return this.cancelling || this.paused\r\n }, _initAjax: function () {\r\n var i = this.taskManager = {\r\n pool: {}, addPool: function (e) {\r\n return i.pool[e] = new i.TasksPool(e)\r\n }, getPool: function (e) {\r\n return i.pool[e]\r\n }, addTask: function (e, t) {\r\n return new i.Task(e, t)\r\n }, TasksPool: function (e) {\r\n var c = this;\r\n c.id = e, c.cancelled = !1, c.cancelledDeferrer = L.Deferred(), c.tasks = {}, c.addTask = function (e, t) {\r\n return c.tasks[e] = new i.Task(e, t)\r\n }, c.size = function () {\r\n return N.getObjectSize(c.tasks)\r\n }, c.run = function (e) {\r\n var t, i, a, r = 0, n = !1, o = N.getObjectKeys(c.tasks).map(function (e) {\r\n return c.tasks[e]\r\n }), s = [], l = L.Deferred();\r\n if (c.cancelled) return c.cancelledDeferrer.resolve(), l.reject();\r\n if (!e) {\r\n var d = N.getObjectKeys(c.tasks).map(function (e) {\r\n return c.tasks[e].deferred\r\n });\r\n return N.whenAll(d).done(function () {\r\n var e = N.getArray(arguments);\r\n c.cancelled ? (l.reject.apply(null, e), c.cancelledDeferrer.resolve()) : (l.resolve.apply(null, e), c.cancelledDeferrer.reject())\r\n }).fail(function () {\r\n var e = N.getArray(arguments);\r\n l.reject.apply(null, e), c.cancelled ? c.cancelledDeferrer.resolve() : c.cancelledDeferrer.reject()\r\n }), L.each(c.tasks, function (e) {\r\n (t = c.tasks[e]).run()\r\n }), l\r\n }\r\n for (i = function (e) {\r\n L.when(e.deferred).fail(function () {\r\n n = !0, a.apply(null, arguments)\r\n }).always(a)\r\n }, a = function () {\r\n var e = N.getArray(arguments);\r\n if (l.notify(e), s.push(e), c.cancelled) return l.reject.apply(null, s), void c.cancelledDeferrer.resolve();\r\n s.length === c.size() && (n ? l.reject : l.resolve).apply(null, s), o.length && (t = o.shift(), i(t), t.run())\r\n }; o.length && r++ < e;) t = o.shift(), i(t), t.run();\r\n return l\r\n }, c.cancel = function () {\r\n return c.cancelled = !0, c.cancelledDeferrer\r\n }\r\n }, Task: function (e, t) {\r\n var i = this;\r\n i.id = e, i.deferred = L.Deferred(), i.logic = t, i.context = null, i.run = function () {\r\n var e = N.getArray(arguments);\r\n return e.unshift(i.deferred), t.apply(i.context, e), i.deferred\r\n }, i.runWithContext = function (e) {\r\n return i.context = e, i.run()\r\n }\r\n }\r\n };\r\n this.ajaxQueue = [], this.ajaxRequests = [], this.ajaxAborted = !1\r\n }, _init: function (e, t) {\r\n var i, a, r = this, n = r.$element;\r\n r.options = e, r.canOrientImage = N.canOrientImage(n), L.each(e, function (e, t) {\r\n switch (e) {\r\n case\"minFileCount\":\r\n case\"maxFileCount\":\r\n case\"maxTotalFileCount\":\r\n case\"minFileSize\":\r\n case\"maxFileSize\":\r\n case\"maxFilePreviewSize\":\r\n case\"resizeImageQuality\":\r\n case\"resizeIfSizeMoreThan\":\r\n case\"progressUploadThreshold\":\r\n case\"initialPreviewCount\":\r\n case\"zoomModalHeight\":\r\n case\"minImageHeight\":\r\n case\"maxImageHeight\":\r\n case\"minImageWidth\":\r\n case\"maxImageWidth\":\r\n r[e] = N.getNum(t);\r\n break;\r\n default:\r\n r[e] = t\r\n }\r\n }), 0 < r.maxTotalFileCount && r.maxTotalFileCount < r.maxFileCount && (r.maxTotalFileCount = r.maxFileCount), r.rtl && (a = r.previewZoomButtonIcons.prev, r.previewZoomButtonIcons.prev = r.previewZoomButtonIcons.next, r.previewZoomButtonIcons.next = a), !isNaN(r.maxAjaxThreads) && r.maxAjaxThreads < r.resumableUploadOptions.maxThreads && (r.resumableUploadOptions.maxThreads = r.maxAjaxThreads), r._initFileManager(), \"function\" == typeof r.autoOrientImage && (r.autoOrientImage = r.autoOrientImage()), \"function\" == typeof r.autoOrientImageInitial && (r.autoOrientImageInitial = r.autoOrientImageInitial()), t || r._cleanup(), r.duplicateErrors = [], r.$form = n.closest(\"form\"), r._initTemplateDefaults(), r.uploadFileAttr = N.isEmpty(n.attr(\"name\")) ? \"file_data\" : n.attr(\"name\"), i = r._getLayoutTemplate(\"progress\"), r.progressTemplate = i.replace(\"{class}\", r.progressClass), r.progressInfoTemplate = i.replace(\"{class}\", r.progressInfoClass), r.progressPauseTemplate = i.replace(\"{class}\", r.progressPauseClass), r.progressCompleteTemplate = i.replace(\"{class}\", r.progressCompleteClass), r.progressErrorTemplate = i.replace(\"{class}\", r.progressErrorClass), r.isDisabled = n.attr(\"disabled\") || n.attr(\"readonly\"), r.isDisabled && n.attr(\"disabled\", !0), r.isClickable = r.browseOnZoneClick && r.showPreview && (r.dropZoneEnabled || !N.isEmpty(r.defaultPreviewContent)), r.isAjaxUpload = N.hasFileUploadSupport() && !N.isEmpty(r.uploadUrl), r.dropZoneEnabled = N.hasDragDropSupport() && r.dropZoneEnabled, r.isAjaxUpload || (r.dropZoneEnabled = r.dropZoneEnabled && N.canAssignFilesToInput()), r.slug = \"function\" == typeof e.slugCallback ? e.slugCallback : r._slugDefault, r.mainTemplate = r.showCaption ? r._getLayoutTemplate(\"main1\") : r._getLayoutTemplate(\"main2\"), r.captionTemplate = r._getLayoutTemplate(\"caption\"), r.previewGenericTemplate = r._getPreviewTemplate(\"generic\"), !r.imageCanvas && r.resizeImage && (r.maxImageWidth || r.maxImageHeight) && (r.imageCanvas = document.createElement(\"canvas\"), r.imageCanvasContext = r.imageCanvas.getContext(\"2d\")), N.isEmpty(n.attr(\"id\")) && n.attr(\"id\", N.uniqId()), r.namespace = \".fileinput_\" + n.attr(\"id\").replace(/-/g, \"_\"), void 0 === r.$container ? r.$container = r._createContainer() : r._refreshContainer(), a = r.$container, r.$dropZone = a.find(\".file-drop-zone\"), r.$progress = a.find(\".kv-upload-progress\"), r.$btnUpload = a.find(\".fileinput-upload\"), r.$captionContainer = N.getElement(e, \"elCaptionContainer\", a.find(\".file-caption\")), r.$caption = N.getElement(e, \"elCaptionText\", a.find(\".file-caption-name\")), N.isEmpty(r.msgPlaceholder) || (i = n.attr(\"multiple\") ? r.filePlural : r.fileSingle, r.$caption.attr(\"placeholder\", r.msgPlaceholder.replace(\"{files}\", i))), r.$captionIcon = r.$captionContainer.find(\".file-caption-icon\"), r.$previewContainer = N.getElement(e, \"elPreviewContainer\", a.find(\".file-preview\")), r.$preview = N.getElement(e, \"elPreviewImage\", a.find(\".file-preview-thumbnails\")), r.$previewStatus = N.getElement(e, \"elPreviewStatus\", a.find(\".file-preview-status\")), r.$errorContainer = N.getElement(e, \"elErrorContainer\", r.$previewContainer.find(\".kv-fileinput-error\")), r._validateDisabled(), N.isEmpty(r.msgErrorClass) || N.addCss(r.$errorContainer, r.msgErrorClass), t ? r._errorsExist() || r.$errorContainer.hide() : (r._resetErrors(), r.$errorContainer.hide(), r.previewInitId = \"thumb-\" + n.attr(\"id\"), r._initPreviewCache(), r._initPreview(!0), r._initPreviewActions(), r.$parent.hasClass(\"file-loading\") && (r.$container.insertBefore(r.$parent), r.$parent.remove())), r._setFileDropZoneTitle(), n.attr(\"disabled\") && r.disable(), r._initZoom(), r.hideThumbnailContent && N.addCss(r.$preview, \"hide-content\")\r\n }, _initFileManager: function () {\r\n var d = this;\r\n d.uploadStartTime = N.now(), d.fileManager = {\r\n stack: {},\r\n filesProcessed: [],\r\n errors: [],\r\n loadedImages: {},\r\n totalImages: 0,\r\n totalFiles: null,\r\n totalSize: null,\r\n uploadedSize: 0,\r\n stats: {},\r\n bpsLog: [],\r\n bps: 0,\r\n initStats: function (e) {\r\n var t = {started: N.now()};\r\n e ? d.fileManager.stats[e] = t : d.fileManager.stats = t\r\n },\r\n getUploadStats: function (e, t, i) {\r\n var n = d.fileManager, a = e ? n.stats[e] && n.stats[e].started || N.now() : d.uploadStartTime,\r\n r = (N.now() - a) / 1e3, o = Math.ceil(r ? t / r : 0), s = i - t,\r\n l = n.bpsLog.length ? d.bitrateUpdateDelay : 0;\r\n return setTimeout(function () {\r\n var e, t, i, a = 0, r = 0;\r\n for (n.bpsLog.push(o), n.bpsLog.sort(function (e, t) {\r\n return e - t\r\n }), i = 10 < (t = n.bpsLog.length) ? t - 10 : Math.ceil(t / 2), e = t; i < e; e--) r = parseFloat(n.bpsLog[e]), a++;\r\n n.bps = 64 * (0 < a ? r / a : 0)\r\n }, l), s = {\r\n fileId: e,\r\n started: a,\r\n elapsed: r,\r\n loaded: t,\r\n total: i,\r\n bps: n.bps,\r\n bitrate: d._getSize(n.bps, [\"B/s\", \"KB/s\", \"MB/s\", \"GB/s\", \"TB/s\", \"PB/s\", \"EB/s\", \"ZB/s\", \"YB/s\"]),\r\n pendingBytes: s\r\n }, e ? n.stats[e] = s : n.stats = s, s\r\n },\r\n exists: function (e) {\r\n return -1 !== L.inArray(e, d.fileManager.getIdList())\r\n },\r\n count: function () {\r\n return d.fileManager.getIdList().length\r\n },\r\n total: function () {\r\n var e = d.fileManager;\r\n return e.totalFiles || (e.totalFiles = e.count()), e.totalFiles\r\n },\r\n getTotalSize: function () {\r\n var i = d.fileManager;\r\n return i.totalSize || (i.totalSize = 0, L.each(d.getFileStack(), function (e, t) {\r\n t = parseFloat(t.size);\r\n i.totalSize += isNaN(t) ? 0 : t\r\n }), i.totalSize)\r\n },\r\n add: function (e, t) {\r\n (t = t || d.fileManager.getId(e)) && (d.fileManager.stack[t] = {\r\n file: e,\r\n name: N.getFileName(e),\r\n relativePath: N.getFileRelativePath(e),\r\n size: e.size,\r\n nameFmt: d._getFileName(e, \"\"),\r\n sizeFmt: d._getSize(e.size)\r\n })\r\n },\r\n remove: function (e) {\r\n e = d._getThumbFileId(e);\r\n e && d.fileManager.removeFile(e)\r\n },\r\n removeFile: function (e) {\r\n delete d.fileManager.stack[e], delete d.fileManager.loadedImages[e]\r\n },\r\n move: function (i, a) {\r\n var r = {}, n = d.fileManager.stack;\r\n (i || a) && i !== a && (L.each(n, function (e, t) {\r\n e !== i && (r[e] = t), e === a && (r[i] = n[i])\r\n }), d.fileManager.stack = r)\r\n },\r\n list: function () {\r\n var i = [];\r\n return L.each(d.getFileStack(), function (e, t) {\r\n t && t.file && i.push(t.file)\r\n }), i\r\n },\r\n isPending: function (e) {\r\n return -1 === L.inArray(e, d.fileManager.filesProcessed) && d.fileManager.exists(e)\r\n },\r\n isProcessed: function () {\r\n var t = !0, i = d.fileManager;\r\n return L.each(d.getFileStack(), function (e) {\r\n i.isPending(e) && (t = !1)\r\n }), t\r\n },\r\n clear: function () {\r\n var e = d.fileManager;\r\n d.isDuplicateError = !1, d.isPersistentError = !1, e.totalFiles = null, e.totalSize = null, e.uploadedSize = 0, e.stack = {}, e.errors = [], e.filesProcessed = [], e.stats = {}, e.bpsLog = [], e.bps = 0, e.clearImages()\r\n },\r\n clearImages: function () {\r\n d.fileManager.loadedImages = {}, d.fileManager.totalImages = 0\r\n },\r\n addImage: function (e, t) {\r\n d.fileManager.loadedImages[e] = t\r\n },\r\n removeImage: function (e) {\r\n delete d.fileManager.loadedImages[e]\r\n },\r\n getImageIdList: function () {\r\n return N.getObjectKeys(d.fileManager.loadedImages)\r\n },\r\n getImageCount: function () {\r\n return d.fileManager.getImageIdList().length\r\n },\r\n getId: function (e) {\r\n return d._getFileId(e)\r\n },\r\n getIndex: function (e) {\r\n return d.fileManager.getIdList().indexOf(e)\r\n },\r\n getThumb: function (t) {\r\n var i = null;\r\n return d._getThumbs().each(function () {\r\n var e = L(this);\r\n d._getThumbFileId(e) === t && (i = e)\r\n }), i\r\n },\r\n getThumbIndex: function (e) {\r\n e = d._getThumbFileId(e);\r\n return d.fileManager.getIndex(e)\r\n },\r\n getIdList: function () {\r\n return N.getObjectKeys(d.fileManager.stack)\r\n },\r\n getFile: function (e) {\r\n return d.fileManager.stack[e] || null\r\n },\r\n getFileName: function (e, t) {\r\n e = d.fileManager.getFile(e);\r\n return e ? t ? e.nameFmt || \"\" : e.name || \"\" : \"\"\r\n },\r\n getFirstFile: function () {\r\n var e = d.fileManager.getIdList(), e = e && e.length ? e[0] : null;\r\n return d.fileManager.getFile(e)\r\n },\r\n setFile: function (e, t) {\r\n d.fileManager.getFile(e) ? d.fileManager.stack[e].file = t : d.fileManager.add(t, e)\r\n },\r\n setProcessed: function (e) {\r\n d.fileManager.filesProcessed.push(e)\r\n },\r\n getProgress: function () {\r\n var e = d.fileManager.total(), t = d.fileManager.filesProcessed.length;\r\n return e ? Math.ceil(t / e * 100) : 0\r\n },\r\n setProgress: function (e, t) {\r\n e = d.fileManager.getFile(e);\r\n !isNaN(t) && e && (e.progress = t)\r\n }\r\n }\r\n }, _setUploadData: function (i, e) {\r\n var a = this;\r\n L.each(e, function (e, t) {\r\n e = a.uploadParamNames[e] || e;\r\n N.isArray(t) ? i.append(e, t[0], t[1]) : i.append(e, t)\r\n })\r\n }, _initResumableUpload: function () {\r\n var g, m = this, h = m.resumableUploadOptions, v = N.logMessages, w = m.fileManager;\r\n if (m.enableResumableUpload) {\r\n if (!1 !== h.fallback && \"function\" != typeof h.fallback && (h.fallback = function (e) {\r\n e._log(v.noResumableSupport), e.enableResumableUpload = !1\r\n }), N.hasResumableUploadSupport() || !1 === h.fallback) return !m.uploadUrl && m.enableResumableUpload ? (m._log(v.noUploadUrl), void (m.enableResumableUpload = !1)) : (h.chunkSize = parseFloat(h.chunkSize), h.chunkSize <= 0 || isNaN(h.chunkSize) ? (m._log(v.invalidChunkSize, {chunkSize: h.chunkSize}), void (m.enableResumableUpload = !1)) : void (g = m.resumableManager = {\r\n init: function (e, t, i) {\r\n g.logs = [], g.stack = [], g.error = \"\", g.id = e, g.file = t.file, g.fileName = t.name, g.fileIndex = i, g.completed = !1, g.lastProgress = 0, m.showPreview && (g.$thumb = w.getThumb(e) || null, g.$progress = g.$btnDelete = null, g.$thumb && g.$thumb.length && (g.$progress = g.$thumb.find(\".file-thumb-progress\"), g.$btnDelete = g.$thumb.find(\".kv-file-remove\"))), g.chunkSize = 1024 * h.chunkSize, g.chunkCount = g.getTotalChunks()\r\n }, setAjaxError: function (e, t, i, a) {\r\n e.responseJSON && e.responseJSON.error && (i = e.responseJSON.error.toString()), a || (g.error = i), h.showErrorLog && m._log(v.ajaxError, {\r\n status: e.status,\r\n error: i,\r\n text: e.responseText || \"\"\r\n })\r\n }, reset: function () {\r\n g.stack = [], g.chunksProcessed = {}\r\n }, setProcessed: function (e) {\r\n var t = g.id, i = g.$thumb, a = g.$progress, r = i && i.length,\r\n n = {id: r ? i.attr(\"id\") : \"\", index: w.getIndex(t), fileId: t},\r\n o = m.resumableUploadOptions.skipErrorsAndProceed;\r\n g.completed = !0, g.lastProgress = 0, r && i.removeClass(\"file-uploading\"), \"success\" === e ? (w.uploadedSize += g.file.size, m.showPreview && (m._setProgress(101, a), m._setThumbStatus(i, \"Success\"), m._initUploadSuccess(g.chunksProcessed[t].data, i)), w.removeFile(t), delete g.chunksProcessed[t], m._raise(\"fileuploaded\", [n.id, n.index, n.fileId]), w.isProcessed() && m._setProgress(101)) : \"cancel\" !== e && (m.showPreview && (m._setThumbStatus(i, \"Error\"), m._setPreviewError(i, !0), m._setProgress(101, a, m.msgProgressError), m._setProgress(101, m.$progress, m.msgProgressError), m.cancelling = !o), m.$errorContainer.find('li[data-file-id=\"' + n.fileId + '\"]').length || (i = {\r\n file: g.fileName,\r\n max: h.maxRetries,\r\n error: g.error\r\n }, a = m.msgResumableUploadRetriesExceeded.setTokens(i), L.extend(n, i), m._showFileError(a, n, \"filemaxretries\"), o && (w.removeFile(t), delete g.chunksProcessed[t], w.isProcessed() && m._setProgress(101)))), w.isProcessed() && g.reset()\r\n }, check: function () {\r\n L.each(g.logs, function (e, t) {\r\n if (!t) return !1\r\n })\r\n }, processedResumables: function () {\r\n var e, t = g.logs, i = 0;\r\n if (!t || !t.length) return 0;\r\n for (e = 0; e < t.length; e++) !0 === t[e] && i++;\r\n return i\r\n }, getUploadedSize: function () {\r\n var e = g.processedResumables() * g.chunkSize;\r\n return e > g.file.size ? g.file.size : e\r\n }, getTotalChunks: function () {\r\n var e = parseFloat(g.chunkSize);\r\n return !isNaN(e) && 0 < e ? Math.ceil(g.file.size / e) : 0\r\n }, getProgress: function () {\r\n var e = g.processedResumables(), t = g.chunkCount;\r\n return 0 === t ? 0 : Math.ceil(e / t * 100)\r\n }, checkAborted: function (e) {\r\n m._isAborted() && (clearInterval(e), m.unlock())\r\n }, upload: function () {\r\n var t = w.getIdList(), i = \"new\", a = setInterval(function () {\r\n var e;\r\n g.checkAborted(a), \"new\" === i && (m.lock(), i = \"processing\", e = t.shift(), w.initStats(e), w.stack[e] && (g.init(e, w.stack[e], w.getIndex(e)), g.processUpload())), !w.isPending(e) && g.completed && (i = \"new\"), w.isProcessed() && ((e = m.$preview.find(\".file-preview-initial\")).length && (N.addCss(e, N.SORT_CSS), m._initSortable()), clearInterval(a), m._clearFileInput(), m.unlock(), setTimeout(function () {\r\n var e = m.previewCache.data;\r\n e && (m.initialPreview = e.content, m.initialPreviewConfig = e.config, m.initialPreviewThumbTags = e.tags), m._raise(\"filebatchuploadcomplete\", [m.initialPreview, m.initialPreviewConfig, m.initialPreviewThumbTags, m._getExtraData()])\r\n }, m.processDelay))\r\n }, m.processDelay)\r\n }, uploadResumable: function () {\r\n for (var e = m.taskManager, t = g.chunkCount, i = e.addPool(g.id), a = 0; a < t; a++) g.logs[a] = !(!g.chunksProcessed[g.id] || !g.chunksProcessed[g.id][a]), g.logs[a] || g.pushAjax(a, 0);\r\n i.run(h.maxThreads).done(function () {\r\n g.setProcessed(\"success\")\r\n }).fail(function () {\r\n g.setProcessed(i.cancelled ? \"cancel\" : \"error\")\r\n })\r\n }, processUpload: function () {\r\n var r, e, t, i, a, n, o = g.id;\r\n h.testUrl ? (r = new FormData, a = w.stack[o], m._setUploadData(r, {\r\n fileId: o,\r\n fileName: a.fileName,\r\n fileSize: a.size,\r\n fileRelativePath: a.relativePath,\r\n chunkSize: g.chunkSize,\r\n chunkCount: g.chunkCount\r\n }), e = function (e) {\r\n n = m._getOutData(r, e), m._raise(\"filetestbeforesend\", [o, w, g, n])\r\n }, t = function (e, t, i) {\r\n n = m._getOutData(r, i, e);\r\n var a = m.uploadParamNames.chunksUploaded || \"chunksUploaded\", i = [o, w, g, n];\r\n e[a] && N.isArray(e[a]) ? (g.chunksProcessed[o] || (g.chunksProcessed[o] = {}), L.each(e[a], function (e, t) {\r\n g.logs[t] = !0, g.chunksProcessed[o][t] = !0\r\n }), g.chunksProcessed[o].data = e, m._raise(\"filetestsuccess\", i)) : m._raise(\"filetesterror\", i), g.uploadResumable()\r\n }, i = function (e, t, i) {\r\n n = m._getOutData(r, e), m._raise(\"filetestajaxerror\", [o, w, g, n]), g.setAjaxError(e, t, i, !0), g.uploadResumable()\r\n }, a = function () {\r\n m._raise(\"filetestcomplete\", [o, w, g, m._getOutData(r)])\r\n }, m._ajaxSubmit(e, t, a, i, r, o, g.fileIndex, h.testUrl)) : g.uploadResumable()\r\n }, pushAjax: function (e, t) {\r\n var i = m.taskManager.getPool(g.id);\r\n i.addTask(i.size() + 1, function (e) {\r\n var t = g.stack.shift(), i = t[0];\r\n g.chunksProcessed[g.id] && g.chunksProcessed[g.id][i] ? m._log(v.chunkQueueError, {index: i}) : g.sendAjax(i, t[1], e)\r\n }), g.stack.push([e, t])\r\n }, sendAjax: function (r, n, o) {\r\n function s(e, t) {\r\n t && (e = e.setTokens(t)), e = d.resumableRequestError.setTokens({msg: e}), m._log(e), o.reject(e)\r\n }\r\n\r\n var e = g.chunkSize, l = g.id, t = g.file, i = g.$thumb, d = N.logMessages, a = g.$btnDelete;\r\n if (!g.chunksProcessed[l] || !g.chunksProcessed[l][r]) {\r\n if (n > h.maxRetries) return s(d.resumableMaxRetriesReached, {n: h.maxRetries}), void g.setProcessed(\"error\");\r\n var c,\r\n u = t[t.slice ? \"slice\" : t.mozSlice ? \"mozSlice\" : t.webkitSlice ? \"webkitSlice\" : \"slice\"](e * r, e * (r + 1)),\r\n p = new FormData, f = w.stack[l];\r\n m._setUploadData(p, {\r\n chunkCount: g.chunkCount,\r\n chunkIndex: r,\r\n chunkSize: e,\r\n chunkSizeStart: e * r,\r\n fileBlob: [u, g.fileName],\r\n fileId: l,\r\n fileName: g.fileName,\r\n fileRelativePath: f.relativePath,\r\n fileSize: t.size,\r\n retryCount: n\r\n }), g.$progress && g.$progress.length && g.$progress.show(), e = function (e) {\r\n c = m._getOutData(p, e), m.showPreview && (i.hasClass(\"file-preview-success\") || (m._setThumbStatus(i, \"Loading\"), N.addCss(i, \"file-uploading\")), a.attr(\"disabled\", !0)), m._raise(\"filechunkbeforesend\", [l, r, n, w, g, c])\r\n }, u = function (e, t, i) {\r\n var a;\r\n m._isAborted() ? s(d.resumableAborting) : (c = m._getOutData(p, i, e), a = m.uploadParamNames.chunkIndex || \"chunkIndex\", i = [l, r, n, w, g, c], e.error ? (h.showErrorLog && m._log(v.retryStatus, {\r\n retry: n + 1,\r\n filename: g.fileName,\r\n chunk: r\r\n }), m._raise(\"filechunkerror\", i), g.pushAjax(r, n + 1), g.error = e.error, s(e.error)) : (g.logs[e[a]] = !0, g.chunksProcessed[l] || (g.chunksProcessed[l] = {}), g.chunksProcessed[l][e[a]] = !0, g.chunksProcessed[l].data = e, o.resolve.call(null, e), m._raise(\"filechunksuccess\", i), g.check()))\r\n }, f = function (e, t, i) {\r\n m._isAborted() ? s(d.resumableAborting) : (c = m._getOutData(p, e), g.setAjaxError(e, t, i), m._raise(\"filechunkajaxerror\", [l, r, n, w, g, c]), g.pushAjax(r, n + 1), s(d.resumableRetryError, {n: n - 1}))\r\n }, t = function () {\r\n m._isAborted() || m._raise(\"filechunkcomplete\", [l, r, n, w, g, m._getOutData(p)])\r\n }, m._ajaxSubmit(e, u, t, f, p, l, g.fileIndex)\r\n }\r\n }\r\n }).reset());\r\n h.fallback(m)\r\n }\r\n }, _initTemplateDefaults: function () {\r\n var i = this, e = function (e, t) {\r\n return '\\n\"\r\n }, t = N.closeButton(\"fileinput-remove\"), a = N.MODAL_ID + \"Label\",\r\n r = '',\r\n n = '
\\n
\\n
\\n
{heading}
\\n \\n
{toggleheader}{fullscreen}{borderless}{close}
\\n
\\n
\\n \\n \\n{prev} {next}\\n
\\n
\\n
\\n',\r\n o = \" {style}\", s = e(\"html\", \"text/html\"), l = e(\"text\", \"text/plain;charset=UTF-8\"),\r\n d = e(\"pdf\", \"application/pdf\"),\r\n c = '\\n\",\r\n u = '\",\r\n p = '\",\r\n f = '\\n\",\r\n g = '\\x3c!--suppress ALL --\\x3e\\n\",\r\n m = '