Seditio Source
Root |
./othercms/b2evolution_7.2.3/rsc/js/build/evo_fileuploader.bmin.js
/* This file includes ALL files that are used for quick file uploader */

function base64_decode(e){var t,n,i,o,a,r,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l=0,u=0,d=[];if(!e)return e;for(e+="";t=(r=s.indexOf(e.charAt(l++))<<18|s.indexOf(e.charAt(l++))<<12|(o=s.indexOf(e.charAt(l++)))<<6|(a=s.indexOf(e.charAt(l++))))>>16&255,n=r>>8&255,i=255&r,d[u++]=64==o?String.fromCharCode(t):64==a?String.fromCharCode(t,n):String.fromCharCode(t,n,i),l<e.length;);return d.join("")}function htmlspecialchars_decode(e,t){var n=0,i=0,o=!1;void 0===t&&(t=2),e=e.toString().replace(/&lt;/g,"<").replace(/&gt;/g,">");var a={ENT_NOQUOTES:0,ENT_HTML_QUOTE_SINGLE:1,ENT_HTML_QUOTE_DOUBLE:2,ENT_COMPAT:2,ENT_QUOTES:3,ENT_IGNORE:4};if(0===t&&(o=!0),"number"!=typeof t){for(t=[].concat(t),i=0;i<t.length;i++)0===a[t[i]]?o=!0:a[t[i]]&&(n|=a[t[i]]);t=n}return t&a.ENT_HTML_QUOTE_SINGLE&&(e=e.replace(/&#0*39;/g,"'")),o||(e=e.replace(/&quot;/g,'"')),e=e.replace(/&amp;/g,"&")}!function(global){var qq=function(o){"use strict";return{hide:function(){return o.style.display="none",this},attach:function(e,t){return o.addEventListener?o.addEventListener(e,t,!1):o.attachEvent&&o.attachEvent("on"+e,t),function(){qq(o).detach(e,t)}},detach:function(e,t){return o.removeEventListener?o.removeEventListener(e,t,!1):o.attachEvent&&o.detachEvent("on"+e,t),this},contains:function(e){return!!e&&(o===e||(o.contains?o.contains(e):!!(8&e.compareDocumentPosition(o))))},insertBefore:function(e){return e.parentNode.insertBefore(o,e),this},remove:function(){return o.parentNode.removeChild(o),this},css:function(e){if(null==o.style)throw new qq.Error("Can't apply style to node as it is not on the HTMLElement prototype chain!");return null!=e.opacity&&"string"!=typeof o.style.opacity&&void 0!==o.filters&&(e.filter="alpha(opacity="+Math.round(100*e.opacity)+")"),qq.extend(o.style,e),this},hasClass:function(e,t){var n=new RegExp("(^| )"+e+"( |$)");return n.test(o.className)||!(!t||!n.test(o.parentNode.className))},addClass:function(e){return qq(o).hasClass(e)||(o.className+=" "+e),this},removeClass:function(e){var t=new RegExp("(^| )"+e+"( |$)");return o.className=o.className.replace(t," ").replace(/^\s+|\s+$/g,""),this},getByClass:function(n,e){var t,i=[];return e&&o.querySelector?o.querySelector("."+n):o.querySelectorAll?o.querySelectorAll("."+n):(t=o.getElementsByTagName("*"),qq.each(t,function(e,t){qq(t).hasClass(n)&&i.push(t)}),e?i[0]:i)},getFirstByClass:function(e){return qq(o).getByClass(e,!0)},children:function(){for(var e=[],t=o.firstChild;t;)1===t.nodeType&&e.push(t),t=t.nextSibling;return e},setText:function(e){return o.innerText=e,o.textContent=e,this},clearText:function(){return qq(o).setText("")},hasAttribute:function(e){var t;return o.hasAttribute?!!o.hasAttribute(e)&&null==/^false$/i.exec(o.getAttribute(e)):void 0!==(t=o[e])&&null==/^false$/i.exec(t)}}},DF;function Ux(d,e,t,n,c){var i,p=d.naturalWidth,f=d.naturalHeight,h=n.width,q=n.height,m=t.getContext("2d"),o=new qq.Promise;return m.save(),n.resize?function(e){var t=e.blob,n=e.image,i=e.imageHeight,o=e.imageWidth,a=e.orientation,r=new qq.Promise,s=e.resize,l=document.createElement("canvas"),u=l.getContext("2d"),d=e.canvas,c=e.targetHeight,p=e.targetWidth;return Wx(l,o,i,a),d.height=c,d.width=p,u.drawImage(n,0,0),s({blob:t,height:c,image:n,sourceCanvas:l,targetCanvas:d,width:p}).then(function(){d.qqImageRendered&&d.qqImageRendered(),r.success()},r.failure),r}({blob:e,canvas:t,image:d,imageHeight:f,imageWidth:p,orientation:n.orientation,resize:n.resize,targetHeight:q,targetWidth:h}):(qq.supportedFeatures.unlimitedScaledImageSize||(i=function(e){var t=5241e3;if(!qq.ios())throw new qq.Error("Downsampled dimensions can only be reliably calculated for iOS!");if(e.origHeight*e.origWidth>t)return{newHeight:Math.round(Math.sqrt(t*(e.origHeight/e.origWidth))),newWidth:Math.round(Math.sqrt(t*(e.origWidth/e.origHeight)))}}({origWidth:h,origHeight:q}))&&(qq.log(qq.format("Had to reduce dimensions due to device limitations from {}w / {}h to {}w / {}h",h,q,i.newWidth,i.newHeight),"warn"),h=i.newWidth,q=i.newHeight),Wx(t,h,q,n.orientation),qq.ios()?function(){!function(e){var t,n=e.naturalWidth,i=e.naturalHeight,o=document.createElement("canvas");return 1048576<n*i&&(o.width=o.height=1,(t=o.getContext("2d")).drawImage(e,1-n,0),0===t.getImageData(0,0,1,1).data[3])}(d)||(p/=2,f/=2);var e,t,n,i=1024,o=document.createElement("canvas"),a=c?function(e,t,n){var i,o,a,r=document.createElement("canvas"),s=0,l=n,u=n;for(r.width=1,r.height=n,(i=r.getContext("2d")).drawImage(e,0,0),o=i.getImageData(0,0,1,n).data;s<u;)0===o[4*(u-1)+3]?l=u:s=u,u=l+s>>1;return 0==(a=u/n)?1:a}(d,0,f):1,r=Math.ceil(i*h/p),s=Math.ceil(i*q/f/a),l=0,u=0;for(o.width=o.height=i,e=o.getContext("2d");l<f;){for(n=t=0;t<p;)e.clearRect(0,0,i,i),e.drawImage(d,-t,-l),m.drawImage(o,0,0,i,i,n,u,r,s),t+=i,n+=r;l+=i,u+=s}m.restore(),o=e=null}():m.drawImage(d,0,0,h,q),t.qqImageRendered&&t.qqImageRendered(),o.success(),o)}function Wx(e,t,n,i){switch(i){case 5:case 6:case 7:case 8:e.width=n,e.height=t;break;default:e.width=t,e.height=n}var o=e.getContext("2d");switch(i){case 2:o.translate(t,0),o.scale(-1,1);break;case 3:o.translate(t,n),o.rotate(Math.PI);break;case 4:o.translate(0,n),o.scale(1,-1);break;case 5:o.rotate(.5*Math.PI),o.scale(1,-1);break;case 6:o.rotate(.5*Math.PI),o.translate(0,-n);break;case 7:o.rotate(.5*Math.PI),o.translate(t,-n),o.scale(-1,1);break;case 8:o.rotate(-.5*Math.PI),o.translate(-t,0)}}function Xx(n,e){var i=this;window.Blob&&n instanceof Blob&&function(){var e=new Image,t=window.URL&&window.URL.createObjectURL?window.URL:window.webkitURL&&window.webkitURL.createObjectURL?window.webkitURL:null;if(!t)throw Error("No createObjectURL function found to create blob url");e.src=t.createObjectURL(n),i.blob=n,n=e}(),n.naturalWidth||n.naturalHeight||(n.onload=function(){var n=i.imageLoadListeners;n&&(i.imageLoadListeners=null,setTimeout(function(){for(var e=0,t=n.length;e<t;e++)n[e]()},0))},n.onerror=e,this.imageLoadListeners=[]),this.srcImage=n}!function(){"use strict";var sb;qq.canvasToBlob=function(e,t,n){return qq.dataUriToBlob(e.toDataURL(t,n))},qq.dataUriToBlob=function(e){var t,n,i,o,a,r,s,l;return n=0<=e.split(",")[0].indexOf("base64")?atob(e.split(",")[1]):decodeURI(e.split(",")[1]),o=e.split(",")[0].split(":")[1].split(";")[0],t=new ArrayBuffer(n.length),i=new Uint8Array(t),qq.each(n,function(e,t){i[e]=t.charCodeAt(0)}),a=t,r=o,s=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,(l=s&&new s)?(l.append(a),l.getBlob(r)):new Blob([a],{type:r})},qq.log=function(e,t){window.console&&(t&&"info"!==t?window.console[t]?window.console[t](e):window.console.log("<"+t+"> "+e):window.console.log(e))},qq.isObject=function(e){return e&&!e.nodeType&&"[object Object]"===Object.prototype.toString.call(e)},qq.isFunction=function(e){return"function"==typeof e},qq.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)||e&&window.ArrayBuffer&&e.buffer&&e.buffer.constructor===ArrayBuffer},qq.isItemList=function(e){return"[object DataTransferItemList]"===Object.prototype.toString.call(e)},qq.isNodeList=function(e){return"[object NodeList]"===Object.prototype.toString.call(e)||e.item&&e.namedItem},qq.isString=function(e){return"[object String]"===Object.prototype.toString.call(e)},qq.trimStr=function(e){return String.prototype.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},qq.format=function(e){var t=Array.prototype.slice.call(arguments,1),o=e,a=o.indexOf("{}");return qq.each(t,function(e,t){var n=o.substring(0,a),i=o.substring(a+2);if((a=(o=n+t+i).indexOf("{}",a+t.length))<0)return!1}),o},qq.isFile=function(e){return window.File&&"[object File]"===Object.prototype.toString.call(e)},qq.isFileList=function(e){return window.FileList&&"[object FileList]"===Object.prototype.toString.call(e)},qq.isFileOrInput=function(e){return qq.isFile(e)||qq.isInput(e)},qq.isInput=function(e,n){function t(e){var t=e.toLowerCase();return n?"file"!==t:"file"===t}return!!(window.HTMLInputElement&&"[object HTMLInputElement]"===Object.prototype.toString.call(e)&&e.type&&t(e.type))||!!(e.tagName&&"input"===e.tagName.toLowerCase()&&e.type&&t(e.type))},qq.isBlob=function(e){if(window.Blob&&"[object Blob]"===Object.prototype.toString.call(e))return!0},qq.isXhrUploadSupported=function(){var e=document.createElement("input");return e.type="file",void 0!==e.multiple&&"undefined"!=typeof File&&"undefined"!=typeof FormData&&void 0!==qq.createXhrInstance().upload},qq.createXhrInstance=function(){if(window.XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(e){return qq.log("Neither XHR or ActiveX are supported!","error"),null}},qq.isFolderDropSupported=function(e){return e.items&&0<e.items.length&&e.items[0].webkitGetAsEntry},qq.isFileChunkingSupported=function(){return!qq.androidStock()&&qq.isXhrUploadSupported()&&(void 0!==File.prototype.slice||void 0!==File.prototype.webkitSlice||void 0!==File.prototype.mozSlice)},qq.sliceBlob=function(e,t,n){return(e.slice||e.mozSlice||e.webkitSlice).call(e,t,n)},qq.arrayBufferToHex=function(e){var i="",t=new Uint8Array(e);return qq.each(t,function(e,t){var n=t.toString(16);n.length<2&&(n="0"+n),i+=n}),i},qq.readBlobToHex=function(e,t,n){var i=qq.sliceBlob(e,t,t+n),o=new FileReader,a=new qq.Promise;return o.onload=function(){a.success(qq.arrayBufferToHex(o.result))},o.onerror=a.failure,o.readAsArrayBuffer(i),a},qq.extend=function(n,e,i){return qq.each(e,function(e,t){i&&qq.isObject(t)?(void 0===n[e]&&(n[e]={}),qq.extend(n[e],t,!0)):n[e]=t}),n},qq.override=function(n,e){var i={},t=e(i);return qq.each(t,function(e,t){void 0!==n[e]&&(i[e]=n[e]),n[e]=t}),n},qq.indexOf=function(e,t,n){if(e.indexOf)return e.indexOf(t,n);n=n||0;var i=e.length;for(n<0&&(n+=i);n<i;n+=1)if(e.hasOwnProperty(n)&&e[n]===t)return n;return-1},qq.getUniqueId=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})},qq.ie=function(){return-1!==navigator.userAgent.indexOf("MSIE")||-1!==navigator.userAgent.indexOf("Trident")},qq.ie7=function(){return-1!==navigator.userAgent.indexOf("MSIE 7")},qq.ie8=function(){return-1!==navigator.userAgent.indexOf("MSIE 8")},qq.ie10=function(){return-1!==navigator.userAgent.indexOf("MSIE 10")},qq.ie11=function(){return qq.ie()&&-1!==navigator.userAgent.indexOf("rv:11")},qq.edge=function(){return 0<=navigator.userAgent.indexOf("Edge")},qq.safari=function(){return void 0!==navigator.vendor&&-1!==navigator.vendor.indexOf("Apple")},qq.chrome=function(){return void 0!==navigator.vendor&&-1!==navigator.vendor.indexOf("Google")},qq.opera=function(){return void 0!==navigator.vendor&&-1!==navigator.vendor.indexOf("Opera")},qq.firefox=function(){return!qq.edge()&&!qq.ie11()&&-1!==navigator.userAgent.indexOf("Mozilla")&&void 0!==navigator.vendor&&""===navigator.vendor},qq.windows=function(){return"Win32"===navigator.platform},qq.android=function(){return-1!==navigator.userAgent.toLowerCase().indexOf("android")},qq.androidStock=function(){return qq.android()&&navigator.userAgent.toLowerCase().indexOf("chrome")<0},qq.ios6=function(){return qq.ios()&&-1!==navigator.userAgent.indexOf(" OS 6_")},qq.ios7=function(){return qq.ios()&&-1!==navigator.userAgent.indexOf(" OS 7_")},qq.ios8=function(){return qq.ios()&&-1!==navigator.userAgent.indexOf(" OS 8_")},qq.ios800=function(){return qq.ios()&&-1!==navigator.userAgent.indexOf(" OS 8_0 ")},qq.ios=function(){return-1!==navigator.userAgent.indexOf("iPad")||-1!==navigator.userAgent.indexOf("iPod")||-1!==navigator.userAgent.indexOf("iPhone")},qq.iosChrome=function(){return qq.ios()&&-1!==navigator.userAgent.indexOf("CriOS")},qq.iosSafari=function(){return qq.ios()&&!qq.iosChrome()&&-1!==navigator.userAgent.indexOf("Safari")},qq.iosSafariWebView=function(){return qq.ios()&&!qq.iosChrome()&&!qq.iosSafari()},qq.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},qq.toElement=(sb=document.createElement("div"),function(e){sb.innerHTML=e;var t=sb.firstChild;return sb.removeChild(t),t}),qq.each=function(e,t){var n;if(e)if(window.Storage&&e.constructor===window.Storage)for(n=0;n<e.length&&!1!==t(e.key(n),e.getItem(e.key(n)));n++);else if(qq.isArray(e)||qq.isItemList(e)||qq.isNodeList(e))for(n=0;n<e.length&&!1!==t(n,e[n]);n++);else if(qq.isString(e))for(n=0;n<e.length&&!1!==t(n,e.charAt(n));n++);else for(n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&!1===t(n,e[n]))break},qq.bind=function(t,n){if(qq.isFunction(t)){var i=Array.prototype.slice.call(arguments,2);return function(){var e=qq.extend([],i);return arguments.length&&(e=e.concat(Array.prototype.slice.call(arguments))),t.apply(n,e)}}throw new Error("first parameter must be a function!")},qq.obj2url=function(e,i,t){function n(e,t){var n=i?/\[\]$/.test(i)?i:i+"["+t+"]":t;"undefined"!==n&&"undefined"!==t&&o.push("object"==typeof e?qq.obj2url(e,n,!0):"[object Function]"===Object.prototype.toString.call(e)?encodeURIComponent(n)+"="+encodeURIComponent(e()):encodeURIComponent(n)+"="+encodeURIComponent(e))}var o=[],a="&";return!t&&i?(a=/\?/.test(i)?/\?$/.test(i)?"":"&":"?",o.push(i),o.push(qq.obj2url(e))):"[object Array]"===Object.prototype.toString.call(e)&&void 0!==e?qq.each(e,function(e,t){n(t,e)}):null!=e&&"object"==typeof e?qq.each(e,function(e,t){n(t,e)}):o.push(encodeURIComponent(i)+"="+encodeURIComponent(e)),i?o.join(a):o.join(a).replace(/^&/,"").replace(/%20/g,"+")},qq.obj2FormData=function(e,n,i){return n=n||new FormData,qq.each(e,function(e,t){e=i?i+"["+e+"]":e,qq.isObject(t)?qq.obj2FormData(t,n,e):qq.isFunction(t)?n.append(e,t()):n.append(e,t)}),n},qq.obj2Inputs=function(e,n){var i;return n=n||document.createElement("form"),qq.obj2FormData(e,{append:function(e,t){(i=document.createElement("input")).setAttribute("name",e),i.setAttribute("value",t),n.appendChild(i)}}),n},qq.parseJson=function(json){return window.JSON&&qq.isFunction(JSON.parse)?JSON.parse(json):eval("("+json+")")},qq.getExtension=function(e){var t=e.lastIndexOf(".")+1;if(0<t)return e.substr(t,e.length-t)},qq.getFilename=function(e){return qq.isInput(e)?e.value.replace(/.*(\/|\\)/,""):qq.isFile(e)&&null!==e.fileName&&void 0!==e.fileName?e.fileName:e.name},qq.DisposeSupport=function(){var t=[];return{dispose:function(){for(var e;(e=t.shift())&&e(),e;);},attach:function(){var e=arguments;this.addDisposer(qq(e[0]).attach.apply(this,Array.prototype.slice.call(arguments,1)))},addDisposer:function(e){t.push(e)}}}}(),function(){"use strict";"function"==typeof define&&define.amd?define(function(){return qq}):"undefined"!=typeof module&&module.exports?module.exports=qq:global.qq=qq}(),function(){"use strict";qq.Error=function(e){this.message="[Fine Uploader "+qq.version+"] "+e},qq.Error.prototype=new Error}(),qq.version="5.16.2",qq.supportedFeatures=function(){"use strict";var e,t,n,i,o,a,r,s,l,u,d,c,p,f,h,q,m;function g(){return!!window.XMLHttpRequest&&void 0!==qq.createXhrInstance().withCredentials}function _(){return void 0!==window.XDomainRequest}return e=function(){var e,t=!0;try{(e=document.createElement("input")).type="file",qq(e).hide(),e.disabled&&(t=!1)}catch(e){t=!1}return t}(),t=(i=e&&qq.isXhrUploadSupported())&&!qq.androidStock(),o=(n=i&&(("draggable"in(q=document.createElement("span"))||"ondragstart"in q&&"ondrop"in q)&&!qq.android()&&!qq.ios()))&&((m=document.createElement("input")).type="file",!!("webkitdirectory"in(m||document.querySelectorAll("input[type=file]")[0]))),a=i&&qq.isFileChunkingSupported(),r=i&&a&&function(){try{return!!window.localStorage&&qq.isFunction(window.localStorage.setItem)}catch(e){return!1}}(),s=i&&(qq.chrome()||qq.opera())&&void 0!==navigator.userAgent.match(/Chrome\/[1][4-9]|Chrome\/[2-9][0-9]/),l=e&&(void 0!==window.postMessage||i),d=g(),u=_(),c=!!g()||_(),p=void 0!==document.createElement("input").webkitdirectory,f=i&&void 0!==window.FileReader,h=!!i&&!qq.androidStock()&&!qq.iosChrome(),{ajaxUploading:i,blobUploading:t,canDetermineSize:i,chunking:a,deleteFileCors:c,deleteFileCorsXdr:u,deleteFileCorsXhr:d,dialogElement:!!window.HTMLDialogElement,fileDrop:n,folderDrop:o,folderSelection:p,imagePreviews:f,imageValidation:f,itemSizeValidation:i,pause:a,progressBar:h,resume:r,scaling:f&&t,tiffPreviews:qq.safari(),unlimitedScaledImageSize:!qq.ios(),uploading:e,uploadCors:l,uploadCustomHeaders:i,uploadNonMultipart:i,uploadViaPaste:s}}(),qq.isGenericPromise=function(e){"use strict";return!!(e&&e.then&&qq.isFunction(e.then))},qq.Promise=function(){"use strict";var n,i,o=[],a=[],t=[],r=0;qq.extend(this,{then:function(e,t){return 0===r?(e&&o.push(e),t&&a.push(t)):-1===r?t&&t.apply(null,i):e&&e.apply(null,n),this},done:function(e){return 0===r?t.push(e):e.apply(null,void 0===i?n:i),this},success:function(){return r=1,n=arguments,o.length&&qq.each(o,function(e,t){t.apply(null,n)}),t.length&&qq.each(t,function(e,t){t.apply(null,n)}),this},failure:function(){return r=-1,i=arguments,a.length&&qq.each(a,function(e,t){t.apply(null,i)}),t.length&&qq.each(t,function(e,t){t.apply(null,i)}),this}})},qq.BlobProxy=function(e,t){"use strict";qq.extend(this,{referenceBlob:e,create:function(){return t(e)}})},qq.UploadButton=function(e){"use strict";var t,n,i=this,o=new qq.DisposeSupport,a={acceptFiles:null,element:null,focusClass:"qq-upload-button-focus",folders:!1,hoverClass:"qq-upload-button-hover",ios8BrowserCrashWorkaround:!1,multiple:!1,name:"qqfile",onChange:function(e){},title:null};function r(){var e=document.createElement("input");return e.setAttribute(qq.UploadButton.BUTTON_ID_ATTR_NAME,n),e.setAttribute("title",a.title),i.setMultiple(a.multiple,e),a.folders&&qq.supportedFeatures.folderSelection&&e.setAttribute("webkitdirectory",""),a.acceptFiles&&e.setAttribute("accept",a.acceptFiles),e.setAttribute("type","file"),e.setAttribute("name",a.name),qq(e).css({position:"absolute",right:0,top:0,fontFamily:"Arial",fontSize:qq.ie()&&!qq.ie8()?"3500px":"118px",margin:0,padding:0,cursor:"pointer",opacity:0}),qq.ie7()||qq(e).css({height:"100%"}),a.element.appendChild(e),o.attach(e,"change",function(){a.onChange(e)}),o.attach(e,"mouseover",function(){qq(a.element).addClass(a.hoverClass)}),o.attach(e,"mouseout",function(){qq(a.element).removeClass(a.hoverClass)}),o.attach(e,"focus",function(){qq(a.element).addClass(a.focusClass)}),o.attach(e,"blur",function(){qq(a.element).removeClass(a.focusClass)}),e}qq.extend(a,e),n=qq.getUniqueId(),qq(a.element).css({position:"relative",overflow:"hidden",direction:"ltr"}),qq.extend(this,{getInput:function(){return t},getButtonId:function(){return n},setMultiple:function(e,t){var n=t||this.getInput();a.ios8BrowserCrashWorkaround&&qq.ios8()&&(qq.iosChrome()||qq.iosSafariWebView())?n.setAttribute("multiple",""):e?n.setAttribute("multiple",""):n.removeAttribute("multiple")},setAcceptFiles:function(e){e!==a.acceptFiles&&t.setAttribute("accept",e)},reset:function(){t.parentNode&&qq(t).remove(),qq(a.element).removeClass(a.focusClass),t=null,t=r()}}),t=r()},qq.UploadButton.BUTTON_ID_ATTR_NAME="qq-button-id",qq.UploadData=function(o){"use strict";var a=[],i={},r={},s={},l={};function n(e){if(qq.isArray(e)){var n=[];return qq.each(e,function(e,t){n.push(a[t])}),n}return a[e]}qq.extend(this,{addFile:function(e){var t=e.status||qq.status.SUBMITTING,n=a.push({name:e.name,originalName:e.name,uuid:e.uuid,size:null==e.size?-1:e.size,status:t,file:e.file})-1;return e.batchId&&(a[n].batchId=e.batchId,void 0===l[e.batchId]&&(l[e.batchId]=[]),l[e.batchId].push(n)),e.proxyGroupId&&(a[n].proxyGroupId=e.proxyGroupId,void 0===s[e.proxyGroupId]&&(s[e.proxyGroupId]=[]),s[e.proxyGroupId].push(n)),a[n].id=n,i[e.uuid]=n,void 0===r[t]&&(r[t]=[]),r[t].push(n),e.onBeforeStatusChange&&e.onBeforeStatusChange(n),o.onStatusChange(n,null,t),n},retrieve:function(e){return qq.isObject(e)&&a.length?void 0!==e.id?n(e.id):void 0!==e.uuid?function(e){if(qq.isArray(e)){var n=[];return qq.each(e,function(e,t){n.push(a[i[t]])}),n}return a[i[e]]}(e.uuid):e.status?function(e){var i=[],t=[].concat(e);return qq.each(t,function(e,t){var n=r[t];void 0!==n&&qq.each(n,function(e,t){i.push(a[t])})}),i}(e.status):void 0:qq.extend([],a,!0)},removeFileRef:function(e){var t=n(e);t&&delete t.file},reset:function(){a=[],i={},r={},l={}},setStatus:function(e,t){var n=a[e].status,i=qq.indexOf(r[n],e);r[n].splice(i,1),a[e].status=t,void 0===r[t]&&(r[t]=[]),r[t].push(e),o.onStatusChange(e,n,t)},uuidChanged:function(e,t){var n=a[e].uuid;a[e].uuid=t,i[t]=e,delete i[n]},updateName:function(e,t){a[e].name=t},updateSize:function(e,t){a[e].size=t},setParentId:function(e,t){a[e].parentId=t},getIdsInProxyGroup:function(e){var t=a[e].proxyGroupId;return t?s[t]:[]},getIdsInBatch:function(e){var t=a[e].batchId;return l[t]}})},qq.status={SUBMITTING:"submitting",SUBMITTED:"submitted",REJECTED:"rejected",QUEUED:"queued",CANCELED:"canceled",PAUSED:"paused",UPLOADING:"uploading",UPLOAD_FINALIZING:"upload finalizing",UPLOAD_RETRYING:"retrying upload",UPLOAD_SUCCESSFUL:"upload successful",UPLOAD_FAILED:"upload failed",DELETE_FAILED:"delete failed",DELETING:"deleting",DELETED:"deleted"},function(){"use strict";qq.basePublicApi={addBlobs:function(e,t,n){this.addFiles(e,t,n)},addInitialFiles:function(e){var n=this;qq.each(e,function(e,t){n._addCannedFile(t)})},addFiles:function(e,t,n){this._maybeHandleIos8SafariWorkaround();var i=0===this._storedIds.length?qq.getUniqueId():this._currentBatchId,o=qq.bind(function(e){this._handleNewFile({blob:e,name:this._options.blobs.defaultName},i,d)},this),a=qq.bind(function(e){this._handleNewFile(e,i,d)},this),r=qq.bind(function(e){var t=qq.canvasToBlob(e);this._handleNewFile({blob:t,name:this._options.blobs.defaultName+".png"},i,d)},this),s=qq.bind(function(e){var t=e.quality&&e.quality/100,n=qq.canvasToBlob(e.canvas,e.type,t);this._handleNewFile({blob:n,name:e.name},i,d)},this),l=qq.bind(function(e){if(qq.isInput(e)&&qq.supportedFeatures.ajaxUploading){var t=Array.prototype.slice.call(e.files),n=this;qq.each(t,function(e,t){n._handleNewFile(t,i,d)})}else this._handleNewFile(e,i,d)},this),u=this,d=[];this._currentBatchId=i,e&&(qq.isFileList(e)&&(e=Array.prototype.slice.call(e)),e=[].concat(e),qq.each(e,function(e,t){qq.isFileOrInput(t)?l(t):qq.isBlob(t)?o(t):qq.isObject(t)?t.blob&&t.name?a(t):t.canvas&&t.name&&s(t):t.tagName&&"canvas"===t.tagName.toLowerCase()?r(t):u.log(t+" is not a valid file container!  Ignoring!","warn")}),this.log("Received "+d.length+" files."),this._prepareItemsForUpload(d,t,n))},cancel:function(e){var t=this._uploadData.retrieve({id:e});t&&t.status===qq.status.UPLOAD_FINALIZING?this.log(qq.format("Ignoring cancel for file ID {} ({}).  Finalizing upload.",e,this.getName(e)),"error"):this._handler.cancel(e)},cancelAll:function(){var e=[],n=this;qq.extend(e,this._storedIds),qq.each(e,function(e,t){n.cancel(t)}),this._handler.cancelAll()},clearStoredFiles:function(){this._storedIds=[]},continueUpload:function(e){var t=this._uploadData.retrieve({id:e});return!(!qq.supportedFeatures.pause||!this._options.chunking.enabled)&&(t.status===qq.status.PAUSED?(this.log(qq.format("Paused file ID {} ({}) will be continued.  Not paused.",e,this.getName(e))),this._uploadFile(e),!0):(this.log(qq.format("Ignoring continue for file ID {} ({}).  Not paused.",e,this.getName(e)),"error"),!1))},deleteFile:function(e){return this._onSubmitDelete(e)},doesExist:function(e){return this._handler.isValid(e)},drawThumbnail:function(e,t,n,i,o){var a,r,s=new qq.Promise;return this._imageGenerator?(a=this._thumbnailUrls[e],r={customResizeFunction:o,maxSize:0<n?n:null,scale:0<n},!i&&qq.supportedFeatures.imagePreviews&&(a=this.getFile(e)),null==a?s.failure({container:t,error:"File or URL not found."}):this._imageGenerator.generate(a,t,r).then(function(e){s.success(e)},function(e,t){s.failure({container:e,error:t||"Problem generating thumbnail"})})):s.failure({container:t,error:"Missing image generator module"}),s},getButton:function(e){return this._getButton(this._buttonIdsForFileIds[e])},getEndpoint:function(e){return this._endpointStore.get(e)},getFile:function(e){var t,n=this._handler.getFile(e);return n||(t=this._uploadData.retrieve({id:e}))&&(n=t.file),n||null},getInProgress:function(){return this._uploadData.retrieve({status:[qq.status.UPLOADING,qq.status.UPLOAD_RETRYING,qq.status.QUEUED]}).length},getName:function(e){return this._uploadData.retrieve({id:e}).name},getParentId:function(e){var t=this.getUploads({id:e}),n=null;return t&&void 0!==t.parentId&&(n=t.parentId),n},getResumableFilesData:function(){return this._handler.getResumableFilesData()},getSize:function(e){return this._uploadData.retrieve({id:e}).size},getNetUploads:function(){return this._netUploaded},getRemainingAllowedItems:function(){var e=this._currentItemLimit;return 0<e?e-this._netUploadedOrQueued:null},getUploads:function(e){return this._uploadData.retrieve(e)},getUuid:function(e){return this._uploadData.retrieve({id:e}).uuid},isResumable:function(e){return this._handler.hasResumeRecord(e)},log:function(e,t){!this._options.debug||t&&"info"!==t?t&&"info"!==t&&qq.log("[Fine Uploader "+qq.version+"] "+e,t):qq.log("[Fine Uploader "+qq.version+"] "+e)},pauseUpload:function(e){var t=this._uploadData.retrieve({id:e});if(!qq.supportedFeatures.pause||!this._options.chunking.enabled)return!1;if(0<=qq.indexOf([qq.status.UPLOADING,qq.status.UPLOAD_RETRYING],t.status)){if(this._handler.pause(e))return this._uploadData.setStatus(e,qq.status.PAUSED),!0;this.log(qq.format("Unable to pause file ID {} ({}).",e,this.getName(e)),"error")}else this.log(qq.format("Ignoring pause for file ID {} ({}).  Not in progress.",e,this.getName(e)),"error");return!1},removeFileRef:function(e){this._handler.expunge(e),this._uploadData.removeFileRef(e)},reset:function(){this.log("Resetting uploader..."),this._handler.reset(),this._storedIds=[],this._autoRetries=[],this._retryTimeouts=[],this._preventRetries=[],this._thumbnailUrls=[],qq.each(this._buttons,function(e,t){t.reset()}),this._paramsStore.reset(),this._endpointStore.reset(),this._netUploadedOrQueued=0,this._netUploaded=0,this._uploadData.reset(),this._buttonIdsForFileIds=[],this._pasteHandler&&this._pasteHandler.reset(),this._options.session.refreshOnReset&&this._refreshSessionData(),this._succeededSinceLastAllComplete=[],this._failedSinceLastAllComplete=[],this._totalProgress&&this._totalProgress.reset(),this._customResumeDataStore.reset()},retry:function(e){return this._manualRetry(e)},scaleImage:function(e,t){var n=this;return qq.Scaler.prototype.scaleImage(e,t,{log:qq.bind(n.log,n),getFile:qq.bind(n.getFile,n),uploadData:n._uploadData})},setCustomHeaders:function(e,t){this._customHeadersStore.set(e,t)},setCustomResumeData:function(e,t){this._customResumeDataStore.set(t,e)},setDeleteFileCustomHeaders:function(e,t){this._deleteFileCustomHeadersStore.set(e,t)},setDeleteFileEndpoint:function(e,t){this._deleteFileEndpointStore.set(e,t)},setDeleteFileParams:function(e,t){this._deleteFileParamsStore.set(e,t)},setEndpoint:function(e,t){this._endpointStore.set(e,t)},setForm:function(e){this._updateFormSupportAndParams(e)},setItemLimit:function(e){this._currentItemLimit=e},setName:function(e,t){this._uploadData.updateName(e,t)},setParams:function(e,t){this._paramsStore.set(e,t)},setUuid:function(e,t){return this._uploadData.uuidChanged(e,t)},setStatus:function(e,t){if(!this.getUploads({id:e}))throw new qq.Error(e+" is not a valid file ID.");switch(t){case qq.status.DELETED:this._onDeleteComplete(e,null,!1);break;case qq.status.DELETE_FAILED:this._onDeleteComplete(e,null,!0);break;default:var n="Method setStatus called on '"+name+"' not implemented yet for "+t;throw this.log(n),new qq.Error(n)}},uploadStoredFiles:function(){0===this._storedIds.length?this._itemError("noFilesError"):this._uploadStoredFiles()}},qq.basePrivateApi={_addCannedFile:function(t){var n=this;return this._uploadData.addFile({uuid:t.uuid,name:t.name,size:t.size,status:qq.status.UPLOAD_SUCCESSFUL,onBeforeStatusChange:function(e){t.deleteFileEndpoint&&n.setDeleteFileEndpoint(t.deleteFileEndpoint,e),t.deleteFileParams&&n.setDeleteFileParams(t.deleteFileParams,e),t.thumbnailUrl&&(n._thumbnailUrls[e]=t.thumbnailUrl),n._netUploaded++,n._netUploadedOrQueued++}})},_annotateWithButtonId:function(e,t){qq.isFile(e)&&(e.qqButtonId=this._getButtonId(t))},_batchError:function(e){this._options.callbacks.onError(null,null,e,void 0)},_createDeleteHandler:function(){var i=this;return new qq.DeleteFileAjaxRequester({method:this._options.deleteFile.method.toUpperCase(),maxConnections:this._options.maxConnections,uuidParamName:this._options.request.uuidName,customHeaders:this._deleteFileCustomHeadersStore,paramsStore:this._deleteFileParamsStore,endpointStore:this._deleteFileEndpointStore,cors:this._options.cors,log:qq.bind(i.log,i),onDelete:function(e){i._onDelete(e),i._options.callbacks.onDelete(e)},onDeleteComplete:function(e,t,n){i._onDeleteComplete(e,t,n),i._options.callbacks.onDeleteComplete(e,t,n)}})},_createPasteHandler:function(){var t=this;return new qq.PasteSupport({targetElement:this._options.paste.targetElement,callbacks:{log:qq.bind(t.log,t),pasteReceived:function(e){t._handleCheckedCallback({name:"onPasteReceived",callback:qq.bind(t._options.callbacks.onPasteReceived,t,e),onSuccess:qq.bind(t._handlePasteSuccess,t,e),identifier:"pasted image"})}}})},_createStore:function(e,t){function n(e){return qq.isObject(e)?qq.extend({},e):e}function i(e,t){s&&qq.isObject(t)&&qq.extend(t,qq.isFunction(s)?s():s),r[e]&&qq.extend(t,r[e])}var o={},a=e,r={},s=t;return{set:function(e,t){null==t?(o={},a=n(e)):o[t]=n(e)},get:function(e){var t;return t=null!=e&&o[e]?o[e]:n(a),i(e,t),n(t)},addReadOnly:function(e,t){qq.isObject(o)&&(null===e?qq.isFunction(t)?s=t:(s=s||{},qq.extend(s,t)):(r[e]=r[e]||{},qq.extend(r[e],t)))},remove:function(e){return delete o[e]},reset:function(){o={},r={},a=e}}},_createUploadDataTracker:function(){var i=this;return new qq.UploadData({getName:function(e){return i.getName(e)},getUuid:function(e){return i.getUuid(e)},getSize:function(e){return i.getSize(e)},onStatusChange:function(e,t,n){i._onUploadStatusChange(e,t,n),i._options.callbacks.onStatusChange(e,t,n),i._maybeAllComplete(e,n),i._totalProgress&&setTimeout(function(){i._totalProgress.onStatusChange(e,t,n)},0)}})},_createUploadButton:function(e){var t,n=this,i=e.accept||this._options.validation.acceptFiles,o=e.allowedExtensions||this._options.validation.allowedExtensions;return t=new qq.UploadButton({acceptFiles:i,element:e.element,focusClass:this._options.classes.buttonFocus,folders:e.folders,hoverClass:this._options.classes.buttonHover,ios8BrowserCrashWorkaround:this._options.workarounds.ios8BrowserCrash,multiple:!!qq.supportedFeatures.ajaxUploading&&!(n._options.workarounds.iosEmptyVideos&&qq.ios()&&!qq.ios6()&&n._isAllowedExtension(o,".mov"))&&(void 0===e.multiple?n._options.multiple:e.multiple),name:this._options.request.inputName,onChange:function(e){n._onInputChange(e)},title:null==e.title?this._options.text.fileInputTitle:e.title}),this._disposeSupport.addDisposer(function(){t.dispose()}),n._buttons.push(t),t},_createUploadHandler:function(e,t){var s=this,l={},n={debug:this._options.debug,maxConnections:this._options.maxConnections,cors:this._options.cors,paramsStore:this._paramsStore,endpointStore:this._endpointStore,chunking:this._options.chunking,resume:this._options.resume,blobs:this._options.blobs,log:qq.bind(s.log,s),preventRetryParam:this._options.retry.preventRetryResponseProperty,onProgress:function(e,t,n,i){n<0||i<0||(l[e]&&l[e].loaded===n&&l[e].total===i||(s._onProgress(e,t,n,i),s._options.callbacks.onProgress(e,t,n,i)),l[e]={loaded:n,total:i})},onComplete:function(e,t,n,i){delete l[e];var o,a=s.getUploads({id:e}).status;if(a!==qq.status.UPLOAD_SUCCESSFUL&&a!==qq.status.UPLOAD_FAILED){o=s._onComplete(e,t,n,i);var r=s.getUploads({id:e}).file.qqDropTarget;o instanceof qq.Promise?o.done(function(){s._options.callbacks.onComplete(e,t,n,i,r)}):s._options.callbacks.onComplete(e,t,n,i,r)}},onCancel:function(e,t,n){var i=new qq.Promise;return s._handleCheckedCallback({name:"onCancel",callback:qq.bind(s._options.callbacks.onCancel,s,e,t),onFailure:i.failure,onSuccess:function(){n.then(function(){s._onCancel(e,t)}),i.success()},identifier:e}),i},onUploadPrep:qq.bind(this._onUploadPrep,this),onUpload:function(e,t){s._onUpload(e,t);var n=s._options.callbacks.onUpload(e,t);return qq.isGenericPromise(n)?(s.log(qq.format("onUpload for {} returned a Promise - waiting for resolution.",e)),n):(new qq.Promise).success()},onUploadChunk:function(e,t,n){s._onUploadChunk(e,n);var i=s._options.callbacks.onUploadChunk(e,t,n);return qq.isGenericPromise(i)?(s.log(qq.format("onUploadChunk for {}.{} returned a Promise - waiting for resolution.",e,n.partIndex)),i):(new qq.Promise).success()},onUploadChunkSuccess:function(e,t,n,i){s._onUploadChunkSuccess(e,t),s._options.callbacks.onUploadChunkSuccess.apply(s,arguments)},onResume:function(e,t,n,i){return s._options.callbacks.onResume(e,t,n,i)},onAutoRetry:function(e,t,n,i){return s._onAutoRetry.apply(s,arguments)},onUuidChanged:function(e,t){s.log("Server requested UUID change from '"+s.getUuid(e)+"' to '"+t+"'"),s.setUuid(e,t)},getName:qq.bind(s.getName,s),getUuid:qq.bind(s.getUuid,s),getSize:qq.bind(s.getSize,s),setSize:qq.bind(s._setSize,s),getDataByUuid:function(e){return s.getUploads({uuid:e})},isQueued:function(e){var t=s.getUploads({id:e}).status;return t===qq.status.QUEUED||t===qq.status.SUBMITTED||t===qq.status.UPLOAD_RETRYING||t===qq.status.PAUSED},getIdsInProxyGroup:s._uploadData.getIdsInProxyGroup,getIdsInBatch:s._uploadData.getIdsInBatch,isInProgress:function(e){return s.getUploads({id:e}).status===qq.status.UPLOADING},getCustomResumeData:qq.bind(s._getCustomResumeData,s),setStatus:function(e,t){s._uploadData.setStatus(e,t)}};return qq.each(this._options.request,function(e,t){n[e]=t}),n.customHeaders=this._customHeadersStore,e&&qq.each(e,function(e,t){n[e]=t}),new qq.UploadHandlerController(n,t)},_fileOrBlobRejected:function(e){this._netUploadedOrQueued--,this._uploadData.setStatus(e,qq.status.REJECTED)},_formatSize:function(e){if(0===e)return e+this._options.text.sizeSymbols[0];for(var t=-1;t++,999<(e/=1e3););return Math.max(e,.1).toFixed(1)+" "+this._options.text.sizeSymbols[t]},_generateExtraButtonSpecs:function(){var a=this;this._extraButtonSpecs={},qq.each(this._options.extraButtons,function(e,t){var n=t.multiple,i=qq.extend({},a._options.validation,!0),o=qq.extend({},t);void 0===n&&(n=a._options.multiple),o.validation&&qq.extend(i,t.validation,!0),qq.extend(o,{multiple:n,validation:i},!0),a._initExtraButton(o)})},_getButton:function(e){var t=this._extraButtonSpecs[e];return t?t.element:e===this._defaultButtonId?this._options.button:void 0},_getButtonId:function(e){var t,n,i=e;if(i instanceof qq.BlobProxy&&(i=i.referenceBlob),i&&!qq.isBlob(i)){if(qq.isFile(i))return i.qqButtonId;if("input"===i.tagName.toLowerCase()&&"file"===i.type.toLowerCase())return i.getAttribute(qq.UploadButton.BUTTON_ID_ATTR_NAME);if(t=i.getElementsByTagName("input"),qq.each(t,function(e,t){if("file"===t.getAttribute("type"))return n=t,!1}),n)return n.getAttribute(qq.UploadButton.BUTTON_ID_ATTR_NAME)}},_getCustomResumeData:function(e){return this._customResumeDataStore.get(e)},_getNotFinished:function(){return this._uploadData.retrieve({status:[qq.status.UPLOADING,qq.status.UPLOAD_RETRYING,qq.status.QUEUED,qq.status.SUBMITTING,qq.status.SUBMITTED,qq.status.PAUSED]}).length},_getValidationBase:function(e){var t=this._extraButtonSpecs[e];return t?t.validation:this._options.validation},_getValidationDescriptor:function(e){return e.file instanceof qq.BlobProxy?{name:qq.getFilename(e.file.referenceBlob),size:e.file.referenceBlob.size,dropTarget:e.file.qqDropTarget}:{name:this.getUploads({id:e.id}).name,size:this.getUploads({id:e.id}).size,dropTarget:this.getUploads({id:e.id}).file.qqDropTarget}},_getValidationDescriptors:function(e){var n=this,i=[];return qq.each(e,function(e,t){i.push(n._getValidationDescriptor(t))}),i},_handleCameraAccess:function(){if(this._options.camera.ios&&qq.ios()){var e="image/*;capture=camera",t=this._options.camera.button,n=t?this._getButtonId(t):this._defaultButtonId,i=this._options;n&&n!==this._defaultButtonId&&(i=this._extraButtonSpecs[n]),i.multiple=!1,null===i.validation.acceptFiles?i.validation.acceptFiles=e:i.validation.acceptFiles+=","+e,qq.each(this._buttons,function(e,t){if(t.getButtonId()===n)return t.setMultiple(i.multiple),t.setAcceptFiles(i.acceptFiles),!1})}},_handleCheckedCallback:function(t){var n=this,e=t.callback();return qq.isGenericPromise(e)?(this.log(t.name+" - waiting for "+t.name+" promise to be fulfilled for "+t.identifier),e.then(function(e){n.log(t.name+" promise success for "+t.identifier),t.onSuccess(e)},function(){t.onFailure?(n.log(t.name+" promise failure for "+t.identifier),t.onFailure()):n.log(t.name+" promise failure for "+t.identifier)})):(!1!==e?t.onSuccess(e):t.onFailure?(this.log(t.name+" - return value was 'false' for "+t.identifier+".  Invoking failure callback."),t.onFailure()):this.log(t.name+" - return value was 'false' for "+t.identifier+".  Will not proceed."),e)},_handleNewFile:function(e,t,n){var i=this,o=qq.getUniqueId(),a=-1,r=qq.getFilename(e),s=e.blob||e,l=this._customNewFileHandler?this._customNewFileHandler:qq.bind(i._handleNewFileGeneric,i);!qq.isInput(s)&&0<=s.size&&(a=s.size),l(s,r,o,a,n,t,this._options.request.uuidName,{uploadData:i._uploadData,paramsStore:i._paramsStore,addFileToHandler:function(e,t){i._handler.add(e,t),i._netUploadedOrQueued++,i._trackButton(e)}})},_handleNewFileGeneric:function(e,t,n,i,o,a){var r=this._uploadData.addFile({uuid:n,name:t,size:i,batchId:a,file:e});this._handler.add(r,e),this._trackButton(r),this._netUploadedOrQueued++,o.push({id:r,file:e})},_handlePasteSuccess:function(e,t){var n=e.type.split("/")[1],i=t;null==i&&(i=this._options.paste.defaultName),i+="."+n,this.addFiles({name:i,blob:e})},_handleDeleteSuccess:function(e){if(this.getUploads({id:e}).status!==qq.status.DELETED){var t=this.getName(e);this._netUploadedOrQueued--,this._netUploaded--,this._handler.expunge(e),this._uploadData.setStatus(e,qq.status.DELETED),this.log("Delete request for '"+t+"' has succeeded.")}},_handleDeleteFailed:function(e,t){var n=this.getName(e);this._uploadData.setStatus(e,qq.status.DELETE_FAILED),this.log("Delete request for '"+n+"' has failed.","error"),t&&void 0!==t.withCredentials?this._options.callbacks.onError(e,n,"Delete request failed with response code "+t.status,t):this._options.callbacks.onError(e,n,"Delete request failed",t)},_initExtraButton:function(e){var t=this._createUploadButton({accept:e.validation.acceptFiles,allowedExtensions:e.validation.allowedExtensions,element:e.element,folders:e.folders,multiple:e.multiple,title:e.fileInputTitle});this._extraButtonSpecs[t.getButtonId()]=e},_initFormSupportAndParams:function(){this._formSupport=qq.FormSupport&&new qq.FormSupport(this._options.form,qq.bind(this.uploadStoredFiles,this),qq.bind(this.log,this)),this._formSupport&&this._formSupport.attachedToForm?(this._paramsStore=this._createStore(this._options.request.params,this._formSupport.getFormInputsAsObject),this._options.autoUpload=this._formSupport.newAutoUpload,this._formSupport.newEndpoint&&(this._options.request.endpoint=this._formSupport.newEndpoint)):this._paramsStore=this._createStore(this._options.request.params)},_isDeletePossible:function(){return!(!qq.DeleteFileAjaxRequester||!this._options.deleteFile.enabled)&&(!this._options.cors.expected||(!!qq.supportedFeatures.deleteFileCorsXhr||!(!qq.supportedFeatures.deleteFileCorsXdr||!this._options.cors.allowXdr)))},_isAllowedExtension:function(e,i){var o=!1;return!e.length||(qq.each(e,function(e,t){if(qq.isString(t)){var n=new RegExp("\\."+t+"$","i");if(null!=i.match(n))return!(o=!0)}}),o)},_itemError:function(e,t,n){var i,o,a=this._options.messages[e],r=[],s=[].concat(t),l=s[0],u=this._getButtonId(n),d=this._getValidationBase(u);function c(e,t){a=a.replace(e,t)}return qq.each(d.allowedExtensions,function(e,t){qq.isString(t)&&r.push(t)}),i=r.join(", ").toLowerCase(),c("{file}",this._options.formatFileName(l)),c("{extensions}",i),c("{fileSize}",this._formatSize(n.size)),c("{sizeLimit}",this._formatSize(d.sizeLimit)),c("{minSizeLimit}",this._formatSize(d.minSizeLimit)),null!==(o=a.match(/(\{\w+\})/g))&&qq.each(o,function(e,t){c(t,s[e])}),this._options.callbacks.onError(null,l,a,void 0),a},_manualRetry:function(e,t){if(this._onBeforeManualRetry(e))return this._netUploadedOrQueued++,this._uploadData.setStatus(e,qq.status.UPLOAD_RETRYING),t?t(e):this._handler.retry(e),!0},_maybeAllComplete:function(e,t){var n=this,i=this._getNotFinished();t===qq.status.UPLOAD_SUCCESSFUL?this._succeededSinceLastAllComplete.push(e):t===qq.status.UPLOAD_FAILED&&this._failedSinceLastAllComplete.push(e),0===i&&(this._succeededSinceLastAllComplete.length||this._failedSinceLastAllComplete.length)&&setTimeout(function(){n._onAllComplete(n._succeededSinceLastAllComplete,n._failedSinceLastAllComplete)},0)},_maybeHandleIos8SafariWorkaround:function(){var e=this;if(this._options.workarounds.ios8SafariUploads&&qq.ios800()&&qq.iosSafari())throw setTimeout(function(){window.alert(e._options.messages.unsupportedBrowserIos8Safari)},0),new qq.Error(this._options.messages.unsupportedBrowserIos8Safari)},_maybeParseAndSendUploadError:function(e,t,n,i){if(!n.success)if(i&&200!==i.status&&!n.error)this._options.callbacks.onError(e,t,"XHR returned response code "+i.status,i);else{var o=n.error?n.error:this._options.text.defaultResponseError;this._options.callbacks.onError(e,t,o,i)}},_maybeProcessNextItemAfterOnValidateCallback:function(e,i,o,a,r){var s=this;if(i.length>o)if(e||!this._options.validation.stopOnFirstInvalidFile)setTimeout(function(){var e=s._getValidationDescriptor(i[o]),t=s._getButtonId(i[o].file),n=s._getButton(t);s._handleCheckedCallback({name:"onValidate",callback:qq.bind(s._options.callbacks.onValidate,s,e,n),onSuccess:qq.bind(s._onValidateCallbackSuccess,s,i,o,a,r),onFailure:qq.bind(s._onValidateCallbackFailure,s,i,o,a,r),identifier:"Item '"+e.name+"', size: "+e.size})},0);else if(!e)for(;o<i.length;o++)s._fileOrBlobRejected(i[o].id)},_onAllComplete:function(e,t){this._totalProgress&&this._totalProgress.onAllComplete(e,t,this._preventRetries),this._options.callbacks.onAllComplete(qq.extend([],e),qq.extend([],t)),this._succeededSinceLastAllComplete=[],this._failedSinceLastAllComplete=[]},_onAutoRetry:function(e,t,n,i,o){var a=this;if(a._preventRetries[e]=n[a._options.retry.preventRetryResponseProperty],a._shouldAutoRetry(e)){var r=1e3*a._options.retry.autoAttemptDelay;return a._maybeParseAndSendUploadError.apply(a,arguments),a._options.callbacks.onAutoRetry(e,t,a._autoRetries[e]),a._onBeforeAutoRetry(e,t),a._uploadData.setStatus(e,qq.status.UPLOAD_RETRYING),a._retryTimeouts[e]=setTimeout(function(){a.log("Starting retry for "+t+"..."),o?o(e):a._handler.retry(e)},r),!0}},_onBeforeAutoRetry:function(e,t){this.log("Waiting "+this._options.retry.autoAttemptDelay+" seconds before retrying "+t+"...")},_onBeforeManualRetry:function(e){var t,n=this._currentItemLimit;return this._preventRetries[e]?(this.log("Retries are forbidden for id "+e,"warn"),!1):this._handler.isValid(e)?(t=this.getName(e),!1!==this._options.callbacks.onManualRetry(e,t)&&(0<n&&this._netUploadedOrQueued+1>n?(this._itemError("retryFailTooManyItems"),!1):(this.log("Retrying upload for '"+t+"' (id: "+e+")..."),!0))):(this.log("'"+e+"' is not a valid file ID","error"),!1)},_onCancel:function(e,t){this._netUploadedOrQueued--,clearTimeout(this._retryTimeouts[e]);var n=qq.indexOf(this._storedIds,e);!this._options.autoUpload&&0<=n&&this._storedIds.splice(n,1),this._uploadData.setStatus(e,qq.status.CANCELED)},_onComplete:function(e,t,n,i){return n.success?(n.thumbnailUrl&&(this._thumbnailUrls[e]=n.thumbnailUrl),this._netUploaded++,this._uploadData.setStatus(e,qq.status.UPLOAD_SUCCESSFUL)):(this._netUploadedOrQueued--,this._uploadData.setStatus(e,qq.status.UPLOAD_FAILED),!0===n[this._options.retry.preventRetryResponseProperty]&&(this._preventRetries[e]=!0)),this._maybeParseAndSendUploadError(e,t,n,i),!!n.success},_onDelete:function(e){this._uploadData.setStatus(e,qq.status.DELETING)},_onDeleteComplete:function(e,t,n){this.getName(e);n?this._handleDeleteFailed(e,t):this._handleDeleteSuccess(e)},_onInputChange:function(e){var t;if(qq.supportedFeatures.ajaxUploading){for(t=0;t<e.files.length;t++)this._annotateWithButtonId(e.files[t],e);this.addFiles(e.files)}else 0<e.value.length&&this.addFiles(e);qq.each(this._buttons,function(e,t){t.reset()})},_onProgress:function(e,t,n,i){this._totalProgress&&this._totalProgress.onIndividualProgress(e,n,i)},_onSubmit:function(e,t){},_onSubmitCallbackSuccess:function(e,t){this._onSubmit.apply(this,arguments),this._uploadData.setStatus(e,qq.status.SUBMITTED),this._onSubmitted.apply(this,arguments),this._options.autoUpload?(this._options.callbacks.onSubmitted.apply(this,arguments),this._uploadFile(e)):(this._storeForLater(e),this._options.callbacks.onSubmitted.apply(this,arguments))},_onSubmitDelete:function(e,t,n){var i,o=this.getUuid(e);return t&&(i=qq.bind(t,this,e,o,n)),this._isDeletePossible()?(this._handleCheckedCallback({name:"onSubmitDelete",callback:qq.bind(this._options.callbacks.onSubmitDelete,this,e),onSuccess:i||qq.bind(this._deleteHandler.sendDelete,this,e,o,n),identifier:e}),!0):(this.log("Delete request ignored for ID "+e+", delete feature is disabled or request not possible due to CORS on a user agent that does not support pre-flighting.","warn"),!1)},_onSubmitted:function(e){},_onTotalProgress:function(e,t){this._options.callbacks.onTotalProgress(e,t)},_onUploadPrep:function(e){},_onUpload:function(e,t){this._uploadData.setStatus(e,qq.status.UPLOADING)},_onUploadChunk:function(e,t){},_onUploadChunkSuccess:function(e,t){!this._preventRetries[e]&&this._options.retry.enableAuto&&(this._autoRetries[e]=0)},_onUploadStatusChange:function(e,t,n){n===qq.status.PAUSED&&clearTimeout(this._retryTimeouts[e])},_onValidateBatchCallbackFailure:function(e){var n=this;qq.each(e,function(e,t){n._fileOrBlobRejected(t.id)})},_onValidateBatchCallbackSuccess:function(e,t,n,i,o){var a,r=this._currentItemLimit,s=this._netUploadedOrQueued;0===r||s<=r?0<t.length?this._handleCheckedCallback({name:"onValidate",callback:qq.bind(this._options.callbacks.onValidate,this,e[0],o),onSuccess:qq.bind(this._onValidateCallbackSuccess,this,t,0,n,i),onFailure:qq.bind(this._onValidateCallbackFailure,this,t,0,n,i),identifier:"Item '"+t[0].file.name+"', size: "+t[0].file.size}):this._itemError("noFilesError"):(this._onValidateBatchCallbackFailure(t),a=this._options.messages.tooManyItemsError.replace(/\{netItems\}/g,s).replace(/\{itemLimit\}/g,r),this._batchError(a))},_onValidateCallbackFailure:function(e,t,n,i){var o=t+1;this._fileOrBlobRejected(e[t].id,e[t].file.name),this._maybeProcessNextItemAfterOnValidateCallback(!1,e,o,n,i)},_onValidateCallbackSuccess:function(e,t,n,i){var o=this,a=t+1,r=this._getValidationDescriptor(e[t]);this._validateFileOrBlobData(e[t],r).then(function(){o._upload(e[t].id,n,i),o._maybeProcessNextItemAfterOnValidateCallback(!0,e,a,n,i)},function(){o._maybeProcessNextItemAfterOnValidateCallback(!1,e,a,n,i)})},_prepareItemsForUpload:function(e,t,n){if(0!==e.length){var i=this._getValidationDescriptors(e),o=this._getButtonId(e[0].file),a=this._getButton(o);this._handleCheckedCallback({name:"onValidateBatch",callback:qq.bind(this._options.callbacks.onValidateBatch,this,i,a),onSuccess:qq.bind(this._onValidateBatchCallbackSuccess,this,i,e,t,n,a),onFailure:qq.bind(this._onValidateBatchCallbackFailure,this,e),identifier:"batch validation"})}else this._itemError("noFilesError")},_preventLeaveInProgress:function(){var t=this;this._disposeSupport.attach(window,"beforeunload",function(e){if(t.getInProgress())return(e=e||window.event).returnValue=t._options.messages.onLeave,t._options.messages.onLeave})},_refreshSessionData:function(){var n=this,e=this._options.session;qq.Session&&null!=this._options.session.endpoint&&(this._session||(qq.extend(e,{cors:this._options.cors}),e.log=qq.bind(this.log,this),e.addFileRecord=qq.bind(this._addCannedFile,this),this._session=new qq.Session(e)),setTimeout(function(){n._session.refresh().then(function(e,t){n._sessionRequestComplete(),n._options.callbacks.onSessionRequestComplete(e,!0,t)},function(e,t){n._options.callbacks.onSessionRequestComplete(e,!1,t)})},0))},_sessionRequestComplete:function(){},_setSize:function(e,t){this._uploadData.updateSize(e,t),this._totalProgress&&this._totalProgress.onNewSize(e)},_shouldAutoRetry:function(e){var t=this._uploadData.retrieve({id:e});return!!(!this._preventRetries[e]&&this._options.retry.enableAuto&&t.status!==qq.status.PAUSED&&(void 0===this._autoRetries[e]&&(this._autoRetries[e]=0),this._autoRetries[e]<this._options.retry.maxAutoAttempts))&&(this._autoRetries[e]+=1,!0)},_storeForLater:function(e){this._storedIds.push(e)},_trackButton:function(e){var t;(t=qq.supportedFeatures.ajaxUploading?this._handler.getFile(e).qqButtonId:this._getButtonId(this._handler.getInput(e)))&&(this._buttonIdsForFileIds[e]=t)},_updateFormSupportAndParams:function(e){this._options.form.element=e,this._formSupport=qq.FormSupport&&new qq.FormSupport(this._options.form,qq.bind(this.uploadStoredFiles,this),qq.bind(this.log,this)),this._formSupport&&this._formSupport.attachedToForm&&(this._paramsStore.addReadOnly(null,this._formSupport.getFormInputsAsObject),this._options.autoUpload=this._formSupport.newAutoUpload,this._formSupport.newEndpoint&&this.setEndpoint(this._formSupport.newEndpoint))},_upload:function(e,t,n){var i=this.getName(e);t&&this.setParams(t,e),n&&this.setEndpoint(n,e),this._handleCheckedCallback({name:"onSubmit",callback:qq.bind(this._options.callbacks.onSubmit,this,e,i,this.getDropTarget(e)),onSuccess:qq.bind(this._onSubmitCallbackSuccess,this,e,i),onFailure:qq.bind(this._fileOrBlobRejected,this,e,i),identifier:e})},_uploadFile:function(e){this._handler.upload(e)||this._uploadData.setStatus(e,qq.status.QUEUED)},_uploadStoredFiles:function(){for(var e,t,n=this;this._storedIds.length;)e=this._storedIds.shift(),this._uploadFile(e);(t=this.getUploads({status:qq.status.SUBMITTING}).length)&&(qq.log("Still waiting for "+t+" files to clear submit queue. Will re-parse stored IDs array shortly."),setTimeout(function(){n._uploadStoredFiles()},1e3))},_validateFileOrBlobData:function(e,t){var n=this,i=e.file instanceof qq.BlobProxy?e.file.referenceBlob:e.file,o=t.name,a=t.size,r=this._getButtonId(e.file),s=this._getValidationBase(r),l=new qq.Promise;return l.then(function(){},function(){n._fileOrBlobRejected(e.id,o)}),qq.isFileOrInput(i)&&!this._isAllowedExtension(s.allowedExtensions,o)?(this._itemError("typeError",o,i),l.failure()):this._options.validation.allowEmpty||0!==a?0<a&&s.sizeLimit&&a>s.sizeLimit?(this._itemError("sizeError",o,i),l.failure()):0<a&&a<s.minSizeLimit?(this._itemError("minSizeError",o,i),l.failure()):(qq.ImageValidation&&qq.supportedFeatures.imagePreviews&&qq.isFile(i)?new qq.ImageValidation(i,qq.bind(n.log,n)).validate(s.image).then(l.success,function(e){n._itemError(e+"ImageError",o,i),l.failure()}):l.success(),l):(this._itemError("emptyError",o,i),l.failure())},_wrapCallbacks:function(){var o,n,i;for(i in n=function(t,e,n){var i;try{return e.apply(o,n)}catch(e){i=e.message||e.toString(),o.log("Caught exception in '"+t+"' callback - "+i,"error")}},(o=this)._options.callbacks)!function(){var e,t;e=i,t=o._options.callbacks[e],o._options.callbacks[e]=function(){return n(e,t,arguments)}}()}}}(),function(){"use strict";qq.FineUploaderBasic=function(e){var n=this;this._options={debug:!1,button:null,multiple:!0,maxConnections:3,disableCancelForFormUploads:!1,autoUpload:!0,warnBeforeUnload:!0,request:{customHeaders:{},endpoint:"/server/upload",filenameParam:"qqfilename",forceMultipart:!0,inputName:"qqfile",method:"POST",omitDefaultParams:!1,params:{},paramsInBody:!0,requireSuccessJson:!0,totalFileSizeName:"qqtotalfilesize",uuidName:"qquuid"},validation:{allowedExtensions:[],sizeLimit:0,minSizeLimit:0,itemLimit:0,stopOnFirstInvalidFile:!0,acceptFiles:null,image:{maxHeight:0,maxWidth:0,minHeight:0,minWidth:0},allowEmpty:!1},callbacks:{onSubmit:function(e,t,n){},onSubmitted:function(e,t){},onComplete:function(e,t,n,i,o){},onAllComplete:function(e,t){},onCancel:function(e,t){},onUpload:function(e,t){},onUploadChunk:function(e,t,n){},onUploadChunkSuccess:function(e,t,n,i){},onResume:function(e,t,n,i){},onProgress:function(e,t,n,i){},onTotalProgress:function(e,t){},onError:function(e,t,n,i){},onAutoRetry:function(e,t,n){},onManualRetry:function(e,t){},onValidateBatch:function(e){},onValidate:function(e){},onSubmitDelete:function(e){},onDelete:function(e){},onDeleteComplete:function(e,t,n){},onPasteReceived:function(e){},onStatusChange:function(e,t,n){},onSessionRequestComplete:function(e,t,n){},onDropzoneDragOver:function(e){},onDropzoneDragOut:function(e){},onDropzoneDragDrop:function(e){}},messages:{typeError:"{file} has an invalid extension. Valid extension(s): {extensions}.",sizeError:"{file} is too large, maximum file size is {sizeLimit}.",minSizeError:"{file} is too small, minimum file size is {minSizeLimit}.",emptyError:"{file} is empty, please select files again without it.",noFilesError:"No files to upload.",tooManyItemsError:"Too many items ({netItems}) would be uploaded.  Item limit is {itemLimit}.",maxHeightImageError:"Image is too tall.",maxWidthImageError:"Image is too wide.",minHeightImageError:"Image is not tall enough.",minWidthImageError:"Image is not wide enough.",retryFailTooManyItems:"Retry failed - you have reached your file limit.",onLeave:"The files are being uploaded, if you leave now the upload will be canceled.",unsupportedBrowserIos8Safari:"Unrecoverable error - this browser does not permit file uploading of any kind due to serious bugs in iOS8 Safari.  Please use iOS8 Chrome until Apple fixes these issues."},retry:{enableAuto:!1,maxAutoAttempts:3,autoAttemptDelay:5,preventRetryResponseProperty:"preventRetry"},classes:{buttonHover:"qq-upload-button-hover",buttonFocus:"qq-upload-button-focus"},chunking:{enabled:!1,concurrent:{enabled:!1},mandatory:!1,paramNames:{partIndex:"qqpartindex",partByteOffset:"qqpartbyteoffset",chunkSize:"qqchunksize",totalFileSize:"qqtotalfilesize",totalParts:"qqtotalparts"},partSize:function(e){return 2e6},success:{endpoint:null,headers:function(e){return null},jsonPayload:!1,method:"POST",params:function(e){return null},resetOnStatus:[]}},resume:{enabled:!1,recordsExpireIn:7,paramNames:{resuming:"qqresume"},customKeys:function(e){return[]}},formatFileName:function(e){return e},text:{defaultResponseError:"Upload failure reason unknown",fileInputTitle:"file input",sizeSymbols:["kB","MB","GB","TB","PB","EB"]},deleteFile:{enabled:!1,method:"DELETE",endpoint:"/server/upload",customHeaders:{},params:{}},cors:{expected:!1,sendCredentials:!1,allowXdr:!1},blobs:{defaultName:"misc_data"},paste:{targetElement:null,defaultName:"pasted_image"},camera:{ios:!1,button:null},extraButtons:[],session:{endpoint:null,params:{},customHeaders:{},refreshOnReset:!0},form:{element:"qq-form",autoUpload:!1,interceptSubmit:!0},scaling:{customResizer:null,sendOriginal:!0,orient:!0,defaultType:null,defaultQuality:80,failureText:"Failed to scale",includeExif:!1,sizes:[]},workarounds:{iosEmptyVideos:!0,ios8SafariUploads:!0,ios8BrowserCrash:!1}},qq.extend(this._options,e,!0),this._buttons=[],this._extraButtonSpecs={},this._buttonIdsForFileIds=[],this._wrapCallbacks(),this._disposeSupport=new qq.DisposeSupport,this._storedIds=[],this._autoRetries=[],this._retryTimeouts=[],this._preventRetries=[],this._thumbnailUrls=[],this._netUploadedOrQueued=0,this._netUploaded=0,this._uploadData=this._createUploadDataTracker(),this._initFormSupportAndParams(),this._customHeadersStore=this._createStore(this._options.request.customHeaders),this._deleteFileCustomHeadersStore=this._createStore(this._options.deleteFile.customHeaders),this._deleteFileParamsStore=this._createStore(this._options.deleteFile.params),this._endpointStore=this._createStore(this._options.request.endpoint),this._deleteFileEndpointStore=this._createStore(this._options.deleteFile.endpoint),this._handler=this._createUploadHandler(),this._deleteHandler=qq.DeleteFileAjaxRequester&&this._createDeleteHandler(),this._options.button&&(this._defaultButtonId=this._createUploadButton({element:this._options.button,title:this._options.text.fileInputTitle}).getButtonId()),this._generateExtraButtonSpecs(),this._handleCameraAccess(),this._options.paste.targetElement&&(qq.PasteSupport?this._pasteHandler=this._createPasteHandler():this.log("Paste support module not found","error")),this._options.warnBeforeUnload&&this._preventLeaveInProgress(),this._imageGenerator=qq.ImageGenerator&&new qq.ImageGenerator(qq.bind(this.log,this)),this._refreshSessionData(),this._succeededSinceLastAllComplete=[],this._failedSinceLastAllComplete=[],this._scaler=qq.Scaler&&new qq.Scaler(this._options.scaling,qq.bind(this.log,this))||{},this._scaler.enabled&&(this._customNewFileHandler=qq.bind(this._scaler.handleNewFile,this._scaler)),qq.TotalProgress&&qq.supportedFeatures.progressBar&&(this._totalProgress=new qq.TotalProgress(qq.bind(this._onTotalProgress,this),function(e){var t=n._uploadData.retrieve({id:e});return t&&t.size||0})),this._currentItemLimit=this._options.validation.itemLimit,this._customResumeDataStore=this._createStore()},qq.FineUploaderBasic.prototype=qq.basePublicApi,qq.extend(qq.FineUploaderBasic.prototype,qq.basePrivateApi)}(),qq.AjaxRequester=function(e){"use strict";var s,l,u=[],d={},c={acceptHeader:null,validMethods:["PATCH","POST","PUT"],method:"POST",contentType:"application/x-www-form-urlencoded",maxConnections:3,customHeaders:{},endpointStore:{},paramsStore:{},mandatedParams:{},allowXRequestedWithAndCacheControl:!0,successfulResponseCodes:{DELETE:[200,202,204],PATCH:[200,201,202,203,204],POST:[200,201,202,203,204],PUT:[200,201,202,203,204],GET:[200]},cors:{expected:!1,sendCredentials:!1},log:function(e,t){},onSend:function(e){},onComplete:function(e,t,n){},onProgress:null};if(qq.extend(c,e),s=c.log,qq.indexOf(c.validMethods,c.method)<0)throw new Error("'"+c.method+"' is not a supported method for this type of request!");function p(e){return c.cors.expected&&void 0===e.withCredentials}function f(e,t){var n=d[e]&&d[e].xhr;return n||(n=t||(c.cors.expected?function(){var e;return(window.XMLHttpRequest||window.ActiveXObject)&&void 0===(e=qq.createXhrInstance()).withCredentials&&((e=new XDomainRequest).onload=function(){},e.onerror=function(){},e.ontimeout=function(){},e.onprogress=function(){}),e}():qq.createXhrInstance()),d[e].xhr=n),n}function a(e){var t=qq.indexOf(u,e),n=c.maxConnections;delete d[e],u.splice(t,1),u.length>=n&&t<n&&q(u[n-1])}function h(e,t){var n=f(e),i=c.method,o=!0===t;a(e),o?s(i+" request for "+e+" has failed","error"):p(n)||function(e){return 0<=qq.indexOf(c.successfulResponseCodes[c.method],e)}(n.status)||(o=!0,s(i+" request for "+e+" has failed - response code "+n.status,"error")),c.onComplete(e,n,o)}function q(e,t){var n,i=f(e,t),o=c.method,a=function(e){var n,t=d[e].additionalParams,i=c.mandatedParams;return c.paramsStore.get&&(n=c.paramsStore.get(e)),t&&qq.each(t,function(e,t){(n=n||{})[e]=t}),i&&qq.each(i,function(e,t){(n=n||{})[e]=t}),n}(e),r=d[e].payload;return c.onSend(e),n=function(e,t,n){var i=c.endpointStore.get(e),o=d[e].addToPath;null!=o&&(i+="/"+o);l&&t&&(i=qq.obj2url(t,i));n&&(i=qq.obj2url(n,i));return i}(e,a,d[e].additionalQueryParams),p(i)?(i.onload=function(e){return function(){h(e)}}(e),i.onerror=function(e){return function(){h(e,!0)}}(e)):i.onreadystatechange=function(e){return function(){4===f(e).readyState&&h(e)}}(e),function(t){var n=c.onProgress;n&&(f(t).upload.onprogress=function(e){e.lengthComputable&&n(t,e.loaded,e.total)})}(e),i.open(o,n,!0),c.cors.expected&&c.cors.sendCredentials&&!p(i)&&(i.withCredentials=!0),function(e){var n=f(e),t=c.customHeaders,i=d[e].additionalHeaders||{},o=c.method,a={};p(n)||(c.acceptHeader&&n.setRequestHeader("Accept",c.acceptHeader),c.allowXRequestedWithAndCacheControl&&(c.cors.expected&&0<=qq.indexOf(["GET","POST","HEAD"],c.method)&&!function(){var n=!1;return qq.each(n,function(e,t){if(qq.indexOf(["Accept","Accept-Language","Content-Language","Content-Type"],t)<0)return!(n=!0)}),n}()||(n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.setRequestHeader("Cache-Control","no-cache"))),!c.contentType||"POST"!==o&&"PUT"!==o||n.setRequestHeader("Content-Type",c.contentType),qq.extend(a,qq.isFunction(t)?t(e):t),qq.extend(a,i),qq.each(a,function(e,t){n.setRequestHeader(e,t)}))}(e),s("Sending "+o+" request for "+e),r?i.send(r):l||!a?i.send():a&&c.contentType&&0<=c.contentType.toLowerCase().indexOf("application/x-www-form-urlencoded")?i.send(qq.obj2url(a,"")):a&&c.contentType&&0<=c.contentType.toLowerCase().indexOf("application/json")?i.send(JSON.stringify(a)):i.send(a),i}l="GET"===c.method||"DELETE"===c.method,qq.extend(this,{initTransport:function(t){var n,i,o,a,r,s;return{withPath:function(e){return n=e,this},withParams:function(e){return i=e,this},withQueryParams:function(e){return s=e,this},withHeaders:function(e){return o=e,this},withPayload:function(e){return a=e,this},withCacheBuster:function(){return r=!0,this},send:function(e){return r&&0<=qq.indexOf(["GET","DELETE"],c.method)&&(i.qqtimestamp=(new Date).getTime()),function(e,t,n,i,o,a,r){if(d[e]={addToPath:n,additionalParams:i,additionalQueryParams:o,additionalHeaders:a,payload:r},u.push(e)<=c.maxConnections)return q(e,t)}(t,e,n,i,s,o,a)}}},canceled:function(e){a(e)}})},qq.UploadHandler=function(e){"use strict";var t=e.proxy,i={},o=t.onCancel,a=t.getName;qq.extend(this,{add:function(e,t){i[e]=t,i[e].temp={}},cancel:function(e){var t=this,n=new qq.Promise;o(e,a(e),n).then(function(){t.isValid(e)&&(i[e].canceled=!0,t.expunge(e)),n.success()})},expunge:function(e){delete i[e]},getThirdPartyFileId:function(e){return i[e].key},isValid:function(e){return void 0!==i[e]},reset:function(){i={}},_getFileState:function(e){return i[e]},_setThirdPartyFileId:function(e,t){i[e].key=t},_wasCanceled:function(e){return!!i[e].canceled}})},qq.UploadHandlerController=function(e,n){"use strict";var i,l,u,t,o=this,a=!1,d=!1,c={paramsStore:{},maxConnections:3,chunking:{enabled:!1,multiple:{enabled:!1}},log:function(e,t){},onProgress:function(e,t,n,i){},onComplete:function(e,t,n,i){},onCancel:function(e,t){},onUploadPrep:function(e){},onUpload:function(e,t){},onUploadChunk:function(e,t,n){},onUploadChunkSuccess:function(e,t,n,i){},onAutoRetry:function(e,t,n,i){},onResume:function(e,t,n,i){},onUuidChanged:function(e,t){},getName:function(e){},setSize:function(e,t){},isQueued:function(e){},getIdsInProxyGroup:function(e){},getIdsInBatch:function(e){},isInProgress:function(e){}},p={done:function(e,t,n,i){var o=u._getChunkData(e,t);u._getFileState(e).attemptingResume=!1,delete u._getFileState(e).temp.chunkProgress[t],u._getFileState(e).loaded+=o.size,c.onUploadChunkSuccess(e,u._getChunkDataForCallback(o),n,i)},finalize:function(i){var o=c.getSize(i),a=c.getName(i);l("All chunks have been uploaded for "+i+" - finalizing...."),u.finalizeChunks(i).then(function(e,t){l("Finalize successful for "+i);var n=h.normalizeResponse(e,!0);c.onProgress(i,a,o,o),u._maybeDeletePersistedChunkData(i),h.cleanup(i,n,t)},function(e,t){var n=h.normalizeResponse(e,!1);l("Problem finalizing chunks for file ID "+i+" - "+n.error,"error"),(n.reset||t&&0<=c.chunking.success.resetOnStatus.indexOf(t.status))&&p.reset(i),c.onAutoRetry(i,a,n,t)||h.cleanup(i,n,t)})},handleFailure:function(e,n,t,i){var o=c.getName(n);l("Chunked upload request failed for "+n+", chunk "+e),u.clearCachedChunk(n,e);var a,r=h.normalizeResponse(t,!1);if(r.reset)p.reset(n);else{var s=u._getFileState(n).chunking.inProgress;0<=(a=s?qq.indexOf(s,e):-1)&&(u._getFileState(n).chunking.inProgress.splice(a,1),u._getFileState(n).chunking.remaining.unshift(e))}u._getFileState(n).temp.ignoreFailure||(d&&(u._getFileState(n).temp.ignoreFailure=!0,l(qq.format("Going to attempt to abort these chunks: {}. These are currently in-progress: {}.",JSON.stringify(Object.keys(u._getXhrs(n))),JSON.stringify(u._getFileState(n).chunking.inProgress))),qq.each(u._getXhrs(n),function(e,t){l(qq.format("Attempting to abort file {}.{}. XHR readyState {}. ",n,e,t.readyState)),t.abort(),t._cancelled=!0}),u.moveInProgressToRemaining(n),f.free(n,!0)),c.onAutoRetry(n,o,r,i)||h.cleanup(n,r,i))},hasMoreParts:function(e){return!!u._getFileState(e).chunking.remaining.length},nextPart:function(e){var t=u._getFileState(e).chunking.remaining.shift();return t>=u._getTotalChunks(e)&&(t=null),t},reset:function(e){l("Server or callback has ordered chunking effort to be restarted on next attempt for item ID "+e,"error"),u._maybeDeletePersistedChunkData(e),u.reevaluateChunking(e),u._getFileState(e).loaded=0,u._getFileState(e).attemptingResume=!1},sendNext:function(a){var n=c.getSize(a),e=c.getName(a),r=p.nextPart(a),i=u._getChunkData(a,r),t=u._getFileState(a),o=t.attemptingResume,s=t.chunking.inProgress||[];(null==t.loaded&&(t.loaded=0),o&&!1===c.onResume(a,e,i,t.customResumeData)&&(p.reset(a),r=p.nextPart(a),i=u._getChunkData(a,r),o=!1),null==r&&0===s.length)?p.finalize(a):(s.push(r),u._getFileState(a).chunking.inProgress=s,d&&f.open(a,r),d&&f.available()&&u._getFileState(a).chunking.remaining.length&&p.sendNext(a),0===i.blob.size&&(l(qq.format("Chunk {} for file {} will not be uploaded, zero sized chunk.",r,a),"error"),p.handleFailure(r,a,"File is no longer available",null)),c.onUploadChunk(a,e,u._getChunkDataForCallback(i)).then(function(e){if(c.isInProgress(a)){l(qq.format("Sending chunked upload request for item {}.{}, bytes {}-{} of {}.",a,r,i.start+1,i.end,n));var t={chunkIdx:r,id:a,overrides:e,resuming:o};u.uploadChunk(t).then(function(e,t){l("Chunked upload request succeeded for "+a+", chunk "+r),u.clearCachedChunk(a,r);var n=u._getFileState(a).chunking.inProgress||[],i=h.normalizeResponse(e,!0),o=qq.indexOf(n,r);l(qq.format("Chunk {} for file {} uploaded successfully.",r,a)),p.done(a,r,i,t),0<=o&&n.splice(o,1),u._maybePersistChunkedState(a),p.hasMoreParts(a)||0!==n.length?p.hasMoreParts(a)?p.sendNext(a):l(qq.format("File ID {} has no more chunks to send and these chunk indexes are still marked as in-progress: {}",a,JSON.stringify(n))):p.finalize(a)},function(e,t){p.handleFailure(r,a,e,t)}).done(function(){u.clearXhr(a,r)})}else l(qq.format("Not sending chunked upload request for item {}.{} - no longer in progress.",a,r))},function(e){p.handleFailure(r,a,e,null)}))}},f={_open:[],_openChunks:{},_waiting:[],available:function(){var e=c.maxConnections,n=0,i=0;return qq.each(f._openChunks,function(e,t){n++,i+=t.length}),e-(f._open.length-n+i)},free:function(e,t){var n,i=!t,o=qq.indexOf(f._waiting,e),a=qq.indexOf(f._open,e);delete f._openChunks[e],h.getProxyOrBlob(e)instanceof qq.BlobProxy&&(l("Generated blob upload has ended for "+e+", disposing generated blob."),delete u._getFileState(e).file),0<=o?f._waiting.splice(o,1):i&&0<=a&&(f._open.splice(a,1),0<=(n=f._waiting.shift())&&(f._open.push(n),h.start(n)))},getWaitingOrConnected:function(){var n=[];return qq.each(f._openChunks,function(e,t){t&&t.length&&n.push(parseInt(e))}),qq.each(f._open,function(e,t){f._openChunks[t]||n.push(parseInt(t))}),n=n.concat(f._waiting)},isUsingConnection:function(e){return 0<=qq.indexOf(f._open,e)},open:function(e,t){return null==t&&f._waiting.push(e),!!f.available()&&(null==t?(f._waiting.pop(),f._open.push(e)):((n=f._openChunks[e]||[]).push(t),f._openChunks[e]=n),!0);var n},reset:function(){f._waiting=[],f._open=[]}},r=function(o,a){var e=u._getFileState(o);e?(e.loaded=0,l("Sending simple upload request for "+o),u.uploadFile(o).then(function(e,t){l("Simple upload request succeeded for "+o);var n=h.normalizeResponse(e,!0),i=c.getSize(o);c.onProgress(o,a,i,i),h.maybeNewUuid(o,n),h.cleanup(o,n,t)},function(e,t){l("Simple upload request failed for "+o);var n=h.normalizeResponse(e,!1);c.onAutoRetry(o,a,n,t)||h.cleanup(o,n,t)})):l("Ignoring send request as this upload may have been cancelled, File ID "+o,"warn")},h={cancel:function(e){l("Cancelling "+e),c.paramsStore.remove(e),f.free(e)},cleanup:function(e,t,n){var i=c.getName(e);c.onComplete(e,i,t,n),u._getFileState(e)&&u._clearXhrs&&u._clearXhrs(e),f.free(e)},getProxyOrBlob:function(e){return u.getProxy&&u.getProxy(e)||u.getFile&&u.getFile(e)},initHandler:function(){var e=n?qq[n]:qq.traditional,t=qq.supportedFeatures.ajaxUploading?"Xhr":"Form";(u=new e[t+"UploadHandler"](c,{getCustomResumeData:c.getCustomResumeData,getDataByUuid:c.getDataByUuid,getName:c.getName,getSize:c.getSize,getUuid:c.getUuid,log:l,onCancel:c.onCancel,onProgress:c.onProgress,onUuidChanged:c.onUuidChanged,onFinalizing:function(e){c.setStatus(e,qq.status.UPLOAD_FINALIZING)}}))._removeExpiredChunkingRecords&&u._removeExpiredChunkingRecords()},isDeferredEligibleForUpload:function(e){return c.isQueued(e)},maybeDefer:function(n,e){return e&&!u.getFile(n)&&e instanceof qq.BlobProxy?(c.onUploadPrep(n),l("Attempting to generate a blob on-demand for "+n),e.create().then(function(e){l("Generated an on-demand blob for "+n),u.updateBlob(n,e),c.setSize(n,e.size),u.reevaluateChunking(n),h.maybeSendDeferredFiles(n)},function(e){var t={};e&&(t.error=e),l(qq.format("Failed to generate blob for ID {}.  Error message: {}.",n,e),"error"),c.onComplete(n,c.getName(n),qq.extend(t,i),null),h.maybeSendDeferredFiles(n),f.free(n)}),!1):h.maybeSendDeferredFiles(n)},maybeSendDeferredFiles:function(n){var e=c.getIdsInProxyGroup(n),i=!1;return e&&e.length?(l("Maybe ready to upload proxy group file "+n),qq.each(e,function(e,t){if(h.isDeferredEligibleForUpload(t)&&u.getFile(t))i=t===n,h.now(t);else if(h.isDeferredEligibleForUpload(t))return!1})):(i=!0,h.now(n)),i},maybeNewUuid:function(e,t){void 0!==t.newUuid&&c.onUuidChanged(e,t.newUuid)},normalizeResponse:function(e,t){var n=e;return qq.isObject(e)||(n={},qq.isString(e)&&!t&&(n.error=e)),n.success=t,n},now:function(n){var i=c.getName(n);if(!o.isValid(n))throw new qq.Error(n+" is not a valid file ID to upload!");c.onUpload(n,i).then(function(e){e&&e.pause?(c.setStatus(n,qq.status.PAUSED),u.pause(n),f.free(n)):a&&u._shouldChunkThisFile(n)?p.sendNext(n):r(n,i)},function(e){if(l(n+" upload start aborted due to rejected onUpload Promise - details: "+(e=e||{}),"error"),!c.onAutoRetry(n,i,e.responseJSON||{})){var t=h.normalizeResponse(e.responseJSON,!1);h.cleanup(n,t)}})},start:function(e){var t=h.getProxyOrBlob(e);return t?h.maybeDefer(e,t):(h.now(e),!0)}};qq.extend(this,{add:function(e,t){u.add.apply(this,arguments)},upload:function(e){return!!f.open(e)&&h.start(e)},retry:function(e){return d&&(u._getFileState(e).temp.ignoreFailure=!1),f.isUsingConnection(e)?h.start(e):o.upload(e)},cancel:function(e){var t=u.cancel(e);qq.isGenericPromise(t)?t.then(function(){h.cancel(e)}):!1!==t&&h.cancel(e)},cancelAll:function(){var e,t=f.getWaitingOrConnected();if(t.length)for(e=t.length-1;0<=e;e--)o.cancel(t[e]);f.reset()},getFile:function(e){return u.getProxy&&u.getProxy(e)?u.getProxy(e).referenceBlob:u.getFile&&u.getFile(e)},isProxied:function(e){return!(!u.getProxy||!u.getProxy(e))},getInput:function(e){if(u.getInput)return u.getInput(e)},reset:function(){l("Resetting upload handler"),o.cancelAll(),f.reset(),u.reset()},expunge:function(e){if(o.isValid(e))return u.expunge(e)},isValid:function(e){return u.isValid(e)},hasResumeRecord:function(e){var t=u.isValid(e)&&u._getLocalStorageId&&u._getLocalStorageId(e);return!!t&&!!localStorage.getItem(t)},getResumableFilesData:function(){return u.getResumableFilesData?u.getResumableFilesData():[]},getThirdPartyFileId:function(e){if(o.isValid(e))return u.getThirdPartyFileId(e)},pause:function(e){return!!(o.isResumable(e)&&u.pause&&o.isValid(e)&&u.pause(e))&&(f.free(e),u.moveInProgressToRemaining(e),!0)},isAttemptingResume:function(e){return!!u.isAttemptingResume&&u.isAttemptingResume(e)},isResumable:function(e){return!!u.isResumable&&u.isResumable(e)}}),qq.extend(c,e),l=c.log,a=c.chunking.enabled&&qq.supportedFeatures.chunking,d=a&&c.chunking.concurrent.enabled,(t={})[c.preventRetryParam]=!0,i=t,h.initHandler()},qq.WindowReceiveMessage=function(e){"use strict";var n={};qq.extend({log:function(e,t){}},e),qq.extend(this,{receiveMessage:function(e,t){window.postMessage?n[e]=qq(window).attach("message",function(e){t(e.data)}):log("iframe message passing not supported in this browser!","error")},stopReceivingMessages:function(e){if(window.postMessage){var t=n[e];t&&t()}}})},qq.FormUploadHandler=function(e){"use strict";var t=e.options,a=this,n=e.proxy,i=qq.getUniqueId(),r={},s={},l={},o=t.isCors,u=t.inputName,d=n.getUuid,c=n.log,p=new qq.WindowReceiveMessage({log:c});function f(e){return e.split("_")[0]}qq.extend(this,new qq.UploadHandler(e)),qq.override(this,function(n){return{add:function(e,t){n.add(e,{input:t}),t.setAttribute("name",u),t.parentNode&&qq(t).remove()},expunge:function(e){!function(e){delete s[e],o&&(clearTimeout(l[e]),delete l[e],p.stopReceivingMessages(e));var t=document.getElementById(a._getIframeName(e));t&&(t.setAttribute("src","javascript:false;"),qq(t).remove())}(e),n.expunge(e)},isValid:function(e){return n.isValid(e)&&void 0!==a._getFileState(e).input}}}),qq.extend(this,{getInput:function(e){return a._getFileState(e).input},_attachLoadEvent:function(e,t){var n;o?function(e,t){var o=e.id,n=f(o),i=d(n);r[i]=t,s[n]=qq(e).attach("load",function(){a.getInput(n)&&(c("Received iframe load event for CORS upload request (iframe name "+o+")"),l[o]=setTimeout(function(){var e="No valid message received from loaded iframe for iframe name "+o;c(e,"error"),t({error:e})},1e3))}),p.receiveMessage(o,function(e){c("Received the following window message: '"+e+"'");f(o);var t,n=a._parseJsonResponse(e),i=n.uuid;i&&r[i]?(c("Handling response for iframe name "+o),clearTimeout(l[o]),delete l[o],a._detachLoadEvent(o),t=r[i],delete r[i],p.stopReceivingMessages(o),t(n)):i||c("'"+e+"' does not contain a UUID - ignoring.")})}(e,t):s[e.id]=qq(e).attach("load",function(){if(c("Received response for "+e.id),e.parentNode){try{if(e.contentDocument&&e.contentDocument.body&&"false"==e.contentDocument.body.innerHTML)return}catch(e){c("Error when attempting to access iframe during handling of upload response ("+e.message+")","error"),n={success:!1}}t(n)}})},_createIframe:function(e){return function(e){var t=qq.toElement("<iframe src='javascript:false;' name='"+e+"' />");return t.setAttribute("id",e),t.style.display="none",document.body.appendChild(t),t}(a._getIframeName(e))},_detachLoadEvent:function(e){void 0!==s[e]&&(s[e](),delete s[e])},_getIframeName:function(e){return e+"_"+i},_initFormForUpload:function(e){var t=e.method,n=e.endpoint,i=e.params,o=e.paramsInBody,a=e.targetName,r=qq.toElement("<form method='"+t+"' enctype='multipart/form-data'></form>"),s=n;return o?qq.obj2Inputs(i,r):s=qq.obj2url(i,n),r.setAttribute("action",s),r.setAttribute("target",a),r.style.display="none",document.body.appendChild(r),r},_parseJsonResponse:function(e){var t={};try{t=qq.parseJson(e)}catch(e){c("Error when attempting to parse iframe upload response ("+e.message+")","error")}return t}})},qq.XhrUploadHandler=function(e){"use strict";function d(e){var t=f._getFileState(e);if(t.chunkSize)return t.chunkSize;var n=o.partSize;return qq.isFunction(n)&&(n=n(e,q(e))),t.chunkSize=n}var f=this,s=e.options.namespace,t=e.proxy,o=e.options.chunking,l=e.options.resume,n=o&&e.options.chunking.enabled&&qq.supportedFeatures.chunking,a=l&&e.options.resume.enabled&&n&&qq.supportedFeatures.resume,h=t.getName,q=t.getSize,r=t.getUuid,u=t.getEndpoint,c=t.getDataByUuid,p=t.onUuidChanged,m=t.onProgress,g=t.log,_=t.getCustomResumeData;function i(i){qq.each(f._getXhrs(i),function(e,t){var n=f._getAjaxRequester(i,e);t.onreadystatechange=null,t.upload.onprogress=null,t.abort(),n&&n.canceled&&n.canceled(i)})}qq.extend(this,new qq.UploadHandler(e)),qq.override(this,function(n){return{add:function(e,t){if(qq.isFile(t)||qq.isBlob(t))n.add(e,{file:t});else{if(!(t instanceof qq.BlobProxy))throw new Error("Passed obj is not a File, Blob, or proxy");n.add(e,{proxy:t})}f._initTempState(e),a&&f._maybePrepareForResume(e)},expunge:function(e){i(e),f._maybeDeletePersistedChunkData(e),f._clearXhrs(e),n.expunge(e)}}}),qq.extend(this,{clearCachedChunk:function(e,t){var n=f._getFileState(e);n&&delete n.temp.cachedChunks[t]},clearXhr:function(e,t){var n=f._getFileState(e).temp;n.xhrs&&delete n.xhrs[t],n.ajaxRequesters&&delete n.ajaxRequesters[t]},finalizeChunks:function(e,t){var n=f._getTotalChunks(e)-1,i=f._getXhr(e,n);return t?(new qq.Promise).success(t(i),i):(new qq.Promise).success({},i)},getFile:function(e){return f.isValid(e)&&f._getFileState(e).file},getProxy:function(e){return f.isValid(e)&&f._getFileState(e).proxy},getResumableFilesData:function(){var i=[];return f._iterateResumeRecords(function(e,t){f.moveInProgressToRemaining(null,t.chunking.inProgress,t.chunking.remaining);var n={name:t.name,remaining:t.chunking.remaining,size:t.size,uuid:t.uuid};t.key&&(n.key=t.key),t.customResumeData&&(n.customResumeData=t.customResumeData),i.push(n)}),i},isAttemptingResume:function(e){return f._getFileState(e).attemptingResume},isResumable:function(e){return!!o&&f.isValid(e)&&!f._getFileState(e).notResumable},moveInProgressToRemaining:function(e,t,n){var i=(f._getFileState(e)||{}).chunking||{},o=t||i.inProgress,a=n||i.remaining;o&&(g(qq.format("Moving these chunks from in-progress {}, to remaining.",JSON.stringify(o))),o.reverse(),qq.each(o,function(e,t){a.unshift(t)}),o.length=0)},pause:function(e){if(f.isValid(e))return g(qq.format("Aborting XHR upload for {} '{}' due to pause instruction.",e,h(e))),f._getFileState(e).paused=!0,i(e),!0},reevaluateChunking:function(e){if(o&&f.isValid(e)){var t,n,i=f._getFileState(e);if(delete i.chunking,i.chunking={},1<(t=f._getTotalChunks(e))||o.mandatory){for(i.chunking.enabled=!0,i.chunking.parts=t,i.chunking.remaining=[],n=0;n<t;n++)i.chunking.remaining.push(n);f._initTempState(e)}else i.chunking.enabled=!1}},updateBlob:function(e,t){f.isValid(e)&&(f._getFileState(e).file=t)},_clearXhrs:function(e){var t=f._getFileState(e).temp;qq.each(t.ajaxRequesters,function(e){delete t.ajaxRequesters[e]}),qq.each(t.xhrs,function(e){delete t.xhrs[e]})},_createXhr:function(e,t){return f._registerXhr(e,t,qq.createXhrInstance())},_getAjaxRequester:function(e,t){var n=null==t?-1:t;return f._getFileState(e).temp.ajaxRequesters[n]},_getChunkData:function(e,t){var n=d(e),i=q(e),o=f.getFile(e),a=n*t,r=i<=a+n?i:a+n,s=f._getTotalChunks(e),l=this._getFileState(e).temp.cachedChunks,u=l[t]||qq.sliceBlob(o,a,r);return{part:t,start:a,end:r,count:s,blob:l[t]=u,size:r-a}},_getChunkDataForCallback:function(e){return{partIndex:e.part,startByte:e.start+1,endByte:e.end,totalParts:e.count}},_getLocalStorageId:function(e){var t=h(e),n=q(e),i=d(e),o=u(e),a=l.customKeys(e),r=qq.format("qq{}resume{}-{}-{}-{}-{}",s,"5.0",t,n,i,o);return a.forEach(function(e){r+="-"+e}),r},_getMimeType:function(e){return f.getFile(e).type},_getPersistableData:function(e){return f._getFileState(e).chunking},_getTotalChunks:function(e){if(o){var t=q(e),n=d(e);return Math.ceil(t/n)}},_getXhr:function(e,t){var n=null==t?-1:t;return f._getFileState(e).temp.xhrs[n]},_getXhrs:function(e){return f._getFileState(e).temp.xhrs},_iterateResumeRecords:function(i){a&&qq.each(localStorage,function(e,t){if(0===e.indexOf(qq.format("qq{}resume",s))){var n=JSON.parse(t);i(e,n)}})},_initTempState:function(e){f._getFileState(e).temp={ajaxRequesters:{},chunkProgress:{},xhrs:{},cachedChunks:{}}},_markNotResumable:function(e){f._getFileState(e).notResumable=!0},_maybeDeletePersistedChunkData:function(e){var t;return!!(a&&f.isResumable(e)&&(t=f._getLocalStorageId(e))&&localStorage.getItem(t))&&(localStorage.removeItem(t),!0)},_maybePrepareForResume:function(e){var t,n,i=f._getFileState(e);a&&void 0===i.key&&(t=f._getLocalStorageId(e),(n=localStorage.getItem(t))&&(n=JSON.parse(n),c(n.uuid)?f._markNotResumable(e):(g(qq.format("Identified file with ID {} and name of {} as resumable.",e,h(e))),p(e,n.uuid),i.key=n.key,i.chunking=n.chunking,i.loaded=n.loaded,i.customResumeData=n.customResumeData,i.attemptingResume=!0,f.moveInProgressToRemaining(e))))},_maybePersistChunkedState:function(t){var e,n,i=f._getFileState(t);if(a&&f.isResumable(t)){var o=_(t);e=f._getLocalStorageId(t),n={name:h(t),size:q(t),uuid:r(t),key:i.key,chunking:i.chunking,loaded:i.loaded,lastUpdated:Date.now()},o&&(n.customResumeData=o);try{localStorage.setItem(e,JSON.stringify(n))}catch(e){g(qq.format("Unable to save resume data for '{}' due to error: '{}'.",t,e.toString()),"warn")}}},_registerProgressHandler:function(u,d,c){var e=f._getXhr(u,d),p=h(u),t={simple:function(e,t){var n=q(u);m(u,p,e===t?n:n<=e?n-1:e,n)},chunked:function(e,t){var n=f._getFileState(u).temp.chunkProgress,i=f._getFileState(u).loaded,o=e,a=t,r=q(u),s=o-(a-c),l=i;n[d]=s,qq.each(n,function(e,t){l+=t}),m(u,p,l,r)}};e.upload.onprogress=function(e){e.lengthComputable&&t[null==c?"simple":"chunked"](e.loaded,e.total)}},_registerXhr:function(e,t,n,i){var o=null==t?-1:t,a=f._getFileState(e).temp;return a.xhrs=a.xhrs||{},a.ajaxRequesters=a.ajaxRequesters||{},a.xhrs[o]=n,i&&(a.ajaxRequesters[o]=i),n},_removeExpiredChunkingRecords:function(){var i=l.recordsExpireIn;f._iterateResumeRecords(function(e,t){var n=new Date(t.lastUpdated);n.setDate(n.getDate()+i),n.getTime()<=Date.now()&&(g("Removing expired resume record with key "+e),localStorage.removeItem(e))})},_shouldChunkThisFile:function(e){var t=f._getFileState(e);if(t)return t.chunking||f.reevaluateChunking(e),t.chunking.enabled}})},qq.DeleteFileAjaxRequester=function(e){"use strict";var o,a={method:"DELETE",uuidParamName:"qquuid",endpointStore:{},maxConnections:3,customHeaders:function(e){return{}},paramsStore:{},cors:{expected:!1,sendCredentials:!1},log:function(e,t){},onDelete:function(e){},onDeleteComplete:function(e,t,n){}};qq.extend(a,e),o=qq.extend(this,new qq.AjaxRequester({acceptHeader:"application/json",validMethods:["POST","DELETE"],method:a.method,endpointStore:a.endpointStore,paramsStore:a.paramsStore,mandatedParams:"POST"===a.method.toUpperCase()?{_method:"DELETE"}:{},maxConnections:a.maxConnections,customHeaders:function(e){return a.customHeaders.get(e)},log:a.log,onSend:a.onDelete,onComplete:a.onDeleteComplete,cors:a.cors})),qq.extend(this,{sendDelete:function(e,t,n){var i=n||{};a.log("Submitting delete file request for "+e),"DELETE"===a.method?o.initTransport(e).withPath(t).withParams(i).send():(i[a.uuidParamName]=t,o.initTransport(e).withParams(i).send())}})},Xx.prototype.render=function(t,e){e=e||{};var n,i,o=this,a=this.srcImage.naturalWidth,r=this.srcImage.naturalHeight,s=e.width,l=e.height,u=e.maxWidth,d=e.maxHeight,c=!this.blob||"image/jpeg"===this.blob.type,p=t.tagName.toLowerCase();this.imageLoadListeners?this.imageLoadListeners.push(function(){o.render(t,e)}):(s&&!l?l=r*s/a<<0:l&&!s?s=a*l/r<<0:(s=a,l=r),u&&u<s&&(l=r*(s=u)/a<<0),d&&d<l&&(s=a*(l=d)/r<<0),n={width:s,height:l},qq.each(e,function(e,t){n[e]=t}),"img"===p?(i=t.src,function(e,t,n,i){var o=document.createElement("canvas"),a=n.mime||"image/jpeg",r=new qq.Promise;return Ux(e,t,o,n,i).then(function(){r.success(o.toDataURL(a,n.quality||.8))}),r}(o.srcImage,o.blob,n,c).then(function(e){t.src=e,i===t.src&&t.onload()})):"canvas"===p&&Ux(this.srcImage,this.blob,t,n,c),"function"==typeof this.onrender&&this.onrender(t))},qq.MegaPixImage=Xx,qq.ImageGenerator=function(c){"use strict";function r(e){return"img"===e.tagName.toLowerCase()}function s(e){return"canvas"===e.tagName.toLowerCase()}function l(e){var t=e.split("/"),n=t[t.length-1].split("?")[0],i=qq.getExtension(n);switch(i=i&&i.toLowerCase()){case"jpeg":case"jpg":return"image/jpeg";case"png":return"image/png";case"bmp":return"image/bmp";case"gif":return"image/gif";case"tiff":case"tif":return"image/tiff"}}function u(e){var t,n,i,o=document.createElement("a");return o.href=e,t=o.protocol,i=o.port,n=o.hostname,t.toLowerCase()!==window.location.protocol.toLowerCase()||(n.toLowerCase()!==window.location.hostname.toLowerCase()||i!==window.location.port&&!qq.ie())}function p(e,t){var n=r(e)||s(e);return r(e)?function(e,t){e.onload=function(){e.onload=null,e.onerror=null,t.success(e)},e.onerror=function(){e.onload=null,e.onerror=null,c("Problem drawing thumbnail!","error"),t.failure(e,"Problem drawing thumbnail!")}}(e,t):s(e)?function(e,t){e.qqImageRendered=function(){t.success(e)}}(e,t):(t.failure(e),c(qq.format("Element container of type {} is not supported!",e.tagName),"error")),n}function d(e,t,n,i,o){var a=new Image,r=new qq.Promise;p(a,r),u(e)&&(a.crossOrigin="anonymous"),a.src=e,r.then(function(){p(t,n),new qq.MegaPixImage(a).render(t,{maxWidth:i,maxHeight:i,mime:l(e),resize:o})},n.failure)}function f(e,t,n,i){p(t,n),qq(t).css({maxWidth:i+"px",maxHeight:i+"px"}),t.src=e}function i(e,t,n){var i=new qq.Promise,o=n.scale,a=o?n.maxSize:null;return o&&r(t)?!function(){var e=document.createElement("canvas");return e.getContext&&e.getContext("2d")}()?f(e,t,i,a):u(e)&&void 0===(new Image).crossOrigin?f(e,t,i,a):d(e,t,i,a):s(t)?d(e,t,i,a):p(t,i)&&(t.src=e),i}qq.extend(this,{generate:function(e,t,n){return qq.isString(e)?(c("Attempting to update thumbnail based on server response."),i(e,t,n||{})):(c("Attempting to draw client-side image preview."),function(o,a,r){function s(){a.onerror=null,a.onload=null,c("Could not render preview, file may be too large!","error"),l.failure(a,"Browser cannot render image!")}var l=new qq.Promise,e=new qq.Identify(o,c),u=r.maxSize,d=null==r.orient||r.orient;return e.isPreviewable().then(function(n){var e={parse:function(){return(new qq.Promise).success()}},t=d?new qq.Exif(o,c):e,i=new qq.MegaPixImage(o,s);p(a,l)&&t.parse().then(function(e){var t=e&&e.Orientation;i.render(a,{maxWidth:u,maxHeight:u,orientation:t,mime:n,resize:r.customResizeFunction})},function(e){c(qq.format("EXIF data could not be parsed ({}).  Assuming orientation = 1.",e)),i.render(a,{maxWidth:u,maxHeight:u,mime:n,resize:r.customResizeFunction})})},function(){c("Not previewable"),l.failure(a,"Not previewable")}),l}(e,t,n||{}))}}),this._testing={},this._testing.isImg=r,this._testing.isCanvas=s,this._testing.isCrossOrigin=u,this._testing.determineMimeOfFileName=l},qq.Exif=function(r,a){"use strict";var s=[274],c={274:{name:"Orientation",bytes:2}};function p(e){for(var t=0,n=0;0<e.length;)t+=parseInt(e.substring(0,2),16)*Math.pow(2,n),e=e.substring(2,e.length),n+=8;return t}function e(){var t=new qq.Promise;return qq.readBlobToHex(r,0,6).then(function(e){0!==e.indexOf("ffd8")?t.failure("Not a valid JPEG!"):function i(e,t){var o=e,a=t;return void 0===o&&(o=2,a=new qq.Promise),qq.readBlobToHex(r,o,4).then(function(e){var t,n=/^ffe([0-9])/.exec(e);n?"1"!==n[1]?(t=parseInt(e.slice(4,8),16),i(o+t+2,a)):a.success(o):a.failure("No EXIF header to be found!")}),a}().then(function(e){t.success(e)},function(e){t.failure(e)})}),t}qq.extend(this,{parse:function(){function n(e){a(qq.format("EXIF header parse failed: '{}' ",e)),o.failure(e)}var o=new qq.Promise;return e().then(function(t){a(qq.format("Moving forward with EXIF header parsing for '{}'",void 0===r.name?"blob":r.name)),function(e){var t=new qq.Promise;return qq.readBlobToHex(r,e+10,2).then(function(e){t.success("4949"===e)}),t}(t).then(function(i){a(qq.format("EXIF Byte order is {} endian",i?"little":"big")),function(e,t){var n=new qq.Promise;return qq.readBlobToHex(r,e+18,2).then(function(e){if(t)return n.success(p(e));n.success(parseInt(e,16))}),n}(t,i).then(function(e){a(qq.format("Found {} APP1 directory entries",e)),function(e,t){var n=e+20,i=12*t;return qq.readBlobToHex(r,n,i)}(t,e).then(function(e){var t=function(e){for(var t=[],n=0;n+24<=e.length;)t.push(e.slice(n,n+24)),n+=24;return t}(e),n=function(l,e){var u=qq.extend([],s),d={};return qq.each(e,function(e,t){var n,i,o,a=t.slice(0,4),r=l?p(a):parseInt(a,16),s=u.indexOf(r);if(0<=s&&(i=c[r].name,o=c[r].bytes,n=t.slice(16,16+2*o),d[i]=l?p(n):parseInt(n,16),u.splice(s,1)),0===u.length)return!1}),d}(i,t);a("Successfully parsed some EXIF tags"),o.success(n)},n)},n)},n)},n),o}}),this._testing={},this._testing.parseLittleEndian=p},qq.Identify=function(a,r){"use strict";qq.extend(this,{isPreviewable:function(){var e=this,i=new qq.Promise,o=!1,t=void 0===a.name?"blob":a.name;return r(qq.format("Attempting to determine if {} can be rendered in this browser",t)),r("First pass: check type attribute of blob object."),this.isPreviewableSync()?(r("Second pass: check for magic bytes in file header."),qq.readBlobToHex(a,0,4).then(function(n){qq.each(e.PREVIEWABLE_MIME_TYPES,function(e,t){if(function(e,n){var i=!1,t=[].concat(e);return qq.each(t,function(e,t){if(0===n.indexOf(t))return!(i=!0)}),i}(t,n))return"image/tiff"===e&&!qq.supportedFeatures.tiffPreviews||(o=!0,i.success(e)),!1}),r(qq.format("'{}' is {} able to be rendered in this browser",t,o?"":"NOT")),o||i.failure()},function(){r("Error reading file w/ name '"+t+"'.  Not able to be rendered in this browser."),i.failure()})):i.failure(),i},isPreviewableSync:function(){var e=a.type,t=0<=qq.indexOf(Object.keys(this.PREVIEWABLE_MIME_TYPES),e),n=!1,i=void 0===a.name?"blob":a.name;return t&&(n="image/tiff"!==e||qq.supportedFeatures.tiffPreviews),n||r(i+" is not previewable in this browser per the blob's type attr"),n}})},qq.Identify.prototype.PREVIEWABLE_MIME_TYPES={"image/jpeg":"ffd8ff","image/gif":"474946","image/png":"89504e","image/bmp":"424d","image/tiff":["49492a00","4d4d002a"]},qq.ImageValidation=function(o,a){"use strict";this.validate=function(n){var i=new qq.Promise;return a("Attempting to validate image."),!function(e){var n=!1;return qq.each(e,function(e,t){if(0<t)return!(n=!0)}),n}(n)?i.success():function(){var n=new qq.Promise;return new qq.Identify(o,a).isPreviewable().then(function(){var e=new Image,t=window.URL&&window.URL.createObjectURL?window.URL:window.webkitURL&&window.webkitURL.createObjectURL?window.webkitURL:null;t?(e.onerror=function(){a("Cannot determine dimensions for image.  May be too large.","error"),n.failure()},e.onload=function(){n.success({width:this.width,height:this.height})},e.src=t.createObjectURL(o)):(a("No createObjectURL function available to generate image URL!","error"),n.failure())},n.failure),n}().then(function(e){var t=function(e,a){var r;return qq.each(e,function(e,t){if(0<t){var n=/(max|min)(Width|Height)/.exec(e),i=n[2].charAt(0).toLowerCase()+n[2].slice(1),o=a[i];switch(n[1]){case"min":if(o<t)return r=e,!1;break;case"max":if(t<o)return r=e,!1}}}),r}(n,e);t?i.failure(t):i.success()},i.success),i}},qq.Session=function(e){"use strict";var a={endpoint:null,params:{},customHeaders:{},cors:{},addFileRecord:function(e){},log:function(e,t){}};function o(e,t,n,i){var o=!1;(t=t&&function(e){if(qq.isArray(e))return!0;a.log("Session response is not an array.","error")}(e))&&qq.each(e,function(e,t){if(null==t.uuid)o=!0,a.log(qq.format("Session response item {} did not include a valid UUID - ignoring.",e),"error");else if(null==t.name)o=!0,a.log(qq.format("Session response item {} did not include a valid name - ignoring.",e),"error");else try{return a.addFileRecord(t),!0}catch(e){o=!0,a.log(e.message,"error")}return!1}),i[t&&!o?"success":"failure"](e,n)}qq.extend(a,e,!0),this.refresh=function(){var i=new qq.Promise,e=qq.extend({},a);return new qq.SessionAjaxRequester(qq.extend(e,{onComplete:function(e,t,n){o(e,t,n,i)}})).queryServer(),i}},qq.SessionAjaxRequester=function(e){"use strict";var t,o={endpoint:null,customHeaders:{},params:{},cors:{expected:!1,sendCredentials:!1},onComplete:function(e,t,n){},log:function(e,t){}};qq.extend(o,e),t=qq.extend(this,new qq.AjaxRequester({acceptHeader:"application/json",validMethods:["GET"],method:"GET",endpointStore:{get:function(){return o.endpoint}},customHeaders:o.customHeaders,log:o.log,onComplete:function(e,t,n){var i=null;if(null!=t.responseText)try{i=qq.parseJson(t.responseText)}catch(e){o.log("Problem parsing session response: "+e.message,"error"),n=!0}o.onComplete(i,!n,t)},cors:o.cors})),qq.extend(this,{queryServer:function(){var e=qq.extend({},o.params);o.log("Session query request."),t.initTransport("sessionRefresh").withParams(e).withCacheBuster().send()}})},qq.Scaler=function(e,s){"use strict";var l=e.customResizer,n=e.sendOriginal,u=e.orient,d=e.defaultType,c=e.defaultQuality/100,p=e.failureText,f=e.includeExif,h=this._getSortedSizes(e.sizes);qq.extend(this,{enabled:qq.supportedFeatures.scaling&&0<h.length,getFileRecords:function(e,i,t){var o=this,a=[],r=t.blob?t.blob:t;return new qq.Identify(r,s).isPreviewableSync()?(qq.each(h,function(e,t){var n=o._determineOutputType({defaultType:d,requestedType:t.type,refType:r.type});a.push({uuid:qq.getUniqueId(),name:o._getName(i,{name:t.name,type:n,refType:r.type}),blob:new qq.BlobProxy(r,qq.bind(o._generateScaledImage,o,{customResizeFunction:l,maxSize:t.maxSize,orient:u,type:n,quality:c,failedText:p,includeExif:f,log:s}))})}),a.push({uuid:e,name:i,size:r.size,blob:n?r:null})):a.push({uuid:e,name:i,size:r.size,blob:r}),a},handleNewFile:function(e,t,n,i,o,a,r,s){e.qqButtonId||e.blob&&e.blob.qqButtonId;var l,u=[],d=null,c=s.addFileToHandler,p=s.uploadData,f=s.paramsStore,h=qq.getUniqueId();qq.each(this.getFileRecords(n,t,e),function(e,t){var n,i=t.size;t.blob instanceof qq.BlobProxy&&(i=-1),n=p.addFile({uuid:t.uuid,name:t.name,size:i,batchId:a,proxyGroupId:h}),t.blob instanceof qq.BlobProxy?u.push(n):d=n,t.blob?(c(n,t.blob),o.push({id:n,file:t.blob})):p.setStatus(n,qq.status.REJECTED)}),null!==d&&(qq.each(u,function(e,t){var n={qqparentuuid:p.retrieve({id:d}).uuid,qqparentsize:p.retrieve({id:d}).size};n[r]=p.retrieve({id:t}).uuid,p.setParentId(t,d),f.addReadOnly(t,n)}),u.length&&((l={})[r]=p.retrieve({id:d}).uuid,f.addReadOnly(d,l)))}})},qq.extend(qq.Scaler.prototype,{scaleImage:function(t,e,n){"use strict";if(!qq.supportedFeatures.scaling)throw new qq.Error("Scaling is not supported in this browser!");var i=new qq.Promise,o=n.log,a=n.getFile(t),r=n.uploadData.retrieve({id:t}),s=r&&r.name,l=r&&r.uuid,u={customResizer:e.customResizer,sendOriginal:!1,orient:e.orient,defaultType:e.type||null,defaultQuality:e.quality,failedToScaleText:"Unable to scale",sizes:[{name:"",maxSize:e.maxSize}]},d=new qq.Scaler(u,o);return qq.Scaler&&qq.supportedFeatures.imagePreviews&&a?qq.bind(function(){var e=d.getFileRecords(l,s,a)[0];e&&e.blob instanceof qq.BlobProxy?e.blob.create().then(i.success,i.failure):(o(t+" is not a scalable image!","error"),i.failure())},this)():(i.failure(),o("Could not generate requested scaled image for "+t+".  Scaling is either not possible in this browser, or the file could not be located.","error")),i},_determineOutputType:function(e){"use strict";var t=e.requestedType,n=e.defaultType,i=e.refType;return n||t?t&&0<=qq.indexOf(Object.keys(qq.Identify.prototype.PREVIEWABLE_MIME_TYPES),t)?"image/tiff"===t?qq.supportedFeatures.tiffPreviews?t:n:t:n:"image/jpeg"!==i?"image/png":i},_getName:function(e,t){"use strict";var n=e.lastIndexOf("."),i=t.type||"image/png",o=t.refType,a="",r=qq.getExtension(e),s="";return t.name&&t.name.trim().length&&(s=" ("+t.name+")"),0<=n?(a=e.substr(0,n),o!==i&&(r=i.split("/")[1]),a+=s+"."+r):a=e+s,a},_getSortedSizes:function(e){"use strict";return(e=qq.extend([],e)).sort(function(e,t){return e.maxSize>t.maxSize?1:e.maxSize<t.maxSize?-1:0})},_generateScaledImage:function(e,i){"use strict";var o=this,t=e.customResizeFunction,a=e.log,n=e.maxSize,r=e.orient,s=e.type,l=e.quality,u=e.failedText,d=e.includeExif&&"image/jpeg"===i.type&&"image/jpeg"===s,c=new qq.Promise,p=new qq.ImageGenerator(a),f=document.createElement("canvas");return a("Attempting to generate scaled version for "+i.name),p.generate(i,f,{maxSize:n,orient:r,customResizeFunction:t}).then(function(){function t(){a("Success generating scaled version for "+i.name);var e=qq.dataUriToBlob(n);c.success(e)}var n=f.toDataURL(s,l);d?o._insertExifHeader(i,n,a).then(function(e){n=e,t()},function(){a("Problem inserting EXIF header into scaled image.  Using scaled image w/out EXIF data.","error"),t()}):t()},function(){a("Failed attempt to generate scaled version for "+i.name,"error"),c.failure(u)}),c},_insertExifHeader:function(e,t,n){"use strict";var i=new FileReader,o=new qq.Promise,a="";return i.onload=function(){a=i.result,o.success(qq.ExifRestorer.restore(a,t))},i.onerror=function(){n("Problem reading "+e.name+" during attempt to transfer EXIF data to scaled version.","error"),o.failure()},i.readAsDataURL(e),o},_dataUriToBlob:function(e){"use strict";var t,n,i,o;return t=0<=e.split(",")[0].indexOf("base64")?atob(e.split(",")[1]):decodeURI(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],i=new ArrayBuffer(t.length),o=new Uint8Array(i),qq.each(t,function(e,t){o[e]=t.charCodeAt(0)}),this._createBlob(i,n)},_createBlob:function(e,t){"use strict";var n=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,i=n&&new n;return i?(i.append(e),i.getBlob(t)):new Blob([e],{type:t})}}),qq.ExifRestorer=(DF={KEY_STR:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode64:function(e){for(var t,n,i,o,a,r="",s="",l="",u=0;i=(t=e[u++])>>2,o=(3&t)<<4|(n=e[u++])>>4,a=(15&n)<<2|(s=e[u++])>>6,l=63&s,isNaN(n)?a=l=64:isNaN(s)&&(l=64),r=r+this.KEY_STR.charAt(i)+this.KEY_STR.charAt(o)+this.KEY_STR.charAt(a)+this.KEY_STR.charAt(l),t=n=s="",i=o=a=l="",u<e.length;);return r},restore:function(e,t){var n="data:image/jpeg;base64,";if(!e.match(n))return t;var i=this.decode64(e.replace(n,"")),o=this.slice2Segments(i),a=this.exifManipulation(t,o);return n+this.encode64(a)},exifManipulation:function(e,t){var n=this.getExifArray(t),i=this.insertExif(e,n);return new Uint8Array(i)},getExifArray:function(e){for(var t,n=0;n<e.length;n++)if(255==(t=e[n])[0]&225==t[1])return t;return[]},insertExif:function(e,t){var n=e.replace("data:image/jpeg;base64,",""),i=this.decode64(n),o=i.indexOf(255,3),a=i.slice(0,o),r=i.slice(o),s=a;return s=(s=s.concat(t)).concat(r)},slice2Segments:function(e){for(var t=0,n=[];!(255==e[t]&218==e[t+1]);){if(255==e[t]&216==e[t+1])t+=2;else{var i=t+(256*e[t+2]+e[t+3])+2,o=e.slice(t,i);n.push(o),t=i}if(t>e.length)break}return n},decode64:function(e){var t,n,i,o,a="",r="",s=0,l=[];if(/[^A-Za-z0-9\+\/\=]/g.exec(e))throw new Error("There were invalid base64 characters in the input text.  Valid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='");for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");t=this.KEY_STR.indexOf(e.charAt(s++))<<2|(i=this.KEY_STR.indexOf(e.charAt(s++)))>>4,n=(15&i)<<4|(o=this.KEY_STR.indexOf(e.charAt(s++)))>>2,a=(3&o)<<6|(r=this.KEY_STR.indexOf(e.charAt(s++))),l.push(t),64!=o&&l.push(n),64!=r&&l.push(a),t=n=a="",i=o=r="",s<e.length;);return l}},DF),qq.TotalProgress=function(n,i){"use strict";function a(e,t){e===u&&t===d||n(e,t),u=e,d=t}function o(e){var t=i(e);0<t&&(c(e,0,t),r[e]={loaded:0,total:t})}var r={},s=0,l=0,u=-1,d=-1,c=function(e,t,n){var i=r[e]?r[e].loaded:0,o=r[e]?r[e].total:0;-1===t&&-1===n?(s-=i,l-=o):(t&&(s+=t-i),n&&(l+=n-o)),a(s,l)};qq.extend(this,{onAllComplete:function(e,t,n){0!==t.length&&!function(e,n){var i=!0;return qq.each(e,function(e,t){if(0<=qq.indexOf(n,t))return i=!1}),i}(t,n)||(a(l,l),this.reset())},onStatusChange:function(e,t,n){n===qq.status.CANCELED||n===qq.status.REJECTED?function(e){c(e,-1,-1),delete r[e]}(e):n===qq.status.SUBMITTING&&o(e)},onIndividualProgress:function(e,t,n){c(e,t,n),r[e]={loaded:t,total:n}},onNewSize:function(e){o(e)},reset:function(){r={},l=s=0}})},qq.PasteSupport=function(e){"use strict";var i,t;i={targetElement:null,callbacks:{log:function(e,t){},pasteReceived:function(e){}}},qq.extend(i,e),t=qq(i.targetElement).attach("paste",function(e){var t=e.clipboardData;t&&qq.each(t.items,function(e,t){if(function(e){return e.type&&0===e.type.indexOf("image/")}(t)){var n=t.getAsFile();i.callbacks.pasteReceived(n)}})}),qq.extend(this,{reset:function(){t&&t()}})},qq.FormSupport=function(e,t,n){"use strict";var i,o,a,r,s=this,l=e.interceptSubmit,u=e.element,d=e.autoUpload;function c(e,t){if(!e.checkValidity||e.checkValidity())return!0;n("Form did not pass validation checks - will not upload.","error"),t()}qq.extend(this,{newEndpoint:null,newAutoUpload:d,attachedToForm:!1,getFormInputsAsObject:function(){return null==u?null:s._form2Obj(u)}}),(r=u)&&(qq.isString(r)&&(r=document.getElementById(r)),r&&(n("Attaching to form element."),(a=r).getAttribute("action")&&(s.newEndpoint=a.getAttribute("action")),l&&(o=(i=r).submit,qq(i).attach("submit",function(e){(e=e||window.event).preventDefault?e.preventDefault():e.returnValue=!1,c(i,o)&&t()}),i.submit=function(){c(i,o)&&t()}))),u=r,this.attachedToForm=!!u},qq.extend(qq.FormSupport.prototype,{_form2Obj:function(e){"use strict";function i(e){return!(!function(e){return 0<=qq.indexOf(["checkbox","radio"],e.toLowerCase())}(e.type)||e.checked)||e.disabled&&"hidden"!==e.type.toLowerCase()}var o={};return qq.each(e.elements,function(e,t){if(!qq.isInput(t,!0)&&"textarea"!==t.tagName.toLowerCase()||!function(e){return qq.indexOf(["button","image","reset","submit"],e.toLowerCase())<0}(t.type)||i(t)){if("select"===t.tagName.toLowerCase()&&!i(t)){var n=function(e){var n=null;return qq.each(qq(e).children(),function(e,t){if("option"===t.tagName.toLowerCase()&&t.selected)return n=t.value,!1}),n}(t);null!==n&&(o[t.name]=n)}}else o[t.name]=t.value}),o}}),qq.traditional=qq.traditional||{},qq.traditional.FormUploadHandler=function(r,e){"use strict";var s=this,l=e.getName,u=e.getUuid,a=e.log;this.uploadFile=function(n){var e,t=s.getInput(n),i=s._createIframe(n),o=new qq.Promise;return(e=function(e,t){var n=r.paramsStore.get(e),i="get"===r.method.toLowerCase()?"GET":"POST",o=r.endpointStore.get(e),a=l(e);return n[r.uuidName]=u(e),n[r.filenameParam]=a,s._initFormForUpload({method:i,endpoint:o,params:n,paramsInBody:r.paramsInBody,targetName:t.name})}(n,i)).appendChild(t),s._attachLoadEvent(i,function(e){a("iframe loaded");var t=e||function(e,t){var n,i,o;try{o=(i=t.contentDocument||t.contentWindow.document).body.innerHTML,a("converting iframe's innerHTML to JSON"),a("innerHTML = "+o),o&&o.match(/^<pre/i)&&(o=i.body.firstChild.firstChild.nodeValue),n=s._parseJsonResponse(o)}catch(e){a("Error when attempting to parse form upload response ("+e.message+")","error"),n={success:!1}}return n}(0,i);s._detachLoadEvent(n),r.cors.expected||qq(i).remove(),t.success?o.success(t):o.failure(t)}),a("Sending upload request for "+n),e.submit(),qq(e).remove(),o},qq.extend(this,new qq.FormUploadHandler({options:{isCors:r.cors.expected,inputName:r.inputName},proxy:{onCancel:r.onCancel,getName:l,getUuid:u,log:a}}))},qq.traditional=qq.traditional||{},qq.traditional.XhrUploadHandler=function(h,n){"use strict";function c(t,n){var i=new qq.Promise;return n.onreadystatechange=function(){if(4===n.readyState){var e=r(t,n);e.success?i.success(e.response,n):i.failure(e.response,n)}},i}function i(e){var t=new qq.Promise;return a.complete(e,q._createXhr(e),function(e){var t=h.paramsStore.get(e),n=m(e),i=g(e);return t[h.uuidName]=_(e),t[h.filenameParam]=n,t[h.totalFileSizeName]=i,t[h.chunking.paramNames.totalParts]=q._getTotalChunks(e),t}(e),h.customHeaders.get(e)).then(function(e){t.success(s(!1,e),e)},function(e){t.failure(s(!1,e),e)}),t}function p(e){var t,n=e.fileOrBlob,i=e.id,o=e.xhr,a=e.xhrOverrides||{},r=e.customParams||{},s=e.params||{},l=a.params||{},u=b?new FormData:null,d=a.method||h.method,c=a.endpoint||h.endpointStore.get(i),p=m(i),f=g(i);return h.omitDefaultParams?(t=qq.extend({},r),qq.extend(t,l)):(t=qq.extend({},r),qq.extend(t,l),qq.extend(t,s),t[h.uuidName]=_(i),t[h.filenameParam]=p,b?t[h.totalFileSizeName]=f:h.paramsInBody||(t[h.inputName]=p)),h.paramsInBody||(c=qq.obj2url(t,c)),o.open(d,c,!0),h.cors.expected&&h.cors.sendCredentials&&(o.withCredentials=!0),b?(h.paramsInBody&&qq.obj2FormData(t,u),u.append(h.inputName,n),u):n}function f(e){var t=e.headerOverrides,n=e.id,i=e.xhr;if(t)qq.each(t,function(e,t){i.setRequestHeader(e,t)});else{var o=h.customHeaders.get(n),a=q.getFile(n);i.setRequestHeader("Accept","application/json"),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.setRequestHeader("Cache-Control","no-cache"),b||(i.setRequestHeader("Content-Type","application/octet-stream"),i.setRequestHeader("X-Mime-Type",a.type)),qq.each(o,function(e,t){i.setRequestHeader(e,t)})}}var q=this,m=n.getName,g=n.getSize,_=n.getUuid,o=n.log,b=h.forceMultipart||h.paramsInBody,a=new qq.traditional.AllChunksDoneAjaxRequester({cors:h.cors,endpoint:h.chunking.success.endpoint,headers:h.chunking.success.headers,jsonPayload:h.chunking.success.jsonPayload,log:o,method:h.chunking.success.method,params:h.chunking.success.params}),r=function(e,t){var n;return o("xhr - server response received for "+e),o("responseText = "+t.responseText),{success:!function(e,t){return qq.indexOf([200,201,202,203,204],e.status)<0||h.requireSuccessJson&&!t.success||t.reset}(t,n=s(!0,t)),response:n}},s=function(t,e){var n={};try{o(qq.format("Received response status {} with body: {}",e.status,e.responseText)),n=qq.parseJson(e.responseText)}catch(e){t&&h.requireSuccessJson&&o("Error when attempting to parse xhr response text ("+e.message+")","error")}return n};qq.extend(this,{uploadChunk:function(e){var t,n,i,o=e.id,a=e.chunkIdx,r=e.overrides||{},s=e.resuming,l=q._getChunkData(o,a),u=q._createXhr(o,a),d={};return t=c(o,u),q._registerProgressHandler(o,a,l.size),i=h.paramsStore.get(o),function(e,t,n){var i=g(e),o=m(e);h.omitDefaultParams||(t[h.chunking.paramNames.partIndex]=n.part,t[h.chunking.paramNames.partByteOffset]=n.start,t[h.chunking.paramNames.chunkSize]=n.size,t[h.chunking.paramNames.totalParts]=n.count,t[h.totalFileSizeName]=i),b&&!h.omitDefaultParams&&(t[h.filenameParam]=o)}(o,d,l),s&&(d[h.resume.paramNames.resuming]=!0),n=p({fileOrBlob:l.blob,id:o,customParams:i,params:d,xhr:u,xhrOverrides:r}),f({headerOverrides:r.headers,id:o,xhr:u}),u.send(n),t},uploadFile:function(e){var t,n,i,o,a=q.getFile(e);return n=q._createXhr(e),q._registerProgressHandler(e),t=c(e,n),i=h.paramsStore.get(e),o=p({fileOrBlob:a,id:e,customParams:i,xhr:n}),f({id:e,xhr:n}),n.send(o),t}}),qq.extend(this,new qq.XhrUploadHandler({options:qq.extend({namespace:"traditional"},h),proxy:qq.extend({getEndpoint:h.endpointStore.get},n)})),qq.override(this,function(t){return{finalizeChunks:function(e){return n.onFinalizing(e),h.chunking.success.endpoint?i(e):t.finalizeChunks(e,qq.bind(s,this,!0))}}})},qq.traditional.AllChunksDoneAjaxRequester=function(e){"use strict";var a,r={cors:{allowXdr:!1,expected:!1,sendCredentials:!1},endpoint:null,log:function(e,t){},method:"POST"},s={},t={get:function(e){return qq.isFunction(r.endpoint)?r.endpoint(e):r.endpoint}};qq.extend(r,e),a=qq.extend(this,new qq.AjaxRequester({acceptHeader:"application/json",contentType:r.jsonPayload?"application/json":"application/x-www-form-urlencoded",validMethods:[r.method],method:r.method,endpointStore:t,allowXRequestedWithAndCacheControl:!1,cors:r.cors,log:r.log,onComplete:function(e,t,n){var i=s[e];delete s[e],n?i.failure(t):i.success(t)}})),qq.extend(this,{complete:function(e,t,n,i){var o=new qq.Promise;return r.log("Submitting All Chunks Done request for "+e),s[e]=o,a.initTransport(e).withParams(r.params(e)||n).withHeaders(r.headers(e)||i).send(t),o}})},qq.DragAndDrop=function(e){"use strict";var a,i,o="qq-hidezones",r="qq-hide-dropzone",s=[],l=[],u=new qq.DisposeSupport;function d(t){var i=new qq.Promise;return t.isFile?t.file(function(e){e.qqPath=n(t),l.push(e),i.success()},function(e){a.callbacks.dropLog("Problem parsing '"+t.fullPath+"'.  FileError code "+e.code+".","error"),i.failure()}):t.isDirectory&&function n(i,e,o,t){var a=t||new qq.Promise,r=e||i.createReader();r.readEntries(function(e){var t=o?o.concat(e):e;e.length?setTimeout(function(){n(i,r,t,a)},0):a.success(t)},a.failure);return a}(t).then(function(e){var n=e.length;qq.each(e,function(e,t){d(t).done(function(){0===(n-=1)&&i.success()})}),e.length||i.success()},function(e){a.callbacks.dropLog("Problem parsing '"+t.fullPath+"'.  FileError code "+e.code+".","error"),i.failure()}),i}function n(e){var t=e.name,n=e.fullPath,i=n.lastIndexOf(t);return"/"===(n=n.substr(0,i)).charAt(0)&&(n=n.substr(1)),n}function c(t){var n=new qq.UploadDropZone({HIDE_ZONES_EVENT_NAME:o,element:t,onEnter:function(e){a.callbacks.handleDragOver(n),qq(t).addClass(a.classes.dropActive),e.stopPropagation()},onLeaveNotDescendants:function(e){a.callbacks.handleDragOut(n),qq(t).removeClass(a.classes.dropActive)},onDrop:function(e){a.callbacks.handleDragDrop(n),function(e,t){var i=[],o=new qq.Promise;return a.callbacks.processingDroppedFiles(),t.dropDisabled(!0),1<e.files.length&&!a.allowMultipleItems?(a.callbacks.processingDroppedFilesComplete([]),a.callbacks.dropError("tooManyFilesError",""),t.dropDisabled(!1),o.failure()):(l=[],qq.isFolderDropSupported(e)?qq.each(e.items,function(e,t){var n=t.webkitGetAsEntry();n&&(n.isFile?l.push(t.getAsFile()):i.push(d(n).done(function(){i.pop(),0===i.length&&o.success()})))}):l=e.files,0===i.length&&o.success()),o}(e.dataTransfer,n).then(function(){!function(e,t){var n=Array.prototype.slice.call(e);a.callbacks.dropLog("Grabbed "+e.length+" dropped files."),t.dropDisabled(!1),a.callbacks.processingDroppedFilesComplete(n,t.getElement())}(l,n)},function(){a.callbacks.dropLog("Drop event DataTransfer parsing failed.  No files will be uploaded.","error")})}});return u.addDisposer(function(){n.dispose()}),qq(t).hasAttribute(r)&&qq(t).hide(),s.push(n),n}function p(e){var n;return qq.each(e.dataTransfer.types,function(e,t){if("Files"===t)return!(n=!0)}),n}function t(){setTimeout(function(){qq.each(i,function(e,t){qq(t).hasAttribute(r)&&qq(t).hide(),qq(t).removeClass(a.classes.dropActive)})},10)}a={dropZoneElements:[],allowMultipleItems:!0,classes:{dropActive:null},callbacks:new qq.DragAndDrop.callbacks},qq.extend(a,e,!0),i=a.dropZoneElements,qq.each(i,function(e,t){var n=c(t);i.length&&qq.supportedFeatures.fileDrop&&u.attach(document,"dragenter",function(e){!n.dropDisabled()&&p(e)&&qq.each(i,function(e,t){t instanceof HTMLElement&&qq(t).hasAttribute(r)&&qq(t).css({display:"block"})})})}),u.attach(document,"dragleave",function(e){!function(e){return qq.safari()?e.x<0||e.y<0:0===e.x&&0===e.y}(e)||t()}),u.attach(qq(document).children()[0],"mouseenter",function(e){t()}),u.attach(document,"drop",function(e){p(e)&&(e.preventDefault(),t())}),u.attach(document,o,t),qq.extend(this,{setupExtraDropzone:function(e){a.dropZoneElements.push(e),c(e)},removeDropzone:function(e){var t,n=a.dropZoneElements;for(t in n)if(n[t]===e)return n.splice(t,1)},dispose:function(){u.dispose(),qq.each(s,function(e,t){t.dispose()})}}),this._testing={},this._testing.extractDirectoryPath=n},qq.DragAndDrop.callbacks=function(){"use strict";return{processingDroppedFiles:function(){},processingDroppedFilesComplete:function(e,t){},dropError:function(e,t){qq.log("Drag & drop error code '"+e+" with these specifics: '"+t+"'","error")},dropLog:function(e,t){qq.log(e,t)},handleDragOver:function(e){},handleDragOut:function(e){},handleDragDrop:function(e){}}},qq.UploadDropZone=function(e){"use strict";var n,t,i,o,a=new qq.DisposeSupport;function r(e){if(!qq.supportedFeatures.fileDrop)return!1;var t,n=e.dataTransfer,i=qq.safari();return t=!(!qq.ie()||!qq.supportedFeatures.fileDrop)||"none"!==n.effectAllowed,n&&t&&(n.files&&n.files.length||!i&&n.types.contains&&n.types.contains("Files")||n.types.includes&&n.types.includes("Files"))}function s(e){return void 0!==e&&(i=e),i}n={element:null,onEnter:function(e){},onLeave:function(e){},onLeaveNotDescendants:function(e){},onDrop:function(e){}},qq.extend(n,e),t=n.element,o||(a.attach(document,"dragover",function(e){e.preventDefault()}),o=!0),a.attach(t,"dragover",function(e){if(r(e)){var t=qq.ie()&&qq.supportedFeatures.fileDrop?null:e.dataTransfer.effectAllowed;e.dataTransfer.dropEffect="move"===t||"linkMove"===t?"move":"copy",e.stopPropagation(),e.preventDefault()}}),a.attach(t,"dragenter",function(e){if(!s()){if(!r(e))return;n.onEnter(e)}}),a.attach(t,"dragleave",function(e){if(r(e)){n.onLeave(e);var t=document.elementFromPoint(e.clientX,e.clientY);qq(this).contains(t)||n.onLeaveNotDescendants(e)}}),a.attach(t,"drop",function(e){if(!s()){if(!r(e))return;e.preventDefault(),e.stopPropagation(),n.onDrop(e),function(){var e;function t(){(e=document.createEvent("Event")).initEvent(n.HIDE_ZONES_EVENT_NAME,!0,!0)}if(window.CustomEvent)try{e=new CustomEvent(n.HIDE_ZONES_EVENT_NAME)}catch(e){t()}else t();document.dispatchEvent(e)}()}}),qq.extend(this,{dropDisabled:function(e){return s(e)},dispose:function(){a.dispose()},getElement:function(){return t}}),this._testing={},this._testing.isValidFileDrag=r},function(){"use strict";qq.uiPublicApi={addInitialFiles:function(e){this._parent.prototype.addInitialFiles.apply(this,arguments),this._templating.addCacheToDom()},clearStoredFiles:function(){this._parent.prototype.clearStoredFiles.apply(this,arguments),this._templating.clearFiles()},addExtraDropzone:function(e){this._dnd&&this._dnd.setupExtraDropzone(e)},removeExtraDropzone:function(e){if(this._dnd)return this._dnd.removeDropzone(e)},getItemByFileId:function(e){if(!this._templating.isHiddenForever(e))return this._templating.getFileContainer(e)},reset:function(){this._parent.prototype.reset.apply(this,arguments),this._templating.reset(),!this._options.button&&this._templating.getButton()&&(this._defaultButtonId=this._createUploadButton({element:this._templating.getButton(),title:this._options.text.fileInputTitle}).getButtonId()),this._dnd&&(this._dnd.dispose(),this._dnd=this._setupDragAndDrop()),this._totalFilesInBatch=0,this._filesInBatchAddedToUi=0,this._setupClickAndEditEventHandlers()},setName:function(e,t){var n=this._options.formatFileName(t);this._parent.prototype.setName.apply(this,arguments),this._templating.updateFilename(e,n)},pauseUpload:function(e){var t=this._parent.prototype.pauseUpload.apply(this,arguments);return t&&this._templating.uploadPaused(e),t},continueUpload:function(e){var t=this._parent.prototype.continueUpload.apply(this,arguments);return t&&this._templating.uploadContinued(e),t},getId:function(e){return this._templating.getFileId(e)},getDropTarget:function(e){return this.getFile(e).qqDropTarget}},qq.uiPrivateApi={_getButton:function(e){var t=this._parent.prototype._getButton.apply(this,arguments);return t||e===this._defaultButtonId&&(t=this._templating.getButton()),t},_removeFileItem:function(e){this._templating.removeFile(e)},_setupClickAndEditEventHandlers:function(){this._fileButtonsClickHandler=qq.FileButtonsClickHandler&&this._bindFileButtonsClickEvent(),this._focusinEventSupported=!qq.firefox(),this._isEditFilenameEnabled()&&(this._filenameClickHandler=this._bindFilenameClickEvent(),this._filenameInputFocusInHandler=this._bindFilenameInputFocusInEvent(),this._filenameInputFocusHandler=this._bindFilenameInputFocusEvent())},_setupDragAndDrop:function(){var i=this,e=this._options.dragAndDrop.extraDropzones,t=this._templating,n=t.getDropZone();return n&&e.push(n),new qq.DragAndDrop({dropZoneElements:e,allowMultipleItems:this._options.multiple,classes:{dropActive:this._options.classes.dropActive},callbacks:{processingDroppedFiles:function(){t.showDropProcessing()},processingDroppedFilesComplete:function(e,n){t.hideDropProcessing(),qq.each(e,function(e,t){t.qqDropTarget=n}),e.length&&i.addFiles(e,null,null)},dropError:function(e,t){i._itemError(e,t)},dropLog:function(e,t){i.log(e,t)},handleDragOver:function(e){i._options.callbacks.onDropzoneDragOver(e)},handleDragOut:function(e){i._options.callbacks.onDropzoneDragOut(e)},handleDragDrop:function(e){i._options.callbacks.onDropzoneDragDrop(e)}}})},_bindFileButtonsClickEvent:function(){var n=this;return new qq.FileButtonsClickHandler({templating:this._templating,log:function(e,t){n.log(e,t)},onDeleteFile:function(e){n.deleteFile(e)},onCancel:function(e){n.cancel(e)},onRetry:function(e){n.retry(e)},onPause:function(e){n.pauseUpload(e)},onContinue:function(e){n.continueUpload(e)},onGetName:function(e){return n.getName(e)}})},_isEditFilenameEnabled:function(){return this._templating.isEditFilenamePossible()&&!this._options.autoUpload&&qq.FilenameClickHandler&&qq.FilenameInputFocusHandler&&qq.FilenameInputFocusHandler},_filenameEditHandler:function(){var n=this,o=this._templating;return{templating:o,log:function(e,t){n.log(e,t)},onGetUploadStatus:function(e){return n.getUploads({id:e}).status},onGetName:function(e){return n.getName(e)},onSetName:function(e,t){n.setName(e,t)},onEditingStatusChange:function(e,t){var n=qq(o.getEditInput(e)),i=qq(o.getFileContainer(e));t?(n.addClass("qq-editing"),o.hideFilename(e),o.hideEditIcon(e)):(n.removeClass("qq-editing"),o.showFilename(e),o.showEditIcon(e)),i.addClass("qq-temp").removeClass("qq-temp")}}},_onUploadStatusChange:function(e,t,n){this._parent.prototype._onUploadStatusChange.apply(this,arguments),this._isEditFilenameEnabled()&&this._templating.getFileContainer(e)&&n!==qq.status.SUBMITTED&&(this._templating.markFilenameEditable(e),this._templating.hideEditIcon(e)),t===qq.status.UPLOAD_RETRYING&&n===qq.status.UPLOADING?(this._templating.hideRetry(e),this._templating.setStatusText(e),qq(this._templating.getFileContainer(e)).removeClass(this._classes.retrying)):n===qq.status.UPLOAD_FAILED&&this._templating.hidePause(e)},_bindFilenameInputFocusInEvent:function(){var e=qq.extend({},this._filenameEditHandler());return new qq.FilenameInputFocusInHandler(e)},_bindFilenameInputFocusEvent:function(){var e=qq.extend({},this._filenameEditHandler());return new qq.FilenameInputFocusHandler(e)},_bindFilenameClickEvent:function(){var e=qq.extend({},this._filenameEditHandler());return new qq.FilenameClickHandler(e)},_storeForLater:function(e){this._parent.prototype._storeForLater.apply(this,arguments),this._templating.hideSpinner(e)},_onAllComplete:function(e,t){this._parent.prototype._onAllComplete.apply(this,arguments),this._templating.resetTotalProgress()},_onSubmit:function(e,t){var n=this.getFile(e);n&&n.qqPath&&this._options.dragAndDrop.reportDirectoryPaths&&this._paramsStore.addReadOnly(e,{qqpath:n.qqPath}),this._parent.prototype._onSubmit.apply(this,arguments),this._addToList(e,t)},_onSubmitted:function(e){this._isEditFilenameEnabled()&&(this._templating.markFilenameEditable(e),this._templating.showEditIcon(e),this._focusinEventSupported||this._filenameInputFocusHandler.addHandler(this._templating.getEditInput(e)))},_onProgress:function(e,t,n,i){this._parent.prototype._onProgress.apply(this,arguments),this._templating.updateProgress(e,n,i),0===i||100===Math.round(n/i*100)?(this._templating.hideCancel(e),this._templating.hidePause(e),this._templating.hideProgress(e),this._templating.setStatusText(e,this._options.text.waitingForResponse),this._displayFileSize(e)):this._displayFileSize(e,n,i)},_onTotalProgress:function(e,t){this._parent.prototype._onTotalProgress.apply(this,arguments),this._templating.updateTotalProgress(e,t)},_onComplete:function(t,e,n,i){var o=this._parent.prototype._onComplete.apply(this,arguments),a=this._templating,r=a.getFileContainer(t),s=this;function l(e){r&&(a.setStatusText(t),qq(r).removeClass(s._classes.retrying),a.hideProgress(t),s.getUploads({id:t}).status!==qq.status.UPLOAD_FAILED&&a.hideCancel(t),a.hideSpinner(t),e.success?s._markFileAsSuccessful(t):(qq(r).addClass(s._classes.fail),a.showCancel(t),a.isRetryPossible()&&!s._preventRetries[t]&&(qq(r).addClass(s._classes.retryable),a.showRetry(t)),s._controlFailureTextDisplay(t,e)))}return o instanceof qq.Promise?o.done(function(e){l(e)}):l(n),o},_markFileAsSuccessful:function(e){var t=this._templating;this._isDeletePossible()&&t.showDeleteButton(e),qq(t.getFileContainer(e)).addClass(this._classes.success),this._maybeUpdateThumbnail(e)},_onUploadPrep:function(e){this._parent.prototype._onUploadPrep.apply(this,arguments),this._templating.showSpinner(e)},_onUpload:function(e,t){var n=this._parent.prototype._onUpload.apply(this,arguments);return this._templating.showSpinner(e),n},_onUploadChunk:function(e,t){this._parent.prototype._onUploadChunk.apply(this,arguments),0<t.partIndex&&this._handler.isResumable(e)&&this._templating.allowPause(e)},_onCancel:function(e,t){this._parent.prototype._onCancel.apply(this,arguments),this._removeFileItem(e),0===this._getNotFinished()&&this._templating.resetTotalProgress()},_onBeforeAutoRetry:function(e){var t,n,i;this._parent.prototype._onBeforeAutoRetry.apply(this,arguments),this._showCancelLink(e),this._options.retry.showAutoRetryNote&&(t=this._autoRetries[e],n=this._options.retry.maxAutoAttempts,i=(i=this._options.retry.autoRetryNote.replace(/\{retryNum\}/g,t)).replace(/\{maxAuto\}/g,n),this._templating.setStatusText(e,i),qq(this._templating.getFileContainer(e)).addClass(this._classes.retrying))},_onBeforeManualRetry:function(e){return this._parent.prototype._onBeforeManualRetry.apply(this,arguments)?(this._templating.resetProgress(e),qq(this._templating.getFileContainer(e)).removeClass(this._classes.fail),this._templating.setStatusText(e),this._templating.showSpinner(e),this._showCancelLink(e),!0):(qq(this._templating.getFileContainer(e)).addClass(this._classes.retryable),this._templating.showRetry(e),!1)},_onSubmitDelete:function(e){var t=qq.bind(this._onSubmitDeleteSuccess,this);this._parent.prototype._onSubmitDelete.call(this,e,t)},_onSubmitDeleteSuccess:function(e,t,n){this._options.deleteFile.forceConfirm?this._showDeleteConfirm.apply(this,arguments):this._sendDeleteRequest.apply(this,arguments)},_onDeleteComplete:function(e,t,n){this._parent.prototype._onDeleteComplete.apply(this,arguments),this._templating.hideSpinner(e),n?(this._templating.setStatusText(e,this._options.deleteFile.deletingFailedText),this._templating.showDeleteButton(e)):this._removeFileItem(e)},_sendDeleteRequest:function(e,t,n){this._templating.hideDeleteButton(e),this._templating.showSpinner(e),this._templating.setStatusText(e,this._options.deleteFile.deletingStatusText),this._deleteHandler.sendDelete.apply(this,arguments)},_showDeleteConfirm:function(e,t,n){var i,o=this.getName(e),a=this._options.deleteFile.confirmMessage.replace(/\{filename\}/g,o),r=(t=this.getUuid(e),arguments),s=this;i=this._options.showConfirm(a),qq.isGenericPromise(i)?i.then(function(){s._sendDeleteRequest.apply(s,r)}):!1!==i&&s._sendDeleteRequest.apply(s,r)},_addToList:function(e,t,n){var i,o,a=0,r=this._handler.isProxied(e)&&this._options.scaling.hideScaled;this._options.display.prependFiles&&(1<this._totalFilesInBatch&&0<this._filesInBatchAddedToUi&&(a=this._filesInBatchAddedToUi-1),i={index:a}),n||(this._options.disableCancelForFormUploads&&!qq.supportedFeatures.ajaxUploading&&this._templating.disableCancel(),this._options.multiple||(o=this.getUploads({id:e}),this._handledProxyGroup=this._handledProxyGroup||o.proxyGroupId,o.proxyGroupId===this._handledProxyGroup&&o.proxyGroupId||(this._handler.cancelAll(),this._clearList(),this._handledProxyGroup=null))),n?(this._templating.addFileToCache(e,this._options.formatFileName(t),i,r),this._templating.updateThumbnail(e,this._thumbnailUrls[e],!0,this._options.thumbnails.customResizer)):(this._templating.addFile(e,this._options.formatFileName(t),i,r),this._templating.generatePreview(e,this.getFile(e),this._options.thumbnails.customResizer)),this._filesInBatchAddedToUi+=1,(n||this._options.display.fileSizeOnSubmit&&qq.supportedFeatures.ajaxUploading)&&this._displayFileSize(e)},_clearList:function(){this._templating.clearFiles(),this.clearStoredFiles()},_displayFileSize:function(e,t,n){var i=this.getSize(e),o=this._formatSize(i);0<=i&&(void 0!==t&&void 0!==n&&(o=this._formatProgress(t,n)),this._templating.updateSize(e,o))},_formatProgress:function(e,t){var n=this._options.text.formatProgress;function i(e,t){n=n.replace(e,t)}return i("{percent}",Math.round(e/t*100)),i("{total_size}",this._formatSize(t)),n},_controlFailureTextDisplay:function(e,t){var n,i,o;n=this._options.failedUploadTextDisplay.mode,i=this._options.failedUploadTextDisplay.responseProperty,"custom"===n?(o=(o=t[i])||this._options.text.failUpload,this._templating.setStatusText(e,o),this._options.failedUploadTextDisplay.enableTooltip&&this._showTooltip(e,o)):"default"===n?this._templating.setStatusText(e,this._options.text.failUpload):"none"!==n&&this.log("failedUploadTextDisplay.mode value of '"+n+"' is not valid","warn")},_showTooltip:function(e,t){this._templating.getFileContainer(e).title=t},_showCancelLink:function(e){this._options.disableCancelForFormUploads&&!qq.supportedFeatures.ajaxUploading||this._templating.showCancel(e)},_itemError:function(e,t,n){var i=this._parent.prototype._itemError.apply(this,arguments);this._options.showMessage(i)},_batchError:function(e){this._parent.prototype._batchError.apply(this,arguments),this._options.showMessage(e)},_setupPastePrompt:function(){var n=this;this._options.callbacks.onPasteReceived=function(){var e=n._options.paste.namePromptMessage,t=n._options.paste.defaultName;return n._options.showPrompt(e,t)}},_fileOrBlobRejected:function(e,t){this._totalFilesInBatch-=1,this._parent.prototype._fileOrBlobRejected.apply(this,arguments)},_prepareItemsForUpload:function(e,t,n){this._totalFilesInBatch=e.length,this._filesInBatchAddedToUi=0,this._parent.prototype._prepareItemsForUpload.apply(this,arguments)},_maybeUpdateThumbnail:function(e){var t=this._thumbnailUrls[e];this.getUploads({id:e}).status===qq.status.DELETED||!t&&!this._options.thumbnails.placeholders.waitUntilResponse&&qq.supportedFeatures.imagePreviews||this._templating.updateThumbnail(e,t,this._options.thumbnails.customResizer)},_addCannedFile:function(e){var t=this._parent.prototype._addCannedFile.apply(this,arguments);return this._addToList(t,this.getName(t),!0),this._templating.hideSpinner(t),this._templating.hideCancel(t),this._markFileAsSuccessful(t),t},_setSize:function(e,t){this._parent.prototype._setSize.apply(this,arguments),this._templating.updateSize(e,this._formatSize(t))},_sessionRequestComplete:function(){this._templating.addCacheToDom(),this._parent.prototype._sessionRequestComplete.apply(this,arguments)}}}(),qq.FineUploader=function(e,t){"use strict";var n=this;this._parent=t?qq[t].FineUploaderBasic:qq.FineUploaderBasic,this._parent.apply(this,arguments),qq.extend(this._options,{element:null,button:null,listElement:null,dragAndDrop:{extraDropzones:[],reportDirectoryPaths:!1},text:{formatProgress:"{percent}% of {total_size}",failUpload:"Upload failed",waitingForResponse:"Processing...",paused:"Paused"},template:"qq-template",classes:{retrying:"qq-upload-retrying",retryable:"qq-upload-retryable",success:"qq-upload-success",fail:"qq-upload-fail",editable:"qq-editable",hide:"qq-hide",dropActive:"qq-upload-drop-area-active"},failedUploadTextDisplay:{mode:"default",responseProperty:"error",enableTooltip:!0},messages:{tooManyFilesError:"You may only drop one file",unsupportedBrowser:"Unrecoverable error - this browser does not permit file uploading of any kind."},retry:{showAutoRetryNote:!0,autoRetryNote:"Retrying {retryNum}/{maxAuto}..."},deleteFile:{forceConfirm:!1,confirmMessage:"Are you sure you want to delete {filename}?",deletingStatusText:"Deleting...",deletingFailedText:"Delete failed"},display:{fileSizeOnSubmit:!1,prependFiles:!1},paste:{promptForName:!1,namePromptMessage:"Please name this image"},thumbnails:{customResizer:null,maxCount:0,placeholders:{waitUntilResponse:!1,notAvailablePath:null,waitingPath:null},timeBetweenThumbs:750},scaling:{hideScaled:!1},showMessage:function(e){if(n._templating.hasDialog("alert"))return n._templating.showDialog("alert",e);setTimeout(function(){window.alert(e)},0)},showConfirm:function(e){return n._templating.hasDialog("confirm")?n._templating.showDialog("confirm",e):window.confirm(e)},showPrompt:function(e,t){return n._templating.hasDialog("prompt")?n._templating.showDialog("prompt",e,t):window.prompt(e,t)}},!0),qq.extend(this._options,e,!0),this._templating=new qq.Templating({log:qq.bind(this.log,this),templateIdOrEl:this._options.template,containerEl:this._options.element,fileContainerEl:this._options.listElement,button:this._options.button,imageGenerator:this._imageGenerator,classes:{hide:this._options.classes.hide,editable:this._options.classes.editable},limits:{maxThumbs:this._options.thumbnails.maxCount,timeBetweenThumbs:this._options.thumbnails.timeBetweenThumbs},placeholders:{waitUntilUpdate:this._options.thumbnails.placeholders.waitUntilResponse,thumbnailNotAvailable:this._options.thumbnails.placeholders.notAvailablePath,waitingForThumbnail:this._options.thumbnails.placeholders.waitingPath},text:this._options.text}),this._options.workarounds.ios8SafariUploads&&qq.ios800()&&qq.iosSafari()?this._templating.renderFailure(this._options.messages.unsupportedBrowserIos8Safari):!qq.supportedFeatures.uploading||this._options.cors.expected&&!qq.supportedFeatures.uploadCors?this._templating.renderFailure(this._options.messages.unsupportedBrowser):(this._wrapCallbacks(),this._templating.render(),this._classes=this._options.classes,!this._options.button&&this._templating.getButton()&&(this._defaultButtonId=this._createUploadButton({element:this._templating.getButton(),title:this._options.text.fileInputTitle}).getButtonId()),this._setupClickAndEditEventHandlers(),qq.DragAndDrop&&qq.supportedFeatures.fileDrop&&(this._dnd=this._setupDragAndDrop()),this._options.paste.targetElement&&this._options.paste.promptForName&&(qq.PasteSupport?this._setupPastePrompt():this.log("Paste support module not found.","error")),this._totalFilesInBatch=0,this._filesInBatchAddedToUi=0)},qq.extend(qq.FineUploader.prototype,qq.basePublicApi),qq.extend(qq.FineUploader.prototype,qq.basePrivateApi),qq.extend(qq.FineUploader.prototype,qq.uiPublicApi),qq.extend(qq.FineUploader.prototype,qq.uiPrivateApi),qq.Templating=function(e){"use strict";function r(t){var n=new qq.Promise;return j.then(function(e){W(e,t),t.src?n.success():(t.src=e.src,t.onload=function(){t.onload=null,Z(t),n.success()})},function(){X(t),n.success()}),n}function s(){if(B.length){A=!0;var e=B.shift();e.update?Y(e):J(e)}else A=!1}function n(e){return G(M(e),L.cancel)}function d(e){return G(M(e),L.continueButton)}function p(e){return G(y,L[e+"Dialog"])}function c(e){return G(M(e),L.deleteButton)}function t(){return G(y,L.dropProcessing)}function i(e){return G(M(e),L.editNameIcon)}function o(e){return G(M(e),L.file)}function f(e){return G(M(e),L.pause)}function h(e){return null==e?G(y,L.totalProgressBarContainer)||G(y,L.totalProgressBar):G(M(e),L.progressBarContainer)||G(M(e),L.progressBar)}function q(e){return G(M(e),L.retry)}function m(e){return G(M(e),L.size)}function a(e){return G(M(e),L.spinner)}function l(e,t){var n=h(e),i=null==e?L.totalProgressBar:L.progressBar;n&&!qq(n).hasClass(i)&&(n=qq(n).getFirstByClass(i)),n&&(qq(n).css({width:t+"%"}),n.setAttribute("aria-valuenow",t))}var g,_,b,v,y,w,x,S,u,F,C,I="qq-file-id",E="qq-file-id-",D="qq-drop-area-text",P="qq-in-progress",k="qq-hidden-forever",T={content:document.createDocumentFragment(),map:{}},U=!1,R=0,A=!1,B=[],O=-1,N={log:null,limits:{maxThumbs:0,timeBetweenThumbs:750},templateIdOrEl:"qq-template",containerEl:null,fileContainerEl:null,button:null,imageGenerator:null,classes:{hide:"qq-hide",editable:"qq-editable"},placeholders:{waitUntilUpdate:!1,thumbnailNotAvailable:null,waitingForThumbnail:null},text:{paused:"Paused"}},L={button:"qq-upload-button-selector",alertDialog:"qq-alert-dialog-selector",dialogCancelButton:"qq-cancel-button-selector",confirmDialog:"qq-confirm-dialog-selector",dialogMessage:"qq-dialog-message-selector",dialogOkButton:"qq-ok-button-selector",promptDialog:"qq-prompt-dialog-selector",uploader:"qq-uploader-selector",drop:"qq-upload-drop-area-selector",list:"qq-upload-list-selector",progressBarContainer:"qq-progress-bar-container-selector",progressBar:"qq-progress-bar-selector",totalProgressBarContainer:"qq-total-progress-bar-container-selector",totalProgressBar:"qq-total-progress-bar-selector",file:"qq-upload-file-selector",spinner:"qq-upload-spinner-selector",size:"qq-upload-size-selector",cancel:"qq-upload-cancel-selector",pause:"qq-upload-pause-selector",continueButton:"qq-upload-continue-selector",deleteButton:"qq-upload-delete-selector",retry:"qq-upload-retry-selector",statusText:"qq-upload-status-text-selector",editFilenameInput:"qq-edit-filename-selector",editNameIcon:"qq-edit-filename-icon-selector",dropText:"qq-upload-drop-area-text-selector",dropProcessing:"qq-drop-processing-selector",dropProcessingSpinner:"qq-drop-processing-spinner-selector",thumbnail:"qq-thumbnail-selector"},z={},H=new qq.Promise,j=new qq.Promise,M=function(e){return T.map[e]||qq(w).getFirstByClass(E+e)},G=function(e,t){return e&&qq(e).getFirstByClass(t)},V=function(e){return x&&G(M(e),L.thumbnail)},X=function(e){e&&qq(e).addClass(N.classes.hide)},W=function(e,t){var n=e.style.maxWidth,i=e.style.maxHeight;i&&n&&!t.style.maxWidth&&!t.style.maxHeight&&qq(t).css({maxWidth:n,maxHeight:i})},Q=function(e,t){var n=z[e]||(new qq.Promise).failure(),i=new qq.Promise;return H.then(function(e){n.then(function(){i.success()},function(){W(e,t),t.onload=function(){t.onload=null,i.success()},t.src=e.src,Z(t)})}),i},J=function(e){var t=e.id,n=e.optFileOrBlob,i=n&&n.qqThumbnailId,o=V(t),a={customResizeFunction:e.customResizeFunction,maxSize:O,orient:!0,scale:!0};qq.supportedFeatures.imagePreviews?o?N.limits.maxThumbs&&N.limits.maxThumbs<=R?(Q(t,o),s()):r(o).done(function(){z[t]=new qq.Promise,z[t].done(function(){setTimeout(s,N.limits.timeBetweenThumbs)}),null!=i?K(t,i):function(e,t,n){var i=V(e);g("Generating new thumbnail for "+e),t.qqThumbnailId=e,N.imageGenerator.generate(t,i,n).then(function(){R++,Z(i),z[e].success()},function(){z[e].failure(),N.placeholders.waitUntilUpdate||Q(e,i)})}(t,n,a)}):s():o&&(r(o),s())},Y=function(e){var t=e.id,n=e.thumbnailUrl,i=e.showWaitingImg,o=V(t),a={customResizeFunction:e.customResizeFunction,scale:S,maxSize:O};if(o)if(n){if(!(N.limits.maxThumbs&&N.limits.maxThumbs<=R))return i&&r(o),N.imageGenerator.generate(n,o,a).then(function(){Z(o),R++,setTimeout(s,N.limits.timeBetweenThumbs)},function(){Q(t,o),setTimeout(s,N.limits.timeBetweenThumbs)});Q(t,o),s()}else Q(t,o),s()},Z=function(e){e&&qq(e).removeClass(N.classes.hide)},K=function(e,t){var n=V(e),i=V(t);g(qq.format("ID {} is the same file as ID {}.  Will use generated thumbnail from ID {} instead.",e,t,t)),z[t].then(function(){R++,z[e].success(),g(qq.format("Now using previously generated thumbnail created for ID {} on ID {}.",t,e)),n.src=i.src,Z(n)},function(){z[e].failure(),N.placeholders.waitUntilUpdate||Q(e,n)})};qq.extend(N,e),g=N.log,qq.supportedFeatures.imagePreviews||(N.limits.timeBetweenThumbs=0,N.limits.maxThumbs=0),y=N.containerEl,x=void 0!==N.imageGenerator,v=function(){var e,t,n,i,o,a,r,s,l,u,d;if(g("Parsing template"),null==N.templateIdOrEl)throw new Error("You MUST specify either a template element or ID!");if(qq.isString(N.templateIdOrEl)){if(null===(e=document.getElementById(N.templateIdOrEl)))throw new Error(qq.format("Cannot find template script at ID '{}'!",N.templateIdOrEl));t=e.innerHTML}else{if(void 0===N.templateIdOrEl.innerHTML)throw new Error("You have specified an invalid value for the template option!  It must be an ID or an Element.");t=N.templateIdOrEl.innerHTML}if(t=qq.trimStr(t),(i=document.createElement("div")).appendChild(qq.toElement(t)),d=qq(i).getFirstByClass(L.uploader),N.button&&(a=qq(i).getFirstByClass(L.button))&&qq(a).remove(),qq.DragAndDrop&&qq.supportedFeatures.fileDrop||(l=qq(i).getFirstByClass(L.dropProcessing))&&qq(l).remove(),(r=qq(i).getFirstByClass(L.drop))&&!qq.DragAndDrop&&(g("DnD module unavailable.","info"),qq(r).remove()),qq.supportedFeatures.fileDrop?qq(d).hasAttribute(D)&&r&&(u=qq(r).getFirstByClass(L.dropText))&&qq(u).remove():(d.removeAttribute(D),r&&qq(r).hasAttribute("qq-hide-dropzone")&&qq(r).css({display:"none"})),s=qq(i).getFirstByClass(L.thumbnail),x?s&&(O=0<(O=parseInt(s.getAttribute("qq-max-size")))?O:null,S=qq(s).hasAttribute("qq-server-scale")):s&&qq(s).remove(),x=x&&s,_=0<qq(i).getByClass(L.editFilenameInput).length,b=0<qq(i).getByClass(L.retry).length,null==(n=qq(i).getFirstByClass(L.list)))throw new Error("Could not find the file list container in the template!");return o=n.children[0].cloneNode(!0),n.innerHTML="",i.getElementsByTagName("DIALOG").length&&document.createElement("dialog"),g("Template parsing complete"),{template:i,fileTemplate:o}}(),u=N.placeholders.thumbnailNotAvailable,F=N.placeholders.waitingForThumbnail,C={maxSize:O,scale:S},x&&(u?N.imageGenerator.generate(u,new Image,C).then(function(e){H.success(e)},function(){H.failure(),g("Problem loading 'not available' placeholder image at "+u,"error")}):H.failure(),F?N.imageGenerator.generate(F,new Image,C).then(function(e){j.success(e)},function(){j.failure(),g("Problem loading 'waiting for thumbnail' placeholder image at "+F,"error")}):j.failure()),qq.extend(this,{render:function(){g("Rendering template in DOM."),R=0,y.appendChild(v.template.cloneNode(!0)),X(t()),this.hideTotalProgress(),w=N.fileContainerEl||G(y,L.list),g("Template rendering complete")},renderFailure:function(e){var t=qq.toElement(e);y.innerHTML="",y.appendChild(t)},reset:function(){y.innerHTML="",this.render()},clearFiles:function(){w.innerHTML=""},disableCancel:function(){U=!0},addFile:function(e,t,n,i,o){var a,r=v.fileTemplate.cloneNode(!0),s=G(r,L.file),l=G(y,L.uploader),u=o?T.content:w;o&&(T.map[e]=r),qq(r).addClass(E+e),l.removeAttribute(D),s&&(qq(s).setText(t),s.setAttribute("title",t)),r.setAttribute(I,e),n?function(e,t,n){var i=n,o=i.firstChild;0<t&&(o=qq(i).children()[t].nextSibling),i.insertBefore(e,o)}(r,n.index,u):u.appendChild(r),i?(r.style.display="none",qq(r).addClass(k)):(X(h(e)),X(m(e)),X(c(e)),X(q(e)),X(f(e)),X(d(e)),U&&this.hideCancel(e),(a=V(e))&&!a.src&&j.then(function(e){a.src=e.src,e.style.maxHeight&&e.style.maxWidth&&qq(a).css({maxHeight:e.style.maxHeight,maxWidth:e.style.maxWidth}),Z(a)}))},addFileToCache:function(e,t,n,i){this.addFile(e,t,n,i,!0)},addCacheToDom:function(){w.appendChild(T.content),T.content=document.createDocumentFragment(),T.map={}},removeFile:function(e){qq(M(e)).remove()},getFileId:function(e){var t=e;if(t){for(;null==t.getAttribute(I);)t=t.parentNode;return parseInt(t.getAttribute(I))}},getFileList:function(){return w},markFilenameEditable:function(e){var t=o(e);t&&qq(t).addClass(N.classes.editable)},updateFilename:function(e,t){var n=o(e);n&&(qq(n).setText(t),n.setAttribute("title",t))},hideFilename:function(e){X(o(e))},showFilename:function(e){Z(o(e))},isFileName:function(e){return qq(e).hasClass(L.file)},getButton:function(){return N.button||G(y,L.button)},hideDropProcessing:function(){X(t())},showDropProcessing:function(){Z(t())},getDropZone:function(){return G(y,L.drop)},isEditFilenamePossible:function(){return _},hideRetry:function(e){X(q(e))},isRetryPossible:function(){return b},showRetry:function(e){Z(q(e))},getFileContainer:function(e){return M(e)},showEditIcon:function(e){var t=i(e);t&&qq(t).addClass(N.classes.editable)},isHiddenForever:function(e){return qq(M(e)).hasClass(k)},hideEditIcon:function(e){var t=i(e);t&&qq(t).removeClass(N.classes.editable)},isEditIcon:function(e){return qq(e).hasClass(L.editNameIcon,!0)},getEditInput:function(e){return G(M(e),L.editFilenameInput)},isEditInput:function(e){return qq(e).hasClass(L.editFilenameInput,!0)},updateProgress:function(e,t,n){var i,o=h(e);o&&0<n&&(100===(i=Math.round(t/n*100))?X(o):Z(o),l(e,i))},updateTotalProgress:function(e,t){this.updateProgress(null,e,t)},hideProgress:function(e){var t=h(e);t&&X(t)},hideTotalProgress:function(){this.hideProgress()},resetProgress:function(e){l(e,0),this.hideTotalProgress(e)},resetTotalProgress:function(){this.resetProgress()},showCancel:function(e){if(!U){var t=n(e);t&&qq(t).removeClass(N.classes.hide)}},hideCancel:function(e){X(n(e))},isCancel:function(e){return qq(e).hasClass(L.cancel,!0)},allowPause:function(e){Z(f(e)),X(d(e))},uploadPaused:function(e){this.setStatusText(e,N.text.paused),this.allowContinueButton(e),X(a(e))},hidePause:function(e){X(f(e))},isPause:function(e){return qq(e).hasClass(L.pause,!0)},isContinueButton:function(e){return qq(e).hasClass(L.continueButton,!0)},allowContinueButton:function(e){Z(d(e)),X(f(e))},uploadContinued:function(e){this.setStatusText(e,""),this.allowPause(e),Z(a(e))},showDeleteButton:function(e){Z(c(e))},hideDeleteButton:function(e){X(c(e))},isDeleteButton:function(e){return qq(e).hasClass(L.deleteButton,!0)},isRetry:function(e){return qq(e).hasClass(L.retry,!0)},updateSize:function(e,t){var n=m(e);n&&(Z(n),qq(n).setText(t))},setStatusText:function(e,t){var n=G(M(e),L.statusText);n&&(null==t?qq(n).clearText():qq(n).setText(t))},hideSpinner:function(e){qq(M(e)).removeClass(P),X(a(e))},showSpinner:function(e){qq(M(e)).addClass(P),Z(a(e))},generatePreview:function(e,t,n){this.isHiddenForever(e)||(B.push({id:e,customResizeFunction:n,optFileOrBlob:t}),A||s())},updateThumbnail:function(e,t,n,i){this.isHiddenForever(e)||(B.push({customResizeFunction:i,update:!0,id:e,thumbnailUrl:t,showWaitingImg:n}),A||s())},hasDialog:function(e){return qq.supportedFeatures.dialogElement&&!!p(e)},showDialog:function(e,t,n){function i(){s.removeEventListener("click",d),l&&l.removeEventListener("click",c),u.failure()}var o=p(e),a=G(o,L.dialogMessage),r=o.getElementsByTagName("INPUT")[0],s=G(o,L.dialogCancelButton),l=G(o,L.dialogOkButton),u=new qq.Promise,d=function(){s.removeEventListener("click",d),o.close()},c=function(){o.removeEventListener("close",i),l.removeEventListener("click",c),o.close(),u.success(r&&r.value)};return o.addEventListener("close",i),s.addEventListener("click",d),l&&l.addEventListener("click",c),r&&(r.value=n),a.textContent=t,o.showModal(),u}})},qq.UiEventHandler=function(e,t){"use strict";var n=new qq.DisposeSupport,i={eventType:"click",attachTo:null,onHandled:function(e,t){}};function o(e){n.attach(e,i.eventType,function(e){var t=(e=e||window.event).target||e.srcElement;i.onHandled(t,e)})}qq.extend(this,{addHandler:function(e){o(e)},dispose:function(){n.dispose()}}),qq.extend(t,{getFileIdFromItem:function(e){return e.qqFileId},getDisposeSupport:function(){return n}}),qq.extend(i,e),i.attachTo&&o(i.attachTo)},qq.FileButtonsClickHandler=function(e){"use strict";var r={templating:null,log:function(e,t){},onDeleteFile:function(e){},onCancel:function(e){},onRetry:function(e){},onPause:function(e){},onContinue:function(e){},onGetName:function(e){}},t={cancel:function(e){r.onCancel(e)},retry:function(e){r.onRetry(e)},deleteButton:function(e){r.onDeleteFile(e)},pause:function(e){r.onPause(e)},continueButton:function(e){r.onContinue(e)}};qq.extend(r,e),r.eventType="click",r.onHandled=function(o,a){qq.each(t,function(e,t){var n,i=e.charAt(0).toUpperCase()+e.slice(1);if(r.templating["is"+i](o))return n=r.templating.getFileId(o),qq.preventDefault(a),r.log(qq.format("Detected valid file button click event on file '{}', ID: {}.",r.onGetName(n),n)),t(n),!1})},r.attachTo=r.templating.getFileList(),qq.extend(this,new qq.UiEventHandler(r,{}))},qq.FilenameClickHandler=function(e){"use strict";var i={},o={templating:null,log:function(e,t){},classes:{file:"qq-upload-file",editNameIcon:"qq-edit-filename-icon"},onGetUploadStatus:function(e){},onGetName:function(e){}};qq.extend(o,e),o.eventType="click",o.onHandled=function(e,t){if(o.templating.isFileName(e)||o.templating.isEditIcon(e)){var n=o.templating.getFileId(e);o.onGetUploadStatus(n)===qq.status.SUBMITTED&&(o.log(qq.format("Detected valid filename click event on file '{}', ID: {}.",o.onGetName(n),n)),qq.preventDefault(t),i.handleFilenameEdit(n,e,!0))}},qq.extend(this,new qq.FilenameEditHandler(o,i))},qq.FilenameInputFocusInHandler=function(e,i){"use strict";var o={templating:null,onGetUploadStatus:function(e){},log:function(e,t){}};i=i||{},o.eventType="focusin",o.onHandled=function(e,t){if(o.templating.isEditInput(e)){var n=o.templating.getFileId(e);o.onGetUploadStatus(n)===qq.status.SUBMITTED&&(o.log(qq.format("Detected valid filename input focus event on file '{}', ID: {}.",o.onGetName(n),n)),i.handleFilenameEdit(n,e))}},qq.extend(o,e),qq.extend(this,new qq.FilenameEditHandler(o,i))},qq.FilenameInputFocusHandler=function(e){"use strict";e.eventType="focus",e.attachTo=null,qq.extend(this,new qq.FilenameInputFocusInHandler(e,{}))},qq.FilenameEditHandler=function(e,o){"use strict";var a={templating:null,log:function(e,t){},onGetUploadStatus:function(e){},onGetName:function(e){},onSetName:function(e,t){},onEditingStatusChange:function(e,t){}};function r(e,t){var n,i=e.value;void 0!==i&&0<qq.trimStr(i).length&&(void 0!==(n=function(e){var t=a.onGetName(e);return qq.getExtension(t)}(t))&&(i=i+"."+n),a.onSetName(t,i)),a.onEditingStatusChange(t,!1)}qq.extend(a,e),a.attachTo=a.templating.getFileList(),qq.extend(this,new qq.UiEventHandler(a,o)),qq.extend(o,{handleFilenameEdit:function(e,t,n){var i=a.templating.getEditInput(e);a.onEditingStatusChange(e,!0),i.value=function(e){var t=a.onGetName(e),n=t.lastIndexOf(".");return 0<n&&(t=t.substr(0,n)),t}(e),n&&i.focus(),function(e,t){o.getDisposeSupport().attach(e,"blur",function(){r(e,t)})}(i,e),function(t,n){o.getDisposeSupport().attach(t,"keyup",function(e){13===(e.keyCode||e.which)&&r(t,n)})}(i,e)}})}}(window),jQuery(document).ready(function(){if(window.dndb={},window.init_uploader=function init_uploader(config){if("draggable"in document.createElement("span"))var button_text=config.draggable_button_text,file_uploader_note_text=config.draggable_note_text;else var button_text=config.nondraggable_button_text,file_uploader_note_text=config.nondraggable_note_text;window.dndb[config.fieldset_prefix+"url"]=config.quickupload_url,window.dndb[config.fieldset_prefix+"root_and_path"]=config.root_and_path,jQuery("#fm_dirtree input[type=radio]").click(function(){window.dndb[config.fieldset_prefix+"url"]=config.quickupload_url+"&root_and_path="+this.value+"&"+config.crumb_file,window.dndb[config.fieldset_prefix+"root_and_path"]=this.value,window.dndb[config.fieldset_prefix+"uploader"].setParams({root_and_path:window.dndb[config.fieldset_prefix+"root_and_path"]})}),config.link_owner&&(window.dndb[config.fieldset_prefix+"url"]+="&link_owner="+config.link_owner),config.fm_mode&&"file_select"==config.fm_mode&&(window.dndb[config.fieldset_prefix+"url"]+="&fm_mode="+config.fm_mode),window.dndb[config.fieldset_prefix+"uploader"]=new qq.FineUploader({debug:!1,request:{endpoint:window.dndb[config.fieldset_prefix+"url"],params:{root_and_path:window.dndb[config.fieldset_prefix+"root_and_path"]}},template:document.getElementById(config.fieldset_prefix+"qq-template"),element:document.getElementById(config.fieldset_prefix+"file-uploader"),listElement:document.querySelector(config.list_element),dragAndDrop:{extraDropzones:eval(config.extra_dropzones)},list_style:config.list_style,action:window.dndb[config.fieldset_prefix+"url"],sizeLimit:config.size_limit,messages:{typeError:config.msg_type_error,sizeError:config.msg_size_error,minSizeError:config.msg_min_size_error,emptyError:config.msg_empty_error,onLeave:config.msg_on_leave},text:{formatProgress:config.msg_format_progress,sizeSymbols:[config.size_symbol_kb,config.size_symbol_mb,config.size_symbol_gb,config.size_symbol_tb,config.size_symbol_pb,config.size_symbol_eb]},validation:{sizeLimit:config.validation_size_limit,allowedExtensions:config.allowed_extensions},callbacks:{onSubmit:function(e,t,n){var i={root_and_path:window.dndb[config.fieldset_prefix+"root_and_path"]};if(jQuery(n).hasClass("link_attachment_dropzone")){qq.extend(i,{link_position:"inline"})}this.setParams(i);var o=jQuery("#"+config.fieldset_prefix+config.table_id+" tr.noresults");o.length&&(""!=config.table_headers&&o.parent().parent().prepend(config.table_headers),o.remove()),setTimeout(function(){evo_link_fix_wrapper_height(config.fieldset_prefix),config.resize_frame&&(window.dndb.update_iframe_height(config.fieldset_prefix),jQuery(document).on("load","#"+config.fieldset_prefix+config.table_id+" img",function(){window.dndb.update_iframe_height(config.fieldset_prefix)}))},10)},onProgress:function(e,t,n,i){var o=jQuery("#"+config.fieldset_prefix+config.table_id+" tr[qq-file-id="+e+"] .progress-bar"),a=Math.round(n/i*100)+"%";o.get(0).style.width=a,o.text(a),config.resize_frame&&window.dndb.update_iframe_height(config.fieldset_prefix)},onDropzoneDragOver:function(e){jQuery(".qq-upload-button").addClass("qq-upload-button-dragover")},onDropzoneDragOut:function(e){jQuery(".qq-upload-button").removeClass("qq-upload-button-dragover")},onDropzoneDragDrop:function(e){jQuery(".qq-upload-button").removeClass("qq-upload-button-dragover")},onComplete:function(e,t,n,i,o){var a;null!=n&&(n.data.text&&(a=1==n.specialchars?htmlspecialchars_decode(n.data.text):n.data.text),a=base64_decode(a),"list"==config.list_style&&null!=n.data.status&&"rename"==n.data.status&&jQuery("#"+config.fieldset_prefix+config.table_id+" #saveBtn").show());if("table"==config.list_style){var r=jQuery("#"+config.fieldset_prefix+config.table_id+" tr[qq-file-id="+e+"]");if(null==n||null==n.data||"error"==n.data.status||"fatal"==n.data.status)r.find(".qq-upload-status").html('<span class="red">'+config.msg_upload_error+"</span>"),n.error?a=n.error:void 0!==a&&""!=a||(a=config.msg_dropped_connection),r.find(".qq-upload-file-selector").append(': <span class="text-danger result_error">'+a+"</span>"),r.find(".qq-upload-image-selector, td.size").prepend(config.warning_icon);else{var s=void 0!==n.data.link_ID?"link":"file",l=config.filename_before;""!=l&&(l=l.replace("$file_path$",n.data.path));var u="";n.data.select_link_button&&(u=n.data.select_link_button);var d="";""!=n.data.warning&&(d='<div class="orange">'+n.data.warning+"</div>");var c=void 0!==n.data.link_url?n.data.link_url:n.data.formatted_name;if(r.find(".qq-upload-checkbox").html(n.data.checkbox),"success"==n.data.status)config.display_status_success?r.find(".qq-upload-status-text-selector").html('<span class="green">'+config.msg_upload_ok+"</span>"):r.find(".qq-upload-status-text-selector").html(""),r.find(".qq-upload-image").html(a),r.find(".qq-upload-file-selector").html(l+u+'<input type="hidden" value="'+n.data.newpath+'" /><span class="fname">'+c+"</span>"+d),r.find(".qq-upload-size-selector").html(n.data.filesize),n.data.filetype&&r.find(".qq-upload-file-type").html(n.data.filetype),n.data.creator&&r.find(".qq-upload-file-creator").html(n.data.creator),null!=n.data.downloads&&r.find(".qq-upload-downloads").html(n.data.downloads),n.data.owner&&r.find(".fsowner").html(n.data.owner),n.data.group&&r.find(".fsgroup").html(n.data.group),n.data.file_date&&r.find(".fsdate").html(n.data.file_date),n.data.file_actions&&r.find(".actions").html(n.data.file_actions),jQuery("#evo_multi_file_selector").length&&jQuery("#evo_multi_file_selector").show();else if("rename"==n.data.status){var p='<span class="orange">'+config.msg_upload_confict+"</span>";"default"==config.status_conflict_place?r.find(".qq-upload-status-text-selector").html(p):r.find(".qq-upload-status-text-selector").html(""),r.find(".qq-upload-image").html(n.data.file),r.find(".qq-upload-image-selector").append(htmlspecialchars_decode(n.data.file)),r.find(".qq-upload-file-selector").html(l+u+'<input type="hidden" value="'+n.data.newpath+'" /><span class="fname">'+c+"</span>"+("before_button"==config.status_conflict_place?" - "+p:"")+' - <a href="#" class="'+config.button_class+' roundbutton_text_noicon qq-conflict-replace" old="'+n.data.old_rootrelpath+'" new="'+n.data.new_rootrelpath+'"><div>'+config.msg_replace_file+'</div><div style="display:none">'+config.msg_revert+"</div></a>"+d);var f=jQuery("#"+config.fieldset_prefix+config.table_id+' input[type=hidden][value="'+n.data.oldpath+'"]');0<f.length&&f.parent().append(' <span class="orange">'+config.msg_old_file+"</span>")}"link"==s&&(r.find(".qq-upload-link-id").html('<span data-order="'+n.data.link_order+'">'+n.data.link_ID+"</span>"),r.find(".qq-upload-image").html(n.data.link_preview),r.find(".qq-upload-link-actions").prepend(n.data.link_actions),void 0!==n.data.link_position&&r.find(".qq-upload-link-position").html(n.data.link_position)),init_colorbox(r.find('.qq-upload-image a[rel^="lightbox"]')),evo_link_sort_list(config.fieldset_prefix)}}else jQuery(window.dndb[config.fieldset_prefix+"uploader"].getItemByFileId(e)).append(a),null==n.data&&""!=n&&jQuery(window.dndb[config.fieldset_prefix+"uploader"].getItemByFileId(e)).append(n);if(config.resize_frame&&(window.dndb.update_iframe_height(config.fieldset_prefix),jQuery(document).on("load","#"+config.fieldset_prefix+config.table_id+" img",function(){window.dndb.update_iframe_height(config.fieldset_preifx)})),jQuery(o).hasClass("link_attachment_dropzone"))switch(n.data.filetype){case"image":case"video":case"audio":textarea_wrap_selection(o,"["+n.data.filetype+":"+n.data.link_ID+"]","",0)}},onCancel:function(e,t){"table"==config.list_style&&setTimeout(function(){var e=jQuery("#"+config.fieldset_prefix+config.table_id+" .filelist_tbody");if(!e.find("tr").length){var t=config.no_results;e.append(t)}},10)}}}),jQuery("div.qq-upload-button-selector > div, div.qq-upload-drop-area > div").html(button_text),config.resize_frame&&(window.dndb.update_iframe_height=function(e){var t=jQuery("#"+e+config.table_id).height();jQuery("#"+e+"attachments_fieldset_wrapper").css({height:t,"max-height":t})}),"table"==config.list_style&&jQuery(document).on("click","#"+config.fieldset_prefix+config.table_id+" .qq-conflict-replace",function(){var s=jQuery(this),l=s.children("div:first").is(":visible"),e=s.attr("old"),u=jQuery("#"+config.fieldset_prefix+config.table_id+' input[type=hidden][value="'+e+'"]'),d=0<u.length;s.hide();var c=s.parent().parent().children("td");return d&&(c=c.add(u.parent().parent().children("td"))),c.css("background","#FFFF00"),c.find("span.error").remove(),jQuery.ajax({type:"POST",url:htsrv_url+"async.php",data:{action:"conflict_files",fileroot_ID:config.fileroot_ID,path:config.path,oldfile:e.replace(/^(.+[\/:])?([^\/]+)$/,"$2"),newfile:s.attr("new").replace(/^(.+[\/:])?([^\/]+)$/,"$2"),format:config.conflict_file_format,crumb_conflictfiles:config.crumb_conflictfiles},success:function(e){var t=jQuery.parseJSON(e);if(void 0===t.error){s.show();var n=s.parent().find("span.fname");if(l?(s.children("div:first").hide(),s.children("div:last").show()):(s.children("div:first").show(),s.children("div:last").hide()),d){var i=u.parent().find("span.fname"),o=i.html();i.html(n.html()),n.html(o);var a=i.prev();if(0!=a.length&&"A"==a.get(0).tagName||(a=i.parent().prev()),0<a.length&&"A"==a.get(0).tagName){var r=a.attr("href");a.attr("href",n.prev().attr("href")),n.prev().attr("href",r)}}else n.html(l?t.old:t.new)}else s.show(),s.parent().append('<span class="error"> - '+t.error+"</span>");c.css("background","")}}),!1}),config.display_support_msg&&document.write('<p class="note">'+file_uploader_note_text+"</p>")},"undefined"!=typeof evo_init_dragdrop_button_config)for(var evo_init_dragdrop_button_config_keys=Object.keys(evo_init_dragdrop_button_config),i=0;i<evo_init_dragdrop_button_config_keys.length;i++)window.init_uploader(evo_init_dragdrop_button_config[evo_init_dragdrop_button_config_keys[i]])}),jQuery(document).ready(function(){if("undefined"!=typeof evo_link_initialize_fieldset_config)for(var e=Object.values(evo_link_initialize_fieldset_config),t=0;t<e.length;t++)window.evo_link_initialize_fieldset(e[t].fieldset_prefix)});